@topvisor/ui 1.5.6 → 1.5.7-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/.chunks/{api-DupNAJPm.amd.js → api-7QFznvLR.amd.js} +2 -2
  2. package/.chunks/{api-DupNAJPm.amd.js.map → api-7QFznvLR.amd.js.map} +1 -1
  3. package/.chunks/{api-DupNAJPm.esm.js → api-7QFznvLR.esm.js} +2 -2
  4. package/.chunks/{api-DupNAJPm.esm.js.map → api-7QFznvLR.esm.js.map} +1 -1
  5. package/.chunks/{app-DinkodXi.amd.js → app-BI7BuMMX.amd.js} +2 -2
  6. package/.chunks/{app-DinkodXi.amd.js.map → app-BI7BuMMX.amd.js.map} +1 -1
  7. package/.chunks/{app-DinkodXi.esm.js → app-BI7BuMMX.esm.js} +5 -5
  8. package/.chunks/{app-DinkodXi.esm.js.map → app-BI7BuMMX.esm.js.map} +1 -1
  9. package/.chunks/{datepicker-bozIEbDA.amd.js → datepicker-DYdxOiJC.amd.js} +2 -2
  10. package/.chunks/{datepicker-bozIEbDA.amd.js.map → datepicker-DYdxOiJC.amd.js.map} +1 -1
  11. package/.chunks/{datepicker-bozIEbDA.esm.js → datepicker-DYdxOiJC.esm.js} +2 -2
  12. package/.chunks/{datepicker-bozIEbDA.esm.js.map → datepicker-DYdxOiJC.esm.js.map} +1 -1
  13. package/.chunks/{dialog-BCDVMWG1.amd.js → dialog-YkK3k6Ei.amd.js} +2 -2
  14. package/.chunks/{dialog-BCDVMWG1.amd.js.map → dialog-YkK3k6Ei.amd.js.map} +1 -1
  15. package/.chunks/{dialog-BCDVMWG1.esm.js → dialog-YkK3k6Ei.esm.js} +3 -3
  16. package/.chunks/{dialog-BCDVMWG1.esm.js.map → dialog-YkK3k6Ei.esm.js.map} +1 -1
  17. package/.chunks/{dialog_regionSelectorRegions-0M1fMu1a.amd.js → dialog_regionSelectorRegions-BGboPhrg.amd.js} +2 -2
  18. package/.chunks/{dialog_regionSelectorRegions-0M1fMu1a.amd.js.map → dialog_regionSelectorRegions-BGboPhrg.amd.js.map} +1 -1
  19. package/.chunks/{dialog_regionSelectorRegions-0M1fMu1a.esm.js → dialog_regionSelectorRegions-BGboPhrg.esm.js} +4 -4
  20. package/.chunks/{dialog_regionSelectorRegions-0M1fMu1a.esm.js.map → dialog_regionSelectorRegions-BGboPhrg.esm.js.map} +1 -1
  21. package/.chunks/{forms-CY5MOh7a.amd.js → forms-3EhjGbIm.amd.js} +2 -2
  22. package/.chunks/forms-3EhjGbIm.amd.js.map +1 -0
  23. package/.chunks/{forms-CY5MOh7a.esm.js → forms-3EhjGbIm.esm.js} +6 -6
  24. package/.chunks/{forms-CY5MOh7a.esm.js.map → forms-3EhjGbIm.esm.js.map} +1 -1
  25. package/.chunks/formsExt-Bwe_GFoI.amd.js +2 -0
  26. package/.chunks/formsExt-Bwe_GFoI.amd.js.map +1 -0
  27. package/.chunks/{formsExt-DzXSTWaT.esm.js → formsExt-Bwe_GFoI.esm.js} +34 -26
  28. package/.chunks/formsExt-Bwe_GFoI.esm.js.map +1 -0
  29. package/.chunks/{notice-bro62vCA.amd.js → notice-CAZoT0RU.amd.js} +2 -2
  30. package/.chunks/{notice-bro62vCA.amd.js.map → notice-CAZoT0RU.amd.js.map} +1 -1
  31. package/.chunks/{notice-bro62vCA.esm.js → notice-CAZoT0RU.esm.js} +2 -2
  32. package/.chunks/{notice-bro62vCA.esm.js.map → notice-CAZoT0RU.esm.js.map} +1 -1
  33. package/.chunks/{popup-3cwJ8Hev.amd.js → popup-DhySIsg9.amd.js} +2 -2
  34. package/.chunks/popup-DhySIsg9.amd.js.map +1 -0
  35. package/.chunks/{popup-3cwJ8Hev.esm.js → popup-DhySIsg9.esm.js} +4 -4
  36. package/.chunks/{popup-3cwJ8Hev.esm.js.map → popup-DhySIsg9.esm.js.map} +1 -1
  37. package/.chunks/{popup-CzhBQhVH.amd.js → popup-w1mbbfr8.amd.js} +2 -2
  38. package/.chunks/{popup-CzhBQhVH.amd.js.map → popup-w1mbbfr8.amd.js.map} +1 -1
  39. package/.chunks/{popup-CzhBQhVH.esm.js → popup-w1mbbfr8.esm.js} +3 -3
  40. package/.chunks/{popup-CzhBQhVH.esm.js.map → popup-w1mbbfr8.esm.js.map} +1 -1
  41. package/.chunks/{utils-ds_g-L_r.amd.js → utils-D3lUe-RP.amd.js} +2 -2
  42. package/.chunks/{utils-ds_g-L_r.amd.js.map → utils-D3lUe-RP.amd.js.map} +1 -1
  43. package/.chunks/{utils-ds_g-L_r.esm.js → utils-D3lUe-RP.esm.js} +4 -4
  44. package/.chunks/{utils-ds_g-L_r.esm.js.map → utils-D3lUe-RP.esm.js.map} +1 -1
  45. package/.chunks/{utils-Be-ScFyj.amd.js → utils-Db5TDjU8.amd.js} +2 -2
  46. package/.chunks/{utils-Be-ScFyj.amd.js.map → utils-Db5TDjU8.amd.js.map} +1 -1
  47. package/.chunks/{utils-Be-ScFyj.esm.js → utils-Db5TDjU8.esm.js} +3 -3
  48. package/.chunks/{utils-Be-ScFyj.esm.js.map → utils-Db5TDjU8.esm.js.map} +1 -1
  49. package/.chunks/{worker-Bv_yPPMv.amd.js → worker-DNQ_Rvpj.amd.js} +2 -2
  50. package/.chunks/{worker-Bv_yPPMv.amd.js.map → worker-DNQ_Rvpj.amd.js.map} +1 -1
  51. package/.chunks/{worker-Bv_yPPMv.esm.js → worker-DNQ_Rvpj.esm.js} +3 -3
  52. package/.chunks/{worker-Bv_yPPMv.esm.js.map → worker-DNQ_Rvpj.esm.js.map} +1 -1
  53. package/api/index.amd.js +1 -1
  54. package/api/index.amd.js.map +1 -1
  55. package/api/index.js +1 -1
  56. package/assets/notice.css +1 -1
  57. package/autoload-css-manifest.amd.json +4 -4
  58. package/autoload-css-manifest.json +4 -4
  59. package/charts/charts.amd.js +1 -1
  60. package/charts/charts.amd.js.map +1 -1
  61. package/charts/charts.js +1 -1
  62. package/core/app.amd.js +1 -1
  63. package/core/app.amd.js.map +1 -1
  64. package/core/app.js +3 -3
  65. package/dialog/dialog.amd.js +1 -1
  66. package/dialog/dialog.amd.js.map +1 -1
  67. package/dialog/dialog.js +2 -2
  68. package/extra/extra.amd.js +1 -1
  69. package/extra/extra.amd.js.map +1 -1
  70. package/extra/extra.js +2 -0
  71. package/extra/extra.js.map +1 -1
  72. package/forms/forms.amd.js +1 -1
  73. package/forms/forms.amd.js.map +1 -1
  74. package/forms/forms.js +1 -1
  75. package/formsExt/formsExt.amd.js +1 -1
  76. package/formsExt/formsExt.amd.js.map +1 -1
  77. package/formsExt/formsExt.js +1 -1
  78. package/layout/layout.amd.js +1 -1
  79. package/layout/layout.amd.js.map +1 -1
  80. package/layout/layout.js +1 -1
  81. package/package.json +3 -2
  82. package/popup/popup.amd.js +1 -1
  83. package/popup/popup.amd.js.map +1 -1
  84. package/popup/popup.js +1 -1
  85. package/popup/worker.amd.js +1 -1
  86. package/popup/worker.amd.js.map +1 -1
  87. package/popup/worker.js +1 -1
  88. package/project/project.amd.js +1 -1
  89. package/project/project.amd.js.map +1 -1
  90. package/project/project.js +14 -13
  91. package/project/project.js.map +1 -1
  92. package/schedule/schedule.amd.js +1 -1
  93. package/schedule/schedule.amd.js.map +1 -1
  94. package/schedule/schedule.js +42 -42
  95. package/schedule/schedule.js.map +1 -1
  96. package/src/components/formsExt/selector2/composables/useMenu.d.ts +2 -0
  97. package/src/components/formsExt/selector2/types.d.ts +8 -0
  98. package/src/components/project/regionSelector/utils/utils.d.ts +2 -2
  99. package/src/components/schedule/schedule/compoents/calendar/types.d.ts +9 -3
  100. package/src/components/schedule/schedule/compoents/email/types.d.ts +3 -0
  101. package/src/components/schedule/schedule/compoents/reportSend/types.d.ts +9 -0
  102. package/src/components/schedule/schedule/compoents/timeSelector/types.d.ts +12 -6
  103. package/src/components/schedule/schedule/compoents/timeSelectors/types.d.ts +3 -0
  104. package/src/core/plugins/core.d.ts +2 -2
  105. package/tabsView/tabsView.amd.js +1 -1
  106. package/tabsView/tabsView.amd.js.map +1 -1
  107. package/tabsView/tabsView.js +3 -3
  108. package/tabsView/tabsView.js.map +1 -1
  109. package/utils/clipboard.amd.js +1 -1
  110. package/utils/clipboard.amd.js.map +1 -1
  111. package/utils/clipboard.js +1 -1
  112. package/utils/date.amd.js +1 -1
  113. package/utils/date.amd.js.map +1 -1
  114. package/utils/date.js +1 -1
  115. package/utils/device.amd.js +1 -1
  116. package/utils/device.amd.js.map +1 -1
  117. package/utils/device.js +1 -1
  118. package/utils/lodash.amd.js +1 -1
  119. package/utils/lodash.amd.js.map +1 -1
  120. package/utils/lodash.js +1 -1
  121. package/utils/price.amd.js +1 -1
  122. package/utils/price.amd.js.map +1 -1
  123. package/utils/price.js +1 -1
  124. package/utils/searchers.amd.js +1 -1
  125. package/utils/searchers.amd.js.map +1 -1
  126. package/utils/searchers.js +1 -1
  127. package/utils/string.amd.js +1 -1
  128. package/utils/string.amd.js.map +1 -1
  129. package/utils/string.js +1 -1
  130. package/.chunks/forms-CY5MOh7a.amd.js.map +0 -1
  131. package/.chunks/formsExt-DzXSTWaT.amd.js +0 -2
  132. package/.chunks/formsExt-DzXSTWaT.amd.js.map +0 -1
  133. package/.chunks/formsExt-DzXSTWaT.esm.js.map +0 -1
  134. package/.chunks/popup-3cwJ8Hev.amd.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"utils-ds_g-L_r.esm.js","names":[],"sources":["../../src/storybook/jquery.ts","../../src/components/dialog/lib/utils.globalEvents.ts","../../src/components/dialog/dialog/style/dialog.css?inline","../../src/components/dialog/dialog/style/dialog.m.css?inline","../../src/components/dialog/dialog/style/dialog.pc.css?inline","../../src/components/dialog/dialog/style/modern/dialog.css?inline","../../src/components/dialog/dialog/style/modern/dialog.pc.css?inline","../../src/components/dialog/lib/utils.ts"],"sourcesContent":["/**\n * см. /.storybook/preview-head.html\n */\nexport default $;\n","import { TopDialogUtils } from './utils';\nimport { TopDialogWorker } from './worker';\nimport { isVisible, querySelectorAllArray, querySelectorVisible } from '@/core/utils/dom';\nimport { historySetState } from '@/core/utils/route';\nimport type { ElTopDialog, ElTopDialogWrapper } from '@/components/dialog/lib/types';\n\nlet inited = false;\n\n/**\n * Инициализация глобальных событий для диалоговых окон\n *\n * Производится один раз при подключении диалогового окна\n *\n * События не размонтируются\n */\nexport const initDialogGlobalEvents = () => {\n\tif (inited) return;\n\tinited = true;\n\n\t/**\n\t * Закрытие диалога по Esc\n\t */\n\tdocument.addEventListener('keydown', (e) => {\n\t\tif (e.key !== 'Escape') return;\n\t\tif (!e.target || !(e.target instanceof HTMLElement)) return;\n\n\t\tconst el = e.target;\n\n\t\t// событие произошло вне диалогового окна\n\t\tif (!el.closest('.ui-dialog')) return;\n\n\t\tif (el.contentEditable === 'true' || el.contentEditable === 'plaintext-only') return;\n\n\t\t// не закрывать окно при открытом TopPopup\n\t\tif (querySelectorVisible(document.documentElement, '.top-popup-wrapper')) return;\n\n\t\t// не закрывать окно при работе с jquery autocomplete\n\t\tif (el.classList.contains('autocomplete')) return;\n\n\t\t// не закрывать окно при открытом fancybox\n\t\tif (querySelectorVisible(document.documentElement, '.fancybox-container')) return;\n\n\t\tconst elDialogs = querySelectorAllArray<ElTopDialog>(document, '.ui-dialog-content').filter((elDialog) => {\n\t\t\treturn isVisible(elDialog);\n\t\t});\n\n\t\t$(elDialogs[elDialogs.length - 1]).dialog('close');\n\t});\n\n\t/**\n\t * Закрытие диалога по кнопке закрыть\n\t */\n\tdocument.addEventListener('click', (e) => {\n\t\t// // навигация без истории\n\t\t// var $dialog = $(this).closest('.ui-dialog-content');\n\t\t// var viewName = $dialog.attr('id');\n\t\t// var pageName = getHash('view-' + viewName);\n\t\t// if (!pageName) {\n\t\t// \ttoPrevPage($dialog);\n\t\t//\n\t\t// \treturn;\n\t\t// }\n\t\t//\n\t\t// // навигация по истории\n\t\t// if (Core.state.isMobile && history.length > 1 && $(this).closest('.modal-layer').length) {\n\t\t// \tvar href = location.href;\n\t\t//\n\t\t// \thistory.go(-1);\n\t\t//\n\t\t// \tsetTimeout(() => {\n\t\t// \t\t// это первая страница в истории вкладки браузера\n\t\t// \t\tif (href === location.href) $(e.target).closest('.ui-dialog-content').dialog('close');\n\t\t// \t});\n\t\t// } else {\n\t\t// \t$(this).closest('.ui-dialog-content').dialog('close');\n\t\t// }\n\n\t\tif (!(e.target instanceof HTMLElement)) return;\n\n\t\tconst el = e.target.closest('[data-action=\"top-dialog-close\"]') as HTMLElement | null;\n\t\tif (!el) return;\n\n\t\te.preventDefault();\n\n\t\tconst elDialog = el.closest<ElTopDialog>('.ui-dialog-content');\n\t\tif (!elDialog) return;\n\n\t\t// если к кнопке привязана ссылка, диалоговое окно не нужно закрывать\n\t\tconst toView = el.dataset.toView;\n\n\t\tif (toView == 'toPrevPage()') {\n\t\t\tTopDialogUtils.toPrevPage(elDialog);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (toView) {\n\t\t\tconst viewNameAndPageLink = toView.split('-');\n\t\t\tconst viewName = viewNameAndPageLink.shift();\n\t\t\tconst pageLink = viewNameAndPageLink.join('-');\n\n\t\t\tif (!viewName) return;\n\n\t\t\tconst elDialog = TopDialogUtils.getElDialogById(viewName);\n\t\t\tif (!elDialog) return;\n\n\t\t\tconst elToPages = querySelectorAllArray(elDialog, `[data-view-page=\"${pageLink}\"]`);\n\t\t\tif (!elToPages) return;\n\n\t\t\tif (!isVisible(elToPages[0])) {\n\t\t\t\tconst hash = TopDialogWorker.genViewPageHash(toView, 'prev');\n\n\t\t\t\t// // не убирает кнопку \"Вперед\" в браузере\n\t\t\t\t// history.replaceState(null, '', hash);\n\t\t\t\t// toViewDirty(toView, 'prev');\n\n\t\t\t\t// // добавляет текущую страницу в историю браузера\n\t\t\t\thistorySetState(false, hash);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tconst $dialog = $(elDialog);\n\n\t\t$dialog.dialog('close');\n\t});\n\n\t/**\n\t * Все submit должны обрабатываться через js\n\t */\n\tdocument.addEventListener('submit', (e) => {\n\t\tconst elForm = e.target as HTMLElement;\n\n\t\tif (elForm.matches('.modal-body > form') || elForm.matches('.modal-layer-body > form')) {\n\t\t\te.preventDefault();\n\t\t}\n\t});\n\n\t/**\n\t * Выполнение действия по нажатию Enter\n\t *\n\t * @todo Убрать `.searcher`\n\t */\n\tdocument.addEventListener('keypress', (e) => {\n\t\tif (!(e.target instanceof HTMLElement)) return;\n\n\t\tconst eventTarget = e.target;\n\n\t\tconst elModalBody = eventTarget.closest('.ui-dialog .modal-body');\n\t\tif (!elModalBody) return;\n\n\t\tconst isInput =\n\t\t\teventTarget.matches('input:not(.searcher), textarea:not(.searcher), select:not(.searcher), button:not(.searcher)')\n\t\t\t|| eventTarget.hasAttribute('contenteditable');\n\t\tif (!isInput) return;\n\n\t\t// if (e.keyCode !== 10 && e.key !== 'ENTER') return;\n\t\tif (e.key !== 'Enter') return;\n\n\t\t// не выполнять submit действий при работе с jquery autocomplete\n\t\tif (eventTarget.classList.contains('autocomplete')) {\n\t\t\te.preventDefault();\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (eventTarget.tagName === 'TEXTAREA') {\n\t\t\tif (!e.ctrlKey && !e.metaKey) return;\n\n\t\t\tconst elForm = eventTarget.closest('form');\n\n\t\t\tif (elForm) {\n\t\t\t\t// Find visible submit buttons\n\t\t\t\tconst elSubmitButton = querySelectorAllArray(elForm, 'button[type=\"submit\"]')\n\t\t\t\t\t.concat(querySelectorAllArray(elForm, 'input[type=\"submit\"]'))\n\t\t\t\t\t.find((elSubmitButton) => {\n\t\t\t\t\t\treturn isVisible(elSubmitButton);\n\t\t\t\t\t});\n\n\t\t\t\telSubmitButton?.click();\n\t\t\t}\n\t\t}\n\t});\n\n\t/**\n\t * Закрытие диалога по клику вне окна\n\t */\n\tdocument.addEventListener('click', function (event) {\n\t\tif (!(event.target instanceof HTMLElement)) return;\n\n\t\tconst eventTarget = event.target;\n\n\t\tif (!eventTarget.classList.contains('ui-widget-overlay')) return;\n\n\t\tlet elDialogWrapperWithTopZIndex: ElTopDialogWrapper | undefined;\n\t\tlet topZIndex = 0;\n\n\t\tconst elDialogWrapperVisibles = querySelectorAllArray<ElTopDialogWrapper>(document, '.ui-dialog').filter((elDialogWrapper) => {\n\t\t\treturn isVisible(elDialogWrapper);\n\t\t});\n\n\t\telDialogWrapperVisibles.forEach((elDialogWrapper) => {\n\t\t\tconst zIndex = Number(window.getComputedStyle(elDialogWrapper).zIndex);\n\t\t\tif (zIndex < topZIndex) return;\n\n\t\t\telDialogWrapperWithTopZIndex = elDialogWrapper;\n\t\t\ttopZIndex = zIndex;\n\t\t});\n\n\t\tif (elDialogWrapperWithTopZIndex) {\n\t\t\tconst elDialog = elDialogWrapperWithTopZIndex.querySelector('.ui-dialog-content');\n\n\t\t\t$(elDialog).dialog('close');\n\t\t}\n\t});\n\n\twindow.addEventListener('resize', TopDialogUtils.recalcPositions);\n\tTopDialogUtils.recalcPositions();\n};\n",":root {\n\t--dialog-border-color: var(--color-line-1);\n\t--dialog-loading-duration: 10s;\n\n\t--top-dialog-footer-height: var(--top-forms-base-height_s);\n}\n\nhtml.with_dialog { overflow: hidden !important; }\n\na[data-to-view] { cursor: pointer; }\n\n/* common */\n.ui-widget-overlay { background: #040404; opacity: 0.50; filter: Alpha(Opacity=50); }\n.ui-dialog { border-radius: 8px; border: none; padding: 0; }\n.ui-dialog.ui-widget { border: none; }\n.ui-dialog-titlebar { display: none; }\n.ui-dialog .ui-dialog-content { padding: 0; overflow: visible; }\n.ui-dialog .project_name { word-break: break-all; }\n\n.ui-dialog-content {\n\t--dialog-header-height: 50px;\n\t--dialog-layer-pageSelector: 0px;\n}\n.ui-dialog-content-withPageSelector {\n\t--dialog-layer-pageSelector: 42px;\n}\n\n.modal-header,\n.modal-body,\n.modal-footer { font-size: 14px; position: relative; }\n.modal-body { padding: var(--padding-default); }\n.modal-body:has(> .topTable:first-child) {\n\tpadding-top: calc(var(--padding-default) / 4);\n}\n\n/* modal-header */\n.modal-header {\n\tborder-bottom: 1px solid var(--dialog-border-color); height: var(--dialog-header-height); padding: 0 var(--padding-default);\n\tdisplay: flex; justify-content: space-between; align-items: center; gap: var(--top-padding-2);\n}\n.modal-header > * { padding: 10px 0; font-size: 16px; }\n.modal-header > .top-title {\n\tmargin: 0;\n\tfont-weight: normal;\n\toverflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n\tflex-grow: 1; order: 50; display: flex; align-items: center;\n}\n.modal-header > .top-title > div[class*=icon] { display: none; }\n.modal-header > div:not(.top-title) { order: 60; }\n.modal-header > div.close {\n\t--top-icon-color: var(--color-text-2);\n\n\tcursor: pointer;\n\tbackground: var(--color-layout-front-1); font-size: 16px;\n\torder: 100;\n\tanimation-name: none !important;\n}\n.modal-header > div.close:hover {\n\t--top-icon-color: var(--color-text-1);\n}\n\n.modal-header .links_icons { position: absolute; right: 50px; }\n.modal-header .links_icons [class*=\"icon-\"] { width: auto; height: auto; padding: 0 5px; color: #D6DEE0; }\n.modal-header .links_icons [class*=\"icon-\"].active { color: var(--color-bg-warning-1); }\n\n.modal-layer-pageSelector { padding: 0 10px !important; }\n\n/* modal-body */\n.modal-body {\n\tmax-height: calc(var(--100vh) - var(--dialog-header-height) - 1px - var(--dialog-layer-pageSelector) - var(--top-dialog-footer-height) - 1px);\n\toverflow-y: auto; overflow-x: hidden; box-sizing: border-box; flex-grow: 1;\n}\n.modal-body hr { margin: 16px -15px; }\n.modal-body h4 { padding: 0; margin: 0 0 10px 0; line-height: normal; }\n.modal-body .inner { padding: var(--padding-default); margin: 0 calc(0px - var(--padding-default)); position: relative; }\n.modal-body .inner .bt { border-top: 1px dashed var(--color-layout-front-primary-3); position: absolute; top: 0; right: 0; left: 0; }\n.modal-body .inner .bb { border-bottom: 1px dashed var(--color-layout-front-primary-3); position: absolute; right: 0; bottom: 0; left: 0; }\n.modal-body .inner.color-1 { background: var(--color-layout-front-primary-3); color: var(--color-text-1); }\n.modal-body .inner strong { color: var(--color-text-1); }\n.modal-body .comment { line-height: 18px; }\n\n/* modal-footer */\n.modal-footer {\n\tmin-height: var(--top-dialog-footer-height);\n\tpadding: var(--top-gap-2);\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tjustify-content: flex-end;\n\tgap: var(--top-gap-2);\n}\n\n.modal-footer .modal-footer-btn-left { margin-right: auto; }\n\n.modal-footer > .btn.full_width,\n.modal-footer > .top-button.full_width { flex-grow: 1; align-self: flex-end; }\n\n.modal-footer-fullWith {\n\tflex-wrap: wrap;\n}\n.modal-footer-fullWith > * {\n\tflex-grow: 1;\n}\n.modal-footer-fullWith > .top-info {\n\tflex-grow: 5;\n}\n.modal-footer-fullWith > *:empty {\n\tflex-grow: 0;\n}\n\n/* modal form */\n.ui-dialog-content > .modal-layer > [data-view-page] > input[type=\"submit\"] { position: absolute; visibility: hidden; }\n\n/* modal help_popup */\n.help_popup .modal-header { display: none; }\n.help_popup .modal-header a { top: 2px; z-index: 10; }\n.help_popup .modal-header .top-title { display: none; }\n\n/* view */\n.modal-layer { overflow: hidden; }\n.modal-layer a[data-top-icon]:empty { color: var(--color-text-4); text-decoration: none; }\n\n.modal-layer > [data-view-page] > div > div.buttons { display: flex; white-space: nowrap; gap: var(--top-padding-1); }\n.modal-layer > [data-view-page] > div > div.buttons:empty { display: none; }\n.modal-layer > [data-view-page] > div > div.buttons > div,\n.modal-layer > [data-view-page] > div > div.buttons > a {\n\tcursor: pointer;\n\twidth: auto; height: auto; min-width: auto; min-height: auto; padding: 10px 9px;\n\tcolor: var(--color-text-4);\n}\n.modal-layer > [data-view-page] > div > div.buttons > div:hover { color: var(--color-text-2); }\n.modal-layer > [data-view-page] > div > div.buttons > div.hidden { display: none !important; }\n\n.ui-dialog-content[data-view-page-active] { display: flex !important; flex-direction: column; justify-items: stretch; }\n.ui-dialog-content > .modal-layer { display: flex !important; align-items: stretch; position: relative; }\n.ui-dialog-content.i-change-page > .modal-layer { overflow: hidden; }\n.ui-dialog-content > .modal-layer > [data-view-page] {\n\twidth: 100%;\n\tposition: relative; display: none;\n\tflex-direction: column; justify-content: space-between;\n\tanimation: 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;\n}\n.ui-dialog-content > .modal-layer > [data-view-page].active { display: flex; }\n.ui-dialog-content > .modal-layer > [data-view-page].reverse { animation-direction: reverse; }\n.ui-dialog-content > .modal-layer > [data-view-page].center-to-left,\n.ui-dialog-content > .modal-layer > [data-view-page].right-to-center { display: flex; position: absolute; top: 0; right: 0; bottom: 0; left: 0; }\n.ui-dialog-content > .modal-layer > [data-view-page].center-to-left > div,\n.ui-dialog-content > .modal-layer > [data-view-page].right-to-center > div { overflow: hidden; }\n\n.ui-dialog-content > .modal-layer-header { border-bottom: 1px solid var(--dialog-border-color); min-height: var(--dialog-header-height); }\n.ui-dialog-content > .modal-layer-header > [data-view-page] > .modal-header { border: none; background: none; }\n.ui-dialog-content > .modal-layer-header > [data-view-page] > .modal-header > * { animation: 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].reverse > .modal-header > * { animation-direction: reverse; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].center-to-left > .modal-header > .top-title { animation-name: dialog-center-to-left-header-title; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].right-to-center > .modal-header > .top-title { animation-name: dialog-right-to-center-header-title; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].center-to-left > .modal-header > [class*=\"widget-\"] { animation-name: dialog-center-to-left-header-title; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].right-to-center > .modal-header > [class*=\"widget-\"] { animation-name: dialog-right-to-center-header-title; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].center-to-left > .modal-header > div { animation-name: dialog-center-to-left-header-icons; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].right-to-center > .modal-header > div { animation-name: dialog-right-to-center-header-icons; }\n\n.ui-dialog-content > .modal-layer-body { border-radius: 0 0 8px 8px; max-height: calc(var(--100vh) - var(--dialog-header-height) - var(--dialog-layer-pageSelector) - var(--toolbar-height)); flex-grow: 2; }\n.ui-dialog-content.i-change-page > .modal-layer-body > [data-view-page] { background: var(--color-layout-front-1); }\n.ui-dialog-content > .modal-layer-body > [data-view-page].center-to-left { animation-name: dialog-center-to-left; }\n.ui-dialog-content > .modal-layer-body > [data-view-page].right-to-center { animation-name: dialog-right-to-center; }\n\n.ui-dialog-content .modal-footer .second_level {\n\tbox-sizing: border-box;\n\tbackground: var(--color-layout-front-1); width: 100%; min-height: 25px;\n\tdisplay: flex; align-items: center; justify-content: center;\n}\n.ui-dialog-content .modal-footer .second_level input {\n\tborder-radius: 8px;\n\twidth: 100%; height: var(--top-forms-base-height);\n\tpadding: var(--top-padding-1) var(--top-padding-3);\n\tbox-sizing: border-box;\n}\n\n.ui-dialog-content > .modal-layer-body > [data-view-page].i-load-data {\n\tpointer-events: none;\n}\n.ui-dialog-content > .modal-layer-body > [data-view-page].i-load-data:before {\n\tcontent: \" \";\n\tbackground: #378DC6; width: 0; height: 4px;\n\tposition: absolute; top: 0; left: 0; z-index: 100;\n\tanimation: top-loadbar var(--dialog-loading-duration) forwards;\n}\n\n.ui-dialog-content.modal-expanded { width: 100vw !important; height: calc(var(--100vh) + 10px) !important; }\n\n/* widgets */\n.modal-header > [data-widget] {\n\tpadding: 0 8px;\n\tposition: absolute; top: 0; right: 0; bottom: 0; left: 0; opacity: 0; overflow: hidden;\n\talign-items: center;\n\tvisibility: hidden;\n\ttransition: opacity 0.3s; z-index: 1;\n}\n\n.modal-header > [data-widget=\"search\"] div.cancel {\n\topacity: 0;\n\ttransform: translateX(100%);\n\ttransition: transform, opacity; transition-duration: 0.3s;\n}\n\n[data-view-page].i-show-search { }\n[data-view-page].i-show-search .modal-header > :not([data-widget=\"search\"]) { visibility: hidden; }\n[data-view-page].i-show-search [data-widget=\"search\"] { visibility: visible; opacity: 1; }\n[data-view-page].i-show-search [data-widget=\"search\"] .cancel { transform: translateX(0); opacity: 1; }\n\n[data-view-page] > .modal-header > * { transition: opacity 0.3s; }\n[data-view-page].i-show-search > .modal-header > div.buttons { opacity: 0; }\n\n/* top-popup */\n.modal-layer .top-popup-wrapper { height: 100% !important; }\n\n/* animation */\n@keyframes dialog-center-to-left-header-title {\n\tfrom { transform: translateX(0); opacity: 1; }\n\t75% { opacity: 0; }\n\tto { transform: translateX(-30%); opacity: 0; }\n}\n\n@keyframes dialog-right-to-center-header-title {\n\tfrom { transform: translateX(100%); opacity: 0; }\n\t25% { opacity: 0; }\n\tto { transform: translateX(0); opacity: 1; }\n}\n\n@keyframes dialog-center-to-left-header-icons {\n\tfrom { transform: translateX(0); opacity: 1; }\n\t35% { transform: translateX(-20%); opacity: 0; }\n\tto { transform: translateX(-20%); opacity: 0; }\n}\n\n@keyframes dialog-right-to-center-header-icons {\n\tfrom { transform: translateX(20%); opacity: 0; }\n\t65% { transform: translateX(20%); opacity: 0; }\n\tto { transform: translateX(0); opacity: 1; }\n}\n\n@keyframes dialog-center-to-left {\n\tfrom { transform: translateX(0); filter: brightness(1); }\n\tto { transform: translateX(-30%); filter: brightness(0.9); }\n}\n\n@keyframes dialog-right-to-center {\n\tfrom { transform: translateX(100%); box-shadow: rgba(0, 0, 0, 0.1) 0 0 10px; }\n\tto { transform: translateX(0); box-shadow: rgba(0, 0, 0, 0.2) 0 0 10px; }\n}\n\n/* вид с дополнительной секцией TopPopup сбоку от окна */\n@media only screen and (max-width: 1480px) {\n\t.win_side_panel_opener { display: none; }\n}\n\n@media only screen and (min-width: 1480px) {\n\t.ui-dialog-content.with_side_panel { box-shadow: rgb(0 0 0 / 20%) 0 0 6px; }\n\n\t.ui-dialog-content.with_side_panel .modal-layer-body { background: var(--color-layout-front-1); }\n\n\t[data-widget=\"side_panel\"] {\n\t\t--side_panel_width: calc((100vw - 900px) / 2 - 28px);\n\n\t\tbox-sizing: border-box;\n\t\tbackground: var(--color-layout-front-1); max-width: var(--side_panel_width); padding: 18px;\n\t\tposition: absolute; top: calc(var(--dialog-header-height) + 1px + var(--dialog-layer-pageSelector)); bottom: calc(var(--top-dialog-footer-height) + 1px);\n\t\tz-index: -1; display: block;\n\t\ttransition: 0.2s;\n\t}\n\n\t.win_side_panel_left { border-radius: 8px 0 0 8px; right: 100%; }\n\n\t.win_side_panel_right { border-radius: 0 8px 8px 0; left: 100%; }\n\n\t.win_side_panel_closed.win_side_panel_left { right: calc(100% - var(--side_panel_width)); }\n\n\t.win_side_panel_closed.win_side_panel_right { left: calc(100% - var(--side_panel_width)); }\n\n\t[data-widget=\"side_panel\"] .template { display: block; }\n\n\t[data-widget=\"side_panel\"] .template > .header,\n\t[data-widget=\"side_panel\"] .template > .footer { display: flex; }\n\n\t.win_side_panel_opener { cursor: pointer; background: var(--color-cyan); color: #FFF; padding: 4px; position: absolute; top: 20px; }\n\n\t.win_side_panel_closed .win_side_panel_opener:not(:hover) { opacity: 0.3; }\n\n\t.win_side_panel_left .win_side_panel_opener { border-radius: 4px 0 0 4px; right: 100%; }\n\n\t.win_side_panel_right .win_side_panel_opener { border-radius: 0 6px 6px 0; left: 100%; }\n}\n\n@media only screen and (max-height: 900px) {\n\thtml.with_dialog { background: #F1F1F1; overflow: hidden; }\n\n\t.ui-widget-overlay { }\n\n\t.ui-dialog.me-tightly {\n\t\tborder-radius: 0;\n\t\theight: auto !important;\n\t\tposition: fixed; top: 0 !important; bottom: 0 !important;\n\t}\n\n\t.ui-dialog.me-tightly .ui-dialog-content { min-height: 100% !important; }\n\n\t/* для не view */\n\t.ui-dialog.me-tightly > div > .modal-body { position: absolute; top: var(--dialog-header-height); right: 0; left: 0; bottom: var(--dialog-header-height); }\n\n\t.ui-dialog.me-tightly > div > .modal-body:last-child { bottom: 0; }\n\n\t.ui-dialog.me-tightly > div > .modal-footer { position: absolute; right: 0; bottom: 0; left: 0; }\n\n\t/* view */\n\t.modal-layer { }\n\n\t.ui-dialog.me-tightly .modal-layer-body { border-radius: 0; min-height: 0 !important; }\n\n\t.ui-dialog.me-tightly .modal-layer-body .modal-footer { min-height: unset; }\n}\n","html.with_dialog body { height: var(--100vh); overflow: hidden; }\n\n.ui-widget-overlay { height: calc(100% - var(--toolbar-height)); }\n\n.ui-dialog {\n\tborder-radius: 0;\n\twidth: auto !important; height: auto !important;\n\tposition: fixed; top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;\n}\n\n.ui-dialog-content {\n\twidth: 100% !important;\n\theight: 100% !important;\n\tmin-width: 0 !important;\n\tmax-width: 100% !important;\n}\n\n/* modal-header */\n.modal-header > .top-title { text-align: center; font-size: 14px; }\n.modal-header > div.close { font-size: 14px; order: 1; }\n.modal-header > div.close:before { content: \"\"; }\n\n/* modal-body */\n.modal-body { }\n.modal-body:last-child { bottom: 0; }\n.modal-footer { bottom: 0; }\n\n/* modal-footer */\n.modal-footer .second_level { padding: 10px 8px; }\n\n/* view */\n.modal-layer-body { min-height: 0 !important; }\n.ui-dialog-content > .modal-layer-body { border-radius: 0; }\n/*.ui-dialog-content > .modal-layer-body > [data-view-page] .modal-body{ margin: auto 0; }*/\n\n.modal-body,\n.modal-footer { padding-right: 12px; padding-left: 12px; }\n.modal-footer .btn:last-child { margin-right: 12px; }\n\n.modal-body .inner { padding: 12px; margin: 0 -12px; position: relative; }\n","/* menu */\n.modal-menu-opener { order: 1 !important; }\n.modal-menu-opener:before {\n\t--top-icon-size: 20px;\n\t--top-icon-color: #FFF;\n\t--top-icon-width: var(--top-icon-size);\n\n\tborder-radius: 50%; background: var(--color-bg-primary-1); padding: 3px;\n\ttransition: transform 0.1s;\n}\n.modal-menu-opener:hover:before { background: var(--color-bg-primary-2); }\n.modal-menu-opener.top-active:before { background: var(--color-bg-primary-2); transform: scale(0.8); }\n\n/* top-popup */\n.modal-layer .top-popup-wrapper {\n\tbackground: transparent;\n\twidth: auto !important; padding: 0 !important; margin: 0 !important;\n\ttop: 0 !important; right: 0 !important; left: 0 !important;\n\ttransition: background 0.3s;\n}\n\n.modal-layer .top-popup-wrapper > .top-popup[class],\n.modal-layer .top-popup-wrapper.with_notch > .top-popup[class] {\n\tborder-radius: 8px; border: none; margin: 12px !important; max-width: 100%; max-height: calc(100% - 24px);\n\ttop: 0 !important; right: 0 !important; bottom: auto !important; left: 0 !important; overflow: auto; display: flex; flex-direction: column;\n\topacity: 1;\n\ttransform: translateY(calc(-100% - 24px));\n\ttransition: transform 0.3s;\n}\n\n.modal-layer .top-popup > .top-popup_header { background: var(--color-theme-50); }\n\n.modal-layer .top-theme-lite .top-popup > .top-popup_header .select { border: none; }\n.modal-layer .top-theme-lite .top-popup > .top-popup_header .select .text { color: #FFF; }\n.modal-layer .top-theme-lite .top-popup > .top-popup_header .select .arrow { background: none; }\n\n.modal-layer .top-popup-wrapper-shown:not(.top-popup-wrapper-closed) {\n\tpointer-events: auto;\n\tbackground: rgba(52, 73, 94, 0.25);\n}\n\n@media only screen and (min-width: 1480px) {\n\t.ui-dialog-content.with_side_panel { box-shadow: rgb(0 0 0 / 20%) 0 0 6px; }\n\n\t.ui-dialog-content.with_side_panel .modal-layer-body { background: var(--color-layout-front-1); }\n\n\t[data-widget=\"side_panel\"] {\n\t\t--side_panel_width: calc((100vw - 900px) / 2 - 28px);\n\n\t\tbox-sizing: border-box;\n\t\tbackground: var(--color-layout-front-1); max-width: var(--side_panel_width); padding: 18px;\n\t\tdisplay: block; position: absolute; top: 51px; bottom: 51px; z-index: -1;\n\t\ttransition: 0.2s;\n\t}\n\n\t.win_side_panel_left { border-radius: 8px 0 0 8px; right: 100%; }\n\n\t.win_side_panel_right { border-radius: 0 8px 8px 0; left: 100%; }\n\n\t.win_side_panel_closed.win_side_panel_left { right: calc(100% - var(--side_panel_width)); }\n\n\t.win_side_panel_closed.win_side_panel_right { left: calc(100% - var(--side_panel_width)); }\n\n\t[data-widget=\"side_panel\"] .template { display: block; }\n\n\t[data-widget=\"side_panel\"] .template > .header,\n\t[data-widget=\"side_panel\"] .template > .footer { display: flex; }\n\n\t.win_side_panel_opener { cursor: pointer; background: var(--color-cyan); color: #FFF; padding: 4px; position: absolute; top: 20px; }\n\n\t.win_side_panel_closed .win_side_panel_opener:not(:hover) { opacity: 0.3; }\n\n\t.win_side_panel_left .win_side_panel_opener { border-radius: 4px 0 0 4px; right: 100%; }\n\n\t.win_side_panel_right .win_side_panel_opener { border-radius: 0 6px 6px 0; left: 100%; }\n}\n","html {\n\t--top-dialog-width: auto;\n\t--top-dialog-height: auto;\n}\n\n.top-dialog {\n\tmax-width: 100vw;\n}\n\n.top-dialog .modal-layer-body {\n\theight: var(--top-dialog-height);\n}\n",".top-dialog {\n\twidth: var(--top-dialog-width) !important;\n}","import 'jquery';\nimport { nextTick } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { TopPopupWorker } from '@/components/popup/worker';\nimport { sleep, waitWhile } from '@/core/utils/system';\nimport { setHashs } from '@/core/utils/route';\nimport { connectScrollShadow } from '@/core/utils/scroll';\n\nimport type { ElTopDialog, ElTopDialogBody, ElTopDialogModalLayer, ElTopDialogPage, ElTopDialogWrapper, MoveDirection } from './types';\nimport { TopDialogWorker } from './worker';\nimport { initDialogGlobalEvents } from './utils.globalEvents';\nimport { getDialogWorker } from '../dialog/dialogs/dialogs.vue';\n\nimport css from '../dialog/style/dialog.css?inline';\nimport cssM from '../dialog/style/dialog.m.css?inline';\nimport cssPC from '../dialog/style/dialog.pc.css?inline';\nimport cssModern from '../dialog/style/modern/dialog.css?inline';\nimport cssModernPC from '../dialog/style/modern/dialog.pc.css?inline';\nimport { isVisible, querySelectorAllArray } from '@/core/utils/dom';\n\nCore.insertStyleToPage(css);\nCore.insertStyleToPage(cssM, 'm');\nCore.insertStyleToPage(cssPC, 'pc');\nCore.insertStyleToPage(cssModern);\nCore.insertStyleToPage(cssModernPC, 'pc');\n\nlet timerClearAnimation: NodeJS.Timeout;\nlet isInited = false;\n\n/**\n * Является ли элемент JQuery<HTMLElement>\n */\nconst isElJQuery = (el: JQuery<HTMLElement> | HTMLElement | HTMLElement[]) => {\n\treturn !!el && typeof el === 'object' && 'jquery' in el;\n};\n\nconst init = () => {\n\t$.extend($.ui.dialog.prototype.options, {\n\t\tfocus: (e: any) => {\n\t\t\te.target.focus();\n\n\t\t\t$('[autofocus]', e.target)[0]?.focus();\n\n\t\t\t// setTimeout(function () {\n\t\t\t// \tif ($('[autofocus]', e.target).length) return;\n\t\t\t// \t$('.modal-footer button:first, .modal-body :input:first', e.target).eq(0).focus();\n\t\t\t//\n\t\t\t// \t// fix пропадающего autocomplete при нажатии на scroll в autocomplete\n\t\t\t// \t$(e.target).add($(e.target).closest('.ui-dialog')).removeAttr('tabindex');\n\t\t\t// });\n\t\t},\n\t\tcreate: (e: any) => onCreate(e.target),\n\t\topen: (e: any) => onOpen(e.target),\n\t\tclose: (e: any) => onClose(e.target),\n\t\tmodal: true,\n\t\tresizable: false,\n\t\tcloseOnEscape: false,\n\t\twidth: 'auto',\n\t\tminHeight: 0,\n\t});\n\n\t$.ui.dialog.prototype._focusTabbable = $.noop;\n\n\t$.ui.dialog.prototype._moveToTopOriginal = $.ui.dialog.prototype._moveToTop;\n\t$.ui.dialog.prototype._moveToTop = function () {\n\t\tthis._moveToTopOriginal();\n\n\t\tconst $dialog = $(this.element);\n\t\t$dialog.trigger('dialogsMoveToTop', [$dialog]);\n\t};\n\n\tinitDialogGlobalEvents();\n\n\tisInited = true;\n};\n\n/**\n * Получить настройки диалогового окна из Vue компонента\n */\nconst genVueOptions = (elDialog: ElTopDialog) => {\n\tconst options: {\n\t\tmodal?: boolean,\n\t\tposition?: any,\n\t} = {};\n\n\tif (elDialog.dataset?.modal === 'false') options.modal = false;\n\tif (elDialog.dataset?.position) options.position = JSON.parse(elDialog.dataset.position);\n\n\treturn options;\n};\n\nconst getElDialogById = (id: string) => {\n\treturn <ElTopDialog | null>document.getElementById(id);\n};\n\n/**\n * Сменить состояние диалогового окна Vue\n */\nconst updatePageVue = async (dialogId: string, pageName?: string, pageNameNext?: string) => {\n\tif (!dialogId.startsWith('dialog_')) return;\n\n\tconst dialog = getDialogWorker(dialogId);\n\tif (!dialog) return;\n\n\tdialog.isOpened.value = true;\n\tif (pageName !== undefined) dialog.pageActive.value = pageName;\n\tif (pageNameNext !== undefined) dialog.pageActiveNext.value = pageNameNext;\n\n\tawait nextTick();\n\n\tif (pageNameNext) {\n\t\tconst elDialog = getElDialogById(dialogId);\n\t\tif (!elDialog) return;\n\n\t\tconst elNextpages = elDialog.querySelectorAll(`[data-view-page=\"${pageNameNext}\"]`);\n\n\t\tif (!elNextpages.length) {\n\t\t\tawait waitWhile(() => !elDialog.querySelectorAll(`[data-view-page=\"${pageNameNext}\"]`).length);\n\t\t}\n\t}\n};\n\n/**\n * Callback for jQuery dialog onCreate\n */\nconst onCreate = (elDialog: ElTopDialog) => {\n\tconst elDialogBody = elDialog.querySelector<ElTopDialogBody>('.modal-body');\n\tif (!elDialogBody) return;\n\n\tconnectScrollShadow(elDialogBody);\n\n\tTopDialogWorker.state.decoratorOnCreate?.(elDialog);\n\n\tinitPopup(elDialog);\n};\n\n/**\n * Инициирование событий TopPopup в диалоговом окне\n */\nconst initPopup = (elDialog: HTMLElement) => {\n\t$(elDialog).on('aftershow.top-menu-popup', '[data-top-popup]', (_e, $popup) => {\n\t\t// перенести popup в корневой элемент страницы диалогового окна\n\t\tconst elPopup = $popup[0];\n\n\t\t// перенести popup в корневой элемент страницы диалогового окна\n\t\tconst elPageContents = TopDialogWorker.getPairPage(elPopup);\n\t\telPageContents?.[1]?.prepend(elPopup);\n\t});\n};\n\n/**\n * Callback for jQuery dialog onOpen\n */\nconst onOpen = async (elDialog: ElTopDialog) => {\n\tconst pageName = elDialog.dataset.viewPageActive;\n\tconst args = elDialog.dataset.args ? elDialog.dataset.args?.split(':') : [];\n\n\tconst w1 = window.innerWidth;\n\n\tCore.state.documentClassModificators.set('top-dialog', 'with_dialog');\n\n\tconst w2 = window.innerWidth;\n\n\tconst scrollBarWidth = w2 - w1;\n\tif (document.documentElement.scrollHeight > window.innerHeight) document.querySelector('html')!.style.marginRight = scrollBarWidth + 'px';\n\n\trecalcPositions();\n\n\tconst dialog = getDialogWorker(elDialog.getAttribute('id')!);\n\tdialog?.emit?.('open', pageName, args);\n};\n\n/**\n * Callback for jQuery dialog onClose\n */\nconst onClose = async (elDialog: ElTopDialog) => {\n\tconst viewName = elDialog.getAttribute('id');\n\tconst pageName = elDialog.dataset.viewPageActive;\n\n\tif (pageName) {\n\t\tconst hashData = {\n\t\t\tvpn: TopDialogWorker.state.viewPageN as number | null,\n\t\t\t['view-' + viewName]: null,\n\t\t};\n\t\thashData['view-' + viewName] = null;\n\n\t\tif (TopDialogWorker.state.viewPageN === 0 || TopDialogWorker.state.viewPageN === 1) {\n\t\t\thashData.vpn = null;\n\t\t}\n\n\t\tsetHashs(hashData, false);\n\t}\n\n\tconst elUiWidgetOverlayVisibles = querySelectorAllArray(document, '.ui-widget-overlay').filter((el) => {\n\t\treturn isVisible(el);\n\t});\n\n\tif (!elUiWidgetOverlayVisibles.length) {\n\t\tCore.state.documentClassModificators.delete('top-dialog');\n\n\t\tdocument.querySelector('html')!.style.marginRight = '';\n\t}\n\n\t$(elDialog).trigger('viewAfterClose', [$(elDialog)]);\n\n\tconst dialog = getDialogWorker(viewName);\n\n\tif (dialog) {\n\t\tdialog.isOpened.value = false;\n\t\tdialog.emit?.('close', pageName);\n\n\t\tif (dialog.onCloseOnce) {\n\t\t\tdialog.onCloseOnce(dialog.props, pageName);\n\t\t\tdialog.onCloseOnce = undefined;\n\t\t}\n\t}\n\n\t// после закрытия диалога может потребоваться пересчет позиций элементов\n\twindow.dispatchEvent(new Event('resize'));\n};\n\n/**\n * Пересчитать положения и размеры открытых диалоговых окон\n */\nconst recalcPositions = () => {\n\tconst elDialogVisibilityes = querySelectorAllArray(document, '.ui-dialog').filter((el) => {\n\t\treturn isVisible(el) && el.querySelector<ElTopDialog>(':scope > .ui-dialog-content');\n\t}).map((el) => {\n\t\treturn el.querySelector<ElTopDialog>(':scope > .ui-dialog-content')!;\n\t});\n\n\telDialogVisibilityes.forEach((elDialog) => {\n\t\tconst elDialogBody = elDialog.querySelector<ElTopDialogBody>('.modal-body');\n\t\tif (!elDialogBody) return;\n\n\t\tconst elDialogWrapper = elDialog.closest('.ui-dialog');\n\n\t\tconst options = genVueOptions(elDialog);\n\n\t\toptions.position ??= { of: window };\n\n\t\tconst $dialog = $(elDialog);\n\t\t$dialog.dialog('option', options);\n\n\t\telDialogWrapper.classList.remove('me-tightly');\n\t\tif ((elDialogWrapper.clientHeight ?? 0) > window.innerHeight) elDialogWrapper.classList.add('me-tightly');\n\t});\n};\n\n/**\n * Переход к view page по неразобранной ссылке в формате: {viewName}-{pageName}[:args]\n */\nconst toViewDirty = async (toViewPageName: string, moveDirection?: MoveDirection) => {\n\tconst regexp = /(\\w+)[=-]([\\w-]+)(?::([\\w.:-]+))?/g;\n\tconst toViewParts = regexp.exec(toViewPageName);\n\tif (toViewParts) {\n\t\tconst viewName = toViewParts[1];\n\t\tconst pageName = toViewParts[2];\n\t\tconst argsString = toViewParts[3];\n\n\t\tlet args: string[] = [];\n\t\tif (argsString) args = argsString.split(':');\n\n\t\tawait toView(viewName, pageName, args, moveDirection);\n\t}\n};\n\n/**\n * Открыть диалоговое окно, возможно указать нужную страницу\n * @param viewNameOrElDialog - id страницы окна или элемент окна\n * @param pageName - имя страницы\n * @param args - аргументы, набор проивзольных параметров, которые могут обрабатываться каждым окном по своему\n * @param moveDirection\n * @param callback - функция, которая будет запущена после октытия страницы\n */\nconst toView = async (\n\tviewNameOrElDialog: ElTopDialog | JQuery<ElTopDialog> | string,\n\tpageName?: string,\n\targs?: string[],\n\tmoveDirection?: MoveDirection,\n\tcallback?: Function,\n) => {\n\tif (!isInited) {\n\t\tawait new Promise<void>((resolve, _reject) => {\n\t\t\tconst timer = setInterval(() => {\n\t\t\t\tif (!isInited) return;\n\n\t\t\t\tclearInterval(timer);\n\n\t\t\t\tresolve();\n\t\t\t}, 10);\n\t\t});\n\t}\n\n\tawait nextTick();\n\n\tlet elDialog: ElTopDialog | null;\n\tif (typeof (viewNameOrElDialog) === 'object') {\n\t\tif (isElJQuery(viewNameOrElDialog)) viewNameOrElDialog = viewNameOrElDialog?.[0]; // todo: убрать после переписки jquery на сайте\n\n\t\telDialog = viewNameOrElDialog;\n\t} else {\n\t\telDialog = getElDialogById(viewNameOrElDialog);\n\t}\n\n\t// Диалоговое окно еще не загружено\n\tif (!elDialog && typeof viewNameOrElDialog === 'string' && TopDialogWorker.state.load) {\n\t\tawait TopDialogWorker.state.load(viewNameOrElDialog);\n\n\t\telDialog = getElDialogById(viewNameOrElDialog);\n\t\tif (!elDialog) {\n\t\t\tthrow new Error('Dialog no exists: ' + viewNameOrElDialog);\n\t\t}\n\t}\n\n\tif (!elDialog) return;\n\n\tawait toViewPage(elDialog, pageName, args, moveDirection);\n\n\tconst $dialog = $(elDialog);\n\n\tif (elDialog?.classList.contains('ui-dialog-content')) {\n\t\t// var zIndexMax = 0;\n\t\t// $.map($('.ui-dialog'), function (el) {\n\t\t// \tvar zIndex = $(el).css('z-index') * 1;\n\t\t// \tif (zIndex > zIndexMax) zIndexMax = zIndex;\n\t\t// });\n\t\t//\n\t\t// if ($dialog.is(':hidden')) $dialog.dialog('open');\n\t\t//\n\t\t// var $dialogWrapper = $dialog.parent();\n\t\t// var $dialogOverlay = $dialogWrapper.next();\n\t\t//\n\t\t// if ($dialogWrapper.css('z-index') * 1 < zIndexMax) {\n\t\t// \t$dialogWrapper.css('z-index', zIndexMax + 2);\n\t\t// \t$dialogOverlay.css('z-index', zIndexMax + 1);\n\t\t// }\n\n\t\t$dialog.dialog('open');\n\t} else {\n\t\tconst options = genVueOptions(elDialog);\n\n\t\t$dialog.dialog(options);\n\t}\n\n\tif (callback) callback($dialog);\n};\n\nconst toViewPage = async (elDialog: ElTopDialog | JQuery<ElTopDialog>, pageName?: string, args?: string[], moveDirection?: MoveDirection) => {\n\t// todo: убрать после переписки jquery на сайте\n\tif (isElJQuery(elDialog)) elDialog = elDialog?.[0];\n\n\tif (pageName === undefined) pageName = elDialog.dataset.viewPageActive;\n\tif (args === undefined) args = elDialog.dataset.args?.split(':') ?? [];\n\n\tif (pageName !== elDialog.dataset.viewPageActive) {\n\t\tconst stopped = stopAnimations(elDialog);\n\t\tif (stopped) await sleep(100);\n\t}\n\n\tawait updatePageVue(elDialog.getAttribute('id') as string, undefined, pageName);\n\n\tconst elModalLayers = querySelectorAllArray<ElTopDialogModalLayer>(elDialog, '.modal-layer');\n\tconst elCurrentPages = elModalLayers.reduce<ElTopDialogPage[]>((acc, elModalLayer) => {\n\t\tconst elCurrentPage = elModalLayer.querySelector<ElTopDialogPage>(':scope > .active');\n\t\tif (elCurrentPage) {\n\t\t\tacc.push(elCurrentPage);\n\t\t}\n\n\t\treturn acc;\n\t}, []);\n\n\tconst elNextPages = elModalLayers.reduce<ElTopDialogPage[]>((acc, elModalLayer) => {\n\t\tconst elNextPage = elModalLayer.querySelector<ElTopDialogPage>(`:scope > [data-view-page=\"${pageName}\"]`);\n\t\tif (elNextPage) {\n\t\t\tacc.push(elNextPage);\n\t\t}\n\n\t\treturn acc;\n\t}, []);\n\n\tconst argsString = args.join(':');\n\n\tif (moveDirection === undefined) {\n\t\tmoveDirection = 'next';\n\t\tif ((elNextPages[0]?.dataset.order ?? 0) < (elCurrentPages[0]?.dataset.order ?? 0)) moveDirection = 'prev';\n\t}\n\n\tif (!elNextPages.length) return;\n\n\telDialog.dataset.viewPageActive = pageName;\n\telDialog.dataset.args = args?.join(':') ?? '';\n\n\t// запрашиваемая страница уже открыта\n\tif (elNextPages[0].classList.contains('active')) {\n\t\tif (elNextPages[0].dataset.viewPageArgs !== argsString) {\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\telNextPage.dataset.viewPageArgs = argsString;\n\t\t\t});\n\n\t\t\t// dialogs.beforeOpenViewPage($dialog, $nextPage, pageName, args);\n\t\t\t// dialogs.afterOpenViewPage($dialog, $nextPage, pageName, args);\n\t\t}\n\n\t\tbeforeOpenViewPage(elDialog, elNextPages, pageName, args);\n\t\tafterOpenViewPage(elDialog, elNextPages, pageName, args);\n\n\t\treturn;\n\t}\n\n\telNextPages.forEach((elNextPage) => {\n\t\telNextPage.dataset.viewPageArgs = argsString;\n\t});\n\n\telCurrentPages.forEach((elCurrentPage) => {\n\t\tif (elCurrentPage.querySelector('.top-popup-wrapper')) {\n\t\t\tTopPopupWorker.close(elCurrentPage.querySelector('.top-popup-wrapper')!);\n\t\t}\n\t});\n\n\tconst elDialogWrapper = elNextPages[0].closest<ElTopDialogWrapper>('.ui-dialog');\n\n\tif (elDialogWrapper && !isVisible(elDialogWrapper)) moveDirection = 'none';\n\tif (!elCurrentPages.length) moveDirection = 'none';\n\tif (isVisible(elNextPages[0])) moveDirection = 'none';\n\n\tswitch (moveDirection) {\n\t\tcase 'prev': {\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\tconst elActive = elNextPage.parentNode?.querySelector(':scope > .active');\n\t\t\t\tif (elActive) elNextPage.parentNode?.insertBefore(elNextPage, elActive);\n\t\t\t});\n\n\t\t\telCurrentPages.forEach((elCurrentPage) => {\n\t\t\t\telCurrentPage.classList.add('right-to-center', 'reverse');\n\t\t\t});\n\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\telNextPage.classList.add('center-to-left', 'reverse');\n\t\t\t});\n\n\t\t\tbreak;\n\t\t}\n\t\tcase 'next': {\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\tconst elActive = elNextPage.parentNode?.querySelector(':scope > .active');\n\t\t\t\tif (elActive) elNextPage.parentNode?.insertBefore(elNextPage, elActive.nextSibling);\n\t\t\t});\n\n\t\t\telCurrentPages.forEach((elCurrentPage) => {\n\t\t\t\telCurrentPage?.classList.add('center-to-left');\n\t\t\t});\n\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\telNextPage.classList.add('right-to-center');\n\t\t\t});\n\n\t\t\tbreak;\n\t\t}\n\t}\n\n\telDialog.setAttribute('view-page-active', pageName);\n\n\telCurrentPages.forEach((elCurrentPage) => {\n\t\telCurrentPage.classList.remove('active');\n\t});\n\n\telNextPages.forEach((elNextPage) => {\n\t\telNextPage.classList.add('active');\n\t});\n\n\tbeforeOpenViewPage(elDialog, elNextPages, pageName, args);\n\n\tif (moveDirection) {\n\t\telDialog.classList.add('i-change-page');\n\n\t\tconst delay = Number(window.getComputedStyle(elNextPages[0]).animationDuration.replace('s', '')) * 1000;\n\n\t\ttimerClearAnimation = setTimeout(function () {\n\t\t\tupdatePageVue(elDialog.getAttribute('id'), pageName, '');\n\t\t\tstopAnimations(elDialog);\n\t\t\tafterOpenViewPage(elDialog, elNextPages, pageName, args);\n\t\t}, delay);\n\t} else {\n\t\tawait updatePageVue(elDialog.getAttribute('id'), pageName, '');\n\t\tafterOpenViewPage(elDialog, elNextPages, pageName, args);\n\t}\n};\n\n/**\n * К предыдущему представлению\n */\nconst toPrevPage = (elDialog: ElTopDialog) => {\n\tconst elModalLayers = querySelectorAllArray<ElTopDialogModalLayer>(elDialog, '.modal-layer');\n\tconst elCurrentPages = elModalLayers.reduce<ElTopDialogPage[]>((acc, elModalLayer) => {\n\t\tconst elCurrentPage = elModalLayer.querySelector<ElTopDialogPage>(':scope > .active');\n\n\t\tif (elCurrentPage) {\n\t\t\tacc.push(elCurrentPage);\n\t\t}\n\n\t\treturn acc;\n\t}, []);\n\n\tconst elPrevPages = elCurrentPages.reduce<ElTopDialogPage[]>((acc, elCurrentPage) => {\n\t\tlet elPrevPage = elCurrentPage.previousElementSibling as ElTopDialogPage | null;\n\t\twhile (elPrevPage && !elPrevPage.hasAttribute('data-view-page')) {\n\t\t\telPrevPage = elPrevPage.previousElementSibling as ElTopDialogPage | null;\n\t\t}\n\n\t\tif (elPrevPage) acc.push(elPrevPage);\n\n\t\treturn acc;\n\t}, []);\n\n\tconst prevPageName = (elPrevPages[0])?.dataset.viewPage;\n\n\tif (prevPageName) {\n\t\tvoid toViewPage(elDialog, prevPageName, undefined, 'prev');\n\t} else {\n\t\tconst $dialog = $(elDialog);\n\t\t$dialog.dialog('close');\n\t}\n};\n\n/**\n * Для обработки событий вне vue\n */\nconst beforeOpenViewPageTimers = new Set();\nconst beforeOpenViewPage = (elDialog: ElTopDialog, elPages: ElTopDialogPage[], pageName: string, args: string[]) => {\n\t// группировка цепочки событий\n\t// запрос на открытие страницы может выполняться несколько раз, чаще такое может быть при открытии, загрузке и переходе сразу к нужной странице\n\tconst eventKey = elDialog.getAttribute('id') + elPages[0].dataset.viewPage + pageName + args.join();\n\n\tif (beforeOpenViewPageTimers.has(eventKey)) return;\n\tbeforeOpenViewPageTimers.add(eventKey);\n\n\tsetTimeout(function () {\n\t\tbeforeOpenViewPageTimers.delete(eventKey);\n\n\t\t$(elDialog).trigger('viewBeforeOpen', [$(elDialog), $(elPages), pageName, args]);\n\t});\n};\n\n/**\n * Для обработки событий вне vue\n */\nconst afterOpenViewPage = (elDialog: ElTopDialog, elPages: ElTopDialogPage[], pageName: string, args: string[]) => {\n\tsetTimeout(function () {\n\t\t$(elDialog).trigger('viewAfterOpen', [$(elDialog), $(elPages), pageName, args]);\n\t});\n};\n\n/**\n * Получить состояние: Диалоговое окно находится в состоянии смены страницы\n */\nconst inAnimation = (elDialog: ElTopDialog | JQuery<ElTopDialog>) => {\n\tif (isElJQuery(elDialog)) elDialog = elDialog?.[0]; // todo: убрать после переписки jquery на сайте\n\n\treturn elDialog.classList.contains('i-change-page');\n};\n\n/**\n * Остановить анимацию смены страницы\n *\n * @returns Вернет true, если анимация производилась и была остановлена\n */\nconst stopAnimations = (elDialog: ElTopDialog) => {\n\tif (!inAnimation(elDialog)) return false;\n\n\tclearTimeout(timerClearAnimation);\n\n\tconst elModalLayers = querySelectorAllArray(elDialog, '.modal-layer');\n\n\tconst pageName = elDialog.dataset.viewPageActive;\n\telDialog.classList.remove('i-change-page');\n\n\telModalLayers.forEach((elModalLayer) => {\n\t\telModalLayer.querySelectorAll(':scope > [data-view-page]').forEach((el) => {\n\t\t\tel.classList.remove('center-to-left', 'right-to-center', 'reverse', 'active');\n\t\t});\n\t});\n\n\telModalLayers.forEach((elModalLayer) => {\n\t\telModalLayer.querySelector(`:scope > [data-view-page=\"${pageName}\"]`)?.classList.add('active');\n\t});\n\n\treturn true;\n};\n\n/**\n * Закрыть диалоговое окно\n */\nconst close = function (dialogId: string) {\n\tconst elDialog = getElDialogById(dialogId);\n\tif (!elDialog) return;\n\n\tconst $dialog = $(elDialog);\n\n\tif (!$dialog.dialog('instance')) return;\n\n\t$dialog.dialog('close');\n};\n\n/**\n * Управление props.isLoading\n */\nconst setLoading = (elPages: ElTopDialogPage[] | JQuery<ElTopDialogPage>, isLoading: boolean, duration?: number) => {\n\tif (isElJQuery(elPages)) elPages = elPages.toArray(); // todo: убрать после переписки jquery на сайте\n\n\tconst elPagesVisibleds = elPages.reduce<ElTopDialogPage[]>((acc, elPage) => {\n\t\tif (elPage.hasAttribute('data-view-page') && isVisible(elPage)) acc.push(elPage);\n\n\t\treturn acc;\n\t}, []);\n\n\tif (isLoading) {\n\t\tif (duration !== undefined) {\n\t\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\t\telPagesVisibled.style.setProperty('--dialog-loading-duration', duration + 's');\n\t\t\t});\n\t\t}\n\n\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\telPagesVisibled.classList.add('i-load-data');\n\t\t});\n\t} else {\n\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\telPagesVisibled.classList.remove('i-load-data');\n\t\t});\n\n\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\telPagesVisibled.style.setProperty('--dialog-loading-duration', '10s');\n\t\t});\n\t}\n};\n\nconst isLoading = (elPage: ElTopDialogPage | JQuery<ElTopDialogPage>) => {\n\tif (isElJQuery(elPage)) elPage = elPage?.[0]; // todo: убрать после переписки jquery на сайте\n\n\treturn elPage.classList.contains('i-load-data');\n};\n\nexport const TopDialogUtils = {\n\tgetElDialogById,\n\tupdatePageVue,\n\trecalcPositions,\n\ttoViewDirty,\n\ttoView,\n\ttoViewPage,\n\ttoPrevPage,\n\tsetLoading,\n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A6B,KAAK;EACrE,CAAC;CAEH;CAiBC,YAfkB,OACd,EAAW,CAAM,MAAG,IAAS,IAAS,KAEnC,EAAO,UAAU,SAAS,aAAa;CAa9C;CACA,gBA7DuB,GAAkB;EACzC,IAAM,IAAW,EAAgB,CAAQ;EACzC,IAAI,CAAC,GAAU;EAEf,IAAM,IAAU,EAAE,CAAQ;EAErB,EAAQ,OAAO,UAAU,KAE9B,EAAQ,OAAO,OAAO;CACvB;AAqDA;AAEA,EAAK"}
1
+ {"version":3,"file":"utils-D3lUe-RP.esm.js","names":[],"sources":["../../src/storybook/jquery.ts","../../src/components/dialog/lib/utils.globalEvents.ts","../../src/components/dialog/dialog/style/dialog.css?inline","../../src/components/dialog/dialog/style/dialog.m.css?inline","../../src/components/dialog/dialog/style/dialog.pc.css?inline","../../src/components/dialog/dialog/style/modern/dialog.css?inline","../../src/components/dialog/dialog/style/modern/dialog.pc.css?inline","../../src/components/dialog/lib/utils.ts"],"sourcesContent":["/**\n * см. /.storybook/preview-head.html\n */\nexport default $;\n","import { TopDialogUtils } from './utils';\nimport { TopDialogWorker } from './worker';\nimport { isVisible, querySelectorAllArray, querySelectorVisible } from '@/core/utils/dom';\nimport { historySetState } from '@/core/utils/route';\nimport type { ElTopDialog, ElTopDialogWrapper } from '@/components/dialog/lib/types';\n\nlet inited = false;\n\n/**\n * Инициализация глобальных событий для диалоговых окон\n *\n * Производится один раз при подключении диалогового окна\n *\n * События не размонтируются\n */\nexport const initDialogGlobalEvents = () => {\n\tif (inited) return;\n\tinited = true;\n\n\t/**\n\t * Закрытие диалога по Esc\n\t */\n\tdocument.addEventListener('keydown', (e) => {\n\t\tif (e.key !== 'Escape') return;\n\t\tif (!e.target || !(e.target instanceof HTMLElement)) return;\n\n\t\tconst el = e.target;\n\n\t\t// событие произошло вне диалогового окна\n\t\tif (!el.closest('.ui-dialog')) return;\n\n\t\tif (el.contentEditable === 'true' || el.contentEditable === 'plaintext-only') return;\n\n\t\t// не закрывать окно при открытом TopPopup\n\t\tif (querySelectorVisible(document.documentElement, '.top-popup-wrapper')) return;\n\n\t\t// не закрывать окно при работе с jquery autocomplete\n\t\tif (el.classList.contains('autocomplete')) return;\n\n\t\t// не закрывать окно при открытом fancybox\n\t\tif (querySelectorVisible(document.documentElement, '.fancybox-container')) return;\n\n\t\tconst elDialogs = querySelectorAllArray<ElTopDialog>(document, '.ui-dialog-content').filter((elDialog) => {\n\t\t\treturn isVisible(elDialog);\n\t\t});\n\n\t\t$(elDialogs[elDialogs.length - 1]).dialog('close');\n\t});\n\n\t/**\n\t * Закрытие диалога по кнопке закрыть\n\t */\n\tdocument.addEventListener('click', (e) => {\n\t\t// // навигация без истории\n\t\t// var $dialog = $(this).closest('.ui-dialog-content');\n\t\t// var viewName = $dialog.attr('id');\n\t\t// var pageName = getHash('view-' + viewName);\n\t\t// if (!pageName) {\n\t\t// \ttoPrevPage($dialog);\n\t\t//\n\t\t// \treturn;\n\t\t// }\n\t\t//\n\t\t// // навигация по истории\n\t\t// if (Core.state.isMobile && history.length > 1 && $(this).closest('.modal-layer').length) {\n\t\t// \tvar href = location.href;\n\t\t//\n\t\t// \thistory.go(-1);\n\t\t//\n\t\t// \tsetTimeout(() => {\n\t\t// \t\t// это первая страница в истории вкладки браузера\n\t\t// \t\tif (href === location.href) $(e.target).closest('.ui-dialog-content').dialog('close');\n\t\t// \t});\n\t\t// } else {\n\t\t// \t$(this).closest('.ui-dialog-content').dialog('close');\n\t\t// }\n\n\t\tif (!(e.target instanceof HTMLElement)) return;\n\n\t\tconst el = e.target.closest('[data-action=\"top-dialog-close\"]') as HTMLElement | null;\n\t\tif (!el) return;\n\n\t\te.preventDefault();\n\n\t\tconst elDialog = el.closest<ElTopDialog>('.ui-dialog-content');\n\t\tif (!elDialog) return;\n\n\t\t// если к кнопке привязана ссылка, диалоговое окно не нужно закрывать\n\t\tconst toView = el.dataset.toView;\n\n\t\tif (toView == 'toPrevPage()') {\n\t\t\tTopDialogUtils.toPrevPage(elDialog);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (toView) {\n\t\t\tconst viewNameAndPageLink = toView.split('-');\n\t\t\tconst viewName = viewNameAndPageLink.shift();\n\t\t\tconst pageLink = viewNameAndPageLink.join('-');\n\n\t\t\tif (!viewName) return;\n\n\t\t\tconst elDialog = TopDialogUtils.getElDialogById(viewName);\n\t\t\tif (!elDialog) return;\n\n\t\t\tconst elToPages = querySelectorAllArray(elDialog, `[data-view-page=\"${pageLink}\"]`);\n\t\t\tif (!elToPages) return;\n\n\t\t\tif (!isVisible(elToPages[0])) {\n\t\t\t\tconst hash = TopDialogWorker.genViewPageHash(toView, 'prev');\n\n\t\t\t\t// // не убирает кнопку \"Вперед\" в браузере\n\t\t\t\t// history.replaceState(null, '', hash);\n\t\t\t\t// toViewDirty(toView, 'prev');\n\n\t\t\t\t// // добавляет текущую страницу в историю браузера\n\t\t\t\thistorySetState(false, hash);\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tconst $dialog = $(elDialog);\n\n\t\t$dialog.dialog('close');\n\t});\n\n\t/**\n\t * Все submit должны обрабатываться через js\n\t */\n\tdocument.addEventListener('submit', (e) => {\n\t\tconst elForm = e.target as HTMLElement;\n\n\t\tif (elForm.matches('.modal-body > form') || elForm.matches('.modal-layer-body > form')) {\n\t\t\te.preventDefault();\n\t\t}\n\t});\n\n\t/**\n\t * Выполнение действия по нажатию Enter\n\t *\n\t * @todo Убрать `.searcher`\n\t */\n\tdocument.addEventListener('keypress', (e) => {\n\t\tif (!(e.target instanceof HTMLElement)) return;\n\n\t\tconst eventTarget = e.target;\n\n\t\tconst elModalBody = eventTarget.closest('.ui-dialog .modal-body');\n\t\tif (!elModalBody) return;\n\n\t\tconst isInput =\n\t\t\teventTarget.matches('input:not(.searcher), textarea:not(.searcher), select:not(.searcher), button:not(.searcher)')\n\t\t\t|| eventTarget.hasAttribute('contenteditable');\n\t\tif (!isInput) return;\n\n\t\t// if (e.keyCode !== 10 && e.key !== 'ENTER') return;\n\t\tif (e.key !== 'Enter') return;\n\n\t\t// не выполнять submit действий при работе с jquery autocomplete\n\t\tif (eventTarget.classList.contains('autocomplete')) {\n\t\t\te.preventDefault();\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (eventTarget.tagName === 'TEXTAREA') {\n\t\t\tif (!e.ctrlKey && !e.metaKey) return;\n\n\t\t\tconst elForm = eventTarget.closest('form');\n\n\t\t\tif (elForm) {\n\t\t\t\t// Find visible submit buttons\n\t\t\t\tconst elSubmitButton = querySelectorAllArray(elForm, 'button[type=\"submit\"]')\n\t\t\t\t\t.concat(querySelectorAllArray(elForm, 'input[type=\"submit\"]'))\n\t\t\t\t\t.find((elSubmitButton) => {\n\t\t\t\t\t\treturn isVisible(elSubmitButton);\n\t\t\t\t\t});\n\n\t\t\t\telSubmitButton?.click();\n\t\t\t}\n\t\t}\n\t});\n\n\t/**\n\t * Закрытие диалога по клику вне окна\n\t */\n\tdocument.addEventListener('click', function (event) {\n\t\tif (!(event.target instanceof HTMLElement)) return;\n\n\t\tconst eventTarget = event.target;\n\n\t\tif (!eventTarget.classList.contains('ui-widget-overlay')) return;\n\n\t\tlet elDialogWrapperWithTopZIndex: ElTopDialogWrapper | undefined;\n\t\tlet topZIndex = 0;\n\n\t\tconst elDialogWrapperVisibles = querySelectorAllArray<ElTopDialogWrapper>(document, '.ui-dialog').filter((elDialogWrapper) => {\n\t\t\treturn isVisible(elDialogWrapper);\n\t\t});\n\n\t\telDialogWrapperVisibles.forEach((elDialogWrapper) => {\n\t\t\tconst zIndex = Number(window.getComputedStyle(elDialogWrapper).zIndex);\n\t\t\tif (zIndex < topZIndex) return;\n\n\t\t\telDialogWrapperWithTopZIndex = elDialogWrapper;\n\t\t\ttopZIndex = zIndex;\n\t\t});\n\n\t\tif (elDialogWrapperWithTopZIndex) {\n\t\t\tconst elDialog = elDialogWrapperWithTopZIndex.querySelector('.ui-dialog-content');\n\n\t\t\t$(elDialog).dialog('close');\n\t\t}\n\t});\n\n\twindow.addEventListener('resize', TopDialogUtils.recalcPositions);\n\tTopDialogUtils.recalcPositions();\n};\n",":root {\n\t--dialog-border-color: var(--color-line-1);\n\t--dialog-loading-duration: 10s;\n\n\t--top-dialog-footer-height: var(--top-forms-base-height_s);\n}\n\nhtml.with_dialog { overflow: hidden !important; }\n\na[data-to-view] { cursor: pointer; }\n\n/* common */\n.ui-widget-overlay { background: #040404; opacity: 0.50; filter: Alpha(Opacity=50); }\n.ui-dialog { border-radius: 8px; border: none; padding: 0; }\n.ui-dialog.ui-widget { border: none; }\n.ui-dialog-titlebar { display: none; }\n.ui-dialog .ui-dialog-content { padding: 0; overflow: visible; }\n.ui-dialog .project_name { word-break: break-all; }\n\n.ui-dialog-content {\n\t--dialog-header-height: 50px;\n\t--dialog-layer-pageSelector: 0px;\n}\n.ui-dialog-content-withPageSelector {\n\t--dialog-layer-pageSelector: 42px;\n}\n\n.modal-header,\n.modal-body,\n.modal-footer { font-size: 14px; position: relative; }\n.modal-body { padding: var(--padding-default); }\n.modal-body:has(> .topTable:first-child) {\n\tpadding-top: calc(var(--padding-default) / 4);\n}\n\n/* modal-header */\n.modal-header {\n\tborder-bottom: 1px solid var(--dialog-border-color); height: var(--dialog-header-height); padding: 0 var(--padding-default);\n\tdisplay: flex; justify-content: space-between; align-items: center; gap: var(--top-padding-2);\n}\n.modal-header > * { padding: 10px 0; font-size: 16px; }\n.modal-header > .top-title {\n\tmargin: 0;\n\tfont-weight: normal;\n\toverflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n\tflex-grow: 1; order: 50; display: flex; align-items: center;\n}\n.modal-header > .top-title > div[class*=icon] { display: none; }\n.modal-header > div:not(.top-title) { order: 60; }\n.modal-header > div.close {\n\t--top-icon-color: var(--color-text-2);\n\n\tcursor: pointer;\n\tbackground: var(--color-layout-front-1); font-size: 16px;\n\torder: 100;\n\tanimation-name: none !important;\n}\n.modal-header > div.close:hover {\n\t--top-icon-color: var(--color-text-1);\n}\n\n.modal-header .links_icons { position: absolute; right: 50px; }\n.modal-header .links_icons [class*=\"icon-\"] { width: auto; height: auto; padding: 0 5px; color: #D6DEE0; }\n.modal-header .links_icons [class*=\"icon-\"].active { color: var(--color-bg-warning-1); }\n\n.modal-layer-pageSelector { padding: 0 10px !important; }\n\n/* modal-body */\n.modal-body {\n\tmax-height: calc(var(--100vh) - var(--dialog-header-height) - 1px - var(--dialog-layer-pageSelector) - var(--top-dialog-footer-height) - 1px);\n\toverflow-y: auto; overflow-x: hidden; box-sizing: border-box; flex-grow: 1;\n}\n.modal-body hr { margin: 16px -15px; }\n.modal-body h4 { padding: 0; margin: 0 0 10px 0; line-height: normal; }\n.modal-body .inner { padding: var(--padding-default); margin: 0 calc(0px - var(--padding-default)); position: relative; }\n.modal-body .inner .bt { border-top: 1px dashed var(--color-layout-front-primary-3); position: absolute; top: 0; right: 0; left: 0; }\n.modal-body .inner .bb { border-bottom: 1px dashed var(--color-layout-front-primary-3); position: absolute; right: 0; bottom: 0; left: 0; }\n.modal-body .inner.color-1 { background: var(--color-layout-front-primary-3); color: var(--color-text-1); }\n.modal-body .inner strong { color: var(--color-text-1); }\n.modal-body .comment { line-height: 18px; }\n\n/* modal-footer */\n.modal-footer {\n\tmin-height: var(--top-dialog-footer-height);\n\tpadding: var(--top-gap-2);\n\tdisplay: flex;\n\tflex-shrink: 0;\n\talign-items: center;\n\tjustify-content: flex-end;\n\tgap: var(--top-gap-2);\n}\n\n.modal-footer .modal-footer-btn-left { margin-right: auto; }\n\n.modal-footer > .btn.full_width,\n.modal-footer > .top-button.full_width { flex-grow: 1; align-self: flex-end; }\n\n.modal-footer-fullWith {\n\tflex-wrap: wrap;\n}\n.modal-footer-fullWith > * {\n\tflex-grow: 1;\n}\n.modal-footer-fullWith > .top-info {\n\tflex-grow: 5;\n}\n.modal-footer-fullWith > *:empty {\n\tflex-grow: 0;\n}\n\n/* modal form */\n.ui-dialog-content > .modal-layer > [data-view-page] > input[type=\"submit\"] { position: absolute; visibility: hidden; }\n\n/* modal help_popup */\n.help_popup .modal-header { display: none; }\n.help_popup .modal-header a { top: 2px; z-index: 10; }\n.help_popup .modal-header .top-title { display: none; }\n\n/* view */\n.modal-layer { overflow: hidden; }\n.modal-layer a[data-top-icon]:empty { color: var(--color-text-4); text-decoration: none; }\n\n.modal-layer > [data-view-page] > div > div.buttons { display: flex; white-space: nowrap; gap: var(--top-padding-1); }\n.modal-layer > [data-view-page] > div > div.buttons:empty { display: none; }\n.modal-layer > [data-view-page] > div > div.buttons > div,\n.modal-layer > [data-view-page] > div > div.buttons > a {\n\tcursor: pointer;\n\twidth: auto; height: auto; min-width: auto; min-height: auto; padding: 10px 9px;\n\tcolor: var(--color-text-4);\n}\n.modal-layer > [data-view-page] > div > div.buttons > div:hover { color: var(--color-text-2); }\n.modal-layer > [data-view-page] > div > div.buttons > div.hidden { display: none !important; }\n\n.ui-dialog-content[data-view-page-active] { display: flex !important; flex-direction: column; justify-items: stretch; }\n.ui-dialog-content > .modal-layer { display: flex !important; align-items: stretch; position: relative; }\n.ui-dialog-content.i-change-page > .modal-layer { overflow: hidden; }\n.ui-dialog-content > .modal-layer > [data-view-page] {\n\twidth: 100%;\n\tposition: relative; display: none;\n\tflex-direction: column; justify-content: space-between;\n\tanimation: 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;\n}\n.ui-dialog-content > .modal-layer > [data-view-page].active { display: flex; }\n.ui-dialog-content > .modal-layer > [data-view-page].reverse { animation-direction: reverse; }\n.ui-dialog-content > .modal-layer > [data-view-page].center-to-left,\n.ui-dialog-content > .modal-layer > [data-view-page].right-to-center { display: flex; position: absolute; top: 0; right: 0; bottom: 0; left: 0; }\n.ui-dialog-content > .modal-layer > [data-view-page].center-to-left > div,\n.ui-dialog-content > .modal-layer > [data-view-page].right-to-center > div { overflow: hidden; }\n\n.ui-dialog-content > .modal-layer-header { border-bottom: 1px solid var(--dialog-border-color); min-height: var(--dialog-header-height); }\n.ui-dialog-content > .modal-layer-header > [data-view-page] > .modal-header { border: none; background: none; }\n.ui-dialog-content > .modal-layer-header > [data-view-page] > .modal-header > * { animation: 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].reverse > .modal-header > * { animation-direction: reverse; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].center-to-left > .modal-header > .top-title { animation-name: dialog-center-to-left-header-title; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].right-to-center > .modal-header > .top-title { animation-name: dialog-right-to-center-header-title; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].center-to-left > .modal-header > [class*=\"widget-\"] { animation-name: dialog-center-to-left-header-title; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].right-to-center > .modal-header > [class*=\"widget-\"] { animation-name: dialog-right-to-center-header-title; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].center-to-left > .modal-header > div { animation-name: dialog-center-to-left-header-icons; }\n.ui-dialog-content > .modal-layer-header > [data-view-page].right-to-center > .modal-header > div { animation-name: dialog-right-to-center-header-icons; }\n\n.ui-dialog-content > .modal-layer-body { border-radius: 0 0 8px 8px; max-height: calc(var(--100vh) - var(--dialog-header-height) - var(--dialog-layer-pageSelector) - var(--toolbar-height)); flex-grow: 2; }\n.ui-dialog-content.i-change-page > .modal-layer-body > [data-view-page] { background: var(--color-layout-front-1); }\n.ui-dialog-content > .modal-layer-body > [data-view-page].center-to-left { animation-name: dialog-center-to-left; }\n.ui-dialog-content > .modal-layer-body > [data-view-page].right-to-center { animation-name: dialog-right-to-center; }\n\n.ui-dialog-content .modal-footer .second_level {\n\tbox-sizing: border-box;\n\tbackground: var(--color-layout-front-1); width: 100%; min-height: 25px;\n\tdisplay: flex; align-items: center; justify-content: center;\n}\n.ui-dialog-content .modal-footer .second_level input {\n\tborder-radius: 8px;\n\twidth: 100%; height: var(--top-forms-base-height);\n\tpadding: var(--top-padding-1) var(--top-padding-3);\n\tbox-sizing: border-box;\n}\n\n.ui-dialog-content > .modal-layer-body > [data-view-page].i-load-data {\n\tpointer-events: none;\n}\n.ui-dialog-content > .modal-layer-body > [data-view-page].i-load-data:before {\n\tcontent: \" \";\n\tbackground: #378DC6; width: 0; height: 4px;\n\tposition: absolute; top: 0; left: 0; z-index: 100;\n\tanimation: top-loadbar var(--dialog-loading-duration) forwards;\n}\n\n.ui-dialog-content.modal-expanded { width: 100vw !important; height: calc(var(--100vh) + 10px) !important; }\n\n/* widgets */\n.modal-header > [data-widget] {\n\tpadding: 0 8px;\n\tposition: absolute; top: 0; right: 0; bottom: 0; left: 0; opacity: 0; overflow: hidden;\n\talign-items: center;\n\tvisibility: hidden;\n\ttransition: opacity 0.3s; z-index: 1;\n}\n\n.modal-header > [data-widget=\"search\"] div.cancel {\n\topacity: 0;\n\ttransform: translateX(100%);\n\ttransition: transform, opacity; transition-duration: 0.3s;\n}\n\n[data-view-page].i-show-search { }\n[data-view-page].i-show-search .modal-header > :not([data-widget=\"search\"]) { visibility: hidden; }\n[data-view-page].i-show-search [data-widget=\"search\"] { visibility: visible; opacity: 1; }\n[data-view-page].i-show-search [data-widget=\"search\"] .cancel { transform: translateX(0); opacity: 1; }\n\n[data-view-page] > .modal-header > * { transition: opacity 0.3s; }\n[data-view-page].i-show-search > .modal-header > div.buttons { opacity: 0; }\n\n/* top-popup */\n.modal-layer .top-popup-wrapper { height: 100% !important; }\n\n/* animation */\n@keyframes dialog-center-to-left-header-title {\n\tfrom { transform: translateX(0); opacity: 1; }\n\t75% { opacity: 0; }\n\tto { transform: translateX(-30%); opacity: 0; }\n}\n\n@keyframes dialog-right-to-center-header-title {\n\tfrom { transform: translateX(100%); opacity: 0; }\n\t25% { opacity: 0; }\n\tto { transform: translateX(0); opacity: 1; }\n}\n\n@keyframes dialog-center-to-left-header-icons {\n\tfrom { transform: translateX(0); opacity: 1; }\n\t35% { transform: translateX(-20%); opacity: 0; }\n\tto { transform: translateX(-20%); opacity: 0; }\n}\n\n@keyframes dialog-right-to-center-header-icons {\n\tfrom { transform: translateX(20%); opacity: 0; }\n\t65% { transform: translateX(20%); opacity: 0; }\n\tto { transform: translateX(0); opacity: 1; }\n}\n\n@keyframes dialog-center-to-left {\n\tfrom { transform: translateX(0); filter: brightness(1); }\n\tto { transform: translateX(-30%); filter: brightness(0.9); }\n}\n\n@keyframes dialog-right-to-center {\n\tfrom { transform: translateX(100%); box-shadow: rgba(0, 0, 0, 0.1) 0 0 10px; }\n\tto { transform: translateX(0); box-shadow: rgba(0, 0, 0, 0.2) 0 0 10px; }\n}\n\n/* вид с дополнительной секцией TopPopup сбоку от окна */\n@media only screen and (max-width: 1480px) {\n\t.win_side_panel_opener { display: none; }\n}\n\n@media only screen and (min-width: 1480px) {\n\t.ui-dialog-content.with_side_panel { box-shadow: rgb(0 0 0 / 20%) 0 0 6px; }\n\n\t.ui-dialog-content.with_side_panel .modal-layer-body { background: var(--color-layout-front-1); }\n\n\t[data-widget=\"side_panel\"] {\n\t\t--side_panel_width: calc((100vw - 900px) / 2 - 28px);\n\n\t\tbox-sizing: border-box;\n\t\tbackground: var(--color-layout-front-1); max-width: var(--side_panel_width); padding: 18px;\n\t\tposition: absolute; top: calc(var(--dialog-header-height) + 1px + var(--dialog-layer-pageSelector)); bottom: calc(var(--top-dialog-footer-height) + 1px);\n\t\tz-index: -1; display: block;\n\t\ttransition: 0.2s;\n\t}\n\n\t.win_side_panel_left { border-radius: 8px 0 0 8px; right: 100%; }\n\n\t.win_side_panel_right { border-radius: 0 8px 8px 0; left: 100%; }\n\n\t.win_side_panel_closed.win_side_panel_left { right: calc(100% - var(--side_panel_width)); }\n\n\t.win_side_panel_closed.win_side_panel_right { left: calc(100% - var(--side_panel_width)); }\n\n\t[data-widget=\"side_panel\"] .template { display: block; }\n\n\t[data-widget=\"side_panel\"] .template > .header,\n\t[data-widget=\"side_panel\"] .template > .footer { display: flex; }\n\n\t.win_side_panel_opener { cursor: pointer; background: var(--color-cyan); color: #FFF; padding: 4px; position: absolute; top: 20px; }\n\n\t.win_side_panel_closed .win_side_panel_opener:not(:hover) { opacity: 0.3; }\n\n\t.win_side_panel_left .win_side_panel_opener { border-radius: 4px 0 0 4px; right: 100%; }\n\n\t.win_side_panel_right .win_side_panel_opener { border-radius: 0 6px 6px 0; left: 100%; }\n}\n\n@media only screen and (max-height: 900px) {\n\thtml.with_dialog { background: #F1F1F1; overflow: hidden; }\n\n\t.ui-widget-overlay { }\n\n\t.ui-dialog.me-tightly {\n\t\tborder-radius: 0;\n\t\theight: auto !important;\n\t\tposition: fixed; top: 0 !important; bottom: 0 !important;\n\t}\n\n\t.ui-dialog.me-tightly .ui-dialog-content { min-height: 100% !important; }\n\n\t/* для не view */\n\t.ui-dialog.me-tightly > div > .modal-body { position: absolute; top: var(--dialog-header-height); right: 0; left: 0; bottom: var(--dialog-header-height); }\n\n\t.ui-dialog.me-tightly > div > .modal-body:last-child { bottom: 0; }\n\n\t.ui-dialog.me-tightly > div > .modal-footer { position: absolute; right: 0; bottom: 0; left: 0; }\n\n\t/* view */\n\t.modal-layer { }\n\n\t.ui-dialog.me-tightly .modal-layer-body { border-radius: 0; min-height: 0 !important; }\n\n\t.ui-dialog.me-tightly .modal-layer-body .modal-footer { min-height: unset; }\n}\n","html.with_dialog body { height: var(--100vh); overflow: hidden; }\n\n.ui-widget-overlay { height: calc(100% - var(--toolbar-height)); }\n\n.ui-dialog {\n\tborder-radius: 0;\n\twidth: auto !important; height: auto !important;\n\tposition: fixed; top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;\n}\n\n.ui-dialog-content {\n\twidth: 100% !important;\n\theight: 100% !important;\n\tmin-width: 0 !important;\n\tmax-width: 100% !important;\n}\n\n/* modal-header */\n.modal-header > .top-title { text-align: center; font-size: 14px; }\n.modal-header > div.close { font-size: 14px; order: 1; }\n.modal-header > div.close:before { content: \"\"; }\n\n/* modal-body */\n.modal-body { }\n.modal-body:last-child { bottom: 0; }\n.modal-footer { bottom: 0; }\n\n/* modal-footer */\n.modal-footer .second_level { padding: 10px 8px; }\n\n/* view */\n.modal-layer-body { min-height: 0 !important; }\n.ui-dialog-content > .modal-layer-body { border-radius: 0; }\n/*.ui-dialog-content > .modal-layer-body > [data-view-page] .modal-body{ margin: auto 0; }*/\n\n.modal-body,\n.modal-footer { padding-right: 12px; padding-left: 12px; }\n.modal-footer .btn:last-child { margin-right: 12px; }\n\n.modal-body .inner { padding: 12px; margin: 0 -12px; position: relative; }\n","/* menu */\n.modal-menu-opener { order: 1 !important; }\n.modal-menu-opener:before {\n\t--top-icon-size: 20px;\n\t--top-icon-color: #FFF;\n\t--top-icon-width: var(--top-icon-size);\n\n\tborder-radius: 50%; background: var(--color-bg-primary-1); padding: 3px;\n\ttransition: transform 0.1s;\n}\n.modal-menu-opener:hover:before { background: var(--color-bg-primary-2); }\n.modal-menu-opener.top-active:before { background: var(--color-bg-primary-2); transform: scale(0.8); }\n\n/* top-popup */\n.modal-layer .top-popup-wrapper {\n\tbackground: transparent;\n\twidth: auto !important; padding: 0 !important; margin: 0 !important;\n\ttop: 0 !important; right: 0 !important; left: 0 !important;\n\ttransition: background 0.3s;\n}\n\n.modal-layer .top-popup-wrapper > .top-popup[class],\n.modal-layer .top-popup-wrapper.with_notch > .top-popup[class] {\n\tborder-radius: 8px; border: none; margin: 12px !important; max-width: 100%; max-height: calc(100% - 24px);\n\ttop: 0 !important; right: 0 !important; bottom: auto !important; left: 0 !important; overflow: auto; display: flex; flex-direction: column;\n\topacity: 1;\n\ttransform: translateY(calc(-100% - 24px));\n\ttransition: transform 0.3s;\n}\n\n.modal-layer .top-popup > .top-popup_header { background: var(--color-theme-50); }\n\n.modal-layer .top-theme-lite .top-popup > .top-popup_header .select { border: none; }\n.modal-layer .top-theme-lite .top-popup > .top-popup_header .select .text { color: #FFF; }\n.modal-layer .top-theme-lite .top-popup > .top-popup_header .select .arrow { background: none; }\n\n.modal-layer .top-popup-wrapper-shown:not(.top-popup-wrapper-closed) {\n\tpointer-events: auto;\n\tbackground: rgba(52, 73, 94, 0.25);\n}\n\n@media only screen and (min-width: 1480px) {\n\t.ui-dialog-content.with_side_panel { box-shadow: rgb(0 0 0 / 20%) 0 0 6px; }\n\n\t.ui-dialog-content.with_side_panel .modal-layer-body { background: var(--color-layout-front-1); }\n\n\t[data-widget=\"side_panel\"] {\n\t\t--side_panel_width: calc((100vw - 900px) / 2 - 28px);\n\n\t\tbox-sizing: border-box;\n\t\tbackground: var(--color-layout-front-1); max-width: var(--side_panel_width); padding: 18px;\n\t\tdisplay: block; position: absolute; top: 51px; bottom: 51px; z-index: -1;\n\t\ttransition: 0.2s;\n\t}\n\n\t.win_side_panel_left { border-radius: 8px 0 0 8px; right: 100%; }\n\n\t.win_side_panel_right { border-radius: 0 8px 8px 0; left: 100%; }\n\n\t.win_side_panel_closed.win_side_panel_left { right: calc(100% - var(--side_panel_width)); }\n\n\t.win_side_panel_closed.win_side_panel_right { left: calc(100% - var(--side_panel_width)); }\n\n\t[data-widget=\"side_panel\"] .template { display: block; }\n\n\t[data-widget=\"side_panel\"] .template > .header,\n\t[data-widget=\"side_panel\"] .template > .footer { display: flex; }\n\n\t.win_side_panel_opener { cursor: pointer; background: var(--color-cyan); color: #FFF; padding: 4px; position: absolute; top: 20px; }\n\n\t.win_side_panel_closed .win_side_panel_opener:not(:hover) { opacity: 0.3; }\n\n\t.win_side_panel_left .win_side_panel_opener { border-radius: 4px 0 0 4px; right: 100%; }\n\n\t.win_side_panel_right .win_side_panel_opener { border-radius: 0 6px 6px 0; left: 100%; }\n}\n","html {\n\t--top-dialog-width: auto;\n\t--top-dialog-height: auto;\n}\n\n.top-dialog {\n\tmax-width: 100vw;\n}\n\n.top-dialog .modal-layer-body {\n\theight: var(--top-dialog-height);\n}\n",".top-dialog {\n\twidth: var(--top-dialog-width) !important;\n}","import 'jquery';\nimport { nextTick } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { TopPopupWorker } from '@/components/popup/worker';\nimport { sleep, waitWhile } from '@/core/utils/system';\nimport { setHashs } from '@/core/utils/route';\nimport { connectScrollShadow } from '@/core/utils/scroll';\n\nimport type { ElTopDialog, ElTopDialogBody, ElTopDialogModalLayer, ElTopDialogPage, ElTopDialogWrapper, MoveDirection } from './types';\nimport { TopDialogWorker } from './worker';\nimport { initDialogGlobalEvents } from './utils.globalEvents';\nimport { getDialogWorker } from '../dialog/dialogs/dialogs.vue';\n\nimport css from '../dialog/style/dialog.css?inline';\nimport cssM from '../dialog/style/dialog.m.css?inline';\nimport cssPC from '../dialog/style/dialog.pc.css?inline';\nimport cssModern from '../dialog/style/modern/dialog.css?inline';\nimport cssModernPC from '../dialog/style/modern/dialog.pc.css?inline';\nimport { isVisible, querySelectorAllArray } from '@/core/utils/dom';\n\nCore.insertStyleToPage(css);\nCore.insertStyleToPage(cssM, 'm');\nCore.insertStyleToPage(cssPC, 'pc');\nCore.insertStyleToPage(cssModern);\nCore.insertStyleToPage(cssModernPC, 'pc');\n\nlet timerClearAnimation: NodeJS.Timeout;\nlet isInited = false;\n\n/**\n * Является ли элемент JQuery<HTMLElement>\n */\nconst isElJQuery = (el: JQuery<HTMLElement> | HTMLElement | HTMLElement[]) => {\n\treturn !!el && typeof el === 'object' && 'jquery' in el;\n};\n\nconst init = () => {\n\t$.extend($.ui.dialog.prototype.options, {\n\t\tfocus: (e: any) => {\n\t\t\te.target.focus();\n\n\t\t\t$('[autofocus]', e.target)[0]?.focus();\n\n\t\t\t// setTimeout(function () {\n\t\t\t// \tif ($('[autofocus]', e.target).length) return;\n\t\t\t// \t$('.modal-footer button:first, .modal-body :input:first', e.target).eq(0).focus();\n\t\t\t//\n\t\t\t// \t// fix пропадающего autocomplete при нажатии на scroll в autocomplete\n\t\t\t// \t$(e.target).add($(e.target).closest('.ui-dialog')).removeAttr('tabindex');\n\t\t\t// });\n\t\t},\n\t\tcreate: (e: any) => onCreate(e.target),\n\t\topen: (e: any) => onOpen(e.target),\n\t\tclose: (e: any) => onClose(e.target),\n\t\tmodal: true,\n\t\tresizable: false,\n\t\tcloseOnEscape: false,\n\t\twidth: 'auto',\n\t\tminHeight: 0,\n\t});\n\n\t$.ui.dialog.prototype._focusTabbable = $.noop;\n\n\t$.ui.dialog.prototype._moveToTopOriginal = $.ui.dialog.prototype._moveToTop;\n\t$.ui.dialog.prototype._moveToTop = function () {\n\t\tthis._moveToTopOriginal();\n\n\t\tconst $dialog = $(this.element);\n\t\t$dialog.trigger('dialogsMoveToTop', [$dialog]);\n\t};\n\n\tinitDialogGlobalEvents();\n\n\tisInited = true;\n};\n\n/**\n * Получить настройки диалогового окна из Vue компонента\n */\nconst genVueOptions = (elDialog: ElTopDialog) => {\n\tconst options: {\n\t\tmodal?: boolean,\n\t\tposition?: any,\n\t} = {};\n\n\tif (elDialog.dataset?.modal === 'false') options.modal = false;\n\tif (elDialog.dataset?.position) options.position = JSON.parse(elDialog.dataset.position);\n\n\treturn options;\n};\n\nconst getElDialogById = (id: string) => {\n\treturn <ElTopDialog | null>document.getElementById(id);\n};\n\n/**\n * Сменить состояние диалогового окна Vue\n */\nconst updatePageVue = async (dialogId: string, pageName?: string, pageNameNext?: string) => {\n\tif (!dialogId.startsWith('dialog_')) return;\n\n\tconst dialog = getDialogWorker(dialogId);\n\tif (!dialog) return;\n\n\tdialog.isOpened.value = true;\n\tif (pageName !== undefined) dialog.pageActive.value = pageName;\n\tif (pageNameNext !== undefined) dialog.pageActiveNext.value = pageNameNext;\n\n\tawait nextTick();\n\n\tif (pageNameNext) {\n\t\tconst elDialog = getElDialogById(dialogId);\n\t\tif (!elDialog) return;\n\n\t\tconst elNextpages = elDialog.querySelectorAll(`[data-view-page=\"${pageNameNext}\"]`);\n\n\t\tif (!elNextpages.length) {\n\t\t\tawait waitWhile(() => !elDialog.querySelectorAll(`[data-view-page=\"${pageNameNext}\"]`).length);\n\t\t}\n\t}\n};\n\n/**\n * Callback for jQuery dialog onCreate\n */\nconst onCreate = (elDialog: ElTopDialog) => {\n\tconst elDialogBody = elDialog.querySelector<ElTopDialogBody>('.modal-body');\n\tif (!elDialogBody) return;\n\n\tconnectScrollShadow(elDialogBody);\n\n\tTopDialogWorker.state.decoratorOnCreate?.(elDialog);\n\n\tinitPopup(elDialog);\n};\n\n/**\n * Инициирование событий TopPopup в диалоговом окне\n */\nconst initPopup = (elDialog: HTMLElement) => {\n\t$(elDialog).on('aftershow.top-menu-popup', '[data-top-popup]', (_e, $popup) => {\n\t\t// перенести popup в корневой элемент страницы диалогового окна\n\t\tconst elPopup = $popup[0];\n\n\t\t// перенести popup в корневой элемент страницы диалогового окна\n\t\tconst elPageContents = TopDialogWorker.getPairPage(elPopup);\n\t\telPageContents?.[1]?.prepend(elPopup);\n\t});\n};\n\n/**\n * Callback for jQuery dialog onOpen\n */\nconst onOpen = async (elDialog: ElTopDialog) => {\n\tconst pageName = elDialog.dataset.viewPageActive;\n\tconst args = elDialog.dataset.args ? elDialog.dataset.args?.split(':') : [];\n\n\tconst w1 = window.innerWidth;\n\n\tCore.state.documentClassModificators.set('top-dialog', 'with_dialog');\n\n\tconst w2 = window.innerWidth;\n\n\tconst scrollBarWidth = w2 - w1;\n\tif (document.documentElement.scrollHeight > window.innerHeight) document.querySelector('html')!.style.marginRight = scrollBarWidth + 'px';\n\n\trecalcPositions();\n\n\tconst dialog = getDialogWorker(elDialog.getAttribute('id')!);\n\tdialog?.emit?.('open', pageName, args);\n};\n\n/**\n * Callback for jQuery dialog onClose\n */\nconst onClose = async (elDialog: ElTopDialog) => {\n\tconst viewName = elDialog.getAttribute('id');\n\tconst pageName = elDialog.dataset.viewPageActive;\n\n\tif (pageName) {\n\t\tconst hashData = {\n\t\t\tvpn: TopDialogWorker.state.viewPageN as number | null,\n\t\t\t['view-' + viewName]: null,\n\t\t};\n\t\thashData['view-' + viewName] = null;\n\n\t\tif (TopDialogWorker.state.viewPageN === 0 || TopDialogWorker.state.viewPageN === 1) {\n\t\t\thashData.vpn = null;\n\t\t}\n\n\t\tsetHashs(hashData, false);\n\t}\n\n\tconst elUiWidgetOverlayVisibles = querySelectorAllArray(document, '.ui-widget-overlay').filter((el) => {\n\t\treturn isVisible(el);\n\t});\n\n\tif (!elUiWidgetOverlayVisibles.length) {\n\t\tCore.state.documentClassModificators.delete('top-dialog');\n\n\t\tdocument.querySelector('html')!.style.marginRight = '';\n\t}\n\n\t$(elDialog).trigger('viewAfterClose', [$(elDialog)]);\n\n\tconst dialog = getDialogWorker(viewName);\n\n\tif (dialog) {\n\t\tdialog.isOpened.value = false;\n\t\tdialog.emit?.('close', pageName);\n\n\t\tif (dialog.onCloseOnce) {\n\t\t\tdialog.onCloseOnce(dialog.props, pageName);\n\t\t\tdialog.onCloseOnce = undefined;\n\t\t}\n\t}\n\n\t// после закрытия диалога может потребоваться пересчет позиций элементов\n\twindow.dispatchEvent(new Event('resize'));\n};\n\n/**\n * Пересчитать положения и размеры открытых диалоговых окон\n */\nconst recalcPositions = () => {\n\tconst elDialogVisibilityes = querySelectorAllArray(document, '.ui-dialog').filter((el) => {\n\t\treturn isVisible(el) && el.querySelector<ElTopDialog>(':scope > .ui-dialog-content');\n\t}).map((el) => {\n\t\treturn el.querySelector<ElTopDialog>(':scope > .ui-dialog-content')!;\n\t});\n\n\telDialogVisibilityes.forEach((elDialog) => {\n\t\tconst elDialogBody = elDialog.querySelector<ElTopDialogBody>('.modal-body');\n\t\tif (!elDialogBody) return;\n\n\t\tconst elDialogWrapper = elDialog.closest('.ui-dialog');\n\n\t\tconst options = genVueOptions(elDialog);\n\n\t\toptions.position ??= { of: window };\n\n\t\tconst $dialog = $(elDialog);\n\t\t$dialog.dialog('option', options);\n\n\t\telDialogWrapper.classList.remove('me-tightly');\n\t\tif ((elDialogWrapper.clientHeight ?? 0) > window.innerHeight) elDialogWrapper.classList.add('me-tightly');\n\t});\n};\n\n/**\n * Переход к view page по неразобранной ссылке в формате: {viewName}-{pageName}[:args]\n */\nconst toViewDirty = async (toViewPageName: string, moveDirection?: MoveDirection) => {\n\tconst regexp = /(\\w+)[=-]([\\w-]+)(?::([\\w.:-]+))?/g;\n\tconst toViewParts = regexp.exec(toViewPageName);\n\tif (toViewParts) {\n\t\tconst viewName = toViewParts[1];\n\t\tconst pageName = toViewParts[2];\n\t\tconst argsString = toViewParts[3];\n\n\t\tlet args: string[] = [];\n\t\tif (argsString) args = argsString.split(':');\n\n\t\tawait toView(viewName, pageName, args, moveDirection);\n\t}\n};\n\n/**\n * Открыть диалоговое окно, возможно указать нужную страницу\n * @param viewNameOrElDialog - id страницы окна или элемент окна\n * @param pageName - имя страницы\n * @param args - аргументы, набор проивзольных параметров, которые могут обрабатываться каждым окном по своему\n * @param moveDirection\n * @param callback - функция, которая будет запущена после октытия страницы\n */\nconst toView = async (\n\tviewNameOrElDialog: ElTopDialog | JQuery<ElTopDialog> | string,\n\tpageName?: string,\n\targs?: string[],\n\tmoveDirection?: MoveDirection,\n\tcallback?: Function,\n) => {\n\tif (!isInited) {\n\t\tawait new Promise<void>((resolve, _reject) => {\n\t\t\tconst timer = setInterval(() => {\n\t\t\t\tif (!isInited) return;\n\n\t\t\t\tclearInterval(timer);\n\n\t\t\t\tresolve();\n\t\t\t}, 10);\n\t\t});\n\t}\n\n\tawait nextTick();\n\n\tlet elDialog: ElTopDialog | null;\n\tif (typeof (viewNameOrElDialog) === 'object') {\n\t\tif (isElJQuery(viewNameOrElDialog)) viewNameOrElDialog = viewNameOrElDialog?.[0]; // todo: убрать после переписки jquery на сайте\n\n\t\telDialog = viewNameOrElDialog;\n\t} else {\n\t\telDialog = getElDialogById(viewNameOrElDialog);\n\t}\n\n\t// Диалоговое окно еще не загружено\n\tif (!elDialog && typeof viewNameOrElDialog === 'string' && TopDialogWorker.state.load) {\n\t\tawait TopDialogWorker.state.load(viewNameOrElDialog);\n\n\t\telDialog = getElDialogById(viewNameOrElDialog);\n\t\tif (!elDialog) {\n\t\t\tthrow new Error('Dialog no exists: ' + viewNameOrElDialog);\n\t\t}\n\t}\n\n\tif (!elDialog) return;\n\n\tawait toViewPage(elDialog, pageName, args, moveDirection);\n\n\tconst $dialog = $(elDialog);\n\n\tif (elDialog?.classList.contains('ui-dialog-content')) {\n\t\t// var zIndexMax = 0;\n\t\t// $.map($('.ui-dialog'), function (el) {\n\t\t// \tvar zIndex = $(el).css('z-index') * 1;\n\t\t// \tif (zIndex > zIndexMax) zIndexMax = zIndex;\n\t\t// });\n\t\t//\n\t\t// if ($dialog.is(':hidden')) $dialog.dialog('open');\n\t\t//\n\t\t// var $dialogWrapper = $dialog.parent();\n\t\t// var $dialogOverlay = $dialogWrapper.next();\n\t\t//\n\t\t// if ($dialogWrapper.css('z-index') * 1 < zIndexMax) {\n\t\t// \t$dialogWrapper.css('z-index', zIndexMax + 2);\n\t\t// \t$dialogOverlay.css('z-index', zIndexMax + 1);\n\t\t// }\n\n\t\t$dialog.dialog('open');\n\t} else {\n\t\tconst options = genVueOptions(elDialog);\n\n\t\t$dialog.dialog(options);\n\t}\n\n\tif (callback) callback($dialog);\n};\n\nconst toViewPage = async (elDialog: ElTopDialog | JQuery<ElTopDialog>, pageName?: string, args?: string[], moveDirection?: MoveDirection) => {\n\t// todo: убрать после переписки jquery на сайте\n\tif (isElJQuery(elDialog)) elDialog = elDialog?.[0];\n\n\tif (pageName === undefined) pageName = elDialog.dataset.viewPageActive;\n\tif (args === undefined) args = elDialog.dataset.args?.split(':') ?? [];\n\n\tif (pageName !== elDialog.dataset.viewPageActive) {\n\t\tconst stopped = stopAnimations(elDialog);\n\t\tif (stopped) await sleep(100);\n\t}\n\n\tawait updatePageVue(elDialog.getAttribute('id') as string, undefined, pageName);\n\n\tconst elModalLayers = querySelectorAllArray<ElTopDialogModalLayer>(elDialog, '.modal-layer');\n\tconst elCurrentPages = elModalLayers.reduce<ElTopDialogPage[]>((acc, elModalLayer) => {\n\t\tconst elCurrentPage = elModalLayer.querySelector<ElTopDialogPage>(':scope > .active');\n\t\tif (elCurrentPage) {\n\t\t\tacc.push(elCurrentPage);\n\t\t}\n\n\t\treturn acc;\n\t}, []);\n\n\tconst elNextPages = elModalLayers.reduce<ElTopDialogPage[]>((acc, elModalLayer) => {\n\t\tconst elNextPage = elModalLayer.querySelector<ElTopDialogPage>(`:scope > [data-view-page=\"${pageName}\"]`);\n\t\tif (elNextPage) {\n\t\t\tacc.push(elNextPage);\n\t\t}\n\n\t\treturn acc;\n\t}, []);\n\n\tconst argsString = args.join(':');\n\n\tif (moveDirection === undefined) {\n\t\tmoveDirection = 'next';\n\t\tif ((elNextPages[0]?.dataset.order ?? 0) < (elCurrentPages[0]?.dataset.order ?? 0)) moveDirection = 'prev';\n\t}\n\n\tif (!elNextPages.length) return;\n\n\telDialog.dataset.viewPageActive = pageName;\n\telDialog.dataset.args = args?.join(':') ?? '';\n\n\t// запрашиваемая страница уже открыта\n\tif (elNextPages[0].classList.contains('active')) {\n\t\tif (elNextPages[0].dataset.viewPageArgs !== argsString) {\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\telNextPage.dataset.viewPageArgs = argsString;\n\t\t\t});\n\n\t\t\t// dialogs.beforeOpenViewPage($dialog, $nextPage, pageName, args);\n\t\t\t// dialogs.afterOpenViewPage($dialog, $nextPage, pageName, args);\n\t\t}\n\n\t\tbeforeOpenViewPage(elDialog, elNextPages, pageName, args);\n\t\tafterOpenViewPage(elDialog, elNextPages, pageName, args);\n\n\t\treturn;\n\t}\n\n\telNextPages.forEach((elNextPage) => {\n\t\telNextPage.dataset.viewPageArgs = argsString;\n\t});\n\n\telCurrentPages.forEach((elCurrentPage) => {\n\t\tif (elCurrentPage.querySelector('.top-popup-wrapper')) {\n\t\t\tTopPopupWorker.close(elCurrentPage.querySelector('.top-popup-wrapper')!);\n\t\t}\n\t});\n\n\tconst elDialogWrapper = elNextPages[0].closest<ElTopDialogWrapper>('.ui-dialog');\n\n\tif (elDialogWrapper && !isVisible(elDialogWrapper)) moveDirection = 'none';\n\tif (!elCurrentPages.length) moveDirection = 'none';\n\tif (isVisible(elNextPages[0])) moveDirection = 'none';\n\n\tswitch (moveDirection) {\n\t\tcase 'prev': {\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\tconst elActive = elNextPage.parentNode?.querySelector(':scope > .active');\n\t\t\t\tif (elActive) elNextPage.parentNode?.insertBefore(elNextPage, elActive);\n\t\t\t});\n\n\t\t\telCurrentPages.forEach((elCurrentPage) => {\n\t\t\t\telCurrentPage.classList.add('right-to-center', 'reverse');\n\t\t\t});\n\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\telNextPage.classList.add('center-to-left', 'reverse');\n\t\t\t});\n\n\t\t\tbreak;\n\t\t}\n\t\tcase 'next': {\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\tconst elActive = elNextPage.parentNode?.querySelector(':scope > .active');\n\t\t\t\tif (elActive) elNextPage.parentNode?.insertBefore(elNextPage, elActive.nextSibling);\n\t\t\t});\n\n\t\t\telCurrentPages.forEach((elCurrentPage) => {\n\t\t\t\telCurrentPage?.classList.add('center-to-left');\n\t\t\t});\n\n\t\t\telNextPages.forEach((elNextPage) => {\n\t\t\t\telNextPage.classList.add('right-to-center');\n\t\t\t});\n\n\t\t\tbreak;\n\t\t}\n\t}\n\n\telDialog.setAttribute('view-page-active', pageName);\n\n\telCurrentPages.forEach((elCurrentPage) => {\n\t\telCurrentPage.classList.remove('active');\n\t});\n\n\telNextPages.forEach((elNextPage) => {\n\t\telNextPage.classList.add('active');\n\t});\n\n\tbeforeOpenViewPage(elDialog, elNextPages, pageName, args);\n\n\tif (moveDirection) {\n\t\telDialog.classList.add('i-change-page');\n\n\t\tconst delay = Number(window.getComputedStyle(elNextPages[0]).animationDuration.replace('s', '')) * 1000;\n\n\t\ttimerClearAnimation = setTimeout(function () {\n\t\t\tupdatePageVue(elDialog.getAttribute('id'), pageName, '');\n\t\t\tstopAnimations(elDialog);\n\t\t\tafterOpenViewPage(elDialog, elNextPages, pageName, args);\n\t\t}, delay);\n\t} else {\n\t\tawait updatePageVue(elDialog.getAttribute('id'), pageName, '');\n\t\tafterOpenViewPage(elDialog, elNextPages, pageName, args);\n\t}\n};\n\n/**\n * К предыдущему представлению\n */\nconst toPrevPage = (elDialog: ElTopDialog) => {\n\tconst elModalLayers = querySelectorAllArray<ElTopDialogModalLayer>(elDialog, '.modal-layer');\n\tconst elCurrentPages = elModalLayers.reduce<ElTopDialogPage[]>((acc, elModalLayer) => {\n\t\tconst elCurrentPage = elModalLayer.querySelector<ElTopDialogPage>(':scope > .active');\n\n\t\tif (elCurrentPage) {\n\t\t\tacc.push(elCurrentPage);\n\t\t}\n\n\t\treturn acc;\n\t}, []);\n\n\tconst elPrevPages = elCurrentPages.reduce<ElTopDialogPage[]>((acc, elCurrentPage) => {\n\t\tlet elPrevPage = elCurrentPage.previousElementSibling as ElTopDialogPage | null;\n\t\twhile (elPrevPage && !elPrevPage.hasAttribute('data-view-page')) {\n\t\t\telPrevPage = elPrevPage.previousElementSibling as ElTopDialogPage | null;\n\t\t}\n\n\t\tif (elPrevPage) acc.push(elPrevPage);\n\n\t\treturn acc;\n\t}, []);\n\n\tconst prevPageName = (elPrevPages[0])?.dataset.viewPage;\n\n\tif (prevPageName) {\n\t\tvoid toViewPage(elDialog, prevPageName, undefined, 'prev');\n\t} else {\n\t\tconst $dialog = $(elDialog);\n\t\t$dialog.dialog('close');\n\t}\n};\n\n/**\n * Для обработки событий вне vue\n */\nconst beforeOpenViewPageTimers = new Set();\nconst beforeOpenViewPage = (elDialog: ElTopDialog, elPages: ElTopDialogPage[], pageName: string, args: string[]) => {\n\t// группировка цепочки событий\n\t// запрос на открытие страницы может выполняться несколько раз, чаще такое может быть при открытии, загрузке и переходе сразу к нужной странице\n\tconst eventKey = elDialog.getAttribute('id') + elPages[0].dataset.viewPage + pageName + args.join();\n\n\tif (beforeOpenViewPageTimers.has(eventKey)) return;\n\tbeforeOpenViewPageTimers.add(eventKey);\n\n\tsetTimeout(function () {\n\t\tbeforeOpenViewPageTimers.delete(eventKey);\n\n\t\t$(elDialog).trigger('viewBeforeOpen', [$(elDialog), $(elPages), pageName, args]);\n\t});\n};\n\n/**\n * Для обработки событий вне vue\n */\nconst afterOpenViewPage = (elDialog: ElTopDialog, elPages: ElTopDialogPage[], pageName: string, args: string[]) => {\n\tsetTimeout(function () {\n\t\t$(elDialog).trigger('viewAfterOpen', [$(elDialog), $(elPages), pageName, args]);\n\t});\n};\n\n/**\n * Получить состояние: Диалоговое окно находится в состоянии смены страницы\n */\nconst inAnimation = (elDialog: ElTopDialog | JQuery<ElTopDialog>) => {\n\tif (isElJQuery(elDialog)) elDialog = elDialog?.[0]; // todo: убрать после переписки jquery на сайте\n\n\treturn elDialog.classList.contains('i-change-page');\n};\n\n/**\n * Остановить анимацию смены страницы\n *\n * @returns Вернет true, если анимация производилась и была остановлена\n */\nconst stopAnimations = (elDialog: ElTopDialog) => {\n\tif (!inAnimation(elDialog)) return false;\n\n\tclearTimeout(timerClearAnimation);\n\n\tconst elModalLayers = querySelectorAllArray(elDialog, '.modal-layer');\n\n\tconst pageName = elDialog.dataset.viewPageActive;\n\telDialog.classList.remove('i-change-page');\n\n\telModalLayers.forEach((elModalLayer) => {\n\t\telModalLayer.querySelectorAll(':scope > [data-view-page]').forEach((el) => {\n\t\t\tel.classList.remove('center-to-left', 'right-to-center', 'reverse', 'active');\n\t\t});\n\t});\n\n\telModalLayers.forEach((elModalLayer) => {\n\t\telModalLayer.querySelector(`:scope > [data-view-page=\"${pageName}\"]`)?.classList.add('active');\n\t});\n\n\treturn true;\n};\n\n/**\n * Закрыть диалоговое окно\n */\nconst close = function (dialogId: string) {\n\tconst elDialog = getElDialogById(dialogId);\n\tif (!elDialog) return;\n\n\tconst $dialog = $(elDialog);\n\n\tif (!$dialog.dialog('instance')) return;\n\n\t$dialog.dialog('close');\n};\n\n/**\n * Управление props.isLoading\n */\nconst setLoading = (elPages: ElTopDialogPage[] | JQuery<ElTopDialogPage>, isLoading: boolean, duration?: number) => {\n\tif (isElJQuery(elPages)) elPages = elPages.toArray(); // todo: убрать после переписки jquery на сайте\n\n\tconst elPagesVisibleds = elPages.reduce<ElTopDialogPage[]>((acc, elPage) => {\n\t\tif (elPage.hasAttribute('data-view-page') && isVisible(elPage)) acc.push(elPage);\n\n\t\treturn acc;\n\t}, []);\n\n\tif (isLoading) {\n\t\tif (duration !== undefined) {\n\t\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\t\telPagesVisibled.style.setProperty('--dialog-loading-duration', duration + 's');\n\t\t\t});\n\t\t}\n\n\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\telPagesVisibled.classList.add('i-load-data');\n\t\t});\n\t} else {\n\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\telPagesVisibled.classList.remove('i-load-data');\n\t\t});\n\n\t\telPagesVisibleds.forEach((elPagesVisibled) => {\n\t\t\telPagesVisibled.style.setProperty('--dialog-loading-duration', '10s');\n\t\t});\n\t}\n};\n\nconst isLoading = (elPage: ElTopDialogPage | JQuery<ElTopDialogPage>) => {\n\tif (isElJQuery(elPage)) elPage = elPage?.[0]; // todo: убрать после переписки jquery на сайте\n\n\treturn elPage.classList.contains('i-load-data');\n};\n\nexport const TopDialogUtils = {\n\tgetElDialogById,\n\tupdatePageVue,\n\trecalcPositions,\n\ttoViewDirty,\n\ttoView,\n\ttoViewPage,\n\ttoPrevPage,\n\tsetLoading,\n\tisLoading,\n\tinAnimation,\n\tclose,\n};\n\ninit();\n"],"mappings":";;;;;;;;;AAGe;;;ACGf,IAAI,IAAS,IASA,UAA+B;CACvC,MACJ,IAAS,IAKT,SAAS,iBAAiB,YAAY,MAAM;EAE3C,IADI,EAAE,QAAQ,YACV,CAAC,EAAE,UAAU,EAAE,EAAE,kBAAkB,cAAc;EAErD,IAAM,IAAK,EAAE;EAcb,IAXI,CAAC,EAAG,QAAQ,YAAY,KAExB,EAAG,oBAAoB,UAAU,EAAG,oBAAoB,oBAGxD,EAAqB,SAAS,iBAAiB,oBAAoB,KAGnE,EAAG,UAAU,SAAS,cAAc,KAGpC,EAAqB,SAAS,iBAAiB,qBAAqB,GAAG;EAE3E,IAAM,IAAY,EAAmC,UAAU,oBAAoB,CAAC,CAAC,QAAQ,MACrF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EAC7E,CAAC;CACF,CAAC,GAED,EAAc,SAAS,MAAiB;EACvC,EAAa,cAAc,6BAA6B,EAAS,GAAG,CAAC,EAAE,UAAU,IAAI,QAAQ;CAC9F,CAAC,GAEM;AACR,GAuDa,IAAiB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA,aA5CmB,GAAsD,GAAoB,MAAsB;EACnH,AAAI,EAAW,CAAO,MAAG,IAAU,EAAQ,QAAQ;EAEnD,IAAM,IAAmB,EAAQ,QAA2B,GAAK,OAC5D,EAAO,aAAa,gBAAgB,KAAK,EAAU,CAAM,KAAG,EAAI,KAAK,CAAM,GAExE,IACL,CAAC,CAAC;EAEL,AAAI,KACC,MAAa,KAAA,KAChB,EAAiB,SAAS,MAAoB;GAC7C,EAAgB,MAAM,YAAY,6BAA6B,IAAW,GAAG;EAC9E,CAAC,GAGF,EAAiB,SAAS,MAAoB;GAC7C,EAAgB,UAAU,IAAI,aAAa;EAC5C,CAAC,MAED,EAAiB,SAAS,MAAoB;GAC7C,EAAgB,UAAU,OAAO,aAAa;EAC/C,CAAC,GAED,EAAiB,SAAS,MAAoB;GAC7C,EAAgB,MAAM,YAAY,6BAA6B,KAAK;EACrE,CAAC;CAEH;CAiBC,YAfkB,OACd,EAAW,CAAM,MAAG,IAAS,IAAS,KAEnC,EAAO,UAAU,SAAS,aAAa;CAa9C;CACA,gBA7DuB,GAAkB;EACzC,IAAM,IAAW,EAAgB,CAAQ;EACzC,IAAI,CAAC,GAAU;EAEf,IAAM,IAAU,EAAE,CAAQ;EAErB,EAAQ,OAAO,UAAU,KAE9B,EAAQ,OAAO,OAAO;CACvB;AAqDA;AAEA,EAAK"}
@@ -1,2 +1,2 @@
1
- var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},n(e)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=n(r),o=0;o<a.length;o++)a[o]!=="default"&&__createBinding(i,r,a[o]);return __setModuleDefault(i,r),i}})();define([`require`,`exports`,`./forms-CY5MOh7a.amd`,`../utils/dom.amd`,`../utils/system.amd`,`../utils/route.amd`,`vue`],function(e,t,r,i,a,o,s){"use strict";if(c===void 0)var c=window.Vue;Object.defineProperty(t,"__esModule",{value:!0}),t.t=t.s=t.r=t.o=t.n=t.i=t.a=void 0;var l=[`id`,`data-view-page-active`,`data-modal`,`data-position`],u=(0,s.defineComponent)({__name:`dialog`,props:{id:{},pageActive:{},width:{default:`600px`},height:{default:`auto`},modal:{type:Boolean,default:!0},position:{},historyType:{default:`push`},classes:{}},emits:[`open`,`close`],setup(e){let t=g(e.id);if(!t)throw Error(`TopDialog cannot be used in a template, use useTopDialog() / useAsyncTopDialog()`);return(0,s.provide)(`dialogWorker`,t),(0,s.onMounted)(()=>{let e=(0,s.getCurrentInstance)(),n=e.parent;if(n?.parent?.type.name!==`DialogWrapper`)throw Error(`TopDialog cannot be used in a template, use useTopDialog()`);if(Array.isArray(n.subTree.children)&&n.subTree.children.length!==1)throw Error(`TopDialog can has only one root element`);t.onMounted(n,e)}),(0,s.watch)(t.isOpened,()=>{t.isReady.value=!0},{flush:`post`,once:!0}),(n,r)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{id:(0,s.unref)(t).idAttr,class:(0,s.normalizeClass)([`top-dialog`,e.classes]),style:(0,s.normalizeStyle)({"--top-dialog-width":e.width,"--top-dialog-height":e.height}),tabindex:`-1`,"data-view-page-active":(0,s.unref)(t).pageActive.value,"data-modal":e.modal,"data-position":e.position},[r[0]||=(0,s.createElementVNode)(`div`,{class:`modal-layer modal-layer-header`},null,-1),(0,s.createElementVNode)(`div`,{class:`modal-layer modal-layer-body`,style:(0,s.normalizeStyle)({"min-height":e.height+`px`})},null,4),(0,s.renderSlot)(n.$slots,`default`)],14,l))}}),d,f=class t{static init(e){if(this.inited)return;this.inited=!0,this.state.load=e?.load,this.state.decoratorOnCreate=e?.decoratorOnCreate;let n=e?.autoInitDelay??5e3;window.addEventListener(`hashchange`,e=>{this.opendDialogsFromChangeUrl(e.oldURL,e.newURL)}),this.opendDialogsFromChangeUrl(``,location.href),document.addEventListener(`mousedown`,async e=>{if(!(e.target instanceof HTMLElement))return;let n=e.target.closest(`a[data-to-view]`);if(!n)return;let r=`next`;n.dataset.action===`top-dialog-close`&&(r=`prev`),n.href=t.genViewPageHash(n.dataset.toView,r)}),document.addEventListener(`click`,async e=>{if(!(e.target instanceof HTMLElement))return;let n=e.target.closest(`[data-to-view]`);if(!n)return;if(n instanceof HTMLAnchorElement&&n.href===`.`){e.preventDefault();let t=new MouseEvent(`mousedown`,{bubbles:!0,cancelable:!0,view:window});n.dispatchEvent(t),setTimeout(()=>n.click());return}let r=await this.getDialogsUtils(),a=n.dataset.toView,s=a.split(`-`)[0],c=r.getElDialogById(s),l=`next`;if(c){let e=(0,i.querySelectorAllArray)(c,`.modal-layer`),t=e.reduce((e,t)=>{let n=t.querySelector(`:scope > .active`);return n&&e.push(n),e},[]);if(t.length){let n=a.split(`-`)[1].split(`:`)[0];(e.reduce((e,t)=>{let r=t?.querySelector(`:scope > [data-view-page="${n}"]`);return r&&e.push(r),e},[])[0]?.dataset.order??0)<(t[0]?.dataset.order??0)&&(l=`prev`)}}n.dataset.action===`top-dialog-close`&&(l=`prev`);let u=t.genViewPageHash(a,l);if(n instanceof HTMLAnchorElement){if(!c||!(0,i.isVisible)(c))return;if(location.hash.indexOf(a.replace(`-`,`=`))!==-1){await r.toViewDirty(a);return}}c?.dataset.toViewReplace?(e.preventDefault(),(0,o.historySetState)(!0,u),await r.toViewDirty(a),l==`next`?t.state.viewPageN++:t.state.viewPageN--):n.tagName!==`A`&&(this.compareStates(u,location.hash)?(0,o.historySetState)(!1,u):await r.toViewDirty(a))}),setTimeout(()=>this.getDialogsUtils(),n)}static opendDialogsFromChangeUrl(e,t){let n=e.replace(/.*?#/,`#`),r=t.replace(/.*?#/,`#`);this.compareStates(n,r)&&this.opendDialogsFromUrl()}static async getDialogsUtils(){let{TopDialogUtils:t}=await new Promise((t,n)=>{e([`./utils-ds_g-L_r.amd`],t,n)}).then(__importStar);return t}static getDialog(e){return e.closest(`.ui-dialog-content`)}static get$dialog(e){return e.closest(`.ui-dialog-content`)}static getPage(e){return e.closest(`[data-view-page]`)}static get$page(e){return e.closest(`[data-view-page]`)}static get$pairPage(e){let n=t.get$dialog(e),r=t.get$page(e).data(`view-page`);return $(`[data-view-page="`+r+`"]`,n)}static getPairPage(e){let n=t.getDialog(e);if(!n)return;let r=t.getPage(e)?.dataset.viewPage;return(0,i.querySelectorAllArray)(n,`[data-view-page="${r}"]`)}static close(e){let t=$(`#`+e);if(t.dialog(`instance`)){t.dialog(`close`);return}let n=document.getElementById(e);n instanceof HTMLDialogElement&&n.close()}static destroy(e){let t=$(`#`+e);if(t.dialog(`instance`)){t.dialog(`close`),t.dialog(`destroy`);return}let n=document.getElementById(e);n instanceof HTMLDialogElement&&n.close()}static genViewPageHash(e,t=`next`){let n=this.state.viewPageN;t==`prev`?n--:n++;let r=e.split(`-`),i=r.shift(),a=r.join(`-`),s=(0,o.genHash)(`vpn`,n);return s=(0,o.genHash)(`view-`+i,a,s),s}static compareStates(e,t){let n=e.match(/[#&]view-[^&]+/g)||[],r=t.match(/[#&]view-[^&]+/g)||[];return!!(n.length!==r.length||n.filter((e,t)=>e!==(r[t]||``)).length)}};t.s=u,t.o=f,d=f,(0,r.K)(f,`state`,{load:void 0,decoratorOnCreate:void 0,viewPageN:0}),(0,r.K)(f,`inited`,!1),(0,r.K)(f,`opendDialogsFromUrl`,async()=>{let e=Number((0,o.getHash)(`vpn`))||0,t=RegExp(`view-((\\w+)=([\\w-]+)(?::([\\w.:-]+))?)`,`g`).exec(location.hash);if(t){let n=`next`;return e<d.state.viewPageN&&(n=`prev`),(await d.getDialogsUtils()).toViewDirty(t[1],n)}return(0,i.querySelectorAllArray)(document,`.ui-dialog-content[data-view-page-active]`).filter(e=>(0,i.isVisible)(e)).forEach(e=>{let t=e.getAttribute(`id`);if(!t)throw`Диалоговое окно не содержит id`;(0,o.getHash)(`view-`+t)||$(e).dialog(`close`)}),d.state.viewPageN=e,!0});var p=class{constructor(e){(0,r.K)(this,`id`,void 0),(0,r.K)(this,`idAttr`,void 0),(0,r.K)(this,`Component`,void 0),(0,r.K)(this,`isMounted`,(0,s.ref)(!1)),(0,r.K)(this,`isReady`,(0,s.ref)(!1)),(0,r.K)(this,`isOpened`,(0,s.ref)(!1)),(0,r.K)(this,`pageActive`,(0,s.ref)(``)),(0,r.K)(this,`isLoadingPage`,(0,s.ref)(!1)),(0,r.K)(this,`pageActiveNext`,(0,s.ref)(``)),(0,r.K)(this,`props`,void 0),(0,r.K)(this,`emit`,void 0),(0,r.K)(this,`onCloseOnce`,void 0),this.id=e.id,this.idAttr=`dialog_`+e.id,this.Component=(0,s.markRaw)(e)}onMounted(e,t){this.isMounted.value=!0,this.props=e.props,this.emit=t.emit}async open(e=`main`,t,n=[],r,i){t&&await this.setProps(t),r&&(this.onCloseOnce=r),await(await f.getDialogsUtils()).toView(this.idAttr,e,n,i)}async openAsLink(e=`main`,t,n=[],r,i){t&&await this.setProps(t),r&&(this.onCloseOnce=r);let a=this.idAttr+`-`+e;(0,o.historySetState)(!1,f.genViewPageHash(a,i))}async close(){f.close(this.idAttr)}async destroy(){f.destroy(this.idAttr)}async setProps(e={}){this.isMounted||await(0,a.waitWhile)(()=>!this.props);for(let t in this.props)this.props[t]=e[t]}needShowPage(e){return this.isOpened.value?this.pageActive.value===e||this.pageActiveNext.value===e:!1}},m={class:`top-dialogs`,style:{display:`none`}},h=(0,s.shallowReactive)(new Map),g=e=>(e=e.replace(/^dialog_/,``),h.get(e)),_=e=>{if(!e?.id)throw console.log({TopDialogComponent:e}),Error(`Expected TopDialogComponent`);return h.has(e.id)||h.set(e.id,new p(e)),h.get(e.id)},v=(0,s.defineComponent)({name:`DialogWrapper`,__name:`dialogs`,setup(e){return(0,s.onUnmounted)(()=>{h.forEach(e=>e.destroy()),h.clear()}),(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,m,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(h),([e,t])=>((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(t.Component),{key:e}))),128))]))}}),y=class{constructor(e){(0,r.K)(this,`resolve`,void 0),(0,r.K)(this,`worker`,(0,s.ref)(null)),this.resolve=e}async get(){if(this.worker.value)return this.worker.value;let e=(await this.resolve()).default;this.worker.value=x(e);let t=this.worker.value;return await(0,a.waitWhile)(()=>!t.isMounted),t}async open(...e){await(await this.get()).open(...e)}async openAsLink(...e){(await this.get()).openAsLink(...e)}async close(...e){(await this.get()).close(...e)}async destroy(...e){(await this.get()).destroy(...e)}async setProps(...e){await(await this.get()).setProps(...e)}},b=()=>{let e=(0,s.getCurrentInstance)();if(e?.type?.id){let t=g(e.type.id);if(t)return t}return(0,s.inject)(`dialogWorker`)},x=e=>_(e);t.a=g,t.i=v,t.r=b,t.n=x,t.t=e=>new y(e)});
2
- //# sourceMappingURL=utils-Be-ScFyj.amd.js.map
1
+ var __createBinding=this&&this.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),__importStar=this&&this.__importStar||(function(){var n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},n(e)};return function(r){if(r&&r.__esModule)return r;var i={};if(r!=null)for(var a=n(r),o=0;o<a.length;o++)a[o]!=="default"&&__createBinding(i,r,a[o]);return __setModuleDefault(i,r),i}})();define([`require`,`exports`,`./forms-3EhjGbIm.amd`,`../utils/dom.amd`,`../utils/system.amd`,`../utils/route.amd`,`vue`],function(e,t,r,i,a,o,s){"use strict";if(c===void 0)var c=window.Vue;Object.defineProperty(t,"__esModule",{value:!0}),t.t=t.s=t.r=t.o=t.n=t.i=t.a=void 0;var l=[`id`,`data-view-page-active`,`data-modal`,`data-position`],u=(0,s.defineComponent)({__name:`dialog`,props:{id:{},pageActive:{},width:{default:`600px`},height:{default:`auto`},modal:{type:Boolean,default:!0},position:{},historyType:{default:`push`},classes:{}},emits:[`open`,`close`],setup(e){let t=g(e.id);if(!t)throw Error(`TopDialog cannot be used in a template, use useTopDialog() / useAsyncTopDialog()`);return(0,s.provide)(`dialogWorker`,t),(0,s.onMounted)(()=>{let e=(0,s.getCurrentInstance)(),n=e.parent;if(n?.parent?.type.name!==`DialogWrapper`)throw Error(`TopDialog cannot be used in a template, use useTopDialog()`);if(Array.isArray(n.subTree.children)&&n.subTree.children.length!==1)throw Error(`TopDialog can has only one root element`);t.onMounted(n,e)}),(0,s.watch)(t.isOpened,()=>{t.isReady.value=!0},{flush:`post`,once:!0}),(n,r)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,{id:(0,s.unref)(t).idAttr,class:(0,s.normalizeClass)([`top-dialog`,e.classes]),style:(0,s.normalizeStyle)({"--top-dialog-width":e.width,"--top-dialog-height":e.height}),tabindex:`-1`,"data-view-page-active":(0,s.unref)(t).pageActive.value,"data-modal":e.modal,"data-position":e.position},[r[0]||=(0,s.createElementVNode)(`div`,{class:`modal-layer modal-layer-header`},null,-1),(0,s.createElementVNode)(`div`,{class:`modal-layer modal-layer-body`,style:(0,s.normalizeStyle)({"min-height":e.height+`px`})},null,4),(0,s.renderSlot)(n.$slots,`default`)],14,l))}}),d,f=class t{static init(e){if(this.inited)return;this.inited=!0,this.state.load=e?.load,this.state.decoratorOnCreate=e?.decoratorOnCreate;let n=e?.autoInitDelay??5e3;window.addEventListener(`hashchange`,e=>{this.opendDialogsFromChangeUrl(e.oldURL,e.newURL)}),this.opendDialogsFromChangeUrl(``,location.href),document.addEventListener(`mousedown`,async e=>{if(!(e.target instanceof HTMLElement))return;let n=e.target.closest(`a[data-to-view]`);if(!n)return;let r=`next`;n.dataset.action===`top-dialog-close`&&(r=`prev`),n.href=t.genViewPageHash(n.dataset.toView,r)}),document.addEventListener(`click`,async e=>{if(!(e.target instanceof HTMLElement))return;let n=e.target.closest(`[data-to-view]`);if(!n)return;if(n instanceof HTMLAnchorElement&&n.href===`.`){e.preventDefault();let t=new MouseEvent(`mousedown`,{bubbles:!0,cancelable:!0,view:window});n.dispatchEvent(t),setTimeout(()=>n.click());return}let r=await this.getDialogsUtils(),a=n.dataset.toView,s=a.split(`-`)[0],c=r.getElDialogById(s),l=`next`;if(c){let e=(0,i.querySelectorAllArray)(c,`.modal-layer`),t=e.reduce((e,t)=>{let n=t.querySelector(`:scope > .active`);return n&&e.push(n),e},[]);if(t.length){let n=a.split(`-`)[1].split(`:`)[0];(e.reduce((e,t)=>{let r=t?.querySelector(`:scope > [data-view-page="${n}"]`);return r&&e.push(r),e},[])[0]?.dataset.order??0)<(t[0]?.dataset.order??0)&&(l=`prev`)}}n.dataset.action===`top-dialog-close`&&(l=`prev`);let u=t.genViewPageHash(a,l);if(n instanceof HTMLAnchorElement){if(!c||!(0,i.isVisible)(c))return;if(location.hash.indexOf(a.replace(`-`,`=`))!==-1){await r.toViewDirty(a);return}}c?.dataset.toViewReplace?(e.preventDefault(),(0,o.historySetState)(!0,u),await r.toViewDirty(a),l==`next`?t.state.viewPageN++:t.state.viewPageN--):n.tagName!==`A`&&(this.compareStates(u,location.hash)?(0,o.historySetState)(!1,u):await r.toViewDirty(a))}),setTimeout(()=>this.getDialogsUtils(),n)}static opendDialogsFromChangeUrl(e,t){let n=e.replace(/.*?#/,`#`),r=t.replace(/.*?#/,`#`);this.compareStates(n,r)&&this.opendDialogsFromUrl()}static async getDialogsUtils(){let{TopDialogUtils:t}=await new Promise((t,n)=>{e([`./utils-D3lUe-RP.amd`],t,n)}).then(__importStar);return t}static getDialog(e){return e.closest(`.ui-dialog-content`)}static get$dialog(e){return e.closest(`.ui-dialog-content`)}static getPage(e){return e.closest(`[data-view-page]`)}static get$page(e){return e.closest(`[data-view-page]`)}static get$pairPage(e){let n=t.get$dialog(e),r=t.get$page(e).data(`view-page`);return $(`[data-view-page="`+r+`"]`,n)}static getPairPage(e){let n=t.getDialog(e);if(!n)return;let r=t.getPage(e)?.dataset.viewPage;return(0,i.querySelectorAllArray)(n,`[data-view-page="${r}"]`)}static close(e){let t=$(`#`+e);if(t.dialog(`instance`)){t.dialog(`close`);return}let n=document.getElementById(e);n instanceof HTMLDialogElement&&n.close()}static destroy(e){let t=$(`#`+e);if(t.dialog(`instance`)){t.dialog(`close`),t.dialog(`destroy`);return}let n=document.getElementById(e);n instanceof HTMLDialogElement&&n.close()}static genViewPageHash(e,t=`next`){let n=this.state.viewPageN;t==`prev`?n--:n++;let r=e.split(`-`),i=r.shift(),a=r.join(`-`),s=(0,o.genHash)(`vpn`,n);return s=(0,o.genHash)(`view-`+i,a,s),s}static compareStates(e,t){let n=e.match(/[#&]view-[^&]+/g)||[],r=t.match(/[#&]view-[^&]+/g)||[];return!!(n.length!==r.length||n.filter((e,t)=>e!==(r[t]||``)).length)}};t.s=u,t.o=f,d=f,(0,r.K)(f,`state`,{load:void 0,decoratorOnCreate:void 0,viewPageN:0}),(0,r.K)(f,`inited`,!1),(0,r.K)(f,`opendDialogsFromUrl`,async()=>{let e=Number((0,o.getHash)(`vpn`))||0,t=RegExp(`view-((\\w+)=([\\w-]+)(?::([\\w.:-]+))?)`,`g`).exec(location.hash);if(t){let n=`next`;return e<d.state.viewPageN&&(n=`prev`),(await d.getDialogsUtils()).toViewDirty(t[1],n)}return(0,i.querySelectorAllArray)(document,`.ui-dialog-content[data-view-page-active]`).filter(e=>(0,i.isVisible)(e)).forEach(e=>{let t=e.getAttribute(`id`);if(!t)throw`Диалоговое окно не содержит id`;(0,o.getHash)(`view-`+t)||$(e).dialog(`close`)}),d.state.viewPageN=e,!0});var p=class{constructor(e){(0,r.K)(this,`id`,void 0),(0,r.K)(this,`idAttr`,void 0),(0,r.K)(this,`Component`,void 0),(0,r.K)(this,`isMounted`,(0,s.ref)(!1)),(0,r.K)(this,`isReady`,(0,s.ref)(!1)),(0,r.K)(this,`isOpened`,(0,s.ref)(!1)),(0,r.K)(this,`pageActive`,(0,s.ref)(``)),(0,r.K)(this,`isLoadingPage`,(0,s.ref)(!1)),(0,r.K)(this,`pageActiveNext`,(0,s.ref)(``)),(0,r.K)(this,`props`,void 0),(0,r.K)(this,`emit`,void 0),(0,r.K)(this,`onCloseOnce`,void 0),this.id=e.id,this.idAttr=`dialog_`+e.id,this.Component=(0,s.markRaw)(e)}onMounted(e,t){this.isMounted.value=!0,this.props=e.props,this.emit=t.emit}async open(e=`main`,t,n=[],r,i){t&&await this.setProps(t),r&&(this.onCloseOnce=r),await(await f.getDialogsUtils()).toView(this.idAttr,e,n,i)}async openAsLink(e=`main`,t,n=[],r,i){t&&await this.setProps(t),r&&(this.onCloseOnce=r);let a=this.idAttr+`-`+e;(0,o.historySetState)(!1,f.genViewPageHash(a,i))}async close(){f.close(this.idAttr)}async destroy(){f.destroy(this.idAttr)}async setProps(e={}){this.isMounted||await(0,a.waitWhile)(()=>!this.props);for(let t in this.props)this.props[t]=e[t]}needShowPage(e){return this.isOpened.value?this.pageActive.value===e||this.pageActiveNext.value===e:!1}},m={class:`top-dialogs`,style:{display:`none`}},h=(0,s.shallowReactive)(new Map),g=e=>(e=e.replace(/^dialog_/,``),h.get(e)),_=e=>{if(!e?.id)throw console.log({TopDialogComponent:e}),Error(`Expected TopDialogComponent`);return h.has(e.id)||h.set(e.id,new p(e)),h.get(e.id)},v=(0,s.defineComponent)({name:`DialogWrapper`,__name:`dialogs`,setup(e){return(0,s.onUnmounted)(()=>{h.forEach(e=>e.destroy()),h.clear()}),(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`div`,m,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(h),([e,t])=>((0,s.openBlock)(),(0,s.createBlock)((0,s.resolveDynamicComponent)(t.Component),{key:e}))),128))]))}}),y=class{constructor(e){(0,r.K)(this,`resolve`,void 0),(0,r.K)(this,`worker`,(0,s.ref)(null)),this.resolve=e}async get(){if(this.worker.value)return this.worker.value;let e=(await this.resolve()).default;this.worker.value=x(e);let t=this.worker.value;return await(0,a.waitWhile)(()=>!t.isMounted),t}async open(...e){await(await this.get()).open(...e)}async openAsLink(...e){(await this.get()).openAsLink(...e)}async close(...e){(await this.get()).close(...e)}async destroy(...e){(await this.get()).destroy(...e)}async setProps(...e){await(await this.get()).setProps(...e)}},b=()=>{let e=(0,s.getCurrentInstance)();if(e?.type?.id){let t=g(e.type.id);if(t)return t}return(0,s.inject)(`dialogWorker`)},x=e=>_(e);t.a=g,t.i=v,t.r=b,t.n=x,t.t=e=>new y(e)});
2
+ //# sourceMappingURL=utils-Db5TDjU8.amd.js.map