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