PageSourceSearch

https://app.adslide.io/static/js/6557-legacy.1582144b.js

js adslide.io collected 2026-10-09 03:12:59 UTC 20,545 bytes, 1 lines download raw bytes

1"use strict";(self["webpackChunkadslide"]=self["webpackChunkadslide"]||[]).push([[6557],{70511:function(t,e,n){var r=n(19167),o=n(39297),i=n(1951),a=n(24913).f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});o(e,t)||a(e,t,{value:i.f(t)})}},1951:function(t,e,n){var r=n(78227);e.f=r},89463:function(t,e,n){var r=n(46518),o=n(43724),i=n(22195),a=n(69565),s=n(79504),h=n(39297),c=n(94901),u=n(1625),l=n(655),f=n(62106),d=n(77740),g=i.Symbol,p=g&&g.prototype;if(o&&c(g)&&(!("description"in p)||void 0!==g().description)){var m={},v=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),e=u(p,this)?new g(t):void 0===t?g():g(t);return""===t&&(m[e]=!0),e};d(v,g);var b=v["for"];v["for"]={for:function(t){var e=l(t),n=a(b,this,e);return""===e&&(m[n]=!0),n}}["for"],v.prototype=p,p.constructor=v;var w="Symbol(description detection)"===String(g("description detection")),y=s(p.valueOf),M=s(p.toString),_=/^Symbol\((.*)\)[^)]+$/,x=s("".replace),I=s("".slice);f(p,"description",{configurable:!0,get:function(){var t=y(this);if(h(m,t))return"";var e=M(t),n=w?I(e,7,-1):x(e,_,"$1");return""===n?void 0:n}}),r({global:!0,constructor:!0,forced:!0},{Symbol:v})}},66557:function(t,e,n){n.d(e,{bL:function(){return xt}});var r=function(){return n(70511)},o=n.cw(function(t,e){var n=r();n("asyncIterator")});n(89463),n(62953);o();n(16280);function i(t,e){this.v=t,this.k=e}function a(t){var e,n;function r(e,n){try{var a=t[e](n),s=a.value,h=s instanceof i;Promise.resolve(h?s.v:s).then(function(n){if(h){var i="return"===e&&s.k?e:"next";if(!s.k||n.done)return r(i,n);n=t[i](n).value}o(!!a.done,n)},function(t){r("throw",t)})}catch(t){o(2,t)}}function o(t,o){2===t?e.reject(o):e.resolve({value:o,done:t}),(e=e.next)?r(e.key,e.arg):n=null}this._invoke=function(t,o){return new Promise(function(i,a){var s={key:t,arg:o,resolve:i,reject:a,next:null};n?n=n.next=s:(e=n=s,r(t,o))})},"function"!=typeof t["return"]&&(this["return"]=void 0)}a.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},a.prototype.next=function(t){return this._invoke("next",t)},a.prototype["throw"]=function(t){return this._invoke("throw",t)},a.prototype["return"]=function(t){return this._invoke("return",t)};n(44114),n(72712),n(26910),n(16573),n(78100),n(77936),n(18111),n(61701),n(18237),n(13579),n(45367),n(92731),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(48140),n(21903),n(91134),n(28845),n(22754),n(37467),n(44732),n(79577),n(16632),n(34226),n(9486),n(20456),n(64979);var s,h=Object.defineProperty,c=Object.getOwnPropertyNames,u=(t,e)=>function(){return t&&(e=(0,t[c(t)[0]])(t=0)),e},l=(t,e)=>{for(var n in e)h(t,n,{get:e[n],enumerable:!0})};function f(){if(void 0!==s)return s;try{var t;const e=document.createElement("canvas"),n=e.getContext("2d",{colorSpace:"display-p3"});s=!!n&&"display-p3"===(null===(t=n.getContextAttributes)||void 0===t?void 0:t.call(n).colorSpace)}catch(e){s=!1}return s}function d(t){return"display-p3"===t||"auto"===t}function g(t){return d(t)&&f()?"display-p3":"srgb"}function p(t,e,n,r){try{return"display-p3"===r?t.getImageData(0,0,e,n,{colorSpace:"display-p3"}):t.getImageData(0,0,e,n)}catch(o){if(o instanceof DOMException&&"SecurityError"===o.name){const t=new Error('Image is tainted by cross-origin data. Add crossorigin="anonymous" to the <img> tag and ensure the server sends appropriate CORS headers.');throw t.cause=o,t}throw o}}function m(t,e,n,r){const o=g(n),i=document.createElement("canvas");i.width=t,i.height=e;const a="display-p3"===o?i.getContext("2d",{colorSpace:"display-p3"}):i.getContext("2d");r(a);const s=p(a,t,e,o);return{data:s.data,width:t,height:e,colorSpace:o}}function v(t,e,n,r){const o=g(r),i=p(t,e,n,o);return{data:i.data,width:e,height:n,colorSpace:o}}var b,w=u({"src/loaders/canvas-utils.ts"(){}}),y={};l(y,{BrowserPixelLoader:()=>b});u({"src/loaders/browser.ts"(){w(),b=class{async load(t,e,n="srgb"){if("undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement)return this.loadFromImage(t,n);if("undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)return this.loadFromCanvas(t,n);var r;if("undefined"!==typeof ImageData&&t instanceof ImageData)return{data:t.data,width:t.width,height:t.height,colorSpace:null!==(r=t.colorSpace)&&void 0!==r?r:"srgb"};if("undefined"!==typeof HTMLVideoElement&&t instanceof HTMLVideoElement)return this.loadFromVideo(t,n);if("undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap)return this.loadFromImageBitmap(t,n);if("undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas)return this.loadFromOffscreenCanvas(t,n);throw new Error("Unsupported source type. Expected HTMLImageElement, HTMLCanvasElement, HTMLVideoElement, ImageData, ImageBitmap, or OffscreenCanvas.")}loadFromImage(t,e){if(!t.complete)throw new Error('Image has not finished loading. Wait for the "load" event before calling getColor/getPalette.');
1if(!t.naturalWidth)throw new Error("Image has no dimensions. It may not have loaded successfully.");return m(t.naturalWidth,t.naturalHeight,e,e=>e.drawImage(t,0,0,t.naturalWidth,t.naturalHeight))}loadFromCanvas(t,e){const n=t.getContext("2d");return v(n,t.width,t.height,e)}loadFromVideo(t,e){if(t.readyState<2)throw new Error('Video is not ready. Wait for the "loadeddata" or "canplay" event before calling getColor/getPalette.');const n=t.videoWidth,r=t.videoHeight;if(!n||!r)throw new Error("Video has no dimensions. It may not have loaded successfully.");return m(n,r,e,e=>e.drawImage(t,0,0,n,r))}loadFromOffscreenCanvas(t,e){const n=t.getContext("2d");if(!n)throw new Error("Could not get 2D context from OffscreenCanvas.");return v(n,t.width,t.height,e)}loadFromImageBitmap(t,e){return m(t.width,t.height,e,e=>e.drawImage(t,0,0))}}}});function M(t){const e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function _(t){const e=t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055;return Math.round(Math.max(0,Math.min(255,255*e)))}function x(t,e){const n=[[0,0,0],[0,0,0],[0,0,0]];for(let r=0;r<3;r++)for(let o=0;o<3;o++)n[r][o]=t[r][0]*e[0][o]+t[r][1]*e[1][o]+t[r][2]*e[2][o];return n}function I(t){const[e,n,r]=t[0],[o,i,a]=t[1],[s,h,c]=t[2],u=i*c-a*h,l=-(o*c-a*s),f=o*h-i*s,d=e*u+n*l+r*f,g=1/d;return[[u*g,(r*h-n*c)*g,(n*a-r*i)*g],[l*g,(e*c-r*s)*g,(r*o-e*a)*g],[f*g,(n*s-e*h)*g,(e*i-n*o)*g]]}function C(t,e,n,r){return[t[0][0]*e+t[0][1]*n+t[0][2]*r,t[1][0]*e+t[1][1]*n+t[1][2]*r,t[2][0]*e+t[2][1]*n+t[2][2]*r]}var S=[[.8189330101,.3618667424,-.1288597137],[.0329845436,.9293118715,.0361456387],[.0482003018,.2643662691,.633851707]],E=[[.4865709486,.2656676932,.1982172852],[.2289745641,.6917385218,.0792869141],[0,.0451133819,1.0439443689]],T=[[.4123907993,.3575843394,.1804807884],[.2126390059,.7151686788,.0721923154],[.0193308187,.1191947798,.9505321522]],k=x(S,E),$=I(k),H=I(T),L=x(H,E),W=I(L),O=[.2126,.7152,.0722];function D(t,e,n){const r=.2104542553*t+.793617785*e-.0040720468*n,o=1.9779984951*t-2.428592205*e+.4505937099*n,i=.0259040371*t+.7827717662*e-.808675766*n,a=Math.sqrt(o*o+i*i);let s=Math.atan2(i,o)*(180/Math.PI);return s<0&&(s+=360),{l:r,c:a,h:s}}function F(t,e,n){const[r,o,i]=C(k,M(t),M(e),M(n));return D(Math.cbrt(r),Math.cbrt(o),Math.cbrt(i))}function P(t,e,n,r="srgb"){if("display-p3"===r)return F(t,e,n);const o=M(t),i=M(e),a=M(n),s=.4122214708*o+.5363325363*i+.0514459929*a,h=.2119034982*o+.6806995451*i+.1073969566*a,c=.0883024619*o+.2817188376*i+.6299787005*a,u=Math.cbrt(s),l=Math.cbrt(h),f=Math.cbrt(c),d=.2104542553*u+.793617785*l-.0040720468*f,g=1.9779984951*u-2.428592205*l+.4505937099*f,p=.0259040371*u+.7827717662*l-.808675766*f,m=Math.sqrt(g*g+p*p);let v=Math.atan2(p,g)*(180/Math.PI);return v<0&&(v+=360),{l:d,c:m,h:v}}function q(t,e,n){const r=n*(Math.PI/180),o=e*Math.cos(r),i=e*Math.sin(r),a=t+.3963377774*o+.2158037573*i,s=t-.1055613458*o-.0638541728*i,h=t-.0894841775*o-1.291485548*i;return[a*a*a,s*s*s,h*h*h]}function V(t,e,n){const[r,o,i]=q(t,e,n),[a,s,h]=C($,r,o,i);return[_(a),_(s),_(h)]}function j(t,e,n,r="srgb"){if("display-p3"===r)return V(t,e,n);const o=n*(Math.PI/180),i=e*Math.cos(o),a=e*Math.sin(o),s=t+.3963377774*i+.2158037573*a,h=t-.1055613458*i-.0638541728*a,c=t-.0894841775*i-1.291485548*a,u=s*s*s,l=h*h*h,f=c*c*c,d=4.0767416621*u-3.3077115913*l+.2309699292*f,g=-1.2684380046*u+2.6097574011*l-.3413193965*f,p=-.0041960863*u-.7034186147*l+1.707614701*f;return[_(d),_(g),_(p)]}function z(t,e="srgb"){const n=new Array(t.length);for(let r=0;r<t.length;r++){const[o,i,a]=t[r],{l:s,c:h,h:c}=P(o,i,a,e);n[r]=[Math.round(255*s),Math.round(h/.4*255),Math.round(c/360*255)]}return n}function B(t,e="srgb"){return t.map(({color:[t,n,r],population:o})=>{const i=t/255,a=n/255*.4,s=r/255*360;return{color:j(i,a,s,e),population:o}})}function A(t,e,n){const[r,o,i]=C(L,M(t),M(e),M(n));return[_(r),_(o),_(i)]}function U(t,e,n){const[r,o,i]=C(W,M(t),M(e),M(n));return[_(r),_(o),_(i)]}var N=.001;function R(t,e,n){const[r,o,i]=C(L,M(t),M(e),M(n));return r<-N||r>1+N||o<-N||o>1+N||i<-N||i>1+N}function G(t,e,n,r="srgb"){const o=M(t),i=M(e),a=M(n),[s,h,c]="display-p3"===r?E[1]:O;return s*o+h*i+c*a}function J(t,e,n){const r=t/255,o=e/255,i=n/255,a=Math.max(r,o,i),s=Math.min(r,o,i),h=(a+s)/2;let c=0,u=0;if(a!==s){const t=a-s;u=h>.5?t/(2-a-s):t/(a+s),c=a===r?((o-i)/t+(o<i?6:0))/6:a===o?((i-r)/t+2)/6:((r-o)/t+4)/6}
1return{h:Math.round(360*c),s:Math.round(100*u),l:Math.round(100*h)}}function K(t,e){const n=Math.max(t,e),r=Math.min(t,e);return(n+.05)/(r+.05)}var Q=class{constructor(t,e,n,r,o,i="srgb"){this._r=t,this._g=e,this._b=n,this.gamut=i,this.population=r,this.proportion=o}get srgb(){return this._srgb||(this._srgb="display-p3"===this.gamut?A(this._r,this._g,this._b):[this._r,this._g,this._b]),this._srgb}rgb(t="srgb"){if(t===this.gamut)return{r:this._r,g:this._g,b:this._b};const[e,n,r]="display-p3"===t?U(this._r,this._g,this._b):this.srgb;return{r:e,g:n,b:r}}hex(){const[t,e,n]=this.srgb,r=t=>t.toString(16).padStart(2,"0");return`#${r(t)}${r(e)}${r(n)}`}hsl(){if(!this._hsl){const[t,e,n]=this.srgb;this._hsl=J(t,e,n)}return this._hsl}oklch(){return this._oklch||(this._oklch=P(this._r,this._g,this._b,this.gamut)),this._oklch}css(t){if(void 0===t){if("display-p3"===this.gamut){const t=t=>+(t/255).toFixed(4);return`color(display-p3 ${t(this._r)} ${t(this._g)} ${t(this._b)})`}t="rgb"}switch(t){case"hsl":{const{h:t,s:e,l:n}=this.hsl();return`hsl(${t}, ${e}%, ${n}%)`}case"oklch":{const{l:t,c:e,h:n}=this.oklch();return`oklch(${t.toFixed(3)} ${e.toFixed(3)} ${n.toFixed(1)})`}case"rgb":default:{const[t,e,n]=this.srgb;return`rgb(${t}, ${e}, ${n})`}}}array(){return[...this.srgb]}toString(){return this.hex()}get textColor(){return this.isDark?"#ffffff":"#000000"}get luminance(){return void 0===this._luminance&&(this._luminance=G(this._r,this._g,this._b,this.gamut)),this._luminance}get isDark(){return this.luminance<=.179}get isLight(){return!this.isDark}get contrast(){if(!this._contrast){const t=this.luminance,e=K(t,1),n=K(t,0),r=this.isDark?X(255,255,255,0,0):X(0,0,0,0,0);this._contrast={white:Math.round(100*e)/100,black:Math.round(100*n)/100,foreground:r}}return this._contrast}};function X(t,e,n,r,o=0,i="srgb"){return new Q(t,e,n,r,o,i)}function Y(t,e){if("number"!==typeof t||!Number.isFinite(t))throw new Error(`region.${e} must be a finite number between 0 and 1 (received ${String(t)})`);if(t<0||t>1)throw new Error(`region.${e} must be between 0 and 1 (received ${t}). Region coordinates are fractions of the image size, not pixels.`);return t}function Z(t){if(null===t||"object"!==typeof t)throw new Error("region must be an object of the form { x, y, width, height } with values between 0 and 1");const e=Y(t.x,"x"),n=Y(t.y,"y"),r=Y(t.width,"width"),o=Y(t.height,"height");if(r<=0||o<=0)throw new Error(`region.width and region.height must be greater than 0 (received ${r} and ${o})`);const i=Math.min(r,1-e),a=Math.min(o,1-n);if(i<=0||a<=0)throw new Error(`region is outside the image: x=${e}, y=${n} leaves no area to sample`);return{x:e,y:n,width:i,height:a}}function tt(t,e,n){const{x:r,y:o,width:i,height:a}=Z(t),s=Math.min(Math.max(Math.round(r*e),0),Math.max(e-1,0)),h=Math.min(Math.max(Math.round(o*n),0),Math.max(n-1,0)),c=Math.min(Math.max(Math.round(i*e),1),e-s),u=Math.min(Math.max(Math.round(a*n),1),n-h);return{left:s,top:h,width:c,height:u}}function et(t,e){return t instanceof Uint8ClampedArray?new Uint8ClampedArray(e):new Uint8Array(e)}function nt(t,e){if(!e)return t;const{width:n,height:r}=t;if(!n||!r)return t;const o=tt(e,n,r);if(0===o.left&&0===o.top&&o.width===n&&o.height===r)return t;const i=4*o.width,a=et(t.data,i*o.height);for(let s=0;s<o.height;s++){const e=4*((o.top+s)*n+o.left);a.set(t.data.subarray(e,e+i),s*i)}return{data:a,width:o.width,height:o.height,colorSpace:t.colorSpace}}function rt(t){var e,n;let{colorCount:r,quality:o}=t;if("undefined"!==typeof r&&Number.isInteger(r)){if(1===r)throw new Error("colorCount should be between 2 and 20. To get one color, call getColor() instead of getPalette()");r=Math.max(r,2),r=Math.min(r,20)}else r=10;("undefined"===typeof o||!Number.isInteger(o)||o<1)&&(o=10);const i=void 0===t.ignoreWhite||!!t.ignoreWhite,a="number"===typeof t.whiteThreshold?t.whiteThreshold:250,s="number"===typeof t.alphaThreshold?t.alphaThreshold:125,h="number"===typeof t.minSaturation?Math.max(0,Math.min(1,t.minSaturation)):0,c=null!==(e=t.colorSpace)&&void 0!==e?e:"oklch",u=null!==(n=t.gamut)&&void 0!==n?n:"srgb",l=void 0!==t.region?Z(t.regi
1on):void 0;return{colorCount:r,quality:o,ignoreWhite:i,whiteThreshold:a,alphaThreshold:s,minSaturation:h,colorSpace:c,gamut:u,region:l}}function ot(t,e,n){return"srgb"===n||"display-p3"!==e?"srgb":"auto"===n?t.some(([t,e,n])=>R(t,e,n))?"display-p3":"srgb":"display-p3"}function it(t,e,n,r){const{ignoreWhite:o=!0,whiteThreshold:i=250,alphaThreshold:a=125,minSaturation:s=0}=r,h=[];for(let c=0;c<e;c+=n){const e=4*c,n=t[e],r=t[e+1],u=t[e+2],l=t[e+3];if(!(void 0!==l&&l<a)&&!(o&&n>i&&r>i&&u>i)){if(s>0){const t=Math.max(n,r,u);if(0===t||(t-Math.min(n,r,u))/t<s)continue}h.push([n,r,u])}}return h}function at(t,e,n){let r=0,o=0,i=0,a=0;for(let s=0;s<e;s+=n){const e=4*s;r+=t[e],o+=t[e+1],i+=t[e+2],a++}return 0===a?null:[Math.round(r/a),Math.round(o/a),Math.round(i/a)]}function st(t,e,n,r,o,i="srgb"){const a=e*n,s={ignoreWhite:r.ignoreWhite,whiteThreshold:r.whiteThreshold,alphaThreshold:r.alphaThreshold,minSaturation:r.minSaturation};let h=it(t,a,r.quality,s);0===h.length&&(h=it(t,a,r.quality,{...s,ignoreWhite:!1})),0===h.length&&(h=it(t,a,r.quality,{...s,ignoreWhite:!1,alphaThreshold:0}));const c=i,u=ot(h,c,r.gamut),l=t=>c===u?t:A(t[0],t[1],t[2]);let f;const d=new Set,g=[];for(const w of h){const t=w.join(",");if(!d.has(t)&&(d.add(t),g.push(w),g.length>r.colorCount))break}if(g.length<=r.colorCount){const t=new Map;for(const e of h){const n=e.join(",");t.set(n,(t.get(n)||0)+1)}f=g.map(e=>({color:e,population:t.get(e.join(","))}))}else if("oklch"===r.colorSpace){const t=z(h,c);f=B(o.quantize(t,r.colorCount),c)}else f=o.quantize(h,r.colorCount);if(f.length>0){const t=f.reduce((t,e)=>t+e.population,0);return f.map(({color:e,population:n})=>{const[r,o,i]=l(e);return X(r,o,i,n,t>0?n/t:0,u)})}const p=at(t,a,r.quality);if(!p)return null;const[m,v,b]=l(p);
1return[X(m,v,b,1,1,u)]}X(255,255,255,0),X(0,0,0,0);var ht=5,ct=8-ht,ut=1e3,lt=.75,ft=1<<3*ht;function dt(t,e,n){return(t<<2*ht)+(e<<ht)+n}var gt=class t{constructor(t,e,n,r,o,i,a){this.r1=t,this.r2=e,this.g1=n,this.g2=r,this.b1=o,this.b2=i,this.histo=a}volume(t=!1){return(void 0===this._volume||t)&&(this._volume=(this.r2-this.r1+1)*(this.g2-this.g1+1)*(this.b2-this.b1+1)),this._volume}count(t=!1){if(void 0===this._count||t){let t=0;for(let e=this.r1;e<=this.r2;e++)for(let n=this.g1;n<=this.g2;n++)for(let r=this.b1;r<=this.b2;r++)t+=this.histo[dt(e,n,r)]||0;this._count=t}return this._count}copy(){return new t(this.r1,this.r2,this.g1,this.g2,this.b1,this.b2,this.histo)}avg(t=!1){if(void 0===this._avg||t){const t=1<<ct;if(this.r1===this.r2&&this.g1===this.g2&&this.b1===this.b2)this._avg=[this.r1<<ct,this.g1<<ct,this.b1<<ct];else{let e=0,n=0,r=0,o=0;for(let i=this.r1;i<=this.r2;i++)for(let a=this.g1;a<=this.g2;a++)for(let s=this.b1;s<=this.b2;s++){const h=this.histo[dt(i,a,s)]||0;e+=h,n+=h*(i+.5)*t,r+=h*(a+.5)*t,o+=h*(s+.5)*t}this._avg=e?[~~(n/e),~~(r/e),~~(o/e)]:[~~(t*(this.r1+this.r2+1)/2),~~(t*(this.g1+this.g2+1)/2),~~(t*(this.b1+this.b2+1)/2)]}}return this._avg}},pt=class{constructor(t){this.comparator=t,this.contents=[],this.sorted=!1}sort(){this.contents.sort(this.comparator),this.sorted=!0}push(t){this.contents.push(t),this.sorted=!1}peek(t){return this.sorted||this.sort(),this.contents[null!==t&&void 0!==t?t:this.contents.length-1]}pop(){return this.sorted||this.sort(),this.contents.pop()}size(){return this.contents.length}map(t){return this.contents.map(t)}};function mt(t){const e=new Uint32Array(ft);for(const n of t){const t=n[0]>>ct,r=n[1]>>ct,o=n[2]>>ct;e[dt(t,r,o)]++}return e}function vt(t,e){let n=1e6,r=0,o=1e6,i=0,a=1e6,s=0;for(const h of t){const t=h[0]>>ct,e=h[1]>>ct,c=h[2]>>ct;t<n?n=t:t>r&&(r=t),e<o?o=e:e>i&&(i=e),c<a?a=c:c>s&&(s=c)}return new gt(n,r,o,i,a,s,e)}function bt(t,e){if(!e.count())return;if(1===e.count())return[e.copy(),null];const n=e.r2-e.r1+1,r=e.g2-e.g1+1,o=e.b2-e.b1+1,i=Math.max(n,r,o);let a=0;const s=[],h=[];if(i===n)for(let u=e.r1;u<=e.r2;u++){let n=0;for(let r=e.g1;r<=e.g2;r++)for(let o=e.b1;o<=e.b2;o++)n+=t[dt(u,r,o)]||0;a+=n,s[u]=a}else if(i===r)for(let u=e.g1;u<=e.g2;u++){let n=0;for(let r=e.r1;r<=e.r2;r++)for(let o=e.b1;o<=e.b2;o++)n+=t[dt(r,u,o)]||0;a+=n,s[u]=a}else for(let u=e.b1;u<=e.b2;u++){let n=0;for(let r=e.r1;r<=e.r2;r++)for(let o=e.g1;o<=e.g2;o++)n+=t[dt(r,o,u)]||0;a+=n,s[u]=a}function c(t){const n=t+"1",r=t+"2";for(let o=e[n];o<=e[r];o++)if(s[o]>a/2){const t=e.copy(),i=e.copy(),a=o-e[n],c=e[r]-o;let u;u=a<=c?Math.min(e[r]-1,~~(o+c/2)):Math.max(e[n],~~(o-1-a/2));while(!s[u])u++;let l=h[u];while(!l&&s[u-1])l=h[--u];return t[r]=u,i[n]=t[r]+1,[t,i]}}return s.forEach((t,e)=>{h[e]=a-t}),c(i===n?"r":i===r?"g":"b")}function wt(t,e,n){let r=t.size(),o=0;while(o<ut){if(r>=e)return;o++;const i=t.pop();if(!i.count()){t.push(i);continue}const a=bt(n,i);if(!a||!a[0])return;t.push(a[0]),a[1]&&(t.push(a[1]),r++)}}function yt(t,e){if(!t.length||e<2||e>256)return[];const n=mt(t),r=vt(t,n),o=new pt((t,e)=>t.count()-e.count());o.push(r),wt(o,lt*e,n);const i=new pt((t,e)=>t.count()*t.volume()-e.count()*e.volume());while(o.size())i.push(o.pop());wt(i,e,n);const a=[];while(i.size()){const t=i.pop();a.push({color:t.avg(),population:t.count()})}return a}var Mt=class{async init(){}quantize(t,e){return yt(t,e)}};w();var _t=new Mt;function xt(t,e){const n=It(t,{colorCount:5,...e});return n?n[0]:null}function It(t,e){var n,r;const o=rt(null!==e&&void 0!==e?e:{}),i=null!==(n=null===e||void 0===e?void 0:e.quantizer)&&void 0!==n?n:_t,a=nt(Ct(t,o.gamut),o.region);return st(a.data,a.width,a.height,o,i,null!==(r=a.colorSpace)&&void 0!==r?r:"srgb")}function Ct(t,e){if("undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement)return St(t,e);if("undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)return v(t.getContext("2d"),t.width,t.height,e);var n;if("undefined"!==typeof ImageData&&t instanceof ImageData)return{data:t.data,width:t.width,height:t.height,colorSpace:null!==(n=t.colorSpace)&&void 0!==n?n:"srgb"};if("undefined"!==typeof HTMLVideoElement&&t instanceof HTMLVideoElement)return Et(t,e);if("undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap)return m(t.width,t.height,e,e=>e.drawImage(t,0,0));if("undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas){const n=t.getContext("2d");if(!n)throw new Error("Could not get 2D context from OffscreenCanvas.");return v(n,t.width,t.height,e)}throw new Error("Unsupported source type. Expected HTMLImageElement, HTMLCanvasElement, HTMLVideoElement, ImageData, ImageBitmap, or OffscreenCanvas.")}function St(t,e){if(!t.complete)throw new Error('Image has not finished loading. Wait for the "load" event before calling getColorSync/getPaletteSync.');
1if(!t.naturalWidth)throw new Error("Image has no dimensions. It may not have loaded successfully.");return m(t.naturalWidth,t.naturalHeight,e,e=>e.drawImage(t,0,0,t.naturalWidth,t.naturalHeight))}function Et(t,e){if(t.readyState<2)throw new Error('Video is not ready. Wait for the "loadeddata" or "canplay" event before calling getColorSync/getPaletteSync.');const n=t.videoWidth,r=t.videoHeight;if(!n||!r)throw new Error("Video has no dimensions. It may not have loaded successfully.");return m(n,r,e,e=>e.drawImage(t,0,0,n,r))}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.