Plugin Directory

Changeset 3306201


Ignore:
Timestamp:
06/04/2025 07:35:33 AM (10 months ago)
Author:
nurwp
Message:

Released trigger-1.0.2

Location:
trigger
Files:
84 added
9 edited

Legend:

Unmodified
Added
Removed
  • trigger/trunk/assets/dist/js/backend-bundle.min.js

    r3300034 r3306201  
    169169    pointer-events: auto;
    170170  }
    171 `,mh=Up;function yh(e){return yh="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},yh(e)}function vh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vh(Object(r),!0).forEach((function(t){bh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function bh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=yh(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=yh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==yh(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wh(){wh=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==yh(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(yh(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function xh(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function _h(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){xh(i,n,o,a,s,"next",e)}function s(e){xh(i,n,o,a,s,"throw",e)}a(void 0)}))}}var Oh=function(){return Xd({queryKey:["getAllProviders"],queryFn:(e=_h(wh().mark((function e(){var t;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,yp("".concat(rd.rest_url,"/connections"),{method:"GET"});case 3:return t=e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)}),staleTime:5e3});var e},Sh=function(){var e=_h(wh().mark((function e(t){var r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.action="update_email_config",e.next=3,yp(rd.ajax_url,{body:t});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Eh=function(){return ep({mutationFn:Sh,onSuccess:function(e){var t;mh.success(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Email configuration saved successfully!","trigger"))},onError:function(e){var t;mh.error(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Failed to save email configuration","trigger"))}})},jh=function(){return ep({mutationFn:(e=_h(wh().mark((function e(t){var r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=gh({action:"trigger_send_test_email"},t),e.next=3,yp(rd.ajax_url,{body:t});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)}),onSuccess:function(e){var t;mh.success(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Test email sent successfully!","trigger"))},onError:function(e){mh.error("asdkf ".concat(e.message)||0)}});var e},Ph=function(){var e=_h(wh().mark((function e(){var t,r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={action:"trigger_connect_with_gmail",trigger_nonce:rd.nonce_value},e.next=3,yp(rd.ajax_url,{body:t});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),kh=function(){return ep({mutationFn:Ph,onSuccess:function(e){window.location.href=e.data.auth_url},onError:function(e){mh.error(e.message||(0,Lo.__)("Failed to connect with Gmail. Please try again.","trigger"))}})},Ch=function(){var e=_h(wh().mark((function e(){var t,r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={action:"trigger_is_gmail_connected"},e.next=3,yp(rd.ajax_url,{body:t});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ah=function(){return ep({mutationFn:Ch,onSuccess:function(e){},onError:function(e){}})},Nh=function(){return Xd({queryKey:["getSesVerifiedEmails"],queryFn:(e=_h(wh().mark((function e(){var t;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,yp("".concat(rd.rest_url,"/get-verified-ses-emails"),{method:"GET",body:{provider:"ses"}});case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)}),staleTime:0});var e};function Th(e){return Th="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},Th(e)}function Mh(){return Mh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mh.apply(null,arguments)}function Rh(){Rh=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Th(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Th(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Lh(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}var Ih=Xf.object({fromEmail:Xf.string().email({message:"Need a valid email address."}),sendTo:Xf.string().email({message:"Need a valid email address."})});function Dh(e){var t=e.open,r=e.onOpenChange,n=e.connection,o=Zu({resolver:el(Ih),defaultValues:{sendTo:"",fromEmail:n.fromEmail}}),a=jh(),s=a.mutateAsync,u=a.isPending,l=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Lh(i,n,o,a,s,"next",e)}function s(e){Lh(i,n,o,a,s,"throw",e)}a(void 0)}))}}(Rh().mark((function e(t){var r;return Rh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={provider:n.provider,sendTo:t.sendTo,fromEmail:t.fromEmail||n.fromEmail},e.next=3,s(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return io(cs,{open:t,onOpenChange:r},io(ms,{style:{zIndex:999999}},io(ys,null,io(vs,null,(0,Lo.__)("Send Test Email","trigger")),io(gs,null,(0,Lo.__)("Send a test email to verify your connection is working properly.","trigger"))),io("div",{className:"pt-4"},io("div",{className:"mb-4"},io("p",{className:"text-sm font-medium mb-1"},(0,Lo.__)("Provider","trigger")),io(xs,{className:"text-sm [&:disabled]:opacity-100",value:n.provider,disabled:!0}))),io(vl,o,io("form",{onSubmit:o.handleSubmit(l),className:"space-y-4"},io("div",{className:"mb-4"},io("p",{className:"text-sm font-medium mb-1"},(0,Lo.__)("From","trigger")),io(xs,{className:"text-sm [&:disabled]:opacity-100",value:n.fromEmail,disabled:!0})),io(bl,{control:o.control,name:"sendTo",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Send To","trigger")),io(Sl,null,io(xs,Mh({placeholder:"example@example.com"},t,{autoFocus:!0}))),io(kl,null))}}),io("div",{className:"flex justify-end gap-2 mt-6"},io(fs,{asChild:!0},io(lo,{variant:"outline"},(0,Lo.__)("Cancel","trigger"))),io(lo,{type:"submit",disabled:u},u?io(i().Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Sending...","trigger")):(0,Lo.__)("Send Test Email","trigger")))))))}function Fh(e,[t,r]){return Math.min(r,Math.max(t,e))}function zh(e){const t=e+"CollectionProvider",[n,o]=Do(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:t,children:n}=e,o=r.useRef(null),a=r.useRef(new Map).current;return(0,ft.jsx)(i,{scope:t,itemMap:a,collectionRef:o,children:n})};s.displayName=t;const u=e+"CollectionSlot",l=r.forwardRef(((e,t)=>{const{scope:r,children:n}=e,o=ct(t,a(u,r).collectionRef);return(0,ft.jsx)(dt,{ref:o,children:n})}));l.displayName=u;const c=e+"CollectionItemSlot",f="data-radix-collection-item",d=r.forwardRef(((e,t)=>{const{scope:n,children:o,...i}=e,s=r.useRef(null),u=ct(t,s),l=a(c,n);return r.useEffect((()=>(l.itemMap.set(s,{ref:s,...i}),()=>{l.itemMap.delete(s)}))),(0,ft.jsx)(dt,{[f]:"",ref:u,children:o})}));return d.displayName=c,[{Provider:s,Slot:l,ItemSlot:d},function(t){const n=a(e+"CollectionConsumer",t),o=r.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`)),r=Array.from(n.itemMap.values()).sort(((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current)));return r}),[n.collectionRef,n.itemMap]);return o},o]}var Bh=r.createContext(void 0);function Vh(e){const t=r.useContext(Bh);return e||t||"ltr"}const $h=["top","right","bottom","left"],Uh=Math.min,Gh=Math.max,Wh=Math.round,qh=Math.floor,Hh=e=>({x:e,y:e}),Zh={left:"right",right:"left",bottom:"top",top:"bottom"},Kh={start:"end",end:"start"};function Yh(e,t,r){return Gh(e,Uh(t,r))}function Xh(e,t){return"function"==typeof e?e(t):e}function Qh(e){return e.split("-")[0]}function Jh(e){return e.split("-")[1]}function em(e){return"x"===e?"y":"x"}function tm(e){return"y"===e?"height":"width"}function rm(e){return["top","bottom"].includes(Qh(e))?"y":"x"}function nm(e){return em(rm(e))}function om(e){return e.replace(/start|end/g,(e=>Kh[e]))}function im(e){return e.replace(/left|right|bottom|top/g,(e=>Zh[e]))}function am(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function sm(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function um(e,t,r){let{reference:n,floating:o}=e;const i=rm(t),a=nm(t),s=tm(a),u=Qh(t),l="y"===i,c=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,d=n[s]/2-o[s]/2;let p;switch(u){case"top":p={x:c,y:n.y-o.height};break;case"bottom":p={x:c,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-o.width,y:f};break;default:p={x:n.x,y:n.y}}switch(Jh(t)){case"start":p[a]-=d*(r&&l?-1:1);break;case"end":p[a]+=d*(r&&l?-1:1)}return p}async function lm(e,t){var r;void 0===t&&(t={});const{x:n,y:o,platform:i,rects:a,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Xh(t,e),h=am(p),m=s[d?"floating"===f?"reference":"floating":f],y=sm(await i.getClippingRect({element:null==(r=await(null==i.isElement?void 0:i.isElement(m)))||r?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:c,strategy:u})),v="floating"===f?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},w=sm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:g,strategy:u}):v);return{top:(y.top-w.top+h.top)/b.y,bottom:(w.bottom-y.bottom+h.bottom)/b.y,left:(y.left-w.left+h.left)/b.x,right:(w.right-y.right+h.right)/b.x}}function cm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fm(e){return $h.some((t=>e[t]>=0))}function dm(){return"undefined"!=typeof window}function pm(e){return ym(e)?(e.nodeName||"").toLowerCase():"#document"}function hm(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function mm(e){var t;return null==(t=(ym(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ym(e){return!!dm()&&(e instanceof Node||e instanceof hm(e).Node)}function vm(e){return!!dm()&&(e instanceof Element||e instanceof hm(e).Element)}function gm(e){return!!dm()&&(e instanceof HTMLElement||e instanceof hm(e).HTMLElement)}function bm(e){return!(!dm()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof hm(e).ShadowRoot)}function wm(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=jm(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function xm(e){return["table","td","th"].includes(pm(e))}function _m(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Om(e){const t=Sm(),r=vm(e)?jm(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!r[e]&&"none"!==r[e]))||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(r.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(r.contain||"").includes(e)))}function Sm(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Em(e){return["html","body","#document"].includes(pm(e))}function jm(e){return hm(e).getComputedStyle(e)}function Pm(e){return vm(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function km(e){if("html"===pm(e))return e;const t=e.assignedSlot||e.parentNode||bm(e)&&e.host||mm(e);return bm(t)?t.host:t}function Cm(e){const t=km(e);return Em(t)?e.ownerDocument?e.ownerDocument.body:e.body:gm(t)&&wm(t)?t:Cm(t)}function Am(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=Cm(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),a=hm(o);if(i){const e=Nm(a);return t.concat(a,a.visualViewport||[],wm(o)?o:[],e&&r?Am(e):[])}return t.concat(o,Am(o,[],r))}function Nm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Tm(e){const t=jm(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=gm(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,s=Wh(r)!==i||Wh(n)!==a;return s&&(r=i,n=a),{width:r,height:n,$:s}}function Mm(e){return vm(e)?e:e.contextElement}function Rm(e){const t=Mm(e);if(!gm(t))return Hh(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Tm(t);let a=(i?Wh(r.width):r.width)/n,s=(i?Wh(r.height):r.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Lm=Hh(0);function Im(e){const t=hm(e);return Sm()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Lm}function Dm(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),i=Mm(e);let a=Hh(1);t&&(n?vm(n)&&(a=Rm(n)):a=Rm(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==hm(e))&&t}(i,r,n)?Im(i):Hh(0);let u=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,c=o.width/a.x,f=o.height/a.y;if(i){const e=hm(i),t=n&&vm(n)?hm(n):n;let r=e,o=Nm(r);for(;o&&n&&t!==r;){const e=Rm(o),t=o.getBoundingClientRect(),n=jm(o),i=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;u*=e.x,l*=e.y,c*=e.x,f*=e.y,u+=i,l+=a,r=hm(o),o=Nm(r)}}return sm({width:c,height:f,x:u,y:l})}function Fm(e,t){const r=Pm(e).scrollLeft;return t?t.left+r:Dm(mm(e)).left+r}function zm(e,t,r){void 0===r&&(r=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:Fm(e,n)),y:n.top+t.scrollTop}}function Bm(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=hm(e),n=mm(e),o=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;const e=Sm();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,u=o.offsetTop)}return{width:i,height:a,x:s,y:u}}(e,r);else if("document"===t)n=function(e){const t=mm(e),r=Pm(e),n=e.ownerDocument.body,o=Gh(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Gh(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+Fm(e);const s=-r.scrollTop;return"rtl"===jm(n).direction&&(a+=Gh(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:s}}(mm(e));else if(vm(t))n=function(e,t){const r=Dm(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=gm(e)?Rm(e):Hh(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:n*i.y}}(t,r);else{const r=Im(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return sm(n)}function Vm(e,t){const r=km(e);return!(r===t||!vm(r)||Em(r))&&("fixed"===jm(r).position||Vm(r,t))}function $m(e,t,r){const n=gm(t),o=mm(t),i="fixed"===r,a=Dm(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const u=Hh(0);if(n||!n&&!i)if(("body"!==pm(t)||wm(o))&&(s=Pm(t)),n){const e=Dm(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else o&&(u.x=Fm(o));const l=!o||n||i?Hh(0):zm(o,s);return{x:a.left+s.scrollLeft-u.x-l.x,y:a.top+s.scrollTop-u.y-l.y,width:a.width,height:a.height}}function Um(e){return"static"===jm(e).position}function Gm(e,t){if(!gm(e)||"fixed"===jm(e).position)return null;if(t)return t(e);let r=e.offsetParent;return mm(e)===r&&(r=r.ownerDocument.body),r}function Wm(e,t){const r=hm(e);if(_m(e))return r;if(!gm(e)){let t=km(e);for(;t&&!Em(t);){if(vm(t)&&!Um(t))return t;t=km(t)}return r}let n=Gm(e,t);for(;n&&xm(n)&&Um(n);)n=Gm(n,t);return n&&Em(n)&&Um(n)&&!Om(n)?r:n||function(e){let t=km(e);for(;gm(t)&&!Em(t);){if(Om(t))return t;if(_m(t))return null;t=km(t)}return null}(e)||r}const qm={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i="fixed"===o,a=mm(n),s=!!t&&_m(t.floating);if(n===a||s&&i)return r;let u={scrollLeft:0,scrollTop:0},l=Hh(1);const c=Hh(0),f=gm(n);if((f||!f&&!i)&&(("body"!==pm(n)||wm(a))&&(u=Pm(n)),gm(n))){const e=Dm(n);l=Rm(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}const d=!a||f||i?Hh(0):zm(a,u,!0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-u.scrollLeft*l.x+c.x+d.x,y:r.y*l.y-u.scrollTop*l.y+c.y+d.y}},getDocumentElement:mm,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[..."clippingAncestors"===r?_m(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Am(e,[],!1).filter((e=>vm(e)&&"body"!==pm(e))),o=null;const i="fixed"===jm(e).position;let a=i?km(e):e;for(;vm(a)&&!Em(a);){const t=jm(a),r=Om(a);r||"fixed"!==t.position||(o=null),(i?!r&&!o:!r&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||wm(a)&&!r&&Vm(e,a))?n=n.filter((e=>e!==a)):o=t,a=km(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=i[0],s=i.reduce(((e,r)=>{const n=Bm(t,r,o);return e.top=Gh(n.top,e.top),e.right=Uh(n.right,e.right),e.bottom=Uh(n.bottom,e.bottom),e.left=Gh(n.left,e.left),e}),Bm(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Wm,getElementRects:async function(e){const t=this.getOffsetParent||Wm,r=this.getDimensions,n=await r(e.floating);return{reference:$m(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Tm(e);return{width:t,height:r}},getScale:Rm,isElement:vm,isRTL:function(e){return"rtl"===jm(e).direction}};function Hm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zm(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:u=!1}=n,l=Mm(e),c=o||i?[...l?Am(l):[],...Am(t)]:[];c.forEach((e=>{o&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)}));const f=l&&s?function(e,t){let r,n=null;const o=mm(e);function i(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function a(s,u){void 0===s&&(s=!1),void 0===u&&(u=1),i();const l=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=l;if(s||t(),!d||!p)return;const h={rootMargin:-qh(f)+"px "+-qh(o.clientWidth-(c+d))+"px "+-qh(o.clientHeight-(f+p))+"px "+-qh(c)+"px",threshold:Gh(0,Uh(1,u))||1};let m=!0;function y(t){const n=t[0].intersectionRatio;if(n!==u){if(!m)return a();n?a(!1,n):r=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==n||Hm(l,e.getBoundingClientRect())||a(),m=!1}try{n=new IntersectionObserver(y,{...h,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(y,h)}n.observe(e)}(!0),i}(l,r):null;let d,p=-1,h=null;a&&(h=new ResizeObserver((e=>{let[n]=e;n&&n.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),r()})),l&&!u&&h.observe(l),h.observe(t));let m=u?Dm(e):null;return u&&function t(){const n=Dm(e);m&&!Hm(m,n)&&r();m=n,d=requestAnimationFrame(t)}(),r(),()=>{var e;c.forEach((e=>{o&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)})),null==f||f(),null==(e=h)||e.disconnect(),h=null,u&&cancelAnimationFrame(d)}}const Km=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:a,middlewareData:s}=t,u=await async function(e,t){const{placement:r,platform:n,elements:o}=e,i=await(null==n.isRTL?void 0:n.isRTL(o.floating)),a=Qh(r),s=Jh(r),u="y"===rm(r),l=["left","top"].includes(a)?-1:1,c=i&&u?-1:1,f=Xh(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),u?{x:p*c,y:d*l}:{x:d*l,y:p*c}}(t,e);return a===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:a}}}}},Ym=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...u}=Xh(e,t),l={x:r,y:n},c=await lm(t,u),f=rm(Qh(o)),d=em(f);let p=l[d],h=l[f];if(i){const e="y"===d?"bottom":"right";p=Yh(p+c["y"===d?"top":"left"],p,p-c[e])}if(a){const e="y"===f?"bottom":"right";h=Yh(h+c["y"===f?"top":"left"],h,h-c[e])}const m=s.fn({...t,[d]:p,[f]:h});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[d]:i,[f]:a}}}}}},Xm=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:u,elements:l}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...y}=Xh(e,t);if(null!=(r=i.arrow)&&r.alignmentOffset)return{};const v=Qh(o),g=rm(s),b=Qh(s)===s,w=await(null==u.isRTL?void 0:u.isRTL(l.floating)),x=d||(b||!m?[im(s)]:function(e){const t=im(e);return[om(e),t,om(t)]}(s)),_="none"!==h;!d&&_&&x.push(...function(e,t,r,n){const o=Jh(e);let i=function(e,t,r){const n=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?i:a;default:return[]}}(Qh(e),"start"===r,n);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(om)))),i}(s,m,h,w));const O=[s,...x],S=await lm(t,y),E=[];let j=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&E.push(S[v]),f){const e=function(e,t,r){void 0===r&&(r=!1);const n=Jh(e),o=nm(e),i=tm(o);let a="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=im(a)),[a,im(a)]}(o,a,w);E.push(S[e[0]],S[e[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every((e=>e<=0))){var P,k;const e=((null==(P=i.flip)?void 0:P.index)||0)+1,t=O[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let r=null==(k=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:k.placement;if(!r)switch(p){case"bestFit":{var C;const e=null==(C=j.filter((e=>{if(_){const t=rm(e.placement);return t===g||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:C[0];e&&(r=e);break}case"initialPlacement":r=s}if(o!==r)return{reset:{placement:r}}}return{}}}},Qm=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:u=()=>{},...l}=Xh(e,t),c=await lm(t,l),f=Qh(o),d=Jh(o),p="y"===rm(o),{width:h,height:m}=i.floating;let y,v;"top"===f||"bottom"===f?(y=f,v=d===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=f,y="end"===d?"top":"bottom");const g=m-c.top-c.bottom,b=h-c.left-c.right,w=Uh(m-c[y],g),x=Uh(h-c[v],b),_=!t.middlewareData.shift;let O=w,S=x;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(S=b),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(O=g),_&&!d){const e=Gh(c.left,0),t=Gh(c.right,0),r=Gh(c.top,0),n=Gh(c.bottom,0);p?S=h-2*(0!==e||0!==t?e+t:Gh(c.left,c.right)):O=m-2*(0!==r||0!==n?r+n:Gh(c.top,c.bottom))}await u({...t,availableWidth:S,availableHeight:O});const E=await a.getDimensions(s.floating);return h!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}},Jm=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Xh(e,t);switch(n){case"referenceHidden":{const e=cm(await lm(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:fm(e)}}}case"escaped":{const e=cm(await lm(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:fm(e)}}}default:return{}}}}},ey=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:a,elements:s,middlewareData:u}=t,{element:l,padding:c=0}=Xh(e,t)||{};if(null==l)return{};const f=am(c),d={x:r,y:n},p=nm(o),h=tm(p),m=await a.getDimensions(l),y="y"===p,v=y?"top":"left",g=y?"bottom":"right",b=y?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-d[p]-i.floating[h],x=d[p]-i.reference[p],_=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l));let O=_?_[b]:0;O&&await(null==a.isElement?void 0:a.isElement(_))||(O=s.floating[b]||i.floating[h]);const S=w/2-x/2,E=O/2-m[h]/2-1,j=Uh(f[v],E),P=Uh(f[g],E),k=j,C=O-m[h]-P,A=O/2-m[h]/2+S,N=Yh(k,A,C),T=!u.arrow&&null!=Jh(o)&&A!==N&&i.reference[h]/2-(A<k?j:P)-m[h]/2<0,M=T?A<k?A-k:A-C:0;return{[p]:d[p]+M,data:{[p]:N,centerOffset:A-N-M,...T&&{alignmentOffset:M}},reset:T}}}),ty=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:l=!0}=Xh(e,t),c={x:r,y:n},f=rm(o),d=em(f);let p=c[d],h=c[f];const m=Xh(s,t),y="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+y.mainAxis,r=i.reference[d]+i.reference[e]-y.mainAxis;p<t?p=t:p>r&&(p=r)}if(l){var v,g;const e="y"===d?"width":"height",t=["top","left"].includes(Qh(o)),r=i.reference[f]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[f])||0)+(t?0:y.crossAxis),n=i.reference[f]+i.reference[e]+(t?0:(null==(g=a.offset)?void 0:g[f])||0)-(t?y.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[d]:p,[f]:h}}}},ry=(e,t,r)=>{const n=new Map,o={platform:qm,...r},i={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),u=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:f}=um(l,n,u),d=n,p={},h=0;for(let r=0;r<s.length;r++){const{name:i,fn:m}=s[r],{x:y,y:v,data:g,reset:b}=await m({x:c,y:f,initialPlacement:n,placement:d,strategy:o,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});c=null!=y?y:c,f=null!=v?v:f,p={...p,[i]:{...p[i],...g}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(l=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:c,y:f}=um(l,d,u))),r=-1)}return{x:c,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var ny="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function oy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!=n--;)if(!oy(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!=n--;){const r=o[n];if(("_owner"!==r||!e.$$typeof)&&!oy(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function iy(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ay(e,t){const r=iy(e);return Math.round(t*r)/r}function sy(e){const t=r.useRef(e);return ny((()=>{t.current=e})),t}const uy=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&function(e){return{}.hasOwnProperty.call(e,"current")}(r)?null!=r.current?ey({element:r.current,padding:n}).fn(t):{}:r?ey({element:r,padding:n}).fn(t):{}}}),ly=(e,t)=>({...Km(e),options:[e,t]}),cy=(e,t)=>({...Ym(e),options:[e,t]}),fy=(e,t)=>({...ty(e),options:[e,t]}),dy=(e,t)=>({...Xm(e),options:[e,t]}),py=(e,t)=>({...Qm(e),options:[e,t]}),hy=(e,t)=>({...Jm(e),options:[e,t]}),my=(e,t)=>({...uy(e),options:[e,t]});var yy=r.forwardRef(((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return(0,ft.jsx)(qo.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,ft.jsx)("polygon",{points:"0,0 30,0 15,10"})})}));yy.displayName="Arrow";var vy=yy;function gy(e){const[t,n]=r.useState(void 0);return zo((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}var by="Popper",[wy,xy]=Do(by),[_y,Oy]=wy(by),Sy=e=>{const{__scopePopper:t,children:n}=e,[o,i]=r.useState(null);return(0,ft.jsx)(_y,{scope:t,anchor:o,onAnchorChange:i,children:n})};Sy.displayName=by;var Ey="PopperAnchor",jy=r.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:o,...i}=e,a=Oy(Ey,n),s=r.useRef(null),u=ct(t,s);return r.useEffect((()=>{a.onAnchorChange(o?.current||s.current)})),o?null:(0,ft.jsx)(qo.div,{...i,ref:u})}));jy.displayName=Ey;var Py="PopperContent",[ky,Cy]=wy(Py),Ay=r.forwardRef(((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:u=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...y}=e,v=Oy(Py,n),[g,b]=r.useState(null),w=ct(t,(e=>b(e))),[x,_]=r.useState(null),O=gy(x),S=O?.width??0,E=O?.height??0,j=o+("center"!==a?"-"+a:""),P="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(c)?c:[c],C=k.length>0,A={padding:P,boundary:k.filter(Ry),altBoundary:C},{refs:N,floatingStyles:T,placement:M,isPositioned:R,middlewareData:L}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:u=!0,whileElementsMounted:l,open:c}=e,[f,d]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=r.useState(o);oy(p,o)||h(o);const[m,y]=r.useState(null),[v,g]=r.useState(null),b=r.useCallback((e=>{e!==O.current&&(O.current=e,y(e))}),[]),w=r.useCallback((e=>{e!==S.current&&(S.current=e,g(e))}),[]),x=a||m,_=s||v,O=r.useRef(null),S=r.useRef(null),E=r.useRef(f),j=null!=l,P=sy(l),k=sy(i),C=sy(c),A=r.useCallback((()=>{if(!O.current||!S.current)return;const e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),ry(O.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==C.current};N.current&&!oy(E.current,t)&&(E.current=t,Wo.flushSync((()=>{d(t)})))}))}),[p,t,n,k,C]);ny((()=>{!1===c&&E.current.isPositioned&&(E.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const N=r.useRef(!1);ny((()=>(N.current=!0,()=>{N.current=!1})),[]),ny((()=>{if(x&&(O.current=x),_&&(S.current=_),x&&_){if(P.current)return P.current(x,_,A);A()}}),[x,_,A,P,j]);const T=r.useMemo((()=>({reference:O,floating:S,setReference:b,setFloating:w})),[b,w]),M=r.useMemo((()=>({reference:x,floating:_})),[x,_]),R=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!M.floating)return e;const t=ay(M.floating,f.x),r=ay(M.floating,f.y);return u?{...e,transform:"translate("+t+"px, "+r+"px)",...iy(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,u,M.floating,f.x,f.y]);return r.useMemo((()=>({...f,update:A,refs:T,elements:M,floatingStyles:R})),[f,A,T,M,R])}({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>Zm(...e,{animationFrame:"always"===h}),elements:{reference:v.anchor},middleware:[ly({mainAxis:i+E,alignmentAxis:s}),l&&cy({mainAxis:!0,crossAxis:!1,limiter:"partial"===d?fy():void 0,...A}),l&&dy({...A}),py({...A,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${r}px`),a.setProperty("--radix-popper-available-height",`${n}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),x&&my({element:x,padding:u}),Ly({arrowWidth:S,arrowHeight:E}),p&&hy({strategy:"referenceHidden",...A})]}),[I,D]=Iy(M),F=Uo(m);zo((()=>{R&&F?.()}),[R,F]);const z=L.arrow?.x,B=L.arrow?.y,V=0!==L.arrow?.centerOffset,[$,U]=r.useState();return zo((()=>{g&&U(window.getComputedStyle(g).zIndex)}),[g]),(0,ft.jsx)("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:R?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,ft.jsx)(ky,{scope:n,placedSide:I,onArrowChange:_,arrowX:z,arrowY:B,shouldHideArrow:V,children:(0,ft.jsx)(qo.div,{"data-side":I,"data-align":D,...y,ref:w,style:{...y.style,animation:R?void 0:"none"}})})})}));Ay.displayName=Py;var Ny="PopperArrow",Ty={top:"bottom",right:"left",bottom:"top",left:"right"},My=r.forwardRef((function(e,t){const{__scopePopper:r,...n}=e,o=Cy(Ny,r),i=Ty[o.placedSide];return(0,ft.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,ft.jsx)(vy,{...n,ref:t,style:{...n.style,display:"block"}})})}));function Ry(e){return null!==e}My.displayName=Ny;var Ly=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[u,l]=Iy(r),c={start:"0%",center:"50%",end:"100%"}[l],f=(o.arrow?.x??0)+a/2,d=(o.arrow?.y??0)+s/2;let p="",h="";return"bottom"===u?(p=i?c:`${f}px`,h=-s+"px"):"top"===u?(p=i?c:`${f}px`,h=`${n.floating.height+s}px`):"right"===u?(p=-s+"px",h=i?c:`${d}px`):"left"===u&&(p=`${n.floating.width+s}px`,h=i?c:`${d}px`),{data:{x:p,y:h}}}});function Iy(e){const[t,r="center"]=e.split("-");return[t,r]}var Dy=Sy,Fy=jy,zy=Ay,By=My;function Vy(e){const t=r.useRef({value:e,previous:e});return r.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}var $y=r.forwardRef(((e,t)=>(0,ft.jsx)(qo.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));$y.displayName="VisuallyHidden";var Uy=[" ","Enter","ArrowUp","ArrowDown"],Gy=[" ","Enter"],Wy="Select",[qy,Hy,Zy]=zh(Wy),[Ky,Yy]=Do(Wy,[Zy,xy]),Xy=xy(),[Qy,Jy]=Ky(Wy),[ev,tv]=Ky(Wy),rv=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:i,onOpenChange:a,value:s,defaultValue:u,onValueChange:l,dir:c,name:f,autoComplete:d,disabled:p,required:h,form:m}=e,y=Xy(t),[v,g]=r.useState(null),[b,w]=r.useState(null),[x,_]=r.useState(!1),O=Vh(c),[S=!1,E]=Go({prop:o,defaultProp:i,onChange:a}),[j,P]=Go({prop:s,defaultProp:u,onChange:l}),k=r.useRef(null),C=!v||(m||!!v.closest("form")),[A,N]=r.useState(new Set),T=Array.from(A).map((e=>e.props.value)).join(";");return(0,ft.jsx)(Dy,{...y,children:(0,ft.jsxs)(Qy,{required:h,scope:t,trigger:v,onTriggerChange:g,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:x,onValueNodeHasChildrenChange:_,contentId:$o(),value:j,onValueChange:P,open:S,onOpenChange:E,dir:O,triggerPointerDownPosRef:k,disabled:p,children:[(0,ft.jsx)(qy.Provider,{scope:t,children:(0,ft.jsx)(ev,{scope:e.__scopeSelect,onNativeOptionAdd:r.useCallback((e=>{N((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:r.useCallback((e=>{N((t=>{const r=new Set(t);return r.delete(e),r}))}),[]),children:n})}),C?(0,ft.jsxs)(Gv,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:d,value:j,onChange:e=>P(e.target.value),disabled:p,form:m,children:[void 0===j?(0,ft.jsx)("option",{value:""}):null,Array.from(A)]},T):null]})})};rv.displayName=Wy;var nv="SelectTrigger",ov=r.forwardRef(((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...i}=e,a=Xy(n),s=Jy(nv,n),u=s.disabled||o,l=ct(t,s.onTriggerChange),c=Hy(n),f=r.useRef("touch"),[d,p,h]=Wv((e=>{const t=c().filter((e=>!e.disabled)),r=t.find((e=>e.value===s.value)),n=qv(t,e,r);void 0!==n&&s.onValueChange(n.value)})),m=e=>{u||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,ft.jsx)(Fy,{asChild:!0,...a,children:(0,ft.jsx)(qo.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":Uv(s.value)?"":void 0,...i,ref:l,onClick:Io(i.onClick,(e=>{e.currentTarget.focus(),"mouse"!==f.current&&m(e)})),onPointerDown:Io(i.onPointerDown,(e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(m(e),e.preventDefault())})),onKeyDown:Io(i.onKeyDown,(e=>{const t=""!==d.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||Uy.includes(e.key)&&(m(),e.preventDefault())}))})})}));ov.displayName=nv;var iv="SelectValue",av=r.forwardRef(((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:a="",...s}=e,u=Jy(iv,r),{onValueNodeHasChildrenChange:l}=u,c=void 0!==i,f=ct(t,u.onValueNodeChange);return zo((()=>{l(c)}),[l,c]),(0,ft.jsx)(qo.span,{...s,ref:f,style:{pointerEvents:"none"},children:Uv(u.value)?(0,ft.jsx)(ft.Fragment,{children:a}):i})}));av.displayName=iv;var sv=r.forwardRef(((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return(0,ft.jsx)(qo.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})}));sv.displayName="SelectIcon";var uv=e=>(0,ft.jsx)(di,{asChild:!0,...e});uv.displayName="SelectPortal";var lv="SelectContent",cv=r.forwardRef(((e,t)=>{const n=Jy(lv,e.__scopeSelect),[o,i]=r.useState();if(zo((()=>{i(new DocumentFragment)}),[]),!n.open){const t=o;return t?Wo.createPortal((0,ft.jsx)(dv,{scope:e.__scopeSelect,children:(0,ft.jsx)(qy.Slot,{scope:e.__scopeSelect,children:(0,ft.jsx)("div",{children:e.children})})}),t):null}return(0,ft.jsx)(hv,{...e,ref:t})}));cv.displayName=lv;var fv=10,[dv,pv]=Ky(lv),hv=r.forwardRef(((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:u,sideOffset:l,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:y,avoidCollisions:v,...g}=e,b=Jy(lv,n),[w,x]=r.useState(null),[_,O]=r.useState(null),S=ct(t,(e=>x(e))),[E,j]=r.useState(null),[P,k]=r.useState(null),C=Hy(n),[A,N]=r.useState(!1),T=r.useRef(!1);r.useEffect((()=>{if(w)return ya(w)}),[w]),yi();const M=r.useCallback((e=>{const[t,...r]=C().map((e=>e.ref.current)),[n]=r.slice(-1),o=document.activeElement;for(const r of e){if(r===o)return;if(r?.scrollIntoView({block:"nearest"}),r===t&&_&&(_.scrollTop=0),r===n&&_&&(_.scrollTop=_.scrollHeight),r?.focus(),document.activeElement!==o)return}}),[C,_]),R=r.useCallback((()=>M([E,w])),[M,E,w]);r.useEffect((()=>{A&&R()}),[A,R]);const{onOpenChange:L,triggerPointerDownPosRef:I}=b;r.useEffect((()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():w.contains(r.target)||L(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}}),[w,L,I]),r.useEffect((()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[L]);const[D,F]=Wv((e=>{const t=C().filter((e=>!e.disabled)),r=t.find((e=>e.ref.current===document.activeElement)),n=qv(t,e,r);n&&setTimeout((()=>n.ref.current.focus()))})),z=r.useCallback(((e,t,r)=>{const n=!T.current&&!r;(void 0!==b.value&&b.value===t||n)&&(j(e),n&&(T.current=!0))}),[b.value]),B=r.useCallback((()=>w?.focus()),[w]),V=r.useCallback(((e,t,r)=>{const n=!T.current&&!r;(void 0!==b.value&&b.value===t||n)&&k(e)}),[b.value]),$="popper"===o?yv:mv,U=$===yv?{side:u,sideOffset:l,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:y,avoidCollisions:v}:{};return(0,ft.jsx)(dv,{scope:n,content:w,viewport:_,onViewportChange:O,itemRefCallback:z,selectedItem:E,onItemLeave:B,itemTextRefCallback:V,focusSelectedItem:R,selectedItemText:P,position:o,isPositioned:A,searchRef:D,children:(0,ft.jsx)(ua,{as:dt,allowPinchZoom:!0,children:(0,ft.jsx)(ii,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Io(i,(e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()})),children:(0,ft.jsx)(Qo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,ft.jsx)($,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...g,...U,onPlaced:()=>N(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:Io(g.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||F(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=C().filter((e=>!e.disabled)).map((e=>e.ref.current));if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout((()=>M(t))),e.preventDefault()}}))})})})})})}));hv.displayName="SelectContentImpl";var mv=r.forwardRef(((e,t)=>{const{__scopeSelect:n,onPlaced:o,...i}=e,a=Jy(lv,n),s=pv(lv,n),[u,l]=r.useState(null),[c,f]=r.useState(null),d=ct(t,(e=>f(e))),p=Hy(n),h=r.useRef(!1),m=r.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:g,focusSelectedItem:b}=s,w=r.useCallback((()=>{if(a.trigger&&a.valueNode&&u&&c&&y&&v&&g){const e=a.trigger.getBoundingClientRect(),t=c.getBoundingClientRect(),r=a.valueNode.getBoundingClientRect(),n=g.getBoundingClientRect();if("rtl"!==a.dir){const o=n.left-t.left,i=r.left-o,a=e.left-i,s=e.width+a,l=Math.max(s,t.width),c=window.innerWidth-fv,f=Fh(i,[fv,Math.max(fv,c-l)]);u.style.minWidth=s+"px",u.style.left=f+"px"}else{const o=t.right-n.right,i=window.innerWidth-r.right-o,a=window.innerWidth-e.right-i,s=e.width+a,l=Math.max(s,t.width),c=window.innerWidth-fv,f=Fh(i,[fv,Math.max(fv,c-l)]);u.style.minWidth=s+"px",u.style.right=f+"px"}const i=p(),s=window.innerHeight-2*fv,l=y.scrollHeight,f=window.getComputedStyle(c),d=parseInt(f.borderTopWidth,10),m=parseInt(f.paddingTop,10),b=parseInt(f.borderBottomWidth,10),w=d+m+l+parseInt(f.paddingBottom,10)+b,x=Math.min(5*v.offsetHeight,w),_=window.getComputedStyle(y),O=parseInt(_.paddingTop,10),S=parseInt(_.paddingBottom,10),E=e.top+e.height/2-fv,j=s-E,P=v.offsetHeight/2,k=d+m+(v.offsetTop+P),C=w-k;if(k<=E){const e=i.length>0&&v===i[i.length-1].ref.current;u.style.bottom="0px";const t=c.clientHeight-y.offsetTop-y.offsetHeight,r=k+Math.max(j,P+(e?S:0)+t+b);u.style.height=r+"px"}else{const e=i.length>0&&v===i[0].ref.current;u.style.top="0px";const t=Math.max(E,d+y.offsetTop+(e?O:0)+P)+C;u.style.height=t+"px",y.scrollTop=k-E+y.offsetTop}u.style.margin=`${fv}px 0`,u.style.minHeight=x+"px",u.style.maxHeight=s+"px",o?.(),requestAnimationFrame((()=>h.current=!0))}}),[p,a.trigger,a.valueNode,u,c,y,v,g,a.dir,o]);zo((()=>w()),[w]);const[x,_]=r.useState();zo((()=>{c&&_(window.getComputedStyle(c).zIndex)}),[c]);const O=r.useCallback((e=>{e&&!0===m.current&&(w(),b?.(),m.current=!1)}),[w,b]);return(0,ft.jsx)(vv,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:h,onScrollButtonChange:O,children:(0,ft.jsx)("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:(0,ft.jsx)(qo.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})}));mv.displayName="SelectItemAlignedPosition";var yv=r.forwardRef(((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=fv,...i}=e,a=Xy(r);return(0,ft.jsx)(zy,{...a,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})}));yv.displayName="SelectPopperPosition";var[vv,gv]=Ky(lv,{}),bv="SelectViewport",wv=r.forwardRef(((e,t)=>{const{__scopeSelect:n,nonce:o,...i}=e,a=pv(bv,n),s=gv(bv,n),u=ct(t,a.onViewportChange),l=r.useRef(0);return(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,ft.jsx)(qy.Slot,{scope:n,children:(0,ft.jsx)(qo.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Io(i.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=s;if(n?.current&&r){const e=Math.abs(l.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*fv,o=parseFloat(r.style.minHeight),i=parseFloat(r.style.height),a=Math.max(o,i);if(a<n){const o=a+e,i=Math.min(n,o),s=o-i;r.style.height=i+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}l.current=t.scrollTop}))})})]})}));wv.displayName=bv;var xv="SelectGroup",[_v,Ov]=Ky(xv),Sv=r.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e,o=$o();return(0,ft.jsx)(_v,{scope:r,id:o,children:(0,ft.jsx)(qo.div,{role:"group","aria-labelledby":o,...n,ref:t})})}));Sv.displayName=xv;var Ev="SelectLabel",jv=r.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ov(Ev,r);return(0,ft.jsx)(qo.div,{id:o.id,...n,ref:t})}));jv.displayName=Ev;var Pv="SelectItem",[kv,Cv]=Ky(Pv),Av=r.forwardRef(((e,t)=>{const{__scopeSelect:n,value:o,disabled:i=!1,textValue:a,...s}=e,u=Jy(Pv,n),l=pv(Pv,n),c=u.value===o,[f,d]=r.useState(a??""),[p,h]=r.useState(!1),m=ct(t,(e=>l.itemRefCallback?.(e,o,i))),y=$o(),v=r.useRef("touch"),g=()=>{i||(u.onValueChange(o),u.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,ft.jsx)(kv,{scope:n,value:o,disabled:i,textId:y,isSelected:c,onItemTextChange:r.useCallback((e=>{d((t=>t||(e?.textContent??"").trim()))}),[]),children:(0,ft.jsx)(qy.ItemSlot,{scope:n,value:o,disabled:i,textValue:f,children:(0,ft.jsx)(qo.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:m,onFocus:Io(s.onFocus,(()=>h(!0))),onBlur:Io(s.onBlur,(()=>h(!1))),onClick:Io(s.onClick,(()=>{"mouse"!==v.current&&g()})),onPointerUp:Io(s.onPointerUp,(()=>{"mouse"===v.current&&g()})),onPointerDown:Io(s.onPointerDown,(e=>{v.current=e.pointerType})),onPointerMove:Io(s.onPointerMove,(e=>{v.current=e.pointerType,i?l.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:Io(s.onPointerLeave,(e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()})),onKeyDown:Io(s.onKeyDown,(e=>{""!==l.searchRef?.current&&" "===e.key||(Gy.includes(e.key)&&g()," "===e.key&&e.preventDefault())}))})})})}));Av.displayName=Pv;var Nv="SelectItemText",Tv=r.forwardRef(((e,t)=>{const{__scopeSelect:n,className:o,style:i,...a}=e,s=Jy(Nv,n),u=pv(Nv,n),l=Cv(Nv,n),c=tv(Nv,n),[f,d]=r.useState(null),p=ct(t,(e=>d(e)),l.onItemTextChange,(e=>u.itemTextRefCallback?.(e,l.value,l.disabled))),h=f?.textContent,m=r.useMemo((()=>(0,ft.jsx)("option",{value:l.value,disabled:l.disabled,children:h},l.value)),[l.disabled,l.value,h]),{onNativeOptionAdd:y,onNativeOptionRemove:v}=c;return zo((()=>(y(m),()=>v(m))),[y,v,m]),(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(qo.span,{id:l.textId,...a,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Wo.createPortal(a.children,s.valueNode):null]})}));Tv.displayName=Nv;var Mv="SelectItemIndicator",Rv=r.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e;return Cv(Mv,r).isSelected?(0,ft.jsx)(qo.span,{"aria-hidden":!0,...n,ref:t}):null}));Rv.displayName=Mv;var Lv="SelectScrollUpButton",Iv=r.forwardRef(((e,t)=>{const n=pv(Lv,e.__scopeSelect),o=gv(Lv,e.__scopeSelect),[i,a]=r.useState(!1),s=ct(t,o.onScrollButtonChange);return zo((()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;a(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[n.viewport,n.isPositioned]),i?(0,ft.jsx)(zv,{...e,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));Iv.displayName=Lv;var Dv="SelectScrollDownButton",Fv=r.forwardRef(((e,t)=>{const n=pv(Dv,e.__scopeSelect),o=gv(Dv,e.__scopeSelect),[i,a]=r.useState(!1),s=ct(t,o.onScrollButtonChange);return zo((()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;a(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[n.viewport,n.isPositioned]),i?(0,ft.jsx)(zv,{...e,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));Fv.displayName=Dv;var zv=r.forwardRef(((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...i}=e,a=pv("SelectScrollButton",n),s=r.useRef(null),u=Hy(n),l=r.useCallback((()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)}),[]);return r.useEffect((()=>()=>l()),[l]),zo((()=>{const e=u().find((e=>e.ref.current===document.activeElement));e?.ref.current?.scrollIntoView({block:"nearest"})}),[u]),(0,ft.jsx)(qo.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Io(i.onPointerDown,(()=>{null===s.current&&(s.current=window.setInterval(o,50))})),onPointerMove:Io(i.onPointerMove,(()=>{a.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(o,50))})),onPointerLeave:Io(i.onPointerLeave,(()=>{l()}))})})),Bv=r.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e;return(0,ft.jsx)(qo.div,{"aria-hidden":!0,...n,ref:t})}));Bv.displayName="SelectSeparator";var Vv="SelectArrow",$v=r.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e,o=Xy(r),i=Jy(Vv,r),a=pv(Vv,r);return i.open&&"popper"===a.position?(0,ft.jsx)(By,{...o,...n,ref:t}):null}));function Uv(e){return""===e||void 0===e}$v.displayName=Vv;var Gv=r.forwardRef(((e,t)=>{const{value:n,...o}=e,i=r.useRef(null),a=ct(t,i),s=Vy(n);return r.useEffect((()=>{const e=i.current,t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}}),[s,n]),(0,ft.jsx)($y,{asChild:!0,children:(0,ft.jsx)("select",{...o,ref:a,defaultValue:n})})}));function Wv(e){const t=Uo(e),n=r.useRef(""),o=r.useRef(0),i=r.useCallback((e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout((()=>e("")),1e3))}(r)}),[t]),a=r.useCallback((()=>{n.current="",window.clearTimeout(o.current)}),[]);return r.useEffect((()=>()=>window.clearTimeout(o.current)),[]),[n,i,a]}function qv(e,t,r){const n=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,o=r?e.indexOf(r):-1;let i=function(e,t){return e.map(((r,n)=>e[(t+n)%e.length]))}(e,Math.max(o,0));1===n.length&&(i=i.filter((e=>e!==r)));const a=i.find((e=>e.textValue.toLowerCase().startsWith(n.toLowerCase())));return a!==r?a:void 0}Gv.displayName="BubbleSelect";var Hv=rv,Zv=ov,Kv=av,Yv=sv,Xv=uv,Qv=cv,Jv=wv,eg=Av,tg=Tv,rg=Rv;const ng=mo("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),og=mo("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var ig=["className","children"],ag=["className","children","position"],sg=["className","children"];function ug(){return ug=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ug.apply(null,arguments)}function lg(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var cg=Hv,fg=Kv,dg=r.forwardRef((function(e,t){var r=e.className,n=e.children,o=lg(e,ig);return io(Zv,ug({ref:t,className:Nr("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r)},o),n,io(Yv,{asChild:!0},io(ng,{className:"h-4 w-4 opacity-50"})))}));dg.displayName=Zv.displayName;var pg=r.forwardRef((function(e,t){var r=e.className,n=e.children,o=e.position,i=void 0===o?"popper":o,a=lg(e,ag);return io(Xv,null,io(Qv,ug({ref:t,className:Nr("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:i},a),io(Jv,{className:Nr("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},n)))}));pg.displayName=Qv.displayName;var hg=r.forwardRef((function(e,t){var r=e.className,n=e.children,o=lg(e,sg);return io(eg,ug({ref:t,className:Nr("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r)},o),io("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},io(rg,null,io(og,{className:"h-4 w-4"}))),io(tg,null,n))}));function mg(e){return mg="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},mg(e)}function yg(){return yg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yg.apply(null,arguments)}function vg(){vg=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==mg(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(mg(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function gg(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function bg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wg(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?wg(e,t):void 0}}(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.")}()}function wg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}hg.displayName=eg.displayName;var xg=Xf.object({fromEmail:Xf.string().email({message:"Need a valid email address."}),sendTo:Xf.string().email({message:"Need a valid email address."})});function _g(e){var t=e.open,n=e.onOpenChange,o=e.connection,a=bg((0,r.useState)([]),2),s=a[0],u=a[1],l=Nh(),c=l.data,f=l.isLoading;l.isError;(0,r.useEffect)((function(){t&&u((null==c?void 0:c.data)||[])}),[t,c]);var d=Zu({resolver:el(xg),defaultValues:{sendTo:"",fromEmail:o.fromEmail}});(0,r.useEffect)((function(){if(s.length>0){var e,t=(null===(e=s.find((function(e){return e.email===o.fromEmail})))||void 0===e?void 0:e.email)||s[0].email;d.setValue("fromEmail",t)}}),[s]);var p=jh(),h=p.mutateAsync,m=p.isPending,y=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){gg(i,n,o,a,s,"next",e)}function s(e){gg(i,n,o,a,s,"throw",e)}a(void 0)}))}}(vg().mark((function e(t){var r;return vg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={provider:o.provider,sendTo:t.sendTo,fromEmail:t.fromEmail||o.fromEmail},e.next=3,h(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return io(cs,{open:t,onOpenChange:n},io(ms,{style:{zIndex:999999}},io(ys,null,io(vs,null,(0,Lo.__)("Send Test Email","trigger")),io(gs,null,(0,Lo.__)("Send a test email to verify your connection is working properly.","trigger"))),io("div",{className:"pt-4"},io("div",{className:"mb-4"},io("p",{className:"text-sm font-medium mb-1"},(0,Lo.__)("Provider","trigger")),io(xs,{className:"text-sm [&:disabled]:opacity-100",value:o.provider,disabled:!0}))),io(vl,d,io("form",{onSubmit:d.handleSubmit(y),className:"space-y-4"},io("div",{className:"mb-4"},io("p",{className:"text-sm font-medium mb-1"},(0,Lo.__)("From","trigger"))),f?io("div",{className:"flex justify-left items-center h-[40px]"},io(_s,{className:"h-4 w-4 animate-spin mr-2"}),(0,Lo.__)("Loading...","trigger")):io(bl,{control:d.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(cg,{value:t.value,onValueChange:t.onChange},io(dg,null,io(fg,{placeholder:(0,Lo.__)("Select verified email","trigger")})),io(pg,{style:{zIndex:999999}},s.map((function(e){return io(hg,{key:e.email,value:e.email},e.email)})))))}}),io(bl,{control:d.control,name:"sendTo",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Send To","trigger")),io(Sl,null,io(xs,yg({placeholder:"example@example.com"},t,{autoFocus:!0}))),io(kl,null))}}),io("div",{className:"flex justify-end gap-2 mt-6"},io(fs,{asChild:!0},io(lo,{variant:"outline"},(0,Lo.__)("Cancel","trigger"))),io(lo,{type:"submit",disabled:m},m?io(i().Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Sending...","trigger")):(0,Lo.__)("Send Test Email","trigger")))))))}function Og(e){return Og="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},Og(e)}function Sg(){return Sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sg.apply(null,arguments)}function Eg(){Eg=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Og(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Og(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function jg(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Pg(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){jg(i,n,o,a,s,"next",e)}function s(e){jg(i,n,o,a,s,"throw",e)}a(void 0)}))}}function kg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Cg(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Cg(e,t):void 0}}(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.")}()}function Cg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Ag=Xf.object({fromEmail:Xf.string().email({message:"Need a valid email address."}),sendTo:Xf.string().email({message:"Need a valid email address."})});function Ng(e){var t=e.open,n=e.onOpenChange,o=e.connection,a="".concat(rd.site_url,"/wp-admin/admin.php?page=trigger"),s=kg((0,r.useState)(!1),2),u=s[0],l=s[1],c=Zu({resolver:el(Ag),defaultValues:{sendTo:"",fromEmail:o.fromEmail}}),f=jh(),d=f.mutateAsync,p=f.isPending,h=function(){var e=Pg(Eg().mark((function e(t){var r;return Eg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={provider:o.provider,sendTo:t.sendTo,fromEmail:t.fromEmail||o.fromEmail},e.next=3,d(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),m=kh(),y=function(){var e=Pg(Eg().mark((function e(t){return Eg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,m.mutateAsync();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),v=Ah();(0,r.useEffect)((function(){t&&g()}),[t]);var g=function(){var e=Pg(Eg().mark((function e(){var t,r;return Eg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v.mutateAsync();case 2:t=e.sent,r=t.status_code,l(200===r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return io(cs,{open:t,onOpenChange:n},io(ms,{style:{zIndex:999999,maxWidth:"550px"}},v.isPending?io(_s,{className:"animate-spin mx-auto mt-10"}):u?io(i().Fragment,null,io(ys,null,io(vs,null,(0,Lo.__)("Send Test Email","trigger")),io(gs,null,(0,Lo.__)("Send a test email to verify your connection is working properly.","trigger"))),io("div",{className:"pt-4"},io("div",{className:"mb-4"},io("p",{className:"text-sm font-medium mb-1"},(0,Lo.__)("Provider","trigger")),io(xs,{className:"text-sm [&:disabled]:opacity-100",value:o.provider,disabled:!0}))),io(vl,c,io("form",{onSubmit:c.handleSubmit(h),className:"space-y-4"},io("div",{className:"mb-4"},io("p",{className:"text-sm font-medium mb-1"},(0,Lo.__)("From","trigger"))),io(bl,{control:c.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io(Sl,null,io(xs,Sg({placeholder:"example@example.com"},t,{autoFocus:!0}))),io(kl,null))}}),io(bl,{control:c.control,name:"sendTo",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Send To","trigger")),io(Sl,null,io(xs,Sg({placeholder:"example@example.com"},t,{autoFocus:!0}))),io(kl,null))}}),io("div",{className:"flex justify-end gap-2 mt-6"},io(fs,{asChild:!0},io(lo,{variant:"outline"},(0,Lo.__)("Cancel","trigger"))),io(lo,{type:"submit",disabled:p},p?io(i().Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Sending...","trigger")):(0,Lo.__)("Send Test Email","trigger")))))):io(i().Fragment,null,io(ys,{className:"mt-10"},io(vs,null,(0,Lo.__)("Set this redirect uri into your google console","trigger"))),io("div",{className:"mt-4"},io("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md mb-4"},io(xs,{value:a,readOnly:!0,className:"flex-1"}),io(lo,{variant:"outline",size:"icon",onClick:function(){navigator.clipboard.writeText(a),mh.success((0,Lo.__)("Copied to clipboard","trigger"))}},io("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},io("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),io("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})))),io(lo,{variant:"default",size:"icon",onClick:function(e){return y(e)},className:"w-full"},m.isPending?io(i().Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Connecting...","trigger")):io(i().Fragment,null,(0,Lo.__)("Connect With Gmail","trigger")))))))}var Tg=o(1594);function Mg(e){var t=e.open,r=e.onOpenChange,n=e.connection;return io(Tg.Fragment,null,"smtp"===n.provider&&io(Dh,{open:t,onOpenChange:r,connection:n}),"ses"===n.provider&&io(_g,{open:t,onOpenChange:r,connection:n}),"gmail"===n.provider&&io(Ng,{open:t,onOpenChange:r,connection:n}))}var Rg="".concat(rd.site_url,"/wp-admin/admin.php?page=trigger"),Lg=[{label:"SMTP",value:"smtp"},{label:"Amazon SES",value:"ses"},{label:"Gmail",value:"gmail"}],Ig=[{label:"None",value:"none"},{label:"SSL",value:"ssl"},{label:"TLS",value:"tls"}],Dg=[{value:"us-east-1",label:"US East (N. Virginia)"},{value:"us-east-2",label:"US East (Ohio)"},{value:"us-west-1",label:"US West (N. California)"},{value:"us-west-2",label:"US West (Oregon)"},{value:"eu-west-1",label:"EU (Ireland)"},{value:"eu-central-1",label:"EU (Frankfurt)"},{value:"ap-south-1",label:"Asia Pacific (Mumbai)"},{value:"ap-southeast-1",label:"Asia Pacific (Singapore)"},{value:"ap-southeast-2",label:"Asia Pacific (Sydney)"},{value:"ap-northeast-1",label:"Asia Pacific (Tokyo)"}],Fg=Xf.enum(["smtp","ses","gmail"],{message:"Email Provider is required"}),zg=Xf.enum(["none","ssl","tls"],{message:"SMTP Security isn't required!"}).default("tls"),Bg=Xf.enum(["25","465","587"],{message:"SMTP port isn't valid!"}),Vg=Xf.object({provider:Fg,fromName:Xf.string().min(1,{message:"From Name is required"}),fromEmail:Xf.string().email({message:"Invalid email address"}),smtpHost:Xf.string().min(1,{message:"SMTP Host is required"}),smtpPort:Bg,smtpSecurity:zg,smtpUsername:Xf.string().min(1,{message:"SMTP Username is required"}),smtpPassword:Xf.string().min(1,{message:"SMTP Password is required"})}),$g=Xf.object({provider:Fg,fromName:Xf.string().min(1,{message:"From Name is required"}),fromEmail:Xf.string().email({message:"Invalid email address"}),accessKeyId:Xf.string().min(1,{message:"Access Key ID is required"}),secretAccessKey:Xf.string().min(1,{message:"Secret Access Key is required"}),region:Xf.string().min(1,{message:"Region is required"})}),Ug=Xf.object({provider:Fg,fromName:Xf.string().min(1,{message:"From Name is required"}),fromEmail:Xf.string().email({message:"Invalid email address"}),clientId:Xf.string().min(1,{message:"Client ID is required"}),clientSecret:Xf.string().min(1,{message:"Client Secret is required"})}),Gg=(Xf.object({provider:Fg,fromEmail:Xf.string().email({message:"Invalid From-email address"}),sendTo:Xf.string().email({message:"Invalid Send-to Email address"})}),o(1594));function Wg(e){return Wg="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},Wg(e)}function qg(){return qg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qg.apply(null,arguments)}function Hg(){Hg=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Wg(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Wg(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Zg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zg(Object(r),!0).forEach((function(t){Yg(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Wg(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Wg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Wg(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xg(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}const Qg=function(e){var t=e.connection,n=Zu({resolver:el(Vg),defaultValues:{provider:t.provider||"smtp",fromName:t.fromName||"",fromEmail:t.fromEmail||"",smtpHost:t.smtpHost||"",smtpPort:t.smtpPort,smtpSecurity:t.smtpSecurity,smtpUsername:t.smtpUsername||"",smtpPassword:t.smtpPassword||""},mode:"onChange"});(0,r.useEffect)((function(){t&&n.reset({provider:t.provider||"smtp",fromName:t.fromName||"",fromEmail:t.fromEmail||"",smtpHost:t.smtpHost||"",smtpPort:t.smtpPort,smtpSecurity:t.smtpSecurity,smtpUsername:t.smtpUsername||"",smtpPassword:t.smtpPassword||""})}),[t,n]);var o=Eh(),i=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Xg(i,n,o,a,s,"next",e)}function s(e){Xg(i,n,o,a,s,"throw",e)}a(void 0)}))}}(Hg().mark((function e(t){var r;return Hg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Kg({},t),e.next=3,o.mutateAsync(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return io(vl,n,io("form",{onSubmit:n.handleSubmit(i),className:"space-y-4 py-4"},io(bl,{control:n.control,name:"fromName",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Name","trigger")),io(Sl,null,io(xs,qg({placeholder:"Sender Name"},t,{autoFocus:!0}))),io(kl,null))}}),io(bl,{control:n.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io(Sl,null,io(xs,qg({type:"email",placeholder:"sender@example.com"},t))),io(kl,null))}}),io(bl,{control:n.control,name:"smtpHost",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Host","trigger")),io(Sl,null,io(xs,qg({placeholder:"smtp.example.com"},t))),io(kl,null))}}),io(bl,{control:n.control,name:"smtpPort",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Port","trigger")),io(Sl,null,io(xs,qg({placeholder:"587"},t))),io(kl,null))}}),io(bl,{control:n.control,name:"smtpSecurity",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Security","trigger")),io(cg,{onValueChange:t.onChange,defaultValue:t.value},io(Sl,null,io(dg,null,io(fg,{placeholder:(0,Lo.__)("Select security type","trigger")}))),io(pg,{style:{zIndex:999999}},io(hg,{value:"none"},(0,Lo.__)("None","trigger")),io(hg,{value:"ssl"},(0,Lo.__)("SSL","trigger")),io(hg,{value:"tls"},(0,Lo.__)("TLS","trigger")))),io(kl,null))}}),io(bl,{control:n.control,name:"smtpUsername",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Username","trigger")),io(Sl,null,io(xs,qg({placeholder:"username"},t))),io(kl,null))}}),io(bl,{control:n.control,name:"smtpPassword",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Password","trigger")),io(Sl,null,io(xs,qg({type:"password",placeholder:"••••••••"},t))),io(kl,null))}}),io("div",{className:"flex justify-end gap-2 mt-6"},io(lo,{type:"submit",disabled:n.formState.isSubmitting},n.formState.isSubmitting?io(Gg.Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Updating...","trigger")):(0,Lo.__)("Save Changes","trigger")))))};var Jg=o(1594);function eb(e){return eb="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},eb(e)}function tb(){return tb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tb.apply(null,arguments)}function rb(){rb=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==eb(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(eb(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function nb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ob(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nb(Object(r),!0).forEach((function(t){ib(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ib(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=eb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==eb(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ab(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}const sb=function(e){var t=e.connection,n=Zu({resolver:el($g),defaultValues:{provider:t.provider,fromName:t.fromName||"",fromEmail:t.fromEmail||"",accessKeyId:t.accessKeyId||"",secretAccessKey:t.secretAccessKey||"",region:t.region||""},mode:"onChange"});(0,r.useEffect)((function(){t&&n.reset({provider:t.provider,fromName:t.fromName||"",fromEmail:t.fromEmail||"",accessKeyId:t.accessKeyId||"",secretAccessKey:t.secretAccessKey||"",region:t.region||""})}),[t,n]);var o=Eh(),i=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ab(i,n,o,a,s,"next",e)}function s(e){ab(i,n,o,a,s,"throw",e)}a(void 0)}))}}(rb().mark((function e(t){var r;return rb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ob({},t),e.next=3,o.mutateAsync(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return io(vl,n,io("form",{onSubmit:n.handleSubmit(i),className:"space-y-4 py-4"},io(bl,{control:n.control,name:"fromName",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Name","trigger")),io(Sl,null,io(xs,tb({placeholder:"Sender Name"},t,{autoFocus:!0}))),io(kl,null))}}),io(bl,{control:n.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io("div",null,io(Sl,{className:"flex-1"},io(xs,tb({type:"email",placeholder:"sender@example.com"},t)))),io(El,null,(0,Lo.__)("AWS SES requires email addresses to be verified before they can be used to send emails.","trigger")),io(kl,null))}}),io(bl,{control:n.control,name:"accessKeyId",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Access Key ID","trigger")),io(Sl,null,io(xs,tb({placeholder:"AKIAXXXXXXXXXXXXXXXX"},t))),io(kl,null))}}),io(bl,{control:n.control,name:"secretAccessKey",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Secret Access Key","trigger")),io(Sl,null,io(xs,tb({type:"password",placeholder:"••••••••••••••••••••••••••••••••"},t))),io(kl,null))}}),io(bl,{control:n.control,name:"region",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Region","trigger")),io(cg,{onValueChange:t.onChange,defaultValue:t.value},io(Sl,null,io(dg,null,io(fg,{placeholder:(0,Lo.__)("Select region","trigger")}))),io(pg,{style:{zIndex:999999}},Dg.map((function(e){return io(hg,{key:e.value,value:e.value},(0,Lo.__)(e.label,"trigger"))})))),io(kl,null))}}),io("div",{className:"flex justify-end gap-2 mt-6"},io(lo,{type:"submit",disabled:n.formState.isSubmitting},n.formState.isSubmitting?io(Jg.Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Updating...","trigger")):(0,Lo.__)("Save Changes","trigger")))))};var ub=o(1594);function lb(e){return lb="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},lb(e)}function cb(){return cb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cb.apply(null,arguments)}function fb(){fb=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==lb(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(lb(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function db(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?db(Object(r),!0).forEach((function(t){hb(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):db(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function hb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=lb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=lb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==lb(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mb(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function yb(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){mb(i,n,o,a,s,"next",e)}function s(e){mb(i,n,o,a,s,"throw",e)}a(void 0)}))}}function vb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gb(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gb(e,t):void 0}}(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.")}()}function gb(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const bb=function(e){var t=e.connection,n=vb((0,r.useState)(!1),2),o=n[0],i=n[1],a=Zu({resolver:el(Ug),defaultValues:{provider:t.provider,fromName:t.fromName||"",fromEmail:t.fromEmail||"",clientId:t.clientId||"",clientSecret:t.clientSecret||""},mode:"onChange"});(0,r.useEffect)((function(){t&&a.reset({provider:t.provider,fromName:t.fromName||"",fromEmail:t.fromEmail||"",clientId:t.clientId||"",clientSecret:t.clientSecret||""})}),[t,a]);var s=Eh(),u=function(){var e=yb(fb().mark((function e(t){var r;return fb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=pb({},t),e.next=3,s.mutateAsync(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),l=kh(),c=function(){var e=yb(fb().mark((function e(t){return fb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,l.mutateAsync();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),f=Ah();(0,r.useEffect)((function(){d()}),[]);var d=function(){var e=yb(fb().mark((function e(){var t,r;return fb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.mutateAsync();case 2:t=e.sent,r=t.status_code,i(200===r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return io(ub.Fragment,null,io(vl,a,io("form",{onSubmit:a.handleSubmit(u),className:"space-y-4 py-4"},io(bl,{control:a.control,name:"fromName",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Name","trigger")),io(Sl,null,io(xs,cb({placeholder:"Sender Name"},t,{autoFocus:!0}))),io(kl,null))}}),io(bl,{control:a.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io("div",null,io(Sl,{className:"flex-1"},io(xs,cb({type:"email",placeholder:"sender@example.com"},t)))),io(El,null,(0,Lo.__)("AWS SES requires email addresses to be verified before they can be used to send emails.","trigger")),io(kl,null))}}),io(bl,{control:a.control,name:"clientId",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Client ID","trigger")),io(Sl,null,io(xs,cb({placeholder:"AKIAXXXXXXXXXXXXXXXX"},t))),io(kl,null))}}),io(bl,{control:a.control,name:"clientSecret",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Client Secret","trigger")),io(Sl,null,io(xs,cb({type:"password",placeholder:"••••••••••••••••••••••••••••••••"},t))),io(kl,null))}}),io("div",{className:"flex justify-end gap-2 mt-6"},io(lo,{type:"submit",disabled:a.formState.isSubmitting},a.formState.isSubmitting?io(ub.Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Updating...","trigger")):(0,Lo.__)("Save Changes","trigger"))))),io("hr",{className:"mt-4"}),io("div",{className:"mt-4"},io("h2",{className:"mb-2"},(0,Lo.__)("Use this URI to your google cloud console","trigger")),io("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md mb-4"},io(xs,{value:Rg,readOnly:!0,className:"flex-1"}),io(lo,{variant:"outline",size:"icon",onClick:yb(fb().mark((function e(){return fb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,up(Rg);case 2:mh.success((0,Lo.__)("Copied to clipboard","trigger"));case 3:case"end":return e.stop()}}),e)})))},io("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},io("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),io("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})))),f.isPending?io(_s,{className:"h-4 w-4 animate-spin mx-auto"}):io(ub.Fragment,null,o?io(lo,{variant:"destructive",size:"icon",onClick:function(e){return c(e)},className:"w-full"},l.isPending&&io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Reconnect With Gmail","trigger")):io(lo,{variant:"default",size:"icon",onClick:function(e){return c(e)},className:"w-full"},l.isPending&&io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Connect With Gmail","trigger")))))};var wb=o(1594);function xb(e){var t=e.open,r=e.onOpenChange,n=e.connection;return io(cs,{open:t,onOpenChange:r},io(ms,{className:"sm:max-w-md overflow-y-auto",style:{zIndex:999999,maxWidth:"550px"}},io(ys,null,io(vs,null,(0,Lo.__)("Edit Connection","trigger")),io(gs,null,(0,Lo.__)("Update your email connection settings.","trigger"))),"smtp"===n.provider&&io(wb.Fragment,null,io(Qg,{connection:n})),"ses"===n.provider&&io(wb.Fragment,null,io(sb,{connection:n})),"gmail"===n.provider&&io(bb,{connection:n})))}var _b=["className"],Ob=["className","children"],Sb=["className"],Eb=["className"],jb=["className"],Pb=["className"];function kb(){return kb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kb.apply(null,arguments)}function Cb(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Ab=Ka,Nb=Ya,Tb=r.forwardRef((function(e,t){var r=e.className,n=Cb(e,_b);return io(Xa,kb({ref:t,className:Nr("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r)},n))}));Tb.displayName=Xa.displayName;var Mb=r.forwardRef((function(e,t){var r=e.className,n=e.children,o=Cb(e,Ob);return io(Nb,null,io(Tb,null),io(Qa,kb({ref:t,className:Nr("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r)},o),n,io(ts,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},io(rs,{className:"h-4 w-4"}),io("span",{className:"sr-only"},(0,Lo.__)("Close","trigger")))))}));Mb.displayName=Qa.displayName;var Rb=function(e){var t=e.className,r=Cb(e,Sb);return io("div",kb({className:Nr("flex flex-col space-y-1.5 text-center sm:text-left",t)},r))};Rb.displayName="DialogHeader";var Lb=function(e){var t=e.className,r=Cb(e,Eb);return io("div",kb({className:Nr("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},r))};Lb.displayName="DialogFooter";var Ib=r.forwardRef((function(e,t){var r=e.className,n=Cb(e,jb);return io(Ja,kb({ref:t,className:Nr("text-lg font-semibold leading-none tracking-tight",r)},n))}));Ib.displayName=Ja.displayName;var Db=r.forwardRef((function(e,t){var r=e.className,n=Cb(e,Pb);return io(es,kb({ref:t,className:Nr("text-sm text-muted-foreground",r)},n))}));function Fb(e){return Fb="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},Fb(e)}function zb(){return zb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zb.apply(null,arguments)}function Bb(){Bb=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Fb(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Fb(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Vb(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}Db.displayName=es.displayName;var $b={default:{confirmButton:"bg-primary hover:bg-primary/90",icon:"text-primary"},danger:{confirmButton:"bg-destructive hover:bg-destructive/90 text-destructive-foreground",icon:"text-destructive"},warning:{confirmButton:"bg-yellow-500 hover:bg-yellow-600 text-white",icon:"text-yellow-500"},success:{confirmButton:"bg-green-500 hover:bg-green-600 text-white",icon:"text-green-500"}},Ub=function(e){var t=e.open,r=e.onOpenChange,n=e.title,o=void 0===n?"Confirm Action":n,a=e.description,s=e.children,u=e.icon,l=e.variant,c=void 0===l?"default":l,f=e.onConfirm,d=e.onCancel,p=e.confirmText,h=void 0===p?"Confirm":p,m=e.cancelText,y=void 0===m?"Cancel":m,v=e.confirmButtonProps,g=e.cancelButtonProps,b=e.loading,w=void 0!==b&&b,x=e.loadingText,_=void 0===x?"Processing...":x,O=e.className,S=e.contentClassName,E=e.headerClassName,j=e.footerClassName,P=e.closeOnConfirm,k=void 0===P||P,C=e.preventCloseOnOutsideClick,A=void 0!==C&&C,N=e.hideFooter,T=void 0!==N&&N,M=e.footerContent,R=e.CustomHeader,L=e.CustomFooter,I=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Vb(i,n,o,a,s,"next",e)}function s(e){Vb(i,n,o,a,s,"throw",e)}a(void 0)}))}}(Bb().mark((function e(){return Bb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f();case 3:k&&r(!1),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),D=function(e){A&&t&&!e||(r(e),!e&&d&&d())},F=$b[c];return io(Ab,{open:t,onOpenChange:D},io(Mb,{className:Nr("sm:max-w-[425px]",S,O)},R?io(R,{className:E}):io(Rb,{className:E},io(Ib,{className:"flex items-center gap-2"},u,o),a&&io(Db,null,a)),s,!T&&io(Lb,{className:j},M||io(i().Fragment,null,io(lo,zb({variant:"outline",onClick:function(){return D(!1)},disabled:w},g),y),io(lo,zb({className:Nr(F.confirmButton),disabled:w,onClick:I},v),w&&io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),w?_:h))),L&&io(L,{className:j})))};Ub.Header=Rb,Ub.Footer=Lb,Ub.Title=Ib,Ub.Description=Db;const Gb=mo("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function Wb(e){return Wb="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},Wb(e)}function qb(){qb=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Wb(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Wb(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Hb(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Zb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Kb(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Kb(e,t):void 0}}(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.")}()}function Kb(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Yb(e){var t=e.open,n=e.onOpenChange,o=e.connection,i=e.setInitialConnections,a=Zb((0,r.useState)(!1),2),s=a[0],u=a[1],l=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Hb(i,n,o,a,s,"next",e)}function s(e){Hb(i,n,o,a,s,"throw",e)}a(void 0)}))}}(qb().mark((function e(){var t,r,a;return qb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return");case 2:return u(!0),e.prev=3,(t=new FormData).append("action","delete_email_config"),t.append("trigger_nonce",rd.nonce_value),t.append("provider",o.provider),e.next=10,fetch(rd.ajax_url,{method:"POST",body:t});case 10:return r=e.sent,e.next=13,r.json();case 13:200===(null==(a=e.sent)?void 0:a.status_code)?(i&&Array.isArray(a.data)&&i(a.data),mh.success(a.message||(0,Lo.__)("Connection deleted successfully!"))):mh.error(a.message||(0,Lo.__)("Failed to delete connection. Please try again.","trigger")),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(3),mh.error((0,Lo.__)("An unexpected error occurred. Please try again.","trigger"));case 21:return e.prev=21,u(!1),n(!1),e.finish(21);case 25:case"end":return e.stop()}}),e,null,[[3,17,21,25]])})));return function(){return e.apply(this,arguments)}}();return io(Ub,{open:t,onOpenChange:n,title:(0,Lo.__)("Delete Connection","trigger"),description:(0,Lo.__)("Are you sure you want to delete this connection? This action cannot be undone.","trigger"),icon:io(Gb,{className:"h-5 w-5 text-destructive"}),variant:"danger",confirmText:(0,Lo.__)("Delete","trigger"),cancelText:(0,Lo.__)("Cancel","trigger"),onConfirm:l,loading:s,loadingText:(0,Lo.__)("Deleting...","trigger")},o&&io("div",{className:"space-y-2 mt-2 mb-4"},io("div",{className:"grid grid-cols-2 gap-2"},io("div",null,io("span",{className:"font-medium"},(0,Lo.__)("Provider:","trigger")),io("p",{className:"text-sm text-muted-foreground"},o.provider)),io("div",null,io("span",{className:"font-medium"},(0,Lo.__)("Email:","trigger")),io("p",{className:"text-sm text-muted-foreground"},o.fromEmail)))))}const Xb=mo("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Qb=mo("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Jb=mo("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var ew=["className"],tw=["className"],rw=["className"],nw=["className"],ow=["className"],iw=["className"];function aw(){return aw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aw.apply(null,arguments)}function sw(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var uw=r.forwardRef((function(e,t){var r=e.className,n=sw(e,ew);return io("div",aw({ref:t,className:Nr("rounded-xl border bg-card text-card-foreground shadow",r)},n))}));uw.displayName="Card";var lw=r.forwardRef((function(e,t){var r=e.className,n=sw(e,tw);return io("div",aw({ref:t,className:Nr("flex flex-col space-y-1.5 p-6",r)},n))}));lw.displayName="CardHeader";var cw=r.forwardRef((function(e,t){var r=e.className,n=sw(e,rw);return io("div",aw({ref:t,className:Nr("font-semibold leading-none tracking-tight",r)},n))}));cw.displayName="CardTitle";var fw=r.forwardRef((function(e,t){var r=e.className,n=sw(e,nw);return io("div",aw({ref:t,className:Nr("text-sm text-muted-foreground",r)},n))}));fw.displayName="CardDescription";var dw=r.forwardRef((function(e,t){var r=e.className,n=sw(e,ow);return io("div",aw({ref:t,className:Nr("p-6 pt-0",r)},n))}));dw.displayName="CardContent",r.forwardRef((function(e,t){var r=e.className,n=sw(e,iw);return io("div",aw({ref:t,className:Nr("flex items-center p-6 pt-0",r)},n))})).displayName="CardFooter";var pw=["className","variant"];function hw(){return hw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hw.apply(null,arguments)}var mw=xt("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",success:"bg-green-100 text-green-800 hover:bg-green-200/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input bg-background hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function yw(e){var t=e.className,r=e.variant,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,pw);return io("div",hw({className:Nr(mw({variant:r}),t)},n))}function vw(e){return vw="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},vw(e)}function gw(){return gw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gw.apply(null,arguments)}function bw(){bw=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==vw(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(vw(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function ww(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function xw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _w(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_w(e,t):void 0}}(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.")}()}function _w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Ow=Xf.object({email:Xf.string().email({message:"Please enter a valid email address."})});function Sw(e){var t=e.open,n=e.onOpenChange,o=e.connection,a=xw((0,r.useState)(!1),2),s=(a[0],a[1],xw((0,r.useState)([]),2)),u=s[0],l=s[1],c=xw((0,r.useState)(!1),2),f=(c[0],c[1],Zu({resolver:el(Ow),defaultValues:{email:""}})),d=Nh(),p=d.data,h=d.isLoading,m=d.isFetching,y=(d.isError,d.refetch);(0,r.useEffect)((function(){null!=p&&p.data&&l((null==p?void 0:p.data)||[])}),[p]);var v,g=ep({mutationFn:(v=_h(wh().mark((function e(t){var r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=gh({action:"verify_ses_email"},t),e.next=3,yp(rd.ajax_url,{body:t});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)}))),function(e){return v.apply(this,arguments)}),onSuccess:function(e){var t;mh.success(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Email verified successfully!","trigger"))},onError:function(e){var t;mh.error(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Failed to verify email","trigger"))}}),b=g.mutateAsync,w=g.isPending,x=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ww(i,n,o,a,s,"next",e)}function s(e){ww(i,n,o,a,s,"throw",e)}a(void 0)}))}}(bw().mark((function e(t){var r,n;return bw().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={email:t.email,provider:o.provider},e.next=3,b(r);case 3:n=e.sent,200===n.status_code?(f.reset(),setTimeout((function(){y()}),1e3)):mh.error((0,Lo.__)("Failed to send verification email. Please try again.","trigger"));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return io(cs,{open:t,onOpenChange:n},io(ms,{className:"overflow-y-auto",style:{zIndex:999999}},io(ys,{className:"mb-6"},io(vs,null,(0,Lo.__)("Verify AWS SES Email Address","trigger")),io(gs,null,(0,Lo.__)("AWS SES requires that email addresses be verified before they can be used as a sender. Use this form to verify your email addresses.","trigger"))),io("div",{className:"space-y-8"},io(uw,null,io(lw,null,io(cw,null,(0,Lo.__)("Add New Email Address","trigger")),io(fw,null,(0,Lo.__)("Enter an email address that you want to send emails from","trigger"))),io(dw,null,io(vl,f,io("form",{onSubmit:f.handleSubmit(x),className:"space-y-4"},io(bl,{control:f.control,name:"email",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Email Address","trigger")),io(Sl,null,io(xs,gw({placeholder:"you@example.com"},t))),io(El,null,(0,Lo.__)("You'll receive a verification email with a link to confirm ownership.","trigger")),io(kl,null))}}),io("div",{className:"flex justify-end"},io(lo,{type:"submit",disabled:w},w?io(i().Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Sending...","trigger")):(0,Lo.__)("Send Verification","trigger"))))))),io(uw,null,io(lw,{className:"flex flex-row items-center justify-between space-y-0 pb-2"},io("div",null,io(cw,null,(0,Lo.__)("Verified Email Addresses","trigger")),io(fw,null,(0,Lo.__)("These email addresses have been registered with AWS SES","trigger"))),io(lo,{variant:"outline",size:"sm",className:"gap-1",onClick:function(){y()},disabled:h||m},h||m?io(_s,{className:"h-4 w-4 animate-spin"}):io(Jb,{className:"h-4 w-4"}),(0,Lo.__)("Refresh","trigger"))),io(dw,null,h||m?io("div",{className:"flex justify-center py-6"},io(_s,{className:"h-8 w-8 animate-spin text-muted-foreground"})):u.length>0?io(Po,null,io(ko,null,io(Ao,null,io(No,null,(0,Lo.__)("Email Address","trigger")),io(No,{className:"w-[150px] text-right"},(0,Lo.__)("Status","trigger")))),io(Co,null,u.map((function(e){return io(Ao,{key:e.email},io(To,null,e.email),io(To,{className:"text-right"},"Success"===(t=e.status)?io(yw,{variant:"success",className:"flex items-center gap-1"},io(Xb,{className:"h-3 w-3"}),(0,Lo.__)("Verified","trigger")):"Pending"===t?io(yw,{variant:"outline",className:"flex items-center gap-1 text-yellow-500 border-yellow-500"},io(Qb,{className:"h-3 w-3"}),(0,Lo.__)("Pending","trigger")):io(yw,{variant:"destructive",className:"flex items-center gap-1"},io(Qb,{className:"h-3 w-3"}),t)));var t})))):io("div",{className:"py-6 text-center text-muted-foreground"},(0,Lo.__)("No verified email addresses found. Use the form above to verify an email address.","trigger"))))),io("div",{className:"mt-6 flex justify-end"},io(fs,{asChild:!0},io(lo,{variant:"outline"},(0,Lo.__)("Close","trigger"))))))}var Ew=o(1594);function jw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Pw(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pw(e,t):void 0}}(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.")}()}function Pw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const kw=function(e){var t=e.initialConnections,n=e.setInitialConnections,o=te(),i=jw((0,r.useState)(null),2),a=i[0],s=i[1],u=jw((0,r.useState)(!1),2),l=u[0],c=u[1],f=jw((0,r.useState)(!1),2),d=f[0],p=f[1],h=jw((0,r.useState)(!1),2),m=h[0],y=h[1],v=jw((0,r.useState)(!1),2),g=v[0],b=v[1],w=jw(ot(),1)[0];return"true"===w.get("google_gmail_redirect")&&(mh.success("Gmail connected successfully!"),setTimeout((function(){window.location.assign("".concat(rd.site_url,"/wp-admin/admin.php?page=trigger#/connections"))}),500)),"true"===w.get("google_gmail_redirect_failed")&&(mh.error("Gmail connection failed!"),setTimeout((function(){window.location.assign("".concat(rd.site_url,"/wp-admin/admin.php?page=trigger#/connections"))}),500)),io("div",{className:"rounded-md border mt-10 p-4"},io("div",{className:"flex justify-between py-3 mb-3"},io("h3",{className:"text-lg font-medium"},(0,Lo.__)("Connection List","trigger")),io(lo,{size:"sm",className:"gap-2",onClick:function(){return o("/add-connection")}},io(yo,{className:"h-5 w-5"}),(0,Lo.__)("Add Connection","trigger"))),io(Po,{className:"border-solid border border-rounded-md border-gray-200"},io(ko,{className:"bg-gray-100"},io(Ao,null,io(No,null,(0,Lo.__)("Connection","trigger")),io(No,null,(0,Lo.__)("Provider","trigger")),io(No,null,(0,Lo.__)("Email","trigger")),io(No,{className:"cursor-pointer"},(0,Lo.__)("Created On ↓","trigger")),io(No,null,(0,Lo.__)("Test Email","trigger")),io(No,null,(0,Lo.__)("Actions","trigger")))),io(Co,null,t.map((function(e,t){return io(Ao,{key:t},io(To,null,"ses"===e.provider?io("svg",{width:"25",height:"25",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},io("g",{"clip-path":"url(#clip0_214_10729)"},io("path",{d:"M80 0H0V80H80V0Z",fill:"url(#paint0_linear_214_10729)"}),io("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M57 60.9999C57 59.3738 55.626 57.9998 54 57.9998C52.374 57.9998 51 59.3738 51 60.9999C51 62.6259 52.374 63.9999 54 63.9999C55.626 63.9999 57 62.6259 57 60.9999ZM40 59.9999C38.374 59.9999 37 61.3739 37 62.9999C37 64.6259 38.374 66 40 66C41.626 66 43 64.6259 43 62.9999C43 61.3739 41.626 59.9999 40 59.9999ZM26 57.9998C24.374 57.9998 23 59.3738 23 60.9999C23 62.6259 24.374 63.9999 26 63.9999C27.626 63.9999 29 62.6259 29 60.9999C29 59.3738 27.626 57.9998 26 57.9998ZM28.605 42.9996H51.395L43.739 36.1104L40.649 38.7585C40.463 38.9195 40.23 38.9995 39.999 38.9995C39.768 38.9995 39.535 38.9195 39.349 38.7585L36.26 36.1104L28.605 42.9996ZM27 28.1733V41.7545L34.729 34.7984L27 28.1733ZM51.297 26.9993H28.703L39.999 36.6824L51.297 26.9993ZM53 41.7545V28.1733L45.271 34.7974L53 41.7545ZM59 60.9999C59 63.7099 56.71 66 54 66C51.29 66 49 63.7099 49 60.9999C49 58.6308 50.75 56.5838 53 56.1058V52.9997H41V58.1058C43.25 58.5838 45 60.6309 45 62.9999C45 65.71 42.71 68 40 68C37.29 68 35 65.71 35 62.9999C35 60.6309 36.75 58.5838 39 58.1058V52.9997H27V56.1058C29.25 56.5838 31 58.6308 31 60.9999C31 63.7099 28.71 66 26 66C23.29 66 21 63.7099 21 60.9999C21 58.6308 22.75 56.5838 25 56.1058V51.9997C25 51.4477 25.447 50.9997 26 50.9997H39V44.9996H26C25.447 44.9996 25 44.5516 25 43.9996V25.9993C25 25.4472 25.447 24.9992 26 24.9992H54C54.553 24.9992 55 25.4472 55 25.9993V43.9996C55 44.5516 54.553 44.9996 54 44.9996H41V50.9997H54C54.553 50.9997 55 51.4477 55 51.9997V56.1058C57.25 56.5838 59 58.6308 59 60.9999ZM68 39.9995C68 45.9066 66.177 51.5597 62.727 56.3448L61.104 55.1748C64.307 50.7317 66 45.4846 66 39.9995C66 25.6642 54.337 14 40.001 14C25.664 14 14 25.6642 14 39.9995C14 45.4846 15.693 50.7317 18.896 55.1748L17.273 56.3448C13.823 51.5597 12 45.9066 12 39.9995C12 24.5612 24.561 12 39.999 12C55.438 12 68 24.5612 68 39.9995Z",fill:"white"})),io("defs",null,io("linearGradient",{id:"paint0_linear_214_10729",x1:"0",y1:"8000",x2:"8000",y2:"0",gradientUnits:"userSpaceOnUse"},io("stop",{"stop-color":"#3334B9"}),io("stop",{offset:"1","stop-color":"#4E74F4"})),io("clipPath",{id:"clip0_214_10729"},io("rect",{width:"80",height:"80",fill:"white"})))):io("svg",{width:"25",height:"25",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},io("rect",{width:"20",height:"20",rx:"2",fill:"#5278FF"}),io("path",{d:"M15.0714 4H4.78571C4.07563 4 3.5 4.67157 3.5 5.5V14.5C3.5 15.3284 4.07563 16 4.78571 16H15.0714C15.7815 16 16.3571 15.3284 16.3571 14.5V5.5C16.3571 4.67157 15.7815 4 15.0714 4Z",stroke:"white",strokeWidth:"0.833333"}),io("path",{d:"M16 8L10.618 11.8025C10.4328 11.9316 10.2186 12 10 12C9.78141 12 9.56724 11.9316 9.382 11.8025L4 8",stroke:"white",strokeWidth:"0.833333"}))),io(To,null,sp(e.provider)),io(To,null,e.fromEmail),io(To,null,e.createdAt),io(To,null,io("div",{className:"flex flex-wrap items-center gap-2"},io(lo,{variant:"secondary",size:"sm",className:" text-blue-600 hover:bg-blue-500 hover:text-white",onClick:function(){return function(e){s(e),c(!0)}(e)}},(0,Lo.__)("Send Test Email","trigger")),"ses"===e.provider&&io(Ew.Fragment,null,io(lo,{variant:"outline",size:"sm",onClick:function(){return b(!0)}},(0,Lo.__)("Verify Email","trigger")),io(Sw,{open:g,onOpenChange:b,connection:e})))),io(To,null,io("div",{className:"flex items-center gap-2"},io(lo,{variant:"ghost",size:"icon",onClick:function(){return function(e){s(e),p(!0)}(e)}},io(Mo,{className:"h-4 w-4"})),io(lo,{variant:"ghost",size:"icon",onClick:function(){return function(e){s(e),y(!0)}(e)}},io(Ro,{className:"h-4 w-4 text-red-500"})))))})))),a&&io(Ew.Fragment,null,io(Mg,{open:l,onOpenChange:c,connection:a}),io(xb,{open:d,onOpenChange:p,connection:a}),io(Yb,{open:m,onOpenChange:y,connection:a,setInitialConnections:n})))};function Cw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Aw(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Aw(e,t):void 0}}(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.")}()}function Aw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Nw=function(e){var t=e.onAddConnection;return io("div",{className:"mx-auto max-w-md text-center"},io("div",{className:"flex justify-center mb-6 mt-10"},io("svg",{width:"200",height:"100",viewBox:"0 0 400 300",fill:"none",xmlns:"http://www.w3.org/2000/svg"},io("path",{d:"M50 150C50 80 120 30 200 30C280 30 350 80 350 150C350 220 280 270 200 270C120 270 50 220 50 150Z",fill:"#F3F4F6",opacity:"0.5"}),io("path",{d:"M120 150C120 150 160 100 200 100C240 100 280 150 280 150",stroke:"#E5E7EB",strokeWidth:"2",strokeDasharray:"4 4"}),io("path",{d:"M120 170C120 170 160 220 200 220C240 220 280 170 280 170",stroke:"#E5E7EB",strokeWidth:"2",strokeDasharray:"4 4"}),io("circle",{cx:"120",cy:"150",r:"8",fill:"#6B7280"}),io("circle",{cx:"280",cy:"150",r:"8",fill:"#6B7280"}),io("circle",{cx:"120",cy:"170",r:"8",fill:"#6B7280"}),io("circle",{cx:"280",cy:"170",r:"8",fill:"#6B7280"}),io("g",{transform:"translate(160, 120)"},io("rect",{x:"0",y:"0",width:"80",height:"60",rx:"4",fill:"#4F46E5"}),io("path",{d:"M0 10L40 35L80 10",stroke:"white",strokeWidth:"2",fill:"none"})),io("circle",{cx:"150",cy:"80",r:"5",fill:"#4F46E5",opacity:"0.5"}),io("circle",{cx:"250",cy:"80",r:"5",fill:"#4F46E5",opacity:"0.5"}),io("circle",{cx:"150",cy:"220",r:"5",fill:"#4F46E5",opacity:"0.5"}),io("circle",{cx:"250",cy:"220",r:"5",fill:"#4F46E5",opacity:"0.5"}),io("path",{d:"M320 60L340 80L300 120",fill:"#4F46E5",opacity:"0.7"}),io("path",{d:"M320 60L300 120L310 90",fill:"#4F46E5"}),io("g",{transform:"translate(80, 100) scale(0.5)"},io("rect",{width:"40",height:"30",rx:"2",fill:"#6B7280",opacity:"0.5"}),io("path",{d:"M0 5L20 20L40 5",stroke:"white",strokeWidth:"1",fill:"none"})),io("g",{transform:"translate(300, 200) scale(0.5)"},io("rect",{width:"40",height:"30",rx:"2",fill:"#6B7280",opacity:"0.5"}),io("path",{d:"M0 5L20 20L40 5",stroke:"white",strokeWidth:"1",fill:"none"})))),io("h2",{className:"mb-4 text-2xl font-semibold tracking-tight"},(0,Lo.__)("Create Your First Connection","trigger")),io("p",{className:"mb-4 text-muted-foreground"},(0,Lo.__)("It looks like you haven't set up a SMTP connection yet. Connect to a reliable SMTP provider to ensure your emails are delivered effectively and securely.","trigger")),io(lo,{size:"lg",className:"gap-2",onClick:t},io(yo,{className:"h-5 w-5"}),(0,Lo.__)("Add Connection","trigger")))},Tw=function(){return io("div",{className:"flex items-center justify-center min-h-[400px]"},io("div",{className:"animate-pulse space-y-4"},io("div",{className:"h-4 w-[550px] bg-gray-200 rounded"}),io("div",{className:"h-4 w-[550px] bg-gray-200 rounded"}),io("div",{className:"h-4 w-[550px] bg-gray-200 rounded"})))};const Mw=function(){var e=Cw((0,r.useState)([]),2),t=e[0],n=e[1],o=te(),i=Oh(),a=i.data,s=i.isLoading;return(0,r.useEffect)((function(){a&&n(a.data)}),[a]),io("div",{className:"min-h-[600px] pr-4"},s?io(Tw,null):0===t.length?io("div",{className:"flex items-center justify-center h-full"},io(Nw,{onAddConnection:function(){return o("/add-connection")}})):io(kw,{initialConnections:t,setInitialConnections:n}))};function Rw(e){return Rw="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},Rw(e)}function Lw(){Lw=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Rw(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Rw(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Iw(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Dw(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Iw(i,n,o,a,s,"next",e)}function s(e){Iw(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Fw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return zw(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zw(e,t):void 0}}(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.")}()}function zw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const Bw=function(){var e,t=Fw((0,r.useState)(!0),2),n=(t[0],t[1],Fw((0,r.useState)(!1),2)),o=n[0],i=(n[1],Fw((0,r.useState)([]),2)),a=i[0],s=i[1],u=Fw((0,r.useState)(null),2),l=(u[0],u[1]),c=Fw((0,r.useState)("none"),2),f=c[0],d=c[1],p=Fw((0,r.useState)("30"),2),h=p[0],m=(p[1],ep({mutationFn:(e=_h(wh().mark((function e(t){var r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=gh({action:"update_default_connection"},t),e.next=3,yp(rd.ajax_url,{body:t});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)}),onSuccess:function(e){var t;mh.success(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Default connection updated successfully!","trigger"))},onError:function(e){var t;mh.error(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Failed to update default connection","trigger"))}})),y=m.mutateAsync,v=m.isPending,g=function(){var e=Dw(Lw().mark((function e(t){return Lw().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:y({provider:t}),d(t);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),b=Oh(),w=b.data,x=b.isLoading;(0,r.useEffect)((function(){w&&s(w.data)}),[w]);var _,O=Xd({queryKey:["getDefaultProvider"],queryFn:(_=_h(wh().mark((function e(){var t;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,yp("".concat(rd.rest_url,"/get-default-connections"),{method:"GET"});case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)}))),function(){return _.apply(this,arguments)}),staleTime:5e3}),S=O.data;O.isLoading;(0,r.useEffect)((function(){var e;l(null==S?void 0:S.data),d((null==S||null===(e=S.data)||void 0===e?void 0:e.provider)||"none")}),[S]),(0,r.useEffect)((function(){}),[h]);return io("div",{className:"space-y-8 p-6"},io("div",{className:"flex items-center justify-between"},io("h3",{className:"text-lg font-medium"},(0,Lo.__)("General Settings","trigger")),o&&io("div",{className:"flex items-center text-sm text-muted-foreground"},io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Saving changes...","trigger"))),io("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm"},io("div",{className:"p-6 space-y-6"},io("div",{className:"space-y-4 pt-4 border-t first:border-t-0 first:pt-0"},io("h3",{className:"text-lg font-medium"},(0,Lo.__)("Default Connection","trigger")),x?io("div",{className:"flex items-center space-x-2 h-[40px]"},io(_s,{className:"h-4 w-4 animate-spin"}),io("span",null,(0,Lo.__)("Loading connections...","trigger"))):io(cg,{value:f,onValueChange:function(e){return g(e)},disabled:x||v},io(dg,{className:"max-w-fit"},io(fg,{placeholder:(0,Lo.__)("Select connection","trigger")})),io(pg,null,io(hg,{value:"none"},(0,Lo.__)("None","trigger")),a.map((function(e){return io(hg,{key:"".concat(e.provider,"-").concat(e.fromEmail),value:e.provider},function(e){return"smtp"===e.provider?"SMTP: ".concat(e.fromEmail," (").concat(e.smtpHost,")"):"ses"===e.provider?"SES: ".concat(e.fromEmail," (").concat(e.region,")"):"gmail"===e.provider?"GMAIL: ".concat(e.fromEmail):e.provider}(e))})))),io("p",{className:"text-muted-foreground"},(0,Lo.__)('This connection will be used by default unless a specific "from email" address is provided in the email headers.',"trigger"))))))},Vw=mo("MoveLeft",[["path",{d:"M6 8L2 12L6 16",key:"kyvwex"}],["path",{d:"M2 12H22",key:"1m8cig"}]]);var $w="rovingFocusGroup.onEntryFocus",Uw={bubbles:!1,cancelable:!0},Gw="RovingFocusGroup",[Ww,qw,Hw]=zh(Gw),[Zw,Kw]=Do(Gw,[Hw]),[Yw,Xw]=Zw(Gw),Qw=r.forwardRef(((e,t)=>(0,ft.jsx)(Ww.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,ft.jsx)(Ww.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,ft.jsx)(Jw,{...e,ref:t})})})));Qw.displayName=Gw;var Jw=r.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...d}=e,p=r.useRef(null),h=ct(t,p),m=Vh(a),[y=null,v]=Go({prop:s,defaultProp:u,onChange:l}),[g,b]=r.useState(!1),w=Uo(c),x=qw(n),_=r.useRef(!1),[O,S]=r.useState(0);return r.useEffect((()=>{const e=p.current;if(e)return e.addEventListener($w,w),()=>e.removeEventListener($w,w)}),[w]),(0,ft.jsx)(Yw,{scope:n,orientation:o,dir:m,loop:i,currentTabStopId:y,onItemFocus:r.useCallback((e=>v(e)),[v]),onItemShiftTab:r.useCallback((()=>b(!0)),[]),onFocusableItemAdd:r.useCallback((()=>S((e=>e+1))),[]),onFocusableItemRemove:r.useCallback((()=>S((e=>e-1))),[]),children:(0,ft.jsx)(qo.div,{tabIndex:g||0===O?-1:0,"data-orientation":o,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Io(e.onMouseDown,(()=>{_.current=!0})),onFocus:Io(e.onFocus,(e=>{const t=!_.current;if(e.target===e.currentTarget&&t&&!g){const t=new CustomEvent($w,Uw);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));nx([e.find((e=>e.active)),e.find((e=>e.id===y)),...e].filter(Boolean).map((e=>e.ref.current)),f)}}_.current=!1})),onBlur:Io(e.onBlur,(()=>b(!1)))})})})),ex="RovingFocusGroupItem",tx=r.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:a,...s}=e,u=$o(),l=a||u,c=Xw(ex,n),f=c.currentTabStopId===l,d=qw(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return r.useEffect((()=>{if(o)return p(),()=>h()}),[o,p,h]),(0,ft.jsx)(Ww.ItemSlot,{scope:n,id:l,focusable:o,active:i,children:(0,ft.jsx)(qo.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Io(e.onMouseDown,(e=>{o?c.onItemFocus(l):e.preventDefault()})),onFocus:Io(e.onFocus,(()=>c.onItemFocus(l))),onKeyDown:Io(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:rx[n]}(e,c.orientation,c.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=d().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=c.loop?function(e,t){return e.map(((r,n)=>e[(t+n)%e.length]))}(r,n+1):r.slice(n+1)}setTimeout((()=>nx(r)))}}))})})}));tx.displayName=ex;var rx={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function nx(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var ox=Qw,ix=tx,ax="Tabs",[sx,ux]=Do(ax,[Kw]),lx=Kw(),[cx,fx]=sx(ax),dx=r.forwardRef(((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:u="automatic",...l}=e,c=Vh(s),[f,d]=Go({prop:n,onChange:o,defaultProp:i});return(0,ft.jsx)(cx,{scope:r,baseId:$o(),value:f,onValueChange:d,orientation:a,dir:c,activationMode:u,children:(0,ft.jsx)(qo.div,{dir:c,"data-orientation":a,...l,ref:t})})}));dx.displayName=ax;var px="TabsList",hx=r.forwardRef(((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=fx(px,r),a=lx(r);return(0,ft.jsx)(ox,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:n,children:(0,ft.jsx)(qo.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})}));hx.displayName=px;var mx="TabsTrigger",yx=r.forwardRef(((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,a=fx(mx,r),s=lx(r),u=bx(a.baseId,n),l=wx(a.baseId,n),c=n===a.value;return(0,ft.jsx)(ix,{asChild:!0,...s,focusable:!o,active:c,children:(0,ft.jsx)(qo.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":l,"data-state":c?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...i,ref:t,onMouseDown:Io(e.onMouseDown,(e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(n)})),onKeyDown:Io(e.onKeyDown,(e=>{[" ","Enter"].includes(e.key)&&a.onValueChange(n)})),onFocus:Io(e.onFocus,(()=>{const e="manual"!==a.activationMode;c||o||!e||a.onValueChange(n)}))})})}));yx.displayName=mx;var vx="TabsContent",gx=r.forwardRef(((e,t)=>{const{__scopeTabs:n,value:o,forceMount:i,children:a,...s}=e,u=fx(vx,n),l=bx(u.baseId,o),c=wx(u.baseId,o),f=o===u.value,d=r.useRef(f);return r.useEffect((()=>{const e=requestAnimationFrame((()=>d.current=!1));return()=>cancelAnimationFrame(e)}),[]),(0,ft.jsx)(pi,{present:i||f,children:({present:r})=>(0,ft.jsx)(qo.div,{"data-state":f?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":l,hidden:!r,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:r&&a})})}));function bx(e,t){return`${e}-trigger-${t}`}function wx(e,t){return`${e}-content-${t}`}gx.displayName=vx;var xx=hx,_x=yx,Ox=gx,Sx=["className"],Ex=["className"],jx=["className"];function Px(){return Px=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Px.apply(null,arguments)}function kx(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Cx=dx,Ax=r.forwardRef((function(e,t){var r=e.className,n=kx(e,Sx);return io(xx,Px({ref:t,className:Nr("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",r)},n))}));Ax.displayName=xx.displayName;var Nx=r.forwardRef((function(e,t){var r=e.className,n=kx(e,Ex);return io(_x,Px({ref:t,className:Nr("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",r)},n))}));Nx.displayName=_x.displayName;var Tx=r.forwardRef((function(e,t){var r=e.className,n=kx(e,jx);return io(Ox,Px({ref:t,className:Nr("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r)},n))}));function Mx(e){return Mx="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},Mx(e)}function Rx(){return Rx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rx.apply(null,arguments)}function Lx(){Lx=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Mx(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Mx(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Ix(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ix(Object(r),!0).forEach((function(t){Fx(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ix(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Fx(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Mx(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Mx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Mx(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zx(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}Tx.displayName=Ox.displayName;const Bx=function(e){var t,n=e.selectedProvider,o=Zu({resolver:el(Vg),defaultValues:{provider:n,fromName:"",fromEmail:"",smtpHost:"",smtpPort:"587",smtpSecurity:"tls",smtpUsername:"",smtpPassword:""}}),i=Eh(),a=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){zx(i,n,o,a,s,"next",e)}function s(e){zx(i,n,o,a,s,"throw",e)}a(void 0)}))}}(Lx().mark((function e(t){var r;return Lx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Dx(Dx({},t),{},{provider:n}),e.next=3,i.mutateAsync(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s=Oh(),u=s.data,l=s.isLoading;return(0,r.useEffect)((function(){if(u&&(null==u?void 0:u.data.length)>0){var e=null==u?void 0:u.data.find((function(e){return"smtp"===e.provider}));e&&(o.setValue("fromName",e.fromName),o.setValue("fromEmail",e.fromEmail),o.setValue("smtpHost",e.smtpHost||""),o.setValue("smtpPort",e.smtpPort||""),o.setValue("smtpSecurity",e.smtpSecurity||""),o.setValue("smtpUsername",e.smtpUsername||""),o.setValue("smtpPassword",e.smtpPassword||""))}}),[u]),io("div",{className:"flex justify-center"},io(uw,{className:"w-full max-w-[1000px] shadow-lg"},io(dw,{className:"p-6"},io("div",{className:"flex justify-between items-center mb-5"},io("h2",{className:"text-xl font-semibold"},null===(t=Lg.find((function(e){return e.value===n})))||void 0===t?void 0:t.label," ",(0,Lo.__)("Configuration","trigger"))),l?io("div",{className:"flex justify-center items-center h-[500px]"},io(_s,{className:"w-4 h-4 animate-spin"})):io(vl,o,io("form",{onSubmit:o.handleSubmit((function(e){a(e)}),(function(e){})),className:"space-y-6"},io("div",{className:"grid gap-4"},io(bl,{control:o.control,name:"smtpHost",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Host","trigger")),io(Sl,null,io(xs,Rx({placeholder:"smtp.hostinger.com"},t))),io(kl,null))}}),io("div",{className:"grid grid-cols-2 gap-4"},io(bl,{control:o.control,name:"smtpPort",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Port","trigger")),io(Sl,null,io(xs,Rx({placeholder:"587"},t))),io(kl,null))}}),io(bl,{control:o.control,name:"smtpSecurity",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Security","trigger")),io(cg,{onValueChange:t.onChange,value:t.value},io(Sl,null,io(dg,null,io(fg,{placeholder:"Select security type"}))),io(pg,null,Ig.map((function(e){return io(hg,{key:e.value,value:e.value},e.label)})))),io(kl,null))}})),io(bl,{control:o.control,name:"smtpUsername",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Username","trigger")),io(Sl,null,io(xs,Rx({placeholder:"username@example.com"},t))),io(kl,null))}}),io(bl,{control:o.control,name:"smtpPassword",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Password","trigger")),io(Sl,null,io(xs,Rx({type:"password",placeholder:"••••••••"},t))),io(kl,null))}})),io("div",{className:"space-y-4 border-t pt-6"},io("div",{className:"grid grid-cols-2 gap-4"},io(bl,{control:o.control,name:"fromName",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Name","trigger")),io(Sl,null,io(xs,Rx({placeholder:"WordPress"},t))),io(kl,null))}}),io(bl,{control:o.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io(Sl,null,io(xs,Rx({placeholder:"wordpress@example.com"},t))),io(kl,null))}}))),io("div",{className:"flex gap-2 justify-end"},io(lo,{type:"submit",disabled:i.isPending},i.isPending?(0,Lo.__)("Saving...","trigger"):(0,Lo.__)("Save Changes","trigger"))))))))};function Vx(e){return Vx="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},Vx(e)}function $x(){return $x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$x.apply(null,arguments)}function Ux(){Ux=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Vx(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Vx(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Gx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gx(Object(r),!0).forEach((function(t){qx(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qx(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Vx(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Vx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Vx(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hx(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}const Zx=function(e){var t,n=e.selectedProvider,o=Zu({resolver:el($g),defaultValues:{provider:n,fromName:"",fromEmail:"",accessKeyId:"",secretAccessKey:"",region:""}}),i=Eh(),a=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Hx(i,n,o,a,s,"next",e)}function s(e){Hx(i,n,o,a,s,"throw",e)}a(void 0)}))}}(Ux().mark((function e(t){var r;return Ux().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Wx(Wx({},t),{},{provider:n}),e.next=3,i.mutateAsync(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s=Oh(),u=s.data,l=s.isLoading;return(0,r.useEffect)((function(){if(u&&(null==u?void 0:u.data.length)>0){var e=null==u?void 0:u.data.find((function(e){return"ses"===e.provider}));e&&(o.setValue("fromName",e.fromName),o.setValue("fromEmail",e.fromEmail),o.setValue("accessKeyId",e.accessKeyId||""),o.setValue("secretAccessKey",e.secretAccessKey||""),o.setValue("region",e.region||""))}}),[u]),io("div",{className:"flex justify-center"},io(uw,{className:"w-full max-w-[1000px] shadow-lg"},io(dw,{className:"p-6"},io("div",{className:"flex justify-between items-center mb-5"},io("h2",{className:"text-xl font-semibold"},null===(t=Lg.find((function(e){return e.value===n})))||void 0===t?void 0:t.label," ",(0,Lo.__)("Configuration","trigger"))),l?io("div",{className:"flex justify-center items-center h-[500px]"},io(_s,{className:"w-4 h-4 animate-spin"})):io(vl,o,io("form",{onSubmit:o.handleSubmit((function(e){a(e)}),(function(e){})),className:"space-y-6"},io("div",{className:"grid gap-6"},io("div",{className:"grid gap-4"},io(bl,{control:o.control,name:"accessKeyId",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Access Key ID","trigger")),io(Sl,null,io(xs,$x({placeholder:"AKIA..."},t))),io(kl,null))}}),io(bl,{control:o.control,name:"secretAccessKey",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Secret Access Key","trigger")),io(Sl,null,io(xs,$x({type:"password",placeholder:"••••••••"},t))),io(kl,null))}}),io(bl,{control:o.control,name:"region",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Region","trigger")),io(cg,{onValueChange:t.onChange,value:t.value},io(Sl,null,io(dg,null,io(fg,{placeholder:(0,Lo.__)("Select AWS region","trigger")}))),io(pg,null,Dg.map((function(e){return io(hg,{key:e.value,value:e.value},e.label)})))),io(kl,null))}})),io("div",{className:"space-y-4 border-t pt-6"},io("div",{className:"grid grid-cols-2 gap-4"},io(bl,{control:o.control,name:"fromName",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Name","trigger")),io(Sl,null,io(xs,$x({placeholder:"WordPress"},t))),io(kl,null))}}),io(bl,{control:o.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io(Sl,null,io(xs,$x({placeholder:"wordpress@example.com"},t))),io(kl,null))}})))),io("div",{className:"flex gap-2 justify-end"},io(lo,{type:"submit",disabled:i.isPending},i.isPending?(0,Lo.__)("Saving...","trigger"):(0,Lo.__)("Save Changes","trigger"))))))))};var Kx=o(1594);function Yx(e){return Yx="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},Yx(e)}function Xx(){return Xx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xx.apply(null,arguments)}function Qx(){Qx=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Yx(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Yx(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Jx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function e_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jx(Object(r),!0).forEach((function(t){t_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function t_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Yx(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Yx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Yx(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r_(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function n_(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){r_(i,n,o,a,s,"next",e)}function s(e){r_(i,n,o,a,s,"throw",e)}a(void 0)}))}}function o_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i_(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i_(e,t):void 0}}(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.")}()}function i_(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const a_=function(e){var t=e.selectedProvider,n=o_((0,r.useState)(!1),2),o=n[0],i=n[1],a=Zu({resolver:el(Ug),defaultValues:{provider:t,clientId:"",clientSecret:"",fromName:"",fromEmail:""}}),s=Eh(),u=function(){var e=n_(Qx().mark((function e(r){var n;return Qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=e_(e_({},r),{},{provider:t}),e.next=3,s.mutateAsync(n);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),l=Oh(),c=l.data,f=l.isLoading;(0,r.useEffect)((function(){if(c&&(null==c?void 0:c.data.length)>0){var e=null==c?void 0:c.data.find((function(e){return"gmail"===e.provider}));e&&(a.setValue("fromName",e.fromName),a.setValue("fromEmail",e.fromEmail),a.setValue("clientId",e.clientId||""),a.setValue("clientSecret",e.clientSecret||""))}}),[c]);var d=Ah();(0,r.useEffect)((function(){p()}),[]);var p=function(){var e=n_(Qx().mark((function e(){var t,r;return Qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.mutateAsync();case 2:t=e.sent,r=t.status_code,i(200===r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),h=kh(),m=function(){var e=n_(Qx().mark((function e(t){return Qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,h.mutateAsync();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return io("div",{className:"flex justify-center"},io(uw,{className:"w-full max-w-[1000px] shadow-lg"},io(dw,{className:"p-6"},io("div",{className:"flex justify-between items-center mb-5"},io("h2",{className:"text-xl font-semibold"},(0,Lo.__)("Google Gmail Configuration","trigger"))),f?io("div",{className:"flex justify-center items-center h-[500px]"},io(_s,{className:"w-4 h-4 animate-spin"})):io(vl,a,io("form",{onSubmit:a.handleSubmit((function(e){u(e)}),(function(e){})),className:"space-y-6"},io("div",{className:"grid gap-6"},io("div",{className:"grid gap-4"},io(bl,{control:a.control,name:"clientId",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Client ID","trigger")),io(Sl,null,io(xs,Xx({placeholder:"AKIA..."},t))),io(kl,null))}}),io(bl,{control:a.control,name:"clientSecret",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Client Secret","trigger")),io(Sl,null,io(xs,Xx({type:"password",placeholder:"••••••••"},t))),io(kl,null))}})),io("div",{className:"space-y-4 border-t pt-6"},io("div",{className:"grid grid-cols-2 gap-4"},io(bl,{control:a.control,name:"fromName",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Name","trigger")),io(Sl,null,io(xs,Xx({placeholder:"WordPress"},t))),io(kl,null))}}),io(bl,{control:a.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io(Sl,null,io(xs,Xx({placeholder:"wordpress@example.com"},t))),io(kl,null))}})))),io("div",{className:"flex gap-2 justify-end"},io(lo,{type:"submit",disabled:s.isPending},s.isPending?(0,Lo.__)("Saving...","trigger"):(0,Lo.__)("Save Changes","trigger"))))),io("hr",{className:"mt-4"}),io("div",{className:"mt-4"},io("h2",{className:"mb-2"},(0,Lo.__)("Use this URI to your google cloud console","trigger")),io("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md mb-4"},io(xs,{value:Rg,readOnly:!0,className:"flex-1"}),io(lo,{variant:"outline",size:"icon",onClick:n_(Qx().mark((function e(){return Qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,up(Rg);case 2:mh.success((0,Lo.__)("Copied to clipboard","trigger"));case 3:case"end":return e.stop()}}),e)})))},io("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},io("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),io("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})))),d.isPending?io(_s,{className:"h-4 w-4 animate-spin mx-auto"}):io(Kx.Fragment,null,o?io(lo,{variant:"destructive",size:"icon",onClick:function(e){return m(e)},className:"w-full"},h.isPending&&io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Reconnect With Gmail","trigger")):io(lo,{variant:"default",size:"icon",onClick:function(e){return m(e)},className:"w-full"},h.isPending&&io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Connect With Gmail","trigger")))))))};function s_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u_(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u_(e,t):void 0}}(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.")}()}function u_(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const l_=function(){var e=te(),t=s_((0,r.useState)("smtp"),2),n=t[0],o=t[1];return io("div",{className:"flex justify-center mt-5 p-5"},io(uw,{className:"w-full max-w-[1000px] shadow-lg"},io(dw,{className:"p-6"},io("div",{className:"flex justify-between items-center mb-8"},io("h2",{className:"text-xl font-semibold"},(0,Lo.__)("Email Settings","trigger")),io("div",{className:"flex items-center gap-2"},io(lo,{variant:"outline",size:"sm",onClick:function(){return e("/connections")}},io(Vw,{className:"w-4 h-4 mr-2"}),(0,Lo.__)("Back","trigger")))),io(Cx,{defaultValue:"smtp",className:"flex gap-6",onValueChange:function(e){o(e)}},io(Ax,{className:"flex flex-col h-fit w-48 bg-muted p-2 rounded-lg"},io(Nx,{value:"smtp",className:"w-full justify-start gap-2 p-2.5"},io("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},io("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),io("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})),(0,Lo.__)("SMTP","trigger")),io(Nx,{value:"ses",className:"w-full justify-start gap-2 p-2.5"},io("svg",{width:"25",height:"25",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},io("g",{"clip-path":"url(#clip0_214_10729)"},io("path",{d:"M80 0H0V80H80V0Z",fill:"url(#paint0_linear_214_10729)"}),io("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M57 60.9999C57 59.3738 55.626 57.9998 54 57.9998C52.374 57.9998 51 59.3738 51 60.9999C51 62.6259 52.374 63.9999 54 63.9999C55.626 63.9999 57 62.6259 57 60.9999ZM40 59.9999C38.374 59.9999 37 61.3739 37 62.9999C37 64.6259 38.374 66 40 66C41.626 66 43 64.6259 43 62.9999C43 61.3739 41.626 59.9999 40 59.9999ZM26 57.9998C24.374 57.9998 23 59.3738 23 60.9999C23 62.6259 24.374 63.9999 26 63.9999C27.626 63.9999 29 62.6259 29 60.9999C29 59.3738 27.626 57.9998 26 57.9998ZM28.605 42.9996H51.395L43.739 36.1104L40.649 38.7585C40.463 38.9195 40.23 38.9995 39.999 38.9995C39.768 38.9995 39.535 38.9195 39.349 38.7585L36.26 36.1104L28.605 42.9996ZM27 28.1733V41.7545L34.729 34.7984L27 28.1733ZM51.297 26.9993H28.703L39.999 36.6824L51.297 26.9993ZM53 41.7545V28.1733L45.271 34.7974L53 41.7545ZM59 60.9999C59 63.7099 56.71 66 54 66C51.29 66 49 63.7099 49 60.9999C49 58.6308 50.75 56.5838 53 56.1058V52.9997H41V58.1058C43.25 58.5838 45 60.6309 45 62.9999C45 65.71 42.71 68 40 68C37.29 68 35 65.71 35 62.9999C35 60.6309 36.75 58.5838 39 58.1058V52.9997H27V56.1058C29.25 56.5838 31 58.6308 31 60.9999C31 63.7099 28.71 66 26 66C23.29 66 21 63.7099 21 60.9999C21 58.6308 22.75 56.5838 25 56.1058V51.9997C25 51.4477 25.447 50.9997 26 50.9997H39V44.9996H26C25.447 44.9996 25 44.5516 25 43.9996V25.9993C25 25.4472 25.447 24.9992 26 24.9992H54C54.553 24.9992 55 25.4472 55 25.9993V43.9996C55 44.5516 54.553 44.9996 54 44.9996H41V50.9997H54C54.553 50.9997 55 51.4477 55 51.9997V56.1058C57.25 56.5838 59 58.6308 59 60.9999ZM68 39.9995C68 45.9066 66.177 51.5597 62.727 56.3448L61.104 55.1748C64.307 50.7317 66 45.4846 66 39.9995C66 25.6642 54.337 14 40.001 14C25.664 14 14 25.6642 14 39.9995C14 45.4846 15.693 50.7317 18.896 55.1748L17.273 56.3448C13.823 51.5597 12 45.9066 12 39.9995C12 24.5612 24.561 12 39.999 12C55.438 12 68 24.5612 68 39.9995Z",fill:"white"})),io("defs",null,io("linearGradient",{id:"paint0_linear_214_10729",x1:"0",y1:"8000",x2:"8000",y2:"0",gradientUnits:"userSpaceOnUse"},io("stop",{"stop-color":"#3334B9"}),io("stop",{offset:"1","stop-color":"#4E74F4"})),io("clipPath",{id:"clip0_214_10729"},io("rect",{width:"80",height:"80",fill:"white"})))),(0,Lo.__)("Amazon SES","trigger")),io(Nx,{value:"gmail",className:"w-full justify-start gap-2 p-2.5"},io("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},io("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),io("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})),(0,Lo.__)("Google Gmail","trigger"))),io("div",{className:"flex-1 border-l pl-6"},io(Tx,{value:"smtp"},io(Bx,{selectedProvider:n})),io(Tx,{value:"ses"},io(Zx,{selectedProvider:n})),io(Tx,{value:"gmail"},io(a_,{selectedProvider:n})))))))},c_=mo("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),f_=mo("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),d_=mo("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),p_=mo("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var h_=[{id:"dashboard",label:"Dashboard",path:"/dashboard",icon:io(c_,null)},{id:"email_logs",label:"Email Logs",path:"/email_logs",icon:io(f_,null)},{id:"connections",label:"Connections",path:"/connections",icon:io(d_,null)},{id:"settings",label:"Settings",path:"/settings",icon:io(p_,null)}];const m_=function(){var e=Q();return io("div",{className:"border-b"},io("div",{className:"flex h-16 items-center px-4"},io("nav",{className:"flex items-center space-x-6"},h_.map((function(t){return io(Je,{key:t.id,to:t.path,className:Nr("flex items-center space-x-2 text-sm font-medium transition-colors hover:text-primary",e.pathname===t.path||"/"===e.pathname&&"/dashboard"===t.path?"text-primary":"text-muted-foreground")},t.label,t.badge&&io("span",{className:"ml-2 rounded-md bg-muted px-1.5 py-0.5 text-xs text-muted-foreground"},t.badge))}))),io("div",{className:"ml-auto flex items-center space-x-4"},io("span",{className:"text-sm text-muted-foreground"},(0,Lo.__)("V-1.0.0","trigger")))))},y_=mo("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var v_=o(7350),g_=o.n(v_),b_=o(5015),w_=o.n(b_),x_=o(1741),__=o.n(x_),O_=o(8156),S_=o.n(O_),E_=o(8023),j_=o.n(E_),P_=function(e){return 0===e?0:e>0?1:-1},k_=function(e){return w_()(e)&&e.indexOf("%")===e.length-1},C_=function(e){return j_()(e)&&!__()(e)},A_=function(e){return C_(e)||w_()(e)},N_=0,T_=function(e){var t=++N_;return"".concat(e||"").concat(t)},M_=function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!C_(e)&&!w_()(e))return n;if(k_(e)){var i=e.indexOf("%");r=t*parseFloat(e.slice(0,i))/100}else r=+e;return __()(r)&&(r=n),o&&r>t&&(r=t),r},R_=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},L_=function(e,t){return C_(e)&&C_(t)?function(r){return e+r*(t-e)}:function(){return t}};function I_(e,t,r){return e&&e.length?e.find((function(e){return e&&("function"==typeof t?t(e):S_()(e,t))===r})):null}var D_=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o]},F_=o(9843),z_=o.n(F_),B_=o(1882),V_=o.n(B_),$_=o(3805),U_=o.n($_),G_=o(2199);function W_(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function q_(e){return q_="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},q_(e)}var H_=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Z_=["points","pathLength"],K_={svg:["viewBox","children"],polygon:Z_,polyline:Z_},Y_=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],X_=function(e,t){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var n=e;if((0,r.isValidElement)(e)&&(n=e.props),!U_()(n))return null;var o={};return Object.keys(n).forEach((function(e){Y_.includes(e)&&(o[e]=t||function(t){return n[e](n,t)})})),o},Q_=function(e,t,r){if(!U_()(e)||"object"!==q_(e))return null;var n=null;return Object.keys(e).forEach((function(o){var i=e[o];Y_.includes(o)&&"function"==typeof i&&(n||(n={}),n[o]=function(e,t,r){return function(n){return e(t,r,n),null}}(i,t,r))})),n},J_=["children"],eO=["children"];function tO(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function rO(e){return rO="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},rO(e)}var nO={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},oO=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},iO=null,aO=null,sO=function e(t){if(t===iO&&Array.isArray(aO))return aO;var n=[];return r.Children.forEach(t,(function(t){z_()(t)||((0,G_.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))})),aO=n,iO=t,n};function uO(e,t){var r=[],n=[];return n=Array.isArray(t)?t.map((function(e){return oO(e)})):[oO(t)],sO(e).forEach((function(e){var t=S_()(e,"type.displayName")||S_()(e,"type.name");-1!==n.indexOf(t)&&r.push(e)})),r}function lO(e,t){var r=uO(e,t);return r&&r[0]}var cO=function(e){if(!e||!e.props)return!1;var t=e.props,r=t.width,n=t.height;return!(!C_(r)||r<=0||!C_(n)||n<=0)},fO=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],dO=function(e){return e&&e.type&&w_()(e.type)&&fO.indexOf(e.type)>=0},pO=function(e,t,n){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var o=e;if((0,r.isValidElement)(e)&&(o=e.props),!U_()(o))return null;var i={};return Object.keys(o).forEach((function(e){var r;(function(e,t,r,n){var o,i=null!==(o=null==K_?void 0:K_[n])&&void 0!==o?o:[];return!V_()(e)&&(n&&i.includes(t)||H_.includes(t))||r&&Y_.includes(t)})(null===(r=o)||void 0===r?void 0:r[e],e,t,n)&&(i[e]=o[e])})),i},hO=function e(t,n){if(t===n)return!0;var o=r.Children.count(t);if(o!==r.Children.count(n))return!1;if(0===o)return!0;if(1===o)return mO(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<o;i++){var a=t[i],s=n[i];if(Array.isArray(a)||Array.isArray(s)){if(!e(a,s))return!1}else if(!mO(a,s))return!1}return!0},mO=function(e,t){if(z_()(e)&&z_()(t))return!0;if(!z_()(e)&&!z_()(t)){var r=e.props||{},n=r.children,o=tO(r,J_),i=t.props||{},a=i.children,s=tO(i,eO);return n&&a?W_(o,s)&&hO(n,a):!n&&!a&&W_(o,s)}return!1},yO=function(e,t){var r=[],n={};return sO(e).forEach((function(e,o){if(dO(e))r.push(e);else if(e){var i=oO(e.type),a=t[i]||{},s=a.handler,u=a.once;if(s&&(!u||!n[i])){var l=s(e,i,o);r.push(l),n[i]=!0}}})),r};function vO(e){return vO="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},vO(e)}function gO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gO(Object(r),!0).forEach((function(t){wO(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gO(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wO(e,t,r){return t=function(e){var t=function(e,t){if("object"!=vO(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=vO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==vO(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _O(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _O(e,t)}(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.")}()}function _O(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var OO=(0,r.forwardRef)((function(e,t){var n=e.aspect,o=e.initialDimension,a=void 0===o?{width:-1,height:-1}:o,s=e.width,u=void 0===s?"100%":s,l=e.height,c=void 0===l?"100%":l,f=e.minWidth,d=void 0===f?0:f,p=e.minHeight,h=e.maxHeight,m=e.children,y=e.debounce,v=void 0===y?0:y,g=e.id,b=e.className,w=e.onResize,x=e.style,_=void 0===x?{}:x,O=(0,r.useRef)(null),S=(0,r.useRef)();S.current=w,(0,r.useImperativeHandle)(t,(function(){return Object.defineProperty(O.current,"current",{get:function(){return O.current},configurable:!0})}));var E=xO((0,r.useState)({containerWidth:a.width,containerHeight:a.height}),2),j=E[0],P=E[1],k=(0,r.useCallback)((function(e,t){P((function(r){var n=Math.round(e),o=Math.round(t);return r.containerWidth===n&&r.containerHeight===o?r:{containerWidth:n,containerHeight:o}}))}),[]);(0,r.useEffect)((function(){var e=function(e){var t,r=e[0].contentRect,n=r.width,o=r.height;k(n,o),null===(t=S.current)||void 0===t||t.call(S,n,o)};v>0&&(e=g_()(e,v,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),r=O.current.getBoundingClientRect(),n=r.width,o=r.height;return k(n,o),t.observe(O.current),function(){t.disconnect()}}),[k,v]);var C=(0,r.useMemo)((function(){var e=j.containerWidth,t=j.containerHeight;if(e<0||t<0)return null;D_(k_(u)||k_(c),"The width(%s) and height(%s) are both fixed numbers,\n       maybe you don't need to use a ResponsiveContainer.",u,c),D_(!n||n>0,"The aspect(%s) must be greater than zero.",n);var o=k_(u)?e:u,a=k_(c)?t:c;n&&n>0&&(o?a=o/n:a&&(o=a*n),h&&a>h&&(a=h)),D_(o>0||a>0,"The width(%s) and height(%s) of chart should be greater than 0,\n       please check the style of container, or the props width(%s) and height(%s),\n       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n       height and width.",o,a,u,c,d,p,n);var s=!Array.isArray(m)&&oO(m.type).endsWith("Chart");return i().Children.map(m,(function(e){return i().isValidElement(e)?(0,r.cloneElement)(e,bO({width:o,height:a},s?{style:bO({height:"100%",width:"100%",maxHeight:a,maxWidth:o},e.props.style)}:{})):e}))}),[n,m,c,h,p,d,j,u]);return i().createElement("div",{id:g?"".concat(g):void 0,className:gt("recharts-responsive-container",b),style:bO(bO({},_),{},{width:u,height:c,minWidth:d,minHeight:p,maxHeight:h}),ref:O},C)})),SO=o(3181),EO=o.n(SO),jO=o(3031),PO=o.n(jO),kO="Invariant failed";function CO(e,t){if(!e)throw new Error(kO)}var AO=["children","width","height","viewBox","className","style","title","desc"];function NO(){return NO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NO.apply(this,arguments)}function TO(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function MO(e){var t=e.children,r=e.width,n=e.height,o=e.viewBox,a=e.className,s=e.style,u=e.title,l=e.desc,c=TO(e,AO),f=o||{width:r,height:n,x:0,y:0},d=gt("recharts-surface",a);return i().createElement("svg",NO({},pO(c,!0,"svg"),{className:d,width:r,height:n,style:s,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),i().createElement("title",null,u),i().createElement("desc",null,l),t)}var RO=["children","className"];function LO(){return LO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LO.apply(this,arguments)}function IO(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var DO=i().forwardRef((function(e,t){var r=e.children,n=e.className,o=IO(e,RO),a=gt("recharts-layer",n);return i().createElement("g",LO({className:a},pO(o,!0),{ref:t}),r)}));function FO(e){return FO="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},FO(e)}function zO(){return zO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zO.apply(this,arguments)}function BO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return VO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return VO(e,t)}(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.")}()}function VO(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function UO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$O(Object(r),!0).forEach((function(t){GO(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function GO(e,t,r){return t=function(e){var t=function(e,t){if("object"!=FO(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=FO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==FO(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WO(e){return Array.isArray(e)&&A_(e[0])&&A_(e[1])?e.join(" ~ "):e}var qO=function(e){var t=e.separator,r=void 0===t?" : ":t,n=e.contentStyle,o=void 0===n?{}:n,a=e.itemStyle,s=void 0===a?{}:a,u=e.labelStyle,l=void 0===u?{}:u,c=e.payload,f=e.formatter,d=e.itemSorter,p=e.wrapperClassName,h=e.labelClassName,m=e.label,y=e.labelFormatter,v=e.accessibilityLayer,g=void 0!==v&&v,b=UO({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},o),w=UO({margin:0},l),x=!z_()(m),_=x?m:"",O=gt("recharts-default-tooltip",p),S=gt("recharts-tooltip-label",h);x&&y&&null!=c&&(_=y(m,c));var E=g?{role:"status","aria-live":"assertive"}:{};return i().createElement("div",zO({className:O,style:b},E),i().createElement("p",{className:S,style:w},i().isValidElement(_)?_:"".concat(_)),function(){if(c&&c.length){var e=(d?PO()(c,d):c).map((function(e,t){if("none"===e.type)return null;var n=UO({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},s),o=e.formatter||f||WO,a=e.value,u=e.name,l=a,d=u;if(o&&null!=l&&null!=d){var p=o(a,u,e,t,c);if(Array.isArray(p)){var h=BO(p,2);l=h[0],d=h[1]}else l=p}return i().createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(t),style:n},A_(d)?i().createElement("span",{className:"recharts-tooltip-item-name"},d):null,A_(d)?i().createElement("span",{className:"recharts-tooltip-item-separator"},r):null,i().createElement("span",{className:"recharts-tooltip-item-value"},l),i().createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))}));return i().createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null}())};function HO(e){return HO="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},HO(e)}function ZO(e,t,r){return t=function(e){var t=function(e,t){if("object"!=HO(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=HO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==HO(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var KO="recharts-tooltip-wrapper",YO={visibility:"hidden"};function XO(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return gt(KO,ZO(ZO(ZO(ZO({},"".concat(KO,"-right"),C_(r)&&t&&C_(t.x)&&r>=t.x),"".concat(KO,"-left"),C_(r)&&t&&C_(t.x)&&r<t.x),"".concat(KO,"-bottom"),C_(n)&&t&&C_(t.y)&&n>=t.y),"".concat(KO,"-top"),C_(n)&&t&&C_(t.y)&&n<t.y))}function QO(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,o=e.offsetTopLeft,i=e.position,a=e.reverseDirection,s=e.tooltipDimension,u=e.viewBox,l=e.viewBoxDimension;if(i&&C_(i[n]))return i[n];var c=r[n]-s-o,f=r[n]+o;return t[n]?a[n]?c:f:a[n]?c<u[n]?Math.max(f,u[n]):Math.max(c,u[n]):f+s>u[n]+l?Math.max(c,u[n]):Math.max(f,u[n])}function JO(e){return JO="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},JO(e)}function eS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eS(Object(r),!0).forEach((function(t){sS(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eS(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,uS(n.key),n)}}function nS(e,t,r){return t=iS(t),function(e,t){if(t&&("object"===JO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,oS()?Reflect.construct(t,r||[],iS(e).constructor):t.apply(e,r))}function oS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oS=function(){return!!e})()}function iS(e){return iS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iS(e)}function aS(e,t){return aS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},aS(e,t)}function sS(e,t,r){return(t=uS(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uS(e){var t=function(e,t){if("object"!=JO(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=JO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==JO(t)?t:t+""}var lS=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return sS(e=nS(this,t,[].concat(n)),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),sS(e,"handleKeyDown",(function(t){var r,n,o,i;"Escape"===t.key&&e.setState({dismissed:!0,dismissedAtCoordinate:{x:null!==(r=null===(n=e.props.coordinate)||void 0===n?void 0:n.x)&&void 0!==r?r:0,y:null!==(o=null===(i=e.props.coordinate)||void 0===i?void 0:i.y)&&void 0!==o?o:0}})})),e}return function(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&&aS(e,t)}(t,e),r=t,n=[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.state.lastBoundingBox.width)>1||Math.abs(e.height-this.state.lastBoundingBox.height)>1)&&this.setState({lastBoundingBox:{width:e.width,height:e.height}})}else-1===this.state.lastBoundingBox.width&&-1===this.state.lastBoundingBox.height||this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var e,t;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(e=this.props.coordinate)||void 0===e?void 0:e.x)===this.state.dismissedAtCoordinate.x&&(null===(t=this.props.coordinate)||void 0===t?void 0:t.y)===this.state.dismissedAtCoordinate.y||(this.state.dismissed=!1))}},{key:"render",value:function(){var e=this,t=this.props,r=t.active,n=t.allowEscapeViewBox,o=t.animationDuration,a=t.animationEasing,s=t.children,u=t.coordinate,l=t.hasPayload,c=t.isAnimationActive,f=t.offset,d=t.position,p=t.reverseDirection,h=t.useTranslate3d,m=t.viewBox,y=t.wrapperStyle,v=function(e){var t,r,n=e.allowEscapeViewBox,o=e.coordinate,i=e.offsetTopLeft,a=e.position,s=e.reverseDirection,u=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox;return{cssProperties:u.height>0&&u.width>0&&o?function(e){var t=e.translateX,r=e.translateY;return{transform:e.useTranslate3d?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}({translateX:t=QO({allowEscapeViewBox:n,coordinate:o,key:"x",offsetTopLeft:i,position:a,reverseDirection:s,tooltipDimension:u.width,viewBox:c,viewBoxDimension:c.width}),translateY:r=QO({allowEscapeViewBox:n,coordinate:o,key:"y",offsetTopLeft:i,position:a,reverseDirection:s,tooltipDimension:u.height,viewBox:c,viewBoxDimension:c.height}),useTranslate3d:l}):YO,cssClasses:XO({translateX:t,translateY:r,coordinate:o})}}({allowEscapeViewBox:n,coordinate:u,offsetTopLeft:f,position:d,reverseDirection:p,tooltipBox:this.state.lastBoundingBox,useTranslate3d:h,viewBox:m}),g=v.cssClasses,b=v.cssProperties,w=tS(tS({transition:c&&r?"transform ".concat(o,"ms ").concat(a):void 0},b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&r&&l?"visible":"hidden",position:"absolute",top:0,left:0},y);return i().createElement("div",{tabIndex:-1,className:g,style:w,ref:function(t){e.wrapperNode=t}},s)}}],n&&rS(r.prototype,n),o&&rS(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.PureComponent),cS={isSsr:!("undefined"!=typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return cS[e]},set:function(e,t){if("string"==typeof e)cS[e]=t;else{var r=Object.keys(e);r&&r.length&&r.forEach((function(t){cS[t]=e[t]}))}}},fS=o(14),dS=o.n(fS);function pS(e,t,r){return!0===t?dS()(e,r):V_()(t)?dS()(e,t):e}function hS(e){return hS="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},hS(e)}function mS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mS(Object(r),!0).forEach((function(t){_S(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mS(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,OS(n.key),n)}}function gS(e,t,r){return t=wS(t),function(e,t){if(t&&("object"===hS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,bS()?Reflect.construct(t,r||[],wS(e).constructor):t.apply(e,r))}function bS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bS=function(){return!!e})()}function wS(e){return wS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wS(e)}function xS(e,t){return xS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xS(e,t)}function _S(e,t,r){return(t=OS(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OS(e){var t=function(e,t){if("object"!=hS(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=hS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==hS(t)?t:t+""}function SS(e){return e.dataKey}var ES=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),gS(this,t,arguments)}return function(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&&xS(e,t)}(t,e),r=t,n=[{key:"render",value:function(){var e=this,t=this.props,r=t.active,n=t.allowEscapeViewBox,o=t.animationDuration,a=t.animationEasing,s=t.content,u=t.coordinate,l=t.filterNull,c=t.isAnimationActive,f=t.offset,d=t.payload,p=t.payloadUniqBy,h=t.position,m=t.reverseDirection,y=t.useTranslate3d,v=t.viewBox,g=t.wrapperStyle,b=null!=d?d:[];l&&b.length&&(b=pS(d.filter((function(t){return null!=t.value&&(!0!==t.hide||e.props.includeHidden)})),p,SS));var w=b.length>0;return i().createElement(lS,{allowEscapeViewBox:n,animationDuration:o,animationEasing:a,isAnimationActive:c,active:r,coordinate:u,hasPayload:w,offset:f,position:h,reverseDirection:m,useTranslate3d:y,viewBox:v,wrapperStyle:g},function(e,t){return i().isValidElement(e)?i().cloneElement(e,t):"function"==typeof e?i().createElement(e,t):i().createElement(qO,t)}(s,yS(yS({},this.props),{},{payload:b})))}}],n&&vS(r.prototype,n),o&&vS(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.PureComponent);_S(ES,"displayName","Tooltip"),_S(ES,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!cS.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var jS=o(5808),PS=o.n(jS);Math.abs,Math.atan2;const kS=Math.cos,CS=(Math.max,Math.min,Math.sin),AS=Math.sqrt,NS=Math.PI,TS=2*NS;const MS={draw(e,t){const r=AS(t/NS);e.moveTo(r,0),e.arc(0,0,r,0,TS)}},RS={draw(e,t){const r=AS(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},LS=AS(1/3),IS=2*LS,DS={draw(e,t){const r=AS(t/IS),n=r*LS;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},FS={draw(e,t){const r=AS(t),n=-r/2;e.rect(n,n,r,r)}},zS=CS(NS/10)/CS(7*NS/10),BS=CS(TS/10)*zS,VS=-kS(TS/10)*zS,$S={draw(e,t){const r=AS(.8908130915292852*t),n=BS*r,o=VS*r;e.moveTo(0,-r),e.lineTo(n,o);for(let t=1;t<5;++t){const i=TS*t/5,a=kS(i),s=CS(i);e.lineTo(s*r,-a*r),e.lineTo(a*n-s*o,s*n+a*o)}e.closePath()}},US=AS(3),GS={draw(e,t){const r=-AS(t/(3*US));e.moveTo(0,2*r),e.lineTo(-US*r,-r),e.lineTo(US*r,-r),e.closePath()}},WS=-.5,qS=AS(3)/2,HS=1/AS(12),ZS=3*(HS/2+1),KS={draw(e,t){const r=AS(t/ZS),n=r/2,o=r*HS,i=n,a=r*HS+r,s=-i,u=a;e.moveTo(n,o),e.lineTo(i,a),e.lineTo(s,u),e.lineTo(WS*n-qS*o,qS*n+WS*o),e.lineTo(WS*i-qS*a,qS*i+WS*a),e.lineTo(WS*s-qS*u,qS*s+WS*u),e.lineTo(WS*n+qS*o,WS*o-qS*n),e.lineTo(WS*i+qS*a,WS*a-qS*i),e.lineTo(WS*s+qS*u,WS*u-qS*s),e.closePath()}};function YS(e){return function(){return e}}const XS=Math.PI,QS=2*XS,JS=1e-6,eE=QS-JS;function tE(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}class rE{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?tE:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return tE;const r=10**t;return function(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=Math.round(arguments[t]*r)/r+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,r,n){this._append`Q${+e},${+t},${this._x1=+r},${this._y1=+n}`}bezierCurveTo(e,t,r,n,o,i){this._append`C${+e},${+t},${+r},${+n},${this._x1=+o},${this._y1=+i}`}arcTo(e,t,r,n,o){if(e=+e,t=+t,r=+r,n=+n,(o=+o)<0)throw new Error(`negative radius: ${o}`);let i=this._x1,a=this._y1,s=r-e,u=n-t,l=i-e,c=a-t,f=l*l+c*c;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(f>JS)if(Math.abs(c*s-u*l)>JS&&o){let d=r-i,p=n-a,h=s*s+u*u,m=d*d+p*p,y=Math.sqrt(h),v=Math.sqrt(f),g=o*Math.tan((XS-Math.acos((h+f-m)/(2*y*v)))/2),b=g/v,w=g/y;Math.abs(b-1)>JS&&this._append`L${e+b*l},${t+b*c}`,this._append`A${o},${o},0,0,${+(c*d>l*p)},${this._x1=e+w*s},${this._y1=t+w*u}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,r,n,o,i){if(e=+e,t=+t,i=!!i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(n),s=r*Math.sin(n),u=e+a,l=t+s,c=1^i,f=i?n-o:o-n;null===this._x1?this._append`M${u},${l}`:(Math.abs(this._x1-u)>JS||Math.abs(this._y1-l)>JS)&&this._append`L${u},${l}`,r&&(f<0&&(f=f%QS+QS),f>eE?this._append`A${r},${r},0,1,${c},${e-a},${t-s}A${r},${r},0,1,${c},${this._x1=u},${this._y1=l}`:f>JS&&this._append`A${r},${r},0,${+(f>=XS)},${c},${this._x1=e+r*Math.cos(o)},${this._y1=t+r*Math.sin(o)}`)}rect(e,t,r,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${r=+r}v${+n}h${-r}Z`}toString(){return this._}}function nE(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(null==r)t=null;else{const e=Math.floor(r);if(!(e>=0))throw new RangeError(`invalid digits: ${r}`);t=e}return e},()=>new rE(t)}AS(3),AS(3);function oE(e){return oE="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},oE(e)}var iE=["type","size","sizeType"];function aE(){return aE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aE.apply(this,arguments)}function sE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function uE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sE(Object(r),!0).forEach((function(t){lE(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sE(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function lE(e,t,r){return t=function(e){var t=function(e,t){if("object"!=oE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=oE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==oE(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cE(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var fE={symbolCircle:MS,symbolCross:RS,symbolDiamond:DS,symbolSquare:FS,symbolStar:$S,symbolTriangle:GS,symbolWye:KS},dE=Math.PI/180,pE=function(e){var t,r,n=e.type,o=void 0===n?"circle":n,a=e.size,s=void 0===a?64:a,u=e.sizeType,l=void 0===u?"area":u,c=uE(uE({},cE(e,iE)),{},{type:o,size:s,sizeType:l}),f=c.className,d=c.cx,p=c.cy,h=pO(c,!0);return d===+d&&p===+p&&s===+s?i().createElement("path",aE({},h,{className:gt("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(p,")"),d:(t=function(e){var t="symbol".concat(PS()(e));return fE[t]||MS}(o),r=function(e,t){let r=null,n=nE(o);function o(){let o;if(r||(r=o=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),o)return r=null,o+""||null}return e="function"==typeof e?e:YS(e||MS),t="function"==typeof t?t:YS(void 0===t?64:+t),o.type=function(t){return arguments.length?(e="function"==typeof t?t:YS(t),o):e},o.size=function(e){return arguments.length?(t="function"==typeof e?e:YS(+e),o):t},o.context=function(e){return arguments.length?(r=null==e?null:e,o):r},o}().type(t).size(function(e,t,r){if("area"===t)return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return.5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var n=18*dE;return 1.25*e*e*(Math.tan(n)-Math.tan(2*n)*Math.pow(Math.tan(n),2));case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}}(s,l,o)),r())})):null};function hE(e){return hE="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},hE(e)}function mE(){return mE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mE.apply(this,arguments)}function yE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,OE(n.key),n)}}function gE(e,t,r){return t=wE(t),function(e,t){if(t&&("object"===hE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,bE()?Reflect.construct(t,r||[],wE(e).constructor):t.apply(e,r))}function bE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bE=function(){return!!e})()}function wE(e){return wE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wE(e)}function xE(e,t){return xE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xE(e,t)}function _E(e,t,r){return(t=OE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OE(e){var t=function(e,t){if("object"!=hE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=hE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==hE(t)?t:t+""}pE.registerSymbol=function(e,t){fE["symbol".concat(PS()(e))]=t};var SE=32,EE=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),gE(this,t,arguments)}return function(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&&xE(e,t)}(t,e),r=t,n=[{key:"renderIcon",value:function(e){var t=this.props.inactiveColor,r=16,n=SE/6,o=SE/3,a=e.inactive?t:e.color;if("plainline"===e.type)return i().createElement("line",{strokeWidth:4,fill:"none",stroke:a,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:r,x2:SE,y2:r,className:"recharts-legend-icon"});if("line"===e.type)return i().createElement("path",{strokeWidth:4,fill:"none",stroke:a,d:"M0,".concat(r,"h").concat(o,"\n            A").concat(n,",").concat(n,",0,1,1,").concat(2*o,",").concat(r,"\n            H").concat(SE,"M").concat(2*o,",").concat(r,"\n            A").concat(n,",").concat(n,",0,1,1,").concat(o,",").concat(r),className:"recharts-legend-icon"});if("rect"===e.type)return i().createElement("path",{stroke:"none",fill:a,d:"M0,".concat(4,"h").concat(SE,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(i().isValidElement(e.legendIcon)){var s=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yE(Object(r),!0).forEach((function(t){_E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yE(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e);return delete s.legendIcon,i().cloneElement(e.legendIcon,s)}return i().createElement(pE,{fill:a,cx:r,cy:r,size:SE,sizeType:"diameter",type:e.type})}},{key:"renderItems",value:function(){var e=this,t=this.props,r=t.payload,n=t.iconSize,o=t.layout,a=t.formatter,s=t.inactiveColor,u={x:0,y:0,width:SE,height:SE},l={display:"horizontal"===o?"inline-block":"block",marginRight:10},c={display:"inline-block",verticalAlign:"middle",marginRight:4};return r.map((function(t,r){var o=t.formatter||a,f=gt(_E(_E({"recharts-legend-item":!0},"legend-item-".concat(r),!0),"inactive",t.inactive));if("none"===t.type)return null;var d=V_()(t.value)?null:t.value;D_(!V_()(t.value),'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>');var p=t.inactive?s:t.color;return i().createElement("li",mE({className:f,style:l,key:"legend-item-".concat(r)},Q_(e.props,t,r)),i().createElement(MO,{width:n,height:n,viewBox:u,style:c},e.renderIcon(t)),i().createElement("span",{className:"recharts-legend-item-text",style:{color:p}},o?o(d,t,r):d))}))}},{key:"render",value:function(){var e=this.props,t=e.payload,r=e.layout,n=e.align;if(!t||!t.length)return null;var o={padding:0,margin:0,textAlign:"horizontal"===r?n:"left"};return i().createElement("ul",{className:"recharts-default-legend",style:o},this.renderItems())}}],n&&vE(r.prototype,n),o&&vE(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.PureComponent);function jE(e){return jE="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},jE(e)}_E(EE,"displayName","Legend"),_E(EE,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var PE=["ref"];function kE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function CE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kE(Object(r),!0).forEach((function(t){LE(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kE(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function AE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,IE(n.key),n)}}function NE(e,t,r){return t=ME(t),function(e,t){if(t&&("object"===jE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,TE()?Reflect.construct(t,r||[],ME(e).constructor):t.apply(e,r))}function TE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(TE=function(){return!!e})()}function ME(e){return ME=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ME(e)}function RE(e,t){return RE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},RE(e,t)}function LE(e,t,r){return(t=IE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IE(e){var t=function(e,t){if("object"!=jE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jE(t)?t:t+""}function DE(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function FE(e){return e.value}var zE=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return LE(e=NE(this,t,[].concat(n)),"lastBoundingBox",{width:-1,height:-1}),e}return function(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&&RE(e,t)}(t,e),r=t,n=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();return e.height=this.wrapperNode.offsetHeight,e.width=this.wrapperNode.offsetWidth,e}return null}},{key:"updateBBox",value:function(){var e=this.props.onBBoxUpdate,t=this.getBBox();t?(Math.abs(t.width-this.lastBoundingBox.width)>1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t)):-1===this.lastBoundingBox.width&&-1===this.lastBoundingBox.height||(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?CE({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(e){var t,r,n=this.props,o=n.layout,i=n.align,a=n.verticalAlign,s=n.margin,u=n.chartWidth,l=n.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===i&&"vertical"===o?{left:((u||0)-this.getBBoxSnapshot().width)/2}:"right"===i?{right:s&&s.right||0}:{left:s&&s.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(r="middle"===a?{top:((l||0)-this.getBBoxSnapshot().height)/2}:"bottom"===a?{bottom:s&&s.bottom||0}:{top:s&&s.top||0}),CE(CE({},t),r)}},{key:"render",value:function(){var e=this,t=this.props,r=t.content,n=t.width,o=t.height,a=t.wrapperStyle,s=t.payloadUniqBy,u=t.payload,l=CE(CE({position:"absolute",width:n||"auto",height:o||"auto"},this.getDefaultPosition(a)),a);return i().createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(t){e.wrapperNode=t}},function(e,t){if(i().isValidElement(e))return i().cloneElement(e,t);if("function"==typeof e)return i().createElement(e,t);t.ref;var r=DE(t,PE);return i().createElement(EE,r)}(r,CE(CE({},this.props),{},{payload:pS(u,s,FE)})))}}],o=[{key:"getWithHeight",value:function(e,t){var r=CE(CE({},this.defaultProps),e.props).layout;return"vertical"===r&&C_(e.props.height)?{height:e.props.height}:"horizontal"===r?{width:e.props.width||t}:null}}],n&&AE(r.prototype,n),o&&AE(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.PureComponent);function BE(){return BE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BE.apply(this,arguments)}LE(zE,"displayName","Legend"),LE(zE,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var VE=function(e){var t=e.cx,r=e.cy,n=e.r,o=e.className,a=gt("recharts-dot",o);return t===+t&&r===+r&&n===+n?i().createElement("circle",BE({},pO(e,!1),X_(e),{className:a,cx:t,cy:r,r:n})):null},$E=o(5556),UE=o.n($E),GE=Object.getOwnPropertyNames,WE=Object.getOwnPropertySymbols,qE=Object.prototype.hasOwnProperty;function HE(e,t){return function(r,n,o){return e(r,n,o)&&t(r,n,o)}}function ZE(e){return function(t,r,n){if(!t||!r||"object"!=typeof t||"object"!=typeof r)return e(t,r,n);var o=n.cache,i=o.get(t),a=o.get(r);if(i&&a)return i===r&&a===t;o.set(t,r),o.set(r,t);var s=e(t,r,n);return o.delete(t),o.delete(r),s}}function KE(e){return GE(e).concat(WE(e))}var YE=Object.hasOwn||function(e,t){return qE.call(e,t)};function XE(e,t){return e===t||!e&&!t&&e!=e&&t!=t}var QE=Object.getOwnPropertyDescriptor,JE=Object.keys;function ej(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function tj(e,t){return XE(e.getTime(),t.getTime())}function rj(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function nj(e,t){return e===t}function oj(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var o,i,a=new Array(n),s=e.entries(),u=0;(o=s.next())&&!o.done;){for(var l=t.entries(),c=!1,f=0;(i=l.next())&&!i.done;)if(a[f])f++;else{var d=o.value,p=i.value;if(r.equals(d[0],p[0],u,f,e,t,r)&&r.equals(d[1],p[1],d[0],p[0],e,t,r)){c=a[f]=!0;break}f++}if(!c)return!1;u++}return!0}var ij=XE;function aj(e,t,r){var n=JE(e),o=n.length;if(JE(t).length!==o)return!1;for(;o-- >0;)if(!pj(e,t,r,n[o]))return!1;return!0}function sj(e,t,r){var n,o,i,a=KE(e),s=a.length;if(KE(t).length!==s)return!1;for(;s-- >0;){if(!pj(e,t,r,n=a[s]))return!1;if(o=QE(e,n),i=QE(t,n),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function uj(e,t){return XE(e.valueOf(),t.valueOf())}function lj(e,t){return e.source===t.source&&e.flags===t.flags}function cj(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var o,i,a=new Array(n),s=e.values();(o=s.next())&&!o.done;){for(var u=t.values(),l=!1,c=0;(i=u.next())&&!i.done;){if(!a[c]&&r.equals(o.value,i.value,o.value,i.value,e,t,r)){l=a[c]=!0;break}c++}if(!l)return!1}return!0}function fj(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function dj(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function pj(e,t,r,n){return!("_owner"!==n&&"__o"!==n&&"__v"!==n||!e.$$typeof&&!t.$$typeof)||YE(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var hj=Array.isArray,mj="function"==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView:null,yj=Object.assign,vj=Object.prototype.toString.call.bind(Object.prototype.toString);var gj=bj();bj({strict:!0}),bj({circular:!0}),bj({circular:!0,strict:!0}),bj({createInternalComparator:function(){return XE}}),bj({strict:!0,createInternalComparator:function(){return XE}}),bj({circular:!0,createInternalComparator:function(){return XE}}),bj({circular:!0,createInternalComparator:function(){return XE},strict:!0});function bj(e){void 0===e&&(e={});var t,r=e.circular,n=void 0!==r&&r,o=e.createInternalComparator,i=e.createState,a=e.strict,s=void 0!==a&&a,u=function(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,o={areArraysEqual:n?sj:ej,areDatesEqual:tj,areErrorsEqual:rj,areFunctionsEqual:nj,areMapsEqual:n?HE(oj,sj):oj,areNumbersEqual:ij,areObjectsEqual:n?sj:aj,arePrimitiveWrappersEqual:uj,areRegExpsEqual:lj,areSetsEqual:n?HE(cj,sj):cj,areTypedArraysEqual:n?sj:fj,areUrlsEqual:dj};if(r&&(o=yj({},o,r(o))),t){var i=ZE(o.areArraysEqual),a=ZE(o.areMapsEqual),s=ZE(o.areObjectsEqual),u=ZE(o.areSetsEqual);o=yj({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return o}(e),l=function(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,o=e.areFunctionsEqual,i=e.areMapsEqual,a=e.areNumbersEqual,s=e.areObjectsEqual,u=e.arePrimitiveWrappersEqual,l=e.areRegExpsEqual,c=e.areSetsEqual,f=e.areTypedArraysEqual,d=e.areUrlsEqual;return function(e,p,h){if(e===p)return!0;if(null==e||null==p)return!1;var m=typeof e;if(m!==typeof p)return!1;if("object"!==m)return"number"===m?a(e,p,h):"function"===m&&o(e,p,h);var y=e.constructor;if(y!==p.constructor)return!1;if(y===Object)return s(e,p,h);if(hj(e))return t(e,p,h);if(null!=mj&&mj(e))return f(e,p,h);if(y===Date)return r(e,p,h);if(y===RegExp)return l(e,p,h);if(y===Map)return i(e,p,h);if(y===Set)return c(e,p,h);var v=vj(e);return"[object Date]"===v?r(e,p,h):"[object RegExp]"===v?l(e,p,h):"[object Map]"===v?i(e,p,h):"[object Set]"===v?c(e,p,h):"[object Object]"===v?"function"!=typeof e.then&&"function"!=typeof p.then&&s(e,p,h):"[object URL]"===v?d(e,p,h):"[object Error]"===v?n(e,p,h):"[object Arguments]"===v?s(e,p,h):("[object Boolean]"===v||"[object Number]"===v||"[object String]"===v)&&u(e,p,h)}}(u),c=o?o(l):(t=l,function(e,r,n,o,i,a,s){return t(e,r,s)});return function(e){var t=e.circular,r=e.comparator,n=e.createState,o=e.equals,i=e.strict;if(n)return function(e,a){var s=n(),u=s.cache,l=void 0===u?t?new WeakMap:void 0:u,c=s.meta;return r(e,a,{cache:l,equals:o,meta:c,strict:i})};if(t)return function(e,t){return r(e,t,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(e,t){return r(e,t,a)}}({circular:n,comparator:l,createState:i,equals:c,strict:s})}function wj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=-1;requestAnimationFrame((function n(o){r<0&&(r=o),o-r>t?(e(o),r=-1):function(e){"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(e)}(n)}))}function xj(e){return xj="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},xj(e)}function _j(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Oj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oj(e,t)}(e)||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.")}()}function Oj(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Sj(){var e=function(){return null},t=!1,r=function r(n){if(!t){if(Array.isArray(n)){if(!n.length)return;var o=_j(n),i=o[0],a=o.slice(1);return"number"==typeof i?void wj(r.bind(null,a),i):(r(i),void wj(r.bind(null,a)))}"object"===xj(n)&&e(n),"function"==typeof n&&n()}};return{stop:function(){t=!0},start:function(e){t=!1,r(e)},subscribe:function(t){return e=t,function(){e=function(){return null}}}}}function Ej(e){return Ej="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},Ej(e)}function jj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pj(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jj(Object(r),!0).forEach((function(t){kj(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jj(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function kj(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Ej(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Ej(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ej(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Cj=function(e){return e},Aj=function(e,t){return Object.keys(t).reduce((function(r,n){return Pj(Pj({},r),{},kj({},n,e(n,t[n])))}),{})},Nj=function(e,t,r){return e.map((function(e){return"".concat((n=e,n.replace(/([A-Z])/g,(function(e){return"-".concat(e.toLowerCase())})))," ").concat(t,"ms ").concat(r);var n})).join(",")};function Tj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||Rj(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.")}()}function Mj(e){return function(e){if(Array.isArray(e))return Lj(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Rj(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.")}()}function Rj(e,t){if(e){if("string"==typeof e)return Lj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Lj(e,t):void 0}}function Lj(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ij=1e-4,Dj=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},Fj=function(e,t){return e.map((function(e,r){return e*Math.pow(t,r)})).reduce((function(e,t){return e+t}))},zj=function(e,t){return function(r){var n=Dj(e,t);return Fj(n,r)}},Bj=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],o=t[1],i=t[2],a=t[3];if(1===t.length)switch(t[0]){case"linear":n=0,o=0,i=1,a=1;break;case"ease":n=.25,o=.1,i=.25,a=1;break;case"ease-in":n=.42,o=0,i=1,a=1;break;case"ease-out":n=.42,o=0,i=.58,a=1;break;case"ease-in-out":n=0,o=0,i=.58,a=1;break;default:var s=t[0].split("(");if("cubic-bezier"===s[0]&&4===s[1].split(")")[0].split(",").length){var u=s[1].split(")")[0].split(",").map((function(e){return parseFloat(e)})),l=Tj(u,4);n=l[0],o=l[1],i=l[2],a=l[3]}}[n,i,o,a].every((function(e){return"number"==typeof e&&e>=0&&e<=1}));var c,f,d=zj(n,i),p=zj(o,a),h=(c=n,f=i,function(e){var t=Dj(c,f),r=[].concat(Mj(t.map((function(e,t){return e*t})).slice(1)),[0]);return Fj(r,e)}),m=function(e){return e>1?1:e<0?0:e},y=function(e){for(var t=e>1?1:e,r=t,n=0;n<8;++n){var o=d(r)-t,i=h(r);if(Math.abs(o-t)<Ij||i<Ij)return p(r);r=m(r-o/i)}return p(r)};return y.isStepper=!1,y},Vj=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0];if("string"==typeof n)switch(n){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Bj(n);case"spring":return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiff,r=void 0===t?100:t,n=e.damping,o=void 0===n?8:n,i=e.dt,a=void 0===i?17:i,s=function(e,t,n){var i=n+(-(e-t)*r-n*o)*a/1e3,s=n*a/1e3+e;return Math.abs(s-t)<Ij&&Math.abs(i)<Ij?[t,0]:[s,i]};return s.isStepper=!0,s.dt=a,s}();default:if("cubic-bezier"===n.split("(")[0])return Bj(n)}return"function"==typeof n?n:null};function $j(e){return $j="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},$j(e)}function Uj(e){return function(e){if(Array.isArray(e))return Kj(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Zj(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.")}()}function Gj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wj(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gj(Object(r),!0).forEach((function(t){qj(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gj(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qj(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==$j(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==$j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===$j(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||Zj(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.")}()}function Zj(e,t){if(e){if("string"==typeof e)return Kj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Kj(e,t):void 0}}function Kj(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Yj=function(e,t,r){return e+(t-e)*r},Xj=function(e){return e.from!==e.to},Qj=function e(t,r,n){var o=Aj((function(e,r){if(Xj(r)){var n=Hj(t(r.from,r.to,r.velocity),2),o=n[0],i=n[1];return Wj(Wj({},r),{},{from:o,velocity:i})}return r}),r);return n<1?Aj((function(e,t){return Xj(t)?Wj(Wj({},t),{},{velocity:Yj(t.velocity,o[e].velocity,n),from:Yj(t.from,o[e].from,n)}):t}),r):e(t,o,n-1)};const Jj=function(e,t,r,n,o){var i,a,s,u,l=(i=e,a=t,[Object.keys(i),Object.keys(a)].reduce((function(e,t){return e.filter((function(e){return t.includes(e)}))}))),c=l.reduce((function(r,n){return Wj(Wj({},r),{},qj({},n,[e[n],t[n]]))}),{}),f=l.reduce((function(r,n){return Wj(Wj({},r),{},qj({},n,{from:e[n],velocity:0,to:t[n]}))}),{}),d=-1,p=function(){return null};return p=r.isStepper?function(n){s||(s=n);var i=(n-s)/r.dt;f=Qj(r,f,i),o(Wj(Wj(Wj({},e),t),Aj((function(e,t){return t.from}),f))),s=n,Object.values(f).filter(Xj).length&&(d=requestAnimationFrame(p))}:function(i){u||(u=i);var a=(i-u)/n,s=Aj((function(e,t){return Yj.apply(void 0,Uj(t).concat([r(a)]))}),c);if(o(Wj(Wj(Wj({},e),t),s)),a<1)d=requestAnimationFrame(p);else{var l=Aj((function(e,t){return Yj.apply(void 0,Uj(t).concat([r(1)]))}),c);o(Wj(Wj(Wj({},e),t),l))}},function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}};function eP(e){return eP="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},eP(e)}var tP=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function rP(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function nP(e){return function(e){if(Array.isArray(e))return oP(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return oP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oP(e,t)}(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.")}()}function oP(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function iP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function aP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?iP(Object(r),!0).forEach((function(t){sP(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iP(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function sP(e,t,r){return(t=lP(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lP(n.key),n)}}function lP(e){var t=function(e,t){if("object"!==eP(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==eP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eP(t)?t:String(t)}function cP(e,t){return cP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cP(e,t)}function fP(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=hP(e);if(t){var o=hP(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return dP(this,r)}}function dP(e,t){if(t&&("object"===eP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pP(e)}function pP(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hP(e){return hP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hP(e)}var mP=function(e){!function(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&&cP(e,t)}(s,e);var t,n,o,a=fP(s);function s(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var n=(r=a.call(this,e,t)).props,o=n.isActive,i=n.attributeName,u=n.from,l=n.to,c=n.steps,f=n.children,d=n.duration;if(r.handleStyleChange=r.handleStyleChange.bind(pP(r)),r.changeStyle=r.changeStyle.bind(pP(r)),!o||d<=0)return r.state={style:{}},"function"==typeof f&&(r.state={style:l}),dP(r);if(c&&c.length)r.state={style:c[0].style};else if(u){if("function"==typeof f)return r.state={style:u},dP(r);r.state={style:i?sP({},i,u):u}}else r.state={style:{}};return r}return t=s,n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.isActive,r=e.canBegin;this.mounted=!0,t&&r&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isActive,n=t.canBegin,o=t.attributeName,i=t.shouldReAnimate,a=t.to,s=t.from,u=this.state.style;if(n)if(r){if(!(gj(e.to,a)&&e.canBegin&&e.isActive)){var l=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var c=l||i?s:e.to;if(this.state&&u){var f={style:o?sP({},o,c):c};(o&&u[o]!==c||!o&&u!==c)&&this.setState(f)}this.runAnimation(aP(aP({},this.props),{},{from:c,begin:0}))}}else{var d={style:o?sP({},o,a):a};this.state&&u&&(o&&u[o]!==a||!o&&u!==a)&&this.setState(d)}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:"handleStyleChange",value:function(e){this.changeStyle(e)}},{key:"changeStyle",value:function(e){this.mounted&&this.setState({style:e})}},{key:"runJSAnimation",value:function(e){var t=this,r=e.from,n=e.to,o=e.duration,i=e.easing,a=e.begin,s=e.onAnimationEnd,u=e.onAnimationStart,l=Jj(r,n,Vj(i),o,this.changeStyle);this.manager.start([u,a,function(){t.stopJSAnimation=l()},o,s])}},{key:"runStepAnimation",value:function(e){var t=this,r=e.steps,n=e.begin,o=e.onAnimationStart,i=r[0],a=i.style,s=i.duration,u=void 0===s?0:s;return this.manager.start([o].concat(nP(r.reduce((function(e,n,o){if(0===o)return e;var i=n.duration,a=n.easing,s=void 0===a?"ease":a,u=n.style,l=n.properties,c=n.onAnimationEnd,f=o>0?r[o-1]:n,d=l||Object.keys(u);if("function"==typeof s||"spring"===s)return[].concat(nP(e),[t.runJSAnimation.bind(t,{from:f.style,to:u,duration:i,easing:s}),i]);var p=Nj(d,i,s),h=aP(aP(aP({},f.style),u),{},{transition:p});return[].concat(nP(e),[h,i,c]).filter(Cj)}),[a,Math.max(u,n)])),[e.onAnimationEnd]))}},{key:"runAnimation",value:function(e){this.manager||(this.manager=Sj());var t=e.begin,r=e.duration,n=e.attributeName,o=e.to,i=e.easing,a=e.onAnimationStart,s=e.onAnimationEnd,u=e.steps,l=e.children,c=this.manager;if(this.unSubscribe=c.subscribe(this.handleStyleChange),"function"!=typeof i&&"function"!=typeof l&&"spring"!==i)if(u.length>1)this.runStepAnimation(e);else{var f=n?sP({},n,o):o,d=Nj(Object.keys(f),r,i);c.start([a,t,aP(aP({},f),{},{transition:d}),r,s])}else this.runJSAnimation(e)}},{key:"render",value:function(){var e=this.props,t=e.children,n=(e.begin,e.duration),o=(e.attributeName,e.easing,e.isActive),a=(e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart,rP(e,tP)),s=r.Children.count(t),u=this.state.style;if("function"==typeof t)return t(u);if(!o||0===s||n<=0)return t;var l=function(e){var t=e.props,n=t.style,o=void 0===n?{}:n,i=t.className;return(0,r.cloneElement)(e,aP(aP({},a),{},{style:aP(aP({},o),u),className:i}))};return 1===s?l(r.Children.only(t)):i().createElement("div",null,r.Children.map(t,(function(e){return l(e)})))}}],n&&uP(t.prototype,n),o&&uP(t,o),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.PureComponent);mP.displayName="Animate",mP.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},mP.propTypes={from:UE().oneOfType([UE().object,UE().string]),to:UE().oneOfType([UE().object,UE().string]),attributeName:UE().string,duration:UE().number,begin:UE().number,easing:UE().oneOfType([UE().string,UE().func]),steps:UE().arrayOf(UE().shape({duration:UE().number.isRequired,style:UE().object.isRequired,easing:UE().oneOfType([UE().oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),UE().func]),properties:UE().arrayOf("string"),onAnimationEnd:UE().func})),children:UE().oneOfType([UE().node,UE().func]),isActive:UE().bool,canBegin:UE().bool,onAnimationEnd:UE().func,shouldReAnimate:UE().bool,onAnimationStart:UE().func,onAnimationReStart:UE().func};const yP=mP;function vP(e){return vP="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},vP(e)}function gP(){return gP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gP.apply(this,arguments)}function bP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return wP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wP(e,t)}(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.")}()}function wP(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xP(Object(r),!0).forEach((function(t){OP(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xP(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function OP(e,t,r){return t=function(e){var t=function(e,t){if("object"!=vP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=vP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==vP(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var SP=function(e,t,r,n,o){var i,a=Math.min(Math.abs(r)/2,Math.abs(n)/2),s=n>=0?1:-1,u=r>=0?1:-1,l=n>=0&&r>=0||n<0&&r<0?1:0;if(a>0&&o instanceof Array){for(var c=[0,0,0,0],f=0;f<4;f++)c[f]=o[f]>a?a:o[f];i="M".concat(e,",").concat(t+s*c[0]),c[0]>0&&(i+="A ".concat(c[0],",").concat(c[0],",0,0,").concat(l,",").concat(e+u*c[0],",").concat(t)),i+="L ".concat(e+r-u*c[1],",").concat(t),c[1]>0&&(i+="A ".concat(c[1],",").concat(c[1],",0,0,").concat(l,",\n        ").concat(e+r,",").concat(t+s*c[1])),i+="L ".concat(e+r,",").concat(t+n-s*c[2]),c[2]>0&&(i+="A ".concat(c[2],",").concat(c[2],",0,0,").concat(l,",\n        ").concat(e+r-u*c[2],",").concat(t+n)),i+="L ".concat(e+u*c[3],",").concat(t+n),c[3]>0&&(i+="A ".concat(c[3],",").concat(c[3],",0,0,").concat(l,",\n        ").concat(e,",").concat(t+n-s*c[3])),i+="Z"}else if(a>0&&o===+o&&o>0){var d=Math.min(a,o);i="M ".concat(e,",").concat(t+s*d,"\n            A ").concat(d,",").concat(d,",0,0,").concat(l,",").concat(e+u*d,",").concat(t,"\n            L ").concat(e+r-u*d,",").concat(t,"\n            A ").concat(d,",").concat(d,",0,0,").concat(l,",").concat(e+r,",").concat(t+s*d,"\n            L ").concat(e+r,",").concat(t+n-s*d,"\n            A ").concat(d,",").concat(d,",0,0,").concat(l,",").concat(e+r-u*d,",").concat(t+n,"\n            L ").concat(e+u*d,",").concat(t+n,"\n            A ").concat(d,",").concat(d,",0,0,").concat(l,",").concat(e,",").concat(t+n-s*d," Z")}else i="M ".concat(e,",").concat(t," h ").concat(r," v ").concat(n," h ").concat(-r," Z");return i},EP=function(e,t){if(!e||!t)return!1;var r=e.x,n=e.y,o=t.x,i=t.y,a=t.width,s=t.height;if(Math.abs(a)>0&&Math.abs(s)>0){var u=Math.min(o,o+a),l=Math.max(o,o+a),c=Math.min(i,i+s),f=Math.max(i,i+s);return r>=u&&r<=l&&n>=c&&n<=f}return!1},jP={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},PP=function(e){var t=_P(_P({},jP),e),n=(0,r.useRef)(),o=bP((0,r.useState)(-1),2),a=o[0],s=o[1];(0,r.useEffect)((function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&s(e)}catch(e){}}),[]);var u=t.x,l=t.y,c=t.width,f=t.height,d=t.radius,p=t.className,h=t.animationEasing,m=t.animationDuration,y=t.animationBegin,v=t.isAnimationActive,g=t.isUpdateAnimationActive;if(u!==+u||l!==+l||c!==+c||f!==+f||0===c||0===f)return null;var b=gt("recharts-rectangle",p);return g?i().createElement(yP,{canBegin:a>0,from:{width:c,height:f,x:u,y:l},to:{width:c,height:f,x:u,y:l},duration:m,animationEasing:h,isActive:g},(function(e){var r=e.width,o=e.height,s=e.x,u=e.y;return i().createElement(yP,{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:v,easing:h},i().createElement("path",gP({},pO(t,!0),{className:b,d:SP(s,u,r,o,d),ref:n})))})):i().createElement("path",gP({},pO(t,!0),{className:b,d:SP(u,l,c,f,d)}))};function kP(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function CP(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}class AP extends Map{constructor(e,t=RP){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,r]of e)this.set(t,r)}get(e){return super.get(NP(this,e))}has(e){return super.has(NP(this,e))}set(e,t){return super.set(TP(this,e),t)}delete(e){return super.delete(MP(this,e))}}Set;function NP({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function TP({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function MP({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function RP(e){return null!==e&&"object"==typeof e?e.valueOf():e}const LP=Symbol("implicit");function IP(){var e=new AP,t=[],r=[],n=LP;function o(o){let i=e.get(o);if(void 0===i){if(n!==LP)return n;e.set(o,i=t.push(o)-1)}return r[i%r.length]}return o.domain=function(r){if(!arguments.length)return t.slice();t=[],e=new AP;for(const n of r)e.has(n)||e.set(n,t.push(n)-1);return o},o.range=function(e){return arguments.length?(r=Array.from(e),o):r.slice()},o.unknown=function(e){return arguments.length?(n=e,o):n},o.copy=function(){return IP(t,r).unknown(n)},kP.apply(o,arguments),o}function DP(){var e,t,r=IP().unknown(void 0),n=r.domain,o=r.range,i=0,a=1,s=!1,u=0,l=0,c=.5;function f(){var r=n().length,f=a<i,d=f?a:i,p=f?i:a;e=(p-d)/Math.max(1,r-u+2*l),s&&(e=Math.floor(e)),d+=(p-d-e*(r-u))*c,t=e*(1-u),s&&(d=Math.round(d),t=Math.round(t));var h=function(e,t,r){e=+e,t=+t,r=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+r;for(var n=-1,o=0|Math.max(0,Math.ceil((t-e)/r)),i=new Array(o);++n<o;)i[n]=e+n*r;return i}(r).map((function(t){return d+e*t}));return o(f?h.reverse():h)}return delete r.unknown,r.domain=function(e){return arguments.length?(n(e),f()):n()},r.range=function(e){return arguments.length?([i,a]=e,i=+i,a=+a,f()):[i,a]},r.rangeRound=function(e){return[i,a]=e,i=+i,a=+a,s=!0,f()},r.bandwidth=function(){return t},r.step=function(){return e},r.round=function(e){return arguments.length?(s=!!e,f()):s},r.padding=function(e){return arguments.length?(u=Math.min(1,l=+e),f()):u},r.paddingInner=function(e){return arguments.length?(u=Math.min(1,e),f()):u},r.paddingOuter=function(e){return arguments.length?(l=+e,f()):l},r.align=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),f()):c},r.copy=function(){return DP(n(),[i,a]).round(s).paddingInner(u).paddingOuter(l).align(c)},kP.apply(f(),arguments)}function FP(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return FP(t())},e}function zP(){return FP(DP.apply(null,arguments).paddingInner(1))}function BP(e){return BP="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},BP(e)}function VP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?VP(Object(r),!0).forEach((function(t){UP(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VP(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function UP(e,t,r){return t=function(e){var t=function(e,t){if("object"!=BP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=BP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==BP(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var GP={widthCache:{},cacheCount:0},WP={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},qP="recharts_measurement_span";var HP=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||cS.isSsr)return{width:0,height:0};var r,n=(r=$P({},t),Object.keys(r).forEach((function(e){r[e]||delete r[e]})),r),o=JSON.stringify({text:e,copyStyle:n});if(GP.widthCache[o])return GP.widthCache[o];try{var i=document.getElementById(qP);i||((i=document.createElement("span")).setAttribute("id",qP),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var a=$P($P({},WP),n);Object.assign(i.style,a),i.textContent="".concat(e);var s=i.getBoundingClientRect(),u={width:s.width,height:s.height};return GP.widthCache[o]=u,++GP.cacheCount>2e3&&(GP.cacheCount=0,GP.widthCache={}),u}catch(e){return{width:0,height:0}}};function ZP(e){return ZP="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},ZP(e)}function KP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return YP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return YP(e,t)}(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.")}()}function YP(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function XP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,QP(n.key),n)}}function QP(e){var t=function(e,t){if("object"!=ZP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ZP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ZP(t)?t:t+""}var JP=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,ek=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,tk=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,rk=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,nk={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},ok=Object.keys(nk),ik="NaN";var ak=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),""===r||tk.test(r)||(this.num=NaN,this.unit=""),ok.includes(r)&&(this.num=function(e,t){return e*nk[t]}(t,r),this.unit="px")}return t=e,n=[{key:"parse",value:function(t){var r,n=KP(null!==(r=rk.exec(t))&&void 0!==r?r:[],3),o=n[1],i=n[2];return new e(parseFloat(o),null!=i?i:"")}}],(r=[{key:"add",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num+t.num,this.unit)}},{key:"subtract",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num-t.num,this.unit)}},{key:"multiply",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num*t.num,this.unit||t.unit)}},{key:"divide",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num/t.num,this.unit||t.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}])&&XP(t.prototype,r),n&&XP(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();function sk(e){if(e.includes(ik))return ik;for(var t=e;t.includes("*")||t.includes("/");){var r,n=KP(null!==(r=JP.exec(t))&&void 0!==r?r:[],4),o=n[1],i=n[2],a=n[3],s=ak.parse(null!=o?o:""),u=ak.parse(null!=a?a:""),l="*"===i?s.multiply(u):s.divide(u);if(l.isNaN())return ik;t=t.replace(JP,l.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var c,f=KP(null!==(c=ek.exec(t))&&void 0!==c?c:[],4),d=f[1],p=f[2],h=f[3],m=ak.parse(null!=d?d:""),y=ak.parse(null!=h?h:""),v="+"===p?m.add(y):m.subtract(y);if(v.isNaN())return ik;t=t.replace(ek,v.toString())}return t}var uk=/\(([^()]*)\)/;function lk(e){var t=e.replace(/\s+/g,"");return t=function(e){for(var t=e;t.includes("(");){var r=KP(uk.exec(t),2)[1];t=t.replace(uk,sk(r))}return t}(t),t=sk(t)}function ck(e){var t=function(e){try{return lk(e)}catch(e){return ik}}(e.slice(5,-1));return t===ik?"":t}var fk=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],dk=["dx","dy","angle","className","breakAll"];function pk(){return pk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pk.apply(this,arguments)}function hk(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function mk(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yk(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yk(e,t)}(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.")}()}function yk(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var vk=/[ \f\n\r\t\v\u2028\u2029]+/,gk=function(e){var t=e.children,r=e.breakAll,n=e.style;try{var o=[];return z_()(t)||(o=r?t.toString().split(""):t.toString().split(vk)),{wordsWithComputedWidth:o.map((function(e){return{word:e,width:HP(e,n).width}})),spaceWidth:r?0:HP(" ",n).width}}catch(e){return null}},bk=function(e){return[{words:z_()(e)?[]:e.toString().split(vk)}]},wk=function(e){var t=e.width,r=e.scaleToFit,n=e.children,o=e.style,i=e.breakAll,a=e.maxLines;if((t||r)&&!cS.isSsr){var s=gk({breakAll:i,children:n,style:o});return s?function(e,t,r,n,o){var i=e.maxLines,a=e.children,s=e.style,u=e.breakAll,l=C_(i),c=a,f=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){var i=t.word,a=t.width,s=e[e.length-1];if(s&&(null==n||o||s.width+a+r<Number(n)))s.words.push(i),s.width+=a+r;else{var u={words:[i],width:a};e.push(u)}return e}),[])},d=f(t);if(!l)return d;for(var p,h=function(e){var t=c.slice(0,e),r=gk({breakAll:u,style:s,children:t+"…"}).wordsWithComputedWidth,o=f(r),a=o.length>i||function(e){return e.reduce((function(e,t){return e.width>t.width?e:t}))}(o).width>Number(n);return[a,o]},m=0,y=c.length-1,v=0;m<=y&&v<=c.length-1;){var g=Math.floor((m+y)/2),b=mk(h(g-1),2),w=b[0],x=b[1],_=mk(h(g),1)[0];if(w||_||(m=g+1),w&&_&&(y=g-1),!w&&_){p=x;break}v++}return p||d}({breakAll:i,children:n,maxLines:a,style:o},s.wordsWithComputedWidth,s.spaceWidth,t,r):bk(n)}return bk(n)},xk="#808080",_k=function(e){var t=e.x,n=void 0===t?0:t,o=e.y,a=void 0===o?0:o,s=e.lineHeight,u=void 0===s?"1em":s,l=e.capHeight,c=void 0===l?"0.71em":l,f=e.scaleToFit,d=void 0!==f&&f,p=e.textAnchor,h=void 0===p?"start":p,m=e.verticalAnchor,y=void 0===m?"end":m,v=e.fill,g=void 0===v?xk:v,b=hk(e,fk),w=(0,r.useMemo)((function(){return wk({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:d,style:b.style,width:b.width})}),[b.breakAll,b.children,b.maxLines,d,b.style,b.width]),x=b.dx,_=b.dy,O=b.angle,S=b.className,E=b.breakAll,j=hk(b,dk);if(!A_(n)||!A_(a))return null;var P,k=n+(C_(x)?x:0),C=a+(C_(_)?_:0);switch(y){case"start":P=ck("calc(".concat(c,")"));break;case"middle":P=ck("calc(".concat((w.length-1)/2," * -").concat(u," + (").concat(c," / 2))"));break;default:P=ck("calc(".concat(w.length-1," * -").concat(u,")"))}var A=[];if(d){var N=w[0].width,T=b.width;A.push("scale(".concat((C_(T)?T/N:1)/N,")"))}return O&&A.push("rotate(".concat(O,", ").concat(k,", ").concat(C,")")),A.length&&(j.transform=A.join(" ")),i().createElement("text",pk({},pO(j,!0),{x:k,y:C,className:gt("recharts-text",S),textAnchor:h,fill:g.includes("url")?xk:g}),w.map((function(e,t){var r=e.words.join(E?"":" ");return i().createElement("tspan",{x:k,dy:0===t?P:u,key:"".concat(r,"-").concat(t)},r)})))};const Ok=Math.sqrt(50),Sk=Math.sqrt(10),Ek=Math.sqrt(2);function jk(e,t,r){const n=(t-e)/Math.max(0,r),o=Math.floor(Math.log10(n)),i=n/Math.pow(10,o),a=i>=Ok?10:i>=Sk?5:i>=Ek?2:1;let s,u,l;return o<0?(l=Math.pow(10,-o)/a,s=Math.round(e*l),u=Math.round(t*l),s/l<e&&++s,u/l>t&&--u,l=-l):(l=Math.pow(10,o)*a,s=Math.round(e/l),u=Math.round(t/l),s*l<e&&++s,u*l>t&&--u),u<s&&.5<=r&&r<2?jk(e,t,2*r):[s,u,l]}function Pk(e,t,r){if(!((r=+r)>0))return[];if((e=+e)===(t=+t))return[e];const n=t<e,[o,i,a]=n?jk(t,e,r):jk(e,t,r);if(!(i>=o))return[];const s=i-o+1,u=new Array(s);if(n)if(a<0)for(let e=0;e<s;++e)u[e]=(i-e)/-a;else for(let e=0;e<s;++e)u[e]=(i-e)*a;else if(a<0)for(let e=0;e<s;++e)u[e]=(o+e)/-a;else for(let e=0;e<s;++e)u[e]=(o+e)*a;return u}function kk(e,t,r){return jk(e=+e,t=+t,r=+r)[2]}function Ck(e,t,r){r=+r;const n=(t=+t)<(e=+e),o=n?kk(t,e,r):kk(e,t,r);return(n?-1:1)*(o<0?1/-o:o)}function Ak(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Nk(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Tk(e){let t,r,n;function o(e,n,o=0,i=e.length){if(o<i){if(0!==t(n,n))return i;do{const t=o+i>>>1;r(e[t],n)<0?o=t+1:i=t}while(o<i)}return o}return 2!==e.length?(t=Ak,r=(t,r)=>Ak(e(t),r),n=(t,r)=>e(t)-r):(t=e===Ak||e===Nk?e:Mk,r=e,n=e),{left:o,center:function(e,t,r=0,i=e.length){const a=o(e,t,r,i-1);return a>r&&n(e[a-1],t)>-n(e[a],t)?a-1:a},right:function(e,n,o=0,i=e.length){if(o<i){if(0!==t(n,n))return i;do{const t=o+i>>>1;r(e[t],n)<=0?o=t+1:i=t}while(o<i)}return o}}}function Mk(){return 0}function Rk(e){return null===e?NaN:+e}const Lk=Tk(Ak),Ik=Lk.right,Dk=(Lk.left,Tk(Rk).center,Ik);function Fk(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function zk(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Bk(){}var Vk=.7,$k=1/Vk,Uk="\\s*([+-]?\\d+)\\s*",Gk="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Wk="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qk=/^#([0-9a-f]{3,8})$/,Hk=new RegExp(`^rgb\\(${Uk},${Uk},${Uk}\\)$`),Zk=new RegExp(`^rgb\\(${Wk},${Wk},${Wk}\\)$`),Kk=new RegExp(`^rgba\\(${Uk},${Uk},${Uk},${Gk}\\)$`),Yk=new RegExp(`^rgba\\(${Wk},${Wk},${Wk},${Gk}\\)$`),Xk=new RegExp(`^hsl\\(${Gk},${Wk},${Wk}\\)$`),Qk=new RegExp(`^hsla\\(${Gk},${Wk},${Wk},${Gk}\\)$`),Jk={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function eC(){return this.rgb().formatHex()}function tC(){return this.rgb().formatRgb()}function rC(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=qk.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?nC(t):3===r?new aC(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?oC(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?oC(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Hk.exec(e))?new aC(t[1],t[2],t[3],1):(t=Zk.exec(e))?new aC(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Kk.exec(e))?oC(t[1],t[2],t[3],t[4]):(t=Yk.exec(e))?oC(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Xk.exec(e))?dC(t[1],t[2]/100,t[3]/100,1):(t=Qk.exec(e))?dC(t[1],t[2]/100,t[3]/100,t[4]):Jk.hasOwnProperty(e)?nC(Jk[e]):"transparent"===e?new aC(NaN,NaN,NaN,0):null}function nC(e){return new aC(e>>16&255,e>>8&255,255&e,1)}function oC(e,t,r,n){return n<=0&&(e=t=r=NaN),new aC(e,t,r,n)}function iC(e,t,r,n){return 1===arguments.length?function(e){return e instanceof Bk||(e=rC(e)),e?new aC((e=e.rgb()).r,e.g,e.b,e.opacity):new aC}(e):new aC(e,t,r,null==n?1:n)}function aC(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function sC(){return`#${fC(this.r)}${fC(this.g)}${fC(this.b)}`}function uC(){const e=lC(this.opacity);return`${1===e?"rgb(":"rgba("}${cC(this.r)}, ${cC(this.g)}, ${cC(this.b)}${1===e?")":`, ${e})`}`}function lC(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cC(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function fC(e){return((e=cC(e))<16?"0":"")+e.toString(16)}function dC(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new hC(e,t,r,n)}function pC(e){if(e instanceof hC)return new hC(e.h,e.s,e.l,e.opacity);if(e instanceof Bk||(e=rC(e)),!e)return new hC;if(e instanceof hC)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,o=Math.min(t,r,n),i=Math.max(t,r,n),a=NaN,s=i-o,u=(i+o)/2;return s?(a=t===i?(r-n)/s+6*(r<n):r===i?(n-t)/s+2:(t-r)/s+4,s/=u<.5?i+o:2-i-o,a*=60):s=u>0&&u<1?0:a,new hC(a,s,u,e.opacity)}function hC(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function mC(e){return(e=(e||0)%360)<0?e+360:e}function yC(e){return Math.max(0,Math.min(1,e||0))}function vC(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function gC(e,t,r,n,o){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*r+(1+3*e+3*i-3*a)*n+a*o)/6}Fk(Bk,rC,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:eC,formatHex:eC,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return pC(this).formatHsl()},formatRgb:tC,toString:tC}),Fk(aC,iC,zk(Bk,{brighter(e){return e=null==e?$k:Math.pow($k,e),new aC(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Vk:Math.pow(Vk,e),new aC(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new aC(cC(this.r),cC(this.g),cC(this.b),lC(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:sC,formatHex:sC,formatHex8:function(){return`#${fC(this.r)}${fC(this.g)}${fC(this.b)}${fC(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:uC,toString:uC})),Fk(hC,(function(e,t,r,n){return 1===arguments.length?pC(e):new hC(e,t,r,null==n?1:n)}),zk(Bk,{brighter(e){return e=null==e?$k:Math.pow($k,e),new hC(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Vk:Math.pow(Vk,e),new hC(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,o=2*r-n;return new aC(vC(e>=240?e-240:e+120,o,n),vC(e,o,n),vC(e<120?e+240:e-120,o,n),this.opacity)},clamp(){return new hC(mC(this.h),yC(this.s),yC(this.l),lC(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=lC(this.opacity);return`${1===e?"hsl(":"hsla("}${mC(this.h)}, ${100*yC(this.s)}%, ${100*yC(this.l)}%${1===e?")":`, ${e})`}`}}));const bC=e=>()=>e;function wC(e,t){return function(r){return e+r*t}}function xC(e){return 1==(e=+e)?_C:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):bC(isNaN(t)?r:t)}}function _C(e,t){var r=t-e;return r?wC(e,r):bC(isNaN(e)?t:e)}const OC=function e(t){var r=xC(t);function n(e,t){var n=r((e=iC(e)).r,(t=iC(t)).r),o=r(e.g,t.g),i=r(e.b,t.b),a=_C(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=e,n}(1);function SC(e){return function(t){var r,n,o=t.length,i=new Array(o),a=new Array(o),s=new Array(o);for(r=0;r<o;++r)n=iC(t[r]),i[r]=n.r||0,a[r]=n.g||0,s[r]=n.b||0;return i=e(i),a=e(a),s=e(s),n.opacity=1,function(e){return n.r=i(e),n.g=a(e),n.b=s(e),n+""}}}SC((function(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),o=e[n],i=e[n+1],a=n>0?e[n-1]:2*o-i,s=n<t-1?e[n+2]:2*i-o;return gC((r-n/t)*t,a,o,i,s)}})),SC((function(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),o=e[(n+t-1)%t],i=e[n%t],a=e[(n+1)%t],s=e[(n+2)%t];return gC((r-n/t)*t,o,i,a,s)}}));function EC(e,t){var r,n=t?t.length:0,o=e?Math.min(n,e.length):0,i=new Array(o),a=new Array(n);for(r=0;r<o;++r)i[r]=MC(e[r],t[r]);for(;r<n;++r)a[r]=t[r];return function(e){for(r=0;r<o;++r)a[r]=i[r](e);return a}}function jC(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function PC(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function kC(e,t){var r,n={},o={};for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=MC(e[r],t[r]):o[r]=t[r];return function(e){for(r in n)o[r]=n[r](e);return o}}var CC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,AC=new RegExp(CC.source,"g");function NC(e,t){var r,n,o,i=CC.lastIndex=AC.lastIndex=0,a=-1,s=[],u=[];for(e+="",t+="";(r=CC.exec(e))&&(n=AC.exec(t));)(o=n.index)>i&&(o=t.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,u.push({i:a,x:PC(r,n)})),i=AC.lastIndex;return i<t.length&&(o=t.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?function(e){return function(t){return e(t)+""}}(u[0].x):function(e){return function(){return e}}(t):(t=u.length,function(e){for(var r,n=0;n<t;++n)s[(r=u[n]).i]=r.x(e);return s.join("")})}function TC(e,t){t||(t=[]);var r,n=e?Math.min(t.length,e.length):0,o=t.slice();return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function MC(e,t){var r,n=typeof t;return null==t||"boolean"===n?bC(t):("number"===n?PC:"string"===n?(r=rC(t))?(t=r,OC):NC:t instanceof rC?OC:t instanceof Date?jC:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?TC:Array.isArray(t)?EC:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?kC:PC)(e,t)}function RC(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function LC(e){return+e}var IC=[0,1];function DC(e){return e}function FC(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function zC(e,t,r){var n=e[0],o=e[1],i=t[0],a=t[1];return o<n?(n=FC(o,n),i=r(a,i)):(n=FC(n,o),i=r(i,a)),function(e){return i(n(e))}}function BC(e,t,r){var n=Math.min(e.length,t.length)-1,o=new Array(n),i=new Array(n),a=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<n;)o[a]=FC(e[a],e[a+1]),i[a]=r(t[a],t[a+1]);return function(t){var r=Dk(e,t,1,n)-1;return i[r](o[r](t))}}function VC(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function $C(){var e,t,r,n,o,i,a=IC,s=IC,u=MC,l=DC;function c(){var e=Math.min(a.length,s.length);return l!==DC&&(l=function(e,t){var r;return e>t&&(r=e,e=t,t=r),function(r){return Math.max(e,Math.min(t,r))}}(a[0],a[e-1])),n=e>2?BC:zC,o=i=null,f}function f(t){return null==t||isNaN(t=+t)?r:(o||(o=n(a.map(e),s,u)))(e(l(t)))}return f.invert=function(r){return l(t((i||(i=n(s,a.map(e),PC)))(r)))},f.domain=function(e){return arguments.length?(a=Array.from(e,LC),c()):a.slice()},f.range=function(e){return arguments.length?(s=Array.from(e),c()):s.slice()},f.rangeRound=function(e){return s=Array.from(e),u=RC,c()},f.clamp=function(e){return arguments.length?(l=!!e||DC,c()):l!==DC},f.interpolate=function(e){return arguments.length?(u=e,c()):u},f.unknown=function(e){return arguments.length?(r=e,f):r},function(r,n){return e=r,t=n,c()}}function UC(){return $C()(DC,DC)}var GC,WC=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function qC(e){if(!(t=WC.exec(e)))throw new Error("invalid format: "+e);var t;return new HC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function HC(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ZC(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function KC(e){return(e=ZC(Math.abs(e)))?e[1]:NaN}function YC(e,t){var r=ZC(e,t);if(!r)return e+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}qC.prototype=HC.prototype,HC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const XC={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>YC(100*e,t),r:YC,s:function(e,t){var r=ZC(e,t);if(!r)return e+"";var n=r[0],o=r[1],i=o-(GC=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=n.length;return i===a?n:i>a?n+new Array(i-a+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+ZC(e,Math.max(0,t+i-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function QC(e){return e}var JC,eA,tA,rA=Array.prototype.map,nA=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function oA(e){var t,r,n=void 0===e.grouping||void 0===e.thousands?QC:(t=rA.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var o=e.length,i=[],a=0,s=t[0],u=0;o>0&&s>0&&(u+s+1>n&&(s=Math.max(1,n-u)),i.push(e.substring(o-=s,o+s)),!((u+=s+1)>n));)s=t[a=(a+1)%t.length];return i.reverse().join(r)}),o=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?QC:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(rA.call(e.numerals,String)),u=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=qC(e)).fill,r=e.align,f=e.sign,d=e.symbol,p=e.zero,h=e.width,m=e.comma,y=e.precision,v=e.trim,g=e.type;"n"===g?(m=!0,g="g"):XC[g]||(void 0===y&&(y=12),v=!0,g="g"),(p||"0"===t&&"="===r)&&(p=!0,t="0",r="=");var b="$"===d?o:"#"===d&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",w="$"===d?i:/[%p]/.test(g)?u:"",x=XC[g],_=/[defgprs%]/.test(g);function O(e){var o,i,u,d=b,O=w;if("c"===g)O=x(e)+O,e="";else{var S=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:x(Math.abs(e),y),v&&(e=function(e){e:for(var t,r=e.length,n=1,o=-1;n<r;++n)switch(e[n]){case".":o=t=n;break;case"0":0===o&&(o=n),t=n;break;default:if(!+e[n])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),S&&0==+e&&"+"!==f&&(S=!1),d=(S?"("===f?f:l:"-"===f||"("===f?"":f)+d,O=("s"===g?nA[8+GC/3]:"")+O+(S&&"("===f?")":""),_)for(o=-1,i=e.length;++o<i;)if(48>(u=e.charCodeAt(o))||u>57){O=(46===u?a+e.slice(o+1):e.slice(o))+O,e=e.slice(0,o);break}}m&&!p&&(e=n(e,1/0));var E=d.length+e.length+O.length,j=E<h?new Array(h-E+1).join(t):"";switch(m&&p&&(e=n(j+e,j.length?h-O.length:1/0),j=""),r){case"<":e=d+e+O+j;break;case"=":e=d+j+e+O;break;case"^":e=j.slice(0,E=j.length>>1)+d+e+O+j.slice(E);break;default:e=j+d+e+O}return s(e)}return y=void 0===y?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),O.toString=function(){return e+""},O}return{format:f,formatPrefix:function(e,t){var r=f(((e=qC(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(KC(t)/3))),o=Math.pow(10,-n),i=nA[8+n/3];return function(e){return r(o*e)+i}}}}function iA(e,t,r,n){var o,i=Ck(e,t,r);switch((n=qC(null==n?",f":n)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=n.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(KC(t)/3)))-KC(Math.abs(e)))}(i,a))||(n.precision=o),tA(n,a);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,KC(t)-KC(e))+1}(i,Math.max(Math.abs(e),Math.abs(t))))||(n.precision=o-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(o=function(e){return Math.max(0,-KC(Math.abs(e)))}(i))||(n.precision=o-2*("%"===n.type))}return eA(n)}function aA(e){var t=e.domain;return e.ticks=function(e){var r=t();return Pk(r[0],r[r.length-1],null==e?10:e)},e.tickFormat=function(e,r){var n=t();return iA(n[0],n[n.length-1],null==e?10:e,r)},e.nice=function(r){null==r&&(r=10);var n,o,i=t(),a=0,s=i.length-1,u=i[a],l=i[s],c=10;for(l<u&&(o=u,u=l,l=o,o=a,a=s,s=o);c-- >0;){if((o=kk(u,l,r))===n)return i[a]=u,i[s]=l,t(i);if(o>0)u=Math.floor(u/o)*o,l=Math.ceil(l/o)*o;else{if(!(o<0))break;u=Math.ceil(u*o)/o,l=Math.floor(l*o)/o}n=o}return e},e}function sA(){var e=UC();return e.copy=function(){return VC(e,sA())},kP.apply(e,arguments),aA(e)}function uA(e){var t;function r(e){return null==e||isNaN(e=+e)?t:e}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,LC),r):e.slice()},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return uA(e).unknown(t)},e=arguments.length?Array.from(e,LC):[0,1],aA(r)}function lA(e,t){var r,n=0,o=(e=e.slice()).length-1,i=e[n],a=e[o];return a<i&&(r=n,n=o,o=r,r=i,i=a,a=r),e[n]=t.floor(i),e[o]=t.ceil(a),e}function cA(e){return Math.log(e)}function fA(e){return Math.exp(e)}function dA(e){return-Math.log(-e)}function pA(e){return-Math.exp(-e)}function hA(e){return isFinite(e)?+("1e"+e):e<0?0:e}function mA(e){return(t,r)=>-e(-t,r)}function yA(e){const t=e(cA,fA),r=t.domain;let n,o,i=10;function a(){return n=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(i),o=function(e){return 10===e?hA:e===Math.E?Math.exp:t=>Math.pow(e,t)}(i),r()[0]<0?(n=mA(n),o=mA(o),e(dA,pA)):e(cA,fA),t}return t.base=function(e){return arguments.length?(i=+e,a()):i},t.domain=function(e){return arguments.length?(r(e),a()):r()},t.ticks=e=>{const t=r();let a=t[0],s=t[t.length-1];const u=s<a;u&&([a,s]=[s,a]);let l,c,f=n(a),d=n(s);const p=null==e?10:+e;let h=[];if(!(i%1)&&d-f<p){if(f=Math.floor(f),d=Math.ceil(d),a>0){for(;f<=d;++f)for(l=1;l<i;++l)if(c=f<0?l/o(-f):l*o(f),!(c<a)){if(c>s)break;h.push(c)}}else for(;f<=d;++f)for(l=i-1;l>=1;--l)if(c=f>0?l/o(-f):l*o(f),!(c<a)){if(c>s)break;h.push(c)}2*h.length<p&&(h=Pk(a,s,p))}else h=Pk(f,d,Math.min(d-f,p)).map(o);return u?h.reverse():h},t.tickFormat=(e,r)=>{if(null==e&&(e=10),null==r&&(r=10===i?"s":","),"function"!=typeof r&&(i%1||null!=(r=qC(r)).precision||(r.trim=!0),r=eA(r)),e===1/0)return r;const a=Math.max(1,i*e/t.ticks().length);return e=>{let t=e/o(Math.round(n(e)));return t*i<i-.5&&(t*=i),t<=a?r(e):""}},t.nice=()=>r(lA(r(),{floor:e=>o(Math.floor(n(e))),ceil:e=>o(Math.ceil(n(e)))})),t}function vA(){const e=yA($C()).domain([1,10]);return e.copy=()=>VC(e,vA()).base(e.base()),kP.apply(e,arguments),e}function gA(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function bA(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function wA(e){var t=1,r=e(gA(t),bA(t));return r.constant=function(r){return arguments.length?e(gA(t=+r),bA(t)):t},aA(r)}function xA(){var e=wA($C());return e.copy=function(){return VC(e,xA()).constant(e.constant())},kP.apply(e,arguments)}function _A(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function OA(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function SA(e){return e<0?-e*e:e*e}function EA(e){var t=e(DC,DC),r=1;return t.exponent=function(t){return arguments.length?1===(r=+t)?e(DC,DC):.5===r?e(OA,SA):e(_A(r),_A(1/r)):r},aA(t)}function jA(){var e=EA($C());return e.copy=function(){return VC(e,jA()).exponent(e.exponent())},kP.apply(e,arguments),e}function PA(){return jA.apply(null,arguments).exponent(.5)}function kA(e){return Math.sign(e)*e*e}function CA(){var e,t=UC(),r=[0,1],n=!1;function o(r){var o=function(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}(t(r));return isNaN(o)?e:n?Math.round(o):o}return o.invert=function(e){return t.invert(kA(e))},o.domain=function(e){return arguments.length?(t.domain(e),o):t.domain()},o.range=function(e){return arguments.length?(t.range((r=Array.from(e,LC)).map(kA)),o):r.slice()},o.rangeRound=function(e){return o.range(e).round(!0)},o.round=function(e){return arguments.length?(n=!!e,o):n},o.clamp=function(e){return arguments.length?(t.clamp(e),o):t.clamp()},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return CA(t.domain(),r).round(n).clamp(t.clamp()).unknown(e)},kP.apply(o,arguments),aA(o)}function AA(e,t){let r;if(void 0===t)for(const t of e)null!=t&&(r<t||void 0===r&&t>=t)&&(r=t);else{let n=-1;for(let o of e)null!=(o=t(o,++n,e))&&(r<o||void 0===r&&o>=o)&&(r=o)}return r}function NA(e,t){let r;if(void 0===t)for(const t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let n=-1;for(let o of e)null!=(o=t(o,++n,e))&&(r>o||void 0===r&&o>=o)&&(r=o)}return r}function TA(e=Ak){if(e===Ak)return MA;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||0===n?n:(0===e(r,r))-(0===e(t,t))}}function MA(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:e>t?1:0)}function RA(e,t,r=0,n=1/0,o){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(o=void 0===o?MA:TA(o);n>r;){if(n-r>600){const i=n-r+1,a=t-r+1,s=Math.log(i),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(i-u)/i)*(a-i/2<0?-1:1);RA(e,t,Math.max(r,Math.floor(t-a*u/i+l)),Math.min(n,Math.floor(t+(i-a)*u/i+l)),o)}const i=e[t];let a=r,s=n;for(LA(e,r,t),o(e[n],i)>0&&LA(e,r,n);a<s;){for(LA(e,a,s),++a,--s;o(e[a],i)<0;)++a;for(;o(e[s],i)>0;)--s}0===o(e[r],i)?LA(e,r,s):(++s,LA(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function LA(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function IA(e,t,r){if(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let r=-1;for(let n of e)null!=(n=t(n,++r,e))&&(n=+n)>=n&&(yield n)}}(e,r)),(n=e.length)&&!isNaN(t=+t)){if(t<=0||n<2)return NA(e);if(t>=1)return AA(e);var n,o=(n-1)*t,i=Math.floor(o),a=AA(RA(e,i).subarray(0,i+1));return a+(NA(e.subarray(i+1))-a)*(o-i)}}function DA(e,t,r=Rk){if((n=e.length)&&!isNaN(t=+t)){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,o=(n-1)*t,i=Math.floor(o),a=+r(e[i],i,e);return a+(+r(e[i+1],i+1,e)-a)*(o-i)}}function FA(){var e,t=[],r=[],n=[];function o(){var e=0,o=Math.max(1,r.length);for(n=new Array(o-1);++e<o;)n[e-1]=DA(t,e/o);return i}function i(t){return null==t||isNaN(t=+t)?e:r[Dk(n,t)]}return i.invertExtent=function(e){var o=r.indexOf(e);return o<0?[NaN,NaN]:[o>0?n[o-1]:t[0],o<n.length?n[o]:t[t.length-1]]},i.domain=function(e){if(!arguments.length)return t.slice();t=[];for(let r of e)null==r||isNaN(r=+r)||t.push(r);return t.sort(Ak),o()},i.range=function(e){return arguments.length?(r=Array.from(e),o()):r.slice()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.quantiles=function(){return n.slice()},i.copy=function(){return FA().domain(t).range(r).unknown(e)},kP.apply(i,arguments)}function zA(){var e,t=0,r=1,n=1,o=[.5],i=[0,1];function a(t){return null!=t&&t<=t?i[Dk(o,t,0,n)]:e}function s(){var e=-1;for(o=new Array(n);++e<n;)o[e]=((e+1)*r-(e-n)*t)/(n+1);return a}return a.domain=function(e){return arguments.length?([t,r]=e,t=+t,r=+r,s()):[t,r]},a.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},a.invertExtent=function(e){var a=i.indexOf(e);return a<0?[NaN,NaN]:a<1?[t,o[0]]:a>=n?[o[n-1],r]:[o[a-1],o[a]]},a.unknown=function(t){return arguments.length?(e=t,a):a},a.thresholds=function(){return o.slice()},a.copy=function(){return zA().domain([t,r]).range(i).unknown(e)},kP.apply(aA(a),arguments)}function BA(){var e,t=[.5],r=[0,1],n=1;function o(o){return null!=o&&o<=o?r[Dk(t,o,0,n)]:e}return o.domain=function(e){return arguments.length?(t=Array.from(e),n=Math.min(t.length,r.length-1),o):t.slice()},o.range=function(e){return arguments.length?(r=Array.from(e),n=Math.min(t.length,r.length-1),o):r.slice()},o.invertExtent=function(e){var n=r.indexOf(e);return[t[n-1],t[n]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return BA().domain(t).range(r).unknown(e)},kP.apply(o,arguments)}JC=oA({thousands:",",grouping:[3],currency:["$",""]}),eA=JC.format,tA=JC.formatPrefix;const VA=1e3,$A=6e4,UA=36e5,GA=864e5,WA=6048e5,qA=2592e6,HA=31536e6,ZA=new Date,KA=new Date;function YA(e,t,r,n){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=t=>(e(t=new Date(+t)),t),o.ceil=r=>(e(r=new Date(r-1)),t(r,1),e(r),r),o.round=e=>{const t=o(e),r=o.ceil(e);return e-t<r-e?t:r},o.offset=(e,r)=>(t(e=new Date(+e),null==r?1:Math.floor(r)),e),o.range=(r,n,i)=>{const a=[];if(r=o.ceil(r),i=null==i?1:Math.floor(i),!(r<n&&i>0))return a;let s;do{a.push(s=new Date(+r)),t(r,i),e(r)}while(s<r&&r<n);return a},o.filter=r=>YA((t=>{if(t>=t)for(;e(t),!r(t);)t.setTime(t-1)}),((e,n)=>{if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););})),r&&(o.count=(t,n)=>(ZA.setTime(+t),KA.setTime(+n),e(ZA),e(KA),Math.floor(r(ZA,KA))),o.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(n?t=>n(t)%e==0:t=>o.count(0,t)%e==0):o:null)),o}const XA=YA((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e));XA.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?YA((t=>{t.setTime(Math.floor(t/e)*e)}),((t,r)=>{t.setTime(+t+r*e)}),((t,r)=>(r-t)/e)):XA:null);XA.range;const QA=YA((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*VA)}),((e,t)=>(t-e)/VA),(e=>e.getUTCSeconds())),JA=(QA.range,YA((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*VA)}),((e,t)=>{e.setTime(+e+t*$A)}),((e,t)=>(t-e)/$A),(e=>e.getMinutes()))),eN=(JA.range,YA((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*$A)}),((e,t)=>(t-e)/$A),(e=>e.getUTCMinutes()))),tN=(eN.range,YA((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*VA-e.getMinutes()*$A)}),((e,t)=>{e.setTime(+e+t*UA)}),((e,t)=>(t-e)/UA),(e=>e.getHours()))),rN=(tN.range,YA((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*UA)}),((e,t)=>(t-e)/UA),(e=>e.getUTCHours()))),nN=(rN.range,YA((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*$A)/GA),(e=>e.getDate()-1))),oN=(nN.range,YA((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/GA),(e=>e.getUTCDate()-1))),iN=(oN.range,YA((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/GA),(e=>Math.floor(e/GA))));iN.range;function aN(e){return YA((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*$A)/WA))}const sN=aN(0),uN=aN(1),lN=aN(2),cN=aN(3),fN=aN(4),dN=aN(5),pN=aN(6);sN.range,uN.range,lN.range,cN.range,fN.range,dN.range,pN.range;function hN(e){return YA((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/WA))}const mN=hN(0),yN=hN(1),vN=hN(2),gN=hN(3),bN=hN(4),wN=hN(5),xN=hN(6),_N=(mN.range,yN.range,vN.range,gN.range,bN.range,wN.range,xN.range,YA((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth()))),ON=(_N.range,YA((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()))),SN=(ON.range,YA((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear())));SN.every=e=>isFinite(e=Math.floor(e))&&e>0?YA((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,r)=>{t.setFullYear(t.getFullYear()+r*e)})):null;SN.range;const EN=YA((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));EN.every=e=>isFinite(e=Math.floor(e))&&e>0?YA((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null;EN.range;function jN(e,t,r,n,o,i){const a=[[QA,1,VA],[QA,5,5e3],[QA,15,15e3],[QA,30,3e4],[i,1,$A],[i,5,3e5],[i,15,9e5],[i,30,18e5],[o,1,UA],[o,3,108e5],[o,6,216e5],[o,12,432e5],[n,1,GA],[n,2,1728e5],[r,1,WA],[t,1,qA],[t,3,7776e6],[e,1,HA]];function s(t,r,n){const o=Math.abs(r-t)/n,i=Tk((([,,e])=>e)).right(a,o);if(i===a.length)return e.every(Ck(t/HA,r/HA,n));if(0===i)return XA.every(Math.max(Ck(t,r,n),1));const[s,u]=a[o/a[i-1][2]<a[i][2]/o?i-1:i];return s.every(u)}return[function(e,t,r){const n=t<e;n&&([e,t]=[t,e]);const o=r&&"function"==typeof r.range?r:s(e,t,r),i=o?o.range(e,+t+1):[];return n?i.reverse():i},s]}const[PN,kN]=jN(EN,ON,mN,iN,rN,eN),[CN,AN]=jN(SN,_N,sN,nN,tN,JA);function NN(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function TN(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function MN(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}var RN,LN,IN,DN={"-":"",_:" ",0:"0"},FN=/^\s*\d+/,zN=/^%/,BN=/[\\^$*+?|[\]().{}]/g;function VN(e,t,r){var n=e<0?"-":"",o=(n?-e:e)+"",i=o.length;return n+(i<r?new Array(r-i+1).join(t)+o:o)}function $N(e){return e.replace(BN,"\\$&")}function UN(e){return new RegExp("^(?:"+e.map($N).join("|")+")","i")}function GN(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function WN(e,t,r){var n=FN.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function qN(e,t,r){var n=FN.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function HN(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function ZN(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function KN(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function YN(e,t,r){var n=FN.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function XN(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function QN(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function JN(e,t,r){var n=FN.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function eT(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function tT(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function rT(e,t,r){var n=FN.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function nT(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function oT(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function iT(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function aT(e,t,r){var n=FN.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function sT(e,t,r){var n=FN.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function uT(e,t,r){var n=zN.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function lT(e,t,r){var n=FN.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function cT(e,t,r){var n=FN.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function fT(e,t){return VN(e.getDate(),t,2)}function dT(e,t){return VN(e.getHours(),t,2)}function pT(e,t){return VN(e.getHours()%12||12,t,2)}function hT(e,t){return VN(1+nN.count(SN(e),e),t,3)}function mT(e,t){return VN(e.getMilliseconds(),t,3)}function yT(e,t){return mT(e,t)+"000"}function vT(e,t){return VN(e.getMonth()+1,t,2)}function gT(e,t){return VN(e.getMinutes(),t,2)}function bT(e,t){return VN(e.getSeconds(),t,2)}function wT(e){var t=e.getDay();return 0===t?7:t}function xT(e,t){return VN(sN.count(SN(e)-1,e),t,2)}function _T(e){var t=e.getDay();return t>=4||0===t?fN(e):fN.ceil(e)}function OT(e,t){return e=_T(e),VN(fN.count(SN(e),e)+(4===SN(e).getDay()),t,2)}function ST(e){return e.getDay()}function ET(e,t){return VN(uN.count(SN(e)-1,e),t,2)}function jT(e,t){return VN(e.getFullYear()%100,t,2)}function PT(e,t){return VN((e=_T(e)).getFullYear()%100,t,2)}function kT(e,t){return VN(e.getFullYear()%1e4,t,4)}function CT(e,t){var r=e.getDay();return VN((e=r>=4||0===r?fN(e):fN.ceil(e)).getFullYear()%1e4,t,4)}function AT(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+VN(t/60|0,"0",2)+VN(t%60,"0",2)}function NT(e,t){return VN(e.getUTCDate(),t,2)}function TT(e,t){return VN(e.getUTCHours(),t,2)}function MT(e,t){return VN(e.getUTCHours()%12||12,t,2)}function RT(e,t){return VN(1+oN.count(EN(e),e),t,3)}function LT(e,t){return VN(e.getUTCMilliseconds(),t,3)}function IT(e,t){return LT(e,t)+"000"}function DT(e,t){return VN(e.getUTCMonth()+1,t,2)}function FT(e,t){return VN(e.getUTCMinutes(),t,2)}function zT(e,t){return VN(e.getUTCSeconds(),t,2)}function BT(e){var t=e.getUTCDay();return 0===t?7:t}function VT(e,t){return VN(mN.count(EN(e)-1,e),t,2)}function $T(e){var t=e.getUTCDay();return t>=4||0===t?bN(e):bN.ceil(e)}function UT(e,t){return e=$T(e),VN(bN.count(EN(e),e)+(4===EN(e).getUTCDay()),t,2)}function GT(e){return e.getUTCDay()}function WT(e,t){return VN(yN.count(EN(e)-1,e),t,2)}function qT(e,t){return VN(e.getUTCFullYear()%100,t,2)}function HT(e,t){return VN((e=$T(e)).getUTCFullYear()%100,t,2)}function ZT(e,t){return VN(e.getUTCFullYear()%1e4,t,4)}function KT(e,t){var r=e.getUTCDay();return VN((e=r>=4||0===r?bN(e):bN.ceil(e)).getUTCFullYear()%1e4,t,4)}function YT(){return"+0000"}function XT(){return"%"}function QT(e){return+e}function JT(e){return Math.floor(+e/1e3)}function eM(e){return new Date(e)}function tM(e){return e instanceof Date?+e:+new Date(+e)}function rM(e,t,r,n,o,i,a,s,u,l){var c=UC(),f=c.invert,d=c.domain,p=l(".%L"),h=l(":%S"),m=l("%I:%M"),y=l("%I %p"),v=l("%a %d"),g=l("%b %d"),b=l("%B"),w=l("%Y");function x(e){return(u(e)<e?p:s(e)<e?h:a(e)<e?m:i(e)<e?y:n(e)<e?o(e)<e?v:g:r(e)<e?b:w)(e)}return c.invert=function(e){return new Date(f(e))},c.domain=function(e){return arguments.length?d(Array.from(e,tM)):d().map(eM)},c.ticks=function(t){var r=d();return e(r[0],r[r.length-1],null==t?10:t)},c.tickFormat=function(e,t){return null==t?x:l(t)},c.nice=function(e){var r=d();return e&&"function"==typeof e.range||(e=t(r[0],r[r.length-1],null==e?10:e)),e?d(lA(r,e)):c},c.copy=function(){return VC(c,rM(e,t,r,n,o,i,a,s,u,l))},c}function nM(){return kP.apply(rM(CN,AN,SN,_N,sN,nN,tN,JA,QA,LN).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function oM(){return kP.apply(rM(PN,kN,EN,ON,mN,oN,rN,eN,QA,IN).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function iM(){var e,t,r,n,o,i=0,a=1,s=DC,u=!1;function l(t){return null==t||isNaN(t=+t)?o:s(0===r?.5:(t=(n(t)-e)*r,u?Math.max(0,Math.min(1,t)):t))}function c(e){return function(t){var r,n;return arguments.length?([r,n]=t,s=e(r,n),l):[s(0),s(1)]}}return l.domain=function(o){return arguments.length?([i,a]=o,e=n(i=+i),t=n(a=+a),r=e===t?0:1/(t-e),l):[i,a]},l.clamp=function(e){return arguments.length?(u=!!e,l):u},l.interpolator=function(e){return arguments.length?(s=e,l):s},l.range=c(MC),l.rangeRound=c(RC),l.unknown=function(e){return arguments.length?(o=e,l):o},function(o){return n=o,e=o(i),t=o(a),r=e===t?0:1/(t-e),l}}function aM(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function sM(){var e=aA(iM()(DC));return e.copy=function(){return aM(e,sM())},CP.apply(e,arguments)}function uM(){var e=yA(iM()).domain([1,10]);return e.copy=function(){return aM(e,uM()).base(e.base())},CP.apply(e,arguments)}function lM(){var e=wA(iM());return e.copy=function(){return aM(e,lM()).constant(e.constant())},CP.apply(e,arguments)}function cM(){var e=EA(iM());return e.copy=function(){return aM(e,cM()).exponent(e.exponent())},CP.apply(e,arguments)}function fM(){return cM.apply(null,arguments).exponent(.5)}function dM(){var e=[],t=DC;function r(r){if(null!=r&&!isNaN(r=+r))return t((Dk(e,r,1)-1)/(e.length-1))}return r.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let r of t)null==r||isNaN(r=+r)||e.push(r);return e.sort(Ak),r},r.interpolator=function(e){return arguments.length?(t=e,r):t},r.range=function(){return e.map(((r,n)=>t(n/(e.length-1))))},r.quantiles=function(t){return Array.from({length:t+1},((r,n)=>IA(e,n/t)))},r.copy=function(){return dM(t).domain(e)},CP.apply(r,arguments)}function pM(){var e,t,r,n,o,i,a,s=0,u=.5,l=1,c=1,f=DC,d=!1;function p(e){return isNaN(e=+e)?a:(e=.5+((e=+i(e))-t)*(c*e<c*t?n:o),f(d?Math.max(0,Math.min(1,e)):e))}function h(e){return function(t){var r,n,o;return arguments.length?([r,n,o]=t,f=function(e,t){void 0===t&&(t=e,e=MC);for(var r=0,n=t.length-1,o=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(o,o=t[++r]);return function(e){var t=Math.max(0,Math.min(n-1,Math.floor(e*=n)));return i[t](e-t)}}(e,[r,n,o]),p):[f(0),f(.5),f(1)]}}return p.domain=function(a){return arguments.length?([s,u,l]=a,e=i(s=+s),t=i(u=+u),r=i(l=+l),n=e===t?0:.5/(t-e),o=t===r?0:.5/(r-t),c=t<e?-1:1,p):[s,u,l]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(f=e,p):f},p.range=h(MC),p.rangeRound=h(RC),p.unknown=function(e){return arguments.length?(a=e,p):a},function(a){return i=a,e=a(s),t=a(u),r=a(l),n=e===t?0:.5/(t-e),o=t===r?0:.5/(r-t),c=t<e?-1:1,p}}function hM(){var e=aA(pM()(DC));return e.copy=function(){return aM(e,hM())},CP.apply(e,arguments)}function mM(){var e=yA(pM()).domain([.1,1,10]);return e.copy=function(){return aM(e,mM()).base(e.base())},CP.apply(e,arguments)}function yM(){var e=wA(pM());return e.copy=function(){return aM(e,yM()).constant(e.constant())},CP.apply(e,arguments)}function vM(){var e=EA(pM());return e.copy=function(){return aM(e,vM()).exponent(e.exponent())},CP.apply(e,arguments)}function gM(){return vM.apply(null,arguments).exponent(.5)}function bM(e,t){if((o=e.length)>1)for(var r,n,o,i=1,a=e[t[0]],s=a.length;i<o;++i)for(n=a,a=e[t[i]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}!function(e){RN=function(e){var t=e.dateTime,r=e.date,n=e.time,o=e.periods,i=e.days,a=e.shortDays,s=e.months,u=e.shortMonths,l=UN(o),c=GN(o),f=UN(i),d=GN(i),p=UN(a),h=GN(a),m=UN(s),y=GN(s),v=UN(u),g=GN(u),b={a:function(e){return a[e.getDay()]},A:function(e){return i[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:fT,e:fT,f:yT,g:PT,G:CT,H:dT,I:pT,j:hT,L:mT,m:vT,M:gT,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:QT,s:JT,S:bT,u:wT,U:xT,V:OT,w:ST,W:ET,x:null,X:null,y:jT,Y:kT,Z:AT,"%":XT},w={a:function(e){return a[e.getUTCDay()]},A:function(e){return i[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:NT,e:NT,f:IT,g:HT,G:KT,H:TT,I:MT,j:RT,L:LT,m:DT,M:FT,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:QT,s:JT,S:zT,u:BT,U:VT,V:UT,w:GT,W:WT,x:null,X:null,y:qT,Y:ZT,Z:YT,"%":XT},x={a:function(e,t,r){var n=p.exec(t.slice(r));return n?(e.w=h.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(e,t,r){var n=f.exec(t.slice(r));return n?(e.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(e,t,r){var n=v.exec(t.slice(r));return n?(e.m=g.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(e,t,r){var n=m.exec(t.slice(r));return n?(e.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(e,r,n){return S(e,t,r,n)},d:tT,e:tT,f:sT,g:XN,G:YN,H:nT,I:nT,j:rT,L:aT,m:eT,M:oT,p:function(e,t,r){var n=l.exec(t.slice(r));return n?(e.p=c.get(n[0].toLowerCase()),r+n[0].length):-1},q:JN,Q:lT,s:cT,S:iT,u:qN,U:HN,V:ZN,w:WN,W:KN,x:function(e,t,n){return S(e,r,t,n)},X:function(e,t,r){return S(e,n,t,r)},y:XN,Y:YN,Z:QN,"%":uT};function _(e,t){return function(r){var n,o,i,a=[],s=-1,u=0,l=e.length;for(r instanceof Date||(r=new Date(+r));++s<l;)37===e.charCodeAt(s)&&(a.push(e.slice(u,s)),null!=(o=DN[n=e.charAt(++s)])?n=e.charAt(++s):o="e"===n?" ":"0",(i=t[n])&&(n=i(r,o)),a.push(n),u=s+1);return a.push(e.slice(u,s)),a.join("")}}function O(e,t){return function(r){var n,o,i=MN(1900,void 0,1);if(S(i,e,r+="",0)!=r.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(t&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(o=(n=TN(MN(i.y,0,1))).getUTCDay(),n=o>4||0===o?yN.ceil(n):yN(n),n=oN.offset(n,7*(i.V-1)),i.y=n.getUTCFullYear(),i.m=n.getUTCMonth(),i.d=n.getUTCDate()+(i.w+6)%7):(o=(n=NN(MN(i.y,0,1))).getDay(),n=o>4||0===o?uN.ceil(n):uN(n),n=nN.offset(n,7*(i.V-1)),i.y=n.getFullYear(),i.m=n.getMonth(),i.d=n.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?TN(MN(i.y,0,1)).getUTCDay():NN(MN(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,TN(i)):NN(i)}}function S(e,t,r,n){for(var o,i,a=0,s=t.length,u=r.length;a<s;){if(n>=u)return-1;if(37===(o=t.charCodeAt(a++))){if(o=t.charAt(a++),!(i=x[o in DN?t.charAt(a++):o])||(n=i(e,r,n))<0)return-1}else if(o!=r.charCodeAt(n++))return-1}return n}return b.x=_(r,b),b.X=_(n,b),b.c=_(t,b),w.x=_(r,w),w.X=_(n,w),w.c=_(t,w),{format:function(e){var t=_(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=O(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=_(e+="",w);return t.toString=function(){return e},t},utcParse:function(e){var t=O(e+="",!0);return t.toString=function(){return e},t}}}(e),LN=RN.format,RN.parse,IN=RN.utcFormat,RN.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Array.prototype.slice;function wM(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function xM(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function _M(e,t){return e[t]}function OM(e){const t=[];return t.key=e,t}var SM=o(4506),EM=o.n(SM),jM=o(1684),PM=o.n(jM),kM=o(7307),CM=o.n(kM),AM=o(2404),NM=o.n(AM),TM=o(8351),MM=o.n(TM);function RM(e){return function(e){if(Array.isArray(e))return LM(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return LM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return LM(e,t)}(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.")}()}function LM(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var IM=function(e){return e},DM={"@@functional/placeholder":!0},FM=function(e){return e===DM},zM=function(e){return function t(){return 0===arguments.length||1===arguments.length&&FM(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},BM=function e(t,r){return 1===t?r:zM((function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=o.filter((function(e){return e!==DM})).length;return a>=t?r.apply(void 0,o):e(t-a,zM((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=o.map((function(e){return FM(e)?t.shift():e}));return r.apply(void 0,RM(i).concat(t))})))}))},VM=function(e){return BM(e.length,e)},$M=function(e,t){for(var r=[],n=e;n<t;++n)r[n-e]=n;return r},UM=VM((function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map((function(e){return t[e]})).map(e)})),GM=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.length)return IM;var n=t.reverse(),o=n[0],i=n.slice(1);return function(){return i.reduce((function(e,t){return t(e)}),o.apply(void 0,arguments))}},WM=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},qM=function(e){var t=null,r=null;return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return t&&o.every((function(e,r){return e===t[r]}))?r:(t=o,r=e.apply(void 0,o))}};var HM=VM((function(e,t,r){var n=+e;return n+r*(+t-n)})),ZM=VM((function(e,t,r){var n=t-+e;return(r-e)/(n=n||1/0)})),KM=VM((function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))}));const YM={rangeStep:function(e,t,r){for(var n=new(MM())(e),o=0,i=[];n.lt(t)&&o<1e5;)i.push(n.toNumber()),n=n.add(r),o++;return i},getDigitCount:function(e){return 0===e?1:Math.floor(new(MM())(e).abs().log(10).toNumber())+1},interpolateNumber:HM,uninterpolateNumber:ZM,uninterpolateTruncation:KM};function XM(e){return function(e){if(Array.isArray(e))return eR(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||JM(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.")}()}function QM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}(e,t)||JM(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.")}()}function JM(e,t){if(e){if("string"==typeof e)return eR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?eR(e,t):void 0}}function eR(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function tR(e){var t=QM(e,2),r=t[0],n=t[1],o=r,i=n;return r>n&&(o=n,i=r),[o,i]}function rR(e,t,r){if(e.lte(0))return new(MM())(0);var n=YM.getDigitCount(e.toNumber()),o=new(MM())(10).pow(n),i=e.div(o),a=1!==n?.05:.1,s=new(MM())(Math.ceil(i.div(a).toNumber())).add(r).mul(a).mul(o);return t?s:new(MM())(Math.ceil(s))}function nR(e,t,r){var n=1,o=new(MM())(e);if(!o.isint()&&r){var i=Math.abs(e);i<1?(n=new(MM())(10).pow(YM.getDigitCount(e)-1),o=new(MM())(Math.floor(o.div(n).toNumber())).mul(n)):i>1&&(o=new(MM())(Math.floor(e)))}else 0===e?o=new(MM())(Math.floor((t-1)/2)):r||(o=new(MM())(Math.floor(e)));var a=Math.floor((t-1)/2),s=GM(UM((function(e){return o.add(new(MM())(e-a).mul(n)).toNumber()})),$M);return s(0,t)}function oR(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new(MM())(0),tickMin:new(MM())(0),tickMax:new(MM())(0)};var i,a=rR(new(MM())(t).sub(e).div(r-1),n,o);i=e<=0&&t>=0?new(MM())(0):(i=new(MM())(e).add(t).div(2)).sub(new(MM())(i).mod(a));var s=Math.ceil(i.sub(e).div(a).toNumber()),u=Math.ceil(new(MM())(t).sub(i).div(a).toNumber()),l=s+u+1;return l>r?oR(e,t,r,n,o+1):(l<r&&(u=t>0?u+(r-l):u,s=t>0?s:s+(r-l)),{step:a,tickMin:i.sub(new(MM())(s).mul(a)),tickMax:i.add(new(MM())(u).mul(a))})}var iR=qM((function(e){var t=QM(e,2),r=t[0],n=t[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=Math.max(o,2),s=QM(tR([r,n]),2),u=s[0],l=s[1];if(u===-1/0||l===1/0){var c=l===1/0?[u].concat(XM($M(0,o-1).map((function(){return 1/0})))):[].concat(XM($M(0,o-1).map((function(){return-1/0}))),[l]);return r>n?WM(c):c}if(u===l)return nR(u,o,i);var f=oR(u,l,a,i),d=f.step,p=f.tickMin,h=f.tickMax,m=YM.rangeStep(p,h.add(new(MM())(.1).mul(d)),d);return r>n?WM(m):m})),aR=(qM((function(e){var t=QM(e,2),r=t[0],n=t[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=Math.max(o,2),s=QM(tR([r,n]),2),u=s[0],l=s[1];if(u===-1/0||l===1/0)return[r,n];if(u===l)return nR(u,o,i);var c=rR(new(MM())(l).sub(u).div(a-1),i,0),f=GM(UM((function(e){return new(MM())(u).add(new(MM())(e).mul(c)).toNumber()})),$M),d=f(0,a).filter((function(e){return e>=u&&e<=l}));return r>n?WM(d):d})),qM((function(e,t){var r=QM(e,2),n=r[0],o=r[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=QM(tR([n,o]),2),s=a[0],u=a[1];if(s===-1/0||u===1/0)return[n,o];if(s===u)return[s];var l=Math.max(t,2),c=rR(new(MM())(u).sub(s).div(l-1),i,0),f=[].concat(XM(YM.rangeStep(new(MM())(s),new(MM())(u).sub(new(MM())(.99).mul(c)),c)),[u]);return n>o?WM(f):f}))),sR=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function uR(e){return uR="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},uR(e)}function lR(){return lR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lR.apply(this,arguments)}function cR(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fR(e,t)}(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.")}()}function fR(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dR(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function pR(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bR(n.key),n)}}function hR(e,t,r){return t=yR(t),function(e,t){if(t&&("object"===uR(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,mR()?Reflect.construct(t,r||[],yR(e).constructor):t.apply(e,r))}function mR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mR=function(){return!!e})()}function yR(e){return yR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yR(e)}function vR(e,t){return vR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vR(e,t)}function gR(e,t,r){return(t=bR(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bR(e){var t=function(e,t){if("object"!=uR(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=uR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uR(t)?t:t+""}var wR=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),hR(this,t,arguments)}return function(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&&vR(e,t)}(t,e),r=t,n=[{key:"render",value:function(){var e=this.props,t=e.offset,r=e.layout,n=e.width,o=e.dataKey,a=e.data,s=e.dataPointFormatter,u=e.xAxis,l=e.yAxis,c=dR(e,sR),f=pO(c,!1);"x"===this.props.direction&&"number"!==u.type&&CO(!1);var d=a.map((function(e){var a=s(e,o),c=a.x,d=a.y,p=a.value,h=a.errorVal;if(!h)return null;var m,y,v=[];if(Array.isArray(h)){var g=cR(h,2);m=g[0],y=g[1]}else m=y=h;if("vertical"===r){var b=u.scale,w=d+t,x=w+n,_=w-n,O=b(p-m),S=b(p+y);v.push({x1:S,y1:x,x2:S,y2:_}),v.push({x1:O,y1:w,x2:S,y2:w}),v.push({x1:O,y1:x,x2:O,y2:_})}else if("horizontal"===r){var E=l.scale,j=c+t,P=j-n,k=j+n,C=E(p-m),A=E(p+y);v.push({x1:P,y1:A,x2:k,y2:A}),v.push({x1:j,y1:C,x2:j,y2:A}),v.push({x1:P,y1:C,x2:k,y2:C})}return i().createElement(DO,lR({className:"recharts-errorBar",key:"bar-".concat(v.map((function(e){return"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)})))},f),v.map((function(e){return i().createElement("line",lR({},e,{key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))})))}));return i().createElement(DO,{className:"recharts-errorBars"},d)}}],n&&pR(r.prototype,n),o&&pR(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(i().Component);function xR(e){return xR="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},xR(e)}function _R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function OR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_R(Object(r),!0).forEach((function(t){SR(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function SR(e,t,r){return t=function(e){var t=function(e,t){if("object"!=xR(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=xR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==xR(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}gR(wR,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"}),gR(wR,"displayName","ErrorBar");var ER=function(e){var t=e.children,r=e.formattedGraphicalItems,n=e.legendWidth,o=e.legendContent,i=lO(t,zE);if(!i)return null;var a,s=zE.defaultProps,u=void 0!==s?OR(OR({},s),i.props):{};return a=i.props&&i.props.payload?i.props&&i.props.payload:"children"===o?(r||[]).reduce((function(e,t){var r=t.item,n=t.props,o=n.sectors||n.data||[];return e.concat(o.map((function(e){return{type:i.props.iconType||r.props.legendType,value:e.name,color:e.fill,payload:e}})))}),[]):(r||[]).map((function(e){var t=e.item,r=t.type.defaultProps,n=void 0!==r?OR(OR({},r),t.props):{},o=n.dataKey,i=n.name,a=n.legendType;return{inactive:n.hide,dataKey:o,type:u.iconType||a||"square",color:RR(t),value:i||o,payload:n}})),OR(OR(OR({},u),zE.getWithHeight(i,n)),{},{payload:a,item:i})};function jR(e){return jR="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},jR(e)}function PR(e){return function(e){if(Array.isArray(e))return kR(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return kR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kR(e,t)}(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.")}()}function kR(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function CR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function AR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?CR(Object(r),!0).forEach((function(t){NR(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CR(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function NR(e,t,r){return t=function(e){var t=function(e,t){if("object"!=jR(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jR(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TR(e,t,r){return z_()(e)||z_()(t)?r:A_(t)?S_()(e,t,r):V_()(t)?t(e):r}function MR(e,t,r,n){var o=CM()(e,(function(e){return TR(e,t)}));if("number"===r){var i=o.filter((function(e){return C_(e)||parseFloat(e)}));return i.length?[PM()(i),EM()(i)]:[1/0,-1/0]}return(n?o.filter((function(e){return!z_()(e)})):o).map((function(e){return A_(e)||e instanceof Date?e:""}))}var RR=function(e){var t,r,n=e.type.displayName,o=null!==(t=e.type)&&void 0!==t&&t.defaultProps?AR(AR({},e.type.defaultProps),e.props):e.props,i=o.stroke,a=o.fill;switch(n){case"Line":r=i;break;case"Area":case"Radar":r=i&&"none"!==i?i:a;break;default:r=a}return r},LR=function(e,t,r,n,o){var i=uO(t.props.children,wR).filter((function(e){return function(e,t,r){return!!z_()(t)||("horizontal"===e?"yAxis"===t:"vertical"===e||"x"===r?"xAxis"===t:"y"!==r||"yAxis"===t)}(n,o,e.props.direction)}));if(i&&i.length){var a=i.map((function(e){return e.props.dataKey}));return e.reduce((function(e,t){var n=TR(t,r);if(z_()(n))return e;var o=Array.isArray(n)?[PM()(n),EM()(n)]:[n,n],i=a.reduce((function(e,r){var n=TR(t,r,0),i=o[0]-Math.abs(Array.isArray(n)?n[0]:n),a=o[1]+Math.abs(Array.isArray(n)?n[1]:n);return[Math.min(i,e[0]),Math.max(a,e[1])]}),[1/0,-1/0]);return[Math.min(i[0],e[0]),Math.max(i[1],e[1])]}),[1/0,-1/0])}return null},IR=function(e,t,r,n,o){var i=t.map((function(t){var i=t.props.dataKey;return"number"===r&&i&&LR(e,t,i,n)||MR(e,i,r,o)}));if("number"===r)return i.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]);var a={};return i.reduce((function(e,t){for(var r=0,n=t.length;r<n;r++)a[t[r]]||(a[t[r]]=!0,e.push(t[r]));return e}),[])},DR=function(e,t){return"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t},FR=function(e,t,r,n){if(n)return e.map((function(e){return e.coordinate}));var o,i,a=e.map((function(e){return e.coordinate===t&&(o=!0),e.coordinate===r&&(i=!0),e.coordinate}));return o||a.push(t),i||a.push(r),a},zR=function(e,t,r){if(!e)return null;var n=e.scale,o=e.duplicateDomain,i=e.type,a=e.range,s="scaleBand"===e.realScaleType?n.bandwidth()/2:2,u=(t||r)&&"category"===i&&n.bandwidth?n.bandwidth()/s:0;return u="angleAxis"===e.axisType&&(null==a?void 0:a.length)>=2?2*P_(a[0]-a[1])*u:u,t&&(e.ticks||e.niceTicks)?(e.ticks||e.niceTicks).map((function(e){var t=o?o.indexOf(e):e;return{coordinate:n(t)+u,value:e,offset:u}})).filter((function(e){return!__()(e.coordinate)})):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map((function(e,t){return{coordinate:n(e)+u,value:e,index:t,offset:u}})):n.ticks&&!r?n.ticks(e.tickCount).map((function(e){return{coordinate:n(e)+u,value:e,offset:u}})):n.domain().map((function(e,t){return{coordinate:n(e)+u,value:o?o[e]:e,index:t,offset:u}}))},BR=new WeakMap,VR=function(e,t){if("function"!=typeof t)return e;BR.has(e)||BR.set(e,new WeakMap);var r=BR.get(e);if(r.has(t))return r.get(t);var n=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return r.set(t,n),n},$R=1e-4,UR={sign:function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var o=0,i=0,a=0;a<t;++a){var s=__()(e[a][r][1])?e[a][r][0]:e[a][r][1];s>=0?(e[a][r][0]=o,e[a][r][1]=o+s,o=e[a][r][1]):(e[a][r][0]=i,e[a][r][1]=i+s,i=e[a][r][1])}},expand:function(e,t){if((n=e.length)>0){for(var r,n,o,i=0,a=e[0].length;i<a;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}bM(e,t)}},none:bM,silhouette:function(e,t){if((r=e.length)>0){for(var r,n=0,o=e[t[0]],i=o.length;n<i;++n){for(var a=0,s=0;a<r;++a)s+=e[a][n][1]||0;o[n][1]+=o[n][0]=-s/2}bM(e,t)}},wiggle:function(e,t){if((o=e.length)>0&&(n=(r=e[t[0]]).length)>0){for(var r,n,o,i=0,a=1;a<n;++a){for(var s=0,u=0,l=0;s<o;++s){for(var c=e[t[s]],f=c[a][1]||0,d=(f-(c[a-1][1]||0))/2,p=0;p<s;++p){var h=e[t[p]];d+=(h[a][1]||0)-(h[a-1][1]||0)}u+=f,l+=d*f}r[a-1][1]+=r[a-1][0]=i,u&&(i-=l/u)}r[a-1][1]+=r[a-1][0]=i,bM(e,t)}},positive:function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var o=0,i=0;i<t;++i){var a=__()(e[i][r][1])?e[i][r][0]:e[i][r][1];a>=0?(e[i][r][0]=o,e[i][r][1]=o+a,o=e[i][r][1]):(e[i][r][0]=0,e[i][r][1]=0)}}},GR=function(e,t,r){var n=t.map((function(e){return e.props.dataKey})),o=UR[r],i=function(){var e=YS([]),t=xM,r=bM,n=_M;function o(o){var i,a,s=Array.from(e.apply(this,arguments),OM),u=s.length,l=-1;for(const e of o)for(i=0,++l;i<u;++i)(s[i][l]=[0,+n(e,s[i].key,l,o)]).data=e;for(i=0,a=wM(t(s));i<u;++i)s[a[i]].index=i;return r(s,a),s}return o.keys=function(t){return arguments.length?(e="function"==typeof t?t:YS(Array.from(t)),o):e},o.value=function(e){return arguments.length?(n="function"==typeof e?e:YS(+e),o):n},o.order=function(e){return arguments.length?(t=null==e?xM:"function"==typeof e?e:YS(Array.from(e)),o):t},o.offset=function(e){return arguments.length?(r=null==e?bM:e,o):r},o}().keys(n).value((function(e,t){return+TR(e,t,0)})).order(xM).offset(o);return i(e)};function WR(e){var t=e.axis,r=e.ticks,n=e.bandSize,o=e.entry,i=e.index,a=e.dataKey;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!z_()(o[t.dataKey])){var s=I_(r,"value",o[t.dataKey]);if(s)return s.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var u=TR(o,z_()(a)?t.dataKey:a);return z_()(u)?null:t.scale(u)}var qR=function(e){var t=e.axis,r=e.ticks,n=e.offset,o=e.bandSize,i=e.entry,a=e.index;if("category"===t.type)return r[a]?r[a].coordinate+n:null;var s=TR(i,t.dataKey,t.domain[a]);return z_()(s)?null:t.scale(s)-o/2+n},HR=function(e,t,r){return Object.keys(e).reduce((function(n,o){var i=e[o].stackedData.reduce((function(e,n){var o=function(e){return e.reduce((function(e,t){return[PM()(t.concat([e[0]]).filter(C_)),EM()(t.concat([e[1]]).filter(C_))]}),[1/0,-1/0])}(n.slice(t,r+1));return[Math.min(e[0],o[0]),Math.max(e[1],o[1])]}),[1/0,-1/0]);return[Math.min(i[0],n[0]),Math.max(i[1],n[1])]}),[1/0,-1/0]).map((function(e){return e===1/0||e===-1/0?0:e}))},ZR=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,KR=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,YR=function(e,t,r){if(V_()(e))return e(t,r);if(!Array.isArray(e))return t;var n=[];if(C_(e[0]))n[0]=r?e[0]:Math.min(e[0],t[0]);else if(ZR.test(e[0])){var o=+ZR.exec(e[0])[1];n[0]=t[0]-o}else V_()(e[0])?n[0]=e[0](t[0]):n[0]=t[0];if(C_(e[1]))n[1]=r?e[1]:Math.max(e[1],t[1]);else if(KR.test(e[1])){var i=+KR.exec(e[1])[1];n[1]=t[1]+i}else V_()(e[1])?n[1]=e[1](t[1]):n[1]=t[1];return n},XR=function(e,t,r){if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var o=PO()(t,(function(e){return e.coordinate})),i=1/0,a=1,s=o.length;a<s;a++){var u=o[a],l=o[a-1];i=Math.min((u.coordinate||0)-(l.coordinate||0),i)}return i===1/0?0:i}return r?void 0:0},QR=function(e,t,r){return e&&e.length?NM()(e,S_()(r,"type.defaultProps.domain"))?t:e:t},JR=function(e,t){var r=e.type.defaultProps?AR(AR({},e.type.defaultProps),e.props):e.props,n=r.dataKey,o=r.name,i=r.unit,a=r.formatter,s=r.tooltipType,u=r.chartType,l=r.hide;return AR(AR({},pO(e,!1)),{},{dataKey:n,unit:i,formatter:a,name:o||n,color:RR(e),value:TR(t,n),type:s,payload:t,chartType:u,hide:l})};function eL(e){return eL="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},eL(e)}function tL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tL(Object(r),!0).forEach((function(t){nL(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tL(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function nL(e,t,r){return t=function(e){var t=function(e,t){if("object"!=eL(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==eL(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var oL=["Webkit","Moz","O","ms"];function iL(e){return iL="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},iL(e)}function aL(){return aL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aL.apply(this,arguments)}function sL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function uL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sL(Object(r),!0).forEach((function(t){hL(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sL(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function lL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mL(n.key),n)}}function cL(e,t,r){return t=dL(t),function(e,t){if(t&&("object"===iL(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fL()?Reflect.construct(t,r||[],dL(e).constructor):t.apply(e,r))}function fL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fL=function(){return!!e})()}function dL(e){return dL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dL(e)}function pL(e,t){return pL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pL(e,t)}function hL(e,t,r){return(t=mL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mL(e){var t=function(e,t){if("object"!=iL(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=iL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==iL(t)?t:t+""}var yL=function(e){return e.changedTouches&&!!e.changedTouches.length},vL=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),hL(r=cL(this,t,[e]),"handleDrag",(function(e){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(e):r.state.isSlideMoving&&r.handleSlideDrag(e)})),hL(r,"handleTouchMove",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&r.handleDrag(e.changedTouches[0])})),hL(r,"handleDragEnd",(function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},(function(){var e=r.props,t=e.endIndex,n=e.onDragEnd,o=e.startIndex;null==n||n({endIndex:t,startIndex:o})})),r.detachDragEndListener()})),hL(r,"handleLeaveWrapper",(function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))})),hL(r,"handleEnterSlideOrTraveller",(function(){r.setState({isTextActive:!0})})),hL(r,"handleLeaveSlideOrTraveller",(function(){r.setState({isTextActive:!1})})),hL(r,"handleSlideDragStart",(function(e){var t=yL(e)?e.changedTouches[0]:e;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:t.pageX}),r.attachDragEndListener()})),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return function(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&&pL(e,t)}(t,e),n=t,o=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var r=e.startX,n=e.endX,o=this.state.scaleValues,i=this.props,a=i.gap,s=i.data.length-1,u=Math.min(r,n),l=Math.max(r,n),c=t.getIndexInRange(o,u),f=t.getIndexInRange(o,l);return{startIndex:c-c%a,endIndex:f===s?s:f-f%a}}},{key:"getTextOfTick",value:function(e){var t=this.props,r=t.data,n=t.tickFormatter,o=t.dataKey,i=TR(r[e],o,e);return V_()(n)?n(i,e):i}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,r=t.slideMoveStartX,n=t.startX,o=t.endX,i=this.props,a=i.x,s=i.width,u=i.travellerWidth,l=i.startIndex,c=i.endIndex,f=i.onChange,d=e.pageX-r;d>0?d=Math.min(d,a+s-u-o,a+s-u-n):d<0&&(d=Math.max(d,a-n,a-o));var p=this.getIndex({startX:n+d,endX:o+d});p.startIndex===l&&p.endIndex===c||!f||f(p),this.setState({startX:n+d,endX:o+d,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var r=yL(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:r.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t=this.state,r=t.brushMoveStartX,n=t.movingTravellerId,o=t.endX,i=t.startX,a=this.state[n],s=this.props,u=s.x,l=s.width,c=s.travellerWidth,f=s.onChange,d=s.gap,p=s.data,h={startX:this.state.startX,endX:this.state.endX},m=e.pageX-r;m>0?m=Math.min(m,u+l-c-a):m<0&&(m=Math.max(m,u-a)),h[n]=a+m;var y=this.getIndex(h),v=y.startIndex,g=y.endIndex;this.setState(hL(hL({},n,a+m),"brushMoveStartX",e.pageX),(function(){var e;f&&(e=p.length-1,("startX"===n&&(o>i?v%d==0:g%d==0)||o<i&&g===e||"endX"===n&&(o>i?g%d==0:v%d==0)||o>i&&g===e)&&f(y))}))}},{key:"handleTravellerMoveKeyboard",value:function(e,t){var r=this,n=this.state,o=n.scaleValues,i=n.startX,a=n.endX,s=this.state[t],u=o.indexOf(s);if(-1!==u){var l=u+e;if(!(-1===l||l>=o.length)){var c=o[l];"startX"===t&&c>=a||"endX"===t&&c<=i||this.setState(hL({},t,c),(function(){r.props.onChange(r.getIndex({startX:r.state.startX,endX:r.state.endX}))}))}}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,o=e.height,a=e.fill,s=e.stroke;return i().createElement("rect",{stroke:s,fill:a,x:t,y:r,width:n,height:o})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,s=e.data,u=e.children,l=e.padding,c=r.Children.only(u);return c?i().cloneElement(c,{x:t,y:n,width:o,height:a,margin:l,compact:!0,data:s}):null}},{key:"renderTravellerLayer",value:function(e,r){var n,o,a=this,s=this.props,u=s.y,l=s.travellerWidth,c=s.height,f=s.traveller,d=s.ariaLabel,p=s.data,h=s.startIndex,m=s.endIndex,y=Math.max(e,this.props.x),v=uL(uL({},pO(this.props,!1)),{},{x:y,y:u,width:l,height:c}),g=d||"Min value: ".concat(null===(n=p[h])||void 0===n?void 0:n.name,", Max value: ").concat(null===(o=p[m])||void 0===o?void 0:o.name);return i().createElement(DO,{tabIndex:0,role:"slider","aria-label":g,"aria-valuenow":e,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[r],onTouchStart:this.travellerDragStartHandlers[r],onKeyDown:function(e){["ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),a.handleTravellerMoveKeyboard("ArrowRight"===e.key?1:-1,r))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(f,v))}},{key:"renderSlide",value:function(e,t){var r=this.props,n=r.y,o=r.height,a=r.stroke,s=r.travellerWidth,u=Math.min(e,t)+s,l=Math.max(Math.abs(t-e)-s,0);return i().createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:a,fillOpacity:.2,x:u,y:n,width:l,height:o})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,r=e.endIndex,n=e.y,o=e.height,a=e.travellerWidth,s=e.stroke,u=this.state,l=u.startX,c=u.endX,f={pointerEvents:"none",fill:s};return i().createElement(DO,{className:"recharts-brush-texts"},i().createElement(_k,aL({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,c)-5,y:n+o/2},f),this.getTextOfTick(t)),i().createElement(_k,aL({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,c)+a+5,y:n+o/2},f),this.getTextOfTick(r)))}},{key:"render",value:function(){var e=this.props,t=e.data,r=e.className,n=e.children,o=e.x,a=e.y,s=e.width,u=e.height,l=e.alwaysShowText,c=this.state,f=c.startX,d=c.endX,p=c.isTextActive,h=c.isSlideMoving,m=c.isTravellerMoving,y=c.isTravellerFocused;if(!t||!t.length||!C_(o)||!C_(a)||!C_(s)||!C_(u)||s<=0||u<=0)return null;var v=gt("recharts-brush",r),g=1===i().Children.count(n),b=function(e,t){if(!e)return null;var r=e.replace(/(\w)/,(function(e){return e.toUpperCase()})),n=oL.reduce((function(e,n){return rL(rL({},e),{},nL({},n+r,t))}),{});return n[e]=t,n}("userSelect","none");return i().createElement(DO,{className:v,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),g&&this.renderPanorama(),this.renderSlide(f,d),this.renderTravellerLayer(f,"startX"),this.renderTravellerLayer(d,"endX"),(p||h||m||y||l)&&this.renderText())}}],a=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,r=e.y,n=e.width,o=e.height,a=e.stroke,s=Math.floor(r+o/2)-1;return i().createElement(i().Fragment,null,i().createElement("rect",{x:t,y:r,width:n,height:o,fill:a,stroke:"none"}),i().createElement("line",{x1:t+1,y1:s,x2:t+n-1,y2:s,fill:"none",stroke:"#fff"}),i().createElement("line",{x1:t+1,y1:s+2,x2:t+n-1,y2:s+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,r){return i().isValidElement(e)?i().cloneElement(e,r):V_()(e)?e(r):t.renderDefaultTraveller(r)}},{key:"getDerivedStateFromProps",value:function(e,t){var r=e.data,n=e.width,o=e.x,i=e.travellerWidth,a=e.updateId,s=e.startIndex,u=e.endIndex;if(r!==t.prevData||a!==t.prevUpdateId)return uL({prevData:r,prevTravellerWidth:i,prevUpdateId:a,prevX:o,prevWidth:n},r&&r.length?function(e){var t=e.data,r=e.startIndex,n=e.endIndex,o=e.x,i=e.width,a=e.travellerWidth;if(!t||!t.length)return{};var s=t.length,u=zP().domain(EO()(0,s)).range([o,o+i-a]),l=u.domain().map((function(e){return u(e)}));return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(n),scale:u,scaleValues:l}}({data:r,width:n,x:o,travellerWidth:i,startIndex:s,endIndex:u}):{scale:null,scaleValues:null});if(t.scale&&(n!==t.prevWidth||o!==t.prevX||i!==t.prevTravellerWidth)){t.scale.range([o,o+n-i]);var l=t.scale.domain().map((function(e){return t.scale(e)}));return{prevData:r,prevTravellerWidth:i,prevUpdateId:a,prevX:o,prevWidth:n,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:l}}return null}},{key:"getIndexInRange",value:function(e,t){for(var r=0,n=e.length-1;n-r>1;){var o=Math.floor((r+n)/2);e[o]>t?n=o:r=o}return t>=e[n]?n:r}}],o&&lL(n.prototype,o),a&&lL(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,a}(r.PureComponent);function gL(e){return gL="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},gL(e)}function bL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bL(Object(r),!0).forEach((function(t){xL(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bL(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xL(e,t,r){return t=function(e){var t=function(e,t){if("object"!=gL(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=gL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==gL(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hL(vL,"displayName","Brush"),hL(vL,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var _L=Math.PI/180,OL=function(e){return 180*e/Math.PI},SL=function(e,t,r,n){return{x:e+Math.cos(-_L*n)*r,y:t+Math.sin(-_L*n)*r}},EL=function(e,t){var r=e.x,n=e.y,o=t.cx,i=t.cy,a=function(e,t){var r=e.x,n=e.y,o=t.x,i=t.y;return Math.sqrt(Math.pow(r-o,2)+Math.pow(n-i,2))}({x:r,y:n},{x:o,y:i});if(a<=0)return{radius:a};var s=(r-o)/a,u=Math.acos(s);return n>i&&(u=2*Math.PI-u),{radius:a,angle:OL(u),angleInRadian:u}},jL=function(e,t){var r=t.startAngle,n=t.endAngle,o=Math.floor(r/360),i=Math.floor(n/360);return e+360*Math.min(o,i)},PL=function(e,t){var r=e.x,n=e.y,o=EL({x:r,y:n},t),i=o.radius,a=o.angle,s=t.innerRadius,u=t.outerRadius;if(i<s||i>u)return!1;if(0===i)return!0;var l,c=function(e){var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),o=Math.floor(r/360),i=Math.min(n,o);return{startAngle:t-360*i,endAngle:r-360*i}}(t),f=c.startAngle,d=c.endAngle,p=a;if(f<=d){for(;p>d;)p-=360;for(;p<f;)p+=360;l=p>=f&&p<=d}else{for(;p>f;)p-=360;for(;p<d;)p+=360;l=p>=d&&p<=f}return l?wL(wL({},t),{},{radius:i,angle:jL(p,t)}):null};function kL(e){return kL="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},kL(e)}var CL=["offset"];function AL(e){return function(e){if(Array.isArray(e))return NL(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return NL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return NL(e,t)}(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.")}()}function NL(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function TL(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function ML(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function RL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ML(Object(r),!0).forEach((function(t){LL(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ML(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function LL(e,t,r){return t=function(e){var t=function(e,t){if("object"!=kL(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=kL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==kL(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IL(){return IL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IL.apply(this,arguments)}var DL=function(e,t,r){var n,o,a=e.position,s=e.viewBox,u=e.offset,l=e.className,c=s,f=c.cx,d=c.cy,p=c.innerRadius,h=c.outerRadius,m=c.startAngle,y=c.endAngle,v=c.clockWise,g=(p+h)/2,b=function(e,t){return P_(t-e)*Math.min(Math.abs(t-e),360)}(m,y),w=b>=0?1:-1;"insideStart"===a?(n=m+w*u,o=v):"insideEnd"===a?(n=y-w*u,o=!v):"end"===a&&(n=y+w*u,o=v),o=b<=0?o:!o;var x=SL(f,d,g,n),_=SL(f,d,g,n+359*(o?1:-1)),O="M".concat(x.x,",").concat(x.y,"\n    A").concat(g,",").concat(g,",0,1,").concat(o?0:1,",\n    ").concat(_.x,",").concat(_.y),S=z_()(e.id)?T_("recharts-radial-line-"):e.id;return i().createElement("text",IL({},r,{dominantBaseline:"central",className:gt("recharts-radial-bar-label",l)}),i().createElement("defs",null,i().createElement("path",{id:S,d:O})),i().createElement("textPath",{xlinkHref:"#".concat(S)},t))};function FL(e){var t,n=e.offset,o=RL({offset:void 0===n?5:n},TL(e,CL)),a=o.viewBox,s=o.position,u=o.value,l=o.children,c=o.content,f=o.className,d=void 0===f?"":f,p=o.textBreakAll;if(!a||z_()(u)&&z_()(l)&&!(0,r.isValidElement)(c)&&!V_()(c))return null;if((0,r.isValidElement)(c))return(0,r.cloneElement)(c,o);if(V_()(c)){if(t=(0,r.createElement)(c,o),(0,r.isValidElement)(t))return t}else t=function(e){var t=e.value,r=e.formatter,n=z_()(e.children)?t:e.children;return V_()(r)?r(n):n}(o);var h=function(e){return"cx"in e&&C_(e.cx)}(a),m=pO(o,!0);if(h&&("insideStart"===s||"insideEnd"===s||"end"===s))return DL(o,t,m);var y=h?function(e){var t=e.viewBox,r=e.offset,n=e.position,o=t,i=o.cx,a=o.cy,s=o.innerRadius,u=o.outerRadius,l=(o.startAngle+o.endAngle)/2;if("outside"===n){var c=SL(i,a,u+r,l),f=c.x;return{x:f,y:c.y,textAnchor:f>=i?"start":"end",verticalAnchor:"middle"}}if("center"===n)return{x:i,y:a,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===n)return{x:i,y:a,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===n)return{x:i,y:a,textAnchor:"middle",verticalAnchor:"end"};var d=SL(i,a,(s+u)/2,l);return{x:d.x,y:d.y,textAnchor:"middle",verticalAnchor:"middle"}}(o):function(e){var t=e.viewBox,r=e.parentViewBox,n=e.offset,o=e.position,i=t,a=i.x,s=i.y,u=i.width,l=i.height,c=l>=0?1:-1,f=c*n,d=c>0?"end":"start",p=c>0?"start":"end",h=u>=0?1:-1,m=h*n,y=h>0?"end":"start",v=h>0?"start":"end";if("top"===o)return RL(RL({},{x:a+u/2,y:s-c*n,textAnchor:"middle",verticalAnchor:d}),r?{height:Math.max(s-r.y,0),width:u}:{});if("bottom"===o)return RL(RL({},{x:a+u/2,y:s+l+f,textAnchor:"middle",verticalAnchor:p}),r?{height:Math.max(r.y+r.height-(s+l),0),width:u}:{});if("left"===o){var g={x:a-m,y:s+l/2,textAnchor:y,verticalAnchor:"middle"};return RL(RL({},g),r?{width:Math.max(g.x-r.x,0),height:l}:{})}if("right"===o){var b={x:a+u+m,y:s+l/2,textAnchor:v,verticalAnchor:"middle"};return RL(RL({},b),r?{width:Math.max(r.x+r.width-b.x,0),height:l}:{})}var w=r?{width:u,height:l}:{};return"insideLeft"===o?RL({x:a+m,y:s+l/2,textAnchor:v,verticalAnchor:"middle"},w):"insideRight"===o?RL({x:a+u-m,y:s+l/2,textAnchor:y,verticalAnchor:"middle"},w):"insideTop"===o?RL({x:a+u/2,y:s+f,textAnchor:"middle",verticalAnchor:p},w):"insideBottom"===o?RL({x:a+u/2,y:s+l-f,textAnchor:"middle",verticalAnchor:d},w):"insideTopLeft"===o?RL({x:a+m,y:s+f,textAnchor:v,verticalAnchor:p},w):"insideTopRight"===o?RL({x:a+u-m,y:s+f,textAnchor:y,verticalAnchor:p},w):"insideBottomLeft"===o?RL({x:a+m,y:s+l-f,textAnchor:v,verticalAnchor:d},w):"insideBottomRight"===o?RL({x:a+u-m,y:s+l-f,textAnchor:y,verticalAnchor:d},w):U_()(o)&&(C_(o.x)||k_(o.x))&&(C_(o.y)||k_(o.y))?RL({x:a+M_(o.x,u),y:s+M_(o.y,l),textAnchor:"end",verticalAnchor:"end"},w):RL({x:a+u/2,y:s+l/2,textAnchor:"middle",verticalAnchor:"middle"},w)}(o);return i().createElement(_k,IL({className:gt("recharts-label",d)},m,y,{breakAll:p}),t)}FL.displayName="Label";var zL=function(e){var t=e.cx,r=e.cy,n=e.angle,o=e.startAngle,i=e.endAngle,a=e.r,s=e.radius,u=e.innerRadius,l=e.outerRadius,c=e.x,f=e.y,d=e.top,p=e.left,h=e.width,m=e.height,y=e.clockWise,v=e.labelViewBox;if(v)return v;if(C_(h)&&C_(m)){if(C_(c)&&C_(f))return{x:c,y:f,width:h,height:m};if(C_(d)&&C_(p))return{x:d,y:p,width:h,height:m}}return C_(c)&&C_(f)?{x:c,y:f,width:0,height:0}:C_(t)&&C_(r)?{cx:t,cy:r,startAngle:o||n||0,endAngle:i||n||0,innerRadius:u||0,outerRadius:l||s||a||0,clockWise:y}:e.viewBox?e.viewBox:{}};FL.parseViewBox=zL,FL.renderCallByParent=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&n&&!e.label)return null;var o=e.children,a=zL(e),s=uO(o,FL).map((function(e,n){return(0,r.cloneElement)(e,{viewBox:t||a,key:"label-".concat(n)})}));if(!n)return s;var u=function(e,t){return e?!0===e?i().createElement(FL,{key:"label-implicit",viewBox:t}):A_(e)?i().createElement(FL,{key:"label-implicit",viewBox:t,value:e}):(0,r.isValidElement)(e)?e.type===FL?(0,r.cloneElement)(e,{key:"label-implicit",viewBox:t}):i().createElement(FL,{key:"label-implicit",content:e,viewBox:t}):V_()(e)?i().createElement(FL,{key:"label-implicit",content:e,viewBox:t}):U_()(e)?i().createElement(FL,IL({viewBox:t},e,{key:"label-implicit"})):null:null}(e.label,t||a);return[u].concat(AL(s))};var BL=function(e,t){var r=e.alwaysShow,n=e.ifOverflow;return r&&(n="extendDomain"),n===t},VL=o(3916),$L=o.n(VL),UL=o(9747),GL=o.n(UL),WL=function(e){return null};WL.displayName="Cell";var qL=o(8090),HL=o.n(qL);function ZL(e){return ZL="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},ZL(e)}var KL=["valueAccessor"],YL=["data","dataKey","clockWise","id","textBreakAll"];function XL(e){return function(e){if(Array.isArray(e))return QL(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return QL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return QL(e,t)}(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.")}()}function QL(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function JL(){return JL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},JL.apply(this,arguments)}function eI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eI(Object(r),!0).forEach((function(t){rI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eI(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rI(e,t,r){return t=function(e){var t=function(e,t){if("object"!=ZL(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ZL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ZL(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nI(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var oI=function(e){return Array.isArray(e.value)?HL()(e.value):e.value};function iI(e){var t=e.valueAccessor,r=void 0===t?oI:t,n=nI(e,KL),o=n.data,a=n.dataKey,s=n.clockWise,u=n.id,l=n.textBreakAll,c=nI(n,YL);return o&&o.length?i().createElement(DO,{className:"recharts-label-list"},o.map((function(e,t){var n=z_()(a)?r(e,t):TR(e&&e.payload,a),o=z_()(u)?{}:{id:"".concat(u,"-").concat(t)};return i().createElement(FL,JL({},pO(e,!0),c,o,{parentViewBox:e.parentViewBox,value:n,textBreakAll:l,viewBox:FL.parseViewBox(z_()(s)?e:tI(tI({},e),{},{clockWise:s})),key:"label-".concat(t),index:t}))}))):null}iI.displayName="LabelList",iI.renderCallByParent=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&n&&!e.label)return null;var o=uO(e.children,iI).map((function(e,n){return(0,r.cloneElement)(e,{data:t,key:"labelList-".concat(n)})}));if(!n)return o;var a=function(e,t){return e?!0===e?i().createElement(iI,{key:"labelList-implicit",data:t}):i().isValidElement(e)||V_()(e)?i().createElement(iI,{key:"labelList-implicit",data:t,content:e}):U_()(e)?i().createElement(iI,JL({data:t},e,{key:"labelList-implicit"})):null:null}(e.label,t);return[a].concat(XL(o))};var aI=o(1331),sI=o.n(aI),uI=o(3812),lI=o.n(uI);function cI(e){return cI="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},cI(e)}function fI(){return fI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fI.apply(this,arguments)}function dI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pI(e,t)}(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.")}()}function pI(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hI(Object(r),!0).forEach((function(t){yI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hI(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function yI(e,t,r){return t=function(e){var t=function(e,t){if("object"!=cI(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=cI(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==cI(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var vI=function(e,t,r,n,o){var i,a=r-n;return i="M ".concat(e,",").concat(t),i+="L ".concat(e+r,",").concat(t),i+="L ".concat(e+r-a/2,",").concat(t+o),i+="L ".concat(e+r-a/2-n,",").concat(t+o),i+="L ".concat(e,",").concat(t," Z")},gI={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},bI=function(e){var t=mI(mI({},gI),e),n=(0,r.useRef)(),o=dI((0,r.useState)(-1),2),a=o[0],s=o[1];(0,r.useEffect)((function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&s(e)}catch(e){}}),[]);var u=t.x,l=t.y,c=t.upperWidth,f=t.lowerWidth,d=t.height,p=t.className,h=t.animationEasing,m=t.animationDuration,y=t.animationBegin,v=t.isUpdateAnimationActive;if(u!==+u||l!==+l||c!==+c||f!==+f||d!==+d||0===c&&0===f||0===d)return null;var g=gt("recharts-trapezoid",p);return v?i().createElement(yP,{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:d,x:u,y:l},to:{upperWidth:c,lowerWidth:f,height:d,x:u,y:l},duration:m,animationEasing:h,isActive:v},(function(e){var r=e.upperWidth,o=e.lowerWidth,s=e.height,u=e.x,l=e.y;return i().createElement(yP,{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:h},i().createElement("path",fI({},pO(t,!0),{className:g,d:vI(u,l,r,o,s),ref:n})))})):i().createElement("g",null,i().createElement("path",fI({},pO(t,!0),{className:g,d:vI(u,l,c,f,d)})))};function wI(e){return wI="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},wI(e)}function xI(){return xI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xI.apply(this,arguments)}function _I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function OI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_I(Object(r),!0).forEach((function(t){SI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_I(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function SI(e,t,r){return t=function(e){var t=function(e,t){if("object"!=wI(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=wI(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wI(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var EI=function(e){var t=e.cx,r=e.cy,n=e.radius,o=e.angle,i=e.sign,a=e.isExternal,s=e.cornerRadius,u=e.cornerIsExternal,l=s*(a?1:-1)+n,c=Math.asin(s/l)/_L,f=u?o:o+i*c,d=u?o-i*c:o;return{center:SL(t,r,l,f),circleTangency:SL(t,r,n,f),lineTangency:SL(t,r,l*Math.cos(c*_L),d),theta:c}},jI=function(e){var t=e.cx,r=e.cy,n=e.innerRadius,o=e.outerRadius,i=e.startAngle,a=function(e,t){return P_(t-e)*Math.min(Math.abs(t-e),359.999)}(i,e.endAngle),s=i+a,u=SL(t,r,o,i),l=SL(t,r,o,s),c="M ".concat(u.x,",").concat(u.y,"\n    A ").concat(o,",").concat(o,",0,\n    ").concat(+(Math.abs(a)>180),",").concat(+(i>s),",\n    ").concat(l.x,",").concat(l.y,"\n  ");if(n>0){var f=SL(t,r,n,i),d=SL(t,r,n,s);c+="L ".concat(d.x,",").concat(d.y,"\n            A ").concat(n,",").concat(n,",0,\n            ").concat(+(Math.abs(a)>180),",").concat(+(i<=s),",\n            ").concat(f.x,",").concat(f.y," Z")}else c+="L ".concat(t,",").concat(r," Z");return c},PI={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},kI=function(e){var t=OI(OI({},PI),e),r=t.cx,n=t.cy,o=t.innerRadius,a=t.outerRadius,s=t.cornerRadius,u=t.forceCornerRadius,l=t.cornerIsExternal,c=t.startAngle,f=t.endAngle,d=t.className;if(a<o||c===f)return null;var p,h=gt("recharts-sector",d),m=a-o,y=M_(s,m,0,!0);return p=y>0&&Math.abs(c-f)<360?function(e){var t=e.cx,r=e.cy,n=e.innerRadius,o=e.outerRadius,i=e.cornerRadius,a=e.forceCornerRadius,s=e.cornerIsExternal,u=e.startAngle,l=e.endAngle,c=P_(l-u),f=EI({cx:t,cy:r,radius:o,angle:u,sign:c,cornerRadius:i,cornerIsExternal:s}),d=f.circleTangency,p=f.lineTangency,h=f.theta,m=EI({cx:t,cy:r,radius:o,angle:l,sign:-c,cornerRadius:i,cornerIsExternal:s}),y=m.circleTangency,v=m.lineTangency,g=m.theta,b=s?Math.abs(u-l):Math.abs(u-l)-h-g;if(b<0)return a?"M ".concat(p.x,",").concat(p.y,"\n        a").concat(i,",").concat(i,",0,0,1,").concat(2*i,",0\n        a").concat(i,",").concat(i,",0,0,1,").concat(2*-i,",0\n      "):jI({cx:t,cy:r,innerRadius:n,outerRadius:o,startAngle:u,endAngle:l});var w="M ".concat(p.x,",").concat(p.y,"\n    A").concat(i,",").concat(i,",0,0,").concat(+(c<0),",").concat(d.x,",").concat(d.y,"\n    A").concat(o,",").concat(o,",0,").concat(+(b>180),",").concat(+(c<0),",").concat(y.x,",").concat(y.y,"\n    A").concat(i,",").concat(i,",0,0,").concat(+(c<0),",").concat(v.x,",").concat(v.y,"\n  ");if(n>0){var x=EI({cx:t,cy:r,radius:n,angle:u,sign:c,isExternal:!0,cornerRadius:i,cornerIsExternal:s}),_=x.circleTangency,O=x.lineTangency,S=x.theta,E=EI({cx:t,cy:r,radius:n,angle:l,sign:-c,isExternal:!0,cornerRadius:i,cornerIsExternal:s}),j=E.circleTangency,P=E.lineTangency,k=E.theta,C=s?Math.abs(u-l):Math.abs(u-l)-S-k;if(C<0&&0===i)return"".concat(w,"L").concat(t,",").concat(r,"Z");w+="L".concat(P.x,",").concat(P.y,"\n      A").concat(i,",").concat(i,",0,0,").concat(+(c<0),",").concat(j.x,",").concat(j.y,"\n      A").concat(n,",").concat(n,",0,").concat(+(C>180),",").concat(+(c>0),",").concat(_.x,",").concat(_.y,"\n      A").concat(i,",").concat(i,",0,0,").concat(+(c<0),",").concat(O.x,",").concat(O.y,"Z")}else w+="L".concat(t,",").concat(r,"Z");return w}({cx:r,cy:n,innerRadius:o,outerRadius:a,cornerRadius:Math.min(y,m/2),forceCornerRadius:u,cornerIsExternal:l,startAngle:c,endAngle:f}):jI({cx:r,cy:n,innerRadius:o,outerRadius:a,startAngle:c,endAngle:f}),i().createElement("path",xI({},pO(t,!0),{className:h,d:p,role:"img"}))},CI=["option","shapeType","propTransformer","activeClassName","isActive"];function AI(e){return AI="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},AI(e)}function NI(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function TI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function MI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?TI(Object(r),!0).forEach((function(t){RI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TI(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function RI(e,t,r){return t=function(e){var t=function(e,t){if("object"!=AI(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=AI(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==AI(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LI(e,t){return MI(MI({},t),e)}function II(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return i().createElement(PP,r);case"trapezoid":return i().createElement(bI,r);case"sector":return i().createElement(kI,r);case"symbols":if(function(e){return"symbols"===e}(t))return i().createElement(pE,r);break;default:return null}}function DI(e){var t,n=e.option,o=e.shapeType,a=e.propTransformer,s=void 0===a?LI:a,u=e.activeClassName,l=void 0===u?"recharts-active-shape":u,c=e.isActive,f=NI(e,CI);if((0,r.isValidElement)(n))t=(0,r.cloneElement)(n,MI(MI({},f),function(e){return(0,r.isValidElement)(e)?e.props:e}(n)));else if(V_()(n))t=n(f);else if(sI()(n)&&!lI()(n)){var d=s(n,f);t=i().createElement(II,{shapeType:o,elementProps:d})}else{var p=f;t=i().createElement(II,{shapeType:o,elementProps:p})}return c?i().createElement(DO,{className:l},t):t}function FI(e,t){return null!=t&&"trapezoids"in e.props}function zI(e,t){return null!=t&&"sectors"in e.props}function BI(e,t){return null!=t&&"points"in e.props}function VI(e,t){var r,n,o=e.x===(null==t||null===(r=t.labelViewBox)||void 0===r?void 0:r.x)||e.x===t.x,i=e.y===(null==t||null===(n=t.labelViewBox)||void 0===n?void 0:n.y)||e.y===t.y;return o&&i}function $I(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function UI(e,t){var r=e.x===t.x,n=e.y===t.y,o=e.z===t.z;return r&&n&&o}function GI(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,o=function(e,t){var r;return FI(e,t)?r="trapezoids":zI(e,t)?r="sectors":BI(e,t)&&(r="points"),r}(r,t),i=function(e,t){var r,n;return FI(e,t)?null===(r=t.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:zI(e,t)?null===(n=t.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:BI(e,t)?t.payload:{}}(r,t),a=n.filter((function(e,n){var a=NM()(i,e),s=r.props[o].filter((function(e){var n=function(e,t){var r;return FI(e,t)?r=VI:zI(e,t)?r=$I:BI(e,t)&&(r=UI),r}(r,t);return n(e,t)})),u=r.props[o].indexOf(s[s.length-1]);return a&&n===u}));return n.indexOf(a[a.length-1])}var WI=["x","y"];function qI(e){return qI="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},qI(e)}function HI(){return HI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HI.apply(this,arguments)}function ZI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function KI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ZI(Object(r),!0).forEach((function(t){YI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZI(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function YI(e,t,r){return t=function(e){var t=function(e,t){if("object"!=qI(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=qI(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==qI(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XI(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function QI(e,t){var r=e.x,n=e.y,o=XI(e,WI),i="".concat(r),a=parseInt(i,10),s="".concat(n),u=parseInt(s,10),l="".concat(t.height||o.height),c=parseInt(l,10),f="".concat(t.width||o.width),d=parseInt(f,10);return KI(KI(KI(KI(KI({},t),o),a?{x:a}:{}),u?{y:u}:{}),{},{height:c,width:d,name:t.name,radius:t.radius})}function JI(e){return i().createElement(DI,HI({shapeType:"rectangle",propTransformer:QI,activeClassName:"recharts-active-bar"},e))}var eD,tD=["value","background"];function rD(e){return rD="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},rD(e)}function nD(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function oD(){return oD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oD.apply(this,arguments)}function iD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function aD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?iD(Object(r),!0).forEach((function(t){dD(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iD(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function sD(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pD(n.key),n)}}function uD(e,t,r){return t=cD(t),function(e,t){if(t&&("object"===rD(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,lD()?Reflect.construct(t,r||[],cD(e).constructor):t.apply(e,r))}function lD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lD=function(){return!!e})()}function cD(e){return cD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cD(e)}function fD(e,t){return fD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fD(e,t)}function dD(e,t,r){return(t=pD(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pD(e){var t=function(e,t){if("object"!=rD(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=rD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==rD(t)?t:t+""}var hD=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return dD(e=uD(this,t,[].concat(n)),"state",{isAnimationFinished:!1}),dD(e,"id",T_("recharts-bar-")),dD(e,"handleAnimationEnd",(function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()})),dD(e,"handleAnimationStart",(function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()})),e}return function(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&&fD(e,t)}(t,e),r=t,n=[{key:"renderRectanglesStatically",value:function(e){var t=this,r=this.props,n=r.shape,o=r.dataKey,a=r.activeIndex,s=r.activeBar,u=pO(this.props,!1);return e&&e.map((function(e,r){var l=r===a,c=l?s:n,f=aD(aD(aD({},u),e),{},{isActive:l,option:c,index:r,dataKey:o,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return i().createElement(DO,oD({className:"recharts-bar-rectangle"},Q_(t.props,e,r),{key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value)}),i().createElement(JI,f))}))}},{key:"renderRectanglesWithAnimation",value:function(){var e=this,t=this.props,r=t.data,n=t.layout,o=t.isAnimationActive,a=t.animationBegin,s=t.animationDuration,u=t.animationEasing,l=t.animationId,c=this.state.prevData;return i().createElement(yP,{begin:a,duration:s,isActive:o,easing:u,from:{t:0},to:{t:1},key:"bar-".concat(l),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(t){var o=t.t,a=r.map((function(e,t){var r=c&&c[t];if(r){var i=L_(r.x,e.x),a=L_(r.y,e.y),s=L_(r.width,e.width),u=L_(r.height,e.height);return aD(aD({},e),{},{x:i(o),y:a(o),width:s(o),height:u(o)})}if("horizontal"===n){var l=L_(0,e.height)(o);return aD(aD({},e),{},{y:e.y+e.height-l,height:l})}var f=L_(0,e.width)(o);return aD(aD({},e),{},{width:f})}));return i().createElement(DO,null,e.renderRectanglesStatically(a))}))}},{key:"renderRectangles",value:function(){var e=this.props,t=e.data,r=e.isAnimationActive,n=this.state.prevData;return!(r&&t&&t.length)||n&&NM()(n,t)?this.renderRectanglesStatically(t):this.renderRectanglesWithAnimation()}},{key:"renderBackground",value:function(){var e=this,t=this.props,r=t.data,n=t.dataKey,o=t.activeIndex,a=pO(this.props.background,!1);return r.map((function(t,r){t.value;var s=t.background,u=nD(t,tD);if(!s)return null;var l=aD(aD(aD(aD(aD({},u),{},{fill:"#eee"},s),a),Q_(e.props,t,r)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:n,index:r,className:"recharts-bar-background-rectangle"});return i().createElement(JI,oD({key:"background-bar-".concat(r),option:e.props.background,isActive:r===o},l))}))}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.data,o=r.xAxis,a=r.yAxis,s=r.layout,u=uO(r.children,wR);if(!u)return null;var l="vertical"===s?n[0].height/2:n[0].width/2,c=function(e,t){var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:TR(e,t)}},f={clipPath:e?"url(#clipPath-".concat(t,")"):null};return i().createElement(DO,f,u.map((function(e){return i().cloneElement(e,{key:"error-bar-".concat(t,"-").concat(e.props.dataKey),data:n,xAxis:o,yAxis:a,layout:s,offset:l,dataPointFormatter:c})})))}},{key:"render",value:function(){var e=this.props,t=e.hide,r=e.data,n=e.className,o=e.xAxis,a=e.yAxis,s=e.left,u=e.top,l=e.width,c=e.height,f=e.isAnimationActive,d=e.background,p=e.id;if(t||!r||!r.length)return null;var h=this.state.isAnimationFinished,m=gt("recharts-bar",n),y=o&&o.allowDataOverflow,v=a&&a.allowDataOverflow,g=y||v,b=z_()(p)?this.id:p;return i().createElement(DO,{className:m},y||v?i().createElement("defs",null,i().createElement("clipPath",{id:"clipPath-".concat(b)},i().createElement("rect",{x:y?s:s-l/2,y:v?u:u-c/2,width:y?l:2*l,height:v?c:2*c}))):null,i().createElement(DO,{className:"recharts-bar-rectangles",clipPath:g?"url(#clipPath-".concat(b,")"):null},d?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(g,b),(!f||h)&&iI.renderCallByParent(this.props,r))}}],o=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}:e.data!==t.curData?{curData:e.data}:null}}],n&&sD(r.prototype,n),o&&sD(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.PureComponent);function mD(e){return mD="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},mD(e)}function yD(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wD(n.key),n)}}function vD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vD(Object(r),!0).forEach((function(t){bD(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vD(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function bD(e,t,r){return(t=wD(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wD(e){var t=function(e,t){if("object"!=mD(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=mD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==mD(t)?t:t+""}eD=hD,dD(hD,"displayName","Bar"),dD(hD,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!cS.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),dD(hD,"getComposedData",(function(e){var t=e.props,r=e.item,n=e.barPosition,o=e.bandSize,i=e.xAxis,a=e.yAxis,s=e.xAxisTicks,u=e.yAxisTicks,l=e.stackedData,c=e.dataStartIndex,f=e.displayedData,d=e.offset,p=function(e,t){if(!e)return null;for(var r=0,n=e.length;r<n;r++)if(e[r].item===t)return e[r].position;return null}(n,r);if(!p)return null;var h=t.layout,m=r.type.defaultProps,y=void 0!==m?aD(aD({},m),r.props):r.props,v=y.dataKey,g=y.children,b=y.minPointSize,w="horizontal"===h?a:i,x=l?w.scale.domain():null,_=function(e){var t=e.numericAxis,r=t.scale.domain();if("number"===t.type){var n=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return n<=0&&o>=0?0:o<0?o:n}return r[0]}({numericAxis:w}),O=uO(g,WL),S=f.map((function(e,t){var n,f,d,m,y,g;l?n=function(e,t){if(!t||2!==t.length||!C_(t[0])||!C_(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),o=[e[0],e[1]];return(!C_(e[0])||e[0]<r)&&(o[0]=r),(!C_(e[1])||e[1]>n)&&(o[1]=n),o[0]>n&&(o[0]=n),o[1]<r&&(o[1]=r),o}(l[c+t],x):(n=TR(e,v),Array.isArray(n)||(n=[_,n]));var w=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(r,n){if("number"==typeof e)return e;var o="number"==typeof r;return o?e(r,n):(o||CO(!1),t)}}(b,eD.defaultProps.minPointSize)(n[1],t);if("horizontal"===h){var S,E=[a.scale(n[0]),a.scale(n[1])],j=E[0],P=E[1];f=qR({axis:i,ticks:s,bandSize:o,offset:p.offset,entry:e,index:t}),d=null!==(S=null!=P?P:j)&&void 0!==S?S:void 0,m=p.size;var k=j-P;if(y=Number.isNaN(k)?0:k,g={x:f,y:a.y,width:m,height:a.height},Math.abs(w)>0&&Math.abs(y)<Math.abs(w)){var C=P_(y||w)*(Math.abs(w)-Math.abs(y));d-=C,y+=C}}else{var A=[i.scale(n[0]),i.scale(n[1])],N=A[0],T=A[1];if(f=N,d=qR({axis:a,ticks:u,bandSize:o,offset:p.offset,entry:e,index:t}),m=T-N,y=p.size,g={x:i.x,y:d,width:i.width,height:y},Math.abs(w)>0&&Math.abs(m)<Math.abs(w))m+=P_(m||w)*(Math.abs(w)-Math.abs(m))}return aD(aD(aD({},e),{},{x:f,y:d,width:m,height:y,value:l?n:n[1],payload:e,background:g},O&&O[t]&&O[t].props),{},{tooltipPayload:[JR(r,e)],tooltipPosition:{x:f+m/2,y:d+y/2}})}));return aD({data:S,layout:h},d)}));var xD=function(e,t){var r=e.x,n=e.y,o=t.x,i=t.y;return{x:Math.min(r,o),y:Math.min(n,i),width:Math.abs(o-r),height:Math.abs(i-n)}},_D=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scale=t}return t=e,r=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.bandAware,n=t.position;if(void 0!==e){if(n)switch(n){case"start":default:return this.scale(e);case"middle":var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+o;case"end":var i=this.bandwidth?this.bandwidth():0;return this.scale(e)+i}if(r){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+a}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),r=t[0],n=t[t.length-1];return r<=n?e>=r&&e<=n:e>=n&&e<=r}}],n=[{key:"create",value:function(t){return new e(t)}}],r&&yD(t.prototype,r),n&&yD(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();bD(_D,"EPS",1e-4);var OD=function(e){var t=Object.keys(e).reduce((function(t,r){return gD(gD({},t),{},bD({},r,_D.create(e[r])))}),{});return gD(gD({},t),{},{apply:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.bandAware,o=r.position;return $L()(e,(function(e,r){return t[r].apply(e,{bandAware:n,position:o})}))},isInRange:function(e){return GL()(e,(function(e,r){return t[r].isInRange(e)}))}})};function SD(){return SD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SD.apply(this,arguments)}function ED(e){return ED="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},ED(e)}function jD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function PD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jD(Object(r),!0).forEach((function(t){MD(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jD(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function kD(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,RD(n.key),n)}}function CD(e,t,r){return t=ND(t),function(e,t){if(t&&("object"===ED(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,AD()?Reflect.construct(t,r||[],ND(e).constructor):t.apply(e,r))}function AD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(AD=function(){return!!e})()}function ND(e){return ND=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ND(e)}function TD(e,t){return TD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},TD(e,t)}function MD(e,t,r){return(t=RD(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RD(e){var t=function(e,t){if("object"!=ED(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ED(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ED(t)?t:t+""}var LD=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),CD(this,t,arguments)}return function(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&&TD(e,t)}(t,e),r=t,n=[{key:"render",value:function(){var e=this.props,r=e.x,n=e.y,o=e.r,a=e.alwaysShow,s=e.clipPathId,u=A_(r),l=A_(n);if(D_(void 0===a,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!l)return null;var c=function(e){var t=e.x,r=e.y,n=e.xAxis,o=e.yAxis,i=OD({x:n.scale,y:o.scale}),a=i.apply({x:t,y:r},{bandAware:!0});return BL(e,"discard")&&!i.isInRange(a)?null:a}(this.props);if(!c)return null;var f=c.x,d=c.y,p=this.props,h=p.shape,m=p.className,y=PD(PD({clipPath:BL(this.props,"hidden")?"url(#".concat(s,")"):void 0},pO(this.props,!0)),{},{cx:f,cy:d});return i().createElement(DO,{className:gt("recharts-reference-dot",m)},t.renderDot(h,y),FL.renderCallByParent(this.props,{x:f-o,y:d-o,width:2*o,height:2*o}))}}],n&&kD(r.prototype,n),o&&kD(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(i().Component);MD(LD,"displayName","ReferenceDot"),MD(LD,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1}),MD(LD,"renderDot",(function(e,t){return i().isValidElement(e)?i().cloneElement(e,t):V_()(e)?e(t):i().createElement(VE,SD({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"}))}));var ID=o(2426),DD=o.n(ID),FD=o(7309),zD=o.n(FD),BD=o(104),VD=o.n(BD)()((function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}}),(function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}));var $D=(0,r.createContext)(void 0),UD=(0,r.createContext)(void 0),GD=(0,r.createContext)(void 0),WD=(0,r.createContext)({}),qD=(0,r.createContext)(void 0),HD=(0,r.createContext)(0),ZD=(0,r.createContext)(0),KD=function(e){var t=e.state,r=t.xAxisMap,n=t.yAxisMap,o=t.offset,a=e.clipPathId,s=e.children,u=e.width,l=e.height,c=VD(o);return i().createElement($D.Provider,{value:r},i().createElement(UD.Provider,{value:n},i().createElement(WD.Provider,{value:o},i().createElement(GD.Provider,{value:c},i().createElement(qD.Provider,{value:a},i().createElement(HD.Provider,{value:l},i().createElement(ZD.Provider,{value:u},s)))))))};var YD=function(e){var t=(0,r.useContext)($D);null==t&&CO(!1);var n=t[e];return null==n&&CO(!1),n},XD=function(e){var t=(0,r.useContext)(UD);null==t&&CO(!1);var n=t[e];return null==n&&CO(!1),n},QD=function(){return(0,r.useContext)(ZD)},JD=function(){return(0,r.useContext)(HD)};function eF(e){return eF="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},eF(e)}function tF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lF(n.key),n)}}function rF(e,t,r){return t=oF(t),function(e,t){if(t&&("object"===eF(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,nF()?Reflect.construct(t,r||[],oF(e).constructor):t.apply(e,r))}function nF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nF=function(){return!!e})()}function oF(e){return oF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oF(e)}function iF(e,t){return iF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},iF(e,t)}function aF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sF(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?aF(Object(r),!0).forEach((function(t){uF(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aF(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function uF(e,t,r){return(t=lF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lF(e){var t=function(e,t){if("object"!=eF(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==eF(t)?t:t+""}function cF(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fF(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fF(e,t)}(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.")}()}function fF(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dF(){return dF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dF.apply(this,arguments)}function pF(e){var t=e.x,n=e.y,o=e.segment,a=e.xAxisId,s=e.yAxisId,u=e.shape,l=e.className,c=e.alwaysShow,f=(0,r.useContext)(qD),d=YD(a),p=XD(s),h=(0,r.useContext)(GD);if(!f||!h)return null;D_(void 0===c,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=function(e,t,r,n,o,i,a,s,u){var l=o.x,c=o.y,f=o.width,d=o.height;if(r){var p=u.y,h=e.y.apply(p,{position:i});if(BL(u,"discard")&&!e.y.isInRange(h))return null;var m=[{x:l+f,y:h},{x:l,y:h}];return"left"===s?m.reverse():m}if(t){var y=u.x,v=e.x.apply(y,{position:i});if(BL(u,"discard")&&!e.x.isInRange(v))return null;var g=[{x:v,y:c+d},{x:v,y:c}];return"top"===a?g.reverse():g}if(n){var b=u.segment.map((function(t){return e.apply(t,{position:i})}));return BL(u,"discard")&&DD()(b,(function(t){return!e.isInRange(t)}))?null:b}return null}(OD({x:d.scale,y:p.scale}),A_(t),A_(n),o&&2===o.length,h,e.position,d.orientation,p.orientation,e);if(!m)return null;var y=cF(m,2),v=y[0],g=v.x,b=v.y,w=y[1],x=w.x,_=w.y,O=sF(sF({clipPath:BL(e,"hidden")?"url(#".concat(f,")"):void 0},pO(e,!0)),{},{x1:g,y1:b,x2:x,y2:_});return i().createElement(DO,{className:gt("recharts-reference-line",l)},function(e,t){return i().isValidElement(e)?i().cloneElement(e,t):V_()(e)?e(t):i().createElement("line",dF({},t,{className:"recharts-reference-line-line"}))}(u,O),FL.renderCallByParent(e,function(e){var t=e.x1,r=e.y1,n=e.x2,o=e.y2;return xD({x:t,y:r},{x:n,y:o})}({x1:g,y1:b,x2:x,y2:_})))}var hF=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),rF(this,t,arguments)}return function(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&&iF(e,t)}(t,e),r=t,(n=[{key:"render",value:function(){return i().createElement(pF,this.props)}}])&&tF(r.prototype,n),o&&tF(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(i().Component);function mF(){return mF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mF.apply(this,arguments)}function yF(e){return yF="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},yF(e)}function vF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gF(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vF(Object(r),!0).forEach((function(t){SF(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vF(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function bF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,EF(n.key),n)}}function wF(e,t,r){return t=_F(t),function(e,t){if(t&&("object"===yF(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,xF()?Reflect.construct(t,r||[],_F(e).constructor):t.apply(e,r))}function xF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xF=function(){return!!e})()}function _F(e){return _F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_F(e)}function OF(e,t){return OF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},OF(e,t)}function SF(e,t,r){return(t=EF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EF(e){var t=function(e,t){if("object"!=yF(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=yF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==yF(t)?t:t+""}uF(hF,"displayName","ReferenceLine"),uF(hF,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});var jF=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),wF(this,t,arguments)}return function(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&&OF(e,t)}(t,e),r=t,(n=[{key:"render",value:function(){var e=this.props,r=e.x1,n=e.x2,o=e.y1,a=e.y2,s=e.className,u=e.alwaysShow,l=e.clipPathId;D_(void 0===u,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var c=A_(r),f=A_(n),d=A_(o),p=A_(a),h=this.props.shape;if(!(c||f||d||p||h))return null;var m=function(e,t,r,n,o){var i=o.x1,a=o.x2,s=o.y1,u=o.y2,l=o.xAxis,c=o.yAxis;if(!l||!c)return null;var f=OD({x:l.scale,y:c.scale}),d={x:e?f.x.apply(i,{position:"start"}):f.x.rangeMin,y:r?f.y.apply(s,{position:"start"}):f.y.rangeMin},p={x:t?f.x.apply(a,{position:"end"}):f.x.rangeMax,y:n?f.y.apply(u,{position:"end"}):f.y.rangeMax};return!BL(o,"discard")||f.isInRange(d)&&f.isInRange(p)?xD(d,p):null}(c,f,d,p,this.props);if(!m&&!h)return null;var y=BL(this.props,"hidden")?"url(#".concat(l,")"):void 0;return i().createElement(DO,{className:gt("recharts-reference-area",s)},t.renderRect(h,gF(gF({clipPath:y},pO(this.props,!0)),m)),FL.renderCallByParent(this.props,m))}}])&&bF(r.prototype,n),o&&bF(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(i().Component);function PF(e){return function(e){if(Array.isArray(e))return kF(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return kF(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kF(e,t)}(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.")}()}function kF(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}SF(jF,"displayName","ReferenceArea"),SF(jF,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1}),SF(jF,"renderRect",(function(e,t){return i().isValidElement(e)?i().cloneElement(e,t):V_()(e)?e(t):i().createElement(PP,mF({},t,{className:"recharts-reference-area-rect"}))}));var CF=function(e,t,r,n,o){var i=uO(e,hF),a=uO(e,LD),s=[].concat(PF(i),PF(a)),u=uO(e,jF),l="".concat(n,"Id"),c=n[0],f=t;if(s.length&&(f=s.reduce((function(e,t){if(t.props[l]===r&&BL(t.props,"extendDomain")&&C_(t.props[c])){var n=t.props[c];return[Math.min(e[0],n),Math.max(e[1],n)]}return e}),f)),u.length){var d="".concat(c,"1"),p="".concat(c,"2");f=u.reduce((function(e,t){if(t.props[l]===r&&BL(t.props,"extendDomain")&&C_(t.props[d])&&C_(t.props[p])){var n=t.props[d],o=t.props[p];return[Math.min(e[0],n,o),Math.max(e[1],n,o)]}return e}),f)}return o&&o.length&&(f=o.reduce((function(e,t){return C_(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e}),f)),f},AF=o(1747),NF=new(o.n(AF)()),TF="recharts.syncMouseEvents";function MF(e){return MF="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},MF(e)}function RF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,IF(n.key),n)}}function LF(e,t,r){return(t=IF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IF(e){var t=function(e,t){if("object"!=MF(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=MF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==MF(t)?t:t+""}var DF=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),LF(this,"activeIndex",0),LF(this,"coordinateList",[]),LF(this,"layout","horizontal")},t=[{key:"setDetails",value:function(e){var t,r=e.coordinateList,n=void 0===r?null:r,o=e.container,i=void 0===o?null:o,a=e.layout,s=void 0===a?null:a,u=e.offset,l=void 0===u?null:u,c=e.mouseHandlerCallback,f=void 0===c?null:c;this.coordinateList=null!==(t=null!=n?n:this.coordinateList)&&void 0!==t?t:[],this.container=null!=i?i:this.container,this.layout=null!=s?s:this.layout,this.offset=null!=l?l:this.offset,this.mouseHandlerCallback=null!=f?f:this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(e){if(0!==this.coordinateList.length)switch(e.key){case"ArrowRight":if("horizontal"!==this.layout)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case"ArrowLeft":if("horizontal"!==this.layout)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:"setIndex",value:function(e){this.activeIndex=e}},{key:"spoofMouse",value:function(){var e,t;if("horizontal"===this.layout&&0!==this.coordinateList.length){var r=this.container.getBoundingClientRect(),n=r.x,o=r.y,i=r.height,a=this.coordinateList[this.activeIndex].coordinate,s=(null===(e=window)||void 0===e?void 0:e.scrollX)||0,u=(null===(t=window)||void 0===t?void 0:t.scrollY)||0,l=n+a+s,c=o+this.offset.top+i/2+u;this.mouseHandlerCallback({pageX:l,pageY:c})}}}],t&&RF(e.prototype,t),r&&RF(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function FF(){}function zF(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function BF(e){this._context=e}function VF(e){this._context=e}function $F(e){this._context=e}BF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:zF(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:zF(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},VF.prototype={areaStart:FF,areaEnd:FF,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:zF(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},$F.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:zF(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class UF{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function GF(e){this._context=e}function WF(e){this._context=e}function qF(e){return new WF(e)}function HF(e){return e<0?-1:1}function ZF(e,t,r){var n=e._x1-e._x0,o=t-e._x1,i=(e._y1-e._y0)/(n||o<0&&-0),a=(r-e._y1)/(o||n<0&&-0),s=(i*o+a*n)/(n+o);return(HF(i)+HF(a))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs(s))||0}function KF(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function YF(e,t,r){var n=e._x0,o=e._y0,i=e._x1,a=e._y1,s=(i-n)/3;e._context.bezierCurveTo(n+s,o+s*t,i-s,a-s*r,i,a)}function XF(e){this._context=e}function QF(e){this._context=new JF(e)}function JF(e){this._context=e}function ez(e){this._context=e}function tz(e){var t,r,n=e.length-1,o=new Array(n),i=new Array(n),a=new Array(n);for(o[0]=0,i[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)o[t]=1,i[t]=4,a[t]=4*e[t]+2*e[t+1];for(o[n-1]=2,i[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=o[t]/i[t-1],i[t]-=r,a[t]-=r*a[t-1];for(o[n-1]=a[n-1]/i[n-1],t=n-2;t>=0;--t)o[t]=(a[t]-o[t+1])/i[t];for(i[n-1]=(e[n]+o[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-o[t+1];return[o,i]}function rz(e,t){this._context=e,this._t=t}function nz(e){return e[0]}function oz(e){return e[1]}function iz(e,t){var r=YS(!0),n=null,o=qF,i=null,a=nE(s);function s(s){var u,l,c,f=(s=wM(s)).length,d=!1;for(null==n&&(i=o(c=a())),u=0;u<=f;++u)!(u<f&&r(l=s[u],u,s))===d&&((d=!d)?i.lineStart():i.lineEnd()),d&&i.point(+e(l,u,s),+t(l,u,s));if(c)return i=null,c+""||null}return e="function"==typeof e?e:void 0===e?nz:YS(e),t="function"==typeof t?t:void 0===t?oz:YS(t),s.x=function(t){return arguments.length?(e="function"==typeof t?t:YS(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:YS(+e),s):t},s.defined=function(e){return arguments.length?(r="function"==typeof e?e:YS(!!e),s):r},s.curve=function(e){return arguments.length?(o=e,null!=n&&(i=o(n)),s):o},s.context=function(e){return arguments.length?(null==e?n=i=null:i=o(n=e),s):n},s}function az(e,t,r){var n=null,o=YS(!0),i=null,a=qF,s=null,u=nE(l);function l(l){var c,f,d,p,h,m=(l=wM(l)).length,y=!1,v=new Array(m),g=new Array(m);for(null==i&&(s=a(h=u())),c=0;c<=m;++c){if(!(c<m&&o(p=l[c],c,l))===y)if(y=!y)f=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=c-1;d>=f;--d)s.point(v[d],g[d]);s.lineEnd(),s.areaEnd()}y&&(v[c]=+e(p,c,l),g[c]=+t(p,c,l),s.point(n?+n(p,c,l):v[c],r?+r(p,c,l):g[c]))}if(h)return s=null,h+""||null}function c(){return iz().defined(o).curve(a).context(i)}return e="function"==typeof e?e:void 0===e?nz:YS(+e),t="function"==typeof t?t:YS(void 0===t?0:+t),r="function"==typeof r?r:void 0===r?oz:YS(+r),l.x=function(t){return arguments.length?(e="function"==typeof t?t:YS(+t),n=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:YS(+t),l):e},l.x1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:YS(+e),l):n},l.y=function(e){return arguments.length?(t="function"==typeof e?e:YS(+e),r=null,l):t},l.y0=function(e){return arguments.length?(t="function"==typeof e?e:YS(+e),l):t},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:YS(+e),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(n).y(t)},l.defined=function(e){return arguments.length?(o="function"==typeof e?e:YS(!!e),l):o},l.curve=function(e){return arguments.length?(a=e,null!=i&&(s=a(i)),l):a},l.context=function(e){return arguments.length?(null==e?i=s=null:s=a(i=e),l):i},l}function sz(e){return sz="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},sz(e)}function uz(){return uz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uz.apply(this,arguments)}function lz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function cz(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lz(Object(r),!0).forEach((function(t){fz(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lz(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function fz(e,t,r){return t=function(e){var t=function(e,t){if("object"!=sz(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=sz(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==sz(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}GF.prototype={areaStart:FF,areaEnd:FF,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},WF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},XF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:YF(this,this._t0,KF(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,YF(this,KF(this,r=ZF(this,e,t)),r);break;default:YF(this,this._t0,r=ZF(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}},(QF.prototype=Object.create(XF.prototype)).point=function(e,t){XF.prototype.point.call(this,t,e)},JF.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,o,i){this._context.bezierCurveTo(t,e,n,r,i,o)}},ez.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===r)this._context.lineTo(e[1],t[1]);else for(var n=tz(e),o=tz(t),i=0,a=1;a<r;++i,++a)this._context.bezierCurveTo(n[0][i],o[0][i],n[1][i],o[1][i],e[a],t[a]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},rz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}}this._x=e,this._y=t}};var dz={curveBasisClosed:function(e){return new VF(e)},curveBasisOpen:function(e){return new $F(e)},curveBasis:function(e){return new BF(e)},curveBumpX:function(e){return new UF(e,!0)},curveBumpY:function(e){return new UF(e,!1)},curveLinearClosed:function(e){return new GF(e)},curveLinear:qF,curveMonotoneX:function(e){return new XF(e)},curveMonotoneY:function(e){return new QF(e)},curveNatural:function(e){return new ez(e)},curveStep:function(e){return new rz(e,.5)},curveStepAfter:function(e){return new rz(e,1)},curveStepBefore:function(e){return new rz(e,0)}},pz=function(e){return e.x===+e.x&&e.y===+e.y},hz=function(e){return e.x},mz=function(e){return e.y},yz=function(e){var t,r=e.type,n=void 0===r?"linear":r,o=e.points,i=void 0===o?[]:o,a=e.baseLine,s=e.layout,u=e.connectNulls,l=void 0!==u&&u,c=function(e,t){if(V_()(e))return e;var r="curve".concat(PS()(e));return"curveMonotone"!==r&&"curveBump"!==r||!t?dz[r]||qF:dz["".concat(r).concat("vertical"===t?"Y":"X")]}(n,s),f=l?i.filter((function(e){return pz(e)})):i;if(Array.isArray(a)){var d=l?a.filter((function(e){return pz(e)})):a,p=f.map((function(e,t){return cz(cz({},e),{},{base:d[t]})}));return t="vertical"===s?az().y(mz).x1(hz).x0((function(e){return e.base.x})):az().x(hz).y1(mz).y0((function(e){return e.base.y})),t.defined(pz).curve(c),t(p)}return(t="vertical"===s&&C_(a)?az().y(mz).x1(hz).x0(a):C_(a)?az().x(hz).y1(mz).y0(a):iz().x(hz).y(mz)).defined(pz).curve(c),t(f)},vz=function(e){var t=e.className,r=e.points,n=e.path,o=e.pathRef;if(!(r&&r.length||n))return null;var a=r&&r.length?yz(e):n;return i().createElement("path",uz({},pO(e,!1),X_(e),{className:gt("recharts-curve",t),d:a,ref:o}))};function gz(e){return gz="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},gz(e)}var bz=["x","y","top","left","width","height","className"];function wz(){return wz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wz.apply(this,arguments)}function xz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _z(e,t,r){return t=function(e){var t=function(e,t){if("object"!=gz(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=gz(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==gz(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oz(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Sz=function(e,t,r,n,o,i){return"M".concat(e,",").concat(o,"v").concat(n,"M").concat(i,",").concat(t,"h").concat(r)},Ez=function(e){var t=e.x,r=void 0===t?0:t,n=e.y,o=void 0===n?0:n,a=e.top,s=void 0===a?0:a,u=e.left,l=void 0===u?0:u,c=e.width,f=void 0===c?0:c,d=e.height,p=void 0===d?0:d,h=e.className,m=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xz(Object(r),!0).forEach((function(t){_z(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xz(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({x:r,y:o,top:s,left:l,width:f,height:p},Oz(e,bz));return C_(r)&&C_(o)&&C_(f)&&C_(p)&&C_(s)&&C_(l)?i().createElement("path",wz({},pO(m,!0),{className:gt("recharts-cross",h),d:Sz(r,o,f,p,s,l)})):null};function jz(e){var t=e.cx,r=e.cy,n=e.radius,o=e.startAngle,i=e.endAngle;return{points:[SL(t,r,n,o),SL(t,r,n,i)],cx:t,cy:r,radius:n,startAngle:o,endAngle:i}}function Pz(e,t,r){var n,o,i,a;if("horizontal"===e)i=n=t.x,o=r.top,a=r.top+r.height;else if("vertical"===e)a=o=t.y,n=r.left,i=r.left+r.width;else if(null!=t.cx&&null!=t.cy){if("centric"!==e)return jz(t);var s=t.cx,u=t.cy,l=t.innerRadius,c=t.outerRadius,f=t.angle,d=SL(s,u,l,f),p=SL(s,u,c,f);n=d.x,o=d.y,i=p.x,a=p.y}return[{x:n,y:o},{x:i,y:a}]}function kz(e){return kz="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},kz(e)}function Cz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Az(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cz(Object(r),!0).forEach((function(t){Nz(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cz(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Nz(e,t,r){return t=function(e){var t=function(e,t){if("object"!=kz(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=kz(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==kz(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tz(e){var t,n,o,i=e.element,a=e.tooltipEventType,s=e.isActive,u=e.activeCoordinate,l=e.activePayload,c=e.offset,f=e.activeTooltipIndex,d=e.tooltipAxisBandSize,p=e.layout,h=e.chartName,m=null!==(t=i.props.cursor)&&void 0!==t?t:null===(n=i.type.defaultProps)||void 0===n?void 0:n.cursor;if(!i||!m||!s||!u||"ScatterChart"!==h&&"axis"!==a)return null;var y=vz;if("ScatterChart"===h)o=u,y=Ez;else if("BarChart"===h)o=function(e,t,r,n){var o=n/2;return{stroke:"none",fill:"#ccc",x:"horizontal"===e?t.x-o:r.left+.5,y:"horizontal"===e?r.top+.5:t.y-o,width:"horizontal"===e?n:r.width-1,height:"horizontal"===e?r.height-1:n}}(p,u,c,d),y=PP;else if("radial"===p){var v=jz(u),g=v.cx,b=v.cy,w=v.radius;o={cx:g,cy:b,startAngle:v.startAngle,endAngle:v.endAngle,innerRadius:w,outerRadius:w},y=kI}else o={points:Pz(p,u,c)},y=vz;var x=Az(Az(Az(Az({stroke:"#ccc",pointerEvents:"none"},c),o),pO(m,!1)),{},{payload:l,payloadIndex:f,className:gt("recharts-tooltip-cursor",m.className)});return(0,r.isValidElement)(m)?(0,r.cloneElement)(m,x):(0,r.createElement)(y,x)}var Mz=["item"],Rz=["children","className","width","height","style","compact","title","desc"];function Lz(e){return Lz="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},Lz(e)}function Iz(){return Iz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Iz.apply(this,arguments)}function Dz(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||Wz(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.")}()}function Fz(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function zz(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yz(n.key),n)}}function Bz(e,t,r){return t=$z(t),function(e,t){if(t&&("object"===Lz(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Vz()?Reflect.construct(t,r||[],$z(e).constructor):t.apply(e,r))}function Vz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vz=function(){return!!e})()}function $z(e){return $z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$z(e)}function Uz(e,t){return Uz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Uz(e,t)}function Gz(e){return function(e){if(Array.isArray(e))return qz(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wz(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.")}()}function Wz(e,t){if(e){if("string"==typeof e)return qz(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qz(e,t):void 0}}function qz(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Hz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Zz(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hz(Object(r),!0).forEach((function(t){Kz(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hz(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Kz(e,t,r){return(t=Yz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yz(e){var t=function(e,t){if("object"!=Lz(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Lz(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Lz(t)?t:t+""}var Xz={xAxis:["bottom","top"],yAxis:["left","right"]},Qz={width:"100%",height:"100%"},Jz={x:0,y:0};function eB(e){return e}var tB=function(e,t){var r=t.graphicalItems,n=t.dataStartIndex,o=t.dataEndIndex,i=(null!=r?r:[]).reduce((function(e,t){var r=t.props.data;return r&&r.length?[].concat(Gz(e),Gz(r)):e}),[]);return i.length>0?i:e&&e.length&&C_(n)&&C_(o)?e.slice(n,o+1):[]};function rB(e){return"number"===e?[0,"auto"]:void 0}var nB=function(e,t,r,n){var o=e.graphicalItems,i=e.tooltipAxis,a=tB(t,e);return r<0||!o||!o.length||r>=a.length?null:o.reduce((function(o,s){var u,l,c=null!==(u=s.props.data)&&void 0!==u?u:t;(c&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=r&&(c=c.slice(e.dataStartIndex,e.dataEndIndex+1)),i.dataKey&&!i.allowDuplicatedCategory)?l=I_(void 0===c?a:c,i.dataKey,n):l=c&&c[r]||a[r];return l?[].concat(Gz(o),[JR(s,l)]):o}),[])},oB=function(e,t,r,n){var o=n||{x:e.chartX,y:e.chartY},i=function(e,t){return"horizontal"===t?e.x:"vertical"===t?e.y:"centric"===t?e.angle:e.radius}(o,r),a=e.orderedTooltipTicks,s=e.tooltipAxis,u=e.tooltipTicks,l=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=-1,a=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(a<=1)return 0;if(o&&"angleAxis"===o.axisType&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var s=o.range,u=0;u<a;u++){var l=u>0?n[u-1].coordinate:n[a-1].coordinate,c=n[u].coordinate,f=u>=a-1?n[0].coordinate:n[u+1].coordinate,d=void 0;if(P_(c-l)!==P_(f-c)){var p=[];if(P_(f-c)===P_(s[1]-s[0])){d=f;var h=c+s[1]-s[0];p[0]=Math.min(h,(h+l)/2),p[1]=Math.max(h,(h+l)/2)}else{d=l;var m=f+s[1]-s[0];p[0]=Math.min(c,(m+c)/2),p[1]=Math.max(c,(m+c)/2)}var y=[Math.min(c,(d+c)/2),Math.max(c,(d+c)/2)];if(e>y[0]&&e<=y[1]||e>=p[0]&&e<=p[1]){i=n[u].index;break}}else{var v=Math.min(l,f),g=Math.max(l,f);if(e>(v+c)/2&&e<=(g+c)/2){i=n[u].index;break}}}else for(var b=0;b<a;b++)if(0===b&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b>0&&b<a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b===a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){i=r[b].index;break}return i}(i,a,u,s);if(l>=0&&u){var c=u[l]&&u[l].value,f=nB(e,t,l,c),d=function(e,t,r,n){var o=t.find((function(e){return e&&e.index===r}));if(o){if("horizontal"===e)return{x:o.coordinate,y:n.y};if("vertical"===e)return{x:n.x,y:o.coordinate};if("centric"===e){var i=o.coordinate,a=n.radius;return Zz(Zz(Zz({},n),SL(n.cx,n.cy,a,i)),{},{angle:i,radius:a})}var s=o.coordinate,u=n.angle;return Zz(Zz(Zz({},n),SL(n.cx,n.cy,s,u)),{},{angle:u,radius:s})}return Jz}(r,a,l,o);return{activeTooltipIndex:l,activeLabel:c,activePayload:f,activeCoordinate:d}}return null},iB=function(e,t){var r=t.axes,n=t.graphicalItems,o=t.axisType,i=t.axisIdKey,a=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,l=e.layout,c=e.children,f=e.stackOffset,d=DR(l,o);return r.reduce((function(t,r){var p,h=void 0!==r.type.defaultProps?Zz(Zz({},r.type.defaultProps),r.props):r.props,m=h.type,y=h.dataKey,v=h.allowDataOverflow,g=h.allowDuplicatedCategory,b=h.scale,w=h.ticks,x=h.includeHidden,_=h[i];if(t[_])return t;var O,S,E,j=tB(e.data,{graphicalItems:n.filter((function(e){var t;return(i in e.props?e.props[i]:null===(t=e.type.defaultProps)||void 0===t?void 0:t[i])===_})),dataStartIndex:s,dataEndIndex:u}),P=j.length;(function(e,t,r){if("number"===r&&!0===t&&Array.isArray(e)){var n=null==e?void 0:e[0],o=null==e?void 0:e[1];if(n&&o&&C_(n)&&C_(o))return!0}return!1})(h.domain,v,m)&&(O=YR(h.domain,null,v),!d||"number"!==m&&"auto"===b||(E=MR(j,y,"category")));var k=rB(m);if(!O||0===O.length){var C,A=null!==(C=h.domain)&&void 0!==C?C:k;if(y){if(O=MR(j,y,m),"category"===m&&d){var N=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++){if(r[e[n]])return!0;r[e[n]]=!0}return!1}(O);g&&N?(S=O,O=EO()(0,P)):g||(O=QR(A,O,r).reduce((function(e,t){return e.indexOf(t)>=0?e:[].concat(Gz(e),[t])}),[]))}else if("category"===m)O=g?O.filter((function(e){return""!==e&&!z_()(e)})):QR(A,O,r).reduce((function(e,t){return e.indexOf(t)>=0||""===t||z_()(t)?e:[].concat(Gz(e),[t])}),[]);else if("number"===m){var T=function(e,t,r,n,o){var i=t.map((function(t){return LR(e,t,r,o,n)})).filter((function(e){return!z_()(e)}));return i&&i.length?i.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]):null}(j,n.filter((function(e){var t,r,n=i in e.props?e.props[i]:null===(t=e.type.defaultProps)||void 0===t?void 0:t[i],o="hide"in e.props?e.props.hide:null===(r=e.type.defaultProps)||void 0===r?void 0:r.hide;return n===_&&(x||!o)})),y,o,l);T&&(O=T)}!d||"number"!==m&&"auto"===b||(E=MR(j,y,"category"))}else O=d?EO()(0,P):a&&a[_]&&a[_].hasStack&&"number"===m?"expand"===f?[0,1]:HR(a[_].stackGroups,s,u):IR(j,n.filter((function(e){var t=i in e.props?e.props[i]:e.type.defaultProps[i],r="hide"in e.props?e.props.hide:e.type.defaultProps.hide;return t===_&&(x||!r)})),m,l,!0);if("number"===m)O=CF(c,O,_,o,w),A&&(O=YR(A,O,v));else if("category"===m&&A){var M=A;O.every((function(e){return M.indexOf(e)>=0}))&&(O=M)}}return Zz(Zz({},t),{},Kz({},_,Zz(Zz({},h),{},{axisType:o,domain:O,categoricalDomain:E,duplicateDomain:S,originalDomain:null!==(p=h.domain)&&void 0!==p?p:k,isCategorical:d,layout:l})))}),{})},aB=function(e,t){var r=t.axisType,n=void 0===r?"xAxis":r,o=t.AxisComp,i=t.graphicalItems,a=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,l=e.children,c="".concat(n,"Id"),f=uO(l,o),d={};return f&&f.length?d=iB(e,{axes:f,graphicalItems:i,axisType:n,axisIdKey:c,stackGroups:a,dataStartIndex:s,dataEndIndex:u}):i&&i.length&&(d=function(e,t){var r=t.graphicalItems,n=t.Axis,o=t.axisType,i=t.axisIdKey,a=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,l=e.layout,c=e.children,f=tB(e.data,{graphicalItems:r,dataStartIndex:s,dataEndIndex:u}),d=f.length,p=DR(l,o),h=-1;return r.reduce((function(e,t){var m,y=(void 0!==t.type.defaultProps?Zz(Zz({},t.type.defaultProps),t.props):t.props)[i],v=rB("number");return e[y]?e:(h++,p?m=EO()(0,d):a&&a[y]&&a[y].hasStack?(m=HR(a[y].stackGroups,s,u),m=CF(c,m,y,o)):(m=YR(v,IR(f,r.filter((function(e){var t,r,n=i in e.props?e.props[i]:null===(t=e.type.defaultProps)||void 0===t?void 0:t[i],o="hide"in e.props?e.props.hide:null===(r=e.type.defaultProps)||void 0===r?void 0:r.hide;return n===y&&!o})),"number",l),n.defaultProps.allowDataOverflow),m=CF(c,m,y,o)),Zz(Zz({},e),{},Kz({},y,Zz(Zz({axisType:o},n.defaultProps),{},{hide:!0,orientation:S_()(Xz,"".concat(o,".").concat(h%2),null),domain:m,originalDomain:v,isCategorical:p,layout:l}))))}),{})}(e,{Axis:o,graphicalItems:i,axisType:n,axisIdKey:c,stackGroups:a,dataStartIndex:s,dataEndIndex:u})),d},sB=function(e){var t=e.children,r=e.defaultShowTooltip,n=lO(t,vL),o=0,i=0;return e.data&&0!==e.data.length&&(i=e.data.length-1),n&&n.props&&(n.props.startIndex>=0&&(o=n.props.startIndex),n.props.endIndex>=0&&(i=n.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:i,activeTooltipIndex:-1,isTooltipActive:Boolean(r)}},uB=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},lB=function(e,t){var r=e.props,n=(e.graphicalItems,e.xAxisMap),o=void 0===n?{}:n,i=e.yAxisMap,a=void 0===i?{}:i,s=r.width,u=r.height,l=r.children,c=r.margin||{},f=lO(l,vL),d=lO(l,zE),p=Object.keys(a).reduce((function(e,t){var r=a[t],n=r.orientation;return r.mirror||r.hide?e:Zz(Zz({},e),{},Kz({},n,e[n]+r.width))}),{left:c.left||0,right:c.right||0}),h=Object.keys(o).reduce((function(e,t){var r=o[t],n=r.orientation;return r.mirror||r.hide?e:Zz(Zz({},e),{},Kz({},n,S_()(e,"".concat(n))+r.height))}),{top:c.top||0,bottom:c.bottom||0}),m=Zz(Zz({},h),p),y=m.bottom;f&&(m.bottom+=f.props.height||vL.defaultProps.height),d&&t&&(m=function(e,t,r,n){var o=r.children,i=r.width,a=r.margin,s=i-(a.left||0)-(a.right||0),u=ER({children:o,legendWidth:s});if(u){var l=n||{},c=l.width,f=l.height,d=u.align,p=u.verticalAlign,h=u.layout;if(("vertical"===h||"horizontal"===h&&"middle"===p)&&"center"!==d&&C_(e[d]))return AR(AR({},e),{},NR({},d,e[d]+(c||0)));if(("horizontal"===h||"vertical"===h&&"center"===d)&&"middle"!==p&&C_(e[p]))return AR(AR({},e),{},NR({},p,e[p]+(f||0)))}return e}(m,0,r,t));var v=s-m.left-m.right,g=u-m.top-m.bottom;return Zz(Zz({brushBottom:y},m),{},{width:Math.max(v,0),height:Math.max(g,0)})},cB=function(e,t){return"xAxis"===t?e[t].width:"yAxis"===t?e[t].height:void 0},fB=["type","layout","connectNulls","ref"],dB=["key"];function pB(e){return pB="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},pB(e)}function hB(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function mB(){return mB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mB.apply(this,arguments)}function yB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yB(Object(r),!0).forEach((function(t){EB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function gB(e){return function(e){if(Array.isArray(e))return bB(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return bB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bB(e,t)}(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.")}()}function bB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function wB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,jB(n.key),n)}}function xB(e,t,r){return t=OB(t),function(e,t){if(t&&("object"===pB(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,_B()?Reflect.construct(t,r||[],OB(e).constructor):t.apply(e,r))}function _B(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_B=function(){return!!e})()}function OB(e){return OB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},OB(e)}function SB(e,t){return SB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},SB(e,t)}function EB(e,t,r){return(t=jB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jB(e){var t=function(e,t){if("object"!=pB(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=pB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pB(t)?t:t+""}var PB=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return EB(e=xB(this,t,[].concat(n)),"state",{isAnimationFinished:!0,totalLength:0}),EB(e,"generateSimpleStrokeDasharray",(function(e,t){return"".concat(t,"px ").concat(e-t,"px")})),EB(e,"getStrokeDasharray",(function(r,n,o){var i=o.reduce((function(e,t){return e+t}));if(!i)return e.generateSimpleStrokeDasharray(n,r);for(var a=Math.floor(r/i),s=r%i,u=n-r,l=[],c=0,f=0;c<o.length;f+=o[c],++c)if(f+o[c]>s){l=[].concat(gB(o.slice(0,c)),[s-f]);break}var d=l.length%2==0?[0,u]:[u];return[].concat(gB(t.repeat(o,a)),gB(l),d).map((function(e){return"".concat(e,"px")})).join(", ")})),EB(e,"id",T_("recharts-line-")),EB(e,"pathRef",(function(t){e.mainCurve=t})),EB(e,"handleAnimationEnd",(function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()})),EB(e,"handleAnimationStart",(function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()})),e}return function(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&&SB(e,t)}(t,e),r=t,n=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.points,o=r.xAxis,a=r.yAxis,s=r.layout,u=uO(r.children,wR);if(!u)return null;var l=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:TR(e.payload,t)}},c={clipPath:e?"url(#clipPath-".concat(t,")"):null};return i().createElement(DO,c,u.map((function(e){return i().cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:n,xAxis:o,yAxis:a,layout:s,dataPointFormatter:l})})))}},{key:"renderDots",value:function(e,r,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.dot,s=o.points,u=o.dataKey,l=pO(this.props,!1),c=pO(a,!0),f=s.map((function(e,r){var n=vB(vB(vB({key:"dot-".concat(r),r:3},l),c),{},{value:e.value,dataKey:u,cx:e.x,cy:e.y,index:r,payload:e.payload});return t.renderDotItem(a,n)})),d={clipPath:e?"url(#clipPath-".concat(r?"":"dots-").concat(n,")"):null};return i().createElement(DO,mB({className:"recharts-line-dots",key:"dots"},d),f)}},{key:"renderCurveStatically",value:function(e,t,r,n){var o=this.props,a=o.type,s=o.layout,u=o.connectNulls,l=(o.ref,hB(o,fB)),c=vB(vB(vB({},pO(l,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(r,")"):null,points:e},n),{},{type:a,layout:s,connectNulls:u});return i().createElement(vz,mB({},c,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var r=this,n=this.props,o=n.points,a=n.strokeDasharray,s=n.isAnimationActive,u=n.animationBegin,l=n.animationDuration,c=n.animationEasing,f=n.animationId,d=n.animateNewValues,p=n.width,h=n.height,m=this.state,y=m.prevPoints,v=m.totalLength;return i().createElement(yP,{begin:u,duration:l,isActive:s,easing:c,from:{t:0},to:{t:1},key:"line-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(n){var i=n.t;if(y){var s=y.length/o.length,u=o.map((function(e,t){var r=Math.floor(t*s);if(y[r]){var n=y[r],o=L_(n.x,e.x),a=L_(n.y,e.y);return vB(vB({},e),{},{x:o(i),y:a(i)})}if(d){var u=L_(2*p,e.x),l=L_(h/2,e.y);return vB(vB({},e),{},{x:u(i),y:l(i)})}return vB(vB({},e),{},{x:e.x,y:e.y})}));return r.renderCurveStatically(u,e,t)}var l,c=L_(0,v)(i);if(a){var f="".concat(a).split(/[,\s]+/gim).map((function(e){return parseFloat(e)}));l=r.getStrokeDasharray(c,v,f)}else l=r.generateSimpleStrokeDasharray(v,c);return r.renderCurveStatically(o,e,t,{strokeDasharray:l})}))}},{key:"renderCurve",value:function(e,t){var r=this.props,n=r.points,o=r.isAnimationActive,i=this.state,a=i.prevPoints,s=i.totalLength;return o&&n&&n.length&&(!a&&s>0||!NM()(a,n))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(n,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,n=t.dot,o=t.points,a=t.className,s=t.xAxis,u=t.yAxis,l=t.top,c=t.left,f=t.width,d=t.height,p=t.isAnimationActive,h=t.id;if(r||!o||!o.length)return null;var m=this.state.isAnimationFinished,y=1===o.length,v=gt("recharts-line",a),g=s&&s.allowDataOverflow,b=u&&u.allowDataOverflow,w=g||b,x=z_()(h)?this.id:h,_=null!==(e=pO(n,!1))&&void 0!==e?e:{r:3,strokeWidth:2},O=_.r,S=void 0===O?3:O,E=_.strokeWidth,j=void 0===E?2:E,P=(function(e){return e&&"object"===rO(e)&&"clipDot"in e}(n)?n:{}).clipDot,k=void 0===P||P,C=2*S+j;return i().createElement(DO,{className:v},g||b?i().createElement("defs",null,i().createElement("clipPath",{id:"clipPath-".concat(x)},i().createElement("rect",{x:g?c:c-f/2,y:b?l:l-d/2,width:g?f:2*f,height:b?d:2*d})),!k&&i().createElement("clipPath",{id:"clipPath-dots-".concat(x)},i().createElement("rect",{x:c-C/2,y:l-C/2,width:f+C,height:d+C}))):null,!y&&this.renderCurve(w,x),this.renderErrorBar(w,x),(y||n)&&this.renderDots(w,k,x),(!p||m)&&iI.renderCallByParent(this.props,o))}}],o=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var r=e.length%2!=0?[].concat(gB(e),[0]):e,n=[],o=0;o<t;++o)n=[].concat(gB(n),gB(r));return n}},{key:"renderDotItem",value:function(e,t){var r;if(i().isValidElement(e))r=i().cloneElement(e,t);else if(V_()(e))r=e(t);else{var n=t.key,o=hB(t,dB),a=gt("recharts-line-dot","boolean"!=typeof e?e.className:"");r=i().createElement(VE,mB({key:n},o,{className:a}))}return r}}],n&&wB(r.prototype,n),o&&wB(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.PureComponent);function kB(e,t,r){if(t<1)return[];if(1===t&&void 0===r)return e;for(var n=[],o=0;o<e.length;o+=t){if(void 0!==r&&!0!==r(e[o]))return;n.push(e[o])}return n}function CB(e,t,r){return function(e){var t=e.width,r=e.height,n=function(e){return(e%180+180)%180}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0),o=n*Math.PI/180,i=Math.atan(r/t),a=o>i&&o<Math.PI-i?r/Math.sin(o):t/Math.cos(o);return Math.abs(a)}({width:e.width+t.width,height:e.height+t.height},r)}function AB(e,t,r,n,o){if(e*t<e*n||e*t>e*o)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-o)<=0}function NB(e){return NB="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},NB(e)}function TB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function MB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?TB(Object(r),!0).forEach((function(t){RB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function RB(e,t,r){return t=function(e){var t=function(e,t){if("object"!=NB(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=NB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==NB(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LB(e,t,r){var n=e.tick,o=e.ticks,i=e.viewBox,a=e.minTickGap,s=e.orientation,u=e.interval,l=e.tickFormatter,c=e.unit,f=e.angle;if(!o||!o.length||!n)return[];if(C_(u)||cS.isSsr)return function(e,t){return kB(e,t+1)}(o,"number"==typeof u&&C_(u)?u:0);var d=[],p="top"===s||"bottom"===s?"width":"height",h=c&&"width"===p?HP(c,{fontSize:t,letterSpacing:r}):{width:0,height:0},m=function(e,n){var o=V_()(l)?l(e.value,n):e.value;return"width"===p?CB(HP(o,{fontSize:t,letterSpacing:r}),h,f):HP(o,{fontSize:t,letterSpacing:r})[p]},y=o.length>=2?P_(o[1].coordinate-o[0].coordinate):1,v=function(e,t,r){var n="width"===r,o=e.x,i=e.y,a=e.width,s=e.height;return 1===t?{start:n?o:i,end:n?o+a:i+s}:{start:n?o+a:i+s,end:n?o:i}}(i,y,p);return"equidistantPreserveStart"===u?function(e,t,r,n,o){for(var i,a=(n||[]).slice(),s=t.start,u=t.end,l=0,c=1,f=s,d=function(){var t=null==n?void 0:n[l];if(void 0===t)return{v:kB(n,c)};var i,a=l,d=function(){return void 0===i&&(i=r(t,a)),i},p=t.coordinate,h=0===l||AB(e,p,d,f,u);h||(l=0,f=s,c+=1),h&&(f=p+e*(d()/2+o),l+=c)};c<=a.length;)if(i=d())return i.v;return[]}(y,v,m,o,a):(d="preserveStart"===u||"preserveStartEnd"===u?function(e,t,r,n,o,i){var a=(n||[]).slice(),s=a.length,u=t.start,l=t.end;if(i){var c=n[s-1],f=r(c,s-1),d=e*(c.coordinate+e*f/2-l);a[s-1]=c=MB(MB({},c),{},{tickCoord:d>0?c.coordinate-d*e:c.coordinate}),AB(e,c.tickCoord,(function(){return f}),u,l)&&(l=c.tickCoord-e*(f/2+o),a[s-1]=MB(MB({},c),{},{isShow:!0}))}for(var p=i?s-1:s,h=function(t){var n,i=a[t],s=function(){return void 0===n&&(n=r(i,t)),n};if(0===t){var c=e*(i.coordinate-e*s()/2-u);a[t]=i=MB(MB({},i),{},{tickCoord:c<0?i.coordinate-c*e:i.coordinate})}else a[t]=i=MB(MB({},i),{},{tickCoord:i.coordinate});AB(e,i.tickCoord,s,u,l)&&(u=i.tickCoord+e*(s()/2+o),a[t]=MB(MB({},i),{},{isShow:!0}))},m=0;m<p;m++)h(m);return a}(y,v,m,o,a,"preserveStartEnd"===u):function(e,t,r,n,o){for(var i=(n||[]).slice(),a=i.length,s=t.start,u=t.end,l=function(t){var n,l=i[t],c=function(){return void 0===n&&(n=r(l,t)),n};if(t===a-1){var f=e*(l.coordinate+e*c()/2-u);i[t]=l=MB(MB({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else i[t]=l=MB(MB({},l),{},{tickCoord:l.coordinate});AB(e,l.tickCoord,c,s,u)&&(u=l.tickCoord-e*(c()/2+o),i[t]=MB(MB({},l),{},{isShow:!0}))},c=a-1;c>=0;c--)l(c);return i}(y,v,m,o,a),d.filter((function(e){return e.isShow})))}EB(PB,"displayName","Line"),EB(PB,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!cS.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),EB(PB,"getComposedData",(function(e){var t=e.props,r=e.xAxis,n=e.yAxis,o=e.xAxisTicks,i=e.yAxisTicks,a=e.dataKey,s=e.bandSize,u=e.displayedData,l=e.offset,c=t.layout,f=u.map((function(e,t){var u=TR(e,a);return"horizontal"===c?{x:WR({axis:r,ticks:o,bandSize:s,entry:e,index:t}),y:z_()(u)?null:n.scale(u),value:u,payload:e}:{x:z_()(u)?null:r.scale(u),y:WR({axis:n,ticks:i,bandSize:s,entry:e,index:t}),value:u,payload:e}}));return vB({points:f,layout:c},l)}));var IB=["viewBox"],DB=["viewBox"],FB=["ticks"];function zB(e){return zB="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},zB(e)}function BB(){return BB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BB.apply(this,arguments)}function VB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?VB(Object(r),!0).forEach((function(t){KB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function UB(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function GB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,YB(n.key),n)}}function WB(e,t,r){return t=HB(t),function(e,t){if(t&&("object"===zB(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qB()?Reflect.construct(t,r||[],HB(e).constructor):t.apply(e,r))}function qB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qB=function(){return!!e})()}function HB(e){return HB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},HB(e)}function ZB(e,t){return ZB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ZB(e,t)}function KB(e,t,r){return(t=YB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YB(e){var t=function(e,t){if("object"!=zB(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=zB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zB(t)?t:t+""}var XB=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=WB(this,t,[e])).state={fontSize:"",letterSpacing:""},r}return function(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&&ZB(e,t)}(t,e),r=t,n=[{key:"shouldComponentUpdate",value:function(e,t){var r=e.viewBox,n=UB(e,IB),o=this.props,i=o.viewBox,a=UB(o,DB);return!W_(r,i)||!W_(n,a)||!W_(t,this.state)}},{key:"componentDidMount",value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:"getTickLineCoord",value:function(e){var t,r,n,o,i,a,s=this.props,u=s.x,l=s.y,c=s.width,f=s.height,d=s.orientation,p=s.tickSize,h=s.mirror,m=s.tickMargin,y=h?-1:1,v=e.tickSize||p,g=C_(e.tickCoord)?e.tickCoord:e.coordinate;switch(d){case"top":t=r=e.coordinate,a=(n=(o=l+ +!h*f)-y*v)-y*m,i=g;break;case"left":n=o=e.coordinate,i=(t=(r=u+ +!h*c)-y*v)-y*m,a=g;break;case"right":n=o=e.coordinate,i=(t=(r=u+ +h*c)+y*v)+y*m,a=g;break;default:t=r=e.coordinate,a=(n=(o=l+ +h*f)+y*v)+y*m,i=g}return{line:{x1:t,y1:n,x2:r,y2:o},tick:{x:i,y:a}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,r=t.orientation,n=t.mirror;switch(r){case"left":e=n?"start":"end";break;case"right":e=n?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,r=e.mirror,n="end";switch(t){case"left":case"right":n="middle";break;case"top":n=r?"start":"end";break;default:n=r?"end":"start"}return n}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,o=e.height,a=e.orientation,s=e.mirror,u=e.axisLine,l=$B($B($B({},pO(this.props,!1)),pO(u,!1)),{},{fill:"none"});if("top"===a||"bottom"===a){var c=+("top"===a&&!s||"bottom"===a&&s);l=$B($B({},l),{},{x1:t,y1:r+c*o,x2:t+n,y2:r+c*o})}else{var f=+("left"===a&&!s||"right"===a&&s);l=$B($B({},l),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+o})}return i().createElement("line",BB({},l,{className:gt("recharts-cartesian-axis-line",S_()(u,"className"))}))}},{key:"renderTicks",value:function(e,r,n){var o=this,a=this.props,s=a.tickLine,u=a.stroke,l=a.tick,c=a.tickFormatter,f=a.unit,d=LB($B($B({},this.props),{},{ticks:e}),r,n),p=this.getTickTextAnchor(),h=this.getTickVerticalAnchor(),m=pO(this.props,!1),y=pO(l,!1),v=$B($B({},m),{},{fill:"none"},pO(s,!1)),g=d.map((function(e,r){var n=o.getTickLineCoord(e),a=n.line,g=n.tick,b=$B($B($B($B({textAnchor:p,verticalAnchor:h},m),{},{stroke:"none",fill:u},y),g),{},{index:r,payload:e,visibleTicksCount:d.length,tickFormatter:c});return i().createElement(DO,BB({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e.value,"-").concat(e.coordinate,"-").concat(e.tickCoord)},Q_(o.props,e,r)),s&&i().createElement("line",BB({},v,a,{className:gt("recharts-cartesian-axis-tick-line",S_()(s,"className"))})),l&&t.renderTickItem(l,b,"".concat(V_()(c)?c(e.value,r):e.value).concat(f||"")))}));return i().createElement("g",{className:"recharts-cartesian-axis-ticks"},g)}},{key:"render",value:function(){var e=this,t=this.props,r=t.axisLine,n=t.width,o=t.height,a=t.ticksGenerator,s=t.className;if(t.hide)return null;var u=this.props,l=u.ticks,c=UB(u,FB),f=l;return V_()(a)&&(f=l&&l.length>0?a(this.props):a(c)),n<=0||o<=0||!f||!f.length?null:i().createElement(DO,{className:gt("recharts-cartesian-axis",s),ref:function(t){e.layerReference=t}},r&&this.renderAxisLine(),this.renderTicks(f,this.state.fontSize,this.state.letterSpacing),FL.renderCallByParent(this.props))}}],o=[{key:"renderTickItem",value:function(e,t,r){return i().isValidElement(e)?i().cloneElement(e,t):V_()(e)?e(t):i().createElement(_k,BB({},t,{className:"recharts-cartesian-axis-tick-value"}),r)}}],n&&GB(r.prototype,n),o&&GB(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.Component);function QB(e){return QB="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},QB(e)}function JB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,iV(n.key),n)}}function eV(e,t,r){return t=rV(t),function(e,t){if(t&&("object"===QB(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,tV()?Reflect.construct(t,r||[],rV(e).constructor):t.apply(e,r))}function tV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tV=function(){return!!e})()}function rV(e){return rV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rV(e)}function nV(e,t){return nV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nV(e,t)}function oV(e,t,r){return(t=iV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iV(e){var t=function(e,t){if("object"!=QB(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=QB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==QB(t)?t:t+""}function aV(){return aV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aV.apply(this,arguments)}function sV(e){var t=e.xAxisId,r=QD(),n=JD(),o=YD(t);return null==o?null:i().createElement(XB,aV({},o,{className:gt("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(e){return zR(e,!0)}}))}KB(XB,"displayName","CartesianAxis"),KB(XB,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var uV=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),eV(this,t,arguments)}return function(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&&nV(e,t)}(t,e),r=t,(n=[{key:"render",value:function(){return i().createElement(sV,this.props)}}])&&JB(r.prototype,n),o&&JB(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(i().Component);function lV(e){return lV="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},lV(e)}function cV(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yV(n.key),n)}}function fV(e,t,r){return t=pV(t),function(e,t){if(t&&("object"===lV(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,dV()?Reflect.construct(t,r||[],pV(e).constructor):t.apply(e,r))}function dV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dV=function(){return!!e})()}function pV(e){return pV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pV(e)}function hV(e,t){return hV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hV(e,t)}function mV(e,t,r){return(t=yV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yV(e){var t=function(e,t){if("object"!=lV(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=lV(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==lV(t)?t:t+""}function vV(){return vV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vV.apply(this,arguments)}oV(uV,"displayName","XAxis"),oV(uV,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});var gV=function(e){var t=e.yAxisId,r=QD(),n=JD(),o=XD(t);return null==o?null:i().createElement(XB,vV({},o,{className:gt("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(e){return zR(e,!0)}}))},bV=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),fV(this,t,arguments)}return function(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&&hV(e,t)}(t,e),r=t,(n=[{key:"render",value:function(){return i().createElement(gV,this.props)}}])&&cV(r.prototype,n),o&&cV(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(i().Component);mV(bV,"displayName","YAxis"),mV(bV,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});var wV=function(e){var t=e.chartName,n=e.GraphicalChild,o=e.defaultTooltipEventType,a=void 0===o?"axis":o,s=e.validateTooltipEventTypes,u=void 0===s?["axis"]:s,l=e.axisComponents,c=e.legendContent,f=e.formatAxisMap,d=e.defaultProps,p=function(e,t){var r=t.graphicalItems,n=t.stackGroups,o=t.offset,i=t.updateId,a=t.dataStartIndex,s=t.dataEndIndex,u=e.barSize,c=e.layout,f=e.barGap,d=e.barCategoryGap,p=e.maxBarSize,h=uB(c),m=h.numericAxisName,y=h.cateAxisName,v=function(e){return!(!e||!e.length)&&e.some((function(e){var t=oO(e&&e.type);return t&&t.indexOf("Bar")>=0}))}(r),g=[];return r.forEach((function(r,h){var b=tB(e.data,{graphicalItems:[r],dataStartIndex:a,dataEndIndex:s}),w=void 0!==r.type.defaultProps?Zz(Zz({},r.type.defaultProps),r.props):r.props,x=w.dataKey,_=w.maxBarSize,O=w["".concat(m,"Id")],S=w["".concat(y,"Id")],E=l.reduce((function(e,r){var n=t["".concat(r.axisType,"Map")],o=w["".concat(r.axisType,"Id")];n&&n[o]||"zAxis"===r.axisType||CO(!1);var i=n[o];return Zz(Zz({},e),{},Kz(Kz({},r.axisType,i),"".concat(r.axisType,"Ticks"),zR(i)))}),{}),j=E[y],P=E["".concat(y,"Ticks")],k=n&&n[O]&&n[O].hasStack&&function(e,t){var r,n=(null!==(r=e.type)&&void 0!==r&&r.defaultProps?AR(AR({},e.type.defaultProps),e.props):e.props).stackId;if(A_(n)){var o=t[n];if(o){var i=o.items.indexOf(e);return i>=0?o.stackedData[i]:null}}return null}(r,n[O].stackGroups),C=oO(r.type).indexOf("Bar")>=0,A=XR(j,P),N=[],T=v&&function(e){var t=e.barSize,r=e.totalSize,n=e.stackGroups,o=void 0===n?{}:n;if(!o)return{};for(var i={},a=Object.keys(o),s=0,u=a.length;s<u;s++)for(var l=o[a[s]].stackGroups,c=Object.keys(l),f=0,d=c.length;f<d;f++){var p=l[c[f]],h=p.items,m=p.cateAxisId,y=h.filter((function(e){return oO(e.type).indexOf("Bar")>=0}));if(y&&y.length){var v=y[0].type.defaultProps,g=void 0!==v?AR(AR({},v),y[0].props):y[0].props,b=g.barSize,w=g[m];i[w]||(i[w]=[]);var x=z_()(b)?t:b;i[w].push({item:y[0],stackList:y.slice(1),barSize:z_()(x)?void 0:M_(x,r,0)})}}return i}({barSize:u,stackGroups:n,totalSize:cB(E,y)});if(C){var M,R,L=z_()(_)?p:_,I=null!==(M=null!==(R=XR(j,P,!0))&&void 0!==R?R:L)&&void 0!==M?M:0;N=function(e){var t=e.barGap,r=e.barCategoryGap,n=e.bandSize,o=e.sizeList,i=void 0===o?[]:o,a=e.maxBarSize,s=i.length;if(s<1)return null;var u,l=M_(t,n,0,!0),c=[];if(i[0].barSize===+i[0].barSize){var f=!1,d=n/s,p=i.reduce((function(e,t){return e+t.barSize||0}),0);(p+=(s-1)*l)>=n&&(p-=(s-1)*l,l=0),p>=n&&d>0&&(f=!0,p=s*(d*=.9));var h={offset:((n-p)/2|0)-l,size:0};u=i.reduce((function(e,t){var r={item:t.item,position:{offset:h.offset+h.size+l,size:f?d:t.barSize}},n=[].concat(PR(e),[r]);return h=n[n.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:h})})),n}),c)}else{var m=M_(r,n,0,!0);n-2*m-(s-1)*l<=0&&(l=0);var y=(n-2*m-(s-1)*l)/s;y>1&&(y>>=0);var v=a===+a?Math.min(y,a):y;u=i.reduce((function(e,t,r){var n=[].concat(PR(e),[{item:t.item,position:{offset:m+(y+l)*r+(y-v)/2,size:v}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:n[n.length-1].position})})),n}),c)}return u}({barGap:f,barCategoryGap:d,bandSize:I!==A?I:A,sizeList:T[S],maxBarSize:L}),I!==A&&(N=N.map((function(e){return Zz(Zz({},e),{},{position:Zz(Zz({},e.position),{},{offset:e.position.offset-I/2})})})))}var D,F,z=r&&r.type&&r.type.getComposedData;z&&g.push({props:Zz(Zz({},z(Zz(Zz({},E),{},{displayedData:b,props:e,dataKey:x,item:r,bandSize:A,barPosition:N,offset:o,stackedData:k,layout:c,dataStartIndex:a,dataEndIndex:s}))),{},Kz(Kz(Kz({key:r.key||"item-".concat(h)},m,E[m]),y,E[y]),"animationId",i)),childIndex:(D=r,F=e.children,sO(F).indexOf(D)),item:r})})),g},h=function(e,r){var o=e.props,i=e.dataStartIndex,a=e.dataEndIndex,s=e.updateId;if(!cO({props:o}))return null;var u=o.children,c=o.layout,d=o.stackOffset,h=o.data,m=o.reverseStackOrder,y=uB(c),v=y.numericAxisName,g=y.cateAxisName,b=uO(u,n),w=function(e,t,r,n,o,i){if(!e)return null;var a=(i?t.reverse():t).reduce((function(e,t){var o,i=null!==(o=t.type)&&void 0!==o&&o.defaultProps?AR(AR({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(i.hide)return e;var s=i[r],u=e[s]||{hasStack:!1,stackGroups:{}};if(A_(a)){var l=u.stackGroups[a]||{numericAxisId:r,cateAxisId:n,items:[]};l.items.push(t),u.hasStack=!0,u.stackGroups[a]=l}else u.stackGroups[T_("_stackId_")]={numericAxisId:r,cateAxisId:n,items:[t]};return AR(AR({},e),{},NR({},s,u))}),{});return Object.keys(a).reduce((function(t,i){var s=a[i];return s.hasStack&&(s.stackGroups=Object.keys(s.stackGroups).reduce((function(t,i){var a=s.stackGroups[i];return AR(AR({},t),{},NR({},i,{numericAxisId:r,cateAxisId:n,items:a.items,stackedData:GR(e,a.items,o)}))}),{})),AR(AR({},t),{},NR({},i,s))}),{})}(h,b,"".concat(v,"Id"),"".concat(g,"Id"),d,m),x=l.reduce((function(e,t){var r="".concat(t.axisType,"Map");return Zz(Zz({},e),{},Kz({},r,aB(o,Zz(Zz({},t),{},{graphicalItems:b,stackGroups:t.axisType===v&&w,dataStartIndex:i,dataEndIndex:a}))))}),{}),_=lB(Zz(Zz({},x),{},{props:o,graphicalItems:b}),null==r?void 0:r.legendBBox);Object.keys(x).forEach((function(e){x[e]=f(o,x[e],_,e.replace("Map",""),t)}));var O,S,E=x["".concat(g,"Map")],j=(O=R_(E),{tooltipTicks:S=zR(O,!1,!0),orderedTooltipTicks:PO()(S,(function(e){return e.coordinate})),tooltipAxis:O,tooltipAxisBandSize:XR(O,S)}),P=p(o,Zz(Zz({},x),{},{dataStartIndex:i,dataEndIndex:a,updateId:s,graphicalItems:b,stackGroups:w,offset:_}));return Zz(Zz({formattedGraphicalItems:P,graphicalItems:b,offset:_,stackGroups:w},j),x)},m=function(e){function n(e){var o,a,s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),Kz(s=Bz(this,n,[e]),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Kz(s,"accessibilityManager",new DF),Kz(s,"handleLegendBBoxUpdate",(function(e){if(e){var t=s.state,r=t.dataStartIndex,n=t.dataEndIndex,o=t.updateId;s.setState(Zz({legendBBox:e},h({props:s.props,dataStartIndex:r,dataEndIndex:n,updateId:o},Zz(Zz({},s.state),{},{legendBBox:e}))))}})),Kz(s,"handleReceiveSyncEvent",(function(e,t,r){if(s.props.syncId===e){if(r===s.eventEmitterSymbol&&"function"!=typeof s.props.syncMethod)return;s.applySyncEvent(t)}})),Kz(s,"handleBrushChange",(function(e){var t=e.startIndex,r=e.endIndex;if(t!==s.state.dataStartIndex||r!==s.state.dataEndIndex){var n=s.state.updateId;s.setState((function(){return Zz({dataStartIndex:t,dataEndIndex:r},h({props:s.props,dataStartIndex:t,dataEndIndex:r,updateId:n},s.state))})),s.triggerSyncEvent({dataStartIndex:t,dataEndIndex:r})}})),Kz(s,"handleMouseEnter",(function(e){var t=s.getMouseInfo(e);if(t){var r=Zz(Zz({},t),{},{isTooltipActive:!0});s.setState(r),s.triggerSyncEvent(r);var n=s.props.onMouseEnter;V_()(n)&&n(r,e)}})),Kz(s,"triggeredAfterMouseMove",(function(e){var t=s.getMouseInfo(e),r=t?Zz(Zz({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};s.setState(r),s.triggerSyncEvent(r);var n=s.props.onMouseMove;V_()(n)&&n(r,e)})),Kz(s,"handleItemMouseEnter",(function(e){s.setState((function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}}))})),Kz(s,"handleItemMouseLeave",(function(){s.setState((function(){return{isTooltipActive:!1}}))})),Kz(s,"handleMouseMove",(function(e){e.persist(),s.throttleTriggeredAfterMouseMove(e)})),Kz(s,"handleMouseLeave",(function(e){s.throttleTriggeredAfterMouseMove.cancel();var t={isTooltipActive:!1};s.setState(t),s.triggerSyncEvent(t);var r=s.props.onMouseLeave;V_()(r)&&r(t,e)})),Kz(s,"handleOuterEvent",(function(e){var t,r=function(e){var t=e&&e.type;return t&&nO[t]?nO[t]:null}(e),n=S_()(s.props,"".concat(r));r&&V_()(n)&&n(null!==(t=/.*touch.*/i.test(r)?s.getMouseInfo(e.changedTouches[0]):s.getMouseInfo(e))&&void 0!==t?t:{},e)})),Kz(s,"handleClick",(function(e){var t=s.getMouseInfo(e);if(t){var r=Zz(Zz({},t),{},{isTooltipActive:!0});s.setState(r),s.triggerSyncEvent(r);var n=s.props.onClick;V_()(n)&&n(r,e)}})),Kz(s,"handleMouseDown",(function(e){var t=s.props.onMouseDown;V_()(t)&&t(s.getMouseInfo(e),e)})),Kz(s,"handleMouseUp",(function(e){var t=s.props.onMouseUp;V_()(t)&&t(s.getMouseInfo(e),e)})),Kz(s,"handleTouchMove",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.throttleTriggeredAfterMouseMove(e.changedTouches[0])})),Kz(s,"handleTouchStart",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.handleMouseDown(e.changedTouches[0])})),Kz(s,"handleTouchEnd",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.handleMouseUp(e.changedTouches[0])})),Kz(s,"handleDoubleClick",(function(e){var t=s.props.onDoubleClick;V_()(t)&&t(s.getMouseInfo(e),e)})),Kz(s,"handleContextMenu",(function(e){var t=s.props.onContextMenu;V_()(t)&&t(s.getMouseInfo(e),e)})),Kz(s,"triggerSyncEvent",(function(e){void 0!==s.props.syncId&&NF.emit(TF,s.props.syncId,e,s.eventEmitterSymbol)})),Kz(s,"applySyncEvent",(function(e){var t=s.props,r=t.layout,n=t.syncMethod,o=s.state.updateId,i=e.dataStartIndex,a=e.dataEndIndex;if(void 0!==e.dataStartIndex||void 0!==e.dataEndIndex)s.setState(Zz({dataStartIndex:i,dataEndIndex:a},h({props:s.props,dataStartIndex:i,dataEndIndex:a,updateId:o},s.state)));else if(void 0!==e.activeTooltipIndex){var u=e.chartX,l=e.chartY,c=e.activeTooltipIndex,f=s.state,d=f.offset,p=f.tooltipTicks;if(!d)return;if("function"==typeof n)c=n(p,e);else if("value"===n){c=-1;for(var m=0;m<p.length;m++)if(p[m].value===e.activeLabel){c=m;break}}var y=Zz(Zz({},d),{},{x:d.left,y:d.top}),v=Math.min(u,y.x+y.width),g=Math.min(l,y.y+y.height),b=p[c]&&p[c].value,w=nB(s.state,s.props.data,c),x=p[c]?{x:"horizontal"===r?p[c].coordinate:v,y:"horizontal"===r?g:p[c].coordinate}:Jz;s.setState(Zz(Zz({},e),{},{activeLabel:b,activeCoordinate:x,activePayload:w,activeTooltipIndex:c}))}else s.setState(e)})),Kz(s,"renderCursor",(function(e){var r,n=s.state,o=n.isTooltipActive,a=n.activeCoordinate,u=n.activePayload,l=n.offset,c=n.activeTooltipIndex,f=n.tooltipAxisBandSize,d=s.getTooltipEventType(),p=null!==(r=e.props.active)&&void 0!==r?r:o,h=s.props.layout,m=e.key||"_recharts-cursor";return i().createElement(Tz,{key:m,activeCoordinate:a,activePayload:u,activeTooltipIndex:c,chartName:t,element:e,isActive:p,layout:h,offset:l,tooltipAxisBandSize:f,tooltipEventType:d})})),Kz(s,"renderPolarAxis",(function(e,t,n){var o=S_()(e,"type.axisType"),i=S_()(s.state,"".concat(o,"Map")),a=e.type.defaultProps,u=void 0!==a?Zz(Zz({},a),e.props):e.props,l=i&&i[u["".concat(o,"Id")]];return(0,r.cloneElement)(e,Zz(Zz({},l),{},{className:gt(o,l.className),key:e.key||"".concat(t,"-").concat(n),ticks:zR(l,!0)}))})),Kz(s,"renderPolarGrid",(function(e){var t=e.props,n=t.radialLines,o=t.polarAngles,i=t.polarRadius,a=s.state,u=a.radiusAxisMap,l=a.angleAxisMap,c=R_(u),f=R_(l),d=f.cx,p=f.cy,h=f.innerRadius,m=f.outerRadius;return(0,r.cloneElement)(e,{polarAngles:Array.isArray(o)?o:zR(f,!0).map((function(e){return e.coordinate})),polarRadius:Array.isArray(i)?i:zR(c,!0).map((function(e){return e.coordinate})),cx:d,cy:p,innerRadius:h,outerRadius:m,key:e.key||"polar-grid",radialLines:n})})),Kz(s,"renderLegend",(function(){var e=s.state.formattedGraphicalItems,t=s.props,n=t.children,o=t.width,i=t.height,a=s.props.margin||{},u=o-(a.left||0)-(a.right||0),l=ER({children:n,formattedGraphicalItems:e,legendWidth:u,legendContent:c});if(!l)return null;var f=l.item,d=Fz(l,Mz);return(0,r.cloneElement)(f,Zz(Zz({},d),{},{chartWidth:o,chartHeight:i,margin:a,onBBoxUpdate:s.handleLegendBBoxUpdate}))})),Kz(s,"renderTooltip",(function(){var e,t=s.props,n=t.children,o=t.accessibilityLayer,i=lO(n,ES);if(!i)return null;var a=s.state,u=a.isTooltipActive,l=a.activeCoordinate,c=a.activePayload,f=a.activeLabel,d=a.offset,p=null!==(e=i.props.active)&&void 0!==e?e:u;return(0,r.cloneElement)(i,{viewBox:Zz(Zz({},d),{},{x:d.left,y:d.top}),active:p,label:f,payload:p?c:[],coordinate:l,accessibilityLayer:o})})),Kz(s,"renderBrush",(function(e){var t=s.props,n=t.margin,o=t.data,i=s.state,a=i.offset,u=i.dataStartIndex,l=i.dataEndIndex,c=i.updateId;return(0,r.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:VR(s.handleBrushChange,e.props.onChange),data:o,x:C_(e.props.x)?e.props.x:a.left,y:C_(e.props.y)?e.props.y:a.top+a.height+a.brushBottom-(n.bottom||0),width:C_(e.props.width)?e.props.width:a.width,startIndex:u,endIndex:l,updateId:"brush-".concat(c)})})),Kz(s,"renderReferenceElement",(function(e,t,n){if(!e)return null;var o=s.clipPathId,i=s.state,a=i.xAxisMap,u=i.yAxisMap,l=i.offset,c=e.type.defaultProps||{},f=e.props,d=f.xAxisId,p=void 0===d?c.xAxisId:d,h=f.yAxisId,m=void 0===h?c.yAxisId:h;return(0,r.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(n),xAxis:a[p],yAxis:u[m],viewBox:{x:l.left,y:l.top,width:l.width,height:l.height},clipPathId:o})})),Kz(s,"renderActivePoints",(function(e){var t=e.item,r=e.activePoint,o=e.basePoint,i=e.childIndex,a=e.isRange,s=[],u=t.props.key,l=void 0!==t.item.type.defaultProps?Zz(Zz({},t.item.type.defaultProps),t.item.props):t.item.props,c=l.activeDot,f=Zz(Zz({index:i,dataKey:l.dataKey,cx:r.x,cy:r.y,r:4,fill:RR(t.item),strokeWidth:2,stroke:"#fff",payload:r.payload,value:r.value},pO(c,!1)),X_(c));return s.push(n.renderActiveDot(c,f,"".concat(u,"-activePoint-").concat(i))),o?s.push(n.renderActiveDot(c,Zz(Zz({},f),{},{cx:o.x,cy:o.y}),"".concat(u,"-basePoint-").concat(i))):a&&s.push(null),s})),Kz(s,"renderGraphicChild",(function(e,t,n){var o=s.filterFormatItem(e,t,n);if(!o)return null;var i=s.getTooltipEventType(),a=s.state,u=a.isTooltipActive,l=a.tooltipAxis,c=a.activeTooltipIndex,f=a.activeLabel,d=lO(s.props.children,ES),p=o.props,h=p.points,m=p.isRange,y=p.baseLine,v=void 0!==o.item.type.defaultProps?Zz(Zz({},o.item.type.defaultProps),o.item.props):o.item.props,g=v.activeDot,b=v.hide,w=v.activeBar,x=v.activeShape,_=Boolean(!b&&u&&d&&(g||w||x)),O={};"axis"!==i&&d&&"click"===d.props.trigger?O={onClick:VR(s.handleItemMouseEnter,e.props.onClick)}:"axis"!==i&&(O={onMouseLeave:VR(s.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:VR(s.handleItemMouseEnter,e.props.onMouseEnter)});var S=(0,r.cloneElement)(e,Zz(Zz({},o.props),O));if(_){if(!(c>=0)){var E,j=(null!==(E=s.getItemByXY(s.state.activeCoordinate))&&void 0!==E?E:{graphicalItem:S}).graphicalItem,P=j.item,k=void 0===P?e:P,C=j.childIndex,A=Zz(Zz(Zz({},o.props),O),{},{activeIndex:C});return[(0,r.cloneElement)(k,A),null,null]}var N,T;if(l.dataKey&&!l.allowDuplicatedCategory){var M="function"==typeof l.dataKey?function(e){return"function"==typeof l.dataKey?l.dataKey(e.payload):null}:"payload.".concat(l.dataKey.toString());N=I_(h,M,f),T=m&&y&&I_(y,M,f)}else N=null==h?void 0:h[c],T=m&&y&&y[c];if(x||w){var R=void 0!==e.props.activeIndex?e.props.activeIndex:c;return[(0,r.cloneElement)(e,Zz(Zz(Zz({},o.props),O),{},{activeIndex:R})),null,null]}if(!z_()(N))return[S].concat(Gz(s.renderActivePoints({item:o,activePoint:N,basePoint:T,childIndex:c,isRange:m})))}return m?[S,null,null]:[S,null]})),Kz(s,"renderCustomized",(function(e,t,n){return(0,r.cloneElement)(e,Zz(Zz({key:"recharts-customized-".concat(n)},s.props),s.state))})),Kz(s,"renderMap",{CartesianGrid:{handler:eB,once:!0},ReferenceArea:{handler:s.renderReferenceElement},ReferenceLine:{handler:eB},ReferenceDot:{handler:s.renderReferenceElement},XAxis:{handler:eB},YAxis:{handler:eB},Brush:{handler:s.renderBrush,once:!0},Bar:{handler:s.renderGraphicChild},Line:{handler:s.renderGraphicChild},Area:{handler:s.renderGraphicChild},Radar:{handler:s.renderGraphicChild},RadialBar:{handler:s.renderGraphicChild},Scatter:{handler:s.renderGraphicChild},Pie:{handler:s.renderGraphicChild},Funnel:{handler:s.renderGraphicChild},Tooltip:{handler:s.renderCursor,once:!0},PolarGrid:{handler:s.renderPolarGrid,once:!0},PolarAngleAxis:{handler:s.renderPolarAxis},PolarRadiusAxis:{handler:s.renderPolarAxis},Customized:{handler:s.renderCustomized}}),s.clipPathId="".concat(null!==(o=e.id)&&void 0!==o?o:T_("recharts"),"-clip"),s.throttleTriggeredAfterMouseMove=g_()(s.triggeredAfterMouseMove,null!==(a=e.throttleDelay)&&void 0!==a?a:1e3/60),s.state={},s}return function(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&&Uz(e,t)}(n,e),o=n,s=[{key:"componentDidMount",value:function(){var e,t;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(e=this.props.margin.left)&&void 0!==e?e:0,top:null!==(t=this.props.margin.top)&&void 0!==t?t:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var e=this.props,t=e.children,r=e.data,n=e.height,o=e.layout,i=lO(t,ES);if(i){var a=i.props.defaultIndex;if(!("number"!=typeof a||a<0||a>this.state.tooltipTicks.length-1)){var s=this.state.tooltipTicks[a]&&this.state.tooltipTicks[a].value,u=nB(this.state,r,a,s),l=this.state.tooltipTicks[a].coordinate,c=(this.state.offset.top+n)/2,f="horizontal"===o?{x:l,y:c}:{y:l,x:c},d=this.state.formattedGraphicalItems.find((function(e){return"Scatter"===e.item.type.name}));d&&(f=Zz(Zz({},f),d.props.points[a].tooltipPosition),u=d.props.points[a].tooltipPayload);var p={activeTooltipIndex:a,isTooltipActive:!0,activeLabel:s,activePayload:u,activeCoordinate:f};this.setState(p),this.renderCursor(i),this.accessibilityManager.setIndex(a)}}}},{key:"getSnapshotBeforeUpdate",value:function(e,t){return this.props.accessibilityLayer?(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:null!==(r=this.props.margin.left)&&void 0!==r?r:0,top:null!==(n=this.props.margin.top)&&void 0!==n?n:0}}),null):null;var r,n}},{key:"componentDidUpdate",value:function(e){hO([lO(e.children,ES)],[lO(this.props.children,ES)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=lO(this.props.children,ES);if(e&&"boolean"==typeof e.props.shared){var t=e.props.shared?"axis":"item";return u.indexOf(t)>=0?t:a}return a}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t,r=this.container,n=r.getBoundingClientRect(),o={top:(t=n).top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft},i={chartX:Math.round(e.pageX-o.left),chartY:Math.round(e.pageY-o.top)},a=n.width/r.offsetWidth||1,s=this.inRange(i.chartX,i.chartY,a);if(!s)return null;var u=this.state,l=u.xAxisMap,c=u.yAxisMap;if("axis"!==this.getTooltipEventType()&&l&&c){var f=R_(l).scale,d=R_(c).scale,p=f&&f.invert?f.invert(i.chartX):null,h=d&&d.invert?d.invert(i.chartY):null;return Zz(Zz({},i),{},{xValue:p,yValue:h})}var m=oB(this.state,this.props.data,this.props.layout,s);return m?Zz(Zz({},i),m):null}},{key:"inRange",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.props.layout,o=e/r,i=t/r;if("horizontal"===n||"vertical"===n){var a=this.state.offset;return o>=a.left&&o<=a.left+a.width&&i>=a.top&&i<=a.top+a.height?{x:o,y:i}:null}var s=this.state,u=s.angleAxisMap,l=s.radiusAxisMap;if(u&&l){var c=R_(u);return PL({x:o,y:i},c)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),r=lO(e,ES),n={};return r&&"axis"===t&&(n="click"===r.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu}),Zz(Zz({},X_(this.props,this.handleOuterEvent)),n)}},{key:"addListener",value:function(){NF.on(TF,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){NF.removeListener(TF,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(e,t,r){for(var n=this.state.formattedGraphicalItems,o=0,i=n.length;o<i;o++){var a=n[o];if(a.item===e||a.props.key===e.key||t===oO(a.item.type)&&r===a.childIndex)return a}return null}},{key:"renderClipPath",value:function(){var e=this.clipPathId,t=this.state.offset,r=t.left,n=t.top,o=t.height,a=t.width;return i().createElement("defs",null,i().createElement("clipPath",{id:e},i().createElement("rect",{x:r,y:n,height:o,width:a})))}},{key:"getXScales",value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce((function(e,t){var r=Dz(t,2),n=r[0],o=r[1];return Zz(Zz({},e),{},Kz({},n,o.scale))}),{}):null}},{key:"getYScales",value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce((function(e,t){var r=Dz(t,2),n=r[0],o=r[1];return Zz(Zz({},e),{},Kz({},n,o.scale))}),{}):null}},{key:"getXScaleByAxisId",value:function(e){var t;return null===(t=this.state.xAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getYScaleByAxisId",value:function(e){var t;return null===(t=this.state.yAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getItemByXY",value:function(e){var t=this.state,r=t.formattedGraphicalItems,n=t.activeItem;if(r&&r.length)for(var o=0,i=r.length;o<i;o++){var a=r[o],s=a.props,u=a.item,l=void 0!==u.type.defaultProps?Zz(Zz({},u.type.defaultProps),u.props):u.props,c=oO(u.type);if("Bar"===c){var f=(s.data||[]).find((function(t){return EP(e,t)}));if(f)return{graphicalItem:a,payload:f}}else if("RadialBar"===c){var d=(s.data||[]).find((function(t){return PL(e,t)}));if(d)return{graphicalItem:a,payload:d}}else if(FI(a,n)||zI(a,n)||BI(a,n)){var p=GI({graphicalItem:a,activeTooltipItem:n,itemData:l.data}),h=void 0===l.activeIndex?p:l.activeIndex;return{graphicalItem:Zz(Zz({},a),{},{childIndex:h}),payload:BI(a,n)?l.data[p]:a.props.data[p]}}}return null}},{key:"render",value:function(){var e=this;if(!cO(this))return null;var t,r,n=this.props,o=n.children,a=n.className,s=n.width,u=n.height,l=n.style,c=n.compact,f=n.title,d=n.desc,p=Fz(n,Rz),h=pO(p,!1);if(c)return i().createElement(KD,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},i().createElement(MO,Iz({},h,{width:s,height:u,title:f,desc:d}),this.renderClipPath(),yO(o,this.renderMap)));this.props.accessibilityLayer&&(h.tabIndex=null!==(t=this.props.tabIndex)&&void 0!==t?t:0,h.role=null!==(r=this.props.role)&&void 0!==r?r:"application",h.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},h.onFocus=function(){e.accessibilityManager.focus()});var m=this.parseEventsOfWrapper();return i().createElement(KD,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},i().createElement("div",Iz({className:gt("recharts-wrapper",a),style:Zz({position:"relative",cursor:"default",width:s,height:u},l)},m,{ref:function(t){e.container=t}}),i().createElement(MO,Iz({},h,{width:s,height:u,title:f,desc:d,style:Qz}),this.renderClipPath(),yO(o,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}],s&&zz(o.prototype,s),l&&zz(o,l),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,s,l}(r.Component);Kz(m,"displayName",t),Kz(m,"defaultProps",Zz({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},d)),Kz(m,"getDerivedStateFromProps",(function(e,t){var r=e.dataKey,n=e.data,o=e.children,i=e.width,a=e.height,s=e.layout,u=e.stackOffset,l=e.margin,c=t.dataStartIndex,f=t.dataEndIndex;if(void 0===t.updateId){var d=sB(e);return Zz(Zz(Zz({},d),{},{updateId:0},h(Zz(Zz({props:e},d),{},{updateId:0}),t)),{},{prevDataKey:r,prevData:n,prevWidth:i,prevHeight:a,prevLayout:s,prevStackOffset:u,prevMargin:l,prevChildren:o})}if(r!==t.prevDataKey||n!==t.prevData||i!==t.prevWidth||a!==t.prevHeight||s!==t.prevLayout||u!==t.prevStackOffset||!W_(l,t.prevMargin)){var p=sB(e),m={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},y=Zz(Zz({},oB(t,n,s)),{},{updateId:t.updateId+1}),v=Zz(Zz(Zz({},p),m),y);return Zz(Zz(Zz({},v),h(Zz({props:e},v),t)),{},{prevDataKey:r,prevData:n,prevWidth:i,prevHeight:a,prevLayout:s,prevStackOffset:u,prevMargin:l,prevChildren:o})}if(!hO(o,t.prevChildren)){var g,b,w,x,_=lO(o,vL),O=_&&null!==(g=null===(b=_.props)||void 0===b?void 0:b.startIndex)&&void 0!==g?g:c,S=_&&null!==(w=null===(x=_.props)||void 0===x?void 0:x.endIndex)&&void 0!==w?w:f,E=O!==c||S!==f,j=!z_()(n)&&!E?t.updateId:t.updateId+1;return Zz(Zz({updateId:j},h(Zz(Zz({props:e},t),{},{updateId:j,dataStartIndex:O,dataEndIndex:S}),t)),{},{prevChildren:o,dataStartIndex:O,dataEndIndex:S})}return null})),Kz(m,"renderActiveDot",(function(e,t,n){var o;return o=(0,r.isValidElement)(e)?(0,r.cloneElement)(e,t):V_()(e)?e(t):i().createElement(VE,t),i().createElement(DO,{className:"recharts-active-dot",key:n},o)}));var y=(0,r.forwardRef)((function(e,t){return i().createElement(m,Iz({},e,{ref:t}))}));return y.displayName=m.displayName,y}({chartName:"LineChart",GraphicalChild:PB,axisComponents:[{axisType:"xAxis",AxisComp:uV},{axisType:"yAxis",AxisComp:bV}],formatAxisMap:function(t,r,n,o,i){var a=t.width,s=t.height,u=t.layout,l=t.children,c=Object.keys(r),f={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:s-n.bottom,bottomMirror:s-n.bottom},d=!!lO(l,hD);return c.reduce((function(a,s){var l,c,p,h,m,y=r[s],v=y.orientation,g=y.domain,b=y.padding,w=void 0===b?{}:b,x=y.mirror,_=y.reversed,O="".concat(v).concat(x?"Mirror":"");if("number"===y.type&&("gap"===y.padding||"no-gap"===y.padding)){var S=g[1]-g[0],E=1/0,j=y.categoricalDomain.sort();if(j.forEach((function(e,t){t>0&&(E=Math.min((e||0)-(j[t-1]||0),E))})),Number.isFinite(E)){var P=E/S,k="vertical"===y.layout?n.height:n.width;if("gap"===y.padding&&(l=P*k/2),"no-gap"===y.padding){var C=M_(t.barCategoryGap,P*k),A=P*k/2;l=A-C-(A-C)/k*C}}}c="xAxis"===o?[n.left+(w.left||0)+(l||0),n.left+n.width-(w.right||0)-(l||0)]:"yAxis"===o?"horizontal"===u?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(l||0),n.top+n.height-(w.bottom||0)-(l||0)]:y.range,_&&(c=[c[1],c[0]]);var N=function(t,r,n){var o=t.scale,i=t.type,a=t.layout,s=t.axisType;if("auto"===o)return"radial"===a&&"radiusAxis"===s?{scale:DP(),realScaleType:"band"}:"radial"===a&&"angleAxis"===s?{scale:sA(),realScaleType:"linear"}:"category"===i&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:zP(),realScaleType:"point"}:"category"===i?{scale:DP(),realScaleType:"band"}:{scale:sA(),realScaleType:"linear"};if(w_()(o)){var u="scale".concat(PS()(o));return{scale:(e[u]||zP)(),realScaleType:e[u]?u:"point"}}return V_()(o)?{scale:o}:{scale:zP(),realScaleType:"point"}}(y,i,d),T=N.scale,M=N.realScaleType;T.domain(g).range(c),function(e){var t=e.domain();if(t&&!(t.length<=2)){var r=t.length,n=e.range(),o=Math.min(n[0],n[1])-$R,i=Math.max(n[0],n[1])+$R,a=e(t[0]),s=e(t[r-1]);(a<o||a>i||s<o||s>i)&&e.domain([t[0],t[r-1]])}}(T);var R=function(e,t){var r=t.realScaleType,n=t.type,o=t.tickCount,i=t.originalDomain,a=t.allowDecimals,s=r||t.scale;if("auto"!==s&&"linear"!==s)return null;if(o&&"number"===n&&i&&("auto"===i[0]||"auto"===i[1])){var u=e.domain();if(!u.length)return null;var l=iR(u,o,a);return e.domain([PM()(l),EM()(l)]),{niceTicks:l}}if(o&&"number"===n){var c=e.domain();return{niceTicks:aR(c,o,a)}}return null}(T,gD(gD({},y),{},{realScaleType:M}));"xAxis"===o?(m="top"===v&&!x||"bottom"===v&&x,p=n.left,h=f[O]-m*y.height):"yAxis"===o&&(m="left"===v&&!x||"right"===v&&x,p=f[O]-m*y.width,h=n.top);var L=gD(gD(gD({},y),R),{},{realScaleType:M,x:p,y:h,scale:T,width:"xAxis"===o?n.width:y.width,height:"yAxis"===o?n.height:y.height});return L.bandSize=XR(L,R),y.hide||"xAxis"!==o?y.hide||(f[O]+=(m?-1:1)*L.width):f[O]+=(m?-1:1)*L.height,gD(gD({},a),{},bD({},s,L))}),{})}}),xV=["x1","y1","x2","y2","key"],_V=["offset"];function OV(e){return OV="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},OV(e)}function SV(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function EV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?SV(Object(r),!0).forEach((function(t){jV(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SV(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function jV(e,t,r){return t=function(e){var t=function(e,t){if("object"!=OV(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=OV(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==OV(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PV(){return PV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PV.apply(this,arguments)}function kV(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var CV=function(e){var t=e.fill;if(!t||"none"===t)return null;var r=e.fillOpacity,n=e.x,o=e.y,a=e.width,s=e.height,u=e.ry;return i().createElement("rect",{x:n,y:o,ry:u,width:a,height:s,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function AV(e,t){var r;if(i().isValidElement(e))r=i().cloneElement(e,t);else if(V_()(e))r=e(t);else{var n=t.x1,o=t.y1,a=t.x2,s=t.y2,u=t.key,l=kV(t,xV),c=pO(l,!1),f=(c.offset,kV(c,_V));r=i().createElement("line",PV({},f,{x1:n,y1:o,x2:a,y2:s,fill:"none",key:u}))}return r}function NV(e){var t=e.x,r=e.width,n=e.horizontal,o=void 0===n||n,a=e.horizontalPoints;if(!o||!a||!a.length)return null;var s=a.map((function(n,i){var a=EV(EV({},e),{},{x1:t,y1:n,x2:t+r,y2:n,key:"line-".concat(i),index:i});return AV(o,a)}));return i().createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function TV(e){var t=e.y,r=e.height,n=e.vertical,o=void 0===n||n,a=e.verticalPoints;if(!o||!a||!a.length)return null;var s=a.map((function(n,i){var a=EV(EV({},e),{},{x1:n,y1:t,x2:n,y2:t+r,key:"line-".concat(i),index:i});return AV(o,a)}));return i().createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function MV(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,o=e.y,a=e.width,s=e.height,u=e.horizontalPoints,l=e.horizontal;if(!(void 0===l||l)||!t||!t.length)return null;var c=u.map((function(e){return Math.round(e+o-o)})).sort((function(e,t){return e-t}));o!==c[0]&&c.unshift(0);var f=c.map((function(e,u){var l=!c[u+1]?o+s-e:c[u+1]-e;if(l<=0)return null;var f=u%t.length;return i().createElement("rect",{key:"react-".concat(u),y:e,x:n,height:l,width:a,stroke:"none",fill:t[f],fillOpacity:r,className:"recharts-cartesian-grid-bg"})}));return i().createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function RV(e){var t=e.vertical,r=void 0===t||t,n=e.verticalFill,o=e.fillOpacity,a=e.x,s=e.y,u=e.width,l=e.height,c=e.verticalPoints;if(!r||!n||!n.length)return null;var f=c.map((function(e){return Math.round(e+a-a)})).sort((function(e,t){return e-t}));a!==f[0]&&f.unshift(0);var d=f.map((function(e,t){var r=!f[t+1]?a+u-e:f[t+1]-e;if(r<=0)return null;var c=t%n.length;return i().createElement("rect",{key:"react-".concat(t),x:e,y:s,width:r,height:l,stroke:"none",fill:n[c],fillOpacity:o,className:"recharts-cartesian-grid-bg"})}));return i().createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var LV=function(e,t){var r=e.xAxis,n=e.width,o=e.height,i=e.offset;return FR(LB(EV(EV(EV({},XB.defaultProps),r),{},{ticks:zR(r,!0),viewBox:{x:0,y:0,width:n,height:o}})),i.left,i.left+i.width,t)},IV=function(e,t){var r=e.yAxis,n=e.width,o=e.height,i=e.offset;return FR(LB(EV(EV(EV({},XB.defaultProps),r),{},{ticks:zR(r,!0),viewBox:{x:0,y:0,width:n,height:o}})),i.top,i.top+i.height,t)},DV={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function FV(e){var t,n,o,a,s,u,l,c,f=QD(),d=JD(),p=(0,r.useContext)(WD),h=EV(EV({},e),{},{stroke:null!==(t=e.stroke)&&void 0!==t?t:DV.stroke,fill:null!==(n=e.fill)&&void 0!==n?n:DV.fill,horizontal:null!==(o=e.horizontal)&&void 0!==o?o:DV.horizontal,horizontalFill:null!==(a=e.horizontalFill)&&void 0!==a?a:DV.horizontalFill,vertical:null!==(s=e.vertical)&&void 0!==s?s:DV.vertical,verticalFill:null!==(u=e.verticalFill)&&void 0!==u?u:DV.verticalFill,x:C_(e.x)?e.x:p.left,y:C_(e.y)?e.y:p.top,width:C_(e.width)?e.width:p.width,height:C_(e.height)?e.height:p.height}),m=h.x,y=h.y,v=h.width,g=h.height,b=h.syncWithTicks,w=h.horizontalValues,x=h.verticalValues,_=(l=(0,r.useContext)($D),R_(l)),O=(c=(0,r.useContext)(UD),zD()(c,(function(e){return GL()(e.domain,Number.isFinite)}))||R_(c));if(!C_(v)||v<=0||!C_(g)||g<=0||!C_(m)||m!==+m||!C_(y)||y!==+y)return null;var S=h.verticalCoordinatesGenerator||LV,E=h.horizontalCoordinatesGenerator||IV,j=h.horizontalPoints,P=h.verticalPoints;if((!j||!j.length)&&V_()(E)){var k=w&&w.length,C=E({yAxis:O?EV(EV({},O),{},{ticks:k?w:O.ticks}):void 0,width:f,height:d,offset:p},!!k||b);D_(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(OV(C),"]")),Array.isArray(C)&&(j=C)}if((!P||!P.length)&&V_()(S)){var A=x&&x.length,N=S({xAxis:_?EV(EV({},_),{},{ticks:A?x:_.ticks}):void 0,width:f,height:d,offset:p},!!A||b);D_(Array.isArray(N),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(OV(N),"]")),Array.isArray(N)&&(P=N)}return i().createElement("g",{className:"recharts-cartesian-grid"},i().createElement(CV,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),i().createElement(NV,PV({},h,{offset:p,horizontalPoints:j,xAxis:_,yAxis:O})),i().createElement(TV,PV({},h,{offset:p,verticalPoints:P,xAxis:_,yAxis:O})),i().createElement(MV,PV({},h,{horizontalPoints:j})),i().createElement(RV,PV({},h,{verticalPoints:P})))}FV.displayName="CartesianGrid";const zV={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function BV(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const VV={date:BV({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:BV({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:BV({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},$V={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function UV(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=r?.width?String(r.width):t;n=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=r?.width?String(r.width):e.defaultWidth;n=e.values[o]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}const GV={ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:UV({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:UV({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:UV({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:UV({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:UV({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function WV(e){return(t,r={})=>{const n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const a=i[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(s)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r;return}(s,(e=>e.test(a))):function(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r;return}(s,(e=>e.test(a)));let l;l=e.valueCallback?e.valueCallback(u):u,l=r.valueCallback?r.valueCallback(l):l;return{value:l,rest:t.slice(a.length)}}}const qV={ordinalNumber:(HV={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const r=e.match(HV.matchPattern);if(!r)return null;const n=r[0],o=e.match(HV.parsePattern);if(!o)return null;let i=HV.valueCallback?HV.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(n.length)}}),era:WV({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:WV({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:WV({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:WV({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:WV({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var HV;const ZV={code:"en-US",formatDistance:(e,t,r)=>{let n;const o=zV[e];return n="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:VV,formatRelative:(e,t,r,n)=>$V[e],localize:GV,match:qV,options:{weekStartsOn:0,firstWeekContainsDate:1}};let KV={};function YV(){return KV}Math.pow(10,8);const XV=6048e5,QV=Symbol.for("constructDateFrom");function JV(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&QV in e?e[QV](t):e instanceof Date?new e.constructor(t):new Date(t)}function e$(e,t){return JV(t||e,e)}function t$(e){const t=e$(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function r$(e,t){const r=e$(e,t?.in);return r.setHours(0,0,0,0),r}function n$(e,t,r){const[n,o]=function(e,...t){const r=JV.bind(null,e||t.find((e=>"object"==typeof e)));return t.map(r)}(r?.in,e,t),i=r$(n),a=r$(o),s=+i-t$(i),u=+a-t$(a);return Math.round((s-u)/864e5)}function o$(e,t){const r=e$(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function i$(e,t){const r=e$(e,t?.in);return n$(r,o$(r))+1}function a$(e,t){const r=YV(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=e$(e,t?.in),i=o.getDay(),a=(i<n?7:0)+i-n;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function s$(e,t){return a$(e,{...t,weekStartsOn:1})}function u$(e,t){const r=e$(e,t?.in),n=r.getFullYear(),o=JV(r,0);o.setFullYear(n+1,0,4),o.setHours(0,0,0,0);const i=s$(o),a=JV(r,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const s=s$(a);return r.getTime()>=i.getTime()?n+1:r.getTime()>=s.getTime()?n:n-1}function l$(e,t){const r=u$(e,t),n=JV(t?.in||e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),s$(n)}function c$(e,t){const r=e$(e,t?.in),n=+s$(r)-+l$(r);return Math.round(n/XV)+1}function f$(e,t){const r=e$(e,t?.in),n=r.getFullYear(),o=YV(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=JV(t?.in||e,0);a.setFullYear(n+1,0,i),a.setHours(0,0,0,0);const s=a$(a,t),u=JV(t?.in||e,0);u.setFullYear(n,0,i),u.setHours(0,0,0,0);const l=a$(u,t);return+r>=+s?n+1:+r>=+l?n:n-1}function d$(e,t){const r=YV(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=f$(e,t),i=JV(t?.in||e,0);i.setFullYear(o,0,n),i.setHours(0,0,0,0);return a$(i,t)}function p$(e,t){const r=e$(e,t?.in),n=+a$(r,t)-+d$(r,t);return Math.round(n/XV)+1}function h$(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const m$={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return h$("yy"===t?n%100:n,t.length)},M(e,t){const r=e.getMonth();return"M"===t?String(r+1):h$(r+1,2)},d:(e,t)=>h$(e.getDate(),t.length),a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>h$(e.getHours()%12||12,t.length),H:(e,t)=>h$(e.getHours(),t.length),m:(e,t)=>h$(e.getMinutes(),t.length),s:(e,t)=>h$(e.getSeconds(),t.length),S(e,t){const r=t.length,n=e.getMilliseconds();return h$(Math.trunc(n*Math.pow(10,r-3)),t.length)}},y$="midnight",v$="noon",g$="morning",b$="afternoon",w$="evening",x$="night",_$={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){const t=e.getFullYear(),n=t>0?t:1-t;return r.ordinalNumber(n,{unit:"year"})}return m$.y(e,t)},Y:function(e,t,r,n){const o=f$(e,n),i=o>0?o:1-o;if("YY"===t){return h$(i%100,2)}return"Yo"===t?r.ordinalNumber(i,{unit:"year"}):h$(i,t.length)},R:function(e,t){return h$(u$(e),t.length)},u:function(e,t){return h$(e.getFullYear(),t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return h$(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return h$(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return m$.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return h$(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const o=p$(e,n);return"wo"===t?r.ordinalNumber(o,{unit:"week"}):h$(o,t.length)},I:function(e,t,r){const n=c$(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):h$(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):m$.d(e,t)},D:function(e,t,r){const n=i$(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):h$(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const o=e.getDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return h$(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const o=e.getDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return h$(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return h$(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let o;switch(o=12===n?v$:0===n?y$:n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let o;switch(o=n>=17?w$:n>=12?b$:n>=4?g$:x$,t){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return m$.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):m$.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):h$(n,t.length)},k:function(e,t,r){let n=e.getHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):h$(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):m$.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):m$.s(e,t)},S:function(e,t){return m$.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return S$(n);case"XXXX":case"XX":return E$(n);default:return E$(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return S$(n);case"xxxx":case"xx":return E$(n);default:return E$(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+O$(n,":");default:return"GMT"+E$(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+O$(n,":");default:return"GMT"+E$(n,":")}},t:function(e,t,r){return h$(Math.trunc(+e/1e3),t.length)},T:function(e,t,r){return h$(+e,t.length)}};function O$(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),o=Math.trunc(n/60),i=n%60;return 0===i?r+String(o):r+String(o)+t+h$(i,2)}function S$(e,t){if(e%60==0){return(e>0?"-":"+")+h$(Math.abs(e)/60,2)}return E$(e,t)}function E$(e,t=""){const r=e>0?"-":"+",n=Math.abs(e);return r+h$(Math.trunc(n/60),2)+t+h$(n%60,2)}const j$=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},P$=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},k$={p:P$,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return j$(e,t);let i;switch(n){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",j$(n,t)).replace("{{time}}",P$(o,t))}},C$=/^D+$/,A$=/^Y+$/,N$=["D","DD","YY","YYYY"];function T$(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function M$(e){return!(!T$(e)&&"number"!=typeof e||isNaN(+e$(e)))}const R$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,L$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,I$=/^'([^]*?)'?$/,D$=/''/g,F$=/[a-zA-Z]/;function z$(e,t,r){const n=YV(),o=r?.locale??n.locale??ZV,i=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=e$(e,r?.in);if(!M$(s))throw new RangeError("Invalid time value");let u=t.match(L$).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,k$[t])(e,o.formatLong)}return e})).join("").match(R$).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:B$(e)};if(_$[t])return{isToken:!0,value:e};if(t.match(F$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(u=o.localize.preprocessor(s,u));const l={firstWeekContainsDate:i,weekStartsOn:a,locale:o};return u.map((n=>{if(!n.isToken)return n.value;const i=n.value;(!r?.useAdditionalWeekYearTokens&&function(e){return A$.test(e)}(i)||!r?.useAdditionalDayOfYearTokens&&function(e){return C$.test(e)}(i))&&function(e,t,r){const n=function(e,t,r){const n="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,r);if(N$.includes(e))throw new RangeError(n)}(i,t,String(e));return(0,_$[i[0]])(s,i,o.localize,l)})).join("")}function B$(e){const t=e.match(I$);return t?t[1].replace(D$,"'"):e}function V$(e){return V$="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},V$(e)}function $$(){$$=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==V$(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(V$(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function U$(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function G$(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return W$(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?W$(e,t):void 0}}(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.")}()}function W$(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const q$=function(){var e=te(),t=G$((0,r.useState)({total:0,success:0,failed:0,chart_data:[]}),2),n=t[0],o=t[1],i=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){U$(i,n,o,a,s,"next",e)}function s(e){U$(i,n,o,a,s,"throw",e)}a(void 0)}))}}($$().mark((function e(){var t,r,n;return $$().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(t=new FormData).append("action","get_email_stats"),t.append("trigger_nonce",rd.nonce_value),e.next=6,fetch(rd.ajax_url,{method:"POST",body:t});case 6:return r=e.sent,e.next=9,r.json();case 9:200===(n=e.sent).status_code&&o(n.data),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0);case 16:case"end":return e.stop()}}),e,null,[[0,13]])})));return function(){return e.apply(this,arguments)}}();return(0,r.useEffect)((function(){i()}),[]),io("div",{className:"p-4 space-y-6"},io("div",{className:"flex justify-between items-center"},io("h2",{className:"text-2xl font-bold"},(0,Lo.__)("Trigger Dashboard","trigger")),io(lo,{size:"sm",className:"gap-2",onClick:function(){return e("/add-connection")}},io(yo,{className:"h-5 w-5"}),(0,Lo.__)("Add Connection","trigger"))),io("div",{className:"grid gap-4 md:grid-cols-3"},io(uw,null,io(lw,{className:"flex flex-row items-center justify-between space-y-0 pb-2"},io(cw,{className:"text-sm font-medium"},(0,Lo.__)("Total Emails","trigger")),io(f_,{className:"h-4 w-4 text-muted-foreground"})),io(dw,null,io("div",{className:"text-2xl font-bold"},n.total))),io(uw,null,io(lw,{className:"flex flex-row items-center justify-between space-y-0 pb-2"},io(cw,{className:"text-sm font-medium"},(0,Lo.__)("Successful","trigger")),io(Xb,{className:"h-4 w-4 text-green-600"})),io(dw,null,io("div",{className:"text-2xl font-bold text-green-600"},n.success))),io(uw,null,io(lw,{className:"flex flex-row items-center justify-between space-y-0 pb-2"},io(cw,{className:"text-sm font-medium"},(0,Lo.__)("Failed","trigger")),io(y_,{className:"h-4 w-4 text-red-600"})),io(dw,null,io("div",{className:"text-2xl font-bold text-red-600"},n.failed)))),io(uw,null,io(lw,null,io(cw,null,(0,Lo.__)("Email Sending Rate","trigger"))),io(dw,null,io("div",{className:"h-[300px]"},io(OO,{width:"100%",height:"100%"},io(wV,{data:n.chart_data},io(FV,{strokeDasharray:"3 3"}),io(uV,{dataKey:"date",tickFormatter:function(e){return z$(new Date(e),"MMM dd")}}),io(bV,null),io(ES,{labelFormatter:function(e){return z$(new Date(e),"MMM dd, yyyy")}}),io(PB,{type:"monotone",dataKey:"success",stroke:"#16a34a",name:(0,Lo.__)("Successful","trigger")}),io(PB,{type:"monotone",dataKey:"failed",stroke:"#dc2626",name:(0,Lo.__)("Failed","trigger")})))))))},H$=mo("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),Z$=mo("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);Array(12).fill(0);let K$=1;const Y$=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach((t=>t(e)))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;const{message:r,...n}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:K$++,i=this.toasts.find((e=>e.id===o)),a=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),i?this.toasts=this.toasts.map((t=>t.id===o?(this.publish({...t,...e,id:o,title:r}),{...t,...e,id:o,dismissible:a,title:r}):t)):this.addToast({title:r,...n,dismissible:a,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach((e=>{this.subscribers.forEach((t=>t({id:e.id,dismiss:!0})))})),requestAnimationFrame((()=>this.subscribers.forEach((t=>t({id:e,dismiss:!0}))))),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;void 0!==t.loading&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));const o=Promise.resolve(e instanceof Function?e():e);let i,a=void 0!==n;const s=o.then((async e=>{i=["resolve",e];if(r.isValidElement(e))a=!1,this.create({id:n,type:"default",message:e});else if(X$(e)&&!e.ok){a=!1;const r="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description,i="object"==typeof r?r:{message:r};this.create({id:n,type:"error",description:o,...i})}else if(e instanceof Error){a=!1;const r="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r?r:{message:r};this.create({id:n,type:"error",description:o,...i})}else if(void 0!==t.success){a=!1;const r="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r?r:{message:r};this.create({id:n,type:"success",description:o,...i})}})).catch((async e=>{if(i=["reject",e],void 0!==t.error){a=!1;const r="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r?r:{message:r};this.create({id:n,type:"error",description:o,...i})}})).finally((()=>{a&&(this.dismiss(n),n=void 0),null==t.finally||t.finally.call(t)})),u=()=>new Promise(((e,t)=>s.then((()=>"reject"===i[0]?t(i[1]):e(i[1]))).catch(t)));return"string"!=typeof n&&"number"!=typeof n?{unwrap:u}:Object.assign(n,{unwrap:u})},this.custom=(e,t)=>{const r=(null==t?void 0:t.id)||K$++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter((e=>!this.dismissedToasts.has(e.id))),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},X$=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,Q$=(e,t)=>{const r=(null==t?void 0:t.id)||K$++;return Y$.addToast({title:e,...t,id:r}),r},J$=Object.assign(Q$,{success:Y$.success,info:Y$.info,warning:Y$.warning,error:Y$.error,custom:Y$.custom,message:Y$.message,promise:Y$.promise,dismiss:Y$.dismiss,loading:Y$.loading},{getHistory:()=>Y$.toasts,getToasts:()=>Y$.getActiveToasts()});!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}[data-sonner-toaster][data-lifted=true]{transform:translateY(-8px)}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");var eU="Checkbox",[tU,rU]=Do(eU),[nU,oU]=tU(eU),iU=r.forwardRef(((e,t)=>{const{__scopeCheckbox:n,name:o,checked:i,defaultChecked:a,required:s,disabled:u,value:l="on",onCheckedChange:c,form:f,...d}=e,[p,h]=r.useState(null),m=ct(t,(e=>h(e))),y=r.useRef(!1),v=!p||(f||!!p.closest("form")),[g=!1,b]=Go({prop:i,defaultProp:a,onChange:c}),w=r.useRef(g);return r.useEffect((()=>{const e=p?.form;if(e){const t=()=>b(w.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[p,b]),(0,ft.jsxs)(nU,{scope:n,state:g,disabled:u,children:[(0,ft.jsx)(qo.button,{type:"button",role:"checkbox","aria-checked":lU(g)?"mixed":g,"aria-required":s,"data-state":cU(g),"data-disabled":u?"":void 0,disabled:u,value:l,...d,ref:m,onKeyDown:Io(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:Io(e.onClick,(e=>{b((e=>!!lU(e)||!e)),v&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())}))}),v&&(0,ft.jsx)(uU,{control:p,bubbles:!y.current,name:o,value:l,checked:g,required:s,disabled:u,form:f,style:{transform:"translateX(-100%)"},defaultChecked:!lU(a)&&a})]})}));iU.displayName=eU;var aU="CheckboxIndicator",sU=r.forwardRef(((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...o}=e,i=oU(aU,r);return(0,ft.jsx)(pi,{present:n||lU(i.state)||!0===i.state,children:(0,ft.jsx)(qo.span,{"data-state":cU(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})}));sU.displayName=aU;var uU=e=>{const{control:t,checked:n,bubbles:o=!0,defaultChecked:i,...a}=e,s=r.useRef(null),u=Vy(n),l=gy(t);r.useEffect((()=>{const e=s.current,t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:o});e.indeterminate=lU(n),r.call(e,!lU(n)&&n),e.dispatchEvent(t)}}),[u,n,o]);const c=r.useRef(!lU(n)&&n);return(0,ft.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??c.current,...a,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function lU(e){return"indeterminate"===e}function cU(e){return lU(e)?"indeterminate":e?"checked":"unchecked"}var fU=iU,dU=sU,pU=["className"];function hU(){return hU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hU.apply(null,arguments)}var mU=r.forwardRef((function(e,t){var r=e.className,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,pU);return io(fU,hU({ref:t,className:Nr("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",r)},n),io(dU,{className:Nr("flex items-center justify-center text-current")},io(og,{className:"h-4 w-4"})))}));function yU(e,t){return"function"==typeof e?e(t):e}function vU(e,t){return r=>{t.setState((t=>({...t,[e]:yU(r,t[e])})))}}function gU(e){return e instanceof Function}function bU(e,t){const r=[],n=e=>{e.forEach((e=>{r.push(e);const o=t(e);null!=o&&o.length&&n(o)}))};return n(e),r}function wU(e,t,r){let n,o=[];return i=>{let a;r.key&&r.debug&&(a=Date.now());const s=e(i),u=s.length!==o.length||s.some(((e,t)=>o[t]!==e));if(!u)return n;let l;if(o=s,r.key&&r.debug&&(l=Date.now()),n=t(...s),null==r||null==r.onChange||r.onChange(n),r.key&&r.debug&&null!=r&&r.debug()){Math.round(100*(Date.now()-a)),Math.round(100*(Date.now()-l))}return n}}function xU(e,t,r,n){return{debug:()=>{var r;return null!=(r=null==e?void 0:e.debugAll)?r:e[t]},key:!1,onChange:n}}mU.displayName=fU.displayName;const _U="debugHeaders";function OU(e,t,r){var n;let o={id:null!=(n=r.id)?n:t.id,column:t,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=r=>{r.subHeaders&&r.subHeaders.length&&r.subHeaders.map(t),e.push(r)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach((t=>{null==t.createHeader||t.createHeader(o,e)})),o}const SU={createTable:e=>{e.getHeaderGroups=wU((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,r,n,o)=>{var i,a;const s=null!=(i=null==n?void 0:n.map((e=>r.find((t=>t.id===e)))).filter(Boolean))?i:[],u=null!=(a=null==o?void 0:o.map((e=>r.find((t=>t.id===e)))).filter(Boolean))?a:[],l=r.filter((e=>!(null!=n&&n.includes(e.id)||null!=o&&o.includes(e.id))));return EU(t,[...s,...l,...u],e)}),xU(e.options,_U)),e.getCenterHeaderGroups=wU((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,r,n,o)=>(r=r.filter((e=>!(null!=n&&n.includes(e.id)||null!=o&&o.includes(e.id)))),EU(t,r,e,"center"))),xU(e.options,_U)),e.getLeftHeaderGroups=wU((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,r,n)=>{var o;const i=null!=(o=null==n?void 0:n.map((e=>r.find((t=>t.id===e)))).filter(Boolean))?o:[];return EU(t,i,e,"left")}),xU(e.options,_U)),e.getRightHeaderGroups=wU((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,r,n)=>{var o;const i=null!=(o=null==n?void 0:n.map((e=>r.find((t=>t.id===e)))).filter(Boolean))?o:[];return EU(t,i,e,"right")}),xU(e.options,_U)),e.getFooterGroups=wU((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),xU(e.options,_U)),e.getLeftFooterGroups=wU((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),xU(e.options,_U)),e.getCenterFooterGroups=wU((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),xU(e.options,_U)),e.getRightFooterGroups=wU((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),xU(e.options,_U)),e.getFlatHeaders=wU((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),xU(e.options,_U)),e.getLeftFlatHeaders=wU((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),xU(e.options,_U)),e.getCenterFlatHeaders=wU((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),xU(e.options,_U)),e.getRightFlatHeaders=wU((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),xU(e.options,_U)),e.getCenterLeafHeaders=wU((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),xU(e.options,_U)),e.getLeftLeafHeaders=wU((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),xU(e.options,_U)),e.getRightLeafHeaders=wU((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),xU(e.options,_U)),e.getLeafHeaders=wU((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,r)=>{var n,o,i,a,s,u;return[...null!=(n=null==(o=e[0])?void 0:o.headers)?n:[],...null!=(i=null==(a=t[0])?void 0:a.headers)?i:[],...null!=(s=null==(u=r[0])?void 0:u.headers)?s:[]].map((e=>e.getLeafHeaders())).flat()}),xU(e.options,_U))}};function EU(e,t,r,n){var o,i;let a=0;const s=function(e,t){void 0===t&&(t=1),a=Math.max(a,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var r;null!=(r=e.columns)&&r.length&&s(e.columns,t+1)}),0)};s(e);let u=[];const l=(e,t)=>{const o={depth:t,id:[n,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach((e=>{const a=[...i].reverse()[0];let s,u=!1;if(e.column.depth===o.depth&&e.column.parent?s=e.column.parent:(s=e.column,u=!0),a&&(null==a?void 0:a.column)===s)a.subHeaders.push(e);else{const o=OU(r,s,{id:[n,t,s.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${i.filter((e=>e.column===s)).length}`:void 0,depth:t,index:i.length});o.subHeaders.push(e),i.push(o)}o.headers.push(e),e.headerGroup=o})),u.push(o),t>0&&l(i,t-1)},c=t.map(((e,t)=>OU(r,e,{depth:a,index:t})));l(c,a-1),u.reverse();const f=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,r=0,n=[0];e.subHeaders&&e.subHeaders.length?(n=[],f(e.subHeaders).forEach((e=>{let{colSpan:r,rowSpan:o}=e;t+=r,n.push(o)}))):t=1;return r+=Math.min(...n),e.colSpan=t,e.rowSpan=r,{colSpan:t,rowSpan:r}}));return f(null!=(o=null==(i=u[0])?void 0:i.headers)?o:[]),u}const jU=(e,t,r,n,o,i,a)=>{let s={id:t,index:n,original:r,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];const r=e.getColumn(t);return null!=r&&r.accessorFn?(s._valuesCache[t]=r.accessorFn(s.original,n),s._valuesCache[t]):void 0},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];const r=e.getColumn(t);return null!=r&&r.accessorFn?r.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=r.columnDef.getUniqueValues(s.original,n),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t]):void 0},renderValue:t=>{var r;return null!=(r=s.getValue(t))?r:e.options.renderFallbackValue},subRows:null!=i?i:[],getLeafRows:()=>bU(s.subRows,(e=>e.subRows)),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){const r=t.getParentRow();if(!r)break;e.push(r),t=r}return e.reverse()},getAllCells:wU((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>function(e,t,r,n){const o={id:`${t.id}_${r.id}`,row:t,column:r,getValue:()=>t.getValue(n),renderValue:()=>{var t;return null!=(t=o.getValue())?t:e.options.renderFallbackValue},getContext:wU((()=>[e,r,t,o]),((e,t,r,n)=>({table:e,column:t,row:r,cell:n,getValue:n.getValue,renderValue:n.renderValue})),xU(e.options,"debugCells"))};return e._features.forEach((n=>{null==n.createCell||n.createCell(o,r,t,e)}),{}),o}(e,s,t,t.id)))),xU(e.options,"debugRows")),_getAllCellsByColumnId:wU((()=>[s.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),xU(e.options,"debugRows"))};for(let t=0;t<e._features.length;t++){const r=e._features[t];null==r||null==r.createRow||r.createRow(s,e)}return s},PU={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},kU=(e,t,r)=>{var n,o;const i=null==r||null==(n=r.toString())?void 0:n.toLowerCase();return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())||null==(o=o.toLowerCase())?void 0:o.includes(i))};kU.autoRemove=e=>FU(e);const CU=(e,t,r)=>{var n;return Boolean(null==(n=e.getValue(t))||null==(n=n.toString())?void 0:n.includes(r))};CU.autoRemove=e=>FU(e);const AU=(e,t,r)=>{var n;return(null==(n=e.getValue(t))||null==(n=n.toString())?void 0:n.toLowerCase())===(null==r?void 0:r.toLowerCase())};AU.autoRemove=e=>FU(e);const NU=(e,t,r)=>{var n;return null==(n=e.getValue(t))?void 0:n.includes(r)};NU.autoRemove=e=>FU(e);const TU=(e,t,r)=>!r.some((r=>{var n;return!(null!=(n=e.getValue(t))&&n.includes(r))}));TU.autoRemove=e=>FU(e)||!(null!=e&&e.length);const MU=(e,t,r)=>r.some((r=>{var n;return null==(n=e.getValue(t))?void 0:n.includes(r)}));MU.autoRemove=e=>FU(e)||!(null!=e&&e.length);const RU=(e,t,r)=>e.getValue(t)===r;RU.autoRemove=e=>FU(e);const LU=(e,t,r)=>e.getValue(t)==r;LU.autoRemove=e=>FU(e);const IU=(e,t,r)=>{let[n,o]=r;const i=e.getValue(t);return i>=n&&i<=o};IU.resolveFilterValue=e=>{let[t,r]=e,n="number"!=typeof t?parseFloat(t):t,o="number"!=typeof r?parseFloat(r):r,i=null===t||Number.isNaN(n)?-1/0:n,a=null===r||Number.isNaN(o)?1/0:o;if(i>a){const e=i;i=a,a=e}return[i,a]},IU.autoRemove=e=>FU(e)||FU(e[0])&&FU(e[1]);const DU={includesString:kU,includesStringSensitive:CU,equalsString:AU,arrIncludes:NU,arrIncludesAll:TU,arrIncludesSome:MU,equals:RU,weakEquals:LU,inNumberRange:IU};function FU(e){return null==e||""===e}const zU={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:vU("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const r=t.getCoreRowModel().flatRows[0],n=null==r?void 0:r.getValue(e.id);return"string"==typeof n?DU.includesString:"number"==typeof n?DU.inNumberRange:"boolean"==typeof n||null!==n&&"object"==typeof n?DU.equals:Array.isArray(n)?DU.arrIncludes:DU.weakEquals},e.getFilterFn=()=>{var r,n;return gU(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(r=null==(n=t.options.filterFns)?void 0:n[e.columnDef.filterFn])?r:DU[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,n,o;return(null==(r=e.columnDef.enableColumnFilter)||r)&&(null==(n=t.options.enableColumnFilters)||n)&&(null==(o=t.options.enableFilters)||o)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return null==(r=t.getState().columnFilters)||null==(r=r.find((t=>t.id===e.id)))?void 0:r.value},e.getFilterIndex=()=>{var r,n;return null!=(r=null==(n=t.getState().columnFilters)?void 0:n.findIndex((t=>t.id===e.id)))?r:-1},e.setFilterValue=r=>{t.setColumnFilters((t=>{const n=e.getFilterFn(),o=null==t?void 0:t.find((t=>t.id===e.id)),i=yU(r,o?o.value:void 0);var a;if(BU(n,i,e))return null!=(a=null==t?void 0:t.filter((t=>t.id!==e.id)))?a:[];const s={id:e.id,value:i};var u;return o?null!=(u=null==t?void 0:t.map((t=>t.id===e.id?s:t)))?u:[]:null!=t&&t.length?[...t,s]:[s]}))}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const r=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var n;return null==(n=yU(t,e))?void 0:n.filter((e=>{const t=r.find((t=>t.id===e.id));if(t){if(BU(t.getFilterFn(),e.value,t))return!1}return!0}))}))},e.resetColumnFilters=t=>{var r,n;e.setColumnFilters(t?[]:null!=(r=null==(n=e.initialState)?void 0:n.columnFilters)?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function BU(e,t,r){return!(!e||!e.autoRemove)&&e.autoRemove(t,r)||void 0===t||"string"==typeof t&&!t}const VU={sum:(e,t,r)=>r.reduce(((t,r)=>{const n=r.getValue(e);return t+("number"==typeof n?n:0)}),0),min:(e,t,r)=>{let n;return r.forEach((t=>{const r=t.getValue(e);null!=r&&(n>r||void 0===n&&r>=r)&&(n=r)})),n},max:(e,t,r)=>{let n;return r.forEach((t=>{const r=t.getValue(e);null!=r&&(n<r||void 0===n&&r>=r)&&(n=r)})),n},extent:(e,t,r)=>{let n,o;return r.forEach((t=>{const r=t.getValue(e);null!=r&&(void 0===n?r>=r&&(n=o=r):(n>r&&(n=r),o<r&&(o=r)))})),[n,o]},mean:(e,t)=>{let r=0,n=0;if(t.forEach((t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++r,n+=o)})),r)return n/r},median:(e,t)=>{if(!t.length)return;const r=t.map((t=>t.getValue(e)));if(!function(e){return Array.isArray(e)&&e.every((e=>"number"==typeof e))}(r))return;if(1===r.length)return r[0];const n=Math.floor(r.length/2),o=r.sort(((e,t)=>e-t));return r.length%2!=0?o[n]:(o[n-1]+o[n])/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length},$U={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,r;return null!=(t=null==(r=e.getValue())||null==r.toString?void 0:r.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:vU("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))},e.getCanGroup=()=>{var r,n;return(null==(r=e.columnDef.enableGrouping)||r)&&(null==(n=t.options.enableGrouping)||n)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return null==(r=t.getState().grouping)?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return null==(r=t.getState().grouping)?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=t.getCoreRowModel().flatRows[0],n=null==r?void 0:r.getValue(e.id);return"number"==typeof n?VU.sum:"[object Date]"===Object.prototype.toString.call(n)?VU.extent:void 0},e.getAggregationFn=()=>{var r,n;if(!e)throw new Error;return gU(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(r=null==(n=t.options.aggregationFns)?void 0:n[e.columnDef.aggregationFn])?r:VU[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var r,n;e.setGrouping(t?[]:null!=(r=null==(n=e.initialState)?void 0:n.grouping)?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const n=t.getColumn(r);return null!=n&&n.columnDef.getGroupingValue?(e._groupingValuesCache[r]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,t,r,n)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=r.subRows)||!t.length)}}};const UU={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:vU("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=wU((e=>[YU(t,e)]),(t=>t.findIndex((t=>t.id===e.id))),xU(t.options,"debugColumns")),e.getIsFirstColumn=r=>{var n;return(null==(n=YU(t,r)[0])?void 0:n.id)===e.id},e.getIsLastColumn=r=>{var n;const o=YU(t,r);return(null==(n=o[o.length-1])?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var r;e.setColumnOrder(t?[]:null!=(r=e.initialState.columnOrder)?r:[])},e._getOrderColumnsFn=wU((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,r)=>n=>{let o=[];if(null!=e&&e.length){const t=[...e],r=[...n];for(;r.length&&t.length;){const e=t.shift(),n=r.findIndex((t=>t.id===e));n>-1&&o.push(r.splice(n,1)[0])}o=[...o,...r]}else o=n;return function(e,t,r){if(null==t||!t.length||!r)return e;const n=e.filter((e=>!t.includes(e.id)));if("remove"===r)return n;const o=t.map((t=>e.find((e=>e.id===t)))).filter(Boolean);return[...o,...n]}(o,t,r)}),xU(e.options,"debugTable"))}},GU={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:vU("columnPinning",e)}),createColumn:(e,t)=>{e.pin=r=>{const n=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,o,i,a,s,u;return"right"===r?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter((e=>!(null!=n&&n.includes(e)))),right:[...(null!=(a=null==e?void 0:e.right)?a:[]).filter((e=>!(null!=n&&n.includes(e)))),...n]}:"left"===r?{left:[...(null!=(s=null==e?void 0:e.left)?s:[]).filter((e=>!(null!=n&&n.includes(e)))),...n],right:(null!=(u=null==e?void 0:e.right)?u:[]).filter((e=>!(null!=n&&n.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=n&&n.includes(e)))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter((e=>!(null!=n&&n.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var r,n,o;return(null==(r=e.columnDef.enablePinning)||r)&&(null==(n=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||n)})),e.getIsPinned=()=>{const r=e.getLeafColumns().map((e=>e.id)),{left:n,right:o}=t.getState().columnPinning,i=r.some((e=>null==n?void 0:n.includes(e))),a=r.some((e=>null==o?void 0:o.includes(e)));return i?"left":!!a&&"right"},e.getPinnedIndex=()=>{var r,n;const o=e.getIsPinned();return o?null!=(r=null==(n=t.getState().columnPinning)||null==(n=n[o])?void 0:n.indexOf(e.id))?r:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=wU((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,r)=>{const n=[...null!=t?t:[],...null!=r?r:[]];return e.filter((e=>!n.includes(e.column.id)))}),xU(t.options,"debugRows")),e.getLeftVisibleCells=wU((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left]),((e,t)=>{const r=(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})));return r}),xU(t.options,"debugRows")),e.getRightVisibleCells=wU((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>{const r=(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})));return r}),xU(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var r,n;return e.setColumnPinning(t?{left:[],right:[]}:null!=(r=null==(n=e.initialState)?void 0:n.columnPinning)?r:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var r;const n=e.getState().columnPinning;var o,i;return t?Boolean(null==(r=n[t])?void 0:r.length):Boolean((null==(o=n.left)?void 0:o.length)||(null==(i=n.right)?void 0:i.length))},e.getLeftLeafColumns=wU((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),xU(e.options,"debugColumns")),e.getRightLeafColumns=wU((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),xU(e.options,"debugColumns")),e.getCenterLeafColumns=wU((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,r)=>{const n=[...null!=t?t:[],...null!=r?r:[]];return e.filter((e=>!n.includes(e.id)))}),xU(e.options,"debugColumns"))}},WU={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},qU={getDefaultColumnDef:()=>WU,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:vU("columnSizing",e),onColumnSizingInfoChange:vU("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var r,n,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(r=e.columnDef.minSize)?r:WU.minSize,null!=(n=null!=i?i:e.columnDef.size)?n:WU.size),null!=(o=e.columnDef.maxSize)?o:WU.maxSize)},e.getStart=wU((e=>[e,YU(t,e),t.getState().columnSizing]),((t,r)=>r.slice(0,e.getIndex(t)).reduce(((e,t)=>e+t.getSize()),0)),xU(t.options,"debugColumns")),e.getAfter=wU((e=>[e,YU(t,e),t.getState().columnSizing]),((t,r)=>r.slice(e.getIndex(t)+1).reduce(((e,t)=>e+t.getSize()),0)),xU(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:r,...n}=t;return n}))},e.getCanResize=()=>{var r,n;return(null==(r=e.columnDef.enableResizing)||r)&&(null==(n=t.options.enableColumnResizing)||n)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const r=e=>{var n;e.subHeaders.length?e.subHeaders.forEach(r):t+=null!=(n=e.column.getSize())?n:0};return r(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=r=>{const n=t.getColumn(e.column.id),o=null==n?void 0:n.getCanResize();return i=>{if(!n||!o)return;if(null==i.persist||i.persist(),ZU(i)&&i.touches&&i.touches.length>1)return;const a=e.getSize(),s=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[n.id,n.getSize()]],u=ZU(i)?Math.round(i.touches[0].clientX):i.clientX,l={},c=(e,r)=>{"number"==typeof r&&(t.setColumnSizingInfo((e=>{var n,o;const i="rtl"===t.options.columnResizeDirection?-1:1,a=(r-(null!=(n=null==e?void 0:e.startOffset)?n:0))*i,s=Math.max(a/(null!=(o=null==e?void 0:e.startSize)?o:0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,r]=e;l[t]=Math.round(100*Math.max(r+r*s,0))/100})),{...e,deltaOffset:a,deltaPercentage:s}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...l}))))},f=e=>c("move",e),d=e=>{c("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},p=r||"undefined"!=typeof document?document:null,h={moveHandler:e=>f(e.clientX),upHandler:e=>{null==p||p.removeEventListener("mousemove",h.moveHandler),null==p||p.removeEventListener("mouseup",h.upHandler),d(e.clientX)}},m={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0].clientX),!1),upHandler:e=>{var t;null==p||p.removeEventListener("touchmove",m.moveHandler),null==p||p.removeEventListener("touchend",m.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(null==(t=e.touches[0])?void 0:t.clientX)}},y=!!function(){if("boolean"==typeof HU)return HU;let e=!1;try{const t={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,t),window.removeEventListener("test",r)}catch(t){e=!1}return HU=e,HU}()&&{passive:!1};ZU(i)?(null==p||p.addEventListener("touchmove",m.moveHandler,y),null==p||p.addEventListener("touchend",m.upHandler,y)):(null==p||p.addEventListener("mousemove",h.moveHandler,y),null==p||p.addEventListener("mouseup",h.upHandler,y)),t.setColumnSizingInfo((e=>({...e,startOffset:u,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:n.id})))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var r;e.setColumnSizing(t?{}:null!=(r=e.initialState.columnSizing)?r:{})},e.resetHeaderSizeInfo=t=>{var r;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(r=e.initialState.columnSizingInfo)?r:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,r;return null!=(t=null==(r=e.getHeaderGroups()[0])?void 0:r.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getLeftTotalSize=()=>{var t,r;return null!=(t=null==(r=e.getLeftHeaderGroups()[0])?void 0:r.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getCenterTotalSize=()=>{var t,r;return null!=(t=null==(r=e.getCenterHeaderGroups()[0])?void 0:r.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getRightTotalSize=()=>{var t,r;return null!=(t=null==(r=e.getRightHeaderGroups()[0])?void 0:r.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0}}};let HU=null;function ZU(e){return"touchstart"===e.type}const KU={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:vU("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=r=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:null!=r?r:!e.getIsVisible()})))},e.getIsVisible=()=>{var r,n;const o=e.columns;return null==(r=o.length?o.some((e=>e.getIsVisible())):null==(n=t.getState().columnVisibility)?void 0:n[e.id])||r},e.getCanHide=()=>{var r,n;return(null==(r=e.columnDef.enableHiding)||r)&&(null==(n=t.options.enableHiding)||n)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=wU((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),xU(t.options,"debugRows")),e.getVisibleCells=wU((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,r)=>[...e,...t,...r]),xU(t.options,"debugRows"))},createTable:e=>{const t=(t,r)=>wU((()=>[r(),r().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),xU(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,(()=>e.getAllFlatColumns())),e.getVisibleLeafColumns=t(0,(()=>e.getAllLeafColumns())),e.getLeftVisibleLeafColumns=t(0,(()=>e.getLeftLeafColumns())),e.getRightVisibleLeafColumns=t(0,(()=>e.getRightLeafColumns())),e.getCenterVisibleLeafColumns=t(0,(()=>e.getCenterLeafColumns())),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var r;e.setColumnVisibility(t?{}:null!=(r=e.initialState.columnVisibility)?r:{})},e.toggleAllColumnsVisible=t=>{var r;t=null!=(r=t)?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,r)=>({...e,[r.id]:t||!(null!=r.getCanHide&&r.getCanHide())})),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var r;e.toggleAllColumnsVisible(null==(r=t.target)?void 0:r.checked)}}};function YU(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const XU={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:vU("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var r;const n=null==(r=e.getCoreRowModel().flatRows[0])||null==(r=r._getAllCellsByColumnId()[t.id])?void 0:r.getValue();return"string"==typeof n||"number"==typeof n}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var r,n,o,i;return(null==(r=e.columnDef.enableGlobalFilter)||r)&&(null==(n=t.options.enableGlobalFilter)||n)&&(null==(o=t.options.enableFilters)||o)&&(null==(i=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||i)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>DU.includesString,e.getGlobalFilterFn=()=>{var t,r;const{globalFilterFn:n}=e.options;return gU(n)?n:"auto"===n?e.getGlobalAutoFilterFn():null!=(t=null==(r=e.options.filterFns)?void 0:r[n])?t:DU[n]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},QU={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:vU("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,r=!1;e._autoResetExpanded=()=>{var n,o;if(t){if(null!=(n=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?n:!e.options.manualExpanding){if(r)return;r=!0,e._queue((()=>{e.resetExpanded(),r=!1}))}}else e._queue((()=>{t=!0}))},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var r,n;e.setExpanded(t?{}:null!=(r=null==(n=e.initialState)?void 0:n.expanded)?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some((e=>e.getCanExpand())),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const r=e.split(".");t=Math.max(t,r.length)})),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=r=>{t.setExpanded((n=>{var o;const i=!0===n||!(null==n||!n[e.id]);let a={};if(!0===n?Object.keys(t.getRowModel().rowsById).forEach((e=>{a[e]=!0})):a=n,r=null!=(o=r)?o:!i,!i&&r)return{...a,[e.id]:!0};if(i&&!r){const{[e.id]:t,...r}=a;return r}return n}))},e.getIsExpanded=()=>{var r;const n=t.getState().expanded;return!!(null!=(r=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?r:!0===n||(null==n?void 0:n[e.id]))},e.getCanExpand=()=>{var r,n,o;return null!=(r=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?r:(null==(n=t.options.enableExpanding)||n)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let r=!0,n=e;for(;r&&n.parentId;)n=t.getRow(n.parentId,!0),r=n.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},JU={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:vU("pagination",e)}),createTable:e=>{let t=!1,r=!1;e._autoResetPageIndex=()=>{var n,o;if(t){if(null!=(n=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?n:!e.options.manualPagination){if(r)return;r=!0,e._queue((()=>{e.resetPageIndex(),r=!1}))}}else e._queue((()=>{t=!0}))},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>yU(t,e))),e.resetPagination=t=>{var r;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(r=e.initialState.pagination)?r:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination((r=>{let n=yU(t,r.pageIndex);const o=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return n=Math.max(0,Math.min(n,o)),{...r,pageIndex:n}}))},e.resetPageIndex=t=>{var r,n;e.setPageIndex(t?0:null!=(r=null==(n=e.initialState)||null==(n=n.pagination)?void 0:n.pageIndex)?r:0)},e.resetPageSize=t=>{var r,n;e.setPageSize(t?10:null!=(r=null==(n=e.initialState)||null==(n=n.pagination)?void 0:n.pageSize)?r:10)},e.setPageSize=t=>{e.setPagination((e=>{const r=Math.max(1,yU(t,e.pageSize)),n=e.pageSize*e.pageIndex,o=Math.floor(n/r);return{...e,pageIndex:o,pageSize:r}}))},e.setPageCount=t=>e.setPagination((r=>{var n;let o=yU(t,null!=(n=e.options.pageCount)?n:-1);return"number"==typeof o&&(o=Math.max(-1,o)),{...r,pageCount:o}})),e.getPageOptions=wU((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),xU(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,r=e.getPageCount();return-1===r||0!==r&&t<r-1},e.previousPage=()=>e.setPageIndex((e=>e-1)),e.nextPage=()=>e.setPageIndex((e=>e+1)),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},eG={getInitialState:e=>({rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onRowPinningChange:vU("rowPinning",e)}),createRow:(e,t)=>{e.pin=(r,n,o)=>{const i=n?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],a=o?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],s=new Set([...a,e.id,...i]);t.setRowPinning((e=>{var t,n,o,i,a,u;return"bottom"===r?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter((e=>!(null!=s&&s.has(e)))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter((e=>!(null!=s&&s.has(e)))),...Array.from(s)]}:"top"===r?{top:[...(null!=(a=null==e?void 0:e.top)?a:[]).filter((e=>!(null!=s&&s.has(e)))),...Array.from(s)],bottom:(null!=(u=null==e?void 0:e.bottom)?u:[]).filter((e=>!(null!=s&&s.has(e))))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter((e=>!(null!=s&&s.has(e)))),bottom:(null!=(n=null==e?void 0:e.bottom)?n:[]).filter((e=>!(null!=s&&s.has(e))))}}))},e.getCanPin=()=>{var r;const{enableRowPinning:n,enablePinning:o}=t.options;return"function"==typeof n?n(e):null==(r=null!=n?n:o)||r},e.getIsPinned=()=>{const r=[e.id],{top:n,bottom:o}=t.getState().rowPinning,i=r.some((e=>null==n?void 0:n.includes(e))),a=r.some((e=>null==o?void 0:o.includes(e)));return i?"top":!!a&&"bottom"},e.getPinnedIndex=()=>{var r,n;const o=e.getIsPinned();if(!o)return-1;const i=null==(r="top"===o?t.getTopRows():t.getBottomRows())?void 0:r.map((e=>{let{id:t}=e;return t}));return null!=(n=null==i?void 0:i.indexOf(e.id))?n:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var r,n;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(r=null==(n=e.initialState)?void 0:n.rowPinning)?r:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var r;const n=e.getState().rowPinning;var o,i;return t?Boolean(null==(r=n[t])?void 0:r.length):Boolean((null==(o=n.top)?void 0:o.length)||(null==(i=n.bottom)?void 0:i.length))},e._getPinnedRows=(t,r,n)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=r?r:[]).map((t=>{const r=e.getRow(t,!0);return r.getIsAllParentsExpanded()?r:null})):(null!=r?r:[]).map((e=>t.find((t=>t.id===e))))).filter(Boolean).map((e=>({...e,position:n})))},e.getTopRows=wU((()=>[e.getRowModel().rows,e.getState().rowPinning.top]),((t,r)=>e._getPinnedRows(t,r,"top")),xU(e.options,"debugRows")),e.getBottomRows=wU((()=>[e.getRowModel().rows,e.getState().rowPinning.bottom]),((t,r)=>e._getPinnedRows(t,r,"bottom")),xU(e.options,"debugRows")),e.getCenterRows=wU((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,r)=>{const n=new Set([...null!=t?t:[],...null!=r?r:[]]);return e.filter((e=>!n.has(e.id)))}),xU(e.options,"debugRows"))}},tG={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:vU("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var r;return e.setRowSelection(t?{}:null!=(r=e.initialState.rowSelection)?r:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection((r=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const n={...r},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach((e=>{e.getCanSelect()&&(n[e.id]=!0)})):o.forEach((e=>{delete n[e.id]})),n}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((r=>{const n=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...r};return e.getRowModel().rows.forEach((t=>{rG(o,t.id,n,!0,e)})),o})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=wU((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,r)=>Object.keys(t).length?nG(e,r):{rows:[],flatRows:[],rowsById:{}}),xU(e.options,"debugTable")),e.getFilteredSelectedRowModel=wU((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,r)=>Object.keys(t).length?nG(e,r):{rows:[],flatRows:[],rowsById:{}}),xU(e.options,"debugTable")),e.getGroupedSelectedRowModel=wU((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,r)=>Object.keys(t).length?nG(e,r):{rows:[],flatRows:[],rowsById:{}}),xU(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let n=Boolean(t.length&&Object.keys(r).length);return n&&t.some((e=>e.getCanSelect()&&!r[e.id]))&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:r}=e.getState();let n=!!t.length;return n&&t.some((e=>!r[e.id]))&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var t;const r=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return r>0&&r<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter((e=>e.getCanSelect())).some((e=>e.getIsSelected()||e.getIsSomeSelected()))},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(r,n)=>{const o=e.getIsSelected();t.setRowSelection((i=>{var a;if(r=void 0!==r?r:!o,e.getCanSelect()&&o===r)return i;const s={...i};return rG(s,e.id,r,null==(a=null==n?void 0:n.selectChildren)||a,t),s}))},e.getIsSelected=()=>{const{rowSelection:r}=t.getState();return oG(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=t.getState();return"some"===iG(e,r)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=t.getState();return"all"===iG(e,r)},e.getCanSelect=()=>{var r;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(r=t.options.enableRowSelection)||r},e.getCanSelectSubRows=()=>{var r;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(r=t.options.enableSubRowSelection)||r},e.getCanMultiSelect=()=>{var r;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(r=t.options.enableMultiRowSelection)||r},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return r=>{var n;t&&e.toggleSelected(null==(n=r.target)?void 0:n.checked)}}}},rG=(e,t,r,n,o)=>{var i;const a=o.getRow(t,!0);r?(a.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),a.getCanSelect()&&(e[t]=!0)):delete e[t],n&&null!=(i=a.subRows)&&i.length&&a.getCanSelectSubRows()&&a.subRows.forEach((t=>rG(e,t.id,r,n,o)))};function nG(e,t){const r=e.getState().rowSelection,n=[],o={},i=function(e,t){return e.map((e=>{var t;const a=oG(e,r);if(a&&(n.push(e),o[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),a)return e})).filter(Boolean)};return{rows:i(t.rows),flatRows:n,rowsById:o}}function oG(e,t){var r;return null!=(r=t[e.id])&&r}function iG(e,t,r){var n;if(null==(n=e.subRows)||!n.length)return!1;let o=!0,i=!1;return e.subRows.forEach((e=>{if((!i||o)&&(e.getCanSelect()&&(oG(e,t)?i=!0:o=!1),e.subRows&&e.subRows.length)){const r=iG(e,t);"all"===r?i=!0:"some"===r?(i=!0,o=!1):o=!1}})),o?"all":!!i&&"some"}const aG=/([0-9]+)/gm;function sG(e,t){return e===t?0:e>t?1:-1}function uG(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function lG(e,t){const r=e.split(aG).filter(Boolean),n=t.split(aG).filter(Boolean);for(;r.length&&n.length;){const e=r.shift(),t=n.shift(),o=parseInt(e,10),i=parseInt(t,10),a=[o,i].sort();if(isNaN(a[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(a[1]))return isNaN(o)?-1:1;if(o>i)return 1;if(i>o)return-1}}return r.length-n.length}const cG={alphanumeric:(e,t,r)=>lG(uG(e.getValue(r)).toLowerCase(),uG(t.getValue(r)).toLowerCase()),alphanumericCaseSensitive:(e,t,r)=>lG(uG(e.getValue(r)),uG(t.getValue(r))),text:(e,t,r)=>sG(uG(e.getValue(r)).toLowerCase(),uG(t.getValue(r)).toLowerCase()),textCaseSensitive:(e,t,r)=>sG(uG(e.getValue(r)),uG(t.getValue(r))),datetime:(e,t,r)=>{const n=e.getValue(r),o=t.getValue(r);return n>o?1:n<o?-1:0},basic:(e,t,r)=>sG(e.getValue(r),t.getValue(r))},fG={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:vU("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const r=t.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const t of r){const r=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(r))return cG.datetime;if("string"==typeof r&&(n=!0,r.split(aG).length>1))return cG.alphanumeric}return n?cG.text:cG.basic},e.getAutoSortDir=()=>{const r=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==r?void 0:r.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var r,n;if(!e)throw new Error;return gU(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(r=null==(n=t.options.sortingFns)?void 0:n[e.columnDef.sortingFn])?r:cG[e.columnDef.sortingFn]},e.toggleSorting=(r,n)=>{const o=e.getNextSortingOrder(),i=null!=r;t.setSorting((a=>{const s=null==a?void 0:a.find((t=>t.id===e.id)),u=null==a?void 0:a.findIndex((t=>t.id===e.id));let l,c=[],f=i?r:"desc"===o;var d;(l=null!=a&&a.length&&e.getCanMultiSort()&&n?s?"toggle":"add":null!=a&&a.length&&u!==a.length-1?"replace":s?"toggle":"replace","toggle"===l&&(i||o||(l="remove")),"add"===l)?(c=[...a,{id:e.id,desc:f}],c.splice(0,c.length-(null!=(d=t.options.maxMultiSortColCount)?d:Number.MAX_SAFE_INTEGER))):c="toggle"===l?a.map((t=>t.id===e.id?{...t,desc:f}:t)):"remove"===l?a.filter((t=>t.id!==e.id)):[{id:e.id,desc:f}];return c}))},e.getFirstSortDir=()=>{var r,n;return(null!=(r=null!=(n=e.columnDef.sortDescFirst)?n:t.options.sortDescFirst)?r:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=r=>{var n,o;const i=e.getFirstSortDir(),a=e.getIsSorted();return a?!!(a===i||null!=(n=t.options.enableSortingRemoval)&&!n||r&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===a?"asc":"desc"):i},e.getCanSort=()=>{var r,n;return(null==(r=e.columnDef.enableSorting)||r)&&(null==(n=t.options.enableSorting)||n)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,n;return null!=(r=null!=(n=e.columnDef.enableMultiSort)?n:t.options.enableMultiSort)?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const n=null==(r=t.getState().sorting)?void 0:r.find((t=>t.id===e.id));return!!n&&(n.desc?"desc":"asc")},e.getSortIndex=()=>{var r,n;return null!=(r=null==(n=t.getState().sorting)?void 0:n.findIndex((t=>t.id===e.id)))?r:-1},e.clearSorting=()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return n=>{r&&(null==n.persist||n.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(n))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var r,n;e.setSorting(t?[]:null!=(r=null==(n=e.initialState)?void 0:n.sorting)?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},dG=[SU,KU,UU,GU,PU,zU,{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},XU,fG,$U,QU,JU,eG,tG,qU];function pG(e){var t,r;const n=[...dG,...null!=(t=e._features)?t:[]];let o={_features:n};const i=o._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(o))),{});let a={...null!=(r=e.initialState)?r:{}};o._features.forEach((e=>{var t;a=null!=(t=null==e.getInitialState?void 0:e.getInitialState(a))?t:a}));const s=[];let u=!1;const l={_features:n,options:{...i,...e},initialState:a,_queue:e=>{s.push(e),u||(u=!0,Promise.resolve().then((()=>{for(;s.length;)s.shift()();u=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{o.setState(o.initialState)},setOptions:e=>{const t=yU(e,o.options);o.options=(e=>o.options.mergeOptions?o.options.mergeOptions(i,e):{...i,...e})(t)},getState:()=>o.options.state,setState:e=>{null==o.options.onStateChange||o.options.onStateChange(e)},_getRowId:(e,t,r)=>{var n;return null!=(n=null==o.options.getRowId?void 0:o.options.getRowId(e,t,r))?n:`${r?[r.id,t].join("."):t}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?o.getPrePaginationRowModel():o.getRowModel()).rowsById[e];if(!r&&(r=o.getCoreRowModel().rowsById[e],!r))throw new Error;return r},_getDefaultColumnDef:wU((()=>[o.options.defaultColumn]),(e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,r;return null!=(t=null==(r=e.renderValue())||null==r.toString?void 0:r.toString())?t:null},...o._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),xU(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:wU((()=>[o._getColumnDefs()]),(e=>{const t=function(e,r,n){return void 0===n&&(n=0),e.map((e=>{const i=function(e,t,r,n){var o,i;const a={...e._getDefaultColumnDef(),...t},s=a.accessorKey;let u,l=null!=(o=null!=(i=a.id)?i:s?"function"==typeof String.prototype.replaceAll?s.replaceAll(".","_"):s.replace(/\./g,"_"):void 0)?o:"string"==typeof a.header?a.header:void 0;if(a.accessorFn?u=a.accessorFn:s&&(u=s.includes(".")?e=>{let t=e;for(const e of s.split(".")){var r;t=null==(r=t)?void 0:r[e]}return t}:e=>e[a.accessorKey]),!l)throw new Error;let c={id:`${String(l)}`,accessorFn:u,parent:n,depth:r,columnDef:a,columns:[],getFlatColumns:wU((()=>[!0]),(()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),xU(e.options,"debugColumns")),getLeafColumns:wU((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=c.columns)&&t.length){let t=c.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[c]}),xU(e.options,"debugColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(c,e);return c}(o,e,n,r),a=e;return i.columns=a.columns?t(a.columns,i,n+1):[],i}))};return t(e)}),xU(e,"debugColumns")),getAllFlatColumns:wU((()=>[o.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),xU(e,"debugColumns")),_getAllFlatColumnsById:wU((()=>[o.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),xU(e,"debugColumns")),getAllLeafColumns:wU((()=>[o.getAllColumns(),o._getOrderColumnsFn()]),((e,t)=>{let r=e.flatMap((e=>e.getLeafColumns()));return t(r)}),xU(e,"debugColumns")),getColumn:e=>o._getAllFlatColumnsById()[e]};Object.assign(o,l);for(let e=0;e<o._features.length;e++){const t=o._features[e];null==t||null==t.createTable||t.createTable(o)}return o}function hG(e,t,r){return r.options.filterFromLeafRows?function(e,t,r){var n;const o=[],i={},a=null!=(n=r.options.maxLeafRowFilterDepth)?n:100,s=function(e,n){void 0===n&&(n=0);const u=[];for(let c=0;c<e.length;c++){var l;let f=e[c];const d=jU(r,f.id,f.original,f.index,f.depth,void 0,f.parentId);if(d.columnFilters=f.columnFilters,null!=(l=f.subRows)&&l.length&&n<a){if(d.subRows=s(f.subRows,n+1),f=d,t(f)&&!d.subRows.length){u.push(f),i[f.id]=f,o.push(f);continue}if(t(f)||d.subRows.length){u.push(f),i[f.id]=f,o.push(f);continue}}else f=d,t(f)&&(u.push(f),i[f.id]=f,o.push(f))}return u};return{rows:s(e),flatRows:o,rowsById:i}}(e,t,r):function(e,t,r){var n;const o=[],i={},a=null!=(n=r.options.maxLeafRowFilterDepth)?n:100,s=function(e,n){void 0===n&&(n=0);const u=[];for(let c=0;c<e.length;c++){let f=e[c];if(t(f)){var l;if(null!=(l=f.subRows)&&l.length&&n<a){const e=jU(r,f.id,f.original,f.index,f.depth,void 0,f.parentId);e.subRows=s(f.subRows,n+1),f=e}u.push(f),o.push(f),i[f.id]=f}}return u};return{rows:s(e),flatRows:o,rowsById:i}}(e,t,r)}function mG(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(n=e)||"function"==typeof n||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(n)?r.createElement(e,t):e:null;var n}const yG=mo("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),vG=mo("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),gG=mo("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var bG=["className"],wG=["className"],xG=["className"],_G=["className","isActive","size"],OG=["className"],SG=["className"],EG=["className"];function jG(){return jG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jG.apply(null,arguments)}function PG(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var kG=function(e){var t=e.className,r=PG(e,bG);return io("nav",jG({role:"navigation","aria-label":"pagination",className:Nr("mx-auto flex w-full justify-center",t)},r))};kG.displayName="Pagination";var CG=r.forwardRef((function(e,t){var r=e.className,n=PG(e,wG);return io("ul",jG({ref:t,className:Nr("flex flex-row items-center gap-1",r)},n))}));CG.displayName="PaginationContent";var AG=r.forwardRef((function(e,t){var r=e.className,n=PG(e,xG);return io("li",jG({ref:t,className:Nr("",r)},n))}));AG.displayName="PaginationItem";var NG=function(e){var t=e.className,r=e.isActive,n=e.size,o=void 0===n?"icon":n,i=PG(e,_G);return io("button",jG({"aria-current":r?"page":void 0,className:Nr(uo({variant:r?"outline":"ghost",size:o}),t)},i))};NG.displayName="PaginationLink";var TG=function(e){var t=e.className,r=PG(e,OG);return io(NG,jG({"aria-label":"Go to previous page",size:"default",className:Nr("gap-1 pl-2.5",t)},r),io(yG,{className:"h-4 w-4"}),io("span",null,"Previous"))};TG.displayName="PaginationPrevious";var MG=function(e){var t=e.className,r=PG(e,SG);return io(NG,jG({"aria-label":"Go to next page",size:"default",className:Nr("gap-1 pr-2.5",t)},r),io("span",null,"Next"),io(vG,{className:"h-4 w-4"}))};MG.displayName="PaginationNext";var RG=function(e){var t=e.className,r=PG(e,EG);return io("span",jG({"aria-hidden":!0,className:Nr("flex h-9 w-9 items-center justify-center",t)},r),io(gG,{className:"h-4 w-4"}),io("span",{className:"sr-only"},"More pages"))};function LG(e){var t=e.table,r=e.loading,n=void 0!==r&&r;return io("div",{className:"flex flex-wrap items-center justify-between space-x-2 py-4"},io("div",{className:"flex-1 text-sm text-muted-foreground hidden lg:block"},t.getFilteredSelectedRowModel().rows.length," of"," ",t.getFilteredRowModel().rows.length," row(s) selected."),io("div",{className:"flex-1 flex space-x-2 items-center justify-center"},io("p",{className:"text-sm font-medium"},(0,Lo.__)("Rows per page","trigger")),io("select",{value:t.getState().pagination.pageSize,onChange:function(e){t.setPageSize(Number(e.target.value))},className:"h-8 w-[70px] rounded-md border border-input bg-transparent px-2 py-1 text-sm"},[10,20,30,40,50].map((function(e){return io("option",{key:e,value:e},e)})))),io(kG,{className:"flex-1 justify-end"},io(CG,{className:"gap-2"},io(AG,null,io(TG,{onClick:function(){return t.previousPage()},disabled:!t.getCanPreviousPage()||n,"aria-disabled":!t.getCanPreviousPage()||n,className:"h-8 min-w-8 px-2"})),Array.from({length:t.getPageCount()},(function(e,r){var n=r+1,o=t.getState().pagination.pageIndex+1;return 1===n||n===t.getPageCount()||n>=o-1&&n<=o+1?io(AG,{key:r},io(NG,{onClick:function(){return t.setPageIndex(r)},isActive:o===n,className:"h-8 min-w-8 px-3"},n)):2===n&&o>3||n===t.getPageCount()-1&&o<t.getPageCount()-2?io(AG,{key:r},io(RG,{className:"h-8"})):null})),io(AG,null,io(MG,{onClick:function(){return t.nextPage()},disabled:!t.getCanNextPage()||n,"aria-disabled":!t.getCanNextPage()||n,className:"h-8 min-w-8 px-2"})))))}RG.displayName="PaginationEllipsis";var IG=o(2543),DG=o(1594);function FG(e){var t=e.table,n=e.searchKey,o=e.searchPlaceholder,i=void 0===o?"Search...":o,a=e.onSearch,s=e.onDeleteSelected,u=e.enableSearch,l=void 0!==u&&u,c=e.renderCustomContent,f=(0,r.useCallback)((0,IG.debounce)((function(e){if(a)a(e);else if(n){var r;null===(r=t.getColumn(n))||void 0===r||r.setFilterValue(e)}}),500),[a,n,t]),d=t.getFilteredSelectedRowModel().rows;return io("div",{className:"flex items-center justify-between h-12"},c?c():io(DG.Fragment,null,io("div",{className:"flex-1"},io("h3",{className:"text-lg font-medium"},(0,Lo.__)("Email Logs","trigger"))),io("div",{className:"flex items-center gap-4"},d.length>0?io("div",{className:"flex items-center gap-4"},io("span",{className:"text-sm text-muted-foreground"},d.length," ",(0,Lo.__)("selected","trigger")),s&&io(lo,{variant:"destructive",size:"sm",onClick:s,className:"flex items-center gap-2"},io(Ro,{className:"h-4 w-4"}),(0,Lo.__)("Delete Selected","trigger"))):l?io(xs,{placeholder:i,onChange:function(e){f(e.target.value)},className:"w-[300px]"}):null)))}function zG(e){var t=e.columns,r=e.rows,n=void 0===r?5:r;return io(Co,null,Array.from({length:n}).map((function(e,r){return io(Ao,{key:r},Array.from({length:t}).map((function(e,t){return io(To,{key:t},io("div",{className:"h-6 w-full animate-pulse rounded bg-gray-200"}))})))})))}function BG(e){var t,n=e.columns,o=e.data,i=e.pageCount,a=e.loading,s=void 0!==a&&a,u=e.sorting,l=void 0===u?[]:u,c=e.pagination,f=e.columnFilters,d=void 0===f?[]:f,p=e.rowSelection,h=void 0===p?{}:p,m=e.searchKey,y=e.searchPlaceholder,v=e.onSearch,g=e.onPaginationChange,b=e.onSortingChange,w=e.onColumnFiltersChange,x=e.onRowSelectionChange,_=e.onDeleteSelected,O=e.enableRowSelection,S=void 0!==O&&O,E=e.enableSearch,j=void 0!==E&&E,P=e.enablePagination,k=void 0===P||P,C=e.renderToolbar,A=e.renderEmpty,N=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=r.useState((()=>({current:pG(t)}))),[o,i]=r.useState((()=>n.current.initialState));return n.current.setOptions((t=>({...t,...e,state:{...o,...e.state},onStateChange:t=>{i(t),null==e.onStateChange||e.onStateChange(t)}}))),n.current}({data:o,columns:n,pageCount:i,state:{sorting:l,pagination:c,columnFilters:d,rowSelection:h},enableRowSelection:S,onRowSelectionChange:x,onPaginationChange:g,onSortingChange:b,getSortedRowModel:e=>wU((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,r)=>{if(!r.rows.length||null==t||!t.length)return r;const n=e.getState().sorting,o=[],i=n.filter((t=>{var r;return null==(r=e.getColumn(t.id))?void 0:r.getCanSort()})),a={};i.forEach((t=>{const r=e.getColumn(t.id);r&&(a[t.id]={sortUndefined:r.columnDef.sortUndefined,invertSorting:r.columnDef.invertSorting,sortingFn:r.getSortingFn()})}));const s=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let n=0;n<i.length;n+=1){var r;const o=i[n],s=a[o.id],u=s.sortUndefined,l=null!=(r=null==o?void 0:o.desc)&&r;let c=0;if(u){const r=void 0===e.getValue(o.id),n=void 0===t.getValue(o.id);if(r||n){if("first"===u)return r?-1:1;if("last"===u)return r?1:-1;c=r&&n?0:r?u:-u}}if(0===c&&(c=s.sortingFn(e,t,o.id)),0!==c)return l&&(c*=-1),s.invertSorting&&(c*=-1),c}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))})),t};return{rows:s(r.rows),flatRows:o,rowsById:r.rowsById}}),xU(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),getCoreRowModel:e=>wU((()=>[e.options.data]),(t=>{const r={rows:[],flatRows:[],rowsById:{}},n=function(t,o,i){void 0===o&&(o=0);const a=[];for(let u=0;u<t.length;u++){const l=jU(e,e._getRowId(t[u],u,i),t[u],u,o,void 0,null==i?void 0:i.id);var s;r.flatRows.push(l),r.rowsById[l.id]=l,a.push(l),e.options.getSubRows&&(l.originalSubRows=e.options.getSubRows(t[u],u),null!=(s=l.originalSubRows)&&s.length&&(l.subRows=n(l.originalSubRows,o+1,l)))}return a};return r.rows=n(t),r}),xU(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),onColumnFiltersChange:w,getFilteredRowModel:e=>wU((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,r,n)=>{if(!t.rows.length||(null==r||!r.length)&&!n){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],i=[];(null!=r?r:[]).forEach((t=>{var r;const n=e.getColumn(t.id);if(!n)return;const i=n.getFilterFn();i&&o.push({id:t.id,filterFn:i,resolvedValue:null!=(r=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?r:t.value})}));const a=(null!=r?r:[]).map((e=>e.id)),s=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let l,c;n&&s&&u.length&&(a.push("__global__"),u.forEach((e=>{var t;i.push({id:e.id,filterFn:s,resolvedValue:null!=(t=null==s.resolveFilterValue?void 0:s.resolveFilterValue(n))?t:n})})));for(let e=0;e<t.flatRows.length;e++){const r=t.flatRows[e];if(r.columnFilters={},o.length)for(let e=0;e<o.length;e++){l=o[e];const t=l.id;r.columnFilters[t]=l.filterFn(r,t,l.resolvedValue,(e=>{r.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){c=i[e];const t=c.id;if(c.filterFn(r,t,c.resolvedValue,(e=>{r.columnFiltersMeta[t]=e}))){r.columnFilters.__global__=!0;break}}!0!==r.columnFilters.__global__&&(r.columnFilters.__global__=!1)}}return hG(t.rows,(e=>{for(let t=0;t<a.length;t++)if(!1===e.columnFilters[a[t]])return!1;return!0}),e)}),xU(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),manualPagination:!0,getRowId:e.getRowId});return io("div",{className:"space-y-4"},(C||j)&&io(FG,{table:N,searchKey:m,searchPlaceholder:y,onSearch:v,onDeleteSelected:_,enableSearch:j,renderCustomContent:C}),io("div",{className:"rounded-md border"},io(Po,null,io(ko,null,N.getHeaderGroups().map((function(e){return io(Ao,{key:e.id},e.headers.map((function(e){return io(No,{key:e.id},e.isPlaceholder?null:mG(e.column.columnDef.header,e.getContext()))})))}))),s?io(zG,{columns:n.length}):null!==(t=N.getRowModel().rows)&&void 0!==t&&t.length?io(Co,null,N.getRowModel().rows.map((function(e){return io(Ao,{key:e.id,"data-state":e.getIsSelected()&&"selected"},e.getVisibleCells().map((function(e){return io(To,{key:e.id},mG(e.column.columnDef.cell,e.getContext()))})))}))):io(Co,null,io(Ao,null,io(To,{colSpan:n.length,className:"h-24 text-center"},A?A():"No results found."))))),k&&io(LG,{table:N,loading:s}))}function VG(e){return VG="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},VG(e)}function $G(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function UG(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$G(Object(r),!0).forEach((function(t){GG(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$G(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function GG(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=VG(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=VG(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==VG(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WG(){WG=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==VG(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(VG(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function qG(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function HG(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){qG(i,n,o,a,s,"next",e)}function s(e){qG(i,n,o,a,s,"throw",e)}a(void 0)}))}}function ZG(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return KG(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?KG(e,t):void 0}}(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.")}()}function KG(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var YG=function(e){var t=e.title,n=e.children,o=e.defaultOpen,i=void 0!==o&&o,a=ZG((0,r.useState)(i),2),s=a[0],u=a[1];return io("div",{className:"border rounded-lg"},io("button",{className:"w-full px-4 py-3 flex items-center justify-between text-left font-medium hover:bg-gray-50",onClick:function(){return u(!s)}},io("span",null,t),io(s?H$:ng,{className:"h-4 w-4 text-gray-500"})),s&&io("div",{className:"px-4 py-3 border-t"},n))};const XG=function(){var e=ZG((0,r.useState)([]),2),t=e[0],n=e[1],o=ZG((0,r.useState)([]),2),i=o[0],a=o[1],s=ZG((0,r.useState)({pageIndex:0,pageSize:10}),2),u=s[0],l=u.pageIndex,c=u.pageSize,f=s[1],d=ZG((0,r.useState)([]),2),p=d[0],h=d[1],m=ZG((0,r.useState)(0),2),y=m[0],v=m[1],g=ZG((0,r.useState)(!0),2),b=g[0],w=g[1],x=ZG((0,r.useState)(null),2),_=x[0],O=x[1],S=ZG((0,r.useState)(null),2),E=S[0],j=S[1],P=ZG((0,r.useState)(!1),2),k=P[0],C=P[1],A=ZG((0,r.useState)(!1),2),N=A[0],T=A[1],M=ZG((0,r.useState)({}),2),R=M[0],L=M[1],I=ZG((0,r.useState)(""),2),D=I[0],F=I[1],z=ZG((0,r.useState)(null),2),B=z[0],V=z[1],$=function(){var e=HG(WG().mark((function e(t){var r,n,o;return WG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return C(!0),e.prev=1,(r=new FormData).append("action","trigger_delete_email_log"),r.append("trigger_nonce",rd.nonce_value),r.append("id",t.toString()),e.next=8,fetch(rd.ajax_url,{method:"POST",body:r});case 8:return n=e.sent,e.next=11,n.json();case 11:if(200!==(null==(o=e.sent)?void 0:o.status_code)){e.next=18;break}return J$.success((null==o?void 0:o.message)||(0,Lo.__)("Email log deleted successfully","trigger")),e.next=16,W({page:l+1,per_page:c,search:D});case 16:e.next=19;break;case 18:J$.error((null==o?void 0:o.message)||(0,Lo.__)("Failed to delete email log","trigger"));case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(1),J$.error((0,Lo.__)("Failed to delete email log","trigger"));case 24:return e.prev=24,C(!1),j(null),e.finish(24);case 28:case"end":return e.stop()}}),e,null,[[1,21,24,28]])})));return function(t){return e.apply(this,arguments)}}(),U=function(){var e=HG(WG().mark((function e(){var t,r,n,o;return WG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E){e.next=2;break}return e.abrupt("return");case 2:return T(!0),e.prev=3,t=Object.keys(R).map((function(e){return parseInt(e)})).filter(Boolean),(r=new FormData).append("action","trigger_bulk_delete_email_logs"),r.append("trigger_nonce",rd.nonce_value),r.append("ids",JSON.stringify(t)),e.next=11,fetch(rd.ajax_url,{method:"POST",body:r});case 11:return n=e.sent,e.next=14,n.json();case 14:if(200!==(null==(o=e.sent)?void 0:o.status_code)){e.next=22;break}return L({}),J$.success((0,Lo.__)("Selected email logs deleted successfully","trigger")),e.next=20,W({page:l+1,per_page:c,search:D});case 20:e.next=23;break;case 22:J$.error((null==o?void 0:o.message)||(0,Lo.__)("Failed to delete email logs","trigger"));case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(3),J$.error((0,Lo.__)("Failed to delete email logs","trigger"));case 28:return e.prev=28,T(!1),j(null),e.finish(28);case 32:case"end":return e.stop()}}),e,null,[[3,25,28,32]])})));return function(){return e.apply(this,arguments)}}(),G=[{id:"select",header:function(e){var t=e.table;return io(mU,{checked:t.getIsAllPageRowsSelected()||t.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:function(e){return t.toggleAllPageRowsSelected(!!e)},"aria-label":(0,Lo.__)("Select all","trigger")})},cell:function(e){var t=e.row,r=e.table.getRowModel().rows.findIndex((function(e){return e.id===t.id}));return io(mU,{checked:t.getIsSelected(),onCheckedChange:function(e){var t,n=window.event;!function(e,t,r){var n=p[e];if(n){if(r&&null!==B){for(var o=Math.min(e,B),i=Math.max(e,B),a=UG({},R),s=o;s<=i;s++){var u=p[s];u&&(a[u.id]=t)}L(a)}else L((function(e){return UG(UG({},e),{},GG({},n.id,t))}));V(e)}}(r,e,null!==(t=null==n?void 0:n.shiftKey)&&void 0!==t&&t)},"aria-label":(0,Lo.__)("Select row","trigger")})},enableSorting:!1,enableHiding:!1},{accessorKey:"mail_to",header:(0,Lo.__)("To","trigger")},{accessorKey:"subject",header:(0,Lo.__)("Subject","trigger")},{accessorKey:"status",header:(0,Lo.__)("Status","trigger"),cell:function(e){var t=e.row.getValue("status");return io(yw,{variant:"outline",className:"".concat("success"===t?"bg-green-50 text-green-700 border-green-200":"bg-red-50 text-red-700 border-red-200")},"success"===t?"Successful":"Failed")}},{accessorKey:"provider",header:(0,Lo.__)("Provider","trigger"),cell:function(e){var t=e.row.getValue("provider");return sp(t)}},{accessorKey:"created_at",header:(0,Lo.__)("Date","trigger"),cell:function(e){var t=e.row;return z$(new Date(t.getValue("created_at")),"PPpp")}},{id:"actions",header:(0,Lo.__)("Actions","trigger"),cell:function(e){var t=e.row.original;return io("div",{className:"flex items-center gap-2"},io(lo,{variant:"ghost",size:"icon",onClick:function(){return function(e){O(e)}(t)},className:"h-8 w-8 p-0"},io(Z$,{className:"h-4 w-4"})),io(lo,{variant:"ghost",size:"icon",onClick:function(){return j(t)},className:"h-8 w-8 p-0 text-red-500 hover:text-red-600 hover:bg-red-50"},io(Ro,{className:"h-4 w-4"})))}}],W=function(){var e=HG(WG().mark((function e(t){var r,n,o;return WG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.prev=1,(r=new FormData).append("action","trigger_fetch_email_logs"),r.append("trigger_nonce",rd.nonce_value),r.append("page",t.page.toString()),r.append("per_page",t.per_page.toString()),t.search&&r.append("search",t.search),e.next=10,fetch(rd.ajax_url,{method:"POST",body:r});case 10:return n=e.sent,e.next=13,n.json();case 13:200===(o=e.sent).status_code?(h(o.data.email_logs),v(o.data.meta.total_pages)):J$.error((null==o?void 0:o.message)||(0,Lo.__)("Failed to fetch email logs","trigger")),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(1),J$.error((0,Lo.__)("Failed to fetch email logs","trigger"));case 20:return e.prev=20,w(!1),e.finish(20);case 23:case"end":return e.stop()}}),e,null,[[1,17,20,23]])})));return function(t){return e.apply(this,arguments)}}();(0,r.useEffect)((function(){W({page:l+1,per_page:c,search:D})}),[l,c]);return io("div",{className:"p-4 space-y-4"},io(BG,{columns:G,data:p,pageCount:y,loading:b,sorting:t,pagination:{pageIndex:l,pageSize:c},columnFilters:i,rowSelection:R,searchKey:"subject",searchPlaceholder:(0,Lo.__)("Search by subject or email...","trigger"),onSearch:function(e){F(e),f((function(e){return UG(UG({},e),{},{pageIndex:0})})),W({page:1,per_page:c,search:e})},onPaginationChange:f,onSortingChange:n,onColumnFiltersChange:a,onRowSelectionChange:L,onDeleteSelected:function(){return j({id:-1})},enableRowSelection:!0,enableSearch:!0,enablePagination:!0,getRowId:function(e){return e.id.toString()}}),io(Ab,{open:!!_,onOpenChange:function(){return O(null)}},io(Mb,{className:"max-w-4xl max-h-[90vh] overflow-y-auto"},io("div",{className:"flex items-start justify-between mb-6"},io("h2",{className:"text-xl font-semibold"},(0,Lo.__)("Email Log","trigger"))),_&&io("div",{className:"space-y-6"},io("div",{className:"space-y-4"},io("div",{className:"flex items-center justify-between"},io("div",{className:"space-y-1"},io("div",{className:"flex items-center gap-2"},io("span",{className:"text-gray-500"},(0,Lo.__)("Sent to:","trigger")),io("span",null,_.mail_to)),io("div",{className:"flex items-center gap-2"},io("span",{className:"text-gray-500"},(0,Lo.__)("Subject:","trigger")),io("span",null,_.subject))),io("div",{className:"text-right space-y-2"},io("div",{className:"flex justify-end gap-2"},io(yw,{variant:"success"},(0,Lo.__)("Successful","trigger"))),io("div",{className:"text-gray-500"},z$(new Date(_.created_at),"MMM dd, yyyy, hh:mm a"))))),io("div",{className:"space-y-4"},io(YG,{title:"Email Body",defaultOpen:!0},io("div",{className:"prose max-w-none",dangerouslySetInnerHTML:{__html:_.message}})),io(YG,{title:"Email Headers"},io("div",{className:"space-y-2"},io("div",{className:"grid grid-cols-[100px_1fr] gap-2"},io("span",{className:"text-gray-500"},"From:"),io("span",null,_.mail_from)),io("div",{className:"grid grid-cols-[100px_1fr] gap-2"},io("span",{className:"text-gray-500"},"Reply-To:"),io("span",null)),io("div",{className:"grid grid-cols-[100px_1fr] gap-2"},io("span",{className:"text-gray-500"},"CC:"),io("span",null)),io("div",{className:"grid grid-cols-[100px_1fr] gap-2"},io("span",{className:"text-gray-500"},"BCC:"),io("span",null)),io("div",{className:"grid grid-cols-[100px_1fr] gap-2"},io("span",{className:"text-gray-500"},"Content-Type:"),io("span",null,"text/html; charset=UTF-8")),io("div",{className:"grid grid-cols-[100px_1fr] gap-2"},io("span",{className:"text-gray-500"},"X-Mailer:"),io("span",null,"WordPress/6.7.2")))),io(YG,{title:"Attachments (0)"},io("div",{className:"text-gray-500 italic"},(0,Lo.__)("No attachments found.","trigger"))),io(YG,{title:"Server Response"},io("pre",{className:"bg-gray-50 p-4 rounded-md text-sm font-mono whitespace-pre-wrap"},_.headers)))))),io(Ub,{open:!!E,onOpenChange:function(e){return!e&&j(null)},title:-1===(null==E?void 0:E.id)?(0,Lo.__)("Delete Selected Email Logs","trigger"):(0,Lo.__)("Delete Email Log","trigger"),description:-1===(null==E?void 0:E.id)?(0,Lo.__)("Are you sure you want to delete all selected email logs? This action cannot be undone.","trigger"):(0,Lo.__)("Are you sure you want to delete this email log? This action cannot be undone.","trigger"),icon:io(Gb,{className:"h-5 w-5 text-destructive"}),variant:"danger",confirmText:(0,Lo.__)("Delete","trigger"),cancelText:(0,Lo.__)("Cancel","trigger"),onConfirm:HG(WG().mark((function e(){return WG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!E){e.next=8;break}if(-1!==E.id){e.next=6;break}return e.next=4,U();case 4:e.next=8;break;case 6:return e.next=8,$(E.id);case 8:case"end":return e.stop()}}),e)}))),loading:k||N,loadingText:(0,Lo.__)("Deleting...","trigger")},E&&-1!==E.id&&io("div",{className:"space-y-2 mt-4"},io("div",{className:"grid grid-cols-2 gap-2"},io("div",null,io("span",{className:"font-medium"},(0,Lo.__)("From:","trigger")),io("p",{className:"text-sm text-muted-foreground"},E.mail_from)),io("div",null,io("span",{className:"font-medium"},(0,Lo.__)("To:","trigger")),io("p",{className:"text-sm text-muted-foreground"},E.mail_to))),io("div",null,io("span",{className:"font-medium"},(0,Lo.__)("Subject:","trigger")),io("p",{className:"text-sm text-muted-foreground"},E.subject))),-1===(null==E?void 0:E.id)&&io("div",{className:"mt-4"},io("p",{className:"text-sm text-muted-foreground"},Object.keys(R).length," ",(0,Lo.__)("email logs will be deleted.","trigger")))))};var QG=o(1594);const JG=function(){return io(QG.Fragment,null,io(Bw,null))};var eW=class extends nd{constructor(e={}){super(),this.config=e,this.#V=new Map}#V;build(e,t,r){const n=t.queryKey,o=t.queryHash??dd(n,t);let i=this.get(o);return i||(i=new Ld({client:e,queryKey:n,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(i)),i}add(e){this.#V.has(e.queryHash)||(this.#V.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#V.get(e.queryHash);t&&(e.destroy(),t===e&&this.#V.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){jd.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}get(e){return this.#V.get(e)}getAll(){return[...this.#V.values()]}find(e){const t={exact:!0,...e};return this.getAll().find((e=>cd(t,e)))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter((t=>cd(e,t))):t}notify(e){jd.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){jd.batch((()=>{this.getAll().forEach((e=>{e.onFocus()}))}))}onOnline(){jd.batch((()=>{this.getAll().forEach((e=>{e.onOnline()}))}))}},tW=class extends nd{constructor(e={}){super(),this.config=e,this.#$=new Set,this.#U=new Map,this.#G=0}#$;#U;#G;build(e,t,r){const n=new Qd({mutationCache:this,mutationId:++this.#G,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#$.add(e);const t=rW(e);if("string"==typeof t){const r=this.#U.get(t);r?r.push(e):this.#U.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#$.delete(e)){const t=rW(e);if("string"==typeof t){const r=this.#U.get(t);if(r)if(r.length>1){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#U.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=rW(e);if("string"==typeof t){const r=this.#U.get(t),n=r?.find((e=>"pending"===e.state.status));return!n||n===e}return!0}runNext(e){const t=rW(e);if("string"==typeof t){const r=this.#U.get(t)?.find((t=>t!==e&&t.state.isPaused));return r?.continue()??Promise.resolve()}return Promise.resolve()}clear(){jd.batch((()=>{this.#$.forEach((e=>{this.notify({type:"removed",mutation:e})})),this.#$.clear(),this.#U.clear()}))}getAll(){return Array.from(this.#$)}find(e){const t={exact:!0,...e};return this.getAll().find((e=>fd(t,e)))}findAll(e={}){return this.getAll().filter((t=>fd(e,t)))}notify(e){jd.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){const e=this.getAll().filter((e=>e.state.isPaused));return jd.batch((()=>Promise.all(e.map((e=>e.continue().catch(id))))))}};function rW(e){return e.options.scope?.id}function nW(e){return{onFetch:(t,r)=>{const n=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},u=0;const l=async()=>{let r=!1;const l=Sd(t.options,t.fetchOptions),c=async(e,n,o)=>{if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);const i={client:t.client,queryKey:t.queryKey,pageParam:n,direction:o?"backward":"forward",meta:t.options.meta};(e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",(()=>{r=!0})),t.signal)})})(i);const a=await l(i),{maxPages:s}=t.options,u=o?_d:xd;return{pages:u(e.pages,a,s),pageParams:u(e.pageParams,n,s)}};if(o&&i.length){const e="backward"===o,t={pages:i,pageParams:a},r=(e?iW:oW)(n,t);s=await c(t,r,e)}else{const t=e??i.length;do{const e=0===u?a[0]??n.initialPageParam:oW(n,s);if(u>0&&null==e)break;s=await c(s,e),u++}while(u<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function oW(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function iW(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var aW=t.createRoot(document.getElementById("trigger-root")),sW=new class{#W;#D;#c;#q;#H;#Z;#K;#Y;constructor(e={}){this.#W=e.queryCache||new eW,this.#D=e.mutationCache||new tW,this.#c=e.defaultOptions||{},this.#q=new Map,this.#H=new Map,this.#Z=0}mount(){this.#Z++,1===this.#Z&&(this.#K=Ed.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#W.onFocus())})),this.#Y=Pd.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#W.onOnline())})))}unmount(){this.#Z--,0===this.#Z&&(this.#K?.(),this.#K=void 0,this.#Y?.(),this.#Y=void 0)}isFetching(e){return this.#W.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#D.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#W.build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ud(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#W.findAll(e).map((({queryKey:e,state:t})=>[e,t.data]))}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=this.#W.get(n.queryHash),i=o?.state.data,a=function(e,t){return"function"==typeof e?e(t):e}(t,i);if(void 0!==a)return this.#W.build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return jd.batch((()=>this.#W.findAll(e).map((({queryKey:e})=>[e,this.setQueryData(e,t,r)]))))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state}removeQueries(e){const t=this.#W;jd.batch((()=>{t.findAll(e).forEach((e=>{t.remove(e)}))}))}resetQueries(e,t){const r=this.#W;return jd.batch((()=>(r.findAll(e).forEach((e=>{e.reset()})),this.refetchQueries({type:"active",...e},t))))}cancelQueries(e,t={}){const r={revert:!0,...t},n=jd.batch((()=>this.#W.findAll(e).map((e=>e.cancel(r)))));return Promise.all(n).then(id).catch(id)}invalidateQueries(e,t={}){return jd.batch((()=>(this.#W.findAll(e).forEach((e=>{e.invalidate()})),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=jd.batch((()=>this.#W.findAll(e).filter((e=>!e.isDisabled())).map((e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(id)),"paused"===e.state.fetchStatus?Promise.resolve():t}))));return Promise.all(n).then(id)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const r=this.#W.build(this,t);return r.isStaleByTime(ud(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(id).catch(id)}fetchInfiniteQuery(e){return e.behavior=nW(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(id).catch(id)}ensureInfiniteQueryData(e){return e.behavior=nW(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Pd.isOnline()?this.#D.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#W}getMutationCache(){return this.#D}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#q.set(pd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#q.values()],r={};return t.forEach((t=>{hd(e,t.queryKey)&&Object.assign(r,t.defaultOptions)})),r}setMutationDefaults(e,t){this.#H.set(pd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#H.values()],r={};return t.forEach((t=>{hd(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)})),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=dd(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Od&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#W.clear(),this.#D.clear()}}({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1}}});aW.render(io((({client:e,children:t})=>(r.useEffect((()=>(e.mount(),()=>{e.unmount()})),[e]),(0,ft.jsx)($d.Provider,{value:e,children:t}))),{client:sW},io((function({basename:e,children:t,window:n}){let o=r.useRef();null==o.current&&(o.current=s({window:n,v5Compat:!0}));let i=o.current,[a,u]=r.useState({action:i.action,location:i.location}),l=r.useCallback((e=>{r.startTransition((()=>u(e)))}),[u]);return r.useLayoutEffect((()=>i.listen(l)),[i,l]),r.createElement(ve,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:i})}),null,io(m_,null),io((function({children:e,location:t}){return ne(ge(e),t)}),null,io(ye,{path:"/",element:io(q$,null)}),io(ye,{path:"/dashboard",element:io(q$,null)}),io(ye,{path:"/email_logs",element:io(XG,null)}),io(ye,{path:"/settings",element:io(JG,null)}),io(ye,{path:"/connections",element:io(Mw,null)}),io(ye,{path:"/general",element:io(Bw,null)}),io(ye,{path:"/add-connection",element:io(l_,null)})),io((({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:o,children:i,containerStyle:a,containerClassName:s})=>{let{toasts:u,handlers:l}=Hp(n);return r.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...a},className:s,onMouseEnter:l.startPause,onMouseLeave:l.endPause},u.map((n=>{let a=n.position||t,s=((e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Ip()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}})(a,l.calculateOffset(n,{reverseOrder:e,gutter:o,defaultPosition:t}));return r.createElement(ph,{id:n.id,key:n.id,onHeightUpdate:l.updateHeight,className:n.visible?hh:"",style:s},"custom"===n.type?Rp(n.message,n):i?i(n):r.createElement(dh,{toast:n,position:a}))})))}),{position:"bottom-right",containerClassName:"!z-[9999999]",toastOptions:{duration:5e3,style:{background:"#fff",color:"#333",border:"1px solid #e5e7eb",padding:"16px",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"},success:{style:{background:"#f0fdf4",borderColor:"#86efac"}},error:{style:{background:"#fef2f2",borderColor:"#fecaca"}}}}))))})()})();
     171`,mh=Up;function yh(e){return yh="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},yh(e)}function vh(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gh(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vh(Object(r),!0).forEach((function(t){bh(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vh(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function bh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=yh(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=yh(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==yh(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wh(){wh=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==yh(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(yh(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function xh(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function _h(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){xh(i,n,o,a,s,"next",e)}function s(e){xh(i,n,o,a,s,"throw",e)}a(void 0)}))}}var Oh=function(){return Xd({queryKey:["getAllProviders"],queryFn:(e=_h(wh().mark((function e(){var t;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,yp("".concat(rd.rest_url,"/connections"),{method:"GET"});case 3:return t=e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)}),staleTime:5e3});var e},Sh=function(){var e=_h(wh().mark((function e(t){var r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.action="update_email_config",e.next=3,yp(rd.ajax_url,{body:t});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Eh=function(){return ep({mutationFn:Sh,onSuccess:function(e){var t;mh.success(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Email configuration saved successfully!","trigger"))},onError:function(e){var t;mh.error(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Failed to save email configuration","trigger"))}})},jh=function(){return ep({mutationFn:(e=_h(wh().mark((function e(t){var r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=gh({action:"trigger_send_test_email"},t),e.next=3,yp(rd.ajax_url,{body:t});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)}),onSuccess:function(e){var t;mh.success(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Test email sent successfully!","trigger"))},onError:function(e){mh.error("asdkf ".concat(e.message)||0)}});var e},Ph=function(){var e=_h(wh().mark((function e(){var t,r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={action:"trigger_connect_with_gmail",trigger_nonce:rd.nonce_value},e.next=3,yp(rd.ajax_url,{body:t});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),kh=function(){return ep({mutationFn:Ph,onSuccess:function(e){window.location.href=e.data.auth_url},onError:function(e){mh.error(e.message||(0,Lo.__)("Failed to connect with Gmail. Please try again.","trigger"))}})},Ch=function(){var e=_h(wh().mark((function e(){var t,r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={action:"trigger_is_gmail_connected"},e.next=3,yp(rd.ajax_url,{body:t});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ah=function(){return ep({mutationFn:Ch,onSuccess:function(e){},onError:function(e){}})},Nh=function(){return Xd({queryKey:["getSesVerifiedEmails"],queryFn:(e=_h(wh().mark((function e(){var t;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,yp("".concat(rd.rest_url,"/get-verified-ses-emails"),{method:"GET",body:{provider:"ses"}});case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)}),staleTime:0});var e};function Th(e){return Th="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},Th(e)}function Mh(){return Mh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mh.apply(null,arguments)}function Rh(){Rh=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Th(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Th(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Lh(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}var Ih=Xf.object({fromEmail:Xf.string().email({message:"Need a valid email address."}),to:Xf.string().email({message:"Need a valid email address."})});function Dh(e){var t=e.open,r=e.onOpenChange,n=e.connection,o=Zu({resolver:el(Ih),defaultValues:{to:"",fromEmail:n.fromEmail}}),a=jh(),s=a.mutateAsync,u=a.isPending,l=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Lh(i,n,o,a,s,"next",e)}function s(e){Lh(i,n,o,a,s,"throw",e)}a(void 0)}))}}(Rh().mark((function e(t){var r;return Rh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={provider:n.provider,to:t.to,fromEmail:t.fromEmail||n.fromEmail},e.next=3,s(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return io(cs,{open:t,onOpenChange:r},io(ms,{style:{zIndex:999999}},io(ys,null,io(vs,null,(0,Lo.__)("Send Test Email","trigger")),io(gs,null,(0,Lo.__)("Send a test email to verify your connection is working properly.","trigger"))),io("div",{className:"pt-4"},io("div",{className:"mb-4"},io("p",{className:"text-sm font-medium mb-1"},(0,Lo.__)("Provider","trigger")),io(xs,{className:"text-sm [&:disabled]:opacity-100",value:n.provider,disabled:!0}))),io(vl,o,io("form",{onSubmit:o.handleSubmit(l),className:"space-y-4"},io("div",{className:"mb-4"},io("p",{className:"text-sm font-medium mb-1"},(0,Lo.__)("From","trigger")),io(xs,{className:"text-sm [&:disabled]:opacity-100",value:n.fromEmail,disabled:!0})),io(bl,{control:o.control,name:"to",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Send To","trigger")),io(Sl,null,io(xs,Mh({placeholder:"example@example.com"},t,{autoFocus:!0}))),io(kl,null))}}),io("div",{className:"flex justify-end gap-2 mt-6"},io(fs,{asChild:!0},io(lo,{variant:"outline"},(0,Lo.__)("Cancel","trigger"))),io(lo,{type:"submit",disabled:u},u?io(i().Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Sending...","trigger")):(0,Lo.__)("Send Test Email","trigger")))))))}function Fh(e,[t,r]){return Math.min(r,Math.max(t,e))}function zh(e){const t=e+"CollectionProvider",[n,o]=Do(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:t,children:n}=e,o=r.useRef(null),a=r.useRef(new Map).current;return(0,ft.jsx)(i,{scope:t,itemMap:a,collectionRef:o,children:n})};s.displayName=t;const u=e+"CollectionSlot",l=r.forwardRef(((e,t)=>{const{scope:r,children:n}=e,o=ct(t,a(u,r).collectionRef);return(0,ft.jsx)(dt,{ref:o,children:n})}));l.displayName=u;const c=e+"CollectionItemSlot",f="data-radix-collection-item",d=r.forwardRef(((e,t)=>{const{scope:n,children:o,...i}=e,s=r.useRef(null),u=ct(t,s),l=a(c,n);return r.useEffect((()=>(l.itemMap.set(s,{ref:s,...i}),()=>{l.itemMap.delete(s)}))),(0,ft.jsx)(dt,{[f]:"",ref:u,children:o})}));return d.displayName=c,[{Provider:s,Slot:l,ItemSlot:d},function(t){const n=a(e+"CollectionConsumer",t),o=r.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`)),r=Array.from(n.itemMap.values()).sort(((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current)));return r}),[n.collectionRef,n.itemMap]);return o},o]}var Bh=r.createContext(void 0);function Vh(e){const t=r.useContext(Bh);return e||t||"ltr"}const $h=["top","right","bottom","left"],Uh=Math.min,Gh=Math.max,Wh=Math.round,qh=Math.floor,Hh=e=>({x:e,y:e}),Zh={left:"right",right:"left",bottom:"top",top:"bottom"},Kh={start:"end",end:"start"};function Yh(e,t,r){return Gh(e,Uh(t,r))}function Xh(e,t){return"function"==typeof e?e(t):e}function Qh(e){return e.split("-")[0]}function Jh(e){return e.split("-")[1]}function em(e){return"x"===e?"y":"x"}function tm(e){return"y"===e?"height":"width"}function rm(e){return["top","bottom"].includes(Qh(e))?"y":"x"}function nm(e){return em(rm(e))}function om(e){return e.replace(/start|end/g,(e=>Kh[e]))}function im(e){return e.replace(/left|right|bottom|top/g,(e=>Zh[e]))}function am(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function sm(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function um(e,t,r){let{reference:n,floating:o}=e;const i=rm(t),a=nm(t),s=tm(a),u=Qh(t),l="y"===i,c=n.x+n.width/2-o.width/2,f=n.y+n.height/2-o.height/2,d=n[s]/2-o[s]/2;let p;switch(u){case"top":p={x:c,y:n.y-o.height};break;case"bottom":p={x:c,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-o.width,y:f};break;default:p={x:n.x,y:n.y}}switch(Jh(t)){case"start":p[a]-=d*(r&&l?-1:1);break;case"end":p[a]+=d*(r&&l?-1:1)}return p}async function lm(e,t){var r;void 0===t&&(t={});const{x:n,y:o,platform:i,rects:a,elements:s,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Xh(t,e),h=am(p),m=s[d?"floating"===f?"reference":"floating":f],y=sm(await i.getClippingRect({element:null==(r=await(null==i.isElement?void 0:i.isElement(m)))||r?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:c,strategy:u})),v="floating"===f?{x:n,y:o,width:a.floating.width,height:a.floating.height}:a.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},w=sm(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:g,strategy:u}):v);return{top:(y.top-w.top+h.top)/b.y,bottom:(w.bottom-y.bottom+h.bottom)/b.y,left:(y.left-w.left+h.left)/b.x,right:(w.right-y.right+h.right)/b.x}}function cm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fm(e){return $h.some((t=>e[t]>=0))}function dm(){return"undefined"!=typeof window}function pm(e){return ym(e)?(e.nodeName||"").toLowerCase():"#document"}function hm(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function mm(e){var t;return null==(t=(ym(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ym(e){return!!dm()&&(e instanceof Node||e instanceof hm(e).Node)}function vm(e){return!!dm()&&(e instanceof Element||e instanceof hm(e).Element)}function gm(e){return!!dm()&&(e instanceof HTMLElement||e instanceof hm(e).HTMLElement)}function bm(e){return!(!dm()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof hm(e).ShadowRoot)}function wm(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=jm(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function xm(e){return["table","td","th"].includes(pm(e))}function _m(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Om(e){const t=Sm(),r=vm(e)?jm(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!r[e]&&"none"!==r[e]))||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(r.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(r.contain||"").includes(e)))}function Sm(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Em(e){return["html","body","#document"].includes(pm(e))}function jm(e){return hm(e).getComputedStyle(e)}function Pm(e){return vm(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function km(e){if("html"===pm(e))return e;const t=e.assignedSlot||e.parentNode||bm(e)&&e.host||mm(e);return bm(t)?t.host:t}function Cm(e){const t=km(e);return Em(t)?e.ownerDocument?e.ownerDocument.body:e.body:gm(t)&&wm(t)?t:Cm(t)}function Am(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=Cm(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),a=hm(o);if(i){const e=Nm(a);return t.concat(a,a.visualViewport||[],wm(o)?o:[],e&&r?Am(e):[])}return t.concat(o,Am(o,[],r))}function Nm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Tm(e){const t=jm(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=gm(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,s=Wh(r)!==i||Wh(n)!==a;return s&&(r=i,n=a),{width:r,height:n,$:s}}function Mm(e){return vm(e)?e:e.contextElement}function Rm(e){const t=Mm(e);if(!gm(t))return Hh(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:i}=Tm(t);let a=(i?Wh(r.width):r.width)/n,s=(i?Wh(r.height):r.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Lm=Hh(0);function Im(e){const t=hm(e);return Sm()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Lm}function Dm(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),i=Mm(e);let a=Hh(1);t&&(n?vm(n)&&(a=Rm(n)):a=Rm(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==hm(e))&&t}(i,r,n)?Im(i):Hh(0);let u=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,c=o.width/a.x,f=o.height/a.y;if(i){const e=hm(i),t=n&&vm(n)?hm(n):n;let r=e,o=Nm(r);for(;o&&n&&t!==r;){const e=Rm(o),t=o.getBoundingClientRect(),n=jm(o),i=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;u*=e.x,l*=e.y,c*=e.x,f*=e.y,u+=i,l+=a,r=hm(o),o=Nm(r)}}return sm({width:c,height:f,x:u,y:l})}function Fm(e,t){const r=Pm(e).scrollLeft;return t?t.left+r:Dm(mm(e)).left+r}function zm(e,t,r){void 0===r&&(r=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:Fm(e,n)),y:n.top+t.scrollTop}}function Bm(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=hm(e),n=mm(e),o=r.visualViewport;let i=n.clientWidth,a=n.clientHeight,s=0,u=0;if(o){i=o.width,a=o.height;const e=Sm();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,u=o.offsetTop)}return{width:i,height:a,x:s,y:u}}(e,r);else if("document"===t)n=function(e){const t=mm(e),r=Pm(e),n=e.ownerDocument.body,o=Gh(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=Gh(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-r.scrollLeft+Fm(e);const s=-r.scrollTop;return"rtl"===jm(n).direction&&(a+=Gh(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:s}}(mm(e));else if(vm(t))n=function(e,t){const r=Dm(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=gm(e)?Rm(e):Hh(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:n*i.y}}(t,r);else{const r=Im(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return sm(n)}function Vm(e,t){const r=km(e);return!(r===t||!vm(r)||Em(r))&&("fixed"===jm(r).position||Vm(r,t))}function $m(e,t,r){const n=gm(t),o=mm(t),i="fixed"===r,a=Dm(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const u=Hh(0);if(n||!n&&!i)if(("body"!==pm(t)||wm(o))&&(s=Pm(t)),n){const e=Dm(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else o&&(u.x=Fm(o));const l=!o||n||i?Hh(0):zm(o,s);return{x:a.left+s.scrollLeft-u.x-l.x,y:a.top+s.scrollTop-u.y-l.y,width:a.width,height:a.height}}function Um(e){return"static"===jm(e).position}function Gm(e,t){if(!gm(e)||"fixed"===jm(e).position)return null;if(t)return t(e);let r=e.offsetParent;return mm(e)===r&&(r=r.ownerDocument.body),r}function Wm(e,t){const r=hm(e);if(_m(e))return r;if(!gm(e)){let t=km(e);for(;t&&!Em(t);){if(vm(t)&&!Um(t))return t;t=km(t)}return r}let n=Gm(e,t);for(;n&&xm(n)&&Um(n);)n=Gm(n,t);return n&&Em(n)&&Um(n)&&!Om(n)?r:n||function(e){let t=km(e);for(;gm(t)&&!Em(t);){if(Om(t))return t;if(_m(t))return null;t=km(t)}return null}(e)||r}const qm={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const i="fixed"===o,a=mm(n),s=!!t&&_m(t.floating);if(n===a||s&&i)return r;let u={scrollLeft:0,scrollTop:0},l=Hh(1);const c=Hh(0),f=gm(n);if((f||!f&&!i)&&(("body"!==pm(n)||wm(a))&&(u=Pm(n)),gm(n))){const e=Dm(n);l=Rm(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}const d=!a||f||i?Hh(0):zm(a,u,!0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-u.scrollLeft*l.x+c.x+d.x,y:r.y*l.y-u.scrollTop*l.y+c.y+d.y}},getDocumentElement:mm,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[..."clippingAncestors"===r?_m(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Am(e,[],!1).filter((e=>vm(e)&&"body"!==pm(e))),o=null;const i="fixed"===jm(e).position;let a=i?km(e):e;for(;vm(a)&&!Em(a);){const t=jm(a),r=Om(a);r||"fixed"!==t.position||(o=null),(i?!r&&!o:!r&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||wm(a)&&!r&&Vm(e,a))?n=n.filter((e=>e!==a)):o=t,a=km(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=i[0],s=i.reduce(((e,r)=>{const n=Bm(t,r,o);return e.top=Gh(n.top,e.top),e.right=Uh(n.right,e.right),e.bottom=Uh(n.bottom,e.bottom),e.left=Gh(n.left,e.left),e}),Bm(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Wm,getElementRects:async function(e){const t=this.getOffsetParent||Wm,r=this.getDimensions,n=await r(e.floating);return{reference:$m(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Tm(e);return{width:t,height:r}},getScale:Rm,isElement:vm,isRTL:function(e){return"rtl"===jm(e).direction}};function Hm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zm(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:u=!1}=n,l=Mm(e),c=o||i?[...l?Am(l):[],...Am(t)]:[];c.forEach((e=>{o&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)}));const f=l&&s?function(e,t){let r,n=null;const o=mm(e);function i(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function a(s,u){void 0===s&&(s=!1),void 0===u&&(u=1),i();const l=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=l;if(s||t(),!d||!p)return;const h={rootMargin:-qh(f)+"px "+-qh(o.clientWidth-(c+d))+"px "+-qh(o.clientHeight-(f+p))+"px "+-qh(c)+"px",threshold:Gh(0,Uh(1,u))||1};let m=!0;function y(t){const n=t[0].intersectionRatio;if(n!==u){if(!m)return a();n?a(!1,n):r=setTimeout((()=>{a(!1,1e-7)}),1e3)}1!==n||Hm(l,e.getBoundingClientRect())||a(),m=!1}try{n=new IntersectionObserver(y,{...h,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(y,h)}n.observe(e)}(!0),i}(l,r):null;let d,p=-1,h=null;a&&(h=new ResizeObserver((e=>{let[n]=e;n&&n.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),r()})),l&&!u&&h.observe(l),h.observe(t));let m=u?Dm(e):null;return u&&function t(){const n=Dm(e);m&&!Hm(m,n)&&r();m=n,d=requestAnimationFrame(t)}(),r(),()=>{var e;c.forEach((e=>{o&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)})),null==f||f(),null==(e=h)||e.disconnect(),h=null,u&&cancelAnimationFrame(d)}}const Km=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:i,placement:a,middlewareData:s}=t,u=await async function(e,t){const{placement:r,platform:n,elements:o}=e,i=await(null==n.isRTL?void 0:n.isRTL(o.floating)),a=Qh(r),s=Jh(r),u="y"===rm(r),l=["left","top"].includes(a)?-1:1,c=i&&u?-1:1,f=Xh(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),u?{x:p*c,y:d*l}:{x:d*l,y:p*c}}(t,e);return a===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:a}}}}},Ym=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...u}=Xh(e,t),l={x:r,y:n},c=await lm(t,u),f=rm(Qh(o)),d=em(f);let p=l[d],h=l[f];if(i){const e="y"===d?"bottom":"right";p=Yh(p+c["y"===d?"top":"left"],p,p-c[e])}if(a){const e="y"===f?"bottom":"right";h=Yh(h+c["y"===f?"top":"left"],h,h-c[e])}const m=s.fn({...t,[d]:p,[f]:h});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[d]:i,[f]:a}}}}}},Xm=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:u,elements:l}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...y}=Xh(e,t);if(null!=(r=i.arrow)&&r.alignmentOffset)return{};const v=Qh(o),g=rm(s),b=Qh(s)===s,w=await(null==u.isRTL?void 0:u.isRTL(l.floating)),x=d||(b||!m?[im(s)]:function(e){const t=im(e);return[om(e),t,om(t)]}(s)),_="none"!==h;!d&&_&&x.push(...function(e,t,r,n){const o=Jh(e);let i=function(e,t,r){const n=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?i:a;default:return[]}}(Qh(e),"start"===r,n);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(om)))),i}(s,m,h,w));const O=[s,...x],S=await lm(t,y),E=[];let j=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&E.push(S[v]),f){const e=function(e,t,r){void 0===r&&(r=!1);const n=Jh(e),o=nm(e),i=tm(o);let a="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=im(a)),[a,im(a)]}(o,a,w);E.push(S[e[0]],S[e[1]])}if(j=[...j,{placement:o,overflows:E}],!E.every((e=>e<=0))){var P,k;const e=((null==(P=i.flip)?void 0:P.index)||0)+1,t=O[e];if(t)return{data:{index:e,overflows:j},reset:{placement:t}};let r=null==(k=j.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:k.placement;if(!r)switch(p){case"bestFit":{var C;const e=null==(C=j.filter((e=>{if(_){const t=rm(e.placement);return t===g||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:C[0];e&&(r=e);break}case"initialPlacement":r=s}if(o!==r)return{reset:{placement:r}}}return{}}}},Qm=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:u=()=>{},...l}=Xh(e,t),c=await lm(t,l),f=Qh(o),d=Jh(o),p="y"===rm(o),{width:h,height:m}=i.floating;let y,v;"top"===f||"bottom"===f?(y=f,v=d===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=f,y="end"===d?"top":"bottom");const g=m-c.top-c.bottom,b=h-c.left-c.right,w=Uh(m-c[y],g),x=Uh(h-c[v],b),_=!t.middlewareData.shift;let O=w,S=x;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(S=b),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(O=g),_&&!d){const e=Gh(c.left,0),t=Gh(c.right,0),r=Gh(c.top,0),n=Gh(c.bottom,0);p?S=h-2*(0!==e||0!==t?e+t:Gh(c.left,c.right)):O=m-2*(0!==r||0!==n?r+n:Gh(c.top,c.bottom))}await u({...t,availableWidth:S,availableHeight:O});const E=await a.getDimensions(s.floating);return h!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}},Jm=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=Xh(e,t);switch(n){case"referenceHidden":{const e=cm(await lm(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:fm(e)}}}case"escaped":{const e=cm(await lm(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:fm(e)}}}default:return{}}}}},ey=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:i,platform:a,elements:s,middlewareData:u}=t,{element:l,padding:c=0}=Xh(e,t)||{};if(null==l)return{};const f=am(c),d={x:r,y:n},p=nm(o),h=tm(p),m=await a.getDimensions(l),y="y"===p,v=y?"top":"left",g=y?"bottom":"right",b=y?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-d[p]-i.floating[h],x=d[p]-i.reference[p],_=await(null==a.getOffsetParent?void 0:a.getOffsetParent(l));let O=_?_[b]:0;O&&await(null==a.isElement?void 0:a.isElement(_))||(O=s.floating[b]||i.floating[h]);const S=w/2-x/2,E=O/2-m[h]/2-1,j=Uh(f[v],E),P=Uh(f[g],E),k=j,C=O-m[h]-P,A=O/2-m[h]/2+S,N=Yh(k,A,C),T=!u.arrow&&null!=Jh(o)&&A!==N&&i.reference[h]/2-(A<k?j:P)-m[h]/2<0,M=T?A<k?A-k:A-C:0;return{[p]:d[p]+M,data:{[p]:N,centerOffset:A-N-M,...T&&{alignmentOffset:M}},reset:T}}}),ty=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:u=!0,crossAxis:l=!0}=Xh(e,t),c={x:r,y:n},f=rm(o),d=em(f);let p=c[d],h=c[f];const m=Xh(s,t),y="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+y.mainAxis,r=i.reference[d]+i.reference[e]-y.mainAxis;p<t?p=t:p>r&&(p=r)}if(l){var v,g;const e="y"===d?"width":"height",t=["top","left"].includes(Qh(o)),r=i.reference[f]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[f])||0)+(t?0:y.crossAxis),n=i.reference[f]+i.reference[e]+(t?0:(null==(g=a.offset)?void 0:g[f])||0)-(t?y.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[d]:p,[f]:h}}}},ry=(e,t,r)=>{const n=new Map,o={platform:qm,...r},i={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),u=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:f}=um(l,n,u),d=n,p={},h=0;for(let r=0;r<s.length;r++){const{name:i,fn:m}=s[r],{x:y,y:v,data:g,reset:b}=await m({x:c,y:f,initialPlacement:n,placement:d,strategy:o,middlewareData:p,rects:l,platform:a,elements:{reference:e,floating:t}});c=null!=y?y:c,f=null!=v?v:f,p={...p,[i]:{...p[i],...g}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(l=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:c,y:f}=um(l,d,u))),r=-1)}return{x:c,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var ny="undefined"!=typeof document?r.useLayoutEffect:r.useEffect;function oy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!=n--;)if(!oy(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!=n--;){const r=o[n];if(("_owner"!==r||!e.$$typeof)&&!oy(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function iy(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ay(e,t){const r=iy(e);return Math.round(t*r)/r}function sy(e){const t=r.useRef(e);return ny((()=>{t.current=e})),t}const uy=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&function(e){return{}.hasOwnProperty.call(e,"current")}(r)?null!=r.current?ey({element:r.current,padding:n}).fn(t):{}:r?ey({element:r,padding:n}).fn(t):{}}}),ly=(e,t)=>({...Km(e),options:[e,t]}),cy=(e,t)=>({...Ym(e),options:[e,t]}),fy=(e,t)=>({...ty(e),options:[e,t]}),dy=(e,t)=>({...Xm(e),options:[e,t]}),py=(e,t)=>({...Qm(e),options:[e,t]}),hy=(e,t)=>({...Jm(e),options:[e,t]}),my=(e,t)=>({...uy(e),options:[e,t]});var yy=r.forwardRef(((e,t)=>{const{children:r,width:n=10,height:o=5,...i}=e;return(0,ft.jsx)(qo.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,ft.jsx)("polygon",{points:"0,0 30,0 15,10"})})}));yy.displayName="Arrow";var vy=yy;function gy(e){const[t,n]=r.useState(void 0);return zo((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}var by="Popper",[wy,xy]=Do(by),[_y,Oy]=wy(by),Sy=e=>{const{__scopePopper:t,children:n}=e,[o,i]=r.useState(null);return(0,ft.jsx)(_y,{scope:t,anchor:o,onAnchorChange:i,children:n})};Sy.displayName=by;var Ey="PopperAnchor",jy=r.forwardRef(((e,t)=>{const{__scopePopper:n,virtualRef:o,...i}=e,a=Oy(Ey,n),s=r.useRef(null),u=ct(t,s);return r.useEffect((()=>{a.onAnchorChange(o?.current||s.current)})),o?null:(0,ft.jsx)(qo.div,{...i,ref:u})}));jy.displayName=Ey;var Py="PopperContent",[ky,Cy]=wy(Py),Ay=r.forwardRef(((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:u=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...y}=e,v=Oy(Py,n),[g,b]=r.useState(null),w=ct(t,(e=>b(e))),[x,_]=r.useState(null),O=gy(x),S=O?.width??0,E=O?.height??0,j=o+("center"!==a?"-"+a:""),P="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},k=Array.isArray(c)?c:[c],C=k.length>0,A={padding:P,boundary:k.filter(Ry),altBoundary:C},{refs:N,floatingStyles:T,placement:M,isPositioned:R,middlewareData:L}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:u=!0,whileElementsMounted:l,open:c}=e,[f,d]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=r.useState(o);oy(p,o)||h(o);const[m,y]=r.useState(null),[v,g]=r.useState(null),b=r.useCallback((e=>{e!==O.current&&(O.current=e,y(e))}),[]),w=r.useCallback((e=>{e!==S.current&&(S.current=e,g(e))}),[]),x=a||m,_=s||v,O=r.useRef(null),S=r.useRef(null),E=r.useRef(f),j=null!=l,P=sy(l),k=sy(i),C=sy(c),A=r.useCallback((()=>{if(!O.current||!S.current)return;const e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),ry(O.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==C.current};N.current&&!oy(E.current,t)&&(E.current=t,Wo.flushSync((()=>{d(t)})))}))}),[p,t,n,k,C]);ny((()=>{!1===c&&E.current.isPositioned&&(E.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const N=r.useRef(!1);ny((()=>(N.current=!0,()=>{N.current=!1})),[]),ny((()=>{if(x&&(O.current=x),_&&(S.current=_),x&&_){if(P.current)return P.current(x,_,A);A()}}),[x,_,A,P,j]);const T=r.useMemo((()=>({reference:O,floating:S,setReference:b,setFloating:w})),[b,w]),M=r.useMemo((()=>({reference:x,floating:_})),[x,_]),R=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!M.floating)return e;const t=ay(M.floating,f.x),r=ay(M.floating,f.y);return u?{...e,transform:"translate("+t+"px, "+r+"px)",...iy(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,u,M.floating,f.x,f.y]);return r.useMemo((()=>({...f,update:A,refs:T,elements:M,floatingStyles:R})),[f,A,T,M,R])}({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>Zm(...e,{animationFrame:"always"===h}),elements:{reference:v.anchor},middleware:[ly({mainAxis:i+E,alignmentAxis:s}),l&&cy({mainAxis:!0,crossAxis:!1,limiter:"partial"===d?fy():void 0,...A}),l&&dy({...A}),py({...A,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${r}px`),a.setProperty("--radix-popper-available-height",`${n}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),x&&my({element:x,padding:u}),Ly({arrowWidth:S,arrowHeight:E}),p&&hy({strategy:"referenceHidden",...A})]}),[I,D]=Iy(M),F=Uo(m);zo((()=>{R&&F?.()}),[R,F]);const z=L.arrow?.x,B=L.arrow?.y,V=0!==L.arrow?.centerOffset,[$,U]=r.useState();return zo((()=>{g&&U(window.getComputedStyle(g).zIndex)}),[g]),(0,ft.jsx)("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...T,transform:R?T.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:$,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,ft.jsx)(ky,{scope:n,placedSide:I,onArrowChange:_,arrowX:z,arrowY:B,shouldHideArrow:V,children:(0,ft.jsx)(qo.div,{"data-side":I,"data-align":D,...y,ref:w,style:{...y.style,animation:R?void 0:"none"}})})})}));Ay.displayName=Py;var Ny="PopperArrow",Ty={top:"bottom",right:"left",bottom:"top",left:"right"},My=r.forwardRef((function(e,t){const{__scopePopper:r,...n}=e,o=Cy(Ny,r),i=Ty[o.placedSide];return(0,ft.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,ft.jsx)(vy,{...n,ref:t,style:{...n.style,display:"block"}})})}));function Ry(e){return null!==e}My.displayName=Ny;var Ly=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[u,l]=Iy(r),c={start:"0%",center:"50%",end:"100%"}[l],f=(o.arrow?.x??0)+a/2,d=(o.arrow?.y??0)+s/2;let p="",h="";return"bottom"===u?(p=i?c:`${f}px`,h=-s+"px"):"top"===u?(p=i?c:`${f}px`,h=`${n.floating.height+s}px`):"right"===u?(p=-s+"px",h=i?c:`${d}px`):"left"===u&&(p=`${n.floating.width+s}px`,h=i?c:`${d}px`),{data:{x:p,y:h}}}});function Iy(e){const[t,r="center"]=e.split("-");return[t,r]}var Dy=Sy,Fy=jy,zy=Ay,By=My;function Vy(e){const t=r.useRef({value:e,previous:e});return r.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}var $y=r.forwardRef(((e,t)=>(0,ft.jsx)(qo.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}})));$y.displayName="VisuallyHidden";var Uy=[" ","Enter","ArrowUp","ArrowDown"],Gy=[" ","Enter"],Wy="Select",[qy,Hy,Zy]=zh(Wy),[Ky,Yy]=Do(Wy,[Zy,xy]),Xy=xy(),[Qy,Jy]=Ky(Wy),[ev,tv]=Ky(Wy),rv=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:i,onOpenChange:a,value:s,defaultValue:u,onValueChange:l,dir:c,name:f,autoComplete:d,disabled:p,required:h,form:m}=e,y=Xy(t),[v,g]=r.useState(null),[b,w]=r.useState(null),[x,_]=r.useState(!1),O=Vh(c),[S=!1,E]=Go({prop:o,defaultProp:i,onChange:a}),[j,P]=Go({prop:s,defaultProp:u,onChange:l}),k=r.useRef(null),C=!v||(m||!!v.closest("form")),[A,N]=r.useState(new Set),T=Array.from(A).map((e=>e.props.value)).join(";");return(0,ft.jsx)(Dy,{...y,children:(0,ft.jsxs)(Qy,{required:h,scope:t,trigger:v,onTriggerChange:g,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:x,onValueNodeHasChildrenChange:_,contentId:$o(),value:j,onValueChange:P,open:S,onOpenChange:E,dir:O,triggerPointerDownPosRef:k,disabled:p,children:[(0,ft.jsx)(qy.Provider,{scope:t,children:(0,ft.jsx)(ev,{scope:e.__scopeSelect,onNativeOptionAdd:r.useCallback((e=>{N((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:r.useCallback((e=>{N((t=>{const r=new Set(t);return r.delete(e),r}))}),[]),children:n})}),C?(0,ft.jsxs)(Gv,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:d,value:j,onChange:e=>P(e.target.value),disabled:p,form:m,children:[void 0===j?(0,ft.jsx)("option",{value:""}):null,Array.from(A)]},T):null]})})};rv.displayName=Wy;var nv="SelectTrigger",ov=r.forwardRef(((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...i}=e,a=Xy(n),s=Jy(nv,n),u=s.disabled||o,l=ct(t,s.onTriggerChange),c=Hy(n),f=r.useRef("touch"),[d,p,h]=Wv((e=>{const t=c().filter((e=>!e.disabled)),r=t.find((e=>e.value===s.value)),n=qv(t,e,r);void 0!==n&&s.onValueChange(n.value)})),m=e=>{u||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,ft.jsx)(Fy,{asChild:!0,...a,children:(0,ft.jsx)(qo.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":Uv(s.value)?"":void 0,...i,ref:l,onClick:Io(i.onClick,(e=>{e.currentTarget.focus(),"mouse"!==f.current&&m(e)})),onPointerDown:Io(i.onPointerDown,(e=>{f.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(m(e),e.preventDefault())})),onKeyDown:Io(i.onKeyDown,(e=>{const t=""!==d.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||Uy.includes(e.key)&&(m(),e.preventDefault())}))})})}));ov.displayName=nv;var iv="SelectValue",av=r.forwardRef(((e,t)=>{const{__scopeSelect:r,className:n,style:o,children:i,placeholder:a="",...s}=e,u=Jy(iv,r),{onValueNodeHasChildrenChange:l}=u,c=void 0!==i,f=ct(t,u.onValueNodeChange);return zo((()=>{l(c)}),[l,c]),(0,ft.jsx)(qo.span,{...s,ref:f,style:{pointerEvents:"none"},children:Uv(u.value)?(0,ft.jsx)(ft.Fragment,{children:a}):i})}));av.displayName=iv;var sv=r.forwardRef(((e,t)=>{const{__scopeSelect:r,children:n,...o}=e;return(0,ft.jsx)(qo.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})}));sv.displayName="SelectIcon";var uv=e=>(0,ft.jsx)(di,{asChild:!0,...e});uv.displayName="SelectPortal";var lv="SelectContent",cv=r.forwardRef(((e,t)=>{const n=Jy(lv,e.__scopeSelect),[o,i]=r.useState();if(zo((()=>{i(new DocumentFragment)}),[]),!n.open){const t=o;return t?Wo.createPortal((0,ft.jsx)(dv,{scope:e.__scopeSelect,children:(0,ft.jsx)(qy.Slot,{scope:e.__scopeSelect,children:(0,ft.jsx)("div",{children:e.children})})}),t):null}return(0,ft.jsx)(hv,{...e,ref:t})}));cv.displayName=lv;var fv=10,[dv,pv]=Ky(lv),hv=r.forwardRef(((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:u,sideOffset:l,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:y,avoidCollisions:v,...g}=e,b=Jy(lv,n),[w,x]=r.useState(null),[_,O]=r.useState(null),S=ct(t,(e=>x(e))),[E,j]=r.useState(null),[P,k]=r.useState(null),C=Hy(n),[A,N]=r.useState(!1),T=r.useRef(!1);r.useEffect((()=>{if(w)return ya(w)}),[w]),yi();const M=r.useCallback((e=>{const[t,...r]=C().map((e=>e.ref.current)),[n]=r.slice(-1),o=document.activeElement;for(const r of e){if(r===o)return;if(r?.scrollIntoView({block:"nearest"}),r===t&&_&&(_.scrollTop=0),r===n&&_&&(_.scrollTop=_.scrollHeight),r?.focus(),document.activeElement!==o)return}}),[C,_]),R=r.useCallback((()=>M([E,w])),[M,E,w]);r.useEffect((()=>{A&&R()}),[A,R]);const{onOpenChange:L,triggerPointerDownPosRef:I}=b;r.useEffect((()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():w.contains(r.target)||L(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}}),[w,L,I]),r.useEffect((()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[L]);const[D,F]=Wv((e=>{const t=C().filter((e=>!e.disabled)),r=t.find((e=>e.ref.current===document.activeElement)),n=qv(t,e,r);n&&setTimeout((()=>n.ref.current.focus()))})),z=r.useCallback(((e,t,r)=>{const n=!T.current&&!r;(void 0!==b.value&&b.value===t||n)&&(j(e),n&&(T.current=!0))}),[b.value]),B=r.useCallback((()=>w?.focus()),[w]),V=r.useCallback(((e,t,r)=>{const n=!T.current&&!r;(void 0!==b.value&&b.value===t||n)&&k(e)}),[b.value]),$="popper"===o?yv:mv,U=$===yv?{side:u,sideOffset:l,align:c,alignOffset:f,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:y,avoidCollisions:v}:{};return(0,ft.jsx)(dv,{scope:n,content:w,viewport:_,onViewportChange:O,itemRefCallback:z,selectedItem:E,onItemLeave:B,itemTextRefCallback:V,focusSelectedItem:R,selectedItemText:P,position:o,isPositioned:A,searchRef:D,children:(0,ft.jsx)(ua,{as:dt,allowPinchZoom:!0,children:(0,ft.jsx)(ii,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Io(i,(e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()})),children:(0,ft.jsx)(Qo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,ft.jsx)($,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...g,...U,onPlaced:()=>N(!0),ref:S,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:Io(g.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||F(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=C().filter((e=>!e.disabled)).map((e=>e.ref.current));if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout((()=>M(t))),e.preventDefault()}}))})})})})})}));hv.displayName="SelectContentImpl";var mv=r.forwardRef(((e,t)=>{const{__scopeSelect:n,onPlaced:o,...i}=e,a=Jy(lv,n),s=pv(lv,n),[u,l]=r.useState(null),[c,f]=r.useState(null),d=ct(t,(e=>f(e))),p=Hy(n),h=r.useRef(!1),m=r.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:g,focusSelectedItem:b}=s,w=r.useCallback((()=>{if(a.trigger&&a.valueNode&&u&&c&&y&&v&&g){const e=a.trigger.getBoundingClientRect(),t=c.getBoundingClientRect(),r=a.valueNode.getBoundingClientRect(),n=g.getBoundingClientRect();if("rtl"!==a.dir){const o=n.left-t.left,i=r.left-o,a=e.left-i,s=e.width+a,l=Math.max(s,t.width),c=window.innerWidth-fv,f=Fh(i,[fv,Math.max(fv,c-l)]);u.style.minWidth=s+"px",u.style.left=f+"px"}else{const o=t.right-n.right,i=window.innerWidth-r.right-o,a=window.innerWidth-e.right-i,s=e.width+a,l=Math.max(s,t.width),c=window.innerWidth-fv,f=Fh(i,[fv,Math.max(fv,c-l)]);u.style.minWidth=s+"px",u.style.right=f+"px"}const i=p(),s=window.innerHeight-2*fv,l=y.scrollHeight,f=window.getComputedStyle(c),d=parseInt(f.borderTopWidth,10),m=parseInt(f.paddingTop,10),b=parseInt(f.borderBottomWidth,10),w=d+m+l+parseInt(f.paddingBottom,10)+b,x=Math.min(5*v.offsetHeight,w),_=window.getComputedStyle(y),O=parseInt(_.paddingTop,10),S=parseInt(_.paddingBottom,10),E=e.top+e.height/2-fv,j=s-E,P=v.offsetHeight/2,k=d+m+(v.offsetTop+P),C=w-k;if(k<=E){const e=i.length>0&&v===i[i.length-1].ref.current;u.style.bottom="0px";const t=c.clientHeight-y.offsetTop-y.offsetHeight,r=k+Math.max(j,P+(e?S:0)+t+b);u.style.height=r+"px"}else{const e=i.length>0&&v===i[0].ref.current;u.style.top="0px";const t=Math.max(E,d+y.offsetTop+(e?O:0)+P)+C;u.style.height=t+"px",y.scrollTop=k-E+y.offsetTop}u.style.margin=`${fv}px 0`,u.style.minHeight=x+"px",u.style.maxHeight=s+"px",o?.(),requestAnimationFrame((()=>h.current=!0))}}),[p,a.trigger,a.valueNode,u,c,y,v,g,a.dir,o]);zo((()=>w()),[w]);const[x,_]=r.useState();zo((()=>{c&&_(window.getComputedStyle(c).zIndex)}),[c]);const O=r.useCallback((e=>{e&&!0===m.current&&(w(),b?.(),m.current=!1)}),[w,b]);return(0,ft.jsx)(vv,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:h,onScrollButtonChange:O,children:(0,ft.jsx)("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:(0,ft.jsx)(qo.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})}));mv.displayName="SelectItemAlignedPosition";var yv=r.forwardRef(((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:o=fv,...i}=e,a=Xy(r);return(0,ft.jsx)(zy,{...a,...i,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})}));yv.displayName="SelectPopperPosition";var[vv,gv]=Ky(lv,{}),bv="SelectViewport",wv=r.forwardRef(((e,t)=>{const{__scopeSelect:n,nonce:o,...i}=e,a=pv(bv,n),s=gv(bv,n),u=ct(t,a.onViewportChange),l=r.useRef(0);return(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,ft.jsx)(qy.Slot,{scope:n,children:(0,ft.jsx)(qo.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Io(i.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=s;if(n?.current&&r){const e=Math.abs(l.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*fv,o=parseFloat(r.style.minHeight),i=parseFloat(r.style.height),a=Math.max(o,i);if(a<n){const o=a+e,i=Math.min(n,o),s=o-i;r.style.height=i+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}l.current=t.scrollTop}))})})]})}));wv.displayName=bv;var xv="SelectGroup",[_v,Ov]=Ky(xv),Sv=r.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e,o=$o();return(0,ft.jsx)(_v,{scope:r,id:o,children:(0,ft.jsx)(qo.div,{role:"group","aria-labelledby":o,...n,ref:t})})}));Sv.displayName=xv;var Ev="SelectLabel",jv=r.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e,o=Ov(Ev,r);return(0,ft.jsx)(qo.div,{id:o.id,...n,ref:t})}));jv.displayName=Ev;var Pv="SelectItem",[kv,Cv]=Ky(Pv),Av=r.forwardRef(((e,t)=>{const{__scopeSelect:n,value:o,disabled:i=!1,textValue:a,...s}=e,u=Jy(Pv,n),l=pv(Pv,n),c=u.value===o,[f,d]=r.useState(a??""),[p,h]=r.useState(!1),m=ct(t,(e=>l.itemRefCallback?.(e,o,i))),y=$o(),v=r.useRef("touch"),g=()=>{i||(u.onValueChange(o),u.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,ft.jsx)(kv,{scope:n,value:o,disabled:i,textId:y,isSelected:c,onItemTextChange:r.useCallback((e=>{d((t=>t||(e?.textContent??"").trim()))}),[]),children:(0,ft.jsx)(qy.ItemSlot,{scope:n,value:o,disabled:i,textValue:f,children:(0,ft.jsx)(qo.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:m,onFocus:Io(s.onFocus,(()=>h(!0))),onBlur:Io(s.onBlur,(()=>h(!1))),onClick:Io(s.onClick,(()=>{"mouse"!==v.current&&g()})),onPointerUp:Io(s.onPointerUp,(()=>{"mouse"===v.current&&g()})),onPointerDown:Io(s.onPointerDown,(e=>{v.current=e.pointerType})),onPointerMove:Io(s.onPointerMove,(e=>{v.current=e.pointerType,i?l.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:Io(s.onPointerLeave,(e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()})),onKeyDown:Io(s.onKeyDown,(e=>{""!==l.searchRef?.current&&" "===e.key||(Gy.includes(e.key)&&g()," "===e.key&&e.preventDefault())}))})})})}));Av.displayName=Pv;var Nv="SelectItemText",Tv=r.forwardRef(((e,t)=>{const{__scopeSelect:n,className:o,style:i,...a}=e,s=Jy(Nv,n),u=pv(Nv,n),l=Cv(Nv,n),c=tv(Nv,n),[f,d]=r.useState(null),p=ct(t,(e=>d(e)),l.onItemTextChange,(e=>u.itemTextRefCallback?.(e,l.value,l.disabled))),h=f?.textContent,m=r.useMemo((()=>(0,ft.jsx)("option",{value:l.value,disabled:l.disabled,children:h},l.value)),[l.disabled,l.value,h]),{onNativeOptionAdd:y,onNativeOptionRemove:v}=c;return zo((()=>(y(m),()=>v(m))),[y,v,m]),(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(qo.span,{id:l.textId,...a,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Wo.createPortal(a.children,s.valueNode):null]})}));Tv.displayName=Nv;var Mv="SelectItemIndicator",Rv=r.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e;return Cv(Mv,r).isSelected?(0,ft.jsx)(qo.span,{"aria-hidden":!0,...n,ref:t}):null}));Rv.displayName=Mv;var Lv="SelectScrollUpButton",Iv=r.forwardRef(((e,t)=>{const n=pv(Lv,e.__scopeSelect),o=gv(Lv,e.__scopeSelect),[i,a]=r.useState(!1),s=ct(t,o.onScrollButtonChange);return zo((()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;a(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[n.viewport,n.isPositioned]),i?(0,ft.jsx)(zv,{...e,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));Iv.displayName=Lv;var Dv="SelectScrollDownButton",Fv=r.forwardRef(((e,t)=>{const n=pv(Dv,e.__scopeSelect),o=gv(Dv,e.__scopeSelect),[i,a]=r.useState(!1),s=ct(t,o.onScrollButtonChange);return zo((()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;a(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[n.viewport,n.isPositioned]),i?(0,ft.jsx)(zv,{...e,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));Fv.displayName=Dv;var zv=r.forwardRef(((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...i}=e,a=pv("SelectScrollButton",n),s=r.useRef(null),u=Hy(n),l=r.useCallback((()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)}),[]);return r.useEffect((()=>()=>l()),[l]),zo((()=>{const e=u().find((e=>e.ref.current===document.activeElement));e?.ref.current?.scrollIntoView({block:"nearest"})}),[u]),(0,ft.jsx)(qo.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Io(i.onPointerDown,(()=>{null===s.current&&(s.current=window.setInterval(o,50))})),onPointerMove:Io(i.onPointerMove,(()=>{a.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(o,50))})),onPointerLeave:Io(i.onPointerLeave,(()=>{l()}))})})),Bv=r.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e;return(0,ft.jsx)(qo.div,{"aria-hidden":!0,...n,ref:t})}));Bv.displayName="SelectSeparator";var Vv="SelectArrow",$v=r.forwardRef(((e,t)=>{const{__scopeSelect:r,...n}=e,o=Xy(r),i=Jy(Vv,r),a=pv(Vv,r);return i.open&&"popper"===a.position?(0,ft.jsx)(By,{...o,...n,ref:t}):null}));function Uv(e){return""===e||void 0===e}$v.displayName=Vv;var Gv=r.forwardRef(((e,t)=>{const{value:n,...o}=e,i=r.useRef(null),a=ct(t,i),s=Vy(n);return r.useEffect((()=>{const e=i.current,t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}}),[s,n]),(0,ft.jsx)($y,{asChild:!0,children:(0,ft.jsx)("select",{...o,ref:a,defaultValue:n})})}));function Wv(e){const t=Uo(e),n=r.useRef(""),o=r.useRef(0),i=r.useCallback((e=>{const r=n.current+e;t(r),function e(t){n.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout((()=>e("")),1e3))}(r)}),[t]),a=r.useCallback((()=>{n.current="",window.clearTimeout(o.current)}),[]);return r.useEffect((()=>()=>window.clearTimeout(o.current)),[]),[n,i,a]}function qv(e,t,r){const n=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,o=r?e.indexOf(r):-1;let i=function(e,t){return e.map(((r,n)=>e[(t+n)%e.length]))}(e,Math.max(o,0));1===n.length&&(i=i.filter((e=>e!==r)));const a=i.find((e=>e.textValue.toLowerCase().startsWith(n.toLowerCase())));return a!==r?a:void 0}Gv.displayName="BubbleSelect";var Hv=rv,Zv=ov,Kv=av,Yv=sv,Xv=uv,Qv=cv,Jv=wv,eg=Av,tg=Tv,rg=Rv;const ng=mo("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),og=mo("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var ig=["className","children"],ag=["className","children","position"],sg=["className","children"];function ug(){return ug=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ug.apply(null,arguments)}function lg(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var cg=Hv,fg=Kv,dg=r.forwardRef((function(e,t){var r=e.className,n=e.children,o=lg(e,ig);return io(Zv,ug({ref:t,className:Nr("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r)},o),n,io(Yv,{asChild:!0},io(ng,{className:"h-4 w-4 opacity-50"})))}));dg.displayName=Zv.displayName;var pg=r.forwardRef((function(e,t){var r=e.className,n=e.children,o=e.position,i=void 0===o?"popper":o,a=lg(e,ag);return io(Xv,null,io(Qv,ug({ref:t,className:Nr("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===i&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:i},a),io(Jv,{className:Nr("p-1","popper"===i&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},n)))}));pg.displayName=Qv.displayName;var hg=r.forwardRef((function(e,t){var r=e.className,n=e.children,o=lg(e,sg);return io(eg,ug({ref:t,className:Nr("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r)},o),io("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},io(rg,null,io(og,{className:"h-4 w-4"}))),io(tg,null,n))}));function mg(e){return mg="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},mg(e)}function yg(){return yg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yg.apply(null,arguments)}function vg(){vg=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==mg(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(mg(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function gg(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function bg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wg(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?wg(e,t):void 0}}(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.")}()}function wg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}hg.displayName=eg.displayName;var xg=Xf.object({fromEmail:Xf.string().email({message:"Need a valid email address."}),to:Xf.string().email({message:"Need a valid email address."})});function _g(e){var t=e.open,n=e.onOpenChange,o=e.connection,a=bg((0,r.useState)([]),2),s=a[0],u=a[1],l=Nh(),c=l.data,f=l.isLoading;l.isError;(0,r.useEffect)((function(){t&&u((null==c?void 0:c.data)||[])}),[t,c]);var d=Zu({resolver:el(xg),defaultValues:{to:"",fromEmail:o.fromEmail}});(0,r.useEffect)((function(){if(s.length>0){var e,t=(null===(e=s.find((function(e){return e.email===o.fromEmail})))||void 0===e?void 0:e.email)||s[0].email;d.setValue("fromEmail",t)}}),[s]);var p=jh(),h=p.mutateAsync,m=p.isPending,y=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){gg(i,n,o,a,s,"next",e)}function s(e){gg(i,n,o,a,s,"throw",e)}a(void 0)}))}}(vg().mark((function e(t){var r;return vg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={provider:o.provider,to:t.to,fromEmail:t.fromEmail||o.fromEmail},e.next=3,h(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return io(cs,{open:t,onOpenChange:n},io(ms,{style:{zIndex:999999}},io(ys,null,io(vs,null,(0,Lo.__)("Send Test Email","trigger")),io(gs,null,(0,Lo.__)("Send a test email to verify your connection is working properly.","trigger"))),io("div",{className:"pt-4"},io("div",{className:"mb-4"},io("p",{className:"text-sm font-medium mb-1"},(0,Lo.__)("Provider","trigger")),io(xs,{className:"text-sm [&:disabled]:opacity-100",value:o.provider,disabled:!0}))),io(vl,d,io("form",{onSubmit:d.handleSubmit(y),className:"space-y-4"},io("div",{className:"mb-4"},io("p",{className:"text-sm font-medium mb-1"},(0,Lo.__)("From","trigger"))),f?io("div",{className:"flex justify-left items-center h-[40px]"},io(_s,{className:"h-4 w-4 animate-spin mr-2"}),(0,Lo.__)("Loading...","trigger")):io(bl,{control:d.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(cg,{value:t.value,onValueChange:t.onChange},io(dg,null,io(fg,{placeholder:(0,Lo.__)("Select verified email","trigger")})),io(pg,{style:{zIndex:999999}},s.map((function(e){return io(hg,{key:e.email,value:e.email},e.email)})))))}}),io(bl,{control:d.control,name:"to",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Send To","trigger")),io(Sl,null,io(xs,yg({placeholder:"example@example.com"},t,{autoFocus:!0}))),io(kl,null))}}),io("div",{className:"flex justify-end gap-2 mt-6"},io(fs,{asChild:!0},io(lo,{variant:"outline"},(0,Lo.__)("Cancel","trigger"))),io(lo,{type:"submit",disabled:m},m?io(i().Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Sending...","trigger")):(0,Lo.__)("Send Test Email","trigger")))))))}function Og(e){return Og="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},Og(e)}function Sg(){return Sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sg.apply(null,arguments)}function Eg(){Eg=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Og(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Og(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function jg(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Pg(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){jg(i,n,o,a,s,"next",e)}function s(e){jg(i,n,o,a,s,"throw",e)}a(void 0)}))}}function kg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Cg(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Cg(e,t):void 0}}(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.")}()}function Cg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Ag=Xf.object({fromEmail:Xf.string().email({message:"Need a valid email address."}),to:Xf.string().email({message:"Need a valid email address."})});function Ng(e){var t=e.open,n=e.onOpenChange,o=e.connection,a="".concat(rd.site_url,"/wp-admin/admin.php?page=trigger"),s=kg((0,r.useState)(!1),2),u=s[0],l=s[1],c=Zu({resolver:el(Ag),defaultValues:{to:"",fromEmail:o.fromEmail}}),f=jh(),d=f.mutateAsync,p=f.isPending,h=function(){var e=Pg(Eg().mark((function e(t){var r;return Eg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={provider:o.provider,to:t.to,fromEmail:t.fromEmail||o.fromEmail},e.next=3,d(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),m=kh(),y=function(){var e=Pg(Eg().mark((function e(t){return Eg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,m.mutateAsync();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),v=Ah();(0,r.useEffect)((function(){t&&g()}),[t]);var g=function(){var e=Pg(Eg().mark((function e(){var t,r;return Eg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,v.mutateAsync();case 2:t=e.sent,r=t.status_code,l(200===r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return io(cs,{open:t,onOpenChange:n},io(ms,{style:{zIndex:999999,maxWidth:"550px"}},v.isPending?io(_s,{className:"animate-spin mx-auto mt-10"}):u?io(i().Fragment,null,io(ys,null,io(vs,null,(0,Lo.__)("Send Test Email","trigger")),io(gs,null,(0,Lo.__)("Send a test email to verify your connection is working properly.","trigger"))),io("div",{className:"pt-4"},io("div",{className:"mb-4"},io("p",{className:"text-sm font-medium mb-1"},(0,Lo.__)("Provider","trigger")),io(xs,{className:"text-sm [&:disabled]:opacity-100",value:o.provider,disabled:!0}))),io(vl,c,io("form",{onSubmit:c.handleSubmit(h),className:"space-y-4"},io("div",{className:"mb-4"},io("p",{className:"text-sm font-medium mb-1"},(0,Lo.__)("From","trigger"))),io(bl,{control:c.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io(Sl,null,io(xs,Sg({placeholder:"example@example.com"},t,{autoFocus:!0}))),io(kl,null))}}),io(bl,{control:c.control,name:"to",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Send To","trigger")),io(Sl,null,io(xs,Sg({placeholder:"example@example.com"},t,{autoFocus:!0}))),io(kl,null))}}),io("div",{className:"flex justify-end gap-2 mt-6"},io(fs,{asChild:!0},io(lo,{variant:"outline"},(0,Lo.__)("Cancel","trigger"))),io(lo,{type:"submit",disabled:p},p?io(i().Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Sending...","trigger")):(0,Lo.__)("Send Test Email","trigger")))))):io(i().Fragment,null,io(ys,{className:"mt-10"},io(vs,null,(0,Lo.__)("Set this redirect uri into your google console","trigger"))),io("div",{className:"mt-4"},io("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md mb-4"},io(xs,{value:a,readOnly:!0,className:"flex-1"}),io(lo,{variant:"outline",size:"icon",onClick:function(){navigator.clipboard.writeText(a),mh.success((0,Lo.__)("Copied to clipboard","trigger"))}},io("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},io("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),io("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})))),io(lo,{variant:"default",size:"icon",onClick:function(e){return y(e)},className:"w-full"},m.isPending?io(i().Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Connecting...","trigger")):io(i().Fragment,null,(0,Lo.__)("Connect With Gmail","trigger")))))))}var Tg=o(1594);function Mg(e){var t=e.open,r=e.onOpenChange,n=e.connection;return io(Tg.Fragment,null,"smtp"===n.provider&&io(Dh,{open:t,onOpenChange:r,connection:n}),"ses"===n.provider&&io(_g,{open:t,onOpenChange:r,connection:n}),"gmail"===n.provider&&io(Ng,{open:t,onOpenChange:r,connection:n}))}var Rg="".concat(rd.site_url,"/wp-admin/admin.php?page=trigger"),Lg=[{label:"SMTP",value:"smtp"},{label:"Amazon SES",value:"ses"},{label:"Gmail",value:"gmail"}],Ig=[{label:"None",value:"none"},{label:"SSL",value:"ssl"},{label:"TLS",value:"tls"}],Dg=[{value:"us-east-1",label:"US East (N. Virginia)"},{value:"us-east-2",label:"US East (Ohio)"},{value:"us-west-1",label:"US West (N. California)"},{value:"us-west-2",label:"US West (Oregon)"},{value:"eu-west-1",label:"EU (Ireland)"},{value:"eu-central-1",label:"EU (Frankfurt)"},{value:"ap-south-1",label:"Asia Pacific (Mumbai)"},{value:"ap-southeast-1",label:"Asia Pacific (Singapore)"},{value:"ap-southeast-2",label:"Asia Pacific (Sydney)"},{value:"ap-northeast-1",label:"Asia Pacific (Tokyo)"}],Fg=Xf.enum(["smtp","ses","gmail"],{message:"Email Provider is required"}),zg=Xf.enum(["none","ssl","tls"],{message:"SMTP Security isn't required!"}).default("tls"),Bg=Xf.enum(["25","465","587"],{message:"SMTP port isn't valid!"}),Vg=Xf.object({provider:Fg,fromName:Xf.string().min(1,{message:"From Name is required"}),fromEmail:Xf.string().email({message:"Invalid email address"}),smtpHost:Xf.string().min(1,{message:"SMTP Host is required"}),smtpPort:Bg,smtpSecurity:zg,smtpUsername:Xf.string().min(1,{message:"SMTP Username is required"}),smtpPassword:Xf.string().min(1,{message:"SMTP Password is required"})}),$g=Xf.object({provider:Fg,fromName:Xf.string().min(1,{message:"From Name is required"}),fromEmail:Xf.string().email({message:"Invalid email address"}),accessKeyId:Xf.string().min(1,{message:"Access Key ID is required"}),secretAccessKey:Xf.string().min(1,{message:"Secret Access Key is required"}),region:Xf.string().min(1,{message:"Region is required"})}),Ug=Xf.object({provider:Fg,fromName:Xf.string().min(1,{message:"From Name is required"}),fromEmail:Xf.string().email({message:"Invalid email address"}),clientId:Xf.string().min(1,{message:"Client ID is required"}),clientSecret:Xf.string().min(1,{message:"Client Secret is required"})}),Gg=(Xf.object({provider:Fg,fromEmail:Xf.string().email({message:"Invalid From-email address"}),to:Xf.string().email({message:"Invalid Send-to Email address"})}),o(1594));function Wg(e){return Wg="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},Wg(e)}function qg(){return qg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qg.apply(null,arguments)}function Hg(){Hg=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Wg(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Wg(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Zg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Kg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Zg(Object(r),!0).forEach((function(t){Yg(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zg(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Yg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Wg(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Wg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Wg(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xg(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}const Qg=function(e){var t=e.connection,n=Zu({resolver:el(Vg),defaultValues:{provider:t.provider||"smtp",fromName:t.fromName||"",fromEmail:t.fromEmail||"",smtpHost:t.smtpHost||"",smtpPort:t.smtpPort,smtpSecurity:t.smtpSecurity,smtpUsername:t.smtpUsername||"",smtpPassword:t.smtpPassword||""},mode:"onChange"});(0,r.useEffect)((function(){t&&n.reset({provider:t.provider||"smtp",fromName:t.fromName||"",fromEmail:t.fromEmail||"",smtpHost:t.smtpHost||"",smtpPort:t.smtpPort,smtpSecurity:t.smtpSecurity,smtpUsername:t.smtpUsername||"",smtpPassword:t.smtpPassword||""})}),[t,n]);var o=Eh(),i=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Xg(i,n,o,a,s,"next",e)}function s(e){Xg(i,n,o,a,s,"throw",e)}a(void 0)}))}}(Hg().mark((function e(t){var r;return Hg().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Kg({},t),e.next=3,o.mutateAsync(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return io(vl,n,io("form",{onSubmit:n.handleSubmit(i),className:"space-y-4 py-4"},io(bl,{control:n.control,name:"fromName",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Name","trigger")),io(Sl,null,io(xs,qg({placeholder:"Sender Name"},t,{autoFocus:!0}))),io(kl,null))}}),io(bl,{control:n.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io(Sl,null,io(xs,qg({type:"email",placeholder:"sender@example.com"},t))),io(kl,null))}}),io(bl,{control:n.control,name:"smtpHost",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Host","trigger")),io(Sl,null,io(xs,qg({placeholder:"smtp.example.com"},t))),io(kl,null))}}),io(bl,{control:n.control,name:"smtpPort",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Port","trigger")),io(Sl,null,io(xs,qg({placeholder:"587"},t))),io(kl,null))}}),io(bl,{control:n.control,name:"smtpSecurity",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Security","trigger")),io(cg,{onValueChange:t.onChange,defaultValue:t.value},io(Sl,null,io(dg,null,io(fg,{placeholder:(0,Lo.__)("Select security type","trigger")}))),io(pg,{style:{zIndex:999999}},io(hg,{value:"none"},(0,Lo.__)("None","trigger")),io(hg,{value:"ssl"},(0,Lo.__)("SSL","trigger")),io(hg,{value:"tls"},(0,Lo.__)("TLS","trigger")))),io(kl,null))}}),io(bl,{control:n.control,name:"smtpUsername",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Username","trigger")),io(Sl,null,io(xs,qg({placeholder:"username"},t))),io(kl,null))}}),io(bl,{control:n.control,name:"smtpPassword",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Password","trigger")),io(Sl,null,io(xs,qg({type:"password",placeholder:"••••••••"},t))),io(kl,null))}}),io("div",{className:"flex justify-end gap-2 mt-6"},io(lo,{type:"submit",disabled:n.formState.isSubmitting},n.formState.isSubmitting?io(Gg.Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Updating...","trigger")):(0,Lo.__)("Save Changes","trigger")))))};var Jg=o(1594);function eb(e){return eb="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},eb(e)}function tb(){return tb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tb.apply(null,arguments)}function rb(){rb=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==eb(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(eb(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function nb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ob(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nb(Object(r),!0).forEach((function(t){ib(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ib(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=eb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==eb(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ab(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}const sb=function(e){var t=e.connection,n=Zu({resolver:el($g),defaultValues:{provider:t.provider,fromName:t.fromName||"",fromEmail:t.fromEmail||"",accessKeyId:t.accessKeyId||"",secretAccessKey:t.secretAccessKey||"",region:t.region||""},mode:"onChange"});(0,r.useEffect)((function(){t&&n.reset({provider:t.provider,fromName:t.fromName||"",fromEmail:t.fromEmail||"",accessKeyId:t.accessKeyId||"",secretAccessKey:t.secretAccessKey||"",region:t.region||""})}),[t,n]);var o=Eh(),i=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ab(i,n,o,a,s,"next",e)}function s(e){ab(i,n,o,a,s,"throw",e)}a(void 0)}))}}(rb().mark((function e(t){var r;return rb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=ob({},t),e.next=3,o.mutateAsync(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return io(vl,n,io("form",{onSubmit:n.handleSubmit(i),className:"space-y-4 py-4"},io(bl,{control:n.control,name:"fromName",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Name","trigger")),io(Sl,null,io(xs,tb({placeholder:"Sender Name"},t,{autoFocus:!0}))),io(kl,null))}}),io(bl,{control:n.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io("div",null,io(Sl,{className:"flex-1"},io(xs,tb({type:"email",placeholder:"sender@example.com"},t)))),io(El,null,(0,Lo.__)("AWS SES requires email addresses to be verified before they can be used to send emails.","trigger")),io(kl,null))}}),io(bl,{control:n.control,name:"accessKeyId",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Access Key ID","trigger")),io(Sl,null,io(xs,tb({placeholder:"AKIAXXXXXXXXXXXXXXXX"},t))),io(kl,null))}}),io(bl,{control:n.control,name:"secretAccessKey",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Secret Access Key","trigger")),io(Sl,null,io(xs,tb({type:"password",placeholder:"••••••••••••••••••••••••••••••••"},t))),io(kl,null))}}),io(bl,{control:n.control,name:"region",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Region","trigger")),io(cg,{onValueChange:t.onChange,defaultValue:t.value},io(Sl,null,io(dg,null,io(fg,{placeholder:(0,Lo.__)("Select region","trigger")}))),io(pg,{style:{zIndex:999999}},Dg.map((function(e){return io(hg,{key:e.value,value:e.value},(0,Lo.__)(e.label,"trigger"))})))),io(kl,null))}}),io("div",{className:"flex justify-end gap-2 mt-6"},io(lo,{type:"submit",disabled:n.formState.isSubmitting},n.formState.isSubmitting?io(Jg.Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Updating...","trigger")):(0,Lo.__)("Save Changes","trigger")))))};var ub=o(1594);function lb(e){return lb="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},lb(e)}function cb(){return cb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cb.apply(null,arguments)}function fb(){fb=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==lb(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(lb(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function db(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function pb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?db(Object(r),!0).forEach((function(t){hb(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):db(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function hb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=lb(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=lb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==lb(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mb(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function yb(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){mb(i,n,o,a,s,"next",e)}function s(e){mb(i,n,o,a,s,"throw",e)}a(void 0)}))}}function vb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gb(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gb(e,t):void 0}}(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.")}()}function gb(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const bb=function(e){var t=e.connection,n=vb((0,r.useState)(!1),2),o=n[0],i=n[1],a=Zu({resolver:el(Ug),defaultValues:{provider:t.provider,fromName:t.fromName||"",fromEmail:t.fromEmail||"",clientId:t.clientId||"",clientSecret:t.clientSecret||""},mode:"onChange"});(0,r.useEffect)((function(){t&&a.reset({provider:t.provider,fromName:t.fromName||"",fromEmail:t.fromEmail||"",clientId:t.clientId||"",clientSecret:t.clientSecret||""})}),[t,a]);var s=Eh(),u=function(){var e=yb(fb().mark((function e(t){var r;return fb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=pb({},t),e.next=3,s.mutateAsync(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),l=kh(),c=function(){var e=yb(fb().mark((function e(t){return fb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,l.mutateAsync();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),f=Ah();(0,r.useEffect)((function(){d()}),[]);var d=function(){var e=yb(fb().mark((function e(){var t,r;return fb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.mutateAsync();case 2:t=e.sent,r=t.status_code,i(200===r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return io(ub.Fragment,null,io(vl,a,io("form",{onSubmit:a.handleSubmit(u),className:"space-y-4 py-4"},io(bl,{control:a.control,name:"fromName",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Name","trigger")),io(Sl,null,io(xs,cb({placeholder:"Sender Name"},t,{autoFocus:!0}))),io(kl,null))}}),io(bl,{control:a.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io("div",null,io(Sl,{className:"flex-1"},io(xs,cb({type:"email",placeholder:"sender@example.com"},t)))),io(El,null,(0,Lo.__)("AWS SES requires email addresses to be verified before they can be used to send emails.","trigger")),io(kl,null))}}),io(bl,{control:a.control,name:"clientId",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Client ID","trigger")),io(Sl,null,io(xs,cb({placeholder:"AKIAXXXXXXXXXXXXXXXX"},t))),io(kl,null))}}),io(bl,{control:a.control,name:"clientSecret",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Client Secret","trigger")),io(Sl,null,io(xs,cb({type:"password",placeholder:"••••••••••••••••••••••••••••••••"},t))),io(kl,null))}}),io("div",{className:"flex justify-end gap-2 mt-6"},io(lo,{type:"submit",disabled:a.formState.isSubmitting},a.formState.isSubmitting?io(ub.Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Updating...","trigger")):(0,Lo.__)("Save Changes","trigger"))))),io("hr",{className:"mt-4"}),io("div",{className:"mt-4"},io("h2",{className:"mb-2"},(0,Lo.__)("Use this URI to your google cloud console","trigger")),io("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md mb-4"},io(xs,{value:Rg,readOnly:!0,className:"flex-1"}),io(lo,{variant:"outline",size:"icon",onClick:yb(fb().mark((function e(){return fb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,up(Rg);case 2:mh.success((0,Lo.__)("Copied to clipboard","trigger"));case 3:case"end":return e.stop()}}),e)})))},io("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},io("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),io("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})))),f.isPending?io(_s,{className:"h-4 w-4 animate-spin mx-auto"}):io(ub.Fragment,null,o?io(lo,{variant:"destructive",size:"icon",onClick:function(e){return c(e)},className:"w-full"},l.isPending&&io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Reconnect With Gmail","trigger")):io(lo,{variant:"default",size:"icon",onClick:function(e){return c(e)},className:"w-full"},l.isPending&&io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Connect With Gmail","trigger")))))};var wb=o(1594);function xb(e){var t=e.open,r=e.onOpenChange,n=e.connection;return io(cs,{open:t,onOpenChange:r},io(ms,{className:"sm:max-w-md overflow-y-auto",style:{zIndex:999999,maxWidth:"550px"}},io(ys,null,io(vs,null,(0,Lo.__)("Edit Connection","trigger")),io(gs,null,(0,Lo.__)("Update your email connection settings.","trigger"))),"smtp"===n.provider&&io(wb.Fragment,null,io(Qg,{connection:n})),"ses"===n.provider&&io(wb.Fragment,null,io(sb,{connection:n})),"gmail"===n.provider&&io(bb,{connection:n})))}var _b=["className"],Ob=["className","children"],Sb=["className"],Eb=["className"],jb=["className"],Pb=["className"];function kb(){return kb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kb.apply(null,arguments)}function Cb(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Ab=Ka,Nb=Ya,Tb=r.forwardRef((function(e,t){var r=e.className,n=Cb(e,_b);return io(Xa,kb({ref:t,className:Nr("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r)},n))}));Tb.displayName=Xa.displayName;var Mb=r.forwardRef((function(e,t){var r=e.className,n=e.children,o=Cb(e,Ob);return io(Nb,null,io(Tb,null),io(Qa,kb({ref:t,className:Nr("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r)},o),n,io(ts,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},io(rs,{className:"h-4 w-4"}),io("span",{className:"sr-only"},(0,Lo.__)("Close","trigger")))))}));Mb.displayName=Qa.displayName;var Rb=function(e){var t=e.className,r=Cb(e,Sb);return io("div",kb({className:Nr("flex flex-col space-y-1.5 text-center sm:text-left",t)},r))};Rb.displayName="DialogHeader";var Lb=function(e){var t=e.className,r=Cb(e,Eb);return io("div",kb({className:Nr("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},r))};Lb.displayName="DialogFooter";var Ib=r.forwardRef((function(e,t){var r=e.className,n=Cb(e,jb);return io(Ja,kb({ref:t,className:Nr("text-lg font-semibold leading-none tracking-tight",r)},n))}));Ib.displayName=Ja.displayName;var Db=r.forwardRef((function(e,t){var r=e.className,n=Cb(e,Pb);return io(es,kb({ref:t,className:Nr("text-sm text-muted-foreground",r)},n))}));function Fb(e){return Fb="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},Fb(e)}function zb(){return zb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zb.apply(null,arguments)}function Bb(){Bb=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Fb(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Fb(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Vb(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}Db.displayName=es.displayName;var $b={default:{confirmButton:"bg-primary hover:bg-primary/90",icon:"text-primary"},danger:{confirmButton:"bg-destructive hover:bg-destructive/90 text-destructive-foreground",icon:"text-destructive"},warning:{confirmButton:"bg-yellow-500 hover:bg-yellow-600 text-white",icon:"text-yellow-500"},success:{confirmButton:"bg-green-500 hover:bg-green-600 text-white",icon:"text-green-500"}},Ub=function(e){var t=e.open,r=e.onOpenChange,n=e.title,o=void 0===n?"Confirm Action":n,a=e.description,s=e.children,u=e.icon,l=e.variant,c=void 0===l?"default":l,f=e.onConfirm,d=e.onCancel,p=e.confirmText,h=void 0===p?"Confirm":p,m=e.cancelText,y=void 0===m?"Cancel":m,v=e.confirmButtonProps,g=e.cancelButtonProps,b=e.loading,w=void 0!==b&&b,x=e.loadingText,_=void 0===x?"Processing...":x,O=e.className,S=e.contentClassName,E=e.headerClassName,j=e.footerClassName,P=e.closeOnConfirm,k=void 0===P||P,C=e.preventCloseOnOutsideClick,A=void 0!==C&&C,N=e.hideFooter,T=void 0!==N&&N,M=e.footerContent,R=e.CustomHeader,L=e.CustomFooter,I=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Vb(i,n,o,a,s,"next",e)}function s(e){Vb(i,n,o,a,s,"throw",e)}a(void 0)}))}}(Bb().mark((function e(){return Bb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f();case 3:k&&r(!1),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(){return e.apply(this,arguments)}}(),D=function(e){A&&t&&!e||(r(e),!e&&d&&d())},F=$b[c];return io(Ab,{open:t,onOpenChange:D},io(Mb,{className:Nr("sm:max-w-[425px]",S,O)},R?io(R,{className:E}):io(Rb,{className:E},io(Ib,{className:"flex items-center gap-2"},u,o),a&&io(Db,null,a)),s,!T&&io(Lb,{className:j},M||io(i().Fragment,null,io(lo,zb({variant:"outline",onClick:function(){return D(!1)},disabled:w},g),y),io(lo,zb({className:Nr(F.confirmButton),disabled:w,onClick:I},v),w&&io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),w?_:h))),L&&io(L,{className:j})))};Ub.Header=Rb,Ub.Footer=Lb,Ub.Title=Ib,Ub.Description=Db;const Gb=mo("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);function Wb(e){return Wb="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},Wb(e)}function qb(){qb=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Wb(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Wb(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Hb(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Zb(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Kb(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Kb(e,t):void 0}}(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.")}()}function Kb(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Yb(e){var t=e.open,n=e.onOpenChange,o=e.connection,i=e.setInitialConnections,a=Zb((0,r.useState)(!1),2),s=a[0],u=a[1],l=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Hb(i,n,o,a,s,"next",e)}function s(e){Hb(i,n,o,a,s,"throw",e)}a(void 0)}))}}(qb().mark((function e(){var t,r,a;return qb().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return");case 2:return u(!0),e.prev=3,(t=new FormData).append("action","delete_email_config"),t.append("trigger_nonce",rd.nonce_value),t.append("provider",o.provider),e.next=10,fetch(rd.ajax_url,{method:"POST",body:t});case 10:return r=e.sent,e.next=13,r.json();case 13:200===(null==(a=e.sent)?void 0:a.status_code)?(i&&Array.isArray(a.data)&&i(a.data),mh.success(a.message||(0,Lo.__)("Connection deleted successfully!"))):mh.error(a.message||(0,Lo.__)("Failed to delete connection. Please try again.","trigger")),e.next=21;break;case 17:e.prev=17,e.t0=e.catch(3),mh.error((0,Lo.__)("An unexpected error occurred. Please try again.","trigger"));case 21:return e.prev=21,u(!1),n(!1),e.finish(21);case 25:case"end":return e.stop()}}),e,null,[[3,17,21,25]])})));return function(){return e.apply(this,arguments)}}();return io(Ub,{open:t,onOpenChange:n,title:(0,Lo.__)("Delete Connection","trigger"),description:(0,Lo.__)("Are you sure you want to delete this connection? This action cannot be undone.","trigger"),icon:io(Gb,{className:"h-5 w-5 text-destructive"}),variant:"danger",confirmText:(0,Lo.__)("Delete","trigger"),cancelText:(0,Lo.__)("Cancel","trigger"),onConfirm:l,loading:s,loadingText:(0,Lo.__)("Deleting...","trigger")},o&&io("div",{className:"space-y-2 mt-2 mb-4"},io("div",{className:"grid grid-cols-2 gap-2"},io("div",null,io("span",{className:"font-medium"},(0,Lo.__)("Provider:","trigger")),io("p",{className:"text-sm text-muted-foreground"},o.provider)),io("div",null,io("span",{className:"font-medium"},(0,Lo.__)("Email:","trigger")),io("p",{className:"text-sm text-muted-foreground"},o.fromEmail)))))}const Xb=mo("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Qb=mo("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),Jb=mo("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var ew=["className"],tw=["className"],rw=["className"],nw=["className"],ow=["className"],iw=["className"];function aw(){return aw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aw.apply(null,arguments)}function sw(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var uw=r.forwardRef((function(e,t){var r=e.className,n=sw(e,ew);return io("div",aw({ref:t,className:Nr("rounded-xl border bg-card text-card-foreground shadow",r)},n))}));uw.displayName="Card";var lw=r.forwardRef((function(e,t){var r=e.className,n=sw(e,tw);return io("div",aw({ref:t,className:Nr("flex flex-col space-y-1.5 p-6",r)},n))}));lw.displayName="CardHeader";var cw=r.forwardRef((function(e,t){var r=e.className,n=sw(e,rw);return io("div",aw({ref:t,className:Nr("font-semibold leading-none tracking-tight",r)},n))}));cw.displayName="CardTitle";var fw=r.forwardRef((function(e,t){var r=e.className,n=sw(e,nw);return io("div",aw({ref:t,className:Nr("text-sm text-muted-foreground",r)},n))}));fw.displayName="CardDescription";var dw=r.forwardRef((function(e,t){var r=e.className,n=sw(e,ow);return io("div",aw({ref:t,className:Nr("p-6 pt-0",r)},n))}));dw.displayName="CardContent",r.forwardRef((function(e,t){var r=e.className,n=sw(e,iw);return io("div",aw({ref:t,className:Nr("flex items-center p-6 pt-0",r)},n))})).displayName="CardFooter";var pw=["className","variant"];function hw(){return hw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hw.apply(null,arguments)}var mw=xt("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",success:"bg-green-100 text-green-800 hover:bg-green-200/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input bg-background hover:bg-accent hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function yw(e){var t=e.className,r=e.variant,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,pw);return io("div",hw({className:Nr(mw({variant:r}),t)},n))}function vw(e){return vw="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},vw(e)}function gw(){return gw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gw.apply(null,arguments)}function bw(){bw=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==vw(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(vw(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function ww(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function xw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _w(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_w(e,t):void 0}}(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.")}()}function _w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Ow=Xf.object({email:Xf.string().email({message:"Please enter a valid email address."})});function Sw(e){var t=e.open,n=e.onOpenChange,o=e.connection,a=xw((0,r.useState)(!1),2),s=(a[0],a[1],xw((0,r.useState)([]),2)),u=s[0],l=s[1],c=xw((0,r.useState)(!1),2),f=(c[0],c[1],Zu({resolver:el(Ow),defaultValues:{email:""}})),d=Nh(),p=d.data,h=d.isLoading,m=d.isFetching,y=(d.isError,d.refetch);(0,r.useEffect)((function(){null!=p&&p.data&&l((null==p?void 0:p.data)||[])}),[p]);var v,g=ep({mutationFn:(v=_h(wh().mark((function e(t){var r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=gh({action:"verify_ses_email"},t),e.next=3,yp(rd.ajax_url,{body:t});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)}))),function(e){return v.apply(this,arguments)}),onSuccess:function(e){var t;mh.success(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Email verified successfully!","trigger"))},onError:function(e){var t;mh.error(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Failed to verify email","trigger"))}}),b=g.mutateAsync,w=g.isPending,x=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){ww(i,n,o,a,s,"next",e)}function s(e){ww(i,n,o,a,s,"throw",e)}a(void 0)}))}}(bw().mark((function e(t){var r,n;return bw().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={email:t.email,provider:o.provider},e.next=3,b(r);case 3:n=e.sent,200===n.status_code?(f.reset(),setTimeout((function(){y()}),1e3)):mh.error((0,Lo.__)("Failed to send verification email. Please try again.","trigger"));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return io(cs,{open:t,onOpenChange:n},io(ms,{className:"overflow-y-auto",style:{zIndex:999999}},io(ys,{className:"mb-6"},io(vs,null,(0,Lo.__)("Verify AWS SES Email Address","trigger")),io(gs,null,(0,Lo.__)("AWS SES requires that email addresses be verified before they can be used as a sender. Use this form to verify your email addresses.","trigger"))),io("div",{className:"space-y-8"},io(uw,null,io(lw,null,io(cw,null,(0,Lo.__)("Add New Email Address","trigger")),io(fw,null,(0,Lo.__)("Enter an email address that you want to send emails from","trigger"))),io(dw,null,io(vl,f,io("form",{onSubmit:f.handleSubmit(x),className:"space-y-4"},io(bl,{control:f.control,name:"email",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Email Address","trigger")),io(Sl,null,io(xs,gw({placeholder:"you@example.com"},t))),io(El,null,(0,Lo.__)("You'll receive a verification email with a link to confirm ownership.","trigger")),io(kl,null))}}),io("div",{className:"flex justify-end"},io(lo,{type:"submit",disabled:w},w?io(i().Fragment,null,io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Sending...","trigger")):(0,Lo.__)("Send Verification","trigger"))))))),io(uw,null,io(lw,{className:"flex flex-row items-center justify-between space-y-0 pb-2"},io("div",null,io(cw,null,(0,Lo.__)("Verified Email Addresses","trigger")),io(fw,null,(0,Lo.__)("These email addresses have been registered with AWS SES","trigger"))),io(lo,{variant:"outline",size:"sm",className:"gap-1",onClick:function(){y()},disabled:h||m},h||m?io(_s,{className:"h-4 w-4 animate-spin"}):io(Jb,{className:"h-4 w-4"}),(0,Lo.__)("Refresh","trigger"))),io(dw,null,h||m?io("div",{className:"flex justify-center py-6"},io(_s,{className:"h-8 w-8 animate-spin text-muted-foreground"})):u.length>0?io(Po,null,io(ko,null,io(Ao,null,io(No,null,(0,Lo.__)("Email Address","trigger")),io(No,{className:"w-[150px] text-right"},(0,Lo.__)("Status","trigger")))),io(Co,null,u.map((function(e){return io(Ao,{key:e.email},io(To,null,e.email),io(To,{className:"text-right"},"Success"===(t=e.status)?io(yw,{variant:"success",className:"flex items-center gap-1"},io(Xb,{className:"h-3 w-3"}),(0,Lo.__)("Verified","trigger")):"Pending"===t?io(yw,{variant:"outline",className:"flex items-center gap-1 text-yellow-500 border-yellow-500"},io(Qb,{className:"h-3 w-3"}),(0,Lo.__)("Pending","trigger")):io(yw,{variant:"destructive",className:"flex items-center gap-1"},io(Qb,{className:"h-3 w-3"}),t)));var t})))):io("div",{className:"py-6 text-center text-muted-foreground"},(0,Lo.__)("No verified email addresses found. Use the form above to verify an email address.","trigger"))))),io("div",{className:"mt-6 flex justify-end"},io(fs,{asChild:!0},io(lo,{variant:"outline"},(0,Lo.__)("Close","trigger"))))))}var Ew=o(1594);function jw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Pw(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pw(e,t):void 0}}(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.")}()}function Pw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const kw=function(e){var t=e.initialConnections,n=e.setInitialConnections,o=te(),i=jw((0,r.useState)(null),2),a=i[0],s=i[1],u=jw((0,r.useState)(!1),2),l=u[0],c=u[1],f=jw((0,r.useState)(!1),2),d=f[0],p=f[1],h=jw((0,r.useState)(!1),2),m=h[0],y=h[1],v=jw((0,r.useState)(!1),2),g=v[0],b=v[1];return io("div",{className:"rounded-md border mt-10 p-4"},io("div",{className:"flex justify-between py-3 mb-3"},io("h3",{className:"text-lg font-medium"},(0,Lo.__)("Connection List","trigger")),io(lo,{size:"sm",className:"gap-2",onClick:function(){return o("/add-connection")}},io(yo,{className:"h-5 w-5"}),(0,Lo.__)("Add Connection","trigger"))),io(Po,{className:"border-solid border border-rounded-md border-gray-200"},io(ko,{className:"bg-gray-100"},io(Ao,null,io(No,null,(0,Lo.__)("Connection","trigger")),io(No,null,(0,Lo.__)("Provider","trigger")),io(No,null,(0,Lo.__)("Email","trigger")),io(No,{className:"cursor-pointer"},(0,Lo.__)("Created On ↓","trigger")),io(No,null,(0,Lo.__)("Test Email","trigger")),io(No,null,(0,Lo.__)("Actions","trigger")))),io(Co,null,t.map((function(e,t){return io(Ao,{key:t},io(To,null,"ses"===e.provider?io("svg",{width:"25",height:"25",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},io("g",{"clip-path":"url(#clip0_214_10729)"},io("path",{d:"M80 0H0V80H80V0Z",fill:"url(#paint0_linear_214_10729)"}),io("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M57 60.9999C57 59.3738 55.626 57.9998 54 57.9998C52.374 57.9998 51 59.3738 51 60.9999C51 62.6259 52.374 63.9999 54 63.9999C55.626 63.9999 57 62.6259 57 60.9999ZM40 59.9999C38.374 59.9999 37 61.3739 37 62.9999C37 64.6259 38.374 66 40 66C41.626 66 43 64.6259 43 62.9999C43 61.3739 41.626 59.9999 40 59.9999ZM26 57.9998C24.374 57.9998 23 59.3738 23 60.9999C23 62.6259 24.374 63.9999 26 63.9999C27.626 63.9999 29 62.6259 29 60.9999C29 59.3738 27.626 57.9998 26 57.9998ZM28.605 42.9996H51.395L43.739 36.1104L40.649 38.7585C40.463 38.9195 40.23 38.9995 39.999 38.9995C39.768 38.9995 39.535 38.9195 39.349 38.7585L36.26 36.1104L28.605 42.9996ZM27 28.1733V41.7545L34.729 34.7984L27 28.1733ZM51.297 26.9993H28.703L39.999 36.6824L51.297 26.9993ZM53 41.7545V28.1733L45.271 34.7974L53 41.7545ZM59 60.9999C59 63.7099 56.71 66 54 66C51.29 66 49 63.7099 49 60.9999C49 58.6308 50.75 56.5838 53 56.1058V52.9997H41V58.1058C43.25 58.5838 45 60.6309 45 62.9999C45 65.71 42.71 68 40 68C37.29 68 35 65.71 35 62.9999C35 60.6309 36.75 58.5838 39 58.1058V52.9997H27V56.1058C29.25 56.5838 31 58.6308 31 60.9999C31 63.7099 28.71 66 26 66C23.29 66 21 63.7099 21 60.9999C21 58.6308 22.75 56.5838 25 56.1058V51.9997C25 51.4477 25.447 50.9997 26 50.9997H39V44.9996H26C25.447 44.9996 25 44.5516 25 43.9996V25.9993C25 25.4472 25.447 24.9992 26 24.9992H54C54.553 24.9992 55 25.4472 55 25.9993V43.9996C55 44.5516 54.553 44.9996 54 44.9996H41V50.9997H54C54.553 50.9997 55 51.4477 55 51.9997V56.1058C57.25 56.5838 59 58.6308 59 60.9999ZM68 39.9995C68 45.9066 66.177 51.5597 62.727 56.3448L61.104 55.1748C64.307 50.7317 66 45.4846 66 39.9995C66 25.6642 54.337 14 40.001 14C25.664 14 14 25.6642 14 39.9995C14 45.4846 15.693 50.7317 18.896 55.1748L17.273 56.3448C13.823 51.5597 12 45.9066 12 39.9995C12 24.5612 24.561 12 39.999 12C55.438 12 68 24.5612 68 39.9995Z",fill:"white"})),io("defs",null,io("linearGradient",{id:"paint0_linear_214_10729",x1:"0",y1:"8000",x2:"8000",y2:"0",gradientUnits:"userSpaceOnUse"},io("stop",{"stop-color":"#3334B9"}),io("stop",{offset:"1","stop-color":"#4E74F4"})),io("clipPath",{id:"clip0_214_10729"},io("rect",{width:"80",height:"80",fill:"white"})))):io("svg",{width:"25",height:"25",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},io("rect",{width:"20",height:"20",rx:"2",fill:"#5278FF"}),io("path",{d:"M15.0714 4H4.78571C4.07563 4 3.5 4.67157 3.5 5.5V14.5C3.5 15.3284 4.07563 16 4.78571 16H15.0714C15.7815 16 16.3571 15.3284 16.3571 14.5V5.5C16.3571 4.67157 15.7815 4 15.0714 4Z",stroke:"white",strokeWidth:"0.833333"}),io("path",{d:"M16 8L10.618 11.8025C10.4328 11.9316 10.2186 12 10 12C9.78141 12 9.56724 11.9316 9.382 11.8025L4 8",stroke:"white",strokeWidth:"0.833333"}))),io(To,null,sp(e.provider)),io(To,null,e.fromEmail),io(To,null,e.createdAt),io(To,null,io("div",{className:"flex flex-wrap items-center gap-2"},io(lo,{variant:"secondary",size:"sm",className:" text-blue-600 hover:bg-blue-500 hover:text-white",onClick:function(){return function(e){s(e),c(!0)}(e)}},(0,Lo.__)("Send Test Email","trigger")),"ses"===e.provider&&io(Ew.Fragment,null,io(lo,{variant:"outline",size:"sm",onClick:function(){return b(!0)}},(0,Lo.__)("Verify Email","trigger")),io(Sw,{open:g,onOpenChange:b,connection:e})))),io(To,null,io("div",{className:"flex items-center gap-2"},io(lo,{variant:"ghost",size:"icon",onClick:function(){return function(e){s(e),p(!0)}(e)}},io(Mo,{className:"h-4 w-4"})),io(lo,{variant:"ghost",size:"icon",onClick:function(){return function(e){s(e),y(!0)}(e)}},io(Ro,{className:"h-4 w-4 text-red-500"})))))})))),a&&io(Ew.Fragment,null,io(Mg,{open:l,onOpenChange:c,connection:a}),io(xb,{open:d,onOpenChange:p,connection:a}),io(Yb,{open:m,onOpenChange:y,connection:a,setInitialConnections:n})))};function Cw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Aw(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Aw(e,t):void 0}}(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.")}()}function Aw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Nw=function(e){var t=e.onAddConnection;return io("div",{className:"mx-auto max-w-md text-center"},io("div",{className:"flex justify-center mb-6 mt-10"},io("svg",{width:"200",height:"100",viewBox:"0 0 400 300",fill:"none",xmlns:"http://www.w3.org/2000/svg"},io("path",{d:"M50 150C50 80 120 30 200 30C280 30 350 80 350 150C350 220 280 270 200 270C120 270 50 220 50 150Z",fill:"#F3F4F6",opacity:"0.5"}),io("path",{d:"M120 150C120 150 160 100 200 100C240 100 280 150 280 150",stroke:"#E5E7EB",strokeWidth:"2",strokeDasharray:"4 4"}),io("path",{d:"M120 170C120 170 160 220 200 220C240 220 280 170 280 170",stroke:"#E5E7EB",strokeWidth:"2",strokeDasharray:"4 4"}),io("circle",{cx:"120",cy:"150",r:"8",fill:"#6B7280"}),io("circle",{cx:"280",cy:"150",r:"8",fill:"#6B7280"}),io("circle",{cx:"120",cy:"170",r:"8",fill:"#6B7280"}),io("circle",{cx:"280",cy:"170",r:"8",fill:"#6B7280"}),io("g",{transform:"translate(160, 120)"},io("rect",{x:"0",y:"0",width:"80",height:"60",rx:"4",fill:"#4F46E5"}),io("path",{d:"M0 10L40 35L80 10",stroke:"white",strokeWidth:"2",fill:"none"})),io("circle",{cx:"150",cy:"80",r:"5",fill:"#4F46E5",opacity:"0.5"}),io("circle",{cx:"250",cy:"80",r:"5",fill:"#4F46E5",opacity:"0.5"}),io("circle",{cx:"150",cy:"220",r:"5",fill:"#4F46E5",opacity:"0.5"}),io("circle",{cx:"250",cy:"220",r:"5",fill:"#4F46E5",opacity:"0.5"}),io("path",{d:"M320 60L340 80L300 120",fill:"#4F46E5",opacity:"0.7"}),io("path",{d:"M320 60L300 120L310 90",fill:"#4F46E5"}),io("g",{transform:"translate(80, 100) scale(0.5)"},io("rect",{width:"40",height:"30",rx:"2",fill:"#6B7280",opacity:"0.5"}),io("path",{d:"M0 5L20 20L40 5",stroke:"white",strokeWidth:"1",fill:"none"})),io("g",{transform:"translate(300, 200) scale(0.5)"},io("rect",{width:"40",height:"30",rx:"2",fill:"#6B7280",opacity:"0.5"}),io("path",{d:"M0 5L20 20L40 5",stroke:"white",strokeWidth:"1",fill:"none"})))),io("h2",{className:"mb-4 text-2xl font-semibold tracking-tight"},(0,Lo.__)("Create Your First Connection","trigger")),io("p",{className:"mb-4 text-muted-foreground"},(0,Lo.__)("It looks like you haven't set up a SMTP connection yet. Connect to a reliable SMTP provider to ensure your emails are delivered effectively and securely.","trigger")),io(lo,{size:"lg",className:"gap-2",onClick:t},io(yo,{className:"h-5 w-5"}),(0,Lo.__)("Add Connection","trigger")))},Tw=function(){return io("div",{className:"flex items-center justify-center min-h-[400px]"},io("div",{className:"animate-pulse space-y-4"},io("div",{className:"h-4 w-[550px] bg-gray-200 rounded"}),io("div",{className:"h-4 w-[550px] bg-gray-200 rounded"}),io("div",{className:"h-4 w-[550px] bg-gray-200 rounded"})))};const Mw=function(){var e=Cw((0,r.useState)([]),2),t=e[0],n=e[1],o=te(),i=Oh(),a=i.data,s=i.isLoading;return(0,r.useEffect)((function(){a&&n(a.data)}),[a]),io("div",{className:"min-h-[600px] pr-4"},s?io(Tw,null):0===t.length?io("div",{className:"flex items-center justify-center h-full"},io(Nw,{onAddConnection:function(){return o("/add-connection")}})):io(kw,{initialConnections:t,setInitialConnections:n}))};function Rw(e){return Rw="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},Rw(e)}function Lw(){Lw=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Rw(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Rw(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Iw(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function Dw(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Iw(i,n,o,a,s,"next",e)}function s(e){Iw(i,n,o,a,s,"throw",e)}a(void 0)}))}}function Fw(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return zw(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zw(e,t):void 0}}(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.")}()}function zw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const Bw=function(){var e,t=Fw((0,r.useState)(!0),2),n=(t[0],t[1],Fw((0,r.useState)(!1),2)),o=n[0],i=(n[1],Fw((0,r.useState)([]),2)),a=i[0],s=i[1],u=Fw((0,r.useState)(null),2),l=(u[0],u[1]),c=Fw((0,r.useState)("none"),2),f=c[0],d=c[1],p=Fw((0,r.useState)("30"),2),h=p[0],m=(p[1],ep({mutationFn:(e=_h(wh().mark((function e(t){var r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=gh({action:"update_default_connection"},t),e.next=3,yp(rd.ajax_url,{body:t});case 3:return r=e.sent,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)}),onSuccess:function(e){var t;mh.success(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Default connection updated successfully!","trigger"))},onError:function(e){var t;mh.error(null!==(t=e.message)&&void 0!==t?t:(0,Lo.__)("Failed to update default connection","trigger"))}})),y=m.mutateAsync,v=m.isPending,g=function(){var e=Dw(Lw().mark((function e(t){return Lw().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:y({provider:t}),d(t);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),b=Oh(),w=b.data,x=b.isLoading;(0,r.useEffect)((function(){w&&s(w.data)}),[w]);var _,O=Xd({queryKey:["getDefaultProvider"],queryFn:(_=_h(wh().mark((function e(){var t;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,yp("".concat(rd.rest_url,"/get-default-connections"),{method:"GET"});case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)}))),function(){return _.apply(this,arguments)}),staleTime:5e3}),S=O.data;O.isLoading;(0,r.useEffect)((function(){var e;l(null==S?void 0:S.data),d((null==S||null===(e=S.data)||void 0===e?void 0:e.provider)||"none")}),[S]),(0,r.useEffect)((function(){}),[h]);return io("div",{className:"space-y-8 p-6"},io("div",{className:"flex items-center justify-between"},io("h3",{className:"text-lg font-medium"},(0,Lo.__)("General Settings","trigger")),o&&io("div",{className:"flex items-center text-sm text-muted-foreground"},io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Saving changes...","trigger"))),io("div",{className:"rounded-lg border bg-card text-card-foreground shadow-sm"},io("div",{className:"p-6 space-y-6"},io("div",{className:"space-y-4 pt-4 border-t first:border-t-0 first:pt-0"},io("h3",{className:"text-lg font-medium"},(0,Lo.__)("Default Connection","trigger")),x?io("div",{className:"flex items-center space-x-2 h-[40px]"},io(_s,{className:"h-4 w-4 animate-spin"}),io("span",null,(0,Lo.__)("Loading connections...","trigger"))):io(cg,{value:f,onValueChange:function(e){return g(e)},disabled:x||v},io(dg,{className:"max-w-fit"},io(fg,{placeholder:(0,Lo.__)("Select connection","trigger")})),io(pg,null,io(hg,{value:"none"},(0,Lo.__)("None","trigger")),a.map((function(e){return io(hg,{key:"".concat(e.provider,"-").concat(e.fromEmail),value:e.provider},function(e){return"smtp"===e.provider?"SMTP: ".concat(e.fromEmail," (").concat(e.smtpHost,")"):"ses"===e.provider?"SES: ".concat(e.fromEmail," (").concat(e.region,")"):"gmail"===e.provider?"GMAIL: ".concat(e.fromEmail):e.provider}(e))})))),io("p",{className:"text-muted-foreground"},(0,Lo.__)('This connection will be used by default unless a specific "from email" address is provided in the email headers.',"trigger"))))))},Vw=mo("MoveLeft",[["path",{d:"M6 8L2 12L6 16",key:"kyvwex"}],["path",{d:"M2 12H22",key:"1m8cig"}]]);var $w="rovingFocusGroup.onEntryFocus",Uw={bubbles:!1,cancelable:!0},Gw="RovingFocusGroup",[Ww,qw,Hw]=zh(Gw),[Zw,Kw]=Do(Gw,[Hw]),[Yw,Xw]=Zw(Gw),Qw=r.forwardRef(((e,t)=>(0,ft.jsx)(Ww.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,ft.jsx)(Ww.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,ft.jsx)(Jw,{...e,ref:t})})})));Qw.displayName=Gw;var Jw=r.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:i=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:f=!1,...d}=e,p=r.useRef(null),h=ct(t,p),m=Vh(a),[y=null,v]=Go({prop:s,defaultProp:u,onChange:l}),[g,b]=r.useState(!1),w=Uo(c),x=qw(n),_=r.useRef(!1),[O,S]=r.useState(0);return r.useEffect((()=>{const e=p.current;if(e)return e.addEventListener($w,w),()=>e.removeEventListener($w,w)}),[w]),(0,ft.jsx)(Yw,{scope:n,orientation:o,dir:m,loop:i,currentTabStopId:y,onItemFocus:r.useCallback((e=>v(e)),[v]),onItemShiftTab:r.useCallback((()=>b(!0)),[]),onFocusableItemAdd:r.useCallback((()=>S((e=>e+1))),[]),onFocusableItemRemove:r.useCallback((()=>S((e=>e-1))),[]),children:(0,ft.jsx)(qo.div,{tabIndex:g||0===O?-1:0,"data-orientation":o,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Io(e.onMouseDown,(()=>{_.current=!0})),onFocus:Io(e.onFocus,(e=>{const t=!_.current;if(e.target===e.currentTarget&&t&&!g){const t=new CustomEvent($w,Uw);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=x().filter((e=>e.focusable));nx([e.find((e=>e.active)),e.find((e=>e.id===y)),...e].filter(Boolean).map((e=>e.ref.current)),f)}}_.current=!1})),onBlur:Io(e.onBlur,(()=>b(!1)))})})})),ex="RovingFocusGroupItem",tx=r.forwardRef(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:i=!1,tabStopId:a,...s}=e,u=$o(),l=a||u,c=Xw(ex,n),f=c.currentTabStopId===l,d=qw(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return r.useEffect((()=>{if(o)return p(),()=>h()}),[o,p,h]),(0,ft.jsx)(Ww.ItemSlot,{scope:n,id:l,focusable:o,active:i,children:(0,ft.jsx)(qo.span,{tabIndex:f?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Io(e.onMouseDown,(e=>{o?c.onItemFocus(l):e.preventDefault()})),onFocus:Io(e.onFocus,(()=>c.onItemFocus(l))),onKeyDown:Io(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:rx[n]}(e,c.orientation,c.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=d().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=c.loop?function(e,t){return e.map(((r,n)=>e[(t+n)%e.length]))}(r,n+1):r.slice(n+1)}setTimeout((()=>nx(r)))}}))})})}));tx.displayName=ex;var rx={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function nx(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var ox=Qw,ix=tx,ax="Tabs",[sx,ux]=Do(ax,[Kw]),lx=Kw(),[cx,fx]=sx(ax),dx=r.forwardRef(((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:i,orientation:a="horizontal",dir:s,activationMode:u="automatic",...l}=e,c=Vh(s),[f,d]=Go({prop:n,onChange:o,defaultProp:i});return(0,ft.jsx)(cx,{scope:r,baseId:$o(),value:f,onValueChange:d,orientation:a,dir:c,activationMode:u,children:(0,ft.jsx)(qo.div,{dir:c,"data-orientation":a,...l,ref:t})})}));dx.displayName=ax;var px="TabsList",hx=r.forwardRef(((e,t)=>{const{__scopeTabs:r,loop:n=!0,...o}=e,i=fx(px,r),a=lx(r);return(0,ft.jsx)(ox,{asChild:!0,...a,orientation:i.orientation,dir:i.dir,loop:n,children:(0,ft.jsx)(qo.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})}));hx.displayName=px;var mx="TabsTrigger",yx=r.forwardRef(((e,t)=>{const{__scopeTabs:r,value:n,disabled:o=!1,...i}=e,a=fx(mx,r),s=lx(r),u=bx(a.baseId,n),l=wx(a.baseId,n),c=n===a.value;return(0,ft.jsx)(ix,{asChild:!0,...s,focusable:!o,active:c,children:(0,ft.jsx)(qo.button,{type:"button",role:"tab","aria-selected":c,"aria-controls":l,"data-state":c?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:u,...i,ref:t,onMouseDown:Io(e.onMouseDown,(e=>{o||0!==e.button||!1!==e.ctrlKey?e.preventDefault():a.onValueChange(n)})),onKeyDown:Io(e.onKeyDown,(e=>{[" ","Enter"].includes(e.key)&&a.onValueChange(n)})),onFocus:Io(e.onFocus,(()=>{const e="manual"!==a.activationMode;c||o||!e||a.onValueChange(n)}))})})}));yx.displayName=mx;var vx="TabsContent",gx=r.forwardRef(((e,t)=>{const{__scopeTabs:n,value:o,forceMount:i,children:a,...s}=e,u=fx(vx,n),l=bx(u.baseId,o),c=wx(u.baseId,o),f=o===u.value,d=r.useRef(f);return r.useEffect((()=>{const e=requestAnimationFrame((()=>d.current=!1));return()=>cancelAnimationFrame(e)}),[]),(0,ft.jsx)(pi,{present:i||f,children:({present:r})=>(0,ft.jsx)(qo.div,{"data-state":f?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":l,hidden:!r,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:r&&a})})}));function bx(e,t){return`${e}-trigger-${t}`}function wx(e,t){return`${e}-content-${t}`}gx.displayName=vx;var xx=hx,_x=yx,Ox=gx,Sx=["className"],Ex=["className"],jx=["className"];function Px(){return Px=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Px.apply(null,arguments)}function kx(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Cx=dx,Ax=r.forwardRef((function(e,t){var r=e.className,n=kx(e,Sx);return io(xx,Px({ref:t,className:Nr("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",r)},n))}));Ax.displayName=xx.displayName;var Nx=r.forwardRef((function(e,t){var r=e.className,n=kx(e,Ex);return io(_x,Px({ref:t,className:Nr("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",r)},n))}));Nx.displayName=_x.displayName;var Tx=r.forwardRef((function(e,t){var r=e.className,n=kx(e,jx);return io(Ox,Px({ref:t,className:Nr("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",r)},n))}));function Mx(e){return Mx="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},Mx(e)}function Rx(){return Rx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rx.apply(null,arguments)}function Lx(){Lx=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Mx(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Mx(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Ix(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Dx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ix(Object(r),!0).forEach((function(t){Fx(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ix(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Fx(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Mx(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Mx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Mx(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zx(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}Tx.displayName=Ox.displayName;const Bx=function(e){var t,n=e.selectedProvider,o=Zu({resolver:el(Vg),defaultValues:{provider:n,fromName:"",fromEmail:"",smtpHost:"",smtpPort:"587",smtpSecurity:"tls",smtpUsername:"",smtpPassword:""}}),i=Eh(),a=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){zx(i,n,o,a,s,"next",e)}function s(e){zx(i,n,o,a,s,"throw",e)}a(void 0)}))}}(Lx().mark((function e(t){var r;return Lx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Dx(Dx({},t),{},{provider:n}),e.next=3,i.mutateAsync(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s=Oh(),u=s.data,l=s.isLoading;return(0,r.useEffect)((function(){if(u&&(null==u?void 0:u.data.length)>0){var e=null==u?void 0:u.data.find((function(e){return"smtp"===e.provider}));e&&(o.setValue("fromName",e.fromName),o.setValue("fromEmail",e.fromEmail),o.setValue("smtpHost",e.smtpHost||""),o.setValue("smtpPort",e.smtpPort||""),o.setValue("smtpSecurity",e.smtpSecurity||""),o.setValue("smtpUsername",e.smtpUsername||""),o.setValue("smtpPassword",e.smtpPassword||""))}}),[u]),io("div",{className:"flex justify-center"},io(uw,{className:"w-full max-w-[1000px] shadow-lg"},io(dw,{className:"p-6"},io("div",{className:"flex justify-between items-center mb-5"},io("h2",{className:"text-xl font-semibold"},null===(t=Lg.find((function(e){return e.value===n})))||void 0===t?void 0:t.label," ",(0,Lo.__)("Configuration","trigger"))),l?io("div",{className:"flex justify-center items-center h-[500px]"},io(_s,{className:"w-4 h-4 animate-spin"})):io(vl,o,io("form",{onSubmit:o.handleSubmit((function(e){a(e)}),(function(e){})),className:"space-y-6"},io("div",{className:"grid gap-4"},io(bl,{control:o.control,name:"smtpHost",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Host","trigger")),io(Sl,null,io(xs,Rx({placeholder:"smtp.hostinger.com"},t))),io(kl,null))}}),io("div",{className:"grid grid-cols-2 gap-4"},io(bl,{control:o.control,name:"smtpPort",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Port","trigger")),io(Sl,null,io(xs,Rx({placeholder:"587"},t))),io(kl,null))}}),io(bl,{control:o.control,name:"smtpSecurity",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Security","trigger")),io(cg,{onValueChange:t.onChange,value:t.value},io(Sl,null,io(dg,null,io(fg,{placeholder:"Select security type"}))),io(pg,null,Ig.map((function(e){return io(hg,{key:e.value,value:e.value},e.label)})))),io(kl,null))}})),io(bl,{control:o.control,name:"smtpUsername",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Username","trigger")),io(Sl,null,io(xs,Rx({placeholder:"username@example.com"},t))),io(kl,null))}}),io(bl,{control:o.control,name:"smtpPassword",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("SMTP Password","trigger")),io(Sl,null,io(xs,Rx({type:"password",placeholder:"••••••••"},t))),io(kl,null))}})),io("div",{className:"space-y-4 border-t pt-6"},io("div",{className:"grid grid-cols-2 gap-4"},io(bl,{control:o.control,name:"fromName",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Name","trigger")),io(Sl,null,io(xs,Rx({placeholder:"WordPress"},t))),io(kl,null))}}),io(bl,{control:o.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io(Sl,null,io(xs,Rx({placeholder:"wordpress@example.com"},t))),io(kl,null))}}))),io("div",{className:"flex gap-2 justify-end"},io(lo,{type:"submit",disabled:i.isPending},i.isPending?(0,Lo.__)("Saving...","trigger"):(0,Lo.__)("Save Changes","trigger"))))))))};function Vx(e){return Vx="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},Vx(e)}function $x(){return $x=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$x.apply(null,arguments)}function Ux(){Ux=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Vx(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Vx(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Gx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wx(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gx(Object(r),!0).forEach((function(t){qx(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qx(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Vx(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Vx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Vx(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hx(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}const Zx=function(e){var t,n=e.selectedProvider,o=Zu({resolver:el($g),defaultValues:{provider:n,fromName:"",fromEmail:"",accessKeyId:"",secretAccessKey:"",region:""}}),i=Eh(),a=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){Hx(i,n,o,a,s,"next",e)}function s(e){Hx(i,n,o,a,s,"throw",e)}a(void 0)}))}}(Ux().mark((function e(t){var r;return Ux().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Wx(Wx({},t),{},{provider:n}),e.next=3,i.mutateAsync(r);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),s=Oh(),u=s.data,l=s.isLoading;return(0,r.useEffect)((function(){if(u&&(null==u?void 0:u.data.length)>0){var e=null==u?void 0:u.data.find((function(e){return"ses"===e.provider}));e&&(o.setValue("fromName",e.fromName),o.setValue("fromEmail",e.fromEmail),o.setValue("accessKeyId",e.accessKeyId||""),o.setValue("secretAccessKey",e.secretAccessKey||""),o.setValue("region",e.region||""))}}),[u]),io("div",{className:"flex justify-center"},io(uw,{className:"w-full max-w-[1000px] shadow-lg"},io(dw,{className:"p-6"},io("div",{className:"flex justify-between items-center mb-5"},io("h2",{className:"text-xl font-semibold"},null===(t=Lg.find((function(e){return e.value===n})))||void 0===t?void 0:t.label," ",(0,Lo.__)("Configuration","trigger"))),l?io("div",{className:"flex justify-center items-center h-[500px]"},io(_s,{className:"w-4 h-4 animate-spin"})):io(vl,o,io("form",{onSubmit:o.handleSubmit((function(e){a(e)}),(function(e){})),className:"space-y-6"},io("div",{className:"grid gap-6"},io("div",{className:"grid gap-4"},io(bl,{control:o.control,name:"accessKeyId",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Access Key ID","trigger")),io(Sl,null,io(xs,$x({placeholder:"AKIA..."},t))),io(kl,null))}}),io(bl,{control:o.control,name:"secretAccessKey",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Secret Access Key","trigger")),io(Sl,null,io(xs,$x({type:"password",placeholder:"••••••••"},t))),io(kl,null))}}),io(bl,{control:o.control,name:"region",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Region","trigger")),io(cg,{onValueChange:t.onChange,value:t.value},io(Sl,null,io(dg,null,io(fg,{placeholder:(0,Lo.__)("Select AWS region","trigger")}))),io(pg,null,Dg.map((function(e){return io(hg,{key:e.value,value:e.value},e.label)})))),io(kl,null))}})),io("div",{className:"space-y-4 border-t pt-6"},io("div",{className:"grid grid-cols-2 gap-4"},io(bl,{control:o.control,name:"fromName",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Name","trigger")),io(Sl,null,io(xs,$x({placeholder:"WordPress"},t))),io(kl,null))}}),io(bl,{control:o.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io(Sl,null,io(xs,$x({placeholder:"wordpress@example.com"},t))),io(kl,null))}})))),io("div",{className:"flex gap-2 justify-end"},io(lo,{type:"submit",disabled:i.isPending},i.isPending?(0,Lo.__)("Saving...","trigger"):(0,Lo.__)("Save Changes","trigger"))))))))};var Kx=o(1594);function Yx(e){return Yx="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},Yx(e)}function Xx(){return Xx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xx.apply(null,arguments)}function Qx(){Qx=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==Yx(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(Yx(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function Jx(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function e_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jx(Object(r),!0).forEach((function(t){t_(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jx(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function t_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=Yx(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Yx(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Yx(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r_(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function n_(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){r_(i,n,o,a,s,"next",e)}function s(e){r_(i,n,o,a,s,"throw",e)}a(void 0)}))}}function o_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i_(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i_(e,t):void 0}}(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.")}()}function i_(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const a_=function(e){var t=e.selectedProvider,n=o_((0,r.useState)(!1),2),o=n[0],i=n[1],a=Zu({resolver:el(Ug),defaultValues:{provider:t,clientId:"",clientSecret:"",fromName:"",fromEmail:""}}),s=Eh(),u=function(){var e=n_(Qx().mark((function e(r){var n;return Qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=e_(e_({},r),{},{provider:t}),e.next=3,s.mutateAsync(n);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),l=Oh(),c=l.data,f=l.isLoading;(0,r.useEffect)((function(){if(c&&(null==c?void 0:c.data.length)>0){var e=null==c?void 0:c.data.find((function(e){return"gmail"===e.provider}));e&&(a.setValue("fromName",e.fromName),a.setValue("fromEmail",e.fromEmail),a.setValue("clientId",e.clientId||""),a.setValue("clientSecret",e.clientSecret||""))}}),[c]);var d=Ah();(0,r.useEffect)((function(){p()}),[]);var p=function(){var e=n_(Qx().mark((function e(){var t,r;return Qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.mutateAsync();case 2:t=e.sent,r=t.status_code,i(200===r);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),h=kh(),m=function(){var e=n_(Qx().mark((function e(t){return Qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,h.mutateAsync();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return io("div",{className:"flex justify-center"},io(uw,{className:"w-full max-w-[1000px] shadow-lg"},io(dw,{className:"p-6"},io("div",{className:"flex justify-between items-center mb-5"},io("h2",{className:"text-xl font-semibold"},(0,Lo.__)("Google Gmail Configuration","trigger"))),f?io("div",{className:"flex justify-center items-center h-[500px]"},io(_s,{className:"w-4 h-4 animate-spin"})):io(vl,a,io("form",{onSubmit:a.handleSubmit((function(e){u(e)}),(function(e){})),className:"space-y-6"},io("div",{className:"grid gap-6"},io("div",{className:"grid gap-4"},io(bl,{control:a.control,name:"clientId",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Client ID","trigger")),io(Sl,null,io(xs,Xx({placeholder:"AKIA..."},t))),io(kl,null))}}),io(bl,{control:a.control,name:"clientSecret",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("Client Secret","trigger")),io(Sl,null,io(xs,Xx({type:"password",placeholder:"••••••••"},t))),io(kl,null))}})),io("div",{className:"space-y-4 border-t pt-6"},io("div",{className:"grid grid-cols-2 gap-4"},io(bl,{control:a.control,name:"fromName",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Name","trigger")),io(Sl,null,io(xs,Xx({placeholder:"WordPress"},t))),io(kl,null))}}),io(bl,{control:a.control,name:"fromEmail",render:function(e){var t=e.field;return io(_l,null,io(Ol,null,(0,Lo.__)("From Email","trigger")),io(Sl,null,io(xs,Xx({placeholder:"wordpress@example.com"},t))),io(kl,null))}})))),io("div",{className:"flex gap-2 justify-end"},io(lo,{type:"submit",disabled:s.isPending},s.isPending?(0,Lo.__)("Saving...","trigger"):(0,Lo.__)("Save Changes","trigger"))))),io("hr",{className:"mt-4"}),io("div",{className:"mt-4"},io("h2",{className:"mb-2"},(0,Lo.__)("Use this URI to your google cloud console","trigger")),io("div",{className:"flex items-center gap-2 p-3 bg-muted rounded-md mb-4"},io(xs,{value:Rg,readOnly:!0,className:"flex-1"}),io(lo,{variant:"outline",size:"icon",onClick:n_(Qx().mark((function e(){return Qx().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,up(Rg);case 2:mh.success((0,Lo.__)("Copied to clipboard","trigger"));case 3:case"end":return e.stop()}}),e)})))},io("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},io("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),io("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})))),d.isPending?io(_s,{className:"h-4 w-4 animate-spin mx-auto"}):io(Kx.Fragment,null,o?io(lo,{variant:"destructive",size:"icon",onClick:function(e){return m(e)},className:"w-full"},h.isPending&&io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Reconnect With Gmail","trigger")):io(lo,{variant:"default",size:"icon",onClick:function(e){return m(e)},className:"w-full"},h.isPending&&io(_s,{className:"mr-2 h-4 w-4 animate-spin"}),(0,Lo.__)("Connect With Gmail","trigger")))))))};function s_(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u_(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u_(e,t):void 0}}(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.")}()}function u_(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const l_=function(){var e=te(),t=s_((0,r.useState)("smtp"),2),n=t[0],o=t[1];return io("div",{className:"flex justify-center mt-5 p-5"},io(uw,{className:"w-full max-w-[1000px] shadow-lg"},io(dw,{className:"p-6"},io("div",{className:"flex justify-between items-center mb-8"},io("h2",{className:"text-xl font-semibold"},(0,Lo.__)("Email Settings","trigger")),io("div",{className:"flex items-center gap-2"},io(lo,{variant:"outline",size:"sm",onClick:function(){return e("/connections")}},io(Vw,{className:"w-4 h-4 mr-2"}),(0,Lo.__)("Back","trigger")))),io(Cx,{defaultValue:"smtp",className:"flex gap-6",onValueChange:function(e){o(e)}},io(Ax,{className:"flex flex-col h-fit w-48 bg-muted p-2 rounded-lg"},io(Nx,{value:"smtp",className:"w-full justify-start gap-2 p-2.5"},io("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},io("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),io("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})),(0,Lo.__)("SMTP","trigger")),io(Nx,{value:"ses",className:"w-full justify-start gap-2 p-2.5"},io("svg",{width:"25",height:"25",viewBox:"0 0 80 80",fill:"none",xmlns:"http://www.w3.org/2000/svg"},io("g",{"clip-path":"url(#clip0_214_10729)"},io("path",{d:"M80 0H0V80H80V0Z",fill:"url(#paint0_linear_214_10729)"}),io("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M57 60.9999C57 59.3738 55.626 57.9998 54 57.9998C52.374 57.9998 51 59.3738 51 60.9999C51 62.6259 52.374 63.9999 54 63.9999C55.626 63.9999 57 62.6259 57 60.9999ZM40 59.9999C38.374 59.9999 37 61.3739 37 62.9999C37 64.6259 38.374 66 40 66C41.626 66 43 64.6259 43 62.9999C43 61.3739 41.626 59.9999 40 59.9999ZM26 57.9998C24.374 57.9998 23 59.3738 23 60.9999C23 62.6259 24.374 63.9999 26 63.9999C27.626 63.9999 29 62.6259 29 60.9999C29 59.3738 27.626 57.9998 26 57.9998ZM28.605 42.9996H51.395L43.739 36.1104L40.649 38.7585C40.463 38.9195 40.23 38.9995 39.999 38.9995C39.768 38.9995 39.535 38.9195 39.349 38.7585L36.26 36.1104L28.605 42.9996ZM27 28.1733V41.7545L34.729 34.7984L27 28.1733ZM51.297 26.9993H28.703L39.999 36.6824L51.297 26.9993ZM53 41.7545V28.1733L45.271 34.7974L53 41.7545ZM59 60.9999C59 63.7099 56.71 66 54 66C51.29 66 49 63.7099 49 60.9999C49 58.6308 50.75 56.5838 53 56.1058V52.9997H41V58.1058C43.25 58.5838 45 60.6309 45 62.9999C45 65.71 42.71 68 40 68C37.29 68 35 65.71 35 62.9999C35 60.6309 36.75 58.5838 39 58.1058V52.9997H27V56.1058C29.25 56.5838 31 58.6308 31 60.9999C31 63.7099 28.71 66 26 66C23.29 66 21 63.7099 21 60.9999C21 58.6308 22.75 56.5838 25 56.1058V51.9997C25 51.4477 25.447 50.9997 26 50.9997H39V44.9996H26C25.447 44.9996 25 44.5516 25 43.9996V25.9993C25 25.4472 25.447 24.9992 26 24.9992H54C54.553 24.9992 55 25.4472 55 25.9993V43.9996C55 44.5516 54.553 44.9996 54 44.9996H41V50.9997H54C54.553 50.9997 55 51.4477 55 51.9997V56.1058C57.25 56.5838 59 58.6308 59 60.9999ZM68 39.9995C68 45.9066 66.177 51.5597 62.727 56.3448L61.104 55.1748C64.307 50.7317 66 45.4846 66 39.9995C66 25.6642 54.337 14 40.001 14C25.664 14 14 25.6642 14 39.9995C14 45.4846 15.693 50.7317 18.896 55.1748L17.273 56.3448C13.823 51.5597 12 45.9066 12 39.9995C12 24.5612 24.561 12 39.999 12C55.438 12 68 24.5612 68 39.9995Z",fill:"white"})),io("defs",null,io("linearGradient",{id:"paint0_linear_214_10729",x1:"0",y1:"8000",x2:"8000",y2:"0",gradientUnits:"userSpaceOnUse"},io("stop",{"stop-color":"#3334B9"}),io("stop",{offset:"1","stop-color":"#4E74F4"})),io("clipPath",{id:"clip0_214_10729"},io("rect",{width:"80",height:"80",fill:"white"})))),(0,Lo.__)("Amazon SES","trigger")),io(Nx,{value:"gmail",className:"w-full justify-start gap-2 p-2.5"},io("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},io("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),io("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})),(0,Lo.__)("Google Gmail","trigger"))),io("div",{className:"flex-1 border-l pl-6"},io(Tx,{value:"smtp"},io(Bx,{selectedProvider:n})),io(Tx,{value:"ses"},io(Zx,{selectedProvider:n})),io(Tx,{value:"gmail"},io(a_,{selectedProvider:n})))))))},c_=mo("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),f_=mo("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),d_=mo("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),p_=mo("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var h_=[{id:"dashboard",label:"Dashboard",path:"/dashboard",icon:io(c_,null)},{id:"email_logs",label:"Email Logs",path:"/email_logs",icon:io(f_,null)},{id:"connections",label:"Connections",path:"/connections",icon:io(d_,null)},{id:"settings",label:"Settings",path:"/settings",icon:io(p_,null)}];const m_=function(){var e=Q();return io("div",{className:"border-b"},io("div",{className:"flex h-16 items-center px-4"},io("nav",{className:"flex items-center space-x-6"},h_.map((function(t){return io(Je,{key:t.id,to:t.path,className:Nr("flex items-center space-x-2 text-sm font-medium transition-colors hover:text-primary",e.pathname===t.path||"/"===e.pathname&&"/dashboard"===t.path?"text-primary":"text-muted-foreground")},t.label,t.badge&&io("span",{className:"ml-2 rounded-md bg-muted px-1.5 py-0.5 text-xs text-muted-foreground"},t.badge))}))),io("div",{className:"ml-auto flex items-center space-x-4"},io("span",{className:"text-sm text-muted-foreground"},(0,Lo.__)("V-1.0.0","trigger")))))},y_=mo("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var v_=o(7350),g_=o.n(v_),b_=o(5015),w_=o.n(b_),x_=o(1741),__=o.n(x_),O_=o(8156),S_=o.n(O_),E_=o(8023),j_=o.n(E_),P_=function(e){return 0===e?0:e>0?1:-1},k_=function(e){return w_()(e)&&e.indexOf("%")===e.length-1},C_=function(e){return j_()(e)&&!__()(e)},A_=function(e){return C_(e)||w_()(e)},N_=0,T_=function(e){var t=++N_;return"".concat(e||"").concat(t)},M_=function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!C_(e)&&!w_()(e))return n;if(k_(e)){var i=e.indexOf("%");r=t*parseFloat(e.slice(0,i))/100}else r=+e;return __()(r)&&(r=n),o&&r>t&&(r=t),r},R_=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},L_=function(e,t){return C_(e)&&C_(t)?function(r){return e+r*(t-e)}:function(){return t}};function I_(e,t,r){return e&&e.length?e.find((function(e){return e&&("function"==typeof t?t(e):S_()(e,t))===r})):null}var D_=function(e,t){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o]},F_=o(9843),z_=o.n(F_),B_=o(1882),V_=o.n(B_),$_=o(3805),U_=o.n($_),G_=o(2199);function W_(e,t){for(var r in e)if({}.hasOwnProperty.call(e,r)&&(!{}.hasOwnProperty.call(t,r)||e[r]!==t[r]))return!1;for(var n in t)if({}.hasOwnProperty.call(t,n)&&!{}.hasOwnProperty.call(e,n))return!1;return!0}function q_(e){return q_="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},q_(e)}var H_=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Z_=["points","pathLength"],K_={svg:["viewBox","children"],polygon:Z_,polyline:Z_},Y_=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],X_=function(e,t){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var n=e;if((0,r.isValidElement)(e)&&(n=e.props),!U_()(n))return null;var o={};return Object.keys(n).forEach((function(e){Y_.includes(e)&&(o[e]=t||function(t){return n[e](n,t)})})),o},Q_=function(e,t,r){if(!U_()(e)||"object"!==q_(e))return null;var n=null;return Object.keys(e).forEach((function(o){var i=e[o];Y_.includes(o)&&"function"==typeof i&&(n||(n={}),n[o]=function(e,t,r){return function(n){return e(t,r,n),null}}(i,t,r))})),n},J_=["children"],eO=["children"];function tO(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function rO(e){return rO="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},rO(e)}var nO={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},oO=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},iO=null,aO=null,sO=function e(t){if(t===iO&&Array.isArray(aO))return aO;var n=[];return r.Children.forEach(t,(function(t){z_()(t)||((0,G_.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))})),aO=n,iO=t,n};function uO(e,t){var r=[],n=[];return n=Array.isArray(t)?t.map((function(e){return oO(e)})):[oO(t)],sO(e).forEach((function(e){var t=S_()(e,"type.displayName")||S_()(e,"type.name");-1!==n.indexOf(t)&&r.push(e)})),r}function lO(e,t){var r=uO(e,t);return r&&r[0]}var cO=function(e){if(!e||!e.props)return!1;var t=e.props,r=t.width,n=t.height;return!(!C_(r)||r<=0||!C_(n)||n<=0)},fO=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],dO=function(e){return e&&e.type&&w_()(e.type)&&fO.indexOf(e.type)>=0},pO=function(e,t,n){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var o=e;if((0,r.isValidElement)(e)&&(o=e.props),!U_()(o))return null;var i={};return Object.keys(o).forEach((function(e){var r;(function(e,t,r,n){var o,i=null!==(o=null==K_?void 0:K_[n])&&void 0!==o?o:[];return!V_()(e)&&(n&&i.includes(t)||H_.includes(t))||r&&Y_.includes(t)})(null===(r=o)||void 0===r?void 0:r[e],e,t,n)&&(i[e]=o[e])})),i},hO=function e(t,n){if(t===n)return!0;var o=r.Children.count(t);if(o!==r.Children.count(n))return!1;if(0===o)return!0;if(1===o)return mO(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<o;i++){var a=t[i],s=n[i];if(Array.isArray(a)||Array.isArray(s)){if(!e(a,s))return!1}else if(!mO(a,s))return!1}return!0},mO=function(e,t){if(z_()(e)&&z_()(t))return!0;if(!z_()(e)&&!z_()(t)){var r=e.props||{},n=r.children,o=tO(r,J_),i=t.props||{},a=i.children,s=tO(i,eO);return n&&a?W_(o,s)&&hO(n,a):!n&&!a&&W_(o,s)}return!1},yO=function(e,t){var r=[],n={};return sO(e).forEach((function(e,o){if(dO(e))r.push(e);else if(e){var i=oO(e.type),a=t[i]||{},s=a.handler,u=a.once;if(s&&(!u||!n[i])){var l=s(e,i,o);r.push(l),n[i]=!0}}})),r};function vO(e){return vO="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},vO(e)}function gO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gO(Object(r),!0).forEach((function(t){wO(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gO(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function wO(e,t,r){return t=function(e){var t=function(e,t){if("object"!=vO(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=vO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==vO(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return _O(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _O(e,t)}(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.")}()}function _O(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var OO=(0,r.forwardRef)((function(e,t){var n=e.aspect,o=e.initialDimension,a=void 0===o?{width:-1,height:-1}:o,s=e.width,u=void 0===s?"100%":s,l=e.height,c=void 0===l?"100%":l,f=e.minWidth,d=void 0===f?0:f,p=e.minHeight,h=e.maxHeight,m=e.children,y=e.debounce,v=void 0===y?0:y,g=e.id,b=e.className,w=e.onResize,x=e.style,_=void 0===x?{}:x,O=(0,r.useRef)(null),S=(0,r.useRef)();S.current=w,(0,r.useImperativeHandle)(t,(function(){return Object.defineProperty(O.current,"current",{get:function(){return O.current},configurable:!0})}));var E=xO((0,r.useState)({containerWidth:a.width,containerHeight:a.height}),2),j=E[0],P=E[1],k=(0,r.useCallback)((function(e,t){P((function(r){var n=Math.round(e),o=Math.round(t);return r.containerWidth===n&&r.containerHeight===o?r:{containerWidth:n,containerHeight:o}}))}),[]);(0,r.useEffect)((function(){var e=function(e){var t,r=e[0].contentRect,n=r.width,o=r.height;k(n,o),null===(t=S.current)||void 0===t||t.call(S,n,o)};v>0&&(e=g_()(e,v,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),r=O.current.getBoundingClientRect(),n=r.width,o=r.height;return k(n,o),t.observe(O.current),function(){t.disconnect()}}),[k,v]);var C=(0,r.useMemo)((function(){var e=j.containerWidth,t=j.containerHeight;if(e<0||t<0)return null;D_(k_(u)||k_(c),"The width(%s) and height(%s) are both fixed numbers,\n       maybe you don't need to use a ResponsiveContainer.",u,c),D_(!n||n>0,"The aspect(%s) must be greater than zero.",n);var o=k_(u)?e:u,a=k_(c)?t:c;n&&n>0&&(o?a=o/n:a&&(o=a*n),h&&a>h&&(a=h)),D_(o>0||a>0,"The width(%s) and height(%s) of chart should be greater than 0,\n       please check the style of container, or the props width(%s) and height(%s),\n       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n       height and width.",o,a,u,c,d,p,n);var s=!Array.isArray(m)&&oO(m.type).endsWith("Chart");return i().Children.map(m,(function(e){return i().isValidElement(e)?(0,r.cloneElement)(e,bO({width:o,height:a},s?{style:bO({height:"100%",width:"100%",maxHeight:a,maxWidth:o},e.props.style)}:{})):e}))}),[n,m,c,h,p,d,j,u]);return i().createElement("div",{id:g?"".concat(g):void 0,className:gt("recharts-responsive-container",b),style:bO(bO({},_),{},{width:u,height:c,minWidth:d,minHeight:p,maxHeight:h}),ref:O},C)})),SO=o(3181),EO=o.n(SO),jO=o(3031),PO=o.n(jO),kO="Invariant failed";function CO(e,t){if(!e)throw new Error(kO)}var AO=["children","width","height","viewBox","className","style","title","desc"];function NO(){return NO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NO.apply(this,arguments)}function TO(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function MO(e){var t=e.children,r=e.width,n=e.height,o=e.viewBox,a=e.className,s=e.style,u=e.title,l=e.desc,c=TO(e,AO),f=o||{width:r,height:n,x:0,y:0},d=gt("recharts-surface",a);return i().createElement("svg",NO({},pO(c,!0,"svg"),{className:d,width:r,height:n,style:s,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),i().createElement("title",null,u),i().createElement("desc",null,l),t)}var RO=["children","className"];function LO(){return LO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LO.apply(this,arguments)}function IO(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var DO=i().forwardRef((function(e,t){var r=e.children,n=e.className,o=IO(e,RO),a=gt("recharts-layer",n);return i().createElement("g",LO({className:a},pO(o,!0),{ref:t}),r)}));function FO(e){return FO="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},FO(e)}function zO(){return zO=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zO.apply(this,arguments)}function BO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return VO(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return VO(e,t)}(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.")}()}function VO(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function $O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function UO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$O(Object(r),!0).forEach((function(t){GO(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function GO(e,t,r){return t=function(e){var t=function(e,t){if("object"!=FO(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=FO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==FO(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function WO(e){return Array.isArray(e)&&A_(e[0])&&A_(e[1])?e.join(" ~ "):e}var qO=function(e){var t=e.separator,r=void 0===t?" : ":t,n=e.contentStyle,o=void 0===n?{}:n,a=e.itemStyle,s=void 0===a?{}:a,u=e.labelStyle,l=void 0===u?{}:u,c=e.payload,f=e.formatter,d=e.itemSorter,p=e.wrapperClassName,h=e.labelClassName,m=e.label,y=e.labelFormatter,v=e.accessibilityLayer,g=void 0!==v&&v,b=UO({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},o),w=UO({margin:0},l),x=!z_()(m),_=x?m:"",O=gt("recharts-default-tooltip",p),S=gt("recharts-tooltip-label",h);x&&y&&null!=c&&(_=y(m,c));var E=g?{role:"status","aria-live":"assertive"}:{};return i().createElement("div",zO({className:O,style:b},E),i().createElement("p",{className:S,style:w},i().isValidElement(_)?_:"".concat(_)),function(){if(c&&c.length){var e=(d?PO()(c,d):c).map((function(e,t){if("none"===e.type)return null;var n=UO({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},s),o=e.formatter||f||WO,a=e.value,u=e.name,l=a,d=u;if(o&&null!=l&&null!=d){var p=o(a,u,e,t,c);if(Array.isArray(p)){var h=BO(p,2);l=h[0],d=h[1]}else l=p}return i().createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(t),style:n},A_(d)?i().createElement("span",{className:"recharts-tooltip-item-name"},d):null,A_(d)?i().createElement("span",{className:"recharts-tooltip-item-separator"},r):null,i().createElement("span",{className:"recharts-tooltip-item-value"},l),i().createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))}));return i().createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null}())};function HO(e){return HO="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},HO(e)}function ZO(e,t,r){return t=function(e){var t=function(e,t){if("object"!=HO(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=HO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==HO(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var KO="recharts-tooltip-wrapper",YO={visibility:"hidden"};function XO(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return gt(KO,ZO(ZO(ZO(ZO({},"".concat(KO,"-right"),C_(r)&&t&&C_(t.x)&&r>=t.x),"".concat(KO,"-left"),C_(r)&&t&&C_(t.x)&&r<t.x),"".concat(KO,"-bottom"),C_(n)&&t&&C_(t.y)&&n>=t.y),"".concat(KO,"-top"),C_(n)&&t&&C_(t.y)&&n<t.y))}function QO(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.key,o=e.offsetTopLeft,i=e.position,a=e.reverseDirection,s=e.tooltipDimension,u=e.viewBox,l=e.viewBoxDimension;if(i&&C_(i[n]))return i[n];var c=r[n]-s-o,f=r[n]+o;return t[n]?a[n]?c:f:a[n]?c<u[n]?Math.max(f,u[n]):Math.max(c,u[n]):f+s>u[n]+l?Math.max(c,u[n]):Math.max(f,u[n])}function JO(e){return JO="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},JO(e)}function eS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eS(Object(r),!0).forEach((function(t){sS(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eS(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,uS(n.key),n)}}function nS(e,t,r){return t=iS(t),function(e,t){if(t&&("object"===JO(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,oS()?Reflect.construct(t,r||[],iS(e).constructor):t.apply(e,r))}function oS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(oS=function(){return!!e})()}function iS(e){return iS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iS(e)}function aS(e,t){return aS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},aS(e,t)}function sS(e,t,r){return(t=uS(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uS(e){var t=function(e,t){if("object"!=JO(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=JO(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==JO(t)?t:t+""}var lS=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return sS(e=nS(this,t,[].concat(n)),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),sS(e,"handleKeyDown",(function(t){var r,n,o,i;"Escape"===t.key&&e.setState({dismissed:!0,dismissedAtCoordinate:{x:null!==(r=null===(n=e.props.coordinate)||void 0===n?void 0:n.x)&&void 0!==r?r:0,y:null!==(o=null===(i=e.props.coordinate)||void 0===i?void 0:i.y)&&void 0!==o?o:0}})})),e}return function(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&&aS(e,t)}(t,e),r=t,n=[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.state.lastBoundingBox.width)>1||Math.abs(e.height-this.state.lastBoundingBox.height)>1)&&this.setState({lastBoundingBox:{width:e.width,height:e.height}})}else-1===this.state.lastBoundingBox.width&&-1===this.state.lastBoundingBox.height||this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var e,t;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(e=this.props.coordinate)||void 0===e?void 0:e.x)===this.state.dismissedAtCoordinate.x&&(null===(t=this.props.coordinate)||void 0===t?void 0:t.y)===this.state.dismissedAtCoordinate.y||(this.state.dismissed=!1))}},{key:"render",value:function(){var e=this,t=this.props,r=t.active,n=t.allowEscapeViewBox,o=t.animationDuration,a=t.animationEasing,s=t.children,u=t.coordinate,l=t.hasPayload,c=t.isAnimationActive,f=t.offset,d=t.position,p=t.reverseDirection,h=t.useTranslate3d,m=t.viewBox,y=t.wrapperStyle,v=function(e){var t,r,n=e.allowEscapeViewBox,o=e.coordinate,i=e.offsetTopLeft,a=e.position,s=e.reverseDirection,u=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox;return{cssProperties:u.height>0&&u.width>0&&o?function(e){var t=e.translateX,r=e.translateY;return{transform:e.useTranslate3d?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}({translateX:t=QO({allowEscapeViewBox:n,coordinate:o,key:"x",offsetTopLeft:i,position:a,reverseDirection:s,tooltipDimension:u.width,viewBox:c,viewBoxDimension:c.width}),translateY:r=QO({allowEscapeViewBox:n,coordinate:o,key:"y",offsetTopLeft:i,position:a,reverseDirection:s,tooltipDimension:u.height,viewBox:c,viewBoxDimension:c.height}),useTranslate3d:l}):YO,cssClasses:XO({translateX:t,translateY:r,coordinate:o})}}({allowEscapeViewBox:n,coordinate:u,offsetTopLeft:f,position:d,reverseDirection:p,tooltipBox:this.state.lastBoundingBox,useTranslate3d:h,viewBox:m}),g=v.cssClasses,b=v.cssProperties,w=tS(tS({transition:c&&r?"transform ".concat(o,"ms ").concat(a):void 0},b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&r&&l?"visible":"hidden",position:"absolute",top:0,left:0},y);return i().createElement("div",{tabIndex:-1,className:g,style:w,ref:function(t){e.wrapperNode=t}},s)}}],n&&rS(r.prototype,n),o&&rS(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.PureComponent),cS={isSsr:!("undefined"!=typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return cS[e]},set:function(e,t){if("string"==typeof e)cS[e]=t;else{var r=Object.keys(e);r&&r.length&&r.forEach((function(t){cS[t]=e[t]}))}}},fS=o(14),dS=o.n(fS);function pS(e,t,r){return!0===t?dS()(e,r):V_()(t)?dS()(e,t):e}function hS(e){return hS="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},hS(e)}function mS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yS(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mS(Object(r),!0).forEach((function(t){_S(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mS(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function vS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,OS(n.key),n)}}function gS(e,t,r){return t=wS(t),function(e,t){if(t&&("object"===hS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,bS()?Reflect.construct(t,r||[],wS(e).constructor):t.apply(e,r))}function bS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bS=function(){return!!e})()}function wS(e){return wS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wS(e)}function xS(e,t){return xS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xS(e,t)}function _S(e,t,r){return(t=OS(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OS(e){var t=function(e,t){if("object"!=hS(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=hS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==hS(t)?t:t+""}function SS(e){return e.dataKey}var ES=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),gS(this,t,arguments)}return function(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&&xS(e,t)}(t,e),r=t,n=[{key:"render",value:function(){var e=this,t=this.props,r=t.active,n=t.allowEscapeViewBox,o=t.animationDuration,a=t.animationEasing,s=t.content,u=t.coordinate,l=t.filterNull,c=t.isAnimationActive,f=t.offset,d=t.payload,p=t.payloadUniqBy,h=t.position,m=t.reverseDirection,y=t.useTranslate3d,v=t.viewBox,g=t.wrapperStyle,b=null!=d?d:[];l&&b.length&&(b=pS(d.filter((function(t){return null!=t.value&&(!0!==t.hide||e.props.includeHidden)})),p,SS));var w=b.length>0;return i().createElement(lS,{allowEscapeViewBox:n,animationDuration:o,animationEasing:a,isAnimationActive:c,active:r,coordinate:u,hasPayload:w,offset:f,position:h,reverseDirection:m,useTranslate3d:y,viewBox:v,wrapperStyle:g},function(e,t){return i().isValidElement(e)?i().cloneElement(e,t):"function"==typeof e?i().createElement(e,t):i().createElement(qO,t)}(s,yS(yS({},this.props),{},{payload:b})))}}],n&&vS(r.prototype,n),o&&vS(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.PureComponent);_S(ES,"displayName","Tooltip"),_S(ES,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!cS.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var jS=o(5808),PS=o.n(jS);Math.abs,Math.atan2;const kS=Math.cos,CS=(Math.max,Math.min,Math.sin),AS=Math.sqrt,NS=Math.PI,TS=2*NS;const MS={draw(e,t){const r=AS(t/NS);e.moveTo(r,0),e.arc(0,0,r,0,TS)}},RS={draw(e,t){const r=AS(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},LS=AS(1/3),IS=2*LS,DS={draw(e,t){const r=AS(t/IS),n=r*LS;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},FS={draw(e,t){const r=AS(t),n=-r/2;e.rect(n,n,r,r)}},zS=CS(NS/10)/CS(7*NS/10),BS=CS(TS/10)*zS,VS=-kS(TS/10)*zS,$S={draw(e,t){const r=AS(.8908130915292852*t),n=BS*r,o=VS*r;e.moveTo(0,-r),e.lineTo(n,o);for(let t=1;t<5;++t){const i=TS*t/5,a=kS(i),s=CS(i);e.lineTo(s*r,-a*r),e.lineTo(a*n-s*o,s*n+a*o)}e.closePath()}},US=AS(3),GS={draw(e,t){const r=-AS(t/(3*US));e.moveTo(0,2*r),e.lineTo(-US*r,-r),e.lineTo(US*r,-r),e.closePath()}},WS=-.5,qS=AS(3)/2,HS=1/AS(12),ZS=3*(HS/2+1),KS={draw(e,t){const r=AS(t/ZS),n=r/2,o=r*HS,i=n,a=r*HS+r,s=-i,u=a;e.moveTo(n,o),e.lineTo(i,a),e.lineTo(s,u),e.lineTo(WS*n-qS*o,qS*n+WS*o),e.lineTo(WS*i-qS*a,qS*i+WS*a),e.lineTo(WS*s-qS*u,qS*s+WS*u),e.lineTo(WS*n+qS*o,WS*o-qS*n),e.lineTo(WS*i+qS*a,WS*a-qS*i),e.lineTo(WS*s+qS*u,WS*u-qS*s),e.closePath()}};function YS(e){return function(){return e}}const XS=Math.PI,QS=2*XS,JS=1e-6,eE=QS-JS;function tE(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=arguments[t]+e[t]}class rE{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?tE:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return tE;const r=10**t;return function(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=Math.round(arguments[t]*r)/r+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,r,n){this._append`Q${+e},${+t},${this._x1=+r},${this._y1=+n}`}bezierCurveTo(e,t,r,n,o,i){this._append`C${+e},${+t},${+r},${+n},${this._x1=+o},${this._y1=+i}`}arcTo(e,t,r,n,o){if(e=+e,t=+t,r=+r,n=+n,(o=+o)<0)throw new Error(`negative radius: ${o}`);let i=this._x1,a=this._y1,s=r-e,u=n-t,l=i-e,c=a-t,f=l*l+c*c;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(f>JS)if(Math.abs(c*s-u*l)>JS&&o){let d=r-i,p=n-a,h=s*s+u*u,m=d*d+p*p,y=Math.sqrt(h),v=Math.sqrt(f),g=o*Math.tan((XS-Math.acos((h+f-m)/(2*y*v)))/2),b=g/v,w=g/y;Math.abs(b-1)>JS&&this._append`L${e+b*l},${t+b*c}`,this._append`A${o},${o},0,0,${+(c*d>l*p)},${this._x1=e+w*s},${this._y1=t+w*u}`}else this._append`L${this._x1=e},${this._y1=t}`;else;}arc(e,t,r,n,o,i){if(e=+e,t=+t,i=!!i,(r=+r)<0)throw new Error(`negative radius: ${r}`);let a=r*Math.cos(n),s=r*Math.sin(n),u=e+a,l=t+s,c=1^i,f=i?n-o:o-n;null===this._x1?this._append`M${u},${l}`:(Math.abs(this._x1-u)>JS||Math.abs(this._y1-l)>JS)&&this._append`L${u},${l}`,r&&(f<0&&(f=f%QS+QS),f>eE?this._append`A${r},${r},0,1,${c},${e-a},${t-s}A${r},${r},0,1,${c},${this._x1=u},${this._y1=l}`:f>JS&&this._append`A${r},${r},0,${+(f>=XS)},${c},${this._x1=e+r*Math.cos(o)},${this._y1=t+r*Math.sin(o)}`)}rect(e,t,r,n){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${r=+r}v${+n}h${-r}Z`}toString(){return this._}}function nE(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(null==r)t=null;else{const e=Math.floor(r);if(!(e>=0))throw new RangeError(`invalid digits: ${r}`);t=e}return e},()=>new rE(t)}AS(3),AS(3);function oE(e){return oE="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},oE(e)}var iE=["type","size","sizeType"];function aE(){return aE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aE.apply(this,arguments)}function sE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function uE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sE(Object(r),!0).forEach((function(t){lE(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sE(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function lE(e,t,r){return t=function(e){var t=function(e,t){if("object"!=oE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=oE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==oE(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cE(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var fE={symbolCircle:MS,symbolCross:RS,symbolDiamond:DS,symbolSquare:FS,symbolStar:$S,symbolTriangle:GS,symbolWye:KS},dE=Math.PI/180,pE=function(e){var t,r,n=e.type,o=void 0===n?"circle":n,a=e.size,s=void 0===a?64:a,u=e.sizeType,l=void 0===u?"area":u,c=uE(uE({},cE(e,iE)),{},{type:o,size:s,sizeType:l}),f=c.className,d=c.cx,p=c.cy,h=pO(c,!0);return d===+d&&p===+p&&s===+s?i().createElement("path",aE({},h,{className:gt("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(p,")"),d:(t=function(e){var t="symbol".concat(PS()(e));return fE[t]||MS}(o),r=function(e,t){let r=null,n=nE(o);function o(){let o;if(r||(r=o=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),o)return r=null,o+""||null}return e="function"==typeof e?e:YS(e||MS),t="function"==typeof t?t:YS(void 0===t?64:+t),o.type=function(t){return arguments.length?(e="function"==typeof t?t:YS(t),o):e},o.size=function(e){return arguments.length?(t="function"==typeof e?e:YS(+e),o):t},o.context=function(e){return arguments.length?(r=null==e?null:e,o):r},o}().type(t).size(function(e,t,r){if("area"===t)return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return.5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var n=18*dE;return 1.25*e*e*(Math.tan(n)-Math.tan(2*n)*Math.pow(Math.tan(n),2));case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}}(s,l,o)),r())})):null};function hE(e){return hE="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},hE(e)}function mE(){return mE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mE.apply(this,arguments)}function yE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,OE(n.key),n)}}function gE(e,t,r){return t=wE(t),function(e,t){if(t&&("object"===hE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,bE()?Reflect.construct(t,r||[],wE(e).constructor):t.apply(e,r))}function bE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(bE=function(){return!!e})()}function wE(e){return wE=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wE(e)}function xE(e,t){return xE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xE(e,t)}function _E(e,t,r){return(t=OE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OE(e){var t=function(e,t){if("object"!=hE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=hE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==hE(t)?t:t+""}pE.registerSymbol=function(e,t){fE["symbol".concat(PS()(e))]=t};var SE=32,EE=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),gE(this,t,arguments)}return function(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&&xE(e,t)}(t,e),r=t,n=[{key:"renderIcon",value:function(e){var t=this.props.inactiveColor,r=16,n=SE/6,o=SE/3,a=e.inactive?t:e.color;if("plainline"===e.type)return i().createElement("line",{strokeWidth:4,fill:"none",stroke:a,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:r,x2:SE,y2:r,className:"recharts-legend-icon"});if("line"===e.type)return i().createElement("path",{strokeWidth:4,fill:"none",stroke:a,d:"M0,".concat(r,"h").concat(o,"\n            A").concat(n,",").concat(n,",0,1,1,").concat(2*o,",").concat(r,"\n            H").concat(SE,"M").concat(2*o,",").concat(r,"\n            A").concat(n,",").concat(n,",0,1,1,").concat(o,",").concat(r),className:"recharts-legend-icon"});if("rect"===e.type)return i().createElement("path",{stroke:"none",fill:a,d:"M0,".concat(4,"h").concat(SE,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(i().isValidElement(e.legendIcon)){var s=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yE(Object(r),!0).forEach((function(t){_E(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yE(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e);return delete s.legendIcon,i().cloneElement(e.legendIcon,s)}return i().createElement(pE,{fill:a,cx:r,cy:r,size:SE,sizeType:"diameter",type:e.type})}},{key:"renderItems",value:function(){var e=this,t=this.props,r=t.payload,n=t.iconSize,o=t.layout,a=t.formatter,s=t.inactiveColor,u={x:0,y:0,width:SE,height:SE},l={display:"horizontal"===o?"inline-block":"block",marginRight:10},c={display:"inline-block",verticalAlign:"middle",marginRight:4};return r.map((function(t,r){var o=t.formatter||a,f=gt(_E(_E({"recharts-legend-item":!0},"legend-item-".concat(r),!0),"inactive",t.inactive));if("none"===t.type)return null;var d=V_()(t.value)?null:t.value;D_(!V_()(t.value),'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>');var p=t.inactive?s:t.color;return i().createElement("li",mE({className:f,style:l,key:"legend-item-".concat(r)},Q_(e.props,t,r)),i().createElement(MO,{width:n,height:n,viewBox:u,style:c},e.renderIcon(t)),i().createElement("span",{className:"recharts-legend-item-text",style:{color:p}},o?o(d,t,r):d))}))}},{key:"render",value:function(){var e=this.props,t=e.payload,r=e.layout,n=e.align;if(!t||!t.length)return null;var o={padding:0,margin:0,textAlign:"horizontal"===r?n:"left"};return i().createElement("ul",{className:"recharts-default-legend",style:o},this.renderItems())}}],n&&vE(r.prototype,n),o&&vE(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.PureComponent);function jE(e){return jE="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},jE(e)}_E(EE,"displayName","Legend"),_E(EE,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var PE=["ref"];function kE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function CE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?kE(Object(r),!0).forEach((function(t){LE(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kE(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function AE(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,IE(n.key),n)}}function NE(e,t,r){return t=ME(t),function(e,t){if(t&&("object"===jE(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,TE()?Reflect.construct(t,r||[],ME(e).constructor):t.apply(e,r))}function TE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(TE=function(){return!!e})()}function ME(e){return ME=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ME(e)}function RE(e,t){return RE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},RE(e,t)}function LE(e,t,r){return(t=IE(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IE(e){var t=function(e,t){if("object"!=jE(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jE(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jE(t)?t:t+""}function DE(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function FE(e){return e.value}var zE=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return LE(e=NE(this,t,[].concat(n)),"lastBoundingBox",{width:-1,height:-1}),e}return function(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&&RE(e,t)}(t,e),r=t,n=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();return e.height=this.wrapperNode.offsetHeight,e.width=this.wrapperNode.offsetWidth,e}return null}},{key:"updateBBox",value:function(){var e=this.props.onBBoxUpdate,t=this.getBBox();t?(Math.abs(t.width-this.lastBoundingBox.width)>1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t)):-1===this.lastBoundingBox.width&&-1===this.lastBoundingBox.height||(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?CE({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(e){var t,r,n=this.props,o=n.layout,i=n.align,a=n.verticalAlign,s=n.margin,u=n.chartWidth,l=n.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===i&&"vertical"===o?{left:((u||0)-this.getBBoxSnapshot().width)/2}:"right"===i?{right:s&&s.right||0}:{left:s&&s.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(r="middle"===a?{top:((l||0)-this.getBBoxSnapshot().height)/2}:"bottom"===a?{bottom:s&&s.bottom||0}:{top:s&&s.top||0}),CE(CE({},t),r)}},{key:"render",value:function(){var e=this,t=this.props,r=t.content,n=t.width,o=t.height,a=t.wrapperStyle,s=t.payloadUniqBy,u=t.payload,l=CE(CE({position:"absolute",width:n||"auto",height:o||"auto"},this.getDefaultPosition(a)),a);return i().createElement("div",{className:"recharts-legend-wrapper",style:l,ref:function(t){e.wrapperNode=t}},function(e,t){if(i().isValidElement(e))return i().cloneElement(e,t);if("function"==typeof e)return i().createElement(e,t);t.ref;var r=DE(t,PE);return i().createElement(EE,r)}(r,CE(CE({},this.props),{},{payload:pS(u,s,FE)})))}}],o=[{key:"getWithHeight",value:function(e,t){var r=CE(CE({},this.defaultProps),e.props).layout;return"vertical"===r&&C_(e.props.height)?{height:e.props.height}:"horizontal"===r?{width:e.props.width||t}:null}}],n&&AE(r.prototype,n),o&&AE(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.PureComponent);function BE(){return BE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BE.apply(this,arguments)}LE(zE,"displayName","Legend"),LE(zE,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var VE=function(e){var t=e.cx,r=e.cy,n=e.r,o=e.className,a=gt("recharts-dot",o);return t===+t&&r===+r&&n===+n?i().createElement("circle",BE({},pO(e,!1),X_(e),{className:a,cx:t,cy:r,r:n})):null},$E=o(5556),UE=o.n($E),GE=Object.getOwnPropertyNames,WE=Object.getOwnPropertySymbols,qE=Object.prototype.hasOwnProperty;function HE(e,t){return function(r,n,o){return e(r,n,o)&&t(r,n,o)}}function ZE(e){return function(t,r,n){if(!t||!r||"object"!=typeof t||"object"!=typeof r)return e(t,r,n);var o=n.cache,i=o.get(t),a=o.get(r);if(i&&a)return i===r&&a===t;o.set(t,r),o.set(r,t);var s=e(t,r,n);return o.delete(t),o.delete(r),s}}function KE(e){return GE(e).concat(WE(e))}var YE=Object.hasOwn||function(e,t){return qE.call(e,t)};function XE(e,t){return e===t||!e&&!t&&e!=e&&t!=t}var QE=Object.getOwnPropertyDescriptor,JE=Object.keys;function ej(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function tj(e,t){return XE(e.getTime(),t.getTime())}function rj(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function nj(e,t){return e===t}function oj(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var o,i,a=new Array(n),s=e.entries(),u=0;(o=s.next())&&!o.done;){for(var l=t.entries(),c=!1,f=0;(i=l.next())&&!i.done;)if(a[f])f++;else{var d=o.value,p=i.value;if(r.equals(d[0],p[0],u,f,e,t,r)&&r.equals(d[1],p[1],d[0],p[0],e,t,r)){c=a[f]=!0;break}f++}if(!c)return!1;u++}return!0}var ij=XE;function aj(e,t,r){var n=JE(e),o=n.length;if(JE(t).length!==o)return!1;for(;o-- >0;)if(!pj(e,t,r,n[o]))return!1;return!0}function sj(e,t,r){var n,o,i,a=KE(e),s=a.length;if(KE(t).length!==s)return!1;for(;s-- >0;){if(!pj(e,t,r,n=a[s]))return!1;if(o=QE(e,n),i=QE(t,n),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function uj(e,t){return XE(e.valueOf(),t.valueOf())}function lj(e,t){return e.source===t.source&&e.flags===t.flags}function cj(e,t,r){var n=e.size;if(n!==t.size)return!1;if(!n)return!0;for(var o,i,a=new Array(n),s=e.values();(o=s.next())&&!o.done;){for(var u=t.values(),l=!1,c=0;(i=u.next())&&!i.done;){if(!a[c]&&r.equals(o.value,i.value,o.value,i.value,e,t,r)){l=a[c]=!0;break}c++}if(!l)return!1}return!0}function fj(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function dj(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function pj(e,t,r,n){return!("_owner"!==n&&"__o"!==n&&"__v"!==n||!e.$$typeof&&!t.$$typeof)||YE(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}var hj=Array.isArray,mj="function"==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView:null,yj=Object.assign,vj=Object.prototype.toString.call.bind(Object.prototype.toString);var gj=bj();bj({strict:!0}),bj({circular:!0}),bj({circular:!0,strict:!0}),bj({createInternalComparator:function(){return XE}}),bj({strict:!0,createInternalComparator:function(){return XE}}),bj({circular:!0,createInternalComparator:function(){return XE}}),bj({circular:!0,createInternalComparator:function(){return XE},strict:!0});function bj(e){void 0===e&&(e={});var t,r=e.circular,n=void 0!==r&&r,o=e.createInternalComparator,i=e.createState,a=e.strict,s=void 0!==a&&a,u=function(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,o={areArraysEqual:n?sj:ej,areDatesEqual:tj,areErrorsEqual:rj,areFunctionsEqual:nj,areMapsEqual:n?HE(oj,sj):oj,areNumbersEqual:ij,areObjectsEqual:n?sj:aj,arePrimitiveWrappersEqual:uj,areRegExpsEqual:lj,areSetsEqual:n?HE(cj,sj):cj,areTypedArraysEqual:n?sj:fj,areUrlsEqual:dj};if(r&&(o=yj({},o,r(o))),t){var i=ZE(o.areArraysEqual),a=ZE(o.areMapsEqual),s=ZE(o.areObjectsEqual),u=ZE(o.areSetsEqual);o=yj({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return o}(e),l=function(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areErrorsEqual,o=e.areFunctionsEqual,i=e.areMapsEqual,a=e.areNumbersEqual,s=e.areObjectsEqual,u=e.arePrimitiveWrappersEqual,l=e.areRegExpsEqual,c=e.areSetsEqual,f=e.areTypedArraysEqual,d=e.areUrlsEqual;return function(e,p,h){if(e===p)return!0;if(null==e||null==p)return!1;var m=typeof e;if(m!==typeof p)return!1;if("object"!==m)return"number"===m?a(e,p,h):"function"===m&&o(e,p,h);var y=e.constructor;if(y!==p.constructor)return!1;if(y===Object)return s(e,p,h);if(hj(e))return t(e,p,h);if(null!=mj&&mj(e))return f(e,p,h);if(y===Date)return r(e,p,h);if(y===RegExp)return l(e,p,h);if(y===Map)return i(e,p,h);if(y===Set)return c(e,p,h);var v=vj(e);return"[object Date]"===v?r(e,p,h):"[object RegExp]"===v?l(e,p,h):"[object Map]"===v?i(e,p,h):"[object Set]"===v?c(e,p,h):"[object Object]"===v?"function"!=typeof e.then&&"function"!=typeof p.then&&s(e,p,h):"[object URL]"===v?d(e,p,h):"[object Error]"===v?n(e,p,h):"[object Arguments]"===v?s(e,p,h):("[object Boolean]"===v||"[object Number]"===v||"[object String]"===v)&&u(e,p,h)}}(u),c=o?o(l):(t=l,function(e,r,n,o,i,a,s){return t(e,r,s)});return function(e){var t=e.circular,r=e.comparator,n=e.createState,o=e.equals,i=e.strict;if(n)return function(e,a){var s=n(),u=s.cache,l=void 0===u?t?new WeakMap:void 0:u,c=s.meta;return r(e,a,{cache:l,equals:o,meta:c,strict:i})};if(t)return function(e,t){return r(e,t,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(e,t){return r(e,t,a)}}({circular:n,comparator:l,createState:i,equals:c,strict:s})}function wj(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=-1;requestAnimationFrame((function n(o){r<0&&(r=o),o-r>t?(e(o),r=-1):function(e){"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(e)}(n)}))}function xj(e){return xj="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},xj(e)}function _j(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Oj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Oj(e,t)}(e)||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.")}()}function Oj(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Sj(){var e=function(){return null},t=!1,r=function r(n){if(!t){if(Array.isArray(n)){if(!n.length)return;var o=_j(n),i=o[0],a=o.slice(1);return"number"==typeof i?void wj(r.bind(null,a),i):(r(i),void wj(r.bind(null,a)))}"object"===xj(n)&&e(n),"function"==typeof n&&n()}};return{stop:function(){t=!0},start:function(e){t=!1,r(e)},subscribe:function(t){return e=t,function(){e=function(){return null}}}}}function Ej(e){return Ej="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},Ej(e)}function jj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pj(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jj(Object(r),!0).forEach((function(t){kj(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jj(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function kj(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Ej(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==Ej(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===Ej(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Cj=function(e){return e},Aj=function(e,t){return Object.keys(t).reduce((function(r,n){return Pj(Pj({},r),{},kj({},n,e(n,t[n])))}),{})},Nj=function(e,t,r){return e.map((function(e){return"".concat((n=e,n.replace(/([A-Z])/g,(function(e){return"-".concat(e.toLowerCase())})))," ").concat(t,"ms ").concat(r);var n})).join(",")};function Tj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||Rj(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.")}()}function Mj(e){return function(e){if(Array.isArray(e))return Lj(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Rj(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.")}()}function Rj(e,t){if(e){if("string"==typeof e)return Lj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Lj(e,t):void 0}}function Lj(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ij=1e-4,Dj=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},Fj=function(e,t){return e.map((function(e,r){return e*Math.pow(t,r)})).reduce((function(e,t){return e+t}))},zj=function(e,t){return function(r){var n=Dj(e,t);return Fj(n,r)}},Bj=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0],o=t[1],i=t[2],a=t[3];if(1===t.length)switch(t[0]){case"linear":n=0,o=0,i=1,a=1;break;case"ease":n=.25,o=.1,i=.25,a=1;break;case"ease-in":n=.42,o=0,i=1,a=1;break;case"ease-out":n=.42,o=0,i=.58,a=1;break;case"ease-in-out":n=0,o=0,i=.58,a=1;break;default:var s=t[0].split("(");if("cubic-bezier"===s[0]&&4===s[1].split(")")[0].split(",").length){var u=s[1].split(")")[0].split(",").map((function(e){return parseFloat(e)})),l=Tj(u,4);n=l[0],o=l[1],i=l[2],a=l[3]}}[n,i,o,a].every((function(e){return"number"==typeof e&&e>=0&&e<=1}));var c,f,d=zj(n,i),p=zj(o,a),h=(c=n,f=i,function(e){var t=Dj(c,f),r=[].concat(Mj(t.map((function(e,t){return e*t})).slice(1)),[0]);return Fj(r,e)}),m=function(e){return e>1?1:e<0?0:e},y=function(e){for(var t=e>1?1:e,r=t,n=0;n<8;++n){var o=d(r)-t,i=h(r);if(Math.abs(o-t)<Ij||i<Ij)return p(r);r=m(r-o/i)}return p(r)};return y.isStepper=!1,y},Vj=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0];if("string"==typeof n)switch(n){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Bj(n);case"spring":return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiff,r=void 0===t?100:t,n=e.damping,o=void 0===n?8:n,i=e.dt,a=void 0===i?17:i,s=function(e,t,n){var i=n+(-(e-t)*r-n*o)*a/1e3,s=n*a/1e3+e;return Math.abs(s-t)<Ij&&Math.abs(i)<Ij?[t,0]:[s,i]};return s.isStepper=!0,s.dt=a,s}();default:if("cubic-bezier"===n.split("(")[0])return Bj(n)}return"function"==typeof n?n:null};function $j(e){return $j="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},$j(e)}function Uj(e){return function(e){if(Array.isArray(e))return Kj(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Zj(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.")}()}function Gj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Wj(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gj(Object(r),!0).forEach((function(t){qj(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gj(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qj(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==$j(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==$j(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===$j(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hj(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||Zj(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.")}()}function Zj(e,t){if(e){if("string"==typeof e)return Kj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Kj(e,t):void 0}}function Kj(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Yj=function(e,t,r){return e+(t-e)*r},Xj=function(e){return e.from!==e.to},Qj=function e(t,r,n){var o=Aj((function(e,r){if(Xj(r)){var n=Hj(t(r.from,r.to,r.velocity),2),o=n[0],i=n[1];return Wj(Wj({},r),{},{from:o,velocity:i})}return r}),r);return n<1?Aj((function(e,t){return Xj(t)?Wj(Wj({},t),{},{velocity:Yj(t.velocity,o[e].velocity,n),from:Yj(t.from,o[e].from,n)}):t}),r):e(t,o,n-1)};const Jj=function(e,t,r,n,o){var i,a,s,u,l=(i=e,a=t,[Object.keys(i),Object.keys(a)].reduce((function(e,t){return e.filter((function(e){return t.includes(e)}))}))),c=l.reduce((function(r,n){return Wj(Wj({},r),{},qj({},n,[e[n],t[n]]))}),{}),f=l.reduce((function(r,n){return Wj(Wj({},r),{},qj({},n,{from:e[n],velocity:0,to:t[n]}))}),{}),d=-1,p=function(){return null};return p=r.isStepper?function(n){s||(s=n);var i=(n-s)/r.dt;f=Qj(r,f,i),o(Wj(Wj(Wj({},e),t),Aj((function(e,t){return t.from}),f))),s=n,Object.values(f).filter(Xj).length&&(d=requestAnimationFrame(p))}:function(i){u||(u=i);var a=(i-u)/n,s=Aj((function(e,t){return Yj.apply(void 0,Uj(t).concat([r(a)]))}),c);if(o(Wj(Wj(Wj({},e),t),s)),a<1)d=requestAnimationFrame(p);else{var l=Aj((function(e,t){return Yj.apply(void 0,Uj(t).concat([r(1)]))}),c);o(Wj(Wj(Wj({},e),t),l))}},function(){return requestAnimationFrame(p),function(){cancelAnimationFrame(d)}}};function eP(e){return eP="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},eP(e)}var tP=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function rP(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function nP(e){return function(e){if(Array.isArray(e))return oP(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return oP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oP(e,t)}(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.")}()}function oP(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function iP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function aP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?iP(Object(r),!0).forEach((function(t){sP(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iP(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function sP(e,t,r){return(t=lP(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lP(n.key),n)}}function lP(e){var t=function(e,t){if("object"!==eP(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==eP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eP(t)?t:String(t)}function cP(e,t){return cP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cP(e,t)}function fP(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 Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=hP(e);if(t){var o=hP(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return dP(this,r)}}function dP(e,t){if(t&&("object"===eP(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return pP(e)}function pP(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hP(e){return hP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hP(e)}var mP=function(e){!function(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&&cP(e,t)}(s,e);var t,n,o,a=fP(s);function s(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var n=(r=a.call(this,e,t)).props,o=n.isActive,i=n.attributeName,u=n.from,l=n.to,c=n.steps,f=n.children,d=n.duration;if(r.handleStyleChange=r.handleStyleChange.bind(pP(r)),r.changeStyle=r.changeStyle.bind(pP(r)),!o||d<=0)return r.state={style:{}},"function"==typeof f&&(r.state={style:l}),dP(r);if(c&&c.length)r.state={style:c[0].style};else if(u){if("function"==typeof f)return r.state={style:u},dP(r);r.state={style:i?sP({},i,u):u}}else r.state={style:{}};return r}return t=s,n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.isActive,r=e.canBegin;this.mounted=!0,t&&r&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isActive,n=t.canBegin,o=t.attributeName,i=t.shouldReAnimate,a=t.to,s=t.from,u=this.state.style;if(n)if(r){if(!(gj(e.to,a)&&e.canBegin&&e.isActive)){var l=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var c=l||i?s:e.to;if(this.state&&u){var f={style:o?sP({},o,c):c};(o&&u[o]!==c||!o&&u!==c)&&this.setState(f)}this.runAnimation(aP(aP({},this.props),{},{from:c,begin:0}))}}else{var d={style:o?sP({},o,a):a};this.state&&u&&(o&&u[o]!==a||!o&&u!==a)&&this.setState(d)}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:"handleStyleChange",value:function(e){this.changeStyle(e)}},{key:"changeStyle",value:function(e){this.mounted&&this.setState({style:e})}},{key:"runJSAnimation",value:function(e){var t=this,r=e.from,n=e.to,o=e.duration,i=e.easing,a=e.begin,s=e.onAnimationEnd,u=e.onAnimationStart,l=Jj(r,n,Vj(i),o,this.changeStyle);this.manager.start([u,a,function(){t.stopJSAnimation=l()},o,s])}},{key:"runStepAnimation",value:function(e){var t=this,r=e.steps,n=e.begin,o=e.onAnimationStart,i=r[0],a=i.style,s=i.duration,u=void 0===s?0:s;return this.manager.start([o].concat(nP(r.reduce((function(e,n,o){if(0===o)return e;var i=n.duration,a=n.easing,s=void 0===a?"ease":a,u=n.style,l=n.properties,c=n.onAnimationEnd,f=o>0?r[o-1]:n,d=l||Object.keys(u);if("function"==typeof s||"spring"===s)return[].concat(nP(e),[t.runJSAnimation.bind(t,{from:f.style,to:u,duration:i,easing:s}),i]);var p=Nj(d,i,s),h=aP(aP(aP({},f.style),u),{},{transition:p});return[].concat(nP(e),[h,i,c]).filter(Cj)}),[a,Math.max(u,n)])),[e.onAnimationEnd]))}},{key:"runAnimation",value:function(e){this.manager||(this.manager=Sj());var t=e.begin,r=e.duration,n=e.attributeName,o=e.to,i=e.easing,a=e.onAnimationStart,s=e.onAnimationEnd,u=e.steps,l=e.children,c=this.manager;if(this.unSubscribe=c.subscribe(this.handleStyleChange),"function"!=typeof i&&"function"!=typeof l&&"spring"!==i)if(u.length>1)this.runStepAnimation(e);else{var f=n?sP({},n,o):o,d=Nj(Object.keys(f),r,i);c.start([a,t,aP(aP({},f),{},{transition:d}),r,s])}else this.runJSAnimation(e)}},{key:"render",value:function(){var e=this.props,t=e.children,n=(e.begin,e.duration),o=(e.attributeName,e.easing,e.isActive),a=(e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart,rP(e,tP)),s=r.Children.count(t),u=this.state.style;if("function"==typeof t)return t(u);if(!o||0===s||n<=0)return t;var l=function(e){var t=e.props,n=t.style,o=void 0===n?{}:n,i=t.className;return(0,r.cloneElement)(e,aP(aP({},a),{},{style:aP(aP({},o),u),className:i}))};return 1===s?l(r.Children.only(t)):i().createElement("div",null,r.Children.map(t,(function(e){return l(e)})))}}],n&&uP(t.prototype,n),o&&uP(t,o),Object.defineProperty(t,"prototype",{writable:!1}),s}(r.PureComponent);mP.displayName="Animate",mP.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},mP.propTypes={from:UE().oneOfType([UE().object,UE().string]),to:UE().oneOfType([UE().object,UE().string]),attributeName:UE().string,duration:UE().number,begin:UE().number,easing:UE().oneOfType([UE().string,UE().func]),steps:UE().arrayOf(UE().shape({duration:UE().number.isRequired,style:UE().object.isRequired,easing:UE().oneOfType([UE().oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),UE().func]),properties:UE().arrayOf("string"),onAnimationEnd:UE().func})),children:UE().oneOfType([UE().node,UE().func]),isActive:UE().bool,canBegin:UE().bool,onAnimationEnd:UE().func,shouldReAnimate:UE().bool,onAnimationStart:UE().func,onAnimationReStart:UE().func};const yP=mP;function vP(e){return vP="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},vP(e)}function gP(){return gP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gP.apply(this,arguments)}function bP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return wP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wP(e,t)}(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.")}()}function wP(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function xP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xP(Object(r),!0).forEach((function(t){OP(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xP(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function OP(e,t,r){return t=function(e){var t=function(e,t){if("object"!=vP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=vP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==vP(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var SP=function(e,t,r,n,o){var i,a=Math.min(Math.abs(r)/2,Math.abs(n)/2),s=n>=0?1:-1,u=r>=0?1:-1,l=n>=0&&r>=0||n<0&&r<0?1:0;if(a>0&&o instanceof Array){for(var c=[0,0,0,0],f=0;f<4;f++)c[f]=o[f]>a?a:o[f];i="M".concat(e,",").concat(t+s*c[0]),c[0]>0&&(i+="A ".concat(c[0],",").concat(c[0],",0,0,").concat(l,",").concat(e+u*c[0],",").concat(t)),i+="L ".concat(e+r-u*c[1],",").concat(t),c[1]>0&&(i+="A ".concat(c[1],",").concat(c[1],",0,0,").concat(l,",\n        ").concat(e+r,",").concat(t+s*c[1])),i+="L ".concat(e+r,",").concat(t+n-s*c[2]),c[2]>0&&(i+="A ".concat(c[2],",").concat(c[2],",0,0,").concat(l,",\n        ").concat(e+r-u*c[2],",").concat(t+n)),i+="L ".concat(e+u*c[3],",").concat(t+n),c[3]>0&&(i+="A ".concat(c[3],",").concat(c[3],",0,0,").concat(l,",\n        ").concat(e,",").concat(t+n-s*c[3])),i+="Z"}else if(a>0&&o===+o&&o>0){var d=Math.min(a,o);i="M ".concat(e,",").concat(t+s*d,"\n            A ").concat(d,",").concat(d,",0,0,").concat(l,",").concat(e+u*d,",").concat(t,"\n            L ").concat(e+r-u*d,",").concat(t,"\n            A ").concat(d,",").concat(d,",0,0,").concat(l,",").concat(e+r,",").concat(t+s*d,"\n            L ").concat(e+r,",").concat(t+n-s*d,"\n            A ").concat(d,",").concat(d,",0,0,").concat(l,",").concat(e+r-u*d,",").concat(t+n,"\n            L ").concat(e+u*d,",").concat(t+n,"\n            A ").concat(d,",").concat(d,",0,0,").concat(l,",").concat(e,",").concat(t+n-s*d," Z")}else i="M ".concat(e,",").concat(t," h ").concat(r," v ").concat(n," h ").concat(-r," Z");return i},EP=function(e,t){if(!e||!t)return!1;var r=e.x,n=e.y,o=t.x,i=t.y,a=t.width,s=t.height;if(Math.abs(a)>0&&Math.abs(s)>0){var u=Math.min(o,o+a),l=Math.max(o,o+a),c=Math.min(i,i+s),f=Math.max(i,i+s);return r>=u&&r<=l&&n>=c&&n<=f}return!1},jP={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},PP=function(e){var t=_P(_P({},jP),e),n=(0,r.useRef)(),o=bP((0,r.useState)(-1),2),a=o[0],s=o[1];(0,r.useEffect)((function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&s(e)}catch(e){}}),[]);var u=t.x,l=t.y,c=t.width,f=t.height,d=t.radius,p=t.className,h=t.animationEasing,m=t.animationDuration,y=t.animationBegin,v=t.isAnimationActive,g=t.isUpdateAnimationActive;if(u!==+u||l!==+l||c!==+c||f!==+f||0===c||0===f)return null;var b=gt("recharts-rectangle",p);return g?i().createElement(yP,{canBegin:a>0,from:{width:c,height:f,x:u,y:l},to:{width:c,height:f,x:u,y:l},duration:m,animationEasing:h,isActive:g},(function(e){var r=e.width,o=e.height,s=e.x,u=e.y;return i().createElement(yP,{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:v,easing:h},i().createElement("path",gP({},pO(t,!0),{className:b,d:SP(s,u,r,o,d),ref:n})))})):i().createElement("path",gP({},pO(t,!0),{className:b,d:SP(u,l,c,f,d)}))};function kP(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function CP(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}class AP extends Map{constructor(e,t=RP){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,r]of e)this.set(t,r)}get(e){return super.get(NP(this,e))}has(e){return super.has(NP(this,e))}set(e,t){return super.set(TP(this,e),t)}delete(e){return super.delete(MP(this,e))}}Set;function NP({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function TP({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function MP({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function RP(e){return null!==e&&"object"==typeof e?e.valueOf():e}const LP=Symbol("implicit");function IP(){var e=new AP,t=[],r=[],n=LP;function o(o){let i=e.get(o);if(void 0===i){if(n!==LP)return n;e.set(o,i=t.push(o)-1)}return r[i%r.length]}return o.domain=function(r){if(!arguments.length)return t.slice();t=[],e=new AP;for(const n of r)e.has(n)||e.set(n,t.push(n)-1);return o},o.range=function(e){return arguments.length?(r=Array.from(e),o):r.slice()},o.unknown=function(e){return arguments.length?(n=e,o):n},o.copy=function(){return IP(t,r).unknown(n)},kP.apply(o,arguments),o}function DP(){var e,t,r=IP().unknown(void 0),n=r.domain,o=r.range,i=0,a=1,s=!1,u=0,l=0,c=.5;function f(){var r=n().length,f=a<i,d=f?a:i,p=f?i:a;e=(p-d)/Math.max(1,r-u+2*l),s&&(e=Math.floor(e)),d+=(p-d-e*(r-u))*c,t=e*(1-u),s&&(d=Math.round(d),t=Math.round(t));var h=function(e,t,r){e=+e,t=+t,r=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+r;for(var n=-1,o=0|Math.max(0,Math.ceil((t-e)/r)),i=new Array(o);++n<o;)i[n]=e+n*r;return i}(r).map((function(t){return d+e*t}));return o(f?h.reverse():h)}return delete r.unknown,r.domain=function(e){return arguments.length?(n(e),f()):n()},r.range=function(e){return arguments.length?([i,a]=e,i=+i,a=+a,f()):[i,a]},r.rangeRound=function(e){return[i,a]=e,i=+i,a=+a,s=!0,f()},r.bandwidth=function(){return t},r.step=function(){return e},r.round=function(e){return arguments.length?(s=!!e,f()):s},r.padding=function(e){return arguments.length?(u=Math.min(1,l=+e),f()):u},r.paddingInner=function(e){return arguments.length?(u=Math.min(1,e),f()):u},r.paddingOuter=function(e){return arguments.length?(l=+e,f()):l},r.align=function(e){return arguments.length?(c=Math.max(0,Math.min(1,e)),f()):c},r.copy=function(){return DP(n(),[i,a]).round(s).paddingInner(u).paddingOuter(l).align(c)},kP.apply(f(),arguments)}function FP(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return FP(t())},e}function zP(){return FP(DP.apply(null,arguments).paddingInner(1))}function BP(e){return BP="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},BP(e)}function VP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?VP(Object(r),!0).forEach((function(t){UP(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VP(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function UP(e,t,r){return t=function(e){var t=function(e,t){if("object"!=BP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=BP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==BP(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var GP={widthCache:{},cacheCount:0},WP={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},qP="recharts_measurement_span";var HP=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||cS.isSsr)return{width:0,height:0};var r,n=(r=$P({},t),Object.keys(r).forEach((function(e){r[e]||delete r[e]})),r),o=JSON.stringify({text:e,copyStyle:n});if(GP.widthCache[o])return GP.widthCache[o];try{var i=document.getElementById(qP);i||((i=document.createElement("span")).setAttribute("id",qP),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var a=$P($P({},WP),n);Object.assign(i.style,a),i.textContent="".concat(e);var s=i.getBoundingClientRect(),u={width:s.width,height:s.height};return GP.widthCache[o]=u,++GP.cacheCount>2e3&&(GP.cacheCount=0,GP.widthCache={}),u}catch(e){return{width:0,height:0}}};function ZP(e){return ZP="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},ZP(e)}function KP(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return YP(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return YP(e,t)}(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.")}()}function YP(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function XP(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,QP(n.key),n)}}function QP(e){var t=function(e,t){if("object"!=ZP(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ZP(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ZP(t)?t:t+""}var JP=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,ek=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,tk=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,rk=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,nk={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},ok=Object.keys(nk),ik="NaN";var ak=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.num=t,this.unit=r,this.num=t,this.unit=r,Number.isNaN(t)&&(this.unit=""),""===r||tk.test(r)||(this.num=NaN,this.unit=""),ok.includes(r)&&(this.num=function(e,t){return e*nk[t]}(t,r),this.unit="px")}return t=e,n=[{key:"parse",value:function(t){var r,n=KP(null!==(r=rk.exec(t))&&void 0!==r?r:[],3),o=n[1],i=n[2];return new e(parseFloat(o),null!=i?i:"")}}],(r=[{key:"add",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num+t.num,this.unit)}},{key:"subtract",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num-t.num,this.unit)}},{key:"multiply",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num*t.num,this.unit||t.unit)}},{key:"divide",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num/t.num,this.unit||t.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}])&&XP(t.prototype,r),n&&XP(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();function sk(e){if(e.includes(ik))return ik;for(var t=e;t.includes("*")||t.includes("/");){var r,n=KP(null!==(r=JP.exec(t))&&void 0!==r?r:[],4),o=n[1],i=n[2],a=n[3],s=ak.parse(null!=o?o:""),u=ak.parse(null!=a?a:""),l="*"===i?s.multiply(u):s.divide(u);if(l.isNaN())return ik;t=t.replace(JP,l.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var c,f=KP(null!==(c=ek.exec(t))&&void 0!==c?c:[],4),d=f[1],p=f[2],h=f[3],m=ak.parse(null!=d?d:""),y=ak.parse(null!=h?h:""),v="+"===p?m.add(y):m.subtract(y);if(v.isNaN())return ik;t=t.replace(ek,v.toString())}return t}var uk=/\(([^()]*)\)/;function lk(e){var t=e.replace(/\s+/g,"");return t=function(e){for(var t=e;t.includes("(");){var r=KP(uk.exec(t),2)[1];t=t.replace(uk,sk(r))}return t}(t),t=sk(t)}function ck(e){var t=function(e){try{return lk(e)}catch(e){return ik}}(e.slice(5,-1));return t===ik?"":t}var fk=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],dk=["dx","dy","angle","className","breakAll"];function pk(){return pk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pk.apply(this,arguments)}function hk(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function mk(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return yk(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yk(e,t)}(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.")}()}function yk(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var vk=/[ \f\n\r\t\v\u2028\u2029]+/,gk=function(e){var t=e.children,r=e.breakAll,n=e.style;try{var o=[];return z_()(t)||(o=r?t.toString().split(""):t.toString().split(vk)),{wordsWithComputedWidth:o.map((function(e){return{word:e,width:HP(e,n).width}})),spaceWidth:r?0:HP(" ",n).width}}catch(e){return null}},bk=function(e){return[{words:z_()(e)?[]:e.toString().split(vk)}]},wk=function(e){var t=e.width,r=e.scaleToFit,n=e.children,o=e.style,i=e.breakAll,a=e.maxLines;if((t||r)&&!cS.isSsr){var s=gk({breakAll:i,children:n,style:o});return s?function(e,t,r,n,o){var i=e.maxLines,a=e.children,s=e.style,u=e.breakAll,l=C_(i),c=a,f=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce((function(e,t){var i=t.word,a=t.width,s=e[e.length-1];if(s&&(null==n||o||s.width+a+r<Number(n)))s.words.push(i),s.width+=a+r;else{var u={words:[i],width:a};e.push(u)}return e}),[])},d=f(t);if(!l)return d;for(var p,h=function(e){var t=c.slice(0,e),r=gk({breakAll:u,style:s,children:t+"…"}).wordsWithComputedWidth,o=f(r),a=o.length>i||function(e){return e.reduce((function(e,t){return e.width>t.width?e:t}))}(o).width>Number(n);return[a,o]},m=0,y=c.length-1,v=0;m<=y&&v<=c.length-1;){var g=Math.floor((m+y)/2),b=mk(h(g-1),2),w=b[0],x=b[1],_=mk(h(g),1)[0];if(w||_||(m=g+1),w&&_&&(y=g-1),!w&&_){p=x;break}v++}return p||d}({breakAll:i,children:n,maxLines:a,style:o},s.wordsWithComputedWidth,s.spaceWidth,t,r):bk(n)}return bk(n)},xk="#808080",_k=function(e){var t=e.x,n=void 0===t?0:t,o=e.y,a=void 0===o?0:o,s=e.lineHeight,u=void 0===s?"1em":s,l=e.capHeight,c=void 0===l?"0.71em":l,f=e.scaleToFit,d=void 0!==f&&f,p=e.textAnchor,h=void 0===p?"start":p,m=e.verticalAnchor,y=void 0===m?"end":m,v=e.fill,g=void 0===v?xk:v,b=hk(e,fk),w=(0,r.useMemo)((function(){return wk({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:d,style:b.style,width:b.width})}),[b.breakAll,b.children,b.maxLines,d,b.style,b.width]),x=b.dx,_=b.dy,O=b.angle,S=b.className,E=b.breakAll,j=hk(b,dk);if(!A_(n)||!A_(a))return null;var P,k=n+(C_(x)?x:0),C=a+(C_(_)?_:0);switch(y){case"start":P=ck("calc(".concat(c,")"));break;case"middle":P=ck("calc(".concat((w.length-1)/2," * -").concat(u," + (").concat(c," / 2))"));break;default:P=ck("calc(".concat(w.length-1," * -").concat(u,")"))}var A=[];if(d){var N=w[0].width,T=b.width;A.push("scale(".concat((C_(T)?T/N:1)/N,")"))}return O&&A.push("rotate(".concat(O,", ").concat(k,", ").concat(C,")")),A.length&&(j.transform=A.join(" ")),i().createElement("text",pk({},pO(j,!0),{x:k,y:C,className:gt("recharts-text",S),textAnchor:h,fill:g.includes("url")?xk:g}),w.map((function(e,t){var r=e.words.join(E?"":" ");return i().createElement("tspan",{x:k,dy:0===t?P:u,key:"".concat(r,"-").concat(t)},r)})))};const Ok=Math.sqrt(50),Sk=Math.sqrt(10),Ek=Math.sqrt(2);function jk(e,t,r){const n=(t-e)/Math.max(0,r),o=Math.floor(Math.log10(n)),i=n/Math.pow(10,o),a=i>=Ok?10:i>=Sk?5:i>=Ek?2:1;let s,u,l;return o<0?(l=Math.pow(10,-o)/a,s=Math.round(e*l),u=Math.round(t*l),s/l<e&&++s,u/l>t&&--u,l=-l):(l=Math.pow(10,o)*a,s=Math.round(e/l),u=Math.round(t/l),s*l<e&&++s,u*l>t&&--u),u<s&&.5<=r&&r<2?jk(e,t,2*r):[s,u,l]}function Pk(e,t,r){if(!((r=+r)>0))return[];if((e=+e)===(t=+t))return[e];const n=t<e,[o,i,a]=n?jk(t,e,r):jk(e,t,r);if(!(i>=o))return[];const s=i-o+1,u=new Array(s);if(n)if(a<0)for(let e=0;e<s;++e)u[e]=(i-e)/-a;else for(let e=0;e<s;++e)u[e]=(i-e)*a;else if(a<0)for(let e=0;e<s;++e)u[e]=(o+e)/-a;else for(let e=0;e<s;++e)u[e]=(o+e)*a;return u}function kk(e,t,r){return jk(e=+e,t=+t,r=+r)[2]}function Ck(e,t,r){r=+r;const n=(t=+t)<(e=+e),o=n?kk(t,e,r):kk(e,t,r);return(n?-1:1)*(o<0?1/-o:o)}function Ak(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Nk(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Tk(e){let t,r,n;function o(e,n,o=0,i=e.length){if(o<i){if(0!==t(n,n))return i;do{const t=o+i>>>1;r(e[t],n)<0?o=t+1:i=t}while(o<i)}return o}return 2!==e.length?(t=Ak,r=(t,r)=>Ak(e(t),r),n=(t,r)=>e(t)-r):(t=e===Ak||e===Nk?e:Mk,r=e,n=e),{left:o,center:function(e,t,r=0,i=e.length){const a=o(e,t,r,i-1);return a>r&&n(e[a-1],t)>-n(e[a],t)?a-1:a},right:function(e,n,o=0,i=e.length){if(o<i){if(0!==t(n,n))return i;do{const t=o+i>>>1;r(e[t],n)<=0?o=t+1:i=t}while(o<i)}return o}}}function Mk(){return 0}function Rk(e){return null===e?NaN:+e}const Lk=Tk(Ak),Ik=Lk.right,Dk=(Lk.left,Tk(Rk).center,Ik);function Fk(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function zk(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}function Bk(){}var Vk=.7,$k=1/Vk,Uk="\\s*([+-]?\\d+)\\s*",Gk="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Wk="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qk=/^#([0-9a-f]{3,8})$/,Hk=new RegExp(`^rgb\\(${Uk},${Uk},${Uk}\\)$`),Zk=new RegExp(`^rgb\\(${Wk},${Wk},${Wk}\\)$`),Kk=new RegExp(`^rgba\\(${Uk},${Uk},${Uk},${Gk}\\)$`),Yk=new RegExp(`^rgba\\(${Wk},${Wk},${Wk},${Gk}\\)$`),Xk=new RegExp(`^hsl\\(${Gk},${Wk},${Wk}\\)$`),Qk=new RegExp(`^hsla\\(${Gk},${Wk},${Wk},${Gk}\\)$`),Jk={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function eC(){return this.rgb().formatHex()}function tC(){return this.rgb().formatRgb()}function rC(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=qk.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?nC(t):3===r?new aC(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?oC(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?oC(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Hk.exec(e))?new aC(t[1],t[2],t[3],1):(t=Zk.exec(e))?new aC(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Kk.exec(e))?oC(t[1],t[2],t[3],t[4]):(t=Yk.exec(e))?oC(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Xk.exec(e))?dC(t[1],t[2]/100,t[3]/100,1):(t=Qk.exec(e))?dC(t[1],t[2]/100,t[3]/100,t[4]):Jk.hasOwnProperty(e)?nC(Jk[e]):"transparent"===e?new aC(NaN,NaN,NaN,0):null}function nC(e){return new aC(e>>16&255,e>>8&255,255&e,1)}function oC(e,t,r,n){return n<=0&&(e=t=r=NaN),new aC(e,t,r,n)}function iC(e,t,r,n){return 1===arguments.length?function(e){return e instanceof Bk||(e=rC(e)),e?new aC((e=e.rgb()).r,e.g,e.b,e.opacity):new aC}(e):new aC(e,t,r,null==n?1:n)}function aC(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function sC(){return`#${fC(this.r)}${fC(this.g)}${fC(this.b)}`}function uC(){const e=lC(this.opacity);return`${1===e?"rgb(":"rgba("}${cC(this.r)}, ${cC(this.g)}, ${cC(this.b)}${1===e?")":`, ${e})`}`}function lC(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cC(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function fC(e){return((e=cC(e))<16?"0":"")+e.toString(16)}function dC(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new hC(e,t,r,n)}function pC(e){if(e instanceof hC)return new hC(e.h,e.s,e.l,e.opacity);if(e instanceof Bk||(e=rC(e)),!e)return new hC;if(e instanceof hC)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,o=Math.min(t,r,n),i=Math.max(t,r,n),a=NaN,s=i-o,u=(i+o)/2;return s?(a=t===i?(r-n)/s+6*(r<n):r===i?(n-t)/s+2:(t-r)/s+4,s/=u<.5?i+o:2-i-o,a*=60):s=u>0&&u<1?0:a,new hC(a,s,u,e.opacity)}function hC(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function mC(e){return(e=(e||0)%360)<0?e+360:e}function yC(e){return Math.max(0,Math.min(1,e||0))}function vC(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}function gC(e,t,r,n,o){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*r+(1+3*e+3*i-3*a)*n+a*o)/6}Fk(Bk,rC,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:eC,formatHex:eC,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return pC(this).formatHsl()},formatRgb:tC,toString:tC}),Fk(aC,iC,zk(Bk,{brighter(e){return e=null==e?$k:Math.pow($k,e),new aC(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Vk:Math.pow(Vk,e),new aC(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new aC(cC(this.r),cC(this.g),cC(this.b),lC(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:sC,formatHex:sC,formatHex8:function(){return`#${fC(this.r)}${fC(this.g)}${fC(this.b)}${fC(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:uC,toString:uC})),Fk(hC,(function(e,t,r,n){return 1===arguments.length?pC(e):new hC(e,t,r,null==n?1:n)}),zk(Bk,{brighter(e){return e=null==e?$k:Math.pow($k,e),new hC(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Vk:Math.pow(Vk,e),new hC(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,o=2*r-n;return new aC(vC(e>=240?e-240:e+120,o,n),vC(e,o,n),vC(e<120?e+240:e-120,o,n),this.opacity)},clamp(){return new hC(mC(this.h),yC(this.s),yC(this.l),lC(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=lC(this.opacity);return`${1===e?"hsl(":"hsla("}${mC(this.h)}, ${100*yC(this.s)}%, ${100*yC(this.l)}%${1===e?")":`, ${e})`}`}}));const bC=e=>()=>e;function wC(e,t){return function(r){return e+r*t}}function xC(e){return 1==(e=+e)?_C:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):bC(isNaN(t)?r:t)}}function _C(e,t){var r=t-e;return r?wC(e,r):bC(isNaN(e)?t:e)}const OC=function e(t){var r=xC(t);function n(e,t){var n=r((e=iC(e)).r,(t=iC(t)).r),o=r(e.g,t.g),i=r(e.b,t.b),a=_C(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return n.gamma=e,n}(1);function SC(e){return function(t){var r,n,o=t.length,i=new Array(o),a=new Array(o),s=new Array(o);for(r=0;r<o;++r)n=iC(t[r]),i[r]=n.r||0,a[r]=n.g||0,s[r]=n.b||0;return i=e(i),a=e(a),s=e(s),n.opacity=1,function(e){return n.r=i(e),n.g=a(e),n.b=s(e),n+""}}}SC((function(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),o=e[n],i=e[n+1],a=n>0?e[n-1]:2*o-i,s=n<t-1?e[n+2]:2*i-o;return gC((r-n/t)*t,a,o,i,s)}})),SC((function(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),o=e[(n+t-1)%t],i=e[n%t],a=e[(n+1)%t],s=e[(n+2)%t];return gC((r-n/t)*t,o,i,a,s)}}));function EC(e,t){var r,n=t?t.length:0,o=e?Math.min(n,e.length):0,i=new Array(o),a=new Array(n);for(r=0;r<o;++r)i[r]=MC(e[r],t[r]);for(;r<n;++r)a[r]=t[r];return function(e){for(r=0;r<o;++r)a[r]=i[r](e);return a}}function jC(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}function PC(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function kC(e,t){var r,n={},o={};for(r in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)r in e?n[r]=MC(e[r],t[r]):o[r]=t[r];return function(e){for(r in n)o[r]=n[r](e);return o}}var CC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,AC=new RegExp(CC.source,"g");function NC(e,t){var r,n,o,i=CC.lastIndex=AC.lastIndex=0,a=-1,s=[],u=[];for(e+="",t+="";(r=CC.exec(e))&&(n=AC.exec(t));)(o=n.index)>i&&(o=t.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,u.push({i:a,x:PC(r,n)})),i=AC.lastIndex;return i<t.length&&(o=t.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?u[0]?function(e){return function(t){return e(t)+""}}(u[0].x):function(e){return function(){return e}}(t):(t=u.length,function(e){for(var r,n=0;n<t;++n)s[(r=u[n]).i]=r.x(e);return s.join("")})}function TC(e,t){t||(t=[]);var r,n=e?Math.min(t.length,e.length):0,o=t.slice();return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function MC(e,t){var r,n=typeof t;return null==t||"boolean"===n?bC(t):("number"===n?PC:"string"===n?(r=rC(t))?(t=r,OC):NC:t instanceof rC?OC:t instanceof Date?jC:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?TC:Array.isArray(t)?EC:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?kC:PC)(e,t)}function RC(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}function LC(e){return+e}var IC=[0,1];function DC(e){return e}function FC(e,t){return(t-=e=+e)?function(r){return(r-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function zC(e,t,r){var n=e[0],o=e[1],i=t[0],a=t[1];return o<n?(n=FC(o,n),i=r(a,i)):(n=FC(n,o),i=r(i,a)),function(e){return i(n(e))}}function BC(e,t,r){var n=Math.min(e.length,t.length)-1,o=new Array(n),i=new Array(n),a=-1;for(e[n]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++a<n;)o[a]=FC(e[a],e[a+1]),i[a]=r(t[a],t[a+1]);return function(t){var r=Dk(e,t,1,n)-1;return i[r](o[r](t))}}function VC(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function $C(){var e,t,r,n,o,i,a=IC,s=IC,u=MC,l=DC;function c(){var e=Math.min(a.length,s.length);return l!==DC&&(l=function(e,t){var r;return e>t&&(r=e,e=t,t=r),function(r){return Math.max(e,Math.min(t,r))}}(a[0],a[e-1])),n=e>2?BC:zC,o=i=null,f}function f(t){return null==t||isNaN(t=+t)?r:(o||(o=n(a.map(e),s,u)))(e(l(t)))}return f.invert=function(r){return l(t((i||(i=n(s,a.map(e),PC)))(r)))},f.domain=function(e){return arguments.length?(a=Array.from(e,LC),c()):a.slice()},f.range=function(e){return arguments.length?(s=Array.from(e),c()):s.slice()},f.rangeRound=function(e){return s=Array.from(e),u=RC,c()},f.clamp=function(e){return arguments.length?(l=!!e||DC,c()):l!==DC},f.interpolate=function(e){return arguments.length?(u=e,c()):u},f.unknown=function(e){return arguments.length?(r=e,f):r},function(r,n){return e=r,t=n,c()}}function UC(){return $C()(DC,DC)}var GC,WC=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function qC(e){if(!(t=WC.exec(e)))throw new Error("invalid format: "+e);var t;return new HC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function HC(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function ZC(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function KC(e){return(e=ZC(Math.abs(e)))?e[1]:NaN}function YC(e,t){var r=ZC(e,t);if(!r)return e+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}qC.prototype=HC.prototype,HC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const XC={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>YC(100*e,t),r:YC,s:function(e,t){var r=ZC(e,t);if(!r)return e+"";var n=r[0],o=r[1],i=o-(GC=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=n.length;return i===a?n:i>a?n+new Array(i-a+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+ZC(e,Math.max(0,t+i-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function QC(e){return e}var JC,eA,tA,rA=Array.prototype.map,nA=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function oA(e){var t,r,n=void 0===e.grouping||void 0===e.thousands?QC:(t=rA.call(e.grouping,Number),r=e.thousands+"",function(e,n){for(var o=e.length,i=[],a=0,s=t[0],u=0;o>0&&s>0&&(u+s+1>n&&(s=Math.max(1,n-u)),i.push(e.substring(o-=s,o+s)),!((u+=s+1)>n));)s=t[a=(a+1)%t.length];return i.reverse().join(r)}),o=void 0===e.currency?"":e.currency[0]+"",i=void 0===e.currency?"":e.currency[1]+"",a=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?QC:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(rA.call(e.numerals,String)),u=void 0===e.percent?"%":e.percent+"",l=void 0===e.minus?"−":e.minus+"",c=void 0===e.nan?"NaN":e.nan+"";function f(e){var t=(e=qC(e)).fill,r=e.align,f=e.sign,d=e.symbol,p=e.zero,h=e.width,m=e.comma,y=e.precision,v=e.trim,g=e.type;"n"===g?(m=!0,g="g"):XC[g]||(void 0===y&&(y=12),v=!0,g="g"),(p||"0"===t&&"="===r)&&(p=!0,t="0",r="=");var b="$"===d?o:"#"===d&&/[boxX]/.test(g)?"0"+g.toLowerCase():"",w="$"===d?i:/[%p]/.test(g)?u:"",x=XC[g],_=/[defgprs%]/.test(g);function O(e){var o,i,u,d=b,O=w;if("c"===g)O=x(e)+O,e="";else{var S=(e=+e)<0||1/e<0;if(e=isNaN(e)?c:x(Math.abs(e),y),v&&(e=function(e){e:for(var t,r=e.length,n=1,o=-1;n<r;++n)switch(e[n]){case".":o=t=n;break;case"0":0===o&&(o=n),t=n;break;default:if(!+e[n])break e;o>0&&(o=0)}return o>0?e.slice(0,o)+e.slice(t+1):e}(e)),S&&0==+e&&"+"!==f&&(S=!1),d=(S?"("===f?f:l:"-"===f||"("===f?"":f)+d,O=("s"===g?nA[8+GC/3]:"")+O+(S&&"("===f?")":""),_)for(o=-1,i=e.length;++o<i;)if(48>(u=e.charCodeAt(o))||u>57){O=(46===u?a+e.slice(o+1):e.slice(o))+O,e=e.slice(0,o);break}}m&&!p&&(e=n(e,1/0));var E=d.length+e.length+O.length,j=E<h?new Array(h-E+1).join(t):"";switch(m&&p&&(e=n(j+e,j.length?h-O.length:1/0),j=""),r){case"<":e=d+e+O+j;break;case"=":e=d+j+e+O;break;case"^":e=j.slice(0,E=j.length>>1)+d+e+O+j.slice(E);break;default:e=j+d+e+O}return s(e)}return y=void 0===y?6:/[gprs]/.test(g)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),O.toString=function(){return e+""},O}return{format:f,formatPrefix:function(e,t){var r=f(((e=qC(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(KC(t)/3))),o=Math.pow(10,-n),i=nA[8+n/3];return function(e){return r(o*e)+i}}}}function iA(e,t,r,n){var o,i=Ck(e,t,r);switch((n=qC(null==n?",f":n)).type){case"s":var a=Math.max(Math.abs(e),Math.abs(t));return null!=n.precision||isNaN(o=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(KC(t)/3)))-KC(Math.abs(e)))}(i,a))||(n.precision=o),tA(n,a);case"":case"e":case"g":case"p":case"r":null!=n.precision||isNaN(o=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,KC(t)-KC(e))+1}(i,Math.max(Math.abs(e),Math.abs(t))))||(n.precision=o-("e"===n.type));break;case"f":case"%":null!=n.precision||isNaN(o=function(e){return Math.max(0,-KC(Math.abs(e)))}(i))||(n.precision=o-2*("%"===n.type))}return eA(n)}function aA(e){var t=e.domain;return e.ticks=function(e){var r=t();return Pk(r[0],r[r.length-1],null==e?10:e)},e.tickFormat=function(e,r){var n=t();return iA(n[0],n[n.length-1],null==e?10:e,r)},e.nice=function(r){null==r&&(r=10);var n,o,i=t(),a=0,s=i.length-1,u=i[a],l=i[s],c=10;for(l<u&&(o=u,u=l,l=o,o=a,a=s,s=o);c-- >0;){if((o=kk(u,l,r))===n)return i[a]=u,i[s]=l,t(i);if(o>0)u=Math.floor(u/o)*o,l=Math.ceil(l/o)*o;else{if(!(o<0))break;u=Math.ceil(u*o)/o,l=Math.floor(l*o)/o}n=o}return e},e}function sA(){var e=UC();return e.copy=function(){return VC(e,sA())},kP.apply(e,arguments),aA(e)}function uA(e){var t;function r(e){return null==e||isNaN(e=+e)?t:e}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(e=Array.from(t,LC),r):e.slice()},r.unknown=function(e){return arguments.length?(t=e,r):t},r.copy=function(){return uA(e).unknown(t)},e=arguments.length?Array.from(e,LC):[0,1],aA(r)}function lA(e,t){var r,n=0,o=(e=e.slice()).length-1,i=e[n],a=e[o];return a<i&&(r=n,n=o,o=r,r=i,i=a,a=r),e[n]=t.floor(i),e[o]=t.ceil(a),e}function cA(e){return Math.log(e)}function fA(e){return Math.exp(e)}function dA(e){return-Math.log(-e)}function pA(e){return-Math.exp(-e)}function hA(e){return isFinite(e)?+("1e"+e):e<0?0:e}function mA(e){return(t,r)=>-e(-t,r)}function yA(e){const t=e(cA,fA),r=t.domain;let n,o,i=10;function a(){return n=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(i),o=function(e){return 10===e?hA:e===Math.E?Math.exp:t=>Math.pow(e,t)}(i),r()[0]<0?(n=mA(n),o=mA(o),e(dA,pA)):e(cA,fA),t}return t.base=function(e){return arguments.length?(i=+e,a()):i},t.domain=function(e){return arguments.length?(r(e),a()):r()},t.ticks=e=>{const t=r();let a=t[0],s=t[t.length-1];const u=s<a;u&&([a,s]=[s,a]);let l,c,f=n(a),d=n(s);const p=null==e?10:+e;let h=[];if(!(i%1)&&d-f<p){if(f=Math.floor(f),d=Math.ceil(d),a>0){for(;f<=d;++f)for(l=1;l<i;++l)if(c=f<0?l/o(-f):l*o(f),!(c<a)){if(c>s)break;h.push(c)}}else for(;f<=d;++f)for(l=i-1;l>=1;--l)if(c=f>0?l/o(-f):l*o(f),!(c<a)){if(c>s)break;h.push(c)}2*h.length<p&&(h=Pk(a,s,p))}else h=Pk(f,d,Math.min(d-f,p)).map(o);return u?h.reverse():h},t.tickFormat=(e,r)=>{if(null==e&&(e=10),null==r&&(r=10===i?"s":","),"function"!=typeof r&&(i%1||null!=(r=qC(r)).precision||(r.trim=!0),r=eA(r)),e===1/0)return r;const a=Math.max(1,i*e/t.ticks().length);return e=>{let t=e/o(Math.round(n(e)));return t*i<i-.5&&(t*=i),t<=a?r(e):""}},t.nice=()=>r(lA(r(),{floor:e=>o(Math.floor(n(e))),ceil:e=>o(Math.ceil(n(e)))})),t}function vA(){const e=yA($C()).domain([1,10]);return e.copy=()=>VC(e,vA()).base(e.base()),kP.apply(e,arguments),e}function gA(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function bA(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function wA(e){var t=1,r=e(gA(t),bA(t));return r.constant=function(r){return arguments.length?e(gA(t=+r),bA(t)):t},aA(r)}function xA(){var e=wA($C());return e.copy=function(){return VC(e,xA()).constant(e.constant())},kP.apply(e,arguments)}function _A(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function OA(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function SA(e){return e<0?-e*e:e*e}function EA(e){var t=e(DC,DC),r=1;return t.exponent=function(t){return arguments.length?1===(r=+t)?e(DC,DC):.5===r?e(OA,SA):e(_A(r),_A(1/r)):r},aA(t)}function jA(){var e=EA($C());return e.copy=function(){return VC(e,jA()).exponent(e.exponent())},kP.apply(e,arguments),e}function PA(){return jA.apply(null,arguments).exponent(.5)}function kA(e){return Math.sign(e)*e*e}function CA(){var e,t=UC(),r=[0,1],n=!1;function o(r){var o=function(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}(t(r));return isNaN(o)?e:n?Math.round(o):o}return o.invert=function(e){return t.invert(kA(e))},o.domain=function(e){return arguments.length?(t.domain(e),o):t.domain()},o.range=function(e){return arguments.length?(t.range((r=Array.from(e,LC)).map(kA)),o):r.slice()},o.rangeRound=function(e){return o.range(e).round(!0)},o.round=function(e){return arguments.length?(n=!!e,o):n},o.clamp=function(e){return arguments.length?(t.clamp(e),o):t.clamp()},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return CA(t.domain(),r).round(n).clamp(t.clamp()).unknown(e)},kP.apply(o,arguments),aA(o)}function AA(e,t){let r;if(void 0===t)for(const t of e)null!=t&&(r<t||void 0===r&&t>=t)&&(r=t);else{let n=-1;for(let o of e)null!=(o=t(o,++n,e))&&(r<o||void 0===r&&o>=o)&&(r=o)}return r}function NA(e,t){let r;if(void 0===t)for(const t of e)null!=t&&(r>t||void 0===r&&t>=t)&&(r=t);else{let n=-1;for(let o of e)null!=(o=t(o,++n,e))&&(r>o||void 0===r&&o>=o)&&(r=o)}return r}function TA(e=Ak){if(e===Ak)return MA;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||0===n?n:(0===e(r,r))-(0===e(t,t))}}function MA(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:e>t?1:0)}function RA(e,t,r=0,n=1/0,o){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(o=void 0===o?MA:TA(o);n>r;){if(n-r>600){const i=n-r+1,a=t-r+1,s=Math.log(i),u=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*u*(i-u)/i)*(a-i/2<0?-1:1);RA(e,t,Math.max(r,Math.floor(t-a*u/i+l)),Math.min(n,Math.floor(t+(i-a)*u/i+l)),o)}const i=e[t];let a=r,s=n;for(LA(e,r,t),o(e[n],i)>0&&LA(e,r,n);a<s;){for(LA(e,a,s),++a,--s;o(e[a],i)<0;)++a;for(;o(e[s],i)>0;)--s}0===o(e[r],i)?LA(e,r,s):(++s,LA(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function LA(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function IA(e,t,r){if(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let r=-1;for(let n of e)null!=(n=t(n,++r,e))&&(n=+n)>=n&&(yield n)}}(e,r)),(n=e.length)&&!isNaN(t=+t)){if(t<=0||n<2)return NA(e);if(t>=1)return AA(e);var n,o=(n-1)*t,i=Math.floor(o),a=AA(RA(e,i).subarray(0,i+1));return a+(NA(e.subarray(i+1))-a)*(o-i)}}function DA(e,t,r=Rk){if((n=e.length)&&!isNaN(t=+t)){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,o=(n-1)*t,i=Math.floor(o),a=+r(e[i],i,e);return a+(+r(e[i+1],i+1,e)-a)*(o-i)}}function FA(){var e,t=[],r=[],n=[];function o(){var e=0,o=Math.max(1,r.length);for(n=new Array(o-1);++e<o;)n[e-1]=DA(t,e/o);return i}function i(t){return null==t||isNaN(t=+t)?e:r[Dk(n,t)]}return i.invertExtent=function(e){var o=r.indexOf(e);return o<0?[NaN,NaN]:[o>0?n[o-1]:t[0],o<n.length?n[o]:t[t.length-1]]},i.domain=function(e){if(!arguments.length)return t.slice();t=[];for(let r of e)null==r||isNaN(r=+r)||t.push(r);return t.sort(Ak),o()},i.range=function(e){return arguments.length?(r=Array.from(e),o()):r.slice()},i.unknown=function(t){return arguments.length?(e=t,i):e},i.quantiles=function(){return n.slice()},i.copy=function(){return FA().domain(t).range(r).unknown(e)},kP.apply(i,arguments)}function zA(){var e,t=0,r=1,n=1,o=[.5],i=[0,1];function a(t){return null!=t&&t<=t?i[Dk(o,t,0,n)]:e}function s(){var e=-1;for(o=new Array(n);++e<n;)o[e]=((e+1)*r-(e-n)*t)/(n+1);return a}return a.domain=function(e){return arguments.length?([t,r]=e,t=+t,r=+r,s()):[t,r]},a.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},a.invertExtent=function(e){var a=i.indexOf(e);return a<0?[NaN,NaN]:a<1?[t,o[0]]:a>=n?[o[n-1],r]:[o[a-1],o[a]]},a.unknown=function(t){return arguments.length?(e=t,a):a},a.thresholds=function(){return o.slice()},a.copy=function(){return zA().domain([t,r]).range(i).unknown(e)},kP.apply(aA(a),arguments)}function BA(){var e,t=[.5],r=[0,1],n=1;function o(o){return null!=o&&o<=o?r[Dk(t,o,0,n)]:e}return o.domain=function(e){return arguments.length?(t=Array.from(e),n=Math.min(t.length,r.length-1),o):t.slice()},o.range=function(e){return arguments.length?(r=Array.from(e),n=Math.min(t.length,r.length-1),o):r.slice()},o.invertExtent=function(e){var n=r.indexOf(e);return[t[n-1],t[n]]},o.unknown=function(t){return arguments.length?(e=t,o):e},o.copy=function(){return BA().domain(t).range(r).unknown(e)},kP.apply(o,arguments)}JC=oA({thousands:",",grouping:[3],currency:["$",""]}),eA=JC.format,tA=JC.formatPrefix;const VA=1e3,$A=6e4,UA=36e5,GA=864e5,WA=6048e5,qA=2592e6,HA=31536e6,ZA=new Date,KA=new Date;function YA(e,t,r,n){function o(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return o.floor=t=>(e(t=new Date(+t)),t),o.ceil=r=>(e(r=new Date(r-1)),t(r,1),e(r),r),o.round=e=>{const t=o(e),r=o.ceil(e);return e-t<r-e?t:r},o.offset=(e,r)=>(t(e=new Date(+e),null==r?1:Math.floor(r)),e),o.range=(r,n,i)=>{const a=[];if(r=o.ceil(r),i=null==i?1:Math.floor(i),!(r<n&&i>0))return a;let s;do{a.push(s=new Date(+r)),t(r,i),e(r)}while(s<r&&r<n);return a},o.filter=r=>YA((t=>{if(t>=t)for(;e(t),!r(t);)t.setTime(t-1)}),((e,n)=>{if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!r(e););else for(;--n>=0;)for(;t(e,1),!r(e););})),r&&(o.count=(t,n)=>(ZA.setTime(+t),KA.setTime(+n),e(ZA),e(KA),Math.floor(r(ZA,KA))),o.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?o.filter(n?t=>n(t)%e==0:t=>o.count(0,t)%e==0):o:null)),o}const XA=YA((()=>{}),((e,t)=>{e.setTime(+e+t)}),((e,t)=>t-e));XA.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?YA((t=>{t.setTime(Math.floor(t/e)*e)}),((t,r)=>{t.setTime(+t+r*e)}),((t,r)=>(r-t)/e)):XA:null);XA.range;const QA=YA((e=>{e.setTime(e-e.getMilliseconds())}),((e,t)=>{e.setTime(+e+t*VA)}),((e,t)=>(t-e)/VA),(e=>e.getUTCSeconds())),JA=(QA.range,YA((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*VA)}),((e,t)=>{e.setTime(+e+t*$A)}),((e,t)=>(t-e)/$A),(e=>e.getMinutes()))),eN=(JA.range,YA((e=>{e.setUTCSeconds(0,0)}),((e,t)=>{e.setTime(+e+t*$A)}),((e,t)=>(t-e)/$A),(e=>e.getUTCMinutes()))),tN=(eN.range,YA((e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*VA-e.getMinutes()*$A)}),((e,t)=>{e.setTime(+e+t*UA)}),((e,t)=>(t-e)/UA),(e=>e.getHours()))),rN=(tN.range,YA((e=>{e.setUTCMinutes(0,0,0)}),((e,t)=>{e.setTime(+e+t*UA)}),((e,t)=>(t-e)/UA),(e=>e.getUTCHours()))),nN=(rN.range,YA((e=>e.setHours(0,0,0,0)),((e,t)=>e.setDate(e.getDate()+t)),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*$A)/GA),(e=>e.getDate()-1))),oN=(nN.range,YA((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/GA),(e=>e.getUTCDate()-1))),iN=(oN.range,YA((e=>{e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+t)}),((e,t)=>(t-e)/GA),(e=>Math.floor(e/GA))));iN.range;function aN(e){return YA((t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),((e,t)=>{e.setDate(e.getDate()+7*t)}),((e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*$A)/WA))}const sN=aN(0),uN=aN(1),lN=aN(2),cN=aN(3),fN=aN(4),dN=aN(5),pN=aN(6);sN.range,uN.range,lN.range,cN.range,fN.range,dN.range,pN.range;function hN(e){return YA((t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)}),((e,t)=>(t-e)/WA))}const mN=hN(0),yN=hN(1),vN=hN(2),gN=hN(3),bN=hN(4),wN=hN(5),xN=hN(6),_N=(mN.range,yN.range,vN.range,gN.range,bN.range,wN.range,xN.range,YA((e=>{e.setDate(1),e.setHours(0,0,0,0)}),((e,t)=>{e.setMonth(e.getMonth()+t)}),((e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())),(e=>e.getMonth()))),ON=(_N.range,YA((e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)}),((e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())),(e=>e.getUTCMonth()))),SN=(ON.range,YA((e=>{e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,t)=>{e.setFullYear(e.getFullYear()+t)}),((e,t)=>t.getFullYear()-e.getFullYear()),(e=>e.getFullYear())));SN.every=e=>isFinite(e=Math.floor(e))&&e>0?YA((t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,r)=>{t.setFullYear(t.getFullYear()+r*e)})):null;SN.range;const EN=YA((e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)}),((e,t)=>t.getUTCFullYear()-e.getUTCFullYear()),(e=>e.getUTCFullYear()));EN.every=e=>isFinite(e=Math.floor(e))&&e>0?YA((t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null;EN.range;function jN(e,t,r,n,o,i){const a=[[QA,1,VA],[QA,5,5e3],[QA,15,15e3],[QA,30,3e4],[i,1,$A],[i,5,3e5],[i,15,9e5],[i,30,18e5],[o,1,UA],[o,3,108e5],[o,6,216e5],[o,12,432e5],[n,1,GA],[n,2,1728e5],[r,1,WA],[t,1,qA],[t,3,7776e6],[e,1,HA]];function s(t,r,n){const o=Math.abs(r-t)/n,i=Tk((([,,e])=>e)).right(a,o);if(i===a.length)return e.every(Ck(t/HA,r/HA,n));if(0===i)return XA.every(Math.max(Ck(t,r,n),1));const[s,u]=a[o/a[i-1][2]<a[i][2]/o?i-1:i];return s.every(u)}return[function(e,t,r){const n=t<e;n&&([e,t]=[t,e]);const o=r&&"function"==typeof r.range?r:s(e,t,r),i=o?o.range(e,+t+1):[];return n?i.reverse():i},s]}const[PN,kN]=jN(EN,ON,mN,iN,rN,eN),[CN,AN]=jN(SN,_N,sN,nN,tN,JA);function NN(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function TN(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function MN(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}var RN,LN,IN,DN={"-":"",_:" ",0:"0"},FN=/^\s*\d+/,zN=/^%/,BN=/[\\^$*+?|[\]().{}]/g;function VN(e,t,r){var n=e<0?"-":"",o=(n?-e:e)+"",i=o.length;return n+(i<r?new Array(r-i+1).join(t)+o:o)}function $N(e){return e.replace(BN,"\\$&")}function UN(e){return new RegExp("^(?:"+e.map($N).join("|")+")","i")}function GN(e){return new Map(e.map(((e,t)=>[e.toLowerCase(),t])))}function WN(e,t,r){var n=FN.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function qN(e,t,r){var n=FN.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function HN(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function ZN(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function KN(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function YN(e,t,r){var n=FN.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function XN(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function QN(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function JN(e,t,r){var n=FN.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function eT(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function tT(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function rT(e,t,r){var n=FN.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function nT(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function oT(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function iT(e,t,r){var n=FN.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function aT(e,t,r){var n=FN.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function sT(e,t,r){var n=FN.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function uT(e,t,r){var n=zN.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function lT(e,t,r){var n=FN.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function cT(e,t,r){var n=FN.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function fT(e,t){return VN(e.getDate(),t,2)}function dT(e,t){return VN(e.getHours(),t,2)}function pT(e,t){return VN(e.getHours()%12||12,t,2)}function hT(e,t){return VN(1+nN.count(SN(e),e),t,3)}function mT(e,t){return VN(e.getMilliseconds(),t,3)}function yT(e,t){return mT(e,t)+"000"}function vT(e,t){return VN(e.getMonth()+1,t,2)}function gT(e,t){return VN(e.getMinutes(),t,2)}function bT(e,t){return VN(e.getSeconds(),t,2)}function wT(e){var t=e.getDay();return 0===t?7:t}function xT(e,t){return VN(sN.count(SN(e)-1,e),t,2)}function _T(e){var t=e.getDay();return t>=4||0===t?fN(e):fN.ceil(e)}function OT(e,t){return e=_T(e),VN(fN.count(SN(e),e)+(4===SN(e).getDay()),t,2)}function ST(e){return e.getDay()}function ET(e,t){return VN(uN.count(SN(e)-1,e),t,2)}function jT(e,t){return VN(e.getFullYear()%100,t,2)}function PT(e,t){return VN((e=_T(e)).getFullYear()%100,t,2)}function kT(e,t){return VN(e.getFullYear()%1e4,t,4)}function CT(e,t){var r=e.getDay();return VN((e=r>=4||0===r?fN(e):fN.ceil(e)).getFullYear()%1e4,t,4)}function AT(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+VN(t/60|0,"0",2)+VN(t%60,"0",2)}function NT(e,t){return VN(e.getUTCDate(),t,2)}function TT(e,t){return VN(e.getUTCHours(),t,2)}function MT(e,t){return VN(e.getUTCHours()%12||12,t,2)}function RT(e,t){return VN(1+oN.count(EN(e),e),t,3)}function LT(e,t){return VN(e.getUTCMilliseconds(),t,3)}function IT(e,t){return LT(e,t)+"000"}function DT(e,t){return VN(e.getUTCMonth()+1,t,2)}function FT(e,t){return VN(e.getUTCMinutes(),t,2)}function zT(e,t){return VN(e.getUTCSeconds(),t,2)}function BT(e){var t=e.getUTCDay();return 0===t?7:t}function VT(e,t){return VN(mN.count(EN(e)-1,e),t,2)}function $T(e){var t=e.getUTCDay();return t>=4||0===t?bN(e):bN.ceil(e)}function UT(e,t){return e=$T(e),VN(bN.count(EN(e),e)+(4===EN(e).getUTCDay()),t,2)}function GT(e){return e.getUTCDay()}function WT(e,t){return VN(yN.count(EN(e)-1,e),t,2)}function qT(e,t){return VN(e.getUTCFullYear()%100,t,2)}function HT(e,t){return VN((e=$T(e)).getUTCFullYear()%100,t,2)}function ZT(e,t){return VN(e.getUTCFullYear()%1e4,t,4)}function KT(e,t){var r=e.getUTCDay();return VN((e=r>=4||0===r?bN(e):bN.ceil(e)).getUTCFullYear()%1e4,t,4)}function YT(){return"+0000"}function XT(){return"%"}function QT(e){return+e}function JT(e){return Math.floor(+e/1e3)}function eM(e){return new Date(e)}function tM(e){return e instanceof Date?+e:+new Date(+e)}function rM(e,t,r,n,o,i,a,s,u,l){var c=UC(),f=c.invert,d=c.domain,p=l(".%L"),h=l(":%S"),m=l("%I:%M"),y=l("%I %p"),v=l("%a %d"),g=l("%b %d"),b=l("%B"),w=l("%Y");function x(e){return(u(e)<e?p:s(e)<e?h:a(e)<e?m:i(e)<e?y:n(e)<e?o(e)<e?v:g:r(e)<e?b:w)(e)}return c.invert=function(e){return new Date(f(e))},c.domain=function(e){return arguments.length?d(Array.from(e,tM)):d().map(eM)},c.ticks=function(t){var r=d();return e(r[0],r[r.length-1],null==t?10:t)},c.tickFormat=function(e,t){return null==t?x:l(t)},c.nice=function(e){var r=d();return e&&"function"==typeof e.range||(e=t(r[0],r[r.length-1],null==e?10:e)),e?d(lA(r,e)):c},c.copy=function(){return VC(c,rM(e,t,r,n,o,i,a,s,u,l))},c}function nM(){return kP.apply(rM(CN,AN,SN,_N,sN,nN,tN,JA,QA,LN).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function oM(){return kP.apply(rM(PN,kN,EN,ON,mN,oN,rN,eN,QA,IN).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function iM(){var e,t,r,n,o,i=0,a=1,s=DC,u=!1;function l(t){return null==t||isNaN(t=+t)?o:s(0===r?.5:(t=(n(t)-e)*r,u?Math.max(0,Math.min(1,t)):t))}function c(e){return function(t){var r,n;return arguments.length?([r,n]=t,s=e(r,n),l):[s(0),s(1)]}}return l.domain=function(o){return arguments.length?([i,a]=o,e=n(i=+i),t=n(a=+a),r=e===t?0:1/(t-e),l):[i,a]},l.clamp=function(e){return arguments.length?(u=!!e,l):u},l.interpolator=function(e){return arguments.length?(s=e,l):s},l.range=c(MC),l.rangeRound=c(RC),l.unknown=function(e){return arguments.length?(o=e,l):o},function(o){return n=o,e=o(i),t=o(a),r=e===t?0:1/(t-e),l}}function aM(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function sM(){var e=aA(iM()(DC));return e.copy=function(){return aM(e,sM())},CP.apply(e,arguments)}function uM(){var e=yA(iM()).domain([1,10]);return e.copy=function(){return aM(e,uM()).base(e.base())},CP.apply(e,arguments)}function lM(){var e=wA(iM());return e.copy=function(){return aM(e,lM()).constant(e.constant())},CP.apply(e,arguments)}function cM(){var e=EA(iM());return e.copy=function(){return aM(e,cM()).exponent(e.exponent())},CP.apply(e,arguments)}function fM(){return cM.apply(null,arguments).exponent(.5)}function dM(){var e=[],t=DC;function r(r){if(null!=r&&!isNaN(r=+r))return t((Dk(e,r,1)-1)/(e.length-1))}return r.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let r of t)null==r||isNaN(r=+r)||e.push(r);return e.sort(Ak),r},r.interpolator=function(e){return arguments.length?(t=e,r):t},r.range=function(){return e.map(((r,n)=>t(n/(e.length-1))))},r.quantiles=function(t){return Array.from({length:t+1},((r,n)=>IA(e,n/t)))},r.copy=function(){return dM(t).domain(e)},CP.apply(r,arguments)}function pM(){var e,t,r,n,o,i,a,s=0,u=.5,l=1,c=1,f=DC,d=!1;function p(e){return isNaN(e=+e)?a:(e=.5+((e=+i(e))-t)*(c*e<c*t?n:o),f(d?Math.max(0,Math.min(1,e)):e))}function h(e){return function(t){var r,n,o;return arguments.length?([r,n,o]=t,f=function(e,t){void 0===t&&(t=e,e=MC);for(var r=0,n=t.length-1,o=t[0],i=new Array(n<0?0:n);r<n;)i[r]=e(o,o=t[++r]);return function(e){var t=Math.max(0,Math.min(n-1,Math.floor(e*=n)));return i[t](e-t)}}(e,[r,n,o]),p):[f(0),f(.5),f(1)]}}return p.domain=function(a){return arguments.length?([s,u,l]=a,e=i(s=+s),t=i(u=+u),r=i(l=+l),n=e===t?0:.5/(t-e),o=t===r?0:.5/(r-t),c=t<e?-1:1,p):[s,u,l]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(f=e,p):f},p.range=h(MC),p.rangeRound=h(RC),p.unknown=function(e){return arguments.length?(a=e,p):a},function(a){return i=a,e=a(s),t=a(u),r=a(l),n=e===t?0:.5/(t-e),o=t===r?0:.5/(r-t),c=t<e?-1:1,p}}function hM(){var e=aA(pM()(DC));return e.copy=function(){return aM(e,hM())},CP.apply(e,arguments)}function mM(){var e=yA(pM()).domain([.1,1,10]);return e.copy=function(){return aM(e,mM()).base(e.base())},CP.apply(e,arguments)}function yM(){var e=wA(pM());return e.copy=function(){return aM(e,yM()).constant(e.constant())},CP.apply(e,arguments)}function vM(){var e=EA(pM());return e.copy=function(){return aM(e,vM()).exponent(e.exponent())},CP.apply(e,arguments)}function gM(){return vM.apply(null,arguments).exponent(.5)}function bM(e,t){if((o=e.length)>1)for(var r,n,o,i=1,a=e[t[0]],s=a.length;i<o;++i)for(n=a,a=e[t[i]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}!function(e){RN=function(e){var t=e.dateTime,r=e.date,n=e.time,o=e.periods,i=e.days,a=e.shortDays,s=e.months,u=e.shortMonths,l=UN(o),c=GN(o),f=UN(i),d=GN(i),p=UN(a),h=GN(a),m=UN(s),y=GN(s),v=UN(u),g=GN(u),b={a:function(e){return a[e.getDay()]},A:function(e){return i[e.getDay()]},b:function(e){return u[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:fT,e:fT,f:yT,g:PT,G:CT,H:dT,I:pT,j:hT,L:mT,m:vT,M:gT,p:function(e){return o[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:QT,s:JT,S:bT,u:wT,U:xT,V:OT,w:ST,W:ET,x:null,X:null,y:jT,Y:kT,Z:AT,"%":XT},w={a:function(e){return a[e.getUTCDay()]},A:function(e){return i[e.getUTCDay()]},b:function(e){return u[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:NT,e:NT,f:IT,g:HT,G:KT,H:TT,I:MT,j:RT,L:LT,m:DT,M:FT,p:function(e){return o[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:QT,s:JT,S:zT,u:BT,U:VT,V:UT,w:GT,W:WT,x:null,X:null,y:qT,Y:ZT,Z:YT,"%":XT},x={a:function(e,t,r){var n=p.exec(t.slice(r));return n?(e.w=h.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(e,t,r){var n=f.exec(t.slice(r));return n?(e.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(e,t,r){var n=v.exec(t.slice(r));return n?(e.m=g.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(e,t,r){var n=m.exec(t.slice(r));return n?(e.m=y.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(e,r,n){return S(e,t,r,n)},d:tT,e:tT,f:sT,g:XN,G:YN,H:nT,I:nT,j:rT,L:aT,m:eT,M:oT,p:function(e,t,r){var n=l.exec(t.slice(r));return n?(e.p=c.get(n[0].toLowerCase()),r+n[0].length):-1},q:JN,Q:lT,s:cT,S:iT,u:qN,U:HN,V:ZN,w:WN,W:KN,x:function(e,t,n){return S(e,r,t,n)},X:function(e,t,r){return S(e,n,t,r)},y:XN,Y:YN,Z:QN,"%":uT};function _(e,t){return function(r){var n,o,i,a=[],s=-1,u=0,l=e.length;for(r instanceof Date||(r=new Date(+r));++s<l;)37===e.charCodeAt(s)&&(a.push(e.slice(u,s)),null!=(o=DN[n=e.charAt(++s)])?n=e.charAt(++s):o="e"===n?" ":"0",(i=t[n])&&(n=i(r,o)),a.push(n),u=s+1);return a.push(e.slice(u,s)),a.join("")}}function O(e,t){return function(r){var n,o,i=MN(1900,void 0,1);if(S(i,e,r+="",0)!=r.length)return null;if("Q"in i)return new Date(i.Q);if("s"in i)return new Date(1e3*i.s+("L"in i?i.L:0));if(t&&!("Z"in i)&&(i.Z=0),"p"in i&&(i.H=i.H%12+12*i.p),void 0===i.m&&(i.m="q"in i?i.q:0),"V"in i){if(i.V<1||i.V>53)return null;"w"in i||(i.w=1),"Z"in i?(o=(n=TN(MN(i.y,0,1))).getUTCDay(),n=o>4||0===o?yN.ceil(n):yN(n),n=oN.offset(n,7*(i.V-1)),i.y=n.getUTCFullYear(),i.m=n.getUTCMonth(),i.d=n.getUTCDate()+(i.w+6)%7):(o=(n=NN(MN(i.y,0,1))).getDay(),n=o>4||0===o?uN.ceil(n):uN(n),n=nN.offset(n,7*(i.V-1)),i.y=n.getFullYear(),i.m=n.getMonth(),i.d=n.getDate()+(i.w+6)%7)}else("W"in i||"U"in i)&&("w"in i||(i.w="u"in i?i.u%7:"W"in i?1:0),o="Z"in i?TN(MN(i.y,0,1)).getUTCDay():NN(MN(i.y,0,1)).getDay(),i.m=0,i.d="W"in i?(i.w+6)%7+7*i.W-(o+5)%7:i.w+7*i.U-(o+6)%7);return"Z"in i?(i.H+=i.Z/100|0,i.M+=i.Z%100,TN(i)):NN(i)}}function S(e,t,r,n){for(var o,i,a=0,s=t.length,u=r.length;a<s;){if(n>=u)return-1;if(37===(o=t.charCodeAt(a++))){if(o=t.charAt(a++),!(i=x[o in DN?t.charAt(a++):o])||(n=i(e,r,n))<0)return-1}else if(o!=r.charCodeAt(n++))return-1}return n}return b.x=_(r,b),b.X=_(n,b),b.c=_(t,b),w.x=_(r,w),w.X=_(n,w),w.c=_(t,w),{format:function(e){var t=_(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=O(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=_(e+="",w);return t.toString=function(){return e},t},utcParse:function(e){var t=O(e+="",!0);return t.toString=function(){return e},t}}}(e),LN=RN.format,RN.parse,IN=RN.utcFormat,RN.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Array.prototype.slice;function wM(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function xM(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function _M(e,t){return e[t]}function OM(e){const t=[];return t.key=e,t}var SM=o(4506),EM=o.n(SM),jM=o(1684),PM=o.n(jM),kM=o(7307),CM=o.n(kM),AM=o(2404),NM=o.n(AM),TM=o(8351),MM=o.n(TM);function RM(e){return function(e){if(Array.isArray(e))return LM(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return LM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return LM(e,t)}(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.")}()}function LM(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var IM=function(e){return e},DM={"@@functional/placeholder":!0},FM=function(e){return e===DM},zM=function(e){return function t(){return 0===arguments.length||1===arguments.length&&FM(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},BM=function e(t,r){return 1===t?r:zM((function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var a=o.filter((function(e){return e!==DM})).length;return a>=t?r.apply(void 0,o):e(t-a,zM((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=o.map((function(e){return FM(e)?t.shift():e}));return r.apply(void 0,RM(i).concat(t))})))}))},VM=function(e){return BM(e.length,e)},$M=function(e,t){for(var r=[],n=e;n<t;++n)r[n-e]=n;return r},UM=VM((function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map((function(e){return t[e]})).map(e)})),GM=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.length)return IM;var n=t.reverse(),o=n[0],i=n.slice(1);return function(){return i.reduce((function(e,t){return t(e)}),o.apply(void 0,arguments))}},WM=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},qM=function(e){var t=null,r=null;return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return t&&o.every((function(e,r){return e===t[r]}))?r:(t=o,r=e.apply(void 0,o))}};var HM=VM((function(e,t,r){var n=+e;return n+r*(+t-n)})),ZM=VM((function(e,t,r){var n=t-+e;return(r-e)/(n=n||1/0)})),KM=VM((function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))}));const YM={rangeStep:function(e,t,r){for(var n=new(MM())(e),o=0,i=[];n.lt(t)&&o<1e5;)i.push(n.toNumber()),n=n.add(r),o++;return i},getDigitCount:function(e){return 0===e?1:Math.floor(new(MM())(e).abs().log(10).toNumber())+1},interpolateNumber:HM,uninterpolateNumber:ZM,uninterpolateTruncation:KM};function XM(e){return function(e){if(Array.isArray(e))return eR(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||JM(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.")}()}function QM(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(o)throw i}}return r}(e,t)||JM(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.")}()}function JM(e,t){if(e){if("string"==typeof e)return eR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?eR(e,t):void 0}}function eR(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function tR(e){var t=QM(e,2),r=t[0],n=t[1],o=r,i=n;return r>n&&(o=n,i=r),[o,i]}function rR(e,t,r){if(e.lte(0))return new(MM())(0);var n=YM.getDigitCount(e.toNumber()),o=new(MM())(10).pow(n),i=e.div(o),a=1!==n?.05:.1,s=new(MM())(Math.ceil(i.div(a).toNumber())).add(r).mul(a).mul(o);return t?s:new(MM())(Math.ceil(s))}function nR(e,t,r){var n=1,o=new(MM())(e);if(!o.isint()&&r){var i=Math.abs(e);i<1?(n=new(MM())(10).pow(YM.getDigitCount(e)-1),o=new(MM())(Math.floor(o.div(n).toNumber())).mul(n)):i>1&&(o=new(MM())(Math.floor(e)))}else 0===e?o=new(MM())(Math.floor((t-1)/2)):r||(o=new(MM())(Math.floor(e)));var a=Math.floor((t-1)/2),s=GM(UM((function(e){return o.add(new(MM())(e-a).mul(n)).toNumber()})),$M);return s(0,t)}function oR(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new(MM())(0),tickMin:new(MM())(0),tickMax:new(MM())(0)};var i,a=rR(new(MM())(t).sub(e).div(r-1),n,o);i=e<=0&&t>=0?new(MM())(0):(i=new(MM())(e).add(t).div(2)).sub(new(MM())(i).mod(a));var s=Math.ceil(i.sub(e).div(a).toNumber()),u=Math.ceil(new(MM())(t).sub(i).div(a).toNumber()),l=s+u+1;return l>r?oR(e,t,r,n,o+1):(l<r&&(u=t>0?u+(r-l):u,s=t>0?s:s+(r-l)),{step:a,tickMin:i.sub(new(MM())(s).mul(a)),tickMax:i.add(new(MM())(u).mul(a))})}var iR=qM((function(e){var t=QM(e,2),r=t[0],n=t[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=Math.max(o,2),s=QM(tR([r,n]),2),u=s[0],l=s[1];if(u===-1/0||l===1/0){var c=l===1/0?[u].concat(XM($M(0,o-1).map((function(){return 1/0})))):[].concat(XM($M(0,o-1).map((function(){return-1/0}))),[l]);return r>n?WM(c):c}if(u===l)return nR(u,o,i);var f=oR(u,l,a,i),d=f.step,p=f.tickMin,h=f.tickMax,m=YM.rangeStep(p,h.add(new(MM())(.1).mul(d)),d);return r>n?WM(m):m})),aR=(qM((function(e){var t=QM(e,2),r=t[0],n=t[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=Math.max(o,2),s=QM(tR([r,n]),2),u=s[0],l=s[1];if(u===-1/0||l===1/0)return[r,n];if(u===l)return nR(u,o,i);var c=rR(new(MM())(l).sub(u).div(a-1),i,0),f=GM(UM((function(e){return new(MM())(u).add(new(MM())(e).mul(c)).toNumber()})),$M),d=f(0,a).filter((function(e){return e>=u&&e<=l}));return r>n?WM(d):d})),qM((function(e,t){var r=QM(e,2),n=r[0],o=r[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=QM(tR([n,o]),2),s=a[0],u=a[1];if(s===-1/0||u===1/0)return[n,o];if(s===u)return[s];var l=Math.max(t,2),c=rR(new(MM())(u).sub(s).div(l-1),i,0),f=[].concat(XM(YM.rangeStep(new(MM())(s),new(MM())(u).sub(new(MM())(.99).mul(c)),c)),[u]);return n>o?WM(f):f}))),sR=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function uR(e){return uR="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},uR(e)}function lR(){return lR=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lR.apply(this,arguments)}function cR(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fR(e,t)}(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.")}()}function fR(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dR(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function pR(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bR(n.key),n)}}function hR(e,t,r){return t=yR(t),function(e,t){if(t&&("object"===uR(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,mR()?Reflect.construct(t,r||[],yR(e).constructor):t.apply(e,r))}function mR(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(mR=function(){return!!e})()}function yR(e){return yR=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yR(e)}function vR(e,t){return vR=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vR(e,t)}function gR(e,t,r){return(t=bR(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bR(e){var t=function(e,t){if("object"!=uR(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=uR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==uR(t)?t:t+""}var wR=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),hR(this,t,arguments)}return function(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&&vR(e,t)}(t,e),r=t,n=[{key:"render",value:function(){var e=this.props,t=e.offset,r=e.layout,n=e.width,o=e.dataKey,a=e.data,s=e.dataPointFormatter,u=e.xAxis,l=e.yAxis,c=dR(e,sR),f=pO(c,!1);"x"===this.props.direction&&"number"!==u.type&&CO(!1);var d=a.map((function(e){var a=s(e,o),c=a.x,d=a.y,p=a.value,h=a.errorVal;if(!h)return null;var m,y,v=[];if(Array.isArray(h)){var g=cR(h,2);m=g[0],y=g[1]}else m=y=h;if("vertical"===r){var b=u.scale,w=d+t,x=w+n,_=w-n,O=b(p-m),S=b(p+y);v.push({x1:S,y1:x,x2:S,y2:_}),v.push({x1:O,y1:w,x2:S,y2:w}),v.push({x1:O,y1:x,x2:O,y2:_})}else if("horizontal"===r){var E=l.scale,j=c+t,P=j-n,k=j+n,C=E(p-m),A=E(p+y);v.push({x1:P,y1:A,x2:k,y2:A}),v.push({x1:j,y1:C,x2:j,y2:A}),v.push({x1:P,y1:C,x2:k,y2:C})}return i().createElement(DO,lR({className:"recharts-errorBar",key:"bar-".concat(v.map((function(e){return"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)})))},f),v.map((function(e){return i().createElement("line",lR({},e,{key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))})))}));return i().createElement(DO,{className:"recharts-errorBars"},d)}}],n&&pR(r.prototype,n),o&&pR(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(i().Component);function xR(e){return xR="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},xR(e)}function _R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function OR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_R(Object(r),!0).forEach((function(t){SR(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_R(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function SR(e,t,r){return t=function(e){var t=function(e,t){if("object"!=xR(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=xR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==xR(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}gR(wR,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"}),gR(wR,"displayName","ErrorBar");var ER=function(e){var t=e.children,r=e.formattedGraphicalItems,n=e.legendWidth,o=e.legendContent,i=lO(t,zE);if(!i)return null;var a,s=zE.defaultProps,u=void 0!==s?OR(OR({},s),i.props):{};return a=i.props&&i.props.payload?i.props&&i.props.payload:"children"===o?(r||[]).reduce((function(e,t){var r=t.item,n=t.props,o=n.sectors||n.data||[];return e.concat(o.map((function(e){return{type:i.props.iconType||r.props.legendType,value:e.name,color:e.fill,payload:e}})))}),[]):(r||[]).map((function(e){var t=e.item,r=t.type.defaultProps,n=void 0!==r?OR(OR({},r),t.props):{},o=n.dataKey,i=n.name,a=n.legendType;return{inactive:n.hide,dataKey:o,type:u.iconType||a||"square",color:RR(t),value:i||o,payload:n}})),OR(OR(OR({},u),zE.getWithHeight(i,n)),{},{payload:a,item:i})};function jR(e){return jR="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},jR(e)}function PR(e){return function(e){if(Array.isArray(e))return kR(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return kR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kR(e,t)}(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.")}()}function kR(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function CR(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function AR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?CR(Object(r),!0).forEach((function(t){NR(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CR(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function NR(e,t,r){return t=function(e){var t=function(e,t){if("object"!=jR(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=jR(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jR(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TR(e,t,r){return z_()(e)||z_()(t)?r:A_(t)?S_()(e,t,r):V_()(t)?t(e):r}function MR(e,t,r,n){var o=CM()(e,(function(e){return TR(e,t)}));if("number"===r){var i=o.filter((function(e){return C_(e)||parseFloat(e)}));return i.length?[PM()(i),EM()(i)]:[1/0,-1/0]}return(n?o.filter((function(e){return!z_()(e)})):o).map((function(e){return A_(e)||e instanceof Date?e:""}))}var RR=function(e){var t,r,n=e.type.displayName,o=null!==(t=e.type)&&void 0!==t&&t.defaultProps?AR(AR({},e.type.defaultProps),e.props):e.props,i=o.stroke,a=o.fill;switch(n){case"Line":r=i;break;case"Area":case"Radar":r=i&&"none"!==i?i:a;break;default:r=a}return r},LR=function(e,t,r,n,o){var i=uO(t.props.children,wR).filter((function(e){return function(e,t,r){return!!z_()(t)||("horizontal"===e?"yAxis"===t:"vertical"===e||"x"===r?"xAxis"===t:"y"!==r||"yAxis"===t)}(n,o,e.props.direction)}));if(i&&i.length){var a=i.map((function(e){return e.props.dataKey}));return e.reduce((function(e,t){var n=TR(t,r);if(z_()(n))return e;var o=Array.isArray(n)?[PM()(n),EM()(n)]:[n,n],i=a.reduce((function(e,r){var n=TR(t,r,0),i=o[0]-Math.abs(Array.isArray(n)?n[0]:n),a=o[1]+Math.abs(Array.isArray(n)?n[1]:n);return[Math.min(i,e[0]),Math.max(a,e[1])]}),[1/0,-1/0]);return[Math.min(i[0],e[0]),Math.max(i[1],e[1])]}),[1/0,-1/0])}return null},IR=function(e,t,r,n,o){var i=t.map((function(t){var i=t.props.dataKey;return"number"===r&&i&&LR(e,t,i,n)||MR(e,i,r,o)}));if("number"===r)return i.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]);var a={};return i.reduce((function(e,t){for(var r=0,n=t.length;r<n;r++)a[t[r]]||(a[t[r]]=!0,e.push(t[r]));return e}),[])},DR=function(e,t){return"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t},FR=function(e,t,r,n){if(n)return e.map((function(e){return e.coordinate}));var o,i,a=e.map((function(e){return e.coordinate===t&&(o=!0),e.coordinate===r&&(i=!0),e.coordinate}));return o||a.push(t),i||a.push(r),a},zR=function(e,t,r){if(!e)return null;var n=e.scale,o=e.duplicateDomain,i=e.type,a=e.range,s="scaleBand"===e.realScaleType?n.bandwidth()/2:2,u=(t||r)&&"category"===i&&n.bandwidth?n.bandwidth()/s:0;return u="angleAxis"===e.axisType&&(null==a?void 0:a.length)>=2?2*P_(a[0]-a[1])*u:u,t&&(e.ticks||e.niceTicks)?(e.ticks||e.niceTicks).map((function(e){var t=o?o.indexOf(e):e;return{coordinate:n(t)+u,value:e,offset:u}})).filter((function(e){return!__()(e.coordinate)})):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map((function(e,t){return{coordinate:n(e)+u,value:e,index:t,offset:u}})):n.ticks&&!r?n.ticks(e.tickCount).map((function(e){return{coordinate:n(e)+u,value:e,offset:u}})):n.domain().map((function(e,t){return{coordinate:n(e)+u,value:o?o[e]:e,index:t,offset:u}}))},BR=new WeakMap,VR=function(e,t){if("function"!=typeof t)return e;BR.has(e)||BR.set(e,new WeakMap);var r=BR.get(e);if(r.has(t))return r.get(t);var n=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return r.set(t,n),n},$R=1e-4,UR={sign:function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var o=0,i=0,a=0;a<t;++a){var s=__()(e[a][r][1])?e[a][r][0]:e[a][r][1];s>=0?(e[a][r][0]=o,e[a][r][1]=o+s,o=e[a][r][1]):(e[a][r][0]=i,e[a][r][1]=i+s,i=e[a][r][1])}},expand:function(e,t){if((n=e.length)>0){for(var r,n,o,i=0,a=e[0].length;i<a;++i){for(o=r=0;r<n;++r)o+=e[r][i][1]||0;if(o)for(r=0;r<n;++r)e[r][i][1]/=o}bM(e,t)}},none:bM,silhouette:function(e,t){if((r=e.length)>0){for(var r,n=0,o=e[t[0]],i=o.length;n<i;++n){for(var a=0,s=0;a<r;++a)s+=e[a][n][1]||0;o[n][1]+=o[n][0]=-s/2}bM(e,t)}},wiggle:function(e,t){if((o=e.length)>0&&(n=(r=e[t[0]]).length)>0){for(var r,n,o,i=0,a=1;a<n;++a){for(var s=0,u=0,l=0;s<o;++s){for(var c=e[t[s]],f=c[a][1]||0,d=(f-(c[a-1][1]||0))/2,p=0;p<s;++p){var h=e[t[p]];d+=(h[a][1]||0)-(h[a-1][1]||0)}u+=f,l+=d*f}r[a-1][1]+=r[a-1][0]=i,u&&(i-=l/u)}r[a-1][1]+=r[a-1][0]=i,bM(e,t)}},positive:function(e){var t=e.length;if(!(t<=0))for(var r=0,n=e[0].length;r<n;++r)for(var o=0,i=0;i<t;++i){var a=__()(e[i][r][1])?e[i][r][0]:e[i][r][1];a>=0?(e[i][r][0]=o,e[i][r][1]=o+a,o=e[i][r][1]):(e[i][r][0]=0,e[i][r][1]=0)}}},GR=function(e,t,r){var n=t.map((function(e){return e.props.dataKey})),o=UR[r],i=function(){var e=YS([]),t=xM,r=bM,n=_M;function o(o){var i,a,s=Array.from(e.apply(this,arguments),OM),u=s.length,l=-1;for(const e of o)for(i=0,++l;i<u;++i)(s[i][l]=[0,+n(e,s[i].key,l,o)]).data=e;for(i=0,a=wM(t(s));i<u;++i)s[a[i]].index=i;return r(s,a),s}return o.keys=function(t){return arguments.length?(e="function"==typeof t?t:YS(Array.from(t)),o):e},o.value=function(e){return arguments.length?(n="function"==typeof e?e:YS(+e),o):n},o.order=function(e){return arguments.length?(t=null==e?xM:"function"==typeof e?e:YS(Array.from(e)),o):t},o.offset=function(e){return arguments.length?(r=null==e?bM:e,o):r},o}().keys(n).value((function(e,t){return+TR(e,t,0)})).order(xM).offset(o);return i(e)};function WR(e){var t=e.axis,r=e.ticks,n=e.bandSize,o=e.entry,i=e.index,a=e.dataKey;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!z_()(o[t.dataKey])){var s=I_(r,"value",o[t.dataKey]);if(s)return s.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var u=TR(o,z_()(a)?t.dataKey:a);return z_()(u)?null:t.scale(u)}var qR=function(e){var t=e.axis,r=e.ticks,n=e.offset,o=e.bandSize,i=e.entry,a=e.index;if("category"===t.type)return r[a]?r[a].coordinate+n:null;var s=TR(i,t.dataKey,t.domain[a]);return z_()(s)?null:t.scale(s)-o/2+n},HR=function(e,t,r){return Object.keys(e).reduce((function(n,o){var i=e[o].stackedData.reduce((function(e,n){var o=function(e){return e.reduce((function(e,t){return[PM()(t.concat([e[0]]).filter(C_)),EM()(t.concat([e[1]]).filter(C_))]}),[1/0,-1/0])}(n.slice(t,r+1));return[Math.min(e[0],o[0]),Math.max(e[1],o[1])]}),[1/0,-1/0]);return[Math.min(i[0],n[0]),Math.max(i[1],n[1])]}),[1/0,-1/0]).map((function(e){return e===1/0||e===-1/0?0:e}))},ZR=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,KR=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,YR=function(e,t,r){if(V_()(e))return e(t,r);if(!Array.isArray(e))return t;var n=[];if(C_(e[0]))n[0]=r?e[0]:Math.min(e[0],t[0]);else if(ZR.test(e[0])){var o=+ZR.exec(e[0])[1];n[0]=t[0]-o}else V_()(e[0])?n[0]=e[0](t[0]):n[0]=t[0];if(C_(e[1]))n[1]=r?e[1]:Math.max(e[1],t[1]);else if(KR.test(e[1])){var i=+KR.exec(e[1])[1];n[1]=t[1]+i}else V_()(e[1])?n[1]=e[1](t[1]):n[1]=t[1];return n},XR=function(e,t,r){if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var o=PO()(t,(function(e){return e.coordinate})),i=1/0,a=1,s=o.length;a<s;a++){var u=o[a],l=o[a-1];i=Math.min((u.coordinate||0)-(l.coordinate||0),i)}return i===1/0?0:i}return r?void 0:0},QR=function(e,t,r){return e&&e.length?NM()(e,S_()(r,"type.defaultProps.domain"))?t:e:t},JR=function(e,t){var r=e.type.defaultProps?AR(AR({},e.type.defaultProps),e.props):e.props,n=r.dataKey,o=r.name,i=r.unit,a=r.formatter,s=r.tooltipType,u=r.chartType,l=r.hide;return AR(AR({},pO(e,!1)),{},{dataKey:n,unit:i,formatter:a,name:o||n,color:RR(e),value:TR(t,n),type:s,payload:t,chartType:u,hide:l})};function eL(e){return eL="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},eL(e)}function tL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function rL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?tL(Object(r),!0).forEach((function(t){nL(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tL(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function nL(e,t,r){return t=function(e){var t=function(e,t){if("object"!=eL(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==eL(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var oL=["Webkit","Moz","O","ms"];function iL(e){return iL="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},iL(e)}function aL(){return aL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aL.apply(this,arguments)}function sL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function uL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?sL(Object(r),!0).forEach((function(t){hL(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sL(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function lL(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,mL(n.key),n)}}function cL(e,t,r){return t=dL(t),function(e,t){if(t&&("object"===iL(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,fL()?Reflect.construct(t,r||[],dL(e).constructor):t.apply(e,r))}function fL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(fL=function(){return!!e})()}function dL(e){return dL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dL(e)}function pL(e,t){return pL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},pL(e,t)}function hL(e,t,r){return(t=mL(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mL(e){var t=function(e,t){if("object"!=iL(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=iL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==iL(t)?t:t+""}var yL=function(e){return e.changedTouches&&!!e.changedTouches.length},vL=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),hL(r=cL(this,t,[e]),"handleDrag",(function(e){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(e):r.state.isSlideMoving&&r.handleSlideDrag(e)})),hL(r,"handleTouchMove",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&r.handleDrag(e.changedTouches[0])})),hL(r,"handleDragEnd",(function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},(function(){var e=r.props,t=e.endIndex,n=e.onDragEnd,o=e.startIndex;null==n||n({endIndex:t,startIndex:o})})),r.detachDragEndListener()})),hL(r,"handleLeaveWrapper",(function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))})),hL(r,"handleEnterSlideOrTraveller",(function(){r.setState({isTextActive:!0})})),hL(r,"handleLeaveSlideOrTraveller",(function(){r.setState({isTextActive:!1})})),hL(r,"handleSlideDragStart",(function(e){var t=yL(e)?e.changedTouches[0]:e;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:t.pageX}),r.attachDragEndListener()})),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return function(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&&pL(e,t)}(t,e),n=t,o=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var r=e.startX,n=e.endX,o=this.state.scaleValues,i=this.props,a=i.gap,s=i.data.length-1,u=Math.min(r,n),l=Math.max(r,n),c=t.getIndexInRange(o,u),f=t.getIndexInRange(o,l);return{startIndex:c-c%a,endIndex:f===s?s:f-f%a}}},{key:"getTextOfTick",value:function(e){var t=this.props,r=t.data,n=t.tickFormatter,o=t.dataKey,i=TR(r[e],o,e);return V_()(n)?n(i,e):i}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,r=t.slideMoveStartX,n=t.startX,o=t.endX,i=this.props,a=i.x,s=i.width,u=i.travellerWidth,l=i.startIndex,c=i.endIndex,f=i.onChange,d=e.pageX-r;d>0?d=Math.min(d,a+s-u-o,a+s-u-n):d<0&&(d=Math.max(d,a-n,a-o));var p=this.getIndex({startX:n+d,endX:o+d});p.startIndex===l&&p.endIndex===c||!f||f(p),this.setState({startX:n+d,endX:o+d,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var r=yL(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:r.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t=this.state,r=t.brushMoveStartX,n=t.movingTravellerId,o=t.endX,i=t.startX,a=this.state[n],s=this.props,u=s.x,l=s.width,c=s.travellerWidth,f=s.onChange,d=s.gap,p=s.data,h={startX:this.state.startX,endX:this.state.endX},m=e.pageX-r;m>0?m=Math.min(m,u+l-c-a):m<0&&(m=Math.max(m,u-a)),h[n]=a+m;var y=this.getIndex(h),v=y.startIndex,g=y.endIndex;this.setState(hL(hL({},n,a+m),"brushMoveStartX",e.pageX),(function(){var e;f&&(e=p.length-1,("startX"===n&&(o>i?v%d==0:g%d==0)||o<i&&g===e||"endX"===n&&(o>i?g%d==0:v%d==0)||o>i&&g===e)&&f(y))}))}},{key:"handleTravellerMoveKeyboard",value:function(e,t){var r=this,n=this.state,o=n.scaleValues,i=n.startX,a=n.endX,s=this.state[t],u=o.indexOf(s);if(-1!==u){var l=u+e;if(!(-1===l||l>=o.length)){var c=o[l];"startX"===t&&c>=a||"endX"===t&&c<=i||this.setState(hL({},t,c),(function(){r.props.onChange(r.getIndex({startX:r.state.startX,endX:r.state.endX}))}))}}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,o=e.height,a=e.fill,s=e.stroke;return i().createElement("rect",{stroke:s,fill:a,x:t,y:r,width:n,height:o})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,n=e.y,o=e.width,a=e.height,s=e.data,u=e.children,l=e.padding,c=r.Children.only(u);return c?i().cloneElement(c,{x:t,y:n,width:o,height:a,margin:l,compact:!0,data:s}):null}},{key:"renderTravellerLayer",value:function(e,r){var n,o,a=this,s=this.props,u=s.y,l=s.travellerWidth,c=s.height,f=s.traveller,d=s.ariaLabel,p=s.data,h=s.startIndex,m=s.endIndex,y=Math.max(e,this.props.x),v=uL(uL({},pO(this.props,!1)),{},{x:y,y:u,width:l,height:c}),g=d||"Min value: ".concat(null===(n=p[h])||void 0===n?void 0:n.name,", Max value: ").concat(null===(o=p[m])||void 0===o?void 0:o.name);return i().createElement(DO,{tabIndex:0,role:"slider","aria-label":g,"aria-valuenow":e,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[r],onTouchStart:this.travellerDragStartHandlers[r],onKeyDown:function(e){["ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),a.handleTravellerMoveKeyboard("ArrowRight"===e.key?1:-1,r))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(f,v))}},{key:"renderSlide",value:function(e,t){var r=this.props,n=r.y,o=r.height,a=r.stroke,s=r.travellerWidth,u=Math.min(e,t)+s,l=Math.max(Math.abs(t-e)-s,0);return i().createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:a,fillOpacity:.2,x:u,y:n,width:l,height:o})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,r=e.endIndex,n=e.y,o=e.height,a=e.travellerWidth,s=e.stroke,u=this.state,l=u.startX,c=u.endX,f={pointerEvents:"none",fill:s};return i().createElement(DO,{className:"recharts-brush-texts"},i().createElement(_k,aL({textAnchor:"end",verticalAnchor:"middle",x:Math.min(l,c)-5,y:n+o/2},f),this.getTextOfTick(t)),i().createElement(_k,aL({textAnchor:"start",verticalAnchor:"middle",x:Math.max(l,c)+a+5,y:n+o/2},f),this.getTextOfTick(r)))}},{key:"render",value:function(){var e=this.props,t=e.data,r=e.className,n=e.children,o=e.x,a=e.y,s=e.width,u=e.height,l=e.alwaysShowText,c=this.state,f=c.startX,d=c.endX,p=c.isTextActive,h=c.isSlideMoving,m=c.isTravellerMoving,y=c.isTravellerFocused;if(!t||!t.length||!C_(o)||!C_(a)||!C_(s)||!C_(u)||s<=0||u<=0)return null;var v=gt("recharts-brush",r),g=1===i().Children.count(n),b=function(e,t){if(!e)return null;var r=e.replace(/(\w)/,(function(e){return e.toUpperCase()})),n=oL.reduce((function(e,n){return rL(rL({},e),{},nL({},n+r,t))}),{});return n[e]=t,n}("userSelect","none");return i().createElement(DO,{className:v,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),g&&this.renderPanorama(),this.renderSlide(f,d),this.renderTravellerLayer(f,"startX"),this.renderTravellerLayer(d,"endX"),(p||h||m||y||l)&&this.renderText())}}],a=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,r=e.y,n=e.width,o=e.height,a=e.stroke,s=Math.floor(r+o/2)-1;return i().createElement(i().Fragment,null,i().createElement("rect",{x:t,y:r,width:n,height:o,fill:a,stroke:"none"}),i().createElement("line",{x1:t+1,y1:s,x2:t+n-1,y2:s,fill:"none",stroke:"#fff"}),i().createElement("line",{x1:t+1,y1:s+2,x2:t+n-1,y2:s+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,r){return i().isValidElement(e)?i().cloneElement(e,r):V_()(e)?e(r):t.renderDefaultTraveller(r)}},{key:"getDerivedStateFromProps",value:function(e,t){var r=e.data,n=e.width,o=e.x,i=e.travellerWidth,a=e.updateId,s=e.startIndex,u=e.endIndex;if(r!==t.prevData||a!==t.prevUpdateId)return uL({prevData:r,prevTravellerWidth:i,prevUpdateId:a,prevX:o,prevWidth:n},r&&r.length?function(e){var t=e.data,r=e.startIndex,n=e.endIndex,o=e.x,i=e.width,a=e.travellerWidth;if(!t||!t.length)return{};var s=t.length,u=zP().domain(EO()(0,s)).range([o,o+i-a]),l=u.domain().map((function(e){return u(e)}));return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(n),scale:u,scaleValues:l}}({data:r,width:n,x:o,travellerWidth:i,startIndex:s,endIndex:u}):{scale:null,scaleValues:null});if(t.scale&&(n!==t.prevWidth||o!==t.prevX||i!==t.prevTravellerWidth)){t.scale.range([o,o+n-i]);var l=t.scale.domain().map((function(e){return t.scale(e)}));return{prevData:r,prevTravellerWidth:i,prevUpdateId:a,prevX:o,prevWidth:n,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:l}}return null}},{key:"getIndexInRange",value:function(e,t){for(var r=0,n=e.length-1;n-r>1;){var o=Math.floor((r+n)/2);e[o]>t?n=o:r=o}return t>=e[n]?n:r}}],o&&lL(n.prototype,o),a&&lL(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,a}(r.PureComponent);function gL(e){return gL="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},gL(e)}function bL(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function wL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?bL(Object(r),!0).forEach((function(t){xL(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bL(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function xL(e,t,r){return t=function(e){var t=function(e,t){if("object"!=gL(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=gL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==gL(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hL(vL,"displayName","Brush"),hL(vL,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var _L=Math.PI/180,OL=function(e){return 180*e/Math.PI},SL=function(e,t,r,n){return{x:e+Math.cos(-_L*n)*r,y:t+Math.sin(-_L*n)*r}},EL=function(e,t){var r=e.x,n=e.y,o=t.cx,i=t.cy,a=function(e,t){var r=e.x,n=e.y,o=t.x,i=t.y;return Math.sqrt(Math.pow(r-o,2)+Math.pow(n-i,2))}({x:r,y:n},{x:o,y:i});if(a<=0)return{radius:a};var s=(r-o)/a,u=Math.acos(s);return n>i&&(u=2*Math.PI-u),{radius:a,angle:OL(u),angleInRadian:u}},jL=function(e,t){var r=t.startAngle,n=t.endAngle,o=Math.floor(r/360),i=Math.floor(n/360);return e+360*Math.min(o,i)},PL=function(e,t){var r=e.x,n=e.y,o=EL({x:r,y:n},t),i=o.radius,a=o.angle,s=t.innerRadius,u=t.outerRadius;if(i<s||i>u)return!1;if(0===i)return!0;var l,c=function(e){var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),o=Math.floor(r/360),i=Math.min(n,o);return{startAngle:t-360*i,endAngle:r-360*i}}(t),f=c.startAngle,d=c.endAngle,p=a;if(f<=d){for(;p>d;)p-=360;for(;p<f;)p+=360;l=p>=f&&p<=d}else{for(;p>f;)p-=360;for(;p<d;)p+=360;l=p>=d&&p<=f}return l?wL(wL({},t),{},{radius:i,angle:jL(p,t)}):null};function kL(e){return kL="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},kL(e)}var CL=["offset"];function AL(e){return function(e){if(Array.isArray(e))return NL(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return NL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return NL(e,t)}(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.")}()}function NL(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function TL(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function ML(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function RL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ML(Object(r),!0).forEach((function(t){LL(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ML(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function LL(e,t,r){return t=function(e){var t=function(e,t){if("object"!=kL(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=kL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==kL(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IL(){return IL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IL.apply(this,arguments)}var DL=function(e,t,r){var n,o,a=e.position,s=e.viewBox,u=e.offset,l=e.className,c=s,f=c.cx,d=c.cy,p=c.innerRadius,h=c.outerRadius,m=c.startAngle,y=c.endAngle,v=c.clockWise,g=(p+h)/2,b=function(e,t){return P_(t-e)*Math.min(Math.abs(t-e),360)}(m,y),w=b>=0?1:-1;"insideStart"===a?(n=m+w*u,o=v):"insideEnd"===a?(n=y-w*u,o=!v):"end"===a&&(n=y+w*u,o=v),o=b<=0?o:!o;var x=SL(f,d,g,n),_=SL(f,d,g,n+359*(o?1:-1)),O="M".concat(x.x,",").concat(x.y,"\n    A").concat(g,",").concat(g,",0,1,").concat(o?0:1,",\n    ").concat(_.x,",").concat(_.y),S=z_()(e.id)?T_("recharts-radial-line-"):e.id;return i().createElement("text",IL({},r,{dominantBaseline:"central",className:gt("recharts-radial-bar-label",l)}),i().createElement("defs",null,i().createElement("path",{id:S,d:O})),i().createElement("textPath",{xlinkHref:"#".concat(S)},t))};function FL(e){var t,n=e.offset,o=RL({offset:void 0===n?5:n},TL(e,CL)),a=o.viewBox,s=o.position,u=o.value,l=o.children,c=o.content,f=o.className,d=void 0===f?"":f,p=o.textBreakAll;if(!a||z_()(u)&&z_()(l)&&!(0,r.isValidElement)(c)&&!V_()(c))return null;if((0,r.isValidElement)(c))return(0,r.cloneElement)(c,o);if(V_()(c)){if(t=(0,r.createElement)(c,o),(0,r.isValidElement)(t))return t}else t=function(e){var t=e.value,r=e.formatter,n=z_()(e.children)?t:e.children;return V_()(r)?r(n):n}(o);var h=function(e){return"cx"in e&&C_(e.cx)}(a),m=pO(o,!0);if(h&&("insideStart"===s||"insideEnd"===s||"end"===s))return DL(o,t,m);var y=h?function(e){var t=e.viewBox,r=e.offset,n=e.position,o=t,i=o.cx,a=o.cy,s=o.innerRadius,u=o.outerRadius,l=(o.startAngle+o.endAngle)/2;if("outside"===n){var c=SL(i,a,u+r,l),f=c.x;return{x:f,y:c.y,textAnchor:f>=i?"start":"end",verticalAnchor:"middle"}}if("center"===n)return{x:i,y:a,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===n)return{x:i,y:a,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===n)return{x:i,y:a,textAnchor:"middle",verticalAnchor:"end"};var d=SL(i,a,(s+u)/2,l);return{x:d.x,y:d.y,textAnchor:"middle",verticalAnchor:"middle"}}(o):function(e){var t=e.viewBox,r=e.parentViewBox,n=e.offset,o=e.position,i=t,a=i.x,s=i.y,u=i.width,l=i.height,c=l>=0?1:-1,f=c*n,d=c>0?"end":"start",p=c>0?"start":"end",h=u>=0?1:-1,m=h*n,y=h>0?"end":"start",v=h>0?"start":"end";if("top"===o)return RL(RL({},{x:a+u/2,y:s-c*n,textAnchor:"middle",verticalAnchor:d}),r?{height:Math.max(s-r.y,0),width:u}:{});if("bottom"===o)return RL(RL({},{x:a+u/2,y:s+l+f,textAnchor:"middle",verticalAnchor:p}),r?{height:Math.max(r.y+r.height-(s+l),0),width:u}:{});if("left"===o){var g={x:a-m,y:s+l/2,textAnchor:y,verticalAnchor:"middle"};return RL(RL({},g),r?{width:Math.max(g.x-r.x,0),height:l}:{})}if("right"===o){var b={x:a+u+m,y:s+l/2,textAnchor:v,verticalAnchor:"middle"};return RL(RL({},b),r?{width:Math.max(r.x+r.width-b.x,0),height:l}:{})}var w=r?{width:u,height:l}:{};return"insideLeft"===o?RL({x:a+m,y:s+l/2,textAnchor:v,verticalAnchor:"middle"},w):"insideRight"===o?RL({x:a+u-m,y:s+l/2,textAnchor:y,verticalAnchor:"middle"},w):"insideTop"===o?RL({x:a+u/2,y:s+f,textAnchor:"middle",verticalAnchor:p},w):"insideBottom"===o?RL({x:a+u/2,y:s+l-f,textAnchor:"middle",verticalAnchor:d},w):"insideTopLeft"===o?RL({x:a+m,y:s+f,textAnchor:v,verticalAnchor:p},w):"insideTopRight"===o?RL({x:a+u-m,y:s+f,textAnchor:y,verticalAnchor:p},w):"insideBottomLeft"===o?RL({x:a+m,y:s+l-f,textAnchor:v,verticalAnchor:d},w):"insideBottomRight"===o?RL({x:a+u-m,y:s+l-f,textAnchor:y,verticalAnchor:d},w):U_()(o)&&(C_(o.x)||k_(o.x))&&(C_(o.y)||k_(o.y))?RL({x:a+M_(o.x,u),y:s+M_(o.y,l),textAnchor:"end",verticalAnchor:"end"},w):RL({x:a+u/2,y:s+l/2,textAnchor:"middle",verticalAnchor:"middle"},w)}(o);return i().createElement(_k,IL({className:gt("recharts-label",d)},m,y,{breakAll:p}),t)}FL.displayName="Label";var zL=function(e){var t=e.cx,r=e.cy,n=e.angle,o=e.startAngle,i=e.endAngle,a=e.r,s=e.radius,u=e.innerRadius,l=e.outerRadius,c=e.x,f=e.y,d=e.top,p=e.left,h=e.width,m=e.height,y=e.clockWise,v=e.labelViewBox;if(v)return v;if(C_(h)&&C_(m)){if(C_(c)&&C_(f))return{x:c,y:f,width:h,height:m};if(C_(d)&&C_(p))return{x:d,y:p,width:h,height:m}}return C_(c)&&C_(f)?{x:c,y:f,width:0,height:0}:C_(t)&&C_(r)?{cx:t,cy:r,startAngle:o||n||0,endAngle:i||n||0,innerRadius:u||0,outerRadius:l||s||a||0,clockWise:y}:e.viewBox?e.viewBox:{}};FL.parseViewBox=zL,FL.renderCallByParent=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&n&&!e.label)return null;var o=e.children,a=zL(e),s=uO(o,FL).map((function(e,n){return(0,r.cloneElement)(e,{viewBox:t||a,key:"label-".concat(n)})}));if(!n)return s;var u=function(e,t){return e?!0===e?i().createElement(FL,{key:"label-implicit",viewBox:t}):A_(e)?i().createElement(FL,{key:"label-implicit",viewBox:t,value:e}):(0,r.isValidElement)(e)?e.type===FL?(0,r.cloneElement)(e,{key:"label-implicit",viewBox:t}):i().createElement(FL,{key:"label-implicit",content:e,viewBox:t}):V_()(e)?i().createElement(FL,{key:"label-implicit",content:e,viewBox:t}):U_()(e)?i().createElement(FL,IL({viewBox:t},e,{key:"label-implicit"})):null:null}(e.label,t||a);return[u].concat(AL(s))};var BL=function(e,t){var r=e.alwaysShow,n=e.ifOverflow;return r&&(n="extendDomain"),n===t},VL=o(3916),$L=o.n(VL),UL=o(9747),GL=o.n(UL),WL=function(e){return null};WL.displayName="Cell";var qL=o(8090),HL=o.n(qL);function ZL(e){return ZL="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},ZL(e)}var KL=["valueAccessor"],YL=["data","dataKey","clockWise","id","textBreakAll"];function XL(e){return function(e){if(Array.isArray(e))return QL(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return QL(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return QL(e,t)}(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.")}()}function QL(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function JL(){return JL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},JL.apply(this,arguments)}function eI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eI(Object(r),!0).forEach((function(t){rI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eI(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function rI(e,t,r){return t=function(e){var t=function(e,t){if("object"!=ZL(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ZL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ZL(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nI(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var oI=function(e){return Array.isArray(e.value)?HL()(e.value):e.value};function iI(e){var t=e.valueAccessor,r=void 0===t?oI:t,n=nI(e,KL),o=n.data,a=n.dataKey,s=n.clockWise,u=n.id,l=n.textBreakAll,c=nI(n,YL);return o&&o.length?i().createElement(DO,{className:"recharts-label-list"},o.map((function(e,t){var n=z_()(a)?r(e,t):TR(e&&e.payload,a),o=z_()(u)?{}:{id:"".concat(u,"-").concat(t)};return i().createElement(FL,JL({},pO(e,!0),c,o,{parentViewBox:e.parentViewBox,value:n,textBreakAll:l,viewBox:FL.parseViewBox(z_()(s)?e:tI(tI({},e),{},{clockWise:s})),key:"label-".concat(t),index:t}))}))):null}iI.displayName="LabelList",iI.renderCallByParent=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&n&&!e.label)return null;var o=uO(e.children,iI).map((function(e,n){return(0,r.cloneElement)(e,{data:t,key:"labelList-".concat(n)})}));if(!n)return o;var a=function(e,t){return e?!0===e?i().createElement(iI,{key:"labelList-implicit",data:t}):i().isValidElement(e)||V_()(e)?i().createElement(iI,{key:"labelList-implicit",data:t,content:e}):U_()(e)?i().createElement(iI,JL({data:t},e,{key:"labelList-implicit"})):null:null}(e.label,t);return[a].concat(XL(o))};var aI=o(1331),sI=o.n(aI),uI=o(3812),lI=o.n(uI);function cI(e){return cI="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},cI(e)}function fI(){return fI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fI.apply(this,arguments)}function dI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return pI(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pI(e,t)}(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.")}()}function pI(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function hI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function mI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?hI(Object(r),!0).forEach((function(t){yI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):hI(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function yI(e,t,r){return t=function(e){var t=function(e,t){if("object"!=cI(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=cI(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==cI(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var vI=function(e,t,r,n,o){var i,a=r-n;return i="M ".concat(e,",").concat(t),i+="L ".concat(e+r,",").concat(t),i+="L ".concat(e+r-a/2,",").concat(t+o),i+="L ".concat(e+r-a/2-n,",").concat(t+o),i+="L ".concat(e,",").concat(t," Z")},gI={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},bI=function(e){var t=mI(mI({},gI),e),n=(0,r.useRef)(),o=dI((0,r.useState)(-1),2),a=o[0],s=o[1];(0,r.useEffect)((function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&s(e)}catch(e){}}),[]);var u=t.x,l=t.y,c=t.upperWidth,f=t.lowerWidth,d=t.height,p=t.className,h=t.animationEasing,m=t.animationDuration,y=t.animationBegin,v=t.isUpdateAnimationActive;if(u!==+u||l!==+l||c!==+c||f!==+f||d!==+d||0===c&&0===f||0===d)return null;var g=gt("recharts-trapezoid",p);return v?i().createElement(yP,{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:d,x:u,y:l},to:{upperWidth:c,lowerWidth:f,height:d,x:u,y:l},duration:m,animationEasing:h,isActive:v},(function(e){var r=e.upperWidth,o=e.lowerWidth,s=e.height,u=e.x,l=e.y;return i().createElement(yP,{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:h},i().createElement("path",fI({},pO(t,!0),{className:g,d:vI(u,l,r,o,s),ref:n})))})):i().createElement("g",null,i().createElement("path",fI({},pO(t,!0),{className:g,d:vI(u,l,c,f,d)})))};function wI(e){return wI="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},wI(e)}function xI(){return xI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xI.apply(this,arguments)}function _I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function OI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_I(Object(r),!0).forEach((function(t){SI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_I(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function SI(e,t,r){return t=function(e){var t=function(e,t){if("object"!=wI(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=wI(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==wI(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var EI=function(e){var t=e.cx,r=e.cy,n=e.radius,o=e.angle,i=e.sign,a=e.isExternal,s=e.cornerRadius,u=e.cornerIsExternal,l=s*(a?1:-1)+n,c=Math.asin(s/l)/_L,f=u?o:o+i*c,d=u?o-i*c:o;return{center:SL(t,r,l,f),circleTangency:SL(t,r,n,f),lineTangency:SL(t,r,l*Math.cos(c*_L),d),theta:c}},jI=function(e){var t=e.cx,r=e.cy,n=e.innerRadius,o=e.outerRadius,i=e.startAngle,a=function(e,t){return P_(t-e)*Math.min(Math.abs(t-e),359.999)}(i,e.endAngle),s=i+a,u=SL(t,r,o,i),l=SL(t,r,o,s),c="M ".concat(u.x,",").concat(u.y,"\n    A ").concat(o,",").concat(o,",0,\n    ").concat(+(Math.abs(a)>180),",").concat(+(i>s),",\n    ").concat(l.x,",").concat(l.y,"\n  ");if(n>0){var f=SL(t,r,n,i),d=SL(t,r,n,s);c+="L ".concat(d.x,",").concat(d.y,"\n            A ").concat(n,",").concat(n,",0,\n            ").concat(+(Math.abs(a)>180),",").concat(+(i<=s),",\n            ").concat(f.x,",").concat(f.y," Z")}else c+="L ".concat(t,",").concat(r," Z");return c},PI={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},kI=function(e){var t=OI(OI({},PI),e),r=t.cx,n=t.cy,o=t.innerRadius,a=t.outerRadius,s=t.cornerRadius,u=t.forceCornerRadius,l=t.cornerIsExternal,c=t.startAngle,f=t.endAngle,d=t.className;if(a<o||c===f)return null;var p,h=gt("recharts-sector",d),m=a-o,y=M_(s,m,0,!0);return p=y>0&&Math.abs(c-f)<360?function(e){var t=e.cx,r=e.cy,n=e.innerRadius,o=e.outerRadius,i=e.cornerRadius,a=e.forceCornerRadius,s=e.cornerIsExternal,u=e.startAngle,l=e.endAngle,c=P_(l-u),f=EI({cx:t,cy:r,radius:o,angle:u,sign:c,cornerRadius:i,cornerIsExternal:s}),d=f.circleTangency,p=f.lineTangency,h=f.theta,m=EI({cx:t,cy:r,radius:o,angle:l,sign:-c,cornerRadius:i,cornerIsExternal:s}),y=m.circleTangency,v=m.lineTangency,g=m.theta,b=s?Math.abs(u-l):Math.abs(u-l)-h-g;if(b<0)return a?"M ".concat(p.x,",").concat(p.y,"\n        a").concat(i,",").concat(i,",0,0,1,").concat(2*i,",0\n        a").concat(i,",").concat(i,",0,0,1,").concat(2*-i,",0\n      "):jI({cx:t,cy:r,innerRadius:n,outerRadius:o,startAngle:u,endAngle:l});var w="M ".concat(p.x,",").concat(p.y,"\n    A").concat(i,",").concat(i,",0,0,").concat(+(c<0),",").concat(d.x,",").concat(d.y,"\n    A").concat(o,",").concat(o,",0,").concat(+(b>180),",").concat(+(c<0),",").concat(y.x,",").concat(y.y,"\n    A").concat(i,",").concat(i,",0,0,").concat(+(c<0),",").concat(v.x,",").concat(v.y,"\n  ");if(n>0){var x=EI({cx:t,cy:r,radius:n,angle:u,sign:c,isExternal:!0,cornerRadius:i,cornerIsExternal:s}),_=x.circleTangency,O=x.lineTangency,S=x.theta,E=EI({cx:t,cy:r,radius:n,angle:l,sign:-c,isExternal:!0,cornerRadius:i,cornerIsExternal:s}),j=E.circleTangency,P=E.lineTangency,k=E.theta,C=s?Math.abs(u-l):Math.abs(u-l)-S-k;if(C<0&&0===i)return"".concat(w,"L").concat(t,",").concat(r,"Z");w+="L".concat(P.x,",").concat(P.y,"\n      A").concat(i,",").concat(i,",0,0,").concat(+(c<0),",").concat(j.x,",").concat(j.y,"\n      A").concat(n,",").concat(n,",0,").concat(+(C>180),",").concat(+(c>0),",").concat(_.x,",").concat(_.y,"\n      A").concat(i,",").concat(i,",0,0,").concat(+(c<0),",").concat(O.x,",").concat(O.y,"Z")}else w+="L".concat(t,",").concat(r,"Z");return w}({cx:r,cy:n,innerRadius:o,outerRadius:a,cornerRadius:Math.min(y,m/2),forceCornerRadius:u,cornerIsExternal:l,startAngle:c,endAngle:f}):jI({cx:r,cy:n,innerRadius:o,outerRadius:a,startAngle:c,endAngle:f}),i().createElement("path",xI({},pO(t,!0),{className:h,d:p,role:"img"}))},CI=["option","shapeType","propTransformer","activeClassName","isActive"];function AI(e){return AI="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},AI(e)}function NI(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function TI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function MI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?TI(Object(r),!0).forEach((function(t){RI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TI(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function RI(e,t,r){return t=function(e){var t=function(e,t){if("object"!=AI(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=AI(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==AI(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LI(e,t){return MI(MI({},t),e)}function II(e){var t=e.shapeType,r=e.elementProps;switch(t){case"rectangle":return i().createElement(PP,r);case"trapezoid":return i().createElement(bI,r);case"sector":return i().createElement(kI,r);case"symbols":if(function(e){return"symbols"===e}(t))return i().createElement(pE,r);break;default:return null}}function DI(e){var t,n=e.option,o=e.shapeType,a=e.propTransformer,s=void 0===a?LI:a,u=e.activeClassName,l=void 0===u?"recharts-active-shape":u,c=e.isActive,f=NI(e,CI);if((0,r.isValidElement)(n))t=(0,r.cloneElement)(n,MI(MI({},f),function(e){return(0,r.isValidElement)(e)?e.props:e}(n)));else if(V_()(n))t=n(f);else if(sI()(n)&&!lI()(n)){var d=s(n,f);t=i().createElement(II,{shapeType:o,elementProps:d})}else{var p=f;t=i().createElement(II,{shapeType:o,elementProps:p})}return c?i().createElement(DO,{className:l},t):t}function FI(e,t){return null!=t&&"trapezoids"in e.props}function zI(e,t){return null!=t&&"sectors"in e.props}function BI(e,t){return null!=t&&"points"in e.props}function VI(e,t){var r,n,o=e.x===(null==t||null===(r=t.labelViewBox)||void 0===r?void 0:r.x)||e.x===t.x,i=e.y===(null==t||null===(n=t.labelViewBox)||void 0===n?void 0:n.y)||e.y===t.y;return o&&i}function $I(e,t){var r=e.endAngle===t.endAngle,n=e.startAngle===t.startAngle;return r&&n}function UI(e,t){var r=e.x===t.x,n=e.y===t.y,o=e.z===t.z;return r&&n&&o}function GI(e){var t=e.activeTooltipItem,r=e.graphicalItem,n=e.itemData,o=function(e,t){var r;return FI(e,t)?r="trapezoids":zI(e,t)?r="sectors":BI(e,t)&&(r="points"),r}(r,t),i=function(e,t){var r,n;return FI(e,t)?null===(r=t.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:zI(e,t)?null===(n=t.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:BI(e,t)?t.payload:{}}(r,t),a=n.filter((function(e,n){var a=NM()(i,e),s=r.props[o].filter((function(e){var n=function(e,t){var r;return FI(e,t)?r=VI:zI(e,t)?r=$I:BI(e,t)&&(r=UI),r}(r,t);return n(e,t)})),u=r.props[o].indexOf(s[s.length-1]);return a&&n===u}));return n.indexOf(a[a.length-1])}var WI=["x","y"];function qI(e){return qI="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},qI(e)}function HI(){return HI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HI.apply(this,arguments)}function ZI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function KI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ZI(Object(r),!0).forEach((function(t){YI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZI(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function YI(e,t,r){return t=function(e){var t=function(e,t){if("object"!=qI(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=qI(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==qI(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XI(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function QI(e,t){var r=e.x,n=e.y,o=XI(e,WI),i="".concat(r),a=parseInt(i,10),s="".concat(n),u=parseInt(s,10),l="".concat(t.height||o.height),c=parseInt(l,10),f="".concat(t.width||o.width),d=parseInt(f,10);return KI(KI(KI(KI(KI({},t),o),a?{x:a}:{}),u?{y:u}:{}),{},{height:c,width:d,name:t.name,radius:t.radius})}function JI(e){return i().createElement(DI,HI({shapeType:"rectangle",propTransformer:QI,activeClassName:"recharts-active-bar"},e))}var eD,tD=["value","background"];function rD(e){return rD="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},rD(e)}function nD(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function oD(){return oD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oD.apply(this,arguments)}function iD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function aD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?iD(Object(r),!0).forEach((function(t){dD(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iD(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function sD(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,pD(n.key),n)}}function uD(e,t,r){return t=cD(t),function(e,t){if(t&&("object"===rD(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,lD()?Reflect.construct(t,r||[],cD(e).constructor):t.apply(e,r))}function lD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(lD=function(){return!!e})()}function cD(e){return cD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cD(e)}function fD(e,t){return fD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fD(e,t)}function dD(e,t,r){return(t=pD(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pD(e){var t=function(e,t){if("object"!=rD(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=rD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==rD(t)?t:t+""}var hD=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return dD(e=uD(this,t,[].concat(n)),"state",{isAnimationFinished:!1}),dD(e,"id",T_("recharts-bar-")),dD(e,"handleAnimationEnd",(function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()})),dD(e,"handleAnimationStart",(function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()})),e}return function(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&&fD(e,t)}(t,e),r=t,n=[{key:"renderRectanglesStatically",value:function(e){var t=this,r=this.props,n=r.shape,o=r.dataKey,a=r.activeIndex,s=r.activeBar,u=pO(this.props,!1);return e&&e.map((function(e,r){var l=r===a,c=l?s:n,f=aD(aD(aD({},u),e),{},{isActive:l,option:c,index:r,dataKey:o,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return i().createElement(DO,oD({className:"recharts-bar-rectangle"},Q_(t.props,e,r),{key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value)}),i().createElement(JI,f))}))}},{key:"renderRectanglesWithAnimation",value:function(){var e=this,t=this.props,r=t.data,n=t.layout,o=t.isAnimationActive,a=t.animationBegin,s=t.animationDuration,u=t.animationEasing,l=t.animationId,c=this.state.prevData;return i().createElement(yP,{begin:a,duration:s,isActive:o,easing:u,from:{t:0},to:{t:1},key:"bar-".concat(l),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(t){var o=t.t,a=r.map((function(e,t){var r=c&&c[t];if(r){var i=L_(r.x,e.x),a=L_(r.y,e.y),s=L_(r.width,e.width),u=L_(r.height,e.height);return aD(aD({},e),{},{x:i(o),y:a(o),width:s(o),height:u(o)})}if("horizontal"===n){var l=L_(0,e.height)(o);return aD(aD({},e),{},{y:e.y+e.height-l,height:l})}var f=L_(0,e.width)(o);return aD(aD({},e),{},{width:f})}));return i().createElement(DO,null,e.renderRectanglesStatically(a))}))}},{key:"renderRectangles",value:function(){var e=this.props,t=e.data,r=e.isAnimationActive,n=this.state.prevData;return!(r&&t&&t.length)||n&&NM()(n,t)?this.renderRectanglesStatically(t):this.renderRectanglesWithAnimation()}},{key:"renderBackground",value:function(){var e=this,t=this.props,r=t.data,n=t.dataKey,o=t.activeIndex,a=pO(this.props.background,!1);return r.map((function(t,r){t.value;var s=t.background,u=nD(t,tD);if(!s)return null;var l=aD(aD(aD(aD(aD({},u),{},{fill:"#eee"},s),a),Q_(e.props,t,r)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:n,index:r,className:"recharts-bar-background-rectangle"});return i().createElement(JI,oD({key:"background-bar-".concat(r),option:e.props.background,isActive:r===o},l))}))}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.data,o=r.xAxis,a=r.yAxis,s=r.layout,u=uO(r.children,wR);if(!u)return null;var l="vertical"===s?n[0].height/2:n[0].width/2,c=function(e,t){var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:TR(e,t)}},f={clipPath:e?"url(#clipPath-".concat(t,")"):null};return i().createElement(DO,f,u.map((function(e){return i().cloneElement(e,{key:"error-bar-".concat(t,"-").concat(e.props.dataKey),data:n,xAxis:o,yAxis:a,layout:s,offset:l,dataPointFormatter:c})})))}},{key:"render",value:function(){var e=this.props,t=e.hide,r=e.data,n=e.className,o=e.xAxis,a=e.yAxis,s=e.left,u=e.top,l=e.width,c=e.height,f=e.isAnimationActive,d=e.background,p=e.id;if(t||!r||!r.length)return null;var h=this.state.isAnimationFinished,m=gt("recharts-bar",n),y=o&&o.allowDataOverflow,v=a&&a.allowDataOverflow,g=y||v,b=z_()(p)?this.id:p;return i().createElement(DO,{className:m},y||v?i().createElement("defs",null,i().createElement("clipPath",{id:"clipPath-".concat(b)},i().createElement("rect",{x:y?s:s-l/2,y:v?u:u-c/2,width:y?l:2*l,height:v?c:2*c}))):null,i().createElement(DO,{className:"recharts-bar-rectangles",clipPath:g?"url(#clipPath-".concat(b,")"):null},d?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(g,b),(!f||h)&&iI.renderCallByParent(this.props,r))}}],o=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}:e.data!==t.curData?{curData:e.data}:null}}],n&&sD(r.prototype,n),o&&sD(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.PureComponent);function mD(e){return mD="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},mD(e)}function yD(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,wD(n.key),n)}}function vD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vD(Object(r),!0).forEach((function(t){bD(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vD(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function bD(e,t,r){return(t=wD(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wD(e){var t=function(e,t){if("object"!=mD(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=mD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==mD(t)?t:t+""}eD=hD,dD(hD,"displayName","Bar"),dD(hD,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!cS.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),dD(hD,"getComposedData",(function(e){var t=e.props,r=e.item,n=e.barPosition,o=e.bandSize,i=e.xAxis,a=e.yAxis,s=e.xAxisTicks,u=e.yAxisTicks,l=e.stackedData,c=e.dataStartIndex,f=e.displayedData,d=e.offset,p=function(e,t){if(!e)return null;for(var r=0,n=e.length;r<n;r++)if(e[r].item===t)return e[r].position;return null}(n,r);if(!p)return null;var h=t.layout,m=r.type.defaultProps,y=void 0!==m?aD(aD({},m),r.props):r.props,v=y.dataKey,g=y.children,b=y.minPointSize,w="horizontal"===h?a:i,x=l?w.scale.domain():null,_=function(e){var t=e.numericAxis,r=t.scale.domain();if("number"===t.type){var n=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return n<=0&&o>=0?0:o<0?o:n}return r[0]}({numericAxis:w}),O=uO(g,WL),S=f.map((function(e,t){var n,f,d,m,y,g;l?n=function(e,t){if(!t||2!==t.length||!C_(t[0])||!C_(t[1]))return e;var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]),o=[e[0],e[1]];return(!C_(e[0])||e[0]<r)&&(o[0]=r),(!C_(e[1])||e[1]>n)&&(o[1]=n),o[0]>n&&(o[0]=n),o[1]<r&&(o[1]=r),o}(l[c+t],x):(n=TR(e,v),Array.isArray(n)||(n=[_,n]));var w=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(r,n){if("number"==typeof e)return e;var o="number"==typeof r;return o?e(r,n):(o||CO(!1),t)}}(b,eD.defaultProps.minPointSize)(n[1],t);if("horizontal"===h){var S,E=[a.scale(n[0]),a.scale(n[1])],j=E[0],P=E[1];f=qR({axis:i,ticks:s,bandSize:o,offset:p.offset,entry:e,index:t}),d=null!==(S=null!=P?P:j)&&void 0!==S?S:void 0,m=p.size;var k=j-P;if(y=Number.isNaN(k)?0:k,g={x:f,y:a.y,width:m,height:a.height},Math.abs(w)>0&&Math.abs(y)<Math.abs(w)){var C=P_(y||w)*(Math.abs(w)-Math.abs(y));d-=C,y+=C}}else{var A=[i.scale(n[0]),i.scale(n[1])],N=A[0],T=A[1];if(f=N,d=qR({axis:a,ticks:u,bandSize:o,offset:p.offset,entry:e,index:t}),m=T-N,y=p.size,g={x:i.x,y:d,width:i.width,height:y},Math.abs(w)>0&&Math.abs(m)<Math.abs(w))m+=P_(m||w)*(Math.abs(w)-Math.abs(m))}return aD(aD(aD({},e),{},{x:f,y:d,width:m,height:y,value:l?n:n[1],payload:e,background:g},O&&O[t]&&O[t].props),{},{tooltipPayload:[JR(r,e)],tooltipPosition:{x:f+m/2,y:d+y/2}})}));return aD({data:S,layout:h},d)}));var xD=function(e,t){var r=e.x,n=e.y,o=t.x,i=t.y;return{x:Math.min(r,o),y:Math.min(n,i),width:Math.abs(o-r),height:Math.abs(i-n)}},_D=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scale=t}return t=e,r=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.bandAware,n=t.position;if(void 0!==e){if(n)switch(n){case"start":default:return this.scale(e);case"middle":var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+o;case"end":var i=this.bandwidth?this.bandwidth():0;return this.scale(e)+i}if(r){var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+a}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),r=t[0],n=t[t.length-1];return r<=n?e>=r&&e<=n:e>=n&&e<=r}}],n=[{key:"create",value:function(t){return new e(t)}}],r&&yD(t.prototype,r),n&&yD(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();bD(_D,"EPS",1e-4);var OD=function(e){var t=Object.keys(e).reduce((function(t,r){return gD(gD({},t),{},bD({},r,_D.create(e[r])))}),{});return gD(gD({},t),{},{apply:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.bandAware,o=r.position;return $L()(e,(function(e,r){return t[r].apply(e,{bandAware:n,position:o})}))},isInRange:function(e){return GL()(e,(function(e,r){return t[r].isInRange(e)}))}})};function SD(){return SD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SD.apply(this,arguments)}function ED(e){return ED="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},ED(e)}function jD(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function PD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jD(Object(r),!0).forEach((function(t){MD(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jD(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function kD(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,RD(n.key),n)}}function CD(e,t,r){return t=ND(t),function(e,t){if(t&&("object"===ED(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,AD()?Reflect.construct(t,r||[],ND(e).constructor):t.apply(e,r))}function AD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(AD=function(){return!!e})()}function ND(e){return ND=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ND(e)}function TD(e,t){return TD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},TD(e,t)}function MD(e,t,r){return(t=RD(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function RD(e){var t=function(e,t){if("object"!=ED(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=ED(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ED(t)?t:t+""}var LD=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),CD(this,t,arguments)}return function(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&&TD(e,t)}(t,e),r=t,n=[{key:"render",value:function(){var e=this.props,r=e.x,n=e.y,o=e.r,a=e.alwaysShow,s=e.clipPathId,u=A_(r),l=A_(n);if(D_(void 0===a,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!l)return null;var c=function(e){var t=e.x,r=e.y,n=e.xAxis,o=e.yAxis,i=OD({x:n.scale,y:o.scale}),a=i.apply({x:t,y:r},{bandAware:!0});return BL(e,"discard")&&!i.isInRange(a)?null:a}(this.props);if(!c)return null;var f=c.x,d=c.y,p=this.props,h=p.shape,m=p.className,y=PD(PD({clipPath:BL(this.props,"hidden")?"url(#".concat(s,")"):void 0},pO(this.props,!0)),{},{cx:f,cy:d});return i().createElement(DO,{className:gt("recharts-reference-dot",m)},t.renderDot(h,y),FL.renderCallByParent(this.props,{x:f-o,y:d-o,width:2*o,height:2*o}))}}],n&&kD(r.prototype,n),o&&kD(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(i().Component);MD(LD,"displayName","ReferenceDot"),MD(LD,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1}),MD(LD,"renderDot",(function(e,t){return i().isValidElement(e)?i().cloneElement(e,t):V_()(e)?e(t):i().createElement(VE,SD({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"}))}));var ID=o(2426),DD=o.n(ID),FD=o(7309),zD=o.n(FD),BD=o(104),VD=o.n(BD)()((function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}}),(function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}));var $D=(0,r.createContext)(void 0),UD=(0,r.createContext)(void 0),GD=(0,r.createContext)(void 0),WD=(0,r.createContext)({}),qD=(0,r.createContext)(void 0),HD=(0,r.createContext)(0),ZD=(0,r.createContext)(0),KD=function(e){var t=e.state,r=t.xAxisMap,n=t.yAxisMap,o=t.offset,a=e.clipPathId,s=e.children,u=e.width,l=e.height,c=VD(o);return i().createElement($D.Provider,{value:r},i().createElement(UD.Provider,{value:n},i().createElement(WD.Provider,{value:o},i().createElement(GD.Provider,{value:c},i().createElement(qD.Provider,{value:a},i().createElement(HD.Provider,{value:l},i().createElement(ZD.Provider,{value:u},s)))))))};var YD=function(e){var t=(0,r.useContext)($D);null==t&&CO(!1);var n=t[e];return null==n&&CO(!1),n},XD=function(e){var t=(0,r.useContext)(UD);null==t&&CO(!1);var n=t[e];return null==n&&CO(!1),n},QD=function(){return(0,r.useContext)(ZD)},JD=function(){return(0,r.useContext)(HD)};function eF(e){return eF="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},eF(e)}function tF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,lF(n.key),n)}}function rF(e,t,r){return t=oF(t),function(e,t){if(t&&("object"===eF(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,nF()?Reflect.construct(t,r||[],oF(e).constructor):t.apply(e,r))}function nF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nF=function(){return!!e})()}function oF(e){return oF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},oF(e)}function iF(e,t){return iF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},iF(e,t)}function aF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function sF(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?aF(Object(r),!0).forEach((function(t){uF(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aF(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function uF(e,t,r){return(t=lF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lF(e){var t=function(e,t){if("object"!=eF(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=eF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==eF(t)?t:t+""}function cF(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return fF(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fF(e,t)}(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.")}()}function fF(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function dF(){return dF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dF.apply(this,arguments)}function pF(e){var t=e.x,n=e.y,o=e.segment,a=e.xAxisId,s=e.yAxisId,u=e.shape,l=e.className,c=e.alwaysShow,f=(0,r.useContext)(qD),d=YD(a),p=XD(s),h=(0,r.useContext)(GD);if(!f||!h)return null;D_(void 0===c,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=function(e,t,r,n,o,i,a,s,u){var l=o.x,c=o.y,f=o.width,d=o.height;if(r){var p=u.y,h=e.y.apply(p,{position:i});if(BL(u,"discard")&&!e.y.isInRange(h))return null;var m=[{x:l+f,y:h},{x:l,y:h}];return"left"===s?m.reverse():m}if(t){var y=u.x,v=e.x.apply(y,{position:i});if(BL(u,"discard")&&!e.x.isInRange(v))return null;var g=[{x:v,y:c+d},{x:v,y:c}];return"top"===a?g.reverse():g}if(n){var b=u.segment.map((function(t){return e.apply(t,{position:i})}));return BL(u,"discard")&&DD()(b,(function(t){return!e.isInRange(t)}))?null:b}return null}(OD({x:d.scale,y:p.scale}),A_(t),A_(n),o&&2===o.length,h,e.position,d.orientation,p.orientation,e);if(!m)return null;var y=cF(m,2),v=y[0],g=v.x,b=v.y,w=y[1],x=w.x,_=w.y,O=sF(sF({clipPath:BL(e,"hidden")?"url(#".concat(f,")"):void 0},pO(e,!0)),{},{x1:g,y1:b,x2:x,y2:_});return i().createElement(DO,{className:gt("recharts-reference-line",l)},function(e,t){return i().isValidElement(e)?i().cloneElement(e,t):V_()(e)?e(t):i().createElement("line",dF({},t,{className:"recharts-reference-line-line"}))}(u,O),FL.renderCallByParent(e,function(e){var t=e.x1,r=e.y1,n=e.x2,o=e.y2;return xD({x:t,y:r},{x:n,y:o})}({x1:g,y1:b,x2:x,y2:_})))}var hF=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),rF(this,t,arguments)}return function(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&&iF(e,t)}(t,e),r=t,(n=[{key:"render",value:function(){return i().createElement(pF,this.props)}}])&&tF(r.prototype,n),o&&tF(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(i().Component);function mF(){return mF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mF.apply(this,arguments)}function yF(e){return yF="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},yF(e)}function vF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function gF(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?vF(Object(r),!0).forEach((function(t){SF(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vF(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function bF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,EF(n.key),n)}}function wF(e,t,r){return t=_F(t),function(e,t){if(t&&("object"===yF(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,xF()?Reflect.construct(t,r||[],_F(e).constructor):t.apply(e,r))}function xF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(xF=function(){return!!e})()}function _F(e){return _F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_F(e)}function OF(e,t){return OF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},OF(e,t)}function SF(e,t,r){return(t=EF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function EF(e){var t=function(e,t){if("object"!=yF(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=yF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==yF(t)?t:t+""}uF(hF,"displayName","ReferenceLine"),uF(hF,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});var jF=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),wF(this,t,arguments)}return function(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&&OF(e,t)}(t,e),r=t,(n=[{key:"render",value:function(){var e=this.props,r=e.x1,n=e.x2,o=e.y1,a=e.y2,s=e.className,u=e.alwaysShow,l=e.clipPathId;D_(void 0===u,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var c=A_(r),f=A_(n),d=A_(o),p=A_(a),h=this.props.shape;if(!(c||f||d||p||h))return null;var m=function(e,t,r,n,o){var i=o.x1,a=o.x2,s=o.y1,u=o.y2,l=o.xAxis,c=o.yAxis;if(!l||!c)return null;var f=OD({x:l.scale,y:c.scale}),d={x:e?f.x.apply(i,{position:"start"}):f.x.rangeMin,y:r?f.y.apply(s,{position:"start"}):f.y.rangeMin},p={x:t?f.x.apply(a,{position:"end"}):f.x.rangeMax,y:n?f.y.apply(u,{position:"end"}):f.y.rangeMax};return!BL(o,"discard")||f.isInRange(d)&&f.isInRange(p)?xD(d,p):null}(c,f,d,p,this.props);if(!m&&!h)return null;var y=BL(this.props,"hidden")?"url(#".concat(l,")"):void 0;return i().createElement(DO,{className:gt("recharts-reference-area",s)},t.renderRect(h,gF(gF({clipPath:y},pO(this.props,!0)),m)),FL.renderCallByParent(this.props,m))}}])&&bF(r.prototype,n),o&&bF(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(i().Component);function PF(e){return function(e){if(Array.isArray(e))return kF(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return kF(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kF(e,t)}(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.")}()}function kF(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}SF(jF,"displayName","ReferenceArea"),SF(jF,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1}),SF(jF,"renderRect",(function(e,t){return i().isValidElement(e)?i().cloneElement(e,t):V_()(e)?e(t):i().createElement(PP,mF({},t,{className:"recharts-reference-area-rect"}))}));var CF=function(e,t,r,n,o){var i=uO(e,hF),a=uO(e,LD),s=[].concat(PF(i),PF(a)),u=uO(e,jF),l="".concat(n,"Id"),c=n[0],f=t;if(s.length&&(f=s.reduce((function(e,t){if(t.props[l]===r&&BL(t.props,"extendDomain")&&C_(t.props[c])){var n=t.props[c];return[Math.min(e[0],n),Math.max(e[1],n)]}return e}),f)),u.length){var d="".concat(c,"1"),p="".concat(c,"2");f=u.reduce((function(e,t){if(t.props[l]===r&&BL(t.props,"extendDomain")&&C_(t.props[d])&&C_(t.props[p])){var n=t.props[d],o=t.props[p];return[Math.min(e[0],n,o),Math.max(e[1],n,o)]}return e}),f)}return o&&o.length&&(f=o.reduce((function(e,t){return C_(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e}),f)),f},AF=o(1747),NF=new(o.n(AF)()),TF="recharts.syncMouseEvents";function MF(e){return MF="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},MF(e)}function RF(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,IF(n.key),n)}}function LF(e,t,r){return(t=IF(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IF(e){var t=function(e,t){if("object"!=MF(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=MF(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==MF(t)?t:t+""}var DF=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),LF(this,"activeIndex",0),LF(this,"coordinateList",[]),LF(this,"layout","horizontal")},t=[{key:"setDetails",value:function(e){var t,r=e.coordinateList,n=void 0===r?null:r,o=e.container,i=void 0===o?null:o,a=e.layout,s=void 0===a?null:a,u=e.offset,l=void 0===u?null:u,c=e.mouseHandlerCallback,f=void 0===c?null:c;this.coordinateList=null!==(t=null!=n?n:this.coordinateList)&&void 0!==t?t:[],this.container=null!=i?i:this.container,this.layout=null!=s?s:this.layout,this.offset=null!=l?l:this.offset,this.mouseHandlerCallback=null!=f?f:this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(e){if(0!==this.coordinateList.length)switch(e.key){case"ArrowRight":if("horizontal"!==this.layout)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case"ArrowLeft":if("horizontal"!==this.layout)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:"setIndex",value:function(e){this.activeIndex=e}},{key:"spoofMouse",value:function(){var e,t;if("horizontal"===this.layout&&0!==this.coordinateList.length){var r=this.container.getBoundingClientRect(),n=r.x,o=r.y,i=r.height,a=this.coordinateList[this.activeIndex].coordinate,s=(null===(e=window)||void 0===e?void 0:e.scrollX)||0,u=(null===(t=window)||void 0===t?void 0:t.scrollY)||0,l=n+a+s,c=o+this.offset.top+i/2+u;this.mouseHandlerCallback({pageX:l,pageY:c})}}}],t&&RF(e.prototype,t),r&&RF(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();function FF(){}function zF(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function BF(e){this._context=e}function VF(e){this._context=e}function $F(e){this._context=e}BF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:zF(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:zF(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},VF.prototype={areaStart:FF,areaEnd:FF,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:zF(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},$F.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:zF(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class UF{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function GF(e){this._context=e}function WF(e){this._context=e}function qF(e){return new WF(e)}function HF(e){return e<0?-1:1}function ZF(e,t,r){var n=e._x1-e._x0,o=t-e._x1,i=(e._y1-e._y0)/(n||o<0&&-0),a=(r-e._y1)/(o||n<0&&-0),s=(i*o+a*n)/(n+o);return(HF(i)+HF(a))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs(s))||0}function KF(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function YF(e,t,r){var n=e._x0,o=e._y0,i=e._x1,a=e._y1,s=(i-n)/3;e._context.bezierCurveTo(n+s,o+s*t,i-s,a-s*r,i,a)}function XF(e){this._context=e}function QF(e){this._context=new JF(e)}function JF(e){this._context=e}function ez(e){this._context=e}function tz(e){var t,r,n=e.length-1,o=new Array(n),i=new Array(n),a=new Array(n);for(o[0]=0,i[0]=2,a[0]=e[0]+2*e[1],t=1;t<n-1;++t)o[t]=1,i[t]=4,a[t]=4*e[t]+2*e[t+1];for(o[n-1]=2,i[n-1]=7,a[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=o[t]/i[t-1],i[t]-=r,a[t]-=r*a[t-1];for(o[n-1]=a[n-1]/i[n-1],t=n-2;t>=0;--t)o[t]=(a[t]-o[t+1])/i[t];for(i[n-1]=(e[n]+o[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-o[t+1];return[o,i]}function rz(e,t){this._context=e,this._t=t}function nz(e){return e[0]}function oz(e){return e[1]}function iz(e,t){var r=YS(!0),n=null,o=qF,i=null,a=nE(s);function s(s){var u,l,c,f=(s=wM(s)).length,d=!1;for(null==n&&(i=o(c=a())),u=0;u<=f;++u)!(u<f&&r(l=s[u],u,s))===d&&((d=!d)?i.lineStart():i.lineEnd()),d&&i.point(+e(l,u,s),+t(l,u,s));if(c)return i=null,c+""||null}return e="function"==typeof e?e:void 0===e?nz:YS(e),t="function"==typeof t?t:void 0===t?oz:YS(t),s.x=function(t){return arguments.length?(e="function"==typeof t?t:YS(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:YS(+e),s):t},s.defined=function(e){return arguments.length?(r="function"==typeof e?e:YS(!!e),s):r},s.curve=function(e){return arguments.length?(o=e,null!=n&&(i=o(n)),s):o},s.context=function(e){return arguments.length?(null==e?n=i=null:i=o(n=e),s):n},s}function az(e,t,r){var n=null,o=YS(!0),i=null,a=qF,s=null,u=nE(l);function l(l){var c,f,d,p,h,m=(l=wM(l)).length,y=!1,v=new Array(m),g=new Array(m);for(null==i&&(s=a(h=u())),c=0;c<=m;++c){if(!(c<m&&o(p=l[c],c,l))===y)if(y=!y)f=c,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),d=c-1;d>=f;--d)s.point(v[d],g[d]);s.lineEnd(),s.areaEnd()}y&&(v[c]=+e(p,c,l),g[c]=+t(p,c,l),s.point(n?+n(p,c,l):v[c],r?+r(p,c,l):g[c]))}if(h)return s=null,h+""||null}function c(){return iz().defined(o).curve(a).context(i)}return e="function"==typeof e?e:void 0===e?nz:YS(+e),t="function"==typeof t?t:YS(void 0===t?0:+t),r="function"==typeof r?r:void 0===r?oz:YS(+r),l.x=function(t){return arguments.length?(e="function"==typeof t?t:YS(+t),n=null,l):e},l.x0=function(t){return arguments.length?(e="function"==typeof t?t:YS(+t),l):e},l.x1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:YS(+e),l):n},l.y=function(e){return arguments.length?(t="function"==typeof e?e:YS(+e),r=null,l):t},l.y0=function(e){return arguments.length?(t="function"==typeof e?e:YS(+e),l):t},l.y1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:YS(+e),l):r},l.lineX0=l.lineY0=function(){return c().x(e).y(t)},l.lineY1=function(){return c().x(e).y(r)},l.lineX1=function(){return c().x(n).y(t)},l.defined=function(e){return arguments.length?(o="function"==typeof e?e:YS(!!e),l):o},l.curve=function(e){return arguments.length?(a=e,null!=i&&(s=a(i)),l):a},l.context=function(e){return arguments.length?(null==e?i=s=null:s=a(i=e),l):i},l}function sz(e){return sz="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},sz(e)}function uz(){return uz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uz.apply(this,arguments)}function lz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function cz(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?lz(Object(r),!0).forEach((function(t){fz(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lz(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function fz(e,t,r){return t=function(e){var t=function(e,t){if("object"!=sz(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=sz(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==sz(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}GF.prototype={areaStart:FF,areaEnd:FF,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},WF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},XF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:YF(this,this._t0,KF(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,YF(this,KF(this,r=ZF(this,e,t)),r);break;default:YF(this,this._t0,r=ZF(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}},(QF.prototype=Object.create(XF.prototype)).point=function(e,t){XF.prototype.point.call(this,t,e)},JF.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,o,i){this._context.bezierCurveTo(t,e,n,r,i,o)}},ez.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===r)this._context.lineTo(e[1],t[1]);else for(var n=tz(e),o=tz(t),i=0,a=1;a<r;++i,++a)this._context.bezierCurveTo(n[0][i],o[0][i],n[1][i],o[1][i],e[a],t[a]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},rz.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}}this._x=e,this._y=t}};var dz={curveBasisClosed:function(e){return new VF(e)},curveBasisOpen:function(e){return new $F(e)},curveBasis:function(e){return new BF(e)},curveBumpX:function(e){return new UF(e,!0)},curveBumpY:function(e){return new UF(e,!1)},curveLinearClosed:function(e){return new GF(e)},curveLinear:qF,curveMonotoneX:function(e){return new XF(e)},curveMonotoneY:function(e){return new QF(e)},curveNatural:function(e){return new ez(e)},curveStep:function(e){return new rz(e,.5)},curveStepAfter:function(e){return new rz(e,1)},curveStepBefore:function(e){return new rz(e,0)}},pz=function(e){return e.x===+e.x&&e.y===+e.y},hz=function(e){return e.x},mz=function(e){return e.y},yz=function(e){var t,r=e.type,n=void 0===r?"linear":r,o=e.points,i=void 0===o?[]:o,a=e.baseLine,s=e.layout,u=e.connectNulls,l=void 0!==u&&u,c=function(e,t){if(V_()(e))return e;var r="curve".concat(PS()(e));return"curveMonotone"!==r&&"curveBump"!==r||!t?dz[r]||qF:dz["".concat(r).concat("vertical"===t?"Y":"X")]}(n,s),f=l?i.filter((function(e){return pz(e)})):i;if(Array.isArray(a)){var d=l?a.filter((function(e){return pz(e)})):a,p=f.map((function(e,t){return cz(cz({},e),{},{base:d[t]})}));return t="vertical"===s?az().y(mz).x1(hz).x0((function(e){return e.base.x})):az().x(hz).y1(mz).y0((function(e){return e.base.y})),t.defined(pz).curve(c),t(p)}return(t="vertical"===s&&C_(a)?az().y(mz).x1(hz).x0(a):C_(a)?az().x(hz).y1(mz).y0(a):iz().x(hz).y(mz)).defined(pz).curve(c),t(f)},vz=function(e){var t=e.className,r=e.points,n=e.path,o=e.pathRef;if(!(r&&r.length||n))return null;var a=r&&r.length?yz(e):n;return i().createElement("path",uz({},pO(e,!1),X_(e),{className:gt("recharts-curve",t),d:a,ref:o}))};function gz(e){return gz="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},gz(e)}var bz=["x","y","top","left","width","height","className"];function wz(){return wz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wz.apply(this,arguments)}function xz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _z(e,t,r){return t=function(e){var t=function(e,t){if("object"!=gz(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=gz(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==gz(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oz(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var Sz=function(e,t,r,n,o,i){return"M".concat(e,",").concat(o,"v").concat(n,"M").concat(i,",").concat(t,"h").concat(r)},Ez=function(e){var t=e.x,r=void 0===t?0:t,n=e.y,o=void 0===n?0:n,a=e.top,s=void 0===a?0:a,u=e.left,l=void 0===u?0:u,c=e.width,f=void 0===c?0:c,d=e.height,p=void 0===d?0:d,h=e.className,m=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xz(Object(r),!0).forEach((function(t){_z(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xz(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({x:r,y:o,top:s,left:l,width:f,height:p},Oz(e,bz));return C_(r)&&C_(o)&&C_(f)&&C_(p)&&C_(s)&&C_(l)?i().createElement("path",wz({},pO(m,!0),{className:gt("recharts-cross",h),d:Sz(r,o,f,p,s,l)})):null};function jz(e){var t=e.cx,r=e.cy,n=e.radius,o=e.startAngle,i=e.endAngle;return{points:[SL(t,r,n,o),SL(t,r,n,i)],cx:t,cy:r,radius:n,startAngle:o,endAngle:i}}function Pz(e,t,r){var n,o,i,a;if("horizontal"===e)i=n=t.x,o=r.top,a=r.top+r.height;else if("vertical"===e)a=o=t.y,n=r.left,i=r.left+r.width;else if(null!=t.cx&&null!=t.cy){if("centric"!==e)return jz(t);var s=t.cx,u=t.cy,l=t.innerRadius,c=t.outerRadius,f=t.angle,d=SL(s,u,l,f),p=SL(s,u,c,f);n=d.x,o=d.y,i=p.x,a=p.y}return[{x:n,y:o},{x:i,y:a}]}function kz(e){return kz="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},kz(e)}function Cz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Az(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Cz(Object(r),!0).forEach((function(t){Nz(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cz(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Nz(e,t,r){return t=function(e){var t=function(e,t){if("object"!=kz(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=kz(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==kz(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tz(e){var t,n,o,i=e.element,a=e.tooltipEventType,s=e.isActive,u=e.activeCoordinate,l=e.activePayload,c=e.offset,f=e.activeTooltipIndex,d=e.tooltipAxisBandSize,p=e.layout,h=e.chartName,m=null!==(t=i.props.cursor)&&void 0!==t?t:null===(n=i.type.defaultProps)||void 0===n?void 0:n.cursor;if(!i||!m||!s||!u||"ScatterChart"!==h&&"axis"!==a)return null;var y=vz;if("ScatterChart"===h)o=u,y=Ez;else if("BarChart"===h)o=function(e,t,r,n){var o=n/2;return{stroke:"none",fill:"#ccc",x:"horizontal"===e?t.x-o:r.left+.5,y:"horizontal"===e?r.top+.5:t.y-o,width:"horizontal"===e?n:r.width-1,height:"horizontal"===e?r.height-1:n}}(p,u,c,d),y=PP;else if("radial"===p){var v=jz(u),g=v.cx,b=v.cy,w=v.radius;o={cx:g,cy:b,startAngle:v.startAngle,endAngle:v.endAngle,innerRadius:w,outerRadius:w},y=kI}else o={points:Pz(p,u,c)},y=vz;var x=Az(Az(Az(Az({stroke:"#ccc",pointerEvents:"none"},c),o),pO(m,!1)),{},{payload:l,payloadIndex:f,className:gt("recharts-tooltip-cursor",m.className)});return(0,r.isValidElement)(m)?(0,r.cloneElement)(m,x):(0,r.createElement)(y,x)}var Mz=["item"],Rz=["children","className","width","height","style","compact","title","desc"];function Lz(e){return Lz="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},Lz(e)}function Iz(){return Iz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Iz.apply(this,arguments)}function Dz(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||Wz(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.")}()}function Fz(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function zz(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Yz(n.key),n)}}function Bz(e,t,r){return t=$z(t),function(e,t){if(t&&("object"===Lz(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Vz()?Reflect.construct(t,r||[],$z(e).constructor):t.apply(e,r))}function Vz(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Vz=function(){return!!e})()}function $z(e){return $z=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$z(e)}function Uz(e,t){return Uz=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Uz(e,t)}function Gz(e){return function(e){if(Array.isArray(e))return qz(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Wz(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.")}()}function Wz(e,t){if(e){if("string"==typeof e)return qz(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qz(e,t):void 0}}function qz(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Hz(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Zz(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hz(Object(r),!0).forEach((function(t){Kz(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hz(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Kz(e,t,r){return(t=Yz(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yz(e){var t=function(e,t){if("object"!=Lz(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=Lz(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Lz(t)?t:t+""}var Xz={xAxis:["bottom","top"],yAxis:["left","right"]},Qz={width:"100%",height:"100%"},Jz={x:0,y:0};function eB(e){return e}var tB=function(e,t){var r=t.graphicalItems,n=t.dataStartIndex,o=t.dataEndIndex,i=(null!=r?r:[]).reduce((function(e,t){var r=t.props.data;return r&&r.length?[].concat(Gz(e),Gz(r)):e}),[]);return i.length>0?i:e&&e.length&&C_(n)&&C_(o)?e.slice(n,o+1):[]};function rB(e){return"number"===e?[0,"auto"]:void 0}var nB=function(e,t,r,n){var o=e.graphicalItems,i=e.tooltipAxis,a=tB(t,e);return r<0||!o||!o.length||r>=a.length?null:o.reduce((function(o,s){var u,l,c=null!==(u=s.props.data)&&void 0!==u?u:t;(c&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=r&&(c=c.slice(e.dataStartIndex,e.dataEndIndex+1)),i.dataKey&&!i.allowDuplicatedCategory)?l=I_(void 0===c?a:c,i.dataKey,n):l=c&&c[r]||a[r];return l?[].concat(Gz(o),[JR(s,l)]):o}),[])},oB=function(e,t,r,n){var o=n||{x:e.chartX,y:e.chartY},i=function(e,t){return"horizontal"===t?e.x:"vertical"===t?e.y:"centric"===t?e.angle:e.radius}(o,r),a=e.orderedTooltipTicks,s=e.tooltipAxis,u=e.tooltipTicks,l=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=-1,a=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0;if(a<=1)return 0;if(o&&"angleAxis"===o.axisType&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var s=o.range,u=0;u<a;u++){var l=u>0?n[u-1].coordinate:n[a-1].coordinate,c=n[u].coordinate,f=u>=a-1?n[0].coordinate:n[u+1].coordinate,d=void 0;if(P_(c-l)!==P_(f-c)){var p=[];if(P_(f-c)===P_(s[1]-s[0])){d=f;var h=c+s[1]-s[0];p[0]=Math.min(h,(h+l)/2),p[1]=Math.max(h,(h+l)/2)}else{d=l;var m=f+s[1]-s[0];p[0]=Math.min(c,(m+c)/2),p[1]=Math.max(c,(m+c)/2)}var y=[Math.min(c,(d+c)/2),Math.max(c,(d+c)/2)];if(e>y[0]&&e<=y[1]||e>=p[0]&&e<=p[1]){i=n[u].index;break}}else{var v=Math.min(l,f),g=Math.max(l,f);if(e>(v+c)/2&&e<=(g+c)/2){i=n[u].index;break}}}else for(var b=0;b<a;b++)if(0===b&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b>0&&b<a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2&&e<=(r[b].coordinate+r[b+1].coordinate)/2||b===a-1&&e>(r[b].coordinate+r[b-1].coordinate)/2){i=r[b].index;break}return i}(i,a,u,s);if(l>=0&&u){var c=u[l]&&u[l].value,f=nB(e,t,l,c),d=function(e,t,r,n){var o=t.find((function(e){return e&&e.index===r}));if(o){if("horizontal"===e)return{x:o.coordinate,y:n.y};if("vertical"===e)return{x:n.x,y:o.coordinate};if("centric"===e){var i=o.coordinate,a=n.radius;return Zz(Zz(Zz({},n),SL(n.cx,n.cy,a,i)),{},{angle:i,radius:a})}var s=o.coordinate,u=n.angle;return Zz(Zz(Zz({},n),SL(n.cx,n.cy,s,u)),{},{angle:u,radius:s})}return Jz}(r,a,l,o);return{activeTooltipIndex:l,activeLabel:c,activePayload:f,activeCoordinate:d}}return null},iB=function(e,t){var r=t.axes,n=t.graphicalItems,o=t.axisType,i=t.axisIdKey,a=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,l=e.layout,c=e.children,f=e.stackOffset,d=DR(l,o);return r.reduce((function(t,r){var p,h=void 0!==r.type.defaultProps?Zz(Zz({},r.type.defaultProps),r.props):r.props,m=h.type,y=h.dataKey,v=h.allowDataOverflow,g=h.allowDuplicatedCategory,b=h.scale,w=h.ticks,x=h.includeHidden,_=h[i];if(t[_])return t;var O,S,E,j=tB(e.data,{graphicalItems:n.filter((function(e){var t;return(i in e.props?e.props[i]:null===(t=e.type.defaultProps)||void 0===t?void 0:t[i])===_})),dataStartIndex:s,dataEndIndex:u}),P=j.length;(function(e,t,r){if("number"===r&&!0===t&&Array.isArray(e)){var n=null==e?void 0:e[0],o=null==e?void 0:e[1];if(n&&o&&C_(n)&&C_(o))return!0}return!1})(h.domain,v,m)&&(O=YR(h.domain,null,v),!d||"number"!==m&&"auto"===b||(E=MR(j,y,"category")));var k=rB(m);if(!O||0===O.length){var C,A=null!==(C=h.domain)&&void 0!==C?C:k;if(y){if(O=MR(j,y,m),"category"===m&&d){var N=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;n<t;n++){if(r[e[n]])return!0;r[e[n]]=!0}return!1}(O);g&&N?(S=O,O=EO()(0,P)):g||(O=QR(A,O,r).reduce((function(e,t){return e.indexOf(t)>=0?e:[].concat(Gz(e),[t])}),[]))}else if("category"===m)O=g?O.filter((function(e){return""!==e&&!z_()(e)})):QR(A,O,r).reduce((function(e,t){return e.indexOf(t)>=0||""===t||z_()(t)?e:[].concat(Gz(e),[t])}),[]);else if("number"===m){var T=function(e,t,r,n,o){var i=t.map((function(t){return LR(e,t,r,o,n)})).filter((function(e){return!z_()(e)}));return i&&i.length?i.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0]):null}(j,n.filter((function(e){var t,r,n=i in e.props?e.props[i]:null===(t=e.type.defaultProps)||void 0===t?void 0:t[i],o="hide"in e.props?e.props.hide:null===(r=e.type.defaultProps)||void 0===r?void 0:r.hide;return n===_&&(x||!o)})),y,o,l);T&&(O=T)}!d||"number"!==m&&"auto"===b||(E=MR(j,y,"category"))}else O=d?EO()(0,P):a&&a[_]&&a[_].hasStack&&"number"===m?"expand"===f?[0,1]:HR(a[_].stackGroups,s,u):IR(j,n.filter((function(e){var t=i in e.props?e.props[i]:e.type.defaultProps[i],r="hide"in e.props?e.props.hide:e.type.defaultProps.hide;return t===_&&(x||!r)})),m,l,!0);if("number"===m)O=CF(c,O,_,o,w),A&&(O=YR(A,O,v));else if("category"===m&&A){var M=A;O.every((function(e){return M.indexOf(e)>=0}))&&(O=M)}}return Zz(Zz({},t),{},Kz({},_,Zz(Zz({},h),{},{axisType:o,domain:O,categoricalDomain:E,duplicateDomain:S,originalDomain:null!==(p=h.domain)&&void 0!==p?p:k,isCategorical:d,layout:l})))}),{})},aB=function(e,t){var r=t.axisType,n=void 0===r?"xAxis":r,o=t.AxisComp,i=t.graphicalItems,a=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,l=e.children,c="".concat(n,"Id"),f=uO(l,o),d={};return f&&f.length?d=iB(e,{axes:f,graphicalItems:i,axisType:n,axisIdKey:c,stackGroups:a,dataStartIndex:s,dataEndIndex:u}):i&&i.length&&(d=function(e,t){var r=t.graphicalItems,n=t.Axis,o=t.axisType,i=t.axisIdKey,a=t.stackGroups,s=t.dataStartIndex,u=t.dataEndIndex,l=e.layout,c=e.children,f=tB(e.data,{graphicalItems:r,dataStartIndex:s,dataEndIndex:u}),d=f.length,p=DR(l,o),h=-1;return r.reduce((function(e,t){var m,y=(void 0!==t.type.defaultProps?Zz(Zz({},t.type.defaultProps),t.props):t.props)[i],v=rB("number");return e[y]?e:(h++,p?m=EO()(0,d):a&&a[y]&&a[y].hasStack?(m=HR(a[y].stackGroups,s,u),m=CF(c,m,y,o)):(m=YR(v,IR(f,r.filter((function(e){var t,r,n=i in e.props?e.props[i]:null===(t=e.type.defaultProps)||void 0===t?void 0:t[i],o="hide"in e.props?e.props.hide:null===(r=e.type.defaultProps)||void 0===r?void 0:r.hide;return n===y&&!o})),"number",l),n.defaultProps.allowDataOverflow),m=CF(c,m,y,o)),Zz(Zz({},e),{},Kz({},y,Zz(Zz({axisType:o},n.defaultProps),{},{hide:!0,orientation:S_()(Xz,"".concat(o,".").concat(h%2),null),domain:m,originalDomain:v,isCategorical:p,layout:l}))))}),{})}(e,{Axis:o,graphicalItems:i,axisType:n,axisIdKey:c,stackGroups:a,dataStartIndex:s,dataEndIndex:u})),d},sB=function(e){var t=e.children,r=e.defaultShowTooltip,n=lO(t,vL),o=0,i=0;return e.data&&0!==e.data.length&&(i=e.data.length-1),n&&n.props&&(n.props.startIndex>=0&&(o=n.props.startIndex),n.props.endIndex>=0&&(i=n.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:i,activeTooltipIndex:-1,isTooltipActive:Boolean(r)}},uB=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},lB=function(e,t){var r=e.props,n=(e.graphicalItems,e.xAxisMap),o=void 0===n?{}:n,i=e.yAxisMap,a=void 0===i?{}:i,s=r.width,u=r.height,l=r.children,c=r.margin||{},f=lO(l,vL),d=lO(l,zE),p=Object.keys(a).reduce((function(e,t){var r=a[t],n=r.orientation;return r.mirror||r.hide?e:Zz(Zz({},e),{},Kz({},n,e[n]+r.width))}),{left:c.left||0,right:c.right||0}),h=Object.keys(o).reduce((function(e,t){var r=o[t],n=r.orientation;return r.mirror||r.hide?e:Zz(Zz({},e),{},Kz({},n,S_()(e,"".concat(n))+r.height))}),{top:c.top||0,bottom:c.bottom||0}),m=Zz(Zz({},h),p),y=m.bottom;f&&(m.bottom+=f.props.height||vL.defaultProps.height),d&&t&&(m=function(e,t,r,n){var o=r.children,i=r.width,a=r.margin,s=i-(a.left||0)-(a.right||0),u=ER({children:o,legendWidth:s});if(u){var l=n||{},c=l.width,f=l.height,d=u.align,p=u.verticalAlign,h=u.layout;if(("vertical"===h||"horizontal"===h&&"middle"===p)&&"center"!==d&&C_(e[d]))return AR(AR({},e),{},NR({},d,e[d]+(c||0)));if(("horizontal"===h||"vertical"===h&&"center"===d)&&"middle"!==p&&C_(e[p]))return AR(AR({},e),{},NR({},p,e[p]+(f||0)))}return e}(m,0,r,t));var v=s-m.left-m.right,g=u-m.top-m.bottom;return Zz(Zz({brushBottom:y},m),{},{width:Math.max(v,0),height:Math.max(g,0)})},cB=function(e,t){return"xAxis"===t?e[t].width:"yAxis"===t?e[t].height:void 0},fB=["type","layout","connectNulls","ref"],dB=["key"];function pB(e){return pB="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},pB(e)}function hB(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function mB(){return mB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mB.apply(this,arguments)}function yB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?yB(Object(r),!0).forEach((function(t){EB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function gB(e){return function(e){if(Array.isArray(e))return bB(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return bB(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bB(e,t)}(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.")}()}function bB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function wB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,jB(n.key),n)}}function xB(e,t,r){return t=OB(t),function(e,t){if(t&&("object"===pB(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,_B()?Reflect.construct(t,r||[],OB(e).constructor):t.apply(e,r))}function _B(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_B=function(){return!!e})()}function OB(e){return OB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},OB(e)}function SB(e,t){return SB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},SB(e,t)}function EB(e,t,r){return(t=jB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jB(e){var t=function(e,t){if("object"!=pB(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=pB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==pB(t)?t:t+""}var PB=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return EB(e=xB(this,t,[].concat(n)),"state",{isAnimationFinished:!0,totalLength:0}),EB(e,"generateSimpleStrokeDasharray",(function(e,t){return"".concat(t,"px ").concat(e-t,"px")})),EB(e,"getStrokeDasharray",(function(r,n,o){var i=o.reduce((function(e,t){return e+t}));if(!i)return e.generateSimpleStrokeDasharray(n,r);for(var a=Math.floor(r/i),s=r%i,u=n-r,l=[],c=0,f=0;c<o.length;f+=o[c],++c)if(f+o[c]>s){l=[].concat(gB(o.slice(0,c)),[s-f]);break}var d=l.length%2==0?[0,u]:[u];return[].concat(gB(t.repeat(o,a)),gB(l),d).map((function(e){return"".concat(e,"px")})).join(", ")})),EB(e,"id",T_("recharts-line-")),EB(e,"pathRef",(function(t){e.mainCurve=t})),EB(e,"handleAnimationEnd",(function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()})),EB(e,"handleAnimationStart",(function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()})),e}return function(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&&SB(e,t)}(t,e),r=t,n=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var r=this.props,n=r.points,o=r.xAxis,a=r.yAxis,s=r.layout,u=uO(r.children,wR);if(!u)return null;var l=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:TR(e.payload,t)}},c={clipPath:e?"url(#clipPath-".concat(t,")"):null};return i().createElement(DO,c,u.map((function(e){return i().cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:n,xAxis:o,yAxis:a,layout:s,dataPointFormatter:l})})))}},{key:"renderDots",value:function(e,r,n){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,a=o.dot,s=o.points,u=o.dataKey,l=pO(this.props,!1),c=pO(a,!0),f=s.map((function(e,r){var n=vB(vB(vB({key:"dot-".concat(r),r:3},l),c),{},{value:e.value,dataKey:u,cx:e.x,cy:e.y,index:r,payload:e.payload});return t.renderDotItem(a,n)})),d={clipPath:e?"url(#clipPath-".concat(r?"":"dots-").concat(n,")"):null};return i().createElement(DO,mB({className:"recharts-line-dots",key:"dots"},d),f)}},{key:"renderCurveStatically",value:function(e,t,r,n){var o=this.props,a=o.type,s=o.layout,u=o.connectNulls,l=(o.ref,hB(o,fB)),c=vB(vB(vB({},pO(l,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(r,")"):null,points:e},n),{},{type:a,layout:s,connectNulls:u});return i().createElement(vz,mB({},c,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var r=this,n=this.props,o=n.points,a=n.strokeDasharray,s=n.isAnimationActive,u=n.animationBegin,l=n.animationDuration,c=n.animationEasing,f=n.animationId,d=n.animateNewValues,p=n.width,h=n.height,m=this.state,y=m.prevPoints,v=m.totalLength;return i().createElement(yP,{begin:u,duration:l,isActive:s,easing:c,from:{t:0},to:{t:1},key:"line-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},(function(n){var i=n.t;if(y){var s=y.length/o.length,u=o.map((function(e,t){var r=Math.floor(t*s);if(y[r]){var n=y[r],o=L_(n.x,e.x),a=L_(n.y,e.y);return vB(vB({},e),{},{x:o(i),y:a(i)})}if(d){var u=L_(2*p,e.x),l=L_(h/2,e.y);return vB(vB({},e),{},{x:u(i),y:l(i)})}return vB(vB({},e),{},{x:e.x,y:e.y})}));return r.renderCurveStatically(u,e,t)}var l,c=L_(0,v)(i);if(a){var f="".concat(a).split(/[,\s]+/gim).map((function(e){return parseFloat(e)}));l=r.getStrokeDasharray(c,v,f)}else l=r.generateSimpleStrokeDasharray(v,c);return r.renderCurveStatically(o,e,t,{strokeDasharray:l})}))}},{key:"renderCurve",value:function(e,t){var r=this.props,n=r.points,o=r.isAnimationActive,i=this.state,a=i.prevPoints,s=i.totalLength;return o&&n&&n.length&&(!a&&s>0||!NM()(a,n))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(n,e,t)}},{key:"render",value:function(){var e,t=this.props,r=t.hide,n=t.dot,o=t.points,a=t.className,s=t.xAxis,u=t.yAxis,l=t.top,c=t.left,f=t.width,d=t.height,p=t.isAnimationActive,h=t.id;if(r||!o||!o.length)return null;var m=this.state.isAnimationFinished,y=1===o.length,v=gt("recharts-line",a),g=s&&s.allowDataOverflow,b=u&&u.allowDataOverflow,w=g||b,x=z_()(h)?this.id:h,_=null!==(e=pO(n,!1))&&void 0!==e?e:{r:3,strokeWidth:2},O=_.r,S=void 0===O?3:O,E=_.strokeWidth,j=void 0===E?2:E,P=(function(e){return e&&"object"===rO(e)&&"clipDot"in e}(n)?n:{}).clipDot,k=void 0===P||P,C=2*S+j;return i().createElement(DO,{className:v},g||b?i().createElement("defs",null,i().createElement("clipPath",{id:"clipPath-".concat(x)},i().createElement("rect",{x:g?c:c-f/2,y:b?l:l-d/2,width:g?f:2*f,height:b?d:2*d})),!k&&i().createElement("clipPath",{id:"clipPath-dots-".concat(x)},i().createElement("rect",{x:c-C/2,y:l-C/2,width:f+C,height:d+C}))):null,!y&&this.renderCurve(w,x),this.renderErrorBar(w,x),(y||n)&&this.renderDots(w,k,x),(!p||m)&&iI.renderCallByParent(this.props,o))}}],o=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var r=e.length%2!=0?[].concat(gB(e),[0]):e,n=[],o=0;o<t;++o)n=[].concat(gB(n),gB(r));return n}},{key:"renderDotItem",value:function(e,t){var r;if(i().isValidElement(e))r=i().cloneElement(e,t);else if(V_()(e))r=e(t);else{var n=t.key,o=hB(t,dB),a=gt("recharts-line-dot","boolean"!=typeof e?e.className:"");r=i().createElement(VE,mB({key:n},o,{className:a}))}return r}}],n&&wB(r.prototype,n),o&&wB(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.PureComponent);function kB(e,t,r){if(t<1)return[];if(1===t&&void 0===r)return e;for(var n=[],o=0;o<e.length;o+=t){if(void 0!==r&&!0!==r(e[o]))return;n.push(e[o])}return n}function CB(e,t,r){return function(e){var t=e.width,r=e.height,n=function(e){return(e%180+180)%180}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0),o=n*Math.PI/180,i=Math.atan(r/t),a=o>i&&o<Math.PI-i?r/Math.sin(o):t/Math.cos(o);return Math.abs(a)}({width:e.width+t.width,height:e.height+t.height},r)}function AB(e,t,r,n,o){if(e*t<e*n||e*t>e*o)return!1;var i=r();return e*(t-e*i/2-n)>=0&&e*(t+e*i/2-o)<=0}function NB(e){return NB="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},NB(e)}function TB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function MB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?TB(Object(r),!0).forEach((function(t){RB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):TB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function RB(e,t,r){return t=function(e){var t=function(e,t){if("object"!=NB(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=NB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==NB(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LB(e,t,r){var n=e.tick,o=e.ticks,i=e.viewBox,a=e.minTickGap,s=e.orientation,u=e.interval,l=e.tickFormatter,c=e.unit,f=e.angle;if(!o||!o.length||!n)return[];if(C_(u)||cS.isSsr)return function(e,t){return kB(e,t+1)}(o,"number"==typeof u&&C_(u)?u:0);var d=[],p="top"===s||"bottom"===s?"width":"height",h=c&&"width"===p?HP(c,{fontSize:t,letterSpacing:r}):{width:0,height:0},m=function(e,n){var o=V_()(l)?l(e.value,n):e.value;return"width"===p?CB(HP(o,{fontSize:t,letterSpacing:r}),h,f):HP(o,{fontSize:t,letterSpacing:r})[p]},y=o.length>=2?P_(o[1].coordinate-o[0].coordinate):1,v=function(e,t,r){var n="width"===r,o=e.x,i=e.y,a=e.width,s=e.height;return 1===t?{start:n?o:i,end:n?o+a:i+s}:{start:n?o+a:i+s,end:n?o:i}}(i,y,p);return"equidistantPreserveStart"===u?function(e,t,r,n,o){for(var i,a=(n||[]).slice(),s=t.start,u=t.end,l=0,c=1,f=s,d=function(){var t=null==n?void 0:n[l];if(void 0===t)return{v:kB(n,c)};var i,a=l,d=function(){return void 0===i&&(i=r(t,a)),i},p=t.coordinate,h=0===l||AB(e,p,d,f,u);h||(l=0,f=s,c+=1),h&&(f=p+e*(d()/2+o),l+=c)};c<=a.length;)if(i=d())return i.v;return[]}(y,v,m,o,a):(d="preserveStart"===u||"preserveStartEnd"===u?function(e,t,r,n,o,i){var a=(n||[]).slice(),s=a.length,u=t.start,l=t.end;if(i){var c=n[s-1],f=r(c,s-1),d=e*(c.coordinate+e*f/2-l);a[s-1]=c=MB(MB({},c),{},{tickCoord:d>0?c.coordinate-d*e:c.coordinate}),AB(e,c.tickCoord,(function(){return f}),u,l)&&(l=c.tickCoord-e*(f/2+o),a[s-1]=MB(MB({},c),{},{isShow:!0}))}for(var p=i?s-1:s,h=function(t){var n,i=a[t],s=function(){return void 0===n&&(n=r(i,t)),n};if(0===t){var c=e*(i.coordinate-e*s()/2-u);a[t]=i=MB(MB({},i),{},{tickCoord:c<0?i.coordinate-c*e:i.coordinate})}else a[t]=i=MB(MB({},i),{},{tickCoord:i.coordinate});AB(e,i.tickCoord,s,u,l)&&(u=i.tickCoord+e*(s()/2+o),a[t]=MB(MB({},i),{},{isShow:!0}))},m=0;m<p;m++)h(m);return a}(y,v,m,o,a,"preserveStartEnd"===u):function(e,t,r,n,o){for(var i=(n||[]).slice(),a=i.length,s=t.start,u=t.end,l=function(t){var n,l=i[t],c=function(){return void 0===n&&(n=r(l,t)),n};if(t===a-1){var f=e*(l.coordinate+e*c()/2-u);i[t]=l=MB(MB({},l),{},{tickCoord:f>0?l.coordinate-f*e:l.coordinate})}else i[t]=l=MB(MB({},l),{},{tickCoord:l.coordinate});AB(e,l.tickCoord,c,s,u)&&(u=l.tickCoord-e*(c()/2+o),i[t]=MB(MB({},l),{},{isShow:!0}))},c=a-1;c>=0;c--)l(c);return i}(y,v,m,o,a),d.filter((function(e){return e.isShow})))}EB(PB,"displayName","Line"),EB(PB,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!cS.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),EB(PB,"getComposedData",(function(e){var t=e.props,r=e.xAxis,n=e.yAxis,o=e.xAxisTicks,i=e.yAxisTicks,a=e.dataKey,s=e.bandSize,u=e.displayedData,l=e.offset,c=t.layout,f=u.map((function(e,t){var u=TR(e,a);return"horizontal"===c?{x:WR({axis:r,ticks:o,bandSize:s,entry:e,index:t}),y:z_()(u)?null:n.scale(u),value:u,payload:e}:{x:z_()(u)?null:r.scale(u),y:WR({axis:n,ticks:i,bandSize:s,entry:e,index:t}),value:u,payload:e}}));return vB({points:f,layout:c},l)}));var IB=["viewBox"],DB=["viewBox"],FB=["ticks"];function zB(e){return zB="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},zB(e)}function BB(){return BB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BB.apply(this,arguments)}function VB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function $B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?VB(Object(r),!0).forEach((function(t){KB(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):VB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function UB(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function GB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,YB(n.key),n)}}function WB(e,t,r){return t=HB(t),function(e,t){if(t&&("object"===zB(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,qB()?Reflect.construct(t,r||[],HB(e).constructor):t.apply(e,r))}function qB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(qB=function(){return!!e})()}function HB(e){return HB=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},HB(e)}function ZB(e,t){return ZB=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ZB(e,t)}function KB(e,t,r){return(t=YB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YB(e){var t=function(e,t){if("object"!=zB(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=zB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zB(t)?t:t+""}var XB=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=WB(this,t,[e])).state={fontSize:"",letterSpacing:""},r}return function(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&&ZB(e,t)}(t,e),r=t,n=[{key:"shouldComponentUpdate",value:function(e,t){var r=e.viewBox,n=UB(e,IB),o=this.props,i=o.viewBox,a=UB(o,DB);return!W_(r,i)||!W_(n,a)||!W_(t,this.state)}},{key:"componentDidMount",value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:"getTickLineCoord",value:function(e){var t,r,n,o,i,a,s=this.props,u=s.x,l=s.y,c=s.width,f=s.height,d=s.orientation,p=s.tickSize,h=s.mirror,m=s.tickMargin,y=h?-1:1,v=e.tickSize||p,g=C_(e.tickCoord)?e.tickCoord:e.coordinate;switch(d){case"top":t=r=e.coordinate,a=(n=(o=l+ +!h*f)-y*v)-y*m,i=g;break;case"left":n=o=e.coordinate,i=(t=(r=u+ +!h*c)-y*v)-y*m,a=g;break;case"right":n=o=e.coordinate,i=(t=(r=u+ +h*c)+y*v)+y*m,a=g;break;default:t=r=e.coordinate,a=(n=(o=l+ +h*f)+y*v)+y*m,i=g}return{line:{x1:t,y1:n,x2:r,y2:o},tick:{x:i,y:a}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,r=t.orientation,n=t.mirror;switch(r){case"left":e=n?"start":"end";break;case"right":e=n?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,r=e.mirror,n="end";switch(t){case"left":case"right":n="middle";break;case"top":n=r?"start":"end";break;default:n=r?"end":"start"}return n}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,r=e.y,n=e.width,o=e.height,a=e.orientation,s=e.mirror,u=e.axisLine,l=$B($B($B({},pO(this.props,!1)),pO(u,!1)),{},{fill:"none"});if("top"===a||"bottom"===a){var c=+("top"===a&&!s||"bottom"===a&&s);l=$B($B({},l),{},{x1:t,y1:r+c*o,x2:t+n,y2:r+c*o})}else{var f=+("left"===a&&!s||"right"===a&&s);l=$B($B({},l),{},{x1:t+f*n,y1:r,x2:t+f*n,y2:r+o})}return i().createElement("line",BB({},l,{className:gt("recharts-cartesian-axis-line",S_()(u,"className"))}))}},{key:"renderTicks",value:function(e,r,n){var o=this,a=this.props,s=a.tickLine,u=a.stroke,l=a.tick,c=a.tickFormatter,f=a.unit,d=LB($B($B({},this.props),{},{ticks:e}),r,n),p=this.getTickTextAnchor(),h=this.getTickVerticalAnchor(),m=pO(this.props,!1),y=pO(l,!1),v=$B($B({},m),{},{fill:"none"},pO(s,!1)),g=d.map((function(e,r){var n=o.getTickLineCoord(e),a=n.line,g=n.tick,b=$B($B($B($B({textAnchor:p,verticalAnchor:h},m),{},{stroke:"none",fill:u},y),g),{},{index:r,payload:e,visibleTicksCount:d.length,tickFormatter:c});return i().createElement(DO,BB({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e.value,"-").concat(e.coordinate,"-").concat(e.tickCoord)},Q_(o.props,e,r)),s&&i().createElement("line",BB({},v,a,{className:gt("recharts-cartesian-axis-tick-line",S_()(s,"className"))})),l&&t.renderTickItem(l,b,"".concat(V_()(c)?c(e.value,r):e.value).concat(f||"")))}));return i().createElement("g",{className:"recharts-cartesian-axis-ticks"},g)}},{key:"render",value:function(){var e=this,t=this.props,r=t.axisLine,n=t.width,o=t.height,a=t.ticksGenerator,s=t.className;if(t.hide)return null;var u=this.props,l=u.ticks,c=UB(u,FB),f=l;return V_()(a)&&(f=l&&l.length>0?a(this.props):a(c)),n<=0||o<=0||!f||!f.length?null:i().createElement(DO,{className:gt("recharts-cartesian-axis",s),ref:function(t){e.layerReference=t}},r&&this.renderAxisLine(),this.renderTicks(f,this.state.fontSize,this.state.letterSpacing),FL.renderCallByParent(this.props))}}],o=[{key:"renderTickItem",value:function(e,t,r){return i().isValidElement(e)?i().cloneElement(e,t):V_()(e)?e(t):i().createElement(_k,BB({},t,{className:"recharts-cartesian-axis-tick-value"}),r)}}],n&&GB(r.prototype,n),o&&GB(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(r.Component);function QB(e){return QB="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},QB(e)}function JB(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,iV(n.key),n)}}function eV(e,t,r){return t=rV(t),function(e,t){if(t&&("object"===QB(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,tV()?Reflect.construct(t,r||[],rV(e).constructor):t.apply(e,r))}function tV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(tV=function(){return!!e})()}function rV(e){return rV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rV(e)}function nV(e,t){return nV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nV(e,t)}function oV(e,t,r){return(t=iV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iV(e){var t=function(e,t){if("object"!=QB(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=QB(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==QB(t)?t:t+""}function aV(){return aV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aV.apply(this,arguments)}function sV(e){var t=e.xAxisId,r=QD(),n=JD(),o=YD(t);return null==o?null:i().createElement(XB,aV({},o,{className:gt("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(e){return zR(e,!0)}}))}KB(XB,"displayName","CartesianAxis"),KB(XB,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var uV=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),eV(this,t,arguments)}return function(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&&nV(e,t)}(t,e),r=t,(n=[{key:"render",value:function(){return i().createElement(sV,this.props)}}])&&JB(r.prototype,n),o&&JB(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(i().Component);function lV(e){return lV="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},lV(e)}function cV(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,yV(n.key),n)}}function fV(e,t,r){return t=pV(t),function(e,t){if(t&&("object"===lV(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,dV()?Reflect.construct(t,r||[],pV(e).constructor):t.apply(e,r))}function dV(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(dV=function(){return!!e})()}function pV(e){return pV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},pV(e)}function hV(e,t){return hV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hV(e,t)}function mV(e,t,r){return(t=yV(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yV(e){var t=function(e,t){if("object"!=lV(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=lV(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==lV(t)?t:t+""}function vV(){return vV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vV.apply(this,arguments)}oV(uV,"displayName","XAxis"),oV(uV,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});var gV=function(e){var t=e.yAxisId,r=QD(),n=JD(),o=XD(t);return null==o?null:i().createElement(XB,vV({},o,{className:gt("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(e){return zR(e,!0)}}))},bV=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),fV(this,t,arguments)}return function(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&&hV(e,t)}(t,e),r=t,(n=[{key:"render",value:function(){return i().createElement(gV,this.props)}}])&&cV(r.prototype,n),o&&cV(r,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o}(i().Component);mV(bV,"displayName","YAxis"),mV(bV,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});var wV=function(e){var t=e.chartName,n=e.GraphicalChild,o=e.defaultTooltipEventType,a=void 0===o?"axis":o,s=e.validateTooltipEventTypes,u=void 0===s?["axis"]:s,l=e.axisComponents,c=e.legendContent,f=e.formatAxisMap,d=e.defaultProps,p=function(e,t){var r=t.graphicalItems,n=t.stackGroups,o=t.offset,i=t.updateId,a=t.dataStartIndex,s=t.dataEndIndex,u=e.barSize,c=e.layout,f=e.barGap,d=e.barCategoryGap,p=e.maxBarSize,h=uB(c),m=h.numericAxisName,y=h.cateAxisName,v=function(e){return!(!e||!e.length)&&e.some((function(e){var t=oO(e&&e.type);return t&&t.indexOf("Bar")>=0}))}(r),g=[];return r.forEach((function(r,h){var b=tB(e.data,{graphicalItems:[r],dataStartIndex:a,dataEndIndex:s}),w=void 0!==r.type.defaultProps?Zz(Zz({},r.type.defaultProps),r.props):r.props,x=w.dataKey,_=w.maxBarSize,O=w["".concat(m,"Id")],S=w["".concat(y,"Id")],E=l.reduce((function(e,r){var n=t["".concat(r.axisType,"Map")],o=w["".concat(r.axisType,"Id")];n&&n[o]||"zAxis"===r.axisType||CO(!1);var i=n[o];return Zz(Zz({},e),{},Kz(Kz({},r.axisType,i),"".concat(r.axisType,"Ticks"),zR(i)))}),{}),j=E[y],P=E["".concat(y,"Ticks")],k=n&&n[O]&&n[O].hasStack&&function(e,t){var r,n=(null!==(r=e.type)&&void 0!==r&&r.defaultProps?AR(AR({},e.type.defaultProps),e.props):e.props).stackId;if(A_(n)){var o=t[n];if(o){var i=o.items.indexOf(e);return i>=0?o.stackedData[i]:null}}return null}(r,n[O].stackGroups),C=oO(r.type).indexOf("Bar")>=0,A=XR(j,P),N=[],T=v&&function(e){var t=e.barSize,r=e.totalSize,n=e.stackGroups,o=void 0===n?{}:n;if(!o)return{};for(var i={},a=Object.keys(o),s=0,u=a.length;s<u;s++)for(var l=o[a[s]].stackGroups,c=Object.keys(l),f=0,d=c.length;f<d;f++){var p=l[c[f]],h=p.items,m=p.cateAxisId,y=h.filter((function(e){return oO(e.type).indexOf("Bar")>=0}));if(y&&y.length){var v=y[0].type.defaultProps,g=void 0!==v?AR(AR({},v),y[0].props):y[0].props,b=g.barSize,w=g[m];i[w]||(i[w]=[]);var x=z_()(b)?t:b;i[w].push({item:y[0],stackList:y.slice(1),barSize:z_()(x)?void 0:M_(x,r,0)})}}return i}({barSize:u,stackGroups:n,totalSize:cB(E,y)});if(C){var M,R,L=z_()(_)?p:_,I=null!==(M=null!==(R=XR(j,P,!0))&&void 0!==R?R:L)&&void 0!==M?M:0;N=function(e){var t=e.barGap,r=e.barCategoryGap,n=e.bandSize,o=e.sizeList,i=void 0===o?[]:o,a=e.maxBarSize,s=i.length;if(s<1)return null;var u,l=M_(t,n,0,!0),c=[];if(i[0].barSize===+i[0].barSize){var f=!1,d=n/s,p=i.reduce((function(e,t){return e+t.barSize||0}),0);(p+=(s-1)*l)>=n&&(p-=(s-1)*l,l=0),p>=n&&d>0&&(f=!0,p=s*(d*=.9));var h={offset:((n-p)/2|0)-l,size:0};u=i.reduce((function(e,t){var r={item:t.item,position:{offset:h.offset+h.size+l,size:f?d:t.barSize}},n=[].concat(PR(e),[r]);return h=n[n.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:h})})),n}),c)}else{var m=M_(r,n,0,!0);n-2*m-(s-1)*l<=0&&(l=0);var y=(n-2*m-(s-1)*l)/s;y>1&&(y>>=0);var v=a===+a?Math.min(y,a):y;u=i.reduce((function(e,t,r){var n=[].concat(PR(e),[{item:t.item,position:{offset:m+(y+l)*r+(y-v)/2,size:v}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach((function(e){n.push({item:e,position:n[n.length-1].position})})),n}),c)}return u}({barGap:f,barCategoryGap:d,bandSize:I!==A?I:A,sizeList:T[S],maxBarSize:L}),I!==A&&(N=N.map((function(e){return Zz(Zz({},e),{},{position:Zz(Zz({},e.position),{},{offset:e.position.offset-I/2})})})))}var D,F,z=r&&r.type&&r.type.getComposedData;z&&g.push({props:Zz(Zz({},z(Zz(Zz({},E),{},{displayedData:b,props:e,dataKey:x,item:r,bandSize:A,barPosition:N,offset:o,stackedData:k,layout:c,dataStartIndex:a,dataEndIndex:s}))),{},Kz(Kz(Kz({key:r.key||"item-".concat(h)},m,E[m]),y,E[y]),"animationId",i)),childIndex:(D=r,F=e.children,sO(F).indexOf(D)),item:r})})),g},h=function(e,r){var o=e.props,i=e.dataStartIndex,a=e.dataEndIndex,s=e.updateId;if(!cO({props:o}))return null;var u=o.children,c=o.layout,d=o.stackOffset,h=o.data,m=o.reverseStackOrder,y=uB(c),v=y.numericAxisName,g=y.cateAxisName,b=uO(u,n),w=function(e,t,r,n,o,i){if(!e)return null;var a=(i?t.reverse():t).reduce((function(e,t){var o,i=null!==(o=t.type)&&void 0!==o&&o.defaultProps?AR(AR({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(i.hide)return e;var s=i[r],u=e[s]||{hasStack:!1,stackGroups:{}};if(A_(a)){var l=u.stackGroups[a]||{numericAxisId:r,cateAxisId:n,items:[]};l.items.push(t),u.hasStack=!0,u.stackGroups[a]=l}else u.stackGroups[T_("_stackId_")]={numericAxisId:r,cateAxisId:n,items:[t]};return AR(AR({},e),{},NR({},s,u))}),{});return Object.keys(a).reduce((function(t,i){var s=a[i];return s.hasStack&&(s.stackGroups=Object.keys(s.stackGroups).reduce((function(t,i){var a=s.stackGroups[i];return AR(AR({},t),{},NR({},i,{numericAxisId:r,cateAxisId:n,items:a.items,stackedData:GR(e,a.items,o)}))}),{})),AR(AR({},t),{},NR({},i,s))}),{})}(h,b,"".concat(v,"Id"),"".concat(g,"Id"),d,m),x=l.reduce((function(e,t){var r="".concat(t.axisType,"Map");return Zz(Zz({},e),{},Kz({},r,aB(o,Zz(Zz({},t),{},{graphicalItems:b,stackGroups:t.axisType===v&&w,dataStartIndex:i,dataEndIndex:a}))))}),{}),_=lB(Zz(Zz({},x),{},{props:o,graphicalItems:b}),null==r?void 0:r.legendBBox);Object.keys(x).forEach((function(e){x[e]=f(o,x[e],_,e.replace("Map",""),t)}));var O,S,E=x["".concat(g,"Map")],j=(O=R_(E),{tooltipTicks:S=zR(O,!1,!0),orderedTooltipTicks:PO()(S,(function(e){return e.coordinate})),tooltipAxis:O,tooltipAxisBandSize:XR(O,S)}),P=p(o,Zz(Zz({},x),{},{dataStartIndex:i,dataEndIndex:a,updateId:s,graphicalItems:b,stackGroups:w,offset:_}));return Zz(Zz({formattedGraphicalItems:P,graphicalItems:b,offset:_,stackGroups:w},j),x)},m=function(e){function n(e){var o,a,s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),Kz(s=Bz(this,n,[e]),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Kz(s,"accessibilityManager",new DF),Kz(s,"handleLegendBBoxUpdate",(function(e){if(e){var t=s.state,r=t.dataStartIndex,n=t.dataEndIndex,o=t.updateId;s.setState(Zz({legendBBox:e},h({props:s.props,dataStartIndex:r,dataEndIndex:n,updateId:o},Zz(Zz({},s.state),{},{legendBBox:e}))))}})),Kz(s,"handleReceiveSyncEvent",(function(e,t,r){if(s.props.syncId===e){if(r===s.eventEmitterSymbol&&"function"!=typeof s.props.syncMethod)return;s.applySyncEvent(t)}})),Kz(s,"handleBrushChange",(function(e){var t=e.startIndex,r=e.endIndex;if(t!==s.state.dataStartIndex||r!==s.state.dataEndIndex){var n=s.state.updateId;s.setState((function(){return Zz({dataStartIndex:t,dataEndIndex:r},h({props:s.props,dataStartIndex:t,dataEndIndex:r,updateId:n},s.state))})),s.triggerSyncEvent({dataStartIndex:t,dataEndIndex:r})}})),Kz(s,"handleMouseEnter",(function(e){var t=s.getMouseInfo(e);if(t){var r=Zz(Zz({},t),{},{isTooltipActive:!0});s.setState(r),s.triggerSyncEvent(r);var n=s.props.onMouseEnter;V_()(n)&&n(r,e)}})),Kz(s,"triggeredAfterMouseMove",(function(e){var t=s.getMouseInfo(e),r=t?Zz(Zz({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};s.setState(r),s.triggerSyncEvent(r);var n=s.props.onMouseMove;V_()(n)&&n(r,e)})),Kz(s,"handleItemMouseEnter",(function(e){s.setState((function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}}))})),Kz(s,"handleItemMouseLeave",(function(){s.setState((function(){return{isTooltipActive:!1}}))})),Kz(s,"handleMouseMove",(function(e){e.persist(),s.throttleTriggeredAfterMouseMove(e)})),Kz(s,"handleMouseLeave",(function(e){s.throttleTriggeredAfterMouseMove.cancel();var t={isTooltipActive:!1};s.setState(t),s.triggerSyncEvent(t);var r=s.props.onMouseLeave;V_()(r)&&r(t,e)})),Kz(s,"handleOuterEvent",(function(e){var t,r=function(e){var t=e&&e.type;return t&&nO[t]?nO[t]:null}(e),n=S_()(s.props,"".concat(r));r&&V_()(n)&&n(null!==(t=/.*touch.*/i.test(r)?s.getMouseInfo(e.changedTouches[0]):s.getMouseInfo(e))&&void 0!==t?t:{},e)})),Kz(s,"handleClick",(function(e){var t=s.getMouseInfo(e);if(t){var r=Zz(Zz({},t),{},{isTooltipActive:!0});s.setState(r),s.triggerSyncEvent(r);var n=s.props.onClick;V_()(n)&&n(r,e)}})),Kz(s,"handleMouseDown",(function(e){var t=s.props.onMouseDown;V_()(t)&&t(s.getMouseInfo(e),e)})),Kz(s,"handleMouseUp",(function(e){var t=s.props.onMouseUp;V_()(t)&&t(s.getMouseInfo(e),e)})),Kz(s,"handleTouchMove",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.throttleTriggeredAfterMouseMove(e.changedTouches[0])})),Kz(s,"handleTouchStart",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.handleMouseDown(e.changedTouches[0])})),Kz(s,"handleTouchEnd",(function(e){null!=e.changedTouches&&e.changedTouches.length>0&&s.handleMouseUp(e.changedTouches[0])})),Kz(s,"handleDoubleClick",(function(e){var t=s.props.onDoubleClick;V_()(t)&&t(s.getMouseInfo(e),e)})),Kz(s,"handleContextMenu",(function(e){var t=s.props.onContextMenu;V_()(t)&&t(s.getMouseInfo(e),e)})),Kz(s,"triggerSyncEvent",(function(e){void 0!==s.props.syncId&&NF.emit(TF,s.props.syncId,e,s.eventEmitterSymbol)})),Kz(s,"applySyncEvent",(function(e){var t=s.props,r=t.layout,n=t.syncMethod,o=s.state.updateId,i=e.dataStartIndex,a=e.dataEndIndex;if(void 0!==e.dataStartIndex||void 0!==e.dataEndIndex)s.setState(Zz({dataStartIndex:i,dataEndIndex:a},h({props:s.props,dataStartIndex:i,dataEndIndex:a,updateId:o},s.state)));else if(void 0!==e.activeTooltipIndex){var u=e.chartX,l=e.chartY,c=e.activeTooltipIndex,f=s.state,d=f.offset,p=f.tooltipTicks;if(!d)return;if("function"==typeof n)c=n(p,e);else if("value"===n){c=-1;for(var m=0;m<p.length;m++)if(p[m].value===e.activeLabel){c=m;break}}var y=Zz(Zz({},d),{},{x:d.left,y:d.top}),v=Math.min(u,y.x+y.width),g=Math.min(l,y.y+y.height),b=p[c]&&p[c].value,w=nB(s.state,s.props.data,c),x=p[c]?{x:"horizontal"===r?p[c].coordinate:v,y:"horizontal"===r?g:p[c].coordinate}:Jz;s.setState(Zz(Zz({},e),{},{activeLabel:b,activeCoordinate:x,activePayload:w,activeTooltipIndex:c}))}else s.setState(e)})),Kz(s,"renderCursor",(function(e){var r,n=s.state,o=n.isTooltipActive,a=n.activeCoordinate,u=n.activePayload,l=n.offset,c=n.activeTooltipIndex,f=n.tooltipAxisBandSize,d=s.getTooltipEventType(),p=null!==(r=e.props.active)&&void 0!==r?r:o,h=s.props.layout,m=e.key||"_recharts-cursor";return i().createElement(Tz,{key:m,activeCoordinate:a,activePayload:u,activeTooltipIndex:c,chartName:t,element:e,isActive:p,layout:h,offset:l,tooltipAxisBandSize:f,tooltipEventType:d})})),Kz(s,"renderPolarAxis",(function(e,t,n){var o=S_()(e,"type.axisType"),i=S_()(s.state,"".concat(o,"Map")),a=e.type.defaultProps,u=void 0!==a?Zz(Zz({},a),e.props):e.props,l=i&&i[u["".concat(o,"Id")]];return(0,r.cloneElement)(e,Zz(Zz({},l),{},{className:gt(o,l.className),key:e.key||"".concat(t,"-").concat(n),ticks:zR(l,!0)}))})),Kz(s,"renderPolarGrid",(function(e){var t=e.props,n=t.radialLines,o=t.polarAngles,i=t.polarRadius,a=s.state,u=a.radiusAxisMap,l=a.angleAxisMap,c=R_(u),f=R_(l),d=f.cx,p=f.cy,h=f.innerRadius,m=f.outerRadius;return(0,r.cloneElement)(e,{polarAngles:Array.isArray(o)?o:zR(f,!0).map((function(e){return e.coordinate})),polarRadius:Array.isArray(i)?i:zR(c,!0).map((function(e){return e.coordinate})),cx:d,cy:p,innerRadius:h,outerRadius:m,key:e.key||"polar-grid",radialLines:n})})),Kz(s,"renderLegend",(function(){var e=s.state.formattedGraphicalItems,t=s.props,n=t.children,o=t.width,i=t.height,a=s.props.margin||{},u=o-(a.left||0)-(a.right||0),l=ER({children:n,formattedGraphicalItems:e,legendWidth:u,legendContent:c});if(!l)return null;var f=l.item,d=Fz(l,Mz);return(0,r.cloneElement)(f,Zz(Zz({},d),{},{chartWidth:o,chartHeight:i,margin:a,onBBoxUpdate:s.handleLegendBBoxUpdate}))})),Kz(s,"renderTooltip",(function(){var e,t=s.props,n=t.children,o=t.accessibilityLayer,i=lO(n,ES);if(!i)return null;var a=s.state,u=a.isTooltipActive,l=a.activeCoordinate,c=a.activePayload,f=a.activeLabel,d=a.offset,p=null!==(e=i.props.active)&&void 0!==e?e:u;return(0,r.cloneElement)(i,{viewBox:Zz(Zz({},d),{},{x:d.left,y:d.top}),active:p,label:f,payload:p?c:[],coordinate:l,accessibilityLayer:o})})),Kz(s,"renderBrush",(function(e){var t=s.props,n=t.margin,o=t.data,i=s.state,a=i.offset,u=i.dataStartIndex,l=i.dataEndIndex,c=i.updateId;return(0,r.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:VR(s.handleBrushChange,e.props.onChange),data:o,x:C_(e.props.x)?e.props.x:a.left,y:C_(e.props.y)?e.props.y:a.top+a.height+a.brushBottom-(n.bottom||0),width:C_(e.props.width)?e.props.width:a.width,startIndex:u,endIndex:l,updateId:"brush-".concat(c)})})),Kz(s,"renderReferenceElement",(function(e,t,n){if(!e)return null;var o=s.clipPathId,i=s.state,a=i.xAxisMap,u=i.yAxisMap,l=i.offset,c=e.type.defaultProps||{},f=e.props,d=f.xAxisId,p=void 0===d?c.xAxisId:d,h=f.yAxisId,m=void 0===h?c.yAxisId:h;return(0,r.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(n),xAxis:a[p],yAxis:u[m],viewBox:{x:l.left,y:l.top,width:l.width,height:l.height},clipPathId:o})})),Kz(s,"renderActivePoints",(function(e){var t=e.item,r=e.activePoint,o=e.basePoint,i=e.childIndex,a=e.isRange,s=[],u=t.props.key,l=void 0!==t.item.type.defaultProps?Zz(Zz({},t.item.type.defaultProps),t.item.props):t.item.props,c=l.activeDot,f=Zz(Zz({index:i,dataKey:l.dataKey,cx:r.x,cy:r.y,r:4,fill:RR(t.item),strokeWidth:2,stroke:"#fff",payload:r.payload,value:r.value},pO(c,!1)),X_(c));return s.push(n.renderActiveDot(c,f,"".concat(u,"-activePoint-").concat(i))),o?s.push(n.renderActiveDot(c,Zz(Zz({},f),{},{cx:o.x,cy:o.y}),"".concat(u,"-basePoint-").concat(i))):a&&s.push(null),s})),Kz(s,"renderGraphicChild",(function(e,t,n){var o=s.filterFormatItem(e,t,n);if(!o)return null;var i=s.getTooltipEventType(),a=s.state,u=a.isTooltipActive,l=a.tooltipAxis,c=a.activeTooltipIndex,f=a.activeLabel,d=lO(s.props.children,ES),p=o.props,h=p.points,m=p.isRange,y=p.baseLine,v=void 0!==o.item.type.defaultProps?Zz(Zz({},o.item.type.defaultProps),o.item.props):o.item.props,g=v.activeDot,b=v.hide,w=v.activeBar,x=v.activeShape,_=Boolean(!b&&u&&d&&(g||w||x)),O={};"axis"!==i&&d&&"click"===d.props.trigger?O={onClick:VR(s.handleItemMouseEnter,e.props.onClick)}:"axis"!==i&&(O={onMouseLeave:VR(s.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:VR(s.handleItemMouseEnter,e.props.onMouseEnter)});var S=(0,r.cloneElement)(e,Zz(Zz({},o.props),O));if(_){if(!(c>=0)){var E,j=(null!==(E=s.getItemByXY(s.state.activeCoordinate))&&void 0!==E?E:{graphicalItem:S}).graphicalItem,P=j.item,k=void 0===P?e:P,C=j.childIndex,A=Zz(Zz(Zz({},o.props),O),{},{activeIndex:C});return[(0,r.cloneElement)(k,A),null,null]}var N,T;if(l.dataKey&&!l.allowDuplicatedCategory){var M="function"==typeof l.dataKey?function(e){return"function"==typeof l.dataKey?l.dataKey(e.payload):null}:"payload.".concat(l.dataKey.toString());N=I_(h,M,f),T=m&&y&&I_(y,M,f)}else N=null==h?void 0:h[c],T=m&&y&&y[c];if(x||w){var R=void 0!==e.props.activeIndex?e.props.activeIndex:c;return[(0,r.cloneElement)(e,Zz(Zz(Zz({},o.props),O),{},{activeIndex:R})),null,null]}if(!z_()(N))return[S].concat(Gz(s.renderActivePoints({item:o,activePoint:N,basePoint:T,childIndex:c,isRange:m})))}return m?[S,null,null]:[S,null]})),Kz(s,"renderCustomized",(function(e,t,n){return(0,r.cloneElement)(e,Zz(Zz({key:"recharts-customized-".concat(n)},s.props),s.state))})),Kz(s,"renderMap",{CartesianGrid:{handler:eB,once:!0},ReferenceArea:{handler:s.renderReferenceElement},ReferenceLine:{handler:eB},ReferenceDot:{handler:s.renderReferenceElement},XAxis:{handler:eB},YAxis:{handler:eB},Brush:{handler:s.renderBrush,once:!0},Bar:{handler:s.renderGraphicChild},Line:{handler:s.renderGraphicChild},Area:{handler:s.renderGraphicChild},Radar:{handler:s.renderGraphicChild},RadialBar:{handler:s.renderGraphicChild},Scatter:{handler:s.renderGraphicChild},Pie:{handler:s.renderGraphicChild},Funnel:{handler:s.renderGraphicChild},Tooltip:{handler:s.renderCursor,once:!0},PolarGrid:{handler:s.renderPolarGrid,once:!0},PolarAngleAxis:{handler:s.renderPolarAxis},PolarRadiusAxis:{handler:s.renderPolarAxis},Customized:{handler:s.renderCustomized}}),s.clipPathId="".concat(null!==(o=e.id)&&void 0!==o?o:T_("recharts"),"-clip"),s.throttleTriggeredAfterMouseMove=g_()(s.triggeredAfterMouseMove,null!==(a=e.throttleDelay)&&void 0!==a?a:1e3/60),s.state={},s}return function(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&&Uz(e,t)}(n,e),o=n,s=[{key:"componentDidMount",value:function(){var e,t;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(e=this.props.margin.left)&&void 0!==e?e:0,top:null!==(t=this.props.margin.top)&&void 0!==t?t:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var e=this.props,t=e.children,r=e.data,n=e.height,o=e.layout,i=lO(t,ES);if(i){var a=i.props.defaultIndex;if(!("number"!=typeof a||a<0||a>this.state.tooltipTicks.length-1)){var s=this.state.tooltipTicks[a]&&this.state.tooltipTicks[a].value,u=nB(this.state,r,a,s),l=this.state.tooltipTicks[a].coordinate,c=(this.state.offset.top+n)/2,f="horizontal"===o?{x:l,y:c}:{y:l,x:c},d=this.state.formattedGraphicalItems.find((function(e){return"Scatter"===e.item.type.name}));d&&(f=Zz(Zz({},f),d.props.points[a].tooltipPosition),u=d.props.points[a].tooltipPayload);var p={activeTooltipIndex:a,isTooltipActive:!0,activeLabel:s,activePayload:u,activeCoordinate:f};this.setState(p),this.renderCursor(i),this.accessibilityManager.setIndex(a)}}}},{key:"getSnapshotBeforeUpdate",value:function(e,t){return this.props.accessibilityLayer?(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:null!==(r=this.props.margin.left)&&void 0!==r?r:0,top:null!==(n=this.props.margin.top)&&void 0!==n?n:0}}),null):null;var r,n}},{key:"componentDidUpdate",value:function(e){hO([lO(e.children,ES)],[lO(this.props.children,ES)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=lO(this.props.children,ES);if(e&&"boolean"==typeof e.props.shared){var t=e.props.shared?"axis":"item";return u.indexOf(t)>=0?t:a}return a}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t,r=this.container,n=r.getBoundingClientRect(),o={top:(t=n).top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft},i={chartX:Math.round(e.pageX-o.left),chartY:Math.round(e.pageY-o.top)},a=n.width/r.offsetWidth||1,s=this.inRange(i.chartX,i.chartY,a);if(!s)return null;var u=this.state,l=u.xAxisMap,c=u.yAxisMap;if("axis"!==this.getTooltipEventType()&&l&&c){var f=R_(l).scale,d=R_(c).scale,p=f&&f.invert?f.invert(i.chartX):null,h=d&&d.invert?d.invert(i.chartY):null;return Zz(Zz({},i),{},{xValue:p,yValue:h})}var m=oB(this.state,this.props.data,this.props.layout,s);return m?Zz(Zz({},i),m):null}},{key:"inRange",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=this.props.layout,o=e/r,i=t/r;if("horizontal"===n||"vertical"===n){var a=this.state.offset;return o>=a.left&&o<=a.left+a.width&&i>=a.top&&i<=a.top+a.height?{x:o,y:i}:null}var s=this.state,u=s.angleAxisMap,l=s.radiusAxisMap;if(u&&l){var c=R_(u);return PL({x:o,y:i},c)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),r=lO(e,ES),n={};return r&&"axis"===t&&(n="click"===r.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu}),Zz(Zz({},X_(this.props,this.handleOuterEvent)),n)}},{key:"addListener",value:function(){NF.on(TF,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){NF.removeListener(TF,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(e,t,r){for(var n=this.state.formattedGraphicalItems,o=0,i=n.length;o<i;o++){var a=n[o];if(a.item===e||a.props.key===e.key||t===oO(a.item.type)&&r===a.childIndex)return a}return null}},{key:"renderClipPath",value:function(){var e=this.clipPathId,t=this.state.offset,r=t.left,n=t.top,o=t.height,a=t.width;return i().createElement("defs",null,i().createElement("clipPath",{id:e},i().createElement("rect",{x:r,y:n,height:o,width:a})))}},{key:"getXScales",value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce((function(e,t){var r=Dz(t,2),n=r[0],o=r[1];return Zz(Zz({},e),{},Kz({},n,o.scale))}),{}):null}},{key:"getYScales",value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce((function(e,t){var r=Dz(t,2),n=r[0],o=r[1];return Zz(Zz({},e),{},Kz({},n,o.scale))}),{}):null}},{key:"getXScaleByAxisId",value:function(e){var t;return null===(t=this.state.xAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getYScaleByAxisId",value:function(e){var t;return null===(t=this.state.yAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getItemByXY",value:function(e){var t=this.state,r=t.formattedGraphicalItems,n=t.activeItem;if(r&&r.length)for(var o=0,i=r.length;o<i;o++){var a=r[o],s=a.props,u=a.item,l=void 0!==u.type.defaultProps?Zz(Zz({},u.type.defaultProps),u.props):u.props,c=oO(u.type);if("Bar"===c){var f=(s.data||[]).find((function(t){return EP(e,t)}));if(f)return{graphicalItem:a,payload:f}}else if("RadialBar"===c){var d=(s.data||[]).find((function(t){return PL(e,t)}));if(d)return{graphicalItem:a,payload:d}}else if(FI(a,n)||zI(a,n)||BI(a,n)){var p=GI({graphicalItem:a,activeTooltipItem:n,itemData:l.data}),h=void 0===l.activeIndex?p:l.activeIndex;return{graphicalItem:Zz(Zz({},a),{},{childIndex:h}),payload:BI(a,n)?l.data[p]:a.props.data[p]}}}return null}},{key:"render",value:function(){var e=this;if(!cO(this))return null;var t,r,n=this.props,o=n.children,a=n.className,s=n.width,u=n.height,l=n.style,c=n.compact,f=n.title,d=n.desc,p=Fz(n,Rz),h=pO(p,!1);if(c)return i().createElement(KD,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},i().createElement(MO,Iz({},h,{width:s,height:u,title:f,desc:d}),this.renderClipPath(),yO(o,this.renderMap)));this.props.accessibilityLayer&&(h.tabIndex=null!==(t=this.props.tabIndex)&&void 0!==t?t:0,h.role=null!==(r=this.props.role)&&void 0!==r?r:"application",h.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},h.onFocus=function(){e.accessibilityManager.focus()});var m=this.parseEventsOfWrapper();return i().createElement(KD,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},i().createElement("div",Iz({className:gt("recharts-wrapper",a),style:Zz({position:"relative",cursor:"default",width:s,height:u},l)},m,{ref:function(t){e.container=t}}),i().createElement(MO,Iz({},h,{width:s,height:u,title:f,desc:d,style:Qz}),this.renderClipPath(),yO(o,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}],s&&zz(o.prototype,s),l&&zz(o,l),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,s,l}(r.Component);Kz(m,"displayName",t),Kz(m,"defaultProps",Zz({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},d)),Kz(m,"getDerivedStateFromProps",(function(e,t){var r=e.dataKey,n=e.data,o=e.children,i=e.width,a=e.height,s=e.layout,u=e.stackOffset,l=e.margin,c=t.dataStartIndex,f=t.dataEndIndex;if(void 0===t.updateId){var d=sB(e);return Zz(Zz(Zz({},d),{},{updateId:0},h(Zz(Zz({props:e},d),{},{updateId:0}),t)),{},{prevDataKey:r,prevData:n,prevWidth:i,prevHeight:a,prevLayout:s,prevStackOffset:u,prevMargin:l,prevChildren:o})}if(r!==t.prevDataKey||n!==t.prevData||i!==t.prevWidth||a!==t.prevHeight||s!==t.prevLayout||u!==t.prevStackOffset||!W_(l,t.prevMargin)){var p=sB(e),m={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},y=Zz(Zz({},oB(t,n,s)),{},{updateId:t.updateId+1}),v=Zz(Zz(Zz({},p),m),y);return Zz(Zz(Zz({},v),h(Zz({props:e},v),t)),{},{prevDataKey:r,prevData:n,prevWidth:i,prevHeight:a,prevLayout:s,prevStackOffset:u,prevMargin:l,prevChildren:o})}if(!hO(o,t.prevChildren)){var g,b,w,x,_=lO(o,vL),O=_&&null!==(g=null===(b=_.props)||void 0===b?void 0:b.startIndex)&&void 0!==g?g:c,S=_&&null!==(w=null===(x=_.props)||void 0===x?void 0:x.endIndex)&&void 0!==w?w:f,E=O!==c||S!==f,j=!z_()(n)&&!E?t.updateId:t.updateId+1;return Zz(Zz({updateId:j},h(Zz(Zz({props:e},t),{},{updateId:j,dataStartIndex:O,dataEndIndex:S}),t)),{},{prevChildren:o,dataStartIndex:O,dataEndIndex:S})}return null})),Kz(m,"renderActiveDot",(function(e,t,n){var o;return o=(0,r.isValidElement)(e)?(0,r.cloneElement)(e,t):V_()(e)?e(t):i().createElement(VE,t),i().createElement(DO,{className:"recharts-active-dot",key:n},o)}));var y=(0,r.forwardRef)((function(e,t){return i().createElement(m,Iz({},e,{ref:t}))}));return y.displayName=m.displayName,y}({chartName:"LineChart",GraphicalChild:PB,axisComponents:[{axisType:"xAxis",AxisComp:uV},{axisType:"yAxis",AxisComp:bV}],formatAxisMap:function(t,r,n,o,i){var a=t.width,s=t.height,u=t.layout,l=t.children,c=Object.keys(r),f={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:s-n.bottom,bottomMirror:s-n.bottom},d=!!lO(l,hD);return c.reduce((function(a,s){var l,c,p,h,m,y=r[s],v=y.orientation,g=y.domain,b=y.padding,w=void 0===b?{}:b,x=y.mirror,_=y.reversed,O="".concat(v).concat(x?"Mirror":"");if("number"===y.type&&("gap"===y.padding||"no-gap"===y.padding)){var S=g[1]-g[0],E=1/0,j=y.categoricalDomain.sort();if(j.forEach((function(e,t){t>0&&(E=Math.min((e||0)-(j[t-1]||0),E))})),Number.isFinite(E)){var P=E/S,k="vertical"===y.layout?n.height:n.width;if("gap"===y.padding&&(l=P*k/2),"no-gap"===y.padding){var C=M_(t.barCategoryGap,P*k),A=P*k/2;l=A-C-(A-C)/k*C}}}c="xAxis"===o?[n.left+(w.left||0)+(l||0),n.left+n.width-(w.right||0)-(l||0)]:"yAxis"===o?"horizontal"===u?[n.top+n.height-(w.bottom||0),n.top+(w.top||0)]:[n.top+(w.top||0)+(l||0),n.top+n.height-(w.bottom||0)-(l||0)]:y.range,_&&(c=[c[1],c[0]]);var N=function(t,r,n){var o=t.scale,i=t.type,a=t.layout,s=t.axisType;if("auto"===o)return"radial"===a&&"radiusAxis"===s?{scale:DP(),realScaleType:"band"}:"radial"===a&&"angleAxis"===s?{scale:sA(),realScaleType:"linear"}:"category"===i&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:zP(),realScaleType:"point"}:"category"===i?{scale:DP(),realScaleType:"band"}:{scale:sA(),realScaleType:"linear"};if(w_()(o)){var u="scale".concat(PS()(o));return{scale:(e[u]||zP)(),realScaleType:e[u]?u:"point"}}return V_()(o)?{scale:o}:{scale:zP(),realScaleType:"point"}}(y,i,d),T=N.scale,M=N.realScaleType;T.domain(g).range(c),function(e){var t=e.domain();if(t&&!(t.length<=2)){var r=t.length,n=e.range(),o=Math.min(n[0],n[1])-$R,i=Math.max(n[0],n[1])+$R,a=e(t[0]),s=e(t[r-1]);(a<o||a>i||s<o||s>i)&&e.domain([t[0],t[r-1]])}}(T);var R=function(e,t){var r=t.realScaleType,n=t.type,o=t.tickCount,i=t.originalDomain,a=t.allowDecimals,s=r||t.scale;if("auto"!==s&&"linear"!==s)return null;if(o&&"number"===n&&i&&("auto"===i[0]||"auto"===i[1])){var u=e.domain();if(!u.length)return null;var l=iR(u,o,a);return e.domain([PM()(l),EM()(l)]),{niceTicks:l}}if(o&&"number"===n){var c=e.domain();return{niceTicks:aR(c,o,a)}}return null}(T,gD(gD({},y),{},{realScaleType:M}));"xAxis"===o?(m="top"===v&&!x||"bottom"===v&&x,p=n.left,h=f[O]-m*y.height):"yAxis"===o&&(m="left"===v&&!x||"right"===v&&x,p=f[O]-m*y.width,h=n.top);var L=gD(gD(gD({},y),R),{},{realScaleType:M,x:p,y:h,scale:T,width:"xAxis"===o?n.width:y.width,height:"yAxis"===o?n.height:y.height});return L.bandSize=XR(L,R),y.hide||"xAxis"!==o?y.hide||(f[O]+=(m?-1:1)*L.width):f[O]+=(m?-1:1)*L.height,gD(gD({},a),{},bD({},s,L))}),{})}}),xV=["x1","y1","x2","y2","key"],_V=["offset"];function OV(e){return OV="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},OV(e)}function SV(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function EV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?SV(Object(r),!0).forEach((function(t){jV(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):SV(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function jV(e,t,r){return t=function(e){var t=function(e,t){if("object"!=OV(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=OV(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==OV(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function PV(){return PV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},PV.apply(this,arguments)}function kV(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var CV=function(e){var t=e.fill;if(!t||"none"===t)return null;var r=e.fillOpacity,n=e.x,o=e.y,a=e.width,s=e.height,u=e.ry;return i().createElement("rect",{x:n,y:o,ry:u,width:a,height:s,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function AV(e,t){var r;if(i().isValidElement(e))r=i().cloneElement(e,t);else if(V_()(e))r=e(t);else{var n=t.x1,o=t.y1,a=t.x2,s=t.y2,u=t.key,l=kV(t,xV),c=pO(l,!1),f=(c.offset,kV(c,_V));r=i().createElement("line",PV({},f,{x1:n,y1:o,x2:a,y2:s,fill:"none",key:u}))}return r}function NV(e){var t=e.x,r=e.width,n=e.horizontal,o=void 0===n||n,a=e.horizontalPoints;if(!o||!a||!a.length)return null;var s=a.map((function(n,i){var a=EV(EV({},e),{},{x1:t,y1:n,x2:t+r,y2:n,key:"line-".concat(i),index:i});return AV(o,a)}));return i().createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function TV(e){var t=e.y,r=e.height,n=e.vertical,o=void 0===n||n,a=e.verticalPoints;if(!o||!a||!a.length)return null;var s=a.map((function(n,i){var a=EV(EV({},e),{},{x1:n,y1:t,x2:n,y2:t+r,key:"line-".concat(i),index:i});return AV(o,a)}));return i().createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function MV(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,o=e.y,a=e.width,s=e.height,u=e.horizontalPoints,l=e.horizontal;if(!(void 0===l||l)||!t||!t.length)return null;var c=u.map((function(e){return Math.round(e+o-o)})).sort((function(e,t){return e-t}));o!==c[0]&&c.unshift(0);var f=c.map((function(e,u){var l=!c[u+1]?o+s-e:c[u+1]-e;if(l<=0)return null;var f=u%t.length;return i().createElement("rect",{key:"react-".concat(u),y:e,x:n,height:l,width:a,stroke:"none",fill:t[f],fillOpacity:r,className:"recharts-cartesian-grid-bg"})}));return i().createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function RV(e){var t=e.vertical,r=void 0===t||t,n=e.verticalFill,o=e.fillOpacity,a=e.x,s=e.y,u=e.width,l=e.height,c=e.verticalPoints;if(!r||!n||!n.length)return null;var f=c.map((function(e){return Math.round(e+a-a)})).sort((function(e,t){return e-t}));a!==f[0]&&f.unshift(0);var d=f.map((function(e,t){var r=!f[t+1]?a+u-e:f[t+1]-e;if(r<=0)return null;var c=t%n.length;return i().createElement("rect",{key:"react-".concat(t),x:e,y:s,width:r,height:l,stroke:"none",fill:n[c],fillOpacity:o,className:"recharts-cartesian-grid-bg"})}));return i().createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var LV=function(e,t){var r=e.xAxis,n=e.width,o=e.height,i=e.offset;return FR(LB(EV(EV(EV({},XB.defaultProps),r),{},{ticks:zR(r,!0),viewBox:{x:0,y:0,width:n,height:o}})),i.left,i.left+i.width,t)},IV=function(e,t){var r=e.yAxis,n=e.width,o=e.height,i=e.offset;return FR(LB(EV(EV(EV({},XB.defaultProps),r),{},{ticks:zR(r,!0),viewBox:{x:0,y:0,width:n,height:o}})),i.top,i.top+i.height,t)},DV={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function FV(e){var t,n,o,a,s,u,l,c,f=QD(),d=JD(),p=(0,r.useContext)(WD),h=EV(EV({},e),{},{stroke:null!==(t=e.stroke)&&void 0!==t?t:DV.stroke,fill:null!==(n=e.fill)&&void 0!==n?n:DV.fill,horizontal:null!==(o=e.horizontal)&&void 0!==o?o:DV.horizontal,horizontalFill:null!==(a=e.horizontalFill)&&void 0!==a?a:DV.horizontalFill,vertical:null!==(s=e.vertical)&&void 0!==s?s:DV.vertical,verticalFill:null!==(u=e.verticalFill)&&void 0!==u?u:DV.verticalFill,x:C_(e.x)?e.x:p.left,y:C_(e.y)?e.y:p.top,width:C_(e.width)?e.width:p.width,height:C_(e.height)?e.height:p.height}),m=h.x,y=h.y,v=h.width,g=h.height,b=h.syncWithTicks,w=h.horizontalValues,x=h.verticalValues,_=(l=(0,r.useContext)($D),R_(l)),O=(c=(0,r.useContext)(UD),zD()(c,(function(e){return GL()(e.domain,Number.isFinite)}))||R_(c));if(!C_(v)||v<=0||!C_(g)||g<=0||!C_(m)||m!==+m||!C_(y)||y!==+y)return null;var S=h.verticalCoordinatesGenerator||LV,E=h.horizontalCoordinatesGenerator||IV,j=h.horizontalPoints,P=h.verticalPoints;if((!j||!j.length)&&V_()(E)){var k=w&&w.length,C=E({yAxis:O?EV(EV({},O),{},{ticks:k?w:O.ticks}):void 0,width:f,height:d,offset:p},!!k||b);D_(Array.isArray(C),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(OV(C),"]")),Array.isArray(C)&&(j=C)}if((!P||!P.length)&&V_()(S)){var A=x&&x.length,N=S({xAxis:_?EV(EV({},_),{},{ticks:A?x:_.ticks}):void 0,width:f,height:d,offset:p},!!A||b);D_(Array.isArray(N),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(OV(N),"]")),Array.isArray(N)&&(P=N)}return i().createElement("g",{className:"recharts-cartesian-grid"},i().createElement(CV,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),i().createElement(NV,PV({},h,{offset:p,horizontalPoints:j,xAxis:_,yAxis:O})),i().createElement(TV,PV({},h,{offset:p,verticalPoints:P,xAxis:_,yAxis:O})),i().createElement(MV,PV({},h,{horizontalPoints:j})),i().createElement(RV,PV({},h,{verticalPoints:P})))}FV.displayName="CartesianGrid";const zV={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function BV(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const VV={date:BV({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:BV({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:BV({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},$V={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function UV(e){return(t,r)=>{let n;if("formatting"===(r?.context?String(r.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=r?.width?String(r.width):t;n=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=r?.width?String(r.width):e.defaultWidth;n=e.values[o]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}const GV={ordinalNumber:(e,t)=>{const r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:UV({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:UV({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:UV({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:UV({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:UV({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function WV(e){return(t,r={})=>{const n=r.width,o=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const a=i[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(s)?function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r;return}(s,(e=>e.test(a))):function(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r;return}(s,(e=>e.test(a)));let l;l=e.valueCallback?e.valueCallback(u):u,l=r.valueCallback?r.valueCallback(l):l;return{value:l,rest:t.slice(a.length)}}}const qV={ordinalNumber:(HV={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const r=e.match(HV.matchPattern);if(!r)return null;const n=r[0],o=e.match(HV.parsePattern);if(!o)return null;let i=HV.valueCallback?HV.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(n.length)}}),era:WV({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:WV({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:WV({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:WV({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:WV({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var HV;const ZV={code:"en-US",formatDistance:(e,t,r)=>{let n;const o=zV[e];return n="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:VV,formatRelative:(e,t,r,n)=>$V[e],localize:GV,match:qV,options:{weekStartsOn:0,firstWeekContainsDate:1}};let KV={};function YV(){return KV}Math.pow(10,8);const XV=6048e5,QV=Symbol.for("constructDateFrom");function JV(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&QV in e?e[QV](t):e instanceof Date?new e.constructor(t):new Date(t)}function e$(e,t){return JV(t||e,e)}function t$(e){const t=e$(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function r$(e,t){const r=e$(e,t?.in);return r.setHours(0,0,0,0),r}function n$(e,t,r){const[n,o]=function(e,...t){const r=JV.bind(null,e||t.find((e=>"object"==typeof e)));return t.map(r)}(r?.in,e,t),i=r$(n),a=r$(o),s=+i-t$(i),u=+a-t$(a);return Math.round((s-u)/864e5)}function o$(e,t){const r=e$(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}function i$(e,t){const r=e$(e,t?.in);return n$(r,o$(r))+1}function a$(e,t){const r=YV(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=e$(e,t?.in),i=o.getDay(),a=(i<n?7:0)+i-n;return o.setDate(o.getDate()-a),o.setHours(0,0,0,0),o}function s$(e,t){return a$(e,{...t,weekStartsOn:1})}function u$(e,t){const r=e$(e,t?.in),n=r.getFullYear(),o=JV(r,0);o.setFullYear(n+1,0,4),o.setHours(0,0,0,0);const i=s$(o),a=JV(r,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const s=s$(a);return r.getTime()>=i.getTime()?n+1:r.getTime()>=s.getTime()?n:n-1}function l$(e,t){const r=u$(e,t),n=JV(t?.in||e,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),s$(n)}function c$(e,t){const r=e$(e,t?.in),n=+s$(r)-+l$(r);return Math.round(n/XV)+1}function f$(e,t){const r=e$(e,t?.in),n=r.getFullYear(),o=YV(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,a=JV(t?.in||e,0);a.setFullYear(n+1,0,i),a.setHours(0,0,0,0);const s=a$(a,t),u=JV(t?.in||e,0);u.setFullYear(n,0,i),u.setHours(0,0,0,0);const l=a$(u,t);return+r>=+s?n+1:+r>=+l?n:n-1}function d$(e,t){const r=YV(),n=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=f$(e,t),i=JV(t?.in||e,0);i.setFullYear(o,0,n),i.setHours(0,0,0,0);return a$(i,t)}function p$(e,t){const r=e$(e,t?.in),n=+a$(r,t)-+d$(r,t);return Math.round(n/XV)+1}function h$(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const m$={y(e,t){const r=e.getFullYear(),n=r>0?r:1-r;return h$("yy"===t?n%100:n,t.length)},M(e,t){const r=e.getMonth();return"M"===t?String(r+1):h$(r+1,2)},d:(e,t)=>h$(e.getDate(),t.length),a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>h$(e.getHours()%12||12,t.length),H:(e,t)=>h$(e.getHours(),t.length),m:(e,t)=>h$(e.getMinutes(),t.length),s:(e,t)=>h$(e.getSeconds(),t.length),S(e,t){const r=t.length,n=e.getMilliseconds();return h$(Math.trunc(n*Math.pow(10,r-3)),t.length)}},y$="midnight",v$="noon",g$="morning",b$="afternoon",w$="evening",x$="night",_$={G:function(e,t,r){const n=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){const t=e.getFullYear(),n=t>0?t:1-t;return r.ordinalNumber(n,{unit:"year"})}return m$.y(e,t)},Y:function(e,t,r,n){const o=f$(e,n),i=o>0?o:1-o;if("YY"===t){return h$(i%100,2)}return"Yo"===t?r.ordinalNumber(i,{unit:"year"}):h$(i,t.length)},R:function(e,t){return h$(u$(e),t.length)},u:function(e,t){return h$(e.getFullYear(),t.length)},Q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return h$(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){const n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return h$(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){const n=e.getMonth();switch(t){case"M":case"MM":return m$.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){const n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return h$(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){const o=p$(e,n);return"wo"===t?r.ordinalNumber(o,{unit:"week"}):h$(o,t.length)},I:function(e,t,r){const n=c$(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):h$(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):m$.d(e,t)},D:function(e,t,r){const n=i$(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):h$(n,t.length)},E:function(e,t,r){const n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){const o=e.getDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return h$(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){const o=e.getDay(),i=(o-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return h$(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){const n=e.getDay(),o=0===n?7:n;switch(t){case"i":return String(o);case"ii":return h$(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){const n=e.getHours();let o;switch(o=12===n?v$:0===n?y$:n/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,r){const n=e.getHours();let o;switch(o=n>=17?w$:n>=12?b$:n>=4?g$:x$,t){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return m$.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):m$.H(e,t)},K:function(e,t,r){const n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):h$(n,t.length)},k:function(e,t,r){let n=e.getHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):h$(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):m$.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):m$.s(e,t)},S:function(e,t){return m$.S(e,t)},X:function(e,t,r){const n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return S$(n);case"XXXX":case"XX":return E$(n);default:return E$(n,":")}},x:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"x":return S$(n);case"xxxx":case"xx":return E$(n);default:return E$(n,":")}},O:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+O$(n,":");default:return"GMT"+E$(n,":")}},z:function(e,t,r){const n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+O$(n,":");default:return"GMT"+E$(n,":")}},t:function(e,t,r){return h$(Math.trunc(+e/1e3),t.length)},T:function(e,t,r){return h$(+e,t.length)}};function O$(e,t=""){const r=e>0?"-":"+",n=Math.abs(e),o=Math.trunc(n/60),i=n%60;return 0===i?r+String(o):r+String(o)+t+h$(i,2)}function S$(e,t){if(e%60==0){return(e>0?"-":"+")+h$(Math.abs(e)/60,2)}return E$(e,t)}function E$(e,t=""){const r=e>0?"-":"+",n=Math.abs(e);return r+h$(Math.trunc(n/60),2)+t+h$(n%60,2)}const j$=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},P$=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},k$={p:P$,P:(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],n=r[1],o=r[2];if(!o)return j$(e,t);let i;switch(n){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",j$(n,t)).replace("{{time}}",P$(o,t))}},C$=/^D+$/,A$=/^Y+$/,N$=["D","DD","YY","YYYY"];function T$(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function M$(e){return!(!T$(e)&&"number"!=typeof e||isNaN(+e$(e)))}const R$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,L$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,I$=/^'([^]*?)'?$/,D$=/''/g,F$=/[a-zA-Z]/;function z$(e,t,r){const n=YV(),o=r?.locale??n.locale??ZV,i=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=e$(e,r?.in);if(!M$(s))throw new RangeError("Invalid time value");let u=t.match(L$).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,k$[t])(e,o.formatLong)}return e})).join("").match(R$).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:B$(e)};if(_$[t])return{isToken:!0,value:e};if(t.match(F$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(u=o.localize.preprocessor(s,u));const l={firstWeekContainsDate:i,weekStartsOn:a,locale:o};return u.map((n=>{if(!n.isToken)return n.value;const i=n.value;(!r?.useAdditionalWeekYearTokens&&function(e){return A$.test(e)}(i)||!r?.useAdditionalDayOfYearTokens&&function(e){return C$.test(e)}(i))&&function(e,t,r){const n=function(e,t,r){const n="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,r);if(N$.includes(e))throw new RangeError(n)}(i,t,String(e));return(0,_$[i[0]])(s,i,o.localize,l)})).join("")}function B$(e){const t=e.match(I$);return t?t[1].replace(D$,"'"):e}function V$(e){return V$="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},V$(e)}function $$(){$$=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==V$(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(V$(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function U$(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function G$(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return W$(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?W$(e,t):void 0}}(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.")}()}function W$(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const q$=function(){var e=te(),t=G$((0,r.useState)({total:0,success:0,failed:0,chart_data:[]}),2),n=t[0],o=t[1],i=function(){var e=function(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){U$(i,n,o,a,s,"next",e)}function s(e){U$(i,n,o,a,s,"throw",e)}a(void 0)}))}}($$().mark((function e(){var t,r,n;return $$().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,(t=new FormData).append("action","get_email_stats"),t.append("trigger_nonce",rd.nonce_value),e.next=6,fetch(rd.ajax_url,{method:"POST",body:t});case 6:return r=e.sent,e.next=9,r.json();case 9:200===(n=e.sent).status_code&&o(n.data),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0);case 16:case"end":return e.stop()}}),e,null,[[0,13]])})));return function(){return e.apply(this,arguments)}}();(0,r.useEffect)((function(){i()}),[]);G$(ot(),1)[0];var a,s=new URLSearchParams(window.location.search).get("code"),u=ep({mutationFn:(a=_h(wh().mark((function e(t){var r;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=gh({action:"handle_google_oauth_callback"},t),e.next=4,yp(rd.ajax_url,{body:t});case 4:return r=e.sent,e.abrupt("return",r);case 6:case"end":return e.stop()}}),e)}))),function(e){return a.apply(this,arguments)}),onSuccess:function(e){200===e.status_code&&(mh.success((null==e?void 0:e.message)||(0,Lo.__)("Google OAuth callback handled successfully","trigger")),setTimeout((function(){window.location.assign("".concat(rd.site_url,"/wp-admin/admin.php?page=trigger#/connections"))}),500))},onError:function(e){mh.error((null==e?void 0:e.message)||(0,Lo.__)("Gmail connection failed!","trigger")),setTimeout((function(){window.location.assign("".concat(rd.site_url,"/wp-admin/admin.php?page=trigger#/connections"))}),500)}}),l=u.mutateAsync;return(0,r.useEffect)((function(){s&&l({code:s})}),[s]),io("div",{className:"p-4 space-y-6"},io("div",{className:"flex justify-between items-center"},io("h2",{className:"text-2xl font-bold"},(0,Lo.__)("Trigger Dashboard","trigger")),io(lo,{size:"sm",className:"gap-2",onClick:function(){return e("/add-connection")}},io(yo,{className:"h-5 w-5"}),(0,Lo.__)("Add Connection","trigger"))),io("div",{className:"grid gap-4 md:grid-cols-3"},io(uw,null,io(lw,{className:"flex flex-row items-center justify-between space-y-0 pb-2"},io(cw,{className:"text-sm font-medium"},(0,Lo.__)("Total Emails","trigger")),io(f_,{className:"h-4 w-4 text-muted-foreground"})),io(dw,null,io("div",{className:"text-2xl font-bold"},n.total))),io(uw,null,io(lw,{className:"flex flex-row items-center justify-between space-y-0 pb-2"},io(cw,{className:"text-sm font-medium"},(0,Lo.__)("Successful","trigger")),io(Xb,{className:"h-4 w-4 text-green-600"})),io(dw,null,io("div",{className:"text-2xl font-bold text-green-600"},n.success))),io(uw,null,io(lw,{className:"flex flex-row items-center justify-between space-y-0 pb-2"},io(cw,{className:"text-sm font-medium"},(0,Lo.__)("Failed","trigger")),io(y_,{className:"h-4 w-4 text-red-600"})),io(dw,null,io("div",{className:"text-2xl font-bold text-red-600"},n.failed)))),io(uw,null,io(lw,null,io(cw,null,(0,Lo.__)("Email Sending Rate","trigger"))),io(dw,null,io("div",{className:"h-[300px]"},io(OO,{width:"100%",height:"100%"},io(wV,{data:n.chart_data},io(FV,{strokeDasharray:"3 3"}),io(uV,{dataKey:"date",tickFormatter:function(e){return z$(new Date(e),"MMM dd")}}),io(bV,null),io(ES,{labelFormatter:function(e){return z$(new Date(e),"MMM dd, yyyy")}}),io(PB,{type:"monotone",dataKey:"success",stroke:"#16a34a",name:(0,Lo.__)("Successful","trigger")}),io(PB,{type:"monotone",dataKey:"failed",stroke:"#dc2626",name:(0,Lo.__)("Failed","trigger")})))))))},H$=mo("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),Z$=mo("Forward",[["polyline",{points:"15 17 20 12 15 7",key:"1w3sku"}],["path",{d:"M4 18v-2a4 4 0 0 1 4-4h12",key:"jmiej9"}]]),K$=mo("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var Y$="Checkbox",[X$,Q$]=Do(Y$),[J$,eU]=X$(Y$),tU=r.forwardRef(((e,t)=>{const{__scopeCheckbox:n,name:o,checked:i,defaultChecked:a,required:s,disabled:u,value:l="on",onCheckedChange:c,form:f,...d}=e,[p,h]=r.useState(null),m=ct(t,(e=>h(e))),y=r.useRef(!1),v=!p||(f||!!p.closest("form")),[g=!1,b]=Go({prop:i,defaultProp:a,onChange:c}),w=r.useRef(g);return r.useEffect((()=>{const e=p?.form;if(e){const t=()=>b(w.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[p,b]),(0,ft.jsxs)(J$,{scope:n,state:g,disabled:u,children:[(0,ft.jsx)(qo.button,{type:"button",role:"checkbox","aria-checked":iU(g)?"mixed":g,"aria-required":s,"data-state":aU(g),"data-disabled":u?"":void 0,disabled:u,value:l,...d,ref:m,onKeyDown:Io(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:Io(e.onClick,(e=>{b((e=>!!iU(e)||!e)),v&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())}))}),v&&(0,ft.jsx)(oU,{control:p,bubbles:!y.current,name:o,value:l,checked:g,required:s,disabled:u,form:f,style:{transform:"translateX(-100%)"},defaultChecked:!iU(a)&&a})]})}));tU.displayName=Y$;var rU="CheckboxIndicator",nU=r.forwardRef(((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...o}=e,i=eU(rU,r);return(0,ft.jsx)(pi,{present:n||iU(i.state)||!0===i.state,children:(0,ft.jsx)(qo.span,{"data-state":aU(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})}));nU.displayName=rU;var oU=e=>{const{control:t,checked:n,bubbles:o=!0,defaultChecked:i,...a}=e,s=r.useRef(null),u=Vy(n),l=gy(t);r.useEffect((()=>{const e=s.current,t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:o});e.indeterminate=iU(n),r.call(e,!iU(n)&&n),e.dispatchEvent(t)}}),[u,n,o]);const c=r.useRef(!iU(n)&&n);return(0,ft.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??c.current,...a,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function iU(e){return"indeterminate"===e}function aU(e){return iU(e)?"indeterminate":e?"checked":"unchecked"}var sU=tU,uU=nU,lU=["className"];function cU(){return cU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cU.apply(null,arguments)}var fU=r.forwardRef((function(e,t){var r=e.className,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,lU);return io(sU,cU({ref:t,className:Nr("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",r)},n),io(uU,{className:Nr("flex items-center justify-center text-current")},io(og,{className:"h-4 w-4"})))}));function dU(e,t){return"function"==typeof e?e(t):e}function pU(e,t){return r=>{t.setState((t=>({...t,[e]:dU(r,t[e])})))}}function hU(e){return e instanceof Function}function mU(e,t){const r=[],n=e=>{e.forEach((e=>{r.push(e);const o=t(e);null!=o&&o.length&&n(o)}))};return n(e),r}function yU(e,t,r){let n,o=[];return i=>{let a;r.key&&r.debug&&(a=Date.now());const s=e(i),u=s.length!==o.length||s.some(((e,t)=>o[t]!==e));if(!u)return n;let l;if(o=s,r.key&&r.debug&&(l=Date.now()),n=t(...s),null==r||null==r.onChange||r.onChange(n),r.key&&r.debug&&null!=r&&r.debug()){Math.round(100*(Date.now()-a)),Math.round(100*(Date.now()-l))}return n}}function vU(e,t,r,n){return{debug:()=>{var r;return null!=(r=null==e?void 0:e.debugAll)?r:e[t]},key:!1,onChange:n}}fU.displayName=sU.displayName;const gU="debugHeaders";function bU(e,t,r){var n;let o={id:null!=(n=r.id)?n:t.id,column:t,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=r=>{r.subHeaders&&r.subHeaders.length&&r.subHeaders.map(t),e.push(r)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach((t=>{null==t.createHeader||t.createHeader(o,e)})),o}const wU={createTable:e=>{e.getHeaderGroups=yU((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,r,n,o)=>{var i,a;const s=null!=(i=null==n?void 0:n.map((e=>r.find((t=>t.id===e)))).filter(Boolean))?i:[],u=null!=(a=null==o?void 0:o.map((e=>r.find((t=>t.id===e)))).filter(Boolean))?a:[],l=r.filter((e=>!(null!=n&&n.includes(e.id)||null!=o&&o.includes(e.id))));return xU(t,[...s,...l,...u],e)}),vU(e.options,gU)),e.getCenterHeaderGroups=yU((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,r,n,o)=>(r=r.filter((e=>!(null!=n&&n.includes(e.id)||null!=o&&o.includes(e.id)))),xU(t,r,e,"center"))),vU(e.options,gU)),e.getLeftHeaderGroups=yU((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,r,n)=>{var o;const i=null!=(o=null==n?void 0:n.map((e=>r.find((t=>t.id===e)))).filter(Boolean))?o:[];return xU(t,i,e,"left")}),vU(e.options,gU)),e.getRightHeaderGroups=yU((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,r,n)=>{var o;const i=null!=(o=null==n?void 0:n.map((e=>r.find((t=>t.id===e)))).filter(Boolean))?o:[];return xU(t,i,e,"right")}),vU(e.options,gU)),e.getFooterGroups=yU((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),vU(e.options,gU)),e.getLeftFooterGroups=yU((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),vU(e.options,gU)),e.getCenterFooterGroups=yU((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),vU(e.options,gU)),e.getRightFooterGroups=yU((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),vU(e.options,gU)),e.getFlatHeaders=yU((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),vU(e.options,gU)),e.getLeftFlatHeaders=yU((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),vU(e.options,gU)),e.getCenterFlatHeaders=yU((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),vU(e.options,gU)),e.getRightFlatHeaders=yU((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),vU(e.options,gU)),e.getCenterLeafHeaders=yU((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),vU(e.options,gU)),e.getLeftLeafHeaders=yU((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),vU(e.options,gU)),e.getRightLeafHeaders=yU((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),vU(e.options,gU)),e.getLeafHeaders=yU((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,r)=>{var n,o,i,a,s,u;return[...null!=(n=null==(o=e[0])?void 0:o.headers)?n:[],...null!=(i=null==(a=t[0])?void 0:a.headers)?i:[],...null!=(s=null==(u=r[0])?void 0:u.headers)?s:[]].map((e=>e.getLeafHeaders())).flat()}),vU(e.options,gU))}};function xU(e,t,r,n){var o,i;let a=0;const s=function(e,t){void 0===t&&(t=1),a=Math.max(a,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var r;null!=(r=e.columns)&&r.length&&s(e.columns,t+1)}),0)};s(e);let u=[];const l=(e,t)=>{const o={depth:t,id:[n,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach((e=>{const a=[...i].reverse()[0];let s,u=!1;if(e.column.depth===o.depth&&e.column.parent?s=e.column.parent:(s=e.column,u=!0),a&&(null==a?void 0:a.column)===s)a.subHeaders.push(e);else{const o=bU(r,s,{id:[n,t,s.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:u,placeholderId:u?`${i.filter((e=>e.column===s)).length}`:void 0,depth:t,index:i.length});o.subHeaders.push(e),i.push(o)}o.headers.push(e),e.headerGroup=o})),u.push(o),t>0&&l(i,t-1)},c=t.map(((e,t)=>bU(r,e,{depth:a,index:t})));l(c,a-1),u.reverse();const f=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,r=0,n=[0];e.subHeaders&&e.subHeaders.length?(n=[],f(e.subHeaders).forEach((e=>{let{colSpan:r,rowSpan:o}=e;t+=r,n.push(o)}))):t=1;return r+=Math.min(...n),e.colSpan=t,e.rowSpan=r,{colSpan:t,rowSpan:r}}));return f(null!=(o=null==(i=u[0])?void 0:i.headers)?o:[]),u}const _U=(e,t,r,n,o,i,a)=>{let s={id:t,index:n,original:r,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];const r=e.getColumn(t);return null!=r&&r.accessorFn?(s._valuesCache[t]=r.accessorFn(s.original,n),s._valuesCache[t]):void 0},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];const r=e.getColumn(t);return null!=r&&r.accessorFn?r.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=r.columnDef.getUniqueValues(s.original,n),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t]):void 0},renderValue:t=>{var r;return null!=(r=s.getValue(t))?r:e.options.renderFallbackValue},subRows:null!=i?i:[],getLeafRows:()=>mU(s.subRows,(e=>e.subRows)),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){const r=t.getParentRow();if(!r)break;e.push(r),t=r}return e.reverse()},getAllCells:yU((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>function(e,t,r,n){const o={id:`${t.id}_${r.id}`,row:t,column:r,getValue:()=>t.getValue(n),renderValue:()=>{var t;return null!=(t=o.getValue())?t:e.options.renderFallbackValue},getContext:yU((()=>[e,r,t,o]),((e,t,r,n)=>({table:e,column:t,row:r,cell:n,getValue:n.getValue,renderValue:n.renderValue})),vU(e.options,"debugCells"))};return e._features.forEach((n=>{null==n.createCell||n.createCell(o,r,t,e)}),{}),o}(e,s,t,t.id)))),vU(e.options,"debugRows")),_getAllCellsByColumnId:yU((()=>[s.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),vU(e.options,"debugRows"))};for(let t=0;t<e._features.length;t++){const r=e._features[t];null==r||null==r.createRow||r.createRow(s,e)}return s},OU={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},SU=(e,t,r)=>{var n,o;const i=null==r||null==(n=r.toString())?void 0:n.toLowerCase();return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())||null==(o=o.toLowerCase())?void 0:o.includes(i))};SU.autoRemove=e=>RU(e);const EU=(e,t,r)=>{var n;return Boolean(null==(n=e.getValue(t))||null==(n=n.toString())?void 0:n.includes(r))};EU.autoRemove=e=>RU(e);const jU=(e,t,r)=>{var n;return(null==(n=e.getValue(t))||null==(n=n.toString())?void 0:n.toLowerCase())===(null==r?void 0:r.toLowerCase())};jU.autoRemove=e=>RU(e);const PU=(e,t,r)=>{var n;return null==(n=e.getValue(t))?void 0:n.includes(r)};PU.autoRemove=e=>RU(e);const kU=(e,t,r)=>!r.some((r=>{var n;return!(null!=(n=e.getValue(t))&&n.includes(r))}));kU.autoRemove=e=>RU(e)||!(null!=e&&e.length);const CU=(e,t,r)=>r.some((r=>{var n;return null==(n=e.getValue(t))?void 0:n.includes(r)}));CU.autoRemove=e=>RU(e)||!(null!=e&&e.length);const AU=(e,t,r)=>e.getValue(t)===r;AU.autoRemove=e=>RU(e);const NU=(e,t,r)=>e.getValue(t)==r;NU.autoRemove=e=>RU(e);const TU=(e,t,r)=>{let[n,o]=r;const i=e.getValue(t);return i>=n&&i<=o};TU.resolveFilterValue=e=>{let[t,r]=e,n="number"!=typeof t?parseFloat(t):t,o="number"!=typeof r?parseFloat(r):r,i=null===t||Number.isNaN(n)?-1/0:n,a=null===r||Number.isNaN(o)?1/0:o;if(i>a){const e=i;i=a,a=e}return[i,a]},TU.autoRemove=e=>RU(e)||RU(e[0])&&RU(e[1]);const MU={includesString:SU,includesStringSensitive:EU,equalsString:jU,arrIncludes:PU,arrIncludesAll:kU,arrIncludesSome:CU,equals:AU,weakEquals:NU,inNumberRange:TU};function RU(e){return null==e||""===e}const LU={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:pU("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const r=t.getCoreRowModel().flatRows[0],n=null==r?void 0:r.getValue(e.id);return"string"==typeof n?MU.includesString:"number"==typeof n?MU.inNumberRange:"boolean"==typeof n||null!==n&&"object"==typeof n?MU.equals:Array.isArray(n)?MU.arrIncludes:MU.weakEquals},e.getFilterFn=()=>{var r,n;return hU(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(r=null==(n=t.options.filterFns)?void 0:n[e.columnDef.filterFn])?r:MU[e.columnDef.filterFn]},e.getCanFilter=()=>{var r,n,o;return(null==(r=e.columnDef.enableColumnFilter)||r)&&(null==(n=t.options.enableColumnFilters)||n)&&(null==(o=t.options.enableFilters)||o)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var r;return null==(r=t.getState().columnFilters)||null==(r=r.find((t=>t.id===e.id)))?void 0:r.value},e.getFilterIndex=()=>{var r,n;return null!=(r=null==(n=t.getState().columnFilters)?void 0:n.findIndex((t=>t.id===e.id)))?r:-1},e.setFilterValue=r=>{t.setColumnFilters((t=>{const n=e.getFilterFn(),o=null==t?void 0:t.find((t=>t.id===e.id)),i=dU(r,o?o.value:void 0);var a;if(IU(n,i,e))return null!=(a=null==t?void 0:t.filter((t=>t.id!==e.id)))?a:[];const s={id:e.id,value:i};var u;return o?null!=(u=null==t?void 0:t.map((t=>t.id===e.id?s:t)))?u:[]:null!=t&&t.length?[...t,s]:[s]}))}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const r=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var n;return null==(n=dU(t,e))?void 0:n.filter((e=>{const t=r.find((t=>t.id===e.id));if(t){if(IU(t.getFilterFn(),e.value,t))return!1}return!0}))}))},e.resetColumnFilters=t=>{var r,n;e.setColumnFilters(t?[]:null!=(r=null==(n=e.initialState)?void 0:n.columnFilters)?r:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function IU(e,t,r){return!(!e||!e.autoRemove)&&e.autoRemove(t,r)||void 0===t||"string"==typeof t&&!t}const DU={sum:(e,t,r)=>r.reduce(((t,r)=>{const n=r.getValue(e);return t+("number"==typeof n?n:0)}),0),min:(e,t,r)=>{let n;return r.forEach((t=>{const r=t.getValue(e);null!=r&&(n>r||void 0===n&&r>=r)&&(n=r)})),n},max:(e,t,r)=>{let n;return r.forEach((t=>{const r=t.getValue(e);null!=r&&(n<r||void 0===n&&r>=r)&&(n=r)})),n},extent:(e,t,r)=>{let n,o;return r.forEach((t=>{const r=t.getValue(e);null!=r&&(void 0===n?r>=r&&(n=o=r):(n>r&&(n=r),o<r&&(o=r)))})),[n,o]},mean:(e,t)=>{let r=0,n=0;if(t.forEach((t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++r,n+=o)})),r)return n/r},median:(e,t)=>{if(!t.length)return;const r=t.map((t=>t.getValue(e)));if(!function(e){return Array.isArray(e)&&e.every((e=>"number"==typeof e))}(r))return;if(1===r.length)return r[0];const n=Math.floor(r.length/2),o=r.sort(((e,t)=>e-t));return r.length%2!=0?o[n]:(o[n-1]+o[n])/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length},FU={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,r;return null!=(t=null==(r=e.getValue())||null==r.toString?void 0:r.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:pU("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))},e.getCanGroup=()=>{var r,n;return(null==(r=e.columnDef.enableGrouping)||r)&&(null==(n=t.options.enableGrouping)||n)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var r;return null==(r=t.getState().grouping)?void 0:r.includes(e.id)},e.getGroupedIndex=()=>{var r;return null==(r=t.getState().grouping)?void 0:r.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const r=t.getCoreRowModel().flatRows[0],n=null==r?void 0:r.getValue(e.id);return"number"==typeof n?DU.sum:"[object Date]"===Object.prototype.toString.call(n)?DU.extent:void 0},e.getAggregationFn=()=>{var r,n;if(!e)throw new Error;return hU(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(r=null==(n=t.options.aggregationFns)?void 0:n[e.columnDef.aggregationFn])?r:DU[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var r,n;e.setGrouping(t?[]:null!=(r=null==(n=e.initialState)?void 0:n.grouping)?r:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=r=>{if(e._groupingValuesCache.hasOwnProperty(r))return e._groupingValuesCache[r];const n=t.getColumn(r);return null!=n&&n.columnDef.getGroupingValue?(e._groupingValuesCache[r]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[r]):e.getValue(r)},e._groupingValuesCache={}},createCell:(e,t,r,n)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===r.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=r.subRows)||!t.length)}}};const zU={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:pU("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=yU((e=>[qU(t,e)]),(t=>t.findIndex((t=>t.id===e.id))),vU(t.options,"debugColumns")),e.getIsFirstColumn=r=>{var n;return(null==(n=qU(t,r)[0])?void 0:n.id)===e.id},e.getIsLastColumn=r=>{var n;const o=qU(t,r);return(null==(n=o[o.length-1])?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var r;e.setColumnOrder(t?[]:null!=(r=e.initialState.columnOrder)?r:[])},e._getOrderColumnsFn=yU((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,r)=>n=>{let o=[];if(null!=e&&e.length){const t=[...e],r=[...n];for(;r.length&&t.length;){const e=t.shift(),n=r.findIndex((t=>t.id===e));n>-1&&o.push(r.splice(n,1)[0])}o=[...o,...r]}else o=n;return function(e,t,r){if(null==t||!t.length||!r)return e;const n=e.filter((e=>!t.includes(e.id)));if("remove"===r)return n;const o=t.map((t=>e.find((e=>e.id===t)))).filter(Boolean);return[...o,...n]}(o,t,r)}),vU(e.options,"debugTable"))}},BU={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:pU("columnPinning",e)}),createColumn:(e,t)=>{e.pin=r=>{const n=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,o,i,a,s,u;return"right"===r?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter((e=>!(null!=n&&n.includes(e)))),right:[...(null!=(a=null==e?void 0:e.right)?a:[]).filter((e=>!(null!=n&&n.includes(e)))),...n]}:"left"===r?{left:[...(null!=(s=null==e?void 0:e.left)?s:[]).filter((e=>!(null!=n&&n.includes(e)))),...n],right:(null!=(u=null==e?void 0:e.right)?u:[]).filter((e=>!(null!=n&&n.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=n&&n.includes(e)))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter((e=>!(null!=n&&n.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var r,n,o;return(null==(r=e.columnDef.enablePinning)||r)&&(null==(n=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||n)})),e.getIsPinned=()=>{const r=e.getLeafColumns().map((e=>e.id)),{left:n,right:o}=t.getState().columnPinning,i=r.some((e=>null==n?void 0:n.includes(e))),a=r.some((e=>null==o?void 0:o.includes(e)));return i?"left":!!a&&"right"},e.getPinnedIndex=()=>{var r,n;const o=e.getIsPinned();return o?null!=(r=null==(n=t.getState().columnPinning)||null==(n=n[o])?void 0:n.indexOf(e.id))?r:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=yU((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,r)=>{const n=[...null!=t?t:[],...null!=r?r:[]];return e.filter((e=>!n.includes(e.column.id)))}),vU(t.options,"debugRows")),e.getLeftVisibleCells=yU((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left]),((e,t)=>{const r=(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})));return r}),vU(t.options,"debugRows")),e.getRightVisibleCells=yU((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>{const r=(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})));return r}),vU(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var r,n;return e.setColumnPinning(t?{left:[],right:[]}:null!=(r=null==(n=e.initialState)?void 0:n.columnPinning)?r:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var r;const n=e.getState().columnPinning;var o,i;return t?Boolean(null==(r=n[t])?void 0:r.length):Boolean((null==(o=n.left)?void 0:o.length)||(null==(i=n.right)?void 0:i.length))},e.getLeftLeafColumns=yU((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),vU(e.options,"debugColumns")),e.getRightLeafColumns=yU((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),vU(e.options,"debugColumns")),e.getCenterLeafColumns=yU((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,r)=>{const n=[...null!=t?t:[],...null!=r?r:[]];return e.filter((e=>!n.includes(e.id)))}),vU(e.options,"debugColumns"))}},VU={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},$U={getDefaultColumnDef:()=>VU,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:pU("columnSizing",e),onColumnSizingInfoChange:pU("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var r,n,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(r=e.columnDef.minSize)?r:VU.minSize,null!=(n=null!=i?i:e.columnDef.size)?n:VU.size),null!=(o=e.columnDef.maxSize)?o:VU.maxSize)},e.getStart=yU((e=>[e,qU(t,e),t.getState().columnSizing]),((t,r)=>r.slice(0,e.getIndex(t)).reduce(((e,t)=>e+t.getSize()),0)),vU(t.options,"debugColumns")),e.getAfter=yU((e=>[e,qU(t,e),t.getState().columnSizing]),((t,r)=>r.slice(e.getIndex(t)+1).reduce(((e,t)=>e+t.getSize()),0)),vU(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:r,...n}=t;return n}))},e.getCanResize=()=>{var r,n;return(null==(r=e.columnDef.enableResizing)||r)&&(null==(n=t.options.enableColumnResizing)||n)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const r=e=>{var n;e.subHeaders.length?e.subHeaders.forEach(r):t+=null!=(n=e.column.getSize())?n:0};return r(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=r=>{const n=t.getColumn(e.column.id),o=null==n?void 0:n.getCanResize();return i=>{if(!n||!o)return;if(null==i.persist||i.persist(),GU(i)&&i.touches&&i.touches.length>1)return;const a=e.getSize(),s=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[n.id,n.getSize()]],u=GU(i)?Math.round(i.touches[0].clientX):i.clientX,l={},c=(e,r)=>{"number"==typeof r&&(t.setColumnSizingInfo((e=>{var n,o;const i="rtl"===t.options.columnResizeDirection?-1:1,a=(r-(null!=(n=null==e?void 0:e.startOffset)?n:0))*i,s=Math.max(a/(null!=(o=null==e?void 0:e.startSize)?o:0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,r]=e;l[t]=Math.round(100*Math.max(r+r*s,0))/100})),{...e,deltaOffset:a,deltaPercentage:s}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...l}))))},f=e=>c("move",e),d=e=>{c("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},p=r||"undefined"!=typeof document?document:null,h={moveHandler:e=>f(e.clientX),upHandler:e=>{null==p||p.removeEventListener("mousemove",h.moveHandler),null==p||p.removeEventListener("mouseup",h.upHandler),d(e.clientX)}},m={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0].clientX),!1),upHandler:e=>{var t;null==p||p.removeEventListener("touchmove",m.moveHandler),null==p||p.removeEventListener("touchend",m.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(null==(t=e.touches[0])?void 0:t.clientX)}},y=!!function(){if("boolean"==typeof UU)return UU;let e=!1;try{const t={get passive(){return e=!0,!1}},r=()=>{};window.addEventListener("test",r,t),window.removeEventListener("test",r)}catch(t){e=!1}return UU=e,UU}()&&{passive:!1};GU(i)?(null==p||p.addEventListener("touchmove",m.moveHandler,y),null==p||p.addEventListener("touchend",m.upHandler,y)):(null==p||p.addEventListener("mousemove",h.moveHandler,y),null==p||p.addEventListener("mouseup",h.upHandler,y)),t.setColumnSizingInfo((e=>({...e,startOffset:u,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:n.id})))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var r;e.setColumnSizing(t?{}:null!=(r=e.initialState.columnSizing)?r:{})},e.resetHeaderSizeInfo=t=>{var r;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(r=e.initialState.columnSizingInfo)?r:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,r;return null!=(t=null==(r=e.getHeaderGroups()[0])?void 0:r.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getLeftTotalSize=()=>{var t,r;return null!=(t=null==(r=e.getLeftHeaderGroups()[0])?void 0:r.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getCenterTotalSize=()=>{var t,r;return null!=(t=null==(r=e.getCenterHeaderGroups()[0])?void 0:r.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getRightTotalSize=()=>{var t,r;return null!=(t=null==(r=e.getRightHeaderGroups()[0])?void 0:r.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0}}};let UU=null;function GU(e){return"touchstart"===e.type}const WU={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:pU("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=r=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:null!=r?r:!e.getIsVisible()})))},e.getIsVisible=()=>{var r,n;const o=e.columns;return null==(r=o.length?o.some((e=>e.getIsVisible())):null==(n=t.getState().columnVisibility)?void 0:n[e.id])||r},e.getCanHide=()=>{var r,n;return(null==(r=e.columnDef.enableHiding)||r)&&(null==(n=t.options.enableHiding)||n)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=yU((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),vU(t.options,"debugRows")),e.getVisibleCells=yU((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,r)=>[...e,...t,...r]),vU(t.options,"debugRows"))},createTable:e=>{const t=(t,r)=>yU((()=>[r(),r().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),vU(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,(()=>e.getAllFlatColumns())),e.getVisibleLeafColumns=t(0,(()=>e.getAllLeafColumns())),e.getLeftVisibleLeafColumns=t(0,(()=>e.getLeftLeafColumns())),e.getRightVisibleLeafColumns=t(0,(()=>e.getRightLeafColumns())),e.getCenterVisibleLeafColumns=t(0,(()=>e.getCenterLeafColumns())),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var r;e.setColumnVisibility(t?{}:null!=(r=e.initialState.columnVisibility)?r:{})},e.toggleAllColumnsVisible=t=>{var r;t=null!=(r=t)?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,r)=>({...e,[r.id]:t||!(null!=r.getCanHide&&r.getCanHide())})),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var r;e.toggleAllColumnsVisible(null==(r=t.target)?void 0:r.checked)}}};function qU(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const HU={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:pU("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var r;const n=null==(r=e.getCoreRowModel().flatRows[0])||null==(r=r._getAllCellsByColumnId()[t.id])?void 0:r.getValue();return"string"==typeof n||"number"==typeof n}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var r,n,o,i;return(null==(r=e.columnDef.enableGlobalFilter)||r)&&(null==(n=t.options.enableGlobalFilter)||n)&&(null==(o=t.options.enableFilters)||o)&&(null==(i=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||i)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>MU.includesString,e.getGlobalFilterFn=()=>{var t,r;const{globalFilterFn:n}=e.options;return hU(n)?n:"auto"===n?e.getGlobalAutoFilterFn():null!=(t=null==(r=e.options.filterFns)?void 0:r[n])?t:MU[n]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},ZU={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:pU("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,r=!1;e._autoResetExpanded=()=>{var n,o;if(t){if(null!=(n=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?n:!e.options.manualExpanding){if(r)return;r=!0,e._queue((()=>{e.resetExpanded(),r=!1}))}}else e._queue((()=>{t=!0}))},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var r,n;e.setExpanded(t?{}:null!=(r=null==(n=e.initialState)?void 0:n.expanded)?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some((e=>e.getCanExpand())),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const r=e.split(".");t=Math.max(t,r.length)})),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=r=>{t.setExpanded((n=>{var o;const i=!0===n||!(null==n||!n[e.id]);let a={};if(!0===n?Object.keys(t.getRowModel().rowsById).forEach((e=>{a[e]=!0})):a=n,r=null!=(o=r)?o:!i,!i&&r)return{...a,[e.id]:!0};if(i&&!r){const{[e.id]:t,...r}=a;return r}return n}))},e.getIsExpanded=()=>{var r;const n=t.getState().expanded;return!!(null!=(r=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?r:!0===n||(null==n?void 0:n[e.id]))},e.getCanExpand=()=>{var r,n,o;return null!=(r=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?r:(null==(n=t.options.enableExpanding)||n)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let r=!0,n=e;for(;r&&n.parentId;)n=t.getRow(n.parentId,!0),r=n.getIsExpanded();return r},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},KU={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:pU("pagination",e)}),createTable:e=>{let t=!1,r=!1;e._autoResetPageIndex=()=>{var n,o;if(t){if(null!=(n=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?n:!e.options.manualPagination){if(r)return;r=!0,e._queue((()=>{e.resetPageIndex(),r=!1}))}}else e._queue((()=>{t=!0}))},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>dU(t,e))),e.resetPagination=t=>{var r;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(r=e.initialState.pagination)?r:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination((r=>{let n=dU(t,r.pageIndex);const o=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return n=Math.max(0,Math.min(n,o)),{...r,pageIndex:n}}))},e.resetPageIndex=t=>{var r,n;e.setPageIndex(t?0:null!=(r=null==(n=e.initialState)||null==(n=n.pagination)?void 0:n.pageIndex)?r:0)},e.resetPageSize=t=>{var r,n;e.setPageSize(t?10:null!=(r=null==(n=e.initialState)||null==(n=n.pagination)?void 0:n.pageSize)?r:10)},e.setPageSize=t=>{e.setPagination((e=>{const r=Math.max(1,dU(t,e.pageSize)),n=e.pageSize*e.pageIndex,o=Math.floor(n/r);return{...e,pageIndex:o,pageSize:r}}))},e.setPageCount=t=>e.setPagination((r=>{var n;let o=dU(t,null!=(n=e.options.pageCount)?n:-1);return"number"==typeof o&&(o=Math.max(-1,o)),{...r,pageCount:o}})),e.getPageOptions=yU((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),vU(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,r=e.getPageCount();return-1===r||0!==r&&t<r-1},e.previousPage=()=>e.setPageIndex((e=>e-1)),e.nextPage=()=>e.setPageIndex((e=>e+1)),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},YU={getInitialState:e=>({rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onRowPinningChange:pU("rowPinning",e)}),createRow:(e,t)=>{e.pin=(r,n,o)=>{const i=n?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],a=o?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],s=new Set([...a,e.id,...i]);t.setRowPinning((e=>{var t,n,o,i,a,u;return"bottom"===r?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter((e=>!(null!=s&&s.has(e)))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter((e=>!(null!=s&&s.has(e)))),...Array.from(s)]}:"top"===r?{top:[...(null!=(a=null==e?void 0:e.top)?a:[]).filter((e=>!(null!=s&&s.has(e)))),...Array.from(s)],bottom:(null!=(u=null==e?void 0:e.bottom)?u:[]).filter((e=>!(null!=s&&s.has(e))))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter((e=>!(null!=s&&s.has(e)))),bottom:(null!=(n=null==e?void 0:e.bottom)?n:[]).filter((e=>!(null!=s&&s.has(e))))}}))},e.getCanPin=()=>{var r;const{enableRowPinning:n,enablePinning:o}=t.options;return"function"==typeof n?n(e):null==(r=null!=n?n:o)||r},e.getIsPinned=()=>{const r=[e.id],{top:n,bottom:o}=t.getState().rowPinning,i=r.some((e=>null==n?void 0:n.includes(e))),a=r.some((e=>null==o?void 0:o.includes(e)));return i?"top":!!a&&"bottom"},e.getPinnedIndex=()=>{var r,n;const o=e.getIsPinned();if(!o)return-1;const i=null==(r="top"===o?t.getTopRows():t.getBottomRows())?void 0:r.map((e=>{let{id:t}=e;return t}));return null!=(n=null==i?void 0:i.indexOf(e.id))?n:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var r,n;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(r=null==(n=e.initialState)?void 0:n.rowPinning)?r:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var r;const n=e.getState().rowPinning;var o,i;return t?Boolean(null==(r=n[t])?void 0:r.length):Boolean((null==(o=n.top)?void 0:o.length)||(null==(i=n.bottom)?void 0:i.length))},e._getPinnedRows=(t,r,n)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=r?r:[]).map((t=>{const r=e.getRow(t,!0);return r.getIsAllParentsExpanded()?r:null})):(null!=r?r:[]).map((e=>t.find((t=>t.id===e))))).filter(Boolean).map((e=>({...e,position:n})))},e.getTopRows=yU((()=>[e.getRowModel().rows,e.getState().rowPinning.top]),((t,r)=>e._getPinnedRows(t,r,"top")),vU(e.options,"debugRows")),e.getBottomRows=yU((()=>[e.getRowModel().rows,e.getState().rowPinning.bottom]),((t,r)=>e._getPinnedRows(t,r,"bottom")),vU(e.options,"debugRows")),e.getCenterRows=yU((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,r)=>{const n=new Set([...null!=t?t:[],...null!=r?r:[]]);return e.filter((e=>!n.has(e.id)))}),vU(e.options,"debugRows"))}},XU={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:pU("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var r;return e.setRowSelection(t?{}:null!=(r=e.initialState.rowSelection)?r:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection((r=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const n={...r},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach((e=>{e.getCanSelect()&&(n[e.id]=!0)})):o.forEach((e=>{delete n[e.id]})),n}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((r=>{const n=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...r};return e.getRowModel().rows.forEach((t=>{QU(o,t.id,n,!0,e)})),o})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=yU((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,r)=>Object.keys(t).length?JU(e,r):{rows:[],flatRows:[],rowsById:{}}),vU(e.options,"debugTable")),e.getFilteredSelectedRowModel=yU((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,r)=>Object.keys(t).length?JU(e,r):{rows:[],flatRows:[],rowsById:{}}),vU(e.options,"debugTable")),e.getGroupedSelectedRowModel=yU((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,r)=>Object.keys(t).length?JU(e,r):{rows:[],flatRows:[],rowsById:{}}),vU(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:r}=e.getState();let n=Boolean(t.length&&Object.keys(r).length);return n&&t.some((e=>e.getCanSelect()&&!r[e.id]))&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:r}=e.getState();let n=!!t.length;return n&&t.some((e=>!r[e.id]))&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var t;const r=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return r>0&&r<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter((e=>e.getCanSelect())).some((e=>e.getIsSelected()||e.getIsSomeSelected()))},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(r,n)=>{const o=e.getIsSelected();t.setRowSelection((i=>{var a;if(r=void 0!==r?r:!o,e.getCanSelect()&&o===r)return i;const s={...i};return QU(s,e.id,r,null==(a=null==n?void 0:n.selectChildren)||a,t),s}))},e.getIsSelected=()=>{const{rowSelection:r}=t.getState();return eG(e,r)},e.getIsSomeSelected=()=>{const{rowSelection:r}=t.getState();return"some"===tG(e,r)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:r}=t.getState();return"all"===tG(e,r)},e.getCanSelect=()=>{var r;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(r=t.options.enableRowSelection)||r},e.getCanSelectSubRows=()=>{var r;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(r=t.options.enableSubRowSelection)||r},e.getCanMultiSelect=()=>{var r;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(r=t.options.enableMultiRowSelection)||r},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return r=>{var n;t&&e.toggleSelected(null==(n=r.target)?void 0:n.checked)}}}},QU=(e,t,r,n,o)=>{var i;const a=o.getRow(t,!0);r?(a.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),a.getCanSelect()&&(e[t]=!0)):delete e[t],n&&null!=(i=a.subRows)&&i.length&&a.getCanSelectSubRows()&&a.subRows.forEach((t=>QU(e,t.id,r,n,o)))};function JU(e,t){const r=e.getState().rowSelection,n=[],o={},i=function(e,t){return e.map((e=>{var t;const a=eG(e,r);if(a&&(n.push(e),o[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),a)return e})).filter(Boolean)};return{rows:i(t.rows),flatRows:n,rowsById:o}}function eG(e,t){var r;return null!=(r=t[e.id])&&r}function tG(e,t,r){var n;if(null==(n=e.subRows)||!n.length)return!1;let o=!0,i=!1;return e.subRows.forEach((e=>{if((!i||o)&&(e.getCanSelect()&&(eG(e,t)?i=!0:o=!1),e.subRows&&e.subRows.length)){const r=tG(e,t);"all"===r?i=!0:"some"===r?(i=!0,o=!1):o=!1}})),o?"all":!!i&&"some"}const rG=/([0-9]+)/gm;function nG(e,t){return e===t?0:e>t?1:-1}function oG(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function iG(e,t){const r=e.split(rG).filter(Boolean),n=t.split(rG).filter(Boolean);for(;r.length&&n.length;){const e=r.shift(),t=n.shift(),o=parseInt(e,10),i=parseInt(t,10),a=[o,i].sort();if(isNaN(a[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(a[1]))return isNaN(o)?-1:1;if(o>i)return 1;if(i>o)return-1}}return r.length-n.length}const aG={alphanumeric:(e,t,r)=>iG(oG(e.getValue(r)).toLowerCase(),oG(t.getValue(r)).toLowerCase()),alphanumericCaseSensitive:(e,t,r)=>iG(oG(e.getValue(r)),oG(t.getValue(r))),text:(e,t,r)=>nG(oG(e.getValue(r)).toLowerCase(),oG(t.getValue(r)).toLowerCase()),textCaseSensitive:(e,t,r)=>nG(oG(e.getValue(r)),oG(t.getValue(r))),datetime:(e,t,r)=>{const n=e.getValue(r),o=t.getValue(r);return n>o?1:n<o?-1:0},basic:(e,t,r)=>nG(e.getValue(r),t.getValue(r))},sG={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:pU("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const r=t.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const t of r){const r=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(r))return aG.datetime;if("string"==typeof r&&(n=!0,r.split(rG).length>1))return aG.alphanumeric}return n?aG.text:aG.basic},e.getAutoSortDir=()=>{const r=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==r?void 0:r.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var r,n;if(!e)throw new Error;return hU(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(r=null==(n=t.options.sortingFns)?void 0:n[e.columnDef.sortingFn])?r:aG[e.columnDef.sortingFn]},e.toggleSorting=(r,n)=>{const o=e.getNextSortingOrder(),i=null!=r;t.setSorting((a=>{const s=null==a?void 0:a.find((t=>t.id===e.id)),u=null==a?void 0:a.findIndex((t=>t.id===e.id));let l,c=[],f=i?r:"desc"===o;var d;(l=null!=a&&a.length&&e.getCanMultiSort()&&n?s?"toggle":"add":null!=a&&a.length&&u!==a.length-1?"replace":s?"toggle":"replace","toggle"===l&&(i||o||(l="remove")),"add"===l)?(c=[...a,{id:e.id,desc:f}],c.splice(0,c.length-(null!=(d=t.options.maxMultiSortColCount)?d:Number.MAX_SAFE_INTEGER))):c="toggle"===l?a.map((t=>t.id===e.id?{...t,desc:f}:t)):"remove"===l?a.filter((t=>t.id!==e.id)):[{id:e.id,desc:f}];return c}))},e.getFirstSortDir=()=>{var r,n;return(null!=(r=null!=(n=e.columnDef.sortDescFirst)?n:t.options.sortDescFirst)?r:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=r=>{var n,o;const i=e.getFirstSortDir(),a=e.getIsSorted();return a?!!(a===i||null!=(n=t.options.enableSortingRemoval)&&!n||r&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===a?"asc":"desc"):i},e.getCanSort=()=>{var r,n;return(null==(r=e.columnDef.enableSorting)||r)&&(null==(n=t.options.enableSorting)||n)&&!!e.accessorFn},e.getCanMultiSort=()=>{var r,n;return null!=(r=null!=(n=e.columnDef.enableMultiSort)?n:t.options.enableMultiSort)?r:!!e.accessorFn},e.getIsSorted=()=>{var r;const n=null==(r=t.getState().sorting)?void 0:r.find((t=>t.id===e.id));return!!n&&(n.desc?"desc":"asc")},e.getSortIndex=()=>{var r,n;return null!=(r=null==(n=t.getState().sorting)?void 0:n.findIndex((t=>t.id===e.id)))?r:-1},e.clearSorting=()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},e.getToggleSortingHandler=()=>{const r=e.getCanSort();return n=>{r&&(null==n.persist||n.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(n))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var r,n;e.setSorting(t?[]:null!=(r=null==(n=e.initialState)?void 0:n.sorting)?r:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},uG=[wU,WU,zU,BU,OU,LU,{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},HU,sG,FU,ZU,KU,YU,XU,$U];function lG(e){var t,r;const n=[...uG,...null!=(t=e._features)?t:[]];let o={_features:n};const i=o._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(o))),{});let a={...null!=(r=e.initialState)?r:{}};o._features.forEach((e=>{var t;a=null!=(t=null==e.getInitialState?void 0:e.getInitialState(a))?t:a}));const s=[];let u=!1;const l={_features:n,options:{...i,...e},initialState:a,_queue:e=>{s.push(e),u||(u=!0,Promise.resolve().then((()=>{for(;s.length;)s.shift()();u=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{o.setState(o.initialState)},setOptions:e=>{const t=dU(e,o.options);o.options=(e=>o.options.mergeOptions?o.options.mergeOptions(i,e):{...i,...e})(t)},getState:()=>o.options.state,setState:e=>{null==o.options.onStateChange||o.options.onStateChange(e)},_getRowId:(e,t,r)=>{var n;return null!=(n=null==o.options.getRowId?void 0:o.options.getRowId(e,t,r))?n:`${r?[r.id,t].join("."):t}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?o.getPrePaginationRowModel():o.getRowModel()).rowsById[e];if(!r&&(r=o.getCoreRowModel().rowsById[e],!r))throw new Error;return r},_getDefaultColumnDef:yU((()=>[o.options.defaultColumn]),(e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,r;return null!=(t=null==(r=e.renderValue())||null==r.toString?void 0:r.toString())?t:null},...o._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),vU(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:yU((()=>[o._getColumnDefs()]),(e=>{const t=function(e,r,n){return void 0===n&&(n=0),e.map((e=>{const i=function(e,t,r,n){var o,i;const a={...e._getDefaultColumnDef(),...t},s=a.accessorKey;let u,l=null!=(o=null!=(i=a.id)?i:s?"function"==typeof String.prototype.replaceAll?s.replaceAll(".","_"):s.replace(/\./g,"_"):void 0)?o:"string"==typeof a.header?a.header:void 0;if(a.accessorFn?u=a.accessorFn:s&&(u=s.includes(".")?e=>{let t=e;for(const e of s.split(".")){var r;t=null==(r=t)?void 0:r[e]}return t}:e=>e[a.accessorKey]),!l)throw new Error;let c={id:`${String(l)}`,accessorFn:u,parent:n,depth:r,columnDef:a,columns:[],getFlatColumns:yU((()=>[!0]),(()=>{var e;return[c,...null==(e=c.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),vU(e.options,"debugColumns")),getLeafColumns:yU((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=c.columns)&&t.length){let t=c.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[c]}),vU(e.options,"debugColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(c,e);return c}(o,e,n,r),a=e;return i.columns=a.columns?t(a.columns,i,n+1):[],i}))};return t(e)}),vU(e,"debugColumns")),getAllFlatColumns:yU((()=>[o.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),vU(e,"debugColumns")),_getAllFlatColumnsById:yU((()=>[o.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),vU(e,"debugColumns")),getAllLeafColumns:yU((()=>[o.getAllColumns(),o._getOrderColumnsFn()]),((e,t)=>{let r=e.flatMap((e=>e.getLeafColumns()));return t(r)}),vU(e,"debugColumns")),getColumn:e=>o._getAllFlatColumnsById()[e]};Object.assign(o,l);for(let e=0;e<o._features.length;e++){const t=o._features[e];null==t||null==t.createTable||t.createTable(o)}return o}function cG(e,t,r){return r.options.filterFromLeafRows?function(e,t,r){var n;const o=[],i={},a=null!=(n=r.options.maxLeafRowFilterDepth)?n:100,s=function(e,n){void 0===n&&(n=0);const u=[];for(let c=0;c<e.length;c++){var l;let f=e[c];const d=_U(r,f.id,f.original,f.index,f.depth,void 0,f.parentId);if(d.columnFilters=f.columnFilters,null!=(l=f.subRows)&&l.length&&n<a){if(d.subRows=s(f.subRows,n+1),f=d,t(f)&&!d.subRows.length){u.push(f),i[f.id]=f,o.push(f);continue}if(t(f)||d.subRows.length){u.push(f),i[f.id]=f,o.push(f);continue}}else f=d,t(f)&&(u.push(f),i[f.id]=f,o.push(f))}return u};return{rows:s(e),flatRows:o,rowsById:i}}(e,t,r):function(e,t,r){var n;const o=[],i={},a=null!=(n=r.options.maxLeafRowFilterDepth)?n:100,s=function(e,n){void 0===n&&(n=0);const u=[];for(let c=0;c<e.length;c++){let f=e[c];if(t(f)){var l;if(null!=(l=f.subRows)&&l.length&&n<a){const e=_U(r,f.id,f.original,f.index,f.depth,void 0,f.parentId);e.subRows=s(f.subRows,n+1),f=e}u.push(f),o.push(f),i[f.id]=f}}return u};return{rows:s(e),flatRows:o,rowsById:i}}(e,t,r)}function fG(e,t){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(n=e)||"function"==typeof n||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(n)?r.createElement(e,t):e:null;var n}const dG=mo("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),pG=mo("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),hG=mo("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var mG=["className"],yG=["className"],vG=["className"],gG=["className","isActive","size"],bG=["className"],wG=["className"],xG=["className"];function _G(){return _G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_G.apply(null,arguments)}function OG(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var SG=function(e){var t=e.className,r=OG(e,mG);return io("nav",_G({role:"navigation","aria-label":"pagination",className:Nr("mx-auto flex w-full justify-center",t)},r))};SG.displayName="Pagination";var EG=r.forwardRef((function(e,t){var r=e.className,n=OG(e,yG);return io("ul",_G({ref:t,className:Nr("flex flex-row items-center gap-1",r)},n))}));EG.displayName="PaginationContent";var jG=r.forwardRef((function(e,t){var r=e.className,n=OG(e,vG);return io("li",_G({ref:t,className:Nr("",r)},n))}));jG.displayName="PaginationItem";var PG=function(e){var t=e.className,r=e.isActive,n=e.size,o=void 0===n?"icon":n,i=OG(e,gG);return io("button",_G({"aria-current":r?"page":void 0,className:Nr(uo({variant:r?"outline":"ghost",size:o}),t)},i))};PG.displayName="PaginationLink";var kG=function(e){var t=e.className,r=OG(e,bG);return io(PG,_G({"aria-label":"Go to previous page",size:"default",className:Nr("gap-1 pl-2.5",t)},r),io(dG,{className:"h-4 w-4"}),io("span",null,"Previous"))};kG.displayName="PaginationPrevious";var CG=function(e){var t=e.className,r=OG(e,wG);return io(PG,_G({"aria-label":"Go to next page",size:"default",className:Nr("gap-1 pr-2.5",t)},r),io("span",null,"Next"),io(pG,{className:"h-4 w-4"}))};CG.displayName="PaginationNext";var AG=function(e){var t=e.className,r=OG(e,xG);return io("span",_G({"aria-hidden":!0,className:Nr("flex h-9 w-9 items-center justify-center",t)},r),io(hG,{className:"h-4 w-4"}),io("span",{className:"sr-only"},"More pages"))};function NG(e){var t=e.table,r=e.loading,n=void 0!==r&&r;return io("div",{className:"flex flex-wrap items-center justify-between space-x-2 py-4"},io("div",{className:"flex-1 text-sm text-muted-foreground hidden lg:block"},t.getFilteredSelectedRowModel().rows.length," of"," ",t.getFilteredRowModel().rows.length," row(s) selected."),io("div",{className:"flex-1 flex space-x-2 items-center justify-center"},io("p",{className:"text-sm font-medium"},(0,Lo.__)("Rows per page","trigger")),io("select",{value:t.getState().pagination.pageSize,onChange:function(e){t.setPageSize(Number(e.target.value))},className:"h-8 w-[70px] rounded-md border border-input bg-transparent px-2 py-1 text-sm"},[10,20,30,40,50].map((function(e){return io("option",{key:e,value:e},e)})))),io(SG,{className:"flex-1 justify-end"},io(EG,{className:"gap-2"},io(jG,null,io(kG,{onClick:function(){return t.previousPage()},disabled:!t.getCanPreviousPage()||n,"aria-disabled":!t.getCanPreviousPage()||n,className:"h-8 min-w-8 px-2"})),Array.from({length:t.getPageCount()},(function(e,r){var n=r+1,o=t.getState().pagination.pageIndex+1;return 1===n||n===t.getPageCount()||n>=o-1&&n<=o+1?io(jG,{key:r},io(PG,{onClick:function(){return t.setPageIndex(r)},isActive:o===n,className:"h-8 min-w-8 px-3"},n)):2===n&&o>3||n===t.getPageCount()-1&&o<t.getPageCount()-2?io(jG,{key:r},io(AG,{className:"h-8"})):null})),io(jG,null,io(CG,{onClick:function(){return t.nextPage()},disabled:!t.getCanNextPage()||n,"aria-disabled":!t.getCanNextPage()||n,className:"h-8 min-w-8 px-2"})))))}AG.displayName="PaginationEllipsis";var TG=o(2543),MG=o(1594);function RG(e){var t=e.table,n=e.searchKey,o=e.searchPlaceholder,i=void 0===o?"Search...":o,a=e.onSearch,s=e.onDeleteSelected,u=e.enableSearch,l=void 0!==u&&u,c=e.renderCustomContent,f=(0,r.useCallback)((0,TG.debounce)((function(e){if(a)a(e);else if(n){var r;null===(r=t.getColumn(n))||void 0===r||r.setFilterValue(e)}}),500),[a,n,t]),d=t.getFilteredSelectedRowModel().rows;return io("div",{className:"flex items-center justify-between h-12"},c?c():io(MG.Fragment,null,io("div",{className:"flex-1"},io("h3",{className:"text-lg font-medium"},(0,Lo.__)("Email Logs","trigger"))),io("div",{className:"flex items-center gap-4"},d.length>0?io("div",{className:"flex items-center gap-4"},io("span",{className:"text-sm text-muted-foreground"},d.length," ",(0,Lo.__)("selected","trigger")),s&&io(lo,{variant:"destructive",size:"sm",onClick:s,className:"flex items-center gap-2"},io(Ro,{className:"h-4 w-4"}),(0,Lo.__)("Delete Selected","trigger"))):l?io(xs,{placeholder:i,onChange:function(e){f(e.target.value)},className:"w-[300px]"}):null)))}function LG(e){var t=e.columns,r=e.rows,n=void 0===r?5:r;return io(Co,null,Array.from({length:n}).map((function(e,r){return io(Ao,{key:r},Array.from({length:t}).map((function(e,t){return io(To,{key:t},io("div",{className:"h-6 w-full animate-pulse rounded bg-gray-200"}))})))})))}function IG(e){var t,n=e.columns,o=e.data,i=e.pageCount,a=e.loading,s=void 0!==a&&a,u=e.sorting,l=void 0===u?[]:u,c=e.pagination,f=e.columnFilters,d=void 0===f?[]:f,p=e.rowSelection,h=void 0===p?{}:p,m=e.searchKey,y=e.searchPlaceholder,v=e.onSearch,g=e.onPaginationChange,b=e.onSortingChange,w=e.onColumnFiltersChange,x=e.onRowSelectionChange,_=e.onDeleteSelected,O=e.enableRowSelection,S=void 0!==O&&O,E=e.enableSearch,j=void 0!==E&&E,P=e.enablePagination,k=void 0===P||P,C=e.renderToolbar,A=e.renderEmpty,N=function(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=r.useState((()=>({current:lG(t)}))),[o,i]=r.useState((()=>n.current.initialState));return n.current.setOptions((t=>({...t,...e,state:{...o,...e.state},onStateChange:t=>{i(t),null==e.onStateChange||e.onStateChange(t)}}))),n.current}({data:o,columns:n,pageCount:i,state:{sorting:l,pagination:c,columnFilters:d,rowSelection:h},enableRowSelection:S,onRowSelectionChange:x,onPaginationChange:g,onSortingChange:b,getSortedRowModel:e=>yU((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,r)=>{if(!r.rows.length||null==t||!t.length)return r;const n=e.getState().sorting,o=[],i=n.filter((t=>{var r;return null==(r=e.getColumn(t.id))?void 0:r.getCanSort()})),a={};i.forEach((t=>{const r=e.getColumn(t.id);r&&(a[t.id]={sortUndefined:r.columnDef.sortUndefined,invertSorting:r.columnDef.invertSorting,sortingFn:r.getSortingFn()})}));const s=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let n=0;n<i.length;n+=1){var r;const o=i[n],s=a[o.id],u=s.sortUndefined,l=null!=(r=null==o?void 0:o.desc)&&r;let c=0;if(u){const r=void 0===e.getValue(o.id),n=void 0===t.getValue(o.id);if(r||n){if("first"===u)return r?-1:1;if("last"===u)return r?1:-1;c=r&&n?0:r?u:-u}}if(0===c&&(c=s.sortingFn(e,t,o.id)),0!==c)return l&&(c*=-1),s.invertSorting&&(c*=-1),c}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=s(e.subRows))})),t};return{rows:s(r.rows),flatRows:o,rowsById:r.rowsById}}),vU(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),getCoreRowModel:e=>yU((()=>[e.options.data]),(t=>{const r={rows:[],flatRows:[],rowsById:{}},n=function(t,o,i){void 0===o&&(o=0);const a=[];for(let u=0;u<t.length;u++){const l=_U(e,e._getRowId(t[u],u,i),t[u],u,o,void 0,null==i?void 0:i.id);var s;r.flatRows.push(l),r.rowsById[l.id]=l,a.push(l),e.options.getSubRows&&(l.originalSubRows=e.options.getSubRows(t[u],u),null!=(s=l.originalSubRows)&&s.length&&(l.subRows=n(l.originalSubRows,o+1,l)))}return a};return r.rows=n(t),r}),vU(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),onColumnFiltersChange:w,getFilteredRowModel:e=>yU((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,r,n)=>{if(!t.rows.length||(null==r||!r.length)&&!n){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],i=[];(null!=r?r:[]).forEach((t=>{var r;const n=e.getColumn(t.id);if(!n)return;const i=n.getFilterFn();i&&o.push({id:t.id,filterFn:i,resolvedValue:null!=(r=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?r:t.value})}));const a=(null!=r?r:[]).map((e=>e.id)),s=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let l,c;n&&s&&u.length&&(a.push("__global__"),u.forEach((e=>{var t;i.push({id:e.id,filterFn:s,resolvedValue:null!=(t=null==s.resolveFilterValue?void 0:s.resolveFilterValue(n))?t:n})})));for(let e=0;e<t.flatRows.length;e++){const r=t.flatRows[e];if(r.columnFilters={},o.length)for(let e=0;e<o.length;e++){l=o[e];const t=l.id;r.columnFilters[t]=l.filterFn(r,t,l.resolvedValue,(e=>{r.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){c=i[e];const t=c.id;if(c.filterFn(r,t,c.resolvedValue,(e=>{r.columnFiltersMeta[t]=e}))){r.columnFilters.__global__=!0;break}}!0!==r.columnFilters.__global__&&(r.columnFilters.__global__=!1)}}return cG(t.rows,(e=>{for(let t=0;t<a.length;t++)if(!1===e.columnFilters[a[t]])return!1;return!0}),e)}),vU(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),manualPagination:!0,getRowId:e.getRowId});return io("div",{className:"space-y-4"},(C||j)&&io(RG,{table:N,searchKey:m,searchPlaceholder:y,onSearch:v,onDeleteSelected:_,enableSearch:j,renderCustomContent:C}),io("div",{className:"rounded-md border"},io(Po,null,io(ko,null,N.getHeaderGroups().map((function(e){return io(Ao,{key:e.id},e.headers.map((function(e){return io(No,{key:e.id},e.isPlaceholder?null:fG(e.column.columnDef.header,e.getContext()))})))}))),s?io(LG,{columns:n.length}):null!==(t=N.getRowModel().rows)&&void 0!==t&&t.length?io(Co,null,N.getRowModel().rows.map((function(e){return io(Ao,{key:e.id,"data-state":e.getIsSelected()&&"selected"},e.getVisibleCells().map((function(e){return io(To,{key:e.id},fG(e.column.columnDef.cell,e.getContext()))})))}))):io(Co,null,io(Ao,null,io(To,{colSpan:n.length,className:"h-24 text-center"},A?A():"No results found."))))),k&&io(NG,{table:N,loading:s}))}function DG(e){return DG="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},DG(e)}function FG(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function zG(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?FG(Object(r),!0).forEach((function(t){BG(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):FG(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function BG(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=DG(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=DG(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==DG(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function VG(){VG=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),s=new A(n||[]);return o(a,"_invoke",{value:j(e,r,s)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=c;var d="suspendedStart",p="suspendedYield",h="executing",m="completed",y={};function v(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var x=Object.getPrototypeOf,_=x&&x(x(N([])));_&&_!==r&&n.call(_,a)&&(w=_);var O=b.prototype=v.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,s){var u=f(e[o],e,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==DG(c)&&n.call(c,"__await")?t.resolve(c.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(c).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function j(t,r,n){var o=d;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=P(s,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var l=f(t,r,n);if("normal"===l.type){if(o=n.done?m:p,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=m,n.method="throw",n.arg=l.arg)}}}function P(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,P(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var i=f(o,t.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function N(t){if(t||""===t){var r=t[a];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(DG(t)+" is not iterable")}return g.prototype=b,o(O,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=l(b,u,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,l(e,u,"GeneratorFunction")),e.prototype=Object.create(O),e},t.awrap=function(e){return{__await:e}},S(E.prototype),l(E.prototype,s,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(c(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(O),l(O,u,"Generator"),l(O,a,(function(){return this})),l(O,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=N,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(C),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return s.type="throw",s.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:N(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function $G(e,t,r,n,o,i,a){try{var s=e[i](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,o)}function UG(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){$G(i,n,o,a,s,"next",e)}function s(e){$G(i,n,o,a,s,"throw",e)}a(void 0)}))}}function GG(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return WG(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?WG(e,t):void 0}}(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.")}()}function WG(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var qG=function(e){var t=e.title,n=e.children,o=e.defaultOpen,i=void 0!==o&&o,a=GG((0,r.useState)(i),2),s=a[0],u=a[1];return io("div",{className:"border rounded-lg"},io("button",{className:"w-full px-4 py-3 flex items-center justify-between text-left font-medium hover:bg-gray-50",onClick:function(){return u(!s)}},io("span",null,t),io(s?H$:ng,{className:"h-4 w-4 text-gray-500"})),s&&io("div",{className:"px-4 py-3 border-t"},n))};const HG=function(){var e,t=GG((0,r.useState)([]),2),n=t[0],o=t[1],i=GG((0,r.useState)([]),2),a=i[0],s=i[1],u=GG((0,r.useState)({pageIndex:0,pageSize:10}),2),l=u[0],c=l.pageIndex,f=l.pageSize,d=u[1],p=GG((0,r.useState)([]),2),h=p[0],m=p[1],y=GG((0,r.useState)(0),2),v=y[0],g=y[1],b=GG((0,r.useState)(!0),2),w=b[0],x=b[1],_=GG((0,r.useState)(null),2),O=_[0],S=_[1],E=GG((0,r.useState)(null),2),j=E[0],P=E[1],k=GG((0,r.useState)(!1),2),C=k[0],A=k[1],N=GG((0,r.useState)(!1),2),T=N[0],M=N[1],R=GG((0,r.useState)({}),2),L=R[0],I=R[1],D=GG((0,r.useState)(""),2),F=D[0],z=D[1],B=GG((0,r.useState)(null),2),V=B[0],$=B[1],U=function(){var e=UG(VG().mark((function e(t){var r,n,o;return VG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return A(!0),e.prev=1,(r=new FormData).append("action","trigger_delete_email_log"),r.append("trigger_nonce",rd.nonce_value),r.append("id",t.toString()),e.next=8,fetch(rd.ajax_url,{method:"POST",body:r});case 8:return n=e.sent,e.next=11,n.json();case 11:if(200!==(null==(o=e.sent)?void 0:o.status_code)){e.next=18;break}return mh.success((null==o?void 0:o.message)||(0,Lo.__)("Email log deleted successfully","trigger")),e.next=16,J({page:c+1,per_page:f,search:F});case 16:e.next=19;break;case 18:mh.error((null==o?void 0:o.message)||(0,Lo.__)("Failed to delete email log","trigger"));case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(1),mh.error((0,Lo.__)("Failed to delete email log","trigger"));case 24:return e.prev=24,A(!1),P(null),e.finish(24);case 28:case"end":return e.stop()}}),e,null,[[1,21,24,28]])})));return function(t){return e.apply(this,arguments)}}(),G=function(){var e=UG(VG().mark((function e(){var t,r,n,o;return VG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(j){e.next=2;break}return e.abrupt("return");case 2:return M(!0),e.prev=3,t=Object.keys(L).map((function(e){return parseInt(e)})).filter(Boolean),(r=new FormData).append("action","trigger_bulk_delete_email_logs"),r.append("trigger_nonce",rd.nonce_value),r.append("ids",JSON.stringify(t)),e.next=11,fetch(rd.ajax_url,{method:"POST",body:r});case 11:return n=e.sent,e.next=14,n.json();case 14:if(200!==(null==(o=e.sent)?void 0:o.status_code)){e.next=22;break}return I({}),mh.success((0,Lo.__)("Selected email logs deleted successfully","trigger")),e.next=20,J({page:c+1,per_page:f,search:F});case 20:e.next=23;break;case 22:mh.error((null==o?void 0:o.message)||(0,Lo.__)("Failed to delete email logs","trigger"));case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(3),mh.error((0,Lo.__)("Failed to delete email logs","trigger"));case 28:return e.prev=28,M(!1),P(null),e.finish(28);case 32:case"end":return e.stop()}}),e,null,[[3,25,28,32]])})));return function(){return e.apply(this,arguments)}}(),W=GG((0,r.useState)(null),2),q=W[0],H=W[1],Z=ep({mutationFn:(e=_h(wh().mark((function e(t){var r,n;return wh().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={action:"trigger_resend_email",id:t.id.toString(),to:t.mail_to,subject:t.subject,message:t.message,headers:t.headers,attachments:t.attachments},n=yp(rd.ajax_url,{body:r}),e.abrupt("return",n);case 3:case"end":return e.stop()}}),e)}))),function(t){return e.apply(this,arguments)}),onSuccess:function(e){200===e.status_code&&mh.success((null==e?void 0:e.message)||(0,Lo.__)("Email resend successfully","trigger"))},onError:function(){mh.error((0,Lo.__)("Failed to resend email","trigger"))}}),K=Z.mutateAsync,Y=Z.isPending,X=function(){var e=UG(VG().mark((function e(t){return VG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K(t);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Q=[{id:"select",header:function(e){var t=e.table;return io(fU,{checked:t.getIsAllPageRowsSelected()||t.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:function(e){return t.toggleAllPageRowsSelected(!!e)},"aria-label":(0,Lo.__)("Select all","trigger")})},cell:function(e){var t=e.row,r=e.table.getRowModel().rows.findIndex((function(e){return e.id===t.id}));return io(fU,{checked:t.getIsSelected(),onCheckedChange:function(e){var t,n=window.event;!function(e,t,r){var n=h[e];if(n){if(r&&null!==V){for(var o=Math.min(e,V),i=Math.max(e,V),a=zG({},L),s=o;s<=i;s++){var u=h[s];u&&(a[u.id]=t)}I(a)}else I((function(e){return zG(zG({},e),{},BG({},n.id,t))}));$(e)}}(r,e,null!==(t=null==n?void 0:n.shiftKey)&&void 0!==t&&t)},"aria-label":(0,Lo.__)("Select row","trigger")})},enableSorting:!1,enableHiding:!1},{accessorKey:"mail_to",header:(0,Lo.__)("To","trigger")},{accessorKey:"subject",header:(0,Lo.__)("Subject","trigger")},{accessorKey:"status",header:(0,Lo.__)("Status","trigger"),cell:function(e){var t=e.row.getValue("status");return io(yw,{variant:"outline",className:"".concat("success"===t?"bg-green-50 text-green-700 border-green-200":"bg-red-50 text-red-700 border-red-200")},"success"===t?"Successful":"Failed")}},{accessorKey:"provider",header:(0,Lo.__)("Provider","trigger"),cell:function(e){var t=e.row.getValue("provider");return sp(t)}},{accessorKey:"created_at",header:(0,Lo.__)("Date","trigger"),cell:function(e){var t=e.row;return z$(new Date(t.getValue("created_at")),"PPpp")}},{id:"actions",header:(0,Lo.__)("Actions","trigger"),cell:function(e){var t=e.row.original;return io("div",{className:"flex items-center gap-2"},io(lo,{variant:"ghost",size:"icon",onClick:function(){return H(t)},className:"h-8 w-8 p-0"},io(Z$,{className:"h-8 w-4 p-0"})),io(lo,{variant:"ghost",size:"icon",onClick:function(){return function(e){S(e)}(t)},className:"h-8 w-8 p-0"},io(K$,{className:"h-4 w-4"})),io(lo,{variant:"ghost",size:"icon",onClick:function(){return P(t)},className:"h-8 w-8 p-0 text-red-500 hover:text-red-600 hover:bg-red-50"},io(Ro,{className:"h-4 w-4"})))}}],J=function(){var e=UG(VG().mark((function e(t){var r,n,o;return VG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(!0),e.prev=1,(r=new FormData).append("action","trigger_fetch_email_logs"),r.append("trigger_nonce",rd.nonce_value),r.append("page",t.page.toString()),r.append("per_page",t.per_page.toString()),t.search&&r.append("search",t.search),e.next=10,fetch(rd.ajax_url,{method:"POST",body:r});case 10:return n=e.sent,e.next=13,n.json();case 13:200===(o=e.sent).status_code?(m(o.data.email_logs),g(o.data.meta.total_pages)):mh.error((null==o?void 0:o.message)||(0,Lo.__)("Failed to fetch email logs","trigger")),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(1),mh.error((0,Lo.__)("Failed to fetch email logs","trigger"));case 20:return e.prev=20,x(!1),e.finish(20);case 23:case"end":return e.stop()}}),e,null,[[1,17,20,23]])})));return function(t){return e.apply(this,arguments)}}();(0,r.useEffect)((function(){J({page:c+1,per_page:f,search:F})}),[c,f]);return io("div",{className:"p-4 space-y-4"},io(IG,{columns:Q,data:h,pageCount:v,loading:w,sorting:n,pagination:{pageIndex:c,pageSize:f},columnFilters:a,rowSelection:L,searchKey:"subject",searchPlaceholder:(0,Lo.__)("Search by subject or email...","trigger"),onSearch:function(e){z(e),d((function(e){return zG(zG({},e),{},{pageIndex:0})})),J({page:1,per_page:f,search:e})},onPaginationChange:d,onSortingChange:o,onColumnFiltersChange:s,onRowSelectionChange:I,onDeleteSelected:function(){return P({id:-1})},enableRowSelection:!0,enableSearch:!0,enablePagination:!0,getRowId:function(e){return e.id.toString()}}),io(Ab,{open:!!O,onOpenChange:function(){return S(null)}},io(Mb,{className:"max-w-4xl max-h-[90vh] overflow-y-auto"},io("div",{className:"flex items-start justify-between mb-6"},io("h2",{className:"text-xl font-semibold"},(0,Lo.__)("Email Log","trigger"))),O&&io("div",{className:"space-y-6"},io("div",{className:"space-y-4"},io("div",{className:"flex items-center justify-between"},io("div",{className:"space-y-1"},io("div",{className:"flex items-center gap-2"},io("span",{className:"text-gray-500"},(0,Lo.__)("Sent to:","trigger")),io("span",null,O.mail_to)),io("div",{className:"flex items-center gap-2"},io("span",{className:"text-gray-500"},(0,Lo.__)("Subject:","trigger")),io("span",null,O.subject))),io("div",{className:"text-right space-y-2"},io("div",{className:"flex justify-end gap-2"},io(yw,{variant:"success"},(0,Lo.__)("Successful","trigger"))),io("div",{className:"text-gray-500"},z$(new Date(O.created_at),"MMM dd, yyyy, hh:mm a"))))),io("div",{className:"space-y-4"},io(qG,{title:"Email Body",defaultOpen:!0},io("div",{className:"prose max-w-none",dangerouslySetInnerHTML:{__html:O.message}})),io(qG,{title:"Email Headers"},io("div",{className:"space-y-2"},io("div",{className:"grid grid-cols-[100px_1fr] gap-2"},io("span",{className:"text-gray-500"},"From:"),io("span",null,O.mail_from)),io("div",{className:"grid grid-cols-[100px_1fr] gap-2"},io("span",{className:"text-gray-500"},"Reply-To:"),io("span",null)),io("div",{className:"grid grid-cols-[100px_1fr] gap-2"},io("span",{className:"text-gray-500"},"CC:"),io("span",null)),io("div",{className:"grid grid-cols-[100px_1fr] gap-2"},io("span",{className:"text-gray-500"},"BCC:"),io("span",null)),io("div",{className:"grid grid-cols-[100px_1fr] gap-2"},io("span",{className:"text-gray-500"},"Content-Type:"),io("span",null,"text/html; charset=UTF-8")),io("div",{className:"grid grid-cols-[100px_1fr] gap-2"},io("span",{className:"text-gray-500"},"X-Mailer:"),io("span",null,"WordPress/6.7.2")))),io(qG,{title:"Attachments (0)"},io("div",{className:"text-gray-500 italic"},(0,Lo.__)("No attachments found.","trigger"))),io(qG,{title:"Server Response"},io("pre",{className:"bg-gray-50 p-4 rounded-md text-sm font-mono whitespace-pre-wrap"},O.headers)))))),io(Ub,{open:!!j,onOpenChange:function(e){return!e&&P(null)},title:-1===(null==j?void 0:j.id)?(0,Lo.__)("Delete Selected Email Logs","trigger"):(0,Lo.__)("Delete Email Log","trigger"),description:-1===(null==j?void 0:j.id)?(0,Lo.__)("Are you sure you want to delete all selected email logs? This action cannot be undone.","trigger"):(0,Lo.__)("Are you sure you want to delete this email log? This action cannot be undone.","trigger"),icon:io(Gb,{className:"h-5 w-5 text-destructive"}),variant:"danger",confirmText:(0,Lo.__)("Delete","trigger"),cancelText:(0,Lo.__)("Cancel","trigger"),onConfirm:UG(VG().mark((function e(){return VG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!j){e.next=8;break}if(-1!==j.id){e.next=6;break}return e.next=4,G();case 4:e.next=8;break;case 6:return e.next=8,U(j.id);case 8:case"end":return e.stop()}}),e)}))),loading:C||T,loadingText:(0,Lo.__)("Deleting...","trigger")},j&&-1!==j.id&&io("div",{className:"space-y-2 mt-4"},io("div",{className:"grid grid-cols-2 gap-2"},io("div",null,io("span",{className:"font-medium"},(0,Lo.__)("From:","trigger")),io("p",{className:"text-sm text-muted-foreground"},j.mail_from)),io("div",null,io("span",{className:"font-medium"},(0,Lo.__)("To:","trigger")),io("p",{className:"text-sm text-muted-foreground"},j.mail_to))),io("div",null,io("span",{className:"font-medium"},(0,Lo.__)("Subject:","trigger")),io("p",{className:"text-sm text-muted-foreground"},j.subject))),-1===(null==j?void 0:j.id)&&io("div",{className:"mt-4"},io("p",{className:"text-sm text-muted-foreground"},Object.keys(L).length," ",(0,Lo.__)("email logs will be deleted.","trigger")))),io(Ub,{open:!!q,onOpenChange:function(e){return!e&&H(null)},title:(0,Lo.__)("Resend Email","trigger"),description:(0,Lo.__)("Are you sure you want to resend this email?","trigger"),icon:io(Z$,{className:"h-5 w-5 text-primary"}),variant:"success",confirmText:(0,Lo.__)("Resend","trigger"),cancelText:(0,Lo.__)("Cancel","trigger"),onConfirm:UG(VG().mark((function e(){return VG().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!q){e.next=4;break}return e.next=3,X(q);case 3:H(null);case 4:case"end":return e.stop()}}),e)}))),loading:Y,loadingText:(0,Lo.__)("Resending...","trigger")},q&&io("div",{className:"space-y-2 mt-4"},io("div",null,io("span",{className:"font-medium"},(0,Lo.__)("To:","trigger")),io("p",{className:"text-sm text-muted-foreground"},q.mail_to)),io("div",null,io("span",{className:"font-medium"},(0,Lo.__)("Subject:","trigger")),io("p",{className:"text-sm text-muted-foreground"},q.subject)))))};var ZG=o(1594);const KG=function(){return io(ZG.Fragment,null,io(Bw,null))};var YG=class extends nd{constructor(e={}){super(),this.config=e,this.#V=new Map}#V;build(e,t,r){const n=t.queryKey,o=t.queryHash??dd(n,t);let i=this.get(o);return i||(i=new Ld({client:e,queryKey:n,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(n)}),this.add(i)),i}add(e){this.#V.has(e.queryHash)||(this.#V.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#V.get(e.queryHash);t&&(e.destroy(),t===e&&this.#V.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){jd.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}get(e){return this.#V.get(e)}getAll(){return[...this.#V.values()]}find(e){const t={exact:!0,...e};return this.getAll().find((e=>cd(t,e)))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter((t=>cd(e,t))):t}notify(e){jd.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){jd.batch((()=>{this.getAll().forEach((e=>{e.onFocus()}))}))}onOnline(){jd.batch((()=>{this.getAll().forEach((e=>{e.onOnline()}))}))}},XG=class extends nd{constructor(e={}){super(),this.config=e,this.#$=new Set,this.#U=new Map,this.#G=0}#$;#U;#G;build(e,t,r){const n=new Qd({mutationCache:this,mutationId:++this.#G,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#$.add(e);const t=QG(e);if("string"==typeof t){const r=this.#U.get(t);r?r.push(e):this.#U.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#$.delete(e)){const t=QG(e);if("string"==typeof t){const r=this.#U.get(t);if(r)if(r.length>1){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#U.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=QG(e);if("string"==typeof t){const r=this.#U.get(t),n=r?.find((e=>"pending"===e.state.status));return!n||n===e}return!0}runNext(e){const t=QG(e);if("string"==typeof t){const r=this.#U.get(t)?.find((t=>t!==e&&t.state.isPaused));return r?.continue()??Promise.resolve()}return Promise.resolve()}clear(){jd.batch((()=>{this.#$.forEach((e=>{this.notify({type:"removed",mutation:e})})),this.#$.clear(),this.#U.clear()}))}getAll(){return Array.from(this.#$)}find(e){const t={exact:!0,...e};return this.getAll().find((e=>fd(t,e)))}findAll(e={}){return this.getAll().filter((t=>fd(e,t)))}notify(e){jd.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){const e=this.getAll().filter((e=>e.state.isPaused));return jd.batch((()=>Promise.all(e.map((e=>e.continue().catch(id))))))}};function QG(e){return e.options.scope?.id}function JG(e){return{onFetch:(t,r)=>{const n=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},u=0;const l=async()=>{let r=!1;const l=Sd(t.options,t.fetchOptions),c=async(e,n,o)=>{if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);const i={client:t.client,queryKey:t.queryKey,pageParam:n,direction:o?"backward":"forward",meta:t.options.meta};(e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?r=!0:t.signal.addEventListener("abort",(()=>{r=!0})),t.signal)})})(i);const a=await l(i),{maxPages:s}=t.options,u=o?_d:xd;return{pages:u(e.pages,a,s),pageParams:u(e.pageParams,n,s)}};if(o&&i.length){const e="backward"===o,t={pages:i,pageParams:a},r=(e?tW:eW)(n,t);s=await c(t,r,e)}else{const t=e??i.length;do{const e=0===u?a[0]??n.initialPageParam:eW(n,s);if(u>0&&null==e)break;s=await c(s,e),u++}while(u<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function eW(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function tW(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var rW=t.createRoot(document.getElementById("trigger-root")),nW=new class{#W;#D;#c;#q;#H;#Z;#K;#Y;constructor(e={}){this.#W=e.queryCache||new YG,this.#D=e.mutationCache||new XG,this.#c=e.defaultOptions||{},this.#q=new Map,this.#H=new Map,this.#Z=0}mount(){this.#Z++,1===this.#Z&&(this.#K=Ed.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#W.onFocus())})),this.#Y=Pd.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#W.onOnline())})))}unmount(){this.#Z--,0===this.#Z&&(this.#K?.(),this.#K=void 0,this.#Y?.(),this.#Y=void 0)}isFetching(e){return this.#W.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#D.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#W.build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ud(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#W.findAll(e).map((({queryKey:e,state:t})=>[e,t.data]))}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),o=this.#W.get(n.queryHash),i=o?.state.data,a=function(e,t){return"function"==typeof e?e(t):e}(t,i);if(void 0!==a)return this.#W.build(this,n).setData(a,{...r,manual:!0})}setQueriesData(e,t,r){return jd.batch((()=>this.#W.findAll(e).map((({queryKey:e})=>[e,this.setQueryData(e,t,r)]))))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#W.get(t.queryHash)?.state}removeQueries(e){const t=this.#W;jd.batch((()=>{t.findAll(e).forEach((e=>{t.remove(e)}))}))}resetQueries(e,t){const r=this.#W;return jd.batch((()=>(r.findAll(e).forEach((e=>{e.reset()})),this.refetchQueries({type:"active",...e},t))))}cancelQueries(e,t={}){const r={revert:!0,...t},n=jd.batch((()=>this.#W.findAll(e).map((e=>e.cancel(r)))));return Promise.all(n).then(id).catch(id)}invalidateQueries(e,t={}){return jd.batch((()=>(this.#W.findAll(e).forEach((e=>{e.invalidate()})),"none"===e?.refetchType?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=jd.batch((()=>this.#W.findAll(e).filter((e=>!e.isDisabled())).map((e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(id)),"paused"===e.state.fetchStatus?Promise.resolve():t}))));return Promise.all(n).then(id)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const r=this.#W.build(this,t);return r.isStaleByTime(ud(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(id).catch(id)}fetchInfiniteQuery(e){return e.behavior=JG(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(id).catch(id)}ensureInfiniteQueryData(e){return e.behavior=JG(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Pd.isOnline()?this.#D.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#W}getMutationCache(){return this.#D}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,t){this.#q.set(pd(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#q.values()],r={};return t.forEach((t=>{hd(e,t.queryKey)&&Object.assign(r,t.defaultOptions)})),r}setMutationDefaults(e,t){this.#H.set(pd(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#H.values()],r={};return t.forEach((t=>{hd(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)})),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=dd(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Od&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#W.clear(),this.#D.clear()}}({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:!1}}});rW.render(io((({client:e,children:t})=>(r.useEffect((()=>(e.mount(),()=>{e.unmount()})),[e]),(0,ft.jsx)($d.Provider,{value:e,children:t}))),{client:nW},io((function({basename:e,children:t,window:n}){let o=r.useRef();null==o.current&&(o.current=s({window:n,v5Compat:!0}));let i=o.current,[a,u]=r.useState({action:i.action,location:i.location}),l=r.useCallback((e=>{r.startTransition((()=>u(e)))}),[u]);return r.useLayoutEffect((()=>i.listen(l)),[i,l]),r.createElement(ve,{basename:e,children:t,location:a.location,navigationType:a.action,navigator:i})}),null,io(m_,null),io((function({children:e,location:t}){return ne(ge(e),t)}),null,io(ye,{path:"/",element:io(q$,null)}),io(ye,{path:"/dashboard",element:io(q$,null)}),io(ye,{path:"/email_logs",element:io(HG,null)}),io(ye,{path:"/settings",element:io(KG,null)}),io(ye,{path:"/connections",element:io(Mw,null)}),io(ye,{path:"/general",element:io(Bw,null)}),io(ye,{path:"/add-connection",element:io(l_,null)})),io((({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:o,children:i,containerStyle:a,containerClassName:s})=>{let{toasts:u,handlers:l}=Hp(n);return r.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...a},className:s,onMouseEnter:l.startPause,onMouseLeave:l.endPause},u.map((n=>{let a=n.position||t,s=((e,t)=>{let r=e.includes("top"),n=r?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:Ip()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...n,...o}})(a,l.calculateOffset(n,{reverseOrder:e,gutter:o,defaultPosition:t}));return r.createElement(ph,{id:n.id,key:n.id,onHeightUpdate:l.updateHeight,className:n.visible?hh:"",style:s},"custom"===n.type?Rp(n.message,n):i?i(n):r.createElement(dh,{toast:n,position:a}))})))}),{position:"bottom-right",containerClassName:"!z-[9999999]",toastOptions:{duration:5e3,style:{background:"#fff",color:"#333",border:"1px solid #e5e7eb",padding:"16px",borderRadius:"8px",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"},success:{style:{background:"#f0fdf4",borderColor:"#86efac"}},error:{style:{background:"#fef2f2",borderColor:"#fecaca"}}}}))))})()})();
  • trigger/trunk/inc/Controllers/EmailLogController.php

    r3300034 r3306201  
    6666        add_action( 'wp_ajax_trigger_bulk_delete_email_logs', array( $this, 'bulk_delete_email_logs' ) );
    6767        add_action( 'wp_ajax_trigger_send_test_email', array( $this, 'send_test_email' ) );
    68         add_action( 'admin_init', array( $this, 'handle_google_oauth_callback' ) );
     68        add_action( 'wp_ajax_trigger_resend_email', array( $this, 'trigger_resend_email' ) );
     69        // add_action( 'admin_init', array( $this, 'handle_google_oauth_callback' ) );
     70        add_action( 'wp_ajax_handle_google_oauth_callback', array( $this, 'handle_google_oauth_callback' ) );
    6971    }
    7072
     
    7476    public function handle_google_oauth_callback() {
    7577        $provider = trigger_get_provider( 'gmail' );
    76         // Handle OAuth Callback
    77         if ( isset( $_GET['code'] ) && null !== $provider && 'gmail' === $provider['provider'] ) {
     78        // Verify nonce for security.
     79        $data = trigger_verify_request( true );
     80        $code = $data['data']['code'];
     81
     82        if ( ! empty( $code ) && null !== $provider && 'gmail' === $provider['provider'] ) {
    7883            $response = wp_remote_post(
    7984                'https://oauth2.googleapis.com/token',
    8085                array(
    8186                    'body' => array(
    82                         'code'          => $_GET['code'], // phpcs:ignore
     87                        'code'          => $code,
    8388                        'client_id'     => $provider['clientId'],
    8489                        'client_secret' => $provider['clientSecret'],
     
    9196            if ( isset( $body['access_token'] ) ) {
    9297                update_option( GMAIL_AUTH_CREDENTIALS, $body );
    93                 wp_safe_redirect( admin_url( 'admin.php?page=trigger#/connections?google_gmail_redirect=true' ) );
     98                return $this->json_response( 'Gmail connected successfully!', null, 200 );
     99                // wp_safe_redirect( admin_url( 'admin.php?page=trigger#/connections?google_gmail_redirect=true' ) );
    94100            } else {
    95                 wp_safe_redirect( admin_url( 'admin.php?page=trigger#/connections?google_gmail_redirect_failed=true' ) );
     101                return $this->json_response( 'Gmail connection failed!', null, 400 );
     102                // wp_safe_redirect( admin_url( 'admin.php?page=trigger#/connections?google_gmail_redirect_failed=true' ) );
    96103            }
    97104        }
     
    281288
    282289        $validation_rules = array(
    283             'sendTo'   => 'required|email',
     290            'to'       => 'required|email',
    284291            'provider' => 'required',
    285292        );
     
    290297        }
    291298
    292         $subject = __( 'AWS SES Test Email from Trigger', 'trigger' );
     299        $subject = __( 'Test Email from Trigger', 'trigger' );
    293300        $message = __( 'This is a test email sent from Trigger plugin.', 'trigger' );
    294301        $headers = array( 'Content-Type: text/html; charset=UTF-8' );
     
    305312        if ( 'ses' === $provider ) {
    306313            $ses_mailer = new SesMailer();
    307             $sent       = $ses_mailer->send_email( $params['sendTo'], $subject, $message, $headers, $config, true );
     314            $sent       = $ses_mailer->send_email( $params['to'], $subject, $message, $headers, $config, true );
    308315        } elseif ( 'gmail' === $provider ) {
    309316            $gmailer = new GMailer();
    310             $sent    = $gmailer->send_email( $params );
     317            $sent    = $gmailer->send_email( $params['to'], $subject, $message, $headers, true );
    311318        } else {
    312319            // For all other providers, use wp_mail
    313             $sent = ( new TriggerMailer() )->trigger_wp_mail( $params['sendTo'], $subject, $message, $headers );
     320            $sent = ( new TriggerMailer() )->trigger_wp_mail( $params['to'], $subject, $message, $headers );
    314321        }
    315322
     
    319326                    'wp_mail_succeeded',
    320327                    array(
    321                         'to'      => $params['sendTo'],
     328                        'to'      => $params['to'],
    322329                        'subject' => $subject,
    323330                        'message' => $message,
     
    335342                        __( 'Failed to send test email', 'trigger' ),
    336343                        array(
    337                             'to'      => $params['sendTo'],
     344                            'to'      => $params['to'],
    338345                            'subject' => $subject,
    339346                            'message' => $message,
     
    346353        }
    347354    }
     355
     356    /**
     357     * Resend email
     358     *
     359     * @param array $params Array containing the email data.
     360     * @return object
     361     */
     362    public function trigger_resend_email( $params ) {
     363        try {
     364            $verify = trigger_verify_request();
     365            if ( ! $verify['success'] ) {
     366                return $this->json_response( $verify['message'], null, $verify['code'] );
     367            }
     368
     369            $params = $verify['data'];
     370
     371            $default_provider = trigger_get_default_provider();
     372            $provider         = $default_provider['provider'];
     373
     374            if ( 'ses' === $provider ) {
     375                $ses_mailer = new SesMailer();
     376                $sent       = $ses_mailer->send_email( $params['to'], $params['subject'], $params['message'], $params['headers'], array(), true );
     377            } elseif ( 'gmail' === $provider ) {
     378                $gmailer = new GMailer();
     379                $sent    = $gmailer->send_email( $params['to'], $params['subject'], $params['message'], $params['headers'], array(), true );
     380            } else {
     381                // For all other providers, use wp_mail
     382                $sent = ( new TriggerMailer() )->trigger_wp_mail( $params['to'], $params['subject'], $params['message'], $params['headers'] );
     383            }
     384
     385            if ( $sent ) {
     386                if ( 'smtp' !== $provider ) {
     387                    do_action(
     388                        'wp_mail_succeeded',
     389                        array(
     390                            'to'      => $params['to'],
     391                            'subject' => $params['subject'],
     392                            'message' => $params['message'],
     393                            'headers' => $params['headers'],
     394                        )
     395                    );
     396                }
     397                return $this->json_response( __( 'Test email sent successfully', 'trigger' ), null, 200 );
     398            } else {
     399                if ( 'smtp' !== $provider ) {
     400                    do_action(
     401                        'wp_mail_failed',
     402                        new \WP_Error(
     403                            'wp_mail_failed',
     404                            __( 'Failed to send test email', 'trigger' ),
     405                            array(
     406                                'to'      => $params['to'],
     407                                'subject' => $params['subject'],
     408                                'message' => $params['message'],
     409                                'headers' => $params['headers'],
     410                            )
     411                        )
     412                    );
     413                }
     414                return $this->json_response( __( 'Failed to send test email', 'trigger' ), null, 400 );
     415            }
     416        } catch ( \Throwable $th ) {
     417            return $this->json_response( 'Error resending email: ' . $th->getMessage(), null, 500 );
     418        }
     419    }
    348420}
  • trigger/trunk/inc/Controllers/Provider/gmail/GMailer.php

    r3300034 r3306201  
    6868     * Send email using Gmail API
    6969     *
    70      * @param array $data Email data.
    71      *
    72      * @return bool|string True on success, error message on failure.
    73      */
    74     public function send_email( $data ) {
    75         $to      = $data['sendTo'];
    76         $subject = 'Test Email from Gmail API';
    77         $body    = "Hello!\nThis email was sent using Gmail API (no composer) from a WordPress plugin.";
    78 
    79         $raw_message  = "From: me\r\n";
    80         $raw_message .= "To: $to\r\n";
     70     * @param string $to Recipient email address.
     71     * @param string $subject Email subject.
     72     * @param string $message Email body (HTML).
     73     * @param array  $headers Email headers.
     74     * @param array  $attachments Array of attachments.
     75     * @param bool   $is_html Whether the message is in HTML format.
     76     *
     77     * @return bool|string True on success, error message on failure
     78     */
     79    public function send_email( $to, $subject, $message, $headers = array(), $attachments, $is_html = false ) {
     80        if ( is_array( $to ) ) {
     81            $to = $to[0];
     82        }
     83        $subject = $subject;
     84        $body    = $message;
     85
     86        if ( $is_html ) {
     87            // todo $body = wp_kses_post( $message );
     88            $is_html = $is_html;
     89        }
     90
     91        // $raw_message  = "From: {$headers['From']}\r\n";
     92        $raw_message  = "To: $to\r\n";
    8193        $raw_message .= "Subject: $subject\r\n";
    8294        $raw_message .= "MIME-Version: 1.0\r\n";
  • trigger/trunk/inc/Core/EmailConfiguration.php

    r3300034 r3306201  
    3030        $this->config = get_option( TRIGGER_DEFAULT_EMAIL_PROVIDER, array() );
    3131        add_action( 'phpmailer_init', array( $this, 'configure_email' ), 10, 1 );
    32         add_action( 'trigger_phpmailer_init', array( $this, 'config_smtp_for_test_ail' ), 10, 1 );
     32        add_action( 'trigger_phpmailer_init', array( $this, 'config_smtp_for_test_mail' ), 10, 1 );
    3333    }
    3434
     
    9797     * @throws Exception If there's an error configuring SES.
    9898     */
    99     public function config_smtp_for_test_ail( PHPMailer $phpmailer ) {
     99    public function config_smtp_for_test_mail( PHPMailer $phpmailer ) {
    100100        $provider = trigger_get_provider( 'smtp' );
    101101        if ( empty( $provider ) ) {
  • trigger/trunk/inc/Core/TriggerMailer.php

    r3300034 r3306201  
    398398         * @param PHPMailer $phpmailer The PHPMailer instance (passed by reference).
    399399         */
    400         do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
     400        // do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) );
    401401
    402402        do_action_ref_array( 'trigger_phpmailer_init', array( &$phpmailer ) );
  • trigger/trunk/inc/TriggerGlobals.php

    r3300034 r3306201  
    1010use Trigger\Helpers\UtilityHelper;
    1111use Trigger\Controllers\Provider\aws\SesMailer;
     12use Trigger\Controllers\Provider\gmail\GMailer;
    1213
    1314/**
     
    3839
    3940/**
    40  * [trigger_get_provider description]
     41 * Trigger_get_provider description
    4142 *
    4243 * @param provider $provider description.
     
    4950        return false;
    5051    }
    51     return $trigger_email_config[ $provider ];
     52    return $trigger_email_config[ $provider ] ?? false;
    5253}
    5354
     
    516517                    throw new PHPMailer\PHPMailer\Exception( 'Failed to send email using SES' );
    517518                }
     519            } elseif ( 'gmail' === $default_provider['provider'] ) {
     520                $gmailer = new GMailer();
     521                $send    = $gmailer->send_email( $to, $subject, $message, $headers, $attachments, false );
    518522            } else {
    519523                $send = $phpmailer->send();
  • trigger/trunk/languages/trigger.pot

    r3300034 r3306201  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Trigger SMTP, Mail Logs, Deliver Mails 1.0.1\n"
     5"Project-Id-Version: Trigger SMTP, Mail Logs, Deliver Mails 1.0.2\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/trigger\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2025-05-24T20:53:57+00:00\n"
     12"POT-Creation-Date: 2025-06-04T07:16:56+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.11.0\n"
     14"X-Generator: WP-CLI 2.12.0\n"
    1515"X-Domain: trigger\n"
    1616
     
    5858msgstr ""
    5959
    60 #: inc/Controllers/EmailLogController.php:292
    61 msgid "AWS SES Test Email from Trigger"
    62 msgstr ""
    63 
    64 #: inc/Controllers/EmailLogController.php:293
     60#: inc/Controllers/EmailLogController.php:299
     61msgid "Test Email from Trigger"
     62msgstr ""
     63
     64#: inc/Controllers/EmailLogController.php:300
    6565msgid "This is a test email sent from Trigger plugin."
    6666msgstr ""
    6767
    68 #: inc/Controllers/EmailLogController.php:300
     68#: inc/Controllers/EmailLogController.php:307
    6969#: inc/Controllers/Provider/aws/AwsSesController.php:62
    7070#: inc/Controllers/Provider/aws/AwsSesController.php:111
     
    7272msgstr ""
    7373
    74 #: inc/Controllers/EmailLogController.php:328
     74#: inc/Controllers/EmailLogController.php:335
     75#: inc/Controllers/EmailLogController.php:397
    7576msgid "Test email sent successfully"
    7677msgstr ""
    7778
    78 #: inc/Controllers/EmailLogController.php:335
    79 #: inc/Controllers/EmailLogController.php:345
     79#: inc/Controllers/EmailLogController.php:342
     80#: inc/Controllers/EmailLogController.php:352
     81#: inc/Controllers/EmailLogController.php:404
     82#: inc/Controllers/EmailLogController.php:414
    8083msgid "Failed to send test email"
    8184msgstr ""
     
    100103#. translators: %s: Email address that was verified
    101104#: inc/Controllers/Provider/aws/SesMailer.php:174
     105#, php-format
    102106msgid "Verification email sent to %s. Please check your inbox and follow the instructions to verify your email address."
    103107msgstr ""
     
    176180#. translators: %1$s: field name, %2$d: value
    177181#: inc/Helpers/ValidationHelper.php:83
     182#, php-format
    178183msgid "%1$s need to be greater than %2$d"
    179184msgstr ""
     
    181186#. translators: %1$s: field name, %2$d: value
    182187#: inc/Helpers/ValidationHelper.php:91
     188#, php-format
    183189msgid "%1$s need to be less than %2$d"
    184190msgstr ""
     
    186192#. translators: %s: field name
    187193#: inc/Helpers/ValidationHelper.php:98
     194#, php-format
    188195msgid "%s is not valid email"
    189196msgstr ""
     
    191198#. translators: %1$s: field name, %2$d: value
    192199#: inc/Helpers/ValidationHelper.php:105
     200#, php-format
    193201msgid "%1$s minimum length is %2$d"
    194202msgstr ""
     
    196204#. translators: %1$s: field name, %2$d: value
    197205#: inc/Helpers/ValidationHelper.php:112
     206#, php-format
    198207msgid "%1$s maximum length is %2$d"
    199208msgstr ""
     
    223232msgstr ""
    224233
    225 #: inc/TriggerGlobals.php:77
     234#: inc/TriggerGlobals.php:78
    226235msgid "Access denied! Please login to access this feature."
    227236msgstr ""
    228237
    229 #: inc/TriggerGlobals.php:95
     238#: inc/TriggerGlobals.php:96
    230239msgid "Invalid security token!"
    231240msgstr ""
    232241
    233 #: inc/TriggerGlobals.php:103
     242#: inc/TriggerGlobals.php:104
    234243msgid "Verification successful."
    235244msgstr ""
  • trigger/trunk/readme.txt

    r3300040 r3306201  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.0.1
     7Stable tag: 1.0.2
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    2626== Changelog ==
    2727
     28= 1.0.2 - June 4, 2025
     29
     30New: Resend mail option in Email List
     31
    2832= 1.0.1 - May 25, 2025
    2933
  • trigger/trunk/triggermail.php

    r3300034 r3306201  
    22/**
    33 * Plugin Name: Trigger SMTP, Mail Logs, Deliver Mails
    4  * Version: 1.0.1
     4 * Version: 1.0.2
    55 * Requires at least: 5.3
    66 * Requires PHP: 7.4
Note: See TracChangeset for help on using the changeset viewer.