primereact 10.1.1 → 10.2.1

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 (209) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +24 -38
  3. package/accordion/accordion.cjs.js +6 -5
  4. package/accordion/accordion.cjs.min.js +1 -1
  5. package/accordion/accordion.d.ts +1 -1
  6. package/accordion/accordion.esm.js +6 -5
  7. package/accordion/accordion.esm.min.js +1 -1
  8. package/accordion/accordion.js +5 -4
  9. package/accordion/accordion.min.js +1 -1
  10. package/api/api.d.ts +246 -13
  11. package/blockui/blockui.cjs.js +2 -1
  12. package/blockui/blockui.cjs.min.js +1 -1
  13. package/blockui/blockui.esm.js +2 -1
  14. package/blockui/blockui.esm.min.js +1 -1
  15. package/blockui/blockui.js +2 -1
  16. package/blockui/blockui.min.js +1 -1
  17. package/calendar/calendar.cjs.js +9 -6
  18. package/calendar/calendar.cjs.min.js +1 -1
  19. package/calendar/calendar.esm.js +9 -6
  20. package/calendar/calendar.esm.min.js +1 -1
  21. package/calendar/calendar.js +9 -6
  22. package/calendar/calendar.min.js +1 -1
  23. package/cascadeselect/cascadeselect.cjs.js +3 -0
  24. package/cascadeselect/cascadeselect.cjs.min.js +1 -1
  25. package/cascadeselect/cascadeselect.esm.js +4 -1
  26. package/cascadeselect/cascadeselect.esm.min.js +1 -1
  27. package/cascadeselect/cascadeselect.js +3 -0
  28. package/cascadeselect/cascadeselect.min.js +1 -1
  29. package/chip/chip.cjs.js +4 -3
  30. package/chip/chip.cjs.min.js +1 -1
  31. package/chip/chip.esm.js +4 -3
  32. package/chip/chip.esm.min.js +1 -1
  33. package/chip/chip.js +4 -3
  34. package/chip/chip.min.js +1 -1
  35. package/chips/chips.cjs.js +2 -1
  36. package/chips/chips.cjs.min.js +1 -1
  37. package/chips/chips.esm.js +2 -1
  38. package/chips/chips.esm.min.js +1 -1
  39. package/chips/chips.js +2 -1
  40. package/chips/chips.min.js +1 -1
  41. package/confirmpopup/confirmpopup.cjs.js +2 -4
  42. package/confirmpopup/confirmpopup.cjs.min.js +1 -1
  43. package/confirmpopup/confirmpopup.esm.js +2 -4
  44. package/confirmpopup/confirmpopup.esm.min.js +1 -1
  45. package/confirmpopup/confirmpopup.js +2 -4
  46. package/confirmpopup/confirmpopup.min.js +1 -1
  47. package/core/core.js +64 -61
  48. package/core/core.min.js +5 -5
  49. package/datatable/datatable.cjs.js +4 -1
  50. package/datatable/datatable.cjs.min.js +1 -1
  51. package/datatable/datatable.d.ts +1 -1
  52. package/datatable/datatable.esm.js +4 -1
  53. package/datatable/datatable.esm.min.js +1 -1
  54. package/datatable/datatable.js +4 -1
  55. package/datatable/datatable.min.js +1 -1
  56. package/dialog/dialog.cjs.js +2 -4
  57. package/dialog/dialog.cjs.min.js +1 -1
  58. package/dialog/dialog.esm.js +2 -4
  59. package/dialog/dialog.esm.min.js +1 -1
  60. package/dialog/dialog.js +2 -4
  61. package/dialog/dialog.min.js +1 -1
  62. package/hooks/hooks.cjs.js +2 -4
  63. package/hooks/hooks.cjs.min.js +1 -1
  64. package/hooks/hooks.esm.js +2 -4
  65. package/hooks/hooks.esm.min.js +1 -1
  66. package/hooks/hooks.js +2 -4
  67. package/hooks/hooks.min.js +1 -1
  68. package/image/image.cjs.js +2 -4
  69. package/image/image.cjs.min.js +1 -1
  70. package/image/image.esm.js +2 -4
  71. package/image/image.esm.min.js +1 -1
  72. package/image/image.js +2 -4
  73. package/image/image.min.js +1 -1
  74. package/inplace/inplace.cjs.js +7 -5
  75. package/inplace/inplace.cjs.min.js +1 -1
  76. package/inplace/inplace.esm.js +7 -5
  77. package/inplace/inplace.esm.min.js +1 -1
  78. package/inplace/inplace.js +7 -5
  79. package/inplace/inplace.min.js +1 -1
  80. package/mention/mention.cjs.js +9 -10
  81. package/mention/mention.cjs.min.js +1 -1
  82. package/mention/mention.esm.js +10 -11
  83. package/mention/mention.esm.min.js +1 -1
  84. package/mention/mention.js +9 -10
  85. package/mention/mention.min.js +1 -1
  86. package/menu/menu.cjs.js +2 -4
  87. package/menu/menu.cjs.min.js +1 -1
  88. package/menu/menu.esm.js +2 -4
  89. package/menu/menu.esm.min.js +1 -1
  90. package/menu/menu.js +2 -4
  91. package/menu/menu.min.js +1 -1
  92. package/multiselect/multiselect.cjs.js +1 -0
  93. package/multiselect/multiselect.cjs.min.js +1 -1
  94. package/multiselect/multiselect.esm.js +1 -0
  95. package/multiselect/multiselect.esm.min.js +1 -1
  96. package/multiselect/multiselect.js +1 -0
  97. package/multiselect/multiselect.min.js +1 -1
  98. package/overlaypanel/overlaypanel.cjs.js +2 -4
  99. package/overlaypanel/overlaypanel.cjs.min.js +1 -1
  100. package/overlaypanel/overlaypanel.esm.js +2 -4
  101. package/overlaypanel/overlaypanel.esm.min.js +1 -1
  102. package/overlaypanel/overlaypanel.js +2 -4
  103. package/overlaypanel/overlaypanel.min.js +1 -1
  104. package/package.json +1 -1
  105. package/panelmenu/panelmenu.cjs.js +1 -1
  106. package/panelmenu/panelmenu.cjs.min.js +1 -1
  107. package/panelmenu/panelmenu.esm.js +1 -1
  108. package/panelmenu/panelmenu.esm.min.js +1 -1
  109. package/panelmenu/panelmenu.js +1 -1
  110. package/panelmenu/panelmenu.min.js +1 -1
  111. package/passthrough/tailwind/index.cjs.js +3 -3
  112. package/passthrough/tailwind/index.cjs.min.js +1 -1
  113. package/passthrough/tailwind/index.esm.js +3 -3
  114. package/passthrough/tailwind/index.esm.min.js +1 -1
  115. package/passthrough/tailwind/index.js +3 -3
  116. package/passthrough/tailwind/index.min.js +1 -1
  117. package/password/password.cjs.js +1 -1
  118. package/password/password.cjs.min.js +1 -1
  119. package/password/password.esm.js +1 -1
  120. package/password/password.esm.min.js +1 -1
  121. package/password/password.js +1 -1
  122. package/password/password.min.js +1 -1
  123. package/primereact.all.cjs.js +314 -273
  124. package/primereact.all.cjs.min.js +1 -1
  125. package/primereact.all.esm.js +314 -273
  126. package/primereact.all.esm.min.js +1 -1
  127. package/primereact.all.js +314 -273
  128. package/primereact.all.min.js +1 -1
  129. package/progressbar/progressbar.cjs.js +4 -1
  130. package/progressbar/progressbar.cjs.min.js +1 -1
  131. package/progressbar/progressbar.esm.js +4 -1
  132. package/progressbar/progressbar.esm.min.js +1 -1
  133. package/progressbar/progressbar.js +4 -1
  134. package/progressbar/progressbar.min.js +1 -1
  135. package/progressspinner/progressspinner.cjs.js +2 -2
  136. package/progressspinner/progressspinner.cjs.min.js +1 -1
  137. package/progressspinner/progressspinner.esm.js +2 -2
  138. package/progressspinner/progressspinner.esm.min.js +1 -1
  139. package/progressspinner/progressspinner.js +2 -2
  140. package/progressspinner/progressspinner.min.js +1 -1
  141. package/ripple/ripple.cjs.js +2 -1
  142. package/ripple/ripple.cjs.min.js +1 -1
  143. package/ripple/ripple.esm.js +2 -1
  144. package/ripple/ripple.esm.min.js +1 -1
  145. package/ripple/ripple.js +2 -1
  146. package/ripple/ripple.min.js +1 -1
  147. package/scrolltop/scrolltop.cjs.js +3 -1
  148. package/scrolltop/scrolltop.cjs.min.js +1 -1
  149. package/scrolltop/scrolltop.esm.js +4 -2
  150. package/scrolltop/scrolltop.esm.min.js +1 -1
  151. package/scrolltop/scrolltop.js +3 -1
  152. package/scrolltop/scrolltop.min.js +1 -1
  153. package/sidebar/sidebar.cjs.js +2 -4
  154. package/sidebar/sidebar.cjs.min.js +1 -1
  155. package/sidebar/sidebar.esm.js +2 -4
  156. package/sidebar/sidebar.esm.min.js +1 -1
  157. package/sidebar/sidebar.js +2 -4
  158. package/sidebar/sidebar.min.js +1 -1
  159. package/skeleton/skeleton.cjs.js +2 -1
  160. package/skeleton/skeleton.cjs.min.js +1 -1
  161. package/skeleton/skeleton.esm.js +2 -1
  162. package/skeleton/skeleton.esm.min.js +1 -1
  163. package/skeleton/skeleton.js +2 -1
  164. package/skeleton/skeleton.min.js +1 -1
  165. package/slidemenu/slidemenu.cjs.js +2 -4
  166. package/slidemenu/slidemenu.cjs.min.js +1 -1
  167. package/slidemenu/slidemenu.esm.js +2 -4
  168. package/slidemenu/slidemenu.esm.min.js +1 -1
  169. package/slidemenu/slidemenu.js +2 -4
  170. package/slidemenu/slidemenu.min.js +1 -1
  171. package/slider/slider.cjs.js +1 -1
  172. package/slider/slider.cjs.min.js +1 -1
  173. package/slider/slider.esm.js +1 -1
  174. package/slider/slider.esm.min.js +1 -1
  175. package/slider/slider.js +1 -1
  176. package/slider/slider.min.js +1 -1
  177. package/speeddial/speeddial.cjs.js +3 -0
  178. package/speeddial/speeddial.cjs.min.js +1 -1
  179. package/speeddial/speeddial.esm.js +4 -1
  180. package/speeddial/speeddial.esm.min.js +1 -1
  181. package/speeddial/speeddial.js +3 -0
  182. package/speeddial/speeddial.min.js +1 -1
  183. package/splitbutton/splitbutton.cjs.js +101 -0
  184. package/splitbutton/splitbutton.cjs.min.js +1 -1
  185. package/splitbutton/splitbutton.d.ts +4 -4
  186. package/splitbutton/splitbutton.esm.js +104 -3
  187. package/splitbutton/splitbutton.esm.min.js +1 -1
  188. package/splitbutton/splitbutton.js +101 -0
  189. package/splitbutton/splitbutton.min.js +1 -1
  190. package/terminal/terminal.cjs.js +7 -12
  191. package/terminal/terminal.cjs.min.js +1 -1
  192. package/terminal/terminal.esm.js +7 -12
  193. package/terminal/terminal.esm.min.js +1 -1
  194. package/terminal/terminal.js +7 -12
  195. package/terminal/terminal.min.js +1 -1
  196. package/tooltip/tooltip.d.ts +1 -1
  197. package/tree/tree.cjs.js +54 -51
  198. package/tree/tree.cjs.min.js +1 -1
  199. package/tree/tree.esm.js +54 -51
  200. package/tree/tree.esm.min.js +1 -1
  201. package/tree/tree.js +54 -51
  202. package/tree/tree.min.js +1 -1
  203. package/treetable/treetable.cjs.js +28 -11
  204. package/treetable/treetable.cjs.min.js +1 -1
  205. package/treetable/treetable.esm.js +28 -11
  206. package/treetable/treetable.esm.min.js +1 -1
  207. package/treetable/treetable.js +28 -11
  208. package/treetable/treetable.min.js +1 -1
  209. package/web-types.json +2 -2
@@ -192,7 +192,6 @@ var useEventListener = function useEventListener(_ref) {
192
192
  when = _ref$when === void 0 ? true : _ref$when;
193
193
  var targetRef = React__namespace.useRef(null);
194
194
  var listenerRef = React__namespace.useRef(null);
195
- var prevListener = usePrevious(listener);
196
195
  var prevOptions = usePrevious(options);
197
196
  var bind = function bind() {
198
197
  var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -222,12 +221,11 @@ var useEventListener = function useEventListener(_ref) {
222
221
  }
223
222
  }, [target, when]);
224
223
  React__namespace.useEffect(function () {
225
- // to properly compare functions we can implicitly converting the function to it's body's text as a String
226
- if (listenerRef.current && ('' + prevListener !== '' + listener || prevOptions !== options)) {
224
+ if (listenerRef.current && (listenerRef.current !== listener || prevOptions !== options)) {
227
225
  unbind();
228
226
  when && bind();
229
227
  }
230
- }, [listener, options, when]);
228
+ }, [listener, options]);
231
229
  useUnmountEffect(function () {
232
230
  unbind();
233
231
  });
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils"),n=require("primereact/api"),r=require("primereact/componentbase"),o=require("primereact/csstransition"),i=require("primereact/hooks"),a=require("primereact/icons/times"),l=require("primereact/icons/windowmaximize"),c=require("primereact/icons/windowminimize"),u=require("primereact/portal"),s=require("primereact/ripple");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var m=d(e),g=p(n);function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e){if(Array.isArray(e))return b(e)}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function h(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function x(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function E(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function O(e){var t=E(e,"string");return"symbol"===w(t)?t:String(t)}function D(e,t,n){return(t=O(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e){if(Array.isArray(e))return e}function P(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}function z(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(e,t){return S(e)||P(e,t)||h(e,t)||z()}var I=function(e){var t=m.useRef(void 0);return m.useEffect((function(){t.current=e})),t.current},j=function(e,n,r){var o,i,a,l,c,u,s,p,d,g,f,b,y,v,h,x=(l=void 0===(a=(o={type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),r(e))}}).target)?"document":a,c=o.type,u=o.listener,s=o.options,d=void 0===(p=o.when)||p,g=m.useRef(null),f=m.useRef(null),b=I(u),y=I(s),v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.ObjectUtils.isNotEmpty(e.target)&&(h(),(e.when||d)&&(g.current=t.DomHandler.getTargetElement(e.target))),!f.current&&g.current&&(f.current=function(e){return u&&u(e)},g.current.addEventListener(c,f.current,s))},h=function(){f.current&&(g.current.removeEventListener(c,f.current,s),f.current=null)},m.useEffect((function(){d?g.current=t.DomHandler.getTargetElement(l):(h(),g.current=null)}),[l,d]),m.useEffect((function(){!f.current||""+b==""+u&&y===s||(h(),d&&v())}),[u,s,d]),i=function(){h()},m.useEffect((function(){return i}),[]),[v,h]),w=k(x,2),E=w[0],O=w[1];return m.useEffect((function(){if(n&&e.current)return E(),function(){O()}})),[e,r]};function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var H=r.ComponentBase.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return t.classNames("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return t.classNames("p-dialog-content",e.props.contentClassName)},footer:"p-dialog-footer",mask:function(e){var n=e.props,r=e.maskVisibleState,o=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===n.position||e.replace("-","")===n.position}));return t.classNames("p-dialog-mask",o?"p-dialog-".concat(o):"",{"p-component-overlay p-component-overlay-enter":n.modal,"p-dialog-visible":r,"p-dialog-draggable":n.draggable,"p-dialog-resizable":n.resizable},n.maskClassName)},root:function(e){var n=e.props,r=e.maximized,o=e.context;return t.classNames("p-dialog p-component",n.className,{"p-dialog-rtl":n.rtl,"p-dialog-maximized":r,"p-dialog-default":!r,"p-input-filled":o&&"filled"===o.inputStyle||"filled"===g.default.inputStyle,"p-ripple-disabled":o&&!1===o.ripple||!1===g.default.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px;\n left: 0px;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n",inlineStyles:{mask:function(e){var t=e.props;return R({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var T=m.forwardRef((function(e,p){var d=m.useContext(n.PrimeReactContext),b=H.getProps(e,d),w=b.id?b.id:t.UniqueComponentId(),E=k(m.useState(w),2),O=E[0],D=k(m.useState(!1),2),S=D[0],P=D[1],z=k(m.useState(!1),2),I=z[0],C=z[1],R=k(m.useState(b.maximized),2),N=R[0],T=R[1],B=m.useRef(null),U=m.useRef(null),X=m.useRef(null),_=m.useRef(null),q=m.useRef(null),L=m.useRef(null),A=m.useRef(null),Y=m.useRef(!1),V=m.useRef(!1),Z=m.useRef(null),F=m.useRef(null),J=m.useRef(null),W=m.useRef(w),$=m.useRef(null),K=b.onMaximize?b.maximized:N,G=I&&(b.blockScroll||b.maximizable&&K),Q=H.setMetaData(M(M({props:b},b.__parentMetadata),{},{state:{id:O,maximized:K,containerVisible:S}})),ee=Q.ptm,te=Q.cx,ne=Q.sx;r.useHandleStyle(H.css.styles,Q.isUnstyled,{name:"dialog"}),j(U,b.closable&&b.closeOnEscape,(function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length;ve(e),n.splice(r-1,1)}}));var re=k(i.useEventListener({type:"keydown",listener:function(e){return Ee(e)}}),2),oe=re[0],ie=re[1],ae=k(i.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ke(e)}}),2),le=ae[0],ce=ae[1],ue=k(i.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Ie(e)}}),2),se=ue[0],pe=ue[1],de=k(i.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return De(e)}}),2),me=de[0],ge=de[1],fe=k(i.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Se(e)}}),2),be=fe[0],ye=fe[1],ve=function(e){b.onHide(),e.preventDefault()},he=function(e){X.current=e.target,b.onPointerDown&&b.onPointerDown(e)},xe=function(e){b.dismissableMask&&b.modal&&U.current===e.target&&!X.current&&ve(e),b.onMaskClick&&b.onMaskClick(e),X.current=null},we=function(e){b.onMaximize?b.onMaximize({originalEvent:e,maximized:!K}):T((function(e){return!e})),e.preventDefault()},Ee=function(e){var n=e.currentTarget;if(n&&n.primeDialogParams){var r=n.primeDialogParams,o=r.length,i=r[o-1]?r[o-1].id:void 0;if(i===O){var a=document.getElementById(i);if("Tab"===e.key){e.preventDefault();var l=t.DomHandler.getFocusableElements(a);if(l&&l.length>0)if(document.activeElement){var c=l.indexOf(document.activeElement);e.shiftKey?-1===c||0===c?l[l.length-1].focus():l[c-1].focus():-1===c||c===l.length-1?l[0].focus():l[c+1].focus()}else l[0].focus()}}}},Oe=function(e){t.DomHandler.hasClass(e.target,"p-dialog-header-icon")||t.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||b.draggable&&(Y.current=!0,Z.current=e.pageX,F.current=e.pageY,B.current.style.margin="0",t.DomHandler.addClass(document.body,"p-unselectable-text"),b.onDragStart&&b.onDragStart(e))},De=function(e){if(Y.current){var n=t.DomHandler.getOuterWidth(B.current),r=t.DomHandler.getOuterHeight(B.current),o=e.pageX-Z.current,i=e.pageY-F.current,a=B.current.getBoundingClientRect(),l=a.left+o,c=a.top+i,u=t.DomHandler.getViewport(),s=getComputedStyle(B.current),p=parseFloat(s.marginLeft),d=parseFloat(s.marginTop);B.current.style.position="fixed",b.keepInViewport?(l>=b.minX&&l+n<u.width&&(Z.current=e.pageX,B.current.style.left=l-p+"px"),c>=b.minY&&c+r<u.height&&(F.current=e.pageY,B.current.style.top=c-d+"px")):(Z.current=e.pageX,B.current.style.left=l-p+"px",F.current=e.pageY,B.current.style.top=c-d+"px"),b.onDrag&&b.onDrag(e)}},Se=function(e){Y.current&&(Y.current=!1,t.DomHandler.removeClass(document.body,"p-unselectable-text"),b.onDragEnd&&b.onDragEnd(e))},Pe=function(e){b.resizable&&(V.current=!0,Z.current=e.pageX,F.current=e.pageY,t.DomHandler.addClass(document.body,"p-unselectable-text"),b.onResizeStart&&b.onResizeStart(e))},ze=function(e,n,r){!r&&(r=t.DomHandler.getViewport());var o=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?o*(r[n]/100):o},ke=function(e){if(V.current){var n=e.pageX-Z.current,r=e.pageY-F.current,o=t.DomHandler.getOuterWidth(B.current),i=t.DomHandler.getOuterHeight(B.current),a=B.current.getBoundingClientRect(),l=t.DomHandler.getViewport(),c=!parseInt(B.current.style.top)||!parseInt(B.current.style.left),u=ze(B.current.style.minWidth,"width",l),s=ze(B.current.style.minHeight,"height",l),p=o+n,d=i+r;c&&(p+=n,d+=r),(!u||p>u)&&a.left+p<l.width&&(B.current.style.width=p+"px"),(!s||d>s)&&a.top+d<l.height&&(B.current.style.height=d+"px"),Z.current=e.pageX,F.current=e.pageY,b.onResize&&b.onResize(e)}},Ie=function(e){V.current&&(V.current=!1,t.DomHandler.removeClass(document.body,"p-unselectable-text"),b.onResizeEnd&&b.onResizeEnd(e))},je=function(){B.current.style.position="",B.current.style.left="",B.current.style.top="",B.current.style.margin=""},Ce=function(){B.current.setAttribute(W.current,"")},Re=function(){var e;b.onShow&&b.onShow(),b.focusOnShow&&!((e=document.activeElement)&&B.current&&B.current.contains(e))&&b.closable&&b.showHeader&&A.current.focus(),Me()},He=function(){b.modal&&t.DomHandler.addClass(U.current,"p-component-overlay-leave")},Ne=function(){Y.current=!1,t.ZIndexUtils.clear(U.current),P(!1),Te(),t.DomHandler.focus($.current),$.current=null},Me=function(){Ue(),Be(!0)},Te=function(){Xe(),Be(!1)},Be=function(e){if(e){var n={id:O,hasBlockScroll:G};document.primeDialogParams||(document.primeDialogParams=[]);var r=document.primeDialogParams.findIndex((function(e){return e.id===O}));document.primeDialogParams=-1===r?[].concat(y(o=document.primeDialogParams)||v(o)||h(o)||x(),[n]):document.primeDialogParams.toSpliced(r,1,n)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==O}));var o;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?t.DomHandler.blockBodyScroll():t.DomHandler.unblockBodyScroll()},Ue=function(){b.draggable&&(me(),be()),b.resizable&&(le(),se()),oe()},Xe=function(){ge(),ye(),ce(),pe(),ie()},_e=function(){J.current=t.DomHandler.createInlineStyle(d&&d.nonce||g.default.nonce);var e="";for(var n in b.breakpoints)e+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(W.current,"] {\n width: ").concat(b.breakpoints[n],";\n }\n }\n ");J.current.innerHTML=e};i.useMountEffect((function(){b.visible&&P(!0),b.breakpoints&&_e()})),i.useUpdateEffect((function(){b.visible&&!S&&P(!0),b.visible!==I&&S&&C(b.visible),b.visible&&($.current=document.activeElement)}),[b.visible,S]),i.useUpdateEffect((function(){S&&(t.ZIndexUtils.set("modal",U.current,d&&d.autoZIndex||g.default.autoZIndex,b.baseZIndex||d&&d.zIndex.modal||g.default.zIndex.modal),C(!0))}),[S]),i.useUpdateEffect((function(){Be(!0)}),[G]),i.useUnmountEffect((function(){Te(),t.DomHandler.removeInlineStyle(J.current),t.ZIndexUtils.clear(U.current)})),m.useImperativeHandle(p,(function(){return{props:b,resetPosition:je,getElement:function(){return B.current},getMask:function(){return U.current},getContent:function(){return _.current},getHeader:function(){return q.current},getFooter:function(){return L.current},getCloseButton:function(){return A.current}}}));var qe,Le,Ae,Ye,Ve,Ze,Fe,Je,We,$e,Ke,Ge,Qe=function(){if(b.closable){var e=b.ariaCloseIconLabel||n.localeOption("close"),r=t.mergeProps({className:te("closeButtonIcon"),"aria-hidden":!0},ee("closeButtonIcon")),o=t.IconUtils.getJSXIcon(b.closeIcon||m.createElement(a.TimesIcon,r),M({},r),{props:b}),i=t.mergeProps({ref:A,type:"button",className:te("closeButton"),"aria-label":e,onClick:ve},ee("closeButton"));return m.createElement("button",i,o,m.createElement(s.Ripple,null))}return null},et=function(){var e=t.mergeProps({className:te("maximizableIcon")},ee("maximizableIcon")),n=t.IconUtils.getJSXIcon(K?b.minimizeIcon||m.createElement(c.WindowMinimizeIcon,e):b.maximizeIcon||m.createElement(l.WindowMaximizeIcon,e),e,{props:b});if(b.maximizable){var r=t.mergeProps({type:"button",className:te("maximizableButton"),onClick:we},ee("maximizableButton"));return m.createElement("button",r,n,m.createElement(s.Ripple,null))}return null},tt=function(){if(b.showHeader){var e=Qe(),n=et(),r=t.ObjectUtils.getJSXElement(b.icons,b),o=t.ObjectUtils.getJSXElement(b.header,b),i=O+"_header",a=t.mergeProps({ref:q,style:b.headerStyle,className:te("header"),onMouseDown:Oe},ee("header")),l=t.mergeProps({id:i,className:te("headerTitle")},ee("headerTitle")),c=t.mergeProps({className:te("headerIcons")},ee("headerIcons"));return m.createElement("div",a,m.createElement("div",l,o),m.createElement("div",c,r,n,e))}return null},nt=function(){var e=t.ObjectUtils.getJSXElement(b.footer,b),n=t.mergeProps({ref:L,className:te("footer")},ee("footer"));return e&&m.createElement("div",n,e)};return S&&(Le=tt(),qe=t.mergeProps({id:O+"_content",ref:_,style:b.contentStyle,className:te("content")},ee("content")),Ae=m.createElement("div",qe,b.children),Ye=nt(),Ve=b.resizable?m.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Pe}):null,Ze=O+"_header",Fe=O+"_content",Je={enter:"center"===b.position?150:300,exit:"center"===b.position?150:300},We=t.mergeProps({ref:U,style:ne("mask"),className:te("mask"),onPointerUp:xe},ee("mask")),$e=t.mergeProps({ref:B,id:O,className:te("root",{props:b,maximized:K,context:d}),style:b.style,onClick:b.onClick,role:"dialog","aria-labelledby":Ze,"aria-describedby":Fe,"aria-modal":b.modal,onPointerDown:he},H.getOtherProps(b),ee("root")),Ke=t.mergeProps({classNames:te("transition"),timeout:Je,in:I,options:b.transitionOptions,unmountOnExit:!0,onEnter:Ce,onEntered:Re,onExiting:He,onExited:Ne},ee("transition")),Ge=m.createElement("div",We,m.createElement(o.CSSTransition,f({nodeRef:B},Ke),m.createElement("div",$e,Le,Ae,Ye,Ve))),m.createElement(u.Portal,{element:Ge,appendTo:b.appendTo,visible:!0}))}));T.displayName="Dialog",exports.Dialog=T;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils"),n=require("primereact/api"),r=require("primereact/componentbase"),o=require("primereact/csstransition"),i=require("primereact/hooks"),a=require("primereact/icons/times"),l=require("primereact/icons/windowmaximize"),c=require("primereact/icons/windowminimize"),u=require("primereact/portal"),s=require("primereact/ripple");function p(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var m=d(e),g=p(n);function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},f.apply(this,arguments)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e){if(Array.isArray(e))return b(e)}function v(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function h(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function x(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}function E(e,t){if("object"!==w(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function O(e){var t=E(e,"string");return"symbol"===w(t)?t:String(t)}function D(e,t,n){return(t=O(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e){if(Array.isArray(e))return e}function P(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}function z(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(e,t){return S(e)||P(e,t)||h(e,t)||z()}var I=function(e){var n,r,o,i=e.target,a=void 0===i?"document":i,l=e.type,c=e.listener,u=e.options,s=e.when,p=void 0===s||s,d=m.useRef(null),g=m.useRef(null),f=(n=u,r=m.useRef(void 0),m.useEffect((function(){r.current=n})),r.current),b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.ObjectUtils.isNotEmpty(e.target)&&(y(),(e.when||p)&&(d.current=t.DomHandler.getTargetElement(e.target))),!g.current&&d.current&&(g.current=function(e){return c&&c(e)},d.current.addEventListener(l,g.current,u))},y=function(){g.current&&(d.current.removeEventListener(l,g.current,u),g.current=null)};return m.useEffect((function(){p?d.current=t.DomHandler.getTargetElement(a):(y(),d.current=null)}),[a,p]),m.useEffect((function(){!g.current||g.current===c&&f===u||(y(),p&&b())}),[c,u]),o=function(){y()},m.useEffect((function(){return o}),[]),[b,y]},j=function(e,t,n){var r=k(I({type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),n(e))}}),2),o=r[0],i=r[1];return m.useEffect((function(){if(t&&e.current)return o(),function(){i()}})),[e,n]};function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var H=r.ComponentBase.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return t.classNames("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return t.classNames("p-dialog-content",e.props.contentClassName)},footer:"p-dialog-footer",mask:function(e){var n=e.props,r=e.maskVisibleState,o=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===n.position||e.replace("-","")===n.position}));return t.classNames("p-dialog-mask",o?"p-dialog-".concat(o):"",{"p-component-overlay p-component-overlay-enter":n.modal,"p-dialog-visible":r,"p-dialog-draggable":n.draggable,"p-dialog-resizable":n.resizable},n.maskClassName)},root:function(e){var n=e.props,r=e.maximized,o=e.context;return t.classNames("p-dialog p-component",n.className,{"p-dialog-rtl":n.rtl,"p-dialog-maximized":r,"p-dialog-default":!r,"p-input-filled":o&&"filled"===o.inputStyle||"filled"===g.default.inputStyle,"p-ripple-disabled":o&&!1===o.ripple||!1===g.default.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px;\n left: 0px;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n",inlineStyles:{mask:function(e){var t=e.props;return R({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){D(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var T=m.forwardRef((function(e,p){var d=m.useContext(n.PrimeReactContext),b=H.getProps(e,d),w=b.id?b.id:t.UniqueComponentId(),E=k(m.useState(w),2),O=E[0],D=k(m.useState(!1),2),S=D[0],P=D[1],z=k(m.useState(!1),2),I=z[0],C=z[1],R=k(m.useState(b.maximized),2),N=R[0],T=R[1],B=m.useRef(null),U=m.useRef(null),X=m.useRef(null),_=m.useRef(null),q=m.useRef(null),L=m.useRef(null),A=m.useRef(null),Y=m.useRef(!1),V=m.useRef(!1),Z=m.useRef(null),F=m.useRef(null),J=m.useRef(null),W=m.useRef(w),$=m.useRef(null),K=b.onMaximize?b.maximized:N,G=I&&(b.blockScroll||b.maximizable&&K),Q=H.setMetaData(M(M({props:b},b.__parentMetadata),{},{state:{id:O,maximized:K,containerVisible:S}})),ee=Q.ptm,te=Q.cx,ne=Q.sx;r.useHandleStyle(H.css.styles,Q.isUnstyled,{name:"dialog"}),j(U,b.closable&&b.closeOnEscape,(function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length;ve(e),n.splice(r-1,1)}}));var re=k(i.useEventListener({type:"keydown",listener:function(e){return Ee(e)}}),2),oe=re[0],ie=re[1],ae=k(i.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ke(e)}}),2),le=ae[0],ce=ae[1],ue=k(i.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Ie(e)}}),2),se=ue[0],pe=ue[1],de=k(i.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return De(e)}}),2),me=de[0],ge=de[1],fe=k(i.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Se(e)}}),2),be=fe[0],ye=fe[1],ve=function(e){b.onHide(),e.preventDefault()},he=function(e){X.current=e.target,b.onPointerDown&&b.onPointerDown(e)},xe=function(e){b.dismissableMask&&b.modal&&U.current===e.target&&!X.current&&ve(e),b.onMaskClick&&b.onMaskClick(e),X.current=null},we=function(e){b.onMaximize?b.onMaximize({originalEvent:e,maximized:!K}):T((function(e){return!e})),e.preventDefault()},Ee=function(e){var n=e.currentTarget;if(n&&n.primeDialogParams){var r=n.primeDialogParams,o=r.length,i=r[o-1]?r[o-1].id:void 0;if(i===O){var a=document.getElementById(i);if("Tab"===e.key){e.preventDefault();var l=t.DomHandler.getFocusableElements(a);if(l&&l.length>0)if(document.activeElement){var c=l.indexOf(document.activeElement);e.shiftKey?-1===c||0===c?l[l.length-1].focus():l[c-1].focus():-1===c||c===l.length-1?l[0].focus():l[c+1].focus()}else l[0].focus()}}}},Oe=function(e){t.DomHandler.hasClass(e.target,"p-dialog-header-icon")||t.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||b.draggable&&(Y.current=!0,Z.current=e.pageX,F.current=e.pageY,B.current.style.margin="0",t.DomHandler.addClass(document.body,"p-unselectable-text"),b.onDragStart&&b.onDragStart(e))},De=function(e){if(Y.current){var n=t.DomHandler.getOuterWidth(B.current),r=t.DomHandler.getOuterHeight(B.current),o=e.pageX-Z.current,i=e.pageY-F.current,a=B.current.getBoundingClientRect(),l=a.left+o,c=a.top+i,u=t.DomHandler.getViewport(),s=getComputedStyle(B.current),p=parseFloat(s.marginLeft),d=parseFloat(s.marginTop);B.current.style.position="fixed",b.keepInViewport?(l>=b.minX&&l+n<u.width&&(Z.current=e.pageX,B.current.style.left=l-p+"px"),c>=b.minY&&c+r<u.height&&(F.current=e.pageY,B.current.style.top=c-d+"px")):(Z.current=e.pageX,B.current.style.left=l-p+"px",F.current=e.pageY,B.current.style.top=c-d+"px"),b.onDrag&&b.onDrag(e)}},Se=function(e){Y.current&&(Y.current=!1,t.DomHandler.removeClass(document.body,"p-unselectable-text"),b.onDragEnd&&b.onDragEnd(e))},Pe=function(e){b.resizable&&(V.current=!0,Z.current=e.pageX,F.current=e.pageY,t.DomHandler.addClass(document.body,"p-unselectable-text"),b.onResizeStart&&b.onResizeStart(e))},ze=function(e,n,r){!r&&(r=t.DomHandler.getViewport());var o=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?o*(r[n]/100):o},ke=function(e){if(V.current){var n=e.pageX-Z.current,r=e.pageY-F.current,o=t.DomHandler.getOuterWidth(B.current),i=t.DomHandler.getOuterHeight(B.current),a=B.current.getBoundingClientRect(),l=t.DomHandler.getViewport(),c=!parseInt(B.current.style.top)||!parseInt(B.current.style.left),u=ze(B.current.style.minWidth,"width",l),s=ze(B.current.style.minHeight,"height",l),p=o+n,d=i+r;c&&(p+=n,d+=r),(!u||p>u)&&a.left+p<l.width&&(B.current.style.width=p+"px"),(!s||d>s)&&a.top+d<l.height&&(B.current.style.height=d+"px"),Z.current=e.pageX,F.current=e.pageY,b.onResize&&b.onResize(e)}},Ie=function(e){V.current&&(V.current=!1,t.DomHandler.removeClass(document.body,"p-unselectable-text"),b.onResizeEnd&&b.onResizeEnd(e))},je=function(){B.current.style.position="",B.current.style.left="",B.current.style.top="",B.current.style.margin=""},Ce=function(){B.current.setAttribute(W.current,"")},Re=function(){var e;b.onShow&&b.onShow(),b.focusOnShow&&!((e=document.activeElement)&&B.current&&B.current.contains(e))&&b.closable&&b.showHeader&&A.current.focus(),Me()},He=function(){b.modal&&t.DomHandler.addClass(U.current,"p-component-overlay-leave")},Ne=function(){Y.current=!1,t.ZIndexUtils.clear(U.current),P(!1),Te(),t.DomHandler.focus($.current),$.current=null},Me=function(){Ue(),Be(!0)},Te=function(){Xe(),Be(!1)},Be=function(e){if(e){var n={id:O,hasBlockScroll:G};document.primeDialogParams||(document.primeDialogParams=[]);var r=document.primeDialogParams.findIndex((function(e){return e.id===O}));document.primeDialogParams=-1===r?[].concat(y(o=document.primeDialogParams)||v(o)||h(o)||x(),[n]):document.primeDialogParams.toSpliced(r,1,n)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==O}));var o;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?t.DomHandler.blockBodyScroll():t.DomHandler.unblockBodyScroll()},Ue=function(){b.draggable&&(me(),be()),b.resizable&&(le(),se()),oe()},Xe=function(){ge(),ye(),ce(),pe(),ie()},_e=function(){J.current=t.DomHandler.createInlineStyle(d&&d.nonce||g.default.nonce);var e="";for(var n in b.breakpoints)e+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(W.current,"] {\n width: ").concat(b.breakpoints[n],";\n }\n }\n ");J.current.innerHTML=e};i.useMountEffect((function(){b.visible&&P(!0),b.breakpoints&&_e()})),i.useUpdateEffect((function(){b.visible&&!S&&P(!0),b.visible!==I&&S&&C(b.visible),b.visible&&($.current=document.activeElement)}),[b.visible,S]),i.useUpdateEffect((function(){S&&(t.ZIndexUtils.set("modal",U.current,d&&d.autoZIndex||g.default.autoZIndex,b.baseZIndex||d&&d.zIndex.modal||g.default.zIndex.modal),C(!0))}),[S]),i.useUpdateEffect((function(){Be(!0)}),[G]),i.useUnmountEffect((function(){Te(),t.DomHandler.removeInlineStyle(J.current),t.ZIndexUtils.clear(U.current)})),m.useImperativeHandle(p,(function(){return{props:b,resetPosition:je,getElement:function(){return B.current},getMask:function(){return U.current},getContent:function(){return _.current},getHeader:function(){return q.current},getFooter:function(){return L.current},getCloseButton:function(){return A.current}}}));var qe,Le,Ae,Ye,Ve,Ze,Fe,Je,We,$e,Ke,Ge,Qe=function(){if(b.closable){var e=b.ariaCloseIconLabel||n.localeOption("close"),r=t.mergeProps({className:te("closeButtonIcon"),"aria-hidden":!0},ee("closeButtonIcon")),o=t.IconUtils.getJSXIcon(b.closeIcon||m.createElement(a.TimesIcon,r),M({},r),{props:b}),i=t.mergeProps({ref:A,type:"button",className:te("closeButton"),"aria-label":e,onClick:ve},ee("closeButton"));return m.createElement("button",i,o,m.createElement(s.Ripple,null))}return null},et=function(){var e=t.mergeProps({className:te("maximizableIcon")},ee("maximizableIcon")),n=t.IconUtils.getJSXIcon(K?b.minimizeIcon||m.createElement(c.WindowMinimizeIcon,e):b.maximizeIcon||m.createElement(l.WindowMaximizeIcon,e),e,{props:b});if(b.maximizable){var r=t.mergeProps({type:"button",className:te("maximizableButton"),onClick:we},ee("maximizableButton"));return m.createElement("button",r,n,m.createElement(s.Ripple,null))}return null},tt=function(){if(b.showHeader){var e=Qe(),n=et(),r=t.ObjectUtils.getJSXElement(b.icons,b),o=t.ObjectUtils.getJSXElement(b.header,b),i=O+"_header",a=t.mergeProps({ref:q,style:b.headerStyle,className:te("header"),onMouseDown:Oe},ee("header")),l=t.mergeProps({id:i,className:te("headerTitle")},ee("headerTitle")),c=t.mergeProps({className:te("headerIcons")},ee("headerIcons"));return m.createElement("div",a,m.createElement("div",l,o),m.createElement("div",c,r,n,e))}return null},nt=function(){var e=t.ObjectUtils.getJSXElement(b.footer,b),n=t.mergeProps({ref:L,className:te("footer")},ee("footer"));return e&&m.createElement("div",n,e)};return S&&(Le=tt(),qe=t.mergeProps({id:O+"_content",ref:_,style:b.contentStyle,className:te("content")},ee("content")),Ae=m.createElement("div",qe,b.children),Ye=nt(),Ve=b.resizable?m.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Pe}):null,Ze=O+"_header",Fe=O+"_content",Je={enter:"center"===b.position?150:300,exit:"center"===b.position?150:300},We=t.mergeProps({ref:U,style:ne("mask"),className:te("mask"),onPointerUp:xe},ee("mask")),$e=t.mergeProps({ref:B,id:O,className:te("root",{props:b,maximized:K,context:d}),style:b.style,onClick:b.onClick,role:"dialog","aria-labelledby":Ze,"aria-describedby":Fe,"aria-modal":b.modal,onPointerDown:he},H.getOtherProps(b),ee("root")),Ke=t.mergeProps({classNames:te("transition"),timeout:Je,in:I,options:b.transitionOptions,unmountOnExit:!0,onEnter:Ce,onEntered:Re,onExiting:He,onExited:Ne},ee("transition")),Ge=m.createElement("div",We,m.createElement(o.CSSTransition,f({nodeRef:B},Ke),m.createElement("div",$e,Le,Ae,Ye,Ve))),m.createElement(u.Portal,{element:Ge,appendTo:b.appendTo,visible:!0}))}));T.displayName="Dialog",exports.Dialog=T;
@@ -165,7 +165,6 @@ var useEventListener = function useEventListener(_ref) {
165
165
  when = _ref$when === void 0 ? true : _ref$when;
166
166
  var targetRef = React.useRef(null);
167
167
  var listenerRef = React.useRef(null);
168
- var prevListener = usePrevious(listener);
169
168
  var prevOptions = usePrevious(options);
170
169
  var bind = function bind() {
171
170
  var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -195,12 +194,11 @@ var useEventListener = function useEventListener(_ref) {
195
194
  }
196
195
  }, [target, when]);
197
196
  React.useEffect(function () {
198
- // to properly compare functions we can implicitly converting the function to it's body's text as a String
199
- if (listenerRef.current && ('' + prevListener !== '' + listener || prevOptions !== options)) {
197
+ if (listenerRef.current && (listenerRef.current !== listener || prevOptions !== options)) {
200
198
  unbind();
201
199
  when && bind();
202
200
  }
203
- }, [listener, options, when]);
201
+ }, [listener, options]);
204
202
  useUnmountEffect(function () {
205
203
  unbind();
206
204
  });
@@ -1 +1 @@
1
- import*as e from"react";import{DomHandler as t,ObjectUtils as n,classNames as r,UniqueComponentId as o,ZIndexUtils as i,mergeProps as a,IconUtils as l}from"primereact/utils";import c,{PrimeReactContext as u,localeOption as s}from"primereact/api";import{ComponentBase as p,useHandleStyle as d}from"primereact/componentbase";import{CSSTransition as m}from"primereact/csstransition";import{useEventListener as g,useMountEffect as f,useUpdateEffect as b,useUnmountEffect as y}from"primereact/hooks";import{TimesIcon as h}from"primereact/icons/times";import{WindowMaximizeIcon as v}from"primereact/icons/windowmaximize";import{WindowMinimizeIcon as x}from"primereact/icons/windowminimize";import{Portal as w}from"primereact/portal";import{Ripple as E}from"primereact/ripple";function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(this,arguments)}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e){if(Array.isArray(e))return z(e)}function k(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function P(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}function D(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function j(e,t){if("object"!==I(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function C(e){var t=j(e,"string");return"symbol"===I(t)?t:String(t)}function R(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){if(Array.isArray(e))return e}function B(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function M(e,t){return N(e)||B(e,t)||P(e,t)||T()}var X=function(t){var n=e.useRef(void 0);return e.useEffect((function(){n.current=t})),n.current},A=function(r,o,i){var a,l,c,u,s,p,d,m,g,f,b,y,h,v,x,w=(u=void 0===(c=(a={type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),i(e))}}).target)?"document":c,s=a.type,p=a.listener,d=a.options,g=void 0===(m=a.when)||m,f=e.useRef(null),b=e.useRef(null),y=X(p),h=X(d),v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.isNotEmpty(e.target)&&(x(),(e.when||g)&&(f.current=t.getTargetElement(e.target))),!b.current&&f.current&&(b.current=function(e){return p&&p(e)},f.current.addEventListener(s,b.current,d))},x=function(){b.current&&(f.current.removeEventListener(s,b.current,d),b.current=null)},e.useEffect((function(){g?f.current=t.getTargetElement(u):(x(),f.current=null)}),[u,g]),e.useEffect((function(){!b.current||""+y==""+p&&h===d||(x(),g&&v())}),[p,d,g]),l=function(){x()},e.useEffect((function(){return l}),[]),[v,x]),E=M(w,2),S=E[0],z=E[1];return e.useEffect((function(){if(o&&r.current)return S(),function(){z()}})),[r,i]};function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _=p.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return r("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return r("p-dialog-content",e.props.contentClassName)},footer:"p-dialog-footer",mask:function(e){var t=e.props,n=e.maskVisibleState,o=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return r("p-dialog-mask",o?"p-dialog-".concat(o):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.props,n=e.maximized,o=e.context;return r("p-dialog p-component",t.className,{"p-dialog-rtl":t.rtl,"p-dialog-maximized":n,"p-dialog-default":!n,"p-input-filled":o&&"filled"===o.inputStyle||"filled"===c.inputStyle,"p-ripple-disabled":o&&!1===o.ripple||!1===c.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px;\n left: 0px;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n",inlineStyles:{mask:function(e){var t=e.props;return Y({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F=e.forwardRef((function(r,p){var z=e.useContext(u),I=_.getProps(r,z),j=I.id?I.id:o(),C=M(e.useState(j),2),R=C[0],N=M(e.useState(!1),2),B=N[0],T=N[1],X=M(e.useState(!1),2),H=X[0],Y=X[1],L=M(e.useState(I.maximized),2),F=L[0],J=L[1],U=e.useRef(null),Z=e.useRef(null),W=e.useRef(null),$=e.useRef(null),K=e.useRef(null),q=e.useRef(null),G=e.useRef(null),Q=e.useRef(!1),ee=e.useRef(!1),te=e.useRef(null),ne=e.useRef(null),re=e.useRef(null),oe=e.useRef(j),ie=e.useRef(null),ae=I.onMaximize?I.maximized:F,le=H&&(I.blockScroll||I.maximizable&&ae),ce=_.setMetaData(V(V({props:I},I.__parentMetadata),{},{state:{id:R,maximized:ae,containerVisible:B}})),ue=ce.ptm,se=ce.cx,pe=ce.sx;d(_.css.styles,ce.isUnstyled,{name:"dialog"}),A(Z,I.closable&&I.closeOnEscape,(function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length;Pe(e),n.splice(r-1,1)}}));var de=M(g({type:"keydown",listener:function(e){return Ce(e)}}),2),me=de[0],ge=de[1],fe=M(g({type:"mousemove",target:function(){return window.document},listener:function(e){return Xe(e)}}),2),be=fe[0],ye=fe[1],he=M(g({type:"mouseup",target:function(){return window.document},listener:function(e){return Ae(e)}}),2),ve=he[0],xe=he[1],we=M(g({type:"mousemove",target:function(){return window.document},listener:function(e){return Ne(e)}}),2),Ee=we[0],Se=we[1],ze=M(g({type:"mouseup",target:function(){return window.document},listener:function(e){return Be(e)}}),2),Oe=ze[0],ke=ze[1],Pe=function(e){I.onHide(),e.preventDefault()},De=function(e){W.current=e.target,I.onPointerDown&&I.onPointerDown(e)},Ie=function(e){I.dismissableMask&&I.modal&&Z.current===e.target&&!W.current&&Pe(e),I.onMaskClick&&I.onMaskClick(e),W.current=null},je=function(e){I.onMaximize?I.onMaximize({originalEvent:e,maximized:!ae}):J((function(e){return!e})),e.preventDefault()},Ce=function(e){var n=e.currentTarget;if(n&&n.primeDialogParams){var r=n.primeDialogParams,o=r.length,i=r[o-1]?r[o-1].id:void 0;if(i===R){var a=document.getElementById(i);if("Tab"===e.key){e.preventDefault();var l=t.getFocusableElements(a);if(l&&l.length>0)if(document.activeElement){var c=l.indexOf(document.activeElement);e.shiftKey?-1===c||0===c?l[l.length-1].focus():l[c-1].focus():-1===c||c===l.length-1?l[0].focus():l[c+1].focus()}else l[0].focus()}}}},Re=function(e){t.hasClass(e.target,"p-dialog-header-icon")||t.hasClass(e.target.parentElement,"p-dialog-header-icon")||I.draggable&&(Q.current=!0,te.current=e.pageX,ne.current=e.pageY,U.current.style.margin="0",t.addClass(document.body,"p-unselectable-text"),I.onDragStart&&I.onDragStart(e))},Ne=function(e){if(Q.current){var n=t.getOuterWidth(U.current),r=t.getOuterHeight(U.current),o=e.pageX-te.current,i=e.pageY-ne.current,a=U.current.getBoundingClientRect(),l=a.left+o,c=a.top+i,u=t.getViewport(),s=getComputedStyle(U.current),p=parseFloat(s.marginLeft),d=parseFloat(s.marginTop);U.current.style.position="fixed",I.keepInViewport?(l>=I.minX&&l+n<u.width&&(te.current=e.pageX,U.current.style.left=l-p+"px"),c>=I.minY&&c+r<u.height&&(ne.current=e.pageY,U.current.style.top=c-d+"px")):(te.current=e.pageX,U.current.style.left=l-p+"px",ne.current=e.pageY,U.current.style.top=c-d+"px"),I.onDrag&&I.onDrag(e)}},Be=function(e){Q.current&&(Q.current=!1,t.removeClass(document.body,"p-unselectable-text"),I.onDragEnd&&I.onDragEnd(e))},Te=function(e){I.resizable&&(ee.current=!0,te.current=e.pageX,ne.current=e.pageY,t.addClass(document.body,"p-unselectable-text"),I.onResizeStart&&I.onResizeStart(e))},Me=function(e,n,r){!r&&(r=t.getViewport());var o=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?o*(r[n]/100):o},Xe=function(e){if(ee.current){var n=e.pageX-te.current,r=e.pageY-ne.current,o=t.getOuterWidth(U.current),i=t.getOuterHeight(U.current),a=U.current.getBoundingClientRect(),l=t.getViewport(),c=!parseInt(U.current.style.top)||!parseInt(U.current.style.left),u=Me(U.current.style.minWidth,"width",l),s=Me(U.current.style.minHeight,"height",l),p=o+n,d=i+r;c&&(p+=n,d+=r),(!u||p>u)&&a.left+p<l.width&&(U.current.style.width=p+"px"),(!s||d>s)&&a.top+d<l.height&&(U.current.style.height=d+"px"),te.current=e.pageX,ne.current=e.pageY,I.onResize&&I.onResize(e)}},Ae=function(e){ee.current&&(ee.current=!1,t.removeClass(document.body,"p-unselectable-text"),I.onResizeEnd&&I.onResizeEnd(e))},He=function(){U.current.style.position="",U.current.style.left="",U.current.style.top="",U.current.style.margin=""},Ye=function(){U.current.setAttribute(oe.current,"")},_e=function(){var e;I.onShow&&I.onShow(),I.focusOnShow&&!((e=document.activeElement)&&U.current&&U.current.contains(e))&&I.closable&&I.showHeader&&G.current.focus(),Fe()},Le=function(){I.modal&&t.addClass(Z.current,"p-component-overlay-leave")},Ve=function(){Q.current=!1,i.clear(Z.current),T(!1),Je(),t.focus(ie.current),ie.current=null},Fe=function(){Ze(),Ue(!0)},Je=function(){We(),Ue(!1)},Ue=function(e){if(e){var n={id:R,hasBlockScroll:le};document.primeDialogParams||(document.primeDialogParams=[]);var r=document.primeDialogParams.findIndex((function(e){return e.id===R}));document.primeDialogParams=-1===r?[].concat(O(o=document.primeDialogParams)||k(o)||P(o)||D(),[n]):document.primeDialogParams.toSpliced(r,1,n)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==R}));var o;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?t.blockBodyScroll():t.unblockBodyScroll()},Ze=function(){I.draggable&&(Ee(),Oe()),I.resizable&&(be(),ve()),me()},We=function(){Se(),ke(),ye(),xe(),ge()},$e=function(){re.current=t.createInlineStyle(z&&z.nonce||c.nonce);var e="";for(var n in I.breakpoints)e+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(oe.current,"] {\n width: ").concat(I.breakpoints[n],";\n }\n }\n ");re.current.innerHTML=e};f((function(){I.visible&&T(!0),I.breakpoints&&$e()})),b((function(){I.visible&&!B&&T(!0),I.visible!==H&&B&&Y(I.visible),I.visible&&(ie.current=document.activeElement)}),[I.visible,B]),b((function(){B&&(i.set("modal",Z.current,z&&z.autoZIndex||c.autoZIndex,I.baseZIndex||z&&z.zIndex.modal||c.zIndex.modal),Y(!0))}),[B]),b((function(){Ue(!0)}),[le]),y((function(){Je(),t.removeInlineStyle(re.current),i.clear(Z.current)})),e.useImperativeHandle(p,(function(){return{props:I,resetPosition:He,getElement:function(){return U.current},getMask:function(){return Z.current},getContent:function(){return $.current},getHeader:function(){return K.current},getFooter:function(){return q.current},getCloseButton:function(){return G.current}}}));var Ke,qe,Ge,Qe,et,tt,nt,rt,ot,it,at,lt,ct=function(){if(I.closable){var t=I.ariaCloseIconLabel||s("close"),n=a({className:se("closeButtonIcon"),"aria-hidden":!0},ue("closeButtonIcon")),r=l.getJSXIcon(I.closeIcon||e.createElement(h,n),V({},n),{props:I}),o=a({ref:G,type:"button",className:se("closeButton"),"aria-label":t,onClick:Pe},ue("closeButton"));return e.createElement("button",o,r,e.createElement(E,null))}return null},ut=function(){var t=a({className:se("maximizableIcon")},ue("maximizableIcon")),n=l.getJSXIcon(ae?I.minimizeIcon||e.createElement(x,t):I.maximizeIcon||e.createElement(v,t),t,{props:I});if(I.maximizable){var r=a({type:"button",className:se("maximizableButton"),onClick:je},ue("maximizableButton"));return e.createElement("button",r,n,e.createElement(E,null))}return null},st=function(){if(I.showHeader){var t=ct(),r=ut(),o=n.getJSXElement(I.icons,I),i=n.getJSXElement(I.header,I),l=R+"_header",c=a({ref:K,style:I.headerStyle,className:se("header"),onMouseDown:Re},ue("header")),u=a({id:l,className:se("headerTitle")},ue("headerTitle")),s=a({className:se("headerIcons")},ue("headerIcons"));return e.createElement("div",c,e.createElement("div",u,i),e.createElement("div",s,o,r,t))}return null},pt=function(){var t=n.getJSXElement(I.footer,I),r=a({ref:q,className:se("footer")},ue("footer"));return t&&e.createElement("div",r,t)};return B&&(qe=st(),Ke=a({id:R+"_content",ref:$,style:I.contentStyle,className:se("content")},ue("content")),Ge=e.createElement("div",Ke,I.children),Qe=pt(),et=I.resizable?e.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Te}):null,tt=R+"_header",nt=R+"_content",rt={enter:"center"===I.position?150:300,exit:"center"===I.position?150:300},ot=a({ref:Z,style:pe("mask"),className:se("mask"),onPointerUp:Ie},ue("mask")),it=a({ref:U,id:R,className:se("root",{props:I,maximized:ae,context:z}),style:I.style,onClick:I.onClick,role:"dialog","aria-labelledby":tt,"aria-describedby":nt,"aria-modal":I.modal,onPointerDown:De},_.getOtherProps(I),ue("root")),at=a({classNames:se("transition"),timeout:rt,in:H,options:I.transitionOptions,unmountOnExit:!0,onEnter:Ye,onEntered:_e,onExiting:Le,onExited:Ve},ue("transition")),lt=e.createElement("div",ot,e.createElement(m,S({nodeRef:U},at),e.createElement("div",it,qe,Ge,Qe,et))),e.createElement(w,{element:lt,appendTo:I.appendTo,visible:!0}))}));F.displayName="Dialog";export{F as Dialog};
1
+ import*as e from"react";import{DomHandler as t,ObjectUtils as n,classNames as r,UniqueComponentId as o,ZIndexUtils as i,mergeProps as a,IconUtils as l}from"primereact/utils";import c,{PrimeReactContext as u,localeOption as s}from"primereact/api";import{ComponentBase as p,useHandleStyle as d}from"primereact/componentbase";import{CSSTransition as m}from"primereact/csstransition";import{useEventListener as g,useMountEffect as f,useUpdateEffect as b,useUnmountEffect as y}from"primereact/hooks";import{TimesIcon as h}from"primereact/icons/times";import{WindowMaximizeIcon as v}from"primereact/icons/windowmaximize";import{WindowMinimizeIcon as x}from"primereact/icons/windowminimize";import{Portal as w}from"primereact/portal";import{Ripple as E}from"primereact/ripple";function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(this,arguments)}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function O(e){if(Array.isArray(e))return z(e)}function k(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function P(e,t){if(e){if("string"==typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}function D(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function j(e,t){if("object"!==I(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==I(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function C(e){var t=j(e,"string");return"symbol"===I(t)?t:String(t)}function R(e,t,n){return(t=C(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){if(Array.isArray(e))return e}function B(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}function T(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function M(e,t){return N(e)||B(e,t)||P(e,t)||T()}var X=function(r){var o,i,a,l=r.target,c=void 0===l?"document":l,u=r.type,s=r.listener,p=r.options,d=r.when,m=void 0===d||d,g=e.useRef(null),f=e.useRef(null),b=(o=p,i=e.useRef(void 0),e.useEffect((function(){i.current=o})),i.current),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.isNotEmpty(e.target)&&(h(),(e.when||m)&&(g.current=t.getTargetElement(e.target))),!f.current&&g.current&&(f.current=function(e){return s&&s(e)},g.current.addEventListener(u,f.current,p))},h=function(){f.current&&(g.current.removeEventListener(u,f.current,p),f.current=null)};return e.useEffect((function(){m?g.current=t.getTargetElement(c):(h(),g.current=null)}),[c,m]),e.useEffect((function(){!f.current||f.current===s&&b===p||(h(),m&&y())}),[s,p]),a=function(){h()},e.useEffect((function(){return a}),[]),[y,h]},A=function(t,n,r){var o=M(X({type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),r(e))}}),2),i=o[0],a=o[1];return e.useEffect((function(){if(n&&t.current)return i(),function(){a()}})),[t,r]};function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var _=p.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return r("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return r("p-dialog-content",e.props.contentClassName)},footer:"p-dialog-footer",mask:function(e){var t=e.props,n=e.maskVisibleState,o=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return r("p-dialog-mask",o?"p-dialog-".concat(o):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":n,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.props,n=e.maximized,o=e.context;return r("p-dialog p-component",t.className,{"p-dialog-rtl":t.rtl,"p-dialog-maximized":n,"p-dialog-default":!n,"p-input-filled":o&&"filled"===o.inputStyle||"filled"===c.inputStyle,"p-ripple-disabled":o&&!1===o.ripple||!1===c.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px;\n left: 0px;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n",inlineStyles:{mask:function(e){var t=e.props;return Y({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function L(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(Object(n),!0).forEach((function(t){R(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F=e.forwardRef((function(r,p){var z=e.useContext(u),I=_.getProps(r,z),j=I.id?I.id:o(),C=M(e.useState(j),2),R=C[0],N=M(e.useState(!1),2),B=N[0],T=N[1],X=M(e.useState(!1),2),H=X[0],Y=X[1],L=M(e.useState(I.maximized),2),F=L[0],J=L[1],U=e.useRef(null),Z=e.useRef(null),W=e.useRef(null),$=e.useRef(null),K=e.useRef(null),q=e.useRef(null),G=e.useRef(null),Q=e.useRef(!1),ee=e.useRef(!1),te=e.useRef(null),ne=e.useRef(null),re=e.useRef(null),oe=e.useRef(j),ie=e.useRef(null),ae=I.onMaximize?I.maximized:F,le=H&&(I.blockScroll||I.maximizable&&ae),ce=_.setMetaData(V(V({props:I},I.__parentMetadata),{},{state:{id:R,maximized:ae,containerVisible:B}})),ue=ce.ptm,se=ce.cx,pe=ce.sx;d(_.css.styles,ce.isUnstyled,{name:"dialog"}),A(Z,I.closable&&I.closeOnEscape,(function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length;Pe(e),n.splice(r-1,1)}}));var de=M(g({type:"keydown",listener:function(e){return Ce(e)}}),2),me=de[0],ge=de[1],fe=M(g({type:"mousemove",target:function(){return window.document},listener:function(e){return Xe(e)}}),2),be=fe[0],ye=fe[1],he=M(g({type:"mouseup",target:function(){return window.document},listener:function(e){return Ae(e)}}),2),ve=he[0],xe=he[1],we=M(g({type:"mousemove",target:function(){return window.document},listener:function(e){return Ne(e)}}),2),Ee=we[0],Se=we[1],ze=M(g({type:"mouseup",target:function(){return window.document},listener:function(e){return Be(e)}}),2),Oe=ze[0],ke=ze[1],Pe=function(e){I.onHide(),e.preventDefault()},De=function(e){W.current=e.target,I.onPointerDown&&I.onPointerDown(e)},Ie=function(e){I.dismissableMask&&I.modal&&Z.current===e.target&&!W.current&&Pe(e),I.onMaskClick&&I.onMaskClick(e),W.current=null},je=function(e){I.onMaximize?I.onMaximize({originalEvent:e,maximized:!ae}):J((function(e){return!e})),e.preventDefault()},Ce=function(e){var n=e.currentTarget;if(n&&n.primeDialogParams){var r=n.primeDialogParams,o=r.length,i=r[o-1]?r[o-1].id:void 0;if(i===R){var a=document.getElementById(i);if("Tab"===e.key){e.preventDefault();var l=t.getFocusableElements(a);if(l&&l.length>0)if(document.activeElement){var c=l.indexOf(document.activeElement);e.shiftKey?-1===c||0===c?l[l.length-1].focus():l[c-1].focus():-1===c||c===l.length-1?l[0].focus():l[c+1].focus()}else l[0].focus()}}}},Re=function(e){t.hasClass(e.target,"p-dialog-header-icon")||t.hasClass(e.target.parentElement,"p-dialog-header-icon")||I.draggable&&(Q.current=!0,te.current=e.pageX,ne.current=e.pageY,U.current.style.margin="0",t.addClass(document.body,"p-unselectable-text"),I.onDragStart&&I.onDragStart(e))},Ne=function(e){if(Q.current){var n=t.getOuterWidth(U.current),r=t.getOuterHeight(U.current),o=e.pageX-te.current,i=e.pageY-ne.current,a=U.current.getBoundingClientRect(),l=a.left+o,c=a.top+i,u=t.getViewport(),s=getComputedStyle(U.current),p=parseFloat(s.marginLeft),d=parseFloat(s.marginTop);U.current.style.position="fixed",I.keepInViewport?(l>=I.minX&&l+n<u.width&&(te.current=e.pageX,U.current.style.left=l-p+"px"),c>=I.minY&&c+r<u.height&&(ne.current=e.pageY,U.current.style.top=c-d+"px")):(te.current=e.pageX,U.current.style.left=l-p+"px",ne.current=e.pageY,U.current.style.top=c-d+"px"),I.onDrag&&I.onDrag(e)}},Be=function(e){Q.current&&(Q.current=!1,t.removeClass(document.body,"p-unselectable-text"),I.onDragEnd&&I.onDragEnd(e))},Te=function(e){I.resizable&&(ee.current=!0,te.current=e.pageX,ne.current=e.pageY,t.addClass(document.body,"p-unselectable-text"),I.onResizeStart&&I.onResizeStart(e))},Me=function(e,n,r){!r&&(r=t.getViewport());var o=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?o*(r[n]/100):o},Xe=function(e){if(ee.current){var n=e.pageX-te.current,r=e.pageY-ne.current,o=t.getOuterWidth(U.current),i=t.getOuterHeight(U.current),a=U.current.getBoundingClientRect(),l=t.getViewport(),c=!parseInt(U.current.style.top)||!parseInt(U.current.style.left),u=Me(U.current.style.minWidth,"width",l),s=Me(U.current.style.minHeight,"height",l),p=o+n,d=i+r;c&&(p+=n,d+=r),(!u||p>u)&&a.left+p<l.width&&(U.current.style.width=p+"px"),(!s||d>s)&&a.top+d<l.height&&(U.current.style.height=d+"px"),te.current=e.pageX,ne.current=e.pageY,I.onResize&&I.onResize(e)}},Ae=function(e){ee.current&&(ee.current=!1,t.removeClass(document.body,"p-unselectable-text"),I.onResizeEnd&&I.onResizeEnd(e))},He=function(){U.current.style.position="",U.current.style.left="",U.current.style.top="",U.current.style.margin=""},Ye=function(){U.current.setAttribute(oe.current,"")},_e=function(){var e;I.onShow&&I.onShow(),I.focusOnShow&&!((e=document.activeElement)&&U.current&&U.current.contains(e))&&I.closable&&I.showHeader&&G.current.focus(),Fe()},Le=function(){I.modal&&t.addClass(Z.current,"p-component-overlay-leave")},Ve=function(){Q.current=!1,i.clear(Z.current),T(!1),Je(),t.focus(ie.current),ie.current=null},Fe=function(){Ze(),Ue(!0)},Je=function(){We(),Ue(!1)},Ue=function(e){if(e){var n={id:R,hasBlockScroll:le};document.primeDialogParams||(document.primeDialogParams=[]);var r=document.primeDialogParams.findIndex((function(e){return e.id===R}));document.primeDialogParams=-1===r?[].concat(O(o=document.primeDialogParams)||k(o)||P(o)||D(),[n]):document.primeDialogParams.toSpliced(r,1,n)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==R}));var o;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?t.blockBodyScroll():t.unblockBodyScroll()},Ze=function(){I.draggable&&(Ee(),Oe()),I.resizable&&(be(),ve()),me()},We=function(){Se(),ke(),ye(),xe(),ge()},$e=function(){re.current=t.createInlineStyle(z&&z.nonce||c.nonce);var e="";for(var n in I.breakpoints)e+="\n @media screen and (max-width: ".concat(n,") {\n .p-dialog[").concat(oe.current,"] {\n width: ").concat(I.breakpoints[n],";\n }\n }\n ");re.current.innerHTML=e};f((function(){I.visible&&T(!0),I.breakpoints&&$e()})),b((function(){I.visible&&!B&&T(!0),I.visible!==H&&B&&Y(I.visible),I.visible&&(ie.current=document.activeElement)}),[I.visible,B]),b((function(){B&&(i.set("modal",Z.current,z&&z.autoZIndex||c.autoZIndex,I.baseZIndex||z&&z.zIndex.modal||c.zIndex.modal),Y(!0))}),[B]),b((function(){Ue(!0)}),[le]),y((function(){Je(),t.removeInlineStyle(re.current),i.clear(Z.current)})),e.useImperativeHandle(p,(function(){return{props:I,resetPosition:He,getElement:function(){return U.current},getMask:function(){return Z.current},getContent:function(){return $.current},getHeader:function(){return K.current},getFooter:function(){return q.current},getCloseButton:function(){return G.current}}}));var Ke,qe,Ge,Qe,et,tt,nt,rt,ot,it,at,lt,ct=function(){if(I.closable){var t=I.ariaCloseIconLabel||s("close"),n=a({className:se("closeButtonIcon"),"aria-hidden":!0},ue("closeButtonIcon")),r=l.getJSXIcon(I.closeIcon||e.createElement(h,n),V({},n),{props:I}),o=a({ref:G,type:"button",className:se("closeButton"),"aria-label":t,onClick:Pe},ue("closeButton"));return e.createElement("button",o,r,e.createElement(E,null))}return null},ut=function(){var t=a({className:se("maximizableIcon")},ue("maximizableIcon")),n=l.getJSXIcon(ae?I.minimizeIcon||e.createElement(x,t):I.maximizeIcon||e.createElement(v,t),t,{props:I});if(I.maximizable){var r=a({type:"button",className:se("maximizableButton"),onClick:je},ue("maximizableButton"));return e.createElement("button",r,n,e.createElement(E,null))}return null},st=function(){if(I.showHeader){var t=ct(),r=ut(),o=n.getJSXElement(I.icons,I),i=n.getJSXElement(I.header,I),l=R+"_header",c=a({ref:K,style:I.headerStyle,className:se("header"),onMouseDown:Re},ue("header")),u=a({id:l,className:se("headerTitle")},ue("headerTitle")),s=a({className:se("headerIcons")},ue("headerIcons"));return e.createElement("div",c,e.createElement("div",u,i),e.createElement("div",s,o,r,t))}return null},pt=function(){var t=n.getJSXElement(I.footer,I),r=a({ref:q,className:se("footer")},ue("footer"));return t&&e.createElement("div",r,t)};return B&&(qe=st(),Ke=a({id:R+"_content",ref:$,style:I.contentStyle,className:se("content")},ue("content")),Ge=e.createElement("div",Ke,I.children),Qe=pt(),et=I.resizable?e.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Te}):null,tt=R+"_header",nt=R+"_content",rt={enter:"center"===I.position?150:300,exit:"center"===I.position?150:300},ot=a({ref:Z,style:pe("mask"),className:se("mask"),onPointerUp:Ie},ue("mask")),it=a({ref:U,id:R,className:se("root",{props:I,maximized:ae,context:z}),style:I.style,onClick:I.onClick,role:"dialog","aria-labelledby":tt,"aria-describedby":nt,"aria-modal":I.modal,onPointerDown:De},_.getOtherProps(I),ue("root")),at=a({classNames:se("transition"),timeout:rt,in:H,options:I.transitionOptions,unmountOnExit:!0,onEnter:Ye,onEntered:_e,onExiting:Le,onExited:Ve},ue("transition")),lt=e.createElement("div",ot,e.createElement(m,S({nodeRef:U},at),e.createElement("div",it,qe,Ge,Qe,et))),e.createElement(w,{element:lt,appendTo:I.appendTo,visible:!0}))}));F.displayName="Dialog";export{F as Dialog};
package/dialog/dialog.js CHANGED
@@ -179,7 +179,6 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
179
179
  when = _ref$when === void 0 ? true : _ref$when;
180
180
  var targetRef = React__namespace.useRef(null);
181
181
  var listenerRef = React__namespace.useRef(null);
182
- var prevListener = usePrevious(listener);
183
182
  var prevOptions = usePrevious(options);
184
183
  var bind = function bind() {
185
184
  var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -209,12 +208,11 @@ this.primereact.dialog = (function (exports, React, utils, PrimeReact, component
209
208
  }
210
209
  }, [target, when]);
211
210
  React__namespace.useEffect(function () {
212
- // to properly compare functions we can implicitly converting the function to it's body's text as a String
213
- if (listenerRef.current && ('' + prevListener !== '' + listener || prevOptions !== options)) {
211
+ if (listenerRef.current && (listenerRef.current !== listener || prevOptions !== options)) {
214
212
  unbind();
215
213
  when && bind();
216
214
  }
217
- }, [listener, options, when]);
215
+ }, [listener, options]);
218
216
  useUnmountEffect(function () {
219
217
  unbind();
220
218
  });
@@ -1 +1 @@
1
- this.primereact=this.primereact||{},this.primereact.dialog=function(e,t,n,r,o,i,a,l,c,s,u,p){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var g=m(t),f=d(r);function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b.apply(this,arguments)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e){if(Array.isArray(e))return y(e)}function h(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function x(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}function w(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function O(e,t){if("object"!==E(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function D(e){var t=O(e,"string");return"symbol"===E(t)?t:String(t)}function S(e,t,n){return(t=D(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){if(Array.isArray(e))return e}function z(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}function k(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e,t){return P(e)||z(e,t)||x(e,t)||k()}var j=function(e){var t=g.useRef(void 0);return g.useEffect((function(){t.current=e})),t.current},C=function(e,t,r){var o,i,a,l,c,s,u,p,d,m,f,b,y,v,h,x=(l=void 0===(a=(o={type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),r(e))}}).target)?"document":a,c=o.type,s=o.listener,u=o.options,d=void 0===(p=o.when)||p,m=g.useRef(null),f=g.useRef(null),b=j(s),y=j(u),v=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.ObjectUtils.isNotEmpty(e.target)&&(h(),(e.when||d)&&(m.current=n.DomHandler.getTargetElement(e.target))),!f.current&&m.current&&(f.current=function(e){return s&&s(e)},m.current.addEventListener(c,f.current,u))},h=function(){f.current&&(m.current.removeEventListener(c,f.current,u),f.current=null)},g.useEffect((function(){d?m.current=n.DomHandler.getTargetElement(l):(h(),m.current=null)}),[l,d]),g.useEffect((function(){!f.current||""+b==""+s&&y===u||(h(),d&&v())}),[s,u,d]),i=function(){h()},g.useEffect((function(){return i}),[]),[v,h]),w=I(x,2),E=w[0],O=w[1];return g.useEffect((function(){if(t&&e.current)return E(),function(){O()}})),[e,r]};function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N=o.ComponentBase.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return n.classNames("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return n.classNames("p-dialog-content",e.props.contentClassName)},footer:"p-dialog-footer",mask:function(e){var t=e.props,r=e.maskVisibleState,o=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return n.classNames("p-dialog-mask",o?"p-dialog-".concat(o):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":r,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.props,r=e.maximized,o=e.context;return n.classNames("p-dialog p-component",t.className,{"p-dialog-rtl":t.rtl,"p-dialog-maximized":r,"p-dialog-default":!r,"p-input-filled":o&&"filled"===o.inputStyle||"filled"===f.default.inputStyle,"p-ripple-disabled":o&&!1===o.ripple||!1===f.default.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px;\n left: 0px;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n",inlineStyles:{mask:function(e){var t=e.props;return H({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=g.forwardRef((function(e,t){var d=g.useContext(r.PrimeReactContext),m=N.getProps(e,d),y=m.id?m.id:n.UniqueComponentId(),E=I(g.useState(y),2),O=E[0],D=I(g.useState(!1),2),S=D[0],P=D[1],z=I(g.useState(!1),2),k=z[0],j=z[1],R=I(g.useState(m.maximized),2),H=R[0],M=R[1],B=g.useRef(null),U=g.useRef(null),X=g.useRef(null),_=g.useRef(null),L=g.useRef(null),A=g.useRef(null),Y=g.useRef(null),V=g.useRef(!1),Z=g.useRef(!1),F=g.useRef(null),J=g.useRef(null),W=g.useRef(null),$=g.useRef(y),q=g.useRef(null),K=m.onMaximize?m.maximized:H,G=k&&(m.blockScroll||m.maximizable&&K),Q=N.setMetaData(T(T({props:m},m.__parentMetadata),{},{state:{id:O,maximized:K,containerVisible:S}})),ee=Q.ptm,te=Q.cx,ne=Q.sx;o.useHandleStyle(N.css.styles,Q.isUnstyled,{name:"dialog"}),C(U,m.closable&&m.closeOnEscape,(function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length;ve(e),n.splice(r-1,1)}}));var re=I(a.useEventListener({type:"keydown",listener:function(e){return Ee(e)}}),2),oe=re[0],ie=re[1],ae=I(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ke(e)}}),2),le=ae[0],ce=ae[1],se=I(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Ie(e)}}),2),ue=se[0],pe=se[1],de=I(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return De(e)}}),2),me=de[0],ge=de[1],fe=I(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Se(e)}}),2),be=fe[0],ye=fe[1],ve=function(e){m.onHide(),e.preventDefault()},he=function(e){X.current=e.target,m.onPointerDown&&m.onPointerDown(e)},xe=function(e){m.dismissableMask&&m.modal&&U.current===e.target&&!X.current&&ve(e),m.onMaskClick&&m.onMaskClick(e),X.current=null},we=function(e){m.onMaximize?m.onMaximize({originalEvent:e,maximized:!K}):M((function(e){return!e})),e.preventDefault()},Ee=function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var r=t.primeDialogParams,o=r.length,i=r[o-1]?r[o-1].id:void 0;if(i===O){var a=document.getElementById(i);if("Tab"===e.key){e.preventDefault();var l=n.DomHandler.getFocusableElements(a);if(l&&l.length>0)if(document.activeElement){var c=l.indexOf(document.activeElement);e.shiftKey?-1===c||0===c?l[l.length-1].focus():l[c-1].focus():-1===c||c===l.length-1?l[0].focus():l[c+1].focus()}else l[0].focus()}}}},Oe=function(e){n.DomHandler.hasClass(e.target,"p-dialog-header-icon")||n.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||m.draggable&&(V.current=!0,F.current=e.pageX,J.current=e.pageY,B.current.style.margin="0",n.DomHandler.addClass(document.body,"p-unselectable-text"),m.onDragStart&&m.onDragStart(e))},De=function(e){if(V.current){var t=n.DomHandler.getOuterWidth(B.current),r=n.DomHandler.getOuterHeight(B.current),o=e.pageX-F.current,i=e.pageY-J.current,a=B.current.getBoundingClientRect(),l=a.left+o,c=a.top+i,s=n.DomHandler.getViewport(),u=getComputedStyle(B.current),p=parseFloat(u.marginLeft),d=parseFloat(u.marginTop);B.current.style.position="fixed",m.keepInViewport?(l>=m.minX&&l+t<s.width&&(F.current=e.pageX,B.current.style.left=l-p+"px"),c>=m.minY&&c+r<s.height&&(J.current=e.pageY,B.current.style.top=c-d+"px")):(F.current=e.pageX,B.current.style.left=l-p+"px",J.current=e.pageY,B.current.style.top=c-d+"px"),m.onDrag&&m.onDrag(e)}},Se=function(e){V.current&&(V.current=!1,n.DomHandler.removeClass(document.body,"p-unselectable-text"),m.onDragEnd&&m.onDragEnd(e))},Pe=function(e){m.resizable&&(Z.current=!0,F.current=e.pageX,J.current=e.pageY,n.DomHandler.addClass(document.body,"p-unselectable-text"),m.onResizeStart&&m.onResizeStart(e))},ze=function(e,t,r){!r&&(r=n.DomHandler.getViewport());var o=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?o*(r[t]/100):o},ke=function(e){if(Z.current){var t=e.pageX-F.current,r=e.pageY-J.current,o=n.DomHandler.getOuterWidth(B.current),i=n.DomHandler.getOuterHeight(B.current),a=B.current.getBoundingClientRect(),l=n.DomHandler.getViewport(),c=!parseInt(B.current.style.top)||!parseInt(B.current.style.left),s=ze(B.current.style.minWidth,"width",l),u=ze(B.current.style.minHeight,"height",l),p=o+t,d=i+r;c&&(p+=t,d+=r),(!s||p>s)&&a.left+p<l.width&&(B.current.style.width=p+"px"),(!u||d>u)&&a.top+d<l.height&&(B.current.style.height=d+"px"),F.current=e.pageX,J.current=e.pageY,m.onResize&&m.onResize(e)}},Ie=function(e){Z.current&&(Z.current=!1,n.DomHandler.removeClass(document.body,"p-unselectable-text"),m.onResizeEnd&&m.onResizeEnd(e))},je=function(){B.current.style.position="",B.current.style.left="",B.current.style.top="",B.current.style.margin=""},Ce=function(){B.current.setAttribute($.current,"")},Re=function(){var e;m.onShow&&m.onShow(),m.focusOnShow&&!((e=document.activeElement)&&B.current&&B.current.contains(e))&&m.closable&&m.showHeader&&Y.current.focus(),Me()},He=function(){m.modal&&n.DomHandler.addClass(U.current,"p-component-overlay-leave")},Ne=function(){V.current=!1,n.ZIndexUtils.clear(U.current),P(!1),Te(),n.DomHandler.focus(q.current),q.current=null},Me=function(){Ue(),Be(!0)},Te=function(){Xe(),Be(!1)},Be=function(e){if(e){var t={id:O,hasBlockScroll:G};document.primeDialogParams||(document.primeDialogParams=[]);var r=document.primeDialogParams.findIndex((function(e){return e.id===O}));document.primeDialogParams=-1===r?[].concat(v(o=document.primeDialogParams)||h(o)||x(o)||w(),[t]):document.primeDialogParams.toSpliced(r,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==O}));var o;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?n.DomHandler.blockBodyScroll():n.DomHandler.unblockBodyScroll()},Ue=function(){m.draggable&&(me(),be()),m.resizable&&(le(),ue()),oe()},Xe=function(){ge(),ye(),ce(),pe(),ie()},_e=function(){W.current=n.DomHandler.createInlineStyle(d&&d.nonce||f.default.nonce);var e="";for(var t in m.breakpoints)e+="\n @media screen and (max-width: ".concat(t,") {\n .p-dialog[").concat($.current,"] {\n width: ").concat(m.breakpoints[t],";\n }\n }\n ");W.current.innerHTML=e};a.useMountEffect((function(){m.visible&&P(!0),m.breakpoints&&_e()})),a.useUpdateEffect((function(){m.visible&&!S&&P(!0),m.visible!==k&&S&&j(m.visible),m.visible&&(q.current=document.activeElement)}),[m.visible,S]),a.useUpdateEffect((function(){S&&(n.ZIndexUtils.set("modal",U.current,d&&d.autoZIndex||f.default.autoZIndex,m.baseZIndex||d&&d.zIndex.modal||f.default.zIndex.modal),j(!0))}),[S]),a.useUpdateEffect((function(){Be(!0)}),[G]),a.useUnmountEffect((function(){Te(),n.DomHandler.removeInlineStyle(W.current),n.ZIndexUtils.clear(U.current)})),g.useImperativeHandle(t,(function(){return{props:m,resetPosition:je,getElement:function(){return B.current},getMask:function(){return U.current},getContent:function(){return _.current},getHeader:function(){return L.current},getFooter:function(){return A.current},getCloseButton:function(){return Y.current}}}));var Le,Ae,Ye,Ve,Ze,Fe,Je,We,$e,qe,Ke,Ge,Qe=function(){if(m.closable){var e=m.ariaCloseIconLabel||r.localeOption("close"),t=n.mergeProps({className:te("closeButtonIcon"),"aria-hidden":!0},ee("closeButtonIcon")),o=n.IconUtils.getJSXIcon(m.closeIcon||g.createElement(l.TimesIcon,t),T({},t),{props:m}),i=n.mergeProps({ref:Y,type:"button",className:te("closeButton"),"aria-label":e,onClick:ve},ee("closeButton"));return g.createElement("button",i,o,g.createElement(p.Ripple,null))}return null},et=function(){var e=n.mergeProps({className:te("maximizableIcon")},ee("maximizableIcon")),t=n.IconUtils.getJSXIcon(K?m.minimizeIcon||g.createElement(s.WindowMinimizeIcon,e):m.maximizeIcon||g.createElement(c.WindowMaximizeIcon,e),e,{props:m});if(m.maximizable){var r=n.mergeProps({type:"button",className:te("maximizableButton"),onClick:we},ee("maximizableButton"));return g.createElement("button",r,t,g.createElement(p.Ripple,null))}return null},tt=function(){if(m.showHeader){var e=Qe(),t=et(),r=n.ObjectUtils.getJSXElement(m.icons,m),o=n.ObjectUtils.getJSXElement(m.header,m),i=O+"_header",a=n.mergeProps({ref:L,style:m.headerStyle,className:te("header"),onMouseDown:Oe},ee("header")),l=n.mergeProps({id:i,className:te("headerTitle")},ee("headerTitle")),c=n.mergeProps({className:te("headerIcons")},ee("headerIcons"));return g.createElement("div",a,g.createElement("div",l,o),g.createElement("div",c,r,t,e))}return null},nt=function(){var e=n.ObjectUtils.getJSXElement(m.footer,m),t=n.mergeProps({ref:A,className:te("footer")},ee("footer"));return e&&g.createElement("div",t,e)};return S&&(Ae=tt(),Le=n.mergeProps({id:O+"_content",ref:_,style:m.contentStyle,className:te("content")},ee("content")),Ye=g.createElement("div",Le,m.children),Ve=nt(),Ze=m.resizable?g.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Pe}):null,Fe=O+"_header",Je=O+"_content",We={enter:"center"===m.position?150:300,exit:"center"===m.position?150:300},$e=n.mergeProps({ref:U,style:ne("mask"),className:te("mask"),onPointerUp:xe},ee("mask")),qe=n.mergeProps({ref:B,id:O,className:te("root",{props:m,maximized:K,context:d}),style:m.style,onClick:m.onClick,role:"dialog","aria-labelledby":Fe,"aria-describedby":Je,"aria-modal":m.modal,onPointerDown:he},N.getOtherProps(m),ee("root")),Ke=n.mergeProps({classNames:te("transition"),timeout:We,in:k,options:m.transitionOptions,unmountOnExit:!0,onEnter:Ce,onEntered:Re,onExiting:He,onExited:Ne},ee("transition")),Ge=g.createElement("div",$e,g.createElement(i.CSSTransition,b({nodeRef:B},Ke),g.createElement("div",qe,Ae,Ye,Ve,Ze))),g.createElement(u.Portal,{element:Ge,appendTo:m.appendTo,visible:!0}))}));return B.displayName="Dialog",e.Dialog=B,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.api,primereact.componentbase,primereact.csstransition,primereact.hooks,primereact.icons.times,primereact.icons.windowmaximize,primereact.icons.windowminimize,primereact.portal,primereact.ripple);
1
+ this.primereact=this.primereact||{},this.primereact.dialog=function(e,t,n,r,o,i,a,l,c,s,u,p){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function m(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var g=m(t),f=d(r);function b(){return b=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},b.apply(this,arguments)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e){if(Array.isArray(e))return y(e)}function h(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function x(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}function w(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function O(e,t){if("object"!==E(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==E(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function D(e){var t=O(e,"string");return"symbol"===E(t)?t:String(t)}function S(e,t,n){return(t=D(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function P(e){if(Array.isArray(e))return e}function z(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(e){s=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw o}}return l}}function k(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e,t){return P(e)||z(e,t)||x(e,t)||k()}var j=function(e){var t,r,o,i=e.target,a=void 0===i?"document":i,l=e.type,c=e.listener,s=e.options,u=e.when,p=void 0===u||u,d=g.useRef(null),m=g.useRef(null),f=(t=s,r=g.useRef(void 0),g.useEffect((function(){r.current=t})),r.current),b=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};n.ObjectUtils.isNotEmpty(e.target)&&(y(),(e.when||p)&&(d.current=n.DomHandler.getTargetElement(e.target))),!m.current&&d.current&&(m.current=function(e){return c&&c(e)},d.current.addEventListener(l,m.current,s))},y=function(){m.current&&(d.current.removeEventListener(l,m.current,s),m.current=null)};return g.useEffect((function(){p?d.current=n.DomHandler.getTargetElement(a):(y(),d.current=null)}),[a,p]),g.useEffect((function(){!m.current||m.current===c&&f===s||(y(),p&&b())}),[c,s]),o=function(){y()},g.useEffect((function(){return o}),[]),[b,y]},C=function(e,t,n){var r=I(j({type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),n(e))}}),2),o=r[0],i=r[1];return g.useEffect((function(){if(t&&e.current)return o(),function(){i()}})),[e,n]};function R(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?R(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var N=o.ComponentBase.extend({defaultProps:{__TYPE:"Dialog",__parentMetadata:null,appendTo:null,ariaCloseIconLabel:null,baseZIndex:0,blockScroll:!1,breakpoints:null,className:null,closable:!0,closeIcon:null,closeOnEscape:!0,contentClassName:null,contentStyle:null,dismissableMask:!1,draggable:!0,focusOnShow:!0,footer:null,header:null,headerClassName:null,headerStyle:null,icons:null,id:null,keepInViewport:!0,maskClassName:null,maskStyle:null,maximizable:!1,maximizeIcon:null,maximized:!1,minX:0,minY:0,minimizeIcon:null,modal:!0,onClick:null,onDrag:null,onDragEnd:null,onDragStart:null,onHide:null,onMaskClick:null,onMaximize:null,onResize:null,onResizeEnd:null,onResizeStart:null,onShow:null,position:"center",resizable:!0,rtl:!1,showHeader:!0,style:null,transitionOptions:null,visible:!1,children:void 0},css:{classes:{closeButtonIcon:"p-dialog-header-close-icon",closeButton:"p-dialog-header-icon p-dialog-header-close p-link",maximizableIcon:"p-dialog-header-maximize-icon",maximizableButton:"p-dialog-header-icon p-dialog-header-maximize p-link",header:function(e){return n.classNames("p-dialog-header",e.props.headerClassName)},headerTitle:"p-dialog-title",headerIcons:"p-dialog-header-icons",content:function(e){return n.classNames("p-dialog-content",e.props.contentClassName)},footer:"p-dialog-footer",mask:function(e){var t=e.props,r=e.maskVisibleState,o=["center","left","right","top","top-left","top-right","bottom","bottom-left","bottom-right"].find((function(e){return e===t.position||e.replace("-","")===t.position}));return n.classNames("p-dialog-mask",o?"p-dialog-".concat(o):"",{"p-component-overlay p-component-overlay-enter":t.modal,"p-dialog-visible":r,"p-dialog-draggable":t.draggable,"p-dialog-resizable":t.resizable},t.maskClassName)},root:function(e){var t=e.props,r=e.maximized,o=e.context;return n.classNames("p-dialog p-component",t.className,{"p-dialog-rtl":t.rtl,"p-dialog-maximized":r,"p-dialog-default":!r,"p-input-filled":o&&"filled"===o.inputStyle||"filled"===f.default.inputStyle,"p-ripple-disabled":o&&!1===o.ripple||!1===f.default.ripple})},transition:"p-dialog"},styles:"\n@layer primereact {\n .p-dialog-mask {\n background-color: transparent;\n transition-property: background-color;\n }\n \n .p-dialog-visible {\n display: flex;\n }\n \n .p-dialog-mask.p-component-overlay {\n pointer-events: auto;\n }\n \n .p-dialog {\n display: flex;\n flex-direction: column;\n pointer-events: auto;\n max-height: 90%;\n transform: scale(1);\n position: relative;\n }\n \n .p-dialog-content {\n overflow-y: auto;\n flex-grow: 1;\n }\n \n .p-dialog-header {\n display: flex;\n align-items: center;\n flex-shrink: 0;\n }\n \n .p-dialog-footer {\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icons {\n display: flex;\n align-items: center;\n align-self: flex-start;\n flex-shrink: 0;\n }\n \n .p-dialog .p-dialog-header-icon {\n display: flex;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n position: relative;\n }\n \n .p-dialog .p-dialog-title {\n flex-grow: 1;\n }\n \n /* Fluid */\n .p-fluid .p-dialog-footer .p-button {\n width: auto;\n }\n \n /* Animation */\n /* Center */\n .p-dialog-enter {\n opacity: 0;\n transform: scale(0.7);\n }\n \n .p-dialog-enter-active {\n opacity: 1;\n transform: scale(1);\n transition: all 150ms cubic-bezier(0, 0, 0.2, 1);\n }\n \n .p-dialog-enter-done {\n transform: none;\n }\n \n .p-dialog-exit-active {\n opacity: 0;\n transform: scale(0.7);\n transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n /* Top, Bottom, Left, Right, Top* and Bottom* */\n .p-dialog-top .p-dialog,\n .p-dialog-bottom .p-dialog,\n .p-dialog-left .p-dialog,\n .p-dialog-right .p-dialog,\n .p-dialog-top-left .p-dialog,\n .p-dialog-top-right .p-dialog,\n .p-dialog-bottom-left .p-dialog,\n .p-dialog-bottom-right .p-dialog {\n margin: 0.75em;\n }\n \n .p-dialog-top .p-dialog-enter,\n .p-dialog-top .p-dialog-exit-active {\n transform: translate3d(0px, -100%, 0px);\n }\n \n .p-dialog-bottom .p-dialog-enter,\n .p-dialog-bottom .p-dialog-exit-active {\n transform: translate3d(0px, 100%, 0px);\n }\n \n .p-dialog-left .p-dialog-enter,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-enter,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-enter,\n .p-dialog-bottom-left .p-dialog-exit-active {\n transform: translate3d(-100%, 0px, 0px);\n }\n \n .p-dialog-right .p-dialog-enter,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-enter,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-enter,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transform: translate3d(100%, 0px, 0px);\n }\n \n .p-dialog-top .p-dialog-enter-active,\n .p-dialog-bottom .p-dialog-enter-active,\n .p-dialog-left .p-dialog-enter-active,\n .p-dialog-top-left .p-dialog-enter-active,\n .p-dialog-bottom-left .p-dialog-enter-active,\n .p-dialog-right .p-dialog-enter-active,\n .p-dialog-top-right .p-dialog-enter-active,\n .p-dialog-bottom-right .p-dialog-enter-active {\n transform: translate3d(0px, 0px, 0px);\n transition: all 0.3s ease-out;\n }\n \n .p-dialog-top .p-dialog-exit-active,\n .p-dialog-bottom .p-dialog-exit-active,\n .p-dialog-left .p-dialog-exit-active,\n .p-dialog-top-left .p-dialog-exit-active,\n .p-dialog-bottom-left .p-dialog-exit-active,\n .p-dialog-right .p-dialog-exit-active,\n .p-dialog-top-right .p-dialog-exit-active,\n .p-dialog-bottom-right .p-dialog-exit-active {\n transition: all 0.3s ease-out;\n }\n \n /* Maximize */\n .p-dialog-maximized {\n transition: none;\n transform: none;\n margin: 0;\n width: 100vw !important;\n height: 100vh !important;\n max-height: 100%;\n top: 0px;\n left: 0px;\n }\n \n .p-dialog-maximized .p-dialog-content {\n flex-grow: 1;\n }\n \n .p-confirm-dialog .p-dialog-content {\n display: flex;\n align-items: center;\n }\n \n /* Resizable */\n .p-dialog .p-resizable-handle {\n position: absolute;\n font-size: 0.1px;\n display: block;\n cursor: se-resize;\n width: 12px;\n height: 12px;\n right: 1px;\n bottom: 1px;\n }\n \n .p-dialog-draggable .p-dialog-header {\n cursor: move;\n } \n}\n",inlineStyles:{mask:function(e){var t=e.props;return H({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",justifyContent:"left"===t.position||"top-left"===t.position||"bottom-left"===t.position?"flex-start":"right"===t.position||"top-right"===t.position||"bottom-right"===t.position?"flex-end":"center",alignItems:"top"===t.position||"top-left"===t.position||"top-right"===t.position?"flex-start":"bottom"===t.position||"bottom-left"===t.position||"bottom-right"===t.position?"flex-end":"center",pointerEvents:!t.modal&&"none"},t.maskStyle)}}}});function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){S(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var B=g.forwardRef((function(e,t){var d=g.useContext(r.PrimeReactContext),m=N.getProps(e,d),y=m.id?m.id:n.UniqueComponentId(),E=I(g.useState(y),2),O=E[0],D=I(g.useState(!1),2),S=D[0],P=D[1],z=I(g.useState(!1),2),k=z[0],j=z[1],R=I(g.useState(m.maximized),2),H=R[0],M=R[1],B=g.useRef(null),U=g.useRef(null),X=g.useRef(null),_=g.useRef(null),L=g.useRef(null),A=g.useRef(null),Y=g.useRef(null),V=g.useRef(!1),Z=g.useRef(!1),F=g.useRef(null),J=g.useRef(null),W=g.useRef(null),$=g.useRef(y),q=g.useRef(null),K=m.onMaximize?m.maximized:H,G=k&&(m.blockScroll||m.maximizable&&K),Q=N.setMetaData(T(T({props:m},m.__parentMetadata),{},{state:{id:O,maximized:K,containerVisible:S}})),ee=Q.ptm,te=Q.cx,ne=Q.sx;o.useHandleStyle(N.css.styles,Q.isUnstyled,{name:"dialog"}),C(U,m.closable&&m.closeOnEscape,(function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var n=t.primeDialogParams,r=n.length;ve(e),n.splice(r-1,1)}}));var re=I(a.useEventListener({type:"keydown",listener:function(e){return Ee(e)}}),2),oe=re[0],ie=re[1],ae=I(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return ke(e)}}),2),le=ae[0],ce=ae[1],se=I(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Ie(e)}}),2),ue=se[0],pe=se[1],de=I(a.useEventListener({type:"mousemove",target:function(){return window.document},listener:function(e){return De(e)}}),2),me=de[0],ge=de[1],fe=I(a.useEventListener({type:"mouseup",target:function(){return window.document},listener:function(e){return Se(e)}}),2),be=fe[0],ye=fe[1],ve=function(e){m.onHide(),e.preventDefault()},he=function(e){X.current=e.target,m.onPointerDown&&m.onPointerDown(e)},xe=function(e){m.dismissableMask&&m.modal&&U.current===e.target&&!X.current&&ve(e),m.onMaskClick&&m.onMaskClick(e),X.current=null},we=function(e){m.onMaximize?m.onMaximize({originalEvent:e,maximized:!K}):M((function(e){return!e})),e.preventDefault()},Ee=function(e){var t=e.currentTarget;if(t&&t.primeDialogParams){var r=t.primeDialogParams,o=r.length,i=r[o-1]?r[o-1].id:void 0;if(i===O){var a=document.getElementById(i);if("Tab"===e.key){e.preventDefault();var l=n.DomHandler.getFocusableElements(a);if(l&&l.length>0)if(document.activeElement){var c=l.indexOf(document.activeElement);e.shiftKey?-1===c||0===c?l[l.length-1].focus():l[c-1].focus():-1===c||c===l.length-1?l[0].focus():l[c+1].focus()}else l[0].focus()}}}},Oe=function(e){n.DomHandler.hasClass(e.target,"p-dialog-header-icon")||n.DomHandler.hasClass(e.target.parentElement,"p-dialog-header-icon")||m.draggable&&(V.current=!0,F.current=e.pageX,J.current=e.pageY,B.current.style.margin="0",n.DomHandler.addClass(document.body,"p-unselectable-text"),m.onDragStart&&m.onDragStart(e))},De=function(e){if(V.current){var t=n.DomHandler.getOuterWidth(B.current),r=n.DomHandler.getOuterHeight(B.current),o=e.pageX-F.current,i=e.pageY-J.current,a=B.current.getBoundingClientRect(),l=a.left+o,c=a.top+i,s=n.DomHandler.getViewport(),u=getComputedStyle(B.current),p=parseFloat(u.marginLeft),d=parseFloat(u.marginTop);B.current.style.position="fixed",m.keepInViewport?(l>=m.minX&&l+t<s.width&&(F.current=e.pageX,B.current.style.left=l-p+"px"),c>=m.minY&&c+r<s.height&&(J.current=e.pageY,B.current.style.top=c-d+"px")):(F.current=e.pageX,B.current.style.left=l-p+"px",J.current=e.pageY,B.current.style.top=c-d+"px"),m.onDrag&&m.onDrag(e)}},Se=function(e){V.current&&(V.current=!1,n.DomHandler.removeClass(document.body,"p-unselectable-text"),m.onDragEnd&&m.onDragEnd(e))},Pe=function(e){m.resizable&&(Z.current=!0,F.current=e.pageX,J.current=e.pageY,n.DomHandler.addClass(document.body,"p-unselectable-text"),m.onResizeStart&&m.onResizeStart(e))},ze=function(e,t,r){!r&&(r=n.DomHandler.getViewport());var o=parseInt(e);return/^(\d+|(\.\d+))(\.\d+)?%$/.test(e)?o*(r[t]/100):o},ke=function(e){if(Z.current){var t=e.pageX-F.current,r=e.pageY-J.current,o=n.DomHandler.getOuterWidth(B.current),i=n.DomHandler.getOuterHeight(B.current),a=B.current.getBoundingClientRect(),l=n.DomHandler.getViewport(),c=!parseInt(B.current.style.top)||!parseInt(B.current.style.left),s=ze(B.current.style.minWidth,"width",l),u=ze(B.current.style.minHeight,"height",l),p=o+t,d=i+r;c&&(p+=t,d+=r),(!s||p>s)&&a.left+p<l.width&&(B.current.style.width=p+"px"),(!u||d>u)&&a.top+d<l.height&&(B.current.style.height=d+"px"),F.current=e.pageX,J.current=e.pageY,m.onResize&&m.onResize(e)}},Ie=function(e){Z.current&&(Z.current=!1,n.DomHandler.removeClass(document.body,"p-unselectable-text"),m.onResizeEnd&&m.onResizeEnd(e))},je=function(){B.current.style.position="",B.current.style.left="",B.current.style.top="",B.current.style.margin=""},Ce=function(){B.current.setAttribute($.current,"")},Re=function(){var e;m.onShow&&m.onShow(),m.focusOnShow&&!((e=document.activeElement)&&B.current&&B.current.contains(e))&&m.closable&&m.showHeader&&Y.current.focus(),Me()},He=function(){m.modal&&n.DomHandler.addClass(U.current,"p-component-overlay-leave")},Ne=function(){V.current=!1,n.ZIndexUtils.clear(U.current),P(!1),Te(),n.DomHandler.focus(q.current),q.current=null},Me=function(){Ue(),Be(!0)},Te=function(){Xe(),Be(!1)},Be=function(e){if(e){var t={id:O,hasBlockScroll:G};document.primeDialogParams||(document.primeDialogParams=[]);var r=document.primeDialogParams.findIndex((function(e){return e.id===O}));document.primeDialogParams=-1===r?[].concat(v(o=document.primeDialogParams)||h(o)||x(o)||w(),[t]):document.primeDialogParams.toSpliced(r,1,t)}else document.primeDialogParams=document.primeDialogParams&&document.primeDialogParams.filter((function(e){return e.id!==O}));var o;document.primeDialogParams&&document.primeDialogParams.some((function(e){return e.hasBlockScroll}))?n.DomHandler.blockBodyScroll():n.DomHandler.unblockBodyScroll()},Ue=function(){m.draggable&&(me(),be()),m.resizable&&(le(),ue()),oe()},Xe=function(){ge(),ye(),ce(),pe(),ie()},_e=function(){W.current=n.DomHandler.createInlineStyle(d&&d.nonce||f.default.nonce);var e="";for(var t in m.breakpoints)e+="\n @media screen and (max-width: ".concat(t,") {\n .p-dialog[").concat($.current,"] {\n width: ").concat(m.breakpoints[t],";\n }\n }\n ");W.current.innerHTML=e};a.useMountEffect((function(){m.visible&&P(!0),m.breakpoints&&_e()})),a.useUpdateEffect((function(){m.visible&&!S&&P(!0),m.visible!==k&&S&&j(m.visible),m.visible&&(q.current=document.activeElement)}),[m.visible,S]),a.useUpdateEffect((function(){S&&(n.ZIndexUtils.set("modal",U.current,d&&d.autoZIndex||f.default.autoZIndex,m.baseZIndex||d&&d.zIndex.modal||f.default.zIndex.modal),j(!0))}),[S]),a.useUpdateEffect((function(){Be(!0)}),[G]),a.useUnmountEffect((function(){Te(),n.DomHandler.removeInlineStyle(W.current),n.ZIndexUtils.clear(U.current)})),g.useImperativeHandle(t,(function(){return{props:m,resetPosition:je,getElement:function(){return B.current},getMask:function(){return U.current},getContent:function(){return _.current},getHeader:function(){return L.current},getFooter:function(){return A.current},getCloseButton:function(){return Y.current}}}));var Le,Ae,Ye,Ve,Ze,Fe,Je,We,$e,qe,Ke,Ge,Qe=function(){if(m.closable){var e=m.ariaCloseIconLabel||r.localeOption("close"),t=n.mergeProps({className:te("closeButtonIcon"),"aria-hidden":!0},ee("closeButtonIcon")),o=n.IconUtils.getJSXIcon(m.closeIcon||g.createElement(l.TimesIcon,t),T({},t),{props:m}),i=n.mergeProps({ref:Y,type:"button",className:te("closeButton"),"aria-label":e,onClick:ve},ee("closeButton"));return g.createElement("button",i,o,g.createElement(p.Ripple,null))}return null},et=function(){var e=n.mergeProps({className:te("maximizableIcon")},ee("maximizableIcon")),t=n.IconUtils.getJSXIcon(K?m.minimizeIcon||g.createElement(s.WindowMinimizeIcon,e):m.maximizeIcon||g.createElement(c.WindowMaximizeIcon,e),e,{props:m});if(m.maximizable){var r=n.mergeProps({type:"button",className:te("maximizableButton"),onClick:we},ee("maximizableButton"));return g.createElement("button",r,t,g.createElement(p.Ripple,null))}return null},tt=function(){if(m.showHeader){var e=Qe(),t=et(),r=n.ObjectUtils.getJSXElement(m.icons,m),o=n.ObjectUtils.getJSXElement(m.header,m),i=O+"_header",a=n.mergeProps({ref:L,style:m.headerStyle,className:te("header"),onMouseDown:Oe},ee("header")),l=n.mergeProps({id:i,className:te("headerTitle")},ee("headerTitle")),c=n.mergeProps({className:te("headerIcons")},ee("headerIcons"));return g.createElement("div",a,g.createElement("div",l,o),g.createElement("div",c,r,t,e))}return null},nt=function(){var e=n.ObjectUtils.getJSXElement(m.footer,m),t=n.mergeProps({ref:A,className:te("footer")},ee("footer"));return e&&g.createElement("div",t,e)};return S&&(Ae=tt(),Le=n.mergeProps({id:O+"_content",ref:_,style:m.contentStyle,className:te("content")},ee("content")),Ye=g.createElement("div",Le,m.children),Ve=nt(),Ze=m.resizable?g.createElement("span",{className:"p-resizable-handle",style:{zIndex:90},onMouseDown:Pe}):null,Fe=O+"_header",Je=O+"_content",We={enter:"center"===m.position?150:300,exit:"center"===m.position?150:300},$e=n.mergeProps({ref:U,style:ne("mask"),className:te("mask"),onPointerUp:xe},ee("mask")),qe=n.mergeProps({ref:B,id:O,className:te("root",{props:m,maximized:K,context:d}),style:m.style,onClick:m.onClick,role:"dialog","aria-labelledby":Fe,"aria-describedby":Je,"aria-modal":m.modal,onPointerDown:he},N.getOtherProps(m),ee("root")),Ke=n.mergeProps({classNames:te("transition"),timeout:We,in:k,options:m.transitionOptions,unmountOnExit:!0,onEnter:Ce,onEntered:Re,onExiting:He,onExited:Ne},ee("transition")),Ge=g.createElement("div",$e,g.createElement(i.CSSTransition,b({nodeRef:B},Ke),g.createElement("div",qe,Ae,Ye,Ve,Ze))),g.createElement(u.Portal,{element:Ge,appendTo:m.appendTo,visible:!0}))}));return B.displayName="Dialog",e.Dialog=B,Object.defineProperty(e,"__esModule",{value:!0}),e}({},React,primereact.utils,primereact.api,primereact.componentbase,primereact.csstransition,primereact.hooks,primereact.icons.times,primereact.icons.windowmaximize,primereact.icons.windowminimize,primereact.portal,primereact.ripple);
@@ -112,7 +112,6 @@ var useEventListener = function useEventListener(_ref) {
112
112
  when = _ref$when === void 0 ? true : _ref$when;
113
113
  var targetRef = React__namespace.useRef(null);
114
114
  var listenerRef = React__namespace.useRef(null);
115
- var prevListener = usePrevious(listener);
116
115
  var prevOptions = usePrevious(options);
117
116
  var bind = function bind() {
118
117
  var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -142,12 +141,11 @@ var useEventListener = function useEventListener(_ref) {
142
141
  }
143
142
  }, [target, when]);
144
143
  React__namespace.useEffect(function () {
145
- // to properly compare functions we can implicitly converting the function to it's body's text as a String
146
- if (listenerRef.current && ('' + prevListener !== '' + listener || prevOptions !== options)) {
144
+ if (listenerRef.current && (listenerRef.current !== listener || prevOptions !== options)) {
147
145
  unbind();
148
146
  when && bind();
149
147
  }
150
- }, [listener, options, when]);
148
+ }, [listener, options]);
151
149
  useUnmountEffect(function () {
152
150
  unbind();
153
151
  });
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils"),n=require("primereact/api");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=u(e),c=r(n);function i(e){if(Array.isArray(e))return e}function a(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,o,c,i=[],a=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=o.call(n)).done)&&(i.push(r.value),i.length!==t);a=!0);}catch(e){l=!0,u=e}finally{try{if(!a&&null!=n.return&&(c=n.return(),Object(c)!==c))return}finally{if(l)throw u}}return i}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){return i(e)||a(e,t)||f(e,t)||s()}var p=function(e){var t=o.useRef(void 0);return o.useEffect((function(){t.current=e})),t.current},v=function(e){return o.useEffect((function(){return e}),[])},m=function(e){var n=e.target,r=void 0===n?"document":n,u=e.type,c=e.listener,i=e.options,a=e.when,l=void 0===a||a,f=o.useRef(null),s=o.useRef(null),d=p(c),m=p(i),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.ObjectUtils.isNotEmpty(e.target)&&(g(),(e.when||l)&&(f.current=t.DomHandler.getTargetElement(e.target))),!s.current&&f.current&&(s.current=function(e){return c&&c(e)},f.current.addEventListener(u,s.current,i))},g=function(){s.current&&(f.current.removeEventListener(u,s.current,i),s.current=null)};return o.useEffect((function(){l?f.current=t.DomHandler.getTargetElement(r):(g(),f.current=null)}),[r,l]),o.useEffect((function(){!s.current||""+d==""+c&&m===i||(g(),l&&y())}),[c,i,l]),v((function(){g()})),[y,g]},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=o.useRef(null),u=o.useRef(null),c=o.useCallback((function(){return clearTimeout(r.current)}),[r.current]);return o.useEffect((function(){u.current=e})),o.useEffect((function(){if(n)return r.current=setTimeout((function(){u.current()}),t),c;c()}),[t,n]),v((function(){c()})),[c]},g={ico:"image/x-icon",png:"image/png",svg:"image/svg+xml",gif:"image/gif"};function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function b(e,t){if("object"!==h(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function w(e){var t=b(e,"string");return"symbol"===h(t)?t:String(t)}function O(e,t,n){return(t=w(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=function(e){var r=e.target,u=e.listener,i=e.options,a=e.when,l=void 0===a||a,f=o.useRef(null),s=o.useRef(null),d=o.useRef([]),m=p(i),y=o.useContext(n.PrimeReactContext),g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.ObjectUtils.isNotEmpty(e.target)&&(h(),(e.when||l)&&(f.current=t.DomHandler.getTargetElement(e.target))),!s.current&&f.current){var n=d.current=t.DomHandler.getScrollableParents(f.current,y?y.hideOverlaysOnDocumentScrolling:c.default.hideOverlaysOnDocumentScrolling);s.current=function(e){return u&&u(e)},n.forEach((function(e){return e.addEventListener("scroll",s.current,i)}))}},h=function(){s.current&&(d.current.forEach((function(e){return e.removeEventListener("scroll",s.current,i)})),s.current=null)};return o.useEffect((function(){l?f.current=t.DomHandler.getTargetElement(r):(h(),f.current=null)}),[r,l]),o.useEffect((function(){!s.current||s.current===u&&m===i||(h(),l&&g())}),[u,i]),v((function(){h()})),[g,h]},D=function(e){var t=e.when;return m({target:"window",type:"resize",listener:e.listener,when:void 0===t||t})},R=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local",r="undefined"!=typeof window,u=d(m({target:"window",type:"storage",listener:function(e){var r="local"===n?window.localStorage:window.sessionStorage;if(e.storageArea===r&&e.key===t){var u=e.newValue?JSON.parse(e.newValue):void 0;f(u)}}}),2),c=u[0],i=u[1],a=d(o.useState(e),2),l=a[0],f=a[1];return o.useEffect((function(){r||f(e);try{var u="local"===n?window.localStorage.getItem(t):window.sessionStorage.getItem(t);f(u?JSON.parse(u):e)}catch(t){f(e)}return c(),function(){return i()}}),[]),[l,function(e){try{var u=e instanceof Function?e(l):e;if(f(u),r){var o=JSON.stringify(u);"local"===n?window.localStorage.setItem(t,o):window.sessionStorage.setItem(t,o)}}catch(e){throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(t))}}]},C=0;exports.useClickOutside=function(e,t){var n=function(n){e.current&&!e.current.contains(n.target)&&t(n)},r=d(m({type:"mousedown",listener:n}),2),u=r[0],c=r[1],i=d(m({type:"touchstart",listener:n}),2),a=i[0],l=i[1];return o.useEffect((function(){if(e.current)return u(),a(),function(){c(),l()}})),[e,t]},exports.useCounter=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{step:1},t=d(o.useState(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0),2),n=t[0],r=t[1];return{count:n,increment:function(){e.max&&n>=e.max||r(n+e.step)},decrement:function(){if(e.min||0===e.min&&n<=e.min)return null;r(n-e.step)},reset:function(){r(0)}}},exports.useDebounce=function(e,t){var n=d(o.useState(e),2),r=n[0],u=n[1],c=d(o.useState(e),2),i=c[0],a=c[1];return y((function(){a(r)}),t,r!==i),[r,i,u]},exports.useEventListener=m,exports.useFavicon=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"shortcut icon";o.useLayoutEffect((function(){if(e){document.querySelectorAll("link[rel*='icon']").forEach((function(e){document.head.removeChild(e)}));var n=document.createElement("link");n.setAttribute("type",g[e.split(".").pop()]),n.setAttribute("rel",t),n.setAttribute("href",e),document.head.appendChild(n)}}),[e,t])},exports.useIntersectionObserver=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=d(o.useState(!1),2),r=n[0],u=n[1];return o.useEffect((function(){if(e.current){var n=new IntersectionObserver((function(e){var t=d(e,1);u(t[0].isIntersecting)}),t);return n.observe(e.current),function(){n.disconnect()}}}),[t,e]),r},exports.useInterval=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=o.useRef(null),u=o.useRef(null),c=o.useCallback((function(){return clearInterval(r.current)}),[r.current]);return o.useEffect((function(){u.current=e})),o.useEffect((function(){if(n)return r.current=setInterval((function(){u.current()}),t),c;c()}),[t,n]),v((function(){c()})),[c]},exports.useLocalStorage=function(e,t){return R(e,t,"local")},exports.useMatchMedia=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=d(o.useState(!1),2),r=n[0],u=n[1],c=o.useRef(null),i=function(e){return u(e.matches)},a=function(){return c.current&&c.current.removeEventListener("change",i)&&(c.current=null)};return o.useEffect((function(){return t&&(c.current=window.matchMedia(e),u(c.current.matches),c.current&&c.current.addEventListener("change",i)),a}),[e,t]),r},exports.useMountEffect=function(e){var t=o.useRef(!1);return o.useEffect((function(){if(!t.current)return t.current=!0,e&&e()}),[])},exports.useMouse=function(){var e=d(o.useState({x:0,y:0}),2),t=e[0],n=e[1],r=o.useRef(null),u=o.useCallback((function(e){var t,u;if(r.current){var o=e.currentTarget.getBoundingClientRect();t=e.pageX-o.left-(window.pageXOffset||window.scrollX),u=e.pageY-o.top-(window.pageYOffset||window.scrollY)}else t=e.clientX,u=e.clientY;n({x:Math.max(0,Math.round(t)),y:Math.max(0,Math.round(u))})}),[]),c=d(m({target:r,type:"mousemove",listener:u}),2),i=c[0],a=c[1],l=d(m({type:"mousemove",listener:u}),2),f=l[0],s=l[1];return o.useEffect((function(){return i(),r.current||f(),function(){a(),r.current||s()}}),[f,i,s,a]),x(x({ref:r},t),{},{reset:function(){return n({x:0,y:0})}})},exports.useMove=function(e){var t=e.mode,n=void 0===t?"both":t,r=e.initialValue,u=void 0===r?{x:0,y:0}:r,c=d(o.useState(u),2),i=c[0],a=c[1],l=d(o.useState(!1),2),f=l[0],s=l[1],p=o.useRef(!1),v=o.useRef(!1),y=o.useRef(null),g=function(e){return B({x:e.clientX,y:e.clientY})},h=function(e){var t=e.clampedX,r=e.clampedY;"vertical"===n?a({y:1-r}):"horizontal"===n?a({x:t}):"both"===n&&a({x:t,y:r})},b=function(){v.current&&p.current&&(v.current=!1,s(!1),U())},w=function(e){e.cancelable&&e.preventDefault(),B({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY})},O=d(m({type:"mousemove",listener:g}),2),E=O[0],x=O[1],S=d(m({type:"mouseup",listener:b}),2),P=S[0],D=S[1],R=d(m({type:"touchmove",listener:w}),2),C=R[0],I=R[1],k=d(m({type:"touchend",listener:b}),2),M=k[0],T=k[1],L=d(m({target:y,type:"mousedown",listener:function(e){_(),e.preventDefault(),g(e)}}),2),A=L[0],H=L[1],X=d(m({target:y,type:"touchstart",listener:function(e){e.cancelable&&e.preventDefault(),_(),w(e)},options:{passive:!1}}),2),Y=X[0],N=X[1],z=function(e,t,n){return Math.min(Math.max(e,t),n)},q=function(e){var t=e.y;return{clampedX:z(e.x,0,1),clampedY:z(t,0,1)}},U=function(){x(),D(),I(),T()};o.useEffect((function(){p.current=!0}),[]);var _=function(){!v.current&&p.current&&(v.current=!0,s(!0),E(),P(),C(),M())},B=function(e){var t=e.x,n=e.y;if(v.current){var r=y.current.getBoundingClientRect(),u=q({x:(t-r.left)/r.width,y:(n-r.top)/r.height});h({clampedX:u.clampedX,clampedY:u.clampedY})}};return o.useEffect((function(){return y.current&&(A(),Y()),function(){y.current&&(H(),N())}}),[A,Y,i,H,N]),j(j({ref:y},i),{},{active:f,reset:function(){a(u)}})},exports.useOnEscapeKey=function(e,t,n){var r=d(m({type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),n(e))}}),2),u=r[0],c=r[1];return o.useEffect((function(){if(t&&e.current)return u(),function(){c()}})),[e,n]},exports.useOverlayListener=function(e){var n=e.target,r=e.overlay,u=e.listener,c=e.when,i=void 0===c||c,a=o.useRef(null),l=o.useRef(null),f=d(m({target:"window",type:"click",listener:function(e){u&&u(e,{type:"outside",valid:3!==e.which&&j(e)})}}),2),s=f[0],p=f[1],y=d(D({target:"window",listener:function(e){u&&u(e,{type:"resize",valid:!t.DomHandler.isTouchDevice()})}}),2),g=y[0],h=y[1],b=d(m({target:"window",type:"orientationchange",listener:function(e){u&&u(e,{type:"orientationchange",valid:!0})}}),2),w=b[0],O=b[1],E=d(P({target:n,listener:function(e){u&&u(e,{type:"scroll",valid:!0})}}),2),x=E[0],S=E[1],j=function(e){return a.current&&!(a.current.isSameNode(e.target)||a.current.contains(e.target)||l.current&&l.current.contains(e.target))},R=function(){p(),h(),O(),S()};return o.useEffect((function(){i?(a.current=t.DomHandler.getTargetElement(n),l.current=t.DomHandler.getTargetElement(r)):(R(),a.current=l.current=null)}),[n,r,i]),o.useEffect((function(){R()}),[i]),v((function(){R()})),[function(){s(),g(),w(),x()},R]},exports.useOverlayScrollListener=P,exports.usePrevious=p,exports.useResizeListener=D,exports.useSessionStorage=function(e,t){return R(e,t,"session")},exports.useStorage=R,exports.useStyle=function(r){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=d(e.useState(!1),2),i=o[0],a=o[1],l=e.useRef(null),f=e.useContext(n.PrimeReactContext),s=t.DomHandler.isClient()?window.document:void 0,p=u.document,v=void 0===p?s:p,m=u.manual,y=void 0!==m&&m,g=u.name,h=void 0===g?"style_".concat(++C):g,b=u.id,w=void 0===b?void 0:b,O=u.media,E=void 0===O?void 0:O,x=function(){v&&(l.current=v.querySelector('style[data-primereact-style-id="'.concat(h,'"]'))||v.getElementById(w)||v.createElement("style"),l.current.isConnected||(l.current.type="text/css",w&&(l.current.id=w),E&&(l.current.media=E),t.DomHandler.addNonce(l.current,f&&f.nonce||c.default.nonce),v.head.appendChild(l.current),h&&l.current.setAttribute("data-primereact-style-id",h)),i||(l.current.textContent=r,a(!0)))};return e.useEffect((function(){y||x()}),[]),{id:w,name:h,update:function(e){i&&r!==e&&(l.current.textContent=e)},unload:function(){v&&l.current&&(t.DomHandler.removeInlineStyle(l.current),a(!1))},load:x,isLoaded:i}},exports.useTimeout=y,exports.useUnmountEffect=v,exports.useUpdateEffect=function(e,t){var n=o.useRef(!1);return o.useEffect((function(){if(n.current)return e&&e();n.current=!0}),t)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("primereact/utils"),n=require("primereact/api");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=u(e),c=r(n);function i(e){if(Array.isArray(e))return e}function a(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,u,o,c,i=[],a=!0,l=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=o.call(n)).done)&&(i.push(r.value),i.length!==t);a=!0);}catch(e){l=!0,u=e}finally{try{if(!a&&null!=n.return&&(c=n.return(),Object(c)!==c))return}finally{if(l)throw u}}return i}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function d(e,t){return i(e)||a(e,t)||f(e,t)||s()}var p=function(e){var t=o.useRef(void 0);return o.useEffect((function(){t.current=e})),t.current},v=function(e){return o.useEffect((function(){return e}),[])},m=function(e){var n=e.target,r=void 0===n?"document":n,u=e.type,c=e.listener,i=e.options,a=e.when,l=void 0===a||a,f=o.useRef(null),s=o.useRef(null),d=p(i),m=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.ObjectUtils.isNotEmpty(e.target)&&(y(),(e.when||l)&&(f.current=t.DomHandler.getTargetElement(e.target))),!s.current&&f.current&&(s.current=function(e){return c&&c(e)},f.current.addEventListener(u,s.current,i))},y=function(){s.current&&(f.current.removeEventListener(u,s.current,i),s.current=null)};return o.useEffect((function(){l?f.current=t.DomHandler.getTargetElement(r):(y(),f.current=null)}),[r,l]),o.useEffect((function(){!s.current||s.current===c&&d===i||(y(),l&&m())}),[c,i]),v((function(){y()})),[m,y]},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=o.useRef(null),u=o.useRef(null),c=o.useCallback((function(){return clearTimeout(r.current)}),[r.current]);return o.useEffect((function(){u.current=e})),o.useEffect((function(){if(n)return r.current=setTimeout((function(){u.current()}),t),c;c()}),[t,n]),v((function(){c()})),[c]},g={ico:"image/x-icon",png:"image/png",svg:"image/svg+xml",gif:"image/gif"};function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function b(e,t){if("object"!==h(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==h(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function w(e){var t=b(e,"string");return"symbol"===h(t)?t:String(t)}function O(e,t,n){return(t=w(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var P=function(e){var r=e.target,u=e.listener,i=e.options,a=e.when,l=void 0===a||a,f=o.useRef(null),s=o.useRef(null),d=o.useRef([]),m=p(i),y=o.useContext(n.PrimeReactContext),g=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(t.ObjectUtils.isNotEmpty(e.target)&&(h(),(e.when||l)&&(f.current=t.DomHandler.getTargetElement(e.target))),!s.current&&f.current){var n=d.current=t.DomHandler.getScrollableParents(f.current,y?y.hideOverlaysOnDocumentScrolling:c.default.hideOverlaysOnDocumentScrolling);s.current=function(e){return u&&u(e)},n.forEach((function(e){return e.addEventListener("scroll",s.current,i)}))}},h=function(){s.current&&(d.current.forEach((function(e){return e.removeEventListener("scroll",s.current,i)})),s.current=null)};return o.useEffect((function(){l?f.current=t.DomHandler.getTargetElement(r):(h(),f.current=null)}),[r,l]),o.useEffect((function(){!s.current||s.current===u&&m===i||(h(),l&&g())}),[u,i]),v((function(){h()})),[g,h]},D=function(e){var t=e.when;return m({target:"window",type:"resize",listener:e.listener,when:void 0===t||t})},R=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local",r="undefined"!=typeof window,u=d(m({target:"window",type:"storage",listener:function(e){var r="local"===n?window.localStorage:window.sessionStorage;if(e.storageArea===r&&e.key===t){var u=e.newValue?JSON.parse(e.newValue):void 0;f(u)}}}),2),c=u[0],i=u[1],a=d(o.useState(e),2),l=a[0],f=a[1];return o.useEffect((function(){r||f(e);try{var u="local"===n?window.localStorage.getItem(t):window.sessionStorage.getItem(t);f(u?JSON.parse(u):e)}catch(t){f(e)}return c(),function(){return i()}}),[]),[l,function(e){try{var u=e instanceof Function?e(l):e;if(f(u),r){var o=JSON.stringify(u);"local"===n?window.localStorage.setItem(t,o):window.sessionStorage.setItem(t,o)}}catch(e){throw new Error("PrimeReact useStorage: Failed to serialize the value at key: ".concat(t))}}]},C=0;exports.useClickOutside=function(e,t){var n=function(n){e.current&&!e.current.contains(n.target)&&t(n)},r=d(m({type:"mousedown",listener:n}),2),u=r[0],c=r[1],i=d(m({type:"touchstart",listener:n}),2),a=i[0],l=i[1];return o.useEffect((function(){if(e.current)return u(),a(),function(){c(),l()}})),[e,t]},exports.useCounter=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{step:1},t=d(o.useState(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0),2),n=t[0],r=t[1];return{count:n,increment:function(){e.max&&n>=e.max||r(n+e.step)},decrement:function(){if(e.min||0===e.min&&n<=e.min)return null;r(n-e.step)},reset:function(){r(0)}}},exports.useDebounce=function(e,t){var n=d(o.useState(e),2),r=n[0],u=n[1],c=d(o.useState(e),2),i=c[0],a=c[1];return y((function(){a(r)}),t,r!==i),[r,i,u]},exports.useEventListener=m,exports.useFavicon=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"shortcut icon";o.useLayoutEffect((function(){if(e){document.querySelectorAll("link[rel*='icon']").forEach((function(e){document.head.removeChild(e)}));var n=document.createElement("link");n.setAttribute("type",g[e.split(".").pop()]),n.setAttribute("rel",t),n.setAttribute("href",e),document.head.appendChild(n)}}),[e,t])},exports.useIntersectionObserver=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=d(o.useState(!1),2),r=n[0],u=n[1];return o.useEffect((function(){if(e.current){var n=new IntersectionObserver((function(e){var t=d(e,1);u(t[0].isIntersecting)}),t);return n.observe(e.current),function(){n.disconnect()}}}),[t,e]),r},exports.useInterval=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=o.useRef(null),u=o.useRef(null),c=o.useCallback((function(){return clearInterval(r.current)}),[r.current]);return o.useEffect((function(){u.current=e})),o.useEffect((function(){if(n)return r.current=setInterval((function(){u.current()}),t),c;c()}),[t,n]),v((function(){c()})),[c]},exports.useLocalStorage=function(e,t){return R(e,t,"local")},exports.useMatchMedia=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=d(o.useState(!1),2),r=n[0],u=n[1],c=o.useRef(null),i=function(e){return u(e.matches)},a=function(){return c.current&&c.current.removeEventListener("change",i)&&(c.current=null)};return o.useEffect((function(){return t&&(c.current=window.matchMedia(e),u(c.current.matches),c.current&&c.current.addEventListener("change",i)),a}),[e,t]),r},exports.useMountEffect=function(e){var t=o.useRef(!1);return o.useEffect((function(){if(!t.current)return t.current=!0,e&&e()}),[])},exports.useMouse=function(){var e=d(o.useState({x:0,y:0}),2),t=e[0],n=e[1],r=o.useRef(null),u=o.useCallback((function(e){var t,u;if(r.current){var o=e.currentTarget.getBoundingClientRect();t=e.pageX-o.left-(window.pageXOffset||window.scrollX),u=e.pageY-o.top-(window.pageYOffset||window.scrollY)}else t=e.clientX,u=e.clientY;n({x:Math.max(0,Math.round(t)),y:Math.max(0,Math.round(u))})}),[]),c=d(m({target:r,type:"mousemove",listener:u}),2),i=c[0],a=c[1],l=d(m({type:"mousemove",listener:u}),2),f=l[0],s=l[1];return o.useEffect((function(){return i(),r.current||f(),function(){a(),r.current||s()}}),[f,i,s,a]),x(x({ref:r},t),{},{reset:function(){return n({x:0,y:0})}})},exports.useMove=function(e){var t=e.mode,n=void 0===t?"both":t,r=e.initialValue,u=void 0===r?{x:0,y:0}:r,c=d(o.useState(u),2),i=c[0],a=c[1],l=d(o.useState(!1),2),f=l[0],s=l[1],p=o.useRef(!1),v=o.useRef(!1),y=o.useRef(null),g=function(e){return B({x:e.clientX,y:e.clientY})},h=function(e){var t=e.clampedX,r=e.clampedY;"vertical"===n?a({y:1-r}):"horizontal"===n?a({x:t}):"both"===n&&a({x:t,y:r})},b=function(){v.current&&p.current&&(v.current=!1,s(!1),U())},w=function(e){e.cancelable&&e.preventDefault(),B({x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY})},O=d(m({type:"mousemove",listener:g}),2),E=O[0],x=O[1],S=d(m({type:"mouseup",listener:b}),2),P=S[0],D=S[1],R=d(m({type:"touchmove",listener:w}),2),C=R[0],I=R[1],k=d(m({type:"touchend",listener:b}),2),M=k[0],T=k[1],L=d(m({target:y,type:"mousedown",listener:function(e){_(),e.preventDefault(),g(e)}}),2),A=L[0],H=L[1],X=d(m({target:y,type:"touchstart",listener:function(e){e.cancelable&&e.preventDefault(),_(),w(e)},options:{passive:!1}}),2),Y=X[0],N=X[1],z=function(e,t,n){return Math.min(Math.max(e,t),n)},q=function(e){var t=e.y;return{clampedX:z(e.x,0,1),clampedY:z(t,0,1)}},U=function(){x(),D(),I(),T()};o.useEffect((function(){p.current=!0}),[]);var _=function(){!v.current&&p.current&&(v.current=!0,s(!0),E(),P(),C(),M())},B=function(e){var t=e.x,n=e.y;if(v.current){var r=y.current.getBoundingClientRect(),u=q({x:(t-r.left)/r.width,y:(n-r.top)/r.height});h({clampedX:u.clampedX,clampedY:u.clampedY})}};return o.useEffect((function(){return y.current&&(A(),Y()),function(){y.current&&(H(),N())}}),[A,Y,i,H,N]),j(j({ref:y},i),{},{active:f,reset:function(){a(u)}})},exports.useOnEscapeKey=function(e,t,n){var r=d(m({type:"keydown",listener:function(e){"Esc"!==e.key&&"Escape"!==e.key||(e.stopImmediatePropagation(),n(e))}}),2),u=r[0],c=r[1];return o.useEffect((function(){if(t&&e.current)return u(),function(){c()}})),[e,n]},exports.useOverlayListener=function(e){var n=e.target,r=e.overlay,u=e.listener,c=e.when,i=void 0===c||c,a=o.useRef(null),l=o.useRef(null),f=d(m({target:"window",type:"click",listener:function(e){u&&u(e,{type:"outside",valid:3!==e.which&&j(e)})}}),2),s=f[0],p=f[1],y=d(D({target:"window",listener:function(e){u&&u(e,{type:"resize",valid:!t.DomHandler.isTouchDevice()})}}),2),g=y[0],h=y[1],b=d(m({target:"window",type:"orientationchange",listener:function(e){u&&u(e,{type:"orientationchange",valid:!0})}}),2),w=b[0],O=b[1],E=d(P({target:n,listener:function(e){u&&u(e,{type:"scroll",valid:!0})}}),2),x=E[0],S=E[1],j=function(e){return a.current&&!(a.current.isSameNode(e.target)||a.current.contains(e.target)||l.current&&l.current.contains(e.target))},R=function(){p(),h(),O(),S()};return o.useEffect((function(){i?(a.current=t.DomHandler.getTargetElement(n),l.current=t.DomHandler.getTargetElement(r)):(R(),a.current=l.current=null)}),[n,r,i]),o.useEffect((function(){R()}),[i]),v((function(){R()})),[function(){s(),g(),w(),x()},R]},exports.useOverlayScrollListener=P,exports.usePrevious=p,exports.useResizeListener=D,exports.useSessionStorage=function(e,t){return R(e,t,"session")},exports.useStorage=R,exports.useStyle=function(r){var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=d(e.useState(!1),2),i=o[0],a=o[1],l=e.useRef(null),f=e.useContext(n.PrimeReactContext),s=t.DomHandler.isClient()?window.document:void 0,p=u.document,v=void 0===p?s:p,m=u.manual,y=void 0!==m&&m,g=u.name,h=void 0===g?"style_".concat(++C):g,b=u.id,w=void 0===b?void 0:b,O=u.media,E=void 0===O?void 0:O,x=function(){v&&(l.current=v.querySelector('style[data-primereact-style-id="'.concat(h,'"]'))||v.getElementById(w)||v.createElement("style"),l.current.isConnected||(l.current.type="text/css",w&&(l.current.id=w),E&&(l.current.media=E),t.DomHandler.addNonce(l.current,f&&f.nonce||c.default.nonce),v.head.appendChild(l.current),h&&l.current.setAttribute("data-primereact-style-id",h)),i||(l.current.textContent=r,a(!0)))};return e.useEffect((function(){y||x()}),[]),{id:w,name:h,update:function(e){i&&r!==e&&(l.current.textContent=e)},unload:function(){v&&l.current&&(t.DomHandler.removeInlineStyle(l.current),a(!1))},load:x,isLoaded:i}},exports.useTimeout=y,exports.useUnmountEffect=v,exports.useUpdateEffect=function(e,t){var n=o.useRef(!1);return o.useEffect((function(){if(n.current)return e&&e();n.current=!0}),t)};
@@ -86,7 +86,6 @@ var useEventListener = function useEventListener(_ref) {
86
86
  when = _ref$when === void 0 ? true : _ref$when;
87
87
  var targetRef = React.useRef(null);
88
88
  var listenerRef = React.useRef(null);
89
- var prevListener = usePrevious(listener);
90
89
  var prevOptions = usePrevious(options);
91
90
  var bind = function bind() {
92
91
  var bindOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -116,12 +115,11 @@ var useEventListener = function useEventListener(_ref) {
116
115
  }
117
116
  }, [target, when]);
118
117
  React.useEffect(function () {
119
- // to properly compare functions we can implicitly converting the function to it's body's text as a String
120
- if (listenerRef.current && ('' + prevListener !== '' + listener || prevOptions !== options)) {
118
+ if (listenerRef.current && (listenerRef.current !== listener || prevOptions !== options)) {
121
119
  unbind();
122
120
  when && bind();
123
121
  }
124
- }, [listener, options, when]);
122
+ }, [listener, options]);
125
123
  useUnmountEffect(function () {
126
124
  unbind();
127
125
  });