| 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:"[email protected]"},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:"[email protected]"},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:"[email protected]"},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:"[email protected]"},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:"[email protected]"},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:"[email protected]"},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:"[email protected]"},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:"[email protected]"},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:"[email protected]"},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:"[email protected]"},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:"[email protected]"},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:"[email protected]"},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,w |