import{s as j,e as b,f as z,t as E,c as w,h as g,j as I,m as k,d as _,g as A,a as v,b as i,i as S,k as h,q as T,n as L,l as B,E as D,S as H,C as N}from"./scheduler.bDsl0G2p.js";import{S as V,i as R}from"./index.DtyFm6kT.js";import"./0.D1YHP6Ug.js";function U(l,e){if(!window.isSecureContext)return console.error("Clipboard action failed: app not running in secure context, see: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard"),{};const n=()=>{l.dispatchEvent(new CustomEvent("copyComplete"))},o=()=>{if(typeof e=="object"){if("element"in e){const t=document.querySelector(`[data-clipboard="${e.element}"]`);if(!t)throw new Error(`Missing HTMLElement with an attribute of [data-clipboard="${e.element}"]`);C(t.innerHTML,"text/html").then(n);return}if("input"in e){const t=document.querySelector(`[data-clipboard="${e.input}"]`);if(!t)throw new Error(`Missing HTMLInputElement with an attribute of [data-clipboard="${e.input}"]`);C(t.value).then(n);return}}C(e).then(n)};return l.addEventListener("click",o),{update(t){e=t},destroy(){l.removeEventListener("click",o)}}}async function C(l,e="text/plain"){navigator.clipboard.write?await navigator.clipboard.write([new ClipboardItem({[e]:new Blob([l],{type:e}),"text/plain":new Blob([l],{type:"text/plain"})})]):await new Promise(n=>{n(navigator.clipboard.writeText(String(l)))})}function M(l){let e,n;return{c(){e=b("pre"),n=E(l[1]),this.h()},l(o){e=w(o,"PRE",{code_wall_context:!0,class:!0,style:!0});var t=g(e);n=k(t,l[1]),t.forEach(_),this.h()},h(){v(e,"code_wall_context",""),v(e,"class","card"),i(e,"grid-column","1"),i(e,"box-sizing","border-box"),i(e,"height","100%"),i(e,"font-size","1em"),i(e,"text-align","left"),i(e,"white-space","break-spaces"),i(e,"word-wrap","break-word"),i(e,"padding","0.5cm"),i(e,"border-radius","4px"),i(e,"color","inherit"),i(e,"display","flex"),i(e,"align-items","center"),i(e,"justify-content","center"),i(e,"text-align","center")},m(o,t){S(o,e,t),h(e,n)},p(o,t){t&2&&T(n,o[1])},d(o){o&&_(e)}}}function q(l){let e,n,o,t,d,p,s;return{c(){e=b("div"),n=b("button"),o=E(l[3]),this.h()},l(u){e=w(u,"DIV",{style:!0});var a=g(e);n=w(a,"BUTTON",{class:!0,type:!0});var r=g(n);o=k(r,l[3]),r.forEach(_),a.forEach(_),this.h()},h(){n.disabled=t=l[3]==="Cloned",v(n,"class","btn variant-filled"),v(n,"type","button"),i(e,"text-align","right"),i(e,"padding","0.25cm")},m(u,a){S(u,e,a),h(e,n),h(n,o),p||(s=[B(n,"click",l[4]),D(d=U.call(null,n,l[0]))],p=!0)},p(u,a){a&8&&T(o,u[3]),a&8&&t!==(t=u[3]==="Cloned")&&(n.disabled=t),d&&H(d.update)&&a&1&&d.update.call(null,u[0])},d(u){u&&_(e),p=!1,N(s)}}}function O(l){let e,n,o,t,d,p,s,u="@",a,r=l[1].length>=1&&M(l),c=l[2]==="yes"&&q(l);return{c(){e=b("div"),n=b("div"),r&&r.c(),o=z(),t=b("pre"),d=b("span"),p=E(l[0]),s=b("span"),s.textContent=u,a=z(),c&&c.c(),this.h()},l(f){e=w(f,"DIV",{class:!0});var m=g(e);n=w(m,"DIV",{style:!0});var x=g(n);r&&r.l(x),o=I(x),t=w(x,"PRE",{code_wall:!0,style:!0});var y=g(t);d=w(y,"SPAN",{code_wall_text:!0});var P=g(d);p=k(P,l[0]),P.forEach(_),s=w(y,"SPAN",{style:!0,"data-svelte-h":!0}),A(s)!=="svelte-1ftf7l6"&&(s.textContent=u),y.forEach(_),x.forEach(_),a=I(m),c&&c.l(m),m.forEach(_),this.h()},h(){v(d,"code_wall_text",""),i(s,"opacity","0"),i(s,"user-select","none"),i(s,"-webkit-user-select","none"),i(s,"-moz-user-select","none"),i(s,"-ms-user-select","none"),v(t,"code_wall",""),i(t,"grid-column","2"),i(t,"box-sizing","border-box"),i(t,"height","100%"),i(t,"font-size","1em"),i(t,"text-align","left"),i(t,"white-space","break-spaces"),i(t,"word-wrap","break-word"),i(t,"width","100%"),i(t,"padding","0.5cm"),i(t,"border-radius","4px"),i(t,"color","inherit"),i(t,"background","inherit"),v(n,"style","display: grid; // grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); // grid-template-columns: min-content auto; grid-template-columns: min-content repeat(auto-fill, minmax(200px, 1fr)); gap: 5px; "),v(e,"class","card")},m(f,m){S(f,e,m),h(e,n),r&&r.m(n,null),h(n,o),h(n,t),h(t,d),h(d,p),h(t,s),h(e,a),c&&c.m(e,null)},p(f,[m]){f[1].length>=1?r?r.p(f,m):(r=M(f),r.c(),r.m(n,o)):r&&(r.d(1),r=null),m&1&&T(p,f[0]),f[2]==="yes"?c?c.p(f,m):(c=q(f),c.c(),c.m(e,null)):c&&(c.d(1),c=null)},i:L,o:L,d(f){f&&_(e),r&&r.d(),c&&c.d()}}}function W(l,e,n){let{text:o=""}=e,{context:t=""}=e,{can_clone:d="no"}=e,p="Clone",s;const u=async()=>{clearTimeout(s),n(3,p="Cloned"),await new Promise(a=>{s=setTimeout(()=>{a()},1e3)}),n(3,p="Clone")};return l.$$set=a=>{"text"in a&&n(0,o=a.text),"context"in a&&n(1,t=a.context),"can_clone"in a&&n(2,d=a.can_clone)},[o,t,d,p,u]}class K extends V{constructor(e){super(),R(this,e,W,O,j,{text:0,context:1,can_clone:2})}}export{K as T,U as c};
//# sourceMappingURL=Trinket.Dv2Pphu7.js.map
