var __awaiter=this&&this.__awaiter||function(t,e,o,n){function r(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,i){function s(t){try{l(n.next(t))}catch(t){i(t)}}function u(t){try{l(n["throw"](t))}catch(t){i(t)}}function l(t){t.done?o(t.value):r(t.value).then(s,u)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s;return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(t){return function(e){return l([t,e])}}function l(s){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;r=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=e.call(t,o)}catch(t){s=[6,t];r=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./index-c820db66.system.js"],(function(t){"use strict";var e,o,n;return{setters:[function(t){e=t.r;o=t.j;n=t.h}],execute:function(){var r=".sc-smoothly-submit-h{display:block;border-width:1px;border-style:solid;border-radius:3px}[hidden].sc-smoothly-submit-h{display:none}[disabled].sc-smoothly-submit-h{opacity:.5}button.sc-smoothly-submit{padding:.2em .3em;font-size:110%;font-weight:400}[processing].sc-smoothly-submit-h{border-color:rgb(var(--smoothly-light-color))}[processing].sc-smoothly-submit-h>button.sc-smoothly-submit{color:rgb(var(--smoothly-light-contrast));background:rgb(var(--smoothly-light-color))}.sc-smoothly-submit-h:not([processing]):not([disabled]):hover,.sc-smoothly-submit-h:not([processing]):not([disabled]):focus,.sc-smoothly-submit-h:not([processing]):not([disabled]):active{border-color:rgb(var(--smoothly-submit-border))}[expand=fill].sc-smoothly-submit-h>button.sc-smoothly-submit,[expand=block].sc-smoothly-submit-h>button.sc-smoothly-submit{width:100%}[expand=fill].sc-smoothly-submit-h{border-left:none;border-right:none}";var i=t("smoothly_submit",function(){function t(t){e(this,t);this.submitEvent=o(this,"submit",7);this.disabled=false}Object.defineProperty(t.prototype,"form",{get:function(){return this.button&&this.button.form||undefined},enumerable:false,configurable:true});t.prototype.handleSubmit=function(t){return __awaiter(this,void 0,void 0,(function(){var e,o,n,r,i,n,r,u;return __generator(this,(function(l){if(!this.processing){this.processing=true;if(this.prevent)t.preventDefault();e={};if(this.form){o=this.form.elements;for(n=0;n<o.length;n++){r=o.item(n);if(s(r)&&r.name)e[r.name]=r.value}i=this.form.getElementsByTagName("smoothly-input");for(n=0;n<i.length;n++){r=i.item(n);if(s(r)&&r.name)e[r.name]=r.value}}u=this.submitEvent.emit(e);console.log("smoothly-submit",u);this.processing=false}return[2]}))}))};t.prototype.submit=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){if(t=!!this.form)this.form.submit();return[2,t]}))}))};t.prototype.render=function(){var t=this;return[n("smoothly-spinner",{active:this.processing}),n("button",{type:"submit",disabled:this.disabled||this.processing,ref:function(e){return t.button=e}},n("slot",null))]};return t}());function s(t){return typeof t.name=="string"&&typeof t.value=="string"}i.style=r}}}));