import{A as j}from"./index.f4d41e67.entry.js";function A(c,h){return h.forEach(function(o){o&&typeof o!="string"&&!Array.isArray(o)&&Object.keys(o).forEach(function(l){if(l!=="default"&&!(l in c)){var u=Object.getOwnPropertyDescriptor(o,l);Object.defineProperty(c,l,u.get?u:{enumerable:!0,get:function(){return o[l]}})}})}),Object.freeze(Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}))}var b={exports:{}};(function(c,h){(function(o){o(j.exports)})(function(o){o.defineOption("styleSelectedText",!1,function(e,t,r){var n=r&&r!=o.Init;t&&!n?(e.state.markedSelection=[],e.state.markedSelectionStyle=typeof t=="string"?t:"CodeMirror-selectedtext",g(e),e.on("cursorActivity",l),e.on("change",u)):!t&&n&&(e.off("cursorActivity",l),e.off("change",u),v(e),e.state.markedSelection=e.state.markedSelectionStyle=null)});function l(e){e.state.markedSelection&&e.operation(function(){O(e)})}function u(e){e.state.markedSelection&&e.state.markedSelection.length&&e.operation(function(){v(e)})}var p=8,y=o.Pos,f=o.cmpPos;function s(e,t,r,n){if(f(t,r)!=0)for(var a=e.state.markedSelection,i=e.state.markedSelectionStyle,S=t.line;;){var P=S==t.line?t:y(S,0),d=S+p,k=d>=r.line,_=k?r:y(d,0),x=e.markText(P,_,{className:i});if(n==null?a.push(x):a.splice(n++,0,x),k)break;S=d}}function v(e){for(var t=e.state.markedSelection,r=0;r<t.length;++r)t[r].clear();t.length=0}function g(e){v(e);for(var t=e.listSelections(),r=0;r<t.length;r++)s(e,t[r].from(),t[r].to())}function O(e){if(!e.somethingSelected())return v(e);if(e.listSelections().length>1)return g(e);var t=e.getCursor("start"),r=e.getCursor("end"),n=e.state.markedSelection;if(!n.length)return s(e,t,r);var a=n[0].find(),i=n[n.length-1].find();if(!a||!i||r.line-t.line<=p||f(t,i.to)>=0||f(r,a.from)<=0)return g(e);for(;f(t,a.from)>0;)n.shift().clear(),a=n[0].find();for(f(t,a.from)<0&&(a.to.line-t.line<p?(n.shift().clear(),s(e,t,a.to,0)):s(e,t,a.from,0));f(r,i.to)<0;)n.pop().clear(),i=n[n.length-1].find();f(r,i.to)>0&&(r.line-i.from.line<p?(n.pop().clear(),s(e,i.from,r)):s(e,i.to,r))}})})();var w=b.exports,E=A({__proto__:null,default:w},[b.exports]);export{E as m};
