import{r as t,h as s,H as o,c as i}from"./p-890a2f7e.js";const e=class{constructor(s){t(this,s),this.fill="solid",this.size="medium"}async loadDocument(){this.name&&(this.document=await e.load(this.name))}async componentWillLoad(){await this.loadDocument()}hostData(){return{innerHTML:this.document?this.document.replace(' width="512" height="512"',"").replace(/(<title>)[\w\d\s-]*(<\/title>)/,`<title>${this.toolTip||""}</title>`).replace(/stroke:#000;/gi,""):void 0}}__stencil_render(){return[]}static async fetch(t){const s=await fetch(t);return s.ok?s.text():void 0}static async load(t){var s;const o=`https://unpkg.com/ionicons@5.0.0/dist/svg/${t}.svg`;return null!==(s=e.cache[o])&&void 0!==s?s:e.cache[o]=e.fetch(o)}static get watchers(){return{name:["loadDocument"]}}render(){return s(o,this.hostData(),this.__stencil_render())}};e.cache={},e.style="[size].sc-smoothly-icon-h{background:none}.sc-smoothly-icon-h{display:block}[hidden].sc-smoothly-icon-h{display:none}[size=small].sc-smoothly-icon-h{width:1.4em;height:1.4em}[size=medium].sc-smoothly-icon-h{width:1.8em;height:1.8em}[size=large].sc-smoothly-icon-h{width:2.8em;height:2.8em}[size=xlarge].sc-smoothly-icon-h{width:4em;height:4em}";const r=class{constructor(s){t(this,s)}render(){return s("div",null,"Loading...")}};r.style='.sc-smoothly-spinner-h{display:block;position:relative}[hidden].sc-smoothly-spinner-h{display:none}.sc-smoothly-spinner-h:not([active]){display:none}.sc-smoothly-spinner-h{position:absolute;left:0;top:0;width:100%;height:100%;background:rgba(var(--smoothly-default-color), var(--smoothly-semitransparent))}.sc-smoothly-spinner-h>div.sc-smoothly-spinner{opacity:1;position:absolute;left:calc(50% - 5em + 1.1em);top:calc(50% - 5em + 1.1em)}.sc-smoothly-spinner-h>div.sc-smoothly-spinner,.sc-smoothly-spinner-h>div.sc-smoothly-spinner::after{border-radius:50%;width:5em;height:5em}.sc-smoothly-spinner-h>div.sc-smoothly-spinner{content:"";color:transparent;position:relative;border-top:1.1em solid rgb(var(--smoothly-primary-tint));border-right:1.1em solid rgb(var(--smoothly-primary-tint));border-bottom:1.1em solid rgb(var(--smoothly-primary-tint));border-left:1.1em solid rgb(var(--smoothly-primary-color));-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:load8 1.1s infinite linear;animation:load8 1.1s infinite linear}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}';const n=class{constructor(s){t(this,s),this.submitEvent=i(this,"submit",7),this.disabled=!1}get form(){return this.button&&this.button.form||void 0}async handleSubmit(t){if(!this.processing){this.processing=!0,this.prevent&&t.preventDefault();const s={};if(this.form){const t=this.form.elements;for(let o=0;o<t.length;o++){const i=t.item(o);h(i)&&i.name&&(s[i.name]=i.value)}const o=this.form.getElementsByTagName("smoothly-input");for(let t=0;t<o.length;t++){const i=o.item(t);h(i)&&i.name&&(s[i.name]=i.value)}}const o=this.submitEvent.emit(s);console.log("smoothly-submit",o),this.processing=!1}}async submit(){let t;return(t=!!this.form)&&this.form.submit(),t}render(){return[s("smoothly-spinner",{active:this.processing}),s("button",{type:"submit",disabled:this.disabled||this.processing,ref:t=>this.button=t},s("slot",null))]}};function h(t){return"string"==typeof t.name&&"string"==typeof t.value}n.style=".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:0.5}button.sc-smoothly-submit{padding:0.2em 0.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}";export{e as smoothly_icon,r as smoothly_spinner,n as smoothly_submit}