HEX
Server: Apache
System: Linux host60.registrar-servers.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: wwwrenee (3804)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /home/wwwrenee/public_html/wp-content/plugins/woocommerce-payments/dist/order.js
/*! For license information please see order.js.LICENSE.txt */
!function(){var e={4184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var c=o.apply(null,n);c&&e.push(c)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var u in n)r.call(n,u)&&n[u]&&e.push(u);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},4155:function(e){var t,n,r=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{n="function"==typeof clearTimeout?clearTimeout:i}catch(e){n=i}}();var u,a=[],s=!1,l=-1;function f(){s&&u&&(s=!1,u.length?a=u.concat(a):l=-1,a.length&&d())}function d(){if(!s){var e=c(f);s=!0;for(var t=a.length;t;){for(u=a,a=[];++l<t;)u&&u[l].run();l=-1,t=a.length}u=null,s=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===i||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new p(e,t)),1!==a.length||s||c(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");r.length&&(e=r[r.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e}(),n.p=window.wcpayAssets.url,function(){"use strict";var e=window.wp.element,t=window.wp.i18n,r=window.ReactDOM,o=n.n(r);const i=e=>{var t;const n=null!==(t=wcpay_order_config)&&void 0!==t?t:wc.wcSettings.getSetting("woocommerce_payments_data");return null==n?void 0:n[e]};function c(){return c=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},c.apply(this,arguments)}function u(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var a=n(4184),s=n.n(a),l=window.lodash,f=window.wp.deprecated,d=n.n(f);function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,t){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},v(e,t)}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&v(e,t)}function b(e){return b="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},b(e)}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w(e,t){if(t&&("object"===b(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}function E(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 S(e,t){if(e){if("string"==typeof e)return E(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)?E(e,t):void 0}}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],c=!0,u=!1;try{for(n=n.call(e);!(c=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{c||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||S(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var R=window.wp.dom,_=window.wp.keycodes,P=window.wp.compose,k=window.wp.primitives,D=(0,e.createElement)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(k.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F(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?F(Object(n),!0).forEach((function(t){j(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t,n,r,o,i,c){var u=t.width,a="rtl"===document.documentElement.dir;"left"===n&&a?n="right":"right"===n&&a&&(n="left"),"left"===r&&a?r="right":"right"===r&&a&&(r="left");var s=Math.round(e.left+e.width/2),l={popoverLeft:s,contentWidth:(s-u/2>0?u/2:s)+(s+u/2>window.innerWidth?window.innerWidth-s:u/2)},f=e.left;"right"===r?f=e.right:"middle"!==i&&(f=s);var d=e.right;"left"===r?d=e.left:"middle"!==i&&(d=s);var p,m={popoverLeft:f,contentWidth:f-u>0?u:f},h={popoverLeft:d,contentWidth:d+u>window.innerWidth?window.innerWidth-d:u},v=n,y=null;if(!o)if("center"===n&&l.contentWidth===u)v="center";else if("left"===n&&m.contentWidth===u)v="left";else if("right"===n&&h.contentWidth===u)v="right";else{var b="left"==(v=m.contentWidth>h.contentWidth?"left":"right")?m.contentWidth:h.contentWidth;y=b!==u?b:null}if(p="center"===v?l.popoverLeft:"left"===v?m.popoverLeft:h.popoverLeft,c){var g=c.getBoundingClientRect();p=Math.min(p,g.right-u)}return{xAxis:v,popoverLeft:p,contentWidth:y}}function A(e,t,n,r,o,i,c){var u=t.height;if(o){var a=((0,R.getScrollContainer)(i)||document.body).getBoundingClientRect().top+u-c;if(e.top<=a)return{yAxis:n,popoverTop:Math.min(e.bottom,a)}}var s=e.top+e.height/2;"bottom"===r?s=e.bottom:"top"===r&&(s=e.top);var l={popoverTop:s,contentHeight:(s-u/2>0?u/2:s)+(s+u/2>window.innerHeight?window.innerHeight-s:u/2)},f={popoverTop:e.top,contentHeight:e.top-10-u>0?u:e.top-10},d={popoverTop:e.bottom,contentHeight:e.bottom+10+u>window.innerHeight?window.innerHeight-10-e.bottom:u},p=n,m=null;if(!o)if("middle"===n&&l.contentHeight===u)p="middle";else if("top"===n&&f.contentHeight===u)p="top";else if("bottom"===n&&d.contentHeight===u)p="bottom";else{var h="top"==(p=f.contentHeight>d.contentHeight?"top":"bottom")?f.contentHeight:d.contentHeight;m=h!==u?h:null}return{yAxis:p,popoverTop:"middle"===p?l.popoverTop:"top"===p?f.popoverTop:d.popoverTop,contentHeight:m}}function M(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var N=(0,e.createContext)({focusHistory:[]}),I=N.Provider,B=N.Consumer;I.displayName="FocusReturnProvider",B.displayName="FocusReturnConsumer",e.Component;var L=(0,P.createHigherOrderComponent)((function t(n){if((o=n)instanceof e.Component||"function"==typeof o){var r=n;return t({})(r)}var o,i=n.onFocusReturn,c=void 0===i?l.stubTrue:i;return function(t){var n=function(n){y(u,n);var r,o,i=(r=u,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(r);if(o){var n=O(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return w(this,e)});function u(){var e;return p(this,u),(e=i.apply(this,arguments)).ownFocusedElements=new Set,e.activeElementOnMount=document.activeElement,e.setIsFocusedFalse=function(){return e.isFocused=!1},e.setIsFocusedTrue=function(t){e.ownFocusedElements.add(t.target),e.isFocused=!0},e}return h(u,[{key:"componentWillUnmount",value:function(){var e=this.activeElementOnMount,t=this.isFocused,n=this.ownFocusedElements;if(t&&!1!==c())for(var r,o=[].concat(M(l.without.apply(void 0,[this.props.focus.focusHistory].concat(M(n)))),[e]);r=o.pop();)if(document.body.contains(r))return void r.focus()}},{key:"render",value:function(){return(0,e.createElement)("div",{onFocus:this.setIsFocusedTrue,onBlur:this.setIsFocusedFalse},(0,e.createElement)(t,this.props.childProps))}}]),u}(e.Component);return function(t){return(0,e.createElement)(B,null,(function(r){return(0,e.createElement)(n,{childProps:t,focus:r})}))}}}),"withFocusReturn");var W=(0,P.createHigherOrderComponent)((function(t){return function(n){y(c,n);var r,o,i=(r=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(r);if(o){var n=O(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return w(this,e)});function c(){var t;return p(this,c),(t=i.apply(this,arguments)).focusContainRef=(0,e.createRef)(),t.handleTabBehaviour=t.handleTabBehaviour.bind(g(t)),t}return h(c,[{key:"handleTabBehaviour",value:function(e){if(e.keyCode===_.TAB){var t=R.focus.tabbable.find(this.focusContainRef.current);if(t.length){var n=t[0],r=t[t.length-1];e.shiftKey&&e.target===n?(e.preventDefault(),r.focus()):(e.shiftKey||e.target!==r)&&t.includes(e.target)||(e.preventDefault(),n.focus())}}}},{key:"render",value:function(){return(0,e.createElement)("div",{onKeyDown:this.handleTabBehaviour,ref:this.focusContainRef,tabIndex:"-1"},(0,e.createElement)(t,this.props))}}]),c}(e.Component)}),"withConstrainedTabbing"),H=W;var z=["button","submit"],U=(0,P.createHigherOrderComponent)((function(t){return function(n){y(u,n);var r,o,i=(r=u,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(r);if(o){var n=O(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return w(this,e)});function u(){var e;return p(this,u),(e=i.apply(this,arguments)).bindNode=e.bindNode.bind(g(e)),e.cancelBlurCheck=e.cancelBlurCheck.bind(g(e)),e.queueBlurCheck=e.queueBlurCheck.bind(g(e)),e.normalizeButtonFocus=e.normalizeButtonFocus.bind(g(e)),e}return h(u,[{key:"componentWillUnmount",value:function(){this.cancelBlurCheck()}},{key:"bindNode",value:function(e){e?this.node=e:(delete this.node,this.cancelBlurCheck())}},{key:"queueBlurCheck",value:function(e){var t=this;e.persist(),this.preventBlurCheck||(this.blurCheckTimeout=setTimeout((function(){document.hasFocus()?"function"==typeof t.node.handleFocusOutside&&t.node.handleFocusOutside(e):e.preventDefault()}),0))}},{key:"cancelBlurCheck",value:function(){clearTimeout(this.blurCheckTimeout)}},{key:"normalizeButtonFocus",value:function(e){var t=e.type,n=e.target;(0,l.includes)(["mouseup","touchend"],t)?this.preventBlurCheck=!1:function(e){switch(e.nodeName){case"A":case"BUTTON":return!0;case"INPUT":return(0,l.includes)(z,e.type)}return!1}(n)&&(this.preventBlurCheck=!0)}},{key:"render",value:function(){return(0,e.createElement)("div",{onFocus:this.cancelBlurCheck,onMouseDown:this.normalizeButtonFocus,onMouseUp:this.normalizeButtonFocus,onTouchStart:this.normalizeButtonFocus,onTouchEnd:this.normalizeButtonFocus,onBlur:this.queueBlurCheck},(0,e.createElement)(t,c({ref:this.bindNode},this.props)))}}]),u}(e.Component)}),"withFocusOutside");var q=function(e){y(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=O(t);if(n){var o=O(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return w(this,e)});function o(){return p(this,o),r.apply(this,arguments)}return h(o,[{key:"handleFocusOutside",value:function(e){this.props.onFocusOutside(e)}},{key:"render",value:function(){return this.props.children}}]),o}(e.Component),K=U(q);function V(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=O(e);if(t){var o=O(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return w(this,n)}}var Q=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.htmlDocument,r=void 0===n?document:n,o=t.className,i=void 0===o?"lockscroll":o,c=0,u=0;function a(e){var t=r.scrollingElement||r.body;e&&(u=t.scrollTop);var n=e?"add":"remove";t.classList[n](i),r.documentElement.classList[n](i),e||(t.scrollTop=u)}function s(){0===c&&a(!0),++c}function l(){1===c&&a(!1),--c}return function(e){y(n,e);var t=V(n);function n(){return p(this,n),t.apply(this,arguments)}return h(n,[{key:"componentDidMount",value:function(){s()}},{key:"componentWillUnmount",value:function(){l()}},{key:"render",value:function(){return null}}]),n}(e.Component)}();function $(e){e.stopPropagation()}var G=(0,e.forwardRef)((function(t,n){var r=t.children,o=u(t,["children"]);return(0,e.createElement)("div",c({},o,{ref:n,onMouseDown:$}),r)}));function J(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=O(e)););return e}function X(){return X="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=J(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},X.apply(this,arguments)}window.wp.isShallowEqual;var Y=(window.wp.warning,n(4155)),Z=(0,e.createContext)({slots:{},fills:{},registerSlot:function(){void 0!==Y&&Y.env},updateSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){}});var ee=(0,e.createContext)({registerSlot:function(){},unregisterSlot:function(){},registerFill:function(){},unregisterFill:function(){},getSlot:function(){},getFills:function(){},subscribe:function(){}}),te=(ee.Provider,ee.Consumer);e.Component;var ne=function(t){y(i,t);var n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(n);if(r){var o=O(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return w(this,e)});function i(){var e;return p(this,i),(e=o.apply(this,arguments)).isUnmounted=!1,e.bindNode=e.bindNode.bind(g(e)),e}return h(i,[{key:"componentDidMount",value:function(){(0,this.props.registerSlot)(this.props.name,this)}},{key:"componentWillUnmount",value:function(){var e=this.props.unregisterSlot;this.isUnmounted=!0,e(this.props.name,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.name,r=t.unregisterSlot,o=t.registerSlot;e.name!==n&&(r(e.name),o(n,this))}},{key:"bindNode",value:function(e){this.node=e}},{key:"forceUpdate",value:function(){this.isUnmounted||X(O(i.prototype),"forceUpdate",this).call(this)}},{key:"render",value:function(){var t=this.props,n=t.children,r=t.name,o=t.fillProps,i=void 0===o?{}:o,c=t.getFills,u=(0,l.map)(c(r,this),(function(t){var n=t.occurrence,r=(0,l.isFunction)(t.children)?t.children(i):t.children;return e.Children.map(r,(function(t,r){if(!t||(0,l.isString)(t))return t;var o="".concat(n,"---").concat(t.key||r);return(0,e.cloneElement)(t,{key:o})}))})).filter((0,l.negate)(e.isEmptyElement));return(0,e.createElement)(e.Fragment,null,(0,l.isFunction)(n)?n(u):u)}}]),i}(e.Component),re=function(t){return(0,e.createElement)(te,null,(function(n){var r=n.registerSlot,o=n.unregisterSlot,i=n.getFills;return(0,e.createElement)(ne,c({},t,{registerSlot:r,unregisterSlot:o,getFills:i}))}))},oe=0;function ie(t){var n=t.name,r=t.children,o=t.registerFill,i=t.unregisterFill,c=function(t){var n=(0,e.useContext)(ee),r=n.getSlot,o=n.subscribe,i=C((0,e.useState)(r(t)),2),c=i[0],u=i[1];return(0,e.useEffect)((function(){return u(r(t)),o((function(){u(r(t))}))}),[t]),c}(n),u=(0,e.useRef)({name:n,children:r});return u.current.occurrence||(u.current.occurrence=++oe),(0,e.useLayoutEffect)((function(){return o(n,u.current),function(){return i(n,u.current)}}),[]),(0,e.useLayoutEffect)((function(){u.current.children=r,c&&c.forceUpdate()}),[r]),(0,e.useLayoutEffect)((function(){n!==u.current.name&&(i(u.current.name,u.current),u.current.name=n,o(n,u.current))}),[n]),c&&c.node?((0,l.isFunction)(r)&&(r=r(c.props.fillProps)),(0,e.createPortal)(r,c.node)):null}var ce=function(t){return(0,e.createElement)(te,null,(function(n){var r=n.registerFill,o=n.unregisterFill;return(0,e.createElement)(ie,c({},t,{registerFill:r,unregisterFill:o}))}))};function ue(t){var n=t.name,r=t.fillProps,o=void 0===r?{}:r,i=t.as,a=void 0===i?"div":i,s=u(t,["name","fillProps","as"]),l=(0,e.useContext)(Z),f=(0,e.useRef)();return(0,e.useLayoutEffect)((function(){return l.registerSlot(n,f,o),function(){l.unregisterSlot(n,f)}}),[l.registerSlot,l.unregisterSlot,n]),(0,e.useLayoutEffect)((function(){l.updateSlot(n,o)})),(0,e.createElement)(a,c({ref:f},s))}function ae(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 se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(n),!0).forEach((function(t){j(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function le(t){var n=(0,e.useContext)(Z),r=n.slots[t]||{},o=n.fills[t],i=(0,e.useMemo)((function(){return o||[]}),[o]),c=(0,e.useCallback)((function(e){n.updateSlot(t,e)}),[t,n.updateSlot]),u=(0,e.useCallback)((function(e){n.unregisterSlot(t,e)}),[t,n.unregisterSlot]),a=(0,e.useCallback)((function(e){n.registerFill(t,e)}),[t,n.registerFill]),s=(0,e.useCallback)((function(e){n.unregisterFill(t,e)}),[t,n.unregisterFill]);return se(se({},r),{},{updateSlot:c,unregisterSlot:u,fills:i,registerFill:a,unregisterFill:s})}function fe(t){var n,r=t.name,o=t.children,i=le(r),c=(0,e.useRef)({rerender:(n=C((0,e.useState)({}),2)[1],function(){return n({})})});return(0,e.useEffect)((function(){return i.registerFill(c),function(){i.unregisterFill(c)}}),[i.registerFill,i.unregisterFill]),i.ref&&i.ref.current?("function"==typeof o&&(o=o(i.fillProps)),(0,e.createPortal)(o,i.ref.current)):null}function de(t){var n=t.bubblesVirtually,r=u(t,["bubblesVirtually"]);return n?(0,e.createElement)(ue,r):(0,e.createElement)(re,r)}function pe(t){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(ce,t),(0,e.createElement)(fe,t))}function me(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 he(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){j(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ve(e){var t=e.type,n=e.origin,r=void 0===n?function(e){return"appear"===e?"top":"left"}(t):n;if("appear"===t){var o,i=C(r.split(" "),2),c=i[0],u=i[1],a=void 0===u?"center":u;return s()("components-animate__appear",(j(o={},"is-from-"+a,"center"!==a),j(o,"is-from-"+c,"middle"!==c),o))}return"slide-in"===t?s()("components-animate__slide-in","is-from-"+r):"loading"===t?s()("components-animate__loading"):void 0}function ye(e){var t=e.type,n=e.options,r=void 0===n?{}:n;return(0,e.children)({className:ve(he({type:t},r))})}var be=H(L((function(e){return e.children}))),ge="Popover";function we(e,t){var n,r=(n=t).ownerDocument.defaultView.getComputedStyle(n),o=r.paddingTop,i=r.paddingBottom,c=r.paddingLeft,u=r.paddingRight,a=o?parseInt(o,10):0,s=i?parseInt(i,10):0,l=c?parseInt(c,10):0,f=u?parseInt(u,10):0;return{x:e.left+l,y:e.top+a,width:e.width-l-f,height:e.height-a-s,left:e.left+l,right:e.right-f,top:e.top+a,bottom:e.bottom-s}}function Oe(e,t,n){n?e.getAttribute(t)!==n&&e.setAttribute(t,n):e.hasAttribute(t)&&e.removeAttribute(t)}function Ee(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";e.style[t]!==n&&(e.style[t]=n)}function Se(e,t,n){n?e.classList.contains(t)||e.classList.add(t):e.classList.contains(t)&&e.classList.remove(t)}var Ce=function(t){var n=t.headerTitle,r=t.onClose,o=t.onKeyDown,i=t.children,a=t.className,l=t.noArrow,f=void 0===l||l,p=t.isAlternate,m=t.position,h=void 0===m?"bottom right":m,v=(t.range,t.focusOnMount),y=void 0===v?"firstElement":v,b=t.anchorRef,g=t.shouldAnchorIncludePadding,w=t.anchorRect,O=t.getAnchorRect,E=t.expandOnMobile,S=t.animate,k=void 0===S||S,j=t.onClickOutside,F=t.onFocusOutside,M=t.__unstableSticky,N=t.__unstableSlotName,I=void 0===N?ge:N,B=t.__unstableObserveElement,L=t.__unstableBoundaryParent,W=u(t,["headerTitle","onClose","onKeyDown","children","className","noArrow","isAlternate","position","range","focusOnMount","anchorRef","shouldAnchorIncludePadding","anchorRect","getAnchorRect","expandOnMobile","animate","onClickOutside","onFocusOutside","__unstableSticky","__unstableSlotName","__unstableObserveElement","__unstableBoundaryParent"]),H=(0,e.useRef)(null),z=(0,e.useRef)(null),U=(0,e.useRef)(),q=(0,P.useViewportMatch)("medium","<"),V=C((0,e.useState)(),2),$=V[0],J=V[1],X=le(I),Y=E&&q,Z=C((0,P.useResizeObserver)(),2),ee=Z[0],te=Z[1];f=Y||f,(0,e.useLayoutEffect)((function(){if(Y)return Se(U.current,"is-without-arrow",f),Se(U.current,"is-alternate",p),Oe(U.current,"data-x-axis"),Oe(U.current,"data-y-axis"),Ee(U.current,"top"),Ee(U.current,"left"),Ee(z.current,"maxHeight"),void Ee(z.current,"maxWidth");var e=function(){if(U.current&&z.current){var e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4?arguments[4]:void 0;if(t)return t;if(n){if(!e.current)return;return n(e.current)}if(!1!==r){if(!(r&&window.Range&&window.Element&&window.DOMRect))return;if(r instanceof window.Range)return(0,R.getRectangleFromRange)(r);if(r instanceof window.Element){var i=r.getBoundingClientRect();return o?i:we(i,r)}var c=r.top,u=r.bottom,a=c.getBoundingClientRect(),s=u.getBoundingClientRect(),l=new window.DOMRect(a.left,a.top,a.width,s.bottom-a.top);return o?l:we(l,r)}if(e.current){var f=e.current.parentNode,d=f.getBoundingClientRect();return o?d:we(d,f)}}(H,w,O,b,g);if(e){var t,n,r=U.current,o=r.offsetParent,i=r.ownerDocument,c=0;if(o&&o!==i.body){var u=o.getBoundingClientRect();c=u.top,e=new window.DOMRect(e.left-u.left,e.top-u.top,e.width,e.height)}L&&(t=null===(n=U.current.closest(".popover-slot"))||void 0===n?void 0:n.parentNode);var a=function(e,t){var n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0,c=C((arguments.length>2&&void 0!==arguments[2]?arguments[2]:"top").split(" "),3),u=c[0],a=c[1],s=void 0===a?"center":a,l=c[2],f=A(e,t,u,l,n,r,o);return T(T({},x(e,t,s,l,n,f.yAxis,i)),f)}(e,te.height?te:z.current.getBoundingClientRect(),h,M,U.current,c,t),s=a.popoverTop,l=a.popoverLeft,d=a.xAxis,m=a.yAxis,v=a.contentHeight,y=a.contentWidth;"number"==typeof s&&"number"==typeof l&&(Ee(U.current,"top",s+"px"),Ee(U.current,"left",l+"px")),Se(U.current,"is-without-arrow",f||"center"===d&&"middle"===m),Se(U.current,"is-alternate",p),Oe(U.current,"data-x-axis",d),Oe(U.current,"data-y-axis",m),Ee(z.current,"maxHeight","number"==typeof v?v+"px":""),Ee(z.current,"maxWidth","number"==typeof y?y+"px":""),J(({left:"right",right:"left"}[d]||"center")+" "+({top:"bottom",bottom:"top"}[m]||"middle"))}}};e();var t,n,r=window.setInterval(e,500),o=function(){window.cancelAnimationFrame(t),t=window.requestAnimationFrame(e)};return window.addEventListener("click",o),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),B&&(n=new window.MutationObserver(e)).observe(B,{attributes:!0}),function(){window.clearInterval(r),window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0),window.removeEventListener("click",o),window.cancelAnimationFrame(t),n&&n.disconnect()}}),[Y,w,O,b,g,h,te,M,B,L]),function(t,n){(0,e.useEffect)((function(){var e=setTimeout((function(){if(t&&n.current)if("firstElement"!==t)"container"===t&&n.current.focus();else{var e=R.focus.tabbable.find(n.current)[0];e?e.focus():n.current.focus()}}),0);return function(){return clearTimeout(e)}}),[])}(y,z);var ne=function(e){e.keyCode===_.ESCAPE&&r&&(e.stopPropagation(),r()),o&&o(e)},re=(0,e.createElement)(K,{onFocusOutside:function(e){if(F)F(e);else if(j){var t;try{t=new window.MouseEvent("click")}catch(e){(t=document.createEvent("MouseEvent")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null)}Object.defineProperty(t,"target",{get:function(){return e.relatedTarget}}),d()("Popover onClickOutside prop",{alternative:"onFocusOutside"}),j(t)}else r&&r()}},(0,e.createElement)(ye,{type:k&&$?"appear":null,options:{origin:$}},(function(t){var o=t.className;return(0,e.createElement)(G,c({className:s()("components-popover",a,o,{"is-expanded":Y,"is-without-arrow":f,"is-alternate":p})},W,{onKeyDown:ne,ref:U}),Y&&(0,e.createElement)(Q,null),Y&&(0,e.createElement)("div",{className:"components-popover__header"},(0,e.createElement)("span",{className:"components-popover__header-title"},n),(0,e.createElement)(Me,{className:"components-popover__close",icon:D,onClick:r})),(0,e.createElement)("div",{ref:z,className:"components-popover__content",tabIndex:"-1"},(0,e.createElement)("div",{style:{position:"relative"}},ee,i)))})));return y&&(re=(0,e.createElement)(be,null,re)),X.ref&&(re=(0,e.createElement)(pe,{name:I},re)),b||w?re:(0,e.createElement)("span",{ref:H},re)};Ce.Slot=function(t){var n=t.name,r=void 0===n?ge:n;return(0,e.createElement)(de,{bubblesVirtually:!0,name:r,className:"popover-slot"})};var Re=Ce,_e=function(t){var n,r,o=t.shortcut,i=t.className;return o?((0,l.isString)(o)&&(n=o),(0,l.isObject)(o)&&(n=o.display,r=o.ariaLabel),(0,e.createElement)("span",{className:i,"aria-label":r},n)):null};var Pe=function(t){y(i,t);var n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(n);if(r){var o=O(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return w(this,e)});function i(){var e;return p(this,i),(e=o.apply(this,arguments)).delayedSetIsOver=(0,l.debounce)((function(t){return e.setState({isOver:t})}),700),e.cancelIsMouseDown=e.createSetIsMouseDown(!1),e.isInMouseDown=!1,e.state={isOver:!1},e}return h(i,[{key:"componentWillUnmount",value:function(){this.delayedSetIsOver.cancel(),document.removeEventListener("mouseup",this.cancelIsMouseDown)}},{key:"emitToChild",value:function(t,n){var r=this.props.children;if(1===e.Children.count(r)){var o=e.Children.only(r);"function"==typeof o.props[t]&&o.props[t](n)}}},{key:"createToggleIsOver",value:function(e,t){var n=this;return function(r){if(n.emitToChild(e,r),!(r.currentTarget.disabled||"focus"===r.type&&n.isInMouseDown)){n.delayedSetIsOver.cancel();var o=(0,l.includes)(["focus","mouseenter"],r.type);o!==n.state.isOver&&(t?n.delayedSetIsOver(o):n.setState({isOver:o}))}}}},{key:"createSetIsMouseDown",value:function(e){var t=this;return function(n){t.emitToChild(e?"onMouseDown":"onMouseUp",n),document[e?"addEventListener":"removeEventListener"]("mouseup",t.cancelIsMouseDown),t.isInMouseDown=e}}},{key:"render",value:function(){var t=this.props,n=t.children,r=t.position,o=t.text,i=t.shortcut;if(1!==e.Children.count(n))return n;var c=e.Children.only(n),u=this.state.isOver;return(0,e.cloneElement)(c,{onMouseEnter:this.createToggleIsOver("onMouseEnter",!0),onMouseLeave:this.createToggleIsOver("onMouseLeave"),onClick:this.createToggleIsOver("onClick"),onFocus:this.createToggleIsOver("onFocus"),onBlur:this.createToggleIsOver("onBlur"),onMouseDown:this.createSetIsMouseDown(!0),children:(0,e.concatChildren)(c.props.children,u&&(0,e.createElement)(Re,{focusOnMount:!1,position:r,className:"components-tooltip","aria-hidden":"true",animate:!1,noArrow:!0},o,(0,e.createElement)(_e,{className:"components-tooltip__shortcut",shortcut:i})))})}}]),i}(e.Component),ke=Pe,De=function(t){var n=t.icon,r=t.className,o=u(t,["icon","className"]),i=["dashicon","dashicons","dashicons-"+n,r].filter(Boolean).join(" ");return(0,e.createElement)("span",c({className:i},o))};function je(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 Fe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?je(Object(n),!0).forEach((function(t){j(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):je(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Te=function(t){var n=t.icon,r=void 0===n?null:n,o=t.size,i=u(t,["icon","size"]);if("string"==typeof r)return(0,e.createElement)(De,c({icon:r},i));if(r&&De===r.type)return(0,e.cloneElement)(r,Fe({},i));var a=o||24;if("function"==typeof r)return r.prototype instanceof e.Component?(0,e.createElement)(r,Fe({size:a},i)):r(Fe({size:a},i));if(r&&("svg"===r.type||r.type===k.SVG)){var s=Fe(Fe({width:a,height:a},r.props),i);return(0,e.createElement)(k.SVG,s)}return(0,e.isValidElement)(r)?(0,e.cloneElement)(r,Fe({size:a},i)):r};function xe(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}var Ae=["onMouseDown","onClick"],Me=(0,e.forwardRef)((function(t,n){var r=t.href,o=t.target,i=t.isPrimary,a=t.isSmall,f=t.isTertiary,p=t.isPressed,m=t.isBusy,h=t.isDefault,v=t.isSecondary,y=t.isLink,b=t.isDestructive,g=t.className,w=t.disabled,O=t.icon,E=t.iconSize,S=t.showTooltip,C=t.tooltipPosition,R=t.shortcut,_=t.label,P=t.children,k=t.__experimentalIsFocusable,D=u(t,["href","target","isPrimary","isSmall","isTertiary","isPressed","isBusy","isDefault","isSecondary","isLink","isDestructive","className","disabled","icon","iconSize","showTooltip","tooltipPosition","shortcut","label","children","__experimentalIsFocusable"]);h&&d()("Button isDefault prop",{alternative:"isSecondary"});var j=s()("components-button",g,{"is-secondary":h||v,"is-primary":i,"is-small":a,"is-tertiary":f,"is-pressed":p,"is-busy":m,"is-link":y,"is-destructive":b,"has-text":!!O&&!!P,"has-icon":!!O}),F=w&&!k,T=void 0===r||F?"button":"a",x="a"===T?{href:r,target:o}:{type:"button",disabled:F,"aria-pressed":p};if(w&&k){x["aria-disabled"]=!0;var A,M=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return xe(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)?xe(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return c=e.done,e},e:function(e){u=!0,i=e},f:function(){try{c||null==n.return||n.return()}finally{if(u)throw i}}}}(Ae);try{for(M.s();!(A=M.n()).done;)D[A.value]=function(e){e.stopPropagation(),e.preventDefault()}}catch(e){M.e(e)}finally{M.f()}}var N=!F&&(S&&_||R||!!_&&(!P||(0,l.isArray)(P)&&!P.length)&&!1!==S),I=(0,e.createElement)(T,c({},x,D,{className:j,"aria-label":D["aria-label"]||_,ref:n}),O&&(0,e.createElement)(Te,{icon:O,size:E}),P);return N?(0,e.createElement)(ke,{text:_,shortcut:R,position:C},I):I})),Ne=window.React,Ie=n.n(Ne);var Be=function(t){y(i,t);var n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(n);if(r){var o=O(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return w(this,e)});function i(){var t;return p(this,i),(t=o.apply(this,arguments)).containerRef=(0,e.createRef)(),t.handleKeyDown=t.handleKeyDown.bind(g(t)),t.handleFocusOutside=t.handleFocusOutside.bind(g(t)),t}return h(i,[{key:"componentDidMount",value:function(){this.props.focusOnMount&&this.containerRef.current.focus()}},{key:"handleFocusOutside",value:function(e){this.props.shouldCloseOnClickOutside&&this.onRequestClose(e)}},{key:"handleKeyDown",value:function(e){e.keyCode===_.ESCAPE&&this.handleEscapeKeyDown(e)}},{key:"handleEscapeKeyDown",value:function(e){this.props.shouldCloseOnEsc&&(e.stopPropagation(),this.onRequestClose(e))}},{key:"onRequestClose",value:function(e){var t=this.props.onRequestClose;t&&t(e)}},{key:"render",value:function(){var t=this.props,n=t.overlayClassName,r=t.contentLabel,o=t.aria,i=o.describedby,c=o.labelledby,u=t.children,a=t.className,l=t.role,f=t.style;return(0,e.createElement)(G,{className:s()("components-modal__screen-overlay",n),onKeyDown:this.handleKeyDown},(0,e.createElement)("div",{className:s()("components-modal__frame",a),style:f,ref:this.containerRef,role:l,"aria-label":r,"aria-labelledby":r?null:c,"aria-describedby":i,tabIndex:"-1"},u))}}]),i}(e.Component),Le=(0,P.compose)([L,H,U])(Be),We=function(n){var r=n.icon,o=n.title,i=n.onClose,c=n.closeLabel,u=n.headingId,a=n.isDismissible,s=c||(0,t.__)("Close dialog");return(0,e.createElement)("div",{className:"components-modal__header"},(0,e.createElement)("div",{className:"components-modal__header-heading-container"},r&&(0,e.createElement)("span",{className:"components-modal__icon-container","aria-hidden":!0},r),o&&(0,e.createElement)("h1",{id:u,className:"components-modal__header-heading"},o)),a&&(0,e.createElement)(Me,{onClick:i,icon:D,label:s}))},He=new Set(["alert","status","log","marquee","timer"]),ze=[],Ue=!1;var qe,Ke=0,Ve=function(t){y(i,t);var n,r,o=(n=i,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(n);if(r){var o=O(this).constructor;e=Reflect.construct(t,arguments,o)}else e=t.apply(this,arguments);return w(this,e)});function i(e){var t;return p(this,i),(t=o.call(this,e)).prepareDOM(),t}return h(i,[{key:"componentDidMount",value:function(){1==++Ke&&this.openFirstModal()}},{key:"componentWillUnmount",value:function(){0==--Ke&&this.closeLastModal(),this.cleanDOM()}},{key:"prepareDOM",value:function(){qe||(qe=document.createElement("div"),document.body.appendChild(qe)),this.node=document.createElement("div"),qe.appendChild(this.node)}},{key:"cleanDOM",value:function(){qe.removeChild(this.node)}},{key:"openFirstModal",value:function(){(function(e){if(!Ue){var t=document.body.children;(0,l.forEach)(t,(function(t){t!==e&&function(e){var t=e.getAttribute("role");return!("SCRIPT"===e.tagName||e.hasAttribute("aria-hidden")||e.hasAttribute("aria-live")||He.has(t))}(t)&&(t.setAttribute("aria-hidden","true"),ze.push(t))})),Ue=!0}})(qe),document.body.classList.add(this.props.bodyOpenClassName)}},{key:"closeLastModal",value:function(){document.body.classList.remove(this.props.bodyOpenClassName),Ue&&((0,l.forEach)(ze,(function(e){e.removeAttribute("aria-hidden")})),ze=[],Ue=!1)}},{key:"render",value:function(){var t=this.props,n=t.onRequestClose,r=t.title,o=t.icon,i=t.closeButtonLabel,a=t.children,s=t.aria,l=t.instanceId,f=t.isDismissible,p=t.isDismissable,m=u(t,["onRequestClose","title","icon","closeButtonLabel","children","aria","instanceId","isDismissible","isDismissable"]),h=s.labelledby||"components-modal-header-".concat(l);return p&&d()("isDismissable prop of the Modal component",{alternative:"isDismissible prop (renamed) of the Modal component"}),(0,e.createPortal)((0,e.createElement)(Le,c({onRequestClose:n,aria:{labelledby:r?h:null,describedby:s.describedby}},m),(0,e.createElement)("div",{className:"components-modal__content",role:"document"},(0,e.createElement)(We,{closeLabel:i,headingId:h,icon:o,isDismissible:f||p,onClose:n,title:r}),a)),this.node)}}]),i}(e.Component);Ve.defaultProps={bodyOpenClassName:"modal-open",role:"dialog",title:null,focusOnMount:!0,shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,isDismissible:!0,aria:{labelledby:null,describedby:null}};var Qe=(0,P.withInstanceId)(Ve),$e=function(){return $e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},$e.apply(this,arguments)},Ge=function(e){var t=e.children,n=e.actions,r=e.className,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children","actions","className"]);return Ie().createElement(Qe,$e({className:s()("wcpay-confirmation-modal",r)},o),t,Ie().createElement(k.HorizontalRule,{className:"wcpay-confirmation-modal__separator"}),Ie().createElement("div",{className:"wcpay-confirmation-modal__footer"},n))},Je=n=>{let{orderStatus:r,refundAmount:o,formattedRefundAmount:i,refundedAmount:c}=n;const[u,a]=(0,e.useState)(!0),s=()=>{a(!1)},l=()=>{jQuery("#order_status").val(r).change()};return(0,e.createElement)(e.Fragment,null,u&&(0,e.createElement)(Ge,{title:(0,t.__)("Refund order in full","woocommerce-payments"),isDismissible:!1,className:"refund-confirmation-modal",actions:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Me,{isSecondary:!0,onClick:()=>{l(),s()}},(0,t.__)("Cancel","woocommerce-payments")),(0,e.createElement)(Me,{isPrimary:!0,onClick:()=>{jQuery.ajax({type:"post",url:woocommerce_admin_meta_boxes.ajax_url,data:{action:"woocommerce_refund_line_items",order_id:woocommerce_admin_meta_boxes.post_id,security:woocommerce_admin_meta_boxes.order_item_nonce,refund_amount:o,refunded_amount:c,api_refund:!0},beforeSend:function(){jQuery(".refund-confirmation-modal").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},success:function(e){!0===e.success?window.location.reload():(l(),window.alert(e.data.error))},complete:function(){jQuery(".refund-confirmation-modal").unblock(),s()}})}},(0,t.sprintf)((0,t.__)("Refund %s","woocommerce-payments"),i)))},(0,e.createElement)("p",null,(0,t.__)('Issue a full refund back to your customer\'s credit card using WooCommerce Payments. This action can not be undone. To issue a partial refund, click "Cancel", and use the "Refund" button in the order details below.',"woocommerce-payments"))))};jQuery((function(n){var r,c;const u=null!==(r=i("disableManualRefunds"))&&void 0!==r&&r,a=null!==(c=i("manualRefundsTip"))&&void 0!==c?c:"";n("#woocommerce-order-items").on("click","button.refund-items",(function(){const e=n(".do-manual-refund");u?e.hide():e.attr({title:a}).tipTip()})),n("select#order_status").on("change",(function(){const r=n("input#original_post_status").val(),c=i("canRefund"),u=i("refundAmount");if("wc-refunded"===this.value&&"wc-refunded"!==r){if(!c)return void alert((0,t.__)("Order cannot be refunded","woocommerce-payments"));if(0>=u)return void alert((0,t.__)("Invalid Refund Amount","woocommerce-payments"));const n=document.createElement("div");n.id="wcpay-refund-confirm-container",document.body.appendChild(n),o().render((0,e.createElement)(Je,{orderStatus:r,refundAmount:u,formattedRefundAmount:i("formattedRefundAmount"),refundedAmount:i("refundedAmount")}),n)}}))}))}()}();