@opengis/form 0.0.15 → 0.0.17

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 (288) hide show
  1. package/dist/{emitter → core/src/emitter}/eventBus.d.ts +1 -1
  2. package/dist/core/src/emitter/eventBus.d.ts.map +1 -0
  3. package/dist/form/src/components/behavior.vue.d.ts.map +1 -0
  4. package/dist/{components → form/src/components}/container-views/index.d.ts.map +1 -1
  5. package/dist/form/src/components/container-views/vs-container-accordion.vue.d.ts.map +1 -0
  6. package/dist/form/src/components/container-views/vs-container-default.vue.d.ts.map +1 -0
  7. package/dist/form/src/components/container-views/vs-container-switcher.vue.d.ts.map +1 -0
  8. package/dist/{components → form/src/components}/form/vs-compact-form.vue.d.ts +8 -1
  9. package/dist/form/src/components/form/vs-compact-form.vue.d.ts.map +1 -0
  10. package/dist/form/src/components/icons/icon-arrow-top-bottom.vue.d.ts.map +1 -0
  11. package/dist/form/src/components/icons/icon-check.vue.d.ts.map +1 -0
  12. package/dist/form/src/components/icons/icon-chevron-down.vue.d.ts.map +1 -0
  13. package/dist/form/src/components/icons/icon-chevron-top-bottom.vue.d.ts.map +1 -0
  14. package/dist/form/src/components/icons/icon-close.vue.d.ts.map +1 -0
  15. package/dist/form/src/components/icons/icon-csv.vue.d.ts.map +1 -0
  16. package/dist/form/src/components/icons/icon-delete.vue.d.ts.map +1 -0
  17. package/dist/form/src/components/icons/icon-download.vue.d.ts.map +1 -0
  18. package/dist/form/src/components/icons/icon-export.vue.d.ts.map +1 -0
  19. package/dist/form/src/components/icons/icon-file.vue.d.ts.map +1 -0
  20. package/dist/form/src/components/icons/icon-geojson.vue.d.ts.map +1 -0
  21. package/dist/form/src/components/icons/icon-grip-vertical.vue.d.ts.map +1 -0
  22. package/dist/form/src/components/icons/icon-import.vue.d.ts.map +1 -0
  23. package/dist/form/src/components/icons/icon-info.vue.d.ts.map +1 -0
  24. package/dist/form/src/components/icons/icon-magnifying-glass.vue.d.ts.map +1 -0
  25. package/dist/form/src/components/icons/icon-no-data.vue.d.ts.map +1 -0
  26. package/dist/form/src/components/icons/icon-pdf.vue.d.ts.map +1 -0
  27. package/dist/form/src/components/icons/icon-pen.vue.d.ts.map +1 -0
  28. package/dist/form/src/components/icons/icon-plus.vue.d.ts.map +1 -0
  29. package/dist/form/src/components/icons/icon-upload.vue.d.ts.map +1 -0
  30. package/dist/form/src/components/icons/icon-zip.vue.d.ts.map +1 -0
  31. package/dist/form/src/components/icons/index.d.ts.map +1 -0
  32. package/dist/{components → form/src/components}/inputs/base/vs-input-email.vue.d.ts +2 -2
  33. package/dist/form/src/components/inputs/base/vs-input-email.vue.d.ts.map +1 -0
  34. package/dist/{components → form/src/components}/inputs/base/vs-input-mask.vue.d.ts +3 -4
  35. package/dist/form/src/components/inputs/base/vs-input-mask.vue.d.ts.map +1 -0
  36. package/dist/{components → form/src/components}/inputs/base/vs-input-number.vue.d.ts +1 -1
  37. package/dist/form/src/components/inputs/base/vs-input-number.vue.d.ts.map +1 -0
  38. package/dist/form/src/components/inputs/base/vs-input-static.vue.d.ts +8 -0
  39. package/dist/form/src/components/inputs/base/vs-input-static.vue.d.ts.map +1 -0
  40. package/dist/{components → form/src/components}/inputs/base/vs-input-switcher.vue.d.ts +7 -6
  41. package/dist/form/src/components/inputs/base/vs-input-switcher.vue.d.ts.map +1 -0
  42. package/dist/{components → form/src/components}/inputs/base/vs-input-text.vue.d.ts +2 -2
  43. package/dist/form/src/components/inputs/base/vs-input-text.vue.d.ts.map +1 -0
  44. package/dist/{components → form/src/components}/inputs/base/vs-input-textarea.vue.d.ts +2 -2
  45. package/dist/form/src/components/inputs/base/vs-input-textarea.vue.d.ts.map +1 -0
  46. package/dist/{components → form/src/components}/inputs/date/vs-date-text.vue.d.ts +1 -2
  47. package/dist/form/src/components/inputs/date/vs-date-text.vue.d.ts.map +1 -0
  48. package/dist/{components → form/src/components}/inputs/date/vs-input-date.vue.d.ts +8 -8
  49. package/dist/form/src/components/inputs/date/vs-input-date.vue.d.ts.map +1 -0
  50. package/dist/{components → form/src/components}/inputs/date/vs-input-date1.vue.d.ts +2 -2
  51. package/dist/form/src/components/inputs/date/vs-input-date1.vue.d.ts.map +1 -0
  52. package/dist/{components → form/src/components}/inputs/date/vs-input-time.vue.d.ts +2 -2
  53. package/dist/form/src/components/inputs/date/vs-input-time.vue.d.ts.map +1 -0
  54. package/dist/{components → form/src/components}/inputs/file/vs-input-file-list-item.vue.d.ts +2 -2
  55. package/dist/form/src/components/inputs/file/vs-input-file-list-item.vue.d.ts.map +1 -0
  56. package/dist/{components → form/src/components}/inputs/file/vs-input-file.vue.d.ts +2 -2
  57. package/dist/form/src/components/inputs/file/vs-input-file.vue.d.ts.map +1 -0
  58. package/dist/form/src/components/inputs/file-list/vs-input-file-list.vue.d.ts +11 -0
  59. package/dist/form/src/components/inputs/file-list/vs-input-file-list.vue.d.ts.map +1 -0
  60. package/dist/form/src/components/inputs/file-list/vs-widget-file-info.vue.d.ts.map +1 -0
  61. package/dist/{components → form/src/components}/inputs/file-list/vs-widget-file-item.vue.d.ts +1 -1
  62. package/dist/form/src/components/inputs/file-list/vs-widget-file-item.vue.d.ts.map +1 -0
  63. package/dist/{components → form/src/components}/inputs/index.d.ts +67 -45
  64. package/dist/{components → form/src/components}/inputs/index.d.ts.map +1 -1
  65. package/dist/form/src/components/inputs/map/icons/icon-compass.vue.d.ts.map +1 -0
  66. package/dist/form/src/components/inputs/map/icons/icon-full-screen.vue.d.ts.map +1 -0
  67. package/dist/form/src/components/inputs/map/icons/icon-line.vue.d.ts.map +1 -0
  68. package/dist/form/src/components/inputs/map/icons/icon-map-pin.vue.d.ts.map +1 -0
  69. package/dist/form/src/components/inputs/map/icons/icon-poligon-rectangle.vue.d.ts.map +1 -0
  70. package/dist/form/src/components/inputs/map/icons/icon-poligon.vue.d.ts.map +1 -0
  71. package/dist/form/src/components/inputs/map/map-layers.vue.d.ts.map +1 -0
  72. package/dist/form/src/components/inputs/map/map-search.vue.d.ts.map +1 -0
  73. package/dist/{components → form/src/components}/inputs/map/map.d.ts +1 -0
  74. package/dist/form/src/components/inputs/map/map.d.ts.map +1 -0
  75. package/dist/form/src/components/inputs/map/util.d.ts +3 -0
  76. package/dist/form/src/components/inputs/map/util.d.ts.map +1 -0
  77. package/dist/form/src/components/inputs/map/vs-input-map.vue.d.ts.map +1 -0
  78. package/dist/{components → form/src/components}/inputs/options/checkbox/index.d.ts +1 -1
  79. package/dist/form/src/components/inputs/options/checkbox/index.d.ts.map +1 -0
  80. package/dist/{components → form/src/components}/inputs/options/checkbox/vs-checkbox-buttons.vue.d.ts +1 -1
  81. package/dist/form/src/components/inputs/options/checkbox/vs-checkbox-buttons.vue.d.ts.map +1 -0
  82. package/dist/{components → form/src/components}/inputs/options/checkbox/vs-checkbox-default.vue.d.ts +2 -2
  83. package/dist/form/src/components/inputs/options/checkbox/vs-checkbox-default.vue.d.ts.map +1 -0
  84. package/dist/{components → form/src/components}/inputs/options/checkbox/vs-input-checkbox-item.vue.d.ts +4 -4
  85. package/dist/form/src/components/inputs/options/checkbox/vs-input-checkbox-item.vue.d.ts.map +1 -0
  86. package/dist/form/src/components/inputs/options/checkbox/vs-input-checkbox.vue.d.ts +14 -0
  87. package/dist/form/src/components/inputs/options/checkbox/vs-input-checkbox.vue.d.ts.map +1 -0
  88. package/dist/{components → form/src/components}/inputs/options/radio/index.d.ts +12 -0
  89. package/dist/form/src/components/inputs/options/radio/index.d.ts.map +1 -0
  90. package/dist/{components → form/src/components}/inputs/options/radio/vs-input-radio-buttons.vue.d.ts +4 -1
  91. package/dist/form/src/components/inputs/options/radio/vs-input-radio-buttons.vue.d.ts.map +1 -0
  92. package/dist/{components → form/src/components}/inputs/options/radio/vs-input-radio-default.vue.d.ts +4 -1
  93. package/dist/form/src/components/inputs/options/radio/vs-input-radio-default.vue.d.ts.map +1 -0
  94. package/dist/{components → form/src/components}/inputs/options/radio/vs-input-radio.vue.d.ts +2 -2
  95. package/dist/form/src/components/inputs/options/radio/vs-input-radio.vue.d.ts.map +1 -0
  96. package/dist/{components → form/src/components}/inputs/table/vs-input-datatable.vue.d.ts +2 -2
  97. package/dist/form/src/components/inputs/table/vs-input-datatable.vue.d.ts.map +1 -0
  98. package/dist/form/src/components/inputs/tag/vs-input-tag.vue.d.ts +20 -0
  99. package/dist/form/src/components/inputs/tag/vs-input-tag.vue.d.ts.map +1 -0
  100. package/dist/{components → form/src/components}/inputs/vs-input-container.vue.d.ts +1 -1
  101. package/dist/form/src/components/inputs/vs-input-container.vue.d.ts.map +1 -0
  102. package/dist/form/src/components/inputs/vs-input-select.vue.d.ts +27 -0
  103. package/dist/form/src/components/inputs/vs-input-select.vue.d.ts.map +1 -0
  104. package/dist/{components → form/src/components}/layouts/index.d.ts +9 -9
  105. package/dist/form/src/components/layouts/index.d.ts.map +1 -0
  106. package/dist/{components → form/src/components}/layouts/vs-compact-form-layout.vue.d.ts +5 -5
  107. package/dist/form/src/components/layouts/vs-compact-form-layout.vue.d.ts.map +1 -0
  108. package/dist/{components → form/src/components}/layouts/vs-layout-default.vue.d.ts +1 -1
  109. package/dist/form/src/components/layouts/vs-layout-default.vue.d.ts.map +1 -0
  110. package/dist/{components → form/src/components}/layouts/vs-layout-horizontal.vue.d.ts +1 -1
  111. package/dist/form/src/components/layouts/vs-layout-horizontal.vue.d.ts.map +1 -0
  112. package/dist/{components → form/src/components}/layouts/vs-layout-inline.vue.d.ts +1 -1
  113. package/dist/form/src/components/layouts/vs-layout-inline.vue.d.ts.map +1 -0
  114. package/dist/form/src/components/modal/modal-edit.vue.d.ts.map +1 -0
  115. package/dist/form/src/components/ui/vs-calendar.vue.d.ts.map +1 -0
  116. package/dist/form/src/components/ui/vs-popover.vue.d.ts.map +1 -0
  117. package/dist/form/src/composables/useForm.d.ts.map +1 -0
  118. package/dist/{composables → form/src/composables}/useStyle.d.ts +1 -1
  119. package/dist/form/src/composables/useStyle.d.ts.map +1 -0
  120. package/dist/{index.d.ts → form/src/index.d.ts} +1 -0
  121. package/dist/form/src/index.d.ts.map +1 -0
  122. package/dist/form/src/plugin/form-plugin.d.ts.map +1 -0
  123. package/dist/{schema.d.ts → form/src/schema.d.ts} +130 -1
  124. package/dist/form/src/schema.d.ts.map +1 -0
  125. package/dist/{types → form/src/types}/form.d.ts +65 -30
  126. package/dist/form/src/types/form.d.ts.map +1 -0
  127. package/dist/{types → form/src/types}/rules.d.ts.map +1 -1
  128. package/dist/form/src/utils/convertForm.d.ts.map +1 -0
  129. package/dist/{utils → form/src/utils}/dynamicPosition.d.ts +1 -0
  130. package/dist/form/src/utils/dynamicPosition.d.ts.map +1 -0
  131. package/dist/form/src/utils/file.api.d.ts.map +1 -0
  132. package/dist/form/src/utils/file.preview.d.ts +3 -0
  133. package/dist/form/src/utils/file.preview.d.ts.map +1 -0
  134. package/dist/form/src/utils/formConditions.d.ts.map +1 -0
  135. package/dist/form/src/utils/formRules.d.ts.map +1 -0
  136. package/dist/form/src/utils/index.d.ts.map +1 -0
  137. package/dist/form/src/utils/randomId.d.ts +3 -0
  138. package/dist/form/src/utils/randomId.d.ts.map +1 -0
  139. package/dist/index.css +1 -1
  140. package/dist/index.js +1704 -2026
  141. package/dist/index.umd.cjs +2 -2
  142. package/package.json +8 -7
  143. package/dist/components/behavior.vue.d.ts.map +0 -1
  144. package/dist/components/container-views/vs-container-accordion.vue.d.ts.map +0 -1
  145. package/dist/components/container-views/vs-container-default.vue.d.ts.map +0 -1
  146. package/dist/components/container-views/vs-container-switcher.vue.d.ts.map +0 -1
  147. package/dist/components/form/vs-compact-form.vue.d.ts.map +0 -1
  148. package/dist/components/icons/icon-arrow-top-bottom.vue.d.ts.map +0 -1
  149. package/dist/components/icons/icon-check.vue.d.ts.map +0 -1
  150. package/dist/components/icons/icon-chevron-down.vue.d.ts.map +0 -1
  151. package/dist/components/icons/icon-chevron-top-bottom.vue.d.ts.map +0 -1
  152. package/dist/components/icons/icon-close.vue.d.ts.map +0 -1
  153. package/dist/components/icons/icon-csv.vue.d.ts.map +0 -1
  154. package/dist/components/icons/icon-delete.vue.d.ts.map +0 -1
  155. package/dist/components/icons/icon-download.vue.d.ts.map +0 -1
  156. package/dist/components/icons/icon-export.vue.d.ts.map +0 -1
  157. package/dist/components/icons/icon-file.vue.d.ts.map +0 -1
  158. package/dist/components/icons/icon-geojson.vue.d.ts.map +0 -1
  159. package/dist/components/icons/icon-grip-vertical.vue.d.ts.map +0 -1
  160. package/dist/components/icons/icon-import.vue.d.ts.map +0 -1
  161. package/dist/components/icons/icon-info.vue.d.ts.map +0 -1
  162. package/dist/components/icons/icon-magnifying-glass.vue.d.ts.map +0 -1
  163. package/dist/components/icons/icon-no-data.vue.d.ts.map +0 -1
  164. package/dist/components/icons/icon-pdf.vue.d.ts.map +0 -1
  165. package/dist/components/icons/icon-pen.vue.d.ts.map +0 -1
  166. package/dist/components/icons/icon-plus.vue.d.ts.map +0 -1
  167. package/dist/components/icons/icon-upload.vue.d.ts.map +0 -1
  168. package/dist/components/icons/icon-zip.vue.d.ts.map +0 -1
  169. package/dist/components/icons/index.d.ts.map +0 -1
  170. package/dist/components/inputs/base/vs-input-email.vue.d.ts.map +0 -1
  171. package/dist/components/inputs/base/vs-input-html.vue.d.ts +0 -6
  172. package/dist/components/inputs/base/vs-input-html.vue.d.ts.map +0 -1
  173. package/dist/components/inputs/base/vs-input-mask.vue.d.ts.map +0 -1
  174. package/dist/components/inputs/base/vs-input-number.vue.d.ts.map +0 -1
  175. package/dist/components/inputs/base/vs-input-static.vue.d.ts +0 -8
  176. package/dist/components/inputs/base/vs-input-static.vue.d.ts.map +0 -1
  177. package/dist/components/inputs/base/vs-input-switcher.vue.d.ts.map +0 -1
  178. package/dist/components/inputs/base/vs-input-text.vue.d.ts.map +0 -1
  179. package/dist/components/inputs/base/vs-input-textarea.vue.d.ts.map +0 -1
  180. package/dist/components/inputs/date/vs-date-text.vue.d.ts.map +0 -1
  181. package/dist/components/inputs/date/vs-input-date.vue.d.ts.map +0 -1
  182. package/dist/components/inputs/date/vs-input-date1.vue.d.ts.map +0 -1
  183. package/dist/components/inputs/date/vs-input-time.vue.d.ts.map +0 -1
  184. package/dist/components/inputs/file/vs-input-file-list-item.vue.d.ts.map +0 -1
  185. package/dist/components/inputs/file/vs-input-file.vue.d.ts.map +0 -1
  186. package/dist/components/inputs/file-list/vs-input-file-list.vue.d.ts +0 -10
  187. package/dist/components/inputs/file-list/vs-input-file-list.vue.d.ts.map +0 -1
  188. package/dist/components/inputs/file-list/vs-widget-file-info.vue.d.ts.map +0 -1
  189. package/dist/components/inputs/file-list/vs-widget-file-item.vue.d.ts.map +0 -1
  190. package/dist/components/inputs/map/icons/icon-compass.vue.d.ts.map +0 -1
  191. package/dist/components/inputs/map/icons/icon-full-screen.vue.d.ts.map +0 -1
  192. package/dist/components/inputs/map/icons/icon-line.vue.d.ts.map +0 -1
  193. package/dist/components/inputs/map/icons/icon-map-pin.vue.d.ts.map +0 -1
  194. package/dist/components/inputs/map/icons/icon-poligon-rectangle.vue.d.ts.map +0 -1
  195. package/dist/components/inputs/map/icons/icon-poligon.vue.d.ts.map +0 -1
  196. package/dist/components/inputs/map/map-layers.vue.d.ts.map +0 -1
  197. package/dist/components/inputs/map/map-search.vue.d.ts.map +0 -1
  198. package/dist/components/inputs/map/map.d.ts.map +0 -1
  199. package/dist/components/inputs/map/util.d.ts +0 -2
  200. package/dist/components/inputs/map/util.d.ts.map +0 -1
  201. package/dist/components/inputs/map/vs-input-map.vue.d.ts.map +0 -1
  202. package/dist/components/inputs/options/checkbox/index.d.ts.map +0 -1
  203. package/dist/components/inputs/options/checkbox/vs-checkbox-buttons.vue.d.ts.map +0 -1
  204. package/dist/components/inputs/options/checkbox/vs-checkbox-default.vue.d.ts.map +0 -1
  205. package/dist/components/inputs/options/checkbox/vs-input-checkbox-item.vue.d.ts.map +0 -1
  206. package/dist/components/inputs/options/checkbox/vs-input-checkbox.vue.d.ts +0 -15
  207. package/dist/components/inputs/options/checkbox/vs-input-checkbox.vue.d.ts.map +0 -1
  208. package/dist/components/inputs/options/radio/index.d.ts.map +0 -1
  209. package/dist/components/inputs/options/radio/vs-input-radio-buttons.vue.d.ts.map +0 -1
  210. package/dist/components/inputs/options/radio/vs-input-radio-default.vue.d.ts.map +0 -1
  211. package/dist/components/inputs/options/radio/vs-input-radio.vue.d.ts.map +0 -1
  212. package/dist/components/inputs/table/vs-input-datatable.vue.d.ts.map +0 -1
  213. package/dist/components/inputs/vs-input-container.vue.d.ts.map +0 -1
  214. package/dist/components/inputs/vs-input-select.vue.d.ts +0 -24
  215. package/dist/components/inputs/vs-input-select.vue.d.ts.map +0 -1
  216. package/dist/components/layouts/index.d.ts.map +0 -1
  217. package/dist/components/layouts/vs-compact-form-layout.vue.d.ts.map +0 -1
  218. package/dist/components/layouts/vs-layout-default.vue.d.ts.map +0 -1
  219. package/dist/components/layouts/vs-layout-horizontal.vue.d.ts.map +0 -1
  220. package/dist/components/layouts/vs-layout-inline.vue.d.ts.map +0 -1
  221. package/dist/components/modal/modal-edit.vue.d.ts.map +0 -1
  222. package/dist/components/ui/vs-calendar.vue.d.ts.map +0 -1
  223. package/dist/components/ui/vs-popover.vue.d.ts.map +0 -1
  224. package/dist/composables/useForm.d.ts.map +0 -1
  225. package/dist/composables/useStyle.d.ts.map +0 -1
  226. package/dist/emitter/eventBus.d.ts.map +0 -1
  227. package/dist/index.d.ts.map +0 -1
  228. package/dist/plugin/form-plugin.d.ts.map +0 -1
  229. package/dist/schema.d.ts.map +0 -1
  230. package/dist/types/form.d.ts.map +0 -1
  231. package/dist/utils/convertForm.d.ts.map +0 -1
  232. package/dist/utils/dynamicPosition.d.ts.map +0 -1
  233. package/dist/utils/file.api.d.ts.map +0 -1
  234. package/dist/utils/file.preview.d.ts +0 -2
  235. package/dist/utils/file.preview.d.ts.map +0 -1
  236. package/dist/utils/formConditions.d.ts.map +0 -1
  237. package/dist/utils/formRules.d.ts.map +0 -1
  238. package/dist/utils/index.d.ts.map +0 -1
  239. package/dist/utils/randomId.d.ts +0 -2
  240. package/dist/utils/randomId.d.ts.map +0 -1
  241. /package/dist/{components → form/src/components}/behavior.vue.d.ts +0 -0
  242. /package/dist/{components → form/src/components}/container-views/index.d.ts +0 -0
  243. /package/dist/{components → form/src/components}/container-views/vs-container-accordion.vue.d.ts +0 -0
  244. /package/dist/{components → form/src/components}/container-views/vs-container-default.vue.d.ts +0 -0
  245. /package/dist/{components → form/src/components}/container-views/vs-container-switcher.vue.d.ts +0 -0
  246. /package/dist/{components → form/src/components}/icons/icon-arrow-top-bottom.vue.d.ts +0 -0
  247. /package/dist/{components → form/src/components}/icons/icon-check.vue.d.ts +0 -0
  248. /package/dist/{components → form/src/components}/icons/icon-chevron-down.vue.d.ts +0 -0
  249. /package/dist/{components → form/src/components}/icons/icon-chevron-top-bottom.vue.d.ts +0 -0
  250. /package/dist/{components → form/src/components}/icons/icon-close.vue.d.ts +0 -0
  251. /package/dist/{components → form/src/components}/icons/icon-csv.vue.d.ts +0 -0
  252. /package/dist/{components → form/src/components}/icons/icon-delete.vue.d.ts +0 -0
  253. /package/dist/{components → form/src/components}/icons/icon-download.vue.d.ts +0 -0
  254. /package/dist/{components → form/src/components}/icons/icon-export.vue.d.ts +0 -0
  255. /package/dist/{components → form/src/components}/icons/icon-file.vue.d.ts +0 -0
  256. /package/dist/{components → form/src/components}/icons/icon-geojson.vue.d.ts +0 -0
  257. /package/dist/{components → form/src/components}/icons/icon-grip-vertical.vue.d.ts +0 -0
  258. /package/dist/{components → form/src/components}/icons/icon-import.vue.d.ts +0 -0
  259. /package/dist/{components → form/src/components}/icons/icon-info.vue.d.ts +0 -0
  260. /package/dist/{components → form/src/components}/icons/icon-magnifying-glass.vue.d.ts +0 -0
  261. /package/dist/{components → form/src/components}/icons/icon-no-data.vue.d.ts +0 -0
  262. /package/dist/{components → form/src/components}/icons/icon-pdf.vue.d.ts +0 -0
  263. /package/dist/{components → form/src/components}/icons/icon-pen.vue.d.ts +0 -0
  264. /package/dist/{components → form/src/components}/icons/icon-plus.vue.d.ts +0 -0
  265. /package/dist/{components → form/src/components}/icons/icon-upload.vue.d.ts +0 -0
  266. /package/dist/{components → form/src/components}/icons/icon-zip.vue.d.ts +0 -0
  267. /package/dist/{components → form/src/components}/icons/index.d.ts +0 -0
  268. /package/dist/{components → form/src/components}/inputs/file-list/vs-widget-file-info.vue.d.ts +0 -0
  269. /package/dist/{components → form/src/components}/inputs/map/icons/icon-compass.vue.d.ts +0 -0
  270. /package/dist/{components → form/src/components}/inputs/map/icons/icon-full-screen.vue.d.ts +0 -0
  271. /package/dist/{components → form/src/components}/inputs/map/icons/icon-line.vue.d.ts +0 -0
  272. /package/dist/{components → form/src/components}/inputs/map/icons/icon-map-pin.vue.d.ts +0 -0
  273. /package/dist/{components → form/src/components}/inputs/map/icons/icon-poligon-rectangle.vue.d.ts +0 -0
  274. /package/dist/{components → form/src/components}/inputs/map/icons/icon-poligon.vue.d.ts +0 -0
  275. /package/dist/{components → form/src/components}/inputs/map/map-layers.vue.d.ts +0 -0
  276. /package/dist/{components → form/src/components}/inputs/map/map-search.vue.d.ts +0 -0
  277. /package/dist/{components → form/src/components}/inputs/map/vs-input-map.vue.d.ts +0 -0
  278. /package/dist/{components → form/src/components}/modal/modal-edit.vue.d.ts +0 -0
  279. /package/dist/{components → form/src/components}/ui/vs-calendar.vue.d.ts +0 -0
  280. /package/dist/{components → form/src/components}/ui/vs-popover.vue.d.ts +0 -0
  281. /package/dist/{composables → form/src/composables}/useForm.d.ts +0 -0
  282. /package/dist/{plugin → form/src/plugin}/form-plugin.d.ts +0 -0
  283. /package/dist/{types → form/src/types}/rules.d.ts +0 -0
  284. /package/dist/{utils → form/src/utils}/convertForm.d.ts +0 -0
  285. /package/dist/{utils → form/src/utils}/file.api.d.ts +0 -0
  286. /package/dist/{utils → form/src/utils}/formConditions.d.ts +0 -0
  287. /package/dist/{utils → form/src/utils}/formRules.d.ts +0 -0
  288. /package/dist/{utils → form/src/utils}/index.d.ts +0 -0
@@ -1,2 +1,2 @@
1
- (function(q,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],t):(q=typeof globalThis<"u"?globalThis:q||self,t(q.FormBuilder={},q.Vue,q.OpenGISCore))})(this,function(q,t,ce){"use strict";const Xe={class:"w-full relative"},Qe={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},et={key:0,class:"text-red-500 text-[14px]"},tt={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},nt=t.defineComponent({__name:"vs-layout-default",props:{ua:{default:""},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(l){return(e,n)=>(t.openBlock(),t.createElementBlock("div",Xe,[e.ua||e.label?(t.openBlock(),t.createElementBlock("div",Qe,[t.createElementVNode("span",null,t.toDisplayString(e.ua||e.label),1),e.item?.rules?.includes("required")?(t.openBlock(),t.createElementBlock("span",et,"*")):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default",t.normalizeProps(t.guardReactiveProps(e.$attrs))),e.error?(t.openBlock(),t.createElementBlock("span",tt,t.toDisplayString(e.error),1)):t.createCommentVNode("",!0)]))}}),st={class:"w-full relative flex flex-row items-center gap-2"},ot={key:0,class:"text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"},at={key:0,class:"text-red-500 text-[14px]"},lt={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},rt=t.defineComponent({__name:"vs-layout-horizontal",props:{ua:{default:""},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(l){return(e,n)=>(t.openBlock(),t.createElementBlock("div",st,[e.item?.type!=="html"?(t.openBlock(),t.createElementBlock("span",ot,[t.createTextVNode(t.toDisplayString(e.ua||e.label)+" ",1),e.item?.rules?.includes("required")&&(e.ua||e.label)?(t.openBlock(),t.createElementBlock("span",at,"*")):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default",t.normalizeProps(t.guardReactiveProps(e.$attrs))),e.error?(t.openBlock(),t.createElementBlock("span",lt,t.toDisplayString(e.error),1)):t.createCommentVNode("",!0)]))}}),it={class:"w-full relative"},dt={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},ut={default:nt,horizontal:rt,inline:t.defineComponent({__name:"vs-layout-inline",props:{ua:{default:""},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(l){return(e,n)=>(t.openBlock(),t.createElementBlock("div",it,[t.renderSlot(e.$slots,"default",t.normalizeProps(t.guardReactiveProps(e.$attrs))),e.error?(t.openBlock(),t.createElementBlock("span",dt,t.toDisplayString(e.error),1)):t.createCommentVNode("",!0)]))}})};function W(l){return{inputClass:t.computed(()=>{const n=`disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${l?.primaryColor||"blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;return l?.size==="sm"?n+"h-[32px]":n+"h-[38px]"})}}const ct=["placeholder","disabled"],be=t.defineComponent({__name:"vs-input-text",props:t.mergeModels({style:{default:()=>({})},customClass:{default:""},placeholder:{default:""},disabled:{type:Boolean,default:!1},type:{},value:{},name:{},rules:{},error:{default:""},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,{inputClass:n}=W(e.style),s=t.useModel(l,"modelValue");return(o,a)=>t.withDirectives((t.openBlock(),t.createElementBlock("input",{type:"text","onUpdate:modelValue":a[0]||(a[0]=r=>s.value=r),placeholder:o.placeholder,disabled:o.disabled,class:t.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[t.unref(n),{"!border-red-600":o.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,ct)),[[t.vModelText,s.value]])}}),pt=["placeholder"],ht=t.defineComponent({__name:"vs-input-number",props:t.mergeModels({style:{default:()=>({})},customClass:{},placeholder:{default:""},disabled:{type:Boolean},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,{inputClass:n}=W(e.style),s=t.useModel(l,"modelValue");return(o,a)=>t.withDirectives((t.openBlock(),t.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":a[0]||(a[0]=r=>s.value=r),placeholder:o.placeholder,class:t.normalizeClass(["py-1.5 px-3 block w-full",[t.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,pt)),[[t.vModelText,s.value]])}}),F=(l,e)=>{const n=l.__vccOpts||l;for(const[s,o]of e)n[s]=o;return n},mt={},ft={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 gt(l,e){return t.openBlock(),t.createElementBlock("svg",ft,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const kt=F(mt,[["render",gt]]),yt={class:"flex items-center gap-[4px]"},xt=["value","id","disabled"],bt=["for"],_t={class:"text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400"},wt=t.defineComponent({__name:"vs-checkbox-default",props:{value:{default:""},label:{default:""},disabled:{type:Boolean,default:!1},id:{},modelValue:{default:""},info:{},error:{}},emits:["update:modelValue"],setup(l,{emit:e}){const n=e,s=l,o=t.computed({get:()=>s.modelValue,set:a=>n("update:modelValue",a)});return(a,r)=>(t.openBlock(),t.createElementBlock("div",yt,[t.withDirectives(t.createElementVNode("input",{type:"checkbox",value:a.value,"onUpdate:modelValue":r[0]||(r[0]=i=>o.value=i),class:t.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":a.disabled}]),id:a.id,disabled:a.disabled},null,10,xt),[[t.vModelCheckbox,o.value]]),t.createElementVNode("label",{for:a.id,class:t.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":a.disabled}])},[t.createElementVNode("div",{class:t.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[o.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",a.error?"border-red-600":""]])},[t.createVNode(kt,{height:"12",width:"12"})],2),t.createElementVNode("span",_t,[t.renderSlot(a.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(a.label),1)])])],10,bt)]))}}),Et=["name","value","disabled"],Bt={class:"flex items-center gap-[6px] text-[14px]"},Vt={key:0,class:"text-[16px]"},Ct=["src"],vt=t.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(l,{emit:e}){const n=l,s=e,o=t.computed({get:()=>n.modelValue,set:i=>{s("update:modelValue",i)}}),a=t.computed(()=>Array.isArray(o.value)?o.value.includes(n.value):o.value===!0||o.value===n.value),r=t.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)=>(t.openBlock(),t.createElementBlock("label",{class:t.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,a.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[t.withDirectives(t.createElementVNode("input",{type:"checkbox",class:"hidden",name:i.id,value:i.value,"onUpdate:modelValue":d[0]||(d[0]=c=>o.value=c),disabled:i.disabled},null,8,Et),[[t.vModelCheckbox,o.value]]),t.createElementVNode("span",Bt,[i.icon||i.imgUrl?(t.openBlock(),t.createElementBlock("span",Vt,[i.icon?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass(i.icon)},null,2)):t.createCommentVNode("",!0),i.imgUrl?(t.openBlock(),t.createElementBlock("img",{key:1,src:i.imgUrl,width:"16",height:"16",alt:"icon"},null,8,Ct)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.renderSlot(i.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(i.label),1)])])],2))}}),St={class:"flex items-center"},ve=t.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(l,{emit:e}){const n=l,s=e,o=`radio-${Math.floor(Math.random()*1e4)}`,a=t.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=t.ref(`vs-checkbox-${n.view||"default"}`);return(i,d)=>(t.openBlock(),t.createElementBlock("div",St,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.value==="vs-checkbox-buttons"?t.unref(vt):t.unref(wt)),{value:i.value,label:i.label,info:i.option?.info,disabled:i.disabled,modelValue:a.value,"onUpdate:modelValue":d[0]||(d[0]=c=>a.value=c),id:o,icon:i.icon,imgUrl:i.imgUrl,style:t.normalizeStyle(i.style),error:i.error},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(i.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))]))}}),Mt={},Ft={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 Nt(l,e){return t.openBlock(),t.createElementBlock("svg",Ft,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const At=F(Mt,[["render",Nt]]),$t={},Dt={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 It(l,e){return t.openBlock(),t.createElementBlock("svg",Dt,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M12 9h.01"},null,-1),t.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),t.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 Lt=F($t,[["render",It]]),Tt={key:0,class:"flex items-start gap-x-1"},Ot={key:0,class:"text-red-500 text-[14px]"},Rt=["title"],jt=["disabled"],Se=t.defineComponent({__name:"vs-input-switcher",props:t.mergeModels({style:{default:()=>({})},customClass:{default:""},placeholder:{},disabled:{type:Boolean,default:!1},type:{},value:{},name:{},rules:{default:()=>[]},error:{default:""},text:{default:""},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{default:""},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{default:"checkbox"},colSpan:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,n=t.useModel(l,"modelValue");return(s,o)=>e.view==="checkbox"?(t.openBlock(),t.createElementBlock("div",Tt,[t.createVNode(ve,{modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=a=>n.value=a),label:s.text,error:s.error||""},null,8,["modelValue","label","error"]),s.rules?.includes("required")?(t.openBlock(),t.createElementBlock("span",Ot,"*")):t.createCommentVNode("",!0),s.i?(t.openBlock(),t.createElementBlock("button",{key:1,class:"cursor-pointer",title:s.i,onClick:o[1]||(o[1]=t.withModifiers(()=>{},["prevent"]))},[t.createVNode(t.unref(Lt),{class:"text-gray-500 w-[14px] h-[14px]"})],8,Rt)):t.createCommentVNode("",!0)])):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.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:o[2]||(o[2]=a=>n.value=!n.value)},[t.createElementVNode("span",{"data-state":"checked",class:t.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,jt))}}),zt=["innerHTML"],Ut=t.defineComponent({__name:"vs-input-static",props:{style:{},customClass:{default:""},placeholder:{},disabled:{type:Boolean},type:{},value:{},name:{},rules:{},error:{},text:{default:""},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{default:""},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},setup(l){const e=l;return(n,s)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(n.customClass),innerHTML:(e.html==="",e.text)},null,10,zt))}}),Pt=["placeholder","disabled","name"],Ht=t.defineComponent({__name:"vs-input-mask",props:t.mergeModels({style:{default:()=>({})},customClass:{default:""},placeholder:{default:""},disabled:{type:Boolean,default:!1},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{default:""},unmask:{type:Boolean,default:!1},placeholderChar:{default:"_"},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,{inputClass:n}=W(e.style),s=t.useModel(l,"modelValue"),o=t.ref(null);let a=null;return t.onMounted(async()=>{if(o.value){const{default:r}=await Promise.resolve().then(()=>Dl);a=r(o.value,{mask:e.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1,placeholderChar:"_"}),a.on("accept",()=>{s.value=e.unmask?a.unmaskedValue:a.value}),a.on("complete",()=>{s.value=e.unmask?a.unmaskedValue:a.value}),a.value=s.value??""}}),t.onBeforeUnmount(()=>{a?.destroy()}),t.watch(()=>e.mask,r=>{a&&a.updateOptions({mask:r,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})}),t.watch(s,r=>{a&&a.unmaskedValue!==r&&(a.value=r||"")}),(r,i)=>(t.openBlock(),t.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:o,placeholder:r.placeholder,disabled:r.disabled,name:r.name,class:t.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[t.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,Pt))}}),qt=["innerHTML"],Gt=t.defineComponent({__name:"vs-input-html",props:{style:{},customClass:{},placeholder:{},disabled:{type:Boolean},type:{},value:{},name:{},rules:{},error:{},text:{default:""},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},setup(l){return(e,n)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{innerHTML:e.text},null,8,qt)]))}}),Kt={class:"relative w-full bg-white rounded-lg"},Zt=["placeholder","disabled"],Yt=t.defineComponent({__name:"vs-input-email",props:t.mergeModels({style:{default:()=>({})},customClass:{default:""},placeholder:{default:""},disabled:{type:Boolean,default:!1},type:{},value:{},name:{},rules:{},error:{default:null},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,{inputClass:n}=W(e.style),s=t.useModel(l,"modelValue");return(o,a)=>(t.openBlock(),t.createElementBlock("div",Kt,[a[1]||(a[1]=t.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)),t.withDirectives(t.createElementVNode("input",{type:"email","onUpdate:modelValue":a[0]||(a[0]=r=>s.value=r),placeholder:o.placeholder,disabled:o.disabled,class:t.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f]",[t.unref(n),{"!border-red-600":o.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,Zt),[[t.vModelText,s.value]])]))}}),Jt=["value","disabled"],Wt={class:"text-[13px] text-gray-700"},Xt=t.defineComponent({__name:"vs-input-radio-default",props:t.mergeModels({style:{},customClass:{default:""},placeholder:{},disabled:{type:Boolean,default:!1},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=t.useModel(l,"modelValue");return(n,s)=>(t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(["flex items-center gap-0",[n.customClass]])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=o=>e.value=o),type:"radio",value:n.value,disabled:n.disabled,class:"hidden"},null,8,Jt),[[t.vModelRadio,e.value]]),t.createElementVNode("span",{class:t.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":""]])},[e.value==n.value?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${n.style?.primaryColor||"blue"}-500`]])},null,2)):t.createCommentVNode("",!0)],2),t.createElementVNode("span",Wt,t.toDisplayString(n.text),1)],2))}}),Qt=["value","disabled"],en={class:"text-[13px] text-gray-700"},tn={"vs-input-radio-default":Xt,"vs-input-radio-buttons":t.defineComponent({__name:"vs-input-radio-buttons",props:t.mergeModels({style:{},customClass:{default:""},placeholder:{},disabled:{type:Boolean,default:!1},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=t.useModel(l,"modelValue");return(n,s)=>(t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[e.value==n.value?`ring-2 ring-ring ring-${n.style?.primaryColor||"blue"}-500`:"",n.customClass]])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":s[0]||(s[0]=o=>e.value=o),type:"radio",value:n.value,disabled:n.disabled,class:"hidden"},null,8,Qt),[[t.vModelRadio,e.value]]),t.createElementVNode("span",en,t.toDisplayString(n.text),1)],2))}})},Me=t.defineComponent({__name:"vs-input-radio",props:t.mergeModels({style:{},customClass:{},placeholder:{},disabled:{type:Boolean},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{default:"vertical"},view:{default:"default"},colSpan:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,n=t.useModel(l,"modelValue"),s=t.computed(()=>tn[`vs-input-radio-${e.view}`]);return(o,a)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([o.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.options,r=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.value),t.mergeProps({key:r?.id,text:r.text,value:r.id.toString(),checked:n.value===r.id,modelValue:n.value,"onUpdate:modelValue":a[0]||(a[0]=i=>n.value=i)},{ref_for:!0},o.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),nn=F(t.defineComponent({__name:"vs-input-checkbox",props:{style:{},customClass:{},placeholder:{},disabled:{type:Boolean},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{default:null},options:{default:()=>[]},maxHeight:{},slots:{default:null},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{default:!1},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{default:"vertical"},view:{},colSpan:{default:0}},emits:["update:modelValue"],setup(l,{emit:e}){const n=l;console.log(n.position);const s=e,o=t.ref([]),a=t.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(h=>h.json());o.value=u?.data||u}catch(u){console.error(u)}};return t.watch(()=>n.modelValue,u=>{if(typeof u=="boolean"&&o.value.length===1){const h=r(o.value[0]);a[h]=u}else if(Array.isArray(u)){const h=new Set(u);o.value.forEach(p=>{if(!p.disabled){const C=r(p);a[C]=h.has(C)}})}},{immediate:!0}),t.watch(a,()=>{if(!o.value.length){s("update:modelValue",null);return}const u=Object.entries(a).filter(([,h])=>h).map(([h])=>h);s("update:modelValue",u.length===0?null:u)},{deep:!0}),t.onMounted(()=>{if(n.data)c().then(()=>{if(typeof n.modelValue=="boolean"&&o.value.length===1){const u=r(o.value[0]);a[u]=n.modelValue}else if(Array.isArray(n.modelValue)){const u=new Set(n.modelValue);o.value.forEach(h=>{if(!h.disabled){const p=r(h);a[p]=u.has(p)}})}});else if(o.value=n.options,typeof n.modelValue=="boolean"&&o.value.length===1){const u=r(o.value[0]);a[u]=n.modelValue}else if(Array.isArray(n.modelValue)){const u=new Set(n.modelValue);o.value.forEach(h=>{if(!h.disabled){const p=r(h);a[p]=u.has(p)}})}}),(u,h)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["p-0 w-full gap-[6px]",[u.position==="vertical"?"flex-col":"",u.colSpan?"grid":"flex justify-start"]])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,p=>(t.openBlock(),t.createBlock(ve,{modelValue:a[r(p)],"onUpdate:modelValue":C=>a[r(p)]=C,value:r(p),class:t.normalizeClass(d(u.colSpan)),disabled:p.disabled,label:i(p),key:r(p),icon:p?.icon,imgUrl:p?.imgUrl,option:p,view:u.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),[["__scopeId","data-v-78e3db80"]]),sn=["placeholder","disabled"],on=t.defineComponent({__name:"vs-input-date1",props:t.mergeModels({style:{default:()=>({})},customClass:{default:""},placeholder:{default:""},disabled:{type:Boolean,default:!1},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,{inputClass:n}=W(e.style),s=t.useModel(l,"modelValue");return(o,a)=>t.withDirectives((t.openBlock(),t.createElementBlock("input",{type:"date","onUpdate:modelValue":a[0]||(a[0]=r=>s.value=r),placeholder:o.placeholder,disabled:o.disabled,class:t.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[t.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,sn)),[[t.vModelText,s.value]])}}),an=async(l,e,n,s)=>{try{const o=new FormData;return o.append("unique","true"),o.append("file",l),(await fetch(`/file/upload/uploads?id=${e||""}&form=${n||""}&table=${s||""}`,{method:"POST",body:o}).then(r=>r.json()))?.result}catch(o){return ce.notify({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",o),null}},ln=async l=>{try{return await fetch(`file/delete${l}`),!0}catch(e){return console.error(e),!1}},Fe=async l=>{try{const e=await fetch(`file/download/files/uploads${l}`),n=await e.arrayBuffer(),s=e.headers["content-type"],o=new TextDecoder("utf-8").decode(n),a=new Blob([o],{type:s}),r=document.createElement("a");r.setAttribute("download",l),r.href=window.URL.createObjectURL(a),r.click()}catch(e){console.error(e.message)}},rn={},dn={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 un(l,e){return t.openBlock(),t.createElementBlock("svg",dn,e[0]||(e[0]=[t.createElementVNode("path",{d:"M5 12h14"},null,-1),t.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const pe=F(rn,[["render",un]]),cn={},pn={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 hn(l,e,n,s,o,a){return t.openBlock(),t.createElementBlock("svg",pn,e[0]||(e[0]=[t.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 mn=F(cn,[["render",hn]]),fn={},gn={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 kn(l,e,n,s,o,a){return t.openBlock(),t.createElementBlock("svg",gn,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),t.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),t.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const yn=F(fn,[["render",kn]]),xn={},bn={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-file-unknown"};function _n(l,e,n,s,o,a){return t.openBlock(),t.createElementBlock("svg",bn,e[0]||(e[0]=[t.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="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>',5)]))}const wn=F(xn,[["render",_n]]),En={},Bn={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 Vn(l,e,n,s,o,a){return t.openBlock(),t.createElementBlock("svg",Bn,e[0]||(e[0]=[t.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 Cn=F(En,[["render",Vn]]),vn={},Sn={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 Mn(l,e,n,s,o,a){return t.openBlock(),t.createElementBlock("svg",Sn,e[0]||(e[0]=[t.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 Fn=F(vn,[["render",Mn]]),Nn=l=>{if(!l)return"";const e=l?.split(".");return e[e.length-1]},An=l=>{const e=Nn(l),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(e)?"img":n.sheetsFormat.includes(e)?yn:n.textsFormat.includes(e)?Fn:n.documentsFormat.includes(e)?mn:n.archivesFormat.includes(e)?Cn:wn},$n={},Dn={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 In(l,e){return t.openBlock(),t.createElementBlock("svg",Dn,e[0]||(e[0]=[t.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 he=F($n,[["render",In]]),Ln={},Tn={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 On(l,e){return t.openBlock(),t.createElementBlock("svg",Tn,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),t.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),t.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Ne=F(Ln,[["render",On]]),Rn={class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},jn={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},Ae=F(t.defineComponent({__name:"vs-input-file-list-item",props:t.mergeModels({style:{},customClass:{},placeholder:{},disabled:{type:Boolean},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},{value:{},valueModifiers:{},item:{},itemModifiers:{}}),emits:["update:value","update:item"],setup(l){const e=t.useModel(l,"value"),n=t.useModel(l,"item"),s=l;return(o,a)=>(t.openBlock(),t.createElementBlock("div",Rn,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(An)(n.value)),{src:n.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:a[0]||(a[0]=r=>t.unref(Fe)(n.value))},null,8,["src"])),t.createElementVNode("div",jn,[t.createElementVNode("button",{type:"button",onClick:a[1]||(a[1]=r=>{t.unref(ln)(n.value),e.value=s.multiple?e.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"},[t.createVNode(he,{class:"w-4 h-4"})]),t.createElementVNode("button",{type:"button",onClick:a[2]||(a[2]=r=>t.unref(Fe)(n.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[t.createVNode(Ne,{class:"w-4 h-4"})])])]))}}),[["__scopeId","data-v-02a1389c"]]),zn={class:"flex items-center gap-x-2"},Un={key:1,class:"flex items-center flex-wrap gap-2"},Pn=t.defineComponent({__name:"vs-input-file",props:t.mergeModels({style:{},customClass:{},placeholder:{},disabled:{type:Boolean},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,n=t.useModel(l,"modelValue"),s=t.ref(null),o=r=>Array.isArray(n.value)&&n.value[r]||"",a=async r=>{if(e.format){const c=r.target.files?.[0];if(!c||!c.name.endsWith(e.format))return}const i=r.target.files?.[0];if(!i)return;const d=await an(i,"1","form","table");n.value=e.multiple?[...n.value||[],d?.file_path]:d?.file_path};return(r,i)=>(t.openBlock(),t.createElementBlock("div",zn,[t.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:s,type:"file",onChange:a},null,544),!r.multiple&&n.value?(t.openBlock(),t.createBlock(Ae,{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?(t.openBlock(),t.createElementBlock("div",Un,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.value,(d,c)=>(t.openBlock(),t.createBlock(Ae,{multiple:r.multiple,key:c,value:n.value,"onUpdate:value":i[2]||(i[2]=u=>n.value=u),item:o(c)},null,8,["multiple","value","item"]))),128)),t.createElementVNode("div",{onClick:i[3]||(i[3]=d=>!r.disabled&&s.value?.click()),class:t.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"])},[t.createVNode(pe,{class:"w-6 h-6"})],2)])):t.createCommentVNode("",!0),r.multiple?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:2,onClick:i[4]||(i[4]=d=>s.value?.click()),class:t.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"])},[t.createVNode(pe,{class:"w-6 h-6"})],2))]))}}),Hn={class:"max-w-[55vw]"},qn={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},Gn={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},Kn={class:"px-[5px]"},Zn={class:""},me=t.defineComponent({__name:"vs-widget-file-info",props:{item:{default:null}},setup(l){const e=l,n=t.computed(()=>{try{return new Date(e.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function s(o){if(o<1024)return`${o} B`;const a=o/1024;return a<1024?`${a.toFixed(2)} KB`:`${(a/1024).toFixed(2)} MB`}return(o,a)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[a[1]||(a[1]=t.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)),t.createElementVNode("div",Hn,[t.createElementVNode("p",qn,t.toDisplayString(o.item?.uploaded_name),1),t.createElementVNode("p",Gn,[t.createElementVNode("span",null,t.toDisplayString(o.item?.username),1),t.withDirectives(t.createElementVNode("span",Kn,"|",512),[[t.vShow,o.item?.username]]),t.createElementVNode("span",null,t.toDisplayString(n.value),1),a[0]||(a[0]=t.createElementVNode("span",{class:"px-[5px]"},"|",-1)),t.createElementVNode("span",Zn,t.toDisplayString(s(o.item?.size)),1)])])],64))}}),Yn={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},Jn={key:0,class:"flex w-full gap-x-3 items-center"},Wn={key:1,class:"flex gap-x-3 w-full items-center"},Xn={key:2,class:"flex gap-x-3 w-full items-center"},Qn=["href"],es={key:3,class:"flex gap-x-3 w-full items-center"},ts={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},ns={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"},ss={class:"inline-block"},os={class:"inline-block"},as=t.defineComponent({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(l,{emit:e}){const n=l,s=e;function o(u){return["pdf","json"].includes(u.ext)}function a(u){return["ppt","pptx","doc","docx","xls","xlsx"].includes(u.ext)}function r(u){const h=document.createElement("a");h.setAttribute("download",u?.uploaded_name),h.href=u?.file_path,h.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,h)=>(t.openBlock(),t.createElementBlock("div",Yn,[u.item.ext==="jpg"||u.item.ext==="png"?(t.openBlock(),t.createElementBlock("div",Jn,[t.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:h[0]||(h[0]=p=>c(u.index))},[t.createVNode(me,{item:u.item},null,8,["item"])])])):o(u.item)?(t.openBlock(),t.createElementBlock("div",Wn,[t.createVNode(me,{item:u.item},null,8,["item"])])):a(u.item)?(t.openBlock(),t.createElementBlock("div",Xn,[t.createElementVNode("a",{href:`/api/file-preview?id=${u.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[t.createVNode(me,{item:u.item},null,8,["item"])],8,Qn)])):(t.openBlock(),t.createElementBlock("div",es,[t.createVNode(me,{item:u.item},null,8,["item"])])),t.createElementVNode("div",ts,[t.createElementVNode("div",ns,[t.createElementVNode("div",ss,[t.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:h[1]||(h[1]=p=>r(u.item))},[t.createVNode(Ne,{height:"14",width:"14"})])]),h[3]||(h[3]=t.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),t.createElementVNode("div",os,[t.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:h[2]||(h[2]=p=>d())},[t.createVNode(he,{height:"14",width:"14"})])])])])]))}}),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 is(l,e){return t.openBlock(),t.createElementBlock("svg",rs,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),t.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),t.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const ds=F(ls,[["render",is]]),us={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},cs={class:"flex w-full mb-[12px] items-center gap-x-2"},ps={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},hs={class1:"ml-auto"},ms={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"},fs={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},gs={class:"relative"},ks={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"},ys={key:0},xs=t.defineComponent({__name:"vs-input-file-list",props:{style:{},customClass:{},placeholder:{},disabled:{type:Boolean},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{default:"/api"},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},emits:["update"],setup(l,{emit:e}){const n=l,s=t.inject("form"),o=t.computed(()=>s.value.formId),a=t.ref(!1),r=t.ref(0),i=e,d=t.ref(!1),c=t.ref({}),u=t.ref([]),h=t.ref(""),p=t.computed(()=>Array.isArray(u.value)?u.value.filter(y=>y.ext==="jpg"||y.ext==="png").map(y=>y?.file_path):[]);console.log("images",p.value);const C=t.computed(()=>h.value===""?u.value:u.value.filter(y=>y?.uploaded_name?.includes(h.value))),S=y=>{const f=p.value.findIndex(O=>O===y.item.file_path);f!==-1&&(a.value=!0,r.value=f)},A=async()=>{try{const y=await fetch(`${n.prefix}/widget/file/${o.value}`).then(f=>f.json());u.value=y?.rows}catch(y){console.error(y)}},$=async y=>{await Promise.all(Array.from(y.target.files).map(async f=>{const O=new FormData;O.append("file",f);try{const E=`${n.prefix}/widget/file/${o.value}`;return await fetch(E,{method:"POST",body:O}),i("update","file-list"),f}catch(E){return console.error(E),null}})),await A()},T=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},v=y=>{c.value=T(y),d.value=!0};return t.watch(o,y=>{y&&A()}),t.onMounted(()=>{o.value&&A()}),(y,f)=>{const O=t.resolveComponent("Lightbox"),E=t.resolveComponent("MessageBox");return t.openBlock(),t.createElementBlock("div",us,[t.createElementVNode("div",cs,[t.createElementVNode("h2",ps," Файлів: "+t.toDisplayString(u.value?.length),1),t.createElementVNode("div",hs,[t.createElementVNode("label",null,[t.createElementVNode("input",{type:"file",class:"hidden",onChange:f[0]||(f[0]=_=>$(_))},null,32),t.createElementVNode("div",ms,[t.createVNode(ds,{height:"16",width:"16"})])])])]),u.value?.length>4?(t.openBlock(),t.createElementBlock("div",fs,[t.createElementVNode("div",null,[t.createElementVNode("div",gs,[f[8]||(f[8]=t.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[t.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"},[t.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),t.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),t.withDirectives(t.createElementVNode("input",{type:"text","onUpdate:modelValue":f[1]||(f[1]=_=>h.value=_),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),[[t.vModelText,h.value,void 0,{trim:!0}]])])])])):t.createCommentVNode("",!0),u.value?.length?(t.openBlock(),t.createElementBlock("div",ks,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(C.value,(_,B)=>(t.openBlock(),t.createBlock(as,{key:B,prefix:y.prefix,item:_,index:B,onUpdate:f[2]||(f[2]=N=>y.$emit("update","file-list")),onOpenModal:f[3]||(f[3]=N=>v(N)),onOpenLightbox:f[4]||(f[4]=N=>S(N))},null,8,["prefix","item","index"]))),128)),C.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",ys,f[9]||(f[9]=[t.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):t.createCommentVNode("",!0),t.createVNode(O,{modelValue:a.value,"onUpdate:modelValue":f[5]||(f[5]=_=>a.value=_),startIndex:r.value,"onUpdate:index":f[6]||(f[6]=_=>r.value=_),images:p.value},null,8,["modelValue","startIndex","images"]),t.createVNode(E,t.mergeProps({modelValue:d.value,"onUpdate:modelValue":f[7]||(f[7]=_=>d.value=_),onConfirm:c.value.confirm},c.value),null,16,["modelValue","onConfirm"])])}}}),bs={class:"flex items-center justify-between"},_s={class:"text-[16px] text-gray-900 font-medium"},ws={class:"grid gap-3"},Es=F(t.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const e=l,n=t.ref(e.isOpen);return t.watch(()=>e.isOpen,s=>{n.value=s}),(s,o)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",bs,[t.createElementVNode("p",_s,t.toDisplayString(l.title),1),t.createVNode(Se,{modelValue:n.value,"onUpdate:modelValue":o[0]||(o[0]=a=>n.value=a),style:t.normalizeStyle(l.style)},null,8,["modelValue","style"])]),t.createVNode(t.Transition,{name:"slide-fade"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",ws,[t.renderSlot(s.$slots,"default",{},void 0,!0)],512),[[t.vShow,n.value]])]),_:3})]))}}),[["__scopeId","data-v-479564a3"]]),Bs={class:"text-[16px] text-gray-900 font-medium"},Vs={class:"grid gap-3"},Cs=F(t.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(l){const e=l,n=t.ref(e.isOpen);return t.watch(()=>e.isOpen,s=>{n.value=s}),(s,o)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("button",{type:"button",onClick:o[0]||(o[0]=a=>n.value=!n.value),class:"flex items-center gap-2"},[t.createVNode(t.unref(At),{class:t.normalizeClass(["h-4 w-4 duration-300",[n.value?"-rotate-180":""]])},null,8,["class"]),t.createElementVNode("span",Bs,t.toDisplayString(l.title),1)]),t.createVNode(t.Transition,{name:"slide-fade"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",Vs,[t.renderSlot(s.$slots,"default",{},void 0,!0)],512),[[t.vShow,n.value]])]),_:3})]))}}),[["__scopeId","data-v-a37284e6"]]),vs={class:"flex items-center justify-between"},Ss={switcher:Es,accordion:Cs,default:t.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(l){return(e,n)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",vs,[t.createElementVNode("p",null,t.toDisplayString(l.title),1)]),t.renderSlot(e.$slots,"default")]))}})},U={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},Ms=(l,e)=>String(l)===String(e),Fs=(l,e)=>String(l)!==String(e),Ns=(l,e)=>l>e,As=(l,e)=>l>=e,$s=(l,e)=>l<e,Ds=(l,e)=>l<=e,Is=(l,e)=>Array.isArray(e)&&e.length===2?l>=e[0]&&l<=e[1]:!1,Ls=(l,e)=>String(l).startsWith(String(e)),Ts=(l,e)=>String(l).endsWith(String(e)),Os=(l,e)=>String(l).includes(String(e)),Rs=(l,e)=>Array.isArray(e)?e.includes(l):!1,js=(l,e)=>Array.isArray(e)?!e.includes(l):!0,$e=(l,e)=>{if(!e)return!0;switch(e?.[1]){case U.Equal:return Ms(l,e?.[2]);case U.Inequal:return Fs(l,e?.[2]);case U.Higer:return Ns(l,e?.[2]);case U.HigerOrEqual:return As(l,e?.[2]);case U.Lower:return $s(l,e?.[2]);case U.LowerOrEqual:return Ds(l,e?.[2]);case U.Between:return Is(l,e?.[2]);case U.StartWith:return Ls(l,e?.[2]);case U.EndWith:return Ts(l,e?.[2]);case U.Contain:return Os(l,e?.[2]);case U.In:return Rs(l,e?.[2]);case U.NotIn:return js(l,e?.[2]);default:return!0}},zs=t.defineComponent({__name:"vs-input-container",props:{style:{type:Object,default:()=>({})},title:{type:String,default:""},view:{type:String,default:"default"},schema:{type:Array,default:()=>[]}},setup(l){const e=l,n=t.inject("formValues",{default:{}}),s=t.inject("form"),o=t.computed(()=>e.schema?.filter(r=>{const i=r?.conditions;if(!i)return!0;const d=Array.isArray(i)?i[0]:i,c=n?.value?.[d];return $e(c,i)})),a=t.computed(()=>Ss[e.view]);return(r,i)=>l.schema?.length?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(a.value),{key:0,title:l.title,style:t.normalizeStyle(l.style)},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,d=>(t.openBlock(),t.createBlock(Te,t.mergeProps({key:d.name},{ref_for:!0},d,{item:d,modelValue:t.unref(n)[d.name],"onUpdate:modelValue":c=>t.unref(n)[d.name]=c,style:l.style,error:t.unref(s)?.errors?.[d.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"]))),128))]),_:1},8,["title","style"])):t.createCommentVNode("",!0)}});function Us(l){return{all:l=l||new Map,on:function(e,n){var s=l.get(e);s?s.push(n):l.set(e,[n])},off:function(e,n){var s=l.get(e);s&&(n?s.splice(s.indexOf(n)>>>0,1):l.set(e,[]))},emit:function(e,n){var s=l.get(e);s&&s.slice().map(function(o){o(n)}),(s=l.get("*"))&&s.slice().map(function(o){o(e,n)})}}}const Ps=Us(),Hs={class:"relative"},qs={class:"w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50"},Gs={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"},Ks={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},Zs={class:"font-medium text-gray-800 dark:text-[#ffffff]"},Ys={class:"p-4 mim-h-0 h-full overflow-auto"},De=t.defineComponent({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{}},emits:["close","save","edit"],setup(l,{emit:e}){const n=l,s=e,o=t.ref(n.schema),a=t.ref(n.defaultValue?JSON.parse(JSON.stringify(n.defaultValue)):{}),r=t.ref({}),i=t.ref(),d=t.ref(n.mode);async function c(){const h=r.value.validate();if(h){ce.notify({type:"warning",title:"Validation",message:Object.entries(h).map(([p,C])=>`${p}: ${C}`).join(`
2
- `)});return}i.value&&(await fetch("/api/table/"+i.value,{method:d.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(a.value)}).then(p=>p.json()),ce.notify({type:"success",title:"Успішно",message:`Дані успішно ${d.value==="add"?"збережено":"оновленно"}`}),Ps.emit("saveDormData",a.value)),s("save",a.value)}function u(){s("close")}return t.onMounted(async()=>{if(n.form){const h=await fetch(`/api/template/form/${n.form}`).then(p=>p.json());o.value=h.schema,i.value=h.token}else if(n.token){i.value=n.token;const h=await fetch(`/api/form/${i.value}`).then(p=>p.json());o.value=h.schema,h.data?a.value=h.data:d.value="add"}}),(h,p)=>(t.openBlock(),t.createElementBlock("div",Hs,[t.createElementVNode("div",qs,[t.createElementVNode("div",Gs,[t.createElementVNode("div",Ks,[t.createElementVNode("h3",Zs,t.toDisplayString(d.value==="add"?"Додати":"Змінити"),1),t.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"},p[2]||(p[2]=[t.createElementVNode("span",{class:"sr-only"},"Close",-1),t.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"},[t.createElementVNode("path",{d:"M18 6 6 18"}),t.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),t.createElementVNode("div",Ys,[o.value?(t.openBlock(),t.createBlock(ne,{key:0,schema:o.value,values:a.value,"onUpdate:values":p[0]||(p[0]=C=>a.value=C),form:r.value,"onUpdate:form":p[1]||(p[1]=C=>r.value=C)},null,8,["schema","values","form"])):t.createCommentVNode("",!0)]),t.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"},[t.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"}," Скасувати "),t.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"}," Зберегти ")])])])]))}}),te=(l={mode:"edit",schema:null})=>new Promise((e,n)=>{const s=document.querySelector("body");if(!s){console.error('Modal root element with id "#modal" not found!');return}const o=document.createElement("div");s.appendChild(o);const a=t.createApp({render(){return t.h(De,{...l,onClose:()=>{e(null),r()},onSave:i=>{e(i),console.log(i),r()}})}});function r(){a.unmount(),o.remove()}a.mount(o)}),Js={class:"select-container w-full"},Ws=["aria-expanded"],Xs={key:1,class:"placeholder"},Qs=["data-value"],eo={class:"right-side"},to={key:0,class:"dropdown-menu"},no=["onClick"],so={key:0,class:"option-no-value"},oo=F(t.defineComponent({__name:"vs-input-select",props:t.mergeModels({style:{default:()=>({})},customClass:{default:""},placeholder:{default:"Оберіть значення"},disabled:{type:Boolean},type:{},value:{},name:{},rules:{},error:{default:null},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{default:"api"},host:{default:""},data:{default:null},options:{default:()=>[]},maxHeight:{default:400},slots:{default:null},mode:{default:"search"},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},{modelValue:{type:[Number,String],default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,n=t.computed(()=>e.mode||(e.api||e.search?"search":null));W(e.style);const s=t.useModel(l,"modelValue"),o=t.ref(null),a=t.ref(!1),r=t.ref(!1),i=t.ref({}),d=t.ref(null),c=t.ref(null),u=t.ref(null),h=t.ref([]),p=t.ref(-1),C=t.ref([]),S=t.ref(""),A=t.ref(null);let $=null;const T=t.computed(()=>{if(h.value?.length){const m=h.value?.filter(g=>g?.id!==u.value?.id);return[u.value].concat(m)?.filter(g=>g!==null)}return[]}),v=async()=>{try{const{data:m}=await fetch(`${e.host}/${e.prefix}/suggest/${e.data}?json=1&key=${S.value}`).then(g=>g.json());return m}catch{return[]}},y=async m=>{document.body.click(),a.value=m!==void 0?m:!a.value,a.value&&!h.value?.length&&(!e.options?.length&&e.data?h.value=await v():e.options?.length&&(h.value=[...e.options])),a.value&&d.value?(i.value.width=`${d.value.getBoundingClientRect()?.width}px`,n.value==="search"&&A.value?.focus()):p.value=-1},f=()=>a.value?y(!1):null,O=m=>{u.value=m,s.value=m.id,r.value=!1,y(!1)};function E(){u.value=null,s.value=null,a.value=!0}const _=(m,g)=>{if(!m||!g)return;const M=m.offsetTop,j=M+m.offsetHeight,H=g.scrollTop,Q=H+g.clientHeight;M<H?Object.assign(g,{scrollTop:M-80}):j>Q&&Object.assign(g,{scrollTop:j-g.clientHeight+4})},B=m=>{if(!a.value)return;const{keyCode:g}=m;if([38,40,13].includes(g)&&m.preventDefault(),g===38){if(p.value===0)return;p.value-=1,_(C.value[p.value],c.value)}else if(g===40){if(p.value+1>=T.value?.length)return;p.value+=1,_(C.value[p.value],c.value)}else if(g===13){const M=T.value[p.value];M&&O(M)}},N=async m=>{if(a.value)return;const{keyCode:g}=m;[38,40].includes(g)&&(await m.preventDefault(),p.value=0,setTimeout(()=>y()))},R=m=>{a.value&&d.value&&c.value&&!c.value.contains(m.target)&&(a.value=!1)},P=m=>{m?.key==="Escape"&&a.value&&y(!1)};async function X(m){if(!m)return null;const g=h.value?.find(j=>j?.id.toString()===m?.toString());if(g)return g;const{data:M}=await fetch(`${e.host}/${e.prefix}/suggest/${e.data}?json=1&val=${m}`).then(j=>j.json());return M[0]}t.onMounted(async()=>{addEventListener("click",f),addEventListener("keydown",B),addEventListener("scroll",R,!0),addEventListener("keydown",P),e.options&&(h.value=e.options),s.value&&!e.options?.length&&e.data&&(h.value=await v()),u.value=await X(s.value?.toString())}),t.onUnmounted(()=>{removeEventListener("click",f),removeEventListener("keydown",B),removeEventListener("scroll",R,!0),removeEventListener("keydown",P)}),t.watch(S,m=>{let g=!1;(m===""||m.trimStart().length!==0)&&(g=!0),g&&($&&clearTimeout($),$=setTimeout(async()=>{!e.options?.length&&e.data?h.value=await v():h.value=e.options.filter(M=>M.text.toLowerCase().includes(m.toLowerCase()))},200))});async function Ve(){if(!e.add)return;const m=await te({form:e.add.form,mode:"add"});if(!m)return;const g=await fetch(`/api/table/${e.add.token}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)}).then(M=>M.json());s.value=g.id,u.value=await X(g.id)}t.watch(s,m=>{const g=h.value.find(M=>M.id===m);g&&(u.value=g,y(!1))});const xe=()=>{a.value=!0,r.value=!r.value,A.value?.focus(),a.value&&t.nextTick(()=>{y(!0),A.value?.focus()})},Ce=()=>{r.value=!1,S.value=""},ie=()=>{r.value=!0,S.value=""},k=()=>{a.value=!1,S.value=""},x=m=>{o.value?.contains(m.target)||k()};return t.onMounted(()=>document.addEventListener("click",x,!0)),t.onBeforeUnmount(()=>document.removeEventListener("click",x)),(m,g)=>(t.openBlock(),t.createElementBlock("div",{class:"flex gap-1 w-full",ref_key:"select",ref:d,onClick:g[1]||(g[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",Js,[g[5]||(g[5]=t.createElementVNode("span",{id:"react-select-live-region",class:"a11yText"},null,-1)),g[6]||(g[6]=t.createElementVNode("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"a11yText"},null,-1)),t.createElementVNode("div",{onKeydown:N,class:t.normalizeClass(r.value?"select-control-focus":"select-control"),role:"combobox","aria-expanded":a.value,"aria-haspopup":"true"},[t.createElementVNode("div",{class:"input-wrapper",onClick:xe,style:{display:"grid"},ref_key:"triggerRef",ref:o},[u.value?.text&&S.value===""?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["singleValue",a.value?"text-gray-500":"text-gray-900"])},t.toDisplayString(u.value?.text),3)):t.createCommentVNode("",!0),!S.value&&!u.value?.text?(t.openBlock(),t.createElementBlock("div",Xs,t.toDisplayString(m.placeholder),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"input-container","data-value":S.value},[r.value?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:0,ref_key:"inputRef",ref:A,onFocus:ie,onBlur:Ce,autocapitalize:"none",autocomplete:"off",autocorrect:"off",spellcheck:"false",type:"text",tabindex:"0","aria-autocomplete":"list",role:"combobox","onUpdate:modelValue":g[0]||(g[0]=M=>S.value=M)},null,544)),[[t.vModelText,S.value]]):t.createCommentVNode("",!0)],8,Qs)],512),t.createElementVNode("div",eo,[s.value?(t.openBlock(),t.createElementBlock("div",{key:0,onClick:E,class:t.normalizeClass(a.value?"indicatorContainer-open":"indicatorContainer"),"aria-hidden":"true"},g[2]||(g[2]=[t.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"side-icon"},[t.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)]),2)):t.createCommentVNode("",!0),g[4]||(g[4]=t.createElementVNode("span",{class:"indicatorSeparator"},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(a.value?"indicatorContainer-open":"indicatorContainer"),"aria-hidden":"true",onClick:xe},g[3]||(g[3]=[t.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",class:"side-icon"},[t.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)]),2)])],42,Ws),a.value?(t.openBlock(),t.createElementBlock("div",to,[t.createElementVNode("div",{class:"menu-container text-gray-900",ref_key:"list",ref:c},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(T.value,(M,j)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([s.value==M?.id?"single-option-active":"single-option",p.value==j?"!bg-blue-100":""]),key:M.id,onClick:H=>O(M),ref_for:!0,ref:H=>C.value[j]=H,"aria-disabled":"false",id:"react-select-3-option-0",tabindex:"-1",role:"option"},t.toDisplayString(M?.text),11,no))),128)),T.value.length===0?(t.openBlock(),t.createElementBlock("div",so," No options ")):t.createCommentVNode("",!0)],512)])):t.createCommentVNode("",!0)]),e.add?(t.openBlock(),t.createElementBlock("button",{key:0,onClick:Ve,class:"bg-white hover:bg-gray-100 text-sm text-gray-900 leadig-[18.5px] py-[10] px-[12px] border border-solid border-stone-200 rounded-md h-[38px] max-h-[40] gap-[8px] flex items-center"},[t.createVNode(pe,{width:"16",height:"16"}),g[7]||(g[7]=t.createElementVNode("span",null,"Додати",-1))])):t.createCommentVNode("",!0)],512))}}),[["__scopeId","data-v-85790176"]]),ao=["placeholder","disabled"],lo=t.defineComponent({__name:"vs-input-textarea",props:t.mergeModels({style:{default:()=>({})},customClass:{default:""},placeholder:{default:""},disabled:{type:Boolean,default:!1},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,{inputClass:n}=W(e.style),s=t.useModel(l,"modelValue");return(o,a)=>t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{"onUpdate:modelValue":a[0]||(a[0]=r=>s.value=r),placeholder:o.placeholder,disabled:o.disabled,row:"2",class:t.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto",[t.unref(n)]]),style:{border:"1px solid #CFD9E0"}},null,10,ao)),[[t.vModelText,s.value]])}}),ro={},io={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 uo(l,e){return t.openBlock(),t.createElementBlock("svg",io,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),t.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const co=F(ro,[["render",uo]]),po={},ho={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 mo(l,e){return t.openBlock(),t.createElementBlock("svg",ho,e[0]||(e[0]=[t.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),t.createElementVNode("path",{d:"M7 20V4"},null,-1),t.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),t.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const fo=F(po,[["render",mo]]),go={},ko={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 yo(l,e){return t.openBlock(),t.createElementBlock("svg",ko,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),t.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),t.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const xo=F(go,[["render",yo]]),bo={},_o={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(l,e){return t.openBlock(),t.createElementBlock("svg",_o,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),t.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),t.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Eo=F(bo,[["render",wo]]),Bo={},Vo={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 Co(l,e){return t.openBlock(),t.createElementBlock("svg",Vo,e[0]||(e[0]=[t.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 Ie=F(Bo,[["render",Co]]),vo={},So={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Mo(l,e){return t.openBlock(),t.createElementBlock("svg",So,e[0]||(e[0]=[t.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 Fo=F(vo,[["render",Mo]]),No={},Ao={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 $o(l,e){return t.openBlock(),t.createElementBlock("svg",Ao,e[0]||(e[0]=[t.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 Do=F(No,[["render",$o]]),Io={class:"vs-datatable border rounded-xl w-full flex-grow"},Lo={class:"flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]"},To={class:"relative w-full"},Oo={class:"table-wrapper flex gap-2"},Ro={class:"vs-popover inline-block text-slate-700"},jo={class:"text-center"},zo={class:""},Uo={class:"py-2 px-4 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"},Po={class:"flex flex-col p-[2px] gap-[2px] w-[140px]"},Ho={class:"text-sm items-center text-gray-800 flex gap-1"},qo={class:"w-full overflow-x-auto"},Go={class:"w-full table-auto caption-bottom text-sm"},Ko={class:"[&_tr]:border-b"},Zo={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"},Yo={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"},Jo={key:0,colspan:"100%",class:"text-center"},Wo={class:"w-full"},Xo={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},Qo=["onDragstart","onDragover","onDrop"],ea={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center"},ta={class:"flex items-center justify-center"},na={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"},sa={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},oa={class:"flex items-center justify-center gap-2"},aa=["onClick"],la=["onClick"],ra=t.defineComponent({__name:"vs-input-datatable",props:t.mergeModels({style:{},customClass:{},placeholder:{},disabled:{type:Boolean},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,n=t.useModel(l,"modelValue"),s=t.ref({}),o=t.ref(""),a=t.computed(()=>{if(!o.value)return n.value??[];const E=o.value.toLowerCase();return n.value.filter(_=>e.colModel?.some(B=>{const N=_[B.key];return N?Array.isArray(N)?N.join(", ").toLowerCase().includes(E):String(N).toLowerCase().includes(E):!1}))});console.log(a.value);const r=t.ref(null),i=t.ref(null),d=t.ref(!1),c=t.ref(null),u=t.ref({top:0,left:0}),h=E=>{r.value=E},p=E=>{i.value=E},C=E=>{if(r.value===null||r.value===E){r.value=null,i.value=null;return}const _=[...n.value],[B]=_.splice(r.value,1);_.splice(E,0,B),n.value=_,r.value=null,i.value=null},S=E=>{const B=E.currentTarget.getBoundingClientRect();u.value={top:B.bottom+window.scrollY,left:B.left+window.scrollX},d.value=!d.value},A=()=>{c.value&&c.value.click()},$=E=>{const B=E.target.files?.[0];if(!B)return;const N=new FileReader;N.onload=R=>{try{const P=R.target?.result;if(typeof P=="string"){const X=JSON.parse(P);Array.isArray(X)&&n.value.push(...X)}}catch(P){console.error("Error parsing file:",P)}},N.readAsText(B)},T=()=>{const E=JSON.stringify(n.value,null,2),_=new Blob([E],{type:"application/json"}),B=URL.createObjectURL(_),N=document.createElement("a");N.href=B,N.download="data.json",N.click(),URL.revokeObjectURL(B)};t.onMounted(async()=>{const E=e.colModel?.filter(_=>_.data);E?.length&&Promise.all(E.map(async _=>{s.value[_.key]=await fetch(`/api/suggest/${_.data}`).then(B=>B.json())}))});async function v(){const E=await te({schema:e.colModel,mode:"add"});E&&(Array.isArray(n.value)?n.value=[...n.value,E]:n.value=[E])}function y(E,_){return s.value[_.key]&&E[_.key]?s.value[_.key].find(B=>B.id.toString()===E[_.key].toString())?.text??E[_.key]:E[_.key]||"-"}async function f(E,_){const B=await te({schema:e.colModel,mode:"add",defaultValue:E});B&&(n.value=n.value.map((N,R)=>R===_?B:N))}function O(E){n.value=n.value.filter((_,B)=>B!==E)}return(E,_)=>(t.openBlock(),t.createElementBlock("div",Io,[t.createElementVNode("div",Lo,[t.createElementVNode("div",To,[t.createVNode(co,{width:"14",height:"14",class:"absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"}),t.withDirectives(t.createElementVNode("input",{type:"text","onUpdate:modelValue":_[0]||(_[0]=B=>o.value=B),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),[[t.vModelText,o.value]])]),t.createElementVNode("div",Oo,[t.createElementVNode("input",{ref_key:"fileInput",ref:c,onChange:$,class:"hidden",accept:".json",type:"file"},null,544),t.createElementVNode("div",Ro,[t.createElementVNode("div",jo,[t.createElementVNode("div",zo,[t.createElementVNode("button",{onClick:S,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"},[t.createVNode(fo,{height:"16",width:"16"})])])])])]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[d.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"text-slate-700 vsTailwind vs-popover__content bottom",style:t.normalizeStyle([{width:"fit-content","z-index":"10002",position:"fixed"},{position:"absolute",top:u.value.top+"px",left:u.value.left+"px"}])},[t.createElementVNode("div",Uo,[t.createElementVNode("div",Po,[t.createElementVNode("button",{onClick:A,class:"text-slate-700 flex items-center gap-1 px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100"},[t.createVNode(xo,{class:"text-black",width:"14",height:"14"}),_[1]||(_[1]=t.createTextVNode(" Імпортувати "))]),t.createElementVNode("button",{onClick:T,class:"text-slate-700 flex items-center px-3 py-1 rounded-md cursor-pointer group hover:bg-gray-100"},[t.createElementVNode("span",Ho,[t.createVNode(Eo,{class:"text-black",width:"14",height:"14"}),_[2]||(_[2]=t.createTextVNode(" Експортувати "))])])])])],4)):t.createCommentVNode("",!0)])),t.createElementVNode("button",{onClick:v,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"},[t.createVNode(pe),_[3]||(_[3]=t.createTextVNode(" Додати "))])]),t.createElementVNode("div",qo,[t.createElementVNode("table",Go,[t.createElementVNode("thead",Ko,[t.createElementVNode("tr",Zo,[t.createElementVNode("th",Yo,[t.createVNode(Ie,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(E.colModel,B=>(t.openBlock(),t.createElementBlock("th",{key:B.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]"},t.toDisplayString(B.ua),1))),128)),_[4]||(_[4]=t.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))])]),t.createElementVNode("tbody",{class:t.normalizeClass({"[&_tr:last-child]:border-0":!i.value})},[a.value.length===0?(t.openBlock(),t.createElementBlock("td",Jo,[t.createElementVNode("div",Wo,[t.createElementVNode("div",Xo,[t.createVNode(Fo,{class:"w-48 mx-auto"}),_[5]||(_[5]=t.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[t.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),t.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,(B,N)=>(t.openBlock(),t.createElementBlock("tr",{key:B.id,class:t.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===N,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":i.value===N}]),draggable:"true",onDragstart:R=>h(N),onDragover:t.withModifiers(R=>p(N),["prevent"]),onDrop:R=>C(N)},[t.createElementVNode("td",ea,[t.createElementVNode("div",ta,[t.createVNode(Ie,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(E.colModel,R=>(t.openBlock(),t.createElementBlock("td",{key:R.key,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},[t.createElementVNode("div",na,t.toDisplayString(y(B,R)),1)]))),128)),t.createElementVNode("td",sa,[t.createElementVNode("div",oa,[t.createElementVNode("button",{onClick:R=>f(B,N),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"},[t.createVNode(Do,{width:"24",height:"24",class:"w-3 h-3"})],8,aa),t.createElementVNode("button",{onClick:R=>O(N),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"},[t.createVNode(he,{width:"24",height:"24",class:"w-3 h-3"})],8,la)])])],42,Qo))),128))],2)])])]))}}),ia={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 Le(l){return l?l.type==="FeatureCollection"||l.type==="Feature"?l:l.geom?{type:"Feature",geometry:{type:l.geom.type,coordinates:l.geom.coordinates},properties:{}}:l.type&&l.coordinates?{type:"Feature",geometry:l,properties:{}}:null:null}const da={},ua={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 ca(l,e){return t.openBlock(),t.createElementBlock("svg",ua,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"},null,-1),t.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 pa=F(da,[["render",ca]]),ha={},ma={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 fa(l,e){return t.openBlock(),t.createElementBlock("svg",ma,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),t.createElementVNode("path",{d:"M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),t.createElementVNode("path",{d:"M7.5 16.5l9 -9"},null,-1)]))}const ga=F(ha,[["render",fa]]),ka={},ya={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 xa(l,e){return t.openBlock(),t.createElementBlock("svg",ya,e[0]||(e[0]=[t.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 ba=F(ka,[["render",xa]]),_a={},wa={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 Ea(l,e){return t.openBlock(),t.createElementBlock("svg",wa,e[0]||(e[0]=[t.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 Ba=F(_a,[["render",Ea]]),Va={},Ca={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 va(l,e){return t.openBlock(),t.createElementBlock("svg",Ca,e[0]||(e[0]=[t.createElementVNode("title",null,null,-1),t.createElementVNode("desc",null,null,-1),t.createElementVNode("defs",null,null,-1),t.createElementVNode("g",{fill:"none","fill-rule":"evenodd",id:"Page-1",stroke:"none","stroke-width":"1"},[t.createElementVNode("g",{fill:"#000000",id:"Core",transform:"translate(-215.000000, -257.000000)"},[t.createElementVNode("g",{id:"fullscreen",transform:"translate(215.000000, 257.000000)"},[t.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=F(Va,[["render",va]]),Ma={class:"form-geom__search"},Fa={class:"map-search__input"},Na={class:"flex flex-nowrap relative"},Aa={class:"form-autocomplete relative min-w-[6rem] vsTailwind map-search__select hidden"},$a={class:"flex items-center w-full"},Da={class:"max-w-[90%] truncate"},Ia={key:0,class:"absolute z-[3100] mt-0.5 left-0 right-0"},La={class:"form-autocomplete__wrapper mt-[10px] z-50 w-full min-w-36 max-h-72 p-0 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-900 top-full opened"},Ta={class:"form-autocomplete__list vsTailwind px-2 pb-2 pt-0 max-h-200 relative [&::-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 dark:bg-neutral-900"},Oa=["onClick"],Ra={class:"flex justify-between items-center w-full"},ja={class:"flex items-center"},za={key:0,class:"flex-shrink-0 w-3.5 h-3.5 text-blue-600",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Ua={class:"relative w-full"},Pa={class:"vs-form-text relative bg-white rounded-lg"},Ha={key:1,class:"absolute left-0 right-0 top-full z-[3200] bg-white border border-gray-200 rounded-b-lg shadow-lg max-h-72 overflow-auto"},qa={key:0},Ga=["onClick"],Ka={key:1,class:"px-3 py-2 text-xs text-gray-500"},Za={key:2,class:"px-3 py-2 text-xs text-gray-400"},Ya=t.defineComponent({__name:"map-search",props:{placeholder:{default:"50, 30"}},emits:["goToCoordinates"],setup(l,{emit:e}){const n=e,s=t.ref(!1),o=t.ref("coordinates"),a=t.ref(""),r=t.ref([]),i=t.ref(!1),d=t.ref(!1);let c;const u=[{value:"coordinates",label:"Пошук по кординатам"},{value:"atu",label:"АТУ"},{value:"address",label:"Адресса"},{value:"search_here",label:"Пошук HERE"}],h=t.computed(()=>u.find(v=>v.value===o.value)?.label??"АТУ");function p(v){o.value=v.value,s.value=!1,a.value="",a.value&&A()}function C(v){v.target.closest(".map-search__input")||(s.value=!1)}t.onMounted(()=>document.addEventListener("click",C)),t.onUnmounted(()=>document.removeEventListener("click",C));async function S(v){let y;o.value==="atu"?y="/api/suggest/atu.nsdi.ato_level":o.value==="address"?y="/api/suggest/map.address_id":o.value==="search_here"&&(y="/api/gis-url-proxy");const f=new URL(y||"");return o.value==="search_here"?f.searchParams.set("searchtext",v):(o.value==="atu"||o.value==="address")&&f.searchParams.set("key",v),f.searchParams.set("limit","20"),f.searchParams.set("q",v),(await fetch(f.toString())).json()}function A(){if(i.value=!0,d.value=!0,o.value==="coordinates"){const v=a.value.trim().split(",");if(v.length===2){const y=parseFloat(v[0]),f=parseFloat(v[1]);!Number.isNaN(y)&&!Number.isNaN(f)&&n("goToCoordinates",[y,f])}return}c&&window.clearTimeout(c),c=window.setTimeout(async()=>{const v=a.value.trim();if(!v){r.value=[],d.value=!1;return}try{const y=await S(v);r.value=Array.isArray(y.features)?y.features:[]}catch{r.value=[]}finally{d.value=!1}},300)}function $(){a.value="",r.value=[],i.value=!1,d.value=!1}function T(v){n("goToCoordinates",v),i.value=!1,d.value=!1,r.value=[]}return(v,y)=>(t.openBlock(),t.createElementBlock("div",Ma,[t.createElementVNode("div",Fa,[t.createElementVNode("div",Na,[t.createElementVNode("div",Aa,[t.createElementVNode("button",{type:"button",onClick:y[0]||(y[0]=f=>s.value=!s.value),class:"h-[40px] relative px-4 pe-9 flex text-nowrap w-full cursor-pointer bg-white border border-solid border-stone-200 rounded-lg text-start text-sm text-stone-800 focus:outline-none focus:ring-1 focus:ring-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200"},[t.createElementVNode("div",$a,[t.createElementVNode("span",Da,t.toDisplayString(h.value),1)]),y[3]||(y[3]=t.createElementVNode("svg",{class:"stroke-gray-500 absolute right-3 translate-y-1/2 bottom-1/2",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none"},[t.createElementVNode("path",{d:"M6 9l6 6 6-6","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))]),s.value?(t.openBlock(),t.createElementBlock("div",Ia,[t.createElementVNode("div",La,[t.createElementVNode("div",Ta,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(u,f=>t.createElementVNode("div",{onClick:O=>p(f),key:f.value,class:"form-autocomplete__item cursor-pointer hs-selected:bg-stone-100 dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800 cursor-default"},[t.createElementVNode("div",Ra,[t.createElementVNode("div",ja,[t.createElementVNode("div",null,t.toDisplayString(f.label),1)]),f.value===o.value?(t.openBlock(),t.createElementBlock("svg",za,y[4]||(y[4]=[t.createElementVNode("polyline",{points:"20 6 9 17 4 12"},null,-1)]))):t.createCommentVNode("",!0)])],8,Oa)),64))])])])):t.createCommentVNode("",!0)]),t.createElementVNode("div",Ua,[t.createElementVNode("div",Pa,[y[6]||(y[6]=t.createElementVNode("i",{class:"absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500"},[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor"},[t.createElementVNode("circle",{cx:"11",cy:"11",r:"8","stroke-width":"2"}),t.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65","stroke-width":"2"})])],-1)),t.withDirectives(t.createElementVNode("input",{type:"text","onUpdate:modelValue":y[1]||(y[1]=f=>a.value=f),onInput:A,onFocus:y[2]||(y[2]=f=>i.value=!0),placeholder:"Пошук...",class:"bg-white h-[38px] text-sm py-2 px-3 ps-9 pe-8 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg 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,544),[[t.vModelText,a.value]]),a.value?(t.openBlock(),t.createElementBlock("button",{key:0,onClick:$,class:"absolute right-2 bottom-1/2 translate-y-1/2 text-gray-500 hover:text-red-500","aria-label":"Очистити",type:"button"},y[5]||(y[5]=[t.createElementVNode("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))):t.createCommentVNode("",!0),i.value&&o.value!=="coordinates"?(t.openBlock(),t.createElementBlock("div",Ha,[r.value.length?(t.openBlock(),t.createElementBlock("ul",qa,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,f=>(t.openBlock(),t.createElementBlock("li",{key:f.properties.place_id,onClick:O=>T(f),class:"px-3 py-2 text-sm cursor-pointer hover:bg-gray-100"},t.toDisplayString(f.properties.display_name),9,Ga))),128))])):d.value?(t.openBlock(),t.createElementBlock("div",Ka,"Шукаю…")):(t.openBlock(),t.createElementBlock("div",Za,"Нічого не знайдено"))])):t.createCommentVNode("",!0)])])])])]))}}),Ja={class:"bg-white/95 p-2 rounded-xl shadow border border-gray-200"},Wa={class:"flex gap-2"},Xa=["onClick","title"],Qa=["src"],el=t.defineComponent({__name:"map-layers",props:{basemaps:{},defaultLayer:{}},emits:["onLayerChange"],setup(l,{emit:e}){const n=l,s=t.ref(n.defaultLayer??""),o=e;function a(r){o("onLayerChange",r),s.value=r}return(r,i)=>(t.openBlock(),t.createElementBlock("div",Ja,[t.createElementVNode("div",Wa,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.basemaps,(d,c)=>(t.openBlock(),t.createElementBlock("div",{key:c,class:t.normalizeClass(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm",{"ring-2 ring-blue-500 border-blue-300":s.value===c}]),onClick:u=>a(c),title:c,role:"button",tabindex:"0"},[t.createElementVNode("img",{src:d.preview,alt:"",class:"w-14 h-14 object-cover"},null,8,Qa)],10,Xa))),128))])]))}}),tl={class:"absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]"},nl={class:"form-geom__panel flex gap-1 items-start mt-2"},sl={class:"flex items-center gap-1"},ol=["disabled"],al={class:"absolute top-4 right-4 z-[1000]"},ll={class:"flex flex-col gap-[2px]"},rl=["aria-pressed"],il=["aria-pressed"],dl=["aria-pressed"],ul=["aria-pressed"],cl={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"},pl={key:0,class:"form-geom__feature flex items-center text-xs transition-all gap-2 w-full"},hl={class:"mr-auto"},ml={class:"font-bold"},fl={class:"flex items-center"},gl={class:"text-xs mr-2"},kl={key:0,class:"text-xs"},yl={key:1,class:"text-xs"},xl={VsInputText:be,VsInputRadio:Me,"vs-input-text":be,"vs-input-textarea":lo,"vs-input-mask":Ht,"vs-input-number":ht,"vs-input-radio":Me,"vs-input-select":oo,"vs-input-switcher":Se,"vs-input-static":Ut,"vs-input-container":zs,"vs-input-date":on,"vs-input-checkbox":nn,"vs-input-file":Pn,"vs-input-html":Gt,"vs-input-email":Yt,"vs-input-datatable":ra,"vs-input-map":F(t.defineComponent({__name:"vs-input-map",props:{style:{},customClass:{},placeholder:{},disabled:{type:Boolean},type:{},value:{},name:{},rules:{},error:{},text:{},mask:{},unmask:{type:Boolean},placeholderChar:{},html:{},prefix:{},host:{},data:{},options:{},maxHeight:{},slots:{},mode:{},add:{},api:{},search:{type:Boolean},i:{},time:{type:Boolean},modelValue:{},clearable:{type:Boolean},now:{type:Boolean},editable:{type:Boolean},isInfinity:{type:Boolean},multiple:{type:Boolean},format:{},colModel:{},position:{},view:{},colSpan:{}},emits:["update:modelValue"],setup(l,{emit:e}){const n=l,s=e,o=t.ref(null);let a,r,i;const d=t.ref(null),c=t.ref(null),u=t.ref(6),h=t.ref(0),p=t.ref(null),C={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"}};let S;const A=t.ref("topo100");function $(){return new Promise((k,x)=>{window.L&&window.L.Draw&&k(0);const m=M=>{if(Array.from(document.styleSheets).some(Q=>Q?.href?.includes(M)))return;const H=document.createElement("link");H.rel="stylesheet",H.href=M,document.head.appendChild(H)},g=M=>new Promise((j,H)=>{const Q=Array.from(document.scripts).find(ue=>ue.src===M);if(Q){Q.addEventListener("load",()=>j()),Q.addEventListener("error",ue=>H(ue));return}const de=document.createElement("script");de.src=M,de.async=!0,de.onload=()=>j(),de.onerror=ue=>H(ue),document.body.appendChild(de)});m("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),m("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),g("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(()=>g("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(()=>k(0)).catch(x)})}function T(){const k=r.toGeoJSON();s("update:modelValue",k),h.value=r.getLayers().length}function v(k=30){const x=r.getLayers();if(!x.length)return;const g=L.featureGroup(x).getBounds();g&&g.isValid()&&a.fitBounds(g,{padding:[k,k]})}function y(){d.value?.click()}const f=t.ref("");function O(k){return k instanceof L.Circle?"Circle":k instanceof L.Rectangle?"Rectangle":k instanceof L.Polygon&&!(k instanceof L.Rectangle)?"Polygon":k instanceof L.Polyline&&!(k instanceof L.Polygon)?"Polyline":k instanceof L.Marker?"Point":"Feature"}function E(k){if(k instanceof L.Circle){const x=k.getRadius();return Math.PI*(x*x)/1e6}if(k instanceof L.Polygon||k instanceof L.Rectangle)try{const x=k.getLatLngs(),m=Array.isArray(x[0])?x[0]:x,g=L.GeometryUtil?.geodesicArea?L.GeometryUtil.geodesicArea(m):0;return g?g/1e6:0}catch{return null}return null}function _(k){return k instanceof L.Circle?k.getLatLng():k.getBounds?k.getBounds().getCenter():k.getLatLng?k.getLatLng():a.getCenter()}function B(){const k=r.getLayers();if(!k.length){p.value=null,h.value=0;return}const x=k[k.length-1],m=O(x),g=_(x),M=E(x);p.value={type:m,center:g,areaKm2:M,layer:x},h.value=k.length}function N(){const k=p.value?.layer;k&&(k instanceof L.Circle&&k.getBounds?a.fitBounds(k.getBounds(),{padding:[30,30]}):k.getBounds?a.fitBounds(k.getBounds(),{padding:[30,30]}):k.getLatLng&&a.setView(k.getLatLng(),Math.max(u.value,14)))}function R(){const k=p.value?.layer;k&&(r.removeLayer(k),T(),B())}t.onMounted(async()=>{await $(),L.drawLocal=ia,a=L.map(o.value,{zoomControl:!1}).setView([50,30],10),L.control.zoom({position:"bottomright"}).addTo(a),S=L.tileLayer(C.topo100.url,{maxZoom:19,minZoom:6}).addTo(a),A.value="topo100",r=new L.FeatureGroup().addTo(a),a.on(L.Draw.Event.CREATED,x=>{const{layer:m}=x;r.clearLayers(),r.addLayer(m),T(),B(),v(),f.value=""}),a.on(L.Draw.Event.EDITED,()=>{T(),B(),v()}),a.on(L.Draw.Event.DELETED,()=>{T(),B(),v()}),a.on("mousemove",x=>{c.value=x.latlng}),a.on("zoomend",()=>{u.value=a.getZoom()});const k=Le(n.modelValue);if(k){const x=[];L.geoJSON(k).eachLayer(m=>x.push(m)),x.length&&r.addLayer(x[0]),T(),B(),v()}});function P(k){if(a){switch(i&&i.disable(),k){case"marker":i=new L.Draw.Marker(a);break;case"polyline":i=new L.Draw.Polyline(a);break;case"polygon":i=new L.Draw.Polygon(a);break;case"rectangle":i=new L.Draw.Rectangle(a);break;default:i=new L.Draw.Rectangle(a);break}i&&(i.enable(),f.value=k)}}function X(){const k=r.toGeoJSON(),x=new Blob([JSON.stringify(k,null,2)],{type:"application/json"}),m=URL.createObjectURL(x),g=document.createElement("a");g.href=m,g.download="data.geojson",g.click(),URL.revokeObjectURL(m)}function Ve(k){const x=k.target.files?.[0];if(!x)return;const m=new FileReader;m.onload=()=>{if(typeof m.result=="string")try{const g=JSON.parse(m.result);r.clearLayers();const M=[];L.geoJSON(g).eachLayer(j=>M.push(j)),M.length&&r.addLayer(M[0]),T(),B(),v()}finally{k.target.value=""}},m.readAsText(x)}function xe(k){a&&(S&&a.removeLayer(S),S=L.tileLayer(C[k].url,{maxZoom:19,minZoom:6}).addTo(a),A.value=k)}function Ce(k){const x=L.latLng(k[0],k[1]);a.setView(x,13)}t.watch(()=>n.modelValue,k=>{const x=Le(k);if(r.clearLayers(),x){const m=[];L.geoJSON(x).eachLayer(g=>m.push(g)),m.length&&r.addLayer(m[0])}h.value=r.getLayers().length,B(),v()});const ie=t.ref(!1);return(k,x)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["leaflet-map-wrapper relative w-full h-[600px]",{fullscreen:ie.value}])},[t.createElementVNode("div",{ref_key:"mapContainer",ref:o,class:"w-full h-full"},null,512),t.createElementVNode("div",tl,[t.createVNode(Ya,{onGoToCoordinates:Ce}),t.createElementVNode("div",nl,[t.createElementVNode("div",sl,[t.createElementVNode("button",{type:"button",class:"vs-btn-row",onClick:y},"Імпорт"),t.createElementVNode("button",{type:"button",class:"vs-btn-row",onClick:X,disabled:h.value===0},"Експорт ",8,ol)]),t.createElementVNode("input",{ref_key:"importRef",ref:d,type:"file",onChange:Ve,accept:".json,.geojson",class:"hidden"},null,544)])]),t.createElementVNode("div",al,[t.createElementVNode("div",ll,[t.createElementVNode("button",{class:t.normalizeClass(["vs-btn",{"vs-active":f.value==="marker"}]),"aria-pressed":f.value==="marker",title:"Point (P)","aria-label":"Draw point",onClick:x[0]||(x[0]=m=>P("marker"))},[t.createVNode(pa)],10,rl),t.createElementVNode("button",{class:t.normalizeClass(["vs-btn",{"vs-active":f.value==="polyline"}]),"aria-pressed":f.value==="polyline",title:"Line (L)","aria-label":"Draw polyline",onClick:x[1]||(x[1]=m=>P("polyline"))},[t.createVNode(ga)],10,il),t.createElementVNode("button",{class:t.normalizeClass(["vs-btn",{"vs-active":f.value==="polygon"}]),"aria-pressed":f.value==="polygon",title:"Polygon (G)","aria-label":"Draw polygon",onClick:x[2]||(x[2]=m=>P("polygon"))},[t.createVNode(ba)],10,dl),t.createElementVNode("button",{class:t.normalizeClass(["vs-btn",{"vs-active":f.value==="rectangle"}]),"aria-pressed":f.value==="rectangle",title:"Rectangle (R)","aria-label":"Draw rectangle",onClick:x[3]||(x[3]=m=>P("rectangle"))},[t.createVNode(Ba)],10,ul),t.createElementVNode("button",{class:"vs-btn",onClick:x[4]||(x[4]=m=>ie.value=!ie.value)},[t.createVNode(Sa,{style:{width:"12px",height:"12px"}})])])]),t.createElementVNode("div",{class:t.normalizeClass(["absolute left-4 z-[1000]",p.value?"bottom-8":"bottom-4"])},[t.createVNode(el,{basemaps:C,"default-layer":"topo100",onOnLayerChange:xe})],2),t.createElementVNode("div",cl,[p.value?(t.openBlock(),t.createElementBlock("div",pl,[t.createElementVNode("div",hl,[x[7]||(x[7]=t.createTextVNode(" Тип: ")),t.createElementVNode("span",ml,t.toDisplayString(p.value.type),1)]),t.createElementVNode("div",fl,[t.createElementVNode("div",gl,[x[8]||(x[8]=t.createTextVNode(" Центр: ")),t.createElementVNode("b",null,t.toDisplayString(p.value.center.lat.toFixed(5))+", "+t.toDisplayString(p.value.center.lng.toFixed(5)),1)]),p.value.areaKm2!==null?(t.openBlock(),t.createElementBlock("div",kl,[x[9]||(x[9]=t.createTextVNode(" Площа: ")),t.createElementVNode("b",null,t.toDisplayString(p.value.areaKm2.toFixed(1))+"км²",1)])):(t.openBlock(),t.createElementBlock("div",yl,x[10]||(x[10]=[t.createTextVNode(" Площа: "),t.createElementVNode("b",null,"—",-1)]))),t.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]=m=>N())},x[11]||(x[11]=[t.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-7d193de4><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-7d193de4></path><path d="M7 10l6 0" data-v-7d193de4></path><path d="M10 7l0 6" data-v-7d193de4></path><path d="M21 21l-6 -6" data-v-7d193de4></path></svg>',1)])),t.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]=m=>R())},[t.createVNode(he,{class:"w-3 h-3"})])])])):t.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-7d193de4"]]),"vs-input-file-list":xs},bl=t.defineComponent({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(l){const e=l,n=t.inject("values");async function s(){try{if(!e.api)return;const o=e.api.replace("{{value}}",e.value),a=await fetch(o);if(!a.ok){ce.notify({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const r=await a.json();if(!e.set||!n)return;for(const[i,d]of Object.entries(e.set))n.value[i]=r.result[d]}catch(o){console.error(e.error,o)}}return(o,a)=>(t.openBlock(),t.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"},t.toDisplayString(o.button),1))}}),_l={class:"flex"},Te=t.defineComponent({__name:"vs-compact-form-layout",props:t.mergeModels({item:{default:{}},layout:{default:"default"},style:{default:{}},type:{default:""},error:{type:[String,Boolean]}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(l){const e=l,n=t.useModel(l,"modelValue"),s=t.computed(()=>ut[`${e.layout}`]),o=t.computed(()=>xl?.[`vs-input-${e.item.type}`]),a=t.computed(()=>{const i=t.unref(o);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=t.computed(()=>{const i=e.item??{},d=a.value;return d.size?Object.fromEntries(Object.entries(i).filter(([c])=>d.has(c))):{}});return(i,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(s.value),{ua:e.item.ua,error:e.error||"",item:i.item,label:e.item.label},{default:t.withCtx(()=>[t.createElementVNode("div",_l,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.value),t.mergeProps(r.value,{modelValue:n.value,"onUpdate:modelValue":d[0]||(d[0]=c=>n.value=c)}),null,16,["modelValue"])),i.item.behavior?(t.openBlock(),t.createBlock(bl,t.mergeProps({key:0},i.item.behavior,{value:n.value}),null,16,["value"])):t.createCommentVNode("",!0)])]),_:1},8,["ua","error","item","label"]))}}),Oe={required:"Це поле є обов’язковим",email:"Неправильний email"},wl=l=>l?!1:Oe.required,El=l=>!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(l)&&l?Oe.email:!1,Bl=(l,e)=>{const n=e.pattern??e.regexp;return!(typeof n=="string"?new RegExp(n):n).test(l)&&l?e.message:!1},Vl=(l,e)=>!1,Cl=(l,e)=>{switch(typeof e=="string"?e:e.type){case"required":return wl(l);case"email":return El(l);case"regexp":return Bl(l,e);case"custom":return Vl();default:return!1}},vl={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",file:"file"};function Re(l){const e=l.toLowerCase();return vl[e]||e}function Sl(l){if(Array.isArray(l)){const n=[];return l.forEach(s=>{const o={...s};o.name=(s.name||s.id||s.key).toString(),o.type=Re(s.type),o.label=s.label||s.ua,o.rules=s.rules||s.validators,s.data&&(o.api=`/api/suggest/${s.data}`),n.push(o)}),n}const e=[];return Object.entries(l).forEach(n=>{const s={name:n[0],...n[1],type:Re(n[1].type),label:n[1].label||n[1].ua,rules:n[1].rules||n[1].validators};n[1].type.includes("list")&&(s.multiple=!0),n[1].data&&(s.api=`/api/suggest/${n[1].data}`),e.push(s)}),e}function Ml(l,e){const n=Sl(e),s=t.ref({});function o(d){const c=d?.conditions;if(!c)return!0;const u=Array.isArray(c)?c[0]:c,h=l?.value?.[u];return $e(h,c)}const a=(d=n,c=!0)=>(d.forEach(u=>{if(u.rules){if(!o(u)){console.log(u.name,"skip hidden"),delete s.value[u.name];return}u.rules.forEach(h=>{const p=Cl(l.value[u.name],h);p?s.value[u.name]=p:delete s.value[u.name]})}u.schema&&a(u.schema,!1)}),c&&Object.values(s.value).some(Boolean)?s.value:null),r=t.computed(()=>n?.filter(d=>o(d)));return{errors:s,validate:a,reset:()=>{l.value={},s.value={}},visibleSchema:r}}const ne=t.defineComponent({__name:"vs-compact-form",props:t.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},layout:{default:()=>"default"},formId:{default:()=>""}},{form:{default:()=>({})},formModifiers:{},values:{default:()=>({})},valuesModifiers:{}}),emits:t.mergeModels(["handle-submit"],["update:form","update:values"]),setup(l,{emit:e}){const n=e,s=l,o=t.useModel(l,"form"),a=t.useModel(l,"values"),{errors:r,validate:i,reset:d,visibleSchema:c}=Ml(a,s.schema),u=()=>{i(),n("handle-submit",a.value)};t.onMounted(()=>{o.value.value=a.value,o.value.errors=r.value,o.value.reset=d,o.value.validate=i,o.value.formId=s.formId});function h(p,C){if(p===C)return!0;if(typeof p!="object"||typeof C!="object"||!p||!C)return!1;const S=Object.keys(p),A=Object.keys(C);return S.length!==A.length?!1:S.every($=>p[$]===C[$])}return t.provide("form",o),t.provide("values",a),(p,C)=>(t.openBlock(),t.createElementBlock("form",{onSubmit:t.withModifiers(u,["prevent"]),class:t.normalizeClass(["grid grid-cols-12",p.layout==="default"?"gap-6":"gap-4"])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(c),S=>(t.openBlock(),t.createBlock(Te,{key:S.name,class:t.normalizeClass(p.layout==="horizontal"?"col-span-12":`col-span-${S.col||12} `),style:t.normalizeStyle(p.style),item:S,layout:p.layout,"model-value":a.value[S.name],"onUpdate:modelValue":A=>{const $=a.value[S.name];h($,A)||(a.value[S.name]=A)},error:t.unref(r)[S.name]},null,8,["class","style","item","layout","model-value","onUpdate:modelValue","error"]))),128))],34))}});ne.install=function(e){e.component("VForm",ne),e.config.globalProperties.$form=te,e.provide("form",te),window.v3plugin||(window.v3plugin={}),window.v3plugin.$form=e.config.globalProperties.$form};function Y(l){return typeof l=="string"||l instanceof String}function je(l){var e;return typeof l=="object"&&l!=null&&(l==null||(e=l.constructor)==null?void 0:e.name)==="Object"}function ze(l,e){return Array.isArray(e)?ze(l,(n,s)=>e.includes(s)):Object.entries(l).reduce((n,s)=>{let[o,a]=s;return e(a,o)&&(n[o]=a),n},{})}const b={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Ue(l){switch(l){case b.LEFT:return b.FORCE_LEFT;case b.RIGHT:return b.FORCE_RIGHT;default:return l}}function _e(l){return l.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function fe(l,e){if(e===l)return!0;const n=Array.isArray(e),s=Array.isArray(l);let o;if(n&&s){if(e.length!=l.length)return!1;for(o=0;o<e.length;o++)if(!fe(e[o],l[o]))return!1;return!0}if(n!=s)return!1;if(e&&l&&typeof e=="object"&&typeof l=="object"){const a=e instanceof Date,r=l instanceof Date;if(a&&r)return e.getTime()==l.getTime();if(a!=r)return!1;const i=e instanceof RegExp,d=l instanceof RegExp;if(i&&d)return e.toString()==l.toString();if(i!=d)return!1;const c=Object.keys(e);for(o=0;o<c.length;o++)if(!Object.prototype.hasOwnProperty.call(l,c[o]))return!1;for(o=0;o<c.length;o++)if(!fe(l[c[o]],e[c[o]]))return!1;return!0}else if(e&&l&&typeof e=="function"&&typeof l=="function")return e.toString()===l.toString();return!1}class Fl{constructor(e){for(Object.assign(this,e);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?b.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?b.RIGHT:b.LEFT}}function w(l,e){return new w.InputMask(l,e)}function Pe(l){if(l==null)throw new Error("mask property should be defined");return l instanceof RegExp?w.MaskedRegExp:Y(l)?w.MaskedPattern:l===Date?w.MaskedDate:l===Number?w.MaskedNumber:Array.isArray(l)||l===Array?w.MaskedDynamic:w.Masked&&l.prototype instanceof w.Masked?l:w.Masked&&l instanceof w.Masked?l.constructor:l instanceof Function?w.MaskedFunction:(console.warn("Mask not found for mask",l),w.Masked)}function ee(l){if(!l)throw new Error("Options in not defined");if(w.Masked){if(l.prototype instanceof w.Masked)return{mask:l};const{mask:e=void 0,...n}=l instanceof w.Masked?{mask:l}:je(l)&&l.mask instanceof w.Masked?l:{};if(e){const s=e.mask;return{...ze(e,(o,a)=>!a.startsWith("_")),mask:e.constructor,_mask:s,...n}}}return je(l)?{...l}:{mask:l}}function G(l){if(w.Masked&&l instanceof w.Masked)return l;const e=ee(l),n=Pe(e.mask);if(!n)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===n&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new n(e)}w.createMask=G;class ge{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,n){if(!(e==null||n==null||e===this.selectionStart&&n===this.selectionEnd))try{this._unsafeSelect(e,n)}catch{}}get isActive(){return!1}}w.MaskElement=ge;const He=90,Nl=89;class se extends ge{constructor(e){super(),this.input=e,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 e,n,s;return(e=(n=(s=this.input).getRootNode)==null?void 0:n.call(s))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){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",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===He&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===Nl&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===He&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType==="historyUndo"&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType==="historyRedo"&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}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={}}}w.HTMLMaskElement=se;class qe extends se{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,n){this.input.setSelectionRange(e,n)}get value(){return this.input.value}set value(e){this.input.value=e}}w.HTMLMaskElement=se;class we extends se{get _unsafeSelectionStart(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),s=n&&n.anchorOffset,o=n&&n.focusOffset;return o==null||s==null||s<o?s:o}get _unsafeSelectionEnd(){const e=this.rootElement,n=e.getSelection&&e.getSelection(),s=n&&n.anchorOffset,o=n&&n.focusOffset;return o==null||s==null||s>o?s:o}_unsafeSelect(e,n){if(!this.rootElement.createRange)return;const s=this.rootElement.createRange();s.setStart(this.input.firstChild||this.input,e),s.setEnd(this.input.lastChild||this.input,n);const o=this.rootElement,a=o.getSelection&&o.getSelection();a&&(a.removeAllRanges(),a.addRange(s))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}w.HTMLContenteditableMaskElement=we;class ke{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>ke.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,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}}ke.MAX_LENGTH=100;class Ge{constructor(e,n){this.el=e instanceof ge?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new we(e):new qe(e),this.masked=G(n),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new ke,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(e){var n;return e==null||((n=this.masked)==null?void 0:n.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof w.Masked)&&this.masked.constructor===Pe(e)){this.masked.updateOptions({mask:e});return}const n=e instanceof w.Masked?e:G({mask:e});n.unmaskedValue=this.masked.unmaskedValue,this.masked=n}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,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(e,n){const s=this._listeners[e];s&&s.forEach(o=>o(n))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),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(e){const n=this.masked.unmaskedValue,s=this.masked.value,o=this.masked.rawInputValue,a=this.displayValue,r=this.unmaskedValue!==n||this.value!==s||this._rawInputValue!==o;this._unmaskedValue=n,this._value=s,this._rawInputValue=o,this.el.value!==a&&(this.el.value=a),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),r&&this._fireChangeEvents(),!this._historyChanging&&(r||this.history.isEmpty)&&this.history.push({unmaskedValue:n,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:n,...s}=e,o=!this.maskEquals(n),a=this.masked.optionsIsChanged(s);o&&(this.mask=n),a&&this.masked.updateOptions(s),(o||a)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,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,b.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,n){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(n),this}off(e,n){if(!this._listeners[e])return this;if(!n)return delete this._listeners[e],this;const s=this._listeners[e].indexOf(n);return s>=0&&this._listeners[e].splice(s,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const n=new Fl({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),s=this.masked.rawInputValue,o=this.masked.splice(n.startChangePos,n.removed.length,n.inserted,n.removeDirection,{input:!0,raw:!0}).offset,a=s===this.masked.rawInputValue?n.removeDirection:b.NONE;let r=this.masked.nearestInputPos(n.startChangePos+o,a);a!==b.NONE&&(r=this.masked.nearestInputPos(r,b.NONE)),this.updateControl(r),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}w.InputMask=Ge;class V{static normalize(e){return Array.isArray(e)?e:[e,new V]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}w.ChangeDetails=V;class K{constructor(e,n,s){e===void 0&&(e=""),n===void 0&&(n=0),this.value=e,this.from=n,this.stop=s}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const n=this.value[0];return this.value=this.value.slice(1),n}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class D{constructor(e){this._value="",this._update({...D.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,n){n===void 0&&(n={input:!0}),this.reset(),this.append(e,n,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,n){return e}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),Math.min(this.displayValue.length,n-e)}extractInput(e,n,s){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this.displayValue.slice(e,n)}extractTail(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),new K(this.extractInput(e,n),e)}appendTail(e){return Y(e)&&(e=new K(String(e))),e.appendTo(this)}_appendCharRaw(e,n){return e?(this._value+=e,new V({inserted:e,rawInserted:e})):new V}_appendChar(e,n,s){n===void 0&&(n={});const o=this.state;let a;if([e,a]=this.doPrepareChar(e,n),e&&(a=a.aggregate(this._appendCharRaw(e,n)),!a.rawInserted&&this.autofix==="pad")){const r=this.state;this.state=o;let i=this.pad(n);const d=this._appendCharRaw(e,n);i=i.aggregate(d),d.rawInserted||i.equals(a)?a=i:this.state=r}if(a.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<a.rawInserted.length;++u)s.unshift(this.displayValue.length-a.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<a.rawInserted.length;++u)s.shift();c=this.appendTail(s),i=c.rawInserted.length===s.toString().length}i&&c.inserted&&(this.state=d)}i||(a=new V,this.state=o,s&&r&&(s.state=r))}return a}_appendPlaceholder(){return new V}_appendEager(){return new V}append(e,n,s){if(!Y(e))throw new Error("value should be string");const o=Y(s)?new K(String(s)):s;n!=null&&n.tail&&(n._beforeTailState=this.state);let a;[e,a]=this.doPrepare(e,n);for(let r=0;r<e.length;++r){const i=this._appendChar(e[r],n,o);if(!i.rawInserted&&!this.doSkipInvalid(e[r],n,o))break;a.aggregate(i)}return(this.eager===!0||this.eager==="append")&&n!=null&&n.input&&e&&a.aggregate(this._appendEager()),o!=null&&(a.tailShift+=this.appendTail(o).tailShift),a}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(n),new V}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const n=this.rawInputValue,s=this.value,o=e();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,o}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const n=this.state,s=e(this);return this.state=n,delete this._isolated,s}doSkipInvalid(e,n,s){return!!this.skipInvalid}doPrepare(e,n){return n===void 0&&(n={}),V.normalize(this.prepare?this.prepare(e,this,n):e)}doPrepareChar(e,n){return n===void 0&&(n={}),V.normalize(this.prepareChar?this.prepareChar(e,this,n):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,n,s,o,a){s===void 0&&(s=""),o===void 0&&(o=b.NONE),a===void 0&&(a={input:!0});const r=e+n,i=this.extractTail(r),d=this.eager===!0||this.eager==="remove";let c;d&&(o=Ue(o),c=this.extractInput(0,r,{raw:!0}));let u=e;const h=new V;if(o!==b.NONE&&(u=this.nearestInputPos(e,n>1&&e!==0&&!d?b.NONE:o),h.tailShift=u-e),h.aggregate(this.remove(u)),d&&o!==b.NONE&&c===this.rawInputValue)if(o===b.FORCE_LEFT){let p;for(;c===this.rawInputValue&&(p=this.displayValue.length);)h.aggregate(new V({tailShift:-1})).aggregate(this.remove(p-1))}else o===b.FORCE_RIGHT&&i.unshift();return h.aggregate(this.append(s,a,i))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!fe(this,e)}typedValueEquals(e){const n=this.typedValue;return e===n||D.EMPTY_VALUES.includes(e)&&D.EMPTY_VALUES.includes(n)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new V}}D.DEFAULTS={skipInvalid:!0},D.EMPTY_VALUES=[void 0,null,""],w.Masked=D;class J{constructor(e,n){e===void 0&&(e=[]),n===void 0&&(n=0),this.chunks=e,this.from=n}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=Y(e)?new K(String(e)):e;const n=this.chunks[this.chunks.length-1],s=n&&(n.stop===e.stop||e.stop==null)&&e.from===n.from+n.toString().length;if(e instanceof K)s?n.extend(e.toString()):this.chunks.push(e);else if(e instanceof J){if(e.stop==null){let o;for(;e.chunks.length&&e.chunks[0].stop==null;)o=e.chunks.shift(),o.from+=e.from,this.extend(o)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof w.MaskedPattern))return new K(this.toString()).appendTo(e);const n=new V;for(let s=0;s<this.chunks.length;++s){const o=this.chunks[s],a=e._mapPosToBlock(e.displayValue.length),r=o.stop;let i;if(r!=null&&(!a||a.index<=r)&&((o instanceof J||e._stops.indexOf(r)>=0)&&n.aggregate(e._appendPlaceholder(r)),i=o instanceof J&&e._blocks[r]),i){const d=i.appendTail(o);n.aggregate(d);const c=o.toString().slice(d.rawInserted.length);c&&n.aggregate(e.append(c,{tail:!0}))}else n.aggregate(e.append(o.toString(),{tail:!0}))}return n}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:n,...s}=e;Object.assign(this,s),this.chunks=n.map(o=>{const a="chunks"in o?new J:new K;return a.state=o,a})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const n=e!=null?e-this.from:e;let s=0;for(;s<this.chunks.length;){const o=this.chunks[s],a=o.unshift(n);if(o.toString()){if(!a)break;++s}else this.chunks.splice(s,1);if(a)return a}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const n=this.chunks[e],s=n.shift();if(n.toString()){if(!s)break;--e}else this.chunks.splice(e,1);if(s)return s}return""}}class Al{constructor(e,n){this.masked=e,this._log=[];const{offset:s,index:o}=e._mapPosToBlock(n)||(n<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=s,this.index=o,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(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}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(e){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(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())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,b.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,b.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,b.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,b.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,b.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,b.NONE),!0})}}class Ee{constructor(e){Object.assign(this,e),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(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(n),this._value||(this._isRawInput=!1),new V}nearestInputPos(e,n){n===void 0&&(n=b.NONE);const s=0,o=this._value.length;switch(n){case b.LEFT:case b.FORCE_LEFT:return s;case b.NONE:case b.RIGHT:case b.FORCE_RIGHT:default:return o}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),this._isRawInput?n-e:0}extractInput(e,n,s){return e===void 0&&(e=0),n===void 0&&(n=this._value.length),s===void 0&&(s={}),s.raw&&this._isRawInput&&this._value.slice(e,n)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,n){if(n===void 0&&(n={}),this.isFilled)return new V;const s=this.eager===!0||this.eager==="append",a=this.char===e&&(this.isUnmasking||n.input||n.raw)&&(!n.raw||!s)&&!n.tail,r=new V({inserted:this.char,rawInserted:a?this.char:""});return this._value=this.char,this._isRawInput=a&&(n.raw||n.input),r}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new V;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new K("")}appendTail(e){return Y(e)&&(e=new K(String(e))),e.appendTo(this)}append(e,n,s){const o=this._appendChar(e[0],n);return s!=null&&(o.tailShift+=this.appendTail(s).tailShift),o}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class oe{constructor(e){const{parent:n,isOptional:s,placeholderChar:o,displayChar:a,lazy:r,eager:i,...d}=e;this.masked=G(d),Object.assign(this,{parent:n,isOptional:s,placeholderChar:o,displayChar:a,lazy:r,eager:i})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),e===0&&n>=1?(this.isFilled=!1,this.masked.remove(e,n)):new V}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(e,n){if(n===void 0&&(n={}),this.isFilled)return new V;const s=this.masked.state;let o=this.masked._appendChar(e,this.currentMaskFlags(n));return o.inserted&&this.doValidate(n)===!1&&(o=new V,this.masked.state=s),!o.inserted&&!this.isOptional&&!this.lazy&&!n.input&&(o.inserted=this.placeholderChar),o.skip=!o.inserted&&!this.isOptional,this.isFilled=!!o.inserted,o}append(e,n,s){return this.masked.append(e,this.currentMaskFlags(n),s)}_appendPlaceholder(){return this.isFilled||this.isOptional?new V:(this.isFilled=!0,new V({inserted:this.placeholderChar}))}_appendEager(){return new V}extractTail(e,n){return this.masked.extractTail(e,n)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,n,s){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.masked.extractInput(e,n,s)}nearestInputPos(e,n){n===void 0&&(n=b.NONE);const s=0,o=this.value.length,a=Math.min(Math.max(e,s),o);switch(n){case b.LEFT:case b.FORCE_LEFT:return this.isComplete?a:s;case b.RIGHT:case b.FORCE_RIGHT:return this.isComplete?a:o;case b.NONE:default:return a}}totalInputPositions(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.value.length),this.value.slice(e,n).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var n;return{...e,_beforeTailState:(e==null||(n=e._beforeTailState)==null?void 0:n.masked)||e?._beforeTailState}}pad(e){return new V}}oe.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 Ke extends D{updateOptions(e){super.updateOptions(e)}_update(e){const n=e.mask;n&&(e.validate=s=>s.search(n)>=0),super._update(e)}}w.MaskedRegExp=Ke;class I extends D{constructor(e){super({...I.DEFAULTS,...e,definitions:Object.assign({},oe.DEFAULT_DEFINITIONS,e?.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const n=this.mask;if(!n||!e)return;let s=!1,o=!1;for(let a=0;a<n.length;++a){if(this.blocks){const c=n.slice(a),u=Object.keys(this.blocks).filter(p=>c.indexOf(p)===0);u.sort((p,C)=>C.length-p.length);const h=u[0];if(h){const{expose:p,repeat:C,...S}=ee(this.blocks[h]),A={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...S,repeat:C,parent:this},$=C!=null?new w.RepeatBlock(A):G(A);$&&(this._blocks.push($),p&&(this.exposeBlock=$),this._maskedBlocks[h]||(this._maskedBlocks[h]=[]),this._maskedBlocks[h].push(this._blocks.length-1)),a+=h.length-1;continue}}let r=n[a],i=r in e;if(r===I.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(r==="{"||r==="}"){s=!s;continue}if(r==="["||r==="]"){o=!o;continue}if(r===I.ESCAPE_CHAR){if(++a,r=n[a],!r)break;i=!1}const d=i?new oe({isOptional:o,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...ee(e[r]),parent:this}):new Ee({char:r,eager:this.eager,isUnmasking:s});this._blocks.push(d)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e){this.reset();return}const{_blocks:n,...s}=e;this._blocks.forEach((o,a)=>o.state=n[a]),super.state=s}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,n)=>e+=n.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(n),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,n)=>e+=n.value,"")}set value(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(n),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const n=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(n),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,n)=>e+=n.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const n=new V;let s=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(s==null)return n;this._blocks[s].isFilled&&++s;for(let o=s;o<this._blocks.length;++o){const a=this._blocks[o]._appendEager();if(!a.inserted)break;n.aggregate(a)}return n}_appendCharRaw(e,n){n===void 0&&(n={});const s=this._mapPosToBlock(this.displayValue.length),o=new V;if(!s)return o;for(let r=s.index,i;i=this._blocks[r];++r){var a;const d=i._appendChar(e,{...n,_beforeTailState:(a=n._beforeTailState)==null||(a=a._blocks)==null?void 0:a[r]});if(o.aggregate(d),d.consumed)break}return o}extractTail(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const s=new J;return e===n||this._forEachBlocksInRange(e,n,(o,a,r,i)=>{const d=o.extractTail(r,i);d.stop=this._findStopBefore(a),d.from=this._blockStartPos(a),d instanceof J&&(d.blockIndex=a),s.extend(d)}),s}extractInput(e,n,s){if(e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),s===void 0&&(s={}),e===n)return"";let o="";return this._forEachBlocksInRange(e,n,(a,r,i,d)=>{o+=a.extractInput(i,d,s)}),o}_findStopBefore(e){let n;for(let s=0;s<this._stops.length;++s){const o=this._stops[s];if(o<=e)n=o;else break}return n}_appendPlaceholder(e){const n=new V;if(this.lazy&&e==null)return n;const s=this._mapPosToBlock(this.displayValue.length);if(!s)return n;const o=s.index,a=e??this._blocks.length;return this._blocks.slice(o,a).forEach(r=>{if(!r.lazy||e!=null){var i;n.aggregate(r._appendPlaceholder((i=r._blocks)==null?void 0:i.length))}}),n}_mapPosToBlock(e){let n="";for(let s=0;s<this._blocks.length;++s){const o=this._blocks[s],a=n.length;if(n+=o.displayValue,e<=n.length)return{index:s,offset:e-a}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((n,s)=>n+=s.displayValue.length,0)}_forEachBlocksInRange(e,n,s){n===void 0&&(n=this.displayValue.length);const o=this._mapPosToBlock(e);if(o){const a=this._mapPosToBlock(n),r=a&&o.index===a.index,i=o.offset,d=a&&r?a.offset:this._blocks[o.index].displayValue.length;if(s(this._blocks[o.index],o.index,i,d),a&&!r){for(let c=o.index+1;c<a.index;++c)s(this._blocks[c],c,0,this._blocks[c].displayValue.length);s(this._blocks[a.index],a.index,0,a.offset)}}}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const s=super.remove(e,n);return this._forEachBlocksInRange(e,n,(o,a,r,i)=>{s.aggregate(o.remove(r,i))}),s}nearestInputPos(e,n){if(n===void 0&&(n=b.NONE),!this._blocks.length)return 0;const s=new Al(this,e);if(n===b.NONE)return s.pushRightBeforeInput()||(s.popState(),s.pushLeftBeforeInput())?s.pos:this.displayValue.length;if(n===b.LEFT||n===b.FORCE_LEFT){if(n===b.LEFT){if(s.pushRightBeforeFilled(),s.ok&&s.pos===e)return e;s.popState()}if(s.pushLeftBeforeInput(),s.pushLeftBeforeRequired(),s.pushLeftBeforeFilled(),n===b.LEFT){if(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.ok&&s.pos<=e||(s.popState(),s.ok&&s.pos<=e))return s.pos;s.popState()}return s.ok?s.pos:n===b.FORCE_LEFT?0:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:0)}return n===b.RIGHT||n===b.FORCE_RIGHT?(s.pushRightBeforeInput(),s.pushRightBeforeRequired(),s.pushRightBeforeFilled()?s.pos:n===b.FORCE_RIGHT?this.displayValue.length:(s.popState(),s.ok||(s.popState(),s.ok)?s.pos:this.nearestInputPos(e,b.LEFT))):e}totalInputPositions(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);let s=0;return this._forEachBlocksInRange(e,n,(o,a,r,i)=>{s+=o.totalInputPositions(r,i)}),s}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const n=this._maskedBlocks[e];return n?n.map(s=>this._blocks[s]):[]}pad(e){const n=new V;return this._forEachBlocksInRange(0,this.displayValue.length,s=>n.aggregate(s.pad(e))),n}}I.DEFAULTS={...D.DEFAULTS,lazy:!0,placeholderChar:"_"},I.STOP_CHAR="`",I.ESCAPE_CHAR="\\",I.InputDefinition=oe,I.FixedDefinition=Ee,w.MaskedPattern=I;class ae extends I{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:n=this.to||0,from:s=this.from||0,maxLength:o=this.maxLength||0,autofix:a=this.autofix,...r}=e;this.to=n,this.from=s,this.maxLength=Math.max(String(n).length,o),this.autofix=a;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(e){let n="",s="";const[,o,a]=e.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(n="0".repeat(o.length)+a,s="9".repeat(o.length)+a),n=n.padEnd(this.maxLength,"0"),s=s.padEnd(this.maxLength,"9"),[n,s]}doPrepareChar(e,n){n===void 0&&(n={});let s;return[e,s]=super.doPrepareChar(e.replace(/\D/g,""),n),e||(s.skip=!this.isComplete),[e,s]}_appendCharRaw(e,n){if(n===void 0&&(n={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,n);const s=String(this.from).padStart(this.maxLength,"0"),o=String(this.to).padStart(this.maxLength,"0"),[a,r]=this.boundaries(this.value+e);return Number(r)<this.from?super._appendCharRaw(s[this.value.length],n):Number(a)>this.to?!n.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(s[this.value.length],n).aggregate(this._appendCharRaw(e,n)):super._appendCharRaw(o[this.value.length],n):super._appendCharRaw(e,n)}doValidate(e){const n=this.value;if(n.search(/[^0]/)===-1&&n.length<=this._matchFrom)return!0;const[o,a]=this.boundaries(n);return this.from<=Number(a)&&Number(o)<=this.to&&super.doValidate(e)}pad(e){const n=new V;if(this.value.length===this.maxLength)return n;const s=this.value,o=this.maxLength-this.value.length;if(o){this.reset();for(let a=0;a<o;++a)n.aggregate(super._appendCharRaw("0",e));s.split("").forEach(a=>this._appendCharRaw(a))}return n}}w.MaskedRange=ae;const $l="d{.}`m{.}`Y";class Z extends I{static extractPatternOptions(e){const{mask:n,pattern:s,...o}=e;return{...o,mask:Y(n)?n:s}}constructor(e){super(Z.extractPatternOptions({...Z.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:n,pattern:s,blocks:o,...a}={...Z.DEFAULTS,...e},r=Object.assign({},Z.GET_DEFAULT_BLOCKS());e.min&&(r.Y.from=e.min.getFullYear()),e.max&&(r.Y.to=e.max.getFullYear()),e.min&&e.max&&r.Y.from===r.Y.to&&(r.m.from=e.min.getMonth()+1,r.m.to=e.max.getMonth()+1,r.m.from===r.m.to&&(r.d.from=e.min.getDate(),r.d.to=e.max.getDate())),Object.assign(r,this.blocks,o),super._update({...a,mask:Y(n)?n:s,blocks:r})}doValidate(e){const n=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&n!=null&&(this.min==null||this.min<=n)&&(this.max==null||n<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(Z.extractPatternOptions(e))}}Z.GET_DEFAULT_BLOCKS=()=>({d:{mask:ae,from:1,to:31,maxLength:2},m:{mask:ae,from:1,to:12,maxLength:2},Y:{mask:ae,from:1900,to:9999}}),Z.DEFAULTS={...I.DEFAULTS,mask:Date,pattern:$l,format:(l,e)=>{if(!l)return"";const n=String(l.getDate()).padStart(2,"0"),s=String(l.getMonth()+1).padStart(2,"0"),o=l.getFullYear();return[n,s,o].join(".")},parse:(l,e)=>{const[n,s,o]=l.split(".").map(Number);return new Date(o,s-1,n)}},w.MaskedDate=Z;class le extends D{constructor(e){super({...le.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(n=>{const{expose:s,...o}=ee(n),a=G({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...o});return s&&(this.exposeMask=a),a}):[])}_appendCharRaw(e,n){n===void 0&&(n={});const s=this._applyDispatch(e,n);return this.currentMask&&s.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(n))),s}_applyDispatch(e,n,s){e===void 0&&(e=""),n===void 0&&(n={}),s===void 0&&(s="");const o=n.tail&&n._beforeTailState!=null?n._beforeTailState._value:this.value,a=this.rawInputValue,r=n.tail&&n._beforeTailState!=null?n._beforeTailState._rawInputValue:a,i=a.slice(r.length),d=this.currentMask,c=new V,u=d?.state;return this.currentMask=this.doDispatch(e,{...n},s),this.currentMask&&(this.currentMask!==d?(this.currentMask.reset(),r&&(this.currentMask.append(r,{raw:!0}),c.tailShift=this.currentMask.value.length-o.length),i&&(c.tailShift+=this.currentMask.append(i,{raw:!0,tail:!0}).tailShift)):u&&(this.currentMask.state=u)),c}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const n=new V;return e&&n.aggregate(this._applyDispatch("",{},e)),n.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var n,s;return{...e,_beforeTailState:((n=e._beforeTailState)==null?void 0:n.currentMaskRef)===this.currentMask&&((s=e._beforeTailState)==null?void 0:s.currentMask)||e._beforeTailState}}doDispatch(e,n,s){return n===void 0&&(n={}),s===void 0&&(s=""),this.dispatch(e,this,n,s)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,n){n===void 0&&(n={});let[s,o]=super.doPrepare(e,n);if(this.currentMask){let a;[s,a]=super.doPrepare(s,this.currentMaskFlags(n)),o=o.aggregate(a)}return[s,o]}doPrepareChar(e,n){n===void 0&&(n={});let[s,o]=super.doPrepareChar(e,n);if(this.currentMask){let a;[s,a]=super.doPrepareChar(s,this.currentMaskFlags(n)),o=o.aggregate(a)}return[s,o]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(n=>n.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let n=String(e);this.currentMask&&(this.currentMask.typedValue=e,n=this.currentMask.unmaskedValue),this.unmaskedValue=n}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,n){const s=new V;return this.currentMask&&s.aggregate(this.currentMask.remove(e,n)).aggregate(this._applyDispatch()),s}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(n=>n.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:n,currentMaskRef:s,currentMask:o,...a}=e;n&&this.compiledMasks.forEach((r,i)=>r.state=n[i]),s!=null&&(this.currentMask=s,this.currentMask.state=o),super.state=a}extractInput(e,n,s){return this.currentMask?this.currentMask.extractInput(e,n,s):""}extractTail(e,n){return this.currentMask?this.currentMask.extractTail(e,n):super.extractTail(e,n)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,n){return this.currentMask?this.currentMask.nearestInputPos(e,n):super.nearestInputPos(e,n)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((n,s)=>{if(!e[s])return;const{mask:o,...a}=e[s];return fe(n,a)&&n.maskEquals(o)}):super.maskEquals(e)}typedValueEquals(e){var n;return!!((n=this.currentMask)!=null&&n.typedValueEquals(e))}}le.DEFAULTS={...D.DEFAULTS,dispatch:(l,e,n,s)=>{if(!e.compiledMasks.length)return;const o=e.rawInputValue,a=e.compiledMasks.map((r,i)=>{const d=e.currentMask===r,c=d?r.displayValue.length:r.nearestInputPos(r.displayValue.length,b.FORCE_LEFT);return r.rawInputValue!==o?(r.reset(),r.append(o,{raw:!0})):d||r.remove(c),r.append(l,e.currentMaskFlags(n)),r.appendTail(s),{index:i,weight:r.rawInputValue.length,totalInputPositions:r.totalInputPositions(0,Math.max(c,r.nearestInputPos(r.displayValue.length,b.FORCE_LEFT)))}});return a.sort((r,i)=>i.weight-r.weight||i.totalInputPositions-r.totalInputPositions),e.compiledMasks[a[0].index]}},w.MaskedDynamic=le;class re extends I{constructor(e){super({...re.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:n,...s}=e;if(n){const o=n.map(i=>i.length),a=Math.min(...o),r=Math.max(...o)-a;s.mask="*".repeat(a),r&&(s.mask+="["+"*".repeat(r)+"]"),this.enum=n}super._update(s)}_appendCharRaw(e,n){n===void 0&&(n={});const s=Math.min(this.nearestInputPos(0,b.FORCE_RIGHT),this.value.length),o=this.enum.filter(a=>this.matchValue(a,this.unmaskedValue+e,s));if(o.length){o.length===1&&this._forEachBlocksInRange(0,this.value.length,(r,i)=>{const d=o[0][i];i>=this.value.length||d===r.value||(r.reset(),r._appendChar(d,n))});const a=super._appendCharRaw(o[0][this.value.length],n);return o.length===1&&o[0].slice(this.unmaskedValue.length).split("").forEach(r=>a.aggregate(super._appendCharRaw(r))),a}return new V({skip:!this.isComplete})}extractTail(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),new K("",e)}remove(e,n){if(e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),e===n)return new V;const s=Math.min(super.nearestInputPos(0,b.FORCE_RIGHT),this.value.length);let o;for(o=e;o>=0&&!(this.enum.filter(i=>this.matchValue(i,this.value.slice(s,o),s)).length>1);--o);const a=super.remove(o,n);return a.tailShift+=o-e,a}get isComplete(){return this.enum.indexOf(this.value)>=0}}re.DEFAULTS={...I.DEFAULTS,matchValue:(l,e,n)=>l.indexOf(e,n)===n},w.MaskedEnum=re;class Ze extends D{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}w.MaskedFunction=Ze;var Ye;class z extends D{constructor(e){super({...z.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),n="\\d*",s=(this.scale?"("+_e(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+n+s),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(_e).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(_e(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const n=e.split(this.radix);return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),n.join(this.radix)}doPrepareChar(e,n){n===void 0&&(n={});const[s,o]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(n.input&&n.raw||!n.input&&!n.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),n);return e&&!s&&(o.skip=!0),s&&!this.allowPositive&&!this.value&&s!=="-"&&o.aggregate(this._appendChar("-")),[s,o]}_separatorsCount(e,n){n===void 0&&(n=!1);let s=0;for(let o=0;o<e;++o)this._value.indexOf(this.thousandsSeparator,o)===o&&(++s,n&&(e+=this.thousandsSeparator.length));return s}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,n,s){return e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n),this._removeThousandsSeparators(super.extractInput(e,n,s))}_appendCharRaw(e,n){n===void 0&&(n={});const s=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,o=this._separatorsCountFromSlice(s);this._value=this._removeThousandsSeparators(this.value);const a=this._value;this._value+=e;const r=this.number;let i=!isNaN(r),d=!1;if(i){let p;this.min!=null&&this.min<0&&this.number<this.min&&(p=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(p=this.max),p!=null&&(this.autofix?(this._value=this.format(p,this).replace(z.UNMASKED_RADIX,this.radix),d||(d=a===this._value&&!n.tail)):i=!1),i&&(i=!!this._value.match(this._numberRegExp))}let c;i?c=new V({inserted:this._value.slice(a.length),rawInserted:d?"":e,skip:d}):(this._value=a,c=new V),this._value=this._insertThousandsSeparators(this._value);const u=n.tail&&n._beforeTailState?n._beforeTailState._value:this._value,h=this._separatorsCountFromSlice(u);return c.tailShift+=(h-o)*this.thousandsSeparator.length,c}_findSeparatorAround(e){if(this.thousandsSeparator){const n=e-this.thousandsSeparator.length+1,s=this.value.indexOf(this.thousandsSeparator,n);if(s<=e)return s}return-1}_adjustRangeWithSeparators(e,n){const s=this._findSeparatorAround(e);s>=0&&(e=s);const o=this._findSeparatorAround(n);return o>=0&&(n=o+this.thousandsSeparator.length),[e,n]}remove(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length),[e,n]=this._adjustRangeWithSeparators(e,n);const s=this.value.slice(0,e),o=this.value.slice(n),a=this._separatorsCount(s.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(s+o));const r=this._separatorsCountFromSlice(s);return new V({tailShift:(r-a)*this.thousandsSeparator.length})}nearestInputPos(e,n){if(!this.thousandsSeparator)return e;switch(n){case b.NONE:case b.LEFT:case b.FORCE_LEFT:{const s=this._findSeparatorAround(e-1);if(s>=0){const o=s+this.thousandsSeparator.length;if(e<o||this.value.length<=o||n===b.FORCE_LEFT)return s}break}case b.RIGHT:case b.FORCE_RIGHT:{const s=this._findSeparatorAround(e);if(s>=0)return s+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let n=e;this.min!=null&&(n=Math.max(n,this.min)),this.max!=null&&(n=Math.min(n,this.max)),n!==e&&(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(e){const n=this._removeThousandsSeparators(e).split(this.radix);return n[0]=n[0].replace(/^(\D*)(0*)(\d*)/,(s,o,a,r)=>o+r),e.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(e){if(!e)return e;const n=e.split(this.radix);return n.length<2&&n.push(""),n[1]=n[1].padEnd(this.scale,"0"),n.join(this.radix)}doSkipInvalid(e,n,s){n===void 0&&(n={});const o=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===z.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,n,s)&&!o}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,z.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(z.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}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(e){return(super.typedValueEquals(e)||z.EMPTY_VALUES.includes(e)&&z.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}Ye=z,z.UNMASKED_RADIX=".",z.EMPTY_VALUES=[...D.EMPTY_VALUES,0],z.DEFAULTS={...D.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[Ye.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:l=>l.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},w.MaskedNumber=z;const ye={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Be(l,e,n){e===void 0&&(e=ye.MASKED),n===void 0&&(n=ye.MASKED);const s=G(l);return o=>s.runIsolated(a=>(a[e]=o,a[n]))}function Je(l,e,n,s){return Be(e,n,s)(l)}w.PIPE_TYPE=ye,w.createPipe=Be,w.pipe=Je;class We extends I{get repeatFrom(){var e;return(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?e:0}get repeatTo(){var e;return(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var n,s,o;const{repeat:a,...r}=ee(e);this._blockOpts=Object.assign({},this._blockOpts,r);const i=G(this._blockOpts);this.repeat=(n=(s=a??i.repeat)!=null?s:this.repeat)!=null?n:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((o=this._blocks)==null?void 0:o.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(e){if(e<this._blocks.length)return this._blocks[e];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(G(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,n){n===void 0&&(n={});const s=new V;for(let d=(o=(a=this._mapPosToBlock(this.displayValue.length))==null?void 0:a.index)!=null?o:Math.max(this._blocks.length-1,0),c,u;c=(r=this._blocks[d])!=null?r:u=!u&&this._allocateBlock(d);++d){var o,a,r,i;const h=c._appendChar(e,{...n,_beforeTailState:(i=n._beforeTailState)==null||(i=i._blocks)==null?void 0:i[d]});if(h.skip&&u){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(s.aggregate(h),h.consumed)break}return s}_trimEmptyTail(e,n){var s,o;e===void 0&&(e=0);const a=Math.max(((s=this._mapPosToBlock(e))==null?void 0:s.index)||0,this.repeatFrom,0);let r;n!=null&&(r=(o=this._mapPosToBlock(n))==null?void 0:o.index),r==null&&(r=this._blocks.length-1);let i=0;for(let d=r;a<=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(e,n){e===void 0&&(e=0),n===void 0&&(n=this.displayValue.length);const s=super.remove(e,n);return this._trimEmptyTail(e,n),s}totalInputPositions(e,n){return e===void 0&&(e=0),n==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,n)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}w.RepeatBlock=We;try{globalThis.IMask=w}catch{}const Dl=Object.freeze(Object.defineProperty({__proto__:null,ChangeDetails:V,ChunksTailDetails:J,DIRECTION:b,HTMLContenteditableMaskElement:we,HTMLInputMaskElement:qe,HTMLMaskElement:se,InputMask:Ge,MaskElement:ge,Masked:D,MaskedDate:Z,MaskedDynamic:le,MaskedEnum:re,MaskedFunction:Ze,MaskedNumber:z,MaskedPattern:I,MaskedRange:ae,MaskedRegExp:Ke,PIPE_TYPE:ye,PatternFixedDefinition:Ee,PatternInputDefinition:oe,RepeatBlock:We,createMask:G,createPipe:Be,default:w,forceDirection:Ue,normalizeOpts:ee,pipe:Je},Symbol.toStringTag,{value:"Module"}));q.ModalEdit=De,q.VForm=ne,q.VsInputText=be,q.default=ne,Object.defineProperties(q,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(q,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@opengis/core")):typeof define=="function"&&define.amd?define(["exports","vue","@opengis/core"],t):(q=typeof globalThis<"u"?globalThis:q||self,t(q.FormBuilder={},q.Vue,q.OpenGISCore))})(this,function(q,t,X){"use strict";const dt={class:"w-full relative"},ut={key:0,class:"text-[14px] font-medium text-gray-900 mb-2"},ct={key:0,class:"text-red-500 text-[14px]"},pt={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},ht=t.defineComponent({__name:"vs-layout-default",props:{ua:{default:""},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(a){return(e,s)=>(t.openBlock(),t.createElementBlock("div",dt,[e.ua||e.label?(t.openBlock(),t.createElementBlock("div",ut,[t.createElementVNode("span",null,t.toDisplayString(e.ua||e.label),1),e.item?.rules?.includes("required")?(t.openBlock(),t.createElementBlock("span",ct,"*")):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default",t.normalizeProps(t.guardReactiveProps(e.$attrs))),e.error?(t.openBlock(),t.createElementBlock("span",pt,t.toDisplayString(e.error),1)):t.createCommentVNode("",!0)]))}}),mt={class:"w-full relative flex flex-row items-center gap-2"},ft={key:0,class:"text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"},gt={key:0,class:"text-red-500 text-[14px]"},kt={key:1,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},bt=t.defineComponent({__name:"vs-layout-horizontal",props:{ua:{default:""},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(a){return(e,s)=>(t.openBlock(),t.createElementBlock("div",mt,[e.item?.type!=="html"?(t.openBlock(),t.createElementBlock("span",ft,[t.createTextVNode(t.toDisplayString(e.ua||e.label)+" ",1),e.item?.rules?.includes("required")&&(e.ua||e.label)?(t.openBlock(),t.createElementBlock("span",gt,"*")):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.renderSlot(e.$slots,"default",t.normalizeProps(t.guardReactiveProps(e.$attrs))),e.error?(t.openBlock(),t.createElementBlock("span",kt,t.toDisplayString(e.error),1)):t.createCommentVNode("",!0)]))}}),xt={class:"w-full relative"},yt={key:0,class:"text-red-500 text-[10px] absolute bottom-[-14px]"},_t={default:ht,horizontal:bt,inline:t.defineComponent({__name:"vs-layout-inline",props:{ua:{default:""},item:{default:()=>({})},error:{type:[String,Boolean],default:""},label:{default:""}},setup(a){return(e,s)=>(t.openBlock(),t.createElementBlock("div",xt,[t.renderSlot(e.$slots,"default",t.normalizeProps(t.guardReactiveProps(e.$attrs))),e.error?(t.openBlock(),t.createElementBlock("span",yt,t.toDisplayString(e.error),1)):t.createCommentVNode("",!0)]))}})};function Q(a){return{inputClass:t.computed(()=>{const s=`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"?`${s}h-[32px]`:`${s}h-[38px]`})}}const wt=["placeholder","disabled"],ve=t.defineComponent({__name:"vs-input-text",props:t.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 e=a,{inputClass:s}=Q(e.style),n=t.useModel(a,"modelValue");return(r,l)=>t.withDirectives((t.openBlock(),t.createElementBlock("input",{type:"text","onUpdate:modelValue":l[0]||(l[0]=o=>n.value=o),placeholder:r.placeholder,disabled:r.disabled,class:t.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[t.unref(s),{"!border-red-600":r.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,wt)),[[t.vModelText,n.value]])}}),Et=["placeholder"],Vt=t.defineComponent({__name:"vs-input-number",props:t.mergeModels({style:{default:()=>({})},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const e=a,{inputClass:s}=Q(e.style),n=t.useModel(a,"modelValue");return(r,l)=>t.withDirectives((t.openBlock(),t.createElementBlock("input",{type:"number",step:"any","onUpdate:modelValue":l[0]||(l[0]=o=>n.value=o),placeholder:r.placeholder,class:t.normalizeClass(["py-1.5 px-3 block w-full",[t.unref(s)]]),style:{border:"1px solid #CFD9E0"}},null,10,Et)),[[t.vModelText,n.value]])}}),$=(a,e)=>{const s=a.__vccOpts||a;for(const[n,r]of e)s[n]=r;return s},Ct={},Bt={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 vt(a,e){return t.openBlock(),t.createElementBlock("svg",Bt,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const St=$(Ct,[["render",vt]]),Nt={class:"flex items-center gap-[4px]"},Ft=["value","id","disabled"],Mt=["for"],At={class:"text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400"},$t=t.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:e}){const s=e,n=a,r=t.computed({get:()=>n.modelValue,set:l=>s("update:modelValue",l)});return(l,o)=>(t.openBlock(),t.createElementBlock("div",Nt,[t.withDirectives(t.createElementVNode("input",{type:"checkbox",value:l.value,"onUpdate:modelValue":o[0]||(o[0]=i=>r.value=i),class:t.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":l.disabled}]),id:l.id,disabled:l.disabled},null,10,Ft),[[t.vModelCheckbox,r.value]]),t.createElementVNode("label",{for:l.id,class:t.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":l.disabled}])},[t.createElementVNode("div",{class:t.normalizeClass(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded",[r.value?"bg-blue-600 border-blue-600":"bg-white border-gray-600",l.error?"border-red-600":""]])},[t.createVNode(St,{height:"12",width:"12"})],2),t.createElementVNode("span",At,[t.renderSlot(l.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(l.label),1)])])],10,Mt)]))}}),Dt=["name","value","disabled"],It={class:"flex items-center gap-[6px] text-[14px]"},Lt={key:0,class:"text-[16px]"},Tt=["src"],Rt=t.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:e}){const s=a,n=e,r=t.computed({get:()=>s.modelValue,set:i=>{n("update:modelValue",i)}}),l=t.computed(()=>Array.isArray(r.value)?r.value.includes(s.value):r.value===!0||r.value===s.value),o=t.computed(()=>s.style?.size==="xs"?"p-1.5 text-xs":s.style?.size==="lg"?"p-3.5 text-[20px]":"p-2.5 text-xs");return(i,d)=>(t.openBlock(),t.createElementBlock("label",{class:t.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",[o.value,l.value?"ring-blue-500":"border border-gray-200 ring-transparent"]])},[t.withDirectives(t.createElementVNode("input",{type:"checkbox",class:"hidden",name:i.id,value:i.value,"onUpdate:modelValue":d[0]||(d[0]=c=>r.value=c),disabled:i.disabled},null,8,Dt),[[t.vModelCheckbox,r.value]]),t.createElementVNode("span",It,[i.icon||i.imgUrl?(t.openBlock(),t.createElementBlock("span",Lt,[i.icon?(t.openBlock(),t.createElementBlock("i",{key:0,class:t.normalizeClass(i.icon)},null,2)):t.createCommentVNode("",!0),i.imgUrl?(t.openBlock(),t.createElementBlock("img",{key:1,src:i.imgUrl,width:"16",height:"16",alt:"icon"},null,8,Tt)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.renderSlot(i.$slots,"default",{},()=>[t.createTextVNode(t.toDisplayString(i.label),1)])])],2))}}),Ot={class:"flex items-center"},De=t.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:e}){const s=a,n=e,r=`radio-${Math.floor(Math.random()*1e4)}`,l=t.computed({get:()=>Array.isArray(s.modelValue)?Array.isArray(s.modelValue)&&s.modelValue.includes(s.value):s.modelValue,set:i=>{if(Array.isArray(s.modelValue)){let d=[...s.modelValue];i?d.includes(s.value)||d.push(s.value):d=d.filter(c=>c!==s.value),n("update:modelValue",d)}else n("update:modelValue",i)}}),o=t.ref(`vs-checkbox-${s.view||"default"}`);return(i,d)=>(t.openBlock(),t.createElementBlock("div",Ot,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.value==="vs-checkbox-buttons"?t.unref(Rt):t.unref($t)),{value:i.value,label:i.label,info:i.option?.info,disabled:i.disabled,modelValue:l.value,"onUpdate:modelValue":d[0]||(d[0]=c=>l.value=c),id:r,icon:i.icon,imgUrl:i.imgUrl,style:t.normalizeStyle(i.style),error:i.error},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(i.label),1)]),_:1},8,["value","label","info","disabled","modelValue","icon","imgUrl","style","error"]))]))}}),zt={},jt={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 Ut(a,e){return t.openBlock(),t.createElementBlock("svg",jt,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const Pt=$(zt,[["render",Ut]]),Ht={},qt={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 Gt(a,e){return t.openBlock(),t.createElementBlock("svg",qt,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M12 9h.01"},null,-1),t.createElementVNode("path",{d:"M11 12h1v4h1"},null,-1),t.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 Kt=$(Ht,[["render",Gt]]),Zt={key:0,class:"flex items-start gap-x-1"},Yt={key:0,class:"text-red-500 text-[14px]"},Jt=["title"],Wt=["disabled"],Ie=t.defineComponent({__name:"vs-input-switcher",props:t.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 e=a,s=t.useModel(a,"modelValue");return(n,r)=>e.view==="checkbox"?(t.openBlock(),t.createElementBlock("div",Zt,[t.createVNode(De,{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=l=>s.value=l),label:n.text,error:n.error||""},null,8,["modelValue","label","error"]),n.rules?.includes("required")?(t.openBlock(),t.createElementBlock("span",Yt,"*")):t.createCommentVNode("",!0),n.i?(t.openBlock(),t.createElementBlock("button",{key:1,class:"cursor-pointer",title:n.i,onClick:r[1]||(r[1]=t.withModifiers(()=>{},["prevent"]))},[t.createVNode(t.unref(Kt),{class:"text-gray-500 w-[14px] h-[14px]"})],8,Jt)):t.createCommentVNode("",!0)])):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:t.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",[s.value?`bg-${n.style?.primaryColor||"blue"}-500`:"bg-stone-200",n.customClass]]),disabled:n.disabled,onClick:r[2]||(r[2]=l=>s.value=!s.value)},[t.createElementVNode("span",{"data-state":"checked",class:t.normalizeClass(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform",[s.value?"translate-x-4":"translate-x-0"]])},null,2)],10,Wt))}}),Xt=["innerHTML"],Le=t.defineComponent({__name:"vs-input-static",props:{text:{default:""},html:{default:""},style:{},customClass:{default:""},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},setup(a){return(e,s)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.customClass),innerHTML:e.html?e.html:e.text},null,10,Xt))}}),Qt=["placeholder","disabled","name"],es=t.defineComponent({__name:"vs-input-mask",props:t.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 e=a,{inputClass:s}=Q(e.style),n=t.useModel(a,"modelValue"),r=t.ref(null);let l=null;return t.onMounted(async()=>{if(r.value){const{default:o}=await Promise.resolve().then(()=>so);l=o(r.value,{mask:e.mask||"",definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},lazy:!1,placeholderChar:e.placeholder}),l.on("accept",()=>{n.value=e.unmask?l.unmaskedValue:l.value}),l.on("complete",()=>{n.value=e.unmask?l.unmaskedValue:l.value}),l.value=n.value??""}}),t.onBeforeUnmount(()=>{l?.destroy()}),t.watch(()=>e.mask,o=>{l&&l.updateOptions({mask:o,definitions:{9:/[0-9]/,A:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/}})}),t.watch(n,o=>{l&&l.unmaskedValue!==o&&(l.value=o||"")}),(o,i)=>(t.openBlock(),t.createElementBlock("input",{type:"text",ref_key:"inputEl",ref:r,placeholder:o.placeholder,disabled:o.disabled,name:o.name,class:t.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[t.unref(s)]]),style:{border:"1px solid #CFD9E0"}},null,10,Qt))}}),ts={class:"relative w-full bg-white rounded-lg"},ss=["placeholder","disabled"],ns=t.defineComponent({__name:"vs-input-email",props:t.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 e=a,{inputClass:s}=Q(e.style),n=t.useModel(a,"modelValue");return(r,l)=>(t.openBlock(),t.createElementBlock("div",ts,[l[1]||(l[1]=t.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)),t.withDirectives(t.createElementVNode("input",{type:"email","onUpdate:modelValue":l[0]||(l[0]=o=>n.value=o),placeholder:r.placeholder,disabled:r.disabled,class:t.normalizeClass(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f]",[t.unref(s),{"!border-red-600":r.error}]]),style:{border:"1px solid #CFD9E0"}},null,10,ss),[[t.vModelText,n.value]])]))}}),rs=["value","disabled"],ls={class:"text-[13px] text-gray-700"},as=t.defineComponent({__name:"vs-input-radio-default",props:t.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const e=t.useModel(a,"modelValue");return(s,n)=>(t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(["flex items-center gap-0",[s.customClass]])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=r=>e.value=r),type:"radio",value:s.value,disabled:s.disabled,class:"hidden"},null,8,rs),[[t.vModelRadio,e.value]]),t.createElementVNode("span",{class:t.normalizeClass(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]",[`border-${s.style?.primaryColor||"blue"}-500`,s.disabled?"opacity-50 cursor-not-allowed":""]])},[e.value==s.value?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["w-[12px] h-[12px] shrink-0 rounded-full",[`bg-${s.style?.primaryColor||"blue"}-500`]])},null,2)):t.createCommentVNode("",!0)],2),t.createElementVNode("span",ls,t.toDisplayString(s.text),1)],2))}}),os=["value","disabled"],is={class:"text-[13px] text-gray-700"},ds={"vs-input-radio-default":as,"vs-input-radio-buttons":t.defineComponent({__name:"vs-input-radio-buttons",props:t.mergeModels({style:{},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{},value:{},text:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const e=t.useModel(a,"modelValue");return(s,n)=>(t.openBlock(),t.createElementBlock("label",{class:t.normalizeClass(["flex items-center border rounded-lg px-2 py-1",[e.value==s.value?`ring-2 ring-ring ring-${s.style?.primaryColor||"blue"}-500`:"",s.customClass]])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=r=>e.value=r),type:"radio",value:s.value,disabled:s.disabled,class:"hidden"},null,8,os),[[t.vModelRadio,e.value]]),t.createElementVNode("span",is,t.toDisplayString(s.text),1)],2))}})},Te=t.defineComponent({__name:"vs-input-radio",props:t.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 e=a,s=t.useModel(a,"modelValue"),n=t.computed(()=>ds[`vs-input-radio-${e.view}`]);return(r,l)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass([r.position==="horizontal"?"flex items-center flex-wrap gap-2":""])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.options,o=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.value),t.mergeProps({key:o?.id,text:o.text,value:o.id.toString(),checked:s.value===o.id,modelValue:s.value,"onUpdate:modelValue":l[0]||(l[0]=i=>s.value=i)},{ref_for:!0},r.$attrs),null,16,["text","value","checked","modelValue"]))),128))],2))}}),us=$(t.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:e}){const s=a,n=e,r=t.ref([]),l=t.reactive({}),o=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/${s.data}`).then(h=>h.json());r.value=u?.data||u}catch(u){console.error(u)}};return t.watch(()=>s.modelValue,u=>{if(typeof u=="boolean"&&r.value.length===1){const h=o(r.value[0]);l[h]=u}else if(Array.isArray(u)){const h=new Set(u);r.value.forEach(p=>{if(!p.disabled){const _=o(p);l[_]=h.has(_)}})}},{immediate:!0}),t.watch(l,()=>{if(!r.value.length){n("update:modelValue",null);return}const u=Object.entries(l).filter(([,h])=>h).map(([h])=>h);n("update:modelValue",u.length===0?null:u)},{deep:!0}),t.onMounted(()=>{if(s.data)c().then(()=>{if(typeof s.modelValue=="boolean"&&r.value.length===1){const u=o(r.value[0]);l[u]=s.modelValue}else if(Array.isArray(s.modelValue)){const u=new Set(s.modelValue);r.value.forEach(h=>{if(!h.disabled){const p=o(h);l[p]=u.has(p)}})}});else if(r.value=s.options,typeof s.modelValue=="boolean"&&r.value.length===1){const u=o(r.value[0]);l[u]=s.modelValue}else if(Array.isArray(s.modelValue)){const u=new Set(s.modelValue);r.value.forEach(h=>{if(!h.disabled){const p=o(h);l[p]=u.has(p)}})}}),(u,h)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["p-0 w-full gap-[6px]",[u.position==="vertical"?"flex-col":"",u.colSpan?"grid":"flex justify-start"]])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,p=>(t.openBlock(),t.createBlock(De,{modelValue:l[o(p)],"onUpdate:modelValue":_=>l[o(p)]=_,value:o(p),class:t.normalizeClass(d(u.colSpan)),disabled:p.disabled,label:i(p),key:o(p),icon:p?.icon,imgUrl:p?.imgUrl,option:p,view:u.view},null,8,["modelValue","onUpdate:modelValue","value","class","disabled","label","icon","imgUrl","option","view"]))),128))],2))}}),[["__scopeId","data-v-54f9e19c"]]),cs=["placeholder","disabled"],ps=t.defineComponent({__name:"vs-input-date1",props:t.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const e=a,{inputClass:s}=Q(e.style),n=t.useModel(a,"modelValue");return(r,l)=>t.withDirectives((t.openBlock(),t.createElementBlock("input",{type:"date","onUpdate:modelValue":l[0]||(l[0]=o=>n.value=o),placeholder:r.placeholder,disabled:r.disabled,class:t.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f]",[t.unref(s)]]),style:{border:"1px solid #CFD9E0"}},null,10,cs)),[[t.vModelText,n.value]])}}),hs=async(a,e,s,n)=>{try{const r=new FormData;return r.append("unique","true"),r.append("file",a),(await fetch(`/file/upload/uploads?id=${e||""}&form=${s||""}&table=${n||""}`,{method:"POST",body:r}).then(o=>o.json()))?.result}catch(r){return X.notify({type:"error",title:"Помилка!",message:"Сталась помилка під час завантаження файлу",position:"right-bottom"}),console.error("Сталась помилка завантаження файлу",r),null}},ms=async a=>{try{return await fetch(`file/delete${a}`),!0}catch(e){return console.error(e),!1}},Re=async a=>{try{const e=await fetch(`file/download/files/uploads${a}`),s=await e.arrayBuffer(),n=e.headers["content-type"],r=new TextDecoder("utf-8").decode(s),l=new Blob([r],{type:n}),o=document.createElement("a");o.setAttribute("download",a),o.href=window.URL.createObjectURL(l),o.click()}catch(e){console.error(e.message)}},fs={},gs={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 ks(a,e){return t.openBlock(),t.createElementBlock("svg",gs,e[0]||(e[0]=[t.createElementVNode("path",{d:"M5 12h14"},null,-1),t.createElementVNode("path",{d:"M12 5v14"},null,-1)]))}const xe=$(fs,[["render",ks]]),bs={},xs={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 ys(a,e,s,n,r,l){return t.openBlock(),t.createElementBlock("svg",xs,e[0]||(e[0]=[t.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 _s=$(bs,[["render",ys]]),ws={},Es={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 Vs(a,e,s,n,r,l){return t.openBlock(),t.createElementBlock("svg",Es,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2"},null,-1),t.createElementVNode("line",{x1:"4",y1:"10",x2:"20",y2:"10"},null,-1),t.createElementVNode("line",{x1:"10",y1:"4",x2:"10",y2:"20"},null,-1)]))}const Cs=$(ws,[["render",Vs]]),Bs={},vs={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-file-unknown"};function Ss(a,e,s,n,r,l){return t.openBlock(),t.createElementBlock("svg",vs,e[0]||(e[0]=[t.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="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>',5)]))}const Ns=$(Bs,[["render",Ss]]),Fs={},Ms={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 As(a,e,s,n,r,l){return t.openBlock(),t.createElementBlock("svg",Ms,e[0]||(e[0]=[t.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 $s=$(Fs,[["render",As]]),Ds={},Is={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 Ls(a,e,s,n,r,l){return t.openBlock(),t.createElementBlock("svg",Is,e[0]||(e[0]=[t.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 Ts=$(Ds,[["render",Ls]]),Rs=a=>{if(!a)return"";const e=a?.split(".");return e[e.length-1]},Os=a=>{const e=Rs(a),s={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 s.imageFormat.includes(e)?"img":s.sheetsFormat.includes(e)?Cs:s.textsFormat.includes(e)?Ts:s.documentsFormat.includes(e)?_s:s.archivesFormat.includes(e)?$s:Ns},zs={},js={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 Us(a,e){return t.openBlock(),t.createElementBlock("svg",js,e[0]||(e[0]=[t.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 ye=$(zs,[["render",Us]]),Ps={},Hs={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 qs(a,e){return t.openBlock(),t.createElementBlock("svg",Hs,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),t.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),t.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Oe=$(Ps,[["render",qs]]),Gs={class:"h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file"},Ks={class:"absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center"},ze=$(t.defineComponent({__name:"vs-input-file-list-item",props:t.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 e=t.useModel(a,"value"),s=t.useModel(a,"item"),n=a;return(r,l)=>(t.openBlock(),t.createElementBlock("div",Gs,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(Os)(s.value)),{src:s.value,alt:"file",class:"w-full h-full object-cover cursor-pointer",onClick:l[0]||(l[0]=o=>t.unref(Re)(s.value))},null,8,["src"])),t.createElementVNode("div",Ks,[t.createElementVNode("button",{type:"button",onClick:l[1]||(l[1]=o=>{t.unref(ms)(s.value),e.value=n.multiple?e.value?.filter(i=>i!==s.value):""}),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"},[t.createVNode(ye,{class:"w-4 h-4"})]),t.createElementVNode("button",{type:"button",onClick:l[2]||(l[2]=o=>t.unref(Re)(s.value)),class:"w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"},[t.createVNode(Oe,{class:"w-4 h-4"})])])]))}}),[["__scopeId","data-v-0ca886b3"]]),Zs={class:"flex items-center gap-x-2"},Ys={key:1,class:"flex items-center flex-wrap gap-2"},Js=t.defineComponent({__name:"vs-input-file",props:t.mergeModels({format:{},multiple:{type:Boolean},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const e=a,s=t.useModel(a,"modelValue"),n=t.ref(null),r=o=>Array.isArray(s.value)&&s.value[o]||"",l=async o=>{if(e.format){const c=o.target.files?.[0];if(!c||!c.name.endsWith(e.format))return}const i=o.target.files?.[0];if(!i)return;const d=await hs(i,"1","form","table");s.value=e.multiple?[...s.value||[],d?.file_path]:d?.file_path};return(o,i)=>(t.openBlock(),t.createElementBlock("div",Zs,[t.createElementVNode("input",{class:"hidden",ref_key:"fileInput",ref:n,type:"file",onChange:l},null,544),!o.multiple&&s.value?(t.openBlock(),t.createBlock(ze,{key:0,item:s.value,"onUpdate:item":i[0]||(i[0]=d=>s.value=d),value:s.value,"onUpdate:value":i[1]||(i[1]=d=>s.value=d)},null,8,["item","value"])):o.multiple?(t.openBlock(),t.createElementBlock("div",Ys,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.value,(d,c)=>(t.openBlock(),t.createBlock(ze,{multiple:o.multiple,key:c,value:s.value,"onUpdate:value":i[2]||(i[2]=u=>s.value=u),item:r(c)},null,8,["multiple","value","item"]))),128)),t.createElementVNode("div",{onClick:i[3]||(i[3]=d=>!o.disabled&&n.value?.click()),class:t.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",o.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:border-blue-500 hover:bg-blue-50"])},[t.createVNode(xe,{class:"w-6 h-6"})],2)])):t.createCommentVNode("",!0),o.multiple?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:2,onClick:i[4]||(i[4]=d=>n.value?.click()),class:t.normalizeClass([o.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"])},[t.createVNode(xe,{class:"w-6 h-6"})],2))]))}}),Ws={class:"max-w-[55vw]"},Xs={class:"text-sm font-semibold text-gray-800 truncate dark:text-neutral-200"},Qs={class:"flex items-center text-xs text-gray-500 truncate dark:text-neutral-500"},en={class:"px-[5px]"},tn={class:""},_e=t.defineComponent({__name:"vs-widget-file-info",props:{item:{default:null}},setup(a){const e=a,s=t.computed(()=>{try{return new Date(e.item.cdate).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}});function n(r){if(r<1024)return`${r} B`;const l=r/1024;return l<1024?`${l.toFixed(2)} KB`:`${(l/1024).toFixed(2)} MB`}return(r,l)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[l[1]||(l[1]=t.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)),t.createElementVNode("div",Ws,[t.createElementVNode("p",Xs,t.toDisplayString(r.item?.uploaded_name),1),t.createElementVNode("p",Qs,[t.createElementVNode("span",null,t.toDisplayString(r.item?.username),1),t.withDirectives(t.createElementVNode("span",en,"|",512),[[t.vShow,r.item?.username]]),t.createElementVNode("span",null,t.toDisplayString(s.value),1),l[0]||(l[0]=t.createElementVNode("span",{class:"px-[5px]"},"|",-1)),t.createElementVNode("span",tn,t.toDisplayString(n(r.item?.size)),1)])])],64))}}),sn={class:"p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full"},nn={key:0,class:"flex w-full gap-x-3 items-center"},rn={key:1,class:"flex gap-x-3 w-full items-center"},ln={key:2,class:"flex gap-x-3 w-full items-center"},an=["href"],on={key:3,class:"flex gap-x-3 w-full items-center"},dn={class:"lg:absolute lg:top-3 lg:end-1 opacity-100"},un={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"},cn={class:"inline-block"},pn={class:"inline-block"},hn=t.defineComponent({__name:"vs-widget-file-item",props:{item:{default:null},index:{default:0},prefix:{default:"/api"}},emits:["update","openModal","openLightbox"],setup(a,{emit:e}){const s=a,n=e;function r(u){return["pdf","json"].includes(u.ext)}function l(u){return["ppt","pptx","doc","docx","xls","xlsx"].includes(u.ext)}function o(u){const h=document.createElement("a");h.setAttribute("download",u?.uploaded_name),h.href=u?.file_path,h.click()}async function i(){try{await fetch(`${s.prefix}/widget/file/${s.item.entity_id}/${s.item.file_id}`),n("update")}catch(u){console.error(u)}}function d(){n("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей файл?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:i,updateListOnConfirm:!0})}function c(u){(s.item.ext==="jpg"||s.item.ext==="png")&&n("openLightbox",{item:s.item,index:u})}return(u,h)=>(t.openBlock(),t.createElementBlock("div",sn,[u.item.ext==="jpg"||u.item.ext==="png"?(t.openBlock(),t.createElementBlock("div",nn,[t.createElementVNode("div",{class:"max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",onClick:h[0]||(h[0]=p=>c(u.index))},[t.createVNode(_e,{item:u.item},null,8,["item"])])])):r(u.item)?(t.openBlock(),t.createElementBlock("div",rn,[t.createVNode(_e,{item:u.item},null,8,["item"])])):l(u.item)?(t.openBlock(),t.createElementBlock("div",ln,[t.createElementVNode("a",{href:`/api/file-preview?id=${u.item.file_id}`,target:"_blank",class:"flex gap-x-3 w-full items-center"},[t.createVNode(_e,{item:u.item},null,8,["item"])],8,an)])):(t.openBlock(),t.createElementBlock("div",on,[t.createVNode(_e,{item:u.item},null,8,["item"])])),t.createElementVNode("div",dn,[t.createElementVNode("div",un,[t.createElementVNode("div",cn,[t.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:h[1]||(h[1]=p=>o(u.item))},[t.createVNode(Oe,{height:"14",width:"14"})])]),h[3]||(h[3]=t.createElementVNode("div",{class:"w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700"},null,-1)),t.createElementVNode("div",pn,[t.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:h[2]||(h[2]=p=>d())},[t.createVNode(ye,{height:"14",width:"14"})])])])])]))}}),mn={},fn={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 gn(a,e){return t.openBlock(),t.createElementBlock("svg",fn,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),t.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),t.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const kn=$(mn,[["render",gn]]),bn={class:"flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full"},xn={class:"flex w-full mb-[12px] items-center gap-x-2"},yn={class:"font-semibold text-gray-800 dark:text-neutral-200 text-[14px]"},_n={class1:"ml-auto"},wn={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"},En={key:0,class:"py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"},Vn={class:"relative"},Cn={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"},Bn={key:0},vn=t.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:e}){const s=a,n=t.inject("form"),r=t.computed(()=>n.value.formId),l=t.ref(!1),o=t.ref(0),i=e,d=t.ref(!1),c=t.ref({}),u=t.ref([]),h=t.ref(""),p=t.computed(()=>Array.isArray(u.value)?u.value.filter(b=>b.ext==="jpg"||b.ext==="png").map(b=>b?.file_path):[]),_=t.computed(()=>h.value===""?u.value:u.value.filter(b=>b?.uploaded_name?.includes(h.value))),S=b=>{const f=p.value.findIndex(z=>z===b.item.file_path);f!==-1&&(l.value=!0,o.value=f)},M=async()=>{try{const b=await fetch(`${s.prefix}/widget/file/${r.value}`).then(f=>f.json());u.value=b?.rows}catch(b){console.error(b)}},A=async b=>{await Promise.all(Array.from(b.target.files).map(async f=>{const z=new FormData;z.append("file",f);try{const V=`${s.prefix}/widget/file/${r.value}`;return await fetch(V,{method:"POST",body:z}),i("update","file-list"),f}catch(V){return console.error(V),null}})),await M()},I=b=>{const f={...b};return b.cancel||(f.cancel=()=>{d.value=!1}),b.updateListOnConfirm&&(f.confirm=async()=>{await b.confirm(),d.value=!1,M()}),f},w=b=>{c.value=I(b),d.value=!0};return t.watch(r,b=>{b&&M()}),t.onMounted(()=>{r.value&&M()}),(b,f)=>{const z=t.resolveComponent("Lightbox"),V=t.resolveComponent("MessageBox");return t.openBlock(),t.createElementBlock("div",bn,[t.createElementVNode("div",xn,[t.createElementVNode("h2",yn," Файлів: "+t.toDisplayString(u.value?.length),1),t.createElementVNode("div",_n,[t.createElementVNode("label",null,[t.createElementVNode("input",{type:"file",class:"hidden",onChange:f[0]||(f[0]=m=>A(m))},null,32),t.createElementVNode("div",wn,[t.createVNode(kn,{height:"16",width:"16"})])])])]),u.value?.length>4?(t.openBlock(),t.createElementBlock("div",En,[t.createElementVNode("div",null,[t.createElementVNode("div",Vn,[f[8]||(f[8]=t.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5"},[t.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"},[t.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),t.createElementVNode("path",{d:"m21 21-4.3-4.3"})])],-1)),t.withDirectives(t.createElementVNode("input",{type:"text","onUpdate:modelValue":f[1]||(f[1]=m=>h.value=m),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),[[t.vModelText,h.value,void 0,{trim:!0}]])])])])):t.createCommentVNode("",!0),u.value?.length?(t.openBlock(),t.createElementBlock("div",Cn,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.value,(m,C)=>(t.openBlock(),t.createBlock(hn,{key:C,prefix:b.prefix,item:m,index:C,onUpdate:f[2]||(f[2]=N=>b.$emit("update","file-list")),onOpenModal:f[3]||(f[3]=N=>w(N)),onOpenLightbox:f[4]||(f[4]=N=>S(N))},null,8,["prefix","item","index"]))),128)),_.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",Bn,f[9]||(f[9]=[t.createElementVNode("p",{class:"text-sm text-gray-600 font-sm"}," Файлів з такою назвою не існує, введіть інше пошукове слово ",-1)])))])):t.createCommentVNode("",!0),t.createVNode(z,{modelValue:l.value,"onUpdate:modelValue":f[5]||(f[5]=m=>l.value=m),startIndex:o.value,"onUpdate:index":f[6]||(f[6]=m=>o.value=m),images:p.value},null,8,["modelValue","startIndex","images"]),t.createVNode(V,t.mergeProps({modelValue:d.value,"onUpdate:modelValue":f[7]||(f[7]=m=>d.value=m),onConfirm:c.value.confirm},c.value),null,16,["modelValue","onConfirm"])])}}}),Sn={class:"flex items-center justify-between"},Nn={class:"text-[16px] text-gray-900 font-medium"},Fn={class:"grid gap-3"},Mn=$(t.defineComponent({__name:"vs-container-switcher",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(a){const e=a,s=t.ref(e.isOpen);return t.watch(()=>e.isOpen,n=>{s.value=n}),(n,r)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",Sn,[t.createElementVNode("p",Nn,t.toDisplayString(a.title),1),t.createVNode(Ie,{modelValue:s.value,"onUpdate:modelValue":r[0]||(r[0]=l=>s.value=l),style:t.normalizeStyle(a.style)},null,8,["modelValue","style"])]),t.createVNode(t.Transition,{name:"slide-fade"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",Fn,[t.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[t.vShow,s.value]])]),_:3})]))}}),[["__scopeId","data-v-90320b87"]]),An={class:"text-[16px] text-gray-900 font-medium"},$n={class:"grid gap-3"},Dn=$(t.defineComponent({__name:"vs-container-accordion",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})},isOpen:{type:Boolean,default:!1}},setup(a){const e=a,s=t.ref(e.isOpen);return t.watch(()=>e.isOpen,n=>{s.value=n}),(n,r)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("button",{type:"button",onClick:r[0]||(r[0]=l=>s.value=!s.value),class:"flex items-center gap-2"},[t.createVNode(t.unref(Pt),{class:t.normalizeClass(["h-4 w-4 duration-300",[s.value?"-rotate-180":""]])},null,8,["class"]),t.createElementVNode("span",An,t.toDisplayString(a.title),1)]),t.createVNode(t.Transition,{name:"slide-fade"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",$n,[t.renderSlot(n.$slots,"default",{},void 0,!0)],512),[[t.vShow,s.value]])]),_:3})]))}}),[["__scopeId","data-v-590eff11"]]),In={class:"flex items-center justify-between"},Ln={switcher:Mn,accordion:Dn,default:t.defineComponent({__name:"vs-container-default",props:{title:{type:String,default:""},style:{type:Object,default:()=>({})}},setup(a){return(e,s)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",In,[t.createElementVNode("p",null,t.toDisplayString(a.title),1)]),t.renderSlot(e.$slots,"default")]))}})},G={Equal:"==",Inequal:"!=",Higer:">",HigerOrEqual:">=",Lower:"<",LowerOrEqual:"<=",Between:"between",StartWith:"^",EndWith:"$",Contain:"*",In:"in",NotIn:"not_in"},Tn=(a,e)=>String(a)===String(e),Rn=(a,e)=>String(a)!==String(e),On=(a,e)=>a>e,zn=(a,e)=>a>=e,jn=(a,e)=>a<e,Un=(a,e)=>a<=e,Pn=(a,e)=>Array.isArray(e)&&e.length===2?a>=e[0]&&a<=e[1]:!1,Hn=(a,e)=>String(a).startsWith(String(e)),qn=(a,e)=>String(a).endsWith(String(e)),Gn=(a,e)=>String(a).includes(String(e)),Kn=(a,e)=>Array.isArray(e)?e.includes(a):!1,Zn=(a,e)=>Array.isArray(e)?!e.includes(a):!0,je=(a,e)=>{if(!e)return!0;switch(e?.[1]){case G.Equal:return Tn(a,e?.[2]);case G.Inequal:return Rn(a,e?.[2]);case G.Higer:return On(a,e?.[2]);case G.HigerOrEqual:return zn(a,e?.[2]);case G.Lower:return jn(a,e?.[2]);case G.LowerOrEqual:return Un(a,e?.[2]);case G.Between:return Pn(a,e?.[2]);case G.StartWith:return Hn(a,e?.[2]);case G.EndWith:return qn(a,e?.[2]);case G.Contain:return Gn(a,e?.[2]);case G.In:return Kn(a,e?.[2]);case G.NotIn:return Zn(a,e?.[2]);default:return!0}},Yn=t.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 e=a,s=t.inject("formValues",{default:{}}),n=t.inject("form"),r=t.computed(()=>e.schema?.filter(o=>{const i=o?.conditions;if(!i)return!0;const d=Array.isArray(i)?i[0]:i,c=s?.value?.[d];return je(c,i)})),l=t.computed(()=>Ln[e.view]);return(o,i)=>a.schema?.length?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.value),{key:0,title:a.title,style:t.normalizeStyle(a.style)},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,d=>(t.openBlock(),t.createBlock(qe,t.mergeProps({key:d.name},{ref_for:!0},d,{item:d,modelValue:t.unref(s)[d.name],"onUpdate:modelValue":c=>t.unref(s)[d.name]=c,style:a.style,error:t.unref(n)?.errors?.[d.name]}),null,16,["item","modelValue","onUpdate:modelValue","style","error"]))),128))]),_:1},8,["title","style"])):t.createCommentVNode("",!0)}}),Jn={class:"relative"},Wn={class:"w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50"},Xn={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"},Qn={class:"py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]"},er={class:"font-medium text-gray-800 dark:text-[#ffffff]"},tr={class:"p-4 mim-h-0 h-full overflow-auto"},Ue=t.defineComponent({__name:"modal-edit",props:{schema:{},defaultValue:{},mode:{},token:{},form:{}},emits:["close","save","edit"],setup(a,{emit:e}){const s=a,n=e,r=t.ref(s.schema),l=t.ref(s.defaultValue?JSON.parse(JSON.stringify(s.defaultValue)):{}),o=t.ref({}),i=t.ref(),d=t.ref(s.mode);async function c(){const h=o.value.validate();if(h){X.notify({type:"warning",title:"Помилка валідації",message:Object.entries(h).map(([p,_])=>`${p}: ${_}`).join(`
2
+ `)});return}if(i.value)try{const p=await fetch(`/api/table/${i.value}`,{method:d.value==="add"?"POST":"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(l.value)});if(p.ok)await p.json(),X.notify({type:"success",title:"Успішно",message:`Дані успішно ${d.value==="add"?"збережено":"оновлено"}`}),n("save",l.value);else if(p.status===400){const _=await p.json().catch(()=>({}));X.notify({type:"warning",title:"Помилка валідації",message:_.message||"Некоректні дані (400)"})}else p.status===500?X.notify({type:"error",title:"Серверна помилка",message:"Виникла помилка на сервері (500)"}):X.notify({type:"error",title:"Помилка",message:`Статус: ${p.status}`})}catch(p){X.notify({type:"error",title:"Помилка з’єднання",message:p.message||"Не вдалося виконати запит"})}}function u(){n("close")}return t.onMounted(async()=>{if(s.form){const h=await fetch(`/api/template/form/${s.form}`).then(p=>p.json());r.value=h.schema,i.value=h.token}else if(s.token){i.value=s.token;const h=await fetch(`/api/form/${i.value}`).then(p=>p.json());r.value=h.schema,h.data?l.value=h.data:d.value="add"}}),(h,p)=>(t.openBlock(),t.createElementBlock("div",Jn,[t.createElementVNode("div",Wn,[t.createElementVNode("div",Xn,[t.createElementVNode("div",Qn,[t.createElementVNode("h3",er,t.toDisplayString(d.value==="add"?"Додати":"Змінити"),1),t.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"},p[2]||(p[2]=[t.createElementVNode("span",{class:"sr-only"},"Close",-1),t.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"},[t.createElementVNode("path",{d:"M18 6 6 18"}),t.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))]),t.createElementVNode("div",tr,[r.value?(t.openBlock(),t.createBlock(ue,{key:0,schema:r.value,values:l.value,"onUpdate:values":p[0]||(p[0]=_=>l.value=_),form:o.value,"onUpdate:form":p[1]||(p[1]=_=>o.value=_)},null,8,["schema","values","form"])):t.createCommentVNode("",!0)]),t.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"},[t.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"}," Скасувати "),t.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"}," Зберегти ")])])])]))}}),de=(a={mode:"edit",schema:null})=>new Promise(e=>{const s=document.querySelector("body");if(!s){console.error('Modal root element with id "#modal" not found!');return}const n=document.createElement("div");s.appendChild(n);function r(){l.unmount(),n.remove()}const l=t.createApp({render(){return t.h(Ue,{...a,onClose:()=>{e(null),r()},onSave:o=>{e(o),r()}})}});l.mount(n)}),sr=["aria-expanded","data-focus"],nr={class:"flex items-center"},rr={class:"overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border"},lr=["onClick"],ar={key:1,class:t.normalizeClass(["flex items-center absolute truncate text-gray-900"])},or={key:2,class:"absolute text-gray-500 truncate"},ir={class:"flex-1 min-w-[2px]"},dr=["placeholder"],ur={class:"flex items-center shrink-0"},cr=["disabled"],pr=["disabled"],hr={key:0,class:"absolute z-10 w-full mt-2 rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]",role:"listbox"},mr=["aria-disabled","onClick"],fr={key:1,class:"px-3 py-2 text-center text-gray-500"},gr=["disabled"],kr=t.defineComponent({__name:"vs-input-select",props:t.mergeModels({multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},mode:{},search:{type:Boolean,default:!0},placeholder:{default:"Оберіть значення"},prefix:{default:"api"},host:{default:""},data:{},options:{default:()=>[]},maxHeight:{default:400},add:{},style:{default:()=>({})},customClass:{default:""},modelValue:{},error:{default:null},name:{}},{modelValue:{default:null},modelModifiers:{}}),emits:t.mergeModels(["change"],["update:modelValue"]),setup(a,{emit:e}){const s=a,n=e,r=t.computed(()=>s.multiple),l=t.computed(()=>s.disabled);Q(s.style);const o=t.useModel(a,"modelValue"),i=t.ref(null),d=t.ref(null),c=t.ref(null),u=t.ref(!1),h=t.ref(!1),p=t.ref(null),_=t.ref([]),S=t.ref(-1),M=t.ref([]),A=t.ref(""),I=t.ref(null),w=t.ref([]),b=t.computed(()=>{if(!w.value.length)return[];const y=new Map(_.value.map(x=>[x.id?.toString(),x]));return w.value.map(x=>y.get(x?.toString())).filter(x=>!!x)}),f=t.computed(()=>s.placeholder||"Select..."),z=t.computed(()=>r.value?!w.value.length&&A.value==="":!p.value?.text&&A.value===""),V=t.computed(()=>l.value?!1:r.value?w.value.length>0:!!o.value),m=y=>r.value?w.value.some(x=>x?.toString()===y?.toString()):o.value?.toString?.()===y?.toString?.(),C=t.computed(()=>{let y=_.value??[];if(A.value.trim()!==""){const x=A.value.toLowerCase();y=y.filter(F=>F.text?.toLowerCase?.().includes(x))}if(r.value&&w.value.length){const x=new Set(w.value.map(F=>F?.toString()));y=y.filter(F=>!x.has(F.id?.toString()))}return y}),N=async y=>{if(!s.data||!y)return[];try{const x=`${s.host}/${s.prefix}/suggest/${s.data}?json=1&val=${encodeURIComponent(y)}`;return(await fetch(x).then(U=>U.json())).data??[]}catch{return[]}},j=async()=>{s.options?.length?_.value=[...s.options]:s.data&&(_.value=await N(A.value))},K=async y=>{if(y==null)return null;const x=_.value?.find(U=>U?.id?.toString()===String(y));return x||((await N(String(y)))?.[0]??null)},ie=async y=>{const x=new Set(_.value.map(U=>U.id?.toString())),F=y.filter(U=>!x.has(U?.toString()));F.length&&await F.reduce(async(U,ae)=>{await U;const Be=await K(ae);Be&&_.value.push(Be)},Promise.resolve())},ge=async()=>{l.value||(u.value=!0,await j(),await t.nextTick(()=>{I.value?.focus(),C.value.length?S.value=0:S.value=-1}))},W=()=>{u.value=!1,S.value=-1},Ae=async y=>{if(l.value)return;!u.value?await ge():W()},ke=async()=>{u.value?I.value?.focus():await ge()},g=()=>{r.value?(w.value=[],o.value=[],n("change",[])):(p.value=null,o.value=null,n("change",null)),A.value="",t.nextTick(()=>I.value?.focus())},k=y=>{r.value&&(w.value=w.value.filter(x=>x?.toString()!==y?.toString()),o.value=[...w.value],n("change",o.value),t.nextTick(()=>I.value?.focus()))},D=y=>{r.value?(m(y.id)||(w.value=[...w.value,y.id],o.value=[...w.value],n("change",o.value)),A.value="",t.nextTick(()=>{I.value?.focus(),S.value=Math.min(S.value,C.value.length-1)})):(p.value=y,o.value=y.id,n("change",o.value),A.value="",W())},T=y=>{m(y.id)||D(y)},H=(y,x)=>{if(!y||!x)return;const F=y.offsetTop,U=F+y.offsetHeight,ae=x.scrollTop,Be=ae+x.clientHeight;let $e=x.scrollTop;F<ae?$e=F-80:U>Be&&($e=U-x.clientHeight+4);const ro=x;ro.scrollTop=$e},be=async y=>{l.value||!u.value&&(y.key==="ArrowDown"||y.key==="ArrowUp")&&(y.preventDefault(),await ge())},se=y=>{if(!u.value)return;const{key:x}=y;if(x==="ArrowDown")y.preventDefault(),S.value+1<C.value.length&&(S.value+=1,H(M.value[S.value],c.value));else if(x==="ArrowUp")y.preventDefault(),S.value>0&&(S.value-=1,H(M.value[S.value],c.value));else if(x==="Enter"){y.preventDefault();const F=C.value[S.value];F&&D(F)}else x==="Escape"?(y.preventDefault(),W()):x==="Backspace"?r.value&&A.value===""&&w.value.length&&(w.value=w.value.slice(0,-1),o.value=[...w.value],n("change",o.value)):x==="Home"?(S.value=0,H(M.value[0],c.value)):x==="End"?(S.value=C.value.length-1,H(M.value[S.value],c.value)):x==="Tab"&&W()},re=()=>{l.value||(h.value=!0)},le=()=>{h.value=!1,A.value=""},ne=y=>{y.key==="Escape"&&u.value&&W()},at=y=>{i.value&&(i.value.contains(y.target)||W())},ot=y=>{u.value&&c.value&&!c.value.contains(y.target)&&W()};t.watch(()=>s.options,y=>{y?.length&&(_.value=[...y])},{immediate:!0});const it=async()=>{if(r.value)Array.isArray(o.value)?w.value=[...o.value]:(w.value=o.value==null?[]:[o.value],o.value=[...w.value]),!s.options?.length&&s.data&&await ie(w.value);else{if(Array.isArray(o.value)){const y=o.value[0]??null;o.value=y??null}p.value=await K(o.value)}};t.watch(o,()=>{it()}),t.onMounted(async()=>{addEventListener("keydown",ne),addEventListener("scroll",ot,!0),document.addEventListener("click",at,!0),s.options?.length?_.value=[...s.options]:s.data&&(_.value=await N("")),await it()}),t.onUnmounted(()=>{removeEventListener("keydown",ne),removeEventListener("scroll",ot,!0),document.removeEventListener("click",at,!0)});async function no(){if(!s.add)return;const y=await de({form:s.add.form,mode:"add"});y&&(await fetch(`/api/table/${s.add.token}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)}).then(x=>x.json()),!s.options?.length&&s.data&&(_.value=await N(A.value)))}return(y,x)=>(t.openBlock(),t.createElementBlock("div",{class:"flex gap-1 w-full",ref_key:"selectRoot",ref:i,onClick:x[2]||(x[2]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",{class:t.normalizeClass(["relative w-full font-sans",s.customClass])},[x[7]||(x[7]=t.createElementVNode("span",{id:"react-select-live-region",class:"sr-only"},null,-1)),x[8]||(x[8]=t.createElementVNode("span",{"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text",role:"log",class:"sr-only"},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(["flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white","border-gray-300 hover:border-gray-400",u.value||h.value?"border-blue-500 ring-1 ring-blue-500":"",l.value?"bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300":""]),role:"combobox","aria-expanded":u.value,"aria-haspopup":"listbox",onKeydown:be,onClick:ke,"data-focus":u.value||h.value?"true":"false"},[t.createElementVNode("div",{class:"flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",ref_key:"triggerRef",ref:d},[r.value&&w.value.length?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(b.value,F=>(t.openBlock(),t.createElementBlock("div",{class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",key:F.id},[t.createElementVNode("div",nr,[F?.color?(t.openBlock(),t.createElementBlock("span",{key:0,class:"w-[16px] h-[16px] rounded-md block ml-1.5",style:t.normalizeStyle({backgroundColor:F?.color})},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",rr,t.toDisplayString(F.text),1)]),t.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:t.withModifiers(U=>k(F.id),["stop"])},x[3]||(x[3]=[t.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"},[t.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,lr)]))),128)):!r.value&&p.value?.text&&A.value===""?(t.openBlock(),t.createElementBlock("div",ar,[p.value?.color?(t.openBlock(),t.createElementBlock("span",{key:0,class:"w-[14px] h-[14px] rounded-md block mr-1 mt-0.5",style:t.normalizeStyle({backgroundColor:p.value?.color})},null,4)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(p.value.text),1)])):t.createCommentVNode("",!0),z.value?(t.openBlock(),t.createElementBlock("div",or,t.toDisplayString(f.value),1)):t.createCommentVNode("",!0),t.createElementVNode("div",ir,[!l.value&&y.search?t.withDirectives((t.openBlock(),t.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:r.value&&w.value.length?"":void 0,"onUpdate:modelValue":x[0]||(x[0]=F=>A.value=F),onFocus:re,onBlur:le,onKeydown:se},null,40,dr)),[[t.vModelText,A.value]]):t.createCommentVNode("",!0)])],512),t.createElementVNode("div",ur,[V.value?(t.openBlock(),t.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:l.value,onClick:t.withModifiers(g,["stop"])},x[4]||(x[4]=[t.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[t.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,cr)):t.createCommentVNode("",!0),x[6]||(x[6]=t.createElementVNode("div",{class:"self-stretch w-px bg-[#ccc] my-[1px]"},null,-1)),t.createElementVNode("button",{type:"button",class:"px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50","aria-hidden":"true",disabled:l.value,onClick:x[1]||(x[1]=t.withModifiers(F=>Ae(),["stop"]))},x[5]||(x[5]=[t.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[t.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,pr)])],42,sr),u.value?(t.openBlock(),t.createElementBlock("div",hr,[t.createElementVNode("div",{class:"max-h-[300px] overflow-y-auto py-1",ref_key:"listRef",ref:c},[C.value.length?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(C.value,(F,U)=>(t.openBlock(),t.createElementBlock("div",{key:F.id,ref_for:!0,ref:ae=>M.value[U]=ae,class:t.normalizeClass(["flex px-3 py-2 cursor-default select-none hover:bg-blue-300",m(F.id)?"text-white bg-blue-500":"text-gray-900 bg-white"]),"aria-disabled":m(F.id)?"true":"false",role:"option",tabindex:"-1",onClick:ae=>T(F)},[F?.color?(t.openBlock(),t.createElementBlock("span",{key:0,class:"w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",style:t.normalizeStyle({backgroundColor:F?.color})},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["leading-[19px]",S.value===F.id?"text-white":"",(S.value===U,"")])},t.toDisplayString(F.text),3)],10,mr))),128)):(t.openBlock(),t.createElementBlock("div",fr," No options "))],512)])):t.createCommentVNode("",!0)],2),s.add?(t.openBlock(),t.createElementBlock("button",{key:0,onClick:no,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:l.value,type:"button"},[t.createVNode(xe,{width:"16",height:"16"}),x[9]||(x[9]=t.createElementVNode("span",null,"Додати",-1))],8,gr)):t.createCommentVNode("",!0)],512))}}),br=["placeholder","disabled"],xr=t.defineComponent({__name:"vs-input-textarea",props:t.mergeModels({style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:""}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const e=a,{inputClass:s}=Q(e.style),n=t.useModel(a,"modelValue");return(r,l)=>t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{"onUpdate:modelValue":l[0]||(l[0]=o=>n.value=o),placeholder:r.placeholder,disabled:r.disabled,row:"2",class:t.normalizeClass(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto",[t.unref(s)]]),style:{border:"1px solid #CFD9E0"}},null,10,br)),[[t.vModelText,n.value]])}}),yr={},_r={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 wr(a,e){return t.openBlock(),t.createElementBlock("svg",_r,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0"},null,-1),t.createElementVNode("path",{d:"M21 21l-6 -6"},null,-1)]))}const Er=$(yr,[["render",wr]]),Vr={},Cr={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 Br(a,e){return t.openBlock(),t.createElementBlock("svg",Cr,e[0]||(e[0]=[t.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),t.createElementVNode("path",{d:"M7 20V4"},null,-1),t.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),t.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const vr=$(Vr,[["render",Br]]),Sr={},Nr={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 Fr(a,e){return t.openBlock(),t.createElementBlock("svg",Nr,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),t.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),t.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Mr=$(Sr,[["render",Fr]]),Ar={},$r={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 Dr(a,e){return t.openBlock(),t.createElementBlock("svg",$r,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),t.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),t.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const Ir=$(Ar,[["render",Dr]]),Lr={},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 Rr(a,e){return t.openBlock(),t.createElementBlock("svg",Tr,e[0]||(e[0]=[t.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 Pe=$(Lr,[["render",Rr]]),Or={},zr={viewBox:"0 0 178 90",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function jr(a,e){return t.openBlock(),t.createElementBlock("svg",zr,e[0]||(e[0]=[t.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 Ur=$(Or,[["render",jr]]),Pr={},Hr={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 qr(a,e){return t.openBlock(),t.createElementBlock("svg",Hr,e[0]||(e[0]=[t.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 Gr=$(Pr,[["render",qr]]),Kr={class:"vs-datatable border rounded-xl w-full flex-grow"},Zr={class:"flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]"},Yr={class:"relative w-full"},Jr={class:"table-wrapper flex gap-2"},Wr={class:"vs-popover inline-block text-slate-700"},Xr={class:"text-center"},Qr={class:""},el={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"},tl={class:"flex flex-col p-[1px] gap-[2px] w-[140px]"},sl={class:"text-sm items-center text-gray-800 flex gap-1"},nl={class:"w-full overflow-x-auto"},rl={class:"w-full table-auto caption-bottom text-sm"},ll={class:"[&_tr]:border-b"},al={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"},ol={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"},il={key:0,colspan:"100%",class:"text-center"},dl={class:"w-full"},ul={class:"p-5 min-h-[200px] flex flex-col justify-center items-center text-center"},cl=["onDragstart","onDragover","onDrop"],pl={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center"},hl={class:"flex items-center justify-center"},ml={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"},fl={class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},gl={class:"flex items-center justify-center gap-2"},kl=["onClick"],bl=["onClick"],xl=t.defineComponent({__name:"vs-input-datatable",props:t.mergeModels({colModel:{},style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},{modelValue:{default:[]},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const e=a,s=t.useModel(a,"modelValue"),n=t.ref({}),r=t.ref(""),l=t.computed(()=>{if(!r.value)return s.value??[];const V=r.value.toLowerCase();return s.value.filter(m=>e.colModel?.some(C=>{const N=m[C.key];return N?Array.isArray(N)?N.join(", ").toLowerCase().includes(V):String(N).toLowerCase().includes(V):!1}))}),o=t.ref(null),i=t.ref(null),d=t.ref(!1),c=t.ref(null),u=t.ref({top:0,left:0}),h=V=>{o.value=V},p=V=>{i.value=V},_=V=>{if(o.value===null||o.value===V){o.value=null,i.value=null;return}const m=[...s.value],[C]=m.splice(o.value,1);m.splice(V,0,C),s.value=m,o.value=null,i.value=null},S=V=>{const C=V.currentTarget.getBoundingClientRect();u.value={top:C.bottom+window.scrollY,left:C.left+window.scrollX},d.value=!d.value},M=()=>{c.value&&c.value.click()},A=V=>{const C=V.target.files?.[0];if(!C)return;const N=new FileReader;N.onload=j=>{try{const K=j.target?.result;if(typeof K=="string"){const ie=JSON.parse(K);Array.isArray(ie)&&s.value.push(...ie)}}catch(K){console.error("Error parsing file:",K)}},N.readAsText(C)},I=()=>{const V=JSON.stringify(s.value,null,2),m=new Blob([V],{type:"application/json"}),C=URL.createObjectURL(m),N=document.createElement("a");N.href=C,N.download="data.json",N.click(),URL.revokeObjectURL(C)};t.onMounted(async()=>{const V=e.colModel?.filter(m=>m.data);V?.length&&Promise.all(V.map(async m=>{n.value[m.key]=await fetch(`/api/suggest/${m.data}`).then(C=>C.json())}))});async function w(){const V=await de({schema:e.colModel,mode:"add"});V&&(Array.isArray(s.value)?s.value=[...s.value,V]:s.value=[V])}function b(V,m){return n.value[m.key]&&V[m.key]?n.value[m.key].find(C=>C.id.toString()===V[m.key].toString())?.text??V[m.key]:V[m.key]||"-"}async function f(V,m){const C=await de({schema:e.colModel,mode:"add",defaultValue:V});C&&(s.value=s.value.map((N,j)=>j===m?C:N))}function z(V){s.value=s.value.filter((m,C)=>C!==V)}return(V,m)=>(t.openBlock(),t.createElementBlock("div",Kr,[t.createElementVNode("div",Zr,[t.createElementVNode("div",Yr,[t.createVNode(Er,{width:"14",height:"14",class:"absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"}),t.withDirectives(t.createElementVNode("input",{type:"text","onUpdate:modelValue":m[0]||(m[0]=C=>r.value=C),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),[[t.vModelText,r.value]])]),t.createElementVNode("div",Jr,[t.createElementVNode("input",{ref_key:"fileInput",ref:c,onChange:A,class:"hidden",accept:".json",type:"file"},null,544),t.createElementVNode("div",Wr,[t.createElementVNode("div",Xr,[t.createElementVNode("div",Qr,[t.createElementVNode("button",{onClick:S,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"},[t.createVNode(vr,{height:"16",width:"16"})])])])])]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[d.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"text-slate-700 vsTailwind vs-popover__content bottom",style:t.normalizeStyle([{width:"fit-content","z-index":"10002",position:"fixed"},{position:"absolute",top:u.value.top+"px",left:u.value.left+"px"}])},[t.createElementVNode("div",el,[t.createElementVNode("div",tl,[t.createElementVNode("button",{onClick:M,class:"text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[t.createVNode(Mr,{class:"text-black",width:"14",height:"14"}),m[1]||(m[1]=t.createTextVNode(" Імпортувати "))]),t.createElementVNode("button",{onClick:I,class:"text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"},[t.createElementVNode("span",sl,[t.createVNode(Ir,{class:"text-black",width:"14",height:"14"}),m[2]||(m[2]=t.createTextVNode(" Експортувати "))])])])])],4)):t.createCommentVNode("",!0)])),t.createElementVNode("button",{onClick:w,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"},[t.createVNode(xe),m[3]||(m[3]=t.createTextVNode(" Додати "))])]),t.createElementVNode("div",nl,[t.createElementVNode("table",rl,[t.createElementVNode("thead",ll,[t.createElementVNode("tr",al,[t.createElementVNode("th",ol,[t.createVNode(Pe,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.colModel,C=>(t.openBlock(),t.createElementBlock("th",{key:C.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]"},t.toDisplayString(C.ua||C.label),1))),128)),m[4]||(m[4]=t.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))])]),t.createElementVNode("tbody",{class:t.normalizeClass({"[&_tr:last-child]:border-0":!i.value})},[l.value.length===0?(t.openBlock(),t.createElementBlock("td",il,[t.createElementVNode("div",dl,[t.createElementVNode("div",ul,[t.createVNode(Ur,{class:"w-48 mx-auto"}),m[5]||(m[5]=t.createElementVNode("div",{class:"max-w-sm mx-auto mt-6"},[t.createElementVNode("p",{class:"font-medium text-gray-800 dark:text-neutral-200"},"Нічого не знайдено"),t.createElementVNode("p",{class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"})],-1))])])])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(C,N)=>(t.openBlock(),t.createElementBlock("tr",{key:C.id,class:t.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":o.value===N,"border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":i.value===N}]),draggable:"true",onDragstart:j=>h(N),onDragover:t.withModifiers(j=>p(N),["prevent"]),onDrop:j=>_(N)},[t.createElementVNode("td",pl,[t.createElementVNode("div",hl,[t.createVNode(Pe,{width:"24",height:"24",class:"w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"})])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.colModel,j=>(t.openBlock(),t.createElementBlock("td",{key:j.key,class:"p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"},[t.createElementVNode("div",ml,t.toDisplayString(b(C,j)),1)]))),128)),t.createElementVNode("td",fl,[t.createElementVNode("div",gl,[t.createElementVNode("button",{onClick:j=>f(C,N),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"},[t.createVNode(Gr,{width:"24",height:"24",class:"w-3 h-3"})],8,kl),t.createElementVNode("button",{onClick:j=>z(N),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"},[t.createVNode(ye,{width:"24",height:"24",class:"w-3 h-3"})],8,bl)])])],42,cl))),128))],2)])])]))}}),yl={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 _l(a){return a?a.type==="FeatureCollection"||a.type==="Feature"?a:a.geom?{type:"Feature",geometry:{type:a.geom.type,coordinates:a.geom.coordinates},properties:{}}:a.type&&a.coordinates?{type:"Feature",geometry:a,properties:{}}:null:null}const wl={},El={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 Vl(a,e){return t.openBlock(),t.createElementBlock("svg",El,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M9 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0"},null,-1),t.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 Cl=$(wl,[["render",Vl]]),Bl={},vl={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 Sl(a,e){return t.openBlock(),t.createElementBlock("svg",vl,e[0]||(e[0]=[t.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),t.createElementVNode("path",{d:"M6 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),t.createElementVNode("path",{d:"M18 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},null,-1),t.createElementVNode("path",{d:"M7.5 16.5l9 -9"},null,-1)]))}const Nl=$(Bl,[["render",Sl]]),Fl={},Ml={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 Al(a,e){return t.openBlock(),t.createElementBlock("svg",Ml,e[0]||(e[0]=[t.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 $l=$(Fl,[["render",Al]]),Dl={},Il={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 Ll(a,e){return t.openBlock(),t.createElementBlock("svg",Il,e[0]||(e[0]=[t.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 Tl=$(Dl,[["render",Ll]]),Rl={},Ol={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 zl(a,e){return t.openBlock(),t.createElementBlock("svg",Ol,e[0]||(e[0]=[t.createElementVNode("title",null,null,-1),t.createElementVNode("desc",null,null,-1),t.createElementVNode("defs",null,null,-1),t.createElementVNode("g",{fill:"none","fill-rule":"evenodd",id:"Page-1",stroke:"none","stroke-width":"1"},[t.createElementVNode("g",{fill:"#000000",id:"Core",transform:"translate(-215.000000, -257.000000)"},[t.createElementVNode("g",{id:"fullscreen",transform:"translate(215.000000, 257.000000)"},[t.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 jl=$(Rl,[["render",zl]]),Ul={class:"form-geom__search"},Pl={class:"map-search__input"},Hl={class:"flex flex-nowrap relative"},ql={class:"form-autocomplete relative min-w-[6rem] vsTailwind map-search__select hidden"},Gl={class:"flex items-center w-full"},Kl={class:"max-w-[90%] truncate"},Zl={key:0,class:"absolute z-[3100] mt-0.5 left-0 right-0"},Yl={class:"form-autocomplete__wrapper mt-[10px] z-50 w-full min-w-36 max-h-72 p-0 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-900 top-full opened"},Jl={class:"form-autocomplete__list vsTailwind px-2 pb-2 pt-0 max-h-200 relative [&::-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 dark:bg-neutral-900"},Wl=["onClick"],Xl={class:"flex justify-between items-center w-full"},Ql={class:"flex items-center"},ea={key:0,class:"flex-shrink-0 w-3.5 h-3.5 text-blue-600",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},ta={class:"relative w-full"},sa={class:"vs-form-text relative bg-white rounded-lg"},na={key:1,class:"absolute left-0 right-0 top-full z-[3200] bg-white border border-gray-200 rounded-b-lg shadow-lg max-h-72 overflow-auto"},ra={key:0},la=["onClick"],aa={key:1,class:"px-3 py-2 text-xs text-gray-500"},oa={key:2,class:"px-3 py-2 text-xs text-gray-400"},ia=t.defineComponent({__name:"map-search",props:{placeholder:{default:"50, 30"}},emits:["goToCoordinates"],setup(a,{emit:e}){const s=e,n=t.ref(!1),r=t.ref("coordinates"),l=t.ref(""),o=t.ref([]),i=t.ref(!1),d=t.ref(!1);let c;const u=[{value:"coordinates",label:"Пошук по кординатам"},{value:"atu",label:"АТУ"},{value:"address",label:"Адресса"},{value:"search_here",label:"Пошук HERE"}],h=t.computed(()=>u.find(w=>w.value===r.value)?.label??"АТУ");function p(w){r.value=w.value,n.value=!1,l.value="",l.value&&M()}function _(w){w.target.closest(".map-search__input")||(n.value=!1)}t.onMounted(()=>document.addEventListener("click",_)),t.onUnmounted(()=>document.removeEventListener("click",_));async function S(w){let b;r.value==="atu"?b="/api/suggest/atu.nsdi.ato_level":r.value==="address"?b="/api/suggest/map.address_id":r.value==="search_here"&&(b="/api/gis-url-proxy");const f=new URL(b||"");return r.value==="search_here"?f.searchParams.set("searchtext",w):(r.value==="atu"||r.value==="address")&&f.searchParams.set("key",w),f.searchParams.set("limit","20"),f.searchParams.set("q",w),(await fetch(f.toString())).json()}function M(){if(i.value=!0,d.value=!0,r.value==="coordinates"){const w=l.value.trim().split(",");if(w.length===2){const b=parseFloat(w[0]),f=parseFloat(w[1]);!Number.isNaN(b)&&!Number.isNaN(f)&&s("goToCoordinates",[b,f])}return}c&&window.clearTimeout(c),c=window.setTimeout(async()=>{const w=l.value.trim();if(!w){o.value=[],d.value=!1;return}try{const b=await S(w);o.value=Array.isArray(b.features)?b.features:[]}catch{o.value=[]}finally{d.value=!1}},300)}function A(){l.value="",o.value=[],i.value=!1,d.value=!1}function I(w){s("goToCoordinates",w),i.value=!1,d.value=!1,o.value=[]}return(w,b)=>(t.openBlock(),t.createElementBlock("div",Ul,[t.createElementVNode("div",Pl,[t.createElementVNode("div",Hl,[t.createElementVNode("div",ql,[t.createElementVNode("button",{type:"button",onClick:b[0]||(b[0]=f=>n.value=!n.value),class:"h-[40px] relative px-4 pe-9 flex text-nowrap w-full cursor-pointer bg-white border border-solid border-stone-200 rounded-lg text-start text-sm text-stone-800 focus:outline-none focus:ring-1 focus:ring-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200"},[t.createElementVNode("div",Gl,[t.createElementVNode("span",Kl,t.toDisplayString(h.value),1)]),b[3]||(b[3]=t.createElementVNode("svg",{class:"stroke-gray-500 absolute right-3 translate-y-1/2 bottom-1/2",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none"},[t.createElementVNode("path",{d:"M6 9l6 6 6-6","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1))]),n.value?(t.openBlock(),t.createElementBlock("div",Zl,[t.createElementVNode("div",Yl,[t.createElementVNode("div",Jl,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(u,f=>t.createElementVNode("div",{onClick:z=>p(f),key:f.value,class:"form-autocomplete__item cursor-pointer hs-selected:bg-stone-100 dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800 cursor-default"},[t.createElementVNode("div",Xl,[t.createElementVNode("div",Ql,[t.createElementVNode("div",null,t.toDisplayString(f.label),1)]),f.value===r.value?(t.openBlock(),t.createElementBlock("svg",ea,b[4]||(b[4]=[t.createElementVNode("polyline",{points:"20 6 9 17 4 12"},null,-1)]))):t.createCommentVNode("",!0)])],8,Wl)),64))])])])):t.createCommentVNode("",!0)]),t.createElementVNode("div",ta,[t.createElementVNode("div",sa,[b[6]||(b[6]=t.createElementVNode("i",{class:"absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500"},[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor"},[t.createElementVNode("circle",{cx:"11",cy:"11",r:"8","stroke-width":"2"}),t.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65","stroke-width":"2"})])],-1)),t.withDirectives(t.createElementVNode("input",{type:"text","onUpdate:modelValue":b[1]||(b[1]=f=>l.value=f),onInput:M,onFocus:b[2]||(b[2]=f=>i.value=!0),placeholder:"Пошук...",class:"bg-white h-[38px] text-sm py-2 px-3 ps-9 pe-8 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg 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,544),[[t.vModelText,l.value]]),l.value?(t.openBlock(),t.createElementBlock("button",{key:0,onClick:A,class:"absolute right-2 bottom-1/2 translate-y-1/2 text-gray-500 hover:text-red-500","aria-label":"Очистити",type:"button"},b[5]||(b[5]=[t.createElementVNode("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[t.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12","stroke-linecap":"round","stroke-linejoin":"round"})],-1)]))):t.createCommentVNode("",!0),i.value&&r.value!=="coordinates"?(t.openBlock(),t.createElementBlock("div",na,[o.value.length?(t.openBlock(),t.createElementBlock("ul",ra,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,f=>(t.openBlock(),t.createElementBlock("li",{key:f.properties.place_id,onClick:z=>I(f),class:"px-3 py-2 text-sm cursor-pointer hover:bg-gray-100"},t.toDisplayString(f.properties.display_name),9,la))),128))])):d.value?(t.openBlock(),t.createElementBlock("div",aa,"Шукаю…")):(t.openBlock(),t.createElementBlock("div",oa,"Нічого не знайдено"))])):t.createCommentVNode("",!0)])])])])]))}}),da={class:"bg-white/95 p-2 rounded-xl shadow border border-gray-200"},ua={class:"flex gap-2"},ca=["onClick","title"],pa=["src"],ha=t.defineComponent({__name:"map-layers",props:{basemaps:{},defaultLayer:{}},emits:["onLayerChange"],setup(a,{emit:e}){const s=a,n=t.ref(s.defaultLayer??""),r=e;function l(o){r("onLayerChange",o),n.value=o}return(o,i)=>(t.openBlock(),t.createElementBlock("div",da,[t.createElementVNode("div",ua,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.basemaps,(d,c)=>(t.openBlock(),t.createElementBlock("div",{key:c,class:t.normalizeClass(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm",{"ring-2 ring-blue-500 border-blue-300":n.value===c}]),onClick:u=>l(c),title:c,role:"button",tabindex:"0"},[t.createElementVNode("img",{src:d.preview,alt:"",class:"w-14 h-14 object-cover"},null,8,pa)],10,ca))),128))])]))}}),ma={class:"absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]"},fa={class:"form-geom__panel flex gap-1 items-start mt-2"},ga={class:"flex items-center gap-1"},ka=["disabled"],ba={class:"absolute top-4 right-4 z-[1000]"},xa={class:"flex flex-col gap-[2px]"},ya=["aria-pressed"],_a=["aria-pressed"],wa=["aria-pressed"],Ea=["aria-pressed"],Va={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"},Ca={key:0,class:"form-geom__feature flex items-center text-xs transition-all gap-2 w-full"},Ba={class:"mr-auto"},va={class:"font-bold"},Sa={class:"flex items-center"},Na={class:"text-xs mr-2"},Fa={key:0,class:"text-xs"},Ma={key:1,class:"text-xs"},Aa=$(t.defineComponent({__name:"vs-input-map",props:{style:{},customClass:{},disabled:{type:Boolean},modelValue:{},error:{},name:{},placeholder:{}},emits:["update:modelValue"],setup(a,{emit:e}){const s=a,n=e,r=t.ref(null);let l,o,i;const d=t.ref(null),c=t.ref(null),u=t.ref(6),h=t.ref(0),p=t.ref(null),_={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"}};let S;const M=t.ref("topo100");function A(){return new Promise((g,k)=>{window.L&&window.L.Draw&&g(0);const D=H=>{if(Array.from(document.styleSheets).some(re=>re?.href?.includes(H)))return;const se=document.createElement("link");se.rel="stylesheet",se.href=H,document.head.appendChild(se)},T=H=>new Promise((be,se)=>{const re=Array.from(document.scripts).find(ne=>ne.src===H);if(re){re.addEventListener("load",()=>be()),re.addEventListener("error",ne=>se(ne));return}const le=document.createElement("script");le.src=H,le.async=!0,le.onload=()=>be(),le.onerror=ne=>se(ne),document.body.appendChild(le)});D("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"),D("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"),T("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(()=>T("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(()=>g(0)).catch(k)})}function I(){const g=o.toGeoJSON();let k=null;g?.features?.length&&(k=g.features[0].geometry),n("update:modelValue",k),h.value=o.getLayers().length}function w(g=30){const k=o.getLayers();if(!k.length)return;const T=L.featureGroup(k).getBounds();T&&T.isValid()&&l.fitBounds(T,{padding:[g,g]})}function b(){d.value?.click()}const f=t.ref("");function z(g){return g instanceof L.Circle?"Circle":g instanceof L.Rectangle?"Rectangle":g instanceof L.Polygon&&!(g instanceof L.Rectangle)?"Polygon":g instanceof L.Polyline&&!(g instanceof L.Polygon)?"Polyline":g instanceof L.Marker?"Point":"Feature"}function V(g){if(g instanceof L.Circle){const k=g.getRadius();return Math.PI*(k*k)/1e6}if(g instanceof L.Polygon||g instanceof L.Rectangle)try{const k=g.getLatLngs(),D=Array.isArray(k[0])?k[0]:k,T=L.GeometryUtil?.geodesicArea?L.GeometryUtil.geodesicArea(D):0;return T?T/1e6:0}catch{return null}return null}function m(g){return g instanceof L.Circle?g.getLatLng():g.getBounds?g.getBounds().getCenter():g.getLatLng?g.getLatLng():l.getCenter()}function C(){const g=o.getLayers();if(!g.length){p.value=null,h.value=0;return}const k=g[g.length-1],D=z(k),T=m(k),H=V(k);p.value={type:D,center:T,areaKm2:H,layer:k},h.value=g.length}function N(){const g=p.value?.layer;g&&(g instanceof L.Circle&&g.getBounds?l.fitBounds(g.getBounds(),{padding:[30,30]}):g.getBounds?l.fitBounds(g.getBounds(),{padding:[30,30]}):g.getLatLng&&l.setView(g.getLatLng(),Math.max(u.value,14)))}function j(){const g=p.value?.layer;g&&(o.removeLayer(g),I(),C())}t.onMounted(async()=>{await A(),L.drawLocal=yl,l=L.map(r.value,{zoomControl:!1}).setView([50,30],10),L.control.zoom({position:"bottomright"}).addTo(l),S=L.tileLayer(_.topo100.url,{maxZoom:19,minZoom:6}).addTo(l),M.value="topo100",o=new L.FeatureGroup().addTo(l),l.on(L.Draw.Event.CREATED,k=>{const{layer:D}=k;o.clearLayers(),o.addLayer(D),I(),C(),w(),f.value=""}),l.on(L.Draw.Event.EDITED,()=>{I(),C(),w()}),l.on(L.Draw.Event.DELETED,()=>{I(),C(),w()}),l.on("mousemove",k=>{c.value=k.latlng}),l.on("zoomend",()=>{u.value=l.getZoom()});const g=_l(s.modelValue);if(g){const k=[];L.geoJSON(g).eachLayer(D=>k.push(D)),k.length&&o.addLayer(k[0]),I(),C(),w()}});function K(g){if(l){switch(i&&i.disable(),g){case"marker":i=new L.Draw.Marker(l);break;case"polyline":i=new L.Draw.Polyline(l);break;case"polygon":i=new L.Draw.Polygon(l);break;case"rectangle":i=new L.Draw.Rectangle(l);break;default:i=new L.Draw.Rectangle(l);break}i&&(i.enable(),f.value=g)}}function ie(){const g=o.toGeoJSON(),k=new Blob([JSON.stringify(g,null,2)],{type:"application/json"}),D=URL.createObjectURL(k),T=document.createElement("a");T.href=D,T.download="data.geojson",T.click(),URL.revokeObjectURL(D)}function ge(g){const k=g.target.files?.[0];if(!k)return;const D=new FileReader;D.onload=()=>{if(typeof D.result=="string")try{const T=JSON.parse(D.result);o.clearLayers(),T&&L.geoJSON({type:"Feature",geometry:T}).eachLayer(H=>{o.addLayer(H)}),I(),C(),w()}finally{g.target.value=""}},D.readAsText(k)}function W(g){l&&(S&&l.removeLayer(S),S=L.tileLayer(_[g].url,{maxZoom:19,minZoom:6}).addTo(l),M.value=g)}function Ae(g){const k=L.latLng(g[0],g[1]);l.setView(k,13)}t.watch(()=>s.modelValue,g=>{o.clearLayers(),g&&L.geoJSON({type:"Feature",geometry:g}).eachLayer(k=>{o.addLayer(k)}),h.value=o.getLayers().length,C(),w()});const ke=t.ref(!1);return(g,k)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["leaflet-map-wrapper relative w-full h-[600px]",{fullscreen:ke.value}])},[t.createElementVNode("div",{ref_key:"mapContainer",ref:r,class:"w-full h-full"},null,512),t.createElementVNode("div",ma,[t.createVNode(ia,{onGoToCoordinates:Ae}),t.createElementVNode("div",fa,[t.createElementVNode("div",ga,[t.createElementVNode("button",{type:"button",class:"vs-btn-row",onClick:b},"Імпорт"),t.createElementVNode("button",{type:"button",class:"vs-btn-row",onClick:ie,disabled:h.value===0},"Експорт ",8,ka)]),t.createElementVNode("input",{ref_key:"importRef",ref:d,type:"file",onChange:ge,accept:".json,.geojson",class:"hidden"},null,544)])]),t.createElementVNode("div",ba,[t.createElementVNode("div",xa,[t.createElementVNode("button",{class:t.normalizeClass(["vs-btn",{"vs-active":f.value==="marker"}]),"aria-pressed":f.value==="marker",title:"Point (P)","aria-label":"Draw point",onClick:k[0]||(k[0]=D=>K("marker"))},[t.createVNode(Cl)],10,ya),t.createElementVNode("button",{class:t.normalizeClass(["vs-btn",{"vs-active":f.value==="polyline"}]),"aria-pressed":f.value==="polyline",title:"Line (L)","aria-label":"Draw polyline",onClick:k[1]||(k[1]=D=>K("polyline"))},[t.createVNode(Nl)],10,_a),t.createElementVNode("button",{class:t.normalizeClass(["vs-btn",{"vs-active":f.value==="polygon"}]),"aria-pressed":f.value==="polygon",title:"Polygon (G)","aria-label":"Draw polygon",onClick:k[2]||(k[2]=D=>K("polygon"))},[t.createVNode($l)],10,wa),t.createElementVNode("button",{class:t.normalizeClass(["vs-btn",{"vs-active":f.value==="rectangle"}]),"aria-pressed":f.value==="rectangle",title:"Rectangle (R)","aria-label":"Draw rectangle",onClick:k[3]||(k[3]=D=>K("rectangle"))},[t.createVNode(Tl)],10,Ea),t.createElementVNode("button",{class:"vs-btn",onClick:k[4]||(k[4]=D=>ke.value=!ke.value)},[t.createVNode(jl,{style:{width:"12px",height:"12px"}})])])]),t.createElementVNode("div",{class:t.normalizeClass(["absolute left-4 z-[1000]",p.value?"bottom-8":"bottom-4"])},[t.createVNode(ha,{basemaps:_,"default-layer":"topo100",onOnLayerChange:W})],2),t.createElementVNode("div",Va,[p.value?(t.openBlock(),t.createElementBlock("div",Ca,[t.createElementVNode("div",Ba,[k[7]||(k[7]=t.createTextVNode(" Тип: ")),t.createElementVNode("span",va,t.toDisplayString(p.value.type),1)]),t.createElementVNode("div",Sa,[t.createElementVNode("div",Na,[k[8]||(k[8]=t.createTextVNode(" Центр: ")),t.createElementVNode("b",null,t.toDisplayString(p.value.center.lat.toFixed(5))+", "+t.toDisplayString(p.value.center.lng.toFixed(5)),1)]),p.value.areaKm2!==null?(t.openBlock(),t.createElementBlock("div",Fa,[k[9]||(k[9]=t.createTextVNode(" Площа: ")),t.createElementVNode("b",null,t.toDisplayString(p.value.areaKm2.toFixed(1))+"км²",1)])):(t.openBlock(),t.createElementBlock("div",Ma,k[10]||(k[10]=[t.createTextVNode(" Площа: "),t.createElementVNode("b",null,"—",-1)]))),t.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:k[5]||(k[5]=D=>N())},k[11]||(k[11]=[t.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-d73d6cfa><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-d73d6cfa></path><path d="M7 10l6 0" data-v-d73d6cfa></path><path d="M10 7l0 6" data-v-d73d6cfa></path><path d="M21 21l-6 -6" data-v-d73d6cfa></path></svg>',1)])),t.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:k[6]||(k[6]=D=>j())},[t.createVNode(ye,{class:"w-3 h-3"})])])])):t.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-d73d6cfa"]]),$a=["data-focus"],Da={class:"flex items-center"},Ia={class:"overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border"},La=["onClick","aria-label"],Ta={key:0,class:"absolute text-gray-500 truncate pl-2"},Ra={class:"flex-1 min-w-[2px]"},Oa=["placeholder"],za={class:"flex items-center shrink-0"},ja=["disabled"],He={VsInputText:ve,VsInputRadio:Te,"vs-input-text":ve,"vs-input-textarea":xr,"vs-input-mask":es,"vs-input-number":Vt,"vs-input-radio":Te,"vs-input-select":kr,"vs-input-switcher":Ie,"vs-input-static":Le,"vs-input-container":Yn,"vs-input-date":ps,"vs-input-checkbox":us,"vs-input-file":Js,"vs-input-html":Le,"vs-input-email":ns,"vs-input-datatable":xl,"vs-input-map":Aa,"vs-input-file-list":vn,"vs-input-tag":t.defineComponent({__name:"vs-input-tag",props:t.mergeModels({unique:{type:Boolean,default:!0},style:{default:()=>({})},customClass:{default:""},disabled:{type:Boolean,default:!1},modelValue:{},error:{},name:{},placeholder:{default:"Введіть тег"}},{modelValue:{default:[]},modelModifiers:{}}),emits:t.mergeModels(["update:modelValue"],["update:modelValue"]),setup(a,{emit:e}){const s=a,n=e;Q(s.style);const r=t.ref(null),l=t.ref(null),o=t.ref(null),i=t.ref(!1),d=t.ref(""),c=t.useModel(a,"modelValue"),u=t.computed(()=>s.placeholder||"Add tag…"),h=t.computed(()=>c.value?.length===0&&d.value===""),p=t.computed(()=>!s.disabled&&c.value?.length>0),_=t.computed(()=>s.disabled),S=async()=>{_.value||await t.nextTick(()=>o.value?.focus())},M=V=>{const m=V.trim();m!==""&&(!c.value||!Array.isArray(c.value)?c.value=[m]:s.unique?c.value.includes(m)||(c.value=[...c.value,m]):c.value=[...c.value,m],d.value="")},A=()=>{const V=d.value;V.trim()!==""&&M(V),d.value=""},I=V=>{const m=c.value.slice();m.splice(V,1),n("update:modelValue",m)},w=()=>{n("update:modelValue",[])},b=()=>{_.value||(i.value=!0)},f=()=>{i.value=!1},z=V=>{const{key:m}=V;m==="Enter"?(V.preventDefault(),A()):m==="Backspace"&&d.value===""&&c.value.length>0&&I(c.value.length-1)};return(V,m)=>(t.openBlock(),t.createElementBlock("div",{class:"flex gap-1 w-full",ref_key:"root",ref:r,onClick:m[1]||(m[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",{class:t.normalizeClass(["relative w-full font-sans",s.customClass]),role:"group","aria-label":"Tag input"},[t.createElementVNode("div",{class:t.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:S},[t.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:l},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(C,N)=>(t.openBlock(),t.createElementBlock("div",{key:N,class:"flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"},[t.createElementVNode("div",Da,[t.createElementVNode("div",Ia,t.toDisplayString(C),1)]),t.createElementVNode("div",{role:"button",class:"flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",onClick:t.withModifiers(j=>I(N),["stop"]),"aria-label":`Remove ${C}`},m[2]||(m[2]=[t.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"},[t.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,La)]))),128)),h.value?(t.openBlock(),t.createElementBlock("div",Ta,t.toDisplayString(u.value),1)):t.createCommentVNode("",!0),t.createElementVNode("div",Ra,[_.value?t.createCommentVNode("",!0):t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:0,ref_key:"inputRef",ref:o,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":m[0]||(m[0]=C=>d.value=C),onFocus:b,onBlur:f,onKeydown:z,placeholder:c.value&&c.value.length?"":void 0},null,40,Oa)),[[t.vModelText,d.value]])])],512),t.createElementVNode("div",za,[p.value?(t.openBlock(),t.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:t.withModifiers(w,["stop"])},m[3]||(m[3]=[t.createElementVNode("svg",{height:"20",width:"20",viewBox:"0 0 20 20",class:"fill-current"},[t.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,ja)):t.createCommentVNode("",!0)])],10,$a)],2)],512))}})},Ua=t.defineComponent({__name:"behavior",props:{api:{},set:{},button:{},error:{},value:{}},setup(a){const e=a,s=t.inject("values");async function n(){try{if(!e.api)return;const r=e.api.replace("{{value}}",e.value),l=await fetch(r);if(!l.ok){X.notify({type:"warning",title:"Validation",message:"При спробі завантажити дані виникла помилка."});return}const o=await l.json();if(!e.set||!s)return;for(const[i,d]of Object.entries(e.set))s.value[i]=o.result[d]}catch(r){console.error(e.error,r)}}return(r,l)=>(t.openBlock(),t.createElementBlock("button",{onClick:n,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"},t.toDisplayString(r.button),1))}}),Pa={class:"flex w-full"},qe=t.defineComponent({__name:"vs-compact-form-layout",props:t.mergeModels({item:{default:{}},layout:{default:"default"},style:{default:{}},type:{default:""},error:{type:[String,Boolean]}},{modelValue:{default:null},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const e=a,s=t.useModel(a,"modelValue"),n=t.computed(()=>_t[`${e.layout}`]),r=t.computed(()=>He?.[`vs-input-${e.item.type}`]),l=t.computed(()=>{const i=t.unref(r);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)}),o=t.computed(()=>{const i=e.item??{},d=l.value;return d.size?Object.fromEntries(Object.entries(i).filter(([c])=>d.has(c))):{}});return(i,d)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n.value),{ua:e.item.ua,error:e.error||"",item:i.item,label:e.item.label},{default:t.withCtx(()=>[t.createElementVNode("div",Pa,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.value),t.mergeProps(o.value,{modelValue:s.value,"onUpdate:modelValue":d[0]||(d[0]=c=>s.value=c)}),null,16,["modelValue"])),i.item.behavior?(t.openBlock(),t.createBlock(Ua,t.mergeProps({key:0},i.item.behavior,{value:s.value}),null,16,["value"])):t.createCommentVNode("",!0)])]),_:1},8,["ua","error","item","label"]))}}),Ge={required:"Це поле є обов’язковим",email:"Неправильний email"},Ha=a=>a?!1:Ge.required,qa=a=>!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a)&&a?Ge.email:!1,Ga=(a,e)=>{const s=e.pattern??e.regexp;return!(typeof s=="string"?new RegExp(s):s).test(a)&&a?e.message:!1},Ka=(a,e)=>!1,Za=(a,e)=>{switch(typeof e=="string"?e:e.type){case"required":return Ha(a);case"email":return qa(a);case"regexp":return Ga(a,e);case"custom":return Ka();default:return!1}},Ya={autocomplete:"select",combobox:"select",datepicker:"date",markedtext:"mask",html:"static",geom:"map",filelist:"file-list",datalist:"datatable",file:"file"};function Ke(a){const e=a.toLowerCase();return Ya[e]||e}function Ja(a){if(Array.isArray(a)){const s=[];return a.forEach(n=>{const r={...n};r.name=(n.name||n.id||n.key).toString(),r.type=Ke(n.type),r.label=n.label||n.ua,r.rules=n.rules||n.validators,n.data&&(r.api=`/api/suggest/${n.data}`),s.push(r)}),s}const e=[];return Object.entries(a).forEach(s=>{const n={name:s[0],...s[1],type:Ke(s[1].type),label:s[1].label||s[1].ua,rules:s[1].rules||s[1].validators};s[1].type.includes("list")&&(n.multiple=!0),s[1].data&&(n.api=`/api/suggest/${s[1].data}`),e.push(n)}),e}function Wa(a,e){const s=Ja(e),n=t.ref({});function r(d){const c=d?.conditions;if(!c)return!0;const u=Array.isArray(c)?c[0]:c,h=a?.value?.[u];return je(h,c)}const l=(d=s,c=!0)=>(d.forEach(u=>{if(u.rules){if(!r(u)){delete n.value[u.name];return}u.rules.forEach(h=>{const p=Za(a.value[u.name],h);p?n.value[u.name]=p:delete n.value[u.name]})}u.schema&&l(u.schema,!1)}),c&&Object.values(n.value).some(Boolean)?n.value:null),o=t.computed(()=>s?.filter(d=>r(d)));return{errors:n,validate:l,reset:()=>{a.value={},n.value={}},visibleSchema:o}}const ue=t.defineComponent({__name:"vs-compact-form",props:t.mergeModels({schema:{default:()=>[]},style:{default:()=>({})},modelValue:{},layout:{default:()=>"default"},formId:{default:()=>""}},{form:{default:()=>({})},formModifiers:{},values:{default:()=>({})},valuesModifiers:{}}),emits:t.mergeModels(["handle-submit","update:modelValue"],["update:form","update:values"]),setup(a,{expose:e,emit:s}){const n=s,r=a,l=t.useModel(a,"form"),o=t.useModel(a,"values"),{errors:i,validate:d,reset:c,visibleSchema:u}=Wa(o,r.schema),h=()=>{n("update:modelValue",o.value),d(),n("handle-submit",o.value)};e({validate:d,reset:c,errors:i}),t.onMounted(()=>{r.modelValue&&(o.value=r.modelValue),l.value.value=o.value,l.value.errors=i.value,l.value.reset=c,l.value.validate=d,l.value.formId=r.formId});function p(_,S){if(_===S)return!0;if(typeof _!="object"||typeof S!="object"||!_||!S)return!1;const M=Object.keys(_),A=Object.keys(S);return M.length!==A.length?!1:M.every(I=>_[I]===S[I])}return t.provide("form",l),t.provide("values",o),(_,S)=>(t.openBlock(),t.createElementBlock("form",{onSubmit:t.withModifiers(h,["prevent"]),class:t.normalizeClass(["grid grid-cols-12",_.layout==="default"?"gap-6":"gap-4"])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(u),M=>(t.openBlock(),t.createBlock(qe,{key:M.name,class:t.normalizeClass(_.layout==="horizontal"?"col-span-12":`col-span-${M.col||12} `),style:t.normalizeStyle(_.style),item:M,layout:_.layout,"model-value":o.value[M.name],"onUpdate:modelValue":A=>{const I=o.value[M.name];p(I,A)||(o.value[M.name]=A)},error:t.unref(i)[M.name]},null,8,["class","style","item","layout","model-value","onUpdate:modelValue","error"]))),128))],34))}});ue.install=function(e){e.component("VForm",ue),Object.assign(e.config.globalProperties,{$form:de}),e.provide("form",de),window.v3plugin||(window.v3plugin={}),window.v3plugin.$form=e.config.globalProperties.$form};function ee(a){return typeof a=="string"||a instanceof String}function Ze(a){var e;return typeof a=="object"&&a!=null&&(a==null||(e=a.constructor)==null?void 0:e.name)==="Object"}function Ye(a,e){return Array.isArray(e)?Ye(a,(s,n)=>e.includes(n)):Object.entries(a).reduce((s,n)=>{let[r,l]=n;return e(l,r)&&(s[r]=l),s},{})}const E={NONE:"NONE",LEFT:"LEFT",FORCE_LEFT:"FORCE_LEFT",RIGHT:"RIGHT",FORCE_RIGHT:"FORCE_RIGHT"};function Je(a){switch(a){case E.LEFT:return E.FORCE_LEFT;case E.RIGHT:return E.FORCE_RIGHT;default:return a}}function Se(a){return a.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function we(a,e){if(e===a)return!0;const s=Array.isArray(e),n=Array.isArray(a);let r;if(s&&n){if(e.length!=a.length)return!1;for(r=0;r<e.length;r++)if(!we(e[r],a[r]))return!1;return!0}if(s!=n)return!1;if(e&&a&&typeof e=="object"&&typeof a=="object"){const l=e instanceof Date,o=a instanceof Date;if(l&&o)return e.getTime()==a.getTime();if(l!=o)return!1;const i=e instanceof RegExp,d=a instanceof RegExp;if(i&&d)return e.toString()==a.toString();if(i!=d)return!1;const c=Object.keys(e);for(r=0;r<c.length;r++)if(!Object.prototype.hasOwnProperty.call(a,c[r]))return!1;for(r=0;r<c.length;r++)if(!we(a[c[r]],e[c[r]]))return!1;return!0}else if(e&&a&&typeof e=="function"&&typeof a=="function")return e.toString()===a.toString();return!1}class Xa{constructor(e){for(Object.assign(this,e);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?E.NONE:(this.oldSelection.end===this.cursorPos||this.oldSelection.start===this.cursorPos)&&this.oldSelection.end===this.oldSelection.start?E.RIGHT:E.LEFT}}function B(a,e){return new B.InputMask(a,e)}function We(a){if(a==null)throw new Error("mask property should be defined");return a instanceof RegExp?B.MaskedRegExp:ee(a)?B.MaskedPattern:a===Date?B.MaskedDate:a===Number?B.MaskedNumber:Array.isArray(a)||a===Array?B.MaskedDynamic:B.Masked&&a.prototype instanceof B.Masked?a:B.Masked&&a instanceof B.Masked?a.constructor:a instanceof Function?B.MaskedFunction:(console.warn("Mask not found for mask",a),B.Masked)}function oe(a){if(!a)throw new Error("Options in not defined");if(B.Masked){if(a.prototype instanceof B.Masked)return{mask:a};const{mask:e=void 0,...s}=a instanceof B.Masked?{mask:a}:Ze(a)&&a.mask instanceof B.Masked?a:{};if(e){const n=e.mask;return{...Ye(e,(r,l)=>!l.startsWith("_")),mask:e.constructor,_mask:n,...s}}}return Ze(a)?{...a}:{mask:a}}function Z(a){if(B.Masked&&a instanceof B.Masked)return a;const e=oe(a),s=We(e.mask);if(!s)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===s&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new s(e)}B.createMask=Z;class Ee{get selectionStart(){let e;try{e=this._unsafeSelectionStart}catch{}return e??this.value.length}get selectionEnd(){let e;try{e=this._unsafeSelectionEnd}catch{}return e??this.value.length}select(e,s){if(!(e==null||s==null||e===this.selectionStart&&s===this.selectionEnd))try{this._unsafeSelect(e,s)}catch{}}get isActive(){return!1}}B.MaskElement=Ee;const Xe=90,Qa=89;class ce extends Ee{constructor(e){super(),this.input=e,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 e,s,n;return(e=(s=(n=this.input).getRootNode)==null?void 0:s.call(n))!=null?e:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(e){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",e.drop),this.input.addEventListener("click",e.click),this.input.addEventListener("focus",e.focus),this.input.addEventListener("blur",e.commit),this._handlers=e}_onKeydown(e){if(this._handlers.redo&&(e.keyCode===Xe&&e.shiftKey&&(e.metaKey||e.ctrlKey)||e.keyCode===Qa&&e.ctrlKey))return e.preventDefault(),this._handlers.redo(e);if(this._handlers.undo&&e.keyCode===Xe&&(e.metaKey||e.ctrlKey))return e.preventDefault(),this._handlers.undo(e);e.isComposing||this._handlers.selectionChange(e)}_onBeforeinput(e){if(e.inputType==="historyUndo"&&this._handlers.undo)return e.preventDefault(),this._handlers.undo(e);if(e.inputType==="historyRedo"&&this._handlers.redo)return e.preventDefault(),this._handlers.redo(e)}_onCompositionEnd(e){this._handlers.input(e)}_onInput(e){e.isComposing||this._handlers.input(e)}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={}}}B.HTMLMaskElement=ce;class Qe extends ce{constructor(e){super(e),this.input=e}get _unsafeSelectionStart(){return this.input.selectionStart!=null?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(e,s){this.input.setSelectionRange(e,s)}get value(){return this.input.value}set value(e){this.input.value=e}}B.HTMLMaskElement=ce;class Ne extends ce{get _unsafeSelectionStart(){const e=this.rootElement,s=e.getSelection&&e.getSelection(),n=s&&s.anchorOffset,r=s&&s.focusOffset;return r==null||n==null||n<r?n:r}get _unsafeSelectionEnd(){const e=this.rootElement,s=e.getSelection&&e.getSelection(),n=s&&s.anchorOffset,r=s&&s.focusOffset;return r==null||n==null||n>r?n:r}_unsafeSelect(e,s){if(!this.rootElement.createRange)return;const n=this.rootElement.createRange();n.setStart(this.input.firstChild||this.input,e),n.setEnd(this.input.lastChild||this.input,s);const r=this.rootElement,l=r.getSelection&&r.getSelection();l&&(l.removeAllRanges(),l.addRange(n))}get value(){return this.input.textContent||""}set value(e){this.input.textContent=e}}B.HTMLContenteditableMaskElement=Ne;class Ve{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return this.states.length===0}push(e){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(e),this.states.length>Ve.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(e){return this.currentIndex=Math.min(Math.max(this.currentIndex+e,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}}Ve.MAX_LENGTH=100;class et{constructor(e,s){this.el=e instanceof Ee?e:e.isContentEditable&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"?new Ne(e):new Qe(e),this.masked=Z(s),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Ve,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(e){var s;return e==null||((s=this.masked)==null?void 0:s.maskEquals(e))}get mask(){return this.masked.mask}set mask(e){if(this.maskEquals(e))return;if(!(e instanceof B.Masked)&&this.masked.constructor===We(e)){this.masked.updateOptions({mask:e});return}const s=e instanceof B.Masked?e:Z({mask:e});s.unmaskedValue=this.masked.unmaskedValue,this.masked=s}get value(){return this._value}set value(e){this.value!==e&&(this.masked.value=e,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(e){this.unmaskedValue!==e&&(this.masked.unmaskedValue=e,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(e){this.rawInputValue!==e&&(this.masked.rawInputValue=e,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(e){this.masked.typedValueEquals(e)||(this.masked.typedValue=e,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(e,s){const n=this._listeners[e];n&&n.forEach(r=>r(s))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(e){!this.el||!this.el.isActive||(this.el.select(e,e),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(e){const s=this.masked.unmaskedValue,n=this.masked.value,r=this.masked.rawInputValue,l=this.displayValue,o=this.unmaskedValue!==s||this.value!==n||this._rawInputValue!==r;this._unmaskedValue=s,this._value=n,this._rawInputValue=r,this.el.value!==l&&(this.el.value=l),e==="auto"?this.alignCursor():e!=null&&(this.cursorPos=e),o&&this._fireChangeEvents(),!this._historyChanging&&(o||this.history.isEmpty)&&this.history.push({unmaskedValue:s,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(e){const{mask:s,...n}=e,r=!this.maskEquals(s),l=this.masked.optionsIsChanged(n);r&&(this.mask=s),l&&this.masked.updateOptions(n),(r||l)&&this.updateControl()}updateCursor(e){e!=null&&(this.cursorPos=e,this._delayUpdateCursor(e))}_delayUpdateCursor(e){this._abortUpdateCursor(),this._changingCursorPos=e,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,E.LEFT))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(e,s){return this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(s),this}off(e,s){if(!this._listeners[e])return this;if(!s)return delete this._listeners[e],this;const n=this._listeners[e].indexOf(s);return n>=0&&this._listeners[e].splice(n,1),this}_onInput(e){this._inputEvent=e,this._abortUpdateCursor();const s=new Xa({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),n=this.masked.rawInputValue,r=this.masked.splice(s.startChangePos,s.removed.length,s.inserted,s.removeDirection,{input:!0,raw:!0}).offset,l=n===this.masked.rawInputValue?s.removeDirection:E.NONE;let o=this.masked.nearestInputPos(s.startChangePos+r,l);l!==E.NONE&&(o=this.masked.nearestInputPos(o,E.NONE)),this.updateControl(o),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(e){e.preventDefault(),e.stopPropagation()}_onFocus(e){this.alignCursorFriendly()}_onClick(e){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(e){e&&(this._historyChanging=!0,this.unmaskedValue=e.unmaskedValue,this.el.select(e.selection.start,e.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}}B.InputMask=et;class v{static normalize(e){return Array.isArray(e)?e:[e,new v]}constructor(e){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},e)}aggregate(e){return this.inserted+=e.inserted,this.rawInserted+=e.rawInserted,this.tailShift+=e.tailShift,this.skip=this.skip||e.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return!!this.rawInserted||this.skip}equals(e){return this.inserted===e.inserted&&this.tailShift===e.tailShift&&this.rawInserted===e.rawInserted&&this.skip===e.skip}}B.ChangeDetails=v;class Y{constructor(e,s,n){e===void 0&&(e=""),s===void 0&&(s=0),this.value=e,this.from=s,this.stop=n}toString(){return this.value}extend(e){this.value+=String(e)}appendTo(e){return e.append(this.toString(),{tail:!0}).aggregate(e._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(e){Object.assign(this,e)}unshift(e){if(!this.value.length||e!=null&&this.from>=e)return"";const s=this.value[0];return this.value=this.value.slice(1),s}shift(){if(!this.value.length)return"";const e=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),e}}class R{constructor(e){this._value="",this._update({...R.DEFAULTS,...e}),this._initialized=!0}updateOptions(e){this.optionsIsChanged(e)&&this.withValueRefresh(this._update.bind(this,e))}_update(e){Object.assign(this,e)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value}reset(){this._value=""}get value(){return this._value}set value(e){this.resolve(e,{input:!0})}resolve(e,s){s===void 0&&(s={input:!0}),this.reset(),this.append(e,s,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(e){this.resolve(e,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(e){this.format?this.value=this.format(e,this):this.unmaskedValue=String(e)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(e){this.resolve(e,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(e,s){return e}totalInputPositions(e,s){return e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length),Math.min(this.displayValue.length,s-e)}extractInput(e,s,n){return e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length),this.displayValue.slice(e,s)}extractTail(e,s){return e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length),new Y(this.extractInput(e,s),e)}appendTail(e){return ee(e)&&(e=new Y(String(e))),e.appendTo(this)}_appendCharRaw(e,s){return e?(this._value+=e,new v({inserted:e,rawInserted:e})):new v}_appendChar(e,s,n){s===void 0&&(s={});const r=this.state;let l;if([e,l]=this.doPrepareChar(e,s),e&&(l=l.aggregate(this._appendCharRaw(e,s)),!l.rawInserted&&this.autofix==="pad")){const o=this.state;this.state=r;let i=this.pad(s);const d=this._appendCharRaw(e,s);i=i.aggregate(d),d.rawInserted||i.equals(l)?l=i:this.state=o}if(l.inserted){let o,i=this.doValidate(s)!==!1;if(i&&n!=null){const d=this.state;if(this.overwrite===!0){o=n.state;for(let u=0;u<l.rawInserted.length;++u)n.unshift(this.displayValue.length-l.tailShift)}let c=this.appendTail(n);if(i=c.rawInserted.length===n.toString().length,!(i&&c.inserted)&&this.overwrite==="shift"){this.state=d,o=n.state;for(let u=0;u<l.rawInserted.length;++u)n.shift();c=this.appendTail(n),i=c.rawInserted.length===n.toString().length}i&&c.inserted&&(this.state=d)}i||(l=new v,this.state=r,n&&o&&(n.state=o))}return l}_appendPlaceholder(){return new v}_appendEager(){return new v}append(e,s,n){if(!ee(e))throw new Error("value should be string");const r=ee(n)?new Y(String(n)):n;s!=null&&s.tail&&(s._beforeTailState=this.state);let l;[e,l]=this.doPrepare(e,s);for(let o=0;o<e.length;++o){const i=this._appendChar(e[o],s,r);if(!i.rawInserted&&!this.doSkipInvalid(e[o],s,r))break;l.aggregate(i)}return(this.eager===!0||this.eager==="append")&&s!=null&&s.input&&e&&l.aggregate(this._appendEager()),r!=null&&(l.tailShift+=this.appendTail(r).tailShift),l}remove(e,s){return e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length),this._value=this.displayValue.slice(0,e)+this.displayValue.slice(s),new v}withValueRefresh(e){if(this._refreshing||!this._initialized)return e();this._refreshing=!0;const s=this.rawInputValue,n=this.value,r=e();return this.rawInputValue=s,this.value&&this.value!==n&&n.indexOf(this.value)===0&&(this.append(n.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,r}runIsolated(e){if(this._isolated||!this._initialized)return e(this);this._isolated=!0;const s=this.state,n=e(this);return this.state=s,delete this._isolated,n}doSkipInvalid(e,s,n){return!!this.skipInvalid}doPrepare(e,s){return s===void 0&&(s={}),v.normalize(this.prepare?this.prepare(e,this,s):e)}doPrepareChar(e,s){return s===void 0&&(s={}),v.normalize(this.prepareChar?this.prepareChar(e,this,s):e)}doValidate(e){return(!this.validate||this.validate(this.value,this,e))&&(!this.parent||this.parent.doValidate(e))}doCommit(){this.commit&&this.commit(this.value,this)}splice(e,s,n,r,l){n===void 0&&(n=""),r===void 0&&(r=E.NONE),l===void 0&&(l={input:!0});const o=e+s,i=this.extractTail(o),d=this.eager===!0||this.eager==="remove";let c;d&&(r=Je(r),c=this.extractInput(0,o,{raw:!0}));let u=e;const h=new v;if(r!==E.NONE&&(u=this.nearestInputPos(e,s>1&&e!==0&&!d?E.NONE:r),h.tailShift=u-e),h.aggregate(this.remove(u)),d&&r!==E.NONE&&c===this.rawInputValue)if(r===E.FORCE_LEFT){let p;for(;c===this.rawInputValue&&(p=this.displayValue.length);)h.aggregate(new v({tailShift:-1})).aggregate(this.remove(p-1))}else r===E.FORCE_RIGHT&&i.unshift();return h.aggregate(this.append(n,l,i))}maskEquals(e){return this.mask===e}optionsIsChanged(e){return!we(this,e)}typedValueEquals(e){const s=this.typedValue;return e===s||R.EMPTY_VALUES.includes(e)&&R.EMPTY_VALUES.includes(s)||(this.format?this.format(e,this)===this.format(this.typedValue,this):!1)}pad(e){return new v}}R.DEFAULTS={skipInvalid:!0},R.EMPTY_VALUES=[void 0,null,""],B.Masked=R;class te{constructor(e,s){e===void 0&&(e=[]),s===void 0&&(s=0),this.chunks=e,this.from=s}toString(){return this.chunks.map(String).join("")}extend(e){if(!String(e))return;e=ee(e)?new Y(String(e)):e;const s=this.chunks[this.chunks.length-1],n=s&&(s.stop===e.stop||e.stop==null)&&e.from===s.from+s.toString().length;if(e instanceof Y)n?s.extend(e.toString()):this.chunks.push(e);else if(e instanceof te){if(e.stop==null){let r;for(;e.chunks.length&&e.chunks[0].stop==null;)r=e.chunks.shift(),r.from+=e.from,this.extend(r)}e.toString()&&(e.stop=e.blockIndex,this.chunks.push(e))}}appendTo(e){if(!(e instanceof B.MaskedPattern))return new Y(this.toString()).appendTo(e);const s=new v;for(let n=0;n<this.chunks.length;++n){const r=this.chunks[n],l=e._mapPosToBlock(e.displayValue.length),o=r.stop;let i;if(o!=null&&(!l||l.index<=o)&&((r instanceof te||e._stops.indexOf(o)>=0)&&s.aggregate(e._appendPlaceholder(o)),i=r instanceof te&&e._blocks[o]),i){const d=i.appendTail(r);s.aggregate(d);const c=r.toString().slice(d.rawInserted.length);c&&s.aggregate(e.append(c,{tail:!0}))}else s.aggregate(e.append(r.toString(),{tail:!0}))}return s}get state(){return{chunks:this.chunks.map(e=>e.state),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(e){const{chunks:s,...n}=e;Object.assign(this,n),this.chunks=s.map(r=>{const l="chunks"in r?new te:new Y;return l.state=r,l})}unshift(e){if(!this.chunks.length||e!=null&&this.from>=e)return"";const s=e!=null?e-this.from:e;let n=0;for(;n<this.chunks.length;){const r=this.chunks[n],l=r.unshift(s);if(r.toString()){if(!l)break;++n}else this.chunks.splice(n,1);if(l)return l}return""}shift(){if(!this.chunks.length)return"";let e=this.chunks.length-1;for(;0<=e;){const s=this.chunks[e],n=s.shift();if(s.toString()){if(!n)break;--e}else this.chunks.splice(e,1);if(n)return n}return""}}class eo{constructor(e,s){this.masked=e,this._log=[];const{offset:n,index:r}=e._mapPosToBlock(s)||(s<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=n,this.index=r,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(e){Object.assign(this,e)}pushState(){this._log.push(this.state)}popState(){const e=this._log.pop();return e&&(this.state=e),e}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(e){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=((s=this.block)==null?void 0:s.displayValue.length)||0){var s;if(e())return this.ok=!0}return this.ok=!1}_pushRight(e){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(e())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,E.FORCE_LEFT),this.offset!==0))return!0})}pushLeftBeforeInput(){return this._pushLeft(()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,E.LEFT),!0})}pushLeftBeforeRequired(){return this._pushLeft(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,E.LEFT),!0})}pushRightBeforeFilled(){return this._pushRight(()=>{if(!(this.block.isFixed||!this.block.value)&&(this.offset=this.block.nearestInputPos(this.offset,E.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,E.NONE),!0})}pushRightBeforeRequired(){return this._pushRight(()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,E.NONE),!0})}}class Fe{constructor(e){Object.assign(this,e),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(e,s){return e===void 0&&(e=0),s===void 0&&(s=this._value.length),this._value=this._value.slice(0,e)+this._value.slice(s),this._value||(this._isRawInput=!1),new v}nearestInputPos(e,s){s===void 0&&(s=E.NONE);const n=0,r=this._value.length;switch(s){case E.LEFT:case E.FORCE_LEFT:return n;case E.NONE:case E.RIGHT:case E.FORCE_RIGHT:default:return r}}totalInputPositions(e,s){return e===void 0&&(e=0),s===void 0&&(s=this._value.length),this._isRawInput?s-e:0}extractInput(e,s,n){return e===void 0&&(e=0),s===void 0&&(s=this._value.length),n===void 0&&(n={}),n.raw&&this._isRawInput&&this._value.slice(e,s)||""}get isComplete(){return!0}get isFilled(){return!!this._value}_appendChar(e,s){if(s===void 0&&(s={}),this.isFilled)return new v;const n=this.eager===!0||this.eager==="append",l=this.char===e&&(this.isUnmasking||s.input||s.raw)&&(!s.raw||!n)&&!s.tail,o=new v({inserted:this.char,rawInserted:l?this.char:""});return this._value=this.char,this._isRawInput=l&&(s.raw||s.input),o}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const e=new v;return this.isFilled||(this._value=e.inserted=this.char),e}extractTail(){return new Y("")}appendTail(e){return ee(e)&&(e=new Y(String(e))),e.appendTo(this)}append(e,s,n){const r=this._appendChar(e[0],s);return n!=null&&(r.tailShift+=this.appendTail(n).tailShift),r}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(e){this._value=e._value,this._isRawInput=!!e._rawInputValue}pad(e){return this._appendPlaceholder()}}class pe{constructor(e){const{parent:s,isOptional:n,placeholderChar:r,displayChar:l,lazy:o,eager:i,...d}=e;this.masked=Z(d),Object.assign(this,{parent:s,isOptional:n,placeholderChar:r,displayChar:l,lazy:o,eager:i})}reset(){this.isFilled=!1,this.masked.reset()}remove(e,s){return e===void 0&&(e=0),s===void 0&&(s=this.value.length),e===0&&s>=1?(this.isFilled=!1,this.masked.remove(e,s)):new v}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(e,s){if(s===void 0&&(s={}),this.isFilled)return new v;const n=this.masked.state;let r=this.masked._appendChar(e,this.currentMaskFlags(s));return r.inserted&&this.doValidate(s)===!1&&(r=new v,this.masked.state=n),!r.inserted&&!this.isOptional&&!this.lazy&&!s.input&&(r.inserted=this.placeholderChar),r.skip=!r.inserted&&!this.isOptional,this.isFilled=!!r.inserted,r}append(e,s,n){return this.masked.append(e,this.currentMaskFlags(s),n)}_appendPlaceholder(){return this.isFilled||this.isOptional?new v:(this.isFilled=!0,new v({inserted:this.placeholderChar}))}_appendEager(){return new v}extractTail(e,s){return this.masked.extractTail(e,s)}appendTail(e){return this.masked.appendTail(e)}extractInput(e,s,n){return e===void 0&&(e=0),s===void 0&&(s=this.value.length),this.masked.extractInput(e,s,n)}nearestInputPos(e,s){s===void 0&&(s=E.NONE);const n=0,r=this.value.length,l=Math.min(Math.max(e,n),r);switch(s){case E.LEFT:case E.FORCE_LEFT:return this.isComplete?l:n;case E.RIGHT:case E.FORCE_RIGHT:return this.isComplete?l:r;case E.NONE:default:return l}}totalInputPositions(e,s){return e===void 0&&(e=0),s===void 0&&(s=this.value.length),this.value.slice(e,s).length}doValidate(e){return this.masked.doValidate(this.currentMaskFlags(e))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(e)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(e){this.masked.state=e.masked,this.isFilled=e.isFilled}currentMaskFlags(e){var s;return{...e,_beforeTailState:(e==null||(s=e._beforeTailState)==null?void 0:s.masked)||e?._beforeTailState}}pad(e){return new v}}pe.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 tt extends R{updateOptions(e){super.updateOptions(e)}_update(e){const s=e.mask;s&&(e.validate=n=>n.search(s)>=0),super._update(e)}}B.MaskedRegExp=tt;class O extends R{constructor(e){super({...O.DEFAULTS,...e,definitions:Object.assign({},pe.DEFAULT_DEFINITIONS,e?.definitions)})}updateOptions(e){super.updateOptions(e)}_update(e){e.definitions=Object.assign({},this.definitions,e.definitions),super._update(e),this._rebuildMask()}_rebuildMask(){const e=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const s=this.mask;if(!s||!e)return;let n=!1,r=!1;for(let l=0;l<s.length;++l){if(this.blocks){const c=s.slice(l),u=Object.keys(this.blocks).filter(p=>c.indexOf(p)===0);u.sort((p,_)=>_.length-p.length);const h=u[0];if(h){const{expose:p,repeat:_,...S}=oe(this.blocks[h]),M={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...S,repeat:_,parent:this},A=_!=null?new B.RepeatBlock(M):Z(M);A&&(this._blocks.push(A),p&&(this.exposeBlock=A),this._maskedBlocks[h]||(this._maskedBlocks[h]=[]),this._maskedBlocks[h].push(this._blocks.length-1)),l+=h.length-1;continue}}let o=s[l],i=o in e;if(o===O.STOP_CHAR){this._stops.push(this._blocks.length);continue}if(o==="{"||o==="}"){n=!n;continue}if(o==="["||o==="]"){r=!r;continue}if(o===O.ESCAPE_CHAR){if(++l,o=s[l],!o)break;i=!1}const d=i?new pe({isOptional:r,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...oe(e[o]),parent:this}):new Fe({char:o,eager:this.eager,isUnmasking:n});this._blocks.push(d)}}get state(){return{...super.state,_blocks:this._blocks.map(e=>e.state)}}set state(e){if(!e){this.reset();return}const{_blocks:s,...n}=e;this._blocks.forEach((r,l)=>r.state=s[l]),super.state=n}reset(){super.reset(),this._blocks.forEach(e=>e.reset())}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every(e=>e.isComplete)}get isFilled(){return this._blocks.every(e=>e.isFilled)}get isFixed(){return this._blocks.every(e=>e.isFixed)}get isOptional(){return this._blocks.every(e=>e.isOptional)}doCommit(){this._blocks.forEach(e=>e.doCommit()),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce((e,s)=>e+=s.unmaskedValue,"")}set unmaskedValue(e){if(this.exposeBlock){const s=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=e,this.appendTail(s),this.doCommit()}else super.unmaskedValue=e}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce((e,s)=>e+=s.value,"")}set value(e){if(this.exposeBlock){const s=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=e,this.appendTail(s),this.doCommit()}else super.value=e}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(e){if(this.exposeBlock){const s=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=e,this.appendTail(s),this.doCommit()}else super.typedValue=e}get displayValue(){return this._blocks.reduce((e,s)=>e+=s.displayValue,"")}appendTail(e){return super.appendTail(e).aggregate(this._appendPlaceholder())}_appendEager(){var e;const s=new v;let n=(e=this._mapPosToBlock(this.displayValue.length))==null?void 0:e.index;if(n==null)return s;this._blocks[n].isFilled&&++n;for(let r=n;r<this._blocks.length;++r){const l=this._blocks[r]._appendEager();if(!l.inserted)break;s.aggregate(l)}return s}_appendCharRaw(e,s){s===void 0&&(s={});const n=this._mapPosToBlock(this.displayValue.length),r=new v;if(!n)return r;for(let o=n.index,i;i=this._blocks[o];++o){var l;const d=i._appendChar(e,{...s,_beforeTailState:(l=s._beforeTailState)==null||(l=l._blocks)==null?void 0:l[o]});if(r.aggregate(d),d.consumed)break}return r}extractTail(e,s){e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length);const n=new te;return e===s||this._forEachBlocksInRange(e,s,(r,l,o,i)=>{const d=r.extractTail(o,i);d.stop=this._findStopBefore(l),d.from=this._blockStartPos(l),d instanceof te&&(d.blockIndex=l),n.extend(d)}),n}extractInput(e,s,n){if(e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length),n===void 0&&(n={}),e===s)return"";let r="";return this._forEachBlocksInRange(e,s,(l,o,i,d)=>{r+=l.extractInput(i,d,n)}),r}_findStopBefore(e){let s;for(let n=0;n<this._stops.length;++n){const r=this._stops[n];if(r<=e)s=r;else break}return s}_appendPlaceholder(e){const s=new v;if(this.lazy&&e==null)return s;const n=this._mapPosToBlock(this.displayValue.length);if(!n)return s;const r=n.index,l=e??this._blocks.length;return this._blocks.slice(r,l).forEach(o=>{if(!o.lazy||e!=null){var i;s.aggregate(o._appendPlaceholder((i=o._blocks)==null?void 0:i.length))}}),s}_mapPosToBlock(e){let s="";for(let n=0;n<this._blocks.length;++n){const r=this._blocks[n],l=s.length;if(s+=r.displayValue,e<=s.length)return{index:n,offset:e-l}}}_blockStartPos(e){return this._blocks.slice(0,e).reduce((s,n)=>s+=n.displayValue.length,0)}_forEachBlocksInRange(e,s,n){s===void 0&&(s=this.displayValue.length);const r=this._mapPosToBlock(e);if(r){const l=this._mapPosToBlock(s),o=l&&r.index===l.index,i=r.offset,d=l&&o?l.offset:this._blocks[r.index].displayValue.length;if(n(this._blocks[r.index],r.index,i,d),l&&!o){for(let c=r.index+1;c<l.index;++c)n(this._blocks[c],c,0,this._blocks[c].displayValue.length);n(this._blocks[l.index],l.index,0,l.offset)}}}remove(e,s){e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length);const n=super.remove(e,s);return this._forEachBlocksInRange(e,s,(r,l,o,i)=>{n.aggregate(r.remove(o,i))}),n}nearestInputPos(e,s){if(s===void 0&&(s=E.NONE),!this._blocks.length)return 0;const n=new eo(this,e);if(s===E.NONE)return n.pushRightBeforeInput()||(n.popState(),n.pushLeftBeforeInput())?n.pos:this.displayValue.length;if(s===E.LEFT||s===E.FORCE_LEFT){if(s===E.LEFT){if(n.pushRightBeforeFilled(),n.ok&&n.pos===e)return e;n.popState()}if(n.pushLeftBeforeInput(),n.pushLeftBeforeRequired(),n.pushLeftBeforeFilled(),s===E.LEFT){if(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.ok&&n.pos<=e||(n.popState(),n.ok&&n.pos<=e))return n.pos;n.popState()}return n.ok?n.pos:s===E.FORCE_LEFT?0:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:0)}return s===E.RIGHT||s===E.FORCE_RIGHT?(n.pushRightBeforeInput(),n.pushRightBeforeRequired(),n.pushRightBeforeFilled()?n.pos:s===E.FORCE_RIGHT?this.displayValue.length:(n.popState(),n.ok||(n.popState(),n.ok)?n.pos:this.nearestInputPos(e,E.LEFT))):e}totalInputPositions(e,s){e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length);let n=0;return this._forEachBlocksInRange(e,s,(r,l,o,i)=>{n+=r.totalInputPositions(o,i)}),n}maskedBlock(e){return this.maskedBlocks(e)[0]}maskedBlocks(e){const s=this._maskedBlocks[e];return s?s.map(n=>this._blocks[n]):[]}pad(e){const s=new v;return this._forEachBlocksInRange(0,this.displayValue.length,n=>s.aggregate(n.pad(e))),s}}O.DEFAULTS={...R.DEFAULTS,lazy:!0,placeholderChar:"_"},O.STOP_CHAR="`",O.ESCAPE_CHAR="\\",O.InputDefinition=pe,O.FixedDefinition=Fe,B.MaskedPattern=O;class he extends O{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){const{to:s=this.to||0,from:n=this.from||0,maxLength:r=this.maxLength||0,autofix:l=this.autofix,...o}=e;this.to=s,this.from=n,this.maxLength=Math.max(String(s).length,r),this.autofix=l;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;o.mask=d.slice(0,c).replace(/0/g,"\\0")+"0".repeat(this.maxLength-c),super._update(o)}get isComplete(){return super.isComplete&&!!this.value}boundaries(e){let s="",n="";const[,r,l]=e.match(/^(\D*)(\d*)(\D*)/)||[];return l&&(s="0".repeat(r.length)+l,n="9".repeat(r.length)+l),s=s.padEnd(this.maxLength,"0"),n=n.padEnd(this.maxLength,"9"),[s,n]}doPrepareChar(e,s){s===void 0&&(s={});let n;return[e,n]=super.doPrepareChar(e.replace(/\D/g,""),s),e||(n.skip=!this.isComplete),[e,n]}_appendCharRaw(e,s){if(s===void 0&&(s={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(e,s);const n=String(this.from).padStart(this.maxLength,"0"),r=String(this.to).padStart(this.maxLength,"0"),[l,o]=this.boundaries(this.value+e);return Number(o)<this.from?super._appendCharRaw(n[this.value.length],s):Number(l)>this.to?!s.tail&&this.autofix==="pad"&&this.value.length+1<this.maxLength?super._appendCharRaw(n[this.value.length],s).aggregate(this._appendCharRaw(e,s)):super._appendCharRaw(r[this.value.length],s):super._appendCharRaw(e,s)}doValidate(e){const s=this.value;if(s.search(/[^0]/)===-1&&s.length<=this._matchFrom)return!0;const[r,l]=this.boundaries(s);return this.from<=Number(l)&&Number(r)<=this.to&&super.doValidate(e)}pad(e){const s=new v;if(this.value.length===this.maxLength)return s;const n=this.value,r=this.maxLength-this.value.length;if(r){this.reset();for(let l=0;l<r;++l)s.aggregate(super._appendCharRaw("0",e));n.split("").forEach(l=>this._appendCharRaw(l))}return s}}B.MaskedRange=he;const to="d{.}`m{.}`Y";class J extends O{static extractPatternOptions(e){const{mask:s,pattern:n,...r}=e;return{...r,mask:ee(s)?s:n}}constructor(e){super(J.extractPatternOptions({...J.DEFAULTS,...e}))}updateOptions(e){super.updateOptions(e)}_update(e){const{mask:s,pattern:n,blocks:r,...l}={...J.DEFAULTS,...e},o=Object.assign({},J.GET_DEFAULT_BLOCKS());e.min&&(o.Y.from=e.min.getFullYear()),e.max&&(o.Y.to=e.max.getFullYear()),e.min&&e.max&&o.Y.from===o.Y.to&&(o.m.from=e.min.getMonth()+1,o.m.to=e.max.getMonth()+1,o.m.from===o.m.to&&(o.d.from=e.min.getDate(),o.d.to=e.max.getDate())),Object.assign(o,this.blocks,r),super._update({...l,mask:ee(s)?s:n,blocks:o})}doValidate(e){const s=this.date;return super.doValidate(e)&&(!this.isComplete||this.isDateExist(this.value)&&s!=null&&(this.min==null||this.min<=s)&&(this.max==null||s<=this.max))}isDateExist(e){return this.format(this.parse(e,this),this).indexOf(e)>=0}get date(){return this.typedValue}set date(e){this.typedValue=e}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(e){super.typedValue=e}maskEquals(e){return e===Date||super.maskEquals(e)}optionsIsChanged(e){return super.optionsIsChanged(J.extractPatternOptions(e))}}J.GET_DEFAULT_BLOCKS=()=>({d:{mask:he,from:1,to:31,maxLength:2},m:{mask:he,from:1,to:12,maxLength:2},Y:{mask:he,from:1900,to:9999}}),J.DEFAULTS={...O.DEFAULTS,mask:Date,pattern:to,format:(a,e)=>{if(!a)return"";const s=String(a.getDate()).padStart(2,"0"),n=String(a.getMonth()+1).padStart(2,"0"),r=a.getFullYear();return[s,n,r].join(".")},parse:(a,e)=>{const[s,n,r]=a.split(".").map(Number);return new Date(r,n-1,s)}},B.MaskedDate=J;class me extends R{constructor(e){super({...me.DEFAULTS,...e}),this.currentMask=void 0}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),"mask"in e&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(e.mask)?e.mask.map(s=>{const{expose:n,...r}=oe(s),l=Z({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...r});return n&&(this.exposeMask=l),l}):[])}_appendCharRaw(e,s){s===void 0&&(s={});const n=this._applyDispatch(e,s);return this.currentMask&&n.aggregate(this.currentMask._appendChar(e,this.currentMaskFlags(s))),n}_applyDispatch(e,s,n){e===void 0&&(e=""),s===void 0&&(s={}),n===void 0&&(n="");const r=s.tail&&s._beforeTailState!=null?s._beforeTailState._value:this.value,l=this.rawInputValue,o=s.tail&&s._beforeTailState!=null?s._beforeTailState._rawInputValue:l,i=l.slice(o.length),d=this.currentMask,c=new v,u=d?.state;return this.currentMask=this.doDispatch(e,{...s},n),this.currentMask&&(this.currentMask!==d?(this.currentMask.reset(),o&&(this.currentMask.append(o,{raw:!0}),c.tailShift=this.currentMask.value.length-r.length),i&&(c.tailShift+=this.currentMask.append(i,{raw:!0,tail:!0}).tailShift)):u&&(this.currentMask.state=u)),c}_appendPlaceholder(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendPlaceholder()),e}_appendEager(){const e=this._applyDispatch();return this.currentMask&&e.aggregate(this.currentMask._appendEager()),e}appendTail(e){const s=new v;return e&&s.aggregate(this._applyDispatch("",{},e)),s.aggregate(this.currentMask?this.currentMask.appendTail(e):super.appendTail(e))}currentMaskFlags(e){var s,n;return{...e,_beforeTailState:((s=e._beforeTailState)==null?void 0:s.currentMaskRef)===this.currentMask&&((n=e._beforeTailState)==null?void 0:n.currentMask)||e._beforeTailState}}doDispatch(e,s,n){return s===void 0&&(s={}),n===void 0&&(n=""),this.dispatch(e,this,s,n)}doValidate(e){return super.doValidate(e)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(e)))}doPrepare(e,s){s===void 0&&(s={});let[n,r]=super.doPrepare(e,s);if(this.currentMask){let l;[n,l]=super.doPrepare(n,this.currentMaskFlags(s)),r=r.aggregate(l)}return[n,r]}doPrepareChar(e,s){s===void 0&&(s={});let[n,r]=super.doPrepareChar(e,s);if(this.currentMask){let l;[n,l]=super.doPrepareChar(n,this.currentMaskFlags(s)),r=r.aggregate(l)}return[n,r]}reset(){var e;(e=this.currentMask)==null||e.reset(),this.compiledMasks.forEach(s=>s.reset())}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(e){this.exposeMask?(this.exposeMask.value=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=e}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(e){this.exposeMask?(this.exposeMask.unmaskedValue=e,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=e}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(e){if(this.exposeMask){this.exposeMask.typedValue=e,this.currentMask=this.exposeMask,this._applyDispatch();return}let s=String(e);this.currentMask&&(this.currentMask.typedValue=e,s=this.currentMask.unmaskedValue),this.unmaskedValue=s}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var e;return!!((e=this.currentMask)!=null&&e.isComplete)}get isFilled(){var e;return!!((e=this.currentMask)!=null&&e.isFilled)}remove(e,s){const n=new v;return this.currentMask&&n.aggregate(this.currentMask.remove(e,s)).aggregate(this._applyDispatch()),n}get state(){var e;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map(s=>s.state),currentMaskRef:this.currentMask,currentMask:(e=this.currentMask)==null?void 0:e.state}}set state(e){const{compiledMasks:s,currentMaskRef:n,currentMask:r,...l}=e;s&&this.compiledMasks.forEach((o,i)=>o.state=s[i]),n!=null&&(this.currentMask=n,this.currentMask.state=r),super.state=l}extractInput(e,s,n){return this.currentMask?this.currentMask.extractInput(e,s,n):""}extractTail(e,s){return this.currentMask?this.currentMask.extractTail(e,s):super.extractTail(e,s)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(e,s){return this.currentMask?this.currentMask.nearestInputPos(e,s):super.nearestInputPos(e,s)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(e){this._overwrite=e}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(e){this._eager=e}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(e){this._skipInvalid=e}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(e){this._autofix=e}maskEquals(e){return Array.isArray(e)?this.compiledMasks.every((s,n)=>{if(!e[n])return;const{mask:r,...l}=e[n];return we(s,l)&&s.maskEquals(r)}):super.maskEquals(e)}typedValueEquals(e){var s;return!!((s=this.currentMask)!=null&&s.typedValueEquals(e))}}me.DEFAULTS={...R.DEFAULTS,dispatch:(a,e,s,n)=>{if(!e.compiledMasks.length)return;const r=e.rawInputValue,l=e.compiledMasks.map((o,i)=>{const d=e.currentMask===o,c=d?o.displayValue.length:o.nearestInputPos(o.displayValue.length,E.FORCE_LEFT);return o.rawInputValue!==r?(o.reset(),o.append(r,{raw:!0})):d||o.remove(c),o.append(a,e.currentMaskFlags(s)),o.appendTail(n),{index:i,weight:o.rawInputValue.length,totalInputPositions:o.totalInputPositions(0,Math.max(c,o.nearestInputPos(o.displayValue.length,E.FORCE_LEFT)))}});return l.sort((o,i)=>i.weight-o.weight||i.totalInputPositions-o.totalInputPositions),e.compiledMasks[l[0].index]}},B.MaskedDynamic=me;class fe extends O{constructor(e){super({...fe.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){const{enum:s,...n}=e;if(s){const r=s.map(i=>i.length),l=Math.min(...r),o=Math.max(...r)-l;n.mask="*".repeat(l),o&&(n.mask+="["+"*".repeat(o)+"]"),this.enum=s}super._update(n)}_appendCharRaw(e,s){s===void 0&&(s={});const n=Math.min(this.nearestInputPos(0,E.FORCE_RIGHT),this.value.length),r=this.enum.filter(l=>this.matchValue(l,this.unmaskedValue+e,n));if(r.length){r.length===1&&this._forEachBlocksInRange(0,this.value.length,(o,i)=>{const d=r[0][i];i>=this.value.length||d===o.value||(o.reset(),o._appendChar(d,s))});const l=super._appendCharRaw(r[0][this.value.length],s);return r.length===1&&r[0].slice(this.unmaskedValue.length).split("").forEach(o=>l.aggregate(super._appendCharRaw(o))),l}return new v({skip:!this.isComplete})}extractTail(e,s){return e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length),new Y("",e)}remove(e,s){if(e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length),e===s)return new v;const n=Math.min(super.nearestInputPos(0,E.FORCE_RIGHT),this.value.length);let r;for(r=e;r>=0&&!(this.enum.filter(i=>this.matchValue(i,this.value.slice(n,r),n)).length>1);--r);const l=super.remove(r,s);return l.tailShift+=r-e,l}get isComplete(){return this.enum.indexOf(this.value)>=0}}fe.DEFAULTS={...O.DEFAULTS,matchValue:(a,e,s)=>a.indexOf(e,s)===s},B.MaskedEnum=fe;class st extends R{updateOptions(e){super.updateOptions(e)}_update(e){super._update({...e,validate:e.mask})}}B.MaskedFunction=st;var nt;class P extends R{constructor(e){super({...P.DEFAULTS,...e})}updateOptions(e){super.updateOptions(e)}_update(e){super._update(e),this._updateRegExps()}_updateRegExps(){const e="^"+(this.allowNegative?"[+|\\-]?":""),s="\\d*",n=(this.scale?"("+Se(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(e+s+n),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(Se).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(Se(this.thousandsSeparator),"g")}_removeThousandsSeparators(e){return e.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(e){const s=e.split(this.radix);return s[0]=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),s.join(this.radix)}doPrepareChar(e,s){s===void 0&&(s={});const[n,r]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(s.input&&s.raw||!s.input&&!s.raw)?e.replace(this._mapToRadixRegExp,this.radix):e),s);return e&&!n&&(r.skip=!0),n&&!this.allowPositive&&!this.value&&n!=="-"&&r.aggregate(this._appendChar("-")),[n,r]}_separatorsCount(e,s){s===void 0&&(s=!1);let n=0;for(let r=0;r<e;++r)this._value.indexOf(this.thousandsSeparator,r)===r&&(++n,s&&(e+=this.thousandsSeparator.length));return n}_separatorsCountFromSlice(e){return e===void 0&&(e=this._value),this._separatorsCount(this._removeThousandsSeparators(e).length,!0)}extractInput(e,s,n){return e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length),[e,s]=this._adjustRangeWithSeparators(e,s),this._removeThousandsSeparators(super.extractInput(e,s,n))}_appendCharRaw(e,s){s===void 0&&(s={});const n=s.tail&&s._beforeTailState?s._beforeTailState._value:this._value,r=this._separatorsCountFromSlice(n);this._value=this._removeThousandsSeparators(this.value);const l=this._value;this._value+=e;const o=this.number;let i=!isNaN(o),d=!1;if(i){let p;this.min!=null&&this.min<0&&this.number<this.min&&(p=this.min),this.max!=null&&this.max>0&&this.number>this.max&&(p=this.max),p!=null&&(this.autofix?(this._value=this.format(p,this).replace(P.UNMASKED_RADIX,this.radix),d||(d=l===this._value&&!s.tail)):i=!1),i&&(i=!!this._value.match(this._numberRegExp))}let c;i?c=new v({inserted:this._value.slice(l.length),rawInserted:d?"":e,skip:d}):(this._value=l,c=new v),this._value=this._insertThousandsSeparators(this._value);const u=s.tail&&s._beforeTailState?s._beforeTailState._value:this._value,h=this._separatorsCountFromSlice(u);return c.tailShift+=(h-r)*this.thousandsSeparator.length,c}_findSeparatorAround(e){if(this.thousandsSeparator){const s=e-this.thousandsSeparator.length+1,n=this.value.indexOf(this.thousandsSeparator,s);if(n<=e)return n}return-1}_adjustRangeWithSeparators(e,s){const n=this._findSeparatorAround(e);n>=0&&(e=n);const r=this._findSeparatorAround(s);return r>=0&&(s=r+this.thousandsSeparator.length),[e,s]}remove(e,s){e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length),[e,s]=this._adjustRangeWithSeparators(e,s);const n=this.value.slice(0,e),r=this.value.slice(s),l=this._separatorsCount(n.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(n+r));const o=this._separatorsCountFromSlice(n);return new v({tailShift:(o-l)*this.thousandsSeparator.length})}nearestInputPos(e,s){if(!this.thousandsSeparator)return e;switch(s){case E.NONE:case E.LEFT:case E.FORCE_LEFT:{const n=this._findSeparatorAround(e-1);if(n>=0){const r=n+this.thousandsSeparator.length;if(e<r||this.value.length<=r||s===E.FORCE_LEFT)return n}break}case E.RIGHT:case E.FORCE_RIGHT:{const n=this._findSeparatorAround(e);if(n>=0)return n+this.thousandsSeparator.length}}return e}doCommit(){if(this.value){const e=this.number;let s=e;this.min!=null&&(s=Math.max(s,this.min)),this.max!=null&&(s=Math.min(s,this.max)),s!==e&&(this.unmaskedValue=this.format(s,this));let n=this.value;this.normalizeZeros&&(n=this._normalizeZeros(n)),this.padFractionalZeros&&this.scale>0&&(n=this._padFractionalZeros(n)),this._value=n}super.doCommit()}_normalizeZeros(e){const s=this._removeThousandsSeparators(e).split(this.radix);return s[0]=s[0].replace(/^(\D*)(0*)(\d*)/,(n,r,l,o)=>r+o),e.length&&!/\d$/.test(s[0])&&(s[0]=s[0]+"0"),s.length>1&&(s[1]=s[1].replace(/0*$/,""),s[1].length||(s.length=1)),this._insertThousandsSeparators(s.join(this.radix))}_padFractionalZeros(e){if(!e)return e;const s=e.split(this.radix);return s.length<2&&s.push(""),s[1]=s[1].padEnd(this.scale,"0"),s.join(this.radix)}doSkipInvalid(e,s,n){s===void 0&&(s={});const r=this.scale===0&&e!==this.thousandsSeparator&&(e===this.radix||e===P.UNMASKED_RADIX||this.mapToRadix.includes(e));return super.doSkipInvalid(e,s,n)&&!r}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,P.UNMASKED_RADIX)}set unmaskedValue(e){super.unmaskedValue=e}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(e){this.rawInputValue=this.format(e,this).replace(P.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(e){this.typedValue=e}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(e){return(super.typedValueEquals(e)||P.EMPTY_VALUES.includes(e)&&P.EMPTY_VALUES.includes(this.typedValue))&&!(e===0&&this.value==="")}}nt=P,P.UNMASKED_RADIX=".",P.EMPTY_VALUES=[...R.EMPTY_VALUES,0],P.DEFAULTS={...R.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[nt.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})},B.MaskedNumber=P;const Ce={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function Me(a,e,s){e===void 0&&(e=Ce.MASKED),s===void 0&&(s=Ce.MASKED);const n=Z(a);return r=>n.runIsolated(l=>(l[e]=r,l[s]))}function rt(a,e,s,n){return Me(e,s,n)(a)}B.PIPE_TYPE=Ce,B.createPipe=Me,B.pipe=rt;class lt extends O{get repeatFrom(){var e;return(e=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)!=null?e:0}get repeatTo(){var e;return(e=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)!=null?e:1/0}constructor(e){super(e)}updateOptions(e){super.updateOptions(e)}_update(e){var s,n,r;const{repeat:l,...o}=oe(e);this._blockOpts=Object.assign({},this._blockOpts,o);const i=Z(this._blockOpts);this.repeat=(s=(n=l??i.repeat)!=null?n:this.repeat)!=null?s:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&((r=this._blocks)==null?void 0:r.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(e){if(e<this._blocks.length)return this._blocks[e];if(this.repeatTo===1/0||this._blocks.length<this.repeatTo)return this._blocks.push(Z(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]}_appendCharRaw(e,s){s===void 0&&(s={});const n=new v;for(let d=(r=(l=this._mapPosToBlock(this.displayValue.length))==null?void 0:l.index)!=null?r:Math.max(this._blocks.length-1,0),c,u;c=(o=this._blocks[d])!=null?o:u=!u&&this._allocateBlock(d);++d){var r,l,o,i;const h=c._appendChar(e,{...s,_beforeTailState:(i=s._beforeTailState)==null||(i=i._blocks)==null?void 0:i[d]});if(h.skip&&u){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(n.aggregate(h),h.consumed)break}return n}_trimEmptyTail(e,s){var n,r;e===void 0&&(e=0);const l=Math.max(((n=this._mapPosToBlock(e))==null?void 0:n.index)||0,this.repeatFrom,0);let o;s!=null&&(o=(r=this._mapPosToBlock(s))==null?void 0:r.index),o==null&&(o=this._blocks.length-1);let i=0;for(let d=o;l<=d&&!this._blocks[d].unmaskedValue;--d,++i);i&&(this._blocks.splice(o-i+1,i),this.mask=this.mask.slice(i))}reset(){super.reset(),this._trimEmptyTail()}remove(e,s){e===void 0&&(e=0),s===void 0&&(s=this.displayValue.length);const n=super.remove(e,s);return this._trimEmptyTail(e,s),n}totalInputPositions(e,s){return e===void 0&&(e=0),s==null&&this.repeatTo===1/0?1/0:super.totalInputPositions(e,s)}get state(){return super.state}set state(e){this._blocks.length=e._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=e}}B.RepeatBlock=lt;try{globalThis.IMask=B}catch{}const so=Object.freeze(Object.defineProperty({__proto__:null,ChangeDetails:v,ChunksTailDetails:te,DIRECTION:E,HTMLContenteditableMaskElement:Ne,HTMLInputMaskElement:Qe,HTMLMaskElement:ce,InputMask:et,MaskElement:Ee,Masked:R,MaskedDate:J,MaskedDynamic:me,MaskedEnum:fe,MaskedFunction:st,MaskedNumber:P,MaskedPattern:O,MaskedRange:he,MaskedRegExp:tt,PIPE_TYPE:Ce,PatternFixedDefinition:Fe,PatternInputDefinition:pe,RepeatBlock:lt,createMask:Z,createPipe:Me,default:B,forceDirection:Je,normalizeOpts:oe,pipe:rt},Symbol.toStringTag,{value:"Module"}));q.ModalEdit=Ue,q.VForm=ue,q.VsInputText=ve,q.default=ue,q.inputs=He,Object.defineProperties(q,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});