import{__exports as e}from"../../../../_virtual/wrapWord.mjs";import{__require as r}from"../../../slice-ansi/index.mjs";import{__require as t}from"../../../strip-ansi/index.mjs";var i;function n(){if(i)return e;i=1;var n=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.wrapWord=void 0;const s=n(r()),o=n(t());return e.wrapWord=(e,r)=>{const t=[];let i=0;return((e,r)=>{let t=(0,o.default)(e);const i=[],n=new RegExp("(^.{1,"+String(Math.max(r,1))+"}(\\s+|$))|(^.{1,"+String(Math.max(r-1,1))+"}(\\\\|/|_|\\.|,|;|-))");do{let e;const s=n.exec(t);if(s){e=s[0],t=t.slice(e.length);const r=e.trim().length,n=e.length-r;i.push([r,n])}else e=t.slice(0,r),t=t.slice(r),i.push([e.length,0])}while(t.length);return i})(e,r).forEach(([r,n])=>{t.push((0,s.default)(e,i,i+r)),i+=r+n}),t},e}export{n as __require};