import{j as i,R as d}from"./vendor-ClLR6ncd.js";import{n as x}from"./index-OtVJl4GC.js";import{k as v,C as u,S as b,l as m}from"./ui-BOPU8Yl4.js";var y=/^(block|let*|return-from|catch|load-time-value|setq|eval-when|locally|symbol-macrolet|flet|macrolet|tagbody|function|multiple-value-call|the|go|multiple-value-prog1|throw|if|progn|unwind-protect|labels|progv|let|quote)$/,a=/^with|^def|^do|^prog|case$|^cond$|bind$|when$|unless$/,k=/^(?:[+\-]?(?:\d+|\d*\.\d+)(?:[efd][+\-]?\d+)?|[+\-]?\d+(?:\/[+\-]?\d+)?|#b[+\-]?[01]+|#o[+\-]?[0-7]+|#x[+\-]?[\da-f]+)/,h=/[^\s'`,@()\[\]";]/,o;function l(e){for(var n;n=e.next();)if(n=="\\")e.next();else if(!h.test(n)){e.backUp(1);break}return e.current()}function c(e,n){if(e.eatSpace())return o="ws",null;if(e.match(k))return"number";var r=e.next();if(r=="\\"&&(r=e.next()),r=='"')return(n.tokenize=T)(e,n);if(r=="(")return o="open","bracket";if(r==")"||r=="]")return o="close","bracket";if(r==";")return e.skipToEnd(),o="ws","comment";if(/['`,@]/.test(r))return null;if(r=="|")return e.skipTo("|")?(e.next(),"variableName"):(e.skipToEnd(),"error");if(r=="#"){var r=e.next();return r=="("?(o="open","bracket"):/[+\-=\.']/.test(r)||/\d/.test(r)&&e.match(/^\d*#/)?null:r=="|"?(n.tokenize=w)(e,n):r==":"?(l(e),"meta"):r=="\\"?(e.next(),l(e),"string.special"):"error"}else{var t=l(e);return t=="."?null:(o="symbol",t=="nil"||t=="t"||t.charAt(0)==":"?"atom":n.lastType=="open"&&(y.test(t)||a.test(t))?"keyword":t.charAt(0)=="&"?"variableName.special":"variableName")}}function T(e,n){for(var r=!1,t;t=e.next();){if(t=='"'&&!r){n.tokenize=c;break}r=!r&&t=="\\"}return"string"}function w(e,n){for(var r,t;r=e.next();){if(r=="#"&&t=="|"){n.tokenize=c;break}t=r}return o="ws","comment"}const C={startState:function(){return{ctx:{prev:null,start:0,indentTo:0},lastType:null,tokenize:c}},token:function(e,n){e.sol()&&typeof n.ctx.indentTo!="number"&&(n.ctx.indentTo=n.ctx.start+1),o=null;var r=n.tokenize(e,n);return o!="ws"&&(n.ctx.indentTo==null?o=="symbol"&&a.test(e.current())?n.ctx.indentTo=n.ctx.start+e.indentUnit:n.ctx.indentTo="next":n.ctx.indentTo=="next"&&(n.ctx.indentTo=e.column()),n.lastType=o),o=="open"?n.ctx={prev:n.ctx,start:e.column(),indentTo:null}:o=="close"&&(n.ctx=n.ctx.prev||n.ctx),r},indent:function(e){var n=e.ctx.indentTo;return typeof n=="number"?n:e.ctx.start+1},languageData:{commentTokens:{line:";;",block:{open:"#|",close:"|#"}},closeBrackets:{brackets:["(","[","{",'"']}}},g=[b.define(C)];function M(e){return i.jsx("div",{style:v,children:i.jsx(u,{extensions:g,...e})})}const s=[m["compact-codemirror"]];function f(e){const{value:n}=x();return n?Array.isArray(e)?e.concat(s):s:e}function z({classNames:e,...n}){const r=f(e);return i.jsx(M,{classNames:r,...n})}const O=d.forwardRef(function({classNames:n,...r},t){const p=f(n);return i.jsx(u,{ref:t,classNames:p,...r})});export{O,z as a,C as c,g as l};
