const o=`(function(){"use strict";function f(t,n){let e=0,i=t.length-1,o=t.length;for(;e<=i;){const r=e+i>>1;t[r]>=n?(o=r,i=r-1):e=r+1}return o}function h(t,n){let e=0,i=t.length;for(;e<i;){const o=e+i>>1;t[o]<=n?e=o+1:i=o}return e}function g(t,n){return t.length===0?-1:n<=t[0]?0:n>=t[t.length-1]?t.length-1:f(t,n)-1}function a(t){const n=t?.intervals;return!Array.isArray(n)||n.length===0?[]:Array.isArray(n[0])?n.map(e=>e[0]):n}function p(t,n,e){if(!Array.isArray(t)||t.length===0)return{lo:0,hi:0,count:0};const i=g(t,n),o=h(t,e)+1,r=Math.max(0,o-i);return{lo:i,hi:o,count:r}}function d(t,n=2e3){if(!Array.isArray(t)||t.length===0)return[];if(!Number.isFinite(n)||n<=0)return[];if(t.length<=n)return t;const e=Math.ceil(t.length/n),i=[];for(let o=0;o<t.length;o+=e)i.push(t[o]);return i}function y(t,n,e,i=2e3){const{lo:o,hi:r,count:u}=p(t,n,e);if(u===0)return{visibleIntervals:[],lo:0,hi:0,count:0};const c=t.slice(o,r);return{visibleIntervals:d(c,i),lo:o,hi:r,count:u}}let s=null;function A(t){s=a(t)}function v(t,n,e=2e3){return!s||s.length===0?{visibleIntervals:[],lo:0,hi:0,count:0}:y(s,t,n,e)}const l=typeof self<"u"?self:globalThis;l.onmessage=async t=>{const{type:n,id:e,data:i}=t.data;if(n==="config"&&(A(i),l.postMessage({type:"config",id:e,data:null})),n==="intervals"){const{start:o,end:r,maxIntervals:u}=i,c=v(o,r,u);l.postMessage({type:"intervals",id:e,data:c})}}})();
`,r=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",o],{type:"text/javascript;charset=utf-8"});function i(n){let t;try{if(t=r&&(self.URL||self.webkitURL).createObjectURL(r),!t)throw"";const e=new Worker(t,{name:n?.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),e}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(o),{name:n?.name})}}export{i as default};
