import{p as a,i as f,a as h,r as E}from"./i18n-Dnhn5Rxr.js";import{R as w,S as b,a as o,T as k,X as I,W as x,t as z,a6 as R,a7 as S,w as T,a5 as W,a0 as X,a8 as j}from"./index-DWyDLubb.js";import{G as q}from"./utils.svelte-CCyS_0CY.js";import{s as A}from"./snippet-BWgYNF9D.js";import{B as F}from"./Button-D-_s2ksk.js";import"./clone-BkeCM4Nl.js";import"./Image-CeW7PJs4.js";import"./misc-vsnLZ-Y1.js";/* empty css                                            */import"./ScrollFade.svelte_svelte_type_style_lang-DPHOQHBm.js";/* empty css                                                   */var H=x('<img class="button-icon svelte-4ac0fl"/>'),J=x("<!> <!>",1);function K(u,e){w(e,!0);let c=a(e,"elem_id",3,""),t=a(e,"elem_classes",19,()=>[]),m=a(e,"visible",3,!0),v=a(e,"variant",3,"secondary"),_=a(e,"size",3,"lg"),d=a(e,"disabled",3,!1),B=a(e,"scale",3,null),y=a(e,"min_width",3,void 0);function p(){if(e.on_click?.(),!e.value?.url)return;let r;if(!e.value.orig_name&&e.value.url){const s=e.value.url.split("/");r=s[s.length-1],r=r.split("?")[0].split("#")[0]}else r=e.value.orig_name;const l=document.createElement("a");l.href=e.value.url,l.download=r||"file",document.body.appendChild(l),l.click(),document.body.removeChild(l)}F(u,{get size(){return _()},get variant(){return v()},get elem_id(){return c()},get elem_classes(){return t()},get visible(){return m()},onclick:p,get scale(){return B()},get min_width(){return y()},get disabled(){return d()},children:(r,l)=>{var s=J(),g=b(s);{var C=i=>{var n=H();z(()=>{h(n,"src",e.icon.url),h(n,"alt",`${e.value} icon`)}),o(i,n)};f(g,i=>{e.icon&&i(C)})}var G=I(g,2);{var P=i=>{var n=R(),D=b(n);A(D,()=>e.children),o(i,n)};f(G,i=>{e.children&&i(P)})}o(r,s)},$$slots:{default:!0}}),k()}function te(u,e){w(e,!0);const c=E(e,["$$slots","$$events","$$legacy"]),t=new q(c);{let m=W(()=>!t.shared.interactive);K(u,{get value(){return t.props.value},get variant(){return t.props.variant},get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},get size(){return t.props.size},get scale(){return t.shared.scale},get icon(){return t.props.icon},get min_width(){return t.shared.min_width},get visible(){return t.shared.visible},get disabled(){return T(m)},on_click:()=>t.dispatch("click"),children:(v,_)=>{j();var d=S();z(()=>X(d,t.shared.label??"")),o(v,d)},$$slots:{default:!0}})}k()}export{K as BaseButton,te as default};
