1import { p as prop, i as if_block, a as set_attribute, b as set_class, f as set_style } from './i18n-CMo5lpzy.js'; 2import { R as push, a6 as comment, S as first_child, a as append, T as pop, aj as delegate, V as child, X as sibling, Y as reset, t as template_effect, W as from_html, w as get, a5 as user_derived } from './index-BvBk1Iap.js'; 3import { s as snippet } from './snippet-Bl5YVoCg.js'; 4import { I as Image } from './Image-CDw5qb5O.js'; 5import './ScrollFade.svelte_svelte_type_style_lang-Xm-PLg9E.js'; 6/* empty css */ 7 8var root_1 = from_html(`<a><!> <!></a>`); 9var root_4 = from_html(`<button><!> <!></button>`); 10 11function Button($$anchor, $$props) { 12 push($$props, true); 13 14 let elem_classes = prop($$props, 'elem_classes', 19, () => []), 15 onclick = prop($$props, 'onclick', 3, () => {}); 16 17 var fragment = comment(); 18 var node = first_child(fragment); 19 20 { 21 var consequent_2 = ($$anchor) => { 22 var a = root_1(); 23 let classes; 24 let styles; 25 var node_1 = child(a); 26 27 { 28 var consequent = ($$anchor) => { 29 { 30 let $0 = user_derived(() => ({ alt: `${$$props.value} icon`, class: "button-icon" })); 31 32 Image($$anchor, { 33 get src() { 34 return $$props.icon.url; 35 }, 36 37 get restProps() { 38 return get($0); 39 } 40 }); 41 } 42 }; 43 44 if_block(node_1, ($$render) => { 45 if ($$props.icon) $$render(consequent); 46 }); 47 } 48 49 var node_2 = sibling(node_1, 2); 50 51 { 52 var consequent_1 = ($$anchor) => { 53 var fragment_2 = comment(); 54 var node_3 = first_child(fragment_2); 55 56 snippet(node_3, () => $$props.children); 57 append($$anchor, fragment_2); 58 }; 59 60 if_block(node_2, ($$render) => { 61 if ($$props.children) $$render(consequent_1); 62 }); 63 } 64 65 reset(a); 66 67 template_effect( 68 ($0) => { 69 set_attribute(a, 'href', $$props.link); 70 set_attribute(a, 'target', $$props.link_target); 71 set_attribute(a, 'rel', $$props.link_target === "_blank" ? "noopener noreferrer" : undefined); 72 set_attribute(a, 'aria-disabled', $$props.disabled); 73 74 classes = set_class(a, 1, `${$$props.size ?? ''} ${$$props.variant ?? ''} ${$0 ?? ''}`, 'svelte-xzq5jh', classes, { 75 hidden: $$props.visible === false || $$props.visible === "hidden", 76 disabled: $$props.disabled 77 }); 78 79 set_attribute(a, 'id', $$props.elem_id); 80 81 styles = set_style(a, '', styles, { 82 'flex-grow': $$props.scale, 83 'pointer-events': $$props.disabled ? "none" : null, 84 width: $$props.scale === 0 ? "fit-content" : null, 85 'min-width': typeof $$props.min_width === "number" ? `calc(min(${$$props.min_width}px, 100%))` : null 86 }); 87 }, 88 [() => elem_classes().join(' ')] 89 ); 90 91 append($$anchor, a); 92 }; 93 94 var alternate = ($$anchor) => { 95 var button = root_4(); 96 97 button.__click = function (...$$args) { 98 onclick()?.apply(this, $$args); 99 }; 100 101 let classes_1; 102 let styles_1; 103 var node_4 = child(button); 104 105 { 106 var consequent_3 = ($$anchor) => { 107 { 108 let $0 = user_derived(() => ({ alt: `${$$props.value} icon` })); 109 let $1 = user_derived(() => [`button-icon ${$$props.value ? "right-padded" : ""}`]); 110 111 Image($$anchor, { 112 get restProps() { 113 return get($0); 114 }, 115 116 get class_names() { 117 return get($1); 118 }, 119 120 get src() { 121 return $$props.icon.url; 122 } 123 }); 124 } 125 }; 126 127 if_block(node_4, ($$render) => { 128 if ($$props.icon) $$render(consequent_3); 129 }); 130 } 131 132 var node_5 = sibling(node_4, 2); 133 134 { 135 var consequent_4 = ($$anchor) => { 136 var fragment_4 = comment(); 137 var node_6 = first_child(fragment_4); 138 139 snippet(node_6, () => $$props.children); 140 append($$anchor, fragment_4); 141 }; 142 143 if_block(node_5, ($$render) => { 144 if ($$props.children) $$render(consequent_4); 145 }); 146 } 147 148 reset(button); 149 150 template_effect( 151 ($0) => { 152 classes_1 = set_class(button, 1, `${$$props.size ?? ''} ${$$props.variant ?? ''} ${$0 ?? ''}`, 'svelte-xzq5jh', classes_1, { 153 hidden: $$props.visible === false || $$props.visible === "hidden" 154 }); 155 156 set_attribute(button, 'id', $$props.elem_id); 157 button.disabled = $$props.disabled; 158 159 styles_1 = set_style(button, '', styles_1, { 160 'flex-grow': $$props.scale, 161 width: $$props.scale === 0 ? "fit-content" : null, 162 'min-width': typeof $$props.min_width === "number" ? `calc(min(${$$props.min_width}px, 100%))` : null 163 }); 164 }, 165 [() => elem_classes().join(' ')] 166 ); 167 168 append($$anchor, button); 169 }; 170 171 if_block(node, ($$render) => { 172 if ($$props.link && $$props.link.length > 0) $$render(consequent_2); else $$render(alternate, false); 173 }); 174 } 175 176 append($$anchor, fragment); 177 pop(); 178} 179 180delegate(['click']); 181 182export { Button as B }; 183//# sourceMappingURL=Button-CH2w4_A4.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.