"use strict";(self.webpackChunkgraphiql_app_for_wp=self.webpackChunkgraphiql_app_for_wp||[]).push([[8787],{6053(t,e,i){function s(t,e,i){return Math.min(Math.max(t,e),i)}i.d(e,{Uq:()=>n,mu:()=>r,qE:()=>s});class n{constructor(){this._n=1,this._val=0}update(t){return this._val=this._val+(t-this._val)/this._n,this._n+=1,this._val}get value(){return this._val}}class r{constructor(t){this._n=0,this._val=0,this._values=[],this._index=0,this._sum=0,this._values=new Array(t),this._values.fill(0,0,t)}update(t){const e=this._values[this._index];return this._values[this._index]=t,this._index=(this._index+1)%this._values.length,this._sum-=e,this._sum+=t,this._n<this._values.length&&(this._n+=1),this._val=this._sum/this._n,this._val}get value(){return this._val}}},8787(t,e,i){i.r(e),i.d(e,{ILanguageFeatureDebounceService:()=>d,LanguageFeatureDebounceService:()=>p});var s=i(2707),n=i(197),r=i(6053),a=i(7974),o=i(8357),u=i(9398),c=i(4888),l=i(4405),h=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},_=function(t,e){return function(i,s){e(i,s,t)}};const d=(0,u.u1)("ILanguageFeatureDebounceService");var v;!function(t){const e=new WeakMap;let i=0;t.of=function(t){let s=e.get(t);return void 0===s&&(s=++i,e.set(t,s)),s}}(v||(v={}));class f{constructor(t){this._default=t}get(t){return this._default}update(t,e){return this._default}default(){return this._default}}class g{constructor(t,e,i,s,r,a){this._logService=t,this._name=e,this._registry=i,this._default=s,this._min=r,this._max=a,this._cache=new n.qK(50,.7)}_key(t){return t.id+this._registry.all(t).reduce((t,e)=>(0,s.sN)(v.of(e),t),0)}get(t){const e=this._key(t),i=this._cache.get(e);return i?(0,r.qE)(i.value,this._min,this._max):this.default()}update(t,e){const i=this._key(t);let s=this._cache.get(i);s||(s=new r.mu(6),this._cache.set(i,s));const n=(0,r.qE)(s.update(e),this._min,this._max);return(0,l.v$)(t.uri,"output")||this._logService.trace("[DEBOUNCE: ".concat(this._name,"] for ").concat(t.uri.toString()," is ").concat(n,"ms")),n}_overall(){const t=new r.Uq;for(const[,e]of this._cache)t.update(e.value);return t.value}default(){const t=0|this._overall()||this._default;return(0,r.qE)(t,this._min,this._max)}}let p=class{constructor(t,e){this._logService=t,this._data=new Map,this._isDev=e.isExtensionDevelopment||!e.isBuilt}for(t,e,i){var s,n,r;const a=null!==(s=null===i||void 0===i?void 0:i.min)&&void 0!==s?s:50,o=null!==(n=null===i||void 0===i?void 0:i.max)&&void 0!==n?n:a**2,u=null!==(r=null===i||void 0===i?void 0:i.key)&&void 0!==r?r:void 0,c="".concat(v.of(t),",").concat(a).concat(u?","+u:"");let l=this._data.get(c);return l||(this._isDev?(this._logService.debug("[DEBOUNCE: ".concat(e,"] is disabled in developed mode")),l=new f(1.5*a)):l=new g(this._logService,e,t,0|this._overallAverage()||1.5*a,a,o),this._data.set(c,l)),l}_overallAverage(){const t=new r.Uq;for(const e of this._data.values())t.update(e.default());return t.value}};p=h([_(0,c.rr),_(1,a.k)],p),(0,o.v)(d,p,1)},7974(t,e,i){i.d(e,{k:()=>s});const s=(0,i(9398).u1)("environmentService")},3601(t,e,i){i.d(e,{d:()=>s});class s{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.ctor=t,this.staticArguments=e,this.supportsDelayedInstantiation=i}}},8357(t,e,i){i.d(e,{N:()=>a,v:()=>r});var s=i(3601);const n=[];function r(t,e,i){e instanceof s.d||(e=new s.d(e,[],Boolean(i))),n.push([t,e])}function a(){return n}},9398(t,e,i){var s;i.d(e,{_$:()=>s,_Y:()=>n,u1:()=>r}),function(t){t.serviceIds=new Map,t.DI_TARGET="$di$target",t.DI_DEPENDENCIES="$di$dependencies",t.getServiceDependencies=function(e){return e[t.DI_DEPENDENCIES]||[]}}(s||(s={}));const n=r("instantiationService");function r(t){if(s.serviceIds.has(t))return s.serviceIds.get(t);const e=function(t,i,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(t,e,i){e[s.DI_TARGET]===e?e[s.DI_DEPENDENCIES].push({id:t,index:i}):(e[s.DI_DEPENDENCIES]=[{id:t,index:i}],e[s.DI_TARGET]=e)}(e,t,n)};return e.toString=()=>t,s.serviceIds.set(t,e),e}}}]);
//# sourceMappingURL=8787.fb8d9741.chunk.js.map