import{s as mt,e as i,a as u,c,l as f,g as r,p as d,i as l,f as n,H as Y,b as Z,m as tt,n as st}from"./scheduler.DKiYiPX0.js";import{S as gt,i as $t,c as J,a as K,m as N,t as Q,b as V,d as W}from"./index.z4bt_ZBS.js";import{C as X}from"./Code.tlNrnEug.js";function _t(k){let s,p,h='npm i @cartamd/plugin-code';return{c(){s=i("pre"),p=new Y(!1),this.h()},l(a){s=c(a,"PRE",{class:!0});var o=Z(s);p=tt(o,!1),o.forEach(n),this.h()},h(){p.a=null,d(s,"class","language-undefined")},m(a,o){l(a,s,o),p.m(h,s)},p:st,d(a){a&&n(s)}}}function vt(k){let s,p,h=`import '@cartamd/plugin-code/default.css';`;return{c(){s=i("pre"),p=new Y(!1),this.h()},l(a){s=c(a,"PRE",{class:!0});var o=Z(s);p=tt(o,!1),o.forEach(n),this.h()},h(){p.a=null,d(s,"class","language-ts")},m(a,o){l(a,s,o),p.m(h,s)},p:st,d(a){a&&n(s)}}}function wt(k){let s,p,h=`const carta = new Carta({ // ... extensions: [ code({ theme: 'ayu-light' }) ] });`;return{c(){s=i("pre"),p=new Y(!1),this.h()},l(a){s=c(a,"PRE",{class:!0});var o=Z(s);p=tt(o,!1),o.forEach(n),this.h()},h(){p.a=null,d(s,"class","language-ts")},m(a,o){l(a,s,o),p.m(h,s)},p:st,d(a){a&&n(s)}}}function Ht(k){let s,p,h=`<script> import { Carta, MarkdownEditor } from 'carta-md'; import { code } from '@cartamd/plugin-code'; const carta = new Carta({ extensions: [code()] }); </script> <MarkdownEditor {carta} />`;return{c(){s=i("pre"),p=new Y(!1),this.h()},l(a){s=c(a,"PRE",{class:!0});var o=Z(s);p=tt(o,!1),o.forEach(n),this.h()},h(){p.a=null,d(s,"class","language-svelte")},m(a,o){l(a,s,o),p.m(h,s)},p:st,d(a){a&&n(s)}}}function xt(k){let s,p="This plugin adds support for code blocks syntax highlighting. It uses the same highlighter from the core package(Shiki).",h,a,o='Installation',E,m,P,g,et='Setup',S,$,nt='Styles',I,M,at="Import the default styles:",R,_,j,v,lt='Using the default highlighter',q,T,pt="Carta comes with a default highlighter that matches the one used to highlight markdown in the editor and is used by default (Shiki). If you want to use a theme different from the one used to highlight Markdown, you can specify it in the options.",U,w,z,H,ot='Using a custom highlighter',O,L,it='It is no longer possible to specify a custom highlighter in this plugin. However, there are many different Remark plugins that provide syntax highlighting.',A,x,ct='Extension',B,C,D,y,ut='Options',F,b,rt='The options you can pass to code() extend the ones provided by Shiki.',G;return m=new X({props:{$$slots:{default:[_t]},$$scope:{ctx:k}}}),_=new X({props:{$$slots:{default:[vt]},$$scope:{ctx:k}}}),w=new X({props:{$$slots:{default:[wt]},$$scope:{ctx:k}}}),C=new X({props:{$$slots:{default:[Ht]},$$scope:{ctx:k}}}),{c(){s=i("p"),s.innerHTML=p,h=u(),a=i("h2"),a.innerHTML=o,E=u(),J(m.$$.fragment),P=u(),g=i("h2"),g.innerHTML=et,S=u(),$=i("h3"),$.innerHTML=nt,I=u(),M=i("p"),M.textContent=at,R=u(),J(_.$$.fragment),j=u(),v=i("h3"),v.innerHTML=lt,q=u(),T=i("p"),T.textContent=pt,U=u(),J(w.$$.fragment),z=u(),H=i("h3"),H.innerHTML=ot,O=u(),L=i("p"),L.innerHTML=it,A=u(),x=i("h3"),x.innerHTML=ct,B=u(),J(C.$$.fragment),D=u(),y=i("h2"),y.innerHTML=ut,F=u(),b=i("p"),b.innerHTML=rt,this.h()},l(t){s=c(t,"P",{"data-svelte-h":!0}),f(s)!=="svelte-ywab58"&&(s.innerHTML=p),h=r(t),a=c(t,"H2",{id:!0,"data-svelte-h":!0}),f(a)!=="svelte-18vig38"&&(a.innerHTML=o),E=r(t),K(m.$$.fragment,t),P=r(t),g=c(t,"H2",{id:!0,"data-svelte-h":!0}),f(g)!=="svelte-1uj9ei1"&&(g.innerHTML=et),S=r(t),$=c(t,"H3",{id:!0,"data-svelte-h":!0}),f($)!=="svelte-1obsuhg"&&($.innerHTML=nt),I=r(t),M=c(t,"P",{"data-svelte-h":!0}),f(M)!=="svelte-1pnhsd1"&&(M.textContent=at),R=r(t),K(_.$$.fragment,t),j=r(t),v=c(t,"H3",{id:!0,"data-svelte-h":!0}),f(v)!=="svelte-1vws7dn"&&(v.innerHTML=lt),q=r(t),T=c(t,"P",{"data-svelte-h":!0}),f(T)!=="svelte-g4q49f"&&(T.textContent=pt),U=r(t),K(w.$$.fragment,t),z=r(t),H=c(t,"H3",{id:!0,"data-svelte-h":!0}),f(H)!=="svelte-ybuzo7"&&(H.innerHTML=ot),O=r(t),L=c(t,"P",{"data-svelte-h":!0}),f(L)!=="svelte-1b5n00u"&&(L.innerHTML=it),A=r(t),x=c(t,"H3",{id:!0,"data-svelte-h":!0}),f(x)!=="svelte-1h1d05d"&&(x.innerHTML=ct),B=r(t),K(C.$$.fragment,t),D=r(t),y=c(t,"H2",{id:!0,"data-svelte-h":!0}),f(y)!=="svelte-qvxcr2"&&(y.innerHTML=ut),F=r(t),b=c(t,"P",{"data-svelte-h":!0}),f(b)!=="svelte-ix7929"&&(b.innerHTML=rt),this.h()},h(){d(a,"id","installation"),d(g,"id","setup"),d($,"id","styles"),d(v,"id","using-the-default-highlighter"),d(H,"id","using-a-custom-highlighter"),d(x,"id","extension"),d(y,"id","options")},m(t,e){l(t,s,e),l(t,h,e),l(t,a,e),l(t,E,e),N(m,t,e),l(t,P,e),l(t,g,e),l(t,S,e),l(t,$,e),l(t,I,e),l(t,M,e),l(t,R,e),N(_,t,e),l(t,j,e),l(t,v,e),l(t,q,e),l(t,T,e),l(t,U,e),N(w,t,e),l(t,z,e),l(t,H,e),l(t,O,e),l(t,L,e),l(t,A,e),l(t,x,e),l(t,B,e),N(C,t,e),l(t,D,e),l(t,y,e),l(t,F,e),l(t,b,e),G=!0},p(t,[e]){const ht={};e&1&&(ht.$$scope={dirty:e,ctx:t}),m.$set(ht);const ft={};e&1&&(ft.$$scope={dirty:e,ctx:t}),_.$set(ft);const dt={};e&1&&(dt.$$scope={dirty:e,ctx:t}),w.$set(dt);const kt={};e&1&&(kt.$$scope={dirty:e,ctx:t}),C.$set(kt)},i(t){G||(Q(m.$$.fragment,t),Q(_.$$.fragment,t),Q(w.$$.fragment,t),Q(C.$$.fragment,t),G=!0)},o(t){V(m.$$.fragment,t),V(_.$$.fragment,t),V(w.$$.fragment,t),V(C.$$.fragment,t),G=!1},d(t){t&&(n(s),n(h),n(a),n(E),n(P),n(g),n(S),n($),n(I),n(M),n(R),n(j),n(v),n(q),n(T),n(U),n(z),n(H),n(O),n(L),n(A),n(x),n(B),n(D),n(y),n(F),n(b)),W(m,t),W(_,t),W(w,t),W(C,t)}}}const Tt={section:"Plugins",title:"Code"};class Lt extends gt{constructor(s){super(),$t(this,s,null,xt,mt,{})}}export{Lt as default,Tt as metadata};