mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
316 lines
2.0 MiB
316 lines
2.0 MiB
var co=Object.defineProperty;var uo=(s,e,t)=>e in s?co(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var G=(s,e,t)=>(uo(s,typeof e!="symbol"?e+"":e,t),t);function _mergeNamespaces(s,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const n in i)if(n!=="default"&&!(n in s)){const o=Object.getOwnPropertyDescriptor(i,n);o&&Object.defineProperty(s,n,o.get?o:{enumerable:!0,get:()=>i[n]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}function bind$4(s,e){return function(){return s.apply(e,arguments)}}const{toString}=Object.prototype,{getPrototypeOf}=Object,kindOf=(s=>e=>{const t=toString.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),kindOfTest=s=>(s=s.toLowerCase(),e=>kindOf(e)===s),typeOfTest=s=>e=>typeof e===s,{isArray:isArray$2}=Array,isUndefined=typeOfTest("undefined");function isBuffer(s){return s!==null&&!isUndefined(s)&&s.constructor!==null&&!isUndefined(s.constructor)&&isFunction$4(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}const isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(s){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(s):e=s&&s.buffer&&isArrayBuffer(s.buffer),e}const isString$1=typeOfTest("string"),isFunction$4=typeOfTest("function"),isNumber$1=typeOfTest("number"),isObject$4=s=>s!==null&&typeof s=="object",isBoolean=s=>s===!0||s===!1,isPlainObject=s=>{if(kindOf(s)!=="object")return!1;const e=getPrototypeOf(s);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},isDate$1=kindOfTest("Date"),isFile=kindOfTest("File"),isBlob=kindOfTest("Blob"),isFileList=kindOfTest("FileList"),isStream=s=>isObject$4(s)&&isFunction$4(s.pipe),isFormData=s=>{let e;return s&&(typeof FormData=="function"&&s instanceof FormData||isFunction$4(s.append)&&((e=kindOf(s))==="formdata"||e==="object"&&isFunction$4(s.toString)&&s.toString()==="[object FormData]"))},isURLSearchParams=kindOfTest("URLSearchParams"),trim$2=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function forEach(s,e,{allOwnKeys:t=!1}={}){if(s===null||typeof s>"u")return;let i,n;if(typeof s!="object"&&(s=[s]),isArray$2(s))for(i=0,n=s.length;i<n;i++)e.call(null,s[i],i,s);else{const o=t?Object.getOwnPropertyNames(s):Object.keys(s),r=o.length;let a;for(i=0;i<r;i++)a=o[i],e.call(null,s[a],a,s)}}function findKey$1(s,e){e=e.toLowerCase();const t=Object.keys(s);let i=t.length,n;for(;i-- >0;)if(n=t[i],e===n.toLowerCase())return n;return null}const _global=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),isContextDefined=s=>!isUndefined(s)&&s!==_global;function merge$1(){const{caseless:s}=isContextDefined(this)&&this||{},e={},t=(i,n)=>{const o=s&&findKey$1(e,n)||n;isPlainObject(e[o])&&isPlainObject(i)?e[o]=merge$1(e[o],i):isPlainObject(i)?e[o]=merge$1({},i):isArray$2(i)?e[o]=i.slice():e[o]=i};for(let i=0,n=arguments.length;i<n;i++)arguments[i]&&forEach(arguments[i],t);return e}const extend=(s,e,t,{allOwnKeys:i}={})=>(forEach(e,(n,o)=>{t&&isFunction$4(n)?s[o]=bind$4(n,t):s[o]=n},{allOwnKeys:i}),s),stripBOM=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),inherits=(s,e,t,i)=>{s.prototype=Object.create(e.prototype,i),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:e.prototype}),t&&Object.assign(s.prototype,t)},toFlatObject=(s,e,t,i)=>{let n,o,r;const a={};if(e=e||{},s==null)return e;do{for(n=Object.getOwnPropertyNames(s),o=n.length;o-- >0;)r=n[o],(!i||i(r,s,e))&&!a[r]&&(e[r]=s[r],a[r]=!0);s=t!==!1&&getPrototypeOf(s)}while(s&&(!t||t(s,e))&&s!==Object.prototype);return e},endsWith=(s,e,t)=>{s=String(s),(t===void 0||t>s.length)&&(t=s.length),t-=e.length;const i=s.indexOf(e,t);return i!==-1&&i===t},toArray=s=>{if(!s)return null;if(isArray$2(s))return s;let e=s.length;if(!isNumber$1(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=s[e];return t},isTypedArray=(s=>e=>s&&e instanceof s)(typeof Uint8Array<"u"&&getPrototypeOf(Uint8Array)),forEachEntry=(s,e)=>{const i=(s&&s[Symbol.iterator]).call(s);let n;for(;(n=i.next())&&!n.done;){const o=n.value;e.call(s,o[0],o[1])}},matchAll=(s,e)=>{let t;const i=[];for(;(t=s.exec(e))!==null;)i.push(t);return i},isHTMLForm=kindOfTest("HTMLFormElement"),toCamelCase=s=>s.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,i,n){return i.toUpperCase()+n}),hasOwnProperty$1=(({hasOwnProperty:s})=>(e,t)=>s.call(e,t))(Object.prototype),isRegExp=kindOfTest("RegExp"),reduceDescriptors=(s,e)=>{const t=Object.getOwnPropertyDescriptors(s),i={};forEach(t,(n,o)=>{let r;(r=e(n,o,s))!==!1&&(i[o]=r||n)}),Object.defineProperties(s,i)},freezeMethods=s=>{reduceDescriptors(s,(e,t)=>{if(isFunction$4(s)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const i=s[t];if(isFunction$4(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},toObjectSet=(s,e)=>{const t={},i=n=>{n.forEach(o=>{t[o]=!0})};return isArray$2(s)?i(s):i(String(s).split(e)),t},noop$4=()=>{},toFiniteNumber=(s,e)=>(s=+s,Number.isFinite(s)?s:e),ALPHA="abcdefghijklmnopqrstuvwxyz",DIGIT="0123456789",ALPHABET={DIGIT,ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT},generateString=(s=16,e=ALPHABET.ALPHA_DIGIT)=>{let t="";const{length:i}=e;for(;s--;)t+=e[Math.random()*i|0];return t};function isSpecCompliantForm(s){return!!(s&&isFunction$4(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator])}const toJSONObject=s=>{const e=new Array(10),t=(i,n)=>{if(isObject$4(i)){if(e.indexOf(i)>=0)return;if(!("toJSON"in i)){e[n]=i;const o=isArray$2(i)?[]:{};return forEach(i,(r,a)=>{const l=t(r,n+1);!isUndefined(l)&&(o[a]=l)}),e[n]=void 0,o}}return i};return t(s,0)},isAsyncFn=kindOfTest("AsyncFunction"),isThenable=s=>s&&(isObject$4(s)||isFunction$4(s))&&isFunction$4(s.then)&&isFunction$4(s.catch),utils$2={isArray:isArray$2,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString:isString$1,isNumber:isNumber$1,isBoolean,isObject:isObject$4,isPlainObject,isUndefined,isDate:isDate$1,isFile,isBlob,isRegExp,isFunction:isFunction$4,isStream,isURLSearchParams,isTypedArray,isFileList,forEach,merge:merge$1,extend,trim:trim$2,stripBOM,inherits,toFlatObject,kindOf,kindOfTest,endsWith,toArray,forEachEntry,matchAll,isHTMLForm,hasOwnProperty:hasOwnProperty$1,hasOwnProp:hasOwnProperty$1,reduceDescriptors,freezeMethods,toObjectSet,toCamelCase,noop:noop$4,toFiniteNumber,findKey:findKey$1,global:_global,isContextDefined,ALPHABET,generateString,isSpecCompliantForm,toJSONObject,isAsyncFn,isThenable};function AxiosError(s,e,t,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),i&&(this.request=i),n&&(this.response=n)}utils$2.inherits(AxiosError,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:utils$2.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const prototype$1=AxiosError.prototype,descriptors$1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(s=>{descriptors$1[s]={value:s}});Object.defineProperties(AxiosError,descriptors$1);Object.defineProperty(prototype$1,"isAxiosError",{value:!0});AxiosError.from=(s,e,t,i,n,o)=>{const r=Object.create(prototype$1);return utils$2.toFlatObject(s,r,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),AxiosError.call(r,s.message,e,t,i,n),r.cause=s,r.name=s.name,o&&Object.assign(r,o),r};const httpAdapter=null;function isVisitable(s){return utils$2.isPlainObject(s)||utils$2.isArray(s)}function removeBrackets(s){return utils$2.endsWith(s,"[]")?s.slice(0,-2):s}function renderKey(s,e,t){return s?s.concat(e).map(function(n,o){return n=removeBrackets(n),!t&&o?"["+n+"]":n}).join(t?".":""):e}function isFlatArray(s){return utils$2.isArray(s)&&!s.some(isVisitable)}const predicates=utils$2.toFlatObject(utils$2,{},null,function(e){return/^is[A-Z]/.test(e)});function toFormData(s,e,t){if(!utils$2.isObject(s))throw new TypeError("target must be an object");e=e||new FormData,t=utils$2.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,S){return!utils$2.isUndefined(S[b])});const i=t.metaTokens,n=t.visitor||h,o=t.dots,r=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&utils$2.isSpecCompliantForm(e);if(!utils$2.isFunction(n))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(utils$2.isDate(y))return y.toISOString();if(!l&&utils$2.isBlob(y))throw new AxiosError("Blob is not supported. Use a Buffer instead.");return utils$2.isArrayBuffer(y)||utils$2.isTypedArray(y)?l&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function h(y,b,S){let E=y;if(y&&!S&&typeof y=="object"){if(utils$2.endsWith(b,"{}"))b=i?b:b.slice(0,-2),y=JSON.stringify(y);else if(utils$2.isArray(y)&&isFlatArray(y)||(utils$2.isFileList(y)||utils$2.endsWith(b,"[]"))&&(E=utils$2.toArray(y)))return b=removeBrackets(b),E.forEach(function(R,A){!(utils$2.isUndefined(R)||R===null)&&e.append(r===!0?renderKey([b],A,o):r===null?b:b+"[]",d(R))}),!1}return isVisitable(y)?!0:(e.append(renderKey(S,b,o),d(y)),!1)}const p=[],m=Object.assign(predicates,{defaultVisitor:h,convertValue:d,isVisitable});function v(y,b){if(!utils$2.isUndefined(y)){if(p.indexOf(y)!==-1)throw Error("Circular reference detected in "+b.join("."));p.push(y),utils$2.forEach(y,function(E,T){(!(utils$2.isUndefined(E)||E===null)&&n.call(e,E,utils$2.isString(T)?T.trim():T,b,m))===!0&&v(E,b?b.concat(T):[T])}),p.pop()}}if(!utils$2.isObject(s))throw new TypeError("data must be an object");return v(s),e}function encode$1(s){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function AxiosURLSearchParams(s,e){this._pairs=[],s&&toFormData(s,this,e)}const prototype=AxiosURLSearchParams.prototype;prototype.append=function(e,t){this._pairs.push([e,t])};prototype.toString=function(e){const t=e?function(i){return e.call(this,i,encode$1)}:encode$1;return this._pairs.map(function(n){return t(n[0])+"="+t(n[1])},"").join("&")};function encode(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(s,e,t){if(!e)return s;const i=t&&t.encode||encode,n=t&&t.serialize;let o;if(n?o=n(e,t):o=utils$2.isURLSearchParams(e)?e.toString():new AxiosURLSearchParams(e,t).toString(i),o){const r=s.indexOf("#");r!==-1&&(s=s.slice(0,r)),s+=(s.indexOf("?")===-1?"?":"&")+o}return s}class InterceptorManager{constructor(){this.handlers=[]}use(e,t,i){return this.handlers.push({fulfilled:e,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){utils$2.forEach(this.handlers,function(i){i!==null&&e(i)})}}const InterceptorManager$1=InterceptorManager,transitionalDefaults={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},URLSearchParams$1=typeof URLSearchParams<"u"?URLSearchParams:AxiosURLSearchParams,FormData$1=typeof FormData<"u"?FormData:null,Blob$1=typeof Blob<"u"?Blob:null,platform$1={isBrowser:!0,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]},hasBrowserEnv=typeof window<"u"&&typeof document<"u",hasStandardBrowserEnv=(s=>hasBrowserEnv&&["ReactNative","NativeScript","NS"].indexOf(s)<0)(typeof navigator<"u"&&navigator.product),hasStandardBrowserWebWorkerEnv=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),utils$1=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv,hasStandardBrowserEnv,hasStandardBrowserWebWorkerEnv},Symbol.toStringTag,{value:"Module"})),platform={...utils$1,...platform$1};function toURLEncodedForm(s,e){return toFormData(s,new platform.classes.URLSearchParams,Object.assign({visitor:function(t,i,n,o){return platform.isNode&&utils$2.isBuffer(t)?(this.append(i,t.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},e))}function parsePropPath(s){return utils$2.matchAll(/\w+|\[(\w*)]/g,s).map(e=>e[0]==="[]"?"":e[1]||e[0])}function arrayToObject(s){const e={},t=Object.keys(s);let i;const n=t.length;let o;for(i=0;i<n;i++)o=t[i],e[o]=s[o];return e}function formDataToJSON(s){function e(t,i,n,o){let r=t[o++];if(r==="__proto__")return!0;const a=Number.isFinite(+r),l=o>=t.length;return r=!r&&utils$2.isArray(n)?n.length:r,l?(utils$2.hasOwnProp(n,r)?n[r]=[n[r],i]:n[r]=i,!a):((!n[r]||!utils$2.isObject(n[r]))&&(n[r]=[]),e(t,i,n[r],o)&&utils$2.isArray(n[r])&&(n[r]=arrayToObject(n[r])),!a)}if(utils$2.isFormData(s)&&utils$2.isFunction(s.entries)){const t={};return utils$2.forEachEntry(s,(i,n)=>{e(parsePropPath(i),n,t,0)}),t}return null}function stringifySafely(s,e,t){if(utils$2.isString(s))try{return(e||JSON.parse)(s),utils$2.trim(s)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(s)}const defaults$2={transitional:transitionalDefaults,adapter:["xhr","http"],transformRequest:[function(e,t){const i=t.getContentType()||"",n=i.indexOf("application/json")>-1,o=utils$2.isObject(e);if(o&&utils$2.isHTMLForm(e)&&(e=new FormData(e)),utils$2.isFormData(e))return n?JSON.stringify(formDataToJSON(e)):e;if(utils$2.isArrayBuffer(e)||utils$2.isBuffer(e)||utils$2.isStream(e)||utils$2.isFile(e)||utils$2.isBlob(e))return e;if(utils$2.isArrayBufferView(e))return e.buffer;if(utils$2.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return toURLEncodedForm(e,this.formSerializer).toString();if((a=utils$2.isFileList(e))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return toFormData(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),stringifySafely(e)):e}],transformResponse:[function(e){const t=this.transitional||defaults$2.transitional,i=t&&t.forcedJSONParsing,n=this.responseType==="json";if(e&&utils$2.isString(e)&&(i&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(a){if(r)throw a.name==="SyntaxError"?AxiosError.from(a,AxiosError.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};utils$2.forEach(["delete","get","head","post","put","patch"],s=>{defaults$2.headers[s]={}});const defaults$3=defaults$2,ignoreDuplicateOf=utils$2.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),parseHeaders=s=>{const e={};let t,i,n;return s&&s.split(`
|
||
`).forEach(function(r){n=r.indexOf(":"),t=r.substring(0,n).trim().toLowerCase(),i=r.substring(n+1).trim(),!(!t||e[t]&&ignoreDuplicateOf[t])&&(t==="set-cookie"?e[t]?e[t].push(i):e[t]=[i]:e[t]=e[t]?e[t]+", "+i:i)}),e},$internals=Symbol("internals");function normalizeHeader(s){return s&&String(s).trim().toLowerCase()}function normalizeValue(s){return s===!1||s==null?s:utils$2.isArray(s)?s.map(normalizeValue):String(s)}function parseTokens(s){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=t.exec(s);)e[i[1]]=i[2];return e}const isValidHeaderName=s=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(s.trim());function matchHeaderValue(s,e,t,i,n){if(utils$2.isFunction(i))return i.call(this,e,t);if(n&&(e=t),!!utils$2.isString(e)){if(utils$2.isString(i))return e.indexOf(i)!==-1;if(utils$2.isRegExp(i))return i.test(e)}}function formatHeader(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,i)=>t.toUpperCase()+i)}function buildAccessors(s,e){const t=utils$2.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(s,i+t,{value:function(n,o,r){return this[i].call(this,e,n,o,r)},configurable:!0})})}class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,i){const n=this;function o(a,l,d){const h=normalizeHeader(l);if(!h)throw new Error("header name must be a non-empty string");const p=utils$2.findKey(n,h);(!p||n[p]===void 0||d===!0||d===void 0&&n[p]!==!1)&&(n[p||l]=normalizeValue(a))}const r=(a,l)=>utils$2.forEach(a,(d,h)=>o(d,h,l));return utils$2.isPlainObject(e)||e instanceof this.constructor?r(e,t):utils$2.isString(e)&&(e=e.trim())&&!isValidHeaderName(e)?r(parseHeaders(e),t):e!=null&&o(t,e,i),this}get(e,t){if(e=normalizeHeader(e),e){const i=utils$2.findKey(this,e);if(i){const n=this[i];if(!t)return n;if(t===!0)return parseTokens(n);if(utils$2.isFunction(t))return t.call(this,n,i);if(utils$2.isRegExp(t))return t.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=normalizeHeader(e),e){const i=utils$2.findKey(this,e);return!!(i&&this[i]!==void 0&&(!t||matchHeaderValue(this,this[i],i,t)))}return!1}delete(e,t){const i=this;let n=!1;function o(r){if(r=normalizeHeader(r),r){const a=utils$2.findKey(i,r);a&&(!t||matchHeaderValue(i,i[a],a,t))&&(delete i[a],n=!0)}}return utils$2.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let i=t.length,n=!1;for(;i--;){const o=t[i];(!e||matchHeaderValue(this,this[o],o,e,!0))&&(delete this[o],n=!0)}return n}normalize(e){const t=this,i={};return utils$2.forEach(this,(n,o)=>{const r=utils$2.findKey(i,o);if(r){t[r]=normalizeValue(n),delete t[o];return}const a=e?formatHeader(o):String(o).trim();a!==o&&delete t[o],t[a]=normalizeValue(n),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return utils$2.forEach(this,(i,n)=>{i!=null&&i!==!1&&(t[n]=e&&utils$2.isArray(i)?i.join(", "):i)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
||
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const i=new this(e);return t.forEach(n=>i.set(n)),i}static accessor(e){const i=(this[$internals]=this[$internals]={accessors:{}}).accessors,n=this.prototype;function o(r){const a=normalizeHeader(r);i[a]||(buildAccessors(n,r),i[a]=!0)}return utils$2.isArray(e)?e.forEach(o):o(e),this}}AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$2.reduceDescriptors(AxiosHeaders.prototype,({value:s},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>s,set(i){this[t]=i}}});utils$2.freezeMethods(AxiosHeaders);const AxiosHeaders$1=AxiosHeaders;function transformData(s,e){const t=this||defaults$3,i=e||t,n=AxiosHeaders$1.from(i.headers);let o=i.data;return utils$2.forEach(s,function(a){o=a.call(t,o,n.normalize(),e?e.status:void 0)}),n.normalize(),o}function isCancel(s){return!!(s&&s.__CANCEL__)}function CanceledError(s,e,t){AxiosError.call(this,s??"canceled",AxiosError.ERR_CANCELED,e,t),this.name="CanceledError"}utils$2.inherits(CanceledError,AxiosError,{__CANCEL__:!0});function settle(s,e,t){const i=t.config.validateStatus;!t.status||!i||i(t.status)?s(t):e(new AxiosError("Request failed with status code "+t.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}const cookies=platform.hasStandardBrowserEnv?{write(s,e,t,i,n,o){const r=[s+"="+encodeURIComponent(e)];utils$2.isNumber(t)&&r.push("expires="+new Date(t).toGMTString()),utils$2.isString(i)&&r.push("path="+i),utils$2.isString(n)&&r.push("domain="+n),o===!0&&r.push("secure"),document.cookie=r.join("; ")},read(s){const e=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(s){this.write(s,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function combineURLs(s,e){return e?s.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):s}function buildFullPath(s,e){return s&&!isAbsoluteURL(e)?combineURLs(s,e):e}const isURLSameOrigin=platform.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let i;function n(o){let r=o;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return i=n(window.location.href),function(r){const a=utils$2.isString(r)?n(r):r;return a.protocol===i.protocol&&a.host===i.host}}():function(){return function(){return!0}}();function parseProtocol(s){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return e&&e[1]||""}function speedometer(s,e){s=s||10;const t=new Array(s),i=new Array(s);let n=0,o=0,r;return e=e!==void 0?e:1e3,function(l){const d=Date.now(),h=i[o];r||(r=d),t[n]=l,i[n]=d;let p=o,m=0;for(;p!==n;)m+=t[p++],p=p%s;if(n=(n+1)%s,n===o&&(o=(o+1)%s),d-r<e)return;const v=h&&d-h;return v?Math.round(m*1e3/v):void 0}}function progressEventReducer(s,e){let t=0;const i=speedometer(50,250);return n=>{const o=n.loaded,r=n.lengthComputable?n.total:void 0,a=o-t,l=i(a),d=o<=r;t=o;const h={loaded:o,total:r,progress:r?o/r:void 0,bytes:a,rate:l||void 0,estimated:l&&r&&d?(r-o)/l:void 0,event:n};h[e?"download":"upload"]=!0,s(h)}}const isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(s){return new Promise(function(t,i){let n=s.data;const o=AxiosHeaders$1.from(s.headers).normalize();let{responseType:r,withXSRFToken:a}=s,l;function d(){s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let h;if(utils$2.isFormData(n)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((h=o.getContentType())!==!1){const[b,...S]=h?h.split(";").map(E=>E.trim()).filter(Boolean):[];o.setContentType([b||"multipart/form-data",...S].join("; "))}}let p=new XMLHttpRequest;if(s.auth){const b=s.auth.username||"",S=s.auth.password?unescape(encodeURIComponent(s.auth.password)):"";o.set("Authorization","Basic "+btoa(b+":"+S))}const m=buildFullPath(s.baseURL,s.url);p.open(s.method.toUpperCase(),buildURL(m,s.params,s.paramsSerializer),!0),p.timeout=s.timeout;function v(){if(!p)return;const b=AxiosHeaders$1.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),E={data:!r||r==="text"||r==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:b,config:s,request:p};settle(function(R){t(R),d()},function(R){i(R),d()},E),p=null}if("onloadend"in p?p.onloadend=v:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(v)},p.onabort=function(){p&&(i(new AxiosError("Request aborted",AxiosError.ECONNABORTED,s,p)),p=null)},p.onerror=function(){i(new AxiosError("Network Error",AxiosError.ERR_NETWORK,s,p)),p=null},p.ontimeout=function(){let S=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const E=s.transitional||transitionalDefaults;s.timeoutErrorMessage&&(S=s.timeoutErrorMessage),i(new AxiosError(S,E.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,s,p)),p=null},platform.hasStandardBrowserEnv&&(a&&utils$2.isFunction(a)&&(a=a(s)),a||a!==!1&&isURLSameOrigin(m))){const b=s.xsrfHeaderName&&s.xsrfCookieName&&cookies.read(s.xsrfCookieName);b&&o.set(s.xsrfHeaderName,b)}n===void 0&&o.setContentType(null),"setRequestHeader"in p&&utils$2.forEach(o.toJSON(),function(S,E){p.setRequestHeader(E,S)}),utils$2.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),r&&r!=="json"&&(p.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&p.addEventListener("progress",progressEventReducer(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",progressEventReducer(s.onUploadProgress)),(s.cancelToken||s.signal)&&(l=b=>{p&&(i(!b||b.type?new CanceledError(null,s,p):b),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const y=parseProtocol(m);if(y&&platform.protocols.indexOf(y)===-1){i(new AxiosError("Unsupported protocol "+y+":",AxiosError.ERR_BAD_REQUEST,s));return}p.send(n||null)})},knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils$2.forEach(knownAdapters,(s,e)=>{if(s){try{Object.defineProperty(s,"name",{value:e})}catch{}Object.defineProperty(s,"adapterName",{value:e})}});const renderReason=s=>`- ${s}`,isResolvedHandle=s=>utils$2.isFunction(s)||s===null||s===!1,adapters$1={getAdapter:s=>{s=utils$2.isArray(s)?s:[s];const{length:e}=s;let t,i;const n={};for(let o=0;o<e;o++){t=s[o];let r;if(i=t,!isResolvedHandle(t)&&(i=knownAdapters[(r=String(t)).toLowerCase()],i===void 0))throw new AxiosError(`Unknown adapter '${r}'`);if(i)break;n[r||"#"+o]=i}if(!i){const o=Object.entries(n).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let r=e?o.length>1?`since :
|
||
`+o.map(renderReason).join(`
|
||
`):" "+renderReason(o[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return i},adapters:knownAdapters};function throwIfCancellationRequested(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new CanceledError(null,s)}function dispatchRequest(s){return throwIfCancellationRequested(s),s.headers=AxiosHeaders$1.from(s.headers),s.data=transformData.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),adapters$1.getAdapter(s.adapter||defaults$3.adapter)(s).then(function(i){return throwIfCancellationRequested(s),i.data=transformData.call(s,s.transformResponse,i),i.headers=AxiosHeaders$1.from(i.headers),i},function(i){return isCancel(i)||(throwIfCancellationRequested(s),i&&i.response&&(i.response.data=transformData.call(s,s.transformResponse,i.response),i.response.headers=AxiosHeaders$1.from(i.response.headers))),Promise.reject(i)})}const headersToObject=s=>s instanceof AxiosHeaders$1?s.toJSON():s;function mergeConfig(s,e){e=e||{};const t={};function i(d,h,p){return utils$2.isPlainObject(d)&&utils$2.isPlainObject(h)?utils$2.merge.call({caseless:p},d,h):utils$2.isPlainObject(h)?utils$2.merge({},h):utils$2.isArray(h)?h.slice():h}function n(d,h,p){if(utils$2.isUndefined(h)){if(!utils$2.isUndefined(d))return i(void 0,d,p)}else return i(d,h,p)}function o(d,h){if(!utils$2.isUndefined(h))return i(void 0,h)}function r(d,h){if(utils$2.isUndefined(h)){if(!utils$2.isUndefined(d))return i(void 0,d)}else return i(void 0,h)}function a(d,h,p){if(p in e)return i(d,h);if(p in s)return i(void 0,d)}const l={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(d,h)=>n(headersToObject(d),headersToObject(h),!0)};return utils$2.forEach(Object.keys(Object.assign({},s,e)),function(h){const p=l[h]||n,m=p(s[h],e[h],h);utils$2.isUndefined(m)&&p!==a||(t[h]=m)}),t}const VERSION$2="1.6.7",validators$1={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{validators$1[s]=function(i){return typeof i===s||"a"+(e<1?"n ":" ")+s}});const deprecatedWarnings={};validators$1.transitional=function(e,t,i){function n(o,r){return"[Axios v"+VERSION$2+"] Transitional option '"+o+"'"+r+(i?". "+i:"")}return(o,r,a)=>{if(e===!1)throw new AxiosError(n(r," has been removed"+(t?" in "+t:"")),AxiosError.ERR_DEPRECATED);return t&&!deprecatedWarnings[r]&&(deprecatedWarnings[r]=!0,console.warn(n(r," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,r,a):!0}};function assertOptions(s,e,t){if(typeof s!="object")throw new AxiosError("options must be an object",AxiosError.ERR_BAD_OPTION_VALUE);const i=Object.keys(s);let n=i.length;for(;n-- >0;){const o=i[n],r=e[o];if(r){const a=s[o],l=a===void 0||r(a,o,s);if(l!==!0)throw new AxiosError("option "+o+" must be "+l,AxiosError.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new AxiosError("Unknown option "+o,AxiosError.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;class Axios{constructor(e){this.defaults=e,this.interceptors={request:new InterceptorManager$1,response:new InterceptorManager$1}}async request(e,t){try{return await this._request(e,t)}catch(i){if(i instanceof Error){let n;Error.captureStackTrace?Error.captureStackTrace(n={}):n=new Error;const o=n.stack?n.stack.replace(/^.+\n/,""):"";i.stack?o&&!String(i.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(i.stack+=`
|
||
`+o):i.stack=o}throw i}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=mergeConfig(this.defaults,t);const{transitional:i,paramsSerializer:n,headers:o}=t;i!==void 0&&validator.assertOptions(i,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),n!=null&&(utils$2.isFunction(n)?t.paramsSerializer={serialize:n}:validator.assertOptions(n,{encode:validators.function,serialize:validators.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let r=o&&utils$2.merge(o.common,o[t.method]);o&&utils$2.forEach(["delete","get","head","post","put","patch","common"],y=>{delete o[y]}),t.headers=AxiosHeaders$1.concat(r,o);const a=[];let l=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(t)===!1||(l=l&&b.synchronous,a.unshift(b.fulfilled,b.rejected))});const d=[];this.interceptors.response.forEach(function(b){d.push(b.fulfilled,b.rejected)});let h,p=0,m;if(!l){const y=[dispatchRequest.bind(this),void 0];for(y.unshift.apply(y,a),y.push.apply(y,d),m=y.length,h=Promise.resolve(t);p<m;)h=h.then(y[p++],y[p++]);return h}m=a.length;let v=t;for(p=0;p<m;){const y=a[p++],b=a[p++];try{v=y(v)}catch(S){b.call(this,S);break}}try{h=dispatchRequest.call(this,v)}catch(y){return Promise.reject(y)}for(p=0,m=d.length;p<m;)h=h.then(d[p++],d[p++]);return h}getUri(e){e=mergeConfig(this.defaults,e);const t=buildFullPath(e.baseURL,e.url);return buildURL(t,e.params,e.paramsSerializer)}}utils$2.forEach(["delete","get","head","options"],function(e){Axios.prototype[e]=function(t,i){return this.request(mergeConfig(i||{},{method:e,url:t,data:(i||{}).data}))}});utils$2.forEach(["post","put","patch"],function(e){function t(i){return function(o,r,a){return this.request(mergeConfig(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:o,data:r}))}}Axios.prototype[e]=t(),Axios.prototype[e+"Form"]=t(!0)});const Axios$1=Axios;class CancelToken{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(o){t=o});const i=this;this.promise.then(n=>{if(!i._listeners)return;let o=i._listeners.length;for(;o-- >0;)i._listeners[o](n);i._listeners=null}),this.promise.then=n=>{let o;const r=new Promise(a=>{i.subscribe(a),o=a}).then(n);return r.cancel=function(){i.unsubscribe(o)},r},e(function(o,r,a){i.reason||(i.reason=new CanceledError(o,r,a),t(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new CancelToken(function(n){e=n}),cancel:e}}}const CancelToken$1=CancelToken;function spread(s){return function(t){return s.apply(null,t)}}function isAxiosError(s){return utils$2.isObject(s)&&s.isAxiosError===!0}const HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach(([s,e])=>{HttpStatusCode[e]=s});const HttpStatusCode$1=HttpStatusCode;function createInstance(s){const e=new Axios$1(s),t=bind$4(Axios$1.prototype.request,e);return utils$2.extend(t,Axios$1.prototype,e,{allOwnKeys:!0}),utils$2.extend(t,e,null,{allOwnKeys:!0}),t.create=function(n){return createInstance(mergeConfig(s,n))},t}const axios=createInstance(defaults$3);axios.Axios=Axios$1;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel;axios.VERSION=VERSION$2;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function(e){return Promise.all(e)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=s=>formDataToJSON(utils$2.isHTMLForm(s)?new FormData(s):s);axios.getAdapter=adapters$1.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const axios$1=axios;var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var assign=make_assign(),create$2=make_create(),trim$1=make_trim(),Global$5=typeof window<"u"?window:commonjsGlobal,util$7={assign,create:create$2,trim:trim$1,bind:bind$3,slice:slice$3,each:each$a,map:map$2,pluck:pluck$1,isList:isList$1,isFunction:isFunction$3,isObject:isObject$3,Global:Global$5};function make_assign(){return Object.assign?Object.assign:function(e,t,i,n){for(var o=1;o<arguments.length;o++)each$a(Object(arguments[o]),function(r,a){e[a]=r});return e}}function make_create(){if(Object.create)return function(e,t,i,n){var o=slice$3(arguments,1);return assign.apply(this,[Object.create(e)].concat(o))};{let s=function(){};return function(t,i,n,o){var r=slice$3(arguments,1);return s.prototype=t,assign.apply(this,[new s].concat(r))}}}function make_trim(){return String.prototype.trim?function(e){return String.prototype.trim.call(e)}:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}}function bind$3(s,e){return function(){return e.apply(s,Array.prototype.slice.call(arguments,0))}}function slice$3(s,e){return Array.prototype.slice.call(s,e||0)}function each$a(s,e){pluck$1(s,function(t,i){return e(t,i),!1})}function map$2(s,e){var t=isList$1(s)?[]:{};return pluck$1(s,function(i,n){return t[n]=e(i,n),!1}),t}function pluck$1(s,e){if(isList$1(s)){for(var t=0;t<s.length;t++)if(e(s[t],t))return s[t]}else for(var i in s)if(s.hasOwnProperty(i)&&e(s[i],i))return s[i]}function isList$1(s){return s!=null&&typeof s!="function"&&typeof s.length=="number"}function isFunction$3(s){return s&&{}.toString.call(s)==="[object Function]"}function isObject$3(s){return s&&{}.toString.call(s)==="[object Object]"}var util$6=util$7,slice$2=util$6.slice,pluck=util$6.pluck,each$9=util$6.each,bind$2=util$6.bind,create$1=util$6.create,isList=util$6.isList,isFunction$2=util$6.isFunction,isObject$2=util$6.isObject,storeEngine={createStore},storeAPI={version:"2.0.12",enabled:!1,get:function(s,e){var t=this.storage.read(this._namespacePrefix+s);return this._deserialize(t,e)},set:function(s,e){return e===void 0?this.remove(s):(this.storage.write(this._namespacePrefix+s,this._serialize(e)),e)},remove:function(s){this.storage.remove(this._namespacePrefix+s)},each:function(s){var e=this;this.storage.each(function(t,i){s.call(e,e._deserialize(t),(i||"").replace(e._namespaceRegexp,""))})},clearAll:function(){this.storage.clearAll()},hasNamespace:function(s){return this._namespacePrefix=="__storejs_"+s+"_"},createStore:function(){return createStore.apply(this,arguments)},addPlugin:function(s){this._addPlugin(s)},namespace:function(s){return createStore(this.storage,this.plugins,s)}};function _warn(){var s=typeof console>"u"?null:console;if(s){var e=s.warn?s.warn:s.log;e.apply(s,arguments)}}function createStore(s,e,t){t||(t=""),s&&!isList(s)&&(s=[s]),e&&!isList(e)&&(e=[e]);var i=t?"__storejs_"+t+"_":"",n=t?new RegExp("^"+i):null,o=/^[a-zA-Z0-9_\-]*$/;if(!o.test(t))throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");var r={_namespacePrefix:i,_namespaceRegexp:n,_testStorage:function(l){try{var d="__storejs__test__";l.write(d,d);var h=l.read(d)===d;return l.remove(d),h}catch{return!1}},_assignPluginFnProp:function(l,d){var h=this[d];this[d]=function(){var m=slice$2(arguments,0),v=this;function y(){if(h)return each$9(arguments,function(S,E){m[E]=S}),h.apply(v,m)}var b=[y].concat(m);return l.apply(v,b)}},_serialize:function(l){return JSON.stringify(l)},_deserialize:function(l,d){if(!l)return d;var h="";try{h=JSON.parse(l)}catch{h=l}return h!==void 0?h:d},_addStorage:function(l){this.enabled||this._testStorage(l)&&(this.storage=l,this.enabled=!0)},_addPlugin:function(l){var d=this;if(isList(l)){each$9(l,function(m){d._addPlugin(m)});return}var h=pluck(this.plugins,function(m){return l===m});if(!h){if(this.plugins.push(l),!isFunction$2(l))throw new Error("Plugins must be function values that return objects");var p=l.call(this);if(!isObject$2(p))throw new Error("Plugins must return an object of function properties");each$9(p,function(m,v){if(!isFunction$2(m))throw new Error("Bad plugin property: "+v+" from plugin "+l.name+". Plugins should only return functions.");d._assignPluginFnProp(m,v)})}},addStorage:function(l){_warn("store.addStorage(storage) is deprecated. Use createStore([storages])"),this._addStorage(l)}},a=create$1(r,storeAPI,{plugins:[]});return a.raw={},each$9(a,function(l,d){isFunction$2(l)&&(a.raw[d]=bind$2(a,l))}),each$9(s,function(l){a._addStorage(l)}),each$9(e,function(l){a._addPlugin(l)}),a}var util$5=util$7,Global$4=util$5.Global,localStorage_1={name:"localStorage",read:read$6,write:write$6,each:each$8,remove:remove$5,clearAll:clearAll$5};function localStorage(){return Global$4.localStorage}function read$6(s){return localStorage().getItem(s)}function write$6(s,e){return localStorage().setItem(s,e)}function each$8(s){for(var e=localStorage().length-1;e>=0;e--){var t=localStorage().key(e);s(read$6(t),t)}}function remove$5(s){return localStorage().removeItem(s)}function clearAll$5(){return localStorage().clear()}var util$4=util$7,Global$3=util$4.Global,oldFFGlobalStorage={name:"oldFF-globalStorage",read:read$5,write:write$5,each:each$7,remove:remove$4,clearAll:clearAll$4},globalStorage=Global$3.globalStorage;function read$5(s){return globalStorage[s]}function write$5(s,e){globalStorage[s]=e}function each$7(s){for(var e=globalStorage.length-1;e>=0;e--){var t=globalStorage.key(e);s(globalStorage[t],t)}}function remove$4(s){return globalStorage.removeItem(s)}function clearAll$4(){each$7(function(s,e){delete globalStorage[s]})}var util$3=util$7,Global$2=util$3.Global,oldIEUserDataStorage={name:"oldIE-userDataStorage",write:write$4,read:read$4,each:each$6,remove:remove$3,clearAll:clearAll$3},storageName="storejs",doc$1=Global$2.document,_withStorageEl=_makeIEStorageElFunction(),disable=(Global$2.navigator?Global$2.navigator.userAgent:"").match(/ (MSIE 8|MSIE 9|MSIE 10)\./);function write$4(s,e){if(!disable){var t=fixKey(s);_withStorageEl(function(i){i.setAttribute(t,e),i.save(storageName)})}}function read$4(s){if(!disable){var e=fixKey(s),t=null;return _withStorageEl(function(i){t=i.getAttribute(e)}),t}}function each$6(s){_withStorageEl(function(e){for(var t=e.XMLDocument.documentElement.attributes,i=t.length-1;i>=0;i--){var n=t[i];s(e.getAttribute(n.name),n.name)}})}function remove$3(s){var e=fixKey(s);_withStorageEl(function(t){t.removeAttribute(e),t.save(storageName)})}function clearAll$3(){_withStorageEl(function(s){var e=s.XMLDocument.documentElement.attributes;s.load(storageName);for(var t=e.length-1;t>=0;t--)s.removeAttribute(e[t].name);s.save(storageName)})}var forbiddenCharsRegex=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");function fixKey(s){return s.replace(/^\d/,"___$&").replace(forbiddenCharsRegex,"___")}function _makeIEStorageElFunction(){if(!doc$1||!doc$1.documentElement||!doc$1.documentElement.addBehavior)return null;var s="script",e,t,i;try{t=new ActiveXObject("htmlfile"),t.open(),t.write("<"+s+">document.w=window</"+s+'><iframe src="/favicon.ico"></iframe>'),t.close(),e=t.w.frames[0].document,i=e.createElement("div")}catch{i=doc$1.createElement("div"),e=doc$1.body}return function(n){var o=[].slice.call(arguments,0);o.unshift(i),e.appendChild(i),i.addBehavior("#default#userData"),i.load(storageName),n.apply(this,o),e.removeChild(i)}}var util$2=util$7,Global$1=util$2.Global,trim=util$2.trim,cookieStorage={name:"cookieStorage",read:read$3,write:write$3,each:each$5,remove:remove$2,clearAll:clearAll$2},doc=Global$1.document;function read$3(s){if(!s||!_has(s))return null;var e="(?:^|.*;\\s*)"+escape(s).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";return unescape(doc.cookie.replace(new RegExp(e),"$1"))}function each$5(s){for(var e=doc.cookie.split(/; ?/g),t=e.length-1;t>=0;t--)if(trim(e[t])){var i=e[t].split("="),n=unescape(i[0]),o=unescape(i[1]);s(o,n)}}function write$3(s,e){s&&(doc.cookie=escape(s)+"="+escape(e)+"; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/")}function remove$2(s){!s||!_has(s)||(doc.cookie=escape(s)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")}function clearAll$2(){each$5(function(s,e){remove$2(e)})}function _has(s){return new RegExp("(?:^|;\\s*)"+escape(s).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=").test(doc.cookie)}var util$1=util$7,Global=util$1.Global,sessionStorage_1={name:"sessionStorage",read:read$2,write:write$2,each:each$4,remove:remove$1,clearAll:clearAll$1};function sessionStorage(){return Global.sessionStorage}function read$2(s){return sessionStorage().getItem(s)}function write$2(s,e){return sessionStorage().setItem(s,e)}function each$4(s){for(var e=sessionStorage().length-1;e>=0;e--){var t=sessionStorage().key(e);s(read$2(t),t)}}function remove$1(s){return sessionStorage().removeItem(s)}function clearAll$1(){return sessionStorage().clear()}var memoryStorage_1={name:"memoryStorage",read:read$1,write:write$1,each:each$3,remove,clearAll},memoryStorage={};function read$1(s){return memoryStorage[s]}function write$1(s,e){memoryStorage[s]=e}function each$3(s){for(var e in memoryStorage)memoryStorage.hasOwnProperty(e)&&s(memoryStorage[e],e)}function remove(s){delete memoryStorage[s]}function clearAll(s){memoryStorage={}}var all=[localStorage_1,oldFFGlobalStorage,oldIEUserDataStorage,cookieStorage,sessionStorage_1,memoryStorage_1],json2$1={},hasRequiredJson2;function requireJson2(){return hasRequiredJson2||(hasRequiredJson2=1,typeof JSON!="object"&&(JSON={}),function(){var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;function f(s){return s<10?"0"+s:s}function this_value(){return this.valueOf()}typeof Date.prototype.toJSON!="function"&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value);var gap,indent,meta,rep;function quote(s){return rx_escapable.lastIndex=0,rx_escapable.test(s)?'"'+s.replace(rx_escapable,function(e){var t=meta[e];return typeof t=="string"?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+s+'"'}function str(s,e){var t,i,n,o,r=gap,a,l=e[s];switch(l&&typeof l=="object"&&typeof l.toJSON=="function"&&(l=l.toJSON(s)),typeof rep=="function"&&(l=rep.call(e,s,l)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(gap+=indent,a=[],Object.prototype.toString.apply(l)==="[object Array]"){for(o=l.length,t=0;t<o;t+=1)a[t]=str(t,l)||"null";return n=a.length===0?"[]":gap?`[
|
||
`+gap+a.join(`,
|
||
`+gap)+`
|
||
`+r+"]":"["+a.join(",")+"]",gap=r,n}if(rep&&typeof rep=="object")for(o=rep.length,t=0;t<o;t+=1)typeof rep[t]=="string"&&(i=rep[t],n=str(i,l),n&&a.push(quote(i)+(gap?": ":":")+n));else for(i in l)Object.prototype.hasOwnProperty.call(l,i)&&(n=str(i,l),n&&a.push(quote(i)+(gap?": ":":")+n));return n=a.length===0?"{}":gap?`{
|
||
`+gap+a.join(`,
|
||
`+gap)+`
|
||
`+r+"}":"{"+a.join(",")+"}",gap=r,n}}typeof JSON.stringify!="function"&&(meta={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(s,e,t){var i;if(gap="",indent="",typeof t=="number")for(i=0;i<t;i+=1)indent+=" ";else typeof t=="string"&&(indent=t);if(rep=e,e&&typeof e!="function"&&(typeof e!="object"||typeof e.length!="number"))throw new Error("JSON.stringify");return str("",{"":s})}),typeof JSON.parse!="function"&&(JSON.parse=function(text,reviver){var j;function walk(s,e){var t,i,n=s[e];if(n&&typeof n=="object")for(t in n)Object.prototype.hasOwnProperty.call(n,t)&&(i=walk(n,t),i!==void 0?n[t]=i:delete n[t]);return reviver.call(s,e,n)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(s){return"\\u"+("0000"+s.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),typeof reviver=="function"?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}()),json2$1}var json2=json2Plugin;function json2Plugin(){return requireJson2(),{}}var engine=storeEngine,storages=all,plugins=[json2],store_legacy=engine.createStore(storages,plugins);const store$1=getDefaultExportFromCjs(store_legacy);var util=util$7,bind$1=util.bind,each$2=util.each,create=util.create,slice$1=util.slice,events=eventsPlugin$1;function eventsPlugin$1(){var s=_newPubSub();return{watch:e,unwatch:t,once:i,set:n,remove:o,clearAll:r};function e(a,l,d){return s.on(l,bind$1(this,d))}function t(a,l){s.off(l)}function i(a,l,d){s.once(l,bind$1(this,d))}function n(a,l,d){var h=this.get(l);a(),s.fire(l,d,h)}function o(a,l){var d=this.get(l);a(),s.fire(l,void 0,d)}function r(a){var l={};this.each(function(d,h){l[h]=d}),a(),each$2(l,function(d,h){s.fire(h,void 0,d)})}}function _newPubSub(){return create(_pubSubBase,{_id:0,_subSignals:{},_subCallbacks:{}})}var _pubSubBase={_id:null,_subCallbacks:null,_subSignals:null,on:function(s,e){return this._subCallbacks[s]||(this._subCallbacks[s]={}),this._id+=1,this._subCallbacks[s][this._id]=e,this._subSignals[this._id]=s,this._id},off:function(s){var e=this._subSignals[s];delete this._subCallbacks[e][s],delete this._subSignals[s]},once:function(s,e){var t=this.on(s,bind$1(this,function(){e.apply(this,arguments),this.off(t)}))},fire:function(s){var e=slice$1(arguments,1);each$2(this._subCallbacks[s],function(t){t.apply(this,e)})}},eventsPlugin=events,observe=[eventsPlugin,observePlugin];function observePlugin(){return{observe:s,unobserve:e};function s(t,i,n){var o=this.watch(i,n);return n(this.get(i)),o}function e(t,i){this.unwatch(i)}}const observePlugin$1=getDefaultExportFromCjs(observe);var flushPending=!1,flushing=!1,queue=[],lastFlushedIndex=-1;function scheduler(s){queueJob(s)}function queueJob(s){queue.includes(s)||queue.push(s),queueFlush()}function dequeueJob(s){let e=queue.indexOf(s);e!==-1&&e>lastFlushedIndex&&queue.splice(e,1)}function queueFlush(){!flushing&&!flushPending&&(flushPending=!0,queueMicrotask(flushJobs))}function flushJobs(){flushPending=!1,flushing=!0;for(let s=0;s<queue.length;s++)queue[s](),lastFlushedIndex=s;queue.length=0,lastFlushedIndex=-1,flushing=!1}var reactive,effect$3,release,raw,shouldSchedule=!0;function disableEffectScheduling(s){shouldSchedule=!1,s(),shouldSchedule=!0}function setReactivityEngine(s){reactive=s.reactive,release=s.release,effect$3=e=>s.effect(e,{scheduler:t=>{shouldSchedule?scheduler(t):t()}}),raw=s.raw}function overrideEffect(s){effect$3=s}function elementBoundEffect(s){let e=()=>{};return[i=>{let n=effect$3(i);return s._x_effects||(s._x_effects=new Set,s._x_runEffects=()=>{s._x_effects.forEach(o=>o())}),s._x_effects.add(n),e=()=>{n!==void 0&&(s._x_effects.delete(n),release(n))},n},()=>{e()}]}function watch(s,e){let t=!0,i,n=effect$3(()=>{let o=s();JSON.stringify(o),t?i=o:queueMicrotask(()=>{e(o,i),i=o}),t=!1});return()=>release(n)}function dispatch(s,e,t={}){s.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0,cancelable:!0}))}function walk(s,e){if(typeof ShadowRoot=="function"&&s instanceof ShadowRoot){Array.from(s.children).forEach(n=>walk(n,e));return}let t=!1;if(e(s,()=>t=!0),t)return;let i=s.firstElementChild;for(;i;)walk(i,e),i=i.nextElementSibling}function warn(s,...e){console.warn(`Alpine Warning: ${s}`,...e)}var started=!1;function start$1(){started&&warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),started=!0,document.body||warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),dispatch(document,"alpine:init"),dispatch(document,"alpine:initializing"),startObservingMutations(),onElAdded(e=>initTree(e,walk)),onElRemoved(e=>destroyTree(e)),onAttributesAdded((e,t)=>{directives(e,t).forEach(i=>i())});let s=e=>!closestRoot(e.parentElement,!0);Array.from(document.querySelectorAll(allSelectors().join(","))).filter(s).forEach(e=>{initTree(e)}),dispatch(document,"alpine:initialized")}var rootSelectorCallbacks=[],initSelectorCallbacks=[];function rootSelectors(){return rootSelectorCallbacks.map(s=>s())}function allSelectors(){return rootSelectorCallbacks.concat(initSelectorCallbacks).map(s=>s())}function addRootSelector(s){rootSelectorCallbacks.push(s)}function addInitSelector(s){initSelectorCallbacks.push(s)}function closestRoot(s,e=!1){return findClosest(s,t=>{if((e?allSelectors():rootSelectors()).some(n=>t.matches(n)))return!0})}function findClosest(s,e){if(s){if(e(s))return s;if(s._x_teleportBack&&(s=s._x_teleportBack),!!s.parentElement)return findClosest(s.parentElement,e)}}function isRoot(s){return rootSelectors().some(e=>s.matches(e))}var initInterceptors=[];function interceptInit(s){initInterceptors.push(s)}function initTree(s,e=walk,t=()=>{}){deferHandlingDirectives(()=>{e(s,(i,n)=>{t(i,n),initInterceptors.forEach(o=>o(i,n)),directives(i,i.attributes).forEach(o=>o()),i._x_ignore&&n()})})}function destroyTree(s){walk(s,e=>{cleanupAttributes(e),cleanupElement(e)})}var onAttributeAddeds=[],onElRemoveds=[],onElAddeds=[];function onElAdded(s){onElAddeds.push(s)}function onElRemoved(s,e){typeof e=="function"?(s._x_cleanups||(s._x_cleanups=[]),s._x_cleanups.push(e)):(e=s,onElRemoveds.push(e))}function onAttributesAdded(s){onAttributeAddeds.push(s)}function onAttributeRemoved(s,e,t){s._x_attributeCleanups||(s._x_attributeCleanups={}),s._x_attributeCleanups[e]||(s._x_attributeCleanups[e]=[]),s._x_attributeCleanups[e].push(t)}function cleanupAttributes(s,e){s._x_attributeCleanups&&Object.entries(s._x_attributeCleanups).forEach(([t,i])=>{(e===void 0||e.includes(t))&&(i.forEach(n=>n()),delete s._x_attributeCleanups[t])})}function cleanupElement(s){if(s._x_cleanups)for(;s._x_cleanups.length;)s._x_cleanups.pop()()}var observer=new MutationObserver(onMutate),currentlyObserving=!1;function startObservingMutations(){observer.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),currentlyObserving=!0}function stopObservingMutations(){flushObserver(),observer.disconnect(),currentlyObserving=!1}var queuedMutations=[];function flushObserver(){let s=observer.takeRecords();queuedMutations.push(()=>s.length>0&&onMutate(s));let e=queuedMutations.length;queueMicrotask(()=>{if(queuedMutations.length===e)for(;queuedMutations.length>0;)queuedMutations.shift()()})}function mutateDom(s){if(!currentlyObserving)return s();stopObservingMutations();let e=s();return startObservingMutations(),e}var isCollecting=!1,deferredMutations=[];function deferMutations(){isCollecting=!0}function flushAndStopDeferringMutations(){isCollecting=!1,onMutate(deferredMutations),deferredMutations=[]}function onMutate(s){if(isCollecting){deferredMutations=deferredMutations.concat(s);return}let e=new Set,t=new Set,i=new Map,n=new Map;for(let o=0;o<s.length;o++)if(!s[o].target._x_ignoreMutationObserver&&(s[o].type==="childList"&&(s[o].addedNodes.forEach(r=>r.nodeType===1&&e.add(r)),s[o].removedNodes.forEach(r=>r.nodeType===1&&t.add(r))),s[o].type==="attributes")){let r=s[o].target,a=s[o].attributeName,l=s[o].oldValue,d=()=>{i.has(r)||i.set(r,[]),i.get(r).push({name:a,value:r.getAttribute(a)})},h=()=>{n.has(r)||n.set(r,[]),n.get(r).push(a)};r.hasAttribute(a)&&l===null?d():r.hasAttribute(a)?(h(),d()):h()}n.forEach((o,r)=>{cleanupAttributes(r,o)}),i.forEach((o,r)=>{onAttributeAddeds.forEach(a=>a(r,o))});for(let o of t)e.has(o)||(onElRemoveds.forEach(r=>r(o)),destroyTree(o));e.forEach(o=>{o._x_ignoreSelf=!0,o._x_ignore=!0});for(let o of e)t.has(o)||o.isConnected&&(delete o._x_ignoreSelf,delete o._x_ignore,onElAddeds.forEach(r=>r(o)),o._x_ignore=!0,o._x_ignoreSelf=!0);e.forEach(o=>{delete o._x_ignoreSelf,delete o._x_ignore}),e=null,t=null,i=null,n=null}function scope(s){return mergeProxies(closestDataStack(s))}function addScopeToNode(s,e,t){return s._x_dataStack=[e,...closestDataStack(t||s)],()=>{s._x_dataStack=s._x_dataStack.filter(i=>i!==e)}}function closestDataStack(s){return s._x_dataStack?s._x_dataStack:typeof ShadowRoot=="function"&&s instanceof ShadowRoot?closestDataStack(s.host):s.parentNode?closestDataStack(s.parentNode):[]}function mergeProxies(s){return new Proxy({objects:s},mergeProxyTrap)}var mergeProxyTrap={ownKeys({objects:s}){return Array.from(new Set(s.flatMap(e=>Object.keys(e))))},has({objects:s},e){return e==Symbol.unscopables?!1:s.some(t=>Object.prototype.hasOwnProperty.call(t,e))},get({objects:s},e,t){return e=="toJSON"?collapseProxies:Reflect.get(s.find(i=>Object.prototype.hasOwnProperty.call(i,e))||{},e,t)},set({objects:s},e,t,i){const n=s.find(r=>Object.prototype.hasOwnProperty.call(r,e))||s[s.length-1],o=Object.getOwnPropertyDescriptor(n,e);return o!=null&&o.set&&(o!=null&&o.get)?Reflect.set(n,e,t,i):Reflect.set(n,e,t)}};function collapseProxies(){return Reflect.ownKeys(this).reduce((e,t)=>(e[t]=Reflect.get(this,t),e),{})}function initInterceptors2(s){let e=i=>typeof i=="object"&&!Array.isArray(i)&&i!==null,t=(i,n="")=>{Object.entries(Object.getOwnPropertyDescriptors(i)).forEach(([o,{value:r,enumerable:a}])=>{if(a===!1||r===void 0)return;let l=n===""?o:`${n}.${o}`;typeof r=="object"&&r!==null&&r._x_interceptor?i[o]=r.initialize(s,l,o):e(r)&&r!==i&&!(r instanceof Element)&&t(r,l)})};return t(s)}function interceptor(s,e=()=>{}){let t={initialValue:void 0,_x_interceptor:!0,initialize(i,n,o){return s(this.initialValue,()=>get$1(i,n),r=>set$1(i,n,r),n,o)}};return e(t),i=>{if(typeof i=="object"&&i!==null&&i._x_interceptor){let n=t.initialize.bind(t);t.initialize=(o,r,a)=>{let l=i.initialize(o,r,a);return t.initialValue=l,n(o,r,a)}}else t.initialValue=i;return t}}function get$1(s,e){return e.split(".").reduce((t,i)=>t[i],s)}function set$1(s,e,t){if(typeof e=="string"&&(e=e.split(".")),e.length===1)s[e[0]]=t;else{if(e.length===0)throw error;return s[e[0]]||(s[e[0]]={}),set$1(s[e[0]],e.slice(1),t)}}var magics={};function magic(s,e){magics[s]=e}function injectMagics(s,e){return Object.entries(magics).forEach(([t,i])=>{let n=null;function o(){if(n)return n;{let[r,a]=getElementBoundUtilities(e);return n={interceptor,...r},onElRemoved(e,a),n}}Object.defineProperty(s,`$${t}`,{get(){return i(e,o())},enumerable:!1})}),s}function tryCatch(s,e,t,...i){try{return t(...i)}catch(n){handleError(n,s,e)}}function handleError(s,e,t=void 0){s=Object.assign(s??{message:"No error message given."},{el:e,expression:t}),console.warn(`Alpine Expression Error: ${s.message}
|
||
|
||
${t?'Expression: "'+t+`"
|
||
|
||
`:""}`,e),setTimeout(()=>{throw s},0)}var shouldAutoEvaluateFunctions=!0;function dontAutoEvaluateFunctions(s){let e=shouldAutoEvaluateFunctions;shouldAutoEvaluateFunctions=!1;let t=s();return shouldAutoEvaluateFunctions=e,t}function evaluate(s,e,t={}){let i;return evaluateLater(s,e)(n=>i=n,t),i}function evaluateLater(...s){return theEvaluatorFunction(...s)}var theEvaluatorFunction=normalEvaluator;function setEvaluator(s){theEvaluatorFunction=s}function normalEvaluator(s,e){let t={};injectMagics(t,s);let i=[t,...closestDataStack(s)],n=typeof e=="function"?generateEvaluatorFromFunction(i,e):generateEvaluatorFromString(i,e,s);return tryCatch.bind(null,s,e,n)}function generateEvaluatorFromFunction(s,e){return(t=()=>{},{scope:i={},params:n=[]}={})=>{let o=e.apply(mergeProxies([i,...s]),n);runIfTypeOfFunction(t,o)}}var evaluatorMemo={};function generateFunctionFromString(s,e){if(evaluatorMemo[s])return evaluatorMemo[s];let t=Object.getPrototypeOf(async function(){}).constructor,i=/^[\n\s]*if.*\(.*\)/.test(s.trim())||/^(let|const)\s/.test(s.trim())?`(async()=>{ ${s} })()`:s,o=(()=>{try{let r=new t(["__self","scope"],`with (scope) { __self.result = ${i} }; __self.finished = true; return __self.result;`);return Object.defineProperty(r,"name",{value:`[Alpine] ${s}`}),r}catch(r){return handleError(r,e,s),Promise.resolve()}})();return evaluatorMemo[s]=o,o}function generateEvaluatorFromString(s,e,t){let i=generateFunctionFromString(e,t);return(n=()=>{},{scope:o={},params:r=[]}={})=>{i.result=void 0,i.finished=!1;let a=mergeProxies([o,...s]);if(typeof i=="function"){let l=i(i,a).catch(d=>handleError(d,t,e));i.finished?(runIfTypeOfFunction(n,i.result,a,r,t),i.result=void 0):l.then(d=>{runIfTypeOfFunction(n,d,a,r,t)}).catch(d=>handleError(d,t,e)).finally(()=>i.result=void 0)}}}function runIfTypeOfFunction(s,e,t,i,n){if(shouldAutoEvaluateFunctions&&typeof e=="function"){let o=e.apply(t,i);o instanceof Promise?o.then(r=>runIfTypeOfFunction(s,r,t,i)).catch(r=>handleError(r,n,e)):s(o)}else typeof e=="object"&&e instanceof Promise?e.then(o=>s(o)):s(e)}var prefixAsString="x-";function prefix(s=""){return prefixAsString+s}function setPrefix(s){prefixAsString=s}var directiveHandlers={};function directive(s,e){return directiveHandlers[s]=e,{before(t){if(!directiveHandlers[t]){console.warn(String.raw`Cannot find directive \`${t}\`. \`${s}\` will use the default order of execution`);return}const i=directiveOrder.indexOf(t);directiveOrder.splice(i>=0?i:directiveOrder.indexOf("DEFAULT"),0,s)}}}function directives(s,e,t){if(e=Array.from(e),s._x_virtualDirectives){let o=Object.entries(s._x_virtualDirectives).map(([a,l])=>({name:a,value:l})),r=attributesOnly(o);o=o.map(a=>r.find(l=>l.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),e=e.concat(o)}let i={};return e.map(toTransformedAttributes((o,r)=>i[o]=r)).filter(outNonAlpineAttributes).map(toParsedDirectives(i,t)).sort(byPriority).map(o=>getDirectiveHandler(s,o))}function attributesOnly(s){return Array.from(s).map(toTransformedAttributes()).filter(e=>!outNonAlpineAttributes(e))}var isDeferringHandlers=!1,directiveHandlerStacks=new Map,currentHandlerStackKey=Symbol();function deferHandlingDirectives(s){isDeferringHandlers=!0;let e=Symbol();currentHandlerStackKey=e,directiveHandlerStacks.set(e,[]);let t=()=>{for(;directiveHandlerStacks.get(e).length;)directiveHandlerStacks.get(e).shift()();directiveHandlerStacks.delete(e)},i=()=>{isDeferringHandlers=!1,t()};s(t),i()}function getElementBoundUtilities(s){let e=[],t=a=>e.push(a),[i,n]=elementBoundEffect(s);return e.push(n),[{Alpine:alpine_default,effect:i,cleanup:t,evaluateLater:evaluateLater.bind(evaluateLater,s),evaluate:evaluate.bind(evaluate,s)},()=>e.forEach(a=>a())]}function getDirectiveHandler(s,e){let t=()=>{},i=directiveHandlers[e.type]||t,[n,o]=getElementBoundUtilities(s);onAttributeRemoved(s,e.original,o);let r=()=>{s._x_ignore||s._x_ignoreSelf||(i.inline&&i.inline(s,e,n),i=i.bind(i,s,e,n),isDeferringHandlers?directiveHandlerStacks.get(currentHandlerStackKey).push(i):i())};return r.runCleanups=o,r}var startingWith=(s,e)=>({name:t,value:i})=>(t.startsWith(s)&&(t=t.replace(s,e)),{name:t,value:i}),into=s=>s;function toTransformedAttributes(s=()=>{}){return({name:e,value:t})=>{let{name:i,value:n}=attributeTransformers.reduce((o,r)=>r(o),{name:e,value:t});return i!==e&&s(i,e),{name:i,value:n}}}var attributeTransformers=[];function mapAttributes(s){attributeTransformers.push(s)}function outNonAlpineAttributes({name:s}){return alpineAttributeRegex().test(s)}var alpineAttributeRegex=()=>new RegExp(`^${prefixAsString}([^:^.]+)\\b`);function toParsedDirectives(s,e){return({name:t,value:i})=>{let n=t.match(alpineAttributeRegex()),o=t.match(/:([a-zA-Z0-9\-_:]+)/),r=t.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=e||s[t]||t;return{type:n?n[1]:null,value:o?o[1]:null,modifiers:r.map(l=>l.replace(".","")),expression:i,original:a}}}var DEFAULT="DEFAULT",directiveOrder=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",DEFAULT,"teleport"];function byPriority(s,e){let t=directiveOrder.indexOf(s.type)===-1?DEFAULT:s.type,i=directiveOrder.indexOf(e.type)===-1?DEFAULT:e.type;return directiveOrder.indexOf(t)-directiveOrder.indexOf(i)}var tickStack=[],isHolding=!1;function nextTick(s=()=>{}){return queueMicrotask(()=>{isHolding||setTimeout(()=>{releaseNextTicks()})}),new Promise(e=>{tickStack.push(()=>{s(),e()})})}function releaseNextTicks(){for(isHolding=!1;tickStack.length;)tickStack.shift()()}function holdNextTicks(){isHolding=!0}function setClasses(s,e){return Array.isArray(e)?setClassesFromString(s,e.join(" ")):typeof e=="object"&&e!==null?setClassesFromObject(s,e):typeof e=="function"?setClasses(s,e()):setClassesFromString(s,e)}function setClassesFromString(s,e){let t=n=>n.split(" ").filter(o=>!s.classList.contains(o)).filter(Boolean),i=n=>(s.classList.add(...n),()=>{s.classList.remove(...n)});return e=e===!0?e="":e||"",i(t(e))}function setClassesFromObject(s,e){let t=a=>a.split(" ").filter(Boolean),i=Object.entries(e).flatMap(([a,l])=>l?t(a):!1).filter(Boolean),n=Object.entries(e).flatMap(([a,l])=>l?!1:t(a)).filter(Boolean),o=[],r=[];return n.forEach(a=>{s.classList.contains(a)&&(s.classList.remove(a),r.push(a))}),i.forEach(a=>{s.classList.contains(a)||(s.classList.add(a),o.push(a))}),()=>{r.forEach(a=>s.classList.add(a)),o.forEach(a=>s.classList.remove(a))}}function setStyles(s,e){return typeof e=="object"&&e!==null?setStylesFromObject(s,e):setStylesFromString(s,e)}function setStylesFromObject(s,e){let t={};return Object.entries(e).forEach(([i,n])=>{t[i]=s.style[i],i.startsWith("--")||(i=kebabCase(i)),s.style.setProperty(i,n)}),setTimeout(()=>{s.style.length===0&&s.removeAttribute("style")}),()=>{setStyles(s,t)}}function setStylesFromString(s,e){let t=s.getAttribute("style",e);return s.setAttribute("style",e),()=>{s.setAttribute("style",t||"")}}function kebabCase(s){return s.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function once(s,e=()=>{}){let t=!1;return function(){t?e.apply(this,arguments):(t=!0,s.apply(this,arguments))}}directive("transition",(s,{value:e,modifiers:t,expression:i},{evaluate:n})=>{typeof i=="function"&&(i=n(i)),i!==!1&&(!i||typeof i=="boolean"?registerTransitionsFromHelper(s,t,e):registerTransitionsFromClassString(s,i,e))});function registerTransitionsFromClassString(s,e,t){registerTransitionObject(s,setClasses,""),{enter:n=>{s._x_transition.enter.during=n},"enter-start":n=>{s._x_transition.enter.start=n},"enter-end":n=>{s._x_transition.enter.end=n},leave:n=>{s._x_transition.leave.during=n},"leave-start":n=>{s._x_transition.leave.start=n},"leave-end":n=>{s._x_transition.leave.end=n}}[t](e)}function registerTransitionsFromHelper(s,e,t){registerTransitionObject(s,setStyles);let i=!e.includes("in")&&!e.includes("out")&&!t,n=i||e.includes("in")||["enter"].includes(t),o=i||e.includes("out")||["leave"].includes(t);e.includes("in")&&!i&&(e=e.filter((E,T)=>T<e.indexOf("out"))),e.includes("out")&&!i&&(e=e.filter((E,T)=>T>e.indexOf("out")));let r=!e.includes("opacity")&&!e.includes("scale"),a=r||e.includes("opacity"),l=r||e.includes("scale"),d=a?0:1,h=l?modifierValue(e,"scale",95)/100:1,p=modifierValue(e,"delay",0)/1e3,m=modifierValue(e,"origin","center"),v="opacity, transform",y=modifierValue(e,"duration",150)/1e3,b=modifierValue(e,"duration",75)/1e3,S="cubic-bezier(0.4, 0.0, 0.2, 1)";n&&(s._x_transition.enter.during={transformOrigin:m,transitionDelay:`${p}s`,transitionProperty:v,transitionDuration:`${y}s`,transitionTimingFunction:S},s._x_transition.enter.start={opacity:d,transform:`scale(${h})`},s._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(s._x_transition.leave.during={transformOrigin:m,transitionDelay:`${p}s`,transitionProperty:v,transitionDuration:`${b}s`,transitionTimingFunction:S},s._x_transition.leave.start={opacity:1,transform:"scale(1)"},s._x_transition.leave.end={opacity:d,transform:`scale(${h})`})}function registerTransitionObject(s,e,t={}){s._x_transition||(s._x_transition={enter:{during:t,start:t,end:t},leave:{during:t,start:t,end:t},in(i=()=>{},n=()=>{}){transition(s,e,{during:this.enter.during,start:this.enter.start,end:this.enter.end},i,n)},out(i=()=>{},n=()=>{}){transition(s,e,{during:this.leave.during,start:this.leave.start,end:this.leave.end},i,n)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(s,e,t,i){const n=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let o=()=>n(t);if(e){s._x_transition&&(s._x_transition.enter||s._x_transition.leave)?s._x_transition.enter&&(Object.entries(s._x_transition.enter.during).length||Object.entries(s._x_transition.enter.start).length||Object.entries(s._x_transition.enter.end).length)?s._x_transition.in(t):o():s._x_transition?s._x_transition.in(t):o();return}s._x_hidePromise=s._x_transition?new Promise((r,a)=>{s._x_transition.out(()=>{},()=>r(i)),s._x_transitioning&&s._x_transitioning.beforeCancel(()=>a({isFromCancelledTransition:!0}))}):Promise.resolve(i),queueMicrotask(()=>{let r=closestHide(s);r?(r._x_hideChildren||(r._x_hideChildren=[]),r._x_hideChildren.push(s)):n(()=>{let a=l=>{let d=Promise.all([l._x_hidePromise,...(l._x_hideChildren||[]).map(a)]).then(([h])=>h());return delete l._x_hidePromise,delete l._x_hideChildren,d};a(s).catch(l=>{if(!l.isFromCancelledTransition)throw l})})})};function closestHide(s){let e=s.parentNode;if(e)return e._x_hidePromise?e:closestHide(e)}function transition(s,e,{during:t,start:i,end:n}={},o=()=>{},r=()=>{}){if(s._x_transitioning&&s._x_transitioning.cancel(),Object.keys(t).length===0&&Object.keys(i).length===0&&Object.keys(n).length===0){o(),r();return}let a,l,d;performTransition(s,{start(){a=e(s,i)},during(){l=e(s,t)},before:o,end(){a(),d=e(s,n)},after:r,cleanup(){l(),d()}})}function performTransition(s,e){let t,i,n,o=once(()=>{mutateDom(()=>{t=!0,i||e.before(),n||(e.end(),releaseNextTicks()),e.after(),s.isConnected&&e.cleanup(),delete s._x_transitioning})});s._x_transitioning={beforeCancels:[],beforeCancel(r){this.beforeCancels.push(r)},cancel:once(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},mutateDom(()=>{e.start(),e.during()}),holdNextTicks(),requestAnimationFrame(()=>{if(t)return;let r=Number(getComputedStyle(s).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(s).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;r===0&&(r=Number(getComputedStyle(s).animationDuration.replace("s",""))*1e3),mutateDom(()=>{e.before()}),i=!0,requestAnimationFrame(()=>{t||(mutateDom(()=>{e.end()}),releaseNextTicks(),setTimeout(s._x_transitioning.finish,r+a),n=!0)})})}function modifierValue(s,e,t){if(s.indexOf(e)===-1)return t;const i=s[s.indexOf(e)+1];if(!i||e==="scale"&&isNaN(i))return t;if(e==="duration"||e==="delay"){let n=i.match(/([0-9]+)ms/);if(n)return n[1]}return e==="origin"&&["top","right","left","center","bottom"].includes(s[s.indexOf(e)+2])?[i,s[s.indexOf(e)+2]].join(" "):i}var isCloning=!1;function skipDuringClone(s,e=()=>{}){return(...t)=>isCloning?e(...t):s(...t)}function onlyDuringClone(s){return(...e)=>isCloning&&s(...e)}var interceptors=[];function interceptClone(s){interceptors.push(s)}function cloneNode(s,e){interceptors.forEach(t=>t(s,e)),isCloning=!0,dontRegisterReactiveSideEffects(()=>{initTree(e,(t,i)=>{i(t,()=>{})})}),isCloning=!1}var isCloningLegacy=!1;function clone$2(s,e){e._x_dataStack||(e._x_dataStack=s._x_dataStack),isCloning=!0,isCloningLegacy=!0,dontRegisterReactiveSideEffects(()=>{cloneTree(e)}),isCloning=!1,isCloningLegacy=!1}function cloneTree(s){let e=!1;initTree(s,(i,n)=>{walk(i,(o,r)=>{if(e&&isRoot(o))return r();e=!0,n(o,r)})})}function dontRegisterReactiveSideEffects(s){let e=effect$3;overrideEffect((t,i)=>{let n=e(t);return release(n),()=>{}}),s(),overrideEffect(e)}function bind(s,e,t,i=[]){switch(s._x_bindings||(s._x_bindings=reactive({})),s._x_bindings[e]=t,e=i.includes("camel")?camelCase(e):e,e){case"value":bindInputValue(s,t);break;case"style":bindStyles(s,t);break;case"class":bindClasses(s,t);break;case"selected":case"checked":bindAttributeAndProperty(s,e,t);break;default:bindAttribute(s,e,t);break}}function bindInputValue(s,e){if(s.type==="radio")s.attributes.value===void 0&&(s.value=e),window.fromModel&&(typeof e=="boolean"?s.checked=safeParseBoolean(s.value)===e:s.checked=checkedAttrLooseCompare(s.value,e));else if(s.type==="checkbox")Number.isInteger(e)?s.value=e:!Array.isArray(e)&&typeof e!="boolean"&&![null,void 0].includes(e)?s.value=String(e):Array.isArray(e)?s.checked=e.some(t=>checkedAttrLooseCompare(t,s.value)):s.checked=!!e;else if(s.tagName==="SELECT")updateSelect(s,e);else{if(s.value===e)return;s.value=e===void 0?"":e}}function bindClasses(s,e){s._x_undoAddedClasses&&s._x_undoAddedClasses(),s._x_undoAddedClasses=setClasses(s,e)}function bindStyles(s,e){s._x_undoAddedStyles&&s._x_undoAddedStyles(),s._x_undoAddedStyles=setStyles(s,e)}function bindAttributeAndProperty(s,e,t){bindAttribute(s,e,t),setPropertyIfChanged(s,e,t)}function bindAttribute(s,e,t){[null,void 0,!1].includes(t)&&attributeShouldntBePreservedIfFalsy(e)?s.removeAttribute(e):(isBooleanAttr(e)&&(t=e),setIfChanged(s,e,t))}function setIfChanged(s,e,t){s.getAttribute(e)!=t&&s.setAttribute(e,t)}function setPropertyIfChanged(s,e,t){s[e]!==t&&(s[e]=t)}function updateSelect(s,e){const t=[].concat(e).map(i=>i+"");Array.from(s.options).forEach(i=>{i.selected=t.includes(i.value)})}function camelCase(s){return s.toLowerCase().replace(/-(\w)/g,(e,t)=>t.toUpperCase())}function checkedAttrLooseCompare(s,e){return s==e}function safeParseBoolean(s){return[1,"1","true","on","yes",!0].includes(s)?!0:[0,"0","false","off","no",!1].includes(s)?!1:s?!!s:null}function isBooleanAttr(s){return["disabled","checked","required","readonly","hidden","open","selected","autofocus","itemscope","multiple","novalidate","allowfullscreen","allowpaymentrequest","formnovalidate","autoplay","controls","loop","muted","playsinline","default","ismap","reversed","async","defer","nomodule"].includes(s)}function attributeShouldntBePreservedIfFalsy(s){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(s)}function getBinding(s,e,t){return s._x_bindings&&s._x_bindings[e]!==void 0?s._x_bindings[e]:getAttributeBinding(s,e,t)}function extractProp(s,e,t,i=!0){if(s._x_bindings&&s._x_bindings[e]!==void 0)return s._x_bindings[e];if(s._x_inlineBindings&&s._x_inlineBindings[e]!==void 0){let n=s._x_inlineBindings[e];return n.extract=i,dontAutoEvaluateFunctions(()=>evaluate(s,n.expression))}return getAttributeBinding(s,e,t)}function getAttributeBinding(s,e,t){let i=s.getAttribute(e);return i===null?typeof t=="function"?t():t:i===""?!0:isBooleanAttr(e)?!![e,"true"].includes(i):i}function debounce$5(s,e){var t;return function(){var i=this,n=arguments,o=function(){t=null,s.apply(i,n)};clearTimeout(t),t=setTimeout(o,e)}}function throttle$1(s,e){let t;return function(){let i=this,n=arguments;t||(s.apply(i,n),t=!0,setTimeout(()=>t=!1,e))}}function entangle({get:s,set:e},{get:t,set:i}){let n=!0,o,r=effect$3(()=>{let a=s(),l=t();if(n)i(cloneIfObject(a)),n=!1;else{let d=JSON.stringify(a),h=JSON.stringify(l);d!==o?i(cloneIfObject(a)):d!==h&&e(cloneIfObject(l))}o=JSON.stringify(s()),JSON.stringify(t())});return()=>{release(r)}}function cloneIfObject(s){return typeof s=="object"?JSON.parse(JSON.stringify(s)):s}function plugin(s){(Array.isArray(s)?s:[s]).forEach(t=>t(alpine_default))}var stores={},isReactive=!1;function store(s,e){if(isReactive||(stores=reactive(stores),isReactive=!0),e===void 0)return stores[s];stores[s]=e,typeof e=="object"&&e!==null&&e.hasOwnProperty("init")&&typeof e.init=="function"&&stores[s].init(),initInterceptors2(stores[s])}function getStores(){return stores}var binds={};function bind2(s,e){let t=typeof e!="function"?()=>e:e;return s instanceof Element?applyBindingsObject(s,t()):(binds[s]=t,()=>{})}function injectBindingProviders(s){return Object.entries(binds).forEach(([e,t])=>{Object.defineProperty(s,e,{get(){return(...i)=>t(...i)}})}),s}function applyBindingsObject(s,e,t){let i=[];for(;i.length;)i.pop()();let n=Object.entries(e).map(([r,a])=>({name:r,value:a})),o=attributesOnly(n);return n=n.map(r=>o.find(a=>a.name===r.name)?{name:`x-bind:${r.name}`,value:`"${r.value}"`}:r),directives(s,n,t).map(r=>{i.push(r.runCleanups),r()}),()=>{for(;i.length;)i.pop()()}}var datas={};function data(s,e){datas[s]=e}function injectDataProviders(s,e){return Object.entries(datas).forEach(([t,i])=>{Object.defineProperty(s,t,{get(){return(...n)=>i.bind(e)(...n)},enumerable:!1})}),s}var Alpine={get reactive(){return reactive},get release(){return release},get effect(){return effect$3},get raw(){return raw},version:"3.13.5",flushAndStopDeferringMutations,dontAutoEvaluateFunctions,disableEffectScheduling,startObservingMutations,stopObservingMutations,setReactivityEngine,onAttributeRemoved,onAttributesAdded,closestDataStack,skipDuringClone,onlyDuringClone,addRootSelector,addInitSelector,interceptClone,addScopeToNode,deferMutations,mapAttributes,evaluateLater,interceptInit,setEvaluator,mergeProxies,extractProp,findClosest,onElRemoved,closestRoot,destroyTree,interceptor,transition,setStyles,mutateDom,directive,entangle,throttle:throttle$1,debounce:debounce$5,evaluate,initTree,nextTick,prefixed:prefix,prefix:setPrefix,plugin,magic,store,start:start$1,clone:clone$2,cloneNode,bound:getBinding,$data:scope,watch,walk,data,bind:bind2},alpine_default=Alpine;function makeMap(s,e){const t=Object.create(null),i=s.split(",");for(let n=0;n<i.length;n++)t[i[n]]=!0;return e?n=>!!t[n.toLowerCase()]:n=>!!t[n]}var EMPTY_OBJ=Object.freeze({}),hasOwnProperty=Object.prototype.hasOwnProperty,hasOwn=(s,e)=>hasOwnProperty.call(s,e),isArray$1=Array.isArray,isMap=s=>toTypeString(s)==="[object Map]",isString=s=>typeof s=="string",isSymbol=s=>typeof s=="symbol",isObject$1=s=>s!==null&&typeof s=="object",objectToString=Object.prototype.toString,toTypeString=s=>objectToString.call(s),toRawType=s=>toTypeString(s).slice(8,-1),isIntegerKey=s=>isString(s)&&s!=="NaN"&&s[0]!=="-"&&""+parseInt(s,10)===s,cacheStringFunction=s=>{const e=Object.create(null);return t=>e[t]||(e[t]=s(t))},capitalize$1=cacheStringFunction(s=>s.charAt(0).toUpperCase()+s.slice(1)),hasChanged=(s,e)=>s!==e&&(s===s||e===e),targetMap=new WeakMap,effectStack=[],activeEffect,ITERATE_KEY=Symbol("iterate"),MAP_KEY_ITERATE_KEY=Symbol("Map key iterate");function isEffect(s){return s&&s._isEffect===!0}function effect2(s,e=EMPTY_OBJ){isEffect(s)&&(s=s.raw);const t=createReactiveEffect(s,e);return e.lazy||t(),t}function stop(s){s.active&&(cleanup(s),s.options.onStop&&s.options.onStop(),s.active=!1)}var uid$1=0;function createReactiveEffect(s,e){const t=function(){if(!t.active)return s();if(!effectStack.includes(t)){cleanup(t);try{return enableTracking(),effectStack.push(t),activeEffect=t,s()}finally{effectStack.pop(),resetTracking(),activeEffect=effectStack[effectStack.length-1]}}};return t.id=uid$1++,t.allowRecurse=!!e.allowRecurse,t._isEffect=!0,t.active=!0,t.raw=s,t.deps=[],t.options=e,t}function cleanup(s){const{deps:e}=s;if(e.length){for(let t=0;t<e.length;t++)e[t].delete(s);e.length=0}}var shouldTrack=!0,trackStack=[];function pauseTracking(){trackStack.push(shouldTrack),shouldTrack=!1}function enableTracking(){trackStack.push(shouldTrack),shouldTrack=!0}function resetTracking(){const s=trackStack.pop();shouldTrack=s===void 0?!0:s}function track(s,e,t){if(!shouldTrack||activeEffect===void 0)return;let i=targetMap.get(s);i||targetMap.set(s,i=new Map);let n=i.get(t);n||i.set(t,n=new Set),n.has(activeEffect)||(n.add(activeEffect),activeEffect.deps.push(n),activeEffect.options.onTrack&&activeEffect.options.onTrack({effect:activeEffect,target:s,type:e,key:t}))}function trigger(s,e,t,i,n,o){const r=targetMap.get(s);if(!r)return;const a=new Set,l=h=>{h&&h.forEach(p=>{(p!==activeEffect||p.allowRecurse)&&a.add(p)})};if(e==="clear")r.forEach(l);else if(t==="length"&&isArray$1(s))r.forEach((h,p)=>{(p==="length"||p>=i)&&l(h)});else switch(t!==void 0&&l(r.get(t)),e){case"add":isArray$1(s)?isIntegerKey(t)&&l(r.get("length")):(l(r.get(ITERATE_KEY)),isMap(s)&&l(r.get(MAP_KEY_ITERATE_KEY)));break;case"delete":isArray$1(s)||(l(r.get(ITERATE_KEY)),isMap(s)&&l(r.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap(s)&&l(r.get(ITERATE_KEY));break}const d=h=>{h.options.onTrigger&&h.options.onTrigger({effect:h,target:s,key:t,type:e,newValue:i,oldValue:n,oldTarget:o}),h.options.scheduler?h.options.scheduler(h):h()};a.forEach(d)}var isNonTrackableKeys=makeMap("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).map(s=>Symbol[s]).filter(isSymbol)),get2=createGetter(),readonlyGet=createGetter(!0),arrayInstrumentations=createArrayInstrumentations();function createArrayInstrumentations(){const s={};return["includes","indexOf","lastIndexOf"].forEach(e=>{s[e]=function(...t){const i=toRaw(this);for(let o=0,r=this.length;o<r;o++)track(i,"get",o+"");const n=i[e](...t);return n===-1||n===!1?i[e](...t.map(toRaw)):n}}),["push","pop","shift","unshift","splice"].forEach(e=>{s[e]=function(...t){pauseTracking();const i=toRaw(this)[e].apply(this,t);return resetTracking(),i}}),s}function createGetter(s=!1,e=!1){return function(i,n,o){if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_raw"&&o===(s?e?shallowReadonlyMap:readonlyMap:e?shallowReactiveMap:reactiveMap).get(i))return i;const r=isArray$1(i);if(!s&&r&&hasOwn(arrayInstrumentations,n))return Reflect.get(arrayInstrumentations,n,o);const a=Reflect.get(i,n,o);return(isSymbol(n)?builtInSymbols.has(n):isNonTrackableKeys(n))||(s||track(i,"get",n),e)?a:isRef(a)?!r||!isIntegerKey(n)?a.value:a:isObject$1(a)?s?readonly(a):reactive2(a):a}}var set2=createSetter();function createSetter(s=!1){return function(t,i,n,o){let r=t[i];if(!s&&(n=toRaw(n),r=toRaw(r),!isArray$1(t)&&isRef(r)&&!isRef(n)))return r.value=n,!0;const a=isArray$1(t)&&isIntegerKey(i)?Number(i)<t.length:hasOwn(t,i),l=Reflect.set(t,i,n,o);return t===toRaw(o)&&(a?hasChanged(n,r)&&trigger(t,"set",i,n,r):trigger(t,"add",i,n)),l}}function deleteProperty(s,e){const t=hasOwn(s,e),i=s[e],n=Reflect.deleteProperty(s,e);return n&&t&&trigger(s,"delete",e,void 0,i),n}function has(s,e){const t=Reflect.has(s,e);return(!isSymbol(e)||!builtInSymbols.has(e))&&track(s,"has",e),t}function ownKeys$3(s){return track(s,"iterate",isArray$1(s)?"length":ITERATE_KEY),Reflect.ownKeys(s)}var mutableHandlers={get:get2,set:set2,deleteProperty,has,ownKeys:ownKeys$3},readonlyHandlers={get:readonlyGet,set(s,e){return console.warn(`Set operation on key "${String(e)}" failed: target is readonly.`,s),!0},deleteProperty(s,e){return console.warn(`Delete operation on key "${String(e)}" failed: target is readonly.`,s),!0}},toReactive=s=>isObject$1(s)?reactive2(s):s,toReadonly=s=>isObject$1(s)?readonly(s):s,toShallow=s=>s,getProto=s=>Reflect.getPrototypeOf(s);function get$1$1(s,e,t=!1,i=!1){s=s.__v_raw;const n=toRaw(s),o=toRaw(e);e!==o&&!t&&track(n,"get",e),!t&&track(n,"get",o);const{has:r}=getProto(n),a=i?toShallow:t?toReadonly:toReactive;if(r.call(n,e))return a(s.get(e));if(r.call(n,o))return a(s.get(o));s!==n&&s.get(e)}function has$1(s,e=!1){const t=this.__v_raw,i=toRaw(t),n=toRaw(s);return s!==n&&!e&&track(i,"has",s),!e&&track(i,"has",n),s===n?t.has(s):t.has(s)||t.has(n)}function size(s,e=!1){return s=s.__v_raw,!e&&track(toRaw(s),"iterate",ITERATE_KEY),Reflect.get(s,"size",s)}function add(s){s=toRaw(s);const e=toRaw(this);return getProto(e).has.call(e,s)||(e.add(s),trigger(e,"add",s,s)),this}function set$1$1(s,e){e=toRaw(e);const t=toRaw(this),{has:i,get:n}=getProto(t);let o=i.call(t,s);o?checkIdentityKeys(t,i,s):(s=toRaw(s),o=i.call(t,s));const r=n.call(t,s);return t.set(s,e),o?hasChanged(e,r)&&trigger(t,"set",s,e,r):trigger(t,"add",s,e),this}function deleteEntry(s){const e=toRaw(this),{has:t,get:i}=getProto(e);let n=t.call(e,s);n?checkIdentityKeys(e,t,s):(s=toRaw(s),n=t.call(e,s));const o=i?i.call(e,s):void 0,r=e.delete(s);return n&&trigger(e,"delete",s,void 0,o),r}function clear(){const s=toRaw(this),e=s.size!==0,t=isMap(s)?new Map(s):new Set(s),i=s.clear();return e&&trigger(s,"clear",void 0,void 0,t),i}function createForEach(s,e){return function(i,n){const o=this,r=o.__v_raw,a=toRaw(r),l=e?toShallow:s?toReadonly:toReactive;return!s&&track(a,"iterate",ITERATE_KEY),r.forEach((d,h)=>i.call(n,l(d),l(h),o))}}function createIterableMethod(s,e,t){return function(...i){const n=this.__v_raw,o=toRaw(n),r=isMap(o),a=s==="entries"||s===Symbol.iterator&&r,l=s==="keys"&&r,d=n[s](...i),h=t?toShallow:e?toReadonly:toReactive;return!e&&track(o,"iterate",l?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value:p,done:m}=d.next();return m?{value:p,done:m}:{value:a?[h(p[0]),h(p[1])]:h(p),done:m}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(s){return function(...e){{const t=e[0]?`on key "${e[0]}" `:"";console.warn(`${capitalize$1(s)} operation ${t}failed: target is readonly.`,toRaw(this))}return s==="delete"?!1:this}}function createInstrumentations(){const s={get(o){return get$1$1(this,o)},get size(){return size(this)},has:has$1,add,set:set$1$1,delete:deleteEntry,clear,forEach:createForEach(!1,!1)},e={get(o){return get$1$1(this,o,!1,!0)},get size(){return size(this)},has:has$1,add,set:set$1$1,delete:deleteEntry,clear,forEach:createForEach(!1,!0)},t={get(o){return get$1$1(this,o,!0)},get size(){return size(this,!0)},has(o){return has$1.call(this,o,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!1)},i={get(o){return get$1$1(this,o,!0,!0)},get size(){return size(this,!0)},has(o){return has$1.call(this,o,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{s[o]=createIterableMethod(o,!1,!1),t[o]=createIterableMethod(o,!0,!1),e[o]=createIterableMethod(o,!1,!0),i[o]=createIterableMethod(o,!0,!0)}),[s,t,e,i]}var[mutableInstrumentations,readonlyInstrumentations,shallowInstrumentations,shallowReadonlyInstrumentations]=createInstrumentations();function createInstrumentationGetter(s,e){const t=e?s?shallowReadonlyInstrumentations:shallowInstrumentations:s?readonlyInstrumentations:mutableInstrumentations;return(i,n,o)=>n==="__v_isReactive"?!s:n==="__v_isReadonly"?s:n==="__v_raw"?i:Reflect.get(hasOwn(t,n)&&n in i?t:i,n,o)}var mutableCollectionHandlers={get:createInstrumentationGetter(!1,!1)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0,!1)};function checkIdentityKeys(s,e,t){const i=toRaw(t);if(i!==t&&e.call(s,i)){const n=toRawType(s);console.warn(`Reactive ${n} contains both the raw and reactive versions of the same object${n==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function targetTypeMap(s){switch(s){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function getTargetType(s){return s.__v_skip||!Object.isExtensible(s)?0:targetTypeMap(toRawType(s))}function reactive2(s){return s&&s.__v_isReadonly?s:createReactiveObject(s,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function readonly(s){return createReactiveObject(s,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function createReactiveObject(s,e,t,i,n){if(!isObject$1(s))return console.warn(`value cannot be made reactive: ${String(s)}`),s;if(s.__v_raw&&!(e&&s.__v_isReactive))return s;const o=n.get(s);if(o)return o;const r=getTargetType(s);if(r===0)return s;const a=new Proxy(s,r===2?i:t);return n.set(s,a),a}function toRaw(s){return s&&toRaw(s.__v_raw)||s}function isRef(s){return!!(s&&s.__v_isRef===!0)}magic("nextTick",()=>nextTick);magic("dispatch",s=>dispatch.bind(dispatch,s));magic("watch",(s,{evaluateLater:e,cleanup:t})=>(i,n)=>{let o=e(i),a=watch(()=>{let l;return o(d=>l=d),l},n);t(a)});magic("store",getStores);magic("data",s=>scope(s));magic("root",s=>closestRoot(s));magic("refs",s=>(s._x_refs_proxy||(s._x_refs_proxy=mergeProxies(getArrayOfRefObject(s))),s._x_refs_proxy));function getArrayOfRefObject(s){let e=[],t=s;for(;t;)t._x_refs&&e.push(t._x_refs),t=t.parentNode;return e}var globalIdMemo={};function findAndIncrementId(s){return globalIdMemo[s]||(globalIdMemo[s]=0),++globalIdMemo[s]}function closestIdRoot(s,e){return findClosest(s,t=>{if(t._x_ids&&t._x_ids[e])return!0})}function setIdRoot(s,e){s._x_ids||(s._x_ids={}),s._x_ids[e]||(s._x_ids[e]=findAndIncrementId(e))}magic("id",(s,{cleanup:e})=>(t,i=null)=>{let n=`${t}${i?`-${i}`:""}`;return cacheIdByNameOnElement(s,n,e,()=>{let o=closestIdRoot(s,t),r=o?o._x_ids[t]:findAndIncrementId(t);return i?`${t}-${r}-${i}`:`${t}-${r}`})});interceptClone((s,e)=>{s._x_id&&(e._x_id=s._x_id)});function cacheIdByNameOnElement(s,e,t,i){if(s._x_id||(s._x_id={}),s._x_id[e])return s._x_id[e];let n=i();return s._x_id[e]=n,t(()=>{delete s._x_id[e]}),n}magic("el",s=>s);warnMissingPluginMagic("Focus","focus","focus");warnMissingPluginMagic("Persist","persist","persist");function warnMissingPluginMagic(s,e,t){magic(e,i=>warn(`You can't use [$${e}] without first installing the "${s}" plugin here: https://alpinejs.dev/plugins/${t}`,i))}directive("modelable",(s,{expression:e},{effect:t,evaluateLater:i,cleanup:n})=>{let o=i(e),r=()=>{let h;return o(p=>h=p),h},a=i(`${e} = __placeholder`),l=h=>a(()=>{},{scope:{__placeholder:h}}),d=r();l(d),queueMicrotask(()=>{if(!s._x_model)return;s._x_removeModelListeners.default();let h=s._x_model.get,p=s._x_model.set,m=entangle({get(){return h()},set(v){p(v)}},{get(){return r()},set(v){l(v)}});n(m)})});directive("teleport",(s,{modifiers:e,expression:t},{cleanup:i})=>{s.tagName.toLowerCase()!=="template"&&warn("x-teleport can only be used on a <template> tag",s);let n=getTarget(t),o=s.content.cloneNode(!0).firstElementChild;s._x_teleport=o,o._x_teleportBack=s,s.setAttribute("data-teleport-template",!0),o.setAttribute("data-teleport-target",!0),s._x_forwardEvents&&s._x_forwardEvents.forEach(a=>{o.addEventListener(a,l=>{l.stopPropagation(),s.dispatchEvent(new l.constructor(l.type,l))})}),addScopeToNode(o,{},s);let r=(a,l,d)=>{d.includes("prepend")?l.parentNode.insertBefore(a,l):d.includes("append")?l.parentNode.insertBefore(a,l.nextSibling):l.appendChild(a)};mutateDom(()=>{r(o,n,e),initTree(o),o._x_ignore=!0}),s._x_teleportPutBack=()=>{let a=getTarget(t);mutateDom(()=>{r(s._x_teleport,a,e)})},i(()=>o.remove())});var teleportContainerDuringClone=document.createElement("div");function getTarget(s){let e=skipDuringClone(()=>document.querySelector(s),()=>teleportContainerDuringClone)();return e||warn(`Cannot find x-teleport element for selector: "${s}"`),e}var handler=()=>{};handler.inline=(s,{modifiers:e},{cleanup:t})=>{e.includes("self")?s._x_ignoreSelf=!0:s._x_ignore=!0,t(()=>{e.includes("self")?delete s._x_ignoreSelf:delete s._x_ignore})};directive("ignore",handler);directive("effect",skipDuringClone((s,{expression:e},{effect:t})=>{t(evaluateLater(s,e))}));function on(s,e,t,i){let n=s,o=l=>i(l),r={},a=(l,d)=>h=>d(l,h);if(t.includes("dot")&&(e=dotSyntax(e)),t.includes("camel")&&(e=camelCase2(e)),t.includes("passive")&&(r.passive=!0),t.includes("capture")&&(r.capture=!0),t.includes("window")&&(n=window),t.includes("document")&&(n=document),t.includes("debounce")){let l=t[t.indexOf("debounce")+1]||"invalid-wait",d=isNumeric(l.split("ms")[0])?Number(l.split("ms")[0]):250;o=debounce$5(o,d)}if(t.includes("throttle")){let l=t[t.indexOf("throttle")+1]||"invalid-wait",d=isNumeric(l.split("ms")[0])?Number(l.split("ms")[0]):250;o=throttle$1(o,d)}return t.includes("prevent")&&(o=a(o,(l,d)=>{d.preventDefault(),l(d)})),t.includes("stop")&&(o=a(o,(l,d)=>{d.stopPropagation(),l(d)})),t.includes("self")&&(o=a(o,(l,d)=>{d.target===s&&l(d)})),(t.includes("away")||t.includes("outside"))&&(n=document,o=a(o,(l,d)=>{s.contains(d.target)||d.target.isConnected!==!1&&(s.offsetWidth<1&&s.offsetHeight<1||s._x_isShown!==!1&&l(d))})),t.includes("once")&&(o=a(o,(l,d)=>{l(d),n.removeEventListener(e,o,r)})),o=a(o,(l,d)=>{isKeyEvent(e)&&isListeningForASpecificKeyThatHasntBeenPressed(d,t)||l(d)}),n.addEventListener(e,o,r),()=>{n.removeEventListener(e,o,r)}}function dotSyntax(s){return s.replace(/-/g,".")}function camelCase2(s){return s.toLowerCase().replace(/-(\w)/g,(e,t)=>t.toUpperCase())}function isNumeric(s){return!Array.isArray(s)&&!isNaN(s)}function kebabCase2(s){return[" ","_"].includes(s)?s:s.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function isKeyEvent(s){return["keydown","keyup"].includes(s)}function isListeningForASpecificKeyThatHasntBeenPressed(s,e){let t=e.filter(o=>!["window","document","prevent","stop","once","capture"].includes(o));if(t.includes("debounce")){let o=t.indexOf("debounce");t.splice(o,isNumeric((t[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(t.includes("throttle")){let o=t.indexOf("throttle");t.splice(o,isNumeric((t[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(t.length===0||t.length===1&&keyToModifiers(s.key).includes(t[0]))return!1;const n=["ctrl","shift","alt","meta","cmd","super"].filter(o=>t.includes(o));return t=t.filter(o=>!n.includes(o)),!(n.length>0&&n.filter(r=>((r==="cmd"||r==="super")&&(r="meta"),s[`${r}Key`])).length===n.length&&keyToModifiers(s.key).includes(t[0]))}function keyToModifiers(s){if(!s)return[];s=kebabCase2(s);let e={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",equal:"=",minus:"-",underscore:"_"};return e[s]=s,Object.keys(e).map(t=>{if(e[t]===s)return t}).filter(t=>t)}directive("model",(s,{modifiers:e,expression:t},{effect:i,cleanup:n})=>{let o=s;e.includes("parent")&&(o=s.parentNode);let r=evaluateLater(o,t),a;typeof t=="string"?a=evaluateLater(o,`${t} = __placeholder`):typeof t=="function"&&typeof t()=="string"?a=evaluateLater(o,`${t()} = __placeholder`):a=()=>{};let l=()=>{let m;return r(v=>m=v),isGetterSetter(m)?m.get():m},d=m=>{let v;r(y=>v=y),isGetterSetter(v)?v.set(m):a(()=>{},{scope:{__placeholder:m}})};typeof t=="string"&&s.type==="radio"&&mutateDom(()=>{s.hasAttribute("name")||s.setAttribute("name",t)});var h=s.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(s.type)||e.includes("lazy")?"change":"input";let p=isCloning?()=>{}:on(s,h,e,m=>{d(getInputValue(s,e,m,l()))});if(e.includes("fill")&&([void 0,null,""].includes(l())||s.type==="checkbox"&&Array.isArray(l()))&&s.dispatchEvent(new Event(h,{})),s._x_removeModelListeners||(s._x_removeModelListeners={}),s._x_removeModelListeners.default=p,n(()=>s._x_removeModelListeners.default()),s.form){let m=on(s.form,"reset",[],v=>{nextTick(()=>s._x_model&&s._x_model.set(s.value))});n(()=>m())}s._x_model={get(){return l()},set(m){d(m)}},s._x_forceModelUpdate=m=>{m===void 0&&typeof t=="string"&&t.match(/\./)&&(m=""),window.fromModel=!0,mutateDom(()=>bind(s,"value",m)),delete window.fromModel},i(()=>{let m=l();e.includes("unintrusive")&&document.activeElement.isSameNode(s)||s._x_forceModelUpdate(m)})});function getInputValue(s,e,t,i){return mutateDom(()=>{if(t instanceof CustomEvent&&t.detail!==void 0)return t.detail!==null&&t.detail!==void 0?t.detail:t.target.value;if(s.type==="checkbox")if(Array.isArray(i)){let n=null;return e.includes("number")?n=safeParseNumber(t.target.value):e.includes("boolean")?n=safeParseBoolean(t.target.value):n=t.target.value,t.target.checked?i.concat([n]):i.filter(o=>!checkedAttrLooseCompare2(o,n))}else return t.target.checked;else return s.tagName.toLowerCase()==="select"&&s.multiple?e.includes("number")?Array.from(t.target.selectedOptions).map(n=>{let o=n.value||n.text;return safeParseNumber(o)}):e.includes("boolean")?Array.from(t.target.selectedOptions).map(n=>{let o=n.value||n.text;return safeParseBoolean(o)}):Array.from(t.target.selectedOptions).map(n=>n.value||n.text):e.includes("number")?safeParseNumber(t.target.value):e.includes("boolean")?safeParseBoolean(t.target.value):e.includes("trim")?t.target.value.trim():t.target.value})}function safeParseNumber(s){let e=s?parseFloat(s):null;return isNumeric2(e)?e:s}function checkedAttrLooseCompare2(s,e){return s==e}function isNumeric2(s){return!Array.isArray(s)&&!isNaN(s)}function isGetterSetter(s){return s!==null&&typeof s=="object"&&typeof s.get=="function"&&typeof s.set=="function"}directive("cloak",s=>queueMicrotask(()=>mutateDom(()=>s.removeAttribute(prefix("cloak")))));addInitSelector(()=>`[${prefix("init")}]`);directive("init",skipDuringClone((s,{expression:e},{evaluate:t})=>typeof e=="string"?!!e.trim()&&t(e,{},!1):t(e,{},!1)));directive("text",(s,{expression:e},{effect:t,evaluateLater:i})=>{let n=i(e);t(()=>{n(o=>{mutateDom(()=>{s.textContent=o})})})});directive("html",(s,{expression:e},{effect:t,evaluateLater:i})=>{let n=i(e);t(()=>{n(o=>{mutateDom(()=>{s.innerHTML=o,s._x_ignoreSelf=!0,initTree(s),delete s._x_ignoreSelf})})})});mapAttributes(startingWith(":",into(prefix("bind:"))));var handler2=(s,{value:e,modifiers:t,expression:i,original:n},{effect:o})=>{if(!e){let a={};injectBindingProviders(a),evaluateLater(s,i)(d=>{applyBindingsObject(s,d,n)},{scope:a});return}if(e==="key")return storeKeyForXFor(s,i);if(s._x_inlineBindings&&s._x_inlineBindings[e]&&s._x_inlineBindings[e].extract)return;let r=evaluateLater(s,i);o(()=>r(a=>{a===void 0&&typeof i=="string"&&i.match(/\./)&&(a=""),mutateDom(()=>bind(s,e,a,t))}))};handler2.inline=(s,{value:e,modifiers:t,expression:i})=>{e&&(s._x_inlineBindings||(s._x_inlineBindings={}),s._x_inlineBindings[e]={expression:i,extract:!1})};directive("bind",handler2);function storeKeyForXFor(s,e){s._x_keyExpression=e}addRootSelector(()=>`[${prefix("data")}]`);directive("data",(s,{expression:e},{cleanup:t})=>{if(shouldSkipRegisteringDataDuringClone(s))return;e=e===""?"{}":e;let i={};injectMagics(i,s);let n={};injectDataProviders(n,i);let o=evaluate(s,e,{scope:n});(o===void 0||o===!0)&&(o={}),injectMagics(o,s);let r=reactive(o);initInterceptors2(r);let a=addScopeToNode(s,r);r.init&&evaluate(s,r.init),t(()=>{r.destroy&&evaluate(s,r.destroy),a()})});interceptClone((s,e)=>{s._x_dataStack&&(e._x_dataStack=s._x_dataStack,e.setAttribute("data-has-alpine-state",!0))});function shouldSkipRegisteringDataDuringClone(s){return isCloning?isCloningLegacy?!0:s.hasAttribute("data-has-alpine-state"):!1}directive("show",(s,{modifiers:e,expression:t},{effect:i})=>{let n=evaluateLater(s,t);s._x_doHide||(s._x_doHide=()=>{mutateDom(()=>{s.style.setProperty("display","none",e.includes("important")?"important":void 0)})}),s._x_doShow||(s._x_doShow=()=>{mutateDom(()=>{s.style.length===1&&s.style.display==="none"?s.removeAttribute("style"):s.style.removeProperty("display")})});let o=()=>{s._x_doHide(),s._x_isShown=!1},r=()=>{s._x_doShow(),s._x_isShown=!0},a=()=>setTimeout(r),l=once(p=>p?r():o(),p=>{typeof s._x_toggleAndCascadeWithTransitions=="function"?s._x_toggleAndCascadeWithTransitions(s,p,r,o):p?a():o()}),d,h=!0;i(()=>n(p=>{!h&&p===d||(e.includes("immediate")&&(p?a():o()),l(p),d=p,h=!1)}))});directive("for",(s,{expression:e},{effect:t,cleanup:i})=>{let n=parseForExpression(e),o=evaluateLater(s,n.items),r=evaluateLater(s,s._x_keyExpression||"index");s._x_prevKeys=[],s._x_lookup={},t(()=>loop(s,n,o,r)),i(()=>{Object.values(s._x_lookup).forEach(a=>a.remove()),delete s._x_prevKeys,delete s._x_lookup})});function loop(s,e,t,i){let n=r=>typeof r=="object"&&!Array.isArray(r),o=s;t(r=>{isNumeric3(r)&&r>=0&&(r=Array.from(Array(r).keys(),S=>S+1)),r===void 0&&(r=[]);let a=s._x_lookup,l=s._x_prevKeys,d=[],h=[];if(n(r))r=Object.entries(r).map(([S,E])=>{let T=getIterationScopeVariables(e,E,S,r);i(R=>h.push(R),{scope:{index:S,...T}}),d.push(T)});else for(let S=0;S<r.length;S++){let E=getIterationScopeVariables(e,r[S],S,r);i(T=>h.push(T),{scope:{index:S,...E}}),d.push(E)}let p=[],m=[],v=[],y=[];for(let S=0;S<l.length;S++){let E=l[S];h.indexOf(E)===-1&&v.push(E)}l=l.filter(S=>!v.includes(S));let b="template";for(let S=0;S<h.length;S++){let E=h[S],T=l.indexOf(E);if(T===-1)l.splice(S,0,E),p.push([b,S]);else if(T!==S){let R=l.splice(S,1)[0],A=l.splice(T-1,1)[0];l.splice(S,0,A),l.splice(T,0,R),m.push([R,A])}else y.push(E);b=E}for(let S=0;S<v.length;S++){let E=v[S];a[E]._x_effects&&a[E]._x_effects.forEach(dequeueJob),a[E].remove(),a[E]=null,delete a[E]}for(let S=0;S<m.length;S++){let[E,T]=m[S],R=a[E],A=a[T],D=document.createElement("div");mutateDom(()=>{A||warn('x-for ":key" is undefined or invalid',o),A.after(D),R.after(A),A._x_currentIfEl&&A.after(A._x_currentIfEl),D.before(R),R._x_currentIfEl&&R.after(R._x_currentIfEl),D.remove()}),A._x_refreshXForScope(d[h.indexOf(T)])}for(let S=0;S<p.length;S++){let[E,T]=p[S],R=E==="template"?o:a[E];R._x_currentIfEl&&(R=R._x_currentIfEl);let A=d[T],D=h[T],x=document.importNode(o.content,!0).firstElementChild,M=reactive(A);addScopeToNode(x,M,o),x._x_refreshXForScope=I=>{Object.entries(I).forEach(([V,z])=>{M[V]=z})},mutateDom(()=>{R.after(x),initTree(x)}),typeof D=="object"&&warn("x-for key cannot be an object, it must be a string or an integer",o),a[D]=x}for(let S=0;S<y.length;S++)a[y[S]]._x_refreshXForScope(d[h.indexOf(y[S])]);o._x_prevKeys=h})}function parseForExpression(s){let e=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,t=/^\s*\(|\)\s*$/g,i=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,n=s.match(i);if(!n)return;let o={};o.items=n[2].trim();let r=n[1].replace(t,"").trim(),a=r.match(e);return a?(o.item=r.replace(e,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=r,o}function getIterationScopeVariables(s,e,t,i){let n={};return/^\[.*\]$/.test(s.item)&&Array.isArray(e)?s.item.replace("[","").replace("]","").split(",").map(r=>r.trim()).forEach((r,a)=>{n[r]=e[a]}):/^\{.*\}$/.test(s.item)&&!Array.isArray(e)&&typeof e=="object"?s.item.replace("{","").replace("}","").split(",").map(r=>r.trim()).forEach(r=>{n[r]=e[r]}):n[s.item]=e,s.index&&(n[s.index]=t),s.collection&&(n[s.collection]=i),n}function isNumeric3(s){return!Array.isArray(s)&&!isNaN(s)}function handler3(){}handler3.inline=(s,{expression:e},{cleanup:t})=>{let i=closestRoot(s);i._x_refs||(i._x_refs={}),i._x_refs[e]=s,t(()=>delete i._x_refs[e])};directive("ref",handler3);directive("if",(s,{expression:e},{effect:t,cleanup:i})=>{s.tagName.toLowerCase()!=="template"&&warn("x-if can only be used on a <template> tag",s);let n=evaluateLater(s,e),o=()=>{if(s._x_currentIfEl)return s._x_currentIfEl;let a=s.content.cloneNode(!0).firstElementChild;return addScopeToNode(a,{},s),mutateDom(()=>{s.after(a),initTree(a)}),s._x_currentIfEl=a,s._x_undoIf=()=>{walk(a,l=>{l._x_effects&&l._x_effects.forEach(dequeueJob)}),a.remove(),delete s._x_currentIfEl},a},r=()=>{s._x_undoIf&&(s._x_undoIf(),delete s._x_undoIf)};t(()=>n(a=>{a?o():r()})),i(()=>s._x_undoIf&&s._x_undoIf())});directive("id",(s,{expression:e},{evaluate:t})=>{t(e).forEach(n=>setIdRoot(s,n))});interceptClone((s,e)=>{s._x_ids&&(e._x_ids=s._x_ids)});mapAttributes(startingWith("@",into(prefix("on:"))));directive("on",skipDuringClone((s,{value:e,modifiers:t,expression:i},{cleanup:n})=>{let o=i?evaluateLater(s,i):()=>{};s.tagName.toLowerCase()==="template"&&(s._x_forwardEvents||(s._x_forwardEvents=[]),s._x_forwardEvents.includes(e)||s._x_forwardEvents.push(e));let r=on(s,e,t,a=>{o(()=>{},{scope:{$event:a},params:[a]})});n(()=>r())}));warnMissingPluginDirective("Collapse","collapse","collapse");warnMissingPluginDirective("Intersect","intersect","intersect");warnMissingPluginDirective("Focus","trap","focus");warnMissingPluginDirective("Mask","mask","mask");function warnMissingPluginDirective(s,e,t){directive(e,i=>warn(`You can't use [x-${e}] without first installing the "${s}" plugin here: https://alpinejs.dev/plugins/${t}`,i))}alpine_default.setEvaluator(normalEvaluator);alpine_default.setReactivityEngine({reactive:reactive2,effect:effect2,release:stop,raw:toRaw});var src_default=alpine_default,module_default=src_default,top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(s,e){return s.concat([e+"-"+start,e+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(s,e){return s.concat([e,e+"-"+start,e+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(s){return s?(s.nodeName||"").toLowerCase():null}function getWindow(s){if(s==null)return window;if(s.toString()!=="[object Window]"){var e=s.ownerDocument;return e&&e.defaultView||window}return s}function isElement$1(s){var e=getWindow(s).Element;return s instanceof e||s instanceof Element}function isHTMLElement(s){var e=getWindow(s).HTMLElement;return s instanceof e||s instanceof HTMLElement}function isShadowRoot(s){if(typeof ShadowRoot>"u")return!1;var e=getWindow(s).ShadowRoot;return s instanceof e||s instanceof ShadowRoot}function applyStyles(s){var e=s.state;Object.keys(e.elements).forEach(function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},o=e.elements[t];!isHTMLElement(o)||!getNodeName(o)||(Object.assign(o.style,i),Object.keys(n).forEach(function(r){var a=n[r];a===!1?o.removeAttribute(r):o.setAttribute(r,a===!0?"":a)}))})}function effect$2(s){var e=s.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(i){var n=e.elements[i],o=e.attributes[i]||{},r=Object.keys(e.styles.hasOwnProperty(i)?e.styles[i]:t[i]),a=r.reduce(function(l,d){return l[d]="",l},{});!isHTMLElement(n)||!getNodeName(n)||(Object.assign(n.style,a),Object.keys(o).forEach(function(l){n.removeAttribute(l)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(s){return s.split("-")[0]}var max=Math.max,min=Math.min,round$1=Math.round;function getUAString(){var s=navigator.userAgentData;return s!=null&&s.brands&&Array.isArray(s.brands)?s.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(s,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var i=s.getBoundingClientRect(),n=1,o=1;e&&isHTMLElement(s)&&(n=s.offsetWidth>0&&round$1(i.width)/s.offsetWidth||1,o=s.offsetHeight>0&&round$1(i.height)/s.offsetHeight||1);var r=isElement$1(s)?getWindow(s):window,a=r.visualViewport,l=!isLayoutViewport()&&t,d=(i.left+(l&&a?a.offsetLeft:0))/n,h=(i.top+(l&&a?a.offsetTop:0))/o,p=i.width/n,m=i.height/o;return{width:p,height:m,top:h,right:d+p,bottom:h+m,left:d,x:d,y:h}}function getLayoutRect(s){var e=getBoundingClientRect(s),t=s.offsetWidth,i=s.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:s.offsetLeft,y:s.offsetTop,width:t,height:i}}function contains(s,e){var t=e.getRootNode&&e.getRootNode();if(s.contains(e))return!0;if(t&&isShadowRoot(t)){var i=e;do{if(i&&s.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function getComputedStyle$2(s){return getWindow(s).getComputedStyle(s)}function isTableElement(s){return["table","td","th"].indexOf(getNodeName(s))>=0}function getDocumentElement(s){return((isElement$1(s)?s.ownerDocument:s.document)||window.document).documentElement}function getParentNode(s){return getNodeName(s)==="html"?s:s.assignedSlot||s.parentNode||(isShadowRoot(s)?s.host:null)||getDocumentElement(s)}function getTrueOffsetParent(s){return!isHTMLElement(s)||getComputedStyle$2(s).position==="fixed"?null:s.offsetParent}function getContainingBlock(s){var e=/firefox/i.test(getUAString()),t=/Trident/i.test(getUAString());if(t&&isHTMLElement(s)){var i=getComputedStyle$2(s);if(i.position==="fixed")return null}var n=getParentNode(s);for(isShadowRoot(n)&&(n=n.host);isHTMLElement(n)&&["html","body"].indexOf(getNodeName(n))<0;){var o=getComputedStyle$2(n);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return n;n=n.parentNode}return null}function getOffsetParent(s){for(var e=getWindow(s),t=getTrueOffsetParent(s);t&&isTableElement(t)&&getComputedStyle$2(t).position==="static";)t=getTrueOffsetParent(t);return t&&(getNodeName(t)==="html"||getNodeName(t)==="body"&&getComputedStyle$2(t).position==="static")?e:t||getContainingBlock(s)||e}function getMainAxisFromPlacement(s){return["top","bottom"].indexOf(s)>=0?"x":"y"}function within(s,e,t){return max(s,min(e,t))}function withinMaxClamp(s,e,t){var i=within(s,e,t);return i>t?t:i}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(s){return Object.assign({},getFreshSideObject(),s)}function expandToHashMap(s,e){return e.reduce(function(t,i){return t[i]=s,t},{})}var toPaddingObject=function s(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,mergePaddingObject(typeof e!="number"?e:expandToHashMap(e,basePlacements))};function arrow(s){var e,t=s.state,i=s.name,n=s.options,o=t.elements.arrow,r=t.modifiersData.popperOffsets,a=getBasePlacement(t.placement),l=getMainAxisFromPlacement(a),d=[left,right].indexOf(a)>=0,h=d?"height":"width";if(!(!o||!r)){var p=toPaddingObject(n.padding,t),m=getLayoutRect(o),v=l==="y"?top:left,y=l==="y"?bottom:right,b=t.rects.reference[h]+t.rects.reference[l]-r[l]-t.rects.popper[h],S=r[l]-t.rects.reference[l],E=getOffsetParent(o),T=E?l==="y"?E.clientHeight||0:E.clientWidth||0:0,R=b/2-S/2,A=p[v],D=T-m[h]-p[y],x=T/2-m[h]/2+R,M=within(A,x,D),I=l;t.modifiersData[i]=(e={},e[I]=M,e.centerOffset=M-x,e)}}function effect$1(s){var e=s.state,t=s.options,i=t.element,n=i===void 0?"[data-popper-arrow]":i;n!=null&&(typeof n=="string"&&(n=e.elements.popper.querySelector(n),!n)||contains(e.elements.popper,n)&&(e.elements.arrow=n))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(s){return s.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(s,e){var t=s.x,i=s.y,n=e.devicePixelRatio||1;return{x:round$1(t*n)/n||0,y:round$1(i*n)/n||0}}function mapToStyles(s){var e,t=s.popper,i=s.popperRect,n=s.placement,o=s.variation,r=s.offsets,a=s.position,l=s.gpuAcceleration,d=s.adaptive,h=s.roundOffsets,p=s.isFixed,m=r.x,v=m===void 0?0:m,y=r.y,b=y===void 0?0:y,S=typeof h=="function"?h({x:v,y:b}):{x:v,y:b};v=S.x,b=S.y;var E=r.hasOwnProperty("x"),T=r.hasOwnProperty("y"),R=left,A=top,D=window;if(d){var x=getOffsetParent(t),M="clientHeight",I="clientWidth";if(x===getWindow(t)&&(x=getDocumentElement(t),getComputedStyle$2(x).position!=="static"&&a==="absolute"&&(M="scrollHeight",I="scrollWidth")),x=x,n===top||(n===left||n===right)&&o===end){A=bottom;var V=p&&x===D&&D.visualViewport?D.visualViewport.height:x[M];b-=V-i.height,b*=l?1:-1}if(n===left||(n===top||n===bottom)&&o===end){R=right;var z=p&&x===D&&D.visualViewport?D.visualViewport.width:x[I];v-=z-i.width,v*=l?1:-1}}var B=Object.assign({position:a},d&&unsetSides),K=h===!0?roundOffsetsByDPR({x:v,y:b},getWindow(t)):{x:v,y:b};if(v=K.x,b=K.y,l){var J;return Object.assign({},B,(J={},J[A]=T?"0":"",J[R]=E?"0":"",J.transform=(D.devicePixelRatio||1)<=1?"translate("+v+"px, "+b+"px)":"translate3d("+v+"px, "+b+"px, 0)",J))}return Object.assign({},B,(e={},e[A]=T?b+"px":"",e[R]=E?v+"px":"",e.transform="",e))}function computeStyles(s){var e=s.state,t=s.options,i=t.gpuAcceleration,n=i===void 0?!0:i,o=t.adaptive,r=o===void 0?!0:o,a=t.roundOffsets,l=a===void 0?!0:a,d={placement:getBasePlacement(e.placement),variation:getVariation(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:n,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,mapToStyles(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,mapToStyles(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(s){var e=s.state,t=s.instance,i=s.options,n=i.scroll,o=n===void 0?!0:n,r=i.resize,a=r===void 0?!0:r,l=getWindow(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(h){h.addEventListener("scroll",t.update,passive)}),a&&l.addEventListener("resize",t.update,passive),function(){o&&d.forEach(function(h){h.removeEventListener("scroll",t.update,passive)}),a&&l.removeEventListener("resize",t.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function s(){},effect,data:{}};var hash$1={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(s){return s.replace(/left|right|bottom|top/g,function(e){return hash$1[e]})}var hash={start:"end",end:"start"};function getOppositeVariationPlacement(s){return s.replace(/start|end/g,function(e){return hash[e]})}function getWindowScroll(s){var e=getWindow(s),t=e.pageXOffset,i=e.pageYOffset;return{scrollLeft:t,scrollTop:i}}function getWindowScrollBarX(s){return getBoundingClientRect(getDocumentElement(s)).left+getWindowScroll(s).scrollLeft}function getViewportRect(s,e){var t=getWindow(s),i=getDocumentElement(s),n=t.visualViewport,o=i.clientWidth,r=i.clientHeight,a=0,l=0;if(n){o=n.width,r=n.height;var d=isLayoutViewport();(d||!d&&e==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:o,height:r,x:a+getWindowScrollBarX(s),y:l}}function getDocumentRect(s){var e,t=getDocumentElement(s),i=getWindowScroll(s),n=(e=s.ownerDocument)==null?void 0:e.body,o=max(t.scrollWidth,t.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),r=max(t.scrollHeight,t.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-i.scrollLeft+getWindowScrollBarX(s),l=-i.scrollTop;return getComputedStyle$2(n||t).direction==="rtl"&&(a+=max(t.clientWidth,n?n.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}function isScrollParent(s){var e=getComputedStyle$2(s),t=e.overflow,i=e.overflowX,n=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+n+i)}function getScrollParent(s){return["html","body","#document"].indexOf(getNodeName(s))>=0?s.ownerDocument.body:isHTMLElement(s)&&isScrollParent(s)?s:getScrollParent(getParentNode(s))}function listScrollParents(s,e){var t;e===void 0&&(e=[]);var i=getScrollParent(s),n=i===((t=s.ownerDocument)==null?void 0:t.body),o=getWindow(i),r=n?[o].concat(o.visualViewport||[],isScrollParent(i)?i:[]):i,a=e.concat(r);return n?a:a.concat(listScrollParents(getParentNode(r)))}function rectToClientRect(s){return Object.assign({},s,{left:s.x,top:s.y,right:s.x+s.width,bottom:s.y+s.height})}function getInnerBoundingClientRect(s,e){var t=getBoundingClientRect(s,!1,e==="fixed");return t.top=t.top+s.clientTop,t.left=t.left+s.clientLeft,t.bottom=t.top+s.clientHeight,t.right=t.left+s.clientWidth,t.width=s.clientWidth,t.height=s.clientHeight,t.x=t.left,t.y=t.top,t}function getClientRectFromMixedType(s,e,t){return e===viewport?rectToClientRect(getViewportRect(s,t)):isElement$1(e)?getInnerBoundingClientRect(e,t):rectToClientRect(getDocumentRect(getDocumentElement(s)))}function getClippingParents(s){var e=listScrollParents(getParentNode(s)),t=["absolute","fixed"].indexOf(getComputedStyle$2(s).position)>=0,i=t&&isHTMLElement(s)?getOffsetParent(s):s;return isElement$1(i)?e.filter(function(n){return isElement$1(n)&&contains(n,i)&&getNodeName(n)!=="body"}):[]}function getClippingRect(s,e,t,i){var n=e==="clippingParents"?getClippingParents(s):[].concat(e),o=[].concat(n,[t]),r=o[0],a=o.reduce(function(l,d){var h=getClientRectFromMixedType(s,d,i);return l.top=max(h.top,l.top),l.right=min(h.right,l.right),l.bottom=min(h.bottom,l.bottom),l.left=max(h.left,l.left),l},getClientRectFromMixedType(s,r,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function computeOffsets(s){var e=s.reference,t=s.element,i=s.placement,n=i?getBasePlacement(i):null,o=i?getVariation(i):null,r=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,l;switch(n){case top:l={x:r,y:e.y-t.height};break;case bottom:l={x:r,y:e.y+e.height};break;case right:l={x:e.x+e.width,y:a};break;case left:l={x:e.x-t.width,y:a};break;default:l={x:e.x,y:e.y}}var d=n?getMainAxisFromPlacement(n):null;if(d!=null){var h=d==="y"?"height":"width";switch(o){case start:l[d]=l[d]-(e[h]/2-t[h]/2);break;case end:l[d]=l[d]+(e[h]/2-t[h]/2);break}}return l}function detectOverflow(s,e){e===void 0&&(e={});var t=e,i=t.placement,n=i===void 0?s.placement:i,o=t.strategy,r=o===void 0?s.strategy:o,a=t.boundary,l=a===void 0?clippingParents:a,d=t.rootBoundary,h=d===void 0?viewport:d,p=t.elementContext,m=p===void 0?popper:p,v=t.altBoundary,y=v===void 0?!1:v,b=t.padding,S=b===void 0?0:b,E=mergePaddingObject(typeof S!="number"?S:expandToHashMap(S,basePlacements)),T=m===popper?reference:popper,R=s.rects.popper,A=s.elements[y?T:m],D=getClippingRect(isElement$1(A)?A:A.contextElement||getDocumentElement(s.elements.popper),l,h,r),x=getBoundingClientRect(s.elements.reference),M=computeOffsets({reference:x,element:R,strategy:"absolute",placement:n}),I=rectToClientRect(Object.assign({},R,M)),V=m===popper?I:x,z={top:D.top-V.top+E.top,bottom:V.bottom-D.bottom+E.bottom,left:D.left-V.left+E.left,right:V.right-D.right+E.right},B=s.modifiersData.offset;if(m===popper&&B){var K=B[n];Object.keys(z).forEach(function(J){var Z=[right,bottom].indexOf(J)>=0?1:-1,F=[top,bottom].indexOf(J)>=0?"y":"x";z[J]+=K[F]*Z})}return z}function computeAutoPlacement(s,e){e===void 0&&(e={});var t=e,i=t.placement,n=t.boundary,o=t.rootBoundary,r=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,d=l===void 0?placements:l,h=getVariation(i),p=h?a?variationPlacements:variationPlacements.filter(function(y){return getVariation(y)===h}):basePlacements,m=p.filter(function(y){return d.indexOf(y)>=0});m.length===0&&(m=p);var v=m.reduce(function(y,b){return y[b]=detectOverflow(s,{placement:b,boundary:n,rootBoundary:o,padding:r})[getBasePlacement(b)],y},{});return Object.keys(v).sort(function(y,b){return v[y]-v[b]})}function getExpandedFallbackPlacements(s){if(getBasePlacement(s)===auto)return[];var e=getOppositePlacement(s);return[getOppositeVariationPlacement(s),e,getOppositeVariationPlacement(e)]}function flip(s){var e=s.state,t=s.options,i=s.name;if(!e.modifiersData[i]._skip){for(var n=t.mainAxis,o=n===void 0?!0:n,r=t.altAxis,a=r===void 0?!0:r,l=t.fallbackPlacements,d=t.padding,h=t.boundary,p=t.rootBoundary,m=t.altBoundary,v=t.flipVariations,y=v===void 0?!0:v,b=t.allowedAutoPlacements,S=e.options.placement,E=getBasePlacement(S),T=E===S,R=l||(T||!y?[getOppositePlacement(S)]:getExpandedFallbackPlacements(S)),A=[S].concat(R).reduce(function(oe,ie){return oe.concat(getBasePlacement(ie)===auto?computeAutoPlacement(e,{placement:ie,boundary:h,rootBoundary:p,padding:d,flipVariations:y,allowedAutoPlacements:b}):ie)},[]),D=e.rects.reference,x=e.rects.popper,M=new Map,I=!0,V=A[0],z=0;z<A.length;z++){var B=A[z],K=getBasePlacement(B),J=getVariation(B)===start,Z=[top,bottom].indexOf(K)>=0,F=Z?"width":"height",$=detectOverflow(e,{placement:B,boundary:h,rootBoundary:p,altBoundary:m,padding:d}),Y=Z?J?right:left:J?bottom:top;D[F]>x[F]&&(Y=getOppositePlacement(Y));var W=getOppositePlacement(Y),X=[];if(o&&X.push($[K]<=0),a&&X.push($[Y]<=0,$[W]<=0),X.every(function(oe){return oe})){V=B,I=!1;break}M.set(B,X)}if(I)for(var U=y?3:1,se=function(ie){var te=A.find(function(Se){var be=M.get(Se);if(be)return be.slice(0,ie).every(function(qe){return qe})});if(te)return V=te,"break"},pe=U;pe>0;pe--){var ae=se(pe);if(ae==="break")break}e.placement!==V&&(e.modifiersData[i]._skip=!0,e.placement=V,e.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(s,e,t){return t===void 0&&(t={x:0,y:0}),{top:s.top-e.height-t.y,right:s.right-e.width+t.x,bottom:s.bottom-e.height+t.y,left:s.left-e.width-t.x}}function isAnySideFullyClipped(s){return[top,right,bottom,left].some(function(e){return s[e]>=0})}function hide(s){var e=s.state,t=s.name,i=e.rects.reference,n=e.rects.popper,o=e.modifiersData.preventOverflow,r=detectOverflow(e,{elementContext:"reference"}),a=detectOverflow(e,{altBoundary:!0}),l=getSideOffsets(r,i),d=getSideOffsets(a,n,o),h=isAnySideFullyClipped(l),p=isAnySideFullyClipped(d);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:h,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(s,e,t){var i=getBasePlacement(s),n=[left,top].indexOf(i)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:s})):t,r=o[0],a=o[1];return r=r||0,a=(a||0)*n,[left,right].indexOf(i)>=0?{x:a,y:r}:{x:r,y:a}}function offset(s){var e=s.state,t=s.options,i=s.name,n=t.offset,o=n===void 0?[0,0]:n,r=placements.reduce(function(h,p){return h[p]=distanceAndSkiddingToXY(p,e.rects,o),h},{}),a=r[e.placement],l=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=d),e.modifiersData[i]=r}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(s){var e=s.state,t=s.name;e.modifiersData[t]=computeOffsets({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(s){return s==="x"?"y":"x"}function preventOverflow(s){var e=s.state,t=s.options,i=s.name,n=t.mainAxis,o=n===void 0?!0:n,r=t.altAxis,a=r===void 0?!1:r,l=t.boundary,d=t.rootBoundary,h=t.altBoundary,p=t.padding,m=t.tether,v=m===void 0?!0:m,y=t.tetherOffset,b=y===void 0?0:y,S=detectOverflow(e,{boundary:l,rootBoundary:d,padding:p,altBoundary:h}),E=getBasePlacement(e.placement),T=getVariation(e.placement),R=!T,A=getMainAxisFromPlacement(E),D=getAltAxis(A),x=e.modifiersData.popperOffsets,M=e.rects.reference,I=e.rects.popper,V=typeof b=="function"?b(Object.assign({},e.rects,{placement:e.placement})):b,z=typeof V=="number"?{mainAxis:V,altAxis:V}:Object.assign({mainAxis:0,altAxis:0},V),B=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,K={x:0,y:0};if(x){if(o){var J,Z=A==="y"?top:left,F=A==="y"?bottom:right,$=A==="y"?"height":"width",Y=x[A],W=Y+S[Z],X=Y-S[F],U=v?-I[$]/2:0,se=T===start?M[$]:I[$],pe=T===start?-I[$]:-M[$],ae=e.elements.arrow,oe=v&&ae?getLayoutRect(ae):{width:0,height:0},ie=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:getFreshSideObject(),te=ie[Z],Se=ie[F],be=within(0,M[$],oe[$]),qe=R?M[$]/2-U-be-te-z.mainAxis:se-be-te-z.mainAxis,dt=R?-M[$]/2+U+be+Se+z.mainAxis:pe+be+Se+z.mainAxis,We=e.elements.arrow&&getOffsetParent(e.elements.arrow),Be=We?A==="y"?We.clientTop||0:We.clientLeft||0:0,Xe=(J=B==null?void 0:B[A])!=null?J:0,Zt=Y+qe-Xe-Be,Mt=Y+dt-Xe,ut=within(v?min(W,Zt):W,Y,v?max(X,Mt):X);x[A]=ut,K[A]=ut-Y}if(a){var Qe,Ze=A==="x"?top:left,Jt=A==="x"?bottom:right,Oe=x[D],Ge=D==="y"?"height":"width",ht=Oe+S[Ze],ft=Oe-S[Jt],gt=[top,left].indexOf(E)!==-1,xt=(Qe=B==null?void 0:B[D])!=null?Qe:0,Je=gt?ht:Oe-M[Ge]-I[Ge]-xt+z.altAxis,mt=gt?Oe+M[Ge]+I[Ge]-xt-z.altAxis:ft,vt=v&>?withinMaxClamp(Je,Oe,mt):within(v?Je:ht,Oe,v?mt:ft);x[D]=vt,K[D]=vt-Oe}e.modifiersData[i]=K}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(s){return{scrollLeft:s.scrollLeft,scrollTop:s.scrollTop}}function getNodeScroll(s){return s===getWindow(s)||!isHTMLElement(s)?getWindowScroll(s):getHTMLElementScroll(s)}function isElementScaled(s){var e=s.getBoundingClientRect(),t=round$1(e.width)/s.offsetWidth||1,i=round$1(e.height)/s.offsetHeight||1;return t!==1||i!==1}function getCompositeRect(s,e,t){t===void 0&&(t=!1);var i=isHTMLElement(e),n=isHTMLElement(e)&&isElementScaled(e),o=getDocumentElement(e),r=getBoundingClientRect(s,n,t),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(i||!i&&!t)&&((getNodeName(e)!=="body"||isScrollParent(o))&&(a=getNodeScroll(e)),isHTMLElement(e)?(l=getBoundingClientRect(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=getWindowScrollBarX(o))),{x:r.left+a.scrollLeft-l.x,y:r.top+a.scrollTop-l.y,width:r.width,height:r.height}}function order(s){var e=new Map,t=new Set,i=[];s.forEach(function(o){e.set(o.name,o)});function n(o){t.add(o.name);var r=[].concat(o.requires||[],o.requiresIfExists||[]);r.forEach(function(a){if(!t.has(a)){var l=e.get(a);l&&n(l)}}),i.push(o)}return s.forEach(function(o){t.has(o.name)||n(o)}),i}function orderModifiers(s){var e=order(s);return modifierPhases.reduce(function(t,i){return t.concat(e.filter(function(n){return n.phase===i}))},[])}function debounce$4(s){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(s())})})),e}}function mergeByName(s){var e=s.reduce(function(t,i){var n=t[i.name];return t[i.name]=n?Object.assign({},n,i,{options:Object.assign({},n.options,i.options),data:Object.assign({},n.data,i.data)}):i,t},{});return Object.keys(e).map(function(t){return e[t]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return!e.some(function(i){return!(i&&typeof i.getBoundingClientRect=="function")})}function popperGenerator(s){s===void 0&&(s={});var e=s,t=e.defaultModifiers,i=t===void 0?[]:t,n=e.defaultOptions,o=n===void 0?DEFAULT_OPTIONS:n;return function(a,l,d){d===void 0&&(d=o);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},p=[],m=!1,v={state:h,setOptions:function(E){var T=typeof E=="function"?E(h.options):E;b(),h.options=Object.assign({},o,h.options,T),h.scrollParents={reference:isElement$1(a)?listScrollParents(a):a.contextElement?listScrollParents(a.contextElement):[],popper:listScrollParents(l)};var R=orderModifiers(mergeByName([].concat(i,h.options.modifiers)));return h.orderedModifiers=R.filter(function(A){return A.enabled}),y(),v.update()},forceUpdate:function(){if(!m){var E=h.elements,T=E.reference,R=E.popper;if(areValidElements(T,R)){h.rects={reference:getCompositeRect(T,getOffsetParent(R),h.options.strategy==="fixed"),popper:getLayoutRect(R)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(z){return h.modifiersData[z.name]=Object.assign({},z.data)});for(var A=0;A<h.orderedModifiers.length;A++){if(h.reset===!0){h.reset=!1,A=-1;continue}var D=h.orderedModifiers[A],x=D.fn,M=D.options,I=M===void 0?{}:M,V=D.name;typeof x=="function"&&(h=x({state:h,options:I,name:V,instance:v})||h)}}}},update:debounce$4(function(){return new Promise(function(S){v.forceUpdate(),S(h)})}),destroy:function(){b(),m=!0}};if(!areValidElements(a,l))return v;v.setOptions(d).then(function(S){!m&&d.onFirstUpdate&&d.onFirstUpdate(S)});function y(){h.orderedModifiers.forEach(function(S){var E=S.name,T=S.options,R=T===void 0?{}:T,A=S.effect;if(typeof A=="function"){var D=A({state:h,name:E,instance:v,options:R}),x=function(){};p.push(D||x)}})}function b(){p.forEach(function(S){return S()}),p=[]}return v}}var createPopper$2=popperGenerator(),defaultModifiers$1=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1],createPopper$1=popperGenerator({defaultModifiers:defaultModifiers$1}),defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1],createPopper=popperGenerator({defaultModifiers});const Popper=Object.freeze(Object.defineProperty({__proto__:null,afterMain,afterRead,afterWrite,applyStyles:applyStyles$1,arrow:arrow$1,auto,basePlacements,beforeMain,beforeRead,beforeWrite,bottom,clippingParents,computeStyles:computeStyles$1,createPopper,createPopperBase:createPopper$2,createPopperLite:createPopper$1,detectOverflow,end,eventListeners,flip:flip$1,hide:hide$1,left,main,modifierPhases,offset:offset$1,placements,popper,popperGenerator,popperOffsets:popperOffsets$1,preventOverflow:preventOverflow$1,read,reference,right,start,top,variationPlacements,viewport,write},Symbol.toStringTag,{value:"Module"}));/*!
|
||
* Bootstrap v5.3.3 (https://getbootstrap.com/)
|
||
* Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||
*/const elementMap=new Map,Data={set(s,e,t){elementMap.has(s)||elementMap.set(s,new Map);const i=elementMap.get(s);if(!i.has(e)&&i.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(i.keys())[0]}.`);return}i.set(e,t)},get(s,e){return elementMap.has(s)&&elementMap.get(s).get(e)||null},remove(s,e){if(!elementMap.has(s))return;const t=elementMap.get(s);t.delete(e),t.size===0&&elementMap.delete(s)}},MAX_UID=1e6,MILLISECONDS_MULTIPLIER=1e3,TRANSITION_END="transitionend",parseSelector=s=>(s&&window.CSS&&window.CSS.escape&&(s=s.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),s),toType=s=>s==null?`${s}`:Object.prototype.toString.call(s).match(/\s([a-z]+)/i)[1].toLowerCase(),getUID=s=>{do s+=Math.floor(Math.random()*MAX_UID);while(document.getElementById(s));return s},getTransitionDurationFromElement=s=>{if(!s)return 0;let{transitionDuration:e,transitionDelay:t}=window.getComputedStyle(s);const i=Number.parseFloat(e),n=Number.parseFloat(t);return!i&&!n?0:(e=e.split(",")[0],t=t.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(t))*MILLISECONDS_MULTIPLIER)},triggerTransitionEnd=s=>{s.dispatchEvent(new Event(TRANSITION_END))},isElement=s=>!s||typeof s!="object"?!1:(typeof s.jquery<"u"&&(s=s[0]),typeof s.nodeType<"u"),getElement=s=>isElement(s)?s.jquery?s[0]:s:typeof s=="string"&&s.length>0?document.querySelector(parseSelector(s)):null,isVisible$1=s=>{if(!isElement(s)||s.getClientRects().length===0)return!1;const e=getComputedStyle(s).getPropertyValue("visibility")==="visible",t=s.closest("details:not([open])");if(!t)return e;if(t!==s){const i=s.closest("summary");if(i&&i.parentNode!==t||i===null)return!1}return e},isDisabled=s=>!s||s.nodeType!==Node.ELEMENT_NODE||s.classList.contains("disabled")?!0:typeof s.disabled<"u"?s.disabled:s.hasAttribute("disabled")&&s.getAttribute("disabled")!=="false",findShadowRoot=s=>{if(!document.documentElement.attachShadow)return null;if(typeof s.getRootNode=="function"){const e=s.getRootNode();return e instanceof ShadowRoot?e:null}return s instanceof ShadowRoot?s:s.parentNode?findShadowRoot(s.parentNode):null},noop$3=()=>{},reflow=s=>{s.offsetHeight},getjQuery=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,DOMContentLoadedCallbacks=[],onDOMContentLoaded=s=>{document.readyState==="loading"?(DOMContentLoadedCallbacks.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of DOMContentLoadedCallbacks)e()}),DOMContentLoadedCallbacks.push(s)):s()},isRTL=()=>document.documentElement.dir==="rtl",defineJQueryPlugin=s=>{onDOMContentLoaded(()=>{const e=getjQuery();if(e){const t=s.NAME,i=e.fn[t];e.fn[t]=s.jQueryInterface,e.fn[t].Constructor=s,e.fn[t].noConflict=()=>(e.fn[t]=i,s.jQueryInterface)}})},execute=(s,e=[],t=s)=>typeof s=="function"?s(...e):t,executeAfterTransition=(s,e,t=!0)=>{if(!t){execute(s);return}const i=5,n=getTransitionDurationFromElement(e)+i;let o=!1;const r=({target:a})=>{a===e&&(o=!0,e.removeEventListener(TRANSITION_END,r),execute(s))};e.addEventListener(TRANSITION_END,r),setTimeout(()=>{o||triggerTransitionEnd(e)},n)},getNextActiveElement=(s,e,t,i)=>{const n=s.length;let o=s.indexOf(e);return o===-1?!t&&i?s[n-1]:s[0]:(o+=t?1:-1,i&&(o=(o+n)%n),s[Math.max(0,Math.min(o,n-1))])},namespaceRegex=/[^.]*(?=\..*)\.|.*/,stripNameRegex=/\..*/,stripUidRegex=/::\d+$/,eventRegistry={};let uidEvent=1;const customEvents={mouseenter:"mouseover",mouseleave:"mouseout"},nativeEvents=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function makeEventUid(s,e){return e&&`${e}::${uidEvent++}`||s.uidEvent||uidEvent++}function getElementEvents(s){const e=makeEventUid(s);return s.uidEvent=e,eventRegistry[e]=eventRegistry[e]||{},eventRegistry[e]}function bootstrapHandler(s,e){return function t(i){return hydrateObj(i,{delegateTarget:s}),t.oneOff&&EventHandler.off(s,i.type,e),e.apply(s,[i])}}function bootstrapDelegationHandler(s,e,t){return function i(n){const o=s.querySelectorAll(e);for(let{target:r}=n;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return hydrateObj(n,{delegateTarget:r}),i.oneOff&&EventHandler.off(s,n.type,e,t),t.apply(r,[n])}}function findHandler(s,e,t=null){return Object.values(s).find(i=>i.callable===e&&i.delegationSelector===t)}function normalizeParameters(s,e,t){const i=typeof e=="string",n=i?t:e||t;let o=getTypeEvent(s);return nativeEvents.has(o)||(o=s),[i,n,o]}function addHandler(s,e,t,i,n){if(typeof e!="string"||!s)return;let[o,r,a]=normalizeParameters(e,t,i);e in customEvents&&(r=(y=>function(b){if(!b.relatedTarget||b.relatedTarget!==b.delegateTarget&&!b.delegateTarget.contains(b.relatedTarget))return y.call(this,b)})(r));const l=getElementEvents(s),d=l[a]||(l[a]={}),h=findHandler(d,r,o?t:null);if(h){h.oneOff=h.oneOff&&n;return}const p=makeEventUid(r,e.replace(namespaceRegex,"")),m=o?bootstrapDelegationHandler(s,t,r):bootstrapHandler(s,r);m.delegationSelector=o?t:null,m.callable=r,m.oneOff=n,m.uidEvent=p,d[p]=m,s.addEventListener(a,m,o)}function removeHandler(s,e,t,i,n){const o=findHandler(e[t],i,n);o&&(s.removeEventListener(t,o,!!n),delete e[t][o.uidEvent])}function removeNamespacedHandlers(s,e,t,i){const n=e[t]||{};for(const[o,r]of Object.entries(n))o.includes(i)&&removeHandler(s,e,t,r.callable,r.delegationSelector)}function getTypeEvent(s){return s=s.replace(stripNameRegex,""),customEvents[s]||s}const EventHandler={on(s,e,t,i){addHandler(s,e,t,i,!1)},one(s,e,t,i){addHandler(s,e,t,i,!0)},off(s,e,t,i){if(typeof e!="string"||!s)return;const[n,o,r]=normalizeParameters(e,t,i),a=r!==e,l=getElementEvents(s),d=l[r]||{},h=e.startsWith(".");if(typeof o<"u"){if(!Object.keys(d).length)return;removeHandler(s,l,r,o,n?t:null);return}if(h)for(const p of Object.keys(l))removeNamespacedHandlers(s,l,p,e.slice(1));for(const[p,m]of Object.entries(d)){const v=p.replace(stripUidRegex,"");(!a||e.includes(v))&&removeHandler(s,l,r,m.callable,m.delegationSelector)}},trigger(s,e,t){if(typeof e!="string"||!s)return null;const i=getjQuery(),n=getTypeEvent(e),o=e!==n;let r=null,a=!0,l=!0,d=!1;o&&i&&(r=i.Event(e,t),i(s).trigger(r),a=!r.isPropagationStopped(),l=!r.isImmediatePropagationStopped(),d=r.isDefaultPrevented());const h=hydrateObj(new Event(e,{bubbles:a,cancelable:!0}),t);return d&&h.preventDefault(),l&&s.dispatchEvent(h),h.defaultPrevented&&r&&r.preventDefault(),h}};function hydrateObj(s,e={}){for(const[t,i]of Object.entries(e))try{s[t]=i}catch{Object.defineProperty(s,t,{configurable:!0,get(){return i}})}return s}function normalizeData(s){if(s==="true")return!0;if(s==="false")return!1;if(s===Number(s).toString())return Number(s);if(s===""||s==="null")return null;if(typeof s!="string")return s;try{return JSON.parse(decodeURIComponent(s))}catch{return s}}function normalizeDataKey(s){return s.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const Manipulator={setDataAttribute(s,e,t){s.setAttribute(`data-bs-${normalizeDataKey(e)}`,t)},removeDataAttribute(s,e){s.removeAttribute(`data-bs-${normalizeDataKey(e)}`)},getDataAttributes(s){if(!s)return{};const e={},t=Object.keys(s.dataset).filter(i=>i.startsWith("bs")&&!i.startsWith("bsConfig"));for(const i of t){let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),e[n]=normalizeData(s.dataset[i])}return e},getDataAttribute(s,e){return normalizeData(s.getAttribute(`data-bs-${normalizeDataKey(e)}`))}};let Config$1=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const i=isElement(t)?Manipulator.getDataAttribute(t,"config"):{};return{...this.constructor.Default,...typeof i=="object"?i:{},...isElement(t)?Manipulator.getDataAttributes(t):{},...typeof e=="object"?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[i,n]of Object.entries(t)){const o=e[i],r=isElement(o)?"element":toType(o);if(!new RegExp(n).test(r))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${r}" but expected type "${n}".`)}}};const VERSION$1="5.3.3";class BaseComponent extends Config$1{constructor(e,t){super(),e=getElement(e),e&&(this._element=e,this._config=this._getConfig(t),Data.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Data.remove(this._element,this.constructor.DATA_KEY),EventHandler.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){executeAfterTransition(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Data.get(getElement(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t=="object"?t:null)}static get VERSION(){return VERSION$1}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const getSelector=s=>{let e=s.getAttribute("data-bs-target");if(!e||e==="#"){let t=s.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&t!=="#"?t.trim():null}return e?e.split(",").map(t=>parseSelector(t)).join(","):null},SelectorEngine={find(s,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,s))},findOne(s,e=document.documentElement){return Element.prototype.querySelector.call(e,s)},children(s,e){return[].concat(...s.children).filter(t=>t.matches(e))},parents(s,e){const t=[];let i=s.parentNode.closest(e);for(;i;)t.push(i),i=i.parentNode.closest(e);return t},prev(s,e){let t=s.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(s,e){let t=s.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(s){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,s).filter(t=>!isDisabled(t)&&isVisible$1(t))},getSelectorFromElement(s){const e=getSelector(s);return e&&SelectorEngine.findOne(e)?e:null},getElementFromSelector(s){const e=getSelector(s);return e?SelectorEngine.findOne(e):null},getMultipleElementsFromSelector(s){const e=getSelector(s);return e?SelectorEngine.find(e):[]}},enableDismissTrigger=(s,e="hide")=>{const t=`click.dismiss${s.EVENT_KEY}`,i=s.NAME;EventHandler.on(document,t,`[data-bs-dismiss="${i}"]`,function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),isDisabled(this))return;const o=SelectorEngine.getElementFromSelector(this)||this.closest(`.${i}`);s.getOrCreateInstance(o)[e]()})},NAME$f="alert",DATA_KEY$a="bs.alert",EVENT_KEY$b=`.${DATA_KEY$a}`,EVENT_CLOSE=`close${EVENT_KEY$b}`,EVENT_CLOSED=`closed${EVENT_KEY$b}`,CLASS_NAME_FADE$5="fade",CLASS_NAME_SHOW$8="show";class Alert extends BaseComponent{static get NAME(){return NAME$f}close(){if(EventHandler.trigger(this._element,EVENT_CLOSE).defaultPrevented)return;this._element.classList.remove(CLASS_NAME_SHOW$8);const t=this._element.classList.contains(CLASS_NAME_FADE$5);this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),EventHandler.trigger(this._element,EVENT_CLOSED),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=Alert.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}enableDismissTrigger(Alert,"close");defineJQueryPlugin(Alert);const NAME$e="button",DATA_KEY$9="bs.button",EVENT_KEY$a=`.${DATA_KEY$9}`,DATA_API_KEY$6=".data-api",CLASS_NAME_ACTIVE$3="active",SELECTOR_DATA_TOGGLE$5='[data-bs-toggle="button"]',EVENT_CLICK_DATA_API$6=`click${EVENT_KEY$a}${DATA_API_KEY$6}`;class Button extends BaseComponent{static get NAME(){return NAME$e}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(CLASS_NAME_ACTIVE$3))}static jQueryInterface(e){return this.each(function(){const t=Button.getOrCreateInstance(this);e==="toggle"&&t[e]()})}}EventHandler.on(document,EVENT_CLICK_DATA_API$6,SELECTOR_DATA_TOGGLE$5,s=>{s.preventDefault();const e=s.target.closest(SELECTOR_DATA_TOGGLE$5);Button.getOrCreateInstance(e).toggle()});defineJQueryPlugin(Button);const NAME$d="swipe",EVENT_KEY$9=".bs.swipe",EVENT_TOUCHSTART=`touchstart${EVENT_KEY$9}`,EVENT_TOUCHMOVE=`touchmove${EVENT_KEY$9}`,EVENT_TOUCHEND=`touchend${EVENT_KEY$9}`,EVENT_POINTERDOWN=`pointerdown${EVENT_KEY$9}`,EVENT_POINTERUP=`pointerup${EVENT_KEY$9}`,POINTER_TYPE_TOUCH="touch",POINTER_TYPE_PEN="pen",CLASS_NAME_POINTER_EVENT="pointer-event",SWIPE_THRESHOLD=40,Default$c={endCallback:null,leftCallback:null,rightCallback:null},DefaultType$c={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Swipe extends Config$1{constructor(e,t){super(),this._element=e,!(!e||!Swipe.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=!!window.PointerEvent,this._initEvents())}static get Default(){return Default$c}static get DefaultType(){return DefaultType$c}static get NAME(){return NAME$d}dispose(){EventHandler.off(this._element,EVENT_KEY$9)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),execute(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=SWIPE_THRESHOLD)return;const t=e/this._deltaX;this._deltaX=0,t&&execute(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(EventHandler.on(this._element,EVENT_POINTERDOWN,e=>this._start(e)),EventHandler.on(this._element,EVENT_POINTERUP,e=>this._end(e)),this._element.classList.add(CLASS_NAME_POINTER_EVENT)):(EventHandler.on(this._element,EVENT_TOUCHSTART,e=>this._start(e)),EventHandler.on(this._element,EVENT_TOUCHMOVE,e=>this._move(e)),EventHandler.on(this._element,EVENT_TOUCHEND,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===POINTER_TYPE_PEN||e.pointerType===POINTER_TYPE_TOUCH)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const NAME$c="carousel",DATA_KEY$8="bs.carousel",EVENT_KEY$8=`.${DATA_KEY$8}`,DATA_API_KEY$5=".data-api",ARROW_LEFT_KEY$1="ArrowLeft",ARROW_RIGHT_KEY$1="ArrowRight",TOUCHEVENT_COMPAT_WAIT=500,ORDER_NEXT="next",ORDER_PREV="prev",DIRECTION_LEFT="left",DIRECTION_RIGHT="right",EVENT_SLIDE=`slide${EVENT_KEY$8}`,EVENT_SLID=`slid${EVENT_KEY$8}`,EVENT_KEYDOWN$1=`keydown${EVENT_KEY$8}`,EVENT_MOUSEENTER$1=`mouseenter${EVENT_KEY$8}`,EVENT_MOUSELEAVE$1=`mouseleave${EVENT_KEY$8}`,EVENT_DRAG_START=`dragstart${EVENT_KEY$8}`,EVENT_LOAD_DATA_API$3=`load${EVENT_KEY$8}${DATA_API_KEY$5}`,EVENT_CLICK_DATA_API$5=`click${EVENT_KEY$8}${DATA_API_KEY$5}`,CLASS_NAME_CAROUSEL="carousel",CLASS_NAME_ACTIVE$2="active",CLASS_NAME_SLIDE="slide",CLASS_NAME_END="carousel-item-end",CLASS_NAME_START="carousel-item-start",CLASS_NAME_NEXT="carousel-item-next",CLASS_NAME_PREV="carousel-item-prev",SELECTOR_ACTIVE=".active",SELECTOR_ITEM=".carousel-item",SELECTOR_ACTIVE_ITEM=SELECTOR_ACTIVE+SELECTOR_ITEM,SELECTOR_ITEM_IMG=".carousel-item img",SELECTOR_INDICATORS=".carousel-indicators",SELECTOR_DATA_SLIDE="[data-bs-slide], [data-bs-slide-to]",SELECTOR_DATA_RIDE='[data-bs-ride="carousel"]',KEY_TO_DIRECTION={[ARROW_LEFT_KEY$1]:DIRECTION_RIGHT,[ARROW_RIGHT_KEY$1]:DIRECTION_LEFT},Default$b={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},DefaultType$b={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Carousel extends BaseComponent{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=SelectorEngine.findOne(SELECTOR_INDICATORS,this._element),this._addEventListeners(),this._config.ride===CLASS_NAME_CAROUSEL&&this.cycle()}static get Default(){return Default$b}static get DefaultType(){return DefaultType$b}static get NAME(){return NAME$c}next(){this._slide(ORDER_NEXT)}nextWhenVisible(){!document.hidden&&isVisible$1(this._element)&&this.next()}prev(){this._slide(ORDER_PREV)}pause(){this._isSliding&&triggerTransitionEnd(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){EventHandler.one(this._element,EVENT_SLID,()=>this.cycle());return}this.cycle()}}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){EventHandler.one(this._element,EVENT_SLID,()=>this.to(e));return}const i=this._getItemIndex(this._getActive());if(i===e)return;const n=e>i?ORDER_NEXT:ORDER_PREV;this._slide(n,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&EventHandler.on(this._element,EVENT_KEYDOWN$1,e=>this._keydown(e)),this._config.pause==="hover"&&(EventHandler.on(this._element,EVENT_MOUSEENTER$1,()=>this.pause()),EventHandler.on(this._element,EVENT_MOUSELEAVE$1,()=>this._maybeEnableCycle())),this._config.touch&&Swipe.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const i of SelectorEngine.find(SELECTOR_ITEM_IMG,this._element))EventHandler.on(i,EVENT_DRAG_START,n=>n.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(DIRECTION_LEFT)),rightCallback:()=>this._slide(this._directionToOrder(DIRECTION_RIGHT)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),TOUCHEVENT_COMPAT_WAIT+this._config.interval))}};this._swipeHelper=new Swipe(this._element,t)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=KEY_TO_DIRECTION[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=SelectorEngine.findOne(SELECTOR_ACTIVE,this._indicatorsElement);t.classList.remove(CLASS_NAME_ACTIVE$2),t.removeAttribute("aria-current");const i=SelectorEngine.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add(CLASS_NAME_ACTIVE$2),i.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const i=this._getActive(),n=e===ORDER_NEXT,o=t||getNextActiveElement(this._getItems(),i,n,this._config.wrap);if(o===i)return;const r=this._getItemIndex(o),a=v=>EventHandler.trigger(this._element,v,{relatedTarget:o,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:r});if(a(EVENT_SLIDE).defaultPrevented||!i||!o)return;const d=!!this._interval;this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(r),this._activeElement=o;const h=n?CLASS_NAME_START:CLASS_NAME_END,p=n?CLASS_NAME_NEXT:CLASS_NAME_PREV;o.classList.add(p),reflow(o),i.classList.add(h),o.classList.add(h);const m=()=>{o.classList.remove(h,p),o.classList.add(CLASS_NAME_ACTIVE$2),i.classList.remove(CLASS_NAME_ACTIVE$2,p,h),this._isSliding=!1,a(EVENT_SLID)};this._queueCallback(m,i,this._isAnimated()),d&&this.cycle()}_isAnimated(){return this._element.classList.contains(CLASS_NAME_SLIDE)}_getActive(){return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM,this._element)}_getItems(){return SelectorEngine.find(SELECTOR_ITEM,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return isRTL()?e===DIRECTION_LEFT?ORDER_PREV:ORDER_NEXT:e===DIRECTION_LEFT?ORDER_NEXT:ORDER_PREV}_orderToDirection(e){return isRTL()?e===ORDER_PREV?DIRECTION_LEFT:DIRECTION_RIGHT:e===ORDER_PREV?DIRECTION_RIGHT:DIRECTION_LEFT}static jQueryInterface(e){return this.each(function(){const t=Carousel.getOrCreateInstance(this,e);if(typeof e=="number"){t.to(e);return}if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}EventHandler.on(document,EVENT_CLICK_DATA_API$5,SELECTOR_DATA_SLIDE,function(s){const e=SelectorEngine.getElementFromSelector(this);if(!e||!e.classList.contains(CLASS_NAME_CAROUSEL))return;s.preventDefault();const t=Carousel.getOrCreateInstance(e),i=this.getAttribute("data-bs-slide-to");if(i){t.to(i),t._maybeEnableCycle();return}if(Manipulator.getDataAttribute(this,"slide")==="next"){t.next(),t._maybeEnableCycle();return}t.prev(),t._maybeEnableCycle()});EventHandler.on(window,EVENT_LOAD_DATA_API$3,()=>{const s=SelectorEngine.find(SELECTOR_DATA_RIDE);for(const e of s)Carousel.getOrCreateInstance(e)});defineJQueryPlugin(Carousel);const NAME$b="collapse",DATA_KEY$7="bs.collapse",EVENT_KEY$7=`.${DATA_KEY$7}`,DATA_API_KEY$4=".data-api",EVENT_SHOW$6=`show${EVENT_KEY$7}`,EVENT_SHOWN$6=`shown${EVENT_KEY$7}`,EVENT_HIDE$6=`hide${EVENT_KEY$7}`,EVENT_HIDDEN$6=`hidden${EVENT_KEY$7}`,EVENT_CLICK_DATA_API$4=`click${EVENT_KEY$7}${DATA_API_KEY$4}`,CLASS_NAME_SHOW$7="show",CLASS_NAME_COLLAPSE="collapse",CLASS_NAME_COLLAPSING="collapsing",CLASS_NAME_COLLAPSED="collapsed",CLASS_NAME_DEEPER_CHILDREN=`:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`,CLASS_NAME_HORIZONTAL="collapse-horizontal",WIDTH="width",HEIGHT="height",SELECTOR_ACTIVES=".collapse.show, .collapse.collapsing",SELECTOR_DATA_TOGGLE$4='[data-bs-toggle="collapse"]',Default$a={parent:null,toggle:!0},DefaultType$a={parent:"(null|element)",toggle:"boolean"};class Collapse extends BaseComponent{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const i=SelectorEngine.find(SELECTOR_DATA_TOGGLE$4);for(const n of i){const o=SelectorEngine.getSelectorFromElement(n),r=SelectorEngine.find(o).filter(a=>a===this._element);o!==null&&r.length&&this._triggerArray.push(n)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Default$a}static get DefaultType(){return DefaultType$a}static get NAME(){return NAME$b}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(a=>a!==this._element).map(a=>Collapse.getOrCreateInstance(a,{toggle:!1}))),e.length&&e[0]._isTransitioning||EventHandler.trigger(this._element,EVENT_SHOW$6).defaultPrevented)return;for(const a of e)a.hide();const i=this._getDimension();this._element.classList.remove(CLASS_NAME_COLLAPSE),this._element.classList.add(CLASS_NAME_COLLAPSING),this._element.style[i]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const n=()=>{this._isTransitioning=!1,this._element.classList.remove(CLASS_NAME_COLLAPSING),this._element.classList.add(CLASS_NAME_COLLAPSE,CLASS_NAME_SHOW$7),this._element.style[i]="",EventHandler.trigger(this._element,EVENT_SHOWN$6)},r=`scroll${i[0].toUpperCase()+i.slice(1)}`;this._queueCallback(n,this._element,!0),this._element.style[i]=`${this._element[r]}px`}hide(){if(this._isTransitioning||!this._isShown()||EventHandler.trigger(this._element,EVENT_HIDE$6).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,reflow(this._element),this._element.classList.add(CLASS_NAME_COLLAPSING),this._element.classList.remove(CLASS_NAME_COLLAPSE,CLASS_NAME_SHOW$7);for(const n of this._triggerArray){const o=SelectorEngine.getElementFromSelector(n);o&&!this._isShown(o)&&this._addAriaAndCollapsedClass([n],!1)}this._isTransitioning=!0;const i=()=>{this._isTransitioning=!1,this._element.classList.remove(CLASS_NAME_COLLAPSING),this._element.classList.add(CLASS_NAME_COLLAPSE),EventHandler.trigger(this._element,EVENT_HIDDEN$6)};this._element.style[t]="",this._queueCallback(i,this._element,!0)}_isShown(e=this._element){return e.classList.contains(CLASS_NAME_SHOW$7)}_configAfterMerge(e){return e.toggle=!!e.toggle,e.parent=getElement(e.parent),e}_getDimension(){return this._element.classList.contains(CLASS_NAME_HORIZONTAL)?WIDTH:HEIGHT}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4);for(const t of e){const i=SelectorEngine.getElementFromSelector(t);i&&this._addAriaAndCollapsedClass([t],this._isShown(i))}}_getFirstLevelChildren(e){const t=SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN,this._config.parent);return SelectorEngine.find(e,this._config.parent).filter(i=>!t.includes(i))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const i of e)i.classList.toggle(CLASS_NAME_COLLAPSED,!t),i.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return typeof e=="string"&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const i=Collapse.getOrCreateInstance(this,t);if(typeof e=="string"){if(typeof i[e]>"u")throw new TypeError(`No method named "${e}"`);i[e]()}})}}EventHandler.on(document,EVENT_CLICK_DATA_API$4,SELECTOR_DATA_TOGGLE$4,function(s){(s.target.tagName==="A"||s.delegateTarget&&s.delegateTarget.tagName==="A")&&s.preventDefault();for(const e of SelectorEngine.getMultipleElementsFromSelector(this))Collapse.getOrCreateInstance(e,{toggle:!1}).toggle()});defineJQueryPlugin(Collapse);const NAME$a="dropdown",DATA_KEY$6="bs.dropdown",EVENT_KEY$6=`.${DATA_KEY$6}`,DATA_API_KEY$3=".data-api",ESCAPE_KEY$2="Escape",TAB_KEY$1="Tab",ARROW_UP_KEY$1="ArrowUp",ARROW_DOWN_KEY$1="ArrowDown",RIGHT_MOUSE_BUTTON=2,EVENT_HIDE$5=`hide${EVENT_KEY$6}`,EVENT_HIDDEN$5=`hidden${EVENT_KEY$6}`,EVENT_SHOW$5=`show${EVENT_KEY$6}`,EVENT_SHOWN$5=`shown${EVENT_KEY$6}`,EVENT_CLICK_DATA_API$3=`click${EVENT_KEY$6}${DATA_API_KEY$3}`,EVENT_KEYDOWN_DATA_API=`keydown${EVENT_KEY$6}${DATA_API_KEY$3}`,EVENT_KEYUP_DATA_API=`keyup${EVENT_KEY$6}${DATA_API_KEY$3}`,CLASS_NAME_SHOW$6="show",CLASS_NAME_DROPUP="dropup",CLASS_NAME_DROPEND="dropend",CLASS_NAME_DROPSTART="dropstart",CLASS_NAME_DROPUP_CENTER="dropup-center",CLASS_NAME_DROPDOWN_CENTER="dropdown-center",SELECTOR_DATA_TOGGLE$3='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',SELECTOR_DATA_TOGGLE_SHOWN=`${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`,SELECTOR_MENU=".dropdown-menu",SELECTOR_NAVBAR=".navbar",SELECTOR_NAVBAR_NAV=".navbar-nav",SELECTOR_VISIBLE_ITEMS=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",PLACEMENT_TOP=isRTL()?"top-end":"top-start",PLACEMENT_TOPEND=isRTL()?"top-start":"top-end",PLACEMENT_BOTTOM=isRTL()?"bottom-end":"bottom-start",PLACEMENT_BOTTOMEND=isRTL()?"bottom-start":"bottom-end",PLACEMENT_RIGHT=isRTL()?"left-start":"right-start",PLACEMENT_LEFT=isRTL()?"right-start":"left-start",PLACEMENT_TOPCENTER="top",PLACEMENT_BOTTOMCENTER="bottom",Default$9={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},DefaultType$9={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Dropdown extends BaseComponent{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=SelectorEngine.next(this._element,SELECTOR_MENU)[0]||SelectorEngine.prev(this._element,SELECTOR_MENU)[0]||SelectorEngine.findOne(SELECTOR_MENU,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Default$9}static get DefaultType(){return DefaultType$9}static get NAME(){return NAME$a}toggle(){return this._isShown()?this.hide():this.show()}show(){if(isDisabled(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!EventHandler.trigger(this._element,EVENT_SHOW$5,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(SELECTOR_NAVBAR_NAV))for(const i of[].concat(...document.body.children))EventHandler.on(i,"mouseover",noop$3);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(CLASS_NAME_SHOW$6),this._element.classList.add(CLASS_NAME_SHOW$6),EventHandler.trigger(this._element,EVENT_SHOWN$5,e)}}hide(){if(isDisabled(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!EventHandler.trigger(this._element,EVENT_HIDE$5,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const i of[].concat(...document.body.children))EventHandler.off(i,"mouseover",noop$3);this._popper&&this._popper.destroy(),this._menu.classList.remove(CLASS_NAME_SHOW$6),this._element.classList.remove(CLASS_NAME_SHOW$6),this._element.setAttribute("aria-expanded","false"),Manipulator.removeDataAttribute(this._menu,"popper"),EventHandler.trigger(this._element,EVENT_HIDDEN$5,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!isElement(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${NAME$a.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof Popper>"u")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;this._config.reference==="parent"?e=this._parent:isElement(this._config.reference)?e=getElement(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=createPopper(e,this._menu,t)}_isShown(){return this._menu.classList.contains(CLASS_NAME_SHOW$6)}_getPlacement(){const e=this._parent;if(e.classList.contains(CLASS_NAME_DROPEND))return PLACEMENT_RIGHT;if(e.classList.contains(CLASS_NAME_DROPSTART))return PLACEMENT_LEFT;if(e.classList.contains(CLASS_NAME_DROPUP_CENTER))return PLACEMENT_TOPCENTER;if(e.classList.contains(CLASS_NAME_DROPDOWN_CENTER))return PLACEMENT_BOTTOMCENTER;const t=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains(CLASS_NAME_DROPUP)?t?PLACEMENT_TOPEND:PLACEMENT_TOP:t?PLACEMENT_BOTTOMEND:PLACEMENT_BOTTOM}_detectNavbar(){return this._element.closest(SELECTOR_NAVBAR)!==null}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(Manipulator.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...execute(this._config.popperConfig,[e])}}_selectMenuItem({key:e,target:t}){const i=SelectorEngine.find(SELECTOR_VISIBLE_ITEMS,this._menu).filter(n=>isVisible$1(n));i.length&&getNextActiveElement(i,t,e===ARROW_DOWN_KEY$1,!i.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=Dropdown.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(e.button===RIGHT_MOUSE_BUTTON||e.type==="keyup"&&e.key!==TAB_KEY$1)return;const t=SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN);for(const i of t){const n=Dropdown.getInstance(i);if(!n||n._config.autoClose===!1)continue;const o=e.composedPath(),r=o.includes(n._menu);if(o.includes(n._element)||n._config.autoClose==="inside"&&!r||n._config.autoClose==="outside"&&r||n._menu.contains(e.target)&&(e.type==="keyup"&&e.key===TAB_KEY$1||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const a={relatedTarget:n._element};e.type==="click"&&(a.clickEvent=e),n._completeHide(a)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),i=e.key===ESCAPE_KEY$2,n=[ARROW_UP_KEY$1,ARROW_DOWN_KEY$1].includes(e.key);if(!n&&!i||t&&!i)return;e.preventDefault();const o=this.matches(SELECTOR_DATA_TOGGLE$3)?this:SelectorEngine.prev(this,SELECTOR_DATA_TOGGLE$3)[0]||SelectorEngine.next(this,SELECTOR_DATA_TOGGLE$3)[0]||SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3,e.delegateTarget.parentNode),r=Dropdown.getOrCreateInstance(o);if(n){e.stopPropagation(),r.show(),r._selectMenuItem(e);return}r._isShown()&&(e.stopPropagation(),r.hide(),o.focus())}}EventHandler.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_DATA_TOGGLE$3,Dropdown.dataApiKeydownHandler);EventHandler.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_MENU,Dropdown.dataApiKeydownHandler);EventHandler.on(document,EVENT_CLICK_DATA_API$3,Dropdown.clearMenus);EventHandler.on(document,EVENT_KEYUP_DATA_API,Dropdown.clearMenus);EventHandler.on(document,EVENT_CLICK_DATA_API$3,SELECTOR_DATA_TOGGLE$3,function(s){s.preventDefault(),Dropdown.getOrCreateInstance(this).toggle()});defineJQueryPlugin(Dropdown);const NAME$9="backdrop",CLASS_NAME_FADE$4="fade",CLASS_NAME_SHOW$5="show",EVENT_MOUSEDOWN=`mousedown.bs.${NAME$9}`,Default$8={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},DefaultType$8={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Backdrop extends Config$1{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return Default$8}static get DefaultType(){return DefaultType$8}static get NAME(){return NAME$9}show(e){if(!this._config.isVisible){execute(e);return}this._append();const t=this._getElement();this._config.isAnimated&&reflow(t),t.classList.add(CLASS_NAME_SHOW$5),this._emulateAnimation(()=>{execute(e)})}hide(e){if(!this._config.isVisible){execute(e);return}this._getElement().classList.remove(CLASS_NAME_SHOW$5),this._emulateAnimation(()=>{this.dispose(),execute(e)})}dispose(){this._isAppended&&(EventHandler.off(this._element,EVENT_MOUSEDOWN),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(CLASS_NAME_FADE$4),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=getElement(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),EventHandler.on(e,EVENT_MOUSEDOWN,()=>{execute(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){executeAfterTransition(e,this._getElement(),this._config.isAnimated)}}const NAME$8="focustrap",DATA_KEY$5="bs.focustrap",EVENT_KEY$5=`.${DATA_KEY$5}`,EVENT_FOCUSIN$2=`focusin${EVENT_KEY$5}`,EVENT_KEYDOWN_TAB=`keydown.tab${EVENT_KEY$5}`,TAB_KEY="Tab",TAB_NAV_FORWARD="forward",TAB_NAV_BACKWARD="backward",Default$7={autofocus:!0,trapElement:null},DefaultType$7={autofocus:"boolean",trapElement:"element"};class FocusTrap extends Config$1{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Default$7}static get DefaultType(){return DefaultType$7}static get NAME(){return NAME$8}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),EventHandler.off(document,EVENT_KEY$5),EventHandler.on(document,EVENT_FOCUSIN$2,e=>this._handleFocusin(e)),EventHandler.on(document,EVENT_KEYDOWN_TAB,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,EventHandler.off(document,EVENT_KEY$5))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const i=SelectorEngine.focusableChildren(t);i.length===0?t.focus():this._lastTabNavDirection===TAB_NAV_BACKWARD?i[i.length-1].focus():i[0].focus()}_handleKeydown(e){e.key===TAB_KEY&&(this._lastTabNavDirection=e.shiftKey?TAB_NAV_BACKWARD:TAB_NAV_FORWARD)}}const SELECTOR_FIXED_CONTENT=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",SELECTOR_STICKY_CONTENT=".sticky-top",PROPERTY_PADDING="padding-right",PROPERTY_MARGIN="margin-right";class ScrollBarHelper{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,PROPERTY_PADDING,t=>t+e),this._setElementAttributes(SELECTOR_FIXED_CONTENT,PROPERTY_PADDING,t=>t+e),this._setElementAttributes(SELECTOR_STICKY_CONTENT,PROPERTY_MARGIN,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,PROPERTY_PADDING),this._resetElementAttributes(SELECTOR_FIXED_CONTENT,PROPERTY_PADDING),this._resetElementAttributes(SELECTOR_STICKY_CONTENT,PROPERTY_MARGIN)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,i){const n=this.getWidth(),o=r=>{if(r!==this._element&&window.innerWidth>r.clientWidth+n)return;this._saveInitialAttribute(r,t);const a=window.getComputedStyle(r).getPropertyValue(t);r.style.setProperty(t,`${i(Number.parseFloat(a))}px`)};this._applyManipulationCallback(e,o)}_saveInitialAttribute(e,t){const i=e.style.getPropertyValue(t);i&&Manipulator.setDataAttribute(e,t,i)}_resetElementAttributes(e,t){const i=n=>{const o=Manipulator.getDataAttribute(n,t);if(o===null){n.style.removeProperty(t);return}Manipulator.removeDataAttribute(n,t),n.style.setProperty(t,o)};this._applyManipulationCallback(e,i)}_applyManipulationCallback(e,t){if(isElement(e)){t(e);return}for(const i of SelectorEngine.find(e,this._element))t(i)}}const NAME$7="modal",DATA_KEY$4="bs.modal",EVENT_KEY$4=`.${DATA_KEY$4}`,DATA_API_KEY$2=".data-api",ESCAPE_KEY$1="Escape",EVENT_HIDE$4=`hide${EVENT_KEY$4}`,EVENT_HIDE_PREVENTED$1=`hidePrevented${EVENT_KEY$4}`,EVENT_HIDDEN$4=`hidden${EVENT_KEY$4}`,EVENT_SHOW$4=`show${EVENT_KEY$4}`,EVENT_SHOWN$4=`shown${EVENT_KEY$4}`,EVENT_RESIZE$1=`resize${EVENT_KEY$4}`,EVENT_CLICK_DISMISS=`click.dismiss${EVENT_KEY$4}`,EVENT_MOUSEDOWN_DISMISS=`mousedown.dismiss${EVENT_KEY$4}`,EVENT_KEYDOWN_DISMISS$1=`keydown.dismiss${EVENT_KEY$4}`,EVENT_CLICK_DATA_API$2=`click${EVENT_KEY$4}${DATA_API_KEY$2}`,CLASS_NAME_OPEN="modal-open",CLASS_NAME_FADE$3="fade",CLASS_NAME_SHOW$4="show",CLASS_NAME_STATIC="modal-static",OPEN_SELECTOR$1=".modal.show",SELECTOR_DIALOG=".modal-dialog",SELECTOR_MODAL_BODY=".modal-body",SELECTOR_DATA_TOGGLE$2='[data-bs-toggle="modal"]',Default$6={backdrop:!0,focus:!0,keyboard:!0},DefaultType$6={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Modal extends BaseComponent{constructor(e,t){super(e,t),this._dialog=SelectorEngine.findOne(SELECTOR_DIALOG,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new ScrollBarHelper,this._addEventListeners()}static get Default(){return Default$6}static get DefaultType(){return DefaultType$6}static get NAME(){return NAME$7}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||EventHandler.trigger(this._element,EVENT_SHOW$4,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(CLASS_NAME_OPEN),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||EventHandler.trigger(this._element,EVENT_HIDE$4).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(CLASS_NAME_SHOW$4),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){EventHandler.off(window,EVENT_KEY$4),EventHandler.off(this._dialog,EVENT_KEY$4),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Backdrop({isVisible:!!this._config.backdrop,isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new FocusTrap({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=SelectorEngine.findOne(SELECTOR_MODAL_BODY,this._dialog);t&&(t.scrollTop=0),reflow(this._element),this._element.classList.add(CLASS_NAME_SHOW$4);const i=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,EventHandler.trigger(this._element,EVENT_SHOWN$4,{relatedTarget:e})};this._queueCallback(i,this._dialog,this._isAnimated())}_addEventListeners(){EventHandler.on(this._element,EVENT_KEYDOWN_DISMISS$1,e=>{if(e.key===ESCAPE_KEY$1){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),EventHandler.on(window,EVENT_RESIZE$1,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),EventHandler.on(this._element,EVENT_MOUSEDOWN_DISMISS,e=>{EventHandler.one(this._element,EVENT_CLICK_DISMISS,t=>{if(!(this._element!==e.target||this._element!==t.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(CLASS_NAME_OPEN),this._resetAdjustments(),this._scrollBar.reset(),EventHandler.trigger(this._element,EVENT_HIDDEN$4)})}_isAnimated(){return this._element.classList.contains(CLASS_NAME_FADE$3)}_triggerBackdropTransition(){if(EventHandler.trigger(this._element,EVENT_HIDE_PREVENTED$1).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,i=this._element.style.overflowY;i==="hidden"||this._element.classList.contains(CLASS_NAME_STATIC)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(CLASS_NAME_STATIC),this._queueCallback(()=>{this._element.classList.remove(CLASS_NAME_STATIC),this._queueCallback(()=>{this._element.style.overflowY=i},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),i=t>0;if(i&&!e){const n=isRTL()?"paddingLeft":"paddingRight";this._element.style[n]=`${t}px`}if(!i&&e){const n=isRTL()?"paddingRight":"paddingLeft";this._element.style[n]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const i=Modal.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof i[e]>"u")throw new TypeError(`No method named "${e}"`);i[e](t)}})}}EventHandler.on(document,EVENT_CLICK_DATA_API$2,SELECTOR_DATA_TOGGLE$2,function(s){const e=SelectorEngine.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&s.preventDefault(),EventHandler.one(e,EVENT_SHOW$4,n=>{n.defaultPrevented||EventHandler.one(e,EVENT_HIDDEN$4,()=>{isVisible$1(this)&&this.focus()})});const t=SelectorEngine.findOne(OPEN_SELECTOR$1);t&&Modal.getInstance(t).hide(),Modal.getOrCreateInstance(e).toggle(this)});enableDismissTrigger(Modal);defineJQueryPlugin(Modal);const NAME$6="offcanvas",DATA_KEY$3="bs.offcanvas",EVENT_KEY$3=`.${DATA_KEY$3}`,DATA_API_KEY$1=".data-api",EVENT_LOAD_DATA_API$2=`load${EVENT_KEY$3}${DATA_API_KEY$1}`,ESCAPE_KEY="Escape",CLASS_NAME_SHOW$3="show",CLASS_NAME_SHOWING$1="showing",CLASS_NAME_HIDING="hiding",CLASS_NAME_BACKDROP="offcanvas-backdrop",OPEN_SELECTOR=".offcanvas.show",EVENT_SHOW$3=`show${EVENT_KEY$3}`,EVENT_SHOWN$3=`shown${EVENT_KEY$3}`,EVENT_HIDE$3=`hide${EVENT_KEY$3}`,EVENT_HIDE_PREVENTED=`hidePrevented${EVENT_KEY$3}`,EVENT_HIDDEN$3=`hidden${EVENT_KEY$3}`,EVENT_RESIZE=`resize${EVENT_KEY$3}`,EVENT_CLICK_DATA_API$1=`click${EVENT_KEY$3}${DATA_API_KEY$1}`,EVENT_KEYDOWN_DISMISS=`keydown.dismiss${EVENT_KEY$3}`,SELECTOR_DATA_TOGGLE$1='[data-bs-toggle="offcanvas"]',Default$5={backdrop:!0,keyboard:!0,scroll:!1},DefaultType$5={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class Offcanvas extends BaseComponent{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Default$5}static get DefaultType(){return DefaultType$5}static get NAME(){return NAME$6}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||EventHandler.trigger(this._element,EVENT_SHOW$3,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new ScrollBarHelper().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(CLASS_NAME_SHOWING$1);const i=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(CLASS_NAME_SHOW$3),this._element.classList.remove(CLASS_NAME_SHOWING$1),EventHandler.trigger(this._element,EVENT_SHOWN$3,{relatedTarget:e})};this._queueCallback(i,this._element,!0)}hide(){if(!this._isShown||EventHandler.trigger(this._element,EVENT_HIDE$3).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(CLASS_NAME_HIDING),this._backdrop.hide();const t=()=>{this._element.classList.remove(CLASS_NAME_SHOW$3,CLASS_NAME_HIDING),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new ScrollBarHelper().reset(),EventHandler.trigger(this._element,EVENT_HIDDEN$3)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=()=>{if(this._config.backdrop==="static"){EventHandler.trigger(this._element,EVENT_HIDE_PREVENTED);return}this.hide()},t=!!this._config.backdrop;return new Backdrop({className:CLASS_NAME_BACKDROP,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new FocusTrap({trapElement:this._element})}_addEventListeners(){EventHandler.on(this._element,EVENT_KEYDOWN_DISMISS,e=>{if(e.key===ESCAPE_KEY){if(this._config.keyboard){this.hide();return}EventHandler.trigger(this._element,EVENT_HIDE_PREVENTED)}})}static jQueryInterface(e){return this.each(function(){const t=Offcanvas.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}EventHandler.on(document,EVENT_CLICK_DATA_API$1,SELECTOR_DATA_TOGGLE$1,function(s){const e=SelectorEngine.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),isDisabled(this))return;EventHandler.one(e,EVENT_HIDDEN$3,()=>{isVisible$1(this)&&this.focus()});const t=SelectorEngine.findOne(OPEN_SELECTOR);t&&t!==e&&Offcanvas.getInstance(t).hide(),Offcanvas.getOrCreateInstance(e).toggle(this)});EventHandler.on(window,EVENT_LOAD_DATA_API$2,()=>{for(const s of SelectorEngine.find(OPEN_SELECTOR))Offcanvas.getOrCreateInstance(s).show()});EventHandler.on(window,EVENT_RESIZE,()=>{for(const s of SelectorEngine.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(s).position!=="fixed"&&Offcanvas.getOrCreateInstance(s).hide()});enableDismissTrigger(Offcanvas);defineJQueryPlugin(Offcanvas);const ARIA_ATTRIBUTE_PATTERN=/^aria-[\w-]*$/i,DefaultAllowlist={"*":["class","dir","id","lang","role",ARIA_ATTRIBUTE_PATTERN],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},uriAttributes=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),SAFE_URL_PATTERN=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,allowedAttribute=(s,e)=>{const t=s.nodeName.toLowerCase();return e.includes(t)?uriAttributes.has(t)?!!SAFE_URL_PATTERN.test(s.nodeValue):!0:e.filter(i=>i instanceof RegExp).some(i=>i.test(t))};function sanitizeHtml(s,e,t){if(!s.length)return s;if(t&&typeof t=="function")return t(s);const n=new window.DOMParser().parseFromString(s,"text/html"),o=[].concat(...n.body.querySelectorAll("*"));for(const r of o){const a=r.nodeName.toLowerCase();if(!Object.keys(e).includes(a)){r.remove();continue}const l=[].concat(...r.attributes),d=[].concat(e["*"]||[],e[a]||[]);for(const h of l)allowedAttribute(h,d)||r.removeAttribute(h.nodeName)}return n.body.innerHTML}const NAME$5="TemplateFactory",Default$4={allowList:DefaultAllowlist,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},DefaultType$4={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},DefaultContentType={entry:"(string|element|function|null)",selector:"(string|element)"};class TemplateFactory extends Config$1{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return Default$4}static get DefaultType(){return DefaultType$4}static get NAME(){return NAME$5}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[n,o]of Object.entries(this._config.content))this._setContent(e,o,n);const t=e.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&t.classList.add(...i.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,i]of Object.entries(e))super._typeCheckConfig({selector:t,entry:i},DefaultContentType)}_setContent(e,t,i){const n=SelectorEngine.findOne(i,e);if(n){if(t=this._resolvePossibleFunction(t),!t){n.remove();return}if(isElement(t)){this._putElementInTemplate(getElement(t),n);return}if(this._config.html){n.innerHTML=this._maybeSanitize(t);return}n.textContent=t}}_maybeSanitize(e){return this._config.sanitize?sanitizeHtml(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return execute(e,[this])}_putElementInTemplate(e,t){if(this._config.html){t.innerHTML="",t.append(e);return}t.textContent=e.textContent}}const NAME$4="tooltip",DISALLOWED_ATTRIBUTES=new Set(["sanitize","allowList","sanitizeFn"]),CLASS_NAME_FADE$2="fade",CLASS_NAME_MODAL="modal",CLASS_NAME_SHOW$2="show",SELECTOR_TOOLTIP_INNER=".tooltip-inner",SELECTOR_MODAL=`.${CLASS_NAME_MODAL}`,EVENT_MODAL_HIDE="hide.bs.modal",TRIGGER_HOVER="hover",TRIGGER_FOCUS="focus",TRIGGER_CLICK="click",TRIGGER_MANUAL="manual",EVENT_HIDE$2="hide",EVENT_HIDDEN$2="hidden",EVENT_SHOW$2="show",EVENT_SHOWN$2="shown",EVENT_INSERTED="inserted",EVENT_CLICK$1="click",EVENT_FOCUSIN$1="focusin",EVENT_FOCUSOUT$1="focusout",EVENT_MOUSEENTER="mouseenter",EVENT_MOUSELEAVE="mouseleave",AttachmentMap={AUTO:"auto",TOP:"top",RIGHT:isRTL()?"left":"right",BOTTOM:"bottom",LEFT:isRTL()?"right":"left"},Default$3={allowList:DefaultAllowlist,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},DefaultType$3={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};let Tooltip$1=class Nn extends BaseComponent{constructor(e,t){if(typeof Popper>"u")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Default$3}static get DefaultType(){return DefaultType$3}static get NAME(){return NAME$4}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),EventHandler.off(this._element.closest(SELECTOR_MODAL),EVENT_MODAL_HIDE,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;const e=EventHandler.trigger(this._element,this.constructor.eventName(EVENT_SHOW$2)),i=(findShadowRoot(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!i)return;this._disposePopper();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));const{container:o}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(o.append(n),EventHandler.trigger(this._element,this.constructor.eventName(EVENT_INSERTED))),this._popper=this._createPopper(n),n.classList.add(CLASS_NAME_SHOW$2),"ontouchstart"in document.documentElement)for(const a of[].concat(...document.body.children))EventHandler.on(a,"mouseover",noop$3);const r=()=>{EventHandler.trigger(this._element,this.constructor.eventName(EVENT_SHOWN$2)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(r,this.tip,this._isAnimated())}hide(){if(!this._isShown()||EventHandler.trigger(this._element,this.constructor.eventName(EVENT_HIDE$2)).defaultPrevented)return;if(this._getTipElement().classList.remove(CLASS_NAME_SHOW$2),"ontouchstart"in document.documentElement)for(const n of[].concat(...document.body.children))EventHandler.off(n,"mouseover",noop$3);this._activeTrigger[TRIGGER_CLICK]=!1,this._activeTrigger[TRIGGER_FOCUS]=!1,this._activeTrigger[TRIGGER_HOVER]=!1,this._isHovered=null;const i=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),EventHandler.trigger(this._element,this.constructor.eventName(EVENT_HIDDEN$2)))};this._queueCallback(i,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return!!this._getTitle()}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(CLASS_NAME_FADE$2,CLASS_NAME_SHOW$2),t.classList.add(`bs-${this.constructor.NAME}-auto`);const i=getUID(this.constructor.NAME).toString();return t.setAttribute("id",i),this._isAnimated()&&t.classList.add(CLASS_NAME_FADE$2),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new TemplateFactory({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[SELECTOR_TOOLTIP_INNER]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(CLASS_NAME_FADE$2)}_isShown(){return this.tip&&this.tip.classList.contains(CLASS_NAME_SHOW$2)}_createPopper(e){const t=execute(this._config.placement,[this,e,this._element]),i=AttachmentMap[t.toUpperCase()];return createPopper(this._element,e,this._getPopperConfig(i))}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_resolvePossibleFunction(e){return execute(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:i=>{this._getTipElement().setAttribute("data-popper-placement",i.state.placement)}}]};return{...t,...execute(this._config.popperConfig,[t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if(t==="click")EventHandler.on(this._element,this.constructor.eventName(EVENT_CLICK$1),this._config.selector,i=>{this._initializeOnDelegatedTarget(i).toggle()});else if(t!==TRIGGER_MANUAL){const i=t===TRIGGER_HOVER?this.constructor.eventName(EVENT_MOUSEENTER):this.constructor.eventName(EVENT_FOCUSIN$1),n=t===TRIGGER_HOVER?this.constructor.eventName(EVENT_MOUSELEAVE):this.constructor.eventName(EVENT_FOCUSOUT$1);EventHandler.on(this._element,i,this._config.selector,o=>{const r=this._initializeOnDelegatedTarget(o);r._activeTrigger[o.type==="focusin"?TRIGGER_FOCUS:TRIGGER_HOVER]=!0,r._enter()}),EventHandler.on(this._element,n,this._config.selector,o=>{const r=this._initializeOnDelegatedTarget(o);r._activeTrigger[o.type==="focusout"?TRIGGER_FOCUS:TRIGGER_HOVER]=r._element.contains(o.relatedTarget),r._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},EventHandler.on(this._element.closest(SELECTOR_MODAL),EVENT_MODAL_HIDE,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=Manipulator.getDataAttributes(this._element);for(const i of Object.keys(t))DISALLOWED_ATTRIBUTES.has(i)&&delete t[i];return e={...t,...typeof e=="object"&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:getElement(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,i]of Object.entries(this._config))this.constructor.Default[t]!==i&&(e[t]=i);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=Nn.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}};defineJQueryPlugin(Tooltip$1);const NAME$3="popover",SELECTOR_TITLE=".popover-header",SELECTOR_CONTENT=".popover-body",Default$2={...Tooltip$1.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},DefaultType$2={...Tooltip$1.DefaultType,content:"(null|string|element|function)"};class Popover extends Tooltip$1{static get Default(){return Default$2}static get DefaultType(){return DefaultType$2}static get NAME(){return NAME$3}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[SELECTOR_TITLE]:this._getTitle(),[SELECTOR_CONTENT]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=Popover.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e]()}})}}defineJQueryPlugin(Popover);const NAME$2="scrollspy",DATA_KEY$2="bs.scrollspy",EVENT_KEY$2=`.${DATA_KEY$2}`,DATA_API_KEY=".data-api",EVENT_ACTIVATE=`activate${EVENT_KEY$2}`,EVENT_CLICK=`click${EVENT_KEY$2}`,EVENT_LOAD_DATA_API$1=`load${EVENT_KEY$2}${DATA_API_KEY}`,CLASS_NAME_DROPDOWN_ITEM="dropdown-item",CLASS_NAME_ACTIVE$1="active",SELECTOR_DATA_SPY='[data-bs-spy="scroll"]',SELECTOR_TARGET_LINKS="[href]",SELECTOR_NAV_LIST_GROUP=".nav, .list-group",SELECTOR_NAV_LINKS=".nav-link",SELECTOR_NAV_ITEMS=".nav-item",SELECTOR_LIST_ITEMS=".list-group-item",SELECTOR_LINK_ITEMS=`${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`,SELECTOR_DROPDOWN=".dropdown",SELECTOR_DROPDOWN_TOGGLE$1=".dropdown-toggle",Default$1={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},DefaultType$1={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class ScrollSpy extends BaseComponent{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Default$1}static get DefaultType(){return DefaultType$1}static get NAME(){return NAME$2}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=getElement(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold=="string"&&(e.threshold=e.threshold.split(",").map(t=>Number.parseFloat(t))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(EventHandler.off(this._config.target,EVENT_CLICK),EventHandler.on(this._config.target,EVENT_CLICK,SELECTOR_TARGET_LINKS,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const i=this._rootElement||window,n=t.offsetTop-this._element.offsetTop;if(i.scrollTo){i.scrollTo({top:n,behavior:"smooth"});return}i.scrollTop=n}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),e)}_observerCallback(e){const t=r=>this._targetLinks.get(`#${r.target.id}`),i=r=>{this._previousScrollData.visibleEntryTop=r.target.offsetTop,this._process(t(r))},n=(this._rootElement||document.documentElement).scrollTop,o=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const r of e){if(!r.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(r));continue}const a=r.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&a){if(i(r),!n)return;continue}!o&&!a&&i(r)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=SelectorEngine.find(SELECTOR_TARGET_LINKS,this._config.target);for(const t of e){if(!t.hash||isDisabled(t))continue;const i=SelectorEngine.findOne(decodeURI(t.hash),this._element);isVisible$1(i)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,i))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(CLASS_NAME_ACTIVE$1),this._activateParents(e),EventHandler.trigger(this._element,EVENT_ACTIVATE,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(CLASS_NAME_DROPDOWN_ITEM)){SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1,e.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1);return}for(const t of SelectorEngine.parents(e,SELECTOR_NAV_LIST_GROUP))for(const i of SelectorEngine.prev(t,SELECTOR_LINK_ITEMS))i.classList.add(CLASS_NAME_ACTIVE$1)}_clearActiveClass(e){e.classList.remove(CLASS_NAME_ACTIVE$1);const t=SelectorEngine.find(`${SELECTOR_TARGET_LINKS}.${CLASS_NAME_ACTIVE$1}`,e);for(const i of t)i.classList.remove(CLASS_NAME_ACTIVE$1)}static jQueryInterface(e){return this.each(function(){const t=ScrollSpy.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}EventHandler.on(window,EVENT_LOAD_DATA_API$1,()=>{for(const s of SelectorEngine.find(SELECTOR_DATA_SPY))ScrollSpy.getOrCreateInstance(s)});defineJQueryPlugin(ScrollSpy);const NAME$1="tab",DATA_KEY$1="bs.tab",EVENT_KEY$1=`.${DATA_KEY$1}`,EVENT_HIDE$1=`hide${EVENT_KEY$1}`,EVENT_HIDDEN$1=`hidden${EVENT_KEY$1}`,EVENT_SHOW$1=`show${EVENT_KEY$1}`,EVENT_SHOWN$1=`shown${EVENT_KEY$1}`,EVENT_CLICK_DATA_API=`click${EVENT_KEY$1}`,EVENT_KEYDOWN=`keydown${EVENT_KEY$1}`,EVENT_LOAD_DATA_API=`load${EVENT_KEY$1}`,ARROW_LEFT_KEY="ArrowLeft",ARROW_RIGHT_KEY="ArrowRight",ARROW_UP_KEY="ArrowUp",ARROW_DOWN_KEY="ArrowDown",HOME_KEY="Home",END_KEY="End",CLASS_NAME_ACTIVE="active",CLASS_NAME_FADE$1="fade",CLASS_NAME_SHOW$1="show",CLASS_DROPDOWN="dropdown",SELECTOR_DROPDOWN_TOGGLE=".dropdown-toggle",SELECTOR_DROPDOWN_MENU=".dropdown-menu",NOT_SELECTOR_DROPDOWN_TOGGLE=`:not(${SELECTOR_DROPDOWN_TOGGLE})`,SELECTOR_TAB_PANEL='.list-group, .nav, [role="tablist"]',SELECTOR_OUTER=".nav-item, .list-group-item",SELECTOR_INNER=`.nav-link${NOT_SELECTOR_DROPDOWN_TOGGLE}, .list-group-item${NOT_SELECTOR_DROPDOWN_TOGGLE}, [role="tab"]${NOT_SELECTOR_DROPDOWN_TOGGLE}`,SELECTOR_DATA_TOGGLE='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',SELECTOR_INNER_ELEM=`${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE}`,SELECTOR_DATA_TOGGLE_ACTIVE=`.${CLASS_NAME_ACTIVE}[data-bs-toggle="tab"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="pill"], .${CLASS_NAME_ACTIVE}[data-bs-toggle="list"]`;class Tab extends BaseComponent{constructor(e){super(e),this._parent=this._element.closest(SELECTOR_TAB_PANEL),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),EventHandler.on(this._element,EVENT_KEYDOWN,t=>this._keydown(t)))}static get NAME(){return NAME$1}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),i=t?EventHandler.trigger(t,EVENT_HIDE$1,{relatedTarget:e}):null;EventHandler.trigger(e,EVENT_SHOW$1,{relatedTarget:t}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(CLASS_NAME_ACTIVE),this._activate(SelectorEngine.getElementFromSelector(e));const i=()=>{if(e.getAttribute("role")!=="tab"){e.classList.add(CLASS_NAME_SHOW$1);return}e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),EventHandler.trigger(e,EVENT_SHOWN$1,{relatedTarget:t})};this._queueCallback(i,e,e.classList.contains(CLASS_NAME_FADE$1))}_deactivate(e,t){if(!e)return;e.classList.remove(CLASS_NAME_ACTIVE),e.blur(),this._deactivate(SelectorEngine.getElementFromSelector(e));const i=()=>{if(e.getAttribute("role")!=="tab"){e.classList.remove(CLASS_NAME_SHOW$1);return}e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),EventHandler.trigger(e,EVENT_HIDDEN$1,{relatedTarget:t})};this._queueCallback(i,e,e.classList.contains(CLASS_NAME_FADE$1))}_keydown(e){if(![ARROW_LEFT_KEY,ARROW_RIGHT_KEY,ARROW_UP_KEY,ARROW_DOWN_KEY,HOME_KEY,END_KEY].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(n=>!isDisabled(n));let i;if([HOME_KEY,END_KEY].includes(e.key))i=t[e.key===HOME_KEY?0:t.length-1];else{const n=[ARROW_RIGHT_KEY,ARROW_DOWN_KEY].includes(e.key);i=getNextActiveElement(t,e.target,n,!0)}i&&(i.focus({preventScroll:!0}),Tab.getOrCreateInstance(i).show())}_getChildren(){return SelectorEngine.find(SELECTOR_INNER_ELEM,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const i of t)this._setInitialAttributesOnChild(i)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),i=this._getOuterElement(e);e.setAttribute("aria-selected",t),i!==e&&this._setAttributeIfNotExists(i,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=SelectorEngine.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const i=this._getOuterElement(e);if(!i.classList.contains(CLASS_DROPDOWN))return;const n=(o,r)=>{const a=SelectorEngine.findOne(o,i);a&&a.classList.toggle(r,t)};n(SELECTOR_DROPDOWN_TOGGLE,CLASS_NAME_ACTIVE),n(SELECTOR_DROPDOWN_MENU,CLASS_NAME_SHOW$1),i.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,i){e.hasAttribute(t)||e.setAttribute(t,i)}_elemIsActive(e){return e.classList.contains(CLASS_NAME_ACTIVE)}_getInnerElement(e){return e.matches(SELECTOR_INNER_ELEM)?e:SelectorEngine.findOne(SELECTOR_INNER_ELEM,e)}_getOuterElement(e){return e.closest(SELECTOR_OUTER)||e}static jQueryInterface(e){return this.each(function(){const t=Tab.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}EventHandler.on(document,EVENT_CLICK_DATA_API,SELECTOR_DATA_TOGGLE,function(s){["A","AREA"].includes(this.tagName)&&s.preventDefault(),!isDisabled(this)&&Tab.getOrCreateInstance(this).show()});EventHandler.on(window,EVENT_LOAD_DATA_API,()=>{for(const s of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE))Tab.getOrCreateInstance(s)});defineJQueryPlugin(Tab);const NAME="toast",DATA_KEY="bs.toast",EVENT_KEY=`.${DATA_KEY}`,EVENT_MOUSEOVER=`mouseover${EVENT_KEY}`,EVENT_MOUSEOUT=`mouseout${EVENT_KEY}`,EVENT_FOCUSIN=`focusin${EVENT_KEY}`,EVENT_FOCUSOUT=`focusout${EVENT_KEY}`,EVENT_HIDE=`hide${EVENT_KEY}`,EVENT_HIDDEN=`hidden${EVENT_KEY}`,EVENT_SHOW=`show${EVENT_KEY}`,EVENT_SHOWN=`shown${EVENT_KEY}`,CLASS_NAME_FADE="fade",CLASS_NAME_HIDE="hide",CLASS_NAME_SHOW="show",CLASS_NAME_SHOWING="showing",DefaultType={animation:"boolean",autohide:"boolean",delay:"number"},Default={animation:!0,autohide:!0,delay:5e3};class Toast extends BaseComponent{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Default}static get DefaultType(){return DefaultType}static get NAME(){return NAME}show(){if(EventHandler.trigger(this._element,EVENT_SHOW).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(CLASS_NAME_FADE);const t=()=>{this._element.classList.remove(CLASS_NAME_SHOWING),EventHandler.trigger(this._element,EVENT_SHOWN),this._maybeScheduleHide()};this._element.classList.remove(CLASS_NAME_HIDE),reflow(this._element),this._element.classList.add(CLASS_NAME_SHOW,CLASS_NAME_SHOWING),this._queueCallback(t,this._element,this._config.animation)}hide(){if(!this.isShown()||EventHandler.trigger(this._element,EVENT_HIDE).defaultPrevented)return;const t=()=>{this._element.classList.add(CLASS_NAME_HIDE),this._element.classList.remove(CLASS_NAME_SHOWING,CLASS_NAME_SHOW),EventHandler.trigger(this._element,EVENT_HIDDEN)};this._element.classList.add(CLASS_NAME_SHOWING),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(CLASS_NAME_SHOW),super.dispose()}isShown(){return this._element.classList.contains(CLASS_NAME_SHOW)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=t;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=t;break}}if(t){this._clearTimeout();return}const i=e.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){EventHandler.on(this._element,EVENT_MOUSEOVER,e=>this._onInteraction(e,!0)),EventHandler.on(this._element,EVENT_MOUSEOUT,e=>this._onInteraction(e,!1)),EventHandler.on(this._element,EVENT_FOCUSIN,e=>this._onInteraction(e,!0)),EventHandler.on(this._element,EVENT_FOCUSOUT,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=Toast.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]>"u")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}enableDismissTrigger(Toast);defineJQueryPlugin(Toast);function toDate(s){const e=Object.prototype.toString.call(s);return s instanceof Date||typeof s=="object"&&e==="[object Date]"?new s.constructor(+s):typeof s=="number"||e==="[object Number]"||typeof s=="string"||e==="[object String]"?new Date(s):new Date(NaN)}function constructFrom(s,e){return s instanceof Date?new s.constructor(e):new Date(e)}function addDays(s,e){const t=toDate(s);return isNaN(e)?constructFrom(s,NaN):(e&&t.setDate(t.getDate()+e),t)}function addMonths(s,e){const t=toDate(s);if(isNaN(e))return constructFrom(s,NaN);if(!e)return t;const i=t.getDate(),n=constructFrom(s,t.getTime());n.setMonth(t.getMonth()+e+1,0);const o=n.getDate();return i>=o?n:(t.setFullYear(n.getFullYear(),n.getMonth(),i),t)}function addMilliseconds(s,e){const t=+toDate(s);return constructFrom(s,t+e)}const millisecondsInWeek=6048e5,millisecondsInDay=864e5,millisecondsInMinute=6e4,millisecondsInHour=36e5,millisecondsInSecond=1e3;function addHours(s,e){return addMilliseconds(s,e*millisecondsInHour)}let defaultOptions={};function getDefaultOptions$1(){return defaultOptions}function startOfWeek(s,e){var a,l,d,h;const t=getDefaultOptions$1(),i=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??t.weekStartsOn??((h=(d=t.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,n=toDate(s),o=n.getDay(),r=(o<i?7:0)+o-i;return n.setDate(n.getDate()-r),n.setHours(0,0,0,0),n}function startOfISOWeek(s){return startOfWeek(s,{weekStartsOn:1})}function getISOWeekYear(s){const e=toDate(s),t=e.getFullYear(),i=constructFrom(s,0);i.setFullYear(t+1,0,4),i.setHours(0,0,0,0);const n=startOfISOWeek(i),o=constructFrom(s,0);o.setFullYear(t,0,4),o.setHours(0,0,0,0);const r=startOfISOWeek(o);return e.getTime()>=n.getTime()?t+1:e.getTime()>=r.getTime()?t:t-1}function startOfDay(s){const e=toDate(s);return e.setHours(0,0,0,0),e}function getTimezoneOffsetInMilliseconds(s){const e=toDate(s),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+s-+t}function differenceInCalendarDays(s,e){const t=startOfDay(s),i=startOfDay(e),n=+t-getTimezoneOffsetInMilliseconds(t),o=+i-getTimezoneOffsetInMilliseconds(i);return Math.round((n-o)/millisecondsInDay)}function startOfISOWeekYear(s){const e=getISOWeekYear(s),t=constructFrom(s,0);return t.setFullYear(e,0,4),t.setHours(0,0,0,0),startOfISOWeek(t)}function addMinutes(s,e){return addMilliseconds(s,e*millisecondsInMinute)}function addQuarters(s,e){const t=e*3;return addMonths(s,t)}function addSeconds(s,e){return addMilliseconds(s,e*1e3)}function addWeeks(s,e){const t=e*7;return addDays(s,t)}function addYears(s,e){return addMonths(s,e*12)}function compareAsc(s,e){const t=toDate(s),i=toDate(e),n=t.getTime()-i.getTime();return n<0?-1:n>0?1:n}function isDate(s){return s instanceof Date||typeof s=="object"&&Object.prototype.toString.call(s)==="[object Date]"}function isValid(s){if(!isDate(s)&&typeof s!="number")return!1;const e=toDate(s);return!isNaN(Number(e))}function differenceInCalendarMonths(s,e){const t=toDate(s),i=toDate(e),n=t.getFullYear()-i.getFullYear(),o=t.getMonth()-i.getMonth();return n*12+o}function differenceInCalendarYears(s,e){const t=toDate(s),i=toDate(e);return t.getFullYear()-i.getFullYear()}function differenceInDays(s,e){const t=toDate(s),i=toDate(e),n=compareLocalAsc(t,i),o=Math.abs(differenceInCalendarDays(t,i));t.setDate(t.getDate()-n*o);const r=+(compareLocalAsc(t,i)===-n),a=n*(o-r);return a===0?0:a}function compareLocalAsc(s,e){const t=s.getFullYear()-e.getFullYear()||s.getMonth()-e.getMonth()||s.getDate()-e.getDate()||s.getHours()-e.getHours()||s.getMinutes()-e.getMinutes()||s.getSeconds()-e.getSeconds()||s.getMilliseconds()-e.getMilliseconds();return t<0?-1:t>0?1:t}function getRoundingMethod(s){return e=>{const i=(s?Math[s]:Math.trunc)(e);return i===0?0:i}}function differenceInMilliseconds(s,e){return+toDate(s)-+toDate(e)}function differenceInHours(s,e,t){const i=differenceInMilliseconds(s,e)/millisecondsInHour;return getRoundingMethod(t==null?void 0:t.roundingMethod)(i)}function differenceInMinutes(s,e,t){const i=differenceInMilliseconds(s,e)/millisecondsInMinute;return getRoundingMethod(t==null?void 0:t.roundingMethod)(i)}function endOfDay(s){const e=toDate(s);return e.setHours(23,59,59,999),e}function endOfMonth(s){const e=toDate(s),t=e.getMonth();return e.setFullYear(e.getFullYear(),t+1,0),e.setHours(23,59,59,999),e}function isLastDayOfMonth(s){const e=toDate(s);return+endOfDay(e)==+endOfMonth(e)}function differenceInMonths(s,e){const t=toDate(s),i=toDate(e),n=compareAsc(t,i),o=Math.abs(differenceInCalendarMonths(t,i));let r;if(o<1)r=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-n*o);let a=compareAsc(t,i)===-n;isLastDayOfMonth(toDate(s))&&o===1&&compareAsc(s,i)===1&&(a=!1),r=n*(o-Number(a))}return r===0?0:r}function differenceInQuarters(s,e,t){const i=differenceInMonths(s,e)/3;return getRoundingMethod(t==null?void 0:t.roundingMethod)(i)}function differenceInSeconds(s,e,t){const i=differenceInMilliseconds(s,e)/1e3;return getRoundingMethod(t==null?void 0:t.roundingMethod)(i)}function differenceInWeeks(s,e,t){const i=differenceInDays(s,e)/7;return getRoundingMethod(t==null?void 0:t.roundingMethod)(i)}function differenceInYears(s,e){const t=toDate(s),i=toDate(e),n=compareAsc(t,i),o=Math.abs(differenceInCalendarYears(t,i));t.setFullYear(1584),i.setFullYear(1584);const r=compareAsc(t,i)===-n,a=n*(o-+r);return a===0?0:a}function startOfMinute(s){const e=toDate(s);return e.setSeconds(0,0),e}function startOfQuarter(s){const e=toDate(s),t=e.getMonth(),i=t-t%3;return e.setMonth(i,1),e.setHours(0,0,0,0),e}function startOfMonth(s){const e=toDate(s);return e.setDate(1),e.setHours(0,0,0,0),e}function endOfYear(s){const e=toDate(s),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function startOfYear(s){const e=toDate(s),t=constructFrom(s,0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}function endOfHour(s){const e=toDate(s);return e.setMinutes(59,59,999),e}function endOfWeek(s,e){var a,l,d,h;const t=getDefaultOptions$1(),i=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??t.weekStartsOn??((h=(d=t.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,n=toDate(s),o=n.getDay(),r=(o<i?-7:0)+6-(o-i);return n.setDate(n.getDate()+r),n.setHours(23,59,59,999),n}function endOfMinute(s){const e=toDate(s);return e.setSeconds(59,999),e}function endOfQuarter(s){const e=toDate(s),t=e.getMonth(),i=t-t%3+3;return e.setMonth(i,0),e.setHours(23,59,59,999),e}function endOfSecond(s){const e=toDate(s);return e.setMilliseconds(999),e}const formatDistanceLocale$t={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance$u=(s,e,t)=>{let i;const n=formatDistanceLocale$t[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:i+" ago":i};function buildFormatLongFn(s){return(e={})=>{const t=e.width?String(e.width):s.defaultWidth;return s.formats[t]||s.formats[s.defaultWidth]}}const dateFormats$v={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats$v={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats$v={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$v={date:buildFormatLongFn({formats:dateFormats$v,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$v,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$v,defaultWidth:"full"})},formatRelativeLocale$u={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative$u=(s,e,t,i)=>formatRelativeLocale$u[s];function buildLocalizeFn(s){return(e,t)=>{const i=t!=null&&t.context?String(t.context):"standalone";let n;if(i==="formatting"&&s.formattingValues){const r=s.defaultFormattingWidth||s.defaultWidth,a=t!=null&&t.width?String(t.width):r;n=s.formattingValues[a]||s.formattingValues[r]}else{const r=s.defaultWidth,a=t!=null&&t.width?String(t.width):s.defaultWidth;n=s.values[a]||s.values[r]}const o=s.argumentCallback?s.argumentCallback(e):e;return n[o]}}const eraValues$u={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues$u={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues$u={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues$u={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues$u={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues$l={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber$u=(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},localize$u={ordinalNumber:ordinalNumber$u,era:buildLocalizeFn({values:eraValues$u,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$u,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$u,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$u,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$u,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$l,defaultFormattingWidth:"wide"})};function buildMatchFn(s){return(e,t={})=>{const i=t.width,n=i&&s.matchPatterns[i]||s.matchPatterns[s.defaultMatchWidth],o=e.match(n);if(!o)return null;const r=o[0],a=i&&s.parsePatterns[i]||s.parsePatterns[s.defaultParseWidth],l=Array.isArray(a)?findIndex(a,p=>p.test(r)):findKey(a,p=>p.test(r));let d;d=s.valueCallback?s.valueCallback(l):l,d=t.valueCallback?t.valueCallback(d):d;const h=e.slice(r.length);return{value:d,rest:h}}}function findKey(s,e){for(const t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&e(s[t]))return t}function findIndex(s,e){for(let t=0;t<s.length;t++)if(e(s[t]))return t}function buildMatchPatternFn(s){return(e,t={})=>{const i=e.match(s.matchPattern);if(!i)return null;const n=i[0],o=e.match(s.parsePattern);if(!o)return null;let r=s.valueCallback?s.valueCallback(o[0]):o[0];r=t.valueCallback?t.valueCallback(r):r;const a=e.slice(n.length);return{value:r,rest:a}}}const matchOrdinalNumberPattern$u=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern$u=/\d+/i,matchEraPatterns$u={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns$u={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns$u={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns$u={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$u={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns$u={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$u={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns$u={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns$u={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns$u={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match$u={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$u,parsePattern:parseOrdinalNumberPattern$u,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$u,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$u,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$u,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$u,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$u,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$u,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$u,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$u,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$u,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$u,defaultParseWidth:"any"})},enUS={code:"en-US",formatDistance:formatDistance$u,formatLong:formatLong$v,formatRelative:formatRelative$u,localize:localize$u,match:match$u,options:{weekStartsOn:0,firstWeekContainsDate:1}};function getDayOfYear(s){const e=toDate(s);return differenceInCalendarDays(e,startOfYear(e))+1}function getISOWeek(s){const e=toDate(s),t=+startOfISOWeek(e)-+startOfISOWeekYear(e);return Math.round(t/millisecondsInWeek)+1}function getWeekYear(s,e){var h,p,m,v;const t=toDate(s),i=t.getFullYear(),n=getDefaultOptions$1(),o=(e==null?void 0:e.firstWeekContainsDate)??((p=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??n.firstWeekContainsDate??((v=(m=n.locale)==null?void 0:m.options)==null?void 0:v.firstWeekContainsDate)??1,r=constructFrom(s,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);const a=startOfWeek(r,e),l=constructFrom(s,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const d=startOfWeek(l,e);return t.getTime()>=a.getTime()?i+1:t.getTime()>=d.getTime()?i:i-1}function startOfWeekYear(s,e){var a,l,d,h;const t=getDefaultOptions$1(),i=(e==null?void 0:e.firstWeekContainsDate)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??t.firstWeekContainsDate??((h=(d=t.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,n=getWeekYear(s,e),o=constructFrom(s,0);return o.setFullYear(n,0,i),o.setHours(0,0,0,0),startOfWeek(o,e)}function getWeek(s,e){const t=toDate(s),i=+startOfWeek(t,e)-+startOfWeekYear(t,e);return Math.round(i/millisecondsInWeek)+1}function addLeadingZeros(s,e){const t=s<0?"-":"",i=Math.abs(s).toString().padStart(e,"0");return t+i}const lightFormatters={y(s,e){const t=s.getFullYear(),i=t>0?t:1-t;return addLeadingZeros(e==="yy"?i%100:i,e.length)},M(s,e){const t=s.getMonth();return e==="M"?String(t+1):addLeadingZeros(t+1,2)},d(s,e){return addLeadingZeros(s.getDate(),e.length)},a(s,e){const t=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(s,e){return addLeadingZeros(s.getHours()%12||12,e.length)},H(s,e){return addLeadingZeros(s.getHours(),e.length)},m(s,e){return addLeadingZeros(s.getMinutes(),e.length)},s(s,e){return addLeadingZeros(s.getSeconds(),e.length)},S(s,e){const t=e.length,i=s.getMilliseconds(),n=Math.trunc(i*Math.pow(10,t-3));return addLeadingZeros(n,e.length)}},dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters$1={G:function(s,e,t){const i=s.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(i,{width:"abbreviated"});case"GGGGG":return t.era(i,{width:"narrow"});case"GGGG":default:return t.era(i,{width:"wide"})}},y:function(s,e,t){if(e==="yo"){const i=s.getFullYear(),n=i>0?i:1-i;return t.ordinalNumber(n,{unit:"year"})}return lightFormatters.y(s,e)},Y:function(s,e,t,i){const n=getWeekYear(s,i),o=n>0?n:1-n;if(e==="YY"){const r=o%100;return addLeadingZeros(r,2)}return e==="Yo"?t.ordinalNumber(o,{unit:"year"}):addLeadingZeros(o,e.length)},R:function(s,e){const t=getISOWeekYear(s);return addLeadingZeros(t,e.length)},u:function(s,e){const t=s.getFullYear();return addLeadingZeros(t,e.length)},Q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return addLeadingZeros(i,2);case"Qo":return t.ordinalNumber(i,{unit:"quarter"});case"QQQ":return t.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(i,{width:"wide",context:"formatting"})}},q:function(s,e,t){const i=Math.ceil((s.getMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return addLeadingZeros(i,2);case"qo":return t.ordinalNumber(i,{unit:"quarter"});case"qqq":return t.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(i,{width:"wide",context:"standalone"})}},M:function(s,e,t){const i=s.getMonth();switch(e){case"M":case"MM":return lightFormatters.M(s,e);case"Mo":return t.ordinalNumber(i+1,{unit:"month"});case"MMM":return t.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(i,{width:"wide",context:"formatting"})}},L:function(s,e,t){const i=s.getMonth();switch(e){case"L":return String(i+1);case"LL":return addLeadingZeros(i+1,2);case"Lo":return t.ordinalNumber(i+1,{unit:"month"});case"LLL":return t.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(i,{width:"wide",context:"standalone"})}},w:function(s,e,t,i){const n=getWeek(s,i);return e==="wo"?t.ordinalNumber(n,{unit:"week"}):addLeadingZeros(n,e.length)},I:function(s,e,t){const i=getISOWeek(s);return e==="Io"?t.ordinalNumber(i,{unit:"week"}):addLeadingZeros(i,e.length)},d:function(s,e,t){return e==="do"?t.ordinalNumber(s.getDate(),{unit:"date"}):lightFormatters.d(s,e)},D:function(s,e,t){const i=getDayOfYear(s);return e==="Do"?t.ordinalNumber(i,{unit:"dayOfYear"}):addLeadingZeros(i,e.length)},E:function(s,e,t){const i=s.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(i,{width:"short",context:"formatting"});case"EEEE":default:return t.day(i,{width:"wide",context:"formatting"})}},e:function(s,e,t,i){const n=s.getDay(),o=(n-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return addLeadingZeros(o,2);case"eo":return t.ordinalNumber(o,{unit:"day"});case"eee":return t.day(n,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(n,{width:"short",context:"formatting"});case"eeee":default:return t.day(n,{width:"wide",context:"formatting"})}},c:function(s,e,t,i){const n=s.getDay(),o=(n-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return addLeadingZeros(o,e.length);case"co":return t.ordinalNumber(o,{unit:"day"});case"ccc":return t.day(n,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(n,{width:"narrow",context:"standalone"});case"cccccc":return t.day(n,{width:"short",context:"standalone"});case"cccc":default:return t.day(n,{width:"wide",context:"standalone"})}},i:function(s,e,t){const i=s.getDay(),n=i===0?7:i;switch(e){case"i":return String(n);case"ii":return addLeadingZeros(n,e.length);case"io":return t.ordinalNumber(n,{unit:"day"});case"iii":return t.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(i,{width:"short",context:"formatting"});case"iiii":default:return t.day(i,{width:"wide",context:"formatting"})}},a:function(s,e,t){const n=s.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(s,e,t){const i=s.getHours();let n;switch(i===12?n=dayPeriodEnum.noon:i===0?n=dayPeriodEnum.midnight:n=i/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(s,e,t){const i=s.getHours();let n;switch(i>=17?n=dayPeriodEnum.evening:i>=12?n=dayPeriodEnum.afternoon:i>=4?n=dayPeriodEnum.morning:n=dayPeriodEnum.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(s,e,t){if(e==="ho"){let i=s.getHours()%12;return i===0&&(i=12),t.ordinalNumber(i,{unit:"hour"})}return lightFormatters.h(s,e)},H:function(s,e,t){return e==="Ho"?t.ordinalNumber(s.getHours(),{unit:"hour"}):lightFormatters.H(s,e)},K:function(s,e,t){const i=s.getHours()%12;return e==="Ko"?t.ordinalNumber(i,{unit:"hour"}):addLeadingZeros(i,e.length)},k:function(s,e,t){let i=s.getHours();return i===0&&(i=24),e==="ko"?t.ordinalNumber(i,{unit:"hour"}):addLeadingZeros(i,e.length)},m:function(s,e,t){return e==="mo"?t.ordinalNumber(s.getMinutes(),{unit:"minute"}):lightFormatters.m(s,e)},s:function(s,e,t){return e==="so"?t.ordinalNumber(s.getSeconds(),{unit:"second"}):lightFormatters.s(s,e)},S:function(s,e){return lightFormatters.S(s,e)},X:function(s,e,t){const i=s.getTimezoneOffset();if(i===0)return"Z";switch(e){case"X":return formatTimezoneWithOptionalMinutes(i);case"XXXX":case"XX":return formatTimezone(i);case"XXXXX":case"XXX":default:return formatTimezone(i,":")}},x:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"x":return formatTimezoneWithOptionalMinutes(i);case"xxxx":case"xx":return formatTimezone(i);case"xxxxx":case"xxx":default:return formatTimezone(i,":")}},O:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(i,":");case"OOOO":default:return"GMT"+formatTimezone(i,":")}},z:function(s,e,t){const i=s.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(i,":");case"zzzz":default:return"GMT"+formatTimezone(i,":")}},t:function(s,e,t){const i=Math.trunc(s.getTime()/1e3);return addLeadingZeros(i,e.length)},T:function(s,e,t){const i=s.getTime();return addLeadingZeros(i,e.length)}};function formatTimezoneShort(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=Math.trunc(i/60),o=i%60;return o===0?t+String(n):t+String(n)+e+addLeadingZeros(o,2)}function formatTimezoneWithOptionalMinutes(s,e){return s%60===0?(s>0?"-":"+")+addLeadingZeros(Math.abs(s)/60,2):formatTimezone(s,e)}function formatTimezone(s,e=""){const t=s>0?"-":"+",i=Math.abs(s),n=addLeadingZeros(Math.trunc(i/60),2),o=addLeadingZeros(i%60,2);return t+n+e+o}const dateLongFormatter=(s,e)=>{switch(s){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},timeLongFormatter=(s,e)=>{switch(s){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},dateTimeLongFormatter=(s,e)=>{const t=s.match(/(P+)(p+)?/)||[],i=t[1],n=t[2];if(!n)return dateLongFormatter(s,e);let o;switch(i){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;case"PPPP":default:o=e.dateTime({width:"full"});break}return o.replace("{{date}}",dateLongFormatter(i,e)).replace("{{time}}",timeLongFormatter(n,e))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},dayOfYearTokenRE=/^D+$/,weekYearTokenRE=/^Y+$/,throwTokens=["D","DD","YY","YYYY"];function isProtectedDayOfYearToken(s){return dayOfYearTokenRE.test(s)}function isProtectedWeekYearToken(s){return weekYearTokenRE.test(s)}function warnOrThrowProtectedError(s,e,t){const i=message(s,e,t);if(console.warn(i),throwTokens.includes(s))throw new RangeError(i)}function message(s,e,t){const i=s[0]==="Y"?"years":"days of the month";return`Use \`${s.toLowerCase()}\` instead of \`${s}\` (in \`${e}\`) for formatting ${i} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const formattingTokensRegExp$1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp$1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp$1=/^'([^]*?)'?$/,doubleQuoteRegExp$1=/''/g,unescapedLatinCharacterRegExp$1=/[a-zA-Z]/;function format(s,e,t){var h,p,m,v,y,b,S,E;const i=getDefaultOptions$1(),n=(t==null?void 0:t.locale)??i.locale??enUS,o=(t==null?void 0:t.firstWeekContainsDate)??((p=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??i.firstWeekContainsDate??((v=(m=i.locale)==null?void 0:m.options)==null?void 0:v.firstWeekContainsDate)??1,r=(t==null?void 0:t.weekStartsOn)??((b=(y=t==null?void 0:t.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((E=(S=i.locale)==null?void 0:S.options)==null?void 0:E.weekStartsOn)??0,a=toDate(s);if(!isValid(a))throw new RangeError("Invalid time value");let l=e.match(longFormattingTokensRegExp$1).map(T=>{const R=T[0];if(R==="p"||R==="P"){const A=longFormatters[R];return A(T,n.formatLong)}return T}).join("").match(formattingTokensRegExp$1).map(T=>{if(T==="''")return{isToken:!1,value:"'"};const R=T[0];if(R==="'")return{isToken:!1,value:cleanEscapedString$1(T)};if(formatters$1[R])return{isToken:!0,value:T};if(R.match(unescapedLatinCharacterRegExp$1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+R+"`");return{isToken:!1,value:T}});n.localize.preprocessor&&(l=n.localize.preprocessor(a,l));const d={firstWeekContainsDate:o,weekStartsOn:r,locale:n};return l.map(T=>{if(!T.isToken)return T.value;const R=T.value;(!(t!=null&&t.useAdditionalWeekYearTokens)&&isProtectedWeekYearToken(R)||!(t!=null&&t.useAdditionalDayOfYearTokens)&&isProtectedDayOfYearToken(R))&&warnOrThrowProtectedError(R,e,String(s));const A=formatters$1[R[0]];return A(a,R,n.localize,d)}).join("")}function cleanEscapedString$1(s){const e=s.match(escapedStringRegExp$1);return e?e[1].replace(doubleQuoteRegExp$1,"'"):s}function getDefaultOptions(){return Object.assign({},getDefaultOptions$1())}function getISODay(s){let t=toDate(s).getDay();return t===0&&(t=7),t}function transpose(s,e){const t=e instanceof Date?constructFrom(e,0):new e(0);return t.setFullYear(s.getFullYear(),s.getMonth(),s.getDate()),t.setHours(s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),t}const TIMEZONE_UNIT_PRIORITY=10;class Setter{constructor(){G(this,"subPriority",0)}validate(e,t){return!0}}class ValueSetter extends Setter{constructor(e,t,i,n,o){super(),this.value=e,this.validateValue=t,this.setValue=i,this.priority=n,o&&(this.subPriority=o)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,i){return this.setValue(e,t,this.value,i)}}class DateToSystemTimezoneSetter extends Setter{constructor(){super(...arguments);G(this,"priority",TIMEZONE_UNIT_PRIORITY);G(this,"subPriority",-1)}set(t,i){return i.timestampIsSet?t:constructFrom(t,transpose(t,Date))}}class Parser{run(e,t,i,n){const o=this.parse(e,t,i,n);return o?{setter:new ValueSetter(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(e,t,i){return!0}}class EraParser extends Parser{constructor(){super(...arguments);G(this,"priority",140);G(this,"incompatibleTokens",["R","u","t","T"])}parse(t,i,n){switch(i){case"G":case"GG":case"GGG":return n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"});case"GGGGG":return n.era(t,{width:"narrow"});case"GGGG":default:return n.era(t,{width:"wide"})||n.era(t,{width:"abbreviated"})||n.era(t,{width:"narrow"})}}set(t,i,n){return i.era=n,t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}}const numericPatterns={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},timezonePatterns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function mapValue(s,e){return s&&{value:e(s.value),rest:s.rest}}function parseNumericPattern(s,e){const t=e.match(s);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function parseTimezonePattern(s,e){const t=e.match(s);if(!t)return null;if(t[0]==="Z")return{value:0,rest:e.slice(1)};const i=t[1]==="+"?1:-1,n=t[2]?parseInt(t[2],10):0,o=t[3]?parseInt(t[3],10):0,r=t[5]?parseInt(t[5],10):0;return{value:i*(n*millisecondsInHour+o*millisecondsInMinute+r*millisecondsInSecond),rest:e.slice(t[0].length)}}function parseAnyDigitsSigned(s){return parseNumericPattern(numericPatterns.anyDigitsSigned,s)}function parseNDigits(s,e){switch(s){case 1:return parseNumericPattern(numericPatterns.singleDigit,e);case 2:return parseNumericPattern(numericPatterns.twoDigits,e);case 3:return parseNumericPattern(numericPatterns.threeDigits,e);case 4:return parseNumericPattern(numericPatterns.fourDigits,e);default:return parseNumericPattern(new RegExp("^\\d{1,"+s+"}"),e)}}function parseNDigitsSigned(s,e){switch(s){case 1:return parseNumericPattern(numericPatterns.singleDigitSigned,e);case 2:return parseNumericPattern(numericPatterns.twoDigitsSigned,e);case 3:return parseNumericPattern(numericPatterns.threeDigitsSigned,e);case 4:return parseNumericPattern(numericPatterns.fourDigitsSigned,e);default:return parseNumericPattern(new RegExp("^-?\\d{1,"+s+"}"),e)}}function dayPeriodEnumToHours(s){switch(s){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function normalizeTwoDigitYear(s,e){const t=e>0,i=t?e:1-e;let n;if(i<=50)n=s||100;else{const o=i+50,r=Math.trunc(o/100)*100,a=s>=o%100;n=s+r-(a?100:0)}return t?n:1-n}function isLeapYearIndex$1(s){return s%400===0||s%4===0&&s%100!==0}class YearParser extends Parser{constructor(){super(...arguments);G(this,"priority",130);G(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(t,i,n){const o=r=>({year:r,isTwoDigitYear:i==="yy"});switch(i){case"y":return mapValue(parseNDigits(4,t),o);case"yo":return mapValue(n.ordinalNumber(t,{unit:"year"}),o);default:return mapValue(parseNDigits(i.length,t),o)}}validate(t,i){return i.isTwoDigitYear||i.year>0}set(t,i,n){const o=t.getFullYear();if(n.isTwoDigitYear){const a=normalizeTwoDigitYear(n.year,o);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const r=!("era"in i)||i.era===1?n.year:1-n.year;return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}}class LocalWeekYearParser extends Parser{constructor(){super(...arguments);G(this,"priority",130);G(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(t,i,n){const o=r=>({year:r,isTwoDigitYear:i==="YY"});switch(i){case"Y":return mapValue(parseNDigits(4,t),o);case"Yo":return mapValue(n.ordinalNumber(t,{unit:"year"}),o);default:return mapValue(parseNDigits(i.length,t),o)}}validate(t,i){return i.isTwoDigitYear||i.year>0}set(t,i,n,o){const r=getWeekYear(t,o);if(n.isTwoDigitYear){const l=normalizeTwoDigitYear(n.year,r);return t.setFullYear(l,0,o.firstWeekContainsDate),t.setHours(0,0,0,0),startOfWeek(t,o)}const a=!("era"in i)||i.era===1?n.year:1-n.year;return t.setFullYear(a,0,o.firstWeekContainsDate),t.setHours(0,0,0,0),startOfWeek(t,o)}}class ISOWeekYearParser extends Parser{constructor(){super(...arguments);G(this,"priority",130);G(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(t,i){return parseNDigitsSigned(i==="R"?4:i.length,t)}set(t,i,n){const o=constructFrom(t,0);return o.setFullYear(n,0,4),o.setHours(0,0,0,0),startOfISOWeek(o)}}class ExtendedYearParser extends Parser{constructor(){super(...arguments);G(this,"priority",130);G(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(t,i){return parseNDigitsSigned(i==="u"?4:i.length,t)}set(t,i,n){return t.setFullYear(n,0,1),t.setHours(0,0,0,0),t}}class QuarterParser extends Parser{constructor(){super(...arguments);G(this,"priority",120);G(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,i,n){switch(i){case"Q":case"QQ":return parseNDigits(i.length,t);case"Qo":return n.ordinalNumber(t,{unit:"quarter"});case"QQQ":return n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(t,{width:"wide",context:"formatting"})||n.quarter(t,{width:"abbreviated",context:"formatting"})||n.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=1&&i<=4}set(t,i,n){return t.setMonth((n-1)*3,1),t.setHours(0,0,0,0),t}}class StandAloneQuarterParser extends Parser{constructor(){super(...arguments);G(this,"priority",120);G(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(t,i,n){switch(i){case"q":case"qq":return parseNDigits(i.length,t);case"qo":return n.ordinalNumber(t,{unit:"quarter"});case"qqq":return n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(t,{width:"wide",context:"standalone"})||n.quarter(t,{width:"abbreviated",context:"standalone"})||n.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,i){return i>=1&&i<=4}set(t,i,n){return t.setMonth((n-1)*3,1),t.setHours(0,0,0,0),t}}class MonthParser extends Parser{constructor(){super(...arguments);G(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);G(this,"priority",110)}parse(t,i,n){const o=r=>r-1;switch(i){case"M":return mapValue(parseNumericPattern(numericPatterns.month,t),o);case"MM":return mapValue(parseNDigits(2,t),o);case"Mo":return mapValue(n.ordinalNumber(t,{unit:"month"}),o);case"MMM":return n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(t,{width:"wide",context:"formatting"})||n.month(t,{width:"abbreviated",context:"formatting"})||n.month(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=0&&i<=11}set(t,i,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}}class StandAloneMonthParser extends Parser{constructor(){super(...arguments);G(this,"priority",110);G(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(t,i,n){const o=r=>r-1;switch(i){case"L":return mapValue(parseNumericPattern(numericPatterns.month,t),o);case"LL":return mapValue(parseNDigits(2,t),o);case"Lo":return mapValue(n.ordinalNumber(t,{unit:"month"}),o);case"LLL":return n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(t,{width:"wide",context:"standalone"})||n.month(t,{width:"abbreviated",context:"standalone"})||n.month(t,{width:"narrow",context:"standalone"})}}validate(t,i){return i>=0&&i<=11}set(t,i,n){return t.setMonth(n,1),t.setHours(0,0,0,0),t}}function setWeek(s,e,t){const i=toDate(s),n=getWeek(i,t)-e;return i.setDate(i.getDate()-n*7),i}class LocalWeekParser extends Parser{constructor(){super(...arguments);G(this,"priority",100);G(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(t,i,n){switch(i){case"w":return parseNumericPattern(numericPatterns.week,t);case"wo":return n.ordinalNumber(t,{unit:"week"});default:return parseNDigits(i.length,t)}}validate(t,i){return i>=1&&i<=53}set(t,i,n,o){return startOfWeek(setWeek(t,n,o),o)}}function setISOWeek(s,e){const t=toDate(s),i=getISOWeek(t)-e;return t.setDate(t.getDate()-i*7),t}class ISOWeekParser extends Parser{constructor(){super(...arguments);G(this,"priority",100);G(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(t,i,n){switch(i){case"I":return parseNumericPattern(numericPatterns.week,t);case"Io":return n.ordinalNumber(t,{unit:"week"});default:return parseNDigits(i.length,t)}}validate(t,i){return i>=1&&i<=53}set(t,i,n){return startOfISOWeek(setISOWeek(t,n))}}const DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP_YEAR=[31,29,31,30,31,30,31,31,30,31,30,31];class DateParser extends Parser{constructor(){super(...arguments);G(this,"priority",90);G(this,"subPriority",1);G(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(t,i,n){switch(i){case"d":return parseNumericPattern(numericPatterns.date,t);case"do":return n.ordinalNumber(t,{unit:"date"});default:return parseNDigits(i.length,t)}}validate(t,i){const n=t.getFullYear(),o=isLeapYearIndex$1(n),r=t.getMonth();return o?i>=1&&i<=DAYS_IN_MONTH_LEAP_YEAR[r]:i>=1&&i<=DAYS_IN_MONTH[r]}set(t,i,n){return t.setDate(n),t.setHours(0,0,0,0),t}}class DayOfYearParser extends Parser{constructor(){super(...arguments);G(this,"priority",90);G(this,"subpriority",1);G(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(t,i,n){switch(i){case"D":case"DD":return parseNumericPattern(numericPatterns.dayOfYear,t);case"Do":return n.ordinalNumber(t,{unit:"date"});default:return parseNDigits(i.length,t)}}validate(t,i){const n=t.getFullYear();return isLeapYearIndex$1(n)?i>=1&&i<=366:i>=1&&i<=365}set(t,i,n){return t.setMonth(0,n),t.setHours(0,0,0,0),t}}function setDay(s,e,t){var p,m,v,y;const i=getDefaultOptions$1(),n=(t==null?void 0:t.weekStartsOn)??((m=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:m.weekStartsOn)??i.weekStartsOn??((y=(v=i.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??0,o=toDate(s),r=o.getDay(),l=(e%7+7)%7,d=7-n,h=e<0||e>6?e-(r+d)%7:(l+d)%7-(r+d)%7;return addDays(o,h)}class DayParser extends Parser{constructor(){super(...arguments);G(this,"priority",90);G(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(t,i,n){switch(i){case"E":case"EE":case"EEE":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=0&&i<=6}set(t,i,n,o){return t=setDay(t,n,o),t.setHours(0,0,0,0),t}}class LocalDayParser extends Parser{constructor(){super(...arguments);G(this,"priority",90);G(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(t,i,n,o){const r=a=>{const l=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return mapValue(parseNDigits(i.length,t),r);case"eo":return mapValue(n.ordinalNumber(t,{unit:"day"}),r);case"eee":return n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeeee":return n.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"})}}validate(t,i){return i>=0&&i<=6}set(t,i,n,o){return t=setDay(t,n,o),t.setHours(0,0,0,0),t}}class StandAloneLocalDayParser extends Parser{constructor(){super(...arguments);G(this,"priority",90);G(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(t,i,n,o){const r=a=>{const l=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return mapValue(parseNDigits(i.length,t),r);case"co":return mapValue(n.ordinalNumber(t,{unit:"day"}),r);case"ccc":return n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"ccccc":return n.day(t,{width:"narrow",context:"standalone"});case"cccccc":return n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(t,{width:"wide",context:"standalone"})||n.day(t,{width:"abbreviated",context:"standalone"})||n.day(t,{width:"short",context:"standalone"})||n.day(t,{width:"narrow",context:"standalone"})}}validate(t,i){return i>=0&&i<=6}set(t,i,n,o){return t=setDay(t,n,o),t.setHours(0,0,0,0),t}}function setISODay(s,e){const t=toDate(s),i=getISODay(t),n=e-i;return addDays(t,n)}class ISODayParser extends Parser{constructor(){super(...arguments);G(this,"priority",90);G(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(t,i,n){const o=r=>r===0?7:r;switch(i){case"i":case"ii":return parseNDigits(i.length,t);case"io":return n.ordinalNumber(t,{unit:"day"});case"iii":return mapValue(n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),o);case"iiiii":return mapValue(n.day(t,{width:"narrow",context:"formatting"}),o);case"iiiiii":return mapValue(n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),o);case"iiii":default:return mapValue(n.day(t,{width:"wide",context:"formatting"})||n.day(t,{width:"abbreviated",context:"formatting"})||n.day(t,{width:"short",context:"formatting"})||n.day(t,{width:"narrow",context:"formatting"}),o)}}validate(t,i){return i>=1&&i<=7}set(t,i,n){return t=setISODay(t,n),t.setHours(0,0,0,0),t}}class AMPMParser extends Parser{constructor(){super(...arguments);G(this,"priority",80);G(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(t,i,n){switch(i){case"a":case"aa":case"aaa":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,i,n){return t.setHours(dayPeriodEnumToHours(n),0,0,0),t}}class AMPMMidnightParser extends Parser{constructor(){super(...arguments);G(this,"priority",80);G(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(t,i,n){switch(i){case"b":case"bb":case"bbb":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,i,n){return t.setHours(dayPeriodEnumToHours(n),0,0,0),t}}class DayPeriodParser extends Parser{constructor(){super(...arguments);G(this,"priority",80);G(this,"incompatibleTokens",["a","b","t","T"])}parse(t,i,n){switch(i){case"B":case"BB":case"BBB":return n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(t,{width:"wide",context:"formatting"})||n.dayPeriod(t,{width:"abbreviated",context:"formatting"})||n.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,i,n){return t.setHours(dayPeriodEnumToHours(n),0,0,0),t}}class Hour1to12Parser extends Parser{constructor(){super(...arguments);G(this,"priority",70);G(this,"incompatibleTokens",["H","K","k","t","T"])}parse(t,i,n){switch(i){case"h":return parseNumericPattern(numericPatterns.hour12h,t);case"ho":return n.ordinalNumber(t,{unit:"hour"});default:return parseNDigits(i.length,t)}}validate(t,i){return i>=1&&i<=12}set(t,i,n){const o=t.getHours()>=12;return o&&n<12?t.setHours(n+12,0,0,0):!o&&n===12?t.setHours(0,0,0,0):t.setHours(n,0,0,0),t}}class Hour0to23Parser extends Parser{constructor(){super(...arguments);G(this,"priority",70);G(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(t,i,n){switch(i){case"H":return parseNumericPattern(numericPatterns.hour23h,t);case"Ho":return n.ordinalNumber(t,{unit:"hour"});default:return parseNDigits(i.length,t)}}validate(t,i){return i>=0&&i<=23}set(t,i,n){return t.setHours(n,0,0,0),t}}class Hour0To11Parser extends Parser{constructor(){super(...arguments);G(this,"priority",70);G(this,"incompatibleTokens",["h","H","k","t","T"])}parse(t,i,n){switch(i){case"K":return parseNumericPattern(numericPatterns.hour11h,t);case"Ko":return n.ordinalNumber(t,{unit:"hour"});default:return parseNDigits(i.length,t)}}validate(t,i){return i>=0&&i<=11}set(t,i,n){return t.getHours()>=12&&n<12?t.setHours(n+12,0,0,0):t.setHours(n,0,0,0),t}}class Hour1To24Parser extends Parser{constructor(){super(...arguments);G(this,"priority",70);G(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(t,i,n){switch(i){case"k":return parseNumericPattern(numericPatterns.hour24h,t);case"ko":return n.ordinalNumber(t,{unit:"hour"});default:return parseNDigits(i.length,t)}}validate(t,i){return i>=1&&i<=24}set(t,i,n){const o=n<=24?n%24:n;return t.setHours(o,0,0,0),t}}class MinuteParser extends Parser{constructor(){super(...arguments);G(this,"priority",60);G(this,"incompatibleTokens",["t","T"])}parse(t,i,n){switch(i){case"m":return parseNumericPattern(numericPatterns.minute,t);case"mo":return n.ordinalNumber(t,{unit:"minute"});default:return parseNDigits(i.length,t)}}validate(t,i){return i>=0&&i<=59}set(t,i,n){return t.setMinutes(n,0,0),t}}class SecondParser extends Parser{constructor(){super(...arguments);G(this,"priority",50);G(this,"incompatibleTokens",["t","T"])}parse(t,i,n){switch(i){case"s":return parseNumericPattern(numericPatterns.second,t);case"so":return n.ordinalNumber(t,{unit:"second"});default:return parseNDigits(i.length,t)}}validate(t,i){return i>=0&&i<=59}set(t,i,n){return t.setSeconds(n,0),t}}class FractionOfSecondParser extends Parser{constructor(){super(...arguments);G(this,"priority",30);G(this,"incompatibleTokens",["t","T"])}parse(t,i){const n=o=>Math.trunc(o*Math.pow(10,-i.length+3));return mapValue(parseNDigits(i.length,t),n)}set(t,i,n){return t.setMilliseconds(n),t}}class ISOTimezoneWithZParser extends Parser{constructor(){super(...arguments);G(this,"priority",10);G(this,"incompatibleTokens",["t","T","x"])}parse(t,i){switch(i){case"X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,t);case"XX":return parseTimezonePattern(timezonePatterns.basic,t);case"XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,t);case"XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,t);case"XXX":default:return parseTimezonePattern(timezonePatterns.extended,t)}}set(t,i,n){return i.timestampIsSet?t:constructFrom(t,t.getTime()-getTimezoneOffsetInMilliseconds(t)-n)}}class ISOTimezoneParser extends Parser{constructor(){super(...arguments);G(this,"priority",10);G(this,"incompatibleTokens",["t","T","X"])}parse(t,i){switch(i){case"x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,t);case"xx":return parseTimezonePattern(timezonePatterns.basic,t);case"xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,t);case"xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,t);case"xxx":default:return parseTimezonePattern(timezonePatterns.extended,t)}}set(t,i,n){return i.timestampIsSet?t:constructFrom(t,t.getTime()-getTimezoneOffsetInMilliseconds(t)-n)}}class TimestampSecondsParser extends Parser{constructor(){super(...arguments);G(this,"priority",40);G(this,"incompatibleTokens","*")}parse(t){return parseAnyDigitsSigned(t)}set(t,i,n){return[constructFrom(t,n*1e3),{timestampIsSet:!0}]}}class TimestampMillisecondsParser extends Parser{constructor(){super(...arguments);G(this,"priority",20);G(this,"incompatibleTokens","*")}parse(t){return parseAnyDigitsSigned(t)}set(t,i,n){return[constructFrom(t,n),{timestampIsSet:!0}]}}const parsers={G:new EraParser,y:new YearParser,Y:new LocalWeekYearParser,R:new ISOWeekYearParser,u:new ExtendedYearParser,Q:new QuarterParser,q:new StandAloneQuarterParser,M:new MonthParser,L:new StandAloneMonthParser,w:new LocalWeekParser,I:new ISOWeekParser,d:new DateParser,D:new DayOfYearParser,E:new DayParser,e:new LocalDayParser,c:new StandAloneLocalDayParser,i:new ISODayParser,a:new AMPMParser,b:new AMPMMidnightParser,B:new DayPeriodParser,h:new Hour1to12Parser,H:new Hour0to23Parser,K:new Hour0To11Parser,k:new Hour1To24Parser,m:new MinuteParser,s:new SecondParser,S:new FractionOfSecondParser,X:new ISOTimezoneWithZParser,x:new ISOTimezoneParser,t:new TimestampSecondsParser,T:new TimestampMillisecondsParser},formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,notWhitespaceRegExp=/\S/,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function parse$1(s,e,t,i){var b,S,E,T,R,A,D,x;const n=getDefaultOptions(),o=(i==null?void 0:i.locale)??n.locale??enUS,r=(i==null?void 0:i.firstWeekContainsDate)??((S=(b=i==null?void 0:i.locale)==null?void 0:b.options)==null?void 0:S.firstWeekContainsDate)??n.firstWeekContainsDate??((T=(E=n.locale)==null?void 0:E.options)==null?void 0:T.firstWeekContainsDate)??1,a=(i==null?void 0:i.weekStartsOn)??((A=(R=i==null?void 0:i.locale)==null?void 0:R.options)==null?void 0:A.weekStartsOn)??n.weekStartsOn??((x=(D=n.locale)==null?void 0:D.options)==null?void 0:x.weekStartsOn)??0;if(e==="")return s===""?toDate(t):constructFrom(t,NaN);const l={firstWeekContainsDate:r,weekStartsOn:a,locale:o},d=[new DateToSystemTimezoneSetter],h=e.match(longFormattingTokensRegExp).map(M=>{const I=M[0];if(I in longFormatters){const V=longFormatters[I];return V(M,o.formatLong)}return M}).join("").match(formattingTokensRegExp),p=[];for(let M of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&isProtectedWeekYearToken(M)&&warnOrThrowProtectedError(M,e,s),!(i!=null&&i.useAdditionalDayOfYearTokens)&&isProtectedDayOfYearToken(M)&&warnOrThrowProtectedError(M,e,s);const I=M[0],V=parsers[I];if(V){const{incompatibleTokens:z}=V;if(Array.isArray(z)){const K=p.find(J=>z.includes(J.token)||J.token===I);if(K)throw new RangeError(`The format string mustn't contain \`${K.fullToken}\` and \`${M}\` at the same time`)}else if(V.incompatibleTokens==="*"&&p.length>0)throw new RangeError(`The format string mustn't contain \`${M}\` and any other token at the same time`);p.push({token:I,fullToken:M});const B=V.run(s,M,o.match,l);if(!B)return constructFrom(t,NaN);d.push(B.setter),s=B.rest}else{if(I.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+I+"`");if(M==="''"?M="'":I==="'"&&(M=cleanEscapedString(M)),s.indexOf(M)===0)s=s.slice(M.length);else return constructFrom(t,NaN)}}if(s.length>0&¬WhitespaceRegExp.test(s))return constructFrom(t,NaN);const m=d.map(M=>M.priority).sort((M,I)=>I-M).filter((M,I,V)=>V.indexOf(M)===I).map(M=>d.filter(I=>I.priority===M).sort((I,V)=>V.subPriority-I.subPriority)).map(M=>M[0]);let v=toDate(t);if(isNaN(v.getTime()))return constructFrom(t,NaN);const y={};for(const M of m){if(!M.validate(v,l))return constructFrom(t,NaN);const I=M.set(v,y,l);Array.isArray(I)?(v=I[0],Object.assign(y,I[1])):v=I}return constructFrom(t,v)}function cleanEscapedString(s){return s.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}function startOfHour(s){const e=toDate(s);return e.setMinutes(0,0,0),e}function isSameWeek(s,e,t){const i=startOfWeek(s,t),n=startOfWeek(e,t);return+i==+n}function startOfSecond(s){const e=toDate(s);return e.setMilliseconds(0),e}function subDays(s,e){return addDays(s,-e)}function parseISO(s,e){const t=(e==null?void 0:e.additionalDigits)??2,i=splitDateString(s);let n;if(i.date){const l=parseYear(i.date,t);n=parseDate(l.restDateString,l.year)}if(!n||isNaN(n.getTime()))return new Date(NaN);const o=n.getTime();let r=0,a;if(i.time&&(r=parseTime(i.time),isNaN(r)))return new Date(NaN);if(i.timezone){if(a=parseTimezone(i.timezone),isNaN(a))return new Date(NaN)}else{const l=new Date(o+r),d=new Date(0);return d.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),d.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),d}return new Date(o+r+a)}const patterns={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},dateRegex=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,timeRegex=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,timezoneRegex=/^([+-])(\d{2})(?::?(\d{2}))?$/;function splitDateString(s){const e={},t=s.split(patterns.dateTimeDelimiter);let i;if(t.length>2)return e;if(/:/.test(t[0])?i=t[0]:(e.date=t[0],i=t[1],patterns.timeZoneDelimiter.test(e.date)&&(e.date=s.split(patterns.timeZoneDelimiter)[0],i=s.substr(e.date.length,s.length))),i){const n=patterns.timezone.exec(i);n?(e.time=i.replace(n[1],""),e.timezone=n[1]):e.time=i}return e}function parseYear(s,e){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),i=s.match(t);if(!i)return{year:NaN,restDateString:""};const n=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?n:o*100,restDateString:s.slice((i[1]||i[2]).length)}}function parseDate(s,e){if(e===null)return new Date(NaN);const t=s.match(dateRegex);if(!t)return new Date(NaN);const i=!!t[4],n=parseDateUnit(t[1]),o=parseDateUnit(t[2])-1,r=parseDateUnit(t[3]),a=parseDateUnit(t[4]),l=parseDateUnit(t[5])-1;if(i)return validateWeekDate(e,a,l)?dayOfISOWeekYear(e,a,l):new Date(NaN);{const d=new Date(0);return!validateDate(e,o,r)||!validateDayOfYearDate(e,n)?new Date(NaN):(d.setUTCFullYear(e,o,Math.max(n,r)),d)}}function parseDateUnit(s){return s?parseInt(s):1}function parseTime(s){const e=s.match(timeRegex);if(!e)return NaN;const t=parseTimeUnit(e[1]),i=parseTimeUnit(e[2]),n=parseTimeUnit(e[3]);return validateTime(t,i,n)?t*millisecondsInHour+i*millisecondsInMinute+n*1e3:NaN}function parseTimeUnit(s){return s&&parseFloat(s.replace(",","."))||0}function parseTimezone(s){if(s==="Z")return 0;const e=s.match(timezoneRegex);if(!e)return 0;const t=e[1]==="+"?-1:1,i=parseInt(e[2]),n=e[3]&&parseInt(e[3])||0;return validateTimezone(i,n)?t*(i*millisecondsInHour+n*millisecondsInMinute):NaN}function dayOfISOWeekYear(s,e,t){const i=new Date(0);i.setUTCFullYear(s,0,4);const n=i.getUTCDay()||7,o=(e-1)*7+t+1-n;return i.setUTCDate(i.getUTCDate()+o),i}const daysInMonths=[31,null,31,30,31,30,31,31,30,31,30,31];function isLeapYearIndex(s){return s%400===0||s%4===0&&s%100!==0}function validateDate(s,e,t){return e>=0&&e<=11&&t>=1&&t<=(daysInMonths[e]||(isLeapYearIndex(s)?29:28))}function validateDayOfYearDate(s,e){return e>=1&&e<=(isLeapYearIndex(s)?366:365)}function validateWeekDate(s,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function validateTime(s,e,t){return s===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&s>=0&&s<25}function validateTimezone(s,e){return e>=0&&e<=59}function subMonths(s,e){return addMonths(s,-e)}const consoleLogger={type:"logger",log(s){this.output("log",s)},warn(s){this.output("warn",s)},error(s){this.output("error",s)},output(s,e){console&&console[s]&&console[s].apply(console,e)}};let Logger$1=class Oi{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||consoleLogger,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,i,n){return n&&!this.debug?null:(typeof e[0]=="string"&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Oi(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Oi(this.logger,e)}};var baseLogger=new Logger$1;class EventEmitter{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const n=this.observers[i].get(t)||0;this.observers[i].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(r=>{let[a,l]=r;for(let d=0;d<l;d++)a(...i)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(r=>{let[a,l]=r;for(let d=0;d<l;d++)a.apply(a,[e,...i])})}}function defer(){let s,e;const t=new Promise((i,n)=>{s=i,e=n});return t.resolve=s,t.reject=e,t}function makeString(s){return s==null?"":""+s}function copy(s,e,t){s.forEach(i=>{e[i]&&(t[i]=e[i])})}const lastOfPathSeparatorRegExp=/###/g;function getLastOfPath(s,e,t){function i(a){return a&&a.indexOf("###")>-1?a.replace(lastOfPathSeparatorRegExp,"."):a}function n(){return!s||typeof s=="string"}const o=typeof e!="string"?e:e.split(".");let r=0;for(;r<o.length-1;){if(n())return{};const a=i(o[r]);!s[a]&&t&&(s[a]=new t),Object.prototype.hasOwnProperty.call(s,a)?s=s[a]:s={},++r}return n()?{}:{obj:s,k:i(o[r])}}function setPath(s,e,t){const{obj:i,k:n}=getLastOfPath(s,e,Object);if(i!==void 0||e.length===1){i[n]=t;return}let o=e[e.length-1],r=e.slice(0,e.length-1),a=getLastOfPath(s,r,Object);for(;a.obj===void 0&&r.length;)o=`${r[r.length-1]}.${o}`,r=r.slice(0,r.length-1),a=getLastOfPath(s,r,Object),a&&a.obj&&typeof a.obj[`${a.k}.${o}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${o}`]=t}function pushPath(s,e,t,i){const{obj:n,k:o}=getLastOfPath(s,e,Object);n[o]=n[o]||[],i&&(n[o]=n[o].concat(t)),i||n[o].push(t)}function getPath(s,e){const{obj:t,k:i}=getLastOfPath(s,e);if(t)return t[i]}function getPathWithDefaults(s,e,t){const i=getPath(s,t);return i!==void 0?i:getPath(e,t)}function deepExtend(s,e,t){for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in s?typeof s[i]=="string"||s[i]instanceof String||typeof e[i]=="string"||e[i]instanceof String?t&&(s[i]=e[i]):deepExtend(s[i],e[i],t):s[i]=e[i]);return s}function regexEscape(s){return s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function escape$1(s){return typeof s=="string"?s.replace(/[&<>"'\/]/g,e=>_entityMap[e]):s}class RegExpCache{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const chars=[" ",",","?","!",";"],looksLikeObjectPathRegExpCache=new RegExpCache(20);function looksLikeObjectPath(s,e,t){e=e||"",t=t||"";const i=chars.filter(r=>e.indexOf(r)<0&&t.indexOf(r)<0);if(i.length===0)return!0;const n=looksLikeObjectPathRegExpCache.getRegExp(`(${i.map(r=>r==="?"?"\\?":r).join("|")})`);let o=!n.test(s);if(!o){const r=s.indexOf(t);r>0&&!n.test(s.substring(0,r))&&(o=!0)}return o}function deepFind(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!s)return;if(s[e])return s[e];const i=e.split(t);let n=s;for(let o=0;o<i.length;){if(!n||typeof n!="object")return;let r,a="";for(let l=o;l<i.length;++l)if(l!==o&&(a+=t),a+=i[l],r=n[a],r!==void 0){if(["string","number","boolean"].indexOf(typeof r)>-1&&l<i.length-1)continue;o+=l-o+1;break}n=r}return n}function getCleanedCode(s){return s&&s.indexOf("_")>0?s.replace("_","-"):s}class ResourceStore extends EventEmitter{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,i){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,r=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,t],i&&(Array.isArray(i)?a.push(...i):typeof i=="string"&&o?a.push(...i.split(o)):a.push(i)));const l=getPath(this.data,a);return!l&&!t&&!i&&e.indexOf(".")>-1&&(e=a[0],t=a[1],i=a.slice(2).join(".")),l||!r||typeof i!="string"?l:deepFind(this.data&&this.data[e]&&this.data[e][t],i,o)}addResource(e,t,i,n){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const r=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let a=[e,t];i&&(a=a.concat(r?i.split(r):i)),e.indexOf(".")>-1&&(a=e.split("."),n=t,t=a[1]),this.addNamespaces(t),setPath(this.data,a,n),o.silent||this.emit("added",e,t,i,n)}addResources(e,t,i){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in i)(typeof i[o]=="string"||Object.prototype.toString.apply(i[o])==="[object Array]")&&this.addResource(e,t,o,i[o],{silent:!0});n.silent||this.emit("added",e,t,i)}addResourceBundle(e,t,i,n,o){let r=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),n=i,i=t,t=a[1]),this.addNamespaces(t);let l=getPath(this.data,a)||{};r.skipCopy||(i=JSON.parse(JSON.stringify(i))),n?deepExtend(l,i,o):l={...l,...i},setPath(this.data,a,l),r.silent||this.emit("added",e,t,i)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}}var postProcessor={processors:{},addPostProcessor(s){this.processors[s.name]=s},handle(s,e,t,i,n){return s.forEach(o=>{this.processors[o]&&(e=this.processors[o].process(e,t,i,n))}),e}};const checkedLoadedFor={};class Translator extends EventEmitter{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),copy(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=baseLogger.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const i=this.resolve(e,t);return i&&i.res!==void 0}extractFromKey(e,t){let i=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const r=i&&e.indexOf(i)>-1,a=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!looksLikeObjectPath(e,i,n);if(r&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:o};const d=e.split(i);(i!==n||i===n&&this.options.ns.indexOf(d[0])>-1)&&(o=d.shift()),e=d.join(n)}return typeof o=="string"&&(o=[o]),{key:e,namespaces:o}}translate(e,t,i){if(typeof t!="object"&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),typeof t=="object"&&(t={...t}),t||(t={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const n=t.returnDetails!==void 0?t.returnDetails:this.options.returnDetails,o=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator,{key:r,namespaces:a}=this.extractFromKey(e[e.length-1],t),l=a[a.length-1],d=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&d.toLowerCase()==="cimode"){if(h){const A=t.nsSeparator||this.options.nsSeparator;return n?{res:`${l}${A}${r}`,usedKey:r,exactUsedKey:r,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:`${l}${A}${r}`}return n?{res:r,usedKey:r,exactUsedKey:r,usedLng:d,usedNS:l,usedParams:this.getUsedParamsDetails(t)}:r}const p=this.resolve(e,t);let m=p&&p.res;const v=p&&p.usedKey||r,y=p&&p.exactUsedKey||r,b=Object.prototype.toString.apply(m),S=["[object Number]","[object Function]","[object RegExp]"],E=t.joinArrays!==void 0?t.joinArrays:this.options.joinArrays,T=!this.i18nFormat||this.i18nFormat.handleAsObject;if(T&&m&&(typeof m!="string"&&typeof m!="boolean"&&typeof m!="number")&&S.indexOf(b)<0&&!(typeof E=="string"&&b==="[object Array]")){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const A=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,m,{...t,ns:a}):`key '${r} (${this.language})' returned an object instead of string.`;return n?(p.res=A,p.usedParams=this.getUsedParamsDetails(t),p):A}if(o){const A=b==="[object Array]",D=A?[]:{},x=A?y:v;for(const M in m)if(Object.prototype.hasOwnProperty.call(m,M)){const I=`${x}${o}${M}`;D[M]=this.translate(I,{...t,joinArrays:!1,ns:a}),D[M]===I&&(D[M]=m[M])}m=D}}else if(T&&typeof E=="string"&&b==="[object Array]")m=m.join(E),m&&(m=this.extendTranslation(m,e,t,i));else{let A=!1,D=!1;const x=t.count!==void 0&&typeof t.count!="string",M=Translator.hasDefaultValue(t),I=x?this.pluralResolver.getSuffix(d,t.count,t):"",V=t.ordinal&&x?this.pluralResolver.getSuffix(d,t.count,{ordinal:!1}):"",z=x&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),B=z&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${I}`]||t[`defaultValue${V}`]||t.defaultValue;!this.isValidLookup(m)&&M&&(A=!0,m=B),this.isValidLookup(m)||(D=!0,m=r);const J=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&D?void 0:m,Z=M&&B!==m&&this.options.updateMissing;if(D||A||Z){if(this.logger.log(Z?"updateKey":"missingKey",d,l,r,Z?B:m),o){const W=this.resolve(r,{...t,keySeparator:!1});W&&W.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let F=[];const $=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if(this.options.saveMissingTo==="fallback"&&$&&$[0])for(let W=0;W<$.length;W++)F.push($[W]);else this.options.saveMissingTo==="all"?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);const Y=(W,X,U)=>{const se=M&&U!==m?U:J;this.options.missingKeyHandler?this.options.missingKeyHandler(W,l,X,se,Z,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(W,l,X,se,Z,t),this.emit("missingKey",W,l,X,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?F.forEach(W=>{const X=this.pluralResolver.getSuffixes(W,t);z&&t[`defaultValue${this.options.pluralSeparator}zero`]&&X.indexOf(`${this.options.pluralSeparator}zero`)<0&&X.push(`${this.options.pluralSeparator}zero`),X.forEach(U=>{Y([W],r+U,t[`defaultValue${U}`]||B)})}):Y(F,r,B))}m=this.extendTranslation(m,e,t,p,i),D&&m===r&&this.options.appendNamespaceToMissingKey&&(m=`${l}:${r}`),(D||A)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${r}`:r,A?m:void 0):m=this.options.parseMissingKeyHandler(m))}return n?(p.res=m,p.usedParams=this.getUsedParamsDetails(t),p):m}extendTranslation(e,t,i,n,o){var r=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const d=typeof e=="string"&&(i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(d){const m=e.match(this.interpolator.nestingRegexp);h=m&&m.length}let p=i.replace&&typeof i.replace!="string"?i.replace:i;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),e=this.interpolator.interpolate(e,p,i.lng||this.language,i),d){const m=e.match(this.interpolator.nestingRegexp),v=m&&m.length;h<v&&(i.nest=!1)}!i.lng&&this.options.compatibilityAPI!=="v1"&&n&&n.res&&(i.lng=n.usedLng),i.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var m=arguments.length,v=new Array(m),y=0;y<m;y++)v[y]=arguments[y];return o&&o[0]===v[0]&&!i.context?(r.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${t[0]}`),null):r.translate(...v,t)},i)),i.interpolation&&this.interpolator.reset()}const a=i.postProcess||this.options.postProcess,l=typeof a=="string"?[a]:a;return e!=null&&l&&l.length&&i.applyPostProcessor!==!1&&(e=postProcessor.handle(l,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i,n,o,r,a;return typeof e=="string"&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(i))return;const d=this.extractFromKey(l,t),h=d.key;n=h;let p=d.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const m=t.count!==void 0&&typeof t.count!="string",v=m&&!t.ordinal&&t.count===0&&this.pluralResolver.shouldUseIntlApi(),y=t.context!==void 0&&(typeof t.context=="string"||typeof t.context=="number")&&t.context!=="",b=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);p.forEach(S=>{this.isValidLookup(i)||(a=S,!checkedLoadedFor[`${b[0]}-${S}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(checkedLoadedFor[`${b[0]}-${S}`]=!0,this.logger.warn(`key "${n}" for languages "${b.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(E=>{if(this.isValidLookup(i))return;r=E;const T=[h];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(T,h,E,S,t);else{let A;m&&(A=this.pluralResolver.getSuffix(E,t.count,t));const D=`${this.options.pluralSeparator}zero`,x=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(T.push(h+A),t.ordinal&&A.indexOf(x)===0&&T.push(h+A.replace(x,this.options.pluralSeparator)),v&&T.push(h+D)),y){const M=`${h}${this.options.contextSeparator}${t.context}`;T.push(M),m&&(T.push(M+A),t.ordinal&&A.indexOf(x)===0&&T.push(M+A.replace(x,this.options.pluralSeparator)),v&&T.push(M+D))}}let R;for(;R=T.pop();)this.isValidLookup(i)||(o=R,i=this.getResource(E,S,R,t))}))})}),{res:i,usedKey:n,exactUsedKey:o,usedLng:r,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,i){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,i,n):this.resourceStore.getResource(e,t,i,n)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&typeof e.replace!="string";let n=i?e.replace:e;if(i&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!i){n={...n};for(const o of t)delete n[o]}return n}static hasDefaultValue(e){const t="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t===i.substring(0,t.length)&&e[i]!==void 0)return!0;return!1}}function capitalize(s){return s.charAt(0).toUpperCase()+s.slice(1)}class LanguageUtil{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=baseLogger.create("languageUtils")}getScriptPartFromCode(e){if(e=getCleanedCode(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=getCleanedCode(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const t=["hans","hant","latn","cyrl","cans","mong","arab"];let i=e.split("-");return this.options.lowerCaseLng?i=i.map(n=>n.toLowerCase()):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=capitalize(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=capitalize(i[1].toLowerCase())),t.indexOf(i[2].toLowerCase())>-1&&(i[2]=capitalize(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(i=>{if(t)return;const n=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(i=>{if(t)return;const n=this.getLanguagePartFromCode(i);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(o=>{if(o===n)return o;if(!(o.indexOf("-")<0&&n.indexOf("-")<0)&&o.indexOf(n)===0)return o})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!t)return e.default||[];let i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}toResolveHierarchy(e,t){const i=this.getFallbackCodes(t||this.options.fallbackLng||[],e),n=[],o=r=>{r&&(this.isSupportedCode(r)?n.push(r):this.logger.warn(`rejecting language code not found in supportedLngs: ${r}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(e))):typeof e=="string"&&o(this.formatLanguageCode(e)),i.forEach(r=>{n.indexOf(r)<0&&o(this.formatLanguageCode(r))}),n}}let sets=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],_rulesPluralsTypes={1:function(s){return+(s>1)},2:function(s){return+(s!=1)},3:function(s){return 0},4:function(s){return s%10==1&&s%100!=11?0:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?1:2},5:function(s){return s==0?0:s==1?1:s==2?2:s%100>=3&&s%100<=10?3:s%100>=11?4:5},6:function(s){return s==1?0:s>=2&&s<=4?1:2},7:function(s){return s==1?0:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?1:2},8:function(s){return s==1?0:s==2?1:s!=8&&s!=11?2:3},9:function(s){return+(s>=2)},10:function(s){return s==1?0:s==2?1:s<7?2:s<11?3:4},11:function(s){return s==1||s==11?0:s==2||s==12?1:s>2&&s<20?2:3},12:function(s){return+(s%10!=1||s%100==11)},13:function(s){return+(s!==0)},14:function(s){return s==1?0:s==2?1:s==3?2:3},15:function(s){return s%10==1&&s%100!=11?0:s%10>=2&&(s%100<10||s%100>=20)?1:2},16:function(s){return s%10==1&&s%100!=11?0:s!==0?1:2},17:function(s){return s==1||s%10==1&&s%100!=11?0:1},18:function(s){return s==0?0:s==1?1:2},19:function(s){return s==1?0:s==0||s%100>1&&s%100<11?1:s%100>10&&s%100<20?2:3},20:function(s){return s==1?0:s==0||s%100>0&&s%100<20?1:2},21:function(s){return s%100==1?1:s%100==2?2:s%100==3||s%100==4?3:0},22:function(s){return s==1?0:s==2?1:(s<0||s>10)&&s%10==0?2:3}};const nonIntlVersions=["v1","v2","v3"],intlVersions=["v4"],suffixesOrder={zero:0,one:1,two:2,few:3,many:4,other:5};function createRules(){const s={};return sets.forEach(e=>{e.lngs.forEach(t=>{s[t]={numbers:e.nr,plurals:_rulesPluralsTypes[e.fc]}})}),s}class PluralResolver{constructor(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=baseLogger.create("pluralResolver"),(!this.options.compatibilityJSON||intlVersions.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=createRules()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(getCleanedCode(e==="dev"?"en":e),{type:t.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=this.getRule(e,t);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}getPluralFormsOfKey(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,i).map(n=>`${t}${n}`)}getSuffixes(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=this.getRule(e,t);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort((n,o)=>suffixesOrder[n]-suffixesOrder[o]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):i.numbers.map(n=>this.getSuffix(e,n,t)):[]}getSuffix(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const n=this.getRule(e,i);return n?this.shouldUseIntlApi()?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:this.getSuffixRetroCompatible(n,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const i=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let n=e.numbers[i];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(n===2?n="plural":n===1&&(n=""));const o=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return this.options.compatibilityJSON==="v1"?n===1?"":typeof n=="number"?`_plural_${n.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?o():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}shouldUseIntlApi(){return!nonIntlVersions.includes(this.options.compatibilityJSON)}}function deepFindWithDefaults(s,e,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",n=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=getPathWithDefaults(s,e,t);return!o&&n&&typeof t=="string"&&(o=deepFind(s,t,i),o===void 0&&(o=deepFind(e,t,i))),o}class Interpolator{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=baseLogger.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(t=>t),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const t=e.interpolation;this.escape=t.escape!==void 0?t.escape:escape$1,this.escapeValue=t.escapeValue!==void 0?t.escapeValue:!0,this.useRawValueToEscape=t.useRawValueToEscape!==void 0?t.useRawValueToEscape:!1,this.prefix=t.prefix?regexEscape(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?regexEscape(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?regexEscape(t.nestingPrefix):t.nestingPrefixEscaped||regexEscape("$t("),this.nestingSuffix=t.nestingSuffix?regexEscape(t.nestingSuffix):t.nestingSuffixEscaped||regexEscape(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=t.alwaysFormat!==void 0?t.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,i)=>t&&t.source===i?(t.lastIndex=0,t):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,i,n){let o,r,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(y){return y.replace(/\$/g,"$$$$")}const h=y=>{if(y.indexOf(this.formatSeparator)<0){const T=deepFindWithDefaults(t,l,y,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(T,void 0,i,{...n,...t,interpolationkey:y}):T}const b=y.split(this.formatSeparator),S=b.shift().trim(),E=b.join(this.formatSeparator).trim();return this.format(deepFindWithDefaults(t,l,S,this.options.keySeparator,this.options.ignoreJSONStructure),E,i,{...n,...t,interpolationkey:S})};this.resetRegExp();const p=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,m=n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:y=>d(y)},{regex:this.regexp,safeValue:y=>this.escapeValue?d(this.escape(y)):d(y)}].forEach(y=>{for(a=0;o=y.regex.exec(e);){const b=o[1].trim();if(r=h(b),r===void 0)if(typeof p=="function"){const E=p(e,o,n);r=typeof E=="string"?E:""}else if(n&&Object.prototype.hasOwnProperty.call(n,b))r="";else if(m){r=o[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${e}`),r="";else typeof r!="string"&&!this.useRawValueToEscape&&(r=makeString(r));const S=y.safeValue(r);if(e=e.replace(o[0],S),m?(y.regex.lastIndex+=r.length,y.regex.lastIndex-=o[0].length):y.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n,o,r;function a(l,d){const h=this.nestingOptionsSeparator;if(l.indexOf(h)<0)return l;const p=l.split(new RegExp(`${h}[ ]*{`));let m=`{${p[1]}`;l=p[0],m=this.interpolate(m,r);const v=m.match(/'/g),y=m.match(/"/g);(v&&v.length%2===0&&!y||y.length%2!==0)&&(m=m.replace(/'/g,'"'));try{r=JSON.parse(m),d&&(r={...d,...r})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,b),`${l}${h}${m}`}return delete r.defaultValue,l}for(;n=this.nestingRegexp.exec(e);){let l=[];r={...i},r=r.replace&&typeof r.replace!="string"?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;let d=!1;if(n[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(n[1])){const h=n[1].split(this.formatSeparator).map(p=>p.trim());n[1]=h.shift(),l=h,d=!0}if(o=t(a.call(this,n[1].trim(),r),r),o&&n[0]===e&&typeof o!="string")return o;typeof o!="string"&&(o=makeString(o)),o||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),o=""),d&&(o=l.reduce((h,p)=>this.format(h,p,i.lng,{...i,interpolationkey:n[1].trim()}),o.trim())),e=e.replace(n[0],o),this.regexp.lastIndex=0}return e}}function parseFormatStr(s){let e=s.toLowerCase().trim();const t={};if(s.indexOf("(")>-1){const i=s.split("(");e=i[0].toLowerCase().trim();const n=i[1].substring(0,i[1].length-1);e==="currency"&&n.indexOf(":")<0?t.currency||(t.currency=n.trim()):e==="relativetime"&&n.indexOf(":")<0?t.range||(t.range=n.trim()):n.split(";").forEach(r=>{if(!r)return;const[a,...l]=r.split(":"),d=l.join(":").trim().replace(/^'+|'+$/g,"");t[a.trim()]||(t[a.trim()]=d),d==="false"&&(t[a.trim()]=!1),d==="true"&&(t[a.trim()]=!0),isNaN(d)||(t[a.trim()]=parseInt(d,10))})}return{formatName:e,formatOptions:t}}function createCachedFormatter(s){const e={};return function(i,n,o){const r=n+JSON.stringify(o);let a=e[r];return a||(a=s(getCleanedCode(n),o),e[r]=a),a(i)}}class Formatter{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=baseLogger.create("formatter"),this.options=e,this.formats={number:createCachedFormatter((t,i)=>{const n=new Intl.NumberFormat(t,{...i});return o=>n.format(o)}),currency:createCachedFormatter((t,i)=>{const n=new Intl.NumberFormat(t,{...i,style:"currency"});return o=>n.format(o)}),datetime:createCachedFormatter((t,i)=>{const n=new Intl.DateTimeFormat(t,{...i});return o=>n.format(o)}),relativetime:createCachedFormatter((t,i)=>{const n=new Intl.RelativeTimeFormat(t,{...i});return o=>n.format(o,i.range||"day")}),list:createCachedFormatter((t,i)=>{const n=new Intl.ListFormat(t,{...i});return o=>n.format(o)})},this.init(e)}init(e){const i=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=createCachedFormatter(t)}format(e,t,i){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return t.split(this.formatSeparator).reduce((a,l)=>{const{formatName:d,formatOptions:h}=parseFormatStr(l);if(this.formats[d]){let p=a;try{const m=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},v=m.locale||m.lng||n.locale||n.lng||i;p=this.formats[d](a,v,{...h,...n,...m})}catch(m){this.logger.warn(m)}return p}else this.logger.warn(`there was no format function for ${d}`);return a},e)}}function removePending(s,e){s.pending[e]!==void 0&&(delete s.pending[e],s.pendingCount--)}class Connector extends EventEmitter{constructor(e,t,i){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=n,this.logger=baseLogger.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(i,n.backend,n)}queueLoad(e,t,i,n){const o={},r={},a={},l={};return e.forEach(d=>{let h=!0;t.forEach(p=>{const m=`${d}|${p}`;!i.reload&&this.store.hasResourceBundle(d,p)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?r[m]===void 0&&(r[m]=!0):(this.state[m]=1,h=!1,r[m]===void 0&&(r[m]=!0),o[m]===void 0&&(o[m]=!0),l[p]===void 0&&(l[p]=!0)))}),h||(a[d]=!0)}),(Object.keys(o).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(o),pending:Object.keys(r),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,t,i){const n=e.split("|"),o=n[0],r=n[1];t&&this.emit("failedLoading",o,r,t),i&&this.store.addResourceBundle(o,r,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2;const a={};this.queue.forEach(l=>{pushPath(l.loaded,[o],r),removePending(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(d=>{a[d]||(a[d]={});const h=l.loaded[d];h.length&&h.forEach(p=>{a[d][p]===void 0&&(a[d][p]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,t,i){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,r=arguments.length>5?arguments[5]:void 0;if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:i,tried:n,wait:o,callback:r});return}this.readingCalls++;const a=(d,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(d&&h&&n<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,i,n+1,o*2,r)},o);return}r(d,h)},l=this.backend[i].bind(this.backend);if(l.length===2){try{const d=l(e,t);d&&typeof d.then=="function"?d.then(h=>a(null,h)).catch(a):a(null,d)}catch(d){a(d)}return}return l(e,t,a)}prepareLoading(e,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof t=="string"&&(t=[t]);const o=this.queueLoad(e,t,i,n);if(!o.toLoad.length)return o.pending.length||n(),null;o.toLoad.forEach(r=>{this.loadOne(r)})}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const i=e.split("|"),n=i[0],o=i[1];this.read(n,o,"read",void 0,void 0,(r,a)=>{r&&this.logger.warn(`${t}loading namespace ${o} for language ${n} failed`,r),!r&&a&&this.logger.log(`${t}loaded namespace ${o} for language ${n}`,a),this.loaded(e,r,a)})}saveMissing(e,t,i,n,o){let r=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${i}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend&&this.backend.create){const l={...r,isUpdate:o},d=this.backend.create.bind(this.backend);if(d.length<6)try{let h;d.length===5?h=d(e,t,i,n,l):h=d(e,t,i,n),h&&typeof h.then=="function"?h.then(p=>a(null,p)).catch(a):a(null,h)}catch(h){a(h)}else d(e,t,i,n,a,l)}!e||!e[0]||this.store.addResource(e[0],t,i,n)}}}function get(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if(typeof e[1]=="object"&&(t=e[1]),typeof e[1]=="string"&&(t.defaultValue=e[1]),typeof e[2]=="string"&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const i=e[3]||e[2];Object.keys(i).forEach(n=>{t[n]=i[n]})}return t},interpolation:{escapeValue:!0,format:s=>s,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function transformOptions(s){return typeof s.ns=="string"&&(s.ns=[s.ns]),typeof s.fallbackLng=="string"&&(s.fallbackLng=[s.fallbackLng]),typeof s.fallbackNS=="string"&&(s.fallbackNS=[s.fallbackNS]),s.supportedLngs&&s.supportedLngs.indexOf("cimode")<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),s}function noop$2(){}function bindMemberFunctions(s){Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(t=>{typeof s[t]=="function"&&(s[t]=s[t].bind(s))})}class I18n extends EventEmitter{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=transformOptions(e),this.services={},this.logger=baseLogger,this.modules={external:[]},bindMemberFunctions(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof t=="function"&&(i=t,t={}),!t.defaultNS&&t.defaultNS!==!1&&t.ns&&(typeof t.ns=="string"?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const n=get();this.options={...n,...this.options,...transformOptions(t)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...n.interpolation,...this.options.interpolation}),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);function o(h){return h?typeof h=="function"?new h:h:null}if(!this.options.isClone){this.modules.logger?baseLogger.init(o(this.modules.logger),this.options):baseLogger.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:typeof Intl<"u"&&(h=Formatter);const p=new LanguageUtil(this.options);this.store=new ResourceStore(this.options.resources,this.options);const m=this.services;m.logger=baseLogger,m.resourceStore=this.store,m.languageUtils=p,m.pluralResolver=new PluralResolver(p,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),h&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(m.formatter=o(h),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new Interpolator(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new Connector(o(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(v){for(var y=arguments.length,b=new Array(y>1?y-1:0),S=1;S<y;S++)b[S-1]=arguments[S];e.emit(v,...b)}),this.modules.languageDetector&&(m.languageDetector=o(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=o(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new Translator(this.services,this.options),this.translator.on("*",function(v){for(var y=arguments.length,b=new Array(y>1?y-1:0),S=1;S<y;S++)b[S-1]=arguments[S];e.emit(v,...b)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,i||(i=noop$2),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=function(){return e.store[h](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=function(){return e.store[h](...arguments),e}});const l=defer(),d=()=>{const h=(p,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(m),i(p,m)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initImmediate?d():setTimeout(d,0),l}loadResources(e){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$2;const n=typeof e=="string"?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const o=[],r=a=>{if(!a||a==="cimode")return;this.services.languageUtils.toResolveHierarchy(a).forEach(d=>{d!=="cimode"&&o.indexOf(d)<0&&o.push(d)})};n?r(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>r(l)),this.options.preload&&this.options.preload.forEach(a=>r(a)),this.services.backendConnector.load(o,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(a)})}else i(null)}reloadResources(e,t,i){const n=defer();return e||(e=this.languages),t||(t=this.options.ns),i||(i=noop$2),this.services.backendConnector.reload(e,t,o=>{n.resolve(),i(o)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&postProcessor.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t<this.languages.length;t++){const i=this.languages[t];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}changeLanguage(e,t){var i=this;this.isLanguageChangingTo=e;const n=defer();this.emit("languageChanging",e);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},r=(l,d)=>{d?(o(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,n.resolve(function(){return i.t(...arguments)}),t&&t(l,function(){return i.t(...arguments)})},a=l=>{!e&&!l&&this.services.languageDetector&&(l=[]);const d=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);d&&(this.language||o(d),this.translator.language||this.translator.changeLanguage(d),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(d)),this.loadResources(d,h=>{r(h,d)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),n}getFixedT(e,t,i){var n=this;const o=function(r,a){let l;if(typeof a!="object"){for(var d=arguments.length,h=new Array(d>2?d-2:0),p=2;p<d;p++)h[p-2]=arguments[p];l=n.options.overloadTranslationOptionHandler([r,a].concat(h))}else l={...a};l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix=l.keyPrefix||i||o.keyPrefix;const m=n.options.keySeparator||".";let v;return l.keyPrefix&&Array.isArray(r)?v=r.map(y=>`${l.keyPrefix}${m}${y}`):v=l.keyPrefix?`${l.keyPrefix}${m}${r}`:r,n.t(v,l)};return typeof e=="string"?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=i,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=t.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const r=(a,l)=>{const d=this.services.backendConnector.state[`${a}|${l}`];return d===-1||d===2};if(t.precheck){const a=t.precheck(this,r);if(a!==void 0)return a}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||r(i,e)&&(!n||r(o,e)))}loadNamespaces(e,t){const i=defer();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(n=>{this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}),this.loadResources(n=>{i.resolve(),t&&t(n)}),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){const i=defer();typeof e=="string"&&(e=[e]);const n=this.options.preload||[],o=e.filter(r=>n.indexOf(r)<0);return o.length?(this.options.preload=n.concat(o),this.loadResources(r=>{i.resolve(),t&&t(r)}),i):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services&&this.services.languageUtils||new LanguageUtil(get());return t.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new I18n(e,t)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:noop$2;const i=e.forkResourceStore;i&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},o=new I18n(n);return(e.debug!==void 0||e.prefix!==void 0)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(a=>{o[a]=this[a]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},i&&(o.store=new ResourceStore(this.store.data,n),o.services.resourceStore=o.store),o.translator=new Translator(o.services,n),o.translator.on("*",function(a){for(var l=arguments.length,d=new Array(l>1?l-1:0),h=1;h<l;h++)d[h-1]=arguments[h];o.emit(a,...d)}),o.init(n,t),o.translator.options=n,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const instance=I18n.createInstance();instance.createInstance=I18n.createInstance;instance.createInstance;instance.dir;instance.init;instance.loadResources;instance.reloadResources;instance.use;instance.changeLanguage;instance.getFixedT;instance.t;instance.exists;instance.setDefaultNamespace;instance.hasLoadedNamespace;instance.loadNamespaces;instance.loadLanguages;function _classCallCheck$1(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function _typeof$3(s){"@babel/helpers - typeof";return _typeof$3=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(s)}function toPrimitive(s,e){if(_typeof$3(s)!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e||"default");if(_typeof$3(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function toPropertyKey(s){var e=toPrimitive(s,"string");return _typeof$3(e)=="symbol"?e:String(e)}function _defineProperties$1(s,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(s,toPropertyKey(i.key),i)}}function _createClass$1(s,e,t){return e&&_defineProperties$1(s.prototype,e),t&&_defineProperties$1(s,t),Object.defineProperty(s,"prototype",{writable:!1}),s}var arr=[],each$1=arr.forEach,slice=arr.slice;function defaults$1(s){return each$1.call(slice.call(arguments,1),function(e){if(e)for(var t in e)s[t]===void 0&&(s[t]=e[t])}),s}function createClassOnDemand(s){return s?typeof s=="function"?new s:s:null}function getDefaults$2(){return{handleEmptyResourcesAsFailed:!0,cacheHitMode:"none"}}function handleCorrectReadFunction(s,e,t,i){var n=s.read.bind(s);if(n.length===2){try{var o=n(e,t);o&&typeof o.then=="function"?o.then(function(r){return i(null,r)}).catch(i):i(null,o)}catch(r){i(r)}return}n(e,t,i)}var Backend$1=function(){function s(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_classCallCheck$1(this,s),this.backends=[],this.type="backend",this.allOptions=i,this.init(e,t)}return _createClass$1(s,[{key:"init",value:function(t){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=defaults$1(n,this.options||{},getDefaults$2()),this.allOptions=o,this.options.backends&&this.options.backends.forEach(function(r,a){i.backends[a]=i.backends[a]||createClassOnDemand(r),i.backends[a].init(t,i.options.backendOptions&&i.options.backendOptions[a]||{},o)}),this.services&&this.options.reloadInterval&&setInterval(function(){return i.reload()},this.options.reloadInterval)}},{key:"read",value:function(t,i,n){var o=this,r=this.backends.length,a=function d(h){if(h>=r)return n(new Error("non of the backend loaded data",!0));var p=h===r-1,m=o.options.handleEmptyResourcesAsFailed&&!p?0:-1,v=o.backends[h];v.read?handleCorrectReadFunction(v,t,i,function(y,b,S){if(!y&&b&&Object.keys(b).length>m){if(n(null,b,h),l(h-1,b),v.save&&o.options.cacheHitMode&&["refresh","refreshAndUpdateStore"].indexOf(o.options.cacheHitMode)>-1){if(S&&o.options.refreshExpirationTime&&S+o.options.refreshExpirationTime>Date.now())return;var E=o.backends[h+1];E&&E.read&&handleCorrectReadFunction(E,t,i,function(T,R){T||R&&(Object.keys(R).length<=m||(l(h,R),o.options.cacheHitMode==="refreshAndUpdateStore"&&o.services&&o.services.resourceStore&&o.services.resourceStore.addResourceBundle(t,i,R)))})}}else d(h+1)}):d(h+1)},l=function d(h,p){if(!(h<0)){var m=o.backends[h];m.save&&m.save(t,i,p),d(h-1,p)}};a(0)}},{key:"create",value:function(t,i,n,o){var r=arguments.length>4&&arguments[4]!==void 0?arguments[4]:function(){},a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};this.backends.forEach(function(l){if(l.create){var d=l.create.bind(l);if(d.length<6){try{var h;d.length===5?h=d(t,i,n,o,a):h=d(t,i,n,o),h&&typeof h.then=="function"?h.then(function(p){return r(null,p)}).catch(r):r(null,h)}catch(p){r(p)}return}d(t,i,n,o,r,a)}})}},{key:"reload",value:function(){var t=this,i=this.services,n=i.backendConnector,o=i.languageUtils,r=i.logger,a=n.language;if(!(a&&a.toLowerCase()==="cimode")){var l=[],d=function(p){var m=o.toResolveHierarchy(p);m.forEach(function(v){l.indexOf(v)<0&&l.push(v)})};d(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(h){return d(h)}),l.forEach(function(h){t.allOptions.ns.forEach(function(p){n.read(h,p,"read",null,null,function(m,v){m&&r.warn("loading namespace ".concat(p," for language ").concat(h," failed"),m),!m&&v&&r.log("loaded namespace ".concat(p," for language ").concat(h),v),n.loaded("".concat(h,"|").concat(p),m,v)})})})}}}]),s}();Backend$1.type="backend";function _typeof$2(s){"@babel/helpers - typeof";return _typeof$2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$2(s)}function hasXMLHttpRequest(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":_typeof$2(XMLHttpRequest))==="object"}function isPromise(s){return!!s&&typeof s.then=="function"}function makePromise(s){return isPromise(s)?s:Promise.resolve(s)}function commonjsRequire(s){throw new Error('Could not dynamically require "'+s+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var getFetch$1={exports:{}},browserPonyfill={exports:{}},hasRequiredBrowserPonyfill;function requireBrowserPonyfill(){return hasRequiredBrowserPonyfill||(hasRequiredBrowserPonyfill=1,function(s,e){var t=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof commonjsGlobal<"u"&&commonjsGlobal,i=function(){function o(){this.fetch=!1,this.DOMException=t.DOMException}return o.prototype=t,new o}();(function(o){(function(r){var a=typeof o<"u"&&o||typeof self<"u"&&self||typeof a<"u"&&a,l={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function d(F){return F&&DataView.prototype.isPrototypeOf(F)}if(l.arrayBuffer)var h=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],p=ArrayBuffer.isView||function(F){return F&&h.indexOf(Object.prototype.toString.call(F))>-1};function m(F){if(typeof F!="string"&&(F=String(F)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(F)||F==="")throw new TypeError('Invalid character in header field name: "'+F+'"');return F.toLowerCase()}function v(F){return typeof F!="string"&&(F=String(F)),F}function y(F){var $={next:function(){var Y=F.shift();return{done:Y===void 0,value:Y}}};return l.iterable&&($[Symbol.iterator]=function(){return $}),$}function b(F){this.map={},F instanceof b?F.forEach(function($,Y){this.append(Y,$)},this):Array.isArray(F)?F.forEach(function($){this.append($[0],$[1])},this):F&&Object.getOwnPropertyNames(F).forEach(function($){this.append($,F[$])},this)}b.prototype.append=function(F,$){F=m(F),$=v($);var Y=this.map[F];this.map[F]=Y?Y+", "+$:$},b.prototype.delete=function(F){delete this.map[m(F)]},b.prototype.get=function(F){return F=m(F),this.has(F)?this.map[F]:null},b.prototype.has=function(F){return this.map.hasOwnProperty(m(F))},b.prototype.set=function(F,$){this.map[m(F)]=v($)},b.prototype.forEach=function(F,$){for(var Y in this.map)this.map.hasOwnProperty(Y)&&F.call($,this.map[Y],Y,this)},b.prototype.keys=function(){var F=[];return this.forEach(function($,Y){F.push(Y)}),y(F)},b.prototype.values=function(){var F=[];return this.forEach(function($){F.push($)}),y(F)},b.prototype.entries=function(){var F=[];return this.forEach(function($,Y){F.push([Y,$])}),y(F)},l.iterable&&(b.prototype[Symbol.iterator]=b.prototype.entries);function S(F){if(F.bodyUsed)return Promise.reject(new TypeError("Already read"));F.bodyUsed=!0}function E(F){return new Promise(function($,Y){F.onload=function(){$(F.result)},F.onerror=function(){Y(F.error)}})}function T(F){var $=new FileReader,Y=E($);return $.readAsArrayBuffer(F),Y}function R(F){var $=new FileReader,Y=E($);return $.readAsText(F),Y}function A(F){for(var $=new Uint8Array(F),Y=new Array($.length),W=0;W<$.length;W++)Y[W]=String.fromCharCode($[W]);return Y.join("")}function D(F){if(F.slice)return F.slice(0);var $=new Uint8Array(F.byteLength);return $.set(new Uint8Array(F)),$.buffer}function x(){return this.bodyUsed=!1,this._initBody=function(F){this.bodyUsed=this.bodyUsed,this._bodyInit=F,F?typeof F=="string"?this._bodyText=F:l.blob&&Blob.prototype.isPrototypeOf(F)?this._bodyBlob=F:l.formData&&FormData.prototype.isPrototypeOf(F)?this._bodyFormData=F:l.searchParams&&URLSearchParams.prototype.isPrototypeOf(F)?this._bodyText=F.toString():l.arrayBuffer&&l.blob&&d(F)?(this._bodyArrayBuffer=D(F.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):l.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(F)||p(F))?this._bodyArrayBuffer=D(F):this._bodyText=F=Object.prototype.toString.call(F):this._bodyText="",this.headers.get("content-type")||(typeof F=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):l.searchParams&&URLSearchParams.prototype.isPrototypeOf(F)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},l.blob&&(this.blob=function(){var F=S(this);if(F)return F;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var F=S(this);return F||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(T)}),this.text=function(){var F=S(this);if(F)return F;if(this._bodyBlob)return R(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(A(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},l.formData&&(this.formData=function(){return this.text().then(z)}),this.json=function(){return this.text().then(JSON.parse)},this}var M=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function I(F){var $=F.toUpperCase();return M.indexOf($)>-1?$:F}function V(F,$){if(!(this instanceof V))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');$=$||{};var Y=$.body;if(F instanceof V){if(F.bodyUsed)throw new TypeError("Already read");this.url=F.url,this.credentials=F.credentials,$.headers||(this.headers=new b(F.headers)),this.method=F.method,this.mode=F.mode,this.signal=F.signal,!Y&&F._bodyInit!=null&&(Y=F._bodyInit,F.bodyUsed=!0)}else this.url=String(F);if(this.credentials=$.credentials||this.credentials||"same-origin",($.headers||!this.headers)&&(this.headers=new b($.headers)),this.method=I($.method||this.method||"GET"),this.mode=$.mode||this.mode||null,this.signal=$.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&Y)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(Y),(this.method==="GET"||this.method==="HEAD")&&($.cache==="no-store"||$.cache==="no-cache")){var W=/([?&])_=[^&]*/;if(W.test(this.url))this.url=this.url.replace(W,"$1_="+new Date().getTime());else{var X=/\?/;this.url+=(X.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}V.prototype.clone=function(){return new V(this,{body:this._bodyInit})};function z(F){var $=new FormData;return F.trim().split("&").forEach(function(Y){if(Y){var W=Y.split("="),X=W.shift().replace(/\+/g," "),U=W.join("=").replace(/\+/g," ");$.append(decodeURIComponent(X),decodeURIComponent(U))}}),$}function B(F){var $=new b,Y=F.replace(/\r?\n[\t ]+/g," ");return Y.split("\r").map(function(W){return W.indexOf(`
|
||
`)===0?W.substr(1,W.length):W}).forEach(function(W){var X=W.split(":"),U=X.shift().trim();if(U){var se=X.join(":").trim();$.append(U,se)}}),$}x.call(V.prototype);function K(F,$){if(!(this instanceof K))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');$||($={}),this.type="default",this.status=$.status===void 0?200:$.status,this.ok=this.status>=200&&this.status<300,this.statusText=$.statusText===void 0?"":""+$.statusText,this.headers=new b($.headers),this.url=$.url||"",this._initBody(F)}x.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new b(this.headers),url:this.url})},K.error=function(){var F=new K(null,{status:0,statusText:""});return F.type="error",F};var J=[301,302,303,307,308];K.redirect=function(F,$){if(J.indexOf($)===-1)throw new RangeError("Invalid status code");return new K(null,{status:$,headers:{location:F}})},r.DOMException=a.DOMException;try{new r.DOMException}catch{r.DOMException=function($,Y){this.message=$,this.name=Y;var W=Error($);this.stack=W.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function Z(F,$){return new Promise(function(Y,W){var X=new V(F,$);if(X.signal&&X.signal.aborted)return W(new r.DOMException("Aborted","AbortError"));var U=new XMLHttpRequest;function se(){U.abort()}U.onload=function(){var ae={status:U.status,statusText:U.statusText,headers:B(U.getAllResponseHeaders()||"")};ae.url="responseURL"in U?U.responseURL:ae.headers.get("X-Request-URL");var oe="response"in U?U.response:U.responseText;setTimeout(function(){Y(new K(oe,ae))},0)},U.onerror=function(){setTimeout(function(){W(new TypeError("Network request failed"))},0)},U.ontimeout=function(){setTimeout(function(){W(new TypeError("Network request failed"))},0)},U.onabort=function(){setTimeout(function(){W(new r.DOMException("Aborted","AbortError"))},0)};function pe(ae){try{return ae===""&&a.location.href?a.location.href:ae}catch{return ae}}U.open(X.method,pe(X.url),!0),X.credentials==="include"?U.withCredentials=!0:X.credentials==="omit"&&(U.withCredentials=!1),"responseType"in U&&(l.blob?U.responseType="blob":l.arrayBuffer&&X.headers.get("Content-Type")&&X.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(U.responseType="arraybuffer")),$&&typeof $.headers=="object"&&!($.headers instanceof b)?Object.getOwnPropertyNames($.headers).forEach(function(ae){U.setRequestHeader(ae,v($.headers[ae]))}):X.headers.forEach(function(ae,oe){U.setRequestHeader(oe,ae)}),X.signal&&(X.signal.addEventListener("abort",se),U.onreadystatechange=function(){U.readyState===4&&X.signal.removeEventListener("abort",se)}),U.send(typeof X._bodyInit>"u"?null:X._bodyInit)})}return Z.polyfill=!0,a.fetch||(a.fetch=Z,a.Headers=b,a.Request=V,a.Response=K),r.Headers=b,r.Request=V,r.Response=K,r.fetch=Z,r})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=t.fetch?t:i;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,s.exports=e}(browserPonyfill,browserPonyfill.exports)),browserPonyfill.exports}(function(s,e){var t;if(typeof fetch=="function"&&(typeof commonjsGlobal<"u"&&commonjsGlobal.fetch?t=commonjsGlobal.fetch:typeof window<"u"&&window.fetch?t=window.fetch:t=fetch),typeof commonjsRequire<"u"&&(typeof window>"u"||typeof window.document>"u")){var i=t||requireBrowserPonyfill();i.default&&(i=i.default),e.default=i,s.exports=e.default}})(getFetch$1,getFetch$1.exports);var getFetchExports=getFetch$1.exports;const getFetch=getDefaultExportFromCjs(getFetchExports),fetchNode=_mergeNamespaces({__proto__:null,default:getFetch},[getFetchExports]);function ownKeys$2(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function _objectSpread$2(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ownKeys$2(Object(t),!0).forEach(function(i){_defineProperty$2(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):ownKeys$2(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}function _defineProperty$2(s,e,t){return e=_toPropertyKey$1(e),e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function _toPropertyKey$1(s){var e=_toPrimitive$1(s,"string");return _typeof$1(e)=="symbol"?e:String(e)}function _toPrimitive$1(s,e){if(_typeof$1(s)!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e||"default");if(_typeof$1(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}function _typeof$1(s){"@babel/helpers - typeof";return _typeof$1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$1(s)}var fetchApi;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?fetchApi=global.fetch:typeof window<"u"&&window.fetch?fetchApi=window.fetch:fetchApi=fetch);var XmlHttpRequestApi;hasXMLHttpRequest()&&(typeof global<"u"&&global.XMLHttpRequest?XmlHttpRequestApi=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(XmlHttpRequestApi=window.XMLHttpRequest));var ActiveXObjectApi;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?ActiveXObjectApi=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(ActiveXObjectApi=window.ActiveXObject));!fetchApi&&fetchNode&&!XmlHttpRequestApi&&!ActiveXObjectApi&&(fetchApi=getFetch||fetchNode);typeof fetchApi!="function"&&(fetchApi=void 0);var addQueryString=function s(e,t){if(t&&_typeof$1(t)==="object"){var i="";for(var n in t)i+="&"+encodeURIComponent(n)+"="+encodeURIComponent(t[n]);if(!i)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+i.slice(1)}return e},fetchIt=function s(e,t,i,n){var o=function(l){if(!l.ok)return i(l.statusText||"Error",{status:l.status});l.text().then(function(d){i(null,{status:l.status,data:d})}).catch(i)};if(n){var r=n(e,t);if(r instanceof Promise){r.then(o).catch(i);return}}typeof fetch=="function"?fetch(e,t).then(o).catch(i):fetchApi(e,t).then(o).catch(i)},omitFetchOptions=!1,requestWithFetch=function s(e,t,i,n){e.queryStringParams&&(t=addQueryString(t,e.queryStringParams));var o=_objectSpread$2({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),i&&(o["Content-Type"]="application/json");var r=typeof e.requestOptions=="function"?e.requestOptions(i):e.requestOptions,a=_objectSpread$2({method:i?"POST":"GET",body:i?e.stringify(i):void 0,headers:o},omitFetchOptions?{}:r),l=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{fetchIt(t,a,n,l)}catch(d){if(!r||Object.keys(r).length===0||!d.message||d.message.indexOf("not implemented")<0)return n(d);try{Object.keys(r).forEach(function(h){delete a[h]}),fetchIt(t,a,n,l),omitFetchOptions=!0}catch(h){n(h)}}},requestWithXmlHttpRequest=function s(e,t,i,n){i&&_typeof$1(i)==="object"&&(i=addQueryString("",i).slice(1)),e.queryStringParams&&(t=addQueryString(t,e.queryStringParams));try{var o;XmlHttpRequestApi?o=new XmlHttpRequestApi:o=new ActiveXObjectApi("MSXML2.XMLHTTP.3.0"),o.open(i?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,i&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var r=e.customHeaders;if(r=typeof r=="function"?r():r,r)for(var a in r)o.setRequestHeader(a,r[a]);o.onreadystatechange=function(){o.readyState>3&&n(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(i)}catch(l){console&&console.log(l)}},request=function s(e,t,i,n){if(typeof i=="function"&&(n=i,i=void 0),n=n||function(){},fetchApi&&t.indexOf("file:")!==0)return requestWithFetch(e,t,i,n);if(hasXMLHttpRequest()||typeof ActiveXObject=="function")return requestWithXmlHttpRequest(e,t,i,n);n(new Error("No fetch and no xhr implementation found!"))};function _typeof(s){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(s)}function ownKeys$1(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function _objectSpread$1(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ownKeys$1(Object(t),!0).forEach(function(i){_defineProperty$1(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):ownKeys$1(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}function _classCallCheck(s,e){if(!(s instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(s,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(s,_toPropertyKey(i.key),i)}}function _createClass(s,e,t){return e&&_defineProperties(s.prototype,e),t&&_defineProperties(s,t),Object.defineProperty(s,"prototype",{writable:!1}),s}function _defineProperty$1(s,e,t){return e=_toPropertyKey(e),e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function _toPropertyKey(s){var e=_toPrimitive(s,"string");return _typeof(e)=="symbol"?e:String(e)}function _toPrimitive(s,e){if(_typeof(s)!="object"||!s)return s;var t=s[Symbol.toPrimitive];if(t!==void 0){var i=t.call(s,e||"default");if(_typeof(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(s)}var getDefaults$1=function s(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(t){return JSON.parse(t)},stringify:JSON.stringify,parsePayload:function(t,i,n){return _defineProperty$1({},i,n||"")},parseLoadPayload:function(t,i){},request,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},Backend=function(){function s(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_classCallCheck(this,s),this.services=e,this.options=t,this.allOptions=i,this.type="backend",this.init(e,t,i)}return _createClass(s,[{key:"init",value:function(t){var i=this,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=_objectSpread$1(_objectSpread$1(_objectSpread$1({},getDefaults$1()),this.options||{}),n),this.allOptions=o,this.services&&this.options.reloadInterval&&setInterval(function(){return i.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(t,i,n){this._readAny(t,t,i,i,n)}},{key:"read",value:function(t,i,n){this._readAny([t],t,[i],i,n)}},{key:"_readAny",value:function(t,i,n,o,r){var a=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(t,n)),l=makePromise(l),l.then(function(d){if(!d)return r(null,{});var h=a.services.interpolator.interpolate(d,{lng:t.join("+"),ns:n.join("+")});a.loadUrl(h,r,i,o)})}},{key:"loadUrl",value:function(t,i,n,o){var r=this,a=typeof n=="string"?[n]:n,l=typeof o=="string"?[o]:o,d=this.options.parseLoadPayload(a,l);this.options.request(this.options,t,d,function(h,p){if(p&&(p.status>=500&&p.status<600||!p.status))return i("failed loading "+t+"; status code: "+p.status,!0);if(p&&p.status>=400&&p.status<500)return i("failed loading "+t+"; status code: "+p.status,!1);if(!p&&h&&h.message&&h.message.indexOf("Failed to fetch")>-1)return i("failed loading "+t+": "+h.message,!0);if(h)return i(h,!1);var m,v;try{typeof p.data=="string"?m=r.options.parse(p.data,n,o):m=p.data}catch{v="failed parsing "+t+" to json"}if(v)return i(v,!1);i(null,m)})}},{key:"create",value:function(t,i,n,o,r){var a=this;if(this.options.addPath){typeof t=="string"&&(t=[t]);var l=this.options.parsePayload(i,n,o),d=0,h=[],p=[];t.forEach(function(m){var v=a.options.addPath;typeof a.options.addPath=="function"&&(v=a.options.addPath(m,i));var y=a.services.interpolator.interpolate(v,{lng:m,ns:i});a.options.request(a.options,y,l,function(b,S){d+=1,h.push(b),p.push(S),d===t.length&&typeof r=="function"&&r(h,p)})})}}},{key:"reload",value:function(){var t=this,i=this.services,n=i.backendConnector,o=i.languageUtils,r=i.logger,a=n.language;if(!(a&&a.toLowerCase()==="cimode")){var l=[],d=function(p){var m=o.toResolveHierarchy(p);m.forEach(function(v){l.indexOf(v)<0&&l.push(v)})};d(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(h){return d(h)}),l.forEach(function(h){t.allOptions.ns.forEach(function(p){n.read(h,p,"read",null,null,function(m,v){m&&r.warn("loading namespace ".concat(p," for language ").concat(h," failed"),m),!m&&v&&r.log("loaded namespace ".concat(p," for language ").concat(h),v),n.loaded("".concat(h,"|").concat(p),m,v)})})})}}}]),s}();Backend.type="backend";function _defineProperty(s,e,t){return e=toPropertyKey(e),e in s?Object.defineProperty(s,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):s[e]=t,s}function ownKeys(s,e){var t=Object.keys(s);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(s);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),t.push.apply(t,i)}return t}function _objectSpread(s){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ownKeys(Object(t),!0).forEach(function(i){_defineProperty(s,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(i){Object.defineProperty(s,i,Object.getOwnPropertyDescriptor(t,i))})}return s}var Storage=function(){function s(e){_classCallCheck$1(this,s),this.store=e.store}return _createClass$1(s,[{key:"setItem",value:function(t,i){if(this.store)try{this.store.setItem(t,i)}catch{}}},{key:"getItem",value:function(t,i){if(this.store)try{return this.store.getItem(t,i)}catch{}}}]),s}();function getDefaults(){var s=null;try{s=window.localStorage}catch(e){typeof window<"u"&&console.log("Failed to load local storage.",e)}return{prefix:"i18next_res_",expirationTime:7*24*60*60*1e3,defaultVersion:void 0,versions:{},store:s}}var Cache=function(){function s(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck$1(this,s),this.init(e,t),this.type="backend"}return _createClass$1(s,[{key:"init",value:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.services=t,this.options=_objectSpread(_objectSpread(_objectSpread({},getDefaults()),this.options),i),this.storage=new Storage(this.options)}},{key:"read",value:function(t,i,n){var o=Date.now();if(!this.storage.store)return n(null,null);var r=this.storage.getItem("".concat(this.options.prefix).concat(t,"-").concat(i));if(r){r=JSON.parse(r);var a=this.getVersion(t);if(r.i18nStamp&&r.i18nStamp+this.options.expirationTime>o&&a===r.i18nVersion){var l=r.i18nStamp;return delete r.i18nVersion,delete r.i18nStamp,n(null,r,l)}}return n(null,null)}},{key:"save",value:function(t,i,n){if(this.storage.store){n.i18nStamp=Date.now();var o=this.getVersion(t);o&&(n.i18nVersion=o),this.storage.setItem("".concat(this.options.prefix).concat(t,"-").concat(i),JSON.stringify(n))}}},{key:"getVersion",value:function(t){return this.options.versions[t]||this.options.defaultVersion}}]),s}();Cache.type="backend";const formatDistanceLocale$s={lessThanXSeconds:{one:"по-малко от секунда",other:"по-малко от {{count}} секунди"},xSeconds:{one:"1 секунда",other:"{{count}} секунди"},halfAMinute:"половин минута",lessThanXMinutes:{one:"по-малко от минута",other:"по-малко от {{count}} минути"},xMinutes:{one:"1 минута",other:"{{count}} минути"},aboutXHours:{one:"около час",other:"около {{count}} часа"},xHours:{one:"1 час",other:"{{count}} часа"},xDays:{one:"1 ден",other:"{{count}} дни"},aboutXWeeks:{one:"около седмица",other:"около {{count}} седмици"},xWeeks:{one:"1 седмица",other:"{{count}} седмици"},aboutXMonths:{one:"около месец",other:"около {{count}} месеца"},xMonths:{one:"1 месец",other:"{{count}} месеца"},aboutXYears:{one:"около година",other:"около {{count}} години"},xYears:{one:"1 година",other:"{{count}} години"},overXYears:{one:"над година",other:"над {{count}} години"},almostXYears:{one:"почти година",other:"почти {{count}} години"}},formatDistance$t=(s,e,t)=>{let i;const n=formatDistanceLocale$s[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"след "+i:"преди "+i:i},dateFormats$u={full:"EEEE, dd MMMM yyyy",long:"dd MMMM yyyy",medium:"dd MMM yyyy",short:"dd/MM/yyyy"},timeFormats$u={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"H:mm"},dateTimeFormats$u={any:"{{date}} {{time}}"},formatLong$u={date:buildFormatLongFn({formats:dateFormats$u,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$u,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$u,defaultWidth:"any"})},weekdays$1=["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"];function lastWeek$4(s){const e=weekdays$1[s];switch(s){case 0:case 3:case 6:return"'миналата "+e+" в' p";case 1:case 2:case 4:case 5:return"'миналия "+e+" в' p"}}function thisWeek$4(s){const e=weekdays$1[s];return s===2?"'във "+e+" в' p":"'в "+e+" в' p"}function nextWeek$4(s){const e=weekdays$1[s];switch(s){case 0:case 3:case 6:return"'следващата "+e+" в' p";case 1:case 2:case 4:case 5:return"'следващия "+e+" в' p"}}const lastWeekFormatToken=(s,e,t)=>{const i=toDate(s),n=i.getDay();return isSameWeek(i,e,t)?thisWeek$4(n):lastWeek$4(n)},nextWeekFormatToken=(s,e,t)=>{const i=toDate(s),n=i.getDay();return isSameWeek(i,e,t)?thisWeek$4(n):nextWeek$4(n)},formatRelativeLocale$t={lastWeek:lastWeekFormatToken,yesterday:"'вчера в' p",today:"'днес в' p",tomorrow:"'утре в' p",nextWeek:nextWeekFormatToken,other:"P"},formatRelative$t=(s,e,t,i)=>{const n=formatRelativeLocale$t[s];return typeof n=="function"?n(e,t,i):n},eraValues$t={narrow:["пр.н.е.","н.е."],abbreviated:["преди н. е.","н. е."],wide:["преди новата ера","новата ера"]},quarterValues$t={narrow:["1","2","3","4"],abbreviated:["1-во тримес.","2-ро тримес.","3-то тримес.","4-то тримес."],wide:["1-во тримесечие","2-ро тримесечие","3-то тримесечие","4-то тримесечие"]},monthValues$t={abbreviated:["яну","фев","мар","апр","май","юни","юли","авг","сеп","окт","ное","дек"],wide:["януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември"]},dayValues$t={narrow:["Н","П","В","С","Ч","П","С"],short:["нд","пн","вт","ср","чт","пт","сб"],abbreviated:["нед","пон","вто","сря","чет","пет","съб"],wide:["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"]},dayPeriodValues$t={wide:{am:"преди обяд",pm:"след обяд",midnight:"в полунощ",noon:"на обяд",morning:"сутринта",afternoon:"следобед",evening:"вечерта",night:"през нощта"}};function isFeminine(s){return s==="year"||s==="week"||s==="minute"||s==="second"}function isNeuter(s){return s==="quarter"}function numberWithSuffix(s,e,t,i,n){const o=isNeuter(e)?n:isFeminine(e)?i:t;return s+"-"+o}const ordinalNumber$t=(s,e)=>{const t=Number(s),i=e==null?void 0:e.unit;if(t===0)return numberWithSuffix(0,i,"ев","ева","ево");if(t%1e3===0)return numberWithSuffix(t,i,"ен","на","но");if(t%100===0)return numberWithSuffix(t,i,"тен","тна","тно");const n=t%100;if(n>20||n<10)switch(n%10){case 1:return numberWithSuffix(t,i,"ви","ва","во");case 2:return numberWithSuffix(t,i,"ри","ра","ро");case 7:case 8:return numberWithSuffix(t,i,"ми","ма","мо")}return numberWithSuffix(t,i,"ти","та","то")},localize$t={ordinalNumber:ordinalNumber$t,era:buildLocalizeFn({values:eraValues$t,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$t,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$t,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$t,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$t,defaultWidth:"wide"})},matchOrdinalNumberPattern$t=/^(\d+)(-?[врмт][аи]|-?т?(ен|на)|-?(ев|ева))?/i,parseOrdinalNumberPattern$t=/\d+/i,matchEraPatterns$t={narrow:/^((пр)?н\.?\s?е\.?)/i,abbreviated:/^((пр)?н\.?\s?е\.?)/i,wide:/^(преди новата ера|новата ера|нова ера)/i},parseEraPatterns$t={any:[/^п/i,/^н/i]},matchQuarterPatterns$t={narrow:/^[1234]/i,abbreviated:/^[1234](-?[врт]?o?)? тримес.?/i,wide:/^[1234](-?[врт]?о?)? тримесечие/i},parseQuarterPatterns$t={any:[/1/i,/2/i,/3/i,/4/i]},matchDayPatterns$t={narrow:/^[нпвсч]/i,short:/^(нд|пн|вт|ср|чт|пт|сб)/i,abbreviated:/^(нед|пон|вто|сря|чет|пет|съб)/i,wide:/^(неделя|понеделник|вторник|сряда|четвъртък|петък|събота)/i},parseDayPatterns$t={narrow:[/^н/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^н[ед]/i,/^п[он]/i,/^вт/i,/^ср/i,/^ч[ет]/i,/^п[ет]/i,/^с[ъб]/i]},matchMonthPatterns$t={abbreviated:/^(яну|фев|мар|апр|май|юни|юли|авг|сеп|окт|ное|дек)/i,wide:/^(януари|февруари|март|април|май|юни|юли|август|септември|октомври|ноември|декември)/i},parseMonthPatterns$t={any:[/^я/i,/^ф/i,/^мар/i,/^ап/i,/^май/i,/^юн/i,/^юл/i,/^ав/i,/^се/i,/^окт/i,/^но/i,/^де/i]},matchDayPeriodPatterns$t={any:/^(преди о|след о|в по|на о|през|веч|сут|следо)/i},parseDayPeriodPatterns$t={any:{am:/^преди о/i,pm:/^след о/i,midnight:/^в пол/i,noon:/^на об/i,morning:/^сут/i,afternoon:/^следо/i,evening:/^веч/i,night:/^през н/i}},match$t={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$t,parsePattern:parseOrdinalNumberPattern$t,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$t,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$t,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$t,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$t,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$t,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$t,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$t,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$t,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$t,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$t,defaultParseWidth:"any"})},bg={code:"bg",formatDistance:formatDistance$t,formatLong:formatLong$u,formatRelative:formatRelative$t,localize:localize$t,match:match$t,options:{weekStartsOn:1,firstWeekContainsDate:1}},formatDistanceLocale$r={lessThanXSeconds:{one:"menys d'un segon",eleven:"menys d'onze segons",other:"menys de {{count}} segons"},xSeconds:{one:"1 segon",other:"{{count}} segons"},halfAMinute:"mig minut",lessThanXMinutes:{one:"menys d'un minut",eleven:"menys d'onze minuts",other:"menys de {{count}} minuts"},xMinutes:{one:"1 minut",other:"{{count}} minuts"},aboutXHours:{one:"aproximadament una hora",other:"aproximadament {{count}} hores"},xHours:{one:"1 hora",other:"{{count}} hores"},xDays:{one:"1 dia",other:"{{count}} dies"},aboutXWeeks:{one:"aproximadament una setmana",other:"aproximadament {{count}} setmanes"},xWeeks:{one:"1 setmana",other:"{{count}} setmanes"},aboutXMonths:{one:"aproximadament un mes",other:"aproximadament {{count}} mesos"},xMonths:{one:"1 mes",other:"{{count}} mesos"},aboutXYears:{one:"aproximadament un any",other:"aproximadament {{count}} anys"},xYears:{one:"1 any",other:"{{count}} anys"},overXYears:{one:"més d'un any",eleven:"més d'onze anys",other:"més de {{count}} anys"},almostXYears:{one:"gairebé un any",other:"gairebé {{count}} anys"}},formatDistance$s=(s,e,t)=>{let i;const n=formatDistanceLocale$r[s];return typeof n=="string"?i=n:e===1?i=n.one:e===11&&n.eleven?i=n.eleven:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"en "+i:"fa "+i:i},dateFormats$t={full:"EEEE, d 'de' MMMM y",long:"d 'de' MMMM y",medium:"d MMM y",short:"dd/MM/y"},timeFormats$t={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$t={full:"{{date}} 'a les' {{time}}",long:"{{date}} 'a les' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$t={date:buildFormatLongFn({formats:dateFormats$t,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$t,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$t,defaultWidth:"full"})},formatRelativeLocale$s={lastWeek:"'el' eeee 'passat a la' LT",yesterday:"'ahir a la' p",today:"'avui a la' p",tomorrow:"'demà a la' p",nextWeek:"eeee 'a la' p",other:"P"},formatRelativeLocalePlural$1={lastWeek:"'el' eeee 'passat a les' p",yesterday:"'ahir a les' p",today:"'avui a les' p",tomorrow:"'demà a les' p",nextWeek:"eeee 'a les' p",other:"P"},formatRelative$s=(s,e,t,i)=>e.getHours()!==1?formatRelativeLocalePlural$1[s]:formatRelativeLocale$s[s],eraValues$s={narrow:["aC","dC"],abbreviated:["a. de C.","d. de C."],wide:["abans de Crist","després de Crist"]},quarterValues$s={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1r trimestre","2n trimestre","3r trimestre","4t trimestre"]},monthValues$s={narrow:["GN","FB","MÇ","AB","MG","JN","JL","AG","ST","OC","NV","DS"],abbreviated:["gen.","febr.","març","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."],wide:["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"]},dayValues$s={narrow:["dg.","dl.","dt.","dm.","dj.","dv.","ds."],short:["dg.","dl.","dt.","dm.","dj.","dv.","ds."],abbreviated:["dg.","dl.","dt.","dm.","dj.","dv.","ds."],wide:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"]},dayPeriodValues$s={narrow:{am:"am",pm:"pm",midnight:"mitjanit",noon:"migdia",morning:"matí",afternoon:"tarda",evening:"vespre",night:"nit"},abbreviated:{am:"a.m.",pm:"p.m.",midnight:"mitjanit",noon:"migdia",morning:"matí",afternoon:"tarda",evening:"vespre",night:"nit"},wide:{am:"ante meridiem",pm:"post meridiem",midnight:"mitjanit",noon:"migdia",morning:"matí",afternoon:"tarda",evening:"vespre",night:"nit"}},formattingDayPeriodValues$k={narrow:{am:"am",pm:"pm",midnight:"de la mitjanit",noon:"del migdia",morning:"del matí",afternoon:"de la tarda",evening:"del vespre",night:"de la nit"},abbreviated:{am:"AM",pm:"PM",midnight:"de la mitjanit",noon:"del migdia",morning:"del matí",afternoon:"de la tarda",evening:"del vespre",night:"de la nit"},wide:{am:"ante meridiem",pm:"post meridiem",midnight:"de la mitjanit",noon:"del migdia",morning:"del matí",afternoon:"de la tarda",evening:"del vespre",night:"de la nit"}},ordinalNumber$s=(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"r";case 2:return t+"n";case 3:return t+"r";case 4:return t+"t"}return t+"è"},localize$s={ordinalNumber:ordinalNumber$s,era:buildLocalizeFn({values:eraValues$s,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$s,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$s,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$s,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$s,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$k,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$s=/^(\d+)(è|r|n|r|t)?/i,parseOrdinalNumberPattern$s=/\d+/i,matchEraPatterns$s={narrow:/^(aC|dC)/i,abbreviated:/^(a. de C.|d. de C.)/i,wide:/^(abans de Crist|despr[eé]s de Crist)/i},parseEraPatterns$s={narrow:[/^aC/i,/^dC/i],abbreviated:[/^(a. de C.)/i,/^(d. de C.)/i],wide:[/^(abans de Crist)/i,/^(despr[eé]s de Crist)/i]},matchQuarterPatterns$s={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](è|r|n|r|t)? trimestre/i},parseQuarterPatterns$s={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$s={narrow:/^(GN|FB|MÇ|AB|MG|JN|JL|AG|ST|OC|NV|DS)/i,abbreviated:/^(gen.|febr.|març|abr.|maig|juny|jul.|ag.|set.|oct.|nov.|des.)/i,wide:/^(gener|febrer|març|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre)/i},parseMonthPatterns$s={narrow:[/^GN/i,/^FB/i,/^MÇ/i,/^AB/i,/^MG/i,/^JN/i,/^JL/i,/^AG/i,/^ST/i,/^OC/i,/^NV/i,/^DS/i],abbreviated:[/^gen./i,/^febr./i,/^març/i,/^abr./i,/^maig/i,/^juny/i,/^jul./i,/^ag./i,/^set./i,/^oct./i,/^nov./i,/^des./i],wide:[/^gener/i,/^febrer/i,/^març/i,/^abril/i,/^maig/i,/^juny/i,/^juliol/i,/^agost/i,/^setembre/i,/^octubre/i,/^novembre/i,/^desembre/i]},matchDayPatterns$s={narrow:/^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,short:/^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,abbreviated:/^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,wide:/^(diumenge|dilluns|dimarts|dimecres|dijous|divendres|dissabte)/i},parseDayPatterns$s={narrow:[/^dg./i,/^dl./i,/^dt./i,/^dm./i,/^dj./i,/^dv./i,/^ds./i],abbreviated:[/^dg./i,/^dl./i,/^dt./i,/^dm./i,/^dj./i,/^dv./i,/^ds./i],wide:[/^diumenge/i,/^dilluns/i,/^dimarts/i,/^dimecres/i,/^dijous/i,/^divendres/i,/^disssabte/i]},matchDayPeriodPatterns$s={narrow:/^(a|p|mn|md|(del|de la) (matí|tarda|vespre|nit))/i,abbreviated:/^([ap]\.?\s?m\.?|mitjanit|migdia|(del|de la) (matí|tarda|vespre|nit))/i,wide:/^(ante meridiem|post meridiem|mitjanit|migdia|(del|de la) (matí|tarda|vespre|nit))/i},parseDayPeriodPatterns$s={any:{am:/^a/i,pm:/^p/i,midnight:/^mitjanit/i,noon:/^migdia/i,morning:/matí/i,afternoon:/tarda/i,evening:/vespre/i,night:/nit/i}},match$s={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$s,parsePattern:parseOrdinalNumberPattern$s,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$s,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$s,defaultParseWidth:"wide"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$s,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$s,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$s,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$s,defaultParseWidth:"wide"}),day:buildMatchFn({matchPatterns:matchDayPatterns$s,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$s,defaultParseWidth:"wide"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$s,defaultMatchWidth:"wide",parsePatterns:parseDayPeriodPatterns$s,defaultParseWidth:"any"})},ca={code:"ca",formatDistance:formatDistance$s,formatLong:formatLong$t,formatRelative:formatRelative$s,localize:localize$s,match:match$s,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$q={lessThanXSeconds:{one:{regular:"méně než 1 sekunda",past:"před méně než 1 sekundou",future:"za méně než 1 sekundu"},few:{regular:"méně než {{count}} sekundy",past:"před méně než {{count}} sekundami",future:"za méně než {{count}} sekundy"},many:{regular:"méně než {{count}} sekund",past:"před méně než {{count}} sekundami",future:"za méně než {{count}} sekund"}},xSeconds:{one:{regular:"1 sekunda",past:"před 1 sekundou",future:"za 1 sekundu"},few:{regular:"{{count}} sekundy",past:"před {{count}} sekundami",future:"za {{count}} sekundy"},many:{regular:"{{count}} sekund",past:"před {{count}} sekundami",future:"za {{count}} sekund"}},halfAMinute:{type:"other",other:{regular:"půl minuty",past:"před půl minutou",future:"za půl minuty"}},lessThanXMinutes:{one:{regular:"méně než 1 minuta",past:"před méně než 1 minutou",future:"za méně než 1 minutu"},few:{regular:"méně než {{count}} minuty",past:"před méně než {{count}} minutami",future:"za méně než {{count}} minuty"},many:{regular:"méně než {{count}} minut",past:"před méně než {{count}} minutami",future:"za méně než {{count}} minut"}},xMinutes:{one:{regular:"1 minuta",past:"před 1 minutou",future:"za 1 minutu"},few:{regular:"{{count}} minuty",past:"před {{count}} minutami",future:"za {{count}} minuty"},many:{regular:"{{count}} minut",past:"před {{count}} minutami",future:"za {{count}} minut"}},aboutXHours:{one:{regular:"přibližně 1 hodina",past:"přibližně před 1 hodinou",future:"přibližně za 1 hodinu"},few:{regular:"přibližně {{count}} hodiny",past:"přibližně před {{count}} hodinami",future:"přibližně za {{count}} hodiny"},many:{regular:"přibližně {{count}} hodin",past:"přibližně před {{count}} hodinami",future:"přibližně za {{count}} hodin"}},xHours:{one:{regular:"1 hodina",past:"před 1 hodinou",future:"za 1 hodinu"},few:{regular:"{{count}} hodiny",past:"před {{count}} hodinami",future:"za {{count}} hodiny"},many:{regular:"{{count}} hodin",past:"před {{count}} hodinami",future:"za {{count}} hodin"}},xDays:{one:{regular:"1 den",past:"před 1 dnem",future:"za 1 den"},few:{regular:"{{count}} dny",past:"před {{count}} dny",future:"za {{count}} dny"},many:{regular:"{{count}} dní",past:"před {{count}} dny",future:"za {{count}} dní"}},aboutXWeeks:{one:{regular:"přibližně 1 týden",past:"přibližně před 1 týdnem",future:"přibližně za 1 týden"},few:{regular:"přibližně {{count}} týdny",past:"přibližně před {{count}} týdny",future:"přibližně za {{count}} týdny"},many:{regular:"přibližně {{count}} týdnů",past:"přibližně před {{count}} týdny",future:"přibližně za {{count}} týdnů"}},xWeeks:{one:{regular:"1 týden",past:"před 1 týdnem",future:"za 1 týden"},few:{regular:"{{count}} týdny",past:"před {{count}} týdny",future:"za {{count}} týdny"},many:{regular:"{{count}} týdnů",past:"před {{count}} týdny",future:"za {{count}} týdnů"}},aboutXMonths:{one:{regular:"přibližně 1 měsíc",past:"přibližně před 1 měsícem",future:"přibližně za 1 měsíc"},few:{regular:"přibližně {{count}} měsíce",past:"přibližně před {{count}} měsíci",future:"přibližně za {{count}} měsíce"},many:{regular:"přibližně {{count}} měsíců",past:"přibližně před {{count}} měsíci",future:"přibližně za {{count}} měsíců"}},xMonths:{one:{regular:"1 měsíc",past:"před 1 měsícem",future:"za 1 měsíc"},few:{regular:"{{count}} měsíce",past:"před {{count}} měsíci",future:"za {{count}} měsíce"},many:{regular:"{{count}} měsíců",past:"před {{count}} měsíci",future:"za {{count}} měsíců"}},aboutXYears:{one:{regular:"přibližně 1 rok",past:"přibližně před 1 rokem",future:"přibližně za 1 rok"},few:{regular:"přibližně {{count}} roky",past:"přibližně před {{count}} roky",future:"přibližně za {{count}} roky"},many:{regular:"přibližně {{count}} roků",past:"přibližně před {{count}} roky",future:"přibližně za {{count}} roků"}},xYears:{one:{regular:"1 rok",past:"před 1 rokem",future:"za 1 rok"},few:{regular:"{{count}} roky",past:"před {{count}} roky",future:"za {{count}} roky"},many:{regular:"{{count}} roků",past:"před {{count}} roky",future:"za {{count}} roků"}},overXYears:{one:{regular:"více než 1 rok",past:"před více než 1 rokem",future:"za více než 1 rok"},few:{regular:"více než {{count}} roky",past:"před více než {{count}} roky",future:"za více než {{count}} roky"},many:{regular:"více než {{count}} roků",past:"před více než {{count}} roky",future:"za více než {{count}} roků"}},almostXYears:{one:{regular:"skoro 1 rok",past:"skoro před 1 rokem",future:"skoro za 1 rok"},few:{regular:"skoro {{count}} roky",past:"skoro před {{count}} roky",future:"skoro za {{count}} roky"},many:{regular:"skoro {{count}} roků",past:"skoro před {{count}} roky",future:"skoro za {{count}} roků"}}},formatDistance$r=(s,e,t)=>{let i;const n=formatDistanceLocale$q[s];n.type==="other"?i=n.other:e===1?i=n.one:e>1&&e<5?i=n.few:i=n.many;const o=(t==null?void 0:t.addSuffix)===!0,r=t==null?void 0:t.comparison;let a;return o&&r===-1?a=i.past:o&&r===1?a=i.future:a=i.regular,a.replace("{{count}}",String(e))},dateFormats$s={full:"EEEE, d. MMMM yyyy",long:"d. MMMM yyyy",medium:"d. M. yyyy",short:"dd.MM.yyyy"},timeFormats$s={full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},dateTimeFormats$s={full:"{{date}} 'v' {{time}}",long:"{{date}} 'v' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$s={date:buildFormatLongFn({formats:dateFormats$s,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$s,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$s,defaultWidth:"full"})},accusativeWeekdays$4=["neděli","pondělí","úterý","středu","čtvrtek","pátek","sobotu"],formatRelativeLocale$r={lastWeek:"'poslední' eeee 've' p",yesterday:"'včera v' p",today:"'dnes v' p",tomorrow:"'zítra v' p",nextWeek:s=>{const e=s.getDay();return"'v "+accusativeWeekdays$4[e]+" o' p"},other:"P"},formatRelative$r=(s,e)=>{const t=formatRelativeLocale$r[s];return typeof t=="function"?t(e):t},eraValues$r={narrow:["př. n. l.","n. l."],abbreviated:["př. n. l.","n. l."],wide:["před naším letopočtem","našeho letopočtu"]},quarterValues$r={narrow:["1","2","3","4"],abbreviated:["1. čtvrtletí","2. čtvrtletí","3. čtvrtletí","4. čtvrtletí"],wide:["1. čtvrtletí","2. čtvrtletí","3. čtvrtletí","4. čtvrtletí"]},monthValues$r={narrow:["L","Ú","B","D","K","Č","Č","S","Z","Ř","L","P"],abbreviated:["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],wide:["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"]},formattingMonthValues$7={narrow:["L","Ú","B","D","K","Č","Č","S","Z","Ř","L","P"],abbreviated:["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],wide:["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince"]},dayValues$r={narrow:["ne","po","út","st","čt","pá","so"],short:["ne","po","út","st","čt","pá","so"],abbreviated:["ned","pon","úte","stř","čtv","pát","sob"],wide:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"]},dayPeriodValues$r={narrow:{am:"dop.",pm:"odp.",midnight:"půlnoc",noon:"poledne",morning:"ráno",afternoon:"odpoledne",evening:"večer",night:"noc"},abbreviated:{am:"dop.",pm:"odp.",midnight:"půlnoc",noon:"poledne",morning:"ráno",afternoon:"odpoledne",evening:"večer",night:"noc"},wide:{am:"dopoledne",pm:"odpoledne",midnight:"půlnoc",noon:"poledne",morning:"ráno",afternoon:"odpoledne",evening:"večer",night:"noc"}},formattingDayPeriodValues$j={narrow:{am:"dop.",pm:"odp.",midnight:"půlnoc",noon:"poledne",morning:"ráno",afternoon:"odpoledne",evening:"večer",night:"noc"},abbreviated:{am:"dop.",pm:"odp.",midnight:"půlnoc",noon:"poledne",morning:"ráno",afternoon:"odpoledne",evening:"večer",night:"noc"},wide:{am:"dopoledne",pm:"odpoledne",midnight:"půlnoc",noon:"poledne",morning:"ráno",afternoon:"odpoledne",evening:"večer",night:"noc"}},ordinalNumber$r=(s,e)=>Number(s)+".",localize$r={ordinalNumber:ordinalNumber$r,era:buildLocalizeFn({values:eraValues$r,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$r,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$r,defaultWidth:"wide",formattingValues:formattingMonthValues$7,defaultFormattingWidth:"wide"}),day:buildLocalizeFn({values:dayValues$r,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$r,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$j,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$r=/^(\d+)\.?/i,parseOrdinalNumberPattern$r=/\d+/i,matchEraPatterns$r={narrow:/^(p[řr](\.|ed) Kr\.|p[řr](\.|ed) n\. l\.|po Kr\.|n\. l\.)/i,abbreviated:/^(p[řr](\.|ed) Kr\.|p[řr](\.|ed) n\. l\.|po Kr\.|n\. l\.)/i,wide:/^(p[řr](\.|ed) Kristem|p[řr](\.|ed) na[šs][íi]m letopo[čc]tem|po Kristu|na[šs]eho letopo[čc]tu)/i},parseEraPatterns$r={any:[/^p[řr]/i,/^(po|n)/i]},matchQuarterPatterns$r={narrow:/^[1234]/i,abbreviated:/^[1234]\. [čc]tvrtlet[íi]/i,wide:/^[1234]\. [čc]tvrtlet[íi]/i},parseQuarterPatterns$r={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$r={narrow:/^[lúubdkčcszřrlp]/i,abbreviated:/^(led|[úu]no|b[řr]e|dub|kv[ěe]|[čc]vn|[čc]vc|srp|z[áa][řr]|[řr][íi]j|lis|pro)/i,wide:/^(leden|ledna|[úu]nora?|b[řr]ezen|b[řr]ezna|duben|dubna|kv[ěe]ten|kv[ěe]tna|[čc]erven(ec|ce)?|[čc]ervna|srpen|srpna|z[áa][řr][íi]|[řr][íi]jen|[řr][íi]jna|listopad(a|u)?|prosinec|prosince)/i},parseMonthPatterns$r={narrow:[/^l/i,/^[úu]/i,/^b/i,/^d/i,/^k/i,/^[čc]/i,/^[čc]/i,/^s/i,/^z/i,/^[řr]/i,/^l/i,/^p/i],any:[/^led/i,/^[úu]n/i,/^b[řr]e/i,/^dub/i,/^kv[ěe]/i,/^[čc]vn|[čc]erven(?!\w)|[čc]ervna/i,/^[čc]vc|[čc]erven(ec|ce)/i,/^srp/i,/^z[áa][řr]/i,/^[řr][íi]j/i,/^lis/i,/^pro/i]},matchDayPatterns$r={narrow:/^[npuúsčps]/i,short:/^(ne|po|[úu]t|st|[čc]t|p[áa]|so)/i,abbreviated:/^(ned|pon|[úu]te|st[rř]|[čc]tv|p[áa]t|sob)/i,wide:/^(ned[ěe]le|pond[ěe]l[íi]|[úu]ter[ýy]|st[řr]eda|[čc]tvrtek|p[áa]tek|sobota)/i},parseDayPatterns$r={narrow:[/^n/i,/^p/i,/^[úu]/i,/^s/i,/^[čc]/i,/^p/i,/^s/i],any:[/^ne/i,/^po/i,/^[úu]t/i,/^st/i,/^[čc]t/i,/^p[áa]/i,/^so/i]},matchDayPeriodPatterns$r={any:/^dopoledne|dop\.?|odpoledne|odp\.?|p[ůu]lnoc|poledne|r[áa]no|odpoledne|ve[čc]er|(v )?noci?/i},parseDayPeriodPatterns$r={any:{am:/^dop/i,pm:/^odp/i,midnight:/^p[ůu]lnoc/i,noon:/^poledne/i,morning:/r[áa]no/i,afternoon:/odpoledne/i,evening:/ve[čc]er/i,night:/noc/i}},match$r={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$r,parsePattern:parseOrdinalNumberPattern$r,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$r,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$r,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$r,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$r,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$r,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$r,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$r,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$r,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$r,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$r,defaultParseWidth:"any"})},cs={code:"cs",formatDistance:formatDistance$r,formatLong:formatLong$s,formatRelative:formatRelative$r,localize:localize$r,match:match$r,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$p={lessThanXSeconds:{one:"mindre end ét sekund",other:"mindre end {{count}} sekunder"},xSeconds:{one:"1 sekund",other:"{{count}} sekunder"},halfAMinute:"ét halvt minut",lessThanXMinutes:{one:"mindre end ét minut",other:"mindre end {{count}} minutter"},xMinutes:{one:"1 minut",other:"{{count}} minutter"},aboutXHours:{one:"cirka 1 time",other:"cirka {{count}} timer"},xHours:{one:"1 time",other:"{{count}} timer"},xDays:{one:"1 dag",other:"{{count}} dage"},aboutXWeeks:{one:"cirka 1 uge",other:"cirka {{count}} uger"},xWeeks:{one:"1 uge",other:"{{count}} uger"},aboutXMonths:{one:"cirka 1 måned",other:"cirka {{count}} måneder"},xMonths:{one:"1 måned",other:"{{count}} måneder"},aboutXYears:{one:"cirka 1 år",other:"cirka {{count}} år"},xYears:{one:"1 år",other:"{{count}} år"},overXYears:{one:"over 1 år",other:"over {{count}} år"},almostXYears:{one:"næsten 1 år",other:"næsten {{count}} år"}},formatDistance$q=(s,e,t)=>{let i;const n=formatDistanceLocale$p[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"om "+i:i+" siden":i},dateFormats$r={full:"EEEE 'den' d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"dd/MM/y"},timeFormats$r={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$r={full:"{{date}} 'kl'. {{time}}",long:"{{date}} 'kl'. {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$r={date:buildFormatLongFn({formats:dateFormats$r,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$r,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$r,defaultWidth:"full"})},formatRelativeLocale$q={lastWeek:"'sidste' eeee 'kl.' p",yesterday:"'i går kl.' p",today:"'i dag kl.' p",tomorrow:"'i morgen kl.' p",nextWeek:"'på' eeee 'kl.' p",other:"P"},formatRelative$q=(s,e,t,i)=>formatRelativeLocale$q[s],eraValues$q={narrow:["fvt","vt"],abbreviated:["f.v.t.","v.t."],wide:["før vesterlandsk tidsregning","vesterlandsk tidsregning"]},quarterValues$q={narrow:["1","2","3","4"],abbreviated:["1. kvt.","2. kvt.","3. kvt.","4. kvt."],wide:["1. kvartal","2. kvartal","3. kvartal","4. kvartal"]},monthValues$q={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],wide:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"]},dayValues$q={narrow:["S","M","T","O","T","F","L"],short:["sø","ma","ti","on","to","fr","lø"],abbreviated:["søn.","man.","tir.","ons.","tor.","fre.","lør."],wide:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},dayPeriodValues$q={narrow:{am:"a",pm:"p",midnight:"midnat",noon:"middag",morning:"morgen",afternoon:"eftermiddag",evening:"aften",night:"nat"},abbreviated:{am:"AM",pm:"PM",midnight:"midnat",noon:"middag",morning:"morgen",afternoon:"eftermiddag",evening:"aften",night:"nat"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnat",noon:"middag",morning:"morgen",afternoon:"eftermiddag",evening:"aften",night:"nat"}},formattingDayPeriodValues$i={narrow:{am:"a",pm:"p",midnight:"midnat",noon:"middag",morning:"om morgenen",afternoon:"om eftermiddagen",evening:"om aftenen",night:"om natten"},abbreviated:{am:"AM",pm:"PM",midnight:"midnat",noon:"middag",morning:"om morgenen",afternoon:"om eftermiddagen",evening:"om aftenen",night:"om natten"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnat",noon:"middag",morning:"om morgenen",afternoon:"om eftermiddagen",evening:"om aftenen",night:"om natten"}},ordinalNumber$q=(s,e)=>Number(s)+".",localize$q={ordinalNumber:ordinalNumber$q,era:buildLocalizeFn({values:eraValues$q,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$q,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$q,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$q,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$q,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$i,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$q=/^(\d+)(\.)?/i,parseOrdinalNumberPattern$q=/\d+/i,matchEraPatterns$q={narrow:/^(fKr|fvt|eKr|vt)/i,abbreviated:/^(f\.Kr\.?|f\.v\.t\.?|e\.Kr\.?|v\.t\.)/i,wide:/^(f.Kr.|før vesterlandsk tidsregning|e.Kr.|vesterlandsk tidsregning)/i},parseEraPatterns$q={any:[/^f/i,/^(v|e)/i]},matchQuarterPatterns$q={narrow:/^[1234]/i,abbreviated:/^[1234]. kvt\./i,wide:/^[1234]\.? kvartal/i},parseQuarterPatterns$q={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$q={narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mar.|apr.|maj|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januar|februar|marts|april|maj|juni|juli|august|september|oktober|november|december)/i},parseMonthPatterns$q={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^maj/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$q={narrow:/^[smtofl]/i,short:/^(søn.|man.|tir.|ons.|tor.|fre.|lør.)/i,abbreviated:/^(søn|man|tir|ons|tor|fre|lør)/i,wide:/^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i},parseDayPatterns$q={narrow:[/^s/i,/^m/i,/^t/i,/^o/i,/^t/i,/^f/i,/^l/i],any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},matchDayPeriodPatterns$q={narrow:/^(a|p|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i,any:/^([ap]\.?\s?m\.?|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i},parseDayPeriodPatterns$q={any:{am:/^a/i,pm:/^p/i,midnight:/midnat/i,noon:/middag/i,morning:/morgen/i,afternoon:/eftermiddag/i,evening:/aften/i,night:/nat/i}},match$q={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$q,parsePattern:parseOrdinalNumberPattern$q,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$q,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$q,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$q,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$q,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$q,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$q,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$q,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$q,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$q,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$q,defaultParseWidth:"any"})},da={code:"da",formatDistance:formatDistance$q,formatLong:formatLong$r,formatRelative:formatRelative$q,localize:localize$q,match:match$q,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$o={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"halbe Minute",withPreposition:"halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},formatDistance$p=(s,e,t)=>{let i;const n=t!=null&&t.addSuffix?formatDistanceLocale$o[s].withPreposition:formatDistanceLocale$o[s].standalone;return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+i:"vor "+i:i},dateFormats$q={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},timeFormats$q={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$q={full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$q={date:buildFormatLongFn({formats:dateFormats$q,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$q,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$q,defaultWidth:"full"})},formatRelativeLocale$p={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},formatRelative$p=(s,e,t,i)=>formatRelativeLocale$p[s],eraValues$p={narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},quarterValues$p={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},monthValues$p={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},formattingMonthValues$6={narrow:monthValues$p.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:monthValues$p.wide},dayValues$p={narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},dayPeriodValues$p={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},formattingDayPeriodValues$h={narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},ordinalNumber$p=s=>Number(s)+".",localize$p={ordinalNumber:ordinalNumber$p,era:buildLocalizeFn({values:eraValues$p,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$p,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$p,formattingValues:formattingMonthValues$6,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$p,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$p,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$h,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$p=/^(\d+)(\.)?/i,parseOrdinalNumberPattern$p=/\d+/i,matchEraPatterns$p={narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},parseEraPatterns$p={any:[/^v/i,/^n/i]},matchQuarterPatterns$p={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},parseQuarterPatterns$p={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$p={narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},parseMonthPatterns$p={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$p={narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},parseDayPatterns$p={any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},matchDayPeriodPatterns$p={narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},parseDayPeriodPatterns$p={any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},match$p={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$p,parsePattern:parseOrdinalNumberPattern$p,valueCallback:s=>parseInt(s)}),era:buildMatchFn({matchPatterns:matchEraPatterns$p,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$p,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$p,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$p,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$p,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$p,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$p,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$p,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$p,defaultMatchWidth:"wide",parsePatterns:parseDayPeriodPatterns$p,defaultParseWidth:"any"})},de={code:"de",formatDistance:formatDistance$p,formatLong:formatLong$q,formatRelative:formatRelative$p,localize:localize$p,match:match$p,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$n={lessThanXSeconds:{one:"λιγότερο από ένα δευτερόλεπτο",other:"λιγότερο από {{count}} δευτερόλεπτα"},xSeconds:{one:"1 δευτερόλεπτο",other:"{{count}} δευτερόλεπτα"},halfAMinute:"μισό λεπτό",lessThanXMinutes:{one:"λιγότερο από ένα λεπτό",other:"λιγότερο από {{count}} λεπτά"},xMinutes:{one:"1 λεπτό",other:"{{count}} λεπτά"},aboutXHours:{one:"περίπου 1 ώρα",other:"περίπου {{count}} ώρες"},xHours:{one:"1 ώρα",other:"{{count}} ώρες"},xDays:{one:"1 ημέρα",other:"{{count}} ημέρες"},aboutXWeeks:{one:"περίπου 1 εβδομάδα",other:"περίπου {{count}} εβδομάδες"},xWeeks:{one:"1 εβδομάδα",other:"{{count}} εβδομάδες"},aboutXMonths:{one:"περίπου 1 μήνας",other:"περίπου {{count}} μήνες"},xMonths:{one:"1 μήνας",other:"{{count}} μήνες"},aboutXYears:{one:"περίπου 1 χρόνο",other:"περίπου {{count}} χρόνια"},xYears:{one:"1 χρόνο",other:"{{count}} χρόνια"},overXYears:{one:"πάνω από 1 χρόνο",other:"πάνω από {{count}} χρόνια"},almostXYears:{one:"περίπου 1 χρόνο",other:"περίπου {{count}} χρόνια"}},formatDistance$o=(s,e,t)=>{let i;const n=formatDistanceLocale$n[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"σε "+i:i+" πριν":i},dateFormats$p={full:"EEEE, d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"d/M/yy"},timeFormats$p={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats$p={full:"{{date}} - {{time}}",long:"{{date}} - {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$p={date:buildFormatLongFn({formats:dateFormats$p,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$p,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$p,defaultWidth:"full"})},formatRelativeLocale$o={lastWeek:s=>{switch(s.getDay()){case 6:return"'το προηγούμενο' eeee 'στις' p";default:return"'την προηγούμενη' eeee 'στις' p"}},yesterday:"'χθες στις' p",today:"'σήμερα στις' p",tomorrow:"'αύριο στις' p",nextWeek:"eeee 'στις' p",other:"P"},formatRelative$o=(s,e)=>{const t=formatRelativeLocale$o[s];return typeof t=="function"?t(e):t},eraValues$o={narrow:["πΧ","μΧ"],abbreviated:["π.Χ.","μ.Χ."],wide:["προ Χριστού","μετά Χριστόν"]},quarterValues$o={narrow:["1","2","3","4"],abbreviated:["Τ1","Τ2","Τ3","Τ4"],wide:["1ο τρίμηνο","2ο τρίμηνο","3ο τρίμηνο","4ο τρίμηνο"]},monthValues$o={narrow:["Ι","Φ","Μ","Α","Μ","Ι","Ι","Α","Σ","Ο","Ν","Δ"],abbreviated:["Ιαν","Φεβ","Μάρ","Απρ","Μάι","Ιούν","Ιούλ","Αύγ","Σεπ","Οκτ","Νοέ","Δεκ"],wide:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"]},formattingMonthValues$5={narrow:["Ι","Φ","Μ","Α","Μ","Ι","Ι","Α","Σ","Ο","Ν","Δ"],abbreviated:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],wide:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"]},dayValues$o={narrow:["Κ","Δ","T","Τ","Π","Π","Σ"],short:["Κυ","Δε","Τρ","Τε","Πέ","Πα","Σά"],abbreviated:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"],wide:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"]},dayPeriodValues$o={narrow:{am:"πμ",pm:"μμ",midnight:"μεσάνυχτα",noon:"μεσημέρι",morning:"πρωί",afternoon:"απόγευμα",evening:"βράδυ",night:"νύχτα"},abbreviated:{am:"π.μ.",pm:"μ.μ.",midnight:"μεσάνυχτα",noon:"μεσημέρι",morning:"πρωί",afternoon:"απόγευμα",evening:"βράδυ",night:"νύχτα"},wide:{am:"π.μ.",pm:"μ.μ.",midnight:"μεσάνυχτα",noon:"μεσημέρι",morning:"πρωί",afternoon:"απόγευμα",evening:"βράδυ",night:"νύχτα"}},ordinalNumber$o=(s,e)=>{const t=Number(s),i=e==null?void 0:e.unit;let n;return i==="year"||i==="month"?n="ος":i==="week"||i==="dayOfYear"||i==="day"||i==="hour"||i==="date"?n="η":n="ο",t+n},localize$o={ordinalNumber:ordinalNumber$o,era:buildLocalizeFn({values:eraValues$o,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$o,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$o,defaultWidth:"wide",formattingValues:formattingMonthValues$5,defaultFormattingWidth:"wide"}),day:buildLocalizeFn({values:dayValues$o,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$o,defaultWidth:"wide"})},matchOrdinalNumberPattern$o=/^(\d+)(ος|η|ο)?/i,parseOrdinalNumberPattern$o=/\d+/i,matchEraPatterns$o={narrow:/^(πΧ|μΧ)/i,abbreviated:/^(π\.?\s?χ\.?|π\.?\s?κ\.?\s?χ\.?|μ\.?\s?χ\.?|κ\.?\s?χ\.?)/i,wide:/^(προ Χριστο(ύ|υ)|πριν απ(ό|ο) την Κοιν(ή|η) Χρονολογ(ί|ι)α|μετ(ά|α) Χριστ(ό|ο)ν|Κοιν(ή|η) Χρονολογ(ί|ι)α)/i},parseEraPatterns$o={any:[/^π/i,/^(μ|κ)/i]},matchQuarterPatterns$o={narrow:/^[1234]/i,abbreviated:/^τ[1234]/i,wide:/^[1234]ο? τρ(ί|ι)μηνο/i},parseQuarterPatterns$o={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$o={narrow:/^[ιφμαμιιασονδ]/i,abbreviated:/^(ιαν|φεβ|μ[άα]ρ|απρ|μ[άα][ιΐ]|ιο[ύυ]ν|ιο[ύυ]λ|α[ύυ]γ|σεπ|οκτ|νο[έε]|δεκ)/i,wide:/^(μ[άα][ιΐ]|α[ύυ]γο[υύ]στ)(ος|ου)|(ιανου[άα]ρ|φεβρου[άα]ρ|μ[άα]ρτ|απρ[ίι]λ|ιο[ύυ]ν|ιο[ύυ]λ|σεπτ[έε]μβρ|οκτ[ώω]βρ|νο[έε]μβρ|δεκ[έε]μβρ)(ιος|ίου)/i},parseMonthPatterns$o={narrow:[/^ι/i,/^φ/i,/^μ/i,/^α/i,/^μ/i,/^ι/i,/^ι/i,/^α/i,/^σ/i,/^ο/i,/^ν/i,/^δ/i],any:[/^ια/i,/^φ/i,/^μ[άα]ρ/i,/^απ/i,/^μ[άα][ιΐ]/i,/^ιο[ύυ]ν/i,/^ιο[ύυ]λ/i,/^α[ύυ]/i,/^σ/i,/^ο/i,/^ν/i,/^δ/i]},matchDayPatterns$o={narrow:/^[κδτπσ]/i,short:/^(κυ|δε|τρ|τε|π[εέ]|π[αά]|σ[αά])/i,abbreviated:/^(κυρ|δευ|τρι|τετ|πεμ|παρ|σαβ)/i,wide:/^(κυριακ(ή|η)|δευτ(έ|ε)ρα|τρ(ί|ι)τη|τετ(ά|α)ρτη|π(έ|ε)μπτη|παρασκευ(ή|η)|σ(ά|α)ββατο)/i},parseDayPatterns$o={narrow:[/^κ/i,/^δ/i,/^τ/i,/^τ/i,/^π/i,/^π/i,/^σ/i],any:[/^κ/i,/^δ/i,/^τρ/i,/^τε/i,/^π[εέ]/i,/^π[αά]/i,/^σ/i]},matchDayPeriodPatterns$o={narrow:/^(πμ|μμ|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i,any:/^([πμ]\.?\s?μ\.?|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i},parseDayPeriodPatterns$o={any:{am:/^πμ|π\.\s?μ\./i,pm:/^μμ|μ\.\s?μ\./i,midnight:/^μεσάν/i,noon:/^μεσημ(έ|ε)/i,morning:/πρω(ί|ι)/i,afternoon:/απ(ό|ο)γευμα/i,evening:/βρ(ά|α)δυ/i,night:/ν(ύ|υ)χτα/i}},match$o={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$o,parsePattern:parseOrdinalNumberPattern$o,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$o,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$o,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$o,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$o,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$o,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$o,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$o,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$o,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$o,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$o,defaultParseWidth:"any"})},el={code:"el",formatDistance:formatDistance$o,formatLong:formatLong$p,formatRelative:formatRelative$o,localize:localize$o,match:match$o,options:{weekStartsOn:1,firstWeekContainsDate:4}},dateFormats$o={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"dd/MM/yyyy"},timeFormats$o={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$o={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$o={date:buildFormatLongFn({formats:dateFormats$o,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$o,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$o,defaultWidth:"full"})},enGB={code:"en-GB",formatDistance:formatDistance$u,formatLong:formatLong$o,formatRelative:formatRelative$u,localize:localize$u,match:match$u,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$m={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},formatDistance$n=(s,e,t)=>{let i;const n=formatDistanceLocale$m[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"en "+i:"hace "+i:i},dateFormats$n={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},timeFormats$n={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$n={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$n={date:buildFormatLongFn({formats:dateFormats$n,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$n,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$n,defaultWidth:"full"})},formatRelativeLocale$n={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},formatRelativeLocalePlural={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},formatRelative$n=(s,e,t,i)=>e.getHours()!==1?formatRelativeLocalePlural[s]:formatRelativeLocale$n[s],eraValues$n={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},quarterValues$n={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},monthValues$n={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},dayValues$n={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},dayPeriodValues$n={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},formattingDayPeriodValues$g={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},ordinalNumber$n=(s,e)=>Number(s)+"º",localize$n={ordinalNumber:ordinalNumber$n,era:buildLocalizeFn({values:eraValues$n,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$n,defaultWidth:"wide",argumentCallback:s=>Number(s)-1}),month:buildLocalizeFn({values:monthValues$n,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$n,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$n,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$g,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$n=/^(\d+)(º)?/i,parseOrdinalNumberPattern$n=/\d+/i,matchEraPatterns$n={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},parseEraPatterns$n={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},matchQuarterPatterns$n={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},parseQuarterPatterns$n={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$n={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},parseMonthPatterns$n={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},matchDayPatterns$n={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},parseDayPatterns$n={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},matchDayPeriodPatterns$n={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},parseDayPeriodPatterns$n={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},match$n={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$n,parsePattern:parseOrdinalNumberPattern$n,valueCallback:function(s){return parseInt(s,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns$n,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$n,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$n,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$n,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$n,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$n,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$n,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$n,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$n,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$n,defaultParseWidth:"any"})},es={code:"es",formatDistance:formatDistance$n,formatLong:formatLong$n,formatRelative:formatRelative$n,localize:localize$n,match:match$n,options:{weekStartsOn:1,firstWeekContainsDate:1}};function futureSeconds(s){return s.replace(/sekuntia?/,"sekunnin")}function futureMinutes(s){return s.replace(/minuuttia?/,"minuutin")}function futureHours(s){return s.replace(/tuntia?/,"tunnin")}function futureDays(s){return s.replace(/päivää?/,"päivän")}function futureWeeks(s){return s.replace(/(viikko|viikkoa)/,"viikon")}function futureMonths(s){return s.replace(/(kuukausi|kuukautta)/,"kuukauden")}function futureYears(s){return s.replace(/(vuosi|vuotta)/,"vuoden")}const formatDistanceLocale$l={lessThanXSeconds:{one:"alle sekunti",other:"alle {{count}} sekuntia",futureTense:futureSeconds},xSeconds:{one:"sekunti",other:"{{count}} sekuntia",futureTense:futureSeconds},halfAMinute:{one:"puoli minuuttia",other:"puoli minuuttia",futureTense:s=>"puolen minuutin"},lessThanXMinutes:{one:"alle minuutti",other:"alle {{count}} minuuttia",futureTense:futureMinutes},xMinutes:{one:"minuutti",other:"{{count}} minuuttia",futureTense:futureMinutes},aboutXHours:{one:"noin tunti",other:"noin {{count}} tuntia",futureTense:futureHours},xHours:{one:"tunti",other:"{{count}} tuntia",futureTense:futureHours},xDays:{one:"päivä",other:"{{count}} päivää",futureTense:futureDays},aboutXWeeks:{one:"noin viikko",other:"noin {{count}} viikkoa",futureTense:futureWeeks},xWeeks:{one:"viikko",other:"{{count}} viikkoa",futureTense:futureWeeks},aboutXMonths:{one:"noin kuukausi",other:"noin {{count}} kuukautta",futureTense:futureMonths},xMonths:{one:"kuukausi",other:"{{count}} kuukautta",futureTense:futureMonths},aboutXYears:{one:"noin vuosi",other:"noin {{count}} vuotta",futureTense:futureYears},xYears:{one:"vuosi",other:"{{count}} vuotta",futureTense:futureYears},overXYears:{one:"yli vuosi",other:"yli {{count}} vuotta",futureTense:futureYears},almostXYears:{one:"lähes vuosi",other:"lähes {{count}} vuotta",futureTense:futureYears}},formatDistance$m=(s,e,t)=>{const i=formatDistanceLocale$l[s],n=e===1?i.one:i.other.replace("{{count}}",String(e));return t!=null&&t.addSuffix?t.comparison&&t.comparison>0?i.futureTense(n)+" kuluttua":n+" sitten":n},dateFormats$m={full:"eeee d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"d.M.y"},timeFormats$m={full:"HH.mm.ss zzzz",long:"HH.mm.ss z",medium:"HH.mm.ss",short:"HH.mm"},dateTimeFormats$m={full:"{{date}} 'klo' {{time}}",long:"{{date}} 'klo' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$m={date:buildFormatLongFn({formats:dateFormats$m,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$m,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$m,defaultWidth:"full"})},formatRelativeLocale$m={lastWeek:"'viime' eeee 'klo' p",yesterday:"'eilen klo' p",today:"'tänään klo' p",tomorrow:"'huomenna klo' p",nextWeek:"'ensi' eeee 'klo' p",other:"P"},formatRelative$m=(s,e,t,i)=>formatRelativeLocale$m[s],eraValues$m={narrow:["eaa.","jaa."],abbreviated:["eaa.","jaa."],wide:["ennen ajanlaskun alkua","jälkeen ajanlaskun alun"]},quarterValues$m={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. kvartaali","2. kvartaali","3. kvartaali","4. kvartaali"]},monthValues$m={narrow:["T","H","M","H","T","K","H","E","S","L","M","J"],abbreviated:["tammi","helmi","maalis","huhti","touko","kesä","heinä","elo","syys","loka","marras","joulu"],wide:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"]},formattingMonthValues$4={narrow:monthValues$m.narrow,abbreviated:monthValues$m.abbreviated,wide:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kesäkuuta","heinäkuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"]},dayValues$m={narrow:["S","M","T","K","T","P","L"],short:["su","ma","ti","ke","to","pe","la"],abbreviated:["sunn.","maan.","tiis.","kesk.","torst.","perj.","la"],wide:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"]},formattingDayValues={narrow:dayValues$m.narrow,short:dayValues$m.short,abbreviated:dayValues$m.abbreviated,wide:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"]},dayPeriodValues$m={narrow:{am:"ap",pm:"ip",midnight:"keskiyö",noon:"keskipäivä",morning:"ap",afternoon:"ip",evening:"illalla",night:"yöllä"},abbreviated:{am:"ap",pm:"ip",midnight:"keskiyö",noon:"keskipäivä",morning:"ap",afternoon:"ip",evening:"illalla",night:"yöllä"},wide:{am:"ap",pm:"ip",midnight:"keskiyöllä",noon:"keskipäivällä",morning:"aamupäivällä",afternoon:"iltapäivällä",evening:"illalla",night:"yöllä"}},ordinalNumber$m=(s,e)=>Number(s)+".",localize$m={ordinalNumber:ordinalNumber$m,era:buildLocalizeFn({values:eraValues$m,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$m,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$m,defaultWidth:"wide",formattingValues:formattingMonthValues$4,defaultFormattingWidth:"wide"}),day:buildLocalizeFn({values:dayValues$m,defaultWidth:"wide",formattingValues:formattingDayValues,defaultFormattingWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$m,defaultWidth:"wide"})},matchOrdinalNumberPattern$m=/^(\d+)(\.)/i,parseOrdinalNumberPattern$m=/\d+/i,matchEraPatterns$m={narrow:/^(e|j)/i,abbreviated:/^(eaa.|jaa.)/i,wide:/^(ennen ajanlaskun alkua|jälkeen ajanlaskun alun)/i},parseEraPatterns$m={any:[/^e/i,/^j/i]},matchQuarterPatterns$m={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234]\.? kvartaali/i},parseQuarterPatterns$m={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$m={narrow:/^[thmkeslj]/i,abbreviated:/^(tammi|helmi|maalis|huhti|touko|kesä|heinä|elo|syys|loka|marras|joulu)/i,wide:/^(tammikuu|helmikuu|maaliskuu|huhtikuu|toukokuu|kesäkuu|heinäkuu|elokuu|syyskuu|lokakuu|marraskuu|joulukuu)(ta)?/i},parseMonthPatterns$m={narrow:[/^t/i,/^h/i,/^m/i,/^h/i,/^t/i,/^k/i,/^h/i,/^e/i,/^s/i,/^l/i,/^m/i,/^j/i],any:[/^ta/i,/^hel/i,/^maa/i,/^hu/i,/^to/i,/^k/i,/^hei/i,/^e/i,/^s/i,/^l/i,/^mar/i,/^j/i]},matchDayPatterns$m={narrow:/^[smtkpl]/i,short:/^(su|ma|ti|ke|to|pe|la)/i,abbreviated:/^(sunn.|maan.|tiis.|kesk.|torst.|perj.|la)/i,wide:/^(sunnuntai|maanantai|tiistai|keskiviikko|torstai|perjantai|lauantai)(na)?/i},parseDayPatterns$m={narrow:[/^s/i,/^m/i,/^t/i,/^k/i,/^t/i,/^p/i,/^l/i],any:[/^s/i,/^m/i,/^ti/i,/^k/i,/^to/i,/^p/i,/^l/i]},matchDayPeriodPatterns$m={narrow:/^(ap|ip|keskiyö|keskipäivä|aamupäivällä|iltapäivällä|illalla|yöllä)/i,any:/^(ap|ip|keskiyöllä|keskipäivällä|aamupäivällä|iltapäivällä|illalla|yöllä)/i},parseDayPeriodPatterns$m={any:{am:/^ap/i,pm:/^ip/i,midnight:/^keskiyö/i,noon:/^keskipäivä/i,morning:/aamupäivällä/i,afternoon:/iltapäivällä/i,evening:/illalla/i,night:/yöllä/i}},match$m={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$m,parsePattern:parseOrdinalNumberPattern$m,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$m,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$m,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$m,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$m,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$m,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$m,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$m,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$m,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$m,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$m,defaultParseWidth:"any"})},fi={code:"fi",formatDistance:formatDistance$m,formatLong:formatLong$m,formatRelative:formatRelative$m,localize:localize$m,match:match$m,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$k={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},formatDistance$l=(s,e,t)=>{let i;const n=formatDistanceLocale$k[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"dans "+i:"il y a "+i:i},dateFormats$l={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},timeFormats$l={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$l={full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$l={date:buildFormatLongFn({formats:dateFormats$l,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$l,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$l,defaultWidth:"full"})},formatRelativeLocale$l={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},formatRelative$l=(s,e,t,i)=>formatRelativeLocale$l[s],eraValues$l={narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},quarterValues$l={narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},monthValues$l={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},dayValues$l={narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},dayPeriodValues$l={narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},ordinalNumber$l=(s,e)=>{const t=Number(s),i=e==null?void 0:e.unit;if(t===0)return"0";const n=["year","week","hour","minute","second"];let o;return t===1?o=i&&n.includes(i)?"ère":"er":o="ème",t+o},LONG_MONTHS_TOKENS=["MMM","MMMM"],localize$l={preprocessor:(s,e)=>s.getDate()===1||!e.some(i=>i.isToken&&LONG_MONTHS_TOKENS.includes(i.value))?e:e.map(i=>i.isToken&&i.value==="do"?{isToken:!0,value:"d"}:i),ordinalNumber:ordinalNumber$l,era:buildLocalizeFn({values:eraValues$l,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$l,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$l,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$l,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$l,defaultWidth:"wide"})},matchOrdinalNumberPattern$l=/^(\d+)(ième|ère|ème|er|e)?/i,parseOrdinalNumberPattern$l=/\d+/i,matchEraPatterns$l={narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},parseEraPatterns$l={any:[/^av/i,/^ap/i]},matchQuarterPatterns$l={narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},parseQuarterPatterns$l={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$l={narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},parseMonthPatterns$l={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$l={narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},parseDayPatterns$l={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},matchDayPeriodPatterns$l={narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},parseDayPeriodPatterns$l={any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},match$l={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$l,parsePattern:parseOrdinalNumberPattern$l,valueCallback:s=>parseInt(s)}),era:buildMatchFn({matchPatterns:matchEraPatterns$l,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$l,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$l,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$l,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$l,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$l,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$l,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$l,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$l,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$l,defaultParseWidth:"any"})},fr={code:"fr",formatDistance:formatDistance$l,formatLong:formatLong$l,formatRelative:formatRelative$l,localize:localize$l,match:match$l,options:{weekStartsOn:1,firstWeekContainsDate:4}},translations={about:"körülbelül",over:"több mint",almost:"majdnem",lessthan:"kevesebb mint"},withoutSuffixes={xseconds:" másodperc",halfaminute:"fél perc",xminutes:" perc",xhours:" óra",xdays:" nap",xweeks:" hét",xmonths:" hónap",xyears:" év"},withSuffixes={xseconds:{"-1":" másodperccel ezelőtt",1:" másodperc múlva",0:" másodperce"},halfaminute:{"-1":"fél perccel ezelőtt",1:"fél perc múlva",0:"fél perce"},xminutes:{"-1":" perccel ezelőtt",1:" perc múlva",0:" perce"},xhours:{"-1":" órával ezelőtt",1:" óra múlva",0:" órája"},xdays:{"-1":" nappal ezelőtt",1:" nap múlva",0:" napja"},xweeks:{"-1":" héttel ezelőtt",1:" hét múlva",0:" hete"},xmonths:{"-1":" hónappal ezelőtt",1:" hónap múlva",0:" hónapja"},xyears:{"-1":" évvel ezelőtt",1:" év múlva",0:" éve"}},formatDistance$k=(s,e,t)=>{const i=s.match(/about|over|almost|lessthan/i),n=i?s.replace(i[0],""):s,o=(t==null?void 0:t.addSuffix)===!0,r=n.toLowerCase(),a=(t==null?void 0:t.comparison)||0,l=o?withSuffixes[r][a]:withoutSuffixes[r];let d=r==="halfaminute"?l:e+l;if(i){const h=i[0].toLowerCase();d=translations[h]+" "+d}return d},dateFormats$k={full:"y. MMMM d., EEEE",long:"y. MMMM d.",medium:"y. MMM d.",short:"y. MM. dd."},timeFormats$k={full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},dateTimeFormats$k={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$k={date:buildFormatLongFn({formats:dateFormats$k,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$k,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$k,defaultWidth:"full"})},accusativeWeekdays$3=["vasárnap","hétfőn","kedden","szerdán","csütörtökön","pénteken","szombaton"];function week(s){return e=>{const t=accusativeWeekdays$3[e.getDay()];return`${s?"":"'múlt' "}'${t}' p'-kor'`}}const formatRelativeLocale$k={lastWeek:week(!1),yesterday:"'tegnap' p'-kor'",today:"'ma' p'-kor'",tomorrow:"'holnap' p'-kor'",nextWeek:week(!0),other:"P"},formatRelative$k=(s,e)=>{const t=formatRelativeLocale$k[s];return typeof t=="function"?t(e):t},eraValues$k={narrow:["ie.","isz."],abbreviated:["i. e.","i. sz."],wide:["Krisztus előtt","időszámításunk szerint"]},quarterValues$k={narrow:["1.","2.","3.","4."],abbreviated:["1. n.év","2. n.év","3. n.év","4. n.év"],wide:["1. negyedév","2. negyedév","3. negyedév","4. negyedév"]},formattingQuarterValues$1={narrow:["I.","II.","III.","IV."],abbreviated:["I. n.év","II. n.év","III. n.év","IV. n.év"],wide:["I. negyedév","II. negyedév","III. negyedév","IV. negyedév"]},monthValues$k={narrow:["J","F","M","Á","M","J","J","A","Sz","O","N","D"],abbreviated:["jan.","febr.","márc.","ápr.","máj.","jún.","júl.","aug.","szept.","okt.","nov.","dec."],wide:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"]},dayValues$k={narrow:["V","H","K","Sz","Cs","P","Sz"],short:["V","H","K","Sze","Cs","P","Szo"],abbreviated:["V","H","K","Sze","Cs","P","Szo"],wide:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"]},dayPeriodValues$k={narrow:{am:"de.",pm:"du.",midnight:"éjfél",noon:"dél",morning:"reggel",afternoon:"du.",evening:"este",night:"éjjel"},abbreviated:{am:"de.",pm:"du.",midnight:"éjfél",noon:"dél",morning:"reggel",afternoon:"du.",evening:"este",night:"éjjel"},wide:{am:"de.",pm:"du.",midnight:"éjfél",noon:"dél",morning:"reggel",afternoon:"délután",evening:"este",night:"éjjel"}},ordinalNumber$k=(s,e)=>Number(s)+".",localize$k={ordinalNumber:ordinalNumber$k,era:buildLocalizeFn({values:eraValues$k,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$k,defaultWidth:"wide",argumentCallback:s=>s-1,formattingValues:formattingQuarterValues$1,defaultFormattingWidth:"wide"}),month:buildLocalizeFn({values:monthValues$k,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$k,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$k,defaultWidth:"wide"})},matchOrdinalNumberPattern$k=/^(\d+)\.?/i,parseOrdinalNumberPattern$k=/\d+/i,matchEraPatterns$k={narrow:/^(ie\.|isz\.)/i,abbreviated:/^(i\.\s?e\.?|b?\s?c\s?e|i\.\s?sz\.?)/i,wide:/^(Krisztus előtt|időszámításunk előtt|időszámításunk szerint|i\. sz\.)/i},parseEraPatterns$k={narrow:[/ie/i,/isz/i],abbreviated:[/^(i\.?\s?e\.?|b\s?ce)/i,/^(i\.?\s?sz\.?|c\s?e)/i],any:[/előtt/i,/(szerint|i. sz.)/i]},matchQuarterPatterns$k={narrow:/^[1234]\.?/i,abbreviated:/^[1234]?\.?\s?n\.év/i,wide:/^([1234]|I|II|III|IV)?\.?\s?negyedév/i},parseQuarterPatterns$k={any:[/1|I$/i,/2|II$/i,/3|III/i,/4|IV/i]},matchMonthPatterns$k={narrow:/^[jfmaásond]|sz/i,abbreviated:/^(jan\.?|febr\.?|márc\.?|ápr\.?|máj\.?|jún\.?|júl\.?|aug\.?|szept\.?|okt\.?|nov\.?|dec\.?)/i,wide:/^(január|február|március|április|május|június|július|augusztus|szeptember|október|november|december)/i},parseMonthPatterns$k={narrow:[/^j/i,/^f/i,/^m/i,/^a|á/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s|sz/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^már/i,/^áp/i,/^máj/i,/^jún/i,/^júl/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$k={narrow:/^([vhkpc]|sz|cs|sz)/i,short:/^([vhkp]|sze|cs|szo)/i,abbreviated:/^([vhkp]|sze|cs|szo)/i,wide:/^(vasárnap|hétfő|kedd|szerda|csütörtök|péntek|szombat)/i},parseDayPatterns$k={narrow:[/^v/i,/^h/i,/^k/i,/^sz/i,/^c/i,/^p/i,/^sz/i],any:[/^v/i,/^h/i,/^k/i,/^sze/i,/^c/i,/^p/i,/^szo/i]},matchDayPeriodPatterns$k={any:/^((de|du)\.?|éjfél|délután|dél|reggel|este|éjjel)/i},parseDayPeriodPatterns$k={any:{am:/^de\.?/i,pm:/^du\.?/i,midnight:/^éjf/i,noon:/^dé/i,morning:/reg/i,afternoon:/^délu\.?/i,evening:/es/i,night:/éjj/i}},match$k={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$k,parsePattern:parseOrdinalNumberPattern$k,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$k,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$k,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$k,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$k,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$k,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$k,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$k,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$k,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$k,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$k,defaultParseWidth:"any"})},hu={code:"hu",formatDistance:formatDistance$k,formatLong:formatLong$k,formatRelative:formatRelative$k,localize:localize$k,match:match$k,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$j={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},formatDistance$j=(s,e,t)=>{let i;const n=formatDistanceLocale$j[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"dalam waktu "+i:i+" yang lalu":i},dateFormats$j={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},timeFormats$j={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},dateTimeFormats$j={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$j={date:buildFormatLongFn({formats:dateFormats$j,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$j,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$j,defaultWidth:"full"})},formatRelativeLocale$j={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},formatRelative$j=(s,e,t,i)=>formatRelativeLocale$j[s],eraValues$j={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},quarterValues$j={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},monthValues$j={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},dayValues$j={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},dayPeriodValues$j={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},formattingDayPeriodValues$f={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},ordinalNumber$j=(s,e)=>"ke-"+Number(s),localize$j={ordinalNumber:ordinalNumber$j,era:buildLocalizeFn({values:eraValues$j,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$j,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$j,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$j,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$j,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$f,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$j=/^ke-(\d+)?/i,parseOrdinalNumberPattern$j=/\d+/i,matchEraPatterns$j={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},parseEraPatterns$j={any:[/^s/i,/^(m|e)/i]},matchQuarterPatterns$j={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},parseQuarterPatterns$j={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$j={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},parseMonthPatterns$j={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$j={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},parseDayPatterns$j={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},matchDayPeriodPatterns$j={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},parseDayPeriodPatterns$j={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},match$j={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$j,parsePattern:parseOrdinalNumberPattern$j,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$j,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$j,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$j,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$j,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$j,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$j,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$j,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$j,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$j,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$j,defaultParseWidth:"any"})},id={code:"id",formatDistance:formatDistance$j,formatLong:formatLong$j,formatRelative:formatRelative$j,localize:localize$j,match:match$j,options:{weekStartsOn:1,firstWeekContainsDate:1}},formatDistanceLocale$i={lessThanXSeconds:{one:"meno di un secondo",other:"meno di {{count}} secondi"},xSeconds:{one:"un secondo",other:"{{count}} secondi"},halfAMinute:"alcuni secondi",lessThanXMinutes:{one:"meno di un minuto",other:"meno di {{count}} minuti"},xMinutes:{one:"un minuto",other:"{{count}} minuti"},aboutXHours:{one:"circa un'ora",other:"circa {{count}} ore"},xHours:{one:"un'ora",other:"{{count}} ore"},xDays:{one:"un giorno",other:"{{count}} giorni"},aboutXWeeks:{one:"circa una settimana",other:"circa {{count}} settimane"},xWeeks:{one:"una settimana",other:"{{count}} settimane"},aboutXMonths:{one:"circa un mese",other:"circa {{count}} mesi"},xMonths:{one:"un mese",other:"{{count}} mesi"},aboutXYears:{one:"circa un anno",other:"circa {{count}} anni"},xYears:{one:"un anno",other:"{{count}} anni"},overXYears:{one:"più di un anno",other:"più di {{count}} anni"},almostXYears:{one:"quasi un anno",other:"quasi {{count}} anni"}},formatDistance$i=(s,e,t)=>{let i;const n=formatDistanceLocale$i[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"tra "+i:i+" fa":i},dateFormats$i={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},timeFormats$i={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$i={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$i={date:buildFormatLongFn({formats:dateFormats$i,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$i,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$i,defaultWidth:"full"})},weekdays=["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"];function lastWeek$3(s){switch(s){case 0:return"'domenica scorsa alle' p";default:return"'"+weekdays[s]+" scorso alle' p"}}function thisWeek$3(s){return"'"+weekdays[s]+" alle' p"}function nextWeek$3(s){switch(s){case 0:return"'domenica prossima alle' p";default:return"'"+weekdays[s]+" prossimo alle' p"}}const formatRelativeLocale$i={lastWeek:(s,e,t)=>{const i=s.getDay();return isSameWeek(s,e,t)?thisWeek$3(i):lastWeek$3(i)},yesterday:"'ieri alle' p",today:"'oggi alle' p",tomorrow:"'domani alle' p",nextWeek:(s,e,t)=>{const i=s.getDay();return isSameWeek(s,e,t)?thisWeek$3(i):nextWeek$3(i)},other:"P"},formatRelative$i=(s,e,t,i)=>{const n=formatRelativeLocale$i[s];return typeof n=="function"?n(e,t,i):n},eraValues$i={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["avanti Cristo","dopo Cristo"]},quarterValues$i={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},monthValues$i={narrow:["G","F","M","A","M","G","L","A","S","O","N","D"],abbreviated:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],wide:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"]},dayValues$i={narrow:["D","L","M","M","G","V","S"],short:["dom","lun","mar","mer","gio","ven","sab"],abbreviated:["dom","lun","mar","mer","gio","ven","sab"],wide:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"]},dayPeriodValues$i={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"}},formattingDayPeriodValues$e={narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"}},ordinalNumber$i=(s,e)=>{const t=Number(s);return String(t)},localize$i={ordinalNumber:ordinalNumber$i,era:buildLocalizeFn({values:eraValues$i,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$i,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$i,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$i,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$i,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$e,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$i=/^(\d+)(º)?/i,parseOrdinalNumberPattern$i=/\d+/i,matchEraPatterns$i={narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},parseEraPatterns$i={any:[/^a/i,/^(d|e)/i]},matchQuarterPatterns$i={narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},parseQuarterPatterns$i={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$i={narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},parseMonthPatterns$i={narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$i={narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},parseDayPatterns$i={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},matchDayPeriodPatterns$i={narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},parseDayPeriodPatterns$i={any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},match$i={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$i,parsePattern:parseOrdinalNumberPattern$i,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$i,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$i,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$i,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$i,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$i,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$i,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$i,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$i,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$i,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$i,defaultParseWidth:"any"})},it={code:"it",formatDistance:formatDistance$i,formatLong:formatLong$i,formatRelative:formatRelative$i,localize:localize$i,match:match$i,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$h={lessThanXSeconds:{one:"1秒未満",other:"{{count}}秒未満",oneWithSuffix:"約1秒",otherWithSuffix:"約{{count}}秒"},xSeconds:{one:"1秒",other:"{{count}}秒"},halfAMinute:"30秒",lessThanXMinutes:{one:"1分未満",other:"{{count}}分未満",oneWithSuffix:"約1分",otherWithSuffix:"約{{count}}分"},xMinutes:{one:"1分",other:"{{count}}分"},aboutXHours:{one:"約1時間",other:"約{{count}}時間"},xHours:{one:"1時間",other:"{{count}}時間"},xDays:{one:"1日",other:"{{count}}日"},aboutXWeeks:{one:"約1週間",other:"約{{count}}週間"},xWeeks:{one:"1週間",other:"{{count}}週間"},aboutXMonths:{one:"約1か月",other:"約{{count}}か月"},xMonths:{one:"1か月",other:"{{count}}か月"},aboutXYears:{one:"約1年",other:"約{{count}}年"},xYears:{one:"1年",other:"{{count}}年"},overXYears:{one:"1年以上",other:"{{count}}年以上"},almostXYears:{one:"1年近く",other:"{{count}}年近く"}},formatDistance$h=(s,e,t)=>{t=t||{};let i;const n=formatDistanceLocale$h[s];return typeof n=="string"?i=n:e===1?t.addSuffix&&n.oneWithSuffix?i=n.oneWithSuffix:i=n.one:t.addSuffix&&n.otherWithSuffix?i=n.otherWithSuffix.replace("{{count}}",String(e)):i=n.other.replace("{{count}}",String(e)),t.addSuffix?t.comparison&&t.comparison>0?i+"後":i+"前":i},dateFormats$h={full:"y年M月d日EEEE",long:"y年M月d日",medium:"y/MM/dd",short:"y/MM/dd"},timeFormats$h={full:"H時mm分ss秒 zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},dateTimeFormats$h={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$h={date:buildFormatLongFn({formats:dateFormats$h,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$h,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$h,defaultWidth:"full"})},formatRelativeLocale$h={lastWeek:"先週のeeeeのp",yesterday:"昨日のp",today:"今日のp",tomorrow:"明日のp",nextWeek:"翌週のeeeeのp",other:"P"},formatRelative$h=(s,e,t,i)=>formatRelativeLocale$h[s],eraValues$h={narrow:["BC","AC"],abbreviated:["紀元前","西暦"],wide:["紀元前","西暦"]},quarterValues$h={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["第1四半期","第2四半期","第3四半期","第4四半期"]},monthValues$h={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},dayValues$h={narrow:["日","月","火","水","木","金","土"],short:["日","月","火","水","木","金","土"],abbreviated:["日","月","火","水","木","金","土"],wide:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"]},dayPeriodValues$h={narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},formattingDayPeriodValues$d={narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},ordinalNumber$h=(s,e)=>{const t=Number(s);switch(String(e==null?void 0:e.unit)){case"year":return`${t}年`;case"quarter":return`第${t}四半期`;case"month":return`${t}月`;case"week":return`第${t}週`;case"date":return`${t}日`;case"hour":return`${t}時`;case"minute":return`${t}分`;case"second":return`${t}秒`;default:return`${t}`}},localize$h={ordinalNumber:ordinalNumber$h,era:buildLocalizeFn({values:eraValues$h,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$h,defaultWidth:"wide",argumentCallback:s=>Number(s)-1}),month:buildLocalizeFn({values:monthValues$h,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$h,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$h,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$d,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$h=/^第?\d+(年|四半期|月|週|日|時|分|秒)?/i,parseOrdinalNumberPattern$h=/\d+/i,matchEraPatterns$h={narrow:/^(B\.?C\.?|A\.?D\.?)/i,abbreviated:/^(紀元[前後]|西暦)/i,wide:/^(紀元[前後]|西暦)/i},parseEraPatterns$h={narrow:[/^B/i,/^A/i],any:[/^(紀元前)/i,/^(西暦|紀元後)/i]},matchQuarterPatterns$h={narrow:/^[1234]/i,abbreviated:/^Q[1234]/i,wide:/^第[1234一二三四1234]四半期/i},parseQuarterPatterns$h={any:[/(1|一|1)/i,/(2|二|2)/i,/(3|三|3)/i,/(4|四|4)/i]},matchMonthPatterns$h={narrow:/^([123456789]|1[012])/,abbreviated:/^([123456789]|1[012])月/i,wide:/^([123456789]|1[012])月/i},parseMonthPatterns$h={any:[/^1\D/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},matchDayPatterns$h={narrow:/^[日月火水木金土]/,short:/^[日月火水木金土]/,abbreviated:/^[日月火水木金土]/,wide:/^[日月火水木金土]曜日/},parseDayPatterns$h={any:[/^日/,/^月/,/^火/,/^水/,/^木/,/^金/,/^土/]},matchDayPeriodPatterns$h={any:/^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i},parseDayPeriodPatterns$h={any:{am:/^(A|午前)/i,pm:/^(P|午後)/i,midnight:/^深夜|真夜中/i,noon:/^正午/i,morning:/^朝/i,afternoon:/^午後/i,evening:/^夜/i,night:/^深夜/i}},match$h={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$h,parsePattern:parseOrdinalNumberPattern$h,valueCallback:function(s){return parseInt(s,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns$h,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$h,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$h,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$h,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$h,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$h,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$h,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$h,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$h,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$h,defaultParseWidth:"any"})},ja={code:"ja",formatDistance:formatDistance$h,formatLong:formatLong$h,formatRelative:formatRelative$h,localize:localize$h,match:match$h,options:{weekStartsOn:0,firstWeekContainsDate:1}},formatDistanceLocale$g={lessThanXSeconds:{one:"1초 미만",other:"{{count}}초 미만"},xSeconds:{one:"1초",other:"{{count}}초"},halfAMinute:"30초",lessThanXMinutes:{one:"1분 미만",other:"{{count}}분 미만"},xMinutes:{one:"1분",other:"{{count}}분"},aboutXHours:{one:"약 1시간",other:"약 {{count}}시간"},xHours:{one:"1시간",other:"{{count}}시간"},xDays:{one:"1일",other:"{{count}}일"},aboutXWeeks:{one:"약 1주",other:"약 {{count}}주"},xWeeks:{one:"1주",other:"{{count}}주"},aboutXMonths:{one:"약 1개월",other:"약 {{count}}개월"},xMonths:{one:"1개월",other:"{{count}}개월"},aboutXYears:{one:"약 1년",other:"약 {{count}}년"},xYears:{one:"1년",other:"{{count}}년"},overXYears:{one:"1년 이상",other:"{{count}}년 이상"},almostXYears:{one:"거의 1년",other:"거의 {{count}}년"}},formatDistance$g=(s,e,t)=>{let i;const n=formatDistanceLocale$g[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?i+" 후":i+" 전":i},dateFormats$g={full:"y년 M월 d일 EEEE",long:"y년 M월 d일",medium:"y.MM.dd",short:"y.MM.dd"},timeFormats$g={full:"a H시 mm분 ss초 zzzz",long:"a H:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$g={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$g={date:buildFormatLongFn({formats:dateFormats$g,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$g,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$g,defaultWidth:"full"})},formatRelativeLocale$g={lastWeek:"'지난' eeee p",yesterday:"'어제' p",today:"'오늘' p",tomorrow:"'내일' p",nextWeek:"'다음' eeee p",other:"P"},formatRelative$g=(s,e,t,i)=>formatRelativeLocale$g[s],eraValues$g={narrow:["BC","AD"],abbreviated:["BC","AD"],wide:["기원전","서기"]},quarterValues$g={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1분기","2분기","3분기","4분기"]},monthValues$g={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],wide:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},dayValues$g={narrow:["일","월","화","수","목","금","토"],short:["일","월","화","수","목","금","토"],abbreviated:["일","월","화","수","목","금","토"],wide:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},dayPeriodValues$g={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},formattingDayPeriodValues$c={narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},ordinalNumber$g=(s,e)=>{const t=Number(s);switch(String(e==null?void 0:e.unit)){case"minute":case"second":return String(t);case"date":return t+"일";default:return t+"번째"}},localize$g={ordinalNumber:ordinalNumber$g,era:buildLocalizeFn({values:eraValues$g,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$g,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$g,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$g,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$g,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$c,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$g=/^(\d+)(일|번째)?/i,parseOrdinalNumberPattern$g=/\d+/i,matchEraPatterns$g={narrow:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(기원전|서기)/i},parseEraPatterns$g={any:[/^(bc|기원전)/i,/^(ad|서기)/i]},matchQuarterPatterns$g={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234]사?분기/i},parseQuarterPatterns$g={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$g={narrow:/^(1[012]|[123456789])/,abbreviated:/^(1[012]|[123456789])월/i,wide:/^(1[012]|[123456789])월/i},parseMonthPatterns$g={any:[/^1월?$/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},matchDayPatterns$g={narrow:/^[일월화수목금토]/,short:/^[일월화수목금토]/,abbreviated:/^[일월화수목금토]/,wide:/^[일월화수목금토]요일/},parseDayPatterns$g={any:[/^일/,/^월/,/^화/,/^수/,/^목/,/^금/,/^토/]},matchDayPeriodPatterns$g={any:/^(am|pm|오전|오후|자정|정오|아침|저녁|밤)/i},parseDayPeriodPatterns$g={any:{am:/^(am|오전)/i,pm:/^(pm|오후)/i,midnight:/^자정/i,noon:/^정오/i,morning:/^아침/i,afternoon:/^오후/i,evening:/^저녁/i,night:/^밤/i}},match$g={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$g,parsePattern:parseOrdinalNumberPattern$g,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$g,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$g,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$g,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$g,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$g,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$g,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$g,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$g,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$g,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$g,defaultParseWidth:"any"})},ko={code:"ko",formatDistance:formatDistance$g,formatLong:formatLong$g,formatRelative:formatRelative$g,localize:localize$g,match:match$g,options:{weekStartsOn:0,firstWeekContainsDate:1}},formatDistanceLocale$f={lessThanXSeconds:{one:"mindre enn ett sekund",other:"mindre enn {{count}} sekunder"},xSeconds:{one:"ett sekund",other:"{{count}} sekunder"},halfAMinute:"et halvt minutt",lessThanXMinutes:{one:"mindre enn ett minutt",other:"mindre enn {{count}} minutter"},xMinutes:{one:"ett minutt",other:"{{count}} minutter"},aboutXHours:{one:"omtrent en time",other:"omtrent {{count}} timer"},xHours:{one:"en time",other:"{{count}} timer"},xDays:{one:"en dag",other:"{{count}} dager"},aboutXWeeks:{one:"omtrent en uke",other:"omtrent {{count}} uker"},xWeeks:{one:"en uke",other:"{{count}} uker"},aboutXMonths:{one:"omtrent en måned",other:"omtrent {{count}} måneder"},xMonths:{one:"en måned",other:"{{count}} måneder"},aboutXYears:{one:"omtrent ett år",other:"omtrent {{count}} år"},xYears:{one:"ett år",other:"{{count}} år"},overXYears:{one:"over ett år",other:"over {{count}} år"},almostXYears:{one:"nesten ett år",other:"nesten {{count}} år"}},formatDistance$f=(s,e,t)=>{let i;const n=formatDistanceLocale$f[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"om "+i:i+" siden":i},dateFormats$f={full:"EEEE d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"dd.MM.y"},timeFormats$f={full:"'kl'. HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$f={full:"{{date}} 'kl.' {{time}}",long:"{{date}} 'kl.' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$f={date:buildFormatLongFn({formats:dateFormats$f,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$f,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$f,defaultWidth:"full"})},formatRelativeLocale$f={lastWeek:"'forrige' eeee 'kl.' p",yesterday:"'i går kl.' p",today:"'i dag kl.' p",tomorrow:"'i morgen kl.' p",nextWeek:"EEEE 'kl.' p",other:"P"},formatRelative$f=(s,e,t,i)=>formatRelativeLocale$f[s],eraValues$f={narrow:["f.Kr.","e.Kr."],abbreviated:["f.Kr.","e.Kr."],wide:["før Kristus","etter Kristus"]},quarterValues$f={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. kvartal","2. kvartal","3. kvartal","4. kvartal"]},monthValues$f={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mars","apr.","mai","juni","juli","aug.","sep.","okt.","nov.","des."],wide:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"]},dayValues$f={narrow:["S","M","T","O","T","F","L"],short:["sø","ma","ti","on","to","fr","lø"],abbreviated:["søn","man","tir","ons","tor","fre","lør"],wide:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},dayPeriodValues$f={narrow:{am:"a",pm:"p",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på etterm.",evening:"på kvelden",night:"på natten"},abbreviated:{am:"a.m.",pm:"p.m.",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på etterm.",evening:"på kvelden",night:"på natten"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnatt",noon:"middag",morning:"på morgenen",afternoon:"på ettermiddagen",evening:"på kvelden",night:"på natten"}},ordinalNumber$f=(s,e)=>Number(s)+".",localize$f={ordinalNumber:ordinalNumber$f,era:buildLocalizeFn({values:eraValues$f,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$f,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$f,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$f,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$f,defaultWidth:"wide"})},matchOrdinalNumberPattern$f=/^(\d+)\.?/i,parseOrdinalNumberPattern$f=/\d+/i,matchEraPatterns$f={narrow:/^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,abbreviated:/^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,wide:/^(før Kristus|før vår tid|etter Kristus|vår tid)/i},parseEraPatterns$f={any:[/^f/i,/^e/i]},matchQuarterPatterns$f={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? kvartal/i},parseQuarterPatterns$f={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$f={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,wide:/^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i},parseMonthPatterns$f={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^aug/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$f={narrow:/^[smtofl]/i,short:/^(sø|ma|ti|on|to|fr|lø)/i,abbreviated:/^(søn|man|tir|ons|tor|fre|lør)/i,wide:/^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i},parseDayPatterns$f={any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},matchDayPeriodPatterns$f={narrow:/^(midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten)|[ap])/i,any:/^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten))/i},parseDayPeriodPatterns$f={any:{am:/^a(\.?\s?m\.?)?$/i,pm:/^p(\.?\s?m\.?)?$/i,midnight:/^midn/i,noon:/^midd/i,morning:/morgen/i,afternoon:/ettermiddag/i,evening:/kveld/i,night:/natt/i}},match$f={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$f,parsePattern:parseOrdinalNumberPattern$f,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$f,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$f,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$f,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$f,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$f,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$f,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$f,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$f,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$f,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$f,defaultParseWidth:"any"})},nb={code:"nb",formatDistance:formatDistance$f,formatLong:formatLong$f,formatRelative:formatRelative$f,localize:localize$f,match:match$f,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$e={lessThanXSeconds:{one:"minder dan een seconde",other:"minder dan {{count}} seconden"},xSeconds:{one:"1 seconde",other:"{{count}} seconden"},halfAMinute:"een halve minuut",lessThanXMinutes:{one:"minder dan een minuut",other:"minder dan {{count}} minuten"},xMinutes:{one:"een minuut",other:"{{count}} minuten"},aboutXHours:{one:"ongeveer 1 uur",other:"ongeveer {{count}} uur"},xHours:{one:"1 uur",other:"{{count}} uur"},xDays:{one:"1 dag",other:"{{count}} dagen"},aboutXWeeks:{one:"ongeveer 1 week",other:"ongeveer {{count}} weken"},xWeeks:{one:"1 week",other:"{{count}} weken"},aboutXMonths:{one:"ongeveer 1 maand",other:"ongeveer {{count}} maanden"},xMonths:{one:"1 maand",other:"{{count}} maanden"},aboutXYears:{one:"ongeveer 1 jaar",other:"ongeveer {{count}} jaar"},xYears:{one:"1 jaar",other:"{{count}} jaar"},overXYears:{one:"meer dan 1 jaar",other:"meer dan {{count}} jaar"},almostXYears:{one:"bijna 1 jaar",other:"bijna {{count}} jaar"}},formatDistance$e=(s,e,t)=>{let i;const n=formatDistanceLocale$e[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"over "+i:i+" geleden":i},dateFormats$e={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd-MM-y"},timeFormats$e={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$e={full:"{{date}} 'om' {{time}}",long:"{{date}} 'om' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$e={date:buildFormatLongFn({formats:dateFormats$e,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$e,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$e,defaultWidth:"full"})},formatRelativeLocale$e={lastWeek:"'afgelopen' eeee 'om' p",yesterday:"'gisteren om' p",today:"'vandaag om' p",tomorrow:"'morgen om' p",nextWeek:"eeee 'om' p",other:"P"},formatRelative$e=(s,e,t,i)=>formatRelativeLocale$e[s],eraValues$e={narrow:["v.C.","n.C."],abbreviated:["v.Chr.","n.Chr."],wide:["voor Christus","na Christus"]},quarterValues$e={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["1e kwartaal","2e kwartaal","3e kwartaal","4e kwartaal"]},monthValues$e={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],wide:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},dayValues$e={narrow:["Z","M","D","W","D","V","Z"],short:["zo","ma","di","wo","do","vr","za"],abbreviated:["zon","maa","din","woe","don","vri","zat"],wide:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},dayPeriodValues$e={narrow:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},abbreviated:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},wide:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"}},ordinalNumber$e=(s,e)=>Number(s)+"e",localize$e={ordinalNumber:ordinalNumber$e,era:buildLocalizeFn({values:eraValues$e,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$e,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$e,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$e,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$e,defaultWidth:"wide"})},matchOrdinalNumberPattern$e=/^(\d+)e?/i,parseOrdinalNumberPattern$e=/\d+/i,matchEraPatterns$e={narrow:/^([vn]\.? ?C\.?)/,abbreviated:/^([vn]\. ?Chr\.?)/,wide:/^((voor|na) Christus)/},parseEraPatterns$e={any:[/^v/,/^n/]},matchQuarterPatterns$e={narrow:/^[1234]/i,abbreviated:/^K[1234]/i,wide:/^[1234]e kwartaal/i},parseQuarterPatterns$e={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$e={narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i},parseMonthPatterns$e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^jan/i,/^feb/i,/^m(r|a)/i,/^apr/i,/^mei/i,/^jun/i,/^jul/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i]},matchDayPatterns$e={narrow:/^[zmdwv]/i,short:/^(zo|ma|di|wo|do|vr|za)/i,abbreviated:/^(zon|maa|din|woe|don|vri|zat)/i,wide:/^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i},parseDayPatterns$e={narrow:[/^z/i,/^m/i,/^d/i,/^w/i,/^d/i,/^v/i,/^z/i],any:[/^zo/i,/^ma/i,/^di/i,/^wo/i,/^do/i,/^vr/i,/^za/i]},matchDayPeriodPatterns$e={any:/^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i},parseDayPeriodPatterns$e={any:{am:/^am/i,pm:/^pm/i,midnight:/^middernacht/i,noon:/^het middaguur/i,morning:/ochtend/i,afternoon:/middag/i,evening:/avond/i,night:/nacht/i}},match$e={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$e,parsePattern:parseOrdinalNumberPattern$e,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$e,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$e,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$e,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$e,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$e,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$e,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$e,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$e,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$e,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$e,defaultParseWidth:"any"})},nl={code:"nl",formatDistance:formatDistance$e,formatLong:formatLong$e,formatRelative:formatRelative$e,localize:localize$e,match:match$e,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$d={lessThanXSeconds:{one:"mindre enn eitt sekund",other:"mindre enn {{count}} sekund"},xSeconds:{one:"eitt sekund",other:"{{count}} sekund"},halfAMinute:"eit halvt minutt",lessThanXMinutes:{one:"mindre enn eitt minutt",other:"mindre enn {{count}} minutt"},xMinutes:{one:"eitt minutt",other:"{{count}} minutt"},aboutXHours:{one:"omtrent ein time",other:"omtrent {{count}} timar"},xHours:{one:"ein time",other:"{{count}} timar"},xDays:{one:"ein dag",other:"{{count}} dagar"},aboutXWeeks:{one:"omtrent ei veke",other:"omtrent {{count}} veker"},xWeeks:{one:"ei veke",other:"{{count}} veker"},aboutXMonths:{one:"omtrent ein månad",other:"omtrent {{count}} månader"},xMonths:{one:"ein månad",other:"{{count}} månader"},aboutXYears:{one:"omtrent eitt år",other:"omtrent {{count}} år"},xYears:{one:"eitt år",other:"{{count}} år"},overXYears:{one:"over eitt år",other:"over {{count}} år"},almostXYears:{one:"nesten eitt år",other:"nesten {{count}} år"}},wordMapping$1=["null","ein","to","tre","fire","fem","seks","sju","åtte","ni","ti","elleve","tolv"],formatDistance$d=(s,e,t)=>{let i;const n=formatDistanceLocale$d[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e<13?wordMapping$1[e]:String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"om "+i:i+" sidan":i},dateFormats$d={full:"EEEE d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"dd.MM.y"},timeFormats$d={full:"'kl'. HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$d={full:"{{date}} 'kl.' {{time}}",long:"{{date}} 'kl.' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$d={date:buildFormatLongFn({formats:dateFormats$d,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$d,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$d,defaultWidth:"full"})},formatRelativeLocale$d={lastWeek:"'førre' eeee 'kl.' p",yesterday:"'i går kl.' p",today:"'i dag kl.' p",tomorrow:"'i morgon kl.' p",nextWeek:"EEEE 'kl.' p",other:"P"},formatRelative$d=(s,e,t,i)=>formatRelativeLocale$d[s],eraValues$d={narrow:["f.Kr.","e.Kr."],abbreviated:["f.Kr.","e.Kr."],wide:["før Kristus","etter Kristus"]},quarterValues$d={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. kvartal","2. kvartal","3. kvartal","4. kvartal"]},monthValues$d={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mars","apr.","mai","juni","juli","aug.","sep.","okt.","nov.","des."],wide:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"]},dayValues$d={narrow:["S","M","T","O","T","F","L"],short:["su","må","ty","on","to","fr","lau"],abbreviated:["sun","mån","tys","ons","tor","fre","laur"],wide:["sundag","måndag","tysdag","onsdag","torsdag","fredag","laurdag"]},dayPeriodValues$d={narrow:{am:"a",pm:"p",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på etterm.",evening:"på kvelden",night:"på natta"},abbreviated:{am:"a.m.",pm:"p.m.",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på etterm.",evening:"på kvelden",night:"på natta"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnatt",noon:"middag",morning:"på morgonen",afternoon:"på ettermiddagen",evening:"på kvelden",night:"på natta"}},ordinalNumber$d=(s,e)=>Number(s)+".",localize$d={ordinalNumber:ordinalNumber$d,era:buildLocalizeFn({values:eraValues$d,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$d,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$d,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$d,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$d,defaultWidth:"wide"})},matchOrdinalNumberPattern$d=/^(\d+)\.?/i,parseOrdinalNumberPattern$d=/\d+/i,matchEraPatterns$d={narrow:/^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,abbreviated:/^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,wide:/^(før Kristus|før vår tid|etter Kristus|vår tid)/i},parseEraPatterns$d={any:[/^f/i,/^e/i]},matchQuarterPatterns$d={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? kvartal/i},parseQuarterPatterns$d={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$d={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,wide:/^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i},parseMonthPatterns$d={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^aug/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$d={narrow:/^[smtofl]/i,short:/^(su|må|ty|on|to|fr|la)/i,abbreviated:/^(sun|mån|tys|ons|tor|fre|laur)/i,wide:/^(sundag|måndag|tysdag|onsdag|torsdag|fredag|laurdag)/i},parseDayPatterns$d={any:[/^s/i,/^m/i,/^ty/i,/^o/i,/^to/i,/^f/i,/^l/i]},matchDayPeriodPatterns$d={narrow:/^(midnatt|middag|(på) (morgonen|ettermiddagen|kvelden|natta)|[ap])/i,any:/^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgonen|ettermiddagen|kvelden|natta))/i},parseDayPeriodPatterns$d={any:{am:/^a(\.?\s?m\.?)?$/i,pm:/^p(\.?\s?m\.?)?$/i,midnight:/^midn/i,noon:/^midd/i,morning:/morgon/i,afternoon:/ettermiddag/i,evening:/kveld/i,night:/natt/i}},match$d={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$d,parsePattern:parseOrdinalNumberPattern$d,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$d,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$d,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$d,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$d,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$d,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$d,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$d,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$d,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$d,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$d,defaultParseWidth:"any"})},nn={code:"nn",formatDistance:formatDistance$d,formatLong:formatLong$d,formatRelative:formatRelative$d,localize:localize$d,match:match$d,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$c={lessThanXSeconds:{one:{regular:"mniej niż sekunda",past:"mniej niż sekundę",future:"mniej niż sekundę"},twoFour:"mniej niż {{count}} sekundy",other:"mniej niż {{count}} sekund"},xSeconds:{one:{regular:"sekunda",past:"sekundę",future:"sekundę"},twoFour:"{{count}} sekundy",other:"{{count}} sekund"},halfAMinute:{one:"pół minuty",twoFour:"pół minuty",other:"pół minuty"},lessThanXMinutes:{one:{regular:"mniej niż minuta",past:"mniej niż minutę",future:"mniej niż minutę"},twoFour:"mniej niż {{count}} minuty",other:"mniej niż {{count}} minut"},xMinutes:{one:{regular:"minuta",past:"minutę",future:"minutę"},twoFour:"{{count}} minuty",other:"{{count}} minut"},aboutXHours:{one:{regular:"około godziny",past:"około godziny",future:"około godzinę"},twoFour:"około {{count}} godziny",other:"około {{count}} godzin"},xHours:{one:{regular:"godzina",past:"godzinę",future:"godzinę"},twoFour:"{{count}} godziny",other:"{{count}} godzin"},xDays:{one:{regular:"dzień",past:"dzień",future:"1 dzień"},twoFour:"{{count}} dni",other:"{{count}} dni"},aboutXWeeks:{one:"około tygodnia",twoFour:"około {{count}} tygodni",other:"około {{count}} tygodni"},xWeeks:{one:"tydzień",twoFour:"{{count}} tygodnie",other:"{{count}} tygodni"},aboutXMonths:{one:"około miesiąc",twoFour:"około {{count}} miesiące",other:"około {{count}} miesięcy"},xMonths:{one:"miesiąc",twoFour:"{{count}} miesiące",other:"{{count}} miesięcy"},aboutXYears:{one:"około rok",twoFour:"około {{count}} lata",other:"około {{count}} lat"},xYears:{one:"rok",twoFour:"{{count}} lata",other:"{{count}} lat"},overXYears:{one:"ponad rok",twoFour:"ponad {{count}} lata",other:"ponad {{count}} lat"},almostXYears:{one:"prawie rok",twoFour:"prawie {{count}} lata",other:"prawie {{count}} lat"}};function declensionGroup$1(s,e){if(e===1)return s.one;const t=e%100;if(t<=20&&t>10)return s.other;const i=t%10;return i>=2&&i<=4?s.twoFour:s.other}function declension$3(s,e,t){const i=declensionGroup$1(s,e);return(typeof i=="string"?i:i[t]).replace("{{count}}",String(e))}const formatDistance$c=(s,e,t)=>{const i=formatDistanceLocale$c[s];return t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"za "+declension$3(i,e,"future"):declension$3(i,e,"past")+" temu":declension$3(i,e,"regular")},dateFormats$c={full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},timeFormats$c={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$c={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$c={date:buildFormatLongFn({formats:dateFormats$c,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$c,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$c,defaultWidth:"full"})},adjectivesLastWeek={masculine:"ostatni",feminine:"ostatnia"},adjectivesThisWeek={masculine:"ten",feminine:"ta"},adjectivesNextWeek={masculine:"następny",feminine:"następna"},dayGrammaticalGender={0:"feminine",1:"masculine",2:"masculine",3:"feminine",4:"masculine",5:"masculine",6:"feminine"};function dayAndTimeWithAdjective(s,e,t,i){let n;if(isSameWeek(e,t,i))n=adjectivesThisWeek;else if(s==="lastWeek")n=adjectivesLastWeek;else if(s==="nextWeek")n=adjectivesNextWeek;else throw new Error(`Cannot determine adjectives for token ${s}`);const o=e.getDay(),r=dayGrammaticalGender[o];return`'${n[r]}' eeee 'o' p`}const formatRelativeLocale$c={lastWeek:dayAndTimeWithAdjective,yesterday:"'wczoraj o' p",today:"'dzisiaj o' p",tomorrow:"'jutro o' p",nextWeek:dayAndTimeWithAdjective,other:"P"},formatRelative$c=(s,e,t,i)=>{const n=formatRelativeLocale$c[s];return typeof n=="function"?n(s,e,t,i):n},eraValues$c={narrow:["p.n.e.","n.e."],abbreviated:["p.n.e.","n.e."],wide:["przed naszą erą","naszej ery"]},quarterValues$c={narrow:["1","2","3","4"],abbreviated:["I kw.","II kw.","III kw.","IV kw."],wide:["I kwartał","II kwartał","III kwartał","IV kwartał"]},monthValues$c={narrow:["S","L","M","K","M","C","L","S","W","P","L","G"],abbreviated:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],wide:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"]},monthFormattingValues={narrow:["s","l","m","k","m","c","l","s","w","p","l","g"],abbreviated:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],wide:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"]},dayValues$c={narrow:["N","P","W","Ś","C","P","S"],short:["nie","pon","wto","śro","czw","pią","sob"],abbreviated:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],wide:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},dayFormattingValues={narrow:["n","p","w","ś","c","p","s"],short:["nie","pon","wto","śro","czw","pią","sob"],abbreviated:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],wide:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},dayPeriodValues$c={narrow:{am:"a",pm:"p",midnight:"półn.",noon:"poł",morning:"rano",afternoon:"popoł.",evening:"wiecz.",night:"noc"},abbreviated:{am:"AM",pm:"PM",midnight:"północ",noon:"południe",morning:"rano",afternoon:"popołudnie",evening:"wieczór",night:"noc"},wide:{am:"AM",pm:"PM",midnight:"północ",noon:"południe",morning:"rano",afternoon:"popołudnie",evening:"wieczór",night:"noc"}},dayPeriodFormattingValues={narrow:{am:"a",pm:"p",midnight:"o półn.",noon:"w poł.",morning:"rano",afternoon:"po poł.",evening:"wiecz.",night:"w nocy"},abbreviated:{am:"AM",pm:"PM",midnight:"o północy",noon:"w południe",morning:"rano",afternoon:"po południu",evening:"wieczorem",night:"w nocy"},wide:{am:"AM",pm:"PM",midnight:"o północy",noon:"w południe",morning:"rano",afternoon:"po południu",evening:"wieczorem",night:"w nocy"}},ordinalNumber$c=(s,e)=>String(s),localize$c={ordinalNumber:ordinalNumber$c,era:buildLocalizeFn({values:eraValues$c,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$c,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$c,defaultWidth:"wide",formattingValues:monthFormattingValues,defaultFormattingWidth:"wide"}),day:buildLocalizeFn({values:dayValues$c,defaultWidth:"wide",formattingValues:dayFormattingValues,defaultFormattingWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$c,defaultWidth:"wide",formattingValues:dayPeriodFormattingValues,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$c=/^(\d+)?/i,parseOrdinalNumberPattern$c=/\d+/i,matchEraPatterns$c={narrow:/^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,abbreviated:/^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,wide:/^(przed\s*nasz(ą|a)\s*er(ą|a)|naszej\s*ery)/i},parseEraPatterns$c={any:[/^p/i,/^n/i]},matchQuarterPatterns$c={narrow:/^[1234]/i,abbreviated:/^(I|II|III|IV)\s*kw\.?/i,wide:/^(I|II|III|IV)\s*kwarta(ł|l)/i},parseQuarterPatterns$c={narrow:[/1/i,/2/i,/3/i,/4/i],any:[/^I kw/i,/^II kw/i,/^III kw/i,/^IV kw/i]},matchMonthPatterns$c={narrow:/^[slmkcwpg]/i,abbreviated:/^(sty|lut|mar|kwi|maj|cze|lip|sie|wrz|pa(ź|z)|lis|gru)/i,wide:/^(stycznia|stycze(ń|n)|lutego|luty|marca|marzec|kwietnia|kwiecie(ń|n)|maja|maj|czerwca|czerwiec|lipca|lipiec|sierpnia|sierpie(ń|n)|wrze(ś|s)nia|wrzesie(ń|n)|pa(ź|z)dziernika|pa(ź|z)dziernik|listopada|listopad|grudnia|grudzie(ń|n))/i},parseMonthPatterns$c={narrow:[/^s/i,/^l/i,/^m/i,/^k/i,/^m/i,/^c/i,/^l/i,/^s/i,/^w/i,/^p/i,/^l/i,/^g/i],any:[/^st/i,/^lu/i,/^mar/i,/^k/i,/^maj/i,/^c/i,/^lip/i,/^si/i,/^w/i,/^p/i,/^lis/i,/^g/i]},matchDayPatterns$c={narrow:/^[npwścs]/i,short:/^(nie|pon|wto|(ś|s)ro|czw|pi(ą|a)|sob)/i,abbreviated:/^(niedz|pon|wt|(ś|s)r|czw|pt|sob)\.?/i,wide:/^(niedziela|poniedzia(ł|l)ek|wtorek|(ś|s)roda|czwartek|pi(ą|a)tek|sobota)/i},parseDayPatterns$c={narrow:[/^n/i,/^p/i,/^w/i,/^ś/i,/^c/i,/^p/i,/^s/i],abbreviated:[/^n/i,/^po/i,/^w/i,/^(ś|s)r/i,/^c/i,/^pt/i,/^so/i],any:[/^n/i,/^po/i,/^w/i,/^(ś|s)r/i,/^c/i,/^pi/i,/^so/i]},matchDayPeriodPatterns$c={narrow:/^(^a$|^p$|pó(ł|l)n\.?|o\s*pó(ł|l)n\.?|po(ł|l)\.?|w\s*po(ł|l)\.?|po\s*po(ł|l)\.?|rano|wiecz\.?|noc|w\s*nocy)/i,any:/^(am|pm|pó(ł|l)noc|o\s*pó(ł|l)nocy|po(ł|l)udnie|w\s*po(ł|l)udnie|popo(ł|l)udnie|po\s*po(ł|l)udniu|rano|wieczór|wieczorem|noc|w\s*nocy)/i},parseDayPeriodPatterns$c={narrow:{am:/^a$/i,pm:/^p$/i,midnight:/pó(ł|l)n/i,noon:/po(ł|l)/i,morning:/rano/i,afternoon:/po\s*po(ł|l)/i,evening:/wiecz/i,night:/noc/i},any:{am:/^am/i,pm:/^pm/i,midnight:/pó(ł|l)n/i,noon:/po(ł|l)/i,morning:/rano/i,afternoon:/po\s*po(ł|l)/i,evening:/wiecz/i,night:/noc/i}},match$c={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$c,parsePattern:parseOrdinalNumberPattern$c,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$c,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$c,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$c,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$c,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$c,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$c,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$c,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$c,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$c,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$c,defaultParseWidth:"any"})},pl={code:"pl",formatDistance:formatDistance$c,formatLong:formatLong$c,formatRelative:formatRelative$c,localize:localize$c,match:match$c,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$b={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"aproximadamente 1 hora",other:"aproximadamente {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"aproximadamente 1 semana",other:"aproximadamente {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"aproximadamente 1 mês",other:"aproximadamente {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"aproximadamente 1 ano",other:"aproximadamente {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},formatDistance$b=(s,e,t)=>{let i;const n=formatDistanceLocale$b[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"daqui a "+i:"há "+i:i},dateFormats$b={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d 'de' MMM 'de' y",short:"dd/MM/y"},timeFormats$b={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$b={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$b={date:buildFormatLongFn({formats:dateFormats$b,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$b,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$b,defaultWidth:"full"})},formatRelativeLocale$b={lastWeek:s=>{const e=s.getDay();return"'"+(e===0||e===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},formatRelative$b=(s,e,t,i)=>{const n=formatRelativeLocale$b[s];return typeof n=="function"?n(e):n},eraValues$b={narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["antes de Cristo","depois de Cristo"]},quarterValues$b={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},monthValues$b={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},dayValues$b={narrow:["d","s","t","q","q","s","s"],short:["dom","seg","ter","qua","qui","sex","sáb"],abbreviated:["dom","seg","ter","qua","qui","sex","sáb"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},dayPeriodValues$b={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"}},formattingDayPeriodValues$b={narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"}},ordinalNumber$b=(s,e)=>Number(s)+"º",localize$b={ordinalNumber:ordinalNumber$b,era:buildLocalizeFn({values:eraValues$b,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$b,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$b,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$b,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$b,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$b,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$b=/^(\d+)(º|ª)?/i,parseOrdinalNumberPattern$b=/\d+/i,matchEraPatterns$b={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes da era comum|depois de cristo|era comum)/i},parseEraPatterns$b={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes da era comum)/i,/^(depois de cristo|era comum)/i]},matchQuarterPatterns$b={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º|ª)? trimestre/i},parseQuarterPatterns$b={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$b={narrow:/^[jfmasond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},parseMonthPatterns$b={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ab/i,/^mai/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$b={narrow:/^[dstq]/i,short:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,wide:/^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i},parseDayPatterns$b={narrow:[/^d/i,/^s/i,/^t/i,/^q/i,/^q/i,/^s/i,/^s/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[áa]/i]},matchDayPeriodPatterns$b={narrow:/^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,any:/^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i},parseDayPeriodPatterns$b={any:{am:/^a/i,pm:/^p/i,midnight:/^meia/i,noon:/^meio/i,morning:/manh[ãa]/i,afternoon:/tarde/i,evening:/noite/i,night:/madrugada/i}},match$b={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$b,parsePattern:parseOrdinalNumberPattern$b,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$b,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$b,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$b,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$b,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$b,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$b,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$b,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$b,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$b,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$b,defaultParseWidth:"any"})},pt={code:"pt",formatDistance:formatDistance$b,formatLong:formatLong$b,formatRelative:formatRelative$b,localize:localize$b,match:match$b,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$a={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},formatDistance$a=(s,e,t)=>{let i;const n=formatDistanceLocale$a[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"em "+i:"há "+i:i},dateFormats$a={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},timeFormats$a={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$a={full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$a={date:buildFormatLongFn({formats:dateFormats$a,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$a,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$a,defaultWidth:"full"})},formatRelativeLocale$a={lastWeek:s=>{const e=s.getDay();return"'"+(e===0||e===6?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},formatRelative$a=(s,e,t,i)=>{const n=formatRelativeLocale$a[s];return typeof n=="function"?n(e):n},eraValues$a={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},quarterValues$a={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},monthValues$a={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},dayValues$a={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},dayPeriodValues$a={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},formattingDayPeriodValues$a={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},ordinalNumber$a=(s,e)=>{const t=Number(s);return(e==null?void 0:e.unit)==="week"?t+"ª":t+"º"},localize$a={ordinalNumber:ordinalNumber$a,era:buildLocalizeFn({values:eraValues$a,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$a,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$a,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$a,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$a,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$a,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$a=/^(\d+)[ºªo]?/i,parseOrdinalNumberPattern$a=/\d+/i,matchEraPatterns$a={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},parseEraPatterns$a={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},matchQuarterPatterns$a={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},parseQuarterPatterns$a={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$a={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},parseMonthPatterns$a={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},matchDayPatterns$a={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},parseDayPatterns$a={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},matchDayPeriodPatterns$a={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},parseDayPeriodPatterns$a={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},match$a={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$a,parsePattern:parseOrdinalNumberPattern$a,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$a,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$a,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$a,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$a,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$a,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$a,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$a,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$a,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$a,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$a,defaultParseWidth:"any"})},ptBR={code:"pt-BR",formatDistance:formatDistance$a,formatLong:formatLong$a,formatRelative:formatRelative$a,localize:localize$a,match:match$a,options:{weekStartsOn:0,firstWeekContainsDate:1}},formatDistanceLocale$9={lessThanXSeconds:{one:"mai puțin de o secundă",other:"mai puțin de {{count}} secunde"},xSeconds:{one:"1 secundă",other:"{{count}} secunde"},halfAMinute:"jumătate de minut",lessThanXMinutes:{one:"mai puțin de un minut",other:"mai puțin de {{count}} minute"},xMinutes:{one:"1 minut",other:"{{count}} minute"},aboutXHours:{one:"circa 1 oră",other:"circa {{count}} ore"},xHours:{one:"1 oră",other:"{{count}} ore"},xDays:{one:"1 zi",other:"{{count}} zile"},aboutXWeeks:{one:"circa o săptămână",other:"circa {{count}} săptămâni"},xWeeks:{one:"1 săptămână",other:"{{count}} săptămâni"},aboutXMonths:{one:"circa 1 lună",other:"circa {{count}} luni"},xMonths:{one:"1 lună",other:"{{count}} luni"},aboutXYears:{one:"circa 1 an",other:"circa {{count}} ani"},xYears:{one:"1 an",other:"{{count}} ani"},overXYears:{one:"peste 1 an",other:"peste {{count}} ani"},almostXYears:{one:"aproape 1 an",other:"aproape {{count}} ani"}},formatDistance$9=(s,e,t)=>{let i;const n=formatDistanceLocale$9[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"în "+i:i+" în urmă":i},dateFormats$9={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"dd.MM.yyyy"},timeFormats$9={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$9={full:"{{date}} 'la' {{time}}",long:"{{date}} 'la' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$9={date:buildFormatLongFn({formats:dateFormats$9,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$9,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$9,defaultWidth:"full"})},formatRelativeLocale$9={lastWeek:"eeee 'trecută la' p",yesterday:"'ieri la' p",today:"'astăzi la' p",tomorrow:"'mâine la' p",nextWeek:"eeee 'viitoare la' p",other:"P"},formatRelative$9=(s,e,t,i)=>formatRelativeLocale$9[s],eraValues$9={narrow:["Î","D"],abbreviated:["Î.d.C.","D.C."],wide:["Înainte de Cristos","După Cristos"]},quarterValues$9={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["primul trimestru","al doilea trimestru","al treilea trimestru","al patrulea trimestru"]},monthValues$9={narrow:["I","F","M","A","M","I","I","A","S","O","N","D"],abbreviated:["ian","feb","mar","apr","mai","iun","iul","aug","sep","oct","noi","dec"],wide:["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"]},dayValues$9={narrow:["d","l","m","m","j","v","s"],short:["du","lu","ma","mi","jo","vi","sâ"],abbreviated:["dum","lun","mar","mie","joi","vin","sâm"],wide:["duminică","luni","marți","miercuri","joi","vineri","sâmbătă"]},dayPeriodValues$9={narrow:{am:"a",pm:"p",midnight:"mn",noon:"ami",morning:"dim",afternoon:"da",evening:"s",night:"n"},abbreviated:{am:"AM",pm:"PM",midnight:"miezul nopții",noon:"amiază",morning:"dimineață",afternoon:"după-amiază",evening:"seară",night:"noapte"},wide:{am:"a.m.",pm:"p.m.",midnight:"miezul nopții",noon:"amiază",morning:"dimineață",afternoon:"după-amiază",evening:"seară",night:"noapte"}},formattingDayPeriodValues$9={narrow:{am:"a",pm:"p",midnight:"mn",noon:"amiază",morning:"dimineață",afternoon:"după-amiază",evening:"seară",night:"noapte"},abbreviated:{am:"AM",pm:"PM",midnight:"miezul nopții",noon:"amiază",morning:"dimineață",afternoon:"după-amiază",evening:"seară",night:"noapte"},wide:{am:"a.m.",pm:"p.m.",midnight:"miezul nopții",noon:"amiază",morning:"dimineață",afternoon:"după-amiază",evening:"seară",night:"noapte"}},ordinalNumber$9=(s,e)=>String(s),localize$9={ordinalNumber:ordinalNumber$9,era:buildLocalizeFn({values:eraValues$9,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$9,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$9,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$9,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$9,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$9,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$9=/^(\d+)?/i,parseOrdinalNumberPattern$9=/\d+/i,matchEraPatterns$9={narrow:/^(Î|D)/i,abbreviated:/^(Î\.?\s?d\.?\s?C\.?|Î\.?\s?e\.?\s?n\.?|D\.?\s?C\.?|e\.?\s?n\.?)/i,wide:/^(Înainte de Cristos|Înaintea erei noastre|După Cristos|Era noastră)/i},parseEraPatterns$9={any:[/^ÎC/i,/^DC/i],wide:[/^(Înainte de Cristos|Înaintea erei noastre)/i,/^(După Cristos|Era noastră)/i]},matchQuarterPatterns$9={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^trimestrul [1234]/i},parseQuarterPatterns$9={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$9={narrow:/^[ifmaasond]/i,abbreviated:/^(ian|feb|mar|apr|mai|iun|iul|aug|sep|oct|noi|dec)/i,wide:/^(ianuarie|februarie|martie|aprilie|mai|iunie|iulie|august|septembrie|octombrie|noiembrie|decembrie)/i},parseMonthPatterns$9={narrow:[/^i/i,/^f/i,/^m/i,/^a/i,/^m/i,/^i/i,/^i/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ia/i,/^f/i,/^mar/i,/^ap/i,/^mai/i,/^iun/i,/^iul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$9={narrow:/^[dlmjvs]/i,short:/^(d|l|ma|mi|j|v|s)/i,abbreviated:/^(dum|lun|mar|mie|jo|vi|sâ)/i,wide:/^(duminica|luni|marţi|miercuri|joi|vineri|sâmbătă)/i},parseDayPatterns$9={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^mi/i,/^j/i,/^v/i,/^s/i]},matchDayPeriodPatterns$9={narrow:/^(a|p|mn|a|(dimineaţa|după-amiaza|seara|noaptea))/i,any:/^([ap]\.?\s?m\.?|miezul nopții|amiaza|(dimineaţa|după-amiaza|seara|noaptea))/i},parseDayPeriodPatterns$9={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/amiaza/i,morning:/dimineaţa/i,afternoon:/după-amiaza/i,evening:/seara/i,night:/noaptea/i}},match$9={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$9,parsePattern:parseOrdinalNumberPattern$9,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$9,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$9,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$9,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$9,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$9,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$9,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$9,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$9,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$9,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$9,defaultParseWidth:"any"})},ro={code:"ro",formatDistance:formatDistance$9,formatLong:formatLong$9,formatRelative:formatRelative$9,localize:localize$9,match:match$9,options:{weekStartsOn:1,firstWeekContainsDate:1}};function declension$2(s,e){if(s.one!==void 0&&e===1)return s.one;const t=e%10,i=e%100;return t===1&&i!==11?s.singularNominative.replace("{{count}}",String(e)):t>=2&&t<=4&&(i<10||i>20)?s.singularGenitive.replace("{{count}}",String(e)):s.pluralGenitive.replace("{{count}}",String(e))}function buildLocalizeTokenFn$1(s){return(e,t)=>t!=null&&t.addSuffix?t.comparison&&t.comparison>0?s.future?declension$2(s.future,e):"через "+declension$2(s.regular,e):s.past?declension$2(s.past,e):declension$2(s.regular,e)+" назад":declension$2(s.regular,e)}const formatDistanceLocale$8={lessThanXSeconds:buildLocalizeTokenFn$1({regular:{one:"меньше секунды",singularNominative:"меньше {{count}} секунды",singularGenitive:"меньше {{count}} секунд",pluralGenitive:"меньше {{count}} секунд"},future:{one:"меньше, чем через секунду",singularNominative:"меньше, чем через {{count}} секунду",singularGenitive:"меньше, чем через {{count}} секунды",pluralGenitive:"меньше, чем через {{count}} секунд"}}),xSeconds:buildLocalizeTokenFn$1({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунды",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду назад",singularGenitive:"{{count}} секунды назад",pluralGenitive:"{{count}} секунд назад"},future:{singularNominative:"через {{count}} секунду",singularGenitive:"через {{count}} секунды",pluralGenitive:"через {{count}} секунд"}}),halfAMinute:(s,e)=>e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"через полминуты":"полминуты назад":"полминуты",lessThanXMinutes:buildLocalizeTokenFn$1({regular:{one:"меньше минуты",singularNominative:"меньше {{count}} минуты",singularGenitive:"меньше {{count}} минут",pluralGenitive:"меньше {{count}} минут"},future:{one:"меньше, чем через минуту",singularNominative:"меньше, чем через {{count}} минуту",singularGenitive:"меньше, чем через {{count}} минуты",pluralGenitive:"меньше, чем через {{count}} минут"}}),xMinutes:buildLocalizeTokenFn$1({regular:{singularNominative:"{{count}} минута",singularGenitive:"{{count}} минуты",pluralGenitive:"{{count}} минут"},past:{singularNominative:"{{count}} минуту назад",singularGenitive:"{{count}} минуты назад",pluralGenitive:"{{count}} минут назад"},future:{singularNominative:"через {{count}} минуту",singularGenitive:"через {{count}} минуты",pluralGenitive:"через {{count}} минут"}}),aboutXHours:buildLocalizeTokenFn$1({regular:{singularNominative:"около {{count}} часа",singularGenitive:"около {{count}} часов",pluralGenitive:"около {{count}} часов"},future:{singularNominative:"приблизительно через {{count}} час",singularGenitive:"приблизительно через {{count}} часа",pluralGenitive:"приблизительно через {{count}} часов"}}),xHours:buildLocalizeTokenFn$1({regular:{singularNominative:"{{count}} час",singularGenitive:"{{count}} часа",pluralGenitive:"{{count}} часов"}}),xDays:buildLocalizeTokenFn$1({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} дня",pluralGenitive:"{{count}} дней"}}),aboutXWeeks:buildLocalizeTokenFn$1({regular:{singularNominative:"около {{count}} недели",singularGenitive:"около {{count}} недель",pluralGenitive:"около {{count}} недель"},future:{singularNominative:"приблизительно через {{count}} неделю",singularGenitive:"приблизительно через {{count}} недели",pluralGenitive:"приблизительно через {{count}} недель"}}),xWeeks:buildLocalizeTokenFn$1({regular:{singularNominative:"{{count}} неделя",singularGenitive:"{{count}} недели",pluralGenitive:"{{count}} недель"}}),aboutXMonths:buildLocalizeTokenFn$1({regular:{singularNominative:"около {{count}} месяца",singularGenitive:"около {{count}} месяцев",pluralGenitive:"около {{count}} месяцев"},future:{singularNominative:"приблизительно через {{count}} месяц",singularGenitive:"приблизительно через {{count}} месяца",pluralGenitive:"приблизительно через {{count}} месяцев"}}),xMonths:buildLocalizeTokenFn$1({regular:{singularNominative:"{{count}} месяц",singularGenitive:"{{count}} месяца",pluralGenitive:"{{count}} месяцев"}}),aboutXYears:buildLocalizeTokenFn$1({regular:{singularNominative:"около {{count}} года",singularGenitive:"около {{count}} лет",pluralGenitive:"около {{count}} лет"},future:{singularNominative:"приблизительно через {{count}} год",singularGenitive:"приблизительно через {{count}} года",pluralGenitive:"приблизительно через {{count}} лет"}}),xYears:buildLocalizeTokenFn$1({regular:{singularNominative:"{{count}} год",singularGenitive:"{{count}} года",pluralGenitive:"{{count}} лет"}}),overXYears:buildLocalizeTokenFn$1({regular:{singularNominative:"больше {{count}} года",singularGenitive:"больше {{count}} лет",pluralGenitive:"больше {{count}} лет"},future:{singularNominative:"больше, чем через {{count}} год",singularGenitive:"больше, чем через {{count}} года",pluralGenitive:"больше, чем через {{count}} лет"}}),almostXYears:buildLocalizeTokenFn$1({regular:{singularNominative:"почти {{count}} год",singularGenitive:"почти {{count}} года",pluralGenitive:"почти {{count}} лет"},future:{singularNominative:"почти через {{count}} год",singularGenitive:"почти через {{count}} года",pluralGenitive:"почти через {{count}} лет"}})},formatDistance$8=(s,e,t)=>formatDistanceLocale$8[s](e,t),dateFormats$8={full:"EEEE, d MMMM y 'г.'",long:"d MMMM y 'г.'",medium:"d MMM y 'г.'",short:"dd.MM.y"},timeFormats$8={full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},dateTimeFormats$8={any:"{{date}}, {{time}}"},formatLong$8={date:buildFormatLongFn({formats:dateFormats$8,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$8,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$8,defaultWidth:"any"})},accusativeWeekdays$2=["воскресенье","понедельник","вторник","среду","четверг","пятницу","субботу"];function lastWeek$2(s){const e=accusativeWeekdays$2[s];switch(s){case 0:return"'в прошлое "+e+" в' p";case 1:case 2:case 4:return"'в прошлый "+e+" в' p";case 3:case 5:case 6:return"'в прошлую "+e+" в' p"}}function thisWeek$2(s){const e=accusativeWeekdays$2[s];return s===2?"'во "+e+" в' p":"'в "+e+" в' p"}function nextWeek$2(s){const e=accusativeWeekdays$2[s];switch(s){case 0:return"'в следующее "+e+" в' p";case 1:case 2:case 4:return"'в следующий "+e+" в' p";case 3:case 5:case 6:return"'в следующую "+e+" в' p"}}const formatRelativeLocale$8={lastWeek:(s,e,t)=>{const i=s.getDay();return isSameWeek(s,e,t)?thisWeek$2(i):lastWeek$2(i)},yesterday:"'вчера в' p",today:"'сегодня в' p",tomorrow:"'завтра в' p",nextWeek:(s,e,t)=>{const i=s.getDay();return isSameWeek(s,e,t)?thisWeek$2(i):nextWeek$2(i)},other:"P"},formatRelative$8=(s,e,t,i)=>{const n=formatRelativeLocale$8[s];return typeof n=="function"?n(e,t,i):n},eraValues$8={narrow:["до н.э.","н.э."],abbreviated:["до н. э.","н. э."],wide:["до нашей эры","нашей эры"]},quarterValues$8={narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},monthValues$8={narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","март","апр.","май","июнь","июль","авг.","сент.","окт.","нояб.","дек."],wide:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"]},formattingMonthValues$3={narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],wide:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"]},dayValues$8={narrow:["В","П","В","С","Ч","П","С"],short:["вс","пн","вт","ср","чт","пт","сб"],abbreviated:["вск","пнд","втр","срд","чтв","птн","суб"],wide:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"]},dayPeriodValues$8={narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утро",afternoon:"день",evening:"вечер",night:"ночь"}},formattingDayPeriodValues$8={narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утра",afternoon:"дня",evening:"вечера",night:"ночи"}},ordinalNumber$8=(s,e)=>{const t=Number(s),i=e==null?void 0:e.unit;let n;return i==="date"?n="-е":i==="week"||i==="minute"||i==="second"?n="-я":n="-й",t+n},localize$8={ordinalNumber:ordinalNumber$8,era:buildLocalizeFn({values:eraValues$8,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$8,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$8,defaultWidth:"wide",formattingValues:formattingMonthValues$3,defaultFormattingWidth:"wide"}),day:buildLocalizeFn({values:dayValues$8,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$8,defaultWidth:"any",formattingValues:formattingDayPeriodValues$8,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$8=/^(\d+)(-?(е|я|й|ое|ье|ая|ья|ый|ой|ий|ый))?/i,parseOrdinalNumberPattern$8=/\d+/i,matchEraPatterns$8={narrow:/^((до )?н\.?\s?э\.?)/i,abbreviated:/^((до )?н\.?\s?э\.?)/i,wide:/^(до нашей эры|нашей эры|наша эра)/i},parseEraPatterns$8={any:[/^д/i,/^н/i]},matchQuarterPatterns$8={narrow:/^[1234]/i,abbreviated:/^[1234](-?[ыои]?й?)? кв.?/i,wide:/^[1234](-?[ыои]?й?)? квартал/i},parseQuarterPatterns$8={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$8={narrow:/^[яфмаисонд]/i,abbreviated:/^(янв|фев|март?|апр|ма[йя]|июн[ья]?|июл[ья]?|авг|сент?|окт|нояб?|дек)\.?/i,wide:/^(январ[ья]|феврал[ья]|марта?|апрел[ья]|ма[йя]|июн[ья]|июл[ья]|августа?|сентябр[ья]|октябр[ья]|октябр[ья]|ноябр[ья]|декабр[ья])/i},parseMonthPatterns$8={narrow:[/^я/i,/^ф/i,/^м/i,/^а/i,/^м/i,/^и/i,/^и/i,/^а/i,/^с/i,/^о/i,/^н/i,/^я/i],any:[/^я/i,/^ф/i,/^мар/i,/^ап/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^ав/i,/^с/i,/^о/i,/^н/i,/^д/i]},matchDayPatterns$8={narrow:/^[впсч]/i,short:/^(вс|во|пн|по|вт|ср|чт|че|пт|пя|сб|су)\.?/i,abbreviated:/^(вск|вос|пнд|пон|втр|вто|срд|сре|чтв|чет|птн|пят|суб).?/i,wide:/^(воскресень[ея]|понедельника?|вторника?|сред[аы]|четверга?|пятниц[аы]|суббот[аы])/i},parseDayPatterns$8={narrow:[/^в/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^в[ос]/i,/^п[он]/i,/^в/i,/^ср/i,/^ч/i,/^п[ят]/i,/^с[уб]/i]},matchDayPeriodPatterns$8={narrow:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,abbreviated:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,wide:/^([дп]п|полночь|полдень|утр[оа]|день|дня|вечера?|ноч[ьи])/i},parseDayPeriodPatterns$8={any:{am:/^дп/i,pm:/^пп/i,midnight:/^полн/i,noon:/^полд/i,morning:/^у/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},match$8={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$8,parsePattern:parseOrdinalNumberPattern$8,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$8,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$8,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$8,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$8,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$8,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$8,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$8,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$8,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$8,defaultMatchWidth:"wide",parsePatterns:parseDayPeriodPatterns$8,defaultParseWidth:"any"})},ru={code:"ru",formatDistance:formatDistance$8,formatLong:formatLong$8,formatRelative:formatRelative$8,localize:localize$8,match:match$8,options:{weekStartsOn:1,firstWeekContainsDate:1}};function declensionGroup(s,e){return e===1&&s.one?s.one:e>=2&&e<=4&&s.twoFour?s.twoFour:s.other}function declension$1(s,e,t){return declensionGroup(s,e)[t].replace("{{count}}",String(e))}function extractPreposition(s){return["lessThan","about","over","almost"].filter(function(t){return!!s.match(new RegExp("^"+t))})[0]}function prefixPreposition(s){let e="";return s==="almost"&&(e="takmer"),s==="about"&&(e="približne"),e.length>0?e+" ":""}function suffixPreposition(s){let e="";return s==="lessThan"&&(e="menej než"),s==="over"&&(e="viac než"),e.length>0?e+" ":""}function lowercaseFirstLetter(s){return s.charAt(0).toLowerCase()+s.slice(1)}const formatDistanceLocale$7={xSeconds:{one:{present:"sekunda",past:"sekundou",future:"sekundu"},twoFour:{present:"{{count}} sekundy",past:"{{count}} sekundami",future:"{{count}} sekundy"},other:{present:"{{count}} sekúnd",past:"{{count}} sekundami",future:"{{count}} sekúnd"}},halfAMinute:{other:{present:"pol minúty",past:"pol minútou",future:"pol minúty"}},xMinutes:{one:{present:"minúta",past:"minútou",future:"minútu"},twoFour:{present:"{{count}} minúty",past:"{{count}} minútami",future:"{{count}} minúty"},other:{present:"{{count}} minút",past:"{{count}} minútami",future:"{{count}} minút"}},xHours:{one:{present:"hodina",past:"hodinou",future:"hodinu"},twoFour:{present:"{{count}} hodiny",past:"{{count}} hodinami",future:"{{count}} hodiny"},other:{present:"{{count}} hodín",past:"{{count}} hodinami",future:"{{count}} hodín"}},xDays:{one:{present:"deň",past:"dňom",future:"deň"},twoFour:{present:"{{count}} dni",past:"{{count}} dňami",future:"{{count}} dni"},other:{present:"{{count}} dní",past:"{{count}} dňami",future:"{{count}} dní"}},xWeeks:{one:{present:"týždeň",past:"týždňom",future:"týždeň"},twoFour:{present:"{{count}} týždne",past:"{{count}} týždňami",future:"{{count}} týždne"},other:{present:"{{count}} týždňov",past:"{{count}} týždňami",future:"{{count}} týždňov"}},xMonths:{one:{present:"mesiac",past:"mesiacom",future:"mesiac"},twoFour:{present:"{{count}} mesiace",past:"{{count}} mesiacmi",future:"{{count}} mesiace"},other:{present:"{{count}} mesiacov",past:"{{count}} mesiacmi",future:"{{count}} mesiacov"}},xYears:{one:{present:"rok",past:"rokom",future:"rok"},twoFour:{present:"{{count}} roky",past:"{{count}} rokmi",future:"{{count}} roky"},other:{present:"{{count}} rokov",past:"{{count}} rokmi",future:"{{count}} rokov"}}},formatDistance$7=(s,e,t)=>{const i=extractPreposition(s)||"",n=lowercaseFirstLetter(s.substring(i.length)),o=formatDistanceLocale$7[n];return t!=null&&t.addSuffix?t.comparison&&t.comparison>0?prefixPreposition(i)+"o "+suffixPreposition(i)+declension$1(o,e,"future"):prefixPreposition(i)+"pred "+suffixPreposition(i)+declension$1(o,e,"past"):prefixPreposition(i)+suffixPreposition(i)+declension$1(o,e,"present")},dateFormats$7={full:"EEEE d. MMMM y",long:"d. MMMM y",medium:"d. M. y",short:"d. M. y"},timeFormats$7={full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},dateTimeFormats$7={full:"{{date}}, {{time}}",long:"{{date}}, {{time}}",medium:"{{date}}, {{time}}",short:"{{date}} {{time}}"},formatLong$7={date:buildFormatLongFn({formats:dateFormats$7,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$7,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$7,defaultWidth:"full"})},accusativeWeekdays$1=["nedeľu","pondelok","utorok","stredu","štvrtok","piatok","sobotu"];function lastWeek$1(s){const e=accusativeWeekdays$1[s];switch(s){case 0:case 3:case 6:return"'minulú "+e+" o' p";default:return"'minulý' eeee 'o' p"}}function thisWeek$1(s){const e=accusativeWeekdays$1[s];return s===4?"'vo' eeee 'o' p":"'v "+e+" o' p"}function nextWeek$1(s){const e=accusativeWeekdays$1[s];switch(s){case 0:case 4:case 6:return"'budúcu "+e+" o' p";default:return"'budúci' eeee 'o' p"}}const formatRelativeLocale$7={lastWeek:(s,e,t)=>{const i=s.getDay();return isSameWeek(s,e,t)?thisWeek$1(i):lastWeek$1(i)},yesterday:"'včera o' p",today:"'dnes o' p",tomorrow:"'zajtra o' p",nextWeek:(s,e,t)=>{const i=s.getDay();return isSameWeek(s,e,t)?thisWeek$1(i):nextWeek$1(i)},other:"P"},formatRelative$7=(s,e,t,i)=>{const n=formatRelativeLocale$7[s];return typeof n=="function"?n(e,t,i):n},eraValues$7={narrow:["pred Kr.","po Kr."],abbreviated:["pred Kr.","po Kr."],wide:["pred Kristom","po Kristovi"]},quarterValues$7={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. štvrťrok","2. štvrťrok","3. štvrťrok","4. štvrťrok"]},monthValues$7={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],wide:["január","február","marec","apríl","máj","jún","júl","august","september","október","november","december"]},formattingMonthValues$2={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","feb","mar","apr","máj","jún","júl","aug","sep","okt","nov","dec"],wide:["januára","februára","marca","apríla","mája","júna","júla","augusta","septembra","októbra","novembra","decembra"]},dayValues$7={narrow:["n","p","u","s","š","p","s"],short:["ne","po","ut","st","št","pi","so"],abbreviated:["ne","po","ut","st","št","pi","so"],wide:["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"]},dayPeriodValues$7={narrow:{am:"AM",pm:"PM",midnight:"poln.",noon:"pol.",morning:"ráno",afternoon:"pop.",evening:"več.",night:"noc"},abbreviated:{am:"AM",pm:"PM",midnight:"poln.",noon:"pol.",morning:"ráno",afternoon:"popol.",evening:"večer",night:"noc"},wide:{am:"AM",pm:"PM",midnight:"polnoc",noon:"poludnie",morning:"ráno",afternoon:"popoludnie",evening:"večer",night:"noc"}},formattingDayPeriodValues$7={narrow:{am:"AM",pm:"PM",midnight:"o poln.",noon:"nap.",morning:"ráno",afternoon:"pop.",evening:"več.",night:"v n."},abbreviated:{am:"AM",pm:"PM",midnight:"o poln.",noon:"napol.",morning:"ráno",afternoon:"popol.",evening:"večer",night:"v noci"},wide:{am:"AM",pm:"PM",midnight:"o polnoci",noon:"napoludnie",morning:"ráno",afternoon:"popoludní",evening:"večer",night:"v noci"}},ordinalNumber$7=(s,e)=>Number(s)+".",localize$7={ordinalNumber:ordinalNumber$7,era:buildLocalizeFn({values:eraValues$7,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$7,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$7,defaultWidth:"wide",formattingValues:formattingMonthValues$2,defaultFormattingWidth:"wide"}),day:buildLocalizeFn({values:dayValues$7,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$7,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$7,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$7=/^(\d+)\.?/i,parseOrdinalNumberPattern$7=/\d+/i,matchEraPatterns$7={narrow:/^(pred Kr\.|pred n\. l\.|po Kr\.|n\. l\.)/i,abbreviated:/^(pred Kr\.|pred n\. l\.|po Kr\.|n\. l\.)/i,wide:/^(pred Kristom|pred na[šs][íi]m letopo[čc]tom|po Kristovi|n[áa][šs]ho letopo[čc]tu)/i},parseEraPatterns$7={any:[/^pr/i,/^(po|n)/i]},matchQuarterPatterns$7={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234]\. [šs]tvr[ťt]rok/i},parseQuarterPatterns$7={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$7={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|m[áa]j|j[úu]n|j[úu]l|aug|sep|okt|nov|dec)/i,wide:/^(janu[áa]ra?|febru[áa]ra?|(marec|marca)|apr[íi]la?|m[áa]ja?|j[úu]na?|j[úu]la?|augusta?|(september|septembra)|(okt[óo]ber|okt[óo]bra)|(november|novembra)|(december|decembra))/i},parseMonthPatterns$7={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^m[áa]j/i,/^j[úu]n/i,/^j[úu]l/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$7={narrow:/^[npusšp]/i,short:/^(ne|po|ut|st|št|pi|so)/i,abbreviated:/^(ne|po|ut|st|št|pi|so)/i,wide:/^(nede[ľl]a|pondelok|utorok|streda|[šs]tvrtok|piatok|sobota])/i},parseDayPatterns$7={narrow:[/^n/i,/^p/i,/^u/i,/^s/i,/^š/i,/^p/i,/^s/i],any:[/^n/i,/^po/i,/^u/i,/^st/i,/^(št|stv)/i,/^pi/i,/^so/i]},matchDayPeriodPatterns$7={narrow:/^(am|pm|(o )?poln\.?|(nap\.?|pol\.?)|r[áa]no|pop\.?|ve[čc]\.?|(v n\.?|noc))/i,abbreviated:/^(am|pm|(o )?poln\.?|(napol\.?|pol\.?)|r[áa]no|pop\.?|ve[čc]er|(v )?noci?)/i,any:/^(am|pm|(o )?polnoci?|(na)?poludnie|r[áa]no|popoludn(ie|í|i)|ve[čc]er|(v )?noci?)/i},parseDayPeriodPatterns$7={any:{am:/^am/i,pm:/^pm/i,midnight:/poln/i,noon:/^(nap|(na)?pol(\.|u))/i,morning:/^r[áa]no/i,afternoon:/^pop/i,evening:/^ve[čc]/i,night:/^(noc|v n\.)/i}},match$7={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$7,parsePattern:parseOrdinalNumberPattern$7,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$7,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$7,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$7,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$7,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$7,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$7,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$7,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$7,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$7,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$7,defaultParseWidth:"any"})},sk={code:"sk",formatDistance:formatDistance$7,formatLong:formatLong$7,formatRelative:formatRelative$7,localize:localize$7,match:match$7,options:{weekStartsOn:1,firstWeekContainsDate:4}};function isPluralType(s){return s.one!==void 0}const formatDistanceLocale$6={lessThanXSeconds:{present:{one:"manj kot {{count}} sekunda",two:"manj kot {{count}} sekundi",few:"manj kot {{count}} sekunde",other:"manj kot {{count}} sekund"},past:{one:"manj kot {{count}} sekundo",two:"manj kot {{count}} sekundama",few:"manj kot {{count}} sekundami",other:"manj kot {{count}} sekundami"},future:{one:"manj kot {{count}} sekundo",two:"manj kot {{count}} sekundi",few:"manj kot {{count}} sekunde",other:"manj kot {{count}} sekund"}},xSeconds:{present:{one:"{{count}} sekunda",two:"{{count}} sekundi",few:"{{count}} sekunde",other:"{{count}} sekund"},past:{one:"{{count}} sekundo",two:"{{count}} sekundama",few:"{{count}} sekundami",other:"{{count}} sekundami"},future:{one:"{{count}} sekundo",two:"{{count}} sekundi",few:"{{count}} sekunde",other:"{{count}} sekund"}},halfAMinute:"pol minute",lessThanXMinutes:{present:{one:"manj kot {{count}} minuta",two:"manj kot {{count}} minuti",few:"manj kot {{count}} minute",other:"manj kot {{count}} minut"},past:{one:"manj kot {{count}} minuto",two:"manj kot {{count}} minutama",few:"manj kot {{count}} minutami",other:"manj kot {{count}} minutami"},future:{one:"manj kot {{count}} minuto",two:"manj kot {{count}} minuti",few:"manj kot {{count}} minute",other:"manj kot {{count}} minut"}},xMinutes:{present:{one:"{{count}} minuta",two:"{{count}} minuti",few:"{{count}} minute",other:"{{count}} minut"},past:{one:"{{count}} minuto",two:"{{count}} minutama",few:"{{count}} minutami",other:"{{count}} minutami"},future:{one:"{{count}} minuto",two:"{{count}} minuti",few:"{{count}} minute",other:"{{count}} minut"}},aboutXHours:{present:{one:"približno {{count}} ura",two:"približno {{count}} uri",few:"približno {{count}} ure",other:"približno {{count}} ur"},past:{one:"približno {{count}} uro",two:"približno {{count}} urama",few:"približno {{count}} urami",other:"približno {{count}} urami"},future:{one:"približno {{count}} uro",two:"približno {{count}} uri",few:"približno {{count}} ure",other:"približno {{count}} ur"}},xHours:{present:{one:"{{count}} ura",two:"{{count}} uri",few:"{{count}} ure",other:"{{count}} ur"},past:{one:"{{count}} uro",two:"{{count}} urama",few:"{{count}} urami",other:"{{count}} urami"},future:{one:"{{count}} uro",two:"{{count}} uri",few:"{{count}} ure",other:"{{count}} ur"}},xDays:{present:{one:"{{count}} dan",two:"{{count}} dni",few:"{{count}} dni",other:"{{count}} dni"},past:{one:"{{count}} dnem",two:"{{count}} dnevoma",few:"{{count}} dnevi",other:"{{count}} dnevi"},future:{one:"{{count}} dan",two:"{{count}} dni",few:"{{count}} dni",other:"{{count}} dni"}},aboutXWeeks:{one:"približno {{count}} teden",two:"približno {{count}} tedna",few:"približno {{count}} tedne",other:"približno {{count}} tednov"},xWeeks:{one:"{{count}} teden",two:"{{count}} tedna",few:"{{count}} tedne",other:"{{count}} tednov"},aboutXMonths:{present:{one:"približno {{count}} mesec",two:"približno {{count}} meseca",few:"približno {{count}} mesece",other:"približno {{count}} mesecev"},past:{one:"približno {{count}} mesecem",two:"približno {{count}} mesecema",few:"približno {{count}} meseci",other:"približno {{count}} meseci"},future:{one:"približno {{count}} mesec",two:"približno {{count}} meseca",few:"približno {{count}} mesece",other:"približno {{count}} mesecev"}},xMonths:{present:{one:"{{count}} mesec",two:"{{count}} meseca",few:"{{count}} meseci",other:"{{count}} mesecev"},past:{one:"{{count}} mesecem",two:"{{count}} mesecema",few:"{{count}} meseci",other:"{{count}} meseci"},future:{one:"{{count}} mesec",two:"{{count}} meseca",few:"{{count}} mesece",other:"{{count}} mesecev"}},aboutXYears:{present:{one:"približno {{count}} leto",two:"približno {{count}} leti",few:"približno {{count}} leta",other:"približno {{count}} let"},past:{one:"približno {{count}} letom",two:"približno {{count}} letoma",few:"približno {{count}} leti",other:"približno {{count}} leti"},future:{one:"približno {{count}} leto",two:"približno {{count}} leti",few:"približno {{count}} leta",other:"približno {{count}} let"}},xYears:{present:{one:"{{count}} leto",two:"{{count}} leti",few:"{{count}} leta",other:"{{count}} let"},past:{one:"{{count}} letom",two:"{{count}} letoma",few:"{{count}} leti",other:"{{count}} leti"},future:{one:"{{count}} leto",two:"{{count}} leti",few:"{{count}} leta",other:"{{count}} let"}},overXYears:{present:{one:"več kot {{count}} leto",two:"več kot {{count}} leti",few:"več kot {{count}} leta",other:"več kot {{count}} let"},past:{one:"več kot {{count}} letom",two:"več kot {{count}} letoma",few:"več kot {{count}} leti",other:"več kot {{count}} leti"},future:{one:"več kot {{count}} leto",two:"več kot {{count}} leti",few:"več kot {{count}} leta",other:"več kot {{count}} let"}},almostXYears:{present:{one:"skoraj {{count}} leto",two:"skoraj {{count}} leti",few:"skoraj {{count}} leta",other:"skoraj {{count}} let"},past:{one:"skoraj {{count}} letom",two:"skoraj {{count}} letoma",few:"skoraj {{count}} leti",other:"skoraj {{count}} leti"},future:{one:"skoraj {{count}} leto",two:"skoraj {{count}} leti",few:"skoraj {{count}} leta",other:"skoraj {{count}} let"}}};function getFormFromCount(s){switch(s%100){case 1:return"one";case 2:return"two";case 3:case 4:return"few";default:return"other"}}const formatDistance$6=(s,e,t)=>{let i="",n="present";t!=null&&t.addSuffix&&(t.comparison&&t.comparison>0?(n="future",i="čez "):(n="past",i="pred "));const o=formatDistanceLocale$6[s];if(typeof o=="string")i+=o;else{const r=getFormFromCount(e);isPluralType(o)?i+=o[r].replace("{{count}}",String(e)):i+=o[n][r].replace("{{count}}",String(e))}return i},dateFormats$6={full:"EEEE, dd. MMMM y",long:"dd. MMMM y",medium:"d. MMM y",short:"d. MM. yy"},timeFormats$6={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$6={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$6={date:buildFormatLongFn({formats:dateFormats$6,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$6,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$6,defaultWidth:"full"})},formatRelativeLocale$6={lastWeek:s=>{switch(s.getDay()){case 0:return"'prejšnjo nedeljo ob' p";case 3:return"'prejšnjo sredo ob' p";case 6:return"'prejšnjo soboto ob' p";default:return"'prejšnji' EEEE 'ob' p"}},yesterday:"'včeraj ob' p",today:"'danes ob' p",tomorrow:"'jutri ob' p",nextWeek:s=>{switch(s.getDay()){case 0:return"'naslednjo nedeljo ob' p";case 3:return"'naslednjo sredo ob' p";case 6:return"'naslednjo soboto ob' p";default:return"'naslednji' EEEE 'ob' p"}},other:"P"},formatRelative$6=(s,e,t,i)=>{const n=formatRelativeLocale$6[s];return typeof n=="function"?n(e):n},eraValues$6={narrow:["pr. n. št.","po n. št."],abbreviated:["pr. n. št.","po n. št."],wide:["pred našim štetjem","po našem štetju"]},quarterValues$6={narrow:["1","2","3","4"],abbreviated:["1. čet.","2. čet.","3. čet.","4. čet."],wide:["1. četrtletje","2. četrtletje","3. četrtletje","4. četrtletje"]},monthValues$6={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan.","feb.","mar.","apr.","maj","jun.","jul.","avg.","sep.","okt.","nov.","dec."],wide:["januar","februar","marec","april","maj","junij","julij","avgust","september","oktober","november","december"]},dayValues$6={narrow:["n","p","t","s","č","p","s"],short:["ned.","pon.","tor.","sre.","čet.","pet.","sob."],abbreviated:["ned.","pon.","tor.","sre.","čet.","pet.","sob."],wide:["nedelja","ponedeljek","torek","sreda","četrtek","petek","sobota"]},dayPeriodValues$6={narrow:{am:"d",pm:"p",midnight:"24.00",noon:"12.00",morning:"j",afternoon:"p",evening:"v",night:"n"},abbreviated:{am:"dop.",pm:"pop.",midnight:"poln.",noon:"pold.",morning:"jut.",afternoon:"pop.",evening:"več.",night:"noč"},wide:{am:"dop.",pm:"pop.",midnight:"polnoč",noon:"poldne",morning:"jutro",afternoon:"popoldne",evening:"večer",night:"noč"}},formattingDayPeriodValues$6={narrow:{am:"d",pm:"p",midnight:"24.00",noon:"12.00",morning:"zj",afternoon:"p",evening:"zv",night:"po"},abbreviated:{am:"dop.",pm:"pop.",midnight:"opoln.",noon:"opold.",morning:"zjut.",afternoon:"pop.",evening:"zveč.",night:"ponoči"},wide:{am:"dop.",pm:"pop.",midnight:"opolnoči",noon:"opoldne",morning:"zjutraj",afternoon:"popoldan",evening:"zvečer",night:"ponoči"}},ordinalNumber$6=(s,e)=>Number(s)+".",localize$6={ordinalNumber:ordinalNumber$6,era:buildLocalizeFn({values:eraValues$6,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$6,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$6,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$6,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$6,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$6,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$6=/^(\d+)\./i,parseOrdinalNumberPattern$6=/\d+/i,matchEraPatterns$6={abbreviated:/^(pr\. n\. št\.|po n\. št\.)/i,wide:/^(pred Kristusom|pred na[sš]im [sš]tetjem|po Kristusu|po na[sš]em [sš]tetju|na[sš]ega [sš]tetja)/i},parseEraPatterns$6={any:[/^pr/i,/^(po|na[sš]em)/i]},matchQuarterPatterns$6={narrow:/^[1234]/i,abbreviated:/^[1234]\.\s?[čc]et\.?/i,wide:/^[1234]\. [čc]etrtletje/i},parseQuarterPatterns$6={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$6={narrow:/^[jfmasond]/i,abbreviated:/^(jan\.|feb\.|mar\.|apr\.|maj|jun\.|jul\.|avg\.|sep\.|okt\.|nov\.|dec\.)/i,wide:/^(januar|februar|marec|april|maj|junij|julij|avgust|september|oktober|november|december)/i},parseMonthPatterns$6={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],abbreviated:[/^ja/i,/^fe/i,/^mar/i,/^ap/i,/^maj/i,/^jun/i,/^jul/i,/^av/i,/^s/i,/^o/i,/^n/i,/^d/i],wide:[/^ja/i,/^fe/i,/^mar/i,/^ap/i,/^maj/i,/^jun/i,/^jul/i,/^av/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$6={narrow:/^[nptsčc]/i,short:/^(ned\.|pon\.|tor\.|sre\.|[cč]et\.|pet\.|sob\.)/i,abbreviated:/^(ned\.|pon\.|tor\.|sre\.|[cč]et\.|pet\.|sob\.)/i,wide:/^(nedelja|ponedeljek|torek|sreda|[cč]etrtek|petek|sobota)/i},parseDayPatterns$6={narrow:[/^n/i,/^p/i,/^t/i,/^s/i,/^[cč]/i,/^p/i,/^s/i],any:[/^n/i,/^po/i,/^t/i,/^sr/i,/^[cč]/i,/^pe/i,/^so/i]},matchDayPeriodPatterns$6={narrow:/^(d|po?|z?v|n|z?j|24\.00|12\.00)/i,any:/^(dop\.|pop\.|o?poln(\.|o[cč]i?)|o?pold(\.|ne)|z?ve[cč](\.|er)|(po)?no[cč]i?|popold(ne|an)|jut(\.|ro)|zjut(\.|raj))/i},parseDayPeriodPatterns$6={narrow:{am:/^d/i,pm:/^p/i,midnight:/^24/i,noon:/^12/i,morning:/^(z?j)/i,afternoon:/^p/i,evening:/^(z?v)/i,night:/^(n|po)/i},any:{am:/^dop\./i,pm:/^pop\./i,midnight:/^o?poln/i,noon:/^o?pold/i,morning:/j/i,afternoon:/^pop\./i,evening:/^z?ve/i,night:/(po)?no/i}},match$6={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$6,parsePattern:parseOrdinalNumberPattern$6,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$6,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$6,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$6,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$6,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$6,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$6,defaultParseWidth:"wide"}),day:buildMatchFn({matchPatterns:matchDayPatterns$6,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$6,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$6,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$6,defaultParseWidth:"any"})},sl={code:"sl",formatDistance:formatDistance$6,formatLong:formatLong$6,formatRelative:formatRelative$6,localize:localize$6,match:match$6,options:{weekStartsOn:1,firstWeekContainsDate:1}},formatDistanceLocale$5={lessThanXSeconds:{one:"mindre än en sekund",other:"mindre än {{count}} sekunder"},xSeconds:{one:"en sekund",other:"{{count}} sekunder"},halfAMinute:"en halv minut",lessThanXMinutes:{one:"mindre än en minut",other:"mindre än {{count}} minuter"},xMinutes:{one:"en minut",other:"{{count}} minuter"},aboutXHours:{one:"ungefär en timme",other:"ungefär {{count}} timmar"},xHours:{one:"en timme",other:"{{count}} timmar"},xDays:{one:"en dag",other:"{{count}} dagar"},aboutXWeeks:{one:"ungefär en vecka",other:"ungefär {{count}} veckor"},xWeeks:{one:"en vecka",other:"{{count}} veckor"},aboutXMonths:{one:"ungefär en månad",other:"ungefär {{count}} månader"},xMonths:{one:"en månad",other:"{{count}} månader"},aboutXYears:{one:"ungefär ett år",other:"ungefär {{count}} år"},xYears:{one:"ett år",other:"{{count}} år"},overXYears:{one:"över ett år",other:"över {{count}} år"},almostXYears:{one:"nästan ett år",other:"nästan {{count}} år"}},wordMapping=["noll","en","två","tre","fyra","fem","sex","sju","åtta","nio","tio","elva","tolv"],formatDistance$5=(s,e,t)=>{let i;const n=formatDistanceLocale$5[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e<13?wordMapping[e]:String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"om "+i:i+" sedan":i},dateFormats$5={full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"y-MM-dd"},timeFormats$5={full:"'kl'. HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$5={full:"{{date}} 'kl.' {{time}}",long:"{{date}} 'kl.' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$5={date:buildFormatLongFn({formats:dateFormats$5,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$5,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$5,defaultWidth:"full"})},formatRelativeLocale$5={lastWeek:"'i' EEEE's kl.' p",yesterday:"'igår kl.' p",today:"'idag kl.' p",tomorrow:"'imorgon kl.' p",nextWeek:"EEEE 'kl.' p",other:"P"},formatRelative$5=(s,e,t,i)=>formatRelativeLocale$5[s],eraValues$5={narrow:["f.Kr.","e.Kr."],abbreviated:["f.Kr.","e.Kr."],wide:["före Kristus","efter Kristus"]},quarterValues$5={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1:a kvartalet","2:a kvartalet","3:e kvartalet","4:e kvartalet"]},monthValues$5={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],wide:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"]},dayValues$5={narrow:["S","M","T","O","T","F","L"],short:["sö","må","ti","on","to","fr","lö"],abbreviated:["sön","mån","tis","ons","tors","fre","lör"],wide:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"]},dayPeriodValues$5={narrow:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"morg.",afternoon:"efterm.",evening:"kväll",night:"natt"},abbreviated:{am:"f.m.",pm:"e.m.",midnight:"midnatt",noon:"middag",morning:"morgon",afternoon:"efterm.",evening:"kväll",night:"natt"},wide:{am:"förmiddag",pm:"eftermiddag",midnight:"midnatt",noon:"middag",morning:"morgon",afternoon:"eftermiddag",evening:"kväll",night:"natt"}},formattingDayPeriodValues$5={narrow:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på efterm.",evening:"på kvällen",night:"på natten"},abbreviated:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på efterm.",evening:"på kvällen",night:"på natten"},wide:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"på morgonen",afternoon:"på eftermiddagen",evening:"på kvällen",night:"på natten"}},ordinalNumber$5=(s,e)=>{const t=Number(s),i=t%100;if(i>20||i<10)switch(i%10){case 1:case 2:return t+":a"}return t+":e"},localize$5={ordinalNumber:ordinalNumber$5,era:buildLocalizeFn({values:eraValues$5,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$5,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$5,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$5,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$5,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$5,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$5=/^(\d+)(:a|:e)?/i,parseOrdinalNumberPattern$5=/\d+/i,matchEraPatterns$5={narrow:/^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,abbreviated:/^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,wide:/^(före Kristus|före vår tid|efter Kristus|vår tid)/i},parseEraPatterns$5={any:[/^f/i,/^[ev]/i]},matchQuarterPatterns$5={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](:a|:e)? kvartalet/i},parseQuarterPatterns$5={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$5={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar[s]?|apr|maj|jun[i]?|jul[i]?|aug|sep|okt|nov|dec)\.?/i,wide:/^(januari|februari|mars|april|maj|juni|juli|augusti|september|oktober|november|december)/i},parseMonthPatterns$5={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^maj/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns$5={narrow:/^[smtofl]/i,short:/^(sö|må|ti|on|to|fr|lö)/i,abbreviated:/^(sön|mån|tis|ons|tors|fre|lör)/i,wide:/^(söndag|måndag|tisdag|onsdag|torsdag|fredag|lördag)/i},parseDayPatterns$5={any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},matchDayPeriodPatterns$5={any:/^([fe]\.?\s?m\.?|midn(att)?|midd(ag)?|(på) (morgonen|eftermiddagen|kvällen|natten))/i},parseDayPeriodPatterns$5={any:{am:/^f/i,pm:/^e/i,midnight:/^midn/i,noon:/^midd/i,morning:/morgon/i,afternoon:/eftermiddag/i,evening:/kväll/i,night:/natt/i}},match$5={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$5,parsePattern:parseOrdinalNumberPattern$5,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$5,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$5,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$5,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$5,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$5,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$5,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$5,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$5,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$5,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$5,defaultParseWidth:"any"})},sv={code:"sv",formatDistance:formatDistance$5,formatLong:formatLong$5,formatRelative:formatRelative$5,localize:localize$5,match:match$5,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale$4={lessThanXSeconds:{one:"bir saniyeden az",other:"{{count}} saniyeden az"},xSeconds:{one:"1 saniye",other:"{{count}} saniye"},halfAMinute:"yarım dakika",lessThanXMinutes:{one:"bir dakikadan az",other:"{{count}} dakikadan az"},xMinutes:{one:"1 dakika",other:"{{count}} dakika"},aboutXHours:{one:"yaklaşık 1 saat",other:"yaklaşık {{count}} saat"},xHours:{one:"1 saat",other:"{{count}} saat"},xDays:{one:"1 gün",other:"{{count}} gün"},aboutXWeeks:{one:"yaklaşık 1 hafta",other:"yaklaşık {{count}} hafta"},xWeeks:{one:"1 hafta",other:"{{count}} hafta"},aboutXMonths:{one:"yaklaşık 1 ay",other:"yaklaşık {{count}} ay"},xMonths:{one:"1 ay",other:"{{count}} ay"},aboutXYears:{one:"yaklaşık 1 yıl",other:"yaklaşık {{count}} yıl"},xYears:{one:"1 yıl",other:"{{count}} yıl"},overXYears:{one:"1 yıldan fazla",other:"{{count}} yıldan fazla"},almostXYears:{one:"neredeyse 1 yıl",other:"neredeyse {{count}} yıl"}},formatDistance$4=(s,e,t)=>{let i;const n=formatDistanceLocale$4[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",e.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?i+" sonra":i+" önce":i},dateFormats$4={full:"d MMMM y EEEE",long:"d MMMM y",medium:"d MMM y",short:"dd.MM.yyyy"},timeFormats$4={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$4={full:"{{date}} 'saat' {{time}}",long:"{{date}} 'saat' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$4={date:buildFormatLongFn({formats:dateFormats$4,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$4,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$4,defaultWidth:"full"})},formatRelativeLocale$4={lastWeek:"'geçen hafta' eeee 'saat' p",yesterday:"'dün saat' p",today:"'bugün saat' p",tomorrow:"'yarın saat' p",nextWeek:"eeee 'saat' p",other:"P"},formatRelative$4=(s,e,t,i)=>formatRelativeLocale$4[s],eraValues$4={narrow:["MÖ","MS"],abbreviated:["MÖ","MS"],wide:["Milattan Önce","Milattan Sonra"]},quarterValues$4={narrow:["1","2","3","4"],abbreviated:["1Ç","2Ç","3Ç","4Ç"],wide:["İlk çeyrek","İkinci Çeyrek","Üçüncü çeyrek","Son çeyrek"]},monthValues$4={narrow:["O","Ş","M","N","M","H","T","A","E","E","K","A"],abbreviated:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],wide:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"]},dayValues$4={narrow:["P","P","S","Ç","P","C","C"],short:["Pz","Pt","Sa","Ça","Pe","Cu","Ct"],abbreviated:["Paz","Pzt","Sal","Çar","Per","Cum","Cts"],wide:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"]},dayPeriodValues$4={narrow:{am:"öö",pm:"ös",midnight:"gy",noon:"ö",morning:"sa",afternoon:"ös",evening:"ak",night:"ge"},abbreviated:{am:"ÖÖ",pm:"ÖS",midnight:"gece yarısı",noon:"öğle",morning:"sabah",afternoon:"öğleden sonra",evening:"akşam",night:"gece"},wide:{am:"Ö.Ö.",pm:"Ö.S.",midnight:"gece yarısı",noon:"öğle",morning:"sabah",afternoon:"öğleden sonra",evening:"akşam",night:"gece"}},formattingDayPeriodValues$4={narrow:{am:"öö",pm:"ös",midnight:"gy",noon:"ö",morning:"sa",afternoon:"ös",evening:"ak",night:"ge"},abbreviated:{am:"ÖÖ",pm:"ÖS",midnight:"gece yarısı",noon:"öğlen",morning:"sabahleyin",afternoon:"öğleden sonra",evening:"akşamleyin",night:"geceleyin"},wide:{am:"ö.ö.",pm:"ö.s.",midnight:"gece yarısı",noon:"öğlen",morning:"sabahleyin",afternoon:"öğleden sonra",evening:"akşamleyin",night:"geceleyin"}},ordinalNumber$4=(s,e)=>Number(s)+".",localize$4={ordinalNumber:ordinalNumber$4,era:buildLocalizeFn({values:eraValues$4,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$4,defaultWidth:"wide",argumentCallback:s=>Number(s)-1}),month:buildLocalizeFn({values:monthValues$4,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$4,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$4,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$4,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$4=/^(\d+)(\.)?/i,parseOrdinalNumberPattern$4=/\d+/i,matchEraPatterns$4={narrow:/^(mö|ms)/i,abbreviated:/^(mö|ms)/i,wide:/^(milattan önce|milattan sonra)/i},parseEraPatterns$4={any:[/(^mö|^milattan önce)/i,/(^ms|^milattan sonra)/i]},matchQuarterPatterns$4={narrow:/^[1234]/i,abbreviated:/^[1234]ç/i,wide:/^((i|İ)lk|(i|İ)kinci|üçüncü|son) çeyrek/i},parseQuarterPatterns$4={any:[/1/i,/2/i,/3/i,/4/i],abbreviated:[/1ç/i,/2ç/i,/3ç/i,/4ç/i],wide:[/^(i|İ)lk çeyrek/i,/(i|İ)kinci çeyrek/i,/üçüncü çeyrek/i,/son çeyrek/i]},matchMonthPatterns$4={narrow:/^[oşmnhtaek]/i,abbreviated:/^(oca|şub|mar|nis|may|haz|tem|ağu|eyl|eki|kas|ara)/i,wide:/^(ocak|şubat|mart|nisan|mayıs|haziran|temmuz|ağustos|eylül|ekim|kasım|aralık)/i},parseMonthPatterns$4={narrow:[/^o/i,/^ş/i,/^m/i,/^n/i,/^m/i,/^h/i,/^t/i,/^a/i,/^e/i,/^e/i,/^k/i,/^a/i],any:[/^o/i,/^ş/i,/^mar/i,/^n/i,/^may/i,/^h/i,/^t/i,/^ağ/i,/^ey/i,/^ek/i,/^k/i,/^ar/i]},matchDayPatterns$4={narrow:/^[psçc]/i,short:/^(pz|pt|sa|ça|pe|cu|ct)/i,abbreviated:/^(paz|pzt|sal|çar|per|cum|cts)/i,wide:/^(pazar(?!tesi)|pazartesi|salı|çarşamba|perşembe|cuma(?!rtesi)|cumartesi)/i},parseDayPatterns$4={narrow:[/^p/i,/^p/i,/^s/i,/^ç/i,/^p/i,/^c/i,/^c/i],any:[/^pz/i,/^pt/i,/^sa/i,/^ça/i,/^pe/i,/^cu/i,/^ct/i],wide:[/^pazar(?!tesi)/i,/^pazartesi/i,/^salı/i,/^çarşamba/i,/^perşembe/i,/^cuma(?!rtesi)/i,/^cumartesi/i]},matchDayPeriodPatterns$4={narrow:/^(öö|ös|gy|ö|sa|ös|ak|ge)/i,any:/^(ö\.?\s?[ös]\.?|öğleden sonra|gece yarısı|öğle|(sabah|öğ|akşam|gece)(leyin))/i},parseDayPeriodPatterns$4={any:{am:/^ö\.?ö\.?/i,pm:/^ö\.?s\.?/i,midnight:/^(gy|gece yarısı)/i,noon:/^öğ/i,morning:/^sa/i,afternoon:/^öğleden sonra/i,evening:/^ak/i,night:/^ge/i}},match$4={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$4,parsePattern:parseOrdinalNumberPattern$4,valueCallback:function(s){return parseInt(s,10)}}),era:buildMatchFn({matchPatterns:matchEraPatterns$4,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$4,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$4,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$4,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$4,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$4,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$4,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$4,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$4,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$4,defaultParseWidth:"any"})},tr={code:"tr",formatDistance:formatDistance$4,formatLong:formatLong$4,formatRelative:formatRelative$4,localize:localize$4,match:match$4,options:{weekStartsOn:1,firstWeekContainsDate:1}};function declension(s,e){if(s.one!==void 0&&e===1)return s.one;const t=e%10,i=e%100;return t===1&&i!==11?s.singularNominative.replace("{{count}}",String(e)):t>=2&&t<=4&&(i<10||i>20)?s.singularGenitive.replace("{{count}}",String(e)):s.pluralGenitive.replace("{{count}}",String(e))}function buildLocalizeTokenFn(s){return(e,t)=>t&&t.addSuffix?t.comparison&&t.comparison>0?s.future?declension(s.future,e):"за "+declension(s.regular,e):s.past?declension(s.past,e):declension(s.regular,e)+" тому":declension(s.regular,e)}const halfAtMinute=(s,e)=>e&&e.addSuffix?e.comparison&&e.comparison>0?"за півхвилини":"півхвилини тому":"півхвилини",formatDistanceLocale$3={lessThanXSeconds:buildLocalizeTokenFn({regular:{one:"менше секунди",singularNominative:"менше {{count}} секунди",singularGenitive:"менше {{count}} секунд",pluralGenitive:"менше {{count}} секунд"},future:{one:"менше, ніж за секунду",singularNominative:"менше, ніж за {{count}} секунду",singularGenitive:"менше, ніж за {{count}} секунди",pluralGenitive:"менше, ніж за {{count}} секунд"}}),xSeconds:buildLocalizeTokenFn({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунди",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду тому",singularGenitive:"{{count}} секунди тому",pluralGenitive:"{{count}} секунд тому"},future:{singularNominative:"за {{count}} секунду",singularGenitive:"за {{count}} секунди",pluralGenitive:"за {{count}} секунд"}}),halfAMinute:halfAtMinute,lessThanXMinutes:buildLocalizeTokenFn({regular:{one:"менше хвилини",singularNominative:"менше {{count}} хвилини",singularGenitive:"менше {{count}} хвилин",pluralGenitive:"менше {{count}} хвилин"},future:{one:"менше, ніж за хвилину",singularNominative:"менше, ніж за {{count}} хвилину",singularGenitive:"менше, ніж за {{count}} хвилини",pluralGenitive:"менше, ніж за {{count}} хвилин"}}),xMinutes:buildLocalizeTokenFn({regular:{singularNominative:"{{count}} хвилина",singularGenitive:"{{count}} хвилини",pluralGenitive:"{{count}} хвилин"},past:{singularNominative:"{{count}} хвилину тому",singularGenitive:"{{count}} хвилини тому",pluralGenitive:"{{count}} хвилин тому"},future:{singularNominative:"за {{count}} хвилину",singularGenitive:"за {{count}} хвилини",pluralGenitive:"за {{count}} хвилин"}}),aboutXHours:buildLocalizeTokenFn({regular:{singularNominative:"близько {{count}} години",singularGenitive:"близько {{count}} годин",pluralGenitive:"близько {{count}} годин"},future:{singularNominative:"приблизно за {{count}} годину",singularGenitive:"приблизно за {{count}} години",pluralGenitive:"приблизно за {{count}} годин"}}),xHours:buildLocalizeTokenFn({regular:{singularNominative:"{{count}} годину",singularGenitive:"{{count}} години",pluralGenitive:"{{count}} годин"}}),xDays:buildLocalizeTokenFn({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} днi",pluralGenitive:"{{count}} днів"}}),aboutXWeeks:buildLocalizeTokenFn({regular:{singularNominative:"близько {{count}} тижня",singularGenitive:"близько {{count}} тижнів",pluralGenitive:"близько {{count}} тижнів"},future:{singularNominative:"приблизно за {{count}} тиждень",singularGenitive:"приблизно за {{count}} тижні",pluralGenitive:"приблизно за {{count}} тижнів"}}),xWeeks:buildLocalizeTokenFn({regular:{singularNominative:"{{count}} тиждень",singularGenitive:"{{count}} тижні",pluralGenitive:"{{count}} тижнів"}}),aboutXMonths:buildLocalizeTokenFn({regular:{singularNominative:"близько {{count}} місяця",singularGenitive:"близько {{count}} місяців",pluralGenitive:"близько {{count}} місяців"},future:{singularNominative:"приблизно за {{count}} місяць",singularGenitive:"приблизно за {{count}} місяці",pluralGenitive:"приблизно за {{count}} місяців"}}),xMonths:buildLocalizeTokenFn({regular:{singularNominative:"{{count}} місяць",singularGenitive:"{{count}} місяці",pluralGenitive:"{{count}} місяців"}}),aboutXYears:buildLocalizeTokenFn({regular:{singularNominative:"близько {{count}} року",singularGenitive:"близько {{count}} років",pluralGenitive:"близько {{count}} років"},future:{singularNominative:"приблизно за {{count}} рік",singularGenitive:"приблизно за {{count}} роки",pluralGenitive:"приблизно за {{count}} років"}}),xYears:buildLocalizeTokenFn({regular:{singularNominative:"{{count}} рік",singularGenitive:"{{count}} роки",pluralGenitive:"{{count}} років"}}),overXYears:buildLocalizeTokenFn({regular:{singularNominative:"більше {{count}} року",singularGenitive:"більше {{count}} років",pluralGenitive:"більше {{count}} років"},future:{singularNominative:"більше, ніж за {{count}} рік",singularGenitive:"більше, ніж за {{count}} роки",pluralGenitive:"більше, ніж за {{count}} років"}}),almostXYears:buildLocalizeTokenFn({regular:{singularNominative:"майже {{count}} рік",singularGenitive:"майже {{count}} роки",pluralGenitive:"майже {{count}} років"},future:{singularNominative:"майже за {{count}} рік",singularGenitive:"майже за {{count}} роки",pluralGenitive:"майже за {{count}} років"}})},formatDistance$3=(s,e,t)=>(t=t||{},formatDistanceLocale$3[s](e,t)),dateFormats$3={full:"EEEE, do MMMM y 'р.'",long:"do MMMM y 'р.'",medium:"d MMM y 'р.'",short:"dd.MM.y"},timeFormats$3={full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},dateTimeFormats$3={full:"{{date}} 'о' {{time}}",long:"{{date}} 'о' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong$3={date:buildFormatLongFn({formats:dateFormats$3,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$3,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$3,defaultWidth:"full"})},accusativeWeekdays=["неділю","понеділок","вівторок","середу","четвер","п’ятницю","суботу"];function lastWeek(s){const e=accusativeWeekdays[s];switch(s){case 0:case 3:case 5:case 6:return"'у минулу "+e+" о' p";case 1:case 2:case 4:return"'у минулий "+e+" о' p"}}function thisWeek(s){return"'у "+accusativeWeekdays[s]+" о' p"}function nextWeek(s){const e=accusativeWeekdays[s];switch(s){case 0:case 3:case 5:case 6:return"'у наступну "+e+" о' p";case 1:case 2:case 4:return"'у наступний "+e+" о' p"}}const lastWeekFormat=(s,e,t)=>{const i=toDate(s),n=i.getDay();return isSameWeek(i,e,t)?thisWeek(n):lastWeek(n)},nextWeekFormat=(s,e,t)=>{const i=toDate(s),n=i.getDay();return isSameWeek(i,e,t)?thisWeek(n):nextWeek(n)},formatRelativeLocale$3={lastWeek:lastWeekFormat,yesterday:"'вчора о' p",today:"'сьогодні о' p",tomorrow:"'завтра о' p",nextWeek:nextWeekFormat,other:"P"},formatRelative$3=(s,e,t,i)=>{const n=formatRelativeLocale$3[s];return typeof n=="function"?n(e,t,i):n},eraValues$3={narrow:["до н.е.","н.е."],abbreviated:["до н. е.","н. е."],wide:["до нашої ери","нашої ери"]},quarterValues$3={narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},monthValues$3={narrow:["С","Л","Б","К","Т","Ч","Л","С","В","Ж","Л","Г"],abbreviated:["січ.","лют.","берез.","квіт.","трав.","черв.","лип.","серп.","верес.","жовт.","листоп.","груд."],wide:["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"]},formattingMonthValues$1={narrow:["С","Л","Б","К","Т","Ч","Л","С","В","Ж","Л","Г"],abbreviated:["січ.","лют.","берез.","квіт.","трав.","черв.","лип.","серп.","верес.","жовт.","листоп.","груд."],wide:["січня","лютого","березня","квітня","травня","червня","липня","серпня","вересня","жовтня","листопада","грудня"]},dayValues$3={narrow:["Н","П","В","С","Ч","П","С"],short:["нд","пн","вт","ср","чт","пт","сб"],abbreviated:["нед","пон","вів","сер","чтв","птн","суб"],wide:["неділя","понеділок","вівторок","середа","четвер","п’ятниця","субота"]},dayPeriodValues$3={narrow:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранок",afternoon:"день",evening:"веч.",night:"ніч"},abbreviated:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранок",afternoon:"день",evening:"веч.",night:"ніч"},wide:{am:"ДП",pm:"ПП",midnight:"північ",noon:"полудень",morning:"ранок",afternoon:"день",evening:"вечір",night:"ніч"}},formattingDayPeriodValues$3={narrow:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"},abbreviated:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"},wide:{am:"ДП",pm:"ПП",midnight:"північ",noon:"полудень",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"}},ordinalNumber$3=(s,e)=>{const t=String(e==null?void 0:e.unit),i=Number(s);let n;return t==="date"?i===3||i===23?n="-є":n="-е":t==="minute"||t==="second"||t==="hour"?n="-а":n="-й",i+n},localize$3={ordinalNumber:ordinalNumber$3,era:buildLocalizeFn({values:eraValues$3,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$3,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$3,defaultWidth:"wide",formattingValues:formattingMonthValues$1,defaultFormattingWidth:"wide"}),day:buildLocalizeFn({values:dayValues$3,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$3,defaultWidth:"any",formattingValues:formattingDayPeriodValues$3,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$3=/^(\d+)(-?(е|й|є|а|я))?/i,parseOrdinalNumberPattern$3=/\d+/i,matchEraPatterns$3={narrow:/^((до )?н\.?\s?е\.?)/i,abbreviated:/^((до )?н\.?\s?е\.?)/i,wide:/^(до нашої ери|нашої ери|наша ера)/i},parseEraPatterns$3={any:[/^д/i,/^н/i]},matchQuarterPatterns$3={narrow:/^[1234]/i,abbreviated:/^[1234](-?[иі]?й?)? кв.?/i,wide:/^[1234](-?[иі]?й?)? квартал/i},parseQuarterPatterns$3={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns$3={narrow:/^[слбктчвжг]/i,abbreviated:/^(січ|лют|бер(ез)?|квіт|трав|черв|лип|серп|вер(ес)?|жовт|лис(топ)?|груд)\.?/i,wide:/^(січень|січня|лютий|лютого|березень|березня|квітень|квітня|травень|травня|червня|червень|липень|липня|серпень|серпня|вересень|вересня|жовтень|жовтня|листопад[а]?|грудень|грудня)/i},parseMonthPatterns$3={narrow:[/^с/i,/^л/i,/^б/i,/^к/i,/^т/i,/^ч/i,/^л/i,/^с/i,/^в/i,/^ж/i,/^л/i,/^г/i],any:[/^сі/i,/^лю/i,/^б/i,/^к/i,/^т/i,/^ч/i,/^лип/i,/^се/i,/^в/i,/^ж/i,/^лис/i,/^г/i]},matchDayPatterns$3={narrow:/^[нпвсч]/i,short:/^(нд|пн|вт|ср|чт|пт|сб)\.?/i,abbreviated:/^(нед|пон|вів|сер|че?тв|птн?|суб)\.?/i,wide:/^(неділ[яі]|понеділ[ок][ка]|вівтор[ок][ка]|серед[аи]|четвер(га)?|п\W*?ятниц[яі]|субот[аи])/i},parseDayPatterns$3={narrow:[/^н/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^н/i,/^п[он]/i,/^в/i,/^с[ер]/i,/^ч/i,/^п\W*?[ят]/i,/^с[уб]/i]},matchDayPeriodPatterns$3={narrow:/^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,abbreviated:/^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,wide:/^([дп]п|північ|полудень|ранок|ранку|день|дня|вечір|вечора|ніч|ночі)/i},parseDayPeriodPatterns$3={any:{am:/^дп/i,pm:/^пп/i,midnight:/^півн/i,noon:/^пол/i,morning:/^р/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},match$3={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$3,parsePattern:parseOrdinalNumberPattern$3,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$3,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$3,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$3,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$3,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$3,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$3,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$3,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$3,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$3,defaultMatchWidth:"wide",parsePatterns:parseDayPeriodPatterns$3,defaultParseWidth:"any"})},uk={code:"uk",formatDistance:formatDistance$3,formatLong:formatLong$3,formatRelative:formatRelative$3,localize:localize$3,match:match$3,options:{weekStartsOn:1,firstWeekContainsDate:1}},formatDistanceLocale$2={lessThanXSeconds:{one:"dưới 1 giây",other:"dưới {{count}} giây"},xSeconds:{one:"1 giây",other:"{{count}} giây"},halfAMinute:"nửa phút",lessThanXMinutes:{one:"dưới 1 phút",other:"dưới {{count}} phút"},xMinutes:{one:"1 phút",other:"{{count}} phút"},aboutXHours:{one:"khoảng 1 giờ",other:"khoảng {{count}} giờ"},xHours:{one:"1 giờ",other:"{{count}} giờ"},xDays:{one:"1 ngày",other:"{{count}} ngày"},aboutXWeeks:{one:"khoảng 1 tuần",other:"khoảng {{count}} tuần"},xWeeks:{one:"1 tuần",other:"{{count}} tuần"},aboutXMonths:{one:"khoảng 1 tháng",other:"khoảng {{count}} tháng"},xMonths:{one:"1 tháng",other:"{{count}} tháng"},aboutXYears:{one:"khoảng 1 năm",other:"khoảng {{count}} năm"},xYears:{one:"1 năm",other:"{{count}} năm"},overXYears:{one:"hơn 1 năm",other:"hơn {{count}} năm"},almostXYears:{one:"gần 1 năm",other:"gần {{count}} năm"}},formatDistance$2=(s,e,t)=>{let i;const n=formatDistanceLocale$2[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?i+" nữa":i+" trước":i},dateFormats$2={full:"EEEE, 'ngày' d MMMM 'năm' y",long:"'ngày' d MMMM 'năm' y",medium:"d MMM 'năm' y",short:"dd/MM/y"},timeFormats$2={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},dateTimeFormats$2={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$2={date:buildFormatLongFn({formats:dateFormats$2,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$2,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$2,defaultWidth:"full"})},formatRelativeLocale$2={lastWeek:"eeee 'tuần trước vào lúc' p",yesterday:"'hôm qua vào lúc' p",today:"'hôm nay vào lúc' p",tomorrow:"'ngày mai vào lúc' p",nextWeek:"eeee 'tới vào lúc' p",other:"P"},formatRelative$2=(s,e,t,i)=>formatRelativeLocale$2[s],eraValues$2={narrow:["TCN","SCN"],abbreviated:["trước CN","sau CN"],wide:["trước Công Nguyên","sau Công Nguyên"]},quarterValues$2={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["Quý 1","Quý 2","Quý 3","Quý 4"]},formattingQuarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["quý I","quý II","quý III","quý IV"]},monthValues$2={narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["Thg 1","Thg 2","Thg 3","Thg 4","Thg 5","Thg 6","Thg 7","Thg 8","Thg 9","Thg 10","Thg 11","Thg 12"],wide:["Tháng Một","Tháng Hai","Tháng Ba","Tháng Tư","Tháng Năm","Tháng Sáu","Tháng Bảy","Tháng Tám","Tháng Chín","Tháng Mười","Tháng Mười Một","Tháng Mười Hai"]},formattingMonthValues={narrow:["01","02","03","04","05","06","07","08","09","10","11","12"],abbreviated:["thg 1","thg 2","thg 3","thg 4","thg 5","thg 6","thg 7","thg 8","thg 9","thg 10","thg 11","thg 12"],wide:["tháng 01","tháng 02","tháng 03","tháng 04","tháng 05","tháng 06","tháng 07","tháng 08","tháng 09","tháng 10","tháng 11","tháng 12"]},dayValues$2={narrow:["CN","T2","T3","T4","T5","T6","T7"],short:["CN","Th 2","Th 3","Th 4","Th 5","Th 6","Th 7"],abbreviated:["CN","Thứ 2","Thứ 3","Thứ 4","Thứ 5","Thứ 6","Thứ 7"],wide:["Chủ Nhật","Thứ Hai","Thứ Ba","Thứ Tư","Thứ Năm","Thứ Sáu","Thứ Bảy"]},dayPeriodValues$2={narrow:{am:"am",pm:"pm",midnight:"nửa đêm",noon:"tr",morning:"sg",afternoon:"ch",evening:"tối",night:"đêm"},abbreviated:{am:"AM",pm:"PM",midnight:"nửa đêm",noon:"trưa",morning:"sáng",afternoon:"chiều",evening:"tối",night:"đêm"},wide:{am:"SA",pm:"CH",midnight:"nửa đêm",noon:"trưa",morning:"sáng",afternoon:"chiều",evening:"tối",night:"đêm"}},formattingDayPeriodValues$2={narrow:{am:"am",pm:"pm",midnight:"nửa đêm",noon:"tr",morning:"sg",afternoon:"ch",evening:"tối",night:"đêm"},abbreviated:{am:"AM",pm:"PM",midnight:"nửa đêm",noon:"trưa",morning:"sáng",afternoon:"chiều",evening:"tối",night:"đêm"},wide:{am:"SA",pm:"CH",midnight:"nửa đêm",noon:"giữa trưa",morning:"vào buổi sáng",afternoon:"vào buổi chiều",evening:"vào buổi tối",night:"vào ban đêm"}},ordinalNumber$2=(s,e)=>{const t=Number(s),i=e==null?void 0:e.unit;if(i==="quarter")switch(t){case 1:return"I";case 2:return"II";case 3:return"III";case 4:return"IV"}else if(i==="day")switch(t){case 1:return"thứ 2";case 2:return"thứ 3";case 3:return"thứ 4";case 4:return"thứ 5";case 5:return"thứ 6";case 6:return"thứ 7";case 7:return"chủ nhật"}else{if(i==="week")return t===1?"thứ nhất":"thứ "+t;if(i==="dayOfYear")return t===1?"đầu tiên":"thứ "+t}return String(t)},localize$2={ordinalNumber:ordinalNumber$2,era:buildLocalizeFn({values:eraValues$2,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$2,defaultWidth:"wide",formattingValues:formattingQuarterValues,defaultFormattingWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$2,defaultWidth:"wide",formattingValues:formattingMonthValues,defaultFormattingWidth:"wide"}),day:buildLocalizeFn({values:dayValues$2,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$2,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$2,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$2=/^(\d+)/i,parseOrdinalNumberPattern$2=/\d+/i,matchEraPatterns$2={narrow:/^(tcn|scn)/i,abbreviated:/^(trước CN|sau CN)/i,wide:/^(trước Công Nguyên|sau Công Nguyên)/i},parseEraPatterns$2={any:[/^t/i,/^s/i]},matchQuarterPatterns$2={narrow:/^([1234]|i{1,3}v?)/i,abbreviated:/^q([1234]|i{1,3}v?)/i,wide:/^quý ([1234]|i{1,3}v?)/i},parseQuarterPatterns$2={any:[/(1|i)$/i,/(2|ii)$/i,/(3|iii)$/i,/(4|iv)$/i]},matchMonthPatterns$2={narrow:/^(0?[2-9]|10|11|12|0?1)/i,abbreviated:/^thg[ _]?(0?[1-9](?!\d)|10|11|12)/i,wide:/^tháng ?(Một|Hai|Ba|Tư|Năm|Sáu|Bảy|Tám|Chín|Mười|Mười ?Một|Mười ?Hai|0?[1-9](?!\d)|10|11|12)/i},parseMonthPatterns$2={narrow:[/0?1$/i,/0?2/i,/3/,/4/,/5/,/6/,/7/,/8/,/9/,/10/,/11/,/12/],abbreviated:[/^thg[ _]?0?1(?!\d)/i,/^thg[ _]?0?2/i,/^thg[ _]?0?3/i,/^thg[ _]?0?4/i,/^thg[ _]?0?5/i,/^thg[ _]?0?6/i,/^thg[ _]?0?7/i,/^thg[ _]?0?8/i,/^thg[ _]?0?9/i,/^thg[ _]?10/i,/^thg[ _]?11/i,/^thg[ _]?12/i],wide:[/^tháng ?(Một|0?1(?!\d))/i,/^tháng ?(Hai|0?2)/i,/^tháng ?(Ba|0?3)/i,/^tháng ?(Tư|0?4)/i,/^tháng ?(Năm|0?5)/i,/^tháng ?(Sáu|0?6)/i,/^tháng ?(Bảy|0?7)/i,/^tháng ?(Tám|0?8)/i,/^tháng ?(Chín|0?9)/i,/^tháng ?(Mười|10)/i,/^tháng ?(Mười ?Một|11)/i,/^tháng ?(Mười ?Hai|12)/i]},matchDayPatterns$2={narrow:/^(CN|T2|T3|T4|T5|T6|T7)/i,short:/^(CN|Th ?2|Th ?3|Th ?4|Th ?5|Th ?6|Th ?7)/i,abbreviated:/^(CN|Th ?2|Th ?3|Th ?4|Th ?5|Th ?6|Th ?7)/i,wide:/^(Chủ ?Nhật|Chúa ?Nhật|thứ ?Hai|thứ ?Ba|thứ ?Tư|thứ ?Năm|thứ ?Sáu|thứ ?Bảy)/i},parseDayPatterns$2={narrow:[/CN/i,/2/i,/3/i,/4/i,/5/i,/6/i,/7/i],short:[/CN/i,/2/i,/3/i,/4/i,/5/i,/6/i,/7/i],abbreviated:[/CN/i,/2/i,/3/i,/4/i,/5/i,/6/i,/7/i],wide:[/(Chủ|Chúa) ?Nhật/i,/Hai/i,/Ba/i,/Tư/i,/Năm/i,/Sáu/i,/Bảy/i]},matchDayPeriodPatterns$2={narrow:/^(a|p|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,abbreviated:/^(am|pm|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,wide:/^(ch[^i]*|sa|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i},parseDayPeriodPatterns$2={any:{am:/^(a|sa)/i,pm:/^(p|ch[^i]*)/i,midnight:/nửa đêm/i,noon:/trưa/i,morning:/sáng/i,afternoon:/chiều/i,evening:/tối/i,night:/^đêm/i}},match$2={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$2,parsePattern:parseOrdinalNumberPattern$2,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$2,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$2,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$2,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$2,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$2,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$2,defaultParseWidth:"wide"}),day:buildMatchFn({matchPatterns:matchDayPatterns$2,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$2,defaultParseWidth:"wide"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$2,defaultMatchWidth:"wide",parsePatterns:parseDayPeriodPatterns$2,defaultParseWidth:"any"})},vi={code:"vi",formatDistance:formatDistance$2,formatLong:formatLong$2,formatRelative:formatRelative$2,localize:localize$2,match:match$2,options:{weekStartsOn:1,firstWeekContainsDate:1}},formatDistanceLocale$1={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},formatDistance$1=(s,e,t)=>{let i;const n=formatDistanceLocale$1[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?i+"内":i+"前":i},dateFormats$1={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},timeFormats$1={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},dateTimeFormats$1={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong$1={date:buildFormatLongFn({formats:dateFormats$1,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats$1,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats$1,defaultWidth:"full"})};function checkWeek(s,e,t){const i="eeee p";return isSameWeek(s,e,t)?i:s.getTime()>e.getTime()?"'下个'"+i:"'上个'"+i}const formatRelativeLocale$1={lastWeek:checkWeek,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:checkWeek,other:"PP p"},formatRelative$1=(s,e,t,i)=>{const n=formatRelativeLocale$1[s];return typeof n=="function"?n(e,t,i):n},eraValues$1={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},quarterValues$1={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},monthValues$1={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},dayValues$1={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},dayPeriodValues$1={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},formattingDayPeriodValues$1={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},ordinalNumber$1=(s,e)=>{const t=Number(s);switch(e==null?void 0:e.unit){case"date":return t.toString()+"日";case"hour":return t.toString()+"时";case"minute":return t.toString()+"分";case"second":return t.toString()+"秒";default:return"第 "+t.toString()}},localize$1={ordinalNumber:ordinalNumber$1,era:buildLocalizeFn({values:eraValues$1,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues$1,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues$1,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues$1,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues$1,defaultWidth:"wide",formattingValues:formattingDayPeriodValues$1,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern$1=/^(第\s*)?\d+(日|时|分|秒)?/i,parseOrdinalNumberPattern$1=/\d+/i,matchEraPatterns$1={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},parseEraPatterns$1={any:[/^(前)/i,/^(公元)/i]},matchQuarterPatterns$1={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},parseQuarterPatterns$1={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},matchMonthPatterns$1={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},parseMonthPatterns$1={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},matchDayPatterns$1={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},parseDayPatterns$1={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},matchDayPeriodPatterns$1={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},parseDayPeriodPatterns$1={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},match$1={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern$1,parsePattern:parseOrdinalNumberPattern$1,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns$1,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns$1,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns$1,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns$1,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns$1,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns$1,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns$1,defaultParseWidth:"any"})},zhCN={code:"zh-CN",formatDistance:formatDistance$1,formatLong:formatLong$1,formatRelative:formatRelative$1,localize:localize$1,match:match$1,options:{weekStartsOn:1,firstWeekContainsDate:4}},formatDistanceLocale={lessThanXSeconds:{one:"少於 1 秒",other:"少於 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分鐘",lessThanXMinutes:{one:"少於 1 分鐘",other:"少於 {{count}} 分鐘"},xMinutes:{one:"1 分鐘",other:"{{count}} 分鐘"},xHours:{one:"1 小時",other:"{{count}} 小時"},aboutXHours:{one:"大約 1 小時",other:"大約 {{count}} 小時"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大約 1 個星期",other:"大約 {{count}} 個星期"},xWeeks:{one:"1 個星期",other:"{{count}} 個星期"},aboutXMonths:{one:"大約 1 個月",other:"大約 {{count}} 個月"},xMonths:{one:"1 個月",other:"{{count}} 個月"},aboutXYears:{one:"大約 1 年",other:"大約 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超過 1 年",other:"超過 {{count}} 年"},almostXYears:{one:"將近 1 年",other:"將近 {{count}} 年"}},formatDistance=(s,e,t)=>{let i;const n=formatDistanceLocale[s];return typeof n=="string"?i=n:e===1?i=n.one:i=n.other.replace("{{count}}",String(e)),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?i+"內":i+"前":i},dateFormats={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},timeFormats={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},dateTimeFormats={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatRelativeLocale={lastWeek:"'上個'eeee p",yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:"'下個'eeee p",other:"P"},formatRelative=(s,e,t,i)=>formatRelativeLocale[s],eraValues={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["第一刻","第二刻","第三刻","第四刻"],wide:["第一刻鐘","第二刻鐘","第三刻鐘","第四刻鐘"]},monthValues={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},dayValues={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["週日","週一","週二","週三","週四","週五","週六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},dayPeriodValues={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜間"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜間"}},formattingDayPeriodValues={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜間"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜間"}},ordinalNumber=(s,e)=>{const t=Number(s);switch(e==null?void 0:e.unit){case"date":return t+"日";case"hour":return t+"時";case"minute":return t+"分";case"second":return t+"秒";default:return"第 "+t}},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:s=>s-1}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})},matchOrdinalNumberPattern=/^(第\s*)?\d+(日|時|分|秒)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},parseEraPatterns={any:[/^(前)/i,/^(公元)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻鐘/i},parseQuarterPatterns={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},matchMonthPatterns={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},parseMonthPatterns={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},matchDayPatterns={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^週[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},parseDayPatterns={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},matchDayPeriodPatterns={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨)/i},parseDayPeriodPatterns={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:s=>parseInt(s,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:s=>s+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},zhTW={code:"zh-TW",formatDistance,formatLong,formatRelative,localize,match,options:{weekStartsOn:1,firstWeekContainsDate:4}};/*!
|
||
* @kurkle/color v0.3.2
|
||
* https://github.com/kurkle/color#readme
|
||
* (c) 2023 Jukka Kurkela
|
||
* Released under the MIT License
|
||
*/function round(s){return s+.5|0}const lim=(s,e,t)=>Math.max(Math.min(s,t),e);function p2b(s){return lim(round(s*2.55),0,255)}function n2b(s){return lim(round(s*255),0,255)}function b2n(s){return lim(round(s/2.55)/100,0,1)}function n2p(s){return lim(round(s*100),0,100)}const map$1={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},hex=[..."0123456789ABCDEF"],h1=s=>hex[s&15],h2=s=>hex[(s&240)>>4]+hex[s&15],eq=s=>(s&240)>>4===(s&15),isShort=s=>eq(s.r)&&eq(s.g)&&eq(s.b)&&eq(s.a);function hexParse(s){var e=s.length,t;return s[0]==="#"&&(e===4||e===5?t={r:255&map$1[s[1]]*17,g:255&map$1[s[2]]*17,b:255&map$1[s[3]]*17,a:e===5?map$1[s[4]]*17:255}:(e===7||e===9)&&(t={r:map$1[s[1]]<<4|map$1[s[2]],g:map$1[s[3]]<<4|map$1[s[4]],b:map$1[s[5]]<<4|map$1[s[6]],a:e===9?map$1[s[7]]<<4|map$1[s[8]]:255})),t}const alpha=(s,e)=>s<255?e(s):"";function hexString(s){var e=isShort(s)?h1:h2;return s?"#"+e(s.r)+e(s.g)+e(s.b)+alpha(s.a,e):void 0}const HUE_RE=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function hsl2rgbn(s,e,t){const i=e*Math.min(t,1-t),n=(o,r=(o+s/30)%12)=>t-i*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function hsv2rgbn(s,e,t){const i=(n,o=(n+s/60)%6)=>t-t*e*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function hwb2rgbn(s,e,t){const i=hsl2rgbn(s,1,.5);let n;for(e+t>1&&(n=1/(e+t),e*=n,t*=n),n=0;n<3;n++)i[n]*=1-e-t,i[n]+=e;return i}function hueValue(s,e,t,i,n){return s===n?(e-t)/i+(e<t?6:0):e===n?(t-s)/i+2:(s-e)/i+4}function rgb2hsl(s){const t=s.r/255,i=s.g/255,n=s.b/255,o=Math.max(t,i,n),r=Math.min(t,i,n),a=(o+r)/2;let l,d,h;return o!==r&&(h=o-r,d=a>.5?h/(2-o-r):h/(o+r),l=hueValue(t,i,n,h,o),l=l*60+.5),[l|0,d||0,a]}function calln(s,e,t,i){return(Array.isArray(e)?s(e[0],e[1],e[2]):s(e,t,i)).map(n2b)}function hsl2rgb(s,e,t){return calln(hsl2rgbn,s,e,t)}function hwb2rgb(s,e,t){return calln(hwb2rgbn,s,e,t)}function hsv2rgb(s,e,t){return calln(hsv2rgbn,s,e,t)}function hue(s){return(s%360+360)%360}function hueParse(s){const e=HUE_RE.exec(s);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?p2b(+e[5]):n2b(+e[5]));const n=hue(+e[2]),o=+e[3]/100,r=+e[4]/100;return e[1]==="hwb"?i=hwb2rgb(n,o,r):e[1]==="hsv"?i=hsv2rgb(n,o,r):i=hsl2rgb(n,o,r),{r:i[0],g:i[1],b:i[2],a:t}}function rotate(s,e){var t=rgb2hsl(s);t[0]=hue(t[0]+e),t=hsl2rgb(t),s.r=t[0],s.g=t[1],s.b=t[2]}function hslString(s){if(!s)return;const e=rgb2hsl(s),t=e[0],i=n2p(e[1]),n=n2p(e[2]);return s.a<255?`hsla(${t}, ${i}%, ${n}%, ${b2n(s.a)})`:`hsl(${t}, ${i}%, ${n}%)`}const map={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},names$1={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function unpack(){const s={},e=Object.keys(names$1),t=Object.keys(map);let i,n,o,r,a;for(i=0;i<e.length;i++){for(r=a=e[i],n=0;n<t.length;n++)o=t[n],a=a.replace(o,map[o]);o=parseInt(names$1[r],16),s[a]=[o>>16&255,o>>8&255,o&255]}return s}let names;function nameParse(s){names||(names=unpack(),names.transparent=[0,0,0,0]);const e=names[s.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const RGB_RE=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rgbParse(s){const e=RGB_RE.exec(s);let t=255,i,n,o;if(e){if(e[7]!==i){const r=+e[7];t=e[8]?p2b(r):lim(r*255,0,255)}return i=+e[1],n=+e[3],o=+e[5],i=255&(e[2]?p2b(i):lim(i,0,255)),n=255&(e[4]?p2b(n):lim(n,0,255)),o=255&(e[6]?p2b(o):lim(o,0,255)),{r:i,g:n,b:o,a:t}}}function rgbString(s){return s&&(s.a<255?`rgba(${s.r}, ${s.g}, ${s.b}, ${b2n(s.a)})`:`rgb(${s.r}, ${s.g}, ${s.b})`)}const to=s=>s<=.0031308?s*12.92:Math.pow(s,1/2.4)*1.055-.055,from=s=>s<=.04045?s/12.92:Math.pow((s+.055)/1.055,2.4);function interpolate$1(s,e,t){const i=from(b2n(s.r)),n=from(b2n(s.g)),o=from(b2n(s.b));return{r:n2b(to(i+t*(from(b2n(e.r))-i))),g:n2b(to(n+t*(from(b2n(e.g))-n))),b:n2b(to(o+t*(from(b2n(e.b))-o))),a:s.a+t*(e.a-s.a)}}function modHSL(s,e,t){if(s){let i=rgb2hsl(s);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=hsl2rgb(i),s.r=i[0],s.g=i[1],s.b=i[2]}}function clone$1(s,e){return s&&Object.assign(e||{},s)}function fromObject(s){var e={r:0,g:0,b:0,a:255};return Array.isArray(s)?s.length>=3&&(e={r:s[0],g:s[1],b:s[2],a:255},s.length>3&&(e.a=n2b(s[3]))):(e=clone$1(s,{r:0,g:0,b:0,a:1}),e.a=n2b(e.a)),e}function functionParse(s){return s.charAt(0)==="r"?rgbParse(s):hueParse(s)}class Color{constructor(e){if(e instanceof Color)return e;const t=typeof e;let i;t==="object"?i=fromObject(e):t==="string"&&(i=hexParse(e)||nameParse(e)||functionParse(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=clone$1(this._rgb);return e&&(e.a=b2n(e.a)),e}set rgb(e){this._rgb=fromObject(e)}rgbString(){return this._valid?rgbString(this._rgb):void 0}hexString(){return this._valid?hexString(this._rgb):void 0}hslString(){return this._valid?hslString(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,n=e.rgb;let o;const r=t===o?.5:t,a=2*r-1,l=i.a-n.a,d=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-d,i.r=255&d*i.r+o*n.r+.5,i.g=255&d*i.g+o*n.g+.5,i.b=255&d*i.b+o*n.b+.5,i.a=r*i.a+(1-r)*n.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=interpolate$1(this._rgb,e._rgb,t)),this}clone(){return new Color(this.rgb)}alpha(e){return this._rgb.a=n2b(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=round(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return modHSL(this._rgb,2,e),this}darken(e){return modHSL(this._rgb,2,-e),this}saturate(e){return modHSL(this._rgb,1,e),this}desaturate(e){return modHSL(this._rgb,1,-e),this}rotate(e){return rotate(this._rgb,e),this}}/*!
|
||
* Chart.js v4.4.2
|
||
* https://www.chartjs.org
|
||
* (c) 2024 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/function noop$1(){}const uid=(()=>{let s=0;return()=>s++})();function isNullOrUndef(s){return s===null||typeof s>"u"}function isArray(s){if(Array.isArray&&Array.isArray(s))return!0;const e=Object.prototype.toString.call(s);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function isObject(s){return s!==null&&Object.prototype.toString.call(s)==="[object Object]"}function isNumberFinite(s){return(typeof s=="number"||s instanceof Number)&&isFinite(+s)}function finiteOrDefault(s,e){return isNumberFinite(s)?s:e}function valueOrDefault(s,e){return typeof s>"u"?e:s}const toPercentage=(s,e)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100:+s/e,toDimension=(s,e)=>typeof s=="string"&&s.endsWith("%")?parseFloat(s)/100*e:+s;function callback(s,e,t){if(s&&typeof s.call=="function")return s.apply(t,e)}function each(s,e,t,i){let n,o,r;if(isArray(s))if(o=s.length,i)for(n=o-1;n>=0;n--)e.call(t,s[n],n);else for(n=0;n<o;n++)e.call(t,s[n],n);else if(isObject(s))for(r=Object.keys(s),o=r.length,n=0;n<o;n++)e.call(t,s[r[n]],r[n])}function _elementsEqual(s,e){let t,i,n,o;if(!s||!e||s.length!==e.length)return!1;for(t=0,i=s.length;t<i;++t)if(n=s[t],o=e[t],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function clone(s){if(isArray(s))return s.map(clone);if(isObject(s)){const e=Object.create(null),t=Object.keys(s),i=t.length;let n=0;for(;n<i;++n)e[t[n]]=clone(s[t[n]]);return e}return s}function isValidKey(s){return["__proto__","prototype","constructor"].indexOf(s)===-1}function _merger(s,e,t,i){if(!isValidKey(s))return;const n=e[s],o=t[s];isObject(n)&&isObject(o)?merge(n,o,i):e[s]=clone(o)}function merge(s,e,t){const i=isArray(e)?e:[e],n=i.length;if(!isObject(s))return s;t=t||{};const o=t.merger||_merger;let r;for(let a=0;a<n;++a){if(r=i[a],!isObject(r))continue;const l=Object.keys(r);for(let d=0,h=l.length;d<h;++d)o(l[d],s,r,t)}return s}function mergeIf(s,e){return merge(s,e,{merger:_mergerIf})}function _mergerIf(s,e,t){if(!isValidKey(s))return;const i=e[s],n=t[s];isObject(i)&&isObject(n)?mergeIf(i,n):Object.prototype.hasOwnProperty.call(e,s)||(e[s]=clone(n))}const keyResolvers={"":s=>s,x:s=>s.x,y:s=>s.y};function _splitKey(s){const e=s.split("."),t=[];let i="";for(const n of e)i+=n,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function _getKeyResolver(s){const e=_splitKey(s);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function resolveObjectKey(s,e){return(keyResolvers[e]||(keyResolvers[e]=_getKeyResolver(e)))(s)}function _capitalize(s){return s.charAt(0).toUpperCase()+s.slice(1)}const defined$1=s=>typeof s<"u",isFunction$1=s=>typeof s=="function",setsEqual=(s,e)=>{if(s.size!==e.size)return!1;for(const t of s)if(!e.has(t))return!1;return!0};function _isClickEvent(s){return s.type==="mouseup"||s.type==="click"||s.type==="contextmenu"}const PI=Math.PI,TAU=2*PI,PITAU=TAU+PI,INFINITY=Number.POSITIVE_INFINITY,RAD_PER_DEG=PI/180,HALF_PI=PI/2,QUARTER_PI=PI/4,TWO_THIRDS_PI=PI*2/3,log10=Math.log10,sign=Math.sign;function almostEquals(s,e,t){return Math.abs(s-e)<t}function niceNum(s){const e=Math.round(s);s=almostEquals(s,e,s/1e3)?e:s;const t=Math.pow(10,Math.floor(log10(s))),i=s/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function _factorize(s){const e=[],t=Math.sqrt(s);let i;for(i=1;i<t;i++)s%i===0&&(e.push(i),e.push(s/i));return t===(t|0)&&e.push(t),e.sort((n,o)=>n-o).pop(),e}function isNumber(s){return!isNaN(parseFloat(s))&&isFinite(s)}function almostWhole(s,e){const t=Math.round(s);return t-e<=s&&t+e>=s}function _setMinAndMaxByKey(s,e,t){let i,n,o;for(i=0,n=s.length;i<n;i++)o=s[i][t],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function toRadians(s){return s*(PI/180)}function toDegrees(s){return s*(180/PI)}function _decimalPlaces(s){if(!isNumberFinite(s))return;let e=1,t=0;for(;Math.round(s*e)/e!==s;)e*=10,t++;return t}function getAngleFromPoint(s,e){const t=e.x-s.x,i=e.y-s.y,n=Math.sqrt(t*t+i*i);let o=Math.atan2(i,t);return o<-.5*PI&&(o+=TAU),{angle:o,distance:n}}function distanceBetweenPoints(s,e){return Math.sqrt(Math.pow(e.x-s.x,2)+Math.pow(e.y-s.y,2))}function _angleDiff(s,e){return(s-e+PITAU)%TAU-PI}function _normalizeAngle(s){return(s%TAU+TAU)%TAU}function _angleBetween(s,e,t,i){const n=_normalizeAngle(s),o=_normalizeAngle(e),r=_normalizeAngle(t),a=_normalizeAngle(o-n),l=_normalizeAngle(r-n),d=_normalizeAngle(n-o),h=_normalizeAngle(n-r);return n===o||n===r||i&&o===r||a>l&&d<h}function _limitValue(s,e,t){return Math.max(e,Math.min(t,s))}function _int16Range(s){return _limitValue(s,-32768,32767)}function _isBetween(s,e,t,i=1e-6){return s>=Math.min(e,t)-i&&s<=Math.max(e,t)+i}function _lookup(s,e,t){t=t||(r=>s[r]<e);let i=s.length-1,n=0,o;for(;i-n>1;)o=n+i>>1,t(o)?n=o:i=o;return{lo:n,hi:i}}const _lookupByKey=(s,e,t,i)=>_lookup(s,t,i?n=>{const o=s[n][e];return o<t||o===t&&s[n+1][e]===t}:n=>s[n][e]<t),_rlookupByKey=(s,e,t)=>_lookup(s,t,i=>s[i][e]>=t);function _filterBetween(s,e,t){let i=0,n=s.length;for(;i<n&&s[i]<e;)i++;for(;n>i&&s[n-1]>t;)n--;return i>0||n<s.length?s.slice(i,n):s}const arrayEvents=["push","pop","shift","splice","unshift"];function listenArrayEvents(s,e){if(s._chartjs){s._chartjs.listeners.push(e);return}Object.defineProperty(s,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),arrayEvents.forEach(t=>{const i="_onData"+_capitalize(t),n=s[t];Object.defineProperty(s,t,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return s._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function unlistenArrayEvents(s,e){const t=s._chartjs;if(!t)return;const i=t.listeners,n=i.indexOf(e);n!==-1&&i.splice(n,1),!(i.length>0)&&(arrayEvents.forEach(o=>{delete s[o]}),delete s._chartjs)}function _arrayUnique(s){const e=new Set(s);return e.size===s.length?s:Array.from(e)}const requestAnimFrame=function(){return typeof window>"u"?function(s){return s()}:window.requestAnimationFrame}();function throttled(s,e){let t=[],i=!1;return function(...n){t=n,i||(i=!0,requestAnimFrame.call(window,()=>{i=!1,s.apply(e,t)}))}}function debounce$3(s,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(s,e,i)):s.apply(this,i),e}}const _toLeftRightCenter=s=>s==="start"?"left":s==="end"?"right":"center",_alignStartEnd=(s,e,t)=>s==="start"?e:s==="end"?t:(e+t)/2,_textX=(s,e,t,i)=>s===(i?"left":"right")?t:s==="center"?(e+t)/2:e;function _getStartAndCountOfVisiblePoints(s,e,t){const i=e.length;let n=0,o=i;if(s._sorted){const{iScale:r,_parsed:a}=s,l=r.axis,{min:d,max:h,minDefined:p,maxDefined:m}=r.getUserBounds();p&&(n=_limitValue(Math.min(_lookupByKey(a,l,d).lo,t?i:_lookupByKey(e,l,r.getPixelForValue(d)).lo),0,i-1)),m?o=_limitValue(Math.max(_lookupByKey(a,r.axis,h,!0).hi+1,t?0:_lookupByKey(e,l,r.getPixelForValue(h),!0).hi+1),n,i)-n:o=i-n}return{start:n,count:o}}function _scaleRangesChanged(s){const{xScale:e,yScale:t,_scaleRanges:i}=s,n={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return s._scaleRanges=n,!0;const o=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,n),o}const atEdge=s=>s===0||s===1,elasticIn=(s,e,t)=>-(Math.pow(2,10*(s-=1))*Math.sin((s-e)*TAU/t)),elasticOut=(s,e,t)=>Math.pow(2,-10*s)*Math.sin((s-e)*TAU/t)+1,effects={linear:s=>s,easeInQuad:s=>s*s,easeOutQuad:s=>-s*(s-2),easeInOutQuad:s=>(s/=.5)<1?.5*s*s:-.5*(--s*(s-2)-1),easeInCubic:s=>s*s*s,easeOutCubic:s=>(s-=1)*s*s+1,easeInOutCubic:s=>(s/=.5)<1?.5*s*s*s:.5*((s-=2)*s*s+2),easeInQuart:s=>s*s*s*s,easeOutQuart:s=>-((s-=1)*s*s*s-1),easeInOutQuart:s=>(s/=.5)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2),easeInQuint:s=>s*s*s*s*s,easeOutQuint:s=>(s-=1)*s*s*s*s+1,easeInOutQuint:s=>(s/=.5)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2),easeInSine:s=>-Math.cos(s*HALF_PI)+1,easeOutSine:s=>Math.sin(s*HALF_PI),easeInOutSine:s=>-.5*(Math.cos(PI*s)-1),easeInExpo:s=>s===0?0:Math.pow(2,10*(s-1)),easeOutExpo:s=>s===1?1:-Math.pow(2,-10*s)+1,easeInOutExpo:s=>atEdge(s)?s:s<.5?.5*Math.pow(2,10*(s*2-1)):.5*(-Math.pow(2,-10*(s*2-1))+2),easeInCirc:s=>s>=1?s:-(Math.sqrt(1-s*s)-1),easeOutCirc:s=>Math.sqrt(1-(s-=1)*s),easeInOutCirc:s=>(s/=.5)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1),easeInElastic:s=>atEdge(s)?s:elasticIn(s,.075,.3),easeOutElastic:s=>atEdge(s)?s:elasticOut(s,.075,.3),easeInOutElastic(s){return atEdge(s)?s:s<.5?.5*elasticIn(s*2,.1125,.45):.5+.5*elasticOut(s*2-1,.1125,.45)},easeInBack(s){return s*s*((1.70158+1)*s-1.70158)},easeOutBack(s){return(s-=1)*s*((1.70158+1)*s+1.70158)+1},easeInOutBack(s){let e=1.70158;return(s/=.5)<1?.5*(s*s*(((e*=1.525)+1)*s-e)):.5*((s-=2)*s*(((e*=1.525)+1)*s+e)+2)},easeInBounce:s=>1-effects.easeOutBounce(1-s),easeOutBounce(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},easeInOutBounce:s=>s<.5?effects.easeInBounce(s*2)*.5:effects.easeOutBounce(s*2-1)*.5+.5};function isPatternOrGradient(s){if(s&&typeof s=="object"){const e=s.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function color(s){return isPatternOrGradient(s)?s:new Color(s)}function getHoverColor(s){return isPatternOrGradient(s)?s:new Color(s).saturate(.5).darken(.1).hexString()}const numbers=["x","y","borderWidth","radius","tension"],colors=["color","borderColor","backgroundColor"];function applyAnimationsDefaults(s){s.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),s.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),s.set("animations",{colors:{type:"color",properties:colors},numbers:{type:"number",properties:numbers}}),s.describe("animations",{_fallback:"animation"}),s.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function applyLayoutsDefaults(s){s.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const intlCache=new Map;function getNumberFormat(s,e){e=e||{};const t=s+JSON.stringify(e);let i=intlCache.get(t);return i||(i=new Intl.NumberFormat(s,e),intlCache.set(t,i)),i}function formatNumber(s,e,t){return getNumberFormat(e,t).format(s)}const formatters={values(s){return isArray(s)?s:""+s},numeric(s,e,t){if(s===0)return"0";const i=this.chart.options.locale;let n,o=s;if(t.length>1){const d=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(d<1e-4||d>1e15)&&(n="scientific"),o=calculateDelta(s,t)}const r=log10(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),formatNumber(s,i,l)},logarithmic(s,e,t){if(s===0)return"0";const i=t[e].significand||s/Math.pow(10,Math.floor(log10(s)));return[1,2,3,5,10,15].includes(i)||e>.8*t.length?formatters.numeric.call(this,s,e,t):""}};function calculateDelta(s,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&s!==Math.floor(s)&&(t=s-Math.floor(s)),t}var Ticks={formatters};function applyScaleDefaults(s){s.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ticks.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),s.route("scale.ticks","color","","color"),s.route("scale.grid","color","","borderColor"),s.route("scale.border","color","","borderColor"),s.route("scale.title","color","","color"),s.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),s.describe("scales",{_fallback:"scale"}),s.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const overrides=Object.create(null),descriptors=Object.create(null);function getScope$1(s,e){if(!e)return s;const t=e.split(".");for(let i=0,n=t.length;i<n;++i){const o=t[i];s=s[o]||(s[o]=Object.create(null))}return s}function set(s,e,t){return typeof e=="string"?merge(getScope$1(s,e),t):merge(getScope$1(s,""),e)}class Defaults{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,n)=>getHoverColor(n.backgroundColor),this.hoverBorderColor=(i,n)=>getHoverColor(n.borderColor),this.hoverColor=(i,n)=>getHoverColor(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return set(this,e,t)}get(e){return getScope$1(this,e)}describe(e,t){return set(descriptors,e,t)}override(e,t){return set(overrides,e,t)}route(e,t,i,n){const o=getScope$1(this,e),r=getScope$1(this,i),a="_"+t;Object.defineProperties(o,{[a]:{value:o[t],writable:!0},[t]:{enumerable:!0,get(){const l=this[a],d=r[n];return isObject(l)?Object.assign({},d,l):valueOrDefault(l,d)},set(l){this[a]=l}}})}apply(e){e.forEach(t=>t(this))}}var defaults=new Defaults({_scriptable:s=>!s.startsWith("on"),_indexable:s=>s!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[applyAnimationsDefaults,applyLayoutsDefaults,applyScaleDefaults]);function toFontString(s){return!s||isNullOrUndef(s.size)||isNullOrUndef(s.family)?null:(s.style?s.style+" ":"")+(s.weight?s.weight+" ":"")+s.size+"px "+s.family}function _measureText(s,e,t,i,n){let o=e[n];return o||(o=e[n]=s.measureText(n).width,t.push(n)),o>i&&(i=o),i}function _longestText(s,e,t,i){i=i||{};let n=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==e&&(n=i.data={},o=i.garbageCollect=[],i.font=e),s.save(),s.font=e;let r=0;const a=t.length;let l,d,h,p,m;for(l=0;l<a;l++)if(p=t[l],p!=null&&!isArray(p))r=_measureText(s,n,o,r,p);else if(isArray(p))for(d=0,h=p.length;d<h;d++)m=p[d],m!=null&&!isArray(m)&&(r=_measureText(s,n,o,r,m));s.restore();const v=o.length/2;if(v>t.length){for(l=0;l<v;l++)delete n[o[l]];o.splice(0,v)}return r}function _alignPixel(s,e,t){const i=s.currentDevicePixelRatio,n=t!==0?Math.max(t/2,.5):0;return Math.round((e-n)*i)/i+n}function clearCanvas(s,e){e=e||s.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,s.width,s.height),e.restore()}function drawPoint(s,e,t,i){drawPointLegend(s,e,t,i,null)}function drawPointLegend(s,e,t,i,n){let o,r,a,l,d,h,p,m;const v=e.pointStyle,y=e.rotation,b=e.radius;let S=(y||0)*RAD_PER_DEG;if(v&&typeof v=="object"&&(o=v.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){s.save(),s.translate(t,i),s.rotate(S),s.drawImage(v,-v.width/2,-v.height/2,v.width,v.height),s.restore();return}if(!(isNaN(b)||b<=0)){switch(s.beginPath(),v){default:n?s.ellipse(t,i,n/2,b,0,0,TAU):s.arc(t,i,b,0,TAU),s.closePath();break;case"triangle":h=n?n/2:b,s.moveTo(t+Math.sin(S)*h,i-Math.cos(S)*b),S+=TWO_THIRDS_PI,s.lineTo(t+Math.sin(S)*h,i-Math.cos(S)*b),S+=TWO_THIRDS_PI,s.lineTo(t+Math.sin(S)*h,i-Math.cos(S)*b),s.closePath();break;case"rectRounded":d=b*.516,l=b-d,r=Math.cos(S+QUARTER_PI)*l,p=Math.cos(S+QUARTER_PI)*(n?n/2-d:l),a=Math.sin(S+QUARTER_PI)*l,m=Math.sin(S+QUARTER_PI)*(n?n/2-d:l),s.arc(t-p,i-a,d,S-PI,S-HALF_PI),s.arc(t+m,i-r,d,S-HALF_PI,S),s.arc(t+p,i+a,d,S,S+HALF_PI),s.arc(t-m,i+r,d,S+HALF_PI,S+PI),s.closePath();break;case"rect":if(!y){l=Math.SQRT1_2*b,h=n?n/2:l,s.rect(t-h,i-l,2*h,2*l);break}S+=QUARTER_PI;case"rectRot":p=Math.cos(S)*(n?n/2:b),r=Math.cos(S)*b,a=Math.sin(S)*b,m=Math.sin(S)*(n?n/2:b),s.moveTo(t-p,i-a),s.lineTo(t+m,i-r),s.lineTo(t+p,i+a),s.lineTo(t-m,i+r),s.closePath();break;case"crossRot":S+=QUARTER_PI;case"cross":p=Math.cos(S)*(n?n/2:b),r=Math.cos(S)*b,a=Math.sin(S)*b,m=Math.sin(S)*(n?n/2:b),s.moveTo(t-p,i-a),s.lineTo(t+p,i+a),s.moveTo(t+m,i-r),s.lineTo(t-m,i+r);break;case"star":p=Math.cos(S)*(n?n/2:b),r=Math.cos(S)*b,a=Math.sin(S)*b,m=Math.sin(S)*(n?n/2:b),s.moveTo(t-p,i-a),s.lineTo(t+p,i+a),s.moveTo(t+m,i-r),s.lineTo(t-m,i+r),S+=QUARTER_PI,p=Math.cos(S)*(n?n/2:b),r=Math.cos(S)*b,a=Math.sin(S)*b,m=Math.sin(S)*(n?n/2:b),s.moveTo(t-p,i-a),s.lineTo(t+p,i+a),s.moveTo(t+m,i-r),s.lineTo(t-m,i+r);break;case"line":r=n?n/2:Math.cos(S)*b,a=Math.sin(S)*b,s.moveTo(t-r,i-a),s.lineTo(t+r,i+a);break;case"dash":s.moveTo(t,i),s.lineTo(t+Math.cos(S)*(n?n/2:b),i+Math.sin(S)*b);break;case!1:s.closePath();break}s.fill(),e.borderWidth>0&&s.stroke()}}function _isPointInArea(s,e,t){return t=t||.5,!e||s&&s.x>e.left-t&&s.x<e.right+t&&s.y>e.top-t&&s.y<e.bottom+t}function clipArea(s,e){s.save(),s.beginPath(),s.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),s.clip()}function unclipArea(s){s.restore()}function _steppedLineTo(s,e,t,i,n){if(!e)return s.lineTo(t.x,t.y);if(n==="middle"){const o=(e.x+t.x)/2;s.lineTo(o,e.y),s.lineTo(o,t.y)}else n==="after"!=!!i?s.lineTo(e.x,t.y):s.lineTo(t.x,e.y);s.lineTo(t.x,t.y)}function _bezierCurveTo(s,e,t,i){if(!e)return s.lineTo(t.x,t.y);s.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function setRenderOpts(s,e){e.translation&&s.translate(e.translation[0],e.translation[1]),isNullOrUndef(e.rotation)||s.rotate(e.rotation),e.color&&(s.fillStyle=e.color),e.textAlign&&(s.textAlign=e.textAlign),e.textBaseline&&(s.textBaseline=e.textBaseline)}function decorateText(s,e,t,i,n){if(n.strikethrough||n.underline){const o=s.measureText(i),r=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,l=t-o.actualBoundingBoxAscent,d=t+o.actualBoundingBoxDescent,h=n.strikethrough?(l+d)/2:d;s.strokeStyle=s.fillStyle,s.beginPath(),s.lineWidth=n.decorationWidth||2,s.moveTo(r,h),s.lineTo(a,h),s.stroke()}}function drawBackdrop(s,e){const t=s.fillStyle;s.fillStyle=e.color,s.fillRect(e.left,e.top,e.width,e.height),s.fillStyle=t}function renderText(s,e,t,i,n,o={}){const r=isArray(e)?e:[e],a=o.strokeWidth>0&&o.strokeColor!=="";let l,d;for(s.save(),s.font=n.string,setRenderOpts(s,o),l=0;l<r.length;++l)d=r[l],o.backdrop&&drawBackdrop(s,o.backdrop),a&&(o.strokeColor&&(s.strokeStyle=o.strokeColor),isNullOrUndef(o.strokeWidth)||(s.lineWidth=o.strokeWidth),s.strokeText(d,t,i,o.maxWidth)),s.fillText(d,t,i,o.maxWidth),decorateText(s,t,i,d,o),i+=Number(n.lineHeight);s.restore()}function addRoundedRectPath(s,e){const{x:t,y:i,w:n,h:o,radius:r}=e;s.arc(t+r.topLeft,i+r.topLeft,r.topLeft,1.5*PI,PI,!0),s.lineTo(t,i+o-r.bottomLeft),s.arc(t+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,PI,HALF_PI,!0),s.lineTo(t+n-r.bottomRight,i+o),s.arc(t+n-r.bottomRight,i+o-r.bottomRight,r.bottomRight,HALF_PI,0,!0),s.lineTo(t+n,i+r.topRight),s.arc(t+n-r.topRight,i+r.topRight,r.topRight,0,-HALF_PI,!0),s.lineTo(t+r.topLeft,i)}const LINE_HEIGHT=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,FONT_STYLE=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function toLineHeight(s,e){const t=(""+s).match(LINE_HEIGHT);if(!t||t[1]==="normal")return e*1.2;switch(s=+t[2],t[3]){case"px":return s;case"%":s/=100;break}return e*s}const numberOrZero=s=>+s||0;function _readValueToProps(s,e){const t={},i=isObject(e),n=i?Object.keys(e):e,o=isObject(s)?i?r=>valueOrDefault(s[r],s[e[r]]):r=>s[r]:()=>s;for(const r of n)t[r]=numberOrZero(o(r));return t}function toTRBL(s){return _readValueToProps(s,{top:"y",right:"x",bottom:"y",left:"x"})}function toTRBLCorners(s){return _readValueToProps(s,["topLeft","topRight","bottomLeft","bottomRight"])}function toPadding(s){const e=toTRBL(s);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function toFont(s,e){s=s||{},e=e||defaults.font;let t=valueOrDefault(s.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=valueOrDefault(s.style,e.style);i&&!(""+i).match(FONT_STYLE)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const n={family:valueOrDefault(s.family,e.family),lineHeight:toLineHeight(valueOrDefault(s.lineHeight,e.lineHeight),t),size:t,style:i,weight:valueOrDefault(s.weight,e.weight),string:""};return n.string=toFontString(n),n}function resolve(s,e,t,i){let n=!0,o,r,a;for(o=0,r=s.length;o<r;++o)if(a=s[o],a!==void 0&&(e!==void 0&&typeof a=="function"&&(a=a(e),n=!1),t!==void 0&&isArray(a)&&(a=a[t%a.length],n=!1),a!==void 0))return i&&!n&&(i.cacheable=!1),a}function _addGrace(s,e,t){const{min:i,max:n}=s,o=toDimension(e,(n-i)/2),r=(a,l)=>t&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(n,o)}}function createContext(s,e){return Object.assign(Object.create(s),e)}function _createResolver(s,e=[""],t,i,n=()=>s[0]){const o=t||s;typeof i>"u"&&(i=_resolve("_fallback",s));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:s,_rootScopes:o,_fallback:i,_getTarget:n,override:a=>_createResolver([a,...s],e,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete s[0][l],!0},get(a,l){return _cached(a,l,()=>_resolveWithPrefixes(l,e,s,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(s[0])},has(a,l){return getKeysFromAllScopes(a).includes(l)},ownKeys(a){return getKeysFromAllScopes(a)},set(a,l,d){const h=a._storage||(a._storage=n());return a[l]=h[l]=d,delete a._keys,!0}})}function _attachContext(s,e,t,i){const n={_cacheable:!1,_proxy:s,_context:e,_subProxy:t,_stack:new Set,_descriptors:_descriptors(s,i),setContext:o=>_attachContext(s,o,t,i),override:o=>_attachContext(s.override(o),e,t,i)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete s[r],!0},get(o,r,a){return _cached(o,r,()=>_resolveWithContext(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(s,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(s,r)},getPrototypeOf(){return Reflect.getPrototypeOf(s)},has(o,r){return Reflect.has(s,r)},ownKeys(){return Reflect.ownKeys(s)},set(o,r,a){return s[r]=a,delete o[r],!0}})}function _descriptors(s,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:n=e.allKeys}=s;return{allKeys:n,scriptable:t,indexable:i,isScriptable:isFunction$1(t)?t:()=>t,isIndexable:isFunction$1(i)?i:()=>i}}const readKey=(s,e)=>s?s+_capitalize(e):e,needsSubResolver=(s,e)=>isObject(e)&&s!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function _cached(s,e,t){if(Object.prototype.hasOwnProperty.call(s,e))return s[e];const i=t();return s[e]=i,i}function _resolveWithContext(s,e,t){const{_proxy:i,_context:n,_subProxy:o,_descriptors:r}=s;let a=i[e];return isFunction$1(a)&&r.isScriptable(e)&&(a=_resolveScriptable(e,a,s,t)),isArray(a)&&a.length&&(a=_resolveArray(e,a,s,r.isIndexable)),needsSubResolver(e,a)&&(a=_attachContext(a,n,o&&o[e],r)),a}function _resolveScriptable(s,e,t,i){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=t;if(a.has(s))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+s);a.add(s);let l=e(o,r||i);return a.delete(s),needsSubResolver(s,l)&&(l=createSubResolver(n._scopes,n,s,l)),l}function _resolveArray(s,e,t,i){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=t;if(typeof o.index<"u"&&i(s))return e[o.index%e.length];if(isObject(e[0])){const l=e,d=n._scopes.filter(h=>h!==l);e=[];for(const h of l){const p=createSubResolver(d,n,s,h);e.push(_attachContext(p,o,r&&r[s],a))}}return e}function resolveFallback(s,e,t){return isFunction$1(s)?s(e,t):s}const getScope=(s,e)=>s===!0?e:typeof s=="string"?resolveObjectKey(e,s):void 0;function addScopes(s,e,t,i,n){for(const o of e){const r=getScope(t,o);if(r){s.add(r);const a=resolveFallback(r._fallback,t,n);if(typeof a<"u"&&a!==t&&a!==i)return a}else if(r===!1&&typeof i<"u"&&t!==i)return null}return!1}function createSubResolver(s,e,t,i){const n=e._rootScopes,o=resolveFallback(e._fallback,t,i),r=[...s,...n],a=new Set;a.add(i);let l=addScopesFromKey(a,r,t,o||t,i);return l===null||typeof o<"u"&&o!==t&&(l=addScopesFromKey(a,r,o,l,i),l===null)?!1:_createResolver(Array.from(a),[""],n,o,()=>subGetTarget(e,t,i))}function addScopesFromKey(s,e,t,i,n){for(;t;)t=addScopes(s,e,t,i,n);return t}function subGetTarget(s,e,t){const i=s._getTarget();e in i||(i[e]={});const n=i[e];return isArray(n)&&isObject(t)?t:n||{}}function _resolveWithPrefixes(s,e,t,i){let n;for(const o of e)if(n=_resolve(readKey(o,s),t),typeof n<"u")return needsSubResolver(s,n)?createSubResolver(t,i,s,n):n}function _resolve(s,e){for(const t of e){if(!t)continue;const i=t[s];if(typeof i<"u")return i}}function getKeysFromAllScopes(s){let e=s._keys;return e||(e=s._keys=resolveKeysFromAllScopes(s._scopes)),e}function resolveKeysFromAllScopes(s){const e=new Set;for(const t of s)for(const i of Object.keys(t).filter(n=>!n.startsWith("_")))e.add(i);return Array.from(e)}function _parseObjectDataRadialScale(s,e,t,i){const{iScale:n}=s,{key:o="r"}=this._parsing,r=new Array(i);let a,l,d,h;for(a=0,l=i;a<l;++a)d=a+t,h=e[d],r[a]={r:n.parse(resolveObjectKey(h,o),d)};return r}const EPSILON=Number.EPSILON||1e-14,getPoint=(s,e)=>e<s.length&&!s[e].skip&&s[e],getValueAxis=s=>s==="x"?"y":"x";function splineCurve(s,e,t,i){const n=s.skip?e:s,o=e,r=t.skip?e:t,a=distanceBetweenPoints(o,n),l=distanceBetweenPoints(r,o);let d=a/(a+l),h=l/(a+l);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const p=i*d,m=i*h;return{previous:{x:o.x-p*(r.x-n.x),y:o.y-p*(r.y-n.y)},next:{x:o.x+m*(r.x-n.x),y:o.y+m*(r.y-n.y)}}}function monotoneAdjust(s,e,t){const i=s.length;let n,o,r,a,l,d=getPoint(s,0);for(let h=0;h<i-1;++h)if(l=d,d=getPoint(s,h+1),!(!l||!d)){if(almostEquals(e[h],0,EPSILON)){t[h]=t[h+1]=0;continue}n=t[h]/e[h],o=t[h+1]/e[h],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),t[h]=n*r*e[h],t[h+1]=o*r*e[h])}}function monotoneCompute(s,e,t="x"){const i=getValueAxis(t),n=s.length;let o,r,a,l=getPoint(s,0);for(let d=0;d<n;++d){if(r=a,a=l,l=getPoint(s,d+1),!a)continue;const h=a[t],p=a[i];r&&(o=(h-r[t])/3,a[`cp1${t}`]=h-o,a[`cp1${i}`]=p-o*e[d]),l&&(o=(l[t]-h)/3,a[`cp2${t}`]=h+o,a[`cp2${i}`]=p+o*e[d])}}function splineCurveMonotone(s,e="x"){const t=getValueAxis(e),i=s.length,n=Array(i).fill(0),o=Array(i);let r,a,l,d=getPoint(s,0);for(r=0;r<i;++r)if(a=l,l=d,d=getPoint(s,r+1),!!l){if(d){const h=d[e]-l[e];n[r]=h!==0?(d[t]-l[t])/h:0}o[r]=a?d?sign(n[r-1])!==sign(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}monotoneAdjust(s,n,o),monotoneCompute(s,o,e)}function capControlPoint(s,e,t){return Math.max(Math.min(s,t),e)}function capBezierPoints(s,e){let t,i,n,o,r,a=_isPointInArea(s[0],e);for(t=0,i=s.length;t<i;++t)r=o,o=a,a=t<i-1&&_isPointInArea(s[t+1],e),o&&(n=s[t],r&&(n.cp1x=capControlPoint(n.cp1x,e.left,e.right),n.cp1y=capControlPoint(n.cp1y,e.top,e.bottom)),a&&(n.cp2x=capControlPoint(n.cp2x,e.left,e.right),n.cp2y=capControlPoint(n.cp2y,e.top,e.bottom)))}function _updateBezierControlPoints(s,e,t,i,n){let o,r,a,l;if(e.spanGaps&&(s=s.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")splineCurveMonotone(s,n);else{let d=i?s[s.length-1]:s[0];for(o=0,r=s.length;o<r;++o)a=s[o],l=splineCurve(d,a,s[Math.min(o+1,r-(i?0:1))%r],e.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,d=a}e.capBezierPoints&&capBezierPoints(s,t)}function _isDomSupported(){return typeof window<"u"&&typeof document<"u"}function _getParentNode(s){let e=s.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function parseMaxStyle(s,e,t){let i;return typeof s=="string"?(i=parseInt(s,10),s.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=s,i}const getComputedStyle$1=s=>s.ownerDocument.defaultView.getComputedStyle(s,null);function getStyle(s,e){return getComputedStyle$1(s).getPropertyValue(e)}const positions=["top","right","bottom","left"];function getPositionedStyle(s,e,t){const i={};t=t?"-"+t:"";for(let n=0;n<4;n++){const o=positions[n];i[o]=parseFloat(s[e+"-"+o+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const useOffsetPos=(s,e,t)=>(s>0||e>0)&&(!t||!t.shadowRoot);function getCanvasPosition(s,e){const t=s.touches,i=t&&t.length?t[0]:s,{offsetX:n,offsetY:o}=i;let r=!1,a,l;if(useOffsetPos(n,o,s.target))a=n,l=o;else{const d=e.getBoundingClientRect();a=i.clientX-d.left,l=i.clientY-d.top,r=!0}return{x:a,y:l,box:r}}function getRelativePosition(s,e){if("native"in s)return s;const{canvas:t,currentDevicePixelRatio:i}=e,n=getComputedStyle$1(t),o=n.boxSizing==="border-box",r=getPositionedStyle(n,"padding"),a=getPositionedStyle(n,"border","width"),{x:l,y:d,box:h}=getCanvasPosition(s,t),p=r.left+(h&&a.left),m=r.top+(h&&a.top);let{width:v,height:y}=e;return o&&(v-=r.width+a.width,y-=r.height+a.height),{x:Math.round((l-p)/v*t.width/i),y:Math.round((d-m)/y*t.height/i)}}function getContainerSize(s,e,t){let i,n;if(e===void 0||t===void 0){const o=_getParentNode(s);if(!o)e=s.clientWidth,t=s.clientHeight;else{const r=o.getBoundingClientRect(),a=getComputedStyle$1(o),l=getPositionedStyle(a,"border","width"),d=getPositionedStyle(a,"padding");e=r.width-d.width-l.width,t=r.height-d.height-l.height,i=parseMaxStyle(a.maxWidth,o,"clientWidth"),n=parseMaxStyle(a.maxHeight,o,"clientHeight")}}return{width:e,height:t,maxWidth:i||INFINITY,maxHeight:n||INFINITY}}const round1=s=>Math.round(s*10)/10;function getMaximumSize(s,e,t,i){const n=getComputedStyle$1(s),o=getPositionedStyle(n,"margin"),r=parseMaxStyle(n.maxWidth,s,"clientWidth")||INFINITY,a=parseMaxStyle(n.maxHeight,s,"clientHeight")||INFINITY,l=getContainerSize(s,e,t);let{width:d,height:h}=l;if(n.boxSizing==="content-box"){const m=getPositionedStyle(n,"border","width"),v=getPositionedStyle(n,"padding");d-=v.width+m.width,h-=v.height+m.height}return d=Math.max(0,d-o.width),h=Math.max(0,i?d/i:h-o.height),d=round1(Math.min(d,r,l.maxWidth)),h=round1(Math.min(h,a,l.maxHeight)),d&&!h&&(h=round1(d/2)),(e!==void 0||t!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,d=round1(Math.floor(h*i))),{width:d,height:h}}function retinaScale(s,e,t){const i=e||1,n=Math.floor(s.height*i),o=Math.floor(s.width*i);s.height=Math.floor(s.height),s.width=Math.floor(s.width);const r=s.canvas;return r.style&&(t||!r.style.height&&!r.style.width)&&(r.style.height=`${s.height}px`,r.style.width=`${s.width}px`),s.currentDevicePixelRatio!==i||r.height!==n||r.width!==o?(s.currentDevicePixelRatio=i,r.height=n,r.width=o,s.ctx.setTransform(i,0,0,i,0,0),!0):!1}const supportsEventListenerOptions=function(){let s=!1;try{const e={get passive(){return s=!0,!1}};_isDomSupported()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return s}();function readUsedSize(s,e){const t=getStyle(s,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function _pointInLine(s,e,t,i){return{x:s.x+t*(e.x-s.x),y:s.y+t*(e.y-s.y)}}function _steppedInterpolation(s,e,t,i){return{x:s.x+t*(e.x-s.x),y:i==="middle"?t<.5?s.y:e.y:i==="after"?t<1?s.y:e.y:t>0?e.y:s.y}}function _bezierInterpolation(s,e,t,i){const n={x:s.cp2x,y:s.cp2y},o={x:e.cp1x,y:e.cp1y},r=_pointInLine(s,n,t),a=_pointInLine(n,o,t),l=_pointInLine(o,e,t),d=_pointInLine(r,a,t),h=_pointInLine(a,l,t);return _pointInLine(d,h,t)}const getRightToLeftAdapter=function(s,e){return{x(t){return s+s+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}},getLeftToRightAdapter=function(){return{x(s){return s},setWidth(s){},textAlign(s){return s},xPlus(s,e){return s+e},leftForLtr(s,e){return s}}};function getRtlAdapter(s,e,t){return s?getRightToLeftAdapter(e,t):getLeftToRightAdapter()}function overrideTextDirection(s,e){let t,i;(e==="ltr"||e==="rtl")&&(t=s.canvas.style,i=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),s.prevTextDirection=i)}function restoreTextDirection(s,e){e!==void 0&&(delete s.prevTextDirection,s.canvas.style.setProperty("direction",e[0],e[1]))}function propertyFn(s){return s==="angle"?{between:_angleBetween,compare:_angleDiff,normalize:_normalizeAngle}:{between:_isBetween,compare:(e,t)=>e-t,normalize:e=>e}}function normalizeSegment({start:s,end:e,count:t,loop:i,style:n}){return{start:s%t,end:e%t,loop:i&&(e-s+1)%t===0,style:n}}function getSegment(s,e,t){const{property:i,start:n,end:o}=t,{between:r,normalize:a}=propertyFn(i),l=e.length;let{start:d,end:h,loop:p}=s,m,v;if(p){for(d+=l,h+=l,m=0,v=l;m<v&&r(a(e[d%l][i]),n,o);++m)d--,h--;d%=l,h%=l}return h<d&&(h+=l),{start:d,end:h,loop:p,style:s.style}}function _boundSegment(s,e,t){if(!t)return[s];const{property:i,start:n,end:o}=t,r=e.length,{compare:a,between:l,normalize:d}=propertyFn(i),{start:h,end:p,loop:m,style:v}=getSegment(s,e,t),y=[];let b=!1,S=null,E,T,R;const A=()=>l(n,R,E)&&a(n,R)!==0,D=()=>a(o,E)===0||l(o,R,E),x=()=>b||A(),M=()=>!b||D();for(let I=h,V=h;I<=p;++I)T=e[I%r],!T.skip&&(E=d(T[i]),E!==R&&(b=l(E,n,o),S===null&&x()&&(S=a(E,n)===0?I:V),S!==null&&M()&&(y.push(normalizeSegment({start:S,end:I,loop:m,count:r,style:v})),S=null),V=I,R=E));return S!==null&&y.push(normalizeSegment({start:S,end:p,loop:m,count:r,style:v})),y}function _boundSegments(s,e){const t=[],i=s.segments;for(let n=0;n<i.length;n++){const o=_boundSegment(i[n],s.points,e);o.length&&t.push(...o)}return t}function findStartAndEnd(s,e,t,i){let n=0,o=e-1;if(t&&!i)for(;n<e&&!s[n].skip;)n++;for(;n<e&&s[n].skip;)n++;for(n%=e,t&&(o+=n);o>n&&s[o%e].skip;)o--;return o%=e,{start:n,end:o}}function solidSegments(s,e,t,i){const n=s.length,o=[];let r=e,a=s[e],l;for(l=e+1;l<=t;++l){const d=s[l%n];d.skip||d.stop?a.skip||(i=!1,o.push({start:e%n,end:(l-1)%n,loop:i}),e=r=d.stop?l:null):(r=l,a.skip&&(e=l)),a=d}return r!==null&&o.push({start:e%n,end:r%n,loop:i}),o}function _computeSegments(s,e){const t=s.points,i=s.options.spanGaps,n=t.length;if(!n)return[];const o=!!s._loop,{start:r,end:a}=findStartAndEnd(t,n,o,i);if(i===!0)return splitByStyles(s,[{start:r,end:a,loop:o}],t,e);const l=a<r?a+n:a,d=!!s._fullLoop&&r===0&&a===n-1;return splitByStyles(s,solidSegments(t,r,l,d),t,e)}function splitByStyles(s,e,t,i){return!i||!i.setContext||!t?e:doSplitByStyles(s,e,t,i)}function doSplitByStyles(s,e,t,i){const n=s._chart.getContext(),o=readStyle(s.options),{_datasetIndex:r,options:{spanGaps:a}}=s,l=t.length,d=[];let h=o,p=e[0].start,m=p;function v(y,b,S,E){const T=a?-1:1;if(y!==b){for(y+=l;t[y%l].skip;)y-=T;for(;t[b%l].skip;)b+=T;y%l!==b%l&&(d.push({start:y%l,end:b%l,loop:S,style:E}),h=E,p=b%l)}}for(const y of e){p=a?p:y.start;let b=t[p%l],S;for(m=p+1;m<=y.end;m++){const E=t[m%l];S=readStyle(i.setContext(createContext(n,{type:"segment",p0:b,p1:E,p0DataIndex:(m-1)%l,p1DataIndex:m%l,datasetIndex:r}))),styleChanged(S,h)&&v(p,m-1,y.loop,h),b=E,h=S}p<m-1&&v(p,m-1,y.loop,h)}return d}function readStyle(s){return{backgroundColor:s.backgroundColor,borderCapStyle:s.borderCapStyle,borderDash:s.borderDash,borderDashOffset:s.borderDashOffset,borderJoinStyle:s.borderJoinStyle,borderWidth:s.borderWidth,borderColor:s.borderColor}}function styleChanged(s,e){if(!e)return!1;const t=[],i=function(n,o){return isPatternOrGradient(o)?(t.includes(o)||t.push(o),t.indexOf(o)):o};return JSON.stringify(s,i)!==JSON.stringify(e,i)}/*!
|
||
* Chart.js v4.4.2
|
||
* https://www.chartjs.org
|
||
* (c) 2024 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/class Animator{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,n){const o=t.listeners[n],r=t.duration;o.forEach(a=>a({chart:e,initial:t.initial,numSteps:r,currentStep:Math.min(i-t.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=requestAnimFrame.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(e),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,i,e,"progress")),o.length||(i.running=!1,this._notify(n,i,e,"complete"),i.initial=!1),t+=o.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,n)=>Math.max(i,n._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var animator=new Animator;const transparent="transparent",interpolators={boolean(s,e,t){return t>.5?e:s},color(s,e,t){const i=color(s||transparent),n=i.valid&&color(e||transparent);return n&&n.valid?n.mix(i,t).hexString():e},number(s,e,t){return s+(e-s)*t}};class Animation{constructor(e,t,i,n){const o=t[i];n=resolve([e.to,n,o,e.from]);const r=resolve([e.from,o,n]);this._active=!0,this._fn=e.fn||interpolators[e.type||typeof r],this._easing=effects[e.easing]||effects.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=resolve([e.to,t,n,e.from]),this._from=resolve([e.from,n,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||t<i),!this._active){this._target[n]=a,this._notify(!0);return}if(t<0){this._target[n]=o;return}l=t/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let n=0;n<i.length;n++)i[n][t]()}}class Animations{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!isObject(e))return;const t=Object.keys(defaults.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(n=>{const o=e[n];if(!isObject(o))return;const r={};for(const a of t)r[a]=o[a];(isArray(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!i.has(a))&&i.set(a,r)})})}_animateOptions(e,t){const i=t.options,n=resolveTargetOptions(e,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&awaitAll(e.options.$animations,i).then(()=>{e.options=i},()=>{}),o}_createAnimations(e,t){const i=this._properties,n=[],o=e.$animations||(e.$animations={}),r=Object.keys(t),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const d=r[l];if(d.charAt(0)==="$")continue;if(d==="options"){n.push(...this._animateOptions(e,t));continue}const h=t[d];let p=o[d];const m=i.get(d);if(p)if(m&&p.active()){p.update(m,h,a);continue}else p.cancel();if(!m||!m.duration){e[d]=h;continue}o[d]=p=new Animation(m,e,d,h),n.push(p)}return n}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return animator.add(this._chart,i),!0}}function awaitAll(s,e){const t=[],i=Object.keys(e);for(let n=0;n<i.length;n++){const o=s[i[n]];o&&o.active()&&t.push(o.wait())}return Promise.all(t)}function resolveTargetOptions(s,e){if(!e)return;let t=s.options;if(!t){s.options=e;return}return t.$shared&&(s.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function scaleClip(s,e){const t=s&&s.options||{},i=t.reverse,n=t.min===void 0?e:0,o=t.max===void 0?e:0;return{start:i?o:n,end:i?n:o}}function defaultClip(s,e,t){if(t===!1)return!1;const i=scaleClip(s,t),n=scaleClip(e,t);return{top:n.end,right:i.end,bottom:n.start,left:i.start}}function toClip(s){let e,t,i,n;return isObject(s)?(e=s.top,t=s.right,i=s.bottom,n=s.left):e=t=i=n=s,{top:e,right:t,bottom:i,left:n,disabled:s===!1}}function getSortedDatasetIndices(s,e){const t=[],i=s._getSortedDatasetMetas(e);let n,o;for(n=0,o=i.length;n<o;++n)t.push(i[n].index);return t}function applyStack(s,e,t,i={}){const n=s.keys,o=i.mode==="single";let r,a,l,d;if(e!==null){for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===t){if(i.all)continue;break}d=s.values[l],isNumberFinite(d)&&(o||e===0||sign(e)===sign(d))&&(e+=d)}return e}}function convertObjectDataToArray(s){const e=Object.keys(s),t=new Array(e.length);let i,n,o;for(i=0,n=e.length;i<n;++i)o=e[i],t[i]={x:o,y:s[o]};return t}function isStacked(s,e){const t=s&&s.options.stacked;return t||t===void 0&&e.stack!==void 0}function getStackKey(s,e,t){return`${s.id}.${e.id}.${t.stack||t.type}`}function getUserBounds(s){const{min:e,max:t,minDefined:i,maxDefined:n}=s.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:n?t:Number.POSITIVE_INFINITY}}function getOrCreateStack(s,e,t){const i=s[e]||(s[e]={});return i[t]||(i[t]={})}function getLastIndexInStack(s,e,t,i){for(const n of e.getMatchingVisibleMetas(i).reverse()){const o=s[n.index];if(t&&o>0||!t&&o<0)return n.index}return null}function updateStacks(s,e){const{chart:t,_cachedMeta:i}=s,n=t._stacks||(t._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,d=r.axis,h=getStackKey(o,r,i),p=e.length;let m;for(let v=0;v<p;++v){const y=e[v],{[l]:b,[d]:S}=y,E=y._stacks||(y._stacks={});m=E[d]=getOrCreateStack(n,h,b),m[a]=S,m._top=getLastIndexInStack(m,r,!0,i.type),m._bottom=getLastIndexInStack(m,r,!1,i.type);const T=m._visualValues||(m._visualValues={});T[a]=S}}function getFirstScaleId(s,e){const t=s.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function createDatasetContext(s,e){return createContext(s,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function createDataContext(s,e,t){return createContext(s,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function clearStacks(s,e){const t=s.controller.index,i=s.vScale&&s.vScale.axis;if(i){e=e||s._parsed;for(const n of e){const o=n._stacks;if(!o||o[i]===void 0||o[i][t]===void 0)return;delete o[i][t],o[i]._visualValues!==void 0&&o[i]._visualValues[t]!==void 0&&delete o[i]._visualValues[t]}}}const isDirectUpdateMode=s=>s==="reset"||s==="none",cloneIfNotShared=(s,e)=>e?s:Object.assign({},s),createStack=(s,e,t)=>s&&!e.hidden&&e._stacked&&{keys:getSortedDatasetIndices(t,!0),values:null};class DatasetController{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=isStacked(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&clearStacks(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),n=(p,m,v,y)=>p==="x"?m:p==="r"?y:v,o=t.xAxisID=valueOrDefault(i.xAxisID,getFirstScaleId(e,"x")),r=t.yAxisID=valueOrDefault(i.yAxisID,getFirstScaleId(e,"y")),a=t.rAxisID=valueOrDefault(i.rAxisID,getFirstScaleId(e,"r")),l=t.indexAxis,d=t.iAxisID=n(l,o,r,a),h=t.vAxisID=n(l,r,o,a);t.xScale=this.getScaleForId(o),t.yScale=this.getScaleForId(r),t.rScale=this.getScaleForId(a),t.iScale=this.getScaleForId(d),t.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&unlistenArrayEvents(this._data,this),e._stacked&&clearStacks(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(isObject(t))this._data=convertObjectDataToArray(t);else if(i!==t){if(i){unlistenArrayEvents(i,this);const n=this._cachedMeta;clearStacks(n),n._parsed=[]}t&&Object.isExtensible(t)&&listenArrayEvents(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const o=t._stacked;t._stacked=isStacked(t.vScale,t),t.stack!==i.stack&&(n=!0,clearStacks(t),t.stack=i.stack),this._resyncElements(e),(n||o!==t._stacked)&&updateStacks(this,t._parsed)}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),i=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=e===0&&t===n.length?!0:i._sorted,d=e>0&&i._parsed[e-1],h,p,m;if(this._parsing===!1)i._parsed=n,i._sorted=!0,m=n;else{isArray(n[e])?m=this.parseArrayData(i,n,e,t):isObject(n[e])?m=this.parseObjectData(i,n,e,t):m=this.parsePrimitiveData(i,n,e,t);const v=()=>p[a]===null||d&&p[a]<d[a];for(h=0;h<t;++h)i._parsed[h+e]=p=m[h],l&&(v()&&(l=!1),d=p);i._sorted=l}r&&updateStacks(this,m)}parsePrimitiveData(e,t,i,n){const{iScale:o,vScale:r}=e,a=o.axis,l=r.axis,d=o.getLabels(),h=o===r,p=new Array(n);let m,v,y;for(m=0,v=n;m<v;++m)y=m+i,p[m]={[a]:h||o.parse(d[y],y),[l]:r.parse(t[y],y)};return p}parseArrayData(e,t,i,n){const{xScale:o,yScale:r}=e,a=new Array(n);let l,d,h,p;for(l=0,d=n;l<d;++l)h=l+i,p=t[h],a[l]={x:o.parse(p[0],h),y:r.parse(p[1],h)};return a}parseObjectData(e,t,i,n){const{xScale:o,yScale:r}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,d=new Array(n);let h,p,m,v;for(h=0,p=n;h<p;++h)m=h+i,v=t[m],d[h]={x:o.parse(resolveObjectKey(v,a),m),y:r.parse(resolveObjectKey(v,l),m)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const n=this.chart,o=this._cachedMeta,r=t[e.axis],a={keys:getSortedDatasetIndices(n,!0),values:t._stacks[e.axis]._visualValues};return applyStack(a,r,o.index,{mode:i})}updateRangeFromParsed(e,t,i,n){const o=i[t.axis];let r=o===null?NaN:o;const a=n&&i._stacks[t.axis];n&&a&&(n.values=a,r=applyStack(n,o,this._cachedMeta.index)),e.min=Math.min(e.min,r),e.max=Math.max(e.max,r)}getMinMax(e,t){const i=this._cachedMeta,n=i._parsed,o=i._sorted&&e===i.iScale,r=n.length,a=this._getOtherScale(e),l=createStack(t,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:p}=getUserBounds(a);let m,v;function y(){v=n[m];const b=v[a.axis];return!isNumberFinite(v[e.axis])||h>b||p<b}for(m=0;m<r&&!(!y()&&(this.updateRangeFromParsed(d,e,v,l),o));++m);if(o){for(m=r-1;m>=0;--m)if(!y()){this.updateRangeFromParsed(d,e,v,l);break}}return d}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let n,o,r;for(n=0,o=t.length;n<o;++n)r=t[n][e.axis],isNumberFinite(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,n=t.vScale,o=this.getParsed(e);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=toClip(valueOrDefault(this.options.clip,defaultClip(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,n=i.data||[],o=t.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,d=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(e,o,a,l),h=a;h<a+l;++h){const p=n[h];p.hidden||(p.active&&d?r.push(p):p.draw(e,o))}for(h=0;h<r.length;++h)r[h].draw(e,o)}getStyle(e,t){const i=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(e||0,i)}getContext(e,t,i){const n=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const r=this._cachedMeta.data[e];o=r.$context||(r.$context=createDataContext(this.getContext(),e,r)),o.parsed=this.getParsed(e),o.raw=n.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=createDatasetContext(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!t,o.mode=i,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",i){const n=t==="active",o=this._cachedDataOpts,r=e+"-"+t,a=o[r],l=this.enableOptionSharing&&defined$1(i);if(a)return cloneIfNotShared(a,l);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,e),p=n?[`${e}Hover`,"hover",e,""]:[e,""],m=d.getOptionScopes(this.getDataset(),h),v=Object.keys(defaults.elements[e]),y=()=>this.getContext(i,n,t),b=d.resolveNamedOptions(m,v,y,p);return b.$shared&&(b.$shared=l,o[r]=Object.freeze(cloneIfNotShared(b,l))),b}_resolveAnimations(e,t,i){const n=this.chart,o=this._cachedDataOpts,r=`animation-${t}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,p=h.datasetAnimationScopeKeys(this._type,t),m=h.getOptionScopes(this.getDataset(),p);l=h.createResolver(m,this.getContext(e,i,t))}const d=new Animations(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||isDirectUpdateMode(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),n=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(t,o)||o!==n;return this.updateSharedOptions(o,t,i),{sharedOptions:o,includeOptions:r}}updateElement(e,t,i,n){isDirectUpdateMode(n)?Object.assign(e,i):this._resolveAnimations(t,n).update(e,i)}updateSharedOptions(e,t,i){e&&!isDirectUpdateMode(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,n){e.active=n;const o=this.getStyle(t,n);this._resolveAnimations(t,i,n).update(e,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[a,l,d]of this._syncList)this[a](l,d);this._syncList=[];const n=i.length,o=t.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,e):o<n&&this._removeElements(o,n-o)}_insertElements(e,t,i=!0){const n=this._cachedMeta,o=n.data,r=e+t;let a;const l=d=>{for(d.length+=t,a=d.length-1;a>=r;a--)d[a]=d[a-t]};for(l(o),a=e;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(e,t),i&&this.updateElements(o,e,t,"reset")}updateElements(e,t,i,n){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const n=i._parsed.splice(e,t);i._stacked&&clearStacks(i,n)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,n]=e;this[t](i,n)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const i=arguments.length-2;i&&this._sync(["_insertElements",e,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}G(DatasetController,"defaults",{}),G(DatasetController,"datasetElementType",null),G(DatasetController,"dataElementType",null);function getAllScaleValues(s,e){if(!s._cache.$bar){const t=s.getMatchingVisibleMetas(e);let i=[];for(let n=0,o=t.length;n<o;n++)i=i.concat(t[n].controller.getAllParsedValues(s));s._cache.$bar=_arrayUnique(i.sort((n,o)=>n-o))}return s._cache.$bar}function computeMinSampleSize(s){const e=s.iScale,t=getAllScaleValues(e,s.type);let i=e._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(defined$1(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(n=0,o=t.length;n<o;++n)r=e.getPixelForValue(t[n]),l();for(a=void 0,n=0,o=e.ticks.length;n<o;++n)r=e.getPixelForTick(n),l();return i}function computeFitCategoryTraits(s,e,t,i){const n=t.barThickness;let o,r;return isNullOrUndef(n)?(o=e.min*t.categoryPercentage,r=t.barPercentage):(o=n*i,r=1),{chunk:o/i,ratio:r,start:e.pixels[s]-o/2}}function computeFlexCategoryTraits(s,e,t,i){const n=e.pixels,o=n[s];let r=s>0?n[s-1]:null,a=s<n.length-1?n[s+1]:null;const l=t.categoryPercentage;r===null&&(r=o-(a===null?e.end-e.start:a-o)),a===null&&(a=o+o-r);const d=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/i,ratio:t.barPercentage,start:d}}function parseFloatBar(s,e,t,i){const n=t.parse(s[0],i),o=t.parse(s[1],i),r=Math.min(n,o),a=Math.max(n,o);let l=r,d=a;Math.abs(r)>Math.abs(a)&&(l=a,d=r),e[t.axis]=d,e._custom={barStart:l,barEnd:d,start:n,end:o,min:r,max:a}}function parseValue(s,e,t,i){return isArray(s)?parseFloatBar(s,e,t,i):e[t.axis]=t.parse(s,i),e}function parseArrayOrPrimitive(s,e,t,i){const n=s.iScale,o=s.vScale,r=n.getLabels(),a=n===o,l=[];let d,h,p,m;for(d=t,h=t+i;d<h;++d)m=e[d],p={},p[n.axis]=a||n.parse(r[d],d),l.push(parseValue(m,p,o,d));return l}function isFloatBar(s){return s&&s.barStart!==void 0&&s.barEnd!==void 0}function barSign(s,e,t){return s!==0?sign(s):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function borderProps(s){let e,t,i,n,o;return s.horizontal?(e=s.base>s.x,t="left",i="right"):(e=s.base<s.y,t="bottom",i="top"),e?(n="end",o="start"):(n="start",o="end"),{start:t,end:i,reverse:e,top:n,bottom:o}}function setBorderSkipped(s,e,t,i){let n=e.borderSkipped;const o={};if(!n){s.borderSkipped=o;return}if(n===!0){s.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:d,bottom:h}=borderProps(s);n==="middle"&&t&&(s.enableBorderRadius=!0,(t._top||0)===i?n=d:(t._bottom||0)===i?n=h:(o[parseEdge(h,r,a,l)]=!0,n=d)),o[parseEdge(n,r,a,l)]=!0,s.borderSkipped=o}function parseEdge(s,e,t,i){return i?(s=swap(s,e,t),s=startEnd(s,t,e)):s=startEnd(s,e,t),s}function swap(s,e,t){return s===e?t:s===t?e:s}function startEnd(s,e,t){return s==="start"?e:s==="end"?t:s}function setInflateAmount(s,{inflateAmount:e},t){s.inflateAmount=e==="auto"?t===1?.33:0:e}class BarController extends DatasetController{parsePrimitiveData(e,t,i,n){return parseArrayOrPrimitive(e,t,i,n)}parseArrayData(e,t,i,n){return parseArrayOrPrimitive(e,t,i,n)}parseObjectData(e,t,i,n){const{iScale:o,vScale:r}=e,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,d=o.axis==="x"?a:l,h=r.axis==="x"?a:l,p=[];let m,v,y,b;for(m=i,v=i+n;m<v;++m)b=t[m],y={},y[o.axis]=o.parse(resolveObjectKey(b,d),m),p.push(parseValue(resolveObjectKey(b,h),y,r,m));return p}updateRangeFromParsed(e,t,i,n){super.updateRangeFromParsed(e,t,i,n);const o=i._custom;o&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:i,vScale:n}=t,o=this.getParsed(e),r=o._custom,a=isFloatBar(r)?"["+r.start+", "+r.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,n){const o=n==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),d=a.isHorizontal(),h=this._getRuler(),{sharedOptions:p,includeOptions:m}=this._getSharedOptions(t,n);for(let v=t;v<t+i;v++){const y=this.getParsed(v),b=o||isNullOrUndef(y[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(v),S=this._calculateBarIndexPixels(v,h),E=(y._stacks||{})[a.axis],T={horizontal:d,base:b.base,enableBorderRadius:!E||isFloatBar(y._custom)||r===E._top||r===E._bottom,x:d?b.head:S.center,y:d?S.center:b.head,height:d?S.size:Math.abs(b.size),width:d?Math.abs(b.size):S.size};m&&(T.options=p||this.resolveDataElementOptions(v,e[v].active?"active":n));const R=T.options||e[v].options;setBorderSkipped(T,R,E,r),setInflateAmount(T,R,h.ratio),this.updateElement(e[v],v,T,n)}}_getStacks(e,t){const{iScale:i}=this._cachedMeta,n=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=i.options.stacked,r=[],a=l=>{const d=l.controller.getParsed(t),h=d&&d[l.vScale.axis];if(isNullOrUndef(h)||isNaN(h))return!0};for(const l of n)if(!(t!==void 0&&a(l))&&((o===!1||r.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&r.push(l.stack),l.index===e))break;return r.length||r.push(void 0),r}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const n=this._getStacks(e,i),o=t!==void 0?n.indexOf(t):-1;return o===-1?n.length-1:o}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,n=[];let o,r;for(o=0,r=t.data.length;o<r;++o)n.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const a=e.barThickness;return{min:a||computeMinSampleSize(t),pixels:n,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:i,index:n},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(e),d=l._custom,h=isFloatBar(d);let p=l[t.axis],m=0,v=i?this.applyStack(t,l,i):p,y,b;v!==p&&(m=v-p,v=p),h&&(p=d.barStart,v=d.barEnd-d.barStart,p!==0&&sign(p)!==sign(d.barEnd)&&(m=0),m+=p);const S=!isNullOrUndef(o)&&!h?o:m;let E=t.getPixelForValue(S);if(this.chart.getDataVisibility(e)?y=t.getPixelForValue(m+v):y=E,b=y-E,Math.abs(b)<r){b=barSign(b,t,a)*r,p===a&&(E-=b/2);const T=t.getPixelForDecimal(0),R=t.getPixelForDecimal(1),A=Math.min(T,R),D=Math.max(T,R);E=Math.max(Math.min(E,D),A),y=E+b,i&&!h&&(l._stacks[t.axis]._visualValues[n]=t.getValueForPixel(y)-t.getValueForPixel(E))}if(E===t.getPixelForValue(a)){const T=sign(b)*t.getLineWidthForValue(a)/2;E+=T,b-=T}return{size:b,base:E,head:y,center:y+b/2}}_calculateBarIndexPixels(e,t){const i=t.scale,n=this.options,o=n.skipNull,r=valueOrDefault(n.maxBarThickness,1/0);let a,l;if(t.grouped){const d=o?this._getStackCount(e):t.stackCount,h=n.barThickness==="flex"?computeFlexCategoryTraits(e,t,n,d):computeFitCategoryTraits(e,t,n,d),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0);a=h.start+h.chunk*p+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=i.getPixelForValue(this.getParsed(e)[i.axis],e),l=Math.min(r,t.min*t.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,n=i.length;let o=0;for(;o<n;++o)this.getParsed(o)[t.axis]!==null&&i[o].draw(this._ctx)}}G(BarController,"id","bar"),G(BarController,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),G(BarController,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function getRatioAndOffset(s,e,t){let i=1,n=1,o=0,r=0;if(e<TAU){const a=s,l=a+e,d=Math.cos(a),h=Math.sin(a),p=Math.cos(l),m=Math.sin(l),v=(R,A,D)=>_angleBetween(R,a,l,!0)?1:Math.max(A,A*t,D,D*t),y=(R,A,D)=>_angleBetween(R,a,l,!0)?-1:Math.min(A,A*t,D,D*t),b=v(0,d,p),S=v(HALF_PI,h,m),E=y(PI,d,p),T=y(PI+HALF_PI,h,m);i=(b-E)/2,n=(S-T)/2,o=-(b+E)/2,r=-(S+T)/2}return{ratioX:i,ratioY:n,offsetX:o,offsetY:r}}class DoughnutController extends DatasetController{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const i=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=i;else{let o=l=>+i[l];if(isObject(i[e])){const{key:l="value"}=this._parsing;o=d=>+resolveObjectKey(i[d],l)}let r,a;for(r=e,a=e+t;r<a;++r)n._parsed[r]=o(r)}}_getRotation(){return toRadians(this.options.rotation-90)}_getCircumference(){return toRadians(this.options.circumference)}_getRotationExtents(){let e=TAU,t=-TAU;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const n=this.chart.getDatasetMeta(i).controller,o=n._getRotation(),r=n._getCircumference();e=Math.min(e,o),t=Math.max(t,o+r)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:i}=t,n=this._cachedMeta,o=n.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),l=Math.min(toPercentage(this.options.cutout,a),1),d=this._getRingWeight(this.index),{circumference:h,rotation:p}=this._getRotationExtents(),{ratioX:m,ratioY:v,offsetX:y,offsetY:b}=getRatioAndOffset(p,h,l),S=(i.width-r)/m,E=(i.height-r)/v,T=Math.max(Math.min(S,E)/2,0),R=toDimension(this.options.radius,T),A=Math.max(R*l,0),D=(R-A)/this._getVisibleDatasetWeightTotal();this.offsetX=y*R,this.offsetY=b*R,n.total=this.calculateTotal(),this.outerRadius=R-D*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-D*d,0),this.updateElements(o,0,o.length,e)}_circumference(e,t){const i=this.options,n=this._cachedMeta,o=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||n._parsed[e]===null||n.data[e].hidden?0:this.calculateCircumference(n._parsed[e]*o/TAU)}updateElements(e,t,i,n){const o=n==="reset",r=this.chart,a=r.chartArea,d=r.options.animation,h=(a.left+a.right)/2,p=(a.top+a.bottom)/2,m=o&&d.animateScale,v=m?0:this.innerRadius,y=m?0:this.outerRadius,{sharedOptions:b,includeOptions:S}=this._getSharedOptions(t,n);let E=this._getRotation(),T;for(T=0;T<t;++T)E+=this._circumference(T,o);for(T=t;T<t+i;++T){const R=this._circumference(T,o),A=e[T],D={x:h+this.offsetX,y:p+this.offsetY,startAngle:E,endAngle:E+R,circumference:R,outerRadius:y,innerRadius:v};S&&(D.options=b||this.resolveDataElementOptions(T,A.active?"active":n)),E+=R,this.updateElement(A,T,D,n)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let i=0,n;for(n=0;n<t.length;n++){const o=e._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!t[n].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?TAU*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=formatNumber(t._parsed[e],i.options.locale);return{label:n[e]||"",value:o}}getMaxBorderWidth(e){let t=0;const i=this.chart;let n,o,r,a,l;if(!e){for(n=0,o=i.data.datasets.length;n<o;++n)if(i.isDatasetVisible(n)){r=i.getDatasetMeta(n),e=r.data,a=r.controller;break}}if(!e)return 0;for(n=0,o=e.length;n<o;++n)l=a.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(t=Math.max(t,l.borderWidth||0,l.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let i=0,n=e.length;i<n;++i){const o=this.resolveDataElementOptions(i);t=Math.max(t,o.offset||0,o.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let i=0;i<e;++i)this.chart.isDatasetVisible(i)&&(t+=this._getRingWeight(i));return t}_getRingWeight(e){return Math.max(valueOrDefault(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}G(DoughnutController,"id","doughnut"),G(DoughnutController,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),G(DoughnutController,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),G(DoughnutController,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:i,color:n}}=e.legend.options;return t.labels.map((o,r)=>{const l=e.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,t,i){i.chart.toggleDataVisibility(t.index),i.chart.update()}}}});class LineController extends DatasetController{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:n=[],_dataset:o}=t,r=this.chart._animationsDisabled;let{start:a,count:l}=_getStartAndCountOfVisiblePoints(t,n,r);this._drawStart=a,this._drawCount=l,_scaleRangesChanged(t)&&(a=0,l=n.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=n;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:d},e),this.updateElements(n,a,l,e)}updateElements(e,t,i,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:p}=this._getSharedOptions(t,n),m=r.axis,v=a.axis,{spanGaps:y,segment:b}=this.options,S=isNumber(y)?y:Number.POSITIVE_INFINITY,E=this.chart._animationsDisabled||o||n==="none",T=t+i,R=e.length;let A=t>0&&this.getParsed(t-1);for(let D=0;D<R;++D){const x=e[D],M=E?x:{};if(D<t||D>=T){M.skip=!0;continue}const I=this.getParsed(D),V=isNullOrUndef(I[v]),z=M[m]=r.getPixelForValue(I[m],D),B=M[v]=o||V?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,I,l):I[v],D);M.skip=isNaN(z)||isNaN(B)||V,M.stop=D>0&&Math.abs(I[m]-A[m])>S,b&&(M.parsed=I,M.raw=d.data[D]),p&&(M.options=h||this.resolveDataElementOptions(D,x.active?"active":n)),E||this.updateElement(x,D,M,n),A=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,n=e.data||[];if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,r)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}G(LineController,"id","line"),G(LineController,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),G(LineController,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class PolarAreaController extends DatasetController{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,n=i.data.labels||[],o=formatNumber(t._parsed[e].r,i.options.locale);return{label:n[e]||"",value:o}}parseObjectData(e,t,i,n){return _parseObjectDataRadialScale.bind(this)(e,t,i,n)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((i,n)=>{const o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(o<t.min&&(t.min=o),o>t.max&&(t.max=o))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,i=e.options,n=Math.min(t.right-t.left,t.bottom-t.top),o=Math.max(n/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/e.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,t,i,n){const o=n==="reset",r=this.chart,l=r.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,p=d.yCenter,m=d.getIndexAngle(0)-.5*PI;let v=m,y;const b=360/this.countVisibleElements();for(y=0;y<t;++y)v+=this._computeAngle(y,n,b);for(y=t;y<t+i;y++){const S=e[y];let E=v,T=v+this._computeAngle(y,n,b),R=r.getDataVisibility(y)?d.getDistanceFromCenterForValue(this.getParsed(y).r):0;v=T,o&&(l.animateScale&&(R=0),l.animateRotate&&(E=T=m));const A={x:h,y:p,innerRadius:0,outerRadius:R,startAngle:E,endAngle:T,options:this.resolveDataElementOptions(y,S.active?"active":n)};this.updateElement(S,y,A,n)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((i,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?toRadians(this.resolveDataElementOptions(e,t).angle||i):0}}G(PolarAreaController,"id","polarArea"),G(PolarAreaController,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),G(PolarAreaController,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:i,color:n}}=e.legend.options;return t.labels.map((o,r)=>{const l=e.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:i,hidden:!e.getDataVisibility(r),index:r}})}return[]}},onClick(e,t,i){i.chart.toggleDataVisibility(t.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class PieController extends DoughnutController{}G(PieController,"id","pie"),G(PieController,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function abstract(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class DateAdapterBase{constructor(e){G(this,"options");this.options=e||{}}static override(e){Object.assign(DateAdapterBase.prototype,e)}init(){}formats(){return abstract()}parse(){return abstract()}format(){return abstract()}add(){return abstract()}diff(){return abstract()}startOf(){return abstract()}endOf(){return abstract()}}var adapters={_date:DateAdapterBase};function binarySearch(s,e,t,i){const{controller:n,data:o,_sorted:r}=s,a=n._cachedMeta.iScale;if(a&&e===a.axis&&e!=="r"&&r&&o.length){const l=a._reversePixels?_rlookupByKey:_lookupByKey;if(i){if(n._sharedOptions){const d=o[0],h=typeof d.getRange=="function"&&d.getRange(e);if(h){const p=l(o,e,t-h),m=l(o,e,t+h);return{lo:p.lo,hi:m.hi}}}}else return l(o,e,t)}return{lo:0,hi:o.length-1}}function evaluateInteractionItems(s,e,t,i,n){const o=s.getSortedVisibleDatasetMetas(),r=t[e];for(let a=0,l=o.length;a<l;++a){const{index:d,data:h}=o[a],{lo:p,hi:m}=binarySearch(o[a],e,r,n);for(let v=p;v<=m;++v){const y=h[v];y.skip||i(y,d,v)}}}function getDistanceMetricForAxis(s){const e=s.indexOf("x")!==-1,t=s.indexOf("y")!==-1;return function(i,n){const o=e?Math.abs(i.x-n.x):0,r=t?Math.abs(i.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function getIntersectItems(s,e,t,i,n){const o=[];return!n&&!s.isPointInArea(e)||evaluateInteractionItems(s,t,e,function(a,l,d){!n&&!_isPointInArea(a,s.chartArea,0)||a.inRange(e.x,e.y,i)&&o.push({element:a,datasetIndex:l,index:d})},!0),o}function getNearestRadialItems(s,e,t,i){let n=[];function o(r,a,l){const{startAngle:d,endAngle:h}=r.getProps(["startAngle","endAngle"],i),{angle:p}=getAngleFromPoint(r,{x:e.x,y:e.y});_angleBetween(p,d,h)&&n.push({element:r,datasetIndex:a,index:l})}return evaluateInteractionItems(s,t,e,o),n}function getNearestCartesianItems(s,e,t,i,n,o){let r=[];const a=getDistanceMetricForAxis(t);let l=Number.POSITIVE_INFINITY;function d(h,p,m){const v=h.inRange(e.x,e.y,n);if(i&&!v)return;const y=h.getCenterPoint(n);if(!(!!o||s.isPointInArea(y))&&!v)return;const S=a(e,y);S<l?(r=[{element:h,datasetIndex:p,index:m}],l=S):S===l&&r.push({element:h,datasetIndex:p,index:m})}return evaluateInteractionItems(s,t,e,d),r}function getNearestItems(s,e,t,i,n,o){return!o&&!s.isPointInArea(e)?[]:t==="r"&&!i?getNearestRadialItems(s,e,t,n):getNearestCartesianItems(s,e,t,i,n,o)}function getAxisItems(s,e,t,i,n){const o=[],r=t==="x"?"inXRange":"inYRange";let a=!1;return evaluateInteractionItems(s,t,e,(l,d,h)=>{l[r](e[t],n)&&(o.push({element:l,datasetIndex:d,index:h}),a=a||l.inRange(e.x,e.y,n))}),i&&!a?[]:o}var Interaction={evaluateInteractionItems,modes:{index(s,e,t,i){const n=getRelativePosition(e,s),o=t.axis||"x",r=t.includeInvisible||!1,a=t.intersect?getIntersectItems(s,n,o,i,r):getNearestItems(s,n,o,!1,i,r),l=[];return a.length?(s.getSortedVisibleDatasetMetas().forEach(d=>{const h=a[0].index,p=d.data[h];p&&!p.skip&&l.push({element:p,datasetIndex:d.index,index:h})}),l):[]},dataset(s,e,t,i){const n=getRelativePosition(e,s),o=t.axis||"xy",r=t.includeInvisible||!1;let a=t.intersect?getIntersectItems(s,n,o,i,r):getNearestItems(s,n,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,d=s.getDatasetMeta(l).data;a=[];for(let h=0;h<d.length;++h)a.push({element:d[h],datasetIndex:l,index:h})}return a},point(s,e,t,i){const n=getRelativePosition(e,s),o=t.axis||"xy",r=t.includeInvisible||!1;return getIntersectItems(s,n,o,i,r)},nearest(s,e,t,i){const n=getRelativePosition(e,s),o=t.axis||"xy",r=t.includeInvisible||!1;return getNearestItems(s,n,o,t.intersect,i,r)},x(s,e,t,i){const n=getRelativePosition(e,s);return getAxisItems(s,n,"x",t.intersect,i)},y(s,e,t,i){const n=getRelativePosition(e,s);return getAxisItems(s,n,"y",t.intersect,i)}}};const STATIC_POSITIONS=["left","top","right","bottom"];function filterByPosition(s,e){return s.filter(t=>t.pos===e)}function filterDynamicPositionByAxis(s,e){return s.filter(t=>STATIC_POSITIONS.indexOf(t.pos)===-1&&t.box.axis===e)}function sortByWeight(s,e){return s.sort((t,i)=>{const n=e?i:t,o=e?t:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function wrapBoxes(s){const e=[];let t,i,n,o,r,a;for(t=0,i=(s||[]).length;t<i;++t)n=s[t],{position:o,options:{stack:r,stackWeight:a=1}}=n,e.push({index:t,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return e}function buildStacks(s){const e={};for(const t of s){const{stack:i,pos:n,stackWeight:o}=t;if(!i||!STATIC_POSITIONS.includes(n))continue;const r=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return e}function setLayoutDims(s,e){const t=buildStacks(s),{vBoxMaxWidth:i,hBoxMaxHeight:n}=e;let o,r,a;for(o=0,r=s.length;o<r;++o){a=s[o];const{fullSize:l}=a.box,d=t[a.stack],h=d&&a.stackWeight/d.weight;a.horizontal?(a.width=h?h*i:l&&e.availableWidth,a.height=n):(a.width=i,a.height=h?h*n:l&&e.availableHeight)}return t}function buildLayoutBoxes(s){const e=wrapBoxes(s),t=sortByWeight(e.filter(d=>d.box.fullSize),!0),i=sortByWeight(filterByPosition(e,"left"),!0),n=sortByWeight(filterByPosition(e,"right")),o=sortByWeight(filterByPosition(e,"top"),!0),r=sortByWeight(filterByPosition(e,"bottom")),a=filterDynamicPositionByAxis(e,"x"),l=filterDynamicPositionByAxis(e,"y");return{fullSize:t,leftAndTop:i.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:filterByPosition(e,"chartArea"),vertical:i.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function getCombinedMax(s,e,t,i){return Math.max(s[t],e[t])+Math.max(s[i],e[i])}function updateMaxPadding(s,e){s.top=Math.max(s.top,e.top),s.left=Math.max(s.left,e.left),s.bottom=Math.max(s.bottom,e.bottom),s.right=Math.max(s.right,e.right)}function updateDims(s,e,t,i){const{pos:n,box:o}=t,r=s.maxPadding;if(!isObject(n)){t.size&&(s[n]-=t.size);const p=i[t.stack]||{size:0,count:1};p.size=Math.max(p.size,t.horizontal?o.height:o.width),t.size=p.size/p.count,s[n]+=t.size}o.getPadding&&updateMaxPadding(r,o.getPadding());const a=Math.max(0,e.outerWidth-getCombinedMax(r,s,"left","right")),l=Math.max(0,e.outerHeight-getCombinedMax(r,s,"top","bottom")),d=a!==s.w,h=l!==s.h;return s.w=a,s.h=l,t.horizontal?{same:d,other:h}:{same:h,other:d}}function handleMaxPadding(s){const e=s.maxPadding;function t(i){const n=Math.max(e[i]-s[i],0);return s[i]+=n,n}s.y+=t("top"),s.x+=t("left"),t("right"),t("bottom")}function getMargins(s,e){const t=e.maxPadding;function i(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(e[r],t[r])}),o}return i(s?["left","right"]:["top","bottom"])}function fitBoxes(s,e,t,i){const n=[];let o,r,a,l,d,h;for(o=0,r=s.length,d=0;o<r;++o){a=s[o],l=a.box,l.update(a.width||e.w,a.height||e.h,getMargins(a.horizontal,e));const{same:p,other:m}=updateDims(e,t,a,i);d|=p&&n.length,h=h||m,l.fullSize||n.push(a)}return d&&fitBoxes(n,e,t,i)||h}function setBoxDims(s,e,t,i,n){s.top=t,s.left=e,s.right=e+i,s.bottom=t+n,s.width=i,s.height=n}function placeBoxes(s,e,t,i){const n=t.padding;let{x:o,y:r}=e;for(const a of s){const l=a.box,d=i[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/d.weight||1;if(a.horizontal){const p=e.w*h,m=d.size||l.height;defined$1(d.start)&&(r=d.start),l.fullSize?setBoxDims(l,n.left,r,t.outerWidth-n.right-n.left,m):setBoxDims(l,e.left+d.placed,r,p,m),d.start=r,d.placed+=p,r=l.bottom}else{const p=e.h*h,m=d.size||l.width;defined$1(d.start)&&(o=d.start),l.fullSize?setBoxDims(l,o,n.top,m,t.outerHeight-n.bottom-n.top):setBoxDims(l,o,e.top+d.placed,m,p),d.start=o,d.placed+=p,o=l.right}}e.x=o,e.y=r}var layouts={addBox(s,e){s.boxes||(s.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},s.boxes.push(e)},removeBox(s,e){const t=s.boxes?s.boxes.indexOf(e):-1;t!==-1&&s.boxes.splice(t,1)},configure(s,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(s,e,t,i){if(!s)return;const n=toPadding(s.options.layout.padding),o=Math.max(e-n.width,0),r=Math.max(t-n.height,0),a=buildLayoutBoxes(s.boxes),l=a.vertical,d=a.horizontal;each(s.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const h=l.reduce((b,S)=>S.box.options&&S.box.options.display===!1?b:b+1,0)||1,p=Object.freeze({outerWidth:e,outerHeight:t,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),m=Object.assign({},n);updateMaxPadding(m,toPadding(i));const v=Object.assign({maxPadding:m,w:o,h:r,x:n.left,y:n.top},n),y=setLayoutDims(l.concat(d),p);fitBoxes(a.fullSize,v,p,y),fitBoxes(l,v,p,y),fitBoxes(d,v,p,y)&&fitBoxes(l,v,p,y),handleMaxPadding(v),placeBoxes(a.leftAndTop,v,p,y),v.x+=v.w,v.y+=v.h,placeBoxes(a.rightAndBottom,v,p,y),s.chartArea={left:v.left,top:v.top,right:v.left+v.w,bottom:v.top+v.h,height:v.h,width:v.w},each(a.chartArea,b=>{const S=b.box;Object.assign(S,s.chartArea),S.update(v.w,v.h,{left:0,top:0,right:0,bottom:0})})}};class BasePlatform{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,n){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,n?Math.floor(t/n):i)}}isAttached(e){return!0}updateConfig(e){}}class BasicPlatform extends BasePlatform{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const EXPANDO_KEY="$chartjs",EVENT_TYPES={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},isNullOrEmpty=s=>s===null||s==="";function initCanvas(s,e){const t=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[EXPANDO_KEY]={initial:{height:i,width:n,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",isNullOrEmpty(n)){const o=readUsedSize(s,"width");o!==void 0&&(s.width=o)}if(isNullOrEmpty(i))if(s.style.height==="")s.height=s.width/(e||2);else{const o=readUsedSize(s,"height");o!==void 0&&(s.height=o)}return s}const eventListenerOptions=supportsEventListenerOptions?{passive:!0}:!1;function addListener(s,e,t){s&&s.addEventListener(e,t,eventListenerOptions)}function removeListener(s,e,t){s&&s.canvas&&s.canvas.removeEventListener(e,t,eventListenerOptions)}function fromNativeEvent(s,e){const t=EVENT_TYPES[s.type]||s.type,{x:i,y:n}=getRelativePosition(s,e);return{type:t,chart:e,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function nodeListContains(s,e){for(const t of s)if(t===e||t.contains(e))return!0}function createAttachObserver(s,e,t){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||nodeListContains(a.addedNodes,i),r=r&&!nodeListContains(a.removedNodes,i);r&&t()});return n.observe(document,{childList:!0,subtree:!0}),n}function createDetachObserver(s,e,t){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||nodeListContains(a.removedNodes,i),r=r&&!nodeListContains(a.addedNodes,i);r&&t()});return n.observe(document,{childList:!0,subtree:!0}),n}const drpListeningCharts=new Map;let oldDevicePixelRatio=0;function onWindowResize(){const s=window.devicePixelRatio;s!==oldDevicePixelRatio&&(oldDevicePixelRatio=s,drpListeningCharts.forEach((e,t)=>{t.currentDevicePixelRatio!==s&&e()}))}function listenDevicePixelRatioChanges(s,e){drpListeningCharts.size||window.addEventListener("resize",onWindowResize),drpListeningCharts.set(s,e)}function unlistenDevicePixelRatioChanges(s){drpListeningCharts.delete(s),drpListeningCharts.size||window.removeEventListener("resize",onWindowResize)}function createResizeObserver(s,e,t){const i=s.canvas,n=i&&_getParentNode(i);if(!n)return;const o=throttled((a,l)=>{const d=n.clientWidth;t(a,l),d<n.clientWidth&&t()},window),r=new ResizeObserver(a=>{const l=a[0],d=l.contentRect.width,h=l.contentRect.height;d===0&&h===0||o(d,h)});return r.observe(n),listenDevicePixelRatioChanges(s,o),r}function releaseObserver(s,e,t){t&&t.disconnect(),e==="resize"&&unlistenDevicePixelRatioChanges(s)}function createProxyAndListen(s,e,t){const i=s.canvas,n=throttled(o=>{s.ctx!==null&&t(fromNativeEvent(o,s))},s);return addListener(i,e,n),n}class DomPlatform extends BasePlatform{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(initCanvas(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[EXPANDO_KEY])return!1;const i=t[EXPANDO_KEY].initial;["height","width"].forEach(o=>{const r=i[o];isNullOrUndef(r)?t.removeAttribute(o):t.setAttribute(o,r)});const n=i.style||{};return Object.keys(n).forEach(o=>{t.style[o]=n[o]}),t.width=t.width,delete t[EXPANDO_KEY],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const n=e.$proxies||(e.$proxies={}),r={attach:createAttachObserver,detach:createDetachObserver,resize:createResizeObserver}[t]||createProxyAndListen;n[t]=r(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),n=i[t];if(!n)return;({attach:releaseObserver,detach:releaseObserver,resize:releaseObserver}[t]||removeListener)(e,t,n),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,n){return getMaximumSize(e,t,i,n)}isAttached(e){const t=_getParentNode(e);return!!(t&&t.isConnected)}}function _detectPlatform(s){return!_isDomSupported()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?BasicPlatform:DomPlatform}var Qt;let Element$1=(Qt=class{constructor(){G(this,"x");G(this,"y");G(this,"active",!1);G(this,"options");G(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return isNumber(this.x)&&isNumber(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const n={};return e.forEach(o=>{n[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),n}},G(Qt,"defaults",{}),G(Qt,"defaultRoutes"),Qt);function autoSkip(s,e){const t=s.options.ticks,i=determineMaxTicks(s),n=Math.min(t.maxTicksLimit||i,i),o=t.major.enabled?getMajorIndices(e):[],r=o.length,a=o[0],l=o[r-1],d=[];if(r>n)return skipMajors(e,d,o,r/n),d;const h=calculateSpacing(o,e,n);if(r>0){let p,m;const v=r>1?Math.round((l-a)/(r-1)):null;for(skip(e,d,h,isNullOrUndef(v)?0:a-v,a),p=0,m=r-1;p<m;p++)skip(e,d,h,o[p],o[p+1]);return skip(e,d,h,l,isNullOrUndef(v)?e.length:l+v),d}return skip(e,d,h),d}function determineMaxTicks(s){const e=s.options.offset,t=s._tickSize(),i=s._length/t+(e?0:1),n=s._maxLength/t;return Math.floor(Math.min(i,n))}function calculateSpacing(s,e,t){const i=getEvenSpacing(s),n=e.length/t;if(!i)return Math.max(n,1);const o=_factorize(i);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>n)return l}return Math.max(n,1)}function getMajorIndices(s){const e=[];let t,i;for(t=0,i=s.length;t<i;t++)s[t].major&&e.push(t);return e}function skipMajors(s,e,t,i){let n=0,o=t[0],r;for(i=Math.ceil(i),r=0;r<s.length;r++)r===o&&(e.push(s[r]),n++,o=t[n*i])}function skip(s,e,t,i,n){const o=valueOrDefault(i,0),r=Math.min(valueOrDefault(n,s.length),s.length);let a=0,l,d,h;for(t=Math.ceil(t),n&&(l=n-i,t=l/Math.floor(l/t)),h=o;h<0;)a++,h=Math.round(o+a*t);for(d=Math.max(o,0);d<r;d++)d===h&&(e.push(s[d]),a++,h=Math.round(o+a*t))}function getEvenSpacing(s){const e=s.length;let t,i;if(e<2)return!1;for(i=s[0],t=1;t<e;++t)if(s[t]-s[t-1]!==i)return!1;return i}const reverseAlign=s=>s==="left"?"right":s==="right"?"left":s,offsetFromEdge=(s,e,t)=>e==="top"||e==="left"?s[e]+t:s[e]-t,getTicksLimit=(s,e)=>Math.min(e||s,s);function sample(s,e){const t=[],i=s.length/e,n=s.length;let o=0;for(;o<n;o+=i)t.push(s[Math.floor(o)]);return t}function getPixelForGridLine(s,e,t){const i=s.ticks.length,n=Math.min(e,i-1),o=s._startPixel,r=s._endPixel,a=1e-6;let l=s.getPixelForTick(n),d;if(!(t&&(i===1?d=Math.max(l-o,r-l):e===0?d=(s.getPixelForTick(1)-l)/2:d=(l-s.getPixelForTick(n-1))/2,l+=n<e?d:-d,l<o-a||l>r+a)))return l}function garbageCollect(s,e){each(s,t=>{const i=t.gc,n=i.length/2;let o;if(n>e){for(o=0;o<n;++o)delete t.data[i[o]];i.splice(0,n)}})}function getTickMarkLength(s){return s.drawTicks?s.tickLength:0}function getTitleHeight(s,e){if(!s.display)return 0;const t=toFont(s.font,e),i=toPadding(s.padding);return(isArray(s.text)?s.text.length:1)*t.lineHeight+i.height}function createScaleContext(s,e){return createContext(s,{scale:e,type:"scale"})}function createTickContext(s,e,t){return createContext(s,{tick:t,index:e,type:"tick"})}function titleAlign(s,e,t){let i=_toLeftRightCenter(s);return(t&&e!=="right"||!t&&e==="right")&&(i=reverseAlign(i)),i}function titleArgs(s,e,t,i){const{top:n,left:o,bottom:r,right:a,chart:l}=s,{chartArea:d,scales:h}=l;let p=0,m,v,y;const b=r-n,S=a-o;if(s.isHorizontal()){if(v=_alignStartEnd(i,o,a),isObject(t)){const E=Object.keys(t)[0],T=t[E];y=h[E].getPixelForValue(T)+b-e}else t==="center"?y=(d.bottom+d.top)/2+b-e:y=offsetFromEdge(s,t,e);m=a-o}else{if(isObject(t)){const E=Object.keys(t)[0],T=t[E];v=h[E].getPixelForValue(T)-S+e}else t==="center"?v=(d.left+d.right)/2-S+e:v=offsetFromEdge(s,t,e);y=_alignStartEnd(i,r,n),p=t==="left"?-HALF_PI:HALF_PI}return{titleX:v,titleY:y,maxWidth:m,rotation:p}}class Scale extends Element$1{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:n}=this;return e=finiteOrDefault(e,Number.POSITIVE_INFINITY),t=finiteOrDefault(t,Number.NEGATIVE_INFINITY),i=finiteOrDefault(i,Number.POSITIVE_INFINITY),n=finiteOrDefault(n,Number.NEGATIVE_INFINITY),{min:finiteOrDefault(e,i),max:finiteOrDefault(t,n),minDefined:isNumberFinite(e),maxDefined:isNumberFinite(t)}}getMinMax(e){let{min:t,max:i,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:t,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,d=a.length;l<d;++l)r=a[l].controller.getMinMax(this,e),n||(t=Math.min(t,r.min)),o||(i=Math.max(i,r.max));return t=o&&t>i?i:t,i=n&&t>i?t:i,{min:finiteOrDefault(t,finiteOrDefault(i,t)),max:finiteOrDefault(i,finiteOrDefault(t,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){callback(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=_addGrace(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?sample(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=autoSkip(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,i;this.isHorizontal()?(t=this.left,i=this.right):(t=this.top,i=this.bottom,e=!e),this._startPixel=t,this._endPixel=i,this._reversePixels=e,this._length=i-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){callback(this.options.afterUpdate,[this])}beforeSetDimensions(){callback(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){callback(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),callback(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){callback(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,n,o;for(i=0,n=e.length;i<n;i++)o=e[i],o.label=callback(t.callback,[o.value,i,e],this)}afterTickToLabelConversion(){callback(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){callback(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=getTicksLimit(this.ticks.length,e.ticks.maxTicksLimit),n=t.minRotation||0,o=t.maxRotation;let r=n,a,l,d;if(!this._isVisible()||!t.display||n>=o||i<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),p=h.widest.width,m=h.highest.height,v=_limitValue(this.chart.width-p,0,this.maxWidth);a=e.offset?this.maxWidth/i:v/(i-1),p+6>a&&(a=v/(i-(e.offset?.5:1)),l=this.maxHeight-getTickMarkLength(e.grid)-t.padding-getTitleHeight(e.title,this.chart.options.font),d=Math.sqrt(p*p+m*m),r=toDegrees(Math.min(Math.asin(_limitValue((h.highest.height+6)/a,-1,1)),Math.asin(_limitValue(l/d,-1,1))-Math.asin(_limitValue(m/d,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){callback(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){callback(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=getTitleHeight(n,t.options.font);if(a?(e.width=this.maxWidth,e.height=getTickMarkLength(o)+l):(e.height=this.maxHeight,e.width=getTickMarkLength(o)+l),i.display&&this.ticks.length){const{first:d,last:h,widest:p,highest:m}=this._getLabelSizes(),v=i.padding*2,y=toRadians(this.labelRotation),b=Math.cos(y),S=Math.sin(y);if(a){const E=i.mirror?0:S*p.width+b*m.height;e.height=Math.min(this.maxHeight,e.height+E+v)}else{const E=i.mirror?0:b*p.width+S*m.height;e.width=Math.min(this.maxWidth,e.width+E+v)}this._calculatePadding(d,h,S,b)}}this._handleMargins(),a?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,d=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,p=this.right-this.getPixelForTick(this.ticks.length-1);let m=0,v=0;l?d?(m=n*e.width,v=i*t.height):(m=i*e.height,v=n*t.width):o==="start"?v=t.width:o==="end"?m=e.width:o!=="inner"&&(m=e.width/2,v=t.width/2),this.paddingLeft=Math.max((m-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((v-p+r)*this.width/(this.width-p),0)}else{let h=t.height/2,p=e.height/2;o==="start"?(h=0,p=e.height):o==="end"&&(h=t.height,p=0),this.paddingTop=h+r,this.paddingBottom=p+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){callback(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,i;for(t=0,i=e.length;t<i;t++)isNullOrUndef(e[t].label)&&(e.splice(t,1),i--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let i=this.ticks;t<i.length&&(i=sample(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,i){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(t/getTicksLimit(t,i));let d=0,h=0,p,m,v,y,b,S,E,T,R,A,D;for(p=0;p<t;p+=l){if(y=e[p].label,b=this._resolveTickFontOptions(p),n.font=S=b.string,E=o[S]=o[S]||{data:{},gc:[]},T=b.lineHeight,R=A=0,!isNullOrUndef(y)&&!isArray(y))R=_measureText(n,E.data,E.gc,R,y),A=T;else if(isArray(y))for(m=0,v=y.length;m<v;++m)D=y[m],!isNullOrUndef(D)&&!isArray(D)&&(R=_measureText(n,E.data,E.gc,R,D),A+=T);r.push(R),a.push(A),d=Math.max(R,d),h=Math.max(A,h)}garbageCollect(o,t);const x=r.indexOf(d),M=a.indexOf(h),I=V=>({width:r[V]||0,height:a[V]||0});return{first:I(0),last:I(t-1),widest:I(x),highest:I(M),widths:r,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return _int16Range(this._alignToPixels?_alignPixel(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const i=t[e];return i.$context||(i.$context=createTickContext(this.getContext(),e,i))}return this.$context||(this.$context=createScaleContext(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=toRadians(this.labelRotation),i=Math.abs(Math.cos(t)),n=Math.abs(Math.sin(t)),o=this._getLabelSizes(),r=e.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*n?a/i:l/n:l*n<a*i?l/i:a/n}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,d=this.isHorizontal(),p=this.ticks.length+(l?1:0),m=getTickMarkLength(o),v=[],y=a.setContext(this.getContext()),b=y.display?y.width:0,S=b/2,E=function($){return _alignPixel(i,$,b)};let T,R,A,D,x,M,I,V,z,B,K,J;if(r==="top")T=E(this.bottom),M=this.bottom-m,V=T-S,B=E(e.top)+S,J=e.bottom;else if(r==="bottom")T=E(this.top),B=e.top,J=E(e.bottom)-S,M=T+S,V=this.top+m;else if(r==="left")T=E(this.right),x=this.right-m,I=T-S,z=E(e.left)+S,K=e.right;else if(r==="right")T=E(this.left),z=e.left,K=E(e.right)-S,x=T+S,I=this.left+m;else if(t==="x"){if(r==="center")T=E((e.top+e.bottom)/2+.5);else if(isObject(r)){const $=Object.keys(r)[0],Y=r[$];T=E(this.chart.scales[$].getPixelForValue(Y))}B=e.top,J=e.bottom,M=T+S,V=M+m}else if(t==="y"){if(r==="center")T=E((e.left+e.right)/2);else if(isObject(r)){const $=Object.keys(r)[0],Y=r[$];T=E(this.chart.scales[$].getPixelForValue(Y))}x=T-S,I=x-m,z=e.left,K=e.right}const Z=valueOrDefault(n.ticks.maxTicksLimit,p),F=Math.max(1,Math.ceil(p/Z));for(R=0;R<p;R+=F){const $=this.getContext(R),Y=o.setContext($),W=a.setContext($),X=Y.lineWidth,U=Y.color,se=W.dash||[],pe=W.dashOffset,ae=Y.tickWidth,oe=Y.tickColor,ie=Y.tickBorderDash||[],te=Y.tickBorderDashOffset;A=getPixelForGridLine(this,R,l),A!==void 0&&(D=_alignPixel(i,A,X),d?x=I=z=K=D:M=V=B=J=D,v.push({tx1:x,ty1:M,tx2:I,ty2:V,x1:z,y1:B,x2:K,y2:J,width:X,color:U,borderDash:se,borderDashOffset:pe,tickWidth:ae,tickColor:oe,tickBorderDash:ie,tickBorderDashOffset:te}))}return this._ticksLength=p,this._borderValue=T,v}_computeLabelItems(e){const t=this.axis,i=this.options,{position:n,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:d,padding:h,mirror:p}=o,m=getTickMarkLength(i.grid),v=m+h,y=p?-h:v,b=-toRadians(this.labelRotation),S=[];let E,T,R,A,D,x,M,I,V,z,B,K,J="middle";if(n==="top")x=this.bottom-y,M=this._getXAxisLabelAlignment();else if(n==="bottom")x=this.top+y,M=this._getXAxisLabelAlignment();else if(n==="left"){const F=this._getYAxisLabelAlignment(m);M=F.textAlign,D=F.x}else if(n==="right"){const F=this._getYAxisLabelAlignment(m);M=F.textAlign,D=F.x}else if(t==="x"){if(n==="center")x=(e.top+e.bottom)/2+v;else if(isObject(n)){const F=Object.keys(n)[0],$=n[F];x=this.chart.scales[F].getPixelForValue($)+v}M=this._getXAxisLabelAlignment()}else if(t==="y"){if(n==="center")D=(e.left+e.right)/2-v;else if(isObject(n)){const F=Object.keys(n)[0],$=n[F];D=this.chart.scales[F].getPixelForValue($)}M=this._getYAxisLabelAlignment(m).textAlign}t==="y"&&(l==="start"?J="top":l==="end"&&(J="bottom"));const Z=this._getLabelSizes();for(E=0,T=a.length;E<T;++E){R=a[E],A=R.label;const F=o.setContext(this.getContext(E));I=this.getPixelForTick(E)+o.labelOffset,V=this._resolveTickFontOptions(E),z=V.lineHeight,B=isArray(A)?A.length:1;const $=B/2,Y=F.color,W=F.textStrokeColor,X=F.textStrokeWidth;let U=M;r?(D=I,M==="inner"&&(E===T-1?U=this.options.reverse?"left":"right":E===0?U=this.options.reverse?"right":"left":U="center"),n==="top"?d==="near"||b!==0?K=-B*z+z/2:d==="center"?K=-Z.highest.height/2-$*z+z:K=-Z.highest.height+z/2:d==="near"||b!==0?K=z/2:d==="center"?K=Z.highest.height/2-$*z:K=Z.highest.height-B*z,p&&(K*=-1),b!==0&&!F.showLabelBackdrop&&(D+=z/2*Math.sin(b))):(x=I,K=(1-B)*z/2);let se;if(F.showLabelBackdrop){const pe=toPadding(F.backdropPadding),ae=Z.heights[E],oe=Z.widths[E];let ie=K-pe.top,te=0-pe.left;switch(J){case"middle":ie-=ae/2;break;case"bottom":ie-=ae;break}switch(M){case"center":te-=oe/2;break;case"right":te-=oe;break;case"inner":E===T-1?te-=oe:E>0&&(te-=oe/2);break}se={left:te,top:ie,width:oe+pe.width,height:ae+pe.height,color:F.backdropColor}}S.push({label:A,font:V,textOffset:K,options:{rotation:b,color:Y,strokeColor:W,strokeWidth:X,textAlign:U,textBaseline:J,translation:[D,x],backdrop:se}})}return S}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-toRadians(this.labelRotation))return e==="top"?"left":"right";let n="center";return t.align==="start"?n="left":t.align==="end"?n="right":t.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=e+o,l=r.widest.width;let d,h;return t==="left"?n?(h=this.right+o,i==="near"?d="left":i==="center"?(d="center",h+=l/2):(d="right",h+=l)):(h=this.right-a,i==="near"?d="right":i==="center"?(d="center",h-=l/2):(d="left",h=this.left)):t==="right"?n?(h=this.left+o,i==="near"?d="right":i==="center"?(d="center",h-=l/2):(d="left",h-=l)):(h=this.left+a,i==="near"?d="left":i==="center"?(d="center",h+=l/2):(d="right",h=this.right)):d="right",{textAlign:d,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:n,width:o,height:r}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,n,o,r),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const n=this.ticks.findIndex(o=>o.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,r;const a=(l,d,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(d.x,d.y),i.stroke(),i.restore())};if(t.display)for(o=0,r=n.length;o<r;++o){const l=n[o];t.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),t.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:i,grid:n}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let d,h,p,m;this.isHorizontal()?(d=_alignPixel(e,this.left,r)-r/2,h=_alignPixel(e,this.right,a)+a/2,p=m=l):(p=_alignPixel(e,this.top,r)-r/2,m=_alignPixel(e,this.bottom,a)+a/2,d=h=l),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(d,p),t.lineTo(h,m),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,n=this._computeLabelArea();n&&clipArea(i,n);const o=this.getLabelItems(e);for(const r of o){const a=r.options,l=r.font,d=r.label,h=r.textOffset;renderText(i,d,0,h,l,a)}n&&unclipArea(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:n}}=this;if(!i.display)return;const o=toFont(i.font),r=toPadding(i.padding),a=i.align;let l=o.lineHeight/2;t==="bottom"||t==="center"||isObject(t)?(l+=r.bottom,isArray(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:d,titleY:h,maxWidth:p,rotation:m}=titleArgs(this,l,t,a);renderText(e,i.text,0,0,o,{color:i.color,maxWidth:p,rotation:m,textAlign:titleAlign(a,t,n),textBaseline:"middle",translation:[d,h]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,i=valueOrDefault(e.grid&&e.grid.z,-1),n=valueOrDefault(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Scale.prototype.draw?[{z:t,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:t,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let o,r;for(o=0,r=t.length;o<r;++o){const a=t[o];a[i]===this.id&&(!e||a.type===e)&&n.push(a)}return n}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return toFont(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class TypedRegistry{constructor(e,t,i){this.type=e,this.scope=t,this.override=i,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let i;isIChartComponent(t)&&(i=this.register(t));const n=this.items,o=e.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in n||(n[o]=e,registerDefaults(e,r,i),this.override&&defaults.override(e.id,e.overrides)),r}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,n=this.scope;i in t&&delete t[i],n&&i in defaults[n]&&(delete defaults[n][i],this.override&&delete overrides[i])}}function registerDefaults(s,e,t){const i=merge(Object.create(null),[t?defaults.get(t):{},defaults.get(e),s.defaults]);defaults.set(e,i),s.defaultRoutes&&routeDefaults(e,s.defaultRoutes),s.descriptors&&defaults.describe(e,s.descriptors)}function routeDefaults(s,e){Object.keys(e).forEach(t=>{const i=t.split("."),n=i.pop(),o=[s].concat(i).join("."),r=e[t].split("."),a=r.pop(),l=r.join(".");defaults.route(o,n,l,a)})}function isIChartComponent(s){return"id"in s&&"defaults"in s}class Registry{constructor(){this.controllers=new TypedRegistry(DatasetController,"datasets",!0),this.elements=new TypedRegistry(Element$1,"elements"),this.plugins=new TypedRegistry(Object,"plugins"),this.scales=new TypedRegistry(Scale,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,i){[...t].forEach(n=>{const o=i||this._getRegistryForType(n);i||o.isForType(n)||o===this.plugins&&n.id?this._exec(e,o,n):each(n,r=>{const a=i||this._getRegistryForType(r);this._exec(e,a,r)})})}_exec(e,t,i){const n=_capitalize(e);callback(i["before"+n],[],i),t[e](i),callback(i["after"+n],[],i)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const i=this._typedRegistries[t];if(i.isForType(e))return i}return this.plugins}_get(e,t,i){const n=t.get(e);if(n===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return n}}var registry=new Registry;class PluginService{constructor(){this._init=[]}notify(e,t,i,n){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));const o=n?this._descriptors(e).filter(n):this._descriptors(e),r=this._notify(o,e,t,i);return t==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),r}_notify(e,t,i,n){n=n||{};for(const o of e){const r=o.plugin,a=r[i],l=[t,n,o.options];if(callback(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){isNullOrUndef(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const i=e&&e.config,n=valueOrDefault(i.options&&i.options.plugins,{}),o=allPlugins(i);return n===!1&&!t?[]:createDescriptors(e,o,n,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(t,i),e,"stop"),this._notify(n(i,t),e,"start")}}function allPlugins(s){const e={},t=[],i=Object.keys(registry.plugins.items);for(let o=0;o<i.length;o++)t.push(registry.getPlugin(i[o]));const n=s.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];t.indexOf(r)===-1&&(t.push(r),e[r.id]=!0)}return{plugins:t,localIds:e}}function getOpts(s,e){return!e&&s===!1?null:s===!0?{}:s}function createDescriptors(s,{plugins:e,localIds:t},i,n){const o=[],r=s.getContext();for(const a of e){const l=a.id,d=getOpts(i[l],n);d!==null&&o.push({plugin:a,options:pluginOpts(s.config,{plugin:a,local:t[l]},d,r)})}return o}function pluginOpts(s,{plugin:e,local:t},i,n){const o=s.pluginScopeKeys(e),r=s.getOptionScopes(i,o);return t&&e.defaults&&r.push(e.defaults),s.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function getIndexAxis(s,e){const t=defaults.datasets[s]||{};return((e.datasets||{})[s]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function getAxisFromDefaultScaleID(s,e){let t=s;return s==="_index_"?t=e:s==="_value_"&&(t=e==="x"?"y":"x"),t}function getDefaultScaleIDFromAxis(s,e){return s===e?"_index_":"_value_"}function idMatchesAxis(s){if(s==="x"||s==="y"||s==="r")return s}function axisFromPosition(s){if(s==="top"||s==="bottom")return"x";if(s==="left"||s==="right")return"y"}function determineAxis(s,...e){if(idMatchesAxis(s))return s;for(const t of e){const i=t.axis||axisFromPosition(t.position)||s.length>1&&idMatchesAxis(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function getAxisFromDataset(s,e,t){if(t[e+"AxisID"]===s)return{axis:e}}function retrieveAxisFromDatasets(s,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===s||i.yAxisID===s);if(t.length)return getAxisFromDataset(s,"x",t[0])||getAxisFromDataset(s,"y",t[0])}return{}}function mergeScaleConfig(s,e){const t=overrides[s.type]||{scales:{}},i=e.scales||{},n=getIndexAxis(s.type,e),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!isObject(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=determineAxis(r,a,retrieveAxisFromDatasets(r,s),defaults.scales[a.type]),d=getDefaultScaleIDFromAxis(l,n),h=t.scales||{};o[r]=mergeIf(Object.create(null),[{axis:l},a,h[l],h[d]])}),s.data.datasets.forEach(r=>{const a=r.type||s.type,l=r.indexAxis||getIndexAxis(a,e),h=(overrides[a]||{}).scales||{};Object.keys(h).forEach(p=>{const m=getAxisFromDefaultScaleID(p,l),v=r[m+"AxisID"]||m;o[v]=o[v]||Object.create(null),mergeIf(o[v],[{axis:m},i[v],h[p]])})}),Object.keys(o).forEach(r=>{const a=o[r];mergeIf(a,[defaults.scales[a.type],defaults.scale])}),o}function initOptions(s){const e=s.options||(s.options={});e.plugins=valueOrDefault(e.plugins,{}),e.scales=mergeScaleConfig(s,e)}function initData(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function initConfig(s){return s=s||{},s.data=initData(s.data),initOptions(s),s}const keyCache=new Map,keysCached=new Set;function cachedKeys(s,e){let t=keyCache.get(s);return t||(t=e(),keyCache.set(s,t),keysCached.add(t)),t}const addIfFound=(s,e,t)=>{const i=resolveObjectKey(e,t);i!==void 0&&s.add(i)};class Config{constructor(e){this._config=initConfig(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=initData(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),initOptions(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return cachedKeys(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return cachedKeys(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return cachedKeys(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return cachedKeys(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let n=i.get(e);return(!n||t)&&(n=new Map,i.set(e,n)),n}getOptionScopes(e,t,i){const{options:n,type:o}=this,r=this._cachedScopes(e,i),a=r.get(t);if(a)return a;const l=new Set;t.forEach(h=>{e&&(l.add(e),h.forEach(p=>addIfFound(l,e,p))),h.forEach(p=>addIfFound(l,n,p)),h.forEach(p=>addIfFound(l,overrides[o]||{},p)),h.forEach(p=>addIfFound(l,defaults,p)),h.forEach(p=>addIfFound(l,descriptors,p))});const d=Array.from(l);return d.length===0&&d.push(Object.create(null)),keysCached.has(t)&&r.set(t,d),d}chartOptionScopes(){const{options:e,type:t}=this;return[e,overrides[t]||{},defaults.datasets[t]||{},{type:t},defaults,descriptors]}resolveNamedOptions(e,t,i,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=getResolver(this._resolverCache,e,n);let l=r;if(needContext(r,t)){o.$shared=!1,i=isFunction$1(i)?i():i;const d=this.createResolver(e,i,a);l=_attachContext(r,i,d)}for(const d of t)o[d]=l[d];return o}createResolver(e,t,i=[""],n){const{resolver:o}=getResolver(this._resolverCache,e,i);return isObject(t)?_attachContext(o,t,void 0,n):o}}function getResolver(s,e,t){let i=s.get(e);i||(i=new Map,s.set(e,i));const n=t.join();let o=i.get(n);return o||(o={resolver:_createResolver(e,t),subPrefixes:t.filter(a=>!a.toLowerCase().includes("hover"))},i.set(n,o)),o}const hasFunction=s=>isObject(s)&&Object.getOwnPropertyNames(s).some(e=>isFunction$1(s[e]));function needContext(s,e){const{isScriptable:t,isIndexable:i}=_descriptors(s);for(const n of e){const o=t(n),r=i(n),a=(r||o)&&s[n];if(o&&(isFunction$1(a)||hasFunction(a))||r&&isArray(a))return!0}return!1}var version="4.4.2";const KNOWN_POSITIONS=["top","bottom","left","right","chartArea"];function positionIsHorizontal(s,e){return s==="top"||s==="bottom"||KNOWN_POSITIONS.indexOf(s)===-1&&e==="x"}function compare2Level(s,e){return function(t,i){return t[s]===i[s]?t[e]-i[e]:t[s]-i[s]}}function onAnimationsComplete(s){const e=s.chart,t=e.options.animation;e.notifyPlugins("afterRender"),callback(t&&t.onComplete,[s],e)}function onAnimationProgress(s){const e=s.chart,t=e.options.animation;callback(t&&t.onProgress,[s],e)}function getCanvas(s){return _isDomSupported()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const instances={},getChart=s=>{const e=getCanvas(s);return Object.values(instances).filter(t=>t.canvas===e).pop()};function moveNumericKeys(s,e,t){const i=Object.keys(s);for(const n of i){const o=+n;if(o>=e){const r=s[n];delete s[n],(t>0||o>e)&&(s[o+t]=r)}}}function determineLastEvent(s,e,t,i){return!t||s.type==="mouseout"?null:i?e:s}function getSizeForArea(s,e,t){return s.options.clip?s[t]:e[t]}function getDatasetArea(s,e){const{xScale:t,yScale:i}=s;return t&&i?{left:getSizeForArea(t,e,"left"),right:getSizeForArea(t,e,"right"),top:getSizeForArea(i,e,"top"),bottom:getSizeForArea(i,e,"bottom")}:e}class Chart{static register(...e){registry.add(...e),invalidatePlugins()}static unregister(...e){registry.remove(...e),invalidatePlugins()}constructor(e,t){const i=this.config=new Config(t),n=getCanvas(e),o=getChart(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||_detectPlatform(n)),this.platform.updateConfig(i);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,d=l&&l.height,h=l&&l.width;if(this.id=uid(),this.ctx=a,this.canvas=l,this.width=h,this.height=d,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new PluginService,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=debounce$3(p=>this.update(p),r.resizeDelay||0),this._dataChanges=[],instances[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}animator.listen(this,"complete",onAnimationsComplete),animator.listen(this,"progress",onAnimationProgress),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:n,_aspectRatio:o}=this;return isNullOrUndef(e)?t&&o?o:n?i/n:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return registry}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():retinaScale(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return clearCanvas(this.canvas,this.ctx),this}stop(){return animator.stop(this),this}resize(e,t){animator.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,e,t,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,retinaScale(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),callback(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};each(t,(i,n)=>{i.id=n})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,n=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];t&&(o=o.concat(Object.keys(t).map(r=>{const a=t[r],l=determineAxis(r,a),d=l==="r",h=l==="x";return{options:a,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),each(o,r=>{const a=r.options,l=a.id,d=determineAxis(l,a),h=valueOrDefault(a.type,r.dtype);(a.position===void 0||positionIsHorizontal(a.position,d)!==positionIsHorizontal(r.dposition))&&(a.position=r.dposition),n[l]=!0;let p=null;if(l in i&&i[l].type===h)p=i[l];else{const m=registry.getScale(h);p=new m({id:l,type:h,ctx:this.ctx,chart:this}),i[p.id]=p}p.init(a,e)}),each(n,(r,a)=>{r||delete i[a]}),each(i,r=>{layouts.configure(this,r,r.options),layouts.addBox(this,r)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((n,o)=>n.index-o.index),i>t){for(let n=t;n<i;++n)this._destroyDatasetMeta(n);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(compare2Level("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((i,n)=>{t.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=t.length;i<n;i++){const o=t[i];let r=this.getDatasetMeta(i);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||getIndexAxis(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const l=registry.getController(a),{datasetElementType:d,dataElementType:h}=defaults.datasets[a];Object.assign(l,{dataElementType:registry.getElement(h),datasetElementType:d&®istry.getElement(d)}),r.controller=new l(this,i),e.push(r.controller)}}return this._updateMetasets(),e}_resetElements(){each(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const i=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let d=0,h=this.data.datasets.length;d<h;d++){const{controller:p}=this.getDatasetMeta(d),m=!n&&o.indexOf(p)===-1;p.buildOrUpdateElements(m),r=Math.max(+p.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),n||each(o,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(compare2Level("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){each(this.scales,e=>{layouts.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!setsEqual(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:o}of t){const r=i==="_removeElements"?-o:o;moveNumericKeys(e,n,r)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=o=>new Set(e.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=i(0);for(let o=1;o<t;o++)if(!setsEqual(n,i(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;layouts.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],each(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,isFunction$1(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),n={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(i.controller._update(t),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(animator.has(this)?this.attached&&!animator.running(this)&&animator.start(this):(this.draw(),onAnimationsComplete({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:n}=this._resizeBeforeDraw;this._resize(i,n),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let n,o;for(n=0,o=t.length;n<o;++n){const r=t[n];(!e||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,n=!i.disabled,o=getDatasetArea(e,this.chartArea),r={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&clipArea(t,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),e.controller.draw(),n&&unclipArea(t),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return _isPointInArea(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,n){const o=Interaction.modes[t];return typeof o=="function"?o(this,e,i,n):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let n=i.filter(o=>o&&o._dataset===t).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=createContext(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const i=this.getDatasetMeta(e);return typeof i.hidden=="boolean"?!i.hidden:!t.hidden}setDatasetVisibility(e,t){const i=this.getDatasetMeta(e);i.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,i){const n=i?"show":"hide",o=this.getDatasetMeta(e),r=o.controller._resolveAnimations(void 0,n);defined$1(t)?(o.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===e?n:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),animator.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),clearCanvas(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete instances[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,i=(o,r)=>{t.addEventListener(this,o,r),e[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};each(this.options.events,o=>i(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(l,d)=>{t.addEventListener(this,l,d),e[l]=d},n=(l,d)=>{e[l]&&(t.removeEventListener(this,l,d),delete e[l])},o=(l,d)=>{this.canvas&&this.resize(l,d)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),i("attach",a)},t.isAttached(this.canvas)?a():r()}unbindEvents(){each(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},each(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const n=i?"set":"remove";let o,r,a,l;for(t==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=e.length;a<l;++a){r=e[a];const d=r&&this.getDatasetMeta(r.datasetIndex).controller;d&&d[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!_elementsEqual(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const n=this.options.hover,o=(l,d)=>l.filter(h=>!d.some(p=>h.datasetIndex===p.datasetIndex&&h.index===p.index)),r=o(t,e),a=i?e:o(e,t);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},n=r=>(r.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;const o=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(o||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:n=[],options:o}=this,r=t,a=this._getActiveElements(e,n,i,r),l=_isClickEvent(e),d=determineLastEvent(e,this._lastEvent,i,l);i&&(this._lastEvent=null,callback(o.onHover,[e,a,this],this),l&&callback(o.onClick,[e,a,this],this));const h=!_elementsEqual(a,n);return(h||t)&&(this._active=a,this._updateHoverStyles(a,n,t)),this._lastEvent=d,h}_getActiveElements(e,t,i,n){if(e.type==="mouseout")return[];if(!i)return t;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,n)}}G(Chart,"defaults",defaults),G(Chart,"instances",instances),G(Chart,"overrides",overrides),G(Chart,"registry",registry),G(Chart,"version",version),G(Chart,"getChart",getChart);function invalidatePlugins(){return each(Chart.instances,s=>s._plugins.invalidate())}function clipArc(s,e,t){const{startAngle:i,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=e;let d=n/a;s.beginPath(),s.arc(o,r,a,i-d,t+d),l>n?(d=n/l,s.arc(o,r,l,t+d,i-d,!0)):s.arc(o,r,n,t+HALF_PI,i-HALF_PI),s.closePath(),s.clip()}function toRadiusCorners(s){return _readValueToProps(s,["outerStart","outerEnd","innerStart","innerEnd"])}function parseBorderRadius$1(s,e,t,i){const n=toRadiusCorners(s.options.borderRadius),o=(t-e)/2,r=Math.min(o,i*e/2),a=l=>{const d=(t-Math.min(o,l))*i/2;return _limitValue(l,0,Math.min(o,d))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:_limitValue(n.innerStart,0,r),innerEnd:_limitValue(n.innerEnd,0,r)}}function rThetaToXY(s,e,t,i){return{x:t+s*Math.cos(e),y:i+s*Math.sin(e)}}function pathArc(s,e,t,i,n,o){const{x:r,y:a,startAngle:l,pixelMargin:d,innerRadius:h}=e,p=Math.max(e.outerRadius+i+t-d,0),m=h>0?h+i+t+d:0;let v=0;const y=n-l;if(i){const F=h>0?h-i:0,$=p>0?p-i:0,Y=(F+$)/2,W=Y!==0?y*Y/(Y+i):y;v=(y-W)/2}const b=Math.max(.001,y*p-t/PI)/p,S=(y-b)/2,E=l+S+v,T=n-S-v,{outerStart:R,outerEnd:A,innerStart:D,innerEnd:x}=parseBorderRadius$1(e,m,p,T-E),M=p-R,I=p-A,V=E+R/M,z=T-A/I,B=m+D,K=m+x,J=E+D/B,Z=T-x/K;if(s.beginPath(),o){const F=(V+z)/2;if(s.arc(r,a,p,V,F),s.arc(r,a,p,F,z),A>0){const X=rThetaToXY(I,z,r,a);s.arc(X.x,X.y,A,z,T+HALF_PI)}const $=rThetaToXY(K,T,r,a);if(s.lineTo($.x,$.y),x>0){const X=rThetaToXY(K,Z,r,a);s.arc(X.x,X.y,x,T+HALF_PI,Z+Math.PI)}const Y=(T-x/m+(E+D/m))/2;if(s.arc(r,a,m,T-x/m,Y,!0),s.arc(r,a,m,Y,E+D/m,!0),D>0){const X=rThetaToXY(B,J,r,a);s.arc(X.x,X.y,D,J+Math.PI,E-HALF_PI)}const W=rThetaToXY(M,E,r,a);if(s.lineTo(W.x,W.y),R>0){const X=rThetaToXY(M,V,r,a);s.arc(X.x,X.y,R,E-HALF_PI,V)}}else{s.moveTo(r,a);const F=Math.cos(V)*p+r,$=Math.sin(V)*p+a;s.lineTo(F,$);const Y=Math.cos(z)*p+r,W=Math.sin(z)*p+a;s.lineTo(Y,W)}s.closePath()}function drawArc(s,e,t,i,n){const{fullCircles:o,startAngle:r,circumference:a}=e;let l=e.endAngle;if(o){pathArc(s,e,t,i,l,n);for(let d=0;d<o;++d)s.fill();isNaN(a)||(l=r+(a%TAU||TAU))}return pathArc(s,e,t,i,l,n),s.fill(),l}function drawBorder(s,e,t,i,n){const{fullCircles:o,startAngle:r,circumference:a,options:l}=e,{borderWidth:d,borderJoinStyle:h,borderDash:p,borderDashOffset:m}=l,v=l.borderAlign==="inner";if(!d)return;s.setLineDash(p||[]),s.lineDashOffset=m,v?(s.lineWidth=d*2,s.lineJoin=h||"round"):(s.lineWidth=d,s.lineJoin=h||"bevel");let y=e.endAngle;if(o){pathArc(s,e,t,i,y,n);for(let b=0;b<o;++b)s.stroke();isNaN(a)||(y=r+(a%TAU||TAU))}v&&clipArc(s,e,y),o||(pathArc(s,e,t,i,y,n),s.stroke())}class ArcElement extends Element$1{constructor(t){super();G(this,"circumference");G(this,"endAngle");G(this,"fullCircles");G(this,"innerRadius");G(this,"outerRadius");G(this,"pixelMargin");G(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,i,n){const o=this.getProps(["x","y"],n),{angle:r,distance:a}=getAngleFromPoint(o,{x:t,y:i}),{startAngle:l,endAngle:d,innerRadius:h,outerRadius:p,circumference:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),v=(this.options.spacing+this.options.borderWidth)/2,b=valueOrDefault(m,d-l)>=TAU||_angleBetween(r,l,d),S=_isBetween(a,h+v,p+v);return b&&S}getCenterPoint(t){const{x:i,y:n,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:d,spacing:h}=this.options,p=(o+r)/2,m=(a+l+h+d)/2;return{x:i+Math.cos(p)*m,y:n+Math.sin(p)*m}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:i,circumference:n}=this,o=(i.offset||0)/4,r=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=n>TAU?Math.floor(n/TAU):0,n===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const l=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(l)*o,Math.sin(l)*o);const d=1-Math.sin(Math.min(PI,n||0)),h=o*d;t.fillStyle=i.backgroundColor,t.strokeStyle=i.borderColor,drawArc(t,this,h,r,a),drawBorder(t,this,h,r,a),t.restore()}}G(ArcElement,"id","arc"),G(ArcElement,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),G(ArcElement,"defaultRoutes",{backgroundColor:"backgroundColor"}),G(ArcElement,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"});function setStyle$1(s,e,t=e){s.lineCap=valueOrDefault(t.borderCapStyle,e.borderCapStyle),s.setLineDash(valueOrDefault(t.borderDash,e.borderDash)),s.lineDashOffset=valueOrDefault(t.borderDashOffset,e.borderDashOffset),s.lineJoin=valueOrDefault(t.borderJoinStyle,e.borderJoinStyle),s.lineWidth=valueOrDefault(t.borderWidth,e.borderWidth),s.strokeStyle=valueOrDefault(t.borderColor,e.borderColor)}function lineTo(s,e,t){s.lineTo(t.x,t.y)}function getLineMethod(s){return s.stepped?_steppedLineTo:s.tension||s.cubicInterpolationMode==="monotone"?_bezierCurveTo:lineTo}function pathVars(s,e,t={}){const i=s.length,{start:n=0,end:o=i-1}=t,{start:r,end:a}=e,l=Math.max(n,r),d=Math.min(o,a),h=n<r&&o<r||n>a&&o>a;return{count:i,start:l,loop:e.loop,ilen:d<l&&!h?i+d-l:d-l}}function pathSegment(s,e,t,i){const{points:n,options:o}=e,{count:r,start:a,loop:l,ilen:d}=pathVars(n,t,i),h=getLineMethod(o);let{move:p=!0,reverse:m}=i||{},v,y,b;for(v=0;v<=d;++v)y=n[(a+(m?d-v:v))%r],!y.skip&&(p?(s.moveTo(y.x,y.y),p=!1):h(s,b,y,m,o.stepped),b=y);return l&&(y=n[(a+(m?d:0))%r],h(s,b,y,m,o.stepped)),!!l}function fastPathSegment(s,e,t,i){const n=e.points,{count:o,start:r,ilen:a}=pathVars(n,t,i),{move:l=!0,reverse:d}=i||{};let h=0,p=0,m,v,y,b,S,E;const T=A=>(r+(d?a-A:A))%o,R=()=>{b!==S&&(s.lineTo(h,S),s.lineTo(h,b),s.lineTo(h,E))};for(l&&(v=n[T(0)],s.moveTo(v.x,v.y)),m=0;m<=a;++m){if(v=n[T(m)],v.skip)continue;const A=v.x,D=v.y,x=A|0;x===y?(D<b?b=D:D>S&&(S=D),h=(p*h+A)/++p):(R(),s.lineTo(A,D),y=x,p=0,b=S=D),E=D}R()}function _getSegmentMethod(s){const e=s.options,t=e.borderDash&&e.borderDash.length;return!s._decimated&&!s._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?fastPathSegment:pathSegment}function _getInterpolationMethod(s){return s.stepped?_steppedInterpolation:s.tension||s.cubicInterpolationMode==="monotone"?_bezierInterpolation:_pointInLine}function strokePathWithCache(s,e,t,i){let n=e._path;n||(n=e._path=new Path2D,e.path(n,t,i)&&n.closePath()),setStyle$1(s,e.options),s.stroke(n)}function strokePathDirect(s,e,t,i){const{segments:n,options:o}=e,r=_getSegmentMethod(e);for(const a of n)setStyle$1(s,o,a.style),s.beginPath(),r(s,e,a,{start:t,end:t+i-1})&&s.closePath(),s.stroke()}const usePath2D=typeof Path2D=="function";function draw(s,e,t,i){usePath2D&&!e.options.segment?strokePathWithCache(s,e,t,i):strokePathDirect(s,e,t,i)}class LineElement extends Element$1{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;_updateBezierControlPoints(this._points,i,e,n,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=_computeSegments(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,i=e.length;return i&&t[e[i-1].end]}interpolate(e,t){const i=this.options,n=e[t],o=this.points,r=_boundSegments(this,{property:t,start:n,end:n});if(!r.length)return;const a=[],l=_getInterpolationMethod(i);let d,h;for(d=0,h=r.length;d<h;++d){const{start:p,end:m}=r[d],v=o[p],y=o[m];if(v===y){a.push(v);continue}const b=Math.abs((n-v[t])/(y[t]-v[t])),S=l(v,y,b,i.stepped);S[t]=e[t],a.push(S)}return a.length===1?a[0]:a}pathSegment(e,t,i){return _getSegmentMethod(this)(e,this,t,i)}path(e,t,i){const n=this.segments,o=_getSegmentMethod(this);let r=this._loop;t=t||0,i=i||this.points.length-t;for(const a of n)r&=o(e,this,a,{start:t,end:t+i-1});return!!r}draw(e,t,i,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),draw(e,this,i,n),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}G(LineElement,"id","line"),G(LineElement,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),G(LineElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),G(LineElement,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function inRange$1(s,e,t,i){const n=s.options,{[t]:o}=s.getProps([t],i);return Math.abs(e-o)<n.radius+n.hitRadius}class PointElement extends Element$1{constructor(t){super();G(this,"parsed");G(this,"skip");G(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,i,n){const o=this.options,{x:r,y:a}=this.getProps(["x","y"],n);return Math.pow(t-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(t,i){return inRange$1(this,t,"x",i)}inYRange(t,i){return inRange$1(this,t,"y",i)}getCenterPoint(t){const{x:i,y:n}=this.getProps(["x","y"],t);return{x:i,y:n}}size(t){t=t||this.options||{};let i=t.radius||0;i=Math.max(i,i&&t.hoverRadius||0);const n=i&&t.borderWidth||0;return(i+n)*2}draw(t,i){const n=this.options;this.skip||n.radius<.1||!_isPointInArea(this,i,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,drawPoint(t,n,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}G(PointElement,"id","point"),G(PointElement,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),G(PointElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function getBarBounds(s,e){const{x:t,y:i,base:n,width:o,height:r}=s.getProps(["x","y","base","width","height"],e);let a,l,d,h,p;return s.horizontal?(p=r/2,a=Math.min(t,n),l=Math.max(t,n),d=i-p,h=i+p):(p=o/2,a=t-p,l=t+p,d=Math.min(i,n),h=Math.max(i,n)),{left:a,top:d,right:l,bottom:h}}function skipOrLimit(s,e,t,i){return s?0:_limitValue(e,t,i)}function parseBorderWidth(s,e,t){const i=s.options.borderWidth,n=s.borderSkipped,o=toTRBL(i);return{t:skipOrLimit(n.top,o.top,0,t),r:skipOrLimit(n.right,o.right,0,e),b:skipOrLimit(n.bottom,o.bottom,0,t),l:skipOrLimit(n.left,o.left,0,e)}}function parseBorderRadius(s,e,t){const{enableBorderRadius:i}=s.getProps(["enableBorderRadius"]),n=s.options.borderRadius,o=toTRBLCorners(n),r=Math.min(e,t),a=s.borderSkipped,l=i||isObject(n);return{topLeft:skipOrLimit(!l||a.top||a.left,o.topLeft,0,r),topRight:skipOrLimit(!l||a.top||a.right,o.topRight,0,r),bottomLeft:skipOrLimit(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:skipOrLimit(!l||a.bottom||a.right,o.bottomRight,0,r)}}function boundingRects(s){const e=getBarBounds(s),t=e.right-e.left,i=e.bottom-e.top,n=parseBorderWidth(s,t/2,i/2),o=parseBorderRadius(s,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:o},inner:{x:e.left+n.l,y:e.top+n.t,w:t-n.l-n.r,h:i-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function inRange(s,e,t,i){const n=e===null,o=t===null,a=s&&!(n&&o)&&getBarBounds(s,i);return a&&(n||_isBetween(e,a.left,a.right))&&(o||_isBetween(t,a.top,a.bottom))}function hasRadius(s){return s.topLeft||s.topRight||s.bottomLeft||s.bottomRight}function addNormalRectPath(s,e){s.rect(e.x,e.y,e.w,e.h)}function inflateRect(s,e,t={}){const i=s.x!==t.x?-e:0,n=s.y!==t.y?-e:0,o=(s.x+s.w!==t.x+t.w?e:0)-i,r=(s.y+s.h!==t.y+t.h?e:0)-n;return{x:s.x+i,y:s.y+n,w:s.w+o,h:s.h+r,radius:s.radius}}class BarElement extends Element$1{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:i,backgroundColor:n}}=this,{inner:o,outer:r}=boundingRects(this),a=hasRadius(r.radius)?addRoundedRectPath:addNormalRectPath;e.save(),(r.w!==o.w||r.h!==o.h)&&(e.beginPath(),a(e,inflateRect(r,t,o)),e.clip(),a(e,inflateRect(o,-t,r)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),a(e,inflateRect(o,t)),e.fillStyle=n,e.fill(),e.restore()}inRange(e,t,i){return inRange(this,e,t,i)}inXRange(e,t){return inRange(this,e,null,t)}inYRange(e,t){return inRange(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(t+n)/2:t,y:o?i:(i+n)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}G(BarElement,"id","bar"),G(BarElement,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),G(BarElement,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const BORDER_COLORS=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],BACKGROUND_COLORS=BORDER_COLORS.map(s=>s.replace("rgb(","rgba(").replace(")",", 0.5)"));function getBorderColor(s){return BORDER_COLORS[s%BORDER_COLORS.length]}function getBackgroundColor(s){return BACKGROUND_COLORS[s%BACKGROUND_COLORS.length]}function colorizeDefaultDataset(s,e){return s.borderColor=getBorderColor(e),s.backgroundColor=getBackgroundColor(e),++e}function colorizeDoughnutDataset(s,e){return s.backgroundColor=s.data.map(()=>getBorderColor(e++)),e}function colorizePolarAreaDataset(s,e){return s.backgroundColor=s.data.map(()=>getBackgroundColor(e++)),e}function getColorizer(s){let e=0;return(t,i)=>{const n=s.getDatasetMeta(i).controller;n instanceof DoughnutController?e=colorizeDoughnutDataset(t,e):n instanceof PolarAreaController?e=colorizePolarAreaDataset(t,e):n&&(e=colorizeDefaultDataset(t,e))}}function containsColorsDefinitions(s){let e;for(e in s)if(s[e].borderColor||s[e].backgroundColor)return!0;return!1}function containsColorsDefinition(s){return s&&(s.borderColor||s.backgroundColor)}var plugin_colors={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(s,e,t){if(!t.enabled)return;const{data:{datasets:i},options:n}=s.config,{elements:o}=n;if(!t.forceOverride&&(containsColorsDefinitions(i)||containsColorsDefinition(n)||o&&containsColorsDefinitions(o)))return;const r=getColorizer(s);i.forEach(r)}};function _segments(s,e,t){const i=s.segments,n=s.points,o=e.points,r=[];for(const a of i){let{start:l,end:d}=a;d=_findSegmentEnd(l,d,n);const h=_getBounds(t,n[l],n[d],a.loop);if(!e.segments){r.push({source:a,target:h,start:n[l],end:n[d]});continue}const p=_boundSegments(e,h);for(const m of p){const v=_getBounds(t,o[m.start],o[m.end],m.loop),y=_boundSegment(a,n,v);for(const b of y)r.push({source:b,target:m,start:{[t]:_getEdge(h,v,"start",Math.max)},end:{[t]:_getEdge(h,v,"end",Math.min)}})}}return r}function _getBounds(s,e,t,i){if(i)return;let n=e[s],o=t[s];return s==="angle"&&(n=_normalizeAngle(n),o=_normalizeAngle(o)),{property:s,start:n,end:o}}function _pointsFromSegments(s,e){const{x:t=null,y:i=null}=s||{},n=e.points,o=[];return e.segments.forEach(({start:r,end:a})=>{a=_findSegmentEnd(r,a,n);const l=n[r],d=n[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:d.x,y:i})):t!==null&&(o.push({x:t,y:l.y}),o.push({x:t,y:d.y}))}),o}function _findSegmentEnd(s,e,t){for(;e>s;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function _getEdge(s,e,t,i){return s&&e?i(s[t],e[t]):s?s[t]:e?e[t]:0}function _createBoundaryLine(s,e){let t=[],i=!1;return isArray(s)?(i=!0,t=s):t=_pointsFromSegments(s,e),t.length?new LineElement({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function _shouldApplyFill(s){return s&&s.fill!==!1}function _resolveTarget(s,e,t){let n=s[e].fill;const o=[e];let r;if(!t)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!isNumberFinite(n))return n;if(r=s[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function _decodeFill(s,e,t){const i=parseFillOption(s);if(isObject(i))return isNaN(i.value)?!1:i;let n=parseFloat(i);return isNumberFinite(n)&&Math.floor(n)===n?decodeTargetIndex(i[0],e,n,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function decodeTargetIndex(s,e,t,i){return(s==="-"||s==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function _getTargetPixel(s,e){let t=null;return s==="start"?t=e.bottom:s==="end"?t=e.top:isObject(s)?t=e.getPixelForValue(s.value):e.getBasePixel&&(t=e.getBasePixel()),t}function _getTargetValue(s,e,t){let i;return s==="start"?i=t:s==="end"?i=e.options.reverse?e.min:e.max:isObject(s)?i=s.value:i=e.getBaseValue(),i}function parseFillOption(s){const e=s.options,t=e.fill;let i=valueOrDefault(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function _buildStackLine(s){const{scale:e,index:t,line:i}=s,n=[],o=i.segments,r=i.points,a=getLinesBelow(e,t);a.push(_createBoundaryLine({x:null,y:e.bottom},i));for(let l=0;l<o.length;l++){const d=o[l];for(let h=d.start;h<=d.end;h++)addPointsBelow(n,r[h],a)}return new LineElement({points:n,options:{}})}function getLinesBelow(s,e){const t=[],i=s.getMatchingVisibleMetas("line");for(let n=0;n<i.length;n++){const o=i[n];if(o.index===e)break;o.hidden||t.unshift(o.dataset)}return t}function addPointsBelow(s,e,t){const i=[];for(let n=0;n<t.length;n++){const o=t[n],{first:r,last:a,point:l}=findPoint(o,e,"x");if(!(!l||r&&a)){if(r)i.unshift(l);else if(s.push(l),!a)break}}s.push(...i)}function findPoint(s,e,t){const i=s.interpolate(e,t);if(!i)return{};const n=i[t],o=s.segments,r=s.points;let a=!1,l=!1;for(let d=0;d<o.length;d++){const h=o[d],p=r[h.start][t],m=r[h.end][t];if(_isBetween(n,p,m)){a=n===p,l=n===m;break}}return{first:a,last:l,point:i}}class simpleArc{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:n,y:o,radius:r}=this;return t=t||{start:0,end:TAU},e.arc(n,o,r,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:n}=this,o=e.angle;return{x:t+Math.cos(o)*n,y:i+Math.sin(o)*n,angle:o}}}function _getTarget(s){const{chart:e,fill:t,line:i}=s;if(isNumberFinite(t))return getLineByIndex(e,t);if(t==="stack")return _buildStackLine(s);if(t==="shape")return!0;const n=computeBoundary(s);return n instanceof simpleArc?n:_createBoundaryLine(n,i)}function getLineByIndex(s,e){const t=s.getDatasetMeta(e);return t&&s.isDatasetVisible(e)?t.dataset:null}function computeBoundary(s){return(s.scale||{}).getPointPositionForValue?computeCircularBoundary(s):computeLinearBoundary(s)}function computeLinearBoundary(s){const{scale:e={},fill:t}=s,i=_getTargetPixel(t,e);if(isNumberFinite(i)){const n=e.isHorizontal();return{x:n?i:null,y:n?null:i}}return null}function computeCircularBoundary(s){const{scale:e,fill:t}=s,i=e.options,n=e.getLabels().length,o=i.reverse?e.max:e.min,r=_getTargetValue(t,e,o),a=[];if(i.grid.circular){const l=e.getPointPositionForValue(0,o);return new simpleArc({x:l.x,y:l.y,radius:e.getDistanceFromCenterForValue(r)})}for(let l=0;l<n;++l)a.push(e.getPointPositionForValue(l,r));return a}function _drawfill(s,e,t){const i=_getTarget(e),{line:n,scale:o,axis:r}=e,a=n.options,l=a.fill,d=a.backgroundColor,{above:h=d,below:p=d}=l||{};i&&n.points.length&&(clipArea(s,t),doFill(s,{line:n,target:i,above:h,below:p,area:t,scale:o,axis:r}),unclipArea(s))}function doFill(s,e){const{line:t,target:i,above:n,below:o,area:r,scale:a}=e,l=t._loop?"angle":e.axis;s.save(),l==="x"&&o!==n&&(clipVertical(s,i,r.top),fill(s,{line:t,target:i,color:n,scale:a,property:l}),s.restore(),s.save(),clipVertical(s,i,r.bottom)),fill(s,{line:t,target:i,color:o,scale:a,property:l}),s.restore()}function clipVertical(s,e,t){const{segments:i,points:n}=e;let o=!0,r=!1;s.beginPath();for(const a of i){const{start:l,end:d}=a,h=n[l],p=n[_findSegmentEnd(l,d,n)];o?(s.moveTo(h.x,h.y),o=!1):(s.lineTo(h.x,t),s.lineTo(h.x,h.y)),r=!!e.pathSegment(s,a,{move:r}),r?s.closePath():s.lineTo(p.x,t)}s.lineTo(e.first().x,t),s.closePath(),s.clip()}function fill(s,e){const{line:t,target:i,property:n,color:o,scale:r}=e,a=_segments(t,i,n);for(const{source:l,target:d,start:h,end:p}of a){const{style:{backgroundColor:m=o}={}}=l,v=i!==!0;s.save(),s.fillStyle=m,clipBounds(s,r,v&&_getBounds(n,h,p)),s.beginPath();const y=!!t.pathSegment(s,l);let b;if(v){y?s.closePath():interpolatedLineTo(s,i,p,n);const S=!!i.pathSegment(s,d,{move:y,reverse:!0});b=y&&S,b||interpolatedLineTo(s,i,h,n)}s.closePath(),s.fill(b?"evenodd":"nonzero"),s.restore()}}function clipBounds(s,e,t){const{top:i,bottom:n}=e.chart.chartArea,{property:o,start:r,end:a}=t||{};o==="x"&&(s.beginPath(),s.rect(r,i,a-r,n-i),s.clip())}function interpolatedLineTo(s,e,t,i){const n=e.interpolate(t,i);n&&s.lineTo(n.x,n.y)}var index={id:"filler",afterDatasetsUpdate(s,e,t){const i=(s.data.datasets||[]).length,n=[];let o,r,a,l;for(r=0;r<i;++r)o=s.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof LineElement&&(l={visible:s.isDatasetVisible(r),index:r,fill:_decodeFill(a,r,i),chart:s,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,n.push(l);for(r=0;r<i;++r)l=n[r],!(!l||l.fill===!1)&&(l.fill=_resolveTarget(n,r,t.propagate))},beforeDraw(s,e,t){const i=t.drawTime==="beforeDraw",n=s.getSortedVisibleDatasetMetas(),o=s.chartArea;for(let r=n.length-1;r>=0;--r){const a=n[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&_drawfill(s.ctx,a,o))}},beforeDatasetsDraw(s,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=s.getSortedVisibleDatasetMetas();for(let n=i.length-1;n>=0;--n){const o=i[n].$filler;_shouldApplyFill(o)&&_drawfill(s.ctx,o,s.chartArea)}},beforeDatasetDraw(s,e,t){const i=e.meta.$filler;!_shouldApplyFill(i)||t.drawTime!=="beforeDatasetDraw"||_drawfill(s.ctx,i,s.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const getBoxSize=(s,e)=>{let{boxHeight:t=e,boxWidth:i=e}=s;return s.usePointStyle&&(t=Math.min(t,e),i=s.pointStyleWidth||Math.min(i,e)),{boxWidth:i,boxHeight:t,itemHeight:Math.max(e,t)}},itemsEqual=(s,e)=>s!==null&&e!==null&&s.datasetIndex===e.datasetIndex&&s.index===e.index;class Legend extends Element$1{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,i){this.maxWidth=e,this.maxHeight=t,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let t=callback(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(i=>e.filter(i,this.chart.data))),e.sort&&(t=t.sort((i,n)=>e.sort(i,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}const i=e.labels,n=toFont(i.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=getBoxSize(i,o);let d,h;t.font=n.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,d=this._fitCols(r,n,a,l)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(h,e.maxHeight||this.maxHeight)}_fitRows(e,t,i,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],d=this.lineWidths=[0],h=n+a;let p=e;o.textAlign="left",o.textBaseline="middle";let m=-1,v=-h;return this.legendItems.forEach((y,b)=>{const S=i+t/2+o.measureText(y.text).width;(b===0||d[d.length-1]+S+2*a>r)&&(p+=h,d[d.length-(b>0?0:1)]=0,v+=h,m++),l[b]={left:0,top:v,row:m,width:S,height:n},d[d.length-1]+=S+a}),p}_fitCols(e,t,i,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],d=this.columnSizes=[],h=r-e;let p=a,m=0,v=0,y=0,b=0;return this.legendItems.forEach((S,E)=>{const{itemWidth:T,itemHeight:R}=calculateItemSize(i,t,o,S,n);E>0&&v+R+2*a>h&&(p+=m+a,d.push({width:m,height:v}),y+=m+a,b++,m=v=0),l[E]={left:y,top:v,col:b,width:T,height:R},m=Math.max(m,T),v+=R+a}),p+=m,d.push({width:m,height:v}),p}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:i,labels:{padding:n},rtl:o}}=this,r=getRtlAdapter(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=_alignStartEnd(i,this.left+n,this.right-this.lineWidths[a]);for(const d of t)a!==d.row&&(a=d.row,l=_alignStartEnd(i,this.left+n,this.right-this.lineWidths[a])),d.top+=this.top+e+n,d.left=r.leftForLtr(r.x(l),d.width),l+=d.width+n}else{let a=0,l=_alignStartEnd(i,this.top+e+n,this.bottom-this.columnSizes[a].height);for(const d of t)d.col!==a&&(a=d.col,l=_alignStartEnd(i,this.top+e+n,this.bottom-this.columnSizes[a].height)),d.top=l,d.left+=this.left+n,d.left=r.leftForLtr(r.x(d.left),d.width),l+=d.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;clipArea(e,this),this._draw(),unclipArea(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:i,ctx:n}=this,{align:o,labels:r}=e,a=defaults.color,l=getRtlAdapter(e.rtl,this.left,this.width),d=toFont(r.font),{padding:h}=r,p=d.size,m=p/2;let v;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=d.string;const{boxWidth:y,boxHeight:b,itemHeight:S}=getBoxSize(r,p),E=function(x,M,I){if(isNaN(y)||y<=0||isNaN(b)||b<0)return;n.save();const V=valueOrDefault(I.lineWidth,1);if(n.fillStyle=valueOrDefault(I.fillStyle,a),n.lineCap=valueOrDefault(I.lineCap,"butt"),n.lineDashOffset=valueOrDefault(I.lineDashOffset,0),n.lineJoin=valueOrDefault(I.lineJoin,"miter"),n.lineWidth=V,n.strokeStyle=valueOrDefault(I.strokeStyle,a),n.setLineDash(valueOrDefault(I.lineDash,[])),r.usePointStyle){const z={radius:b*Math.SQRT2/2,pointStyle:I.pointStyle,rotation:I.rotation,borderWidth:V},B=l.xPlus(x,y/2),K=M+m;drawPointLegend(n,z,B,K,r.pointStyleWidth&&y)}else{const z=M+Math.max((p-b)/2,0),B=l.leftForLtr(x,y),K=toTRBLCorners(I.borderRadius);n.beginPath(),Object.values(K).some(J=>J!==0)?addRoundedRectPath(n,{x:B,y:z,w:y,h:b,radius:K}):n.rect(B,z,y,b),n.fill(),V!==0&&n.stroke()}n.restore()},T=function(x,M,I){renderText(n,I.text,x,M+S/2,d,{strikethrough:I.hidden,textAlign:l.textAlign(I.textAlign)})},R=this.isHorizontal(),A=this._computeTitleHeight();R?v={x:_alignStartEnd(o,this.left+h,this.right-i[0]),y:this.top+h+A,line:0}:v={x:this.left+h,y:_alignStartEnd(o,this.top+A+h,this.bottom-t[0].height),line:0},overrideTextDirection(this.ctx,e.textDirection);const D=S+h;this.legendItems.forEach((x,M)=>{n.strokeStyle=x.fontColor,n.fillStyle=x.fontColor;const I=n.measureText(x.text).width,V=l.textAlign(x.textAlign||(x.textAlign=r.textAlign)),z=y+m+I;let B=v.x,K=v.y;l.setWidth(this.width),R?M>0&&B+z+h>this.right&&(K=v.y+=D,v.line++,B=v.x=_alignStartEnd(o,this.left+h,this.right-i[v.line])):M>0&&K+D>this.bottom&&(B=v.x=B+t[v.line].width+h,v.line++,K=v.y=_alignStartEnd(o,this.top+A+h,this.bottom-t[v.line].height));const J=l.x(B);if(E(J,K,x),B=_textX(V,B+y+m,R?B+z:this.right,e.rtl),T(l.x(B),K,x),R)v.x+=z+h;else if(typeof x.text!="string"){const Z=d.lineHeight;v.y+=calculateLegendItemHeight(x,Z)+h}else v.y+=D}),restoreTextDirection(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,i=toFont(t.font),n=toPadding(t.padding);if(!t.display)return;const o=getRtlAdapter(e.rtl,this.left,this.width),r=this.ctx,a=t.position,l=i.size/2,d=n.top+l;let h,p=this.left,m=this.width;if(this.isHorizontal())m=Math.max(...this.lineWidths),h=this.top+d,p=_alignStartEnd(e.align,p,this.right-m);else{const y=this.columnSizes.reduce((b,S)=>Math.max(b,S.height),0);h=d+_alignStartEnd(e.align,this.top,this.bottom-y-e.labels.padding-this._computeTitleHeight())}const v=_alignStartEnd(a,p,p+m);r.textAlign=o.textAlign(_toLeftRightCenter(a)),r.textBaseline="middle",r.strokeStyle=t.color,r.fillStyle=t.color,r.font=i.string,renderText(r,t.text,v,h,i)}_computeTitleHeight(){const e=this.options.title,t=toFont(e.font),i=toPadding(e.padding);return e.display?t.lineHeight+i.height:0}_getLegendItemAt(e,t){let i,n,o;if(_isBetween(e,this.left,this.right)&&_isBetween(t,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(n=o[i],_isBetween(e,n.left,n.left+n.width)&&_isBetween(t,n.top,n.top+n.height))return this.legendItems[i]}return null}handleEvent(e){const t=this.options;if(!isListened(e.type,t))return;const i=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const n=this._hoveredItem,o=itemsEqual(n,i);n&&!o&&callback(t.onLeave,[e,n,this],this),this._hoveredItem=i,i&&!o&&callback(t.onHover,[e,i,this],this)}else i&&callback(t.onClick,[e,i,this],this)}}function calculateItemSize(s,e,t,i,n){const o=calculateItemWidth(i,s,e,t),r=calculateItemHeight(n,i,e.lineHeight);return{itemWidth:o,itemHeight:r}}function calculateItemWidth(s,e,t,i){let n=s.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),e+t.size/2+i.measureText(n).width}function calculateItemHeight(s,e,t){let i=s;return typeof e.text!="string"&&(i=calculateLegendItemHeight(e,t)),i}function calculateLegendItemHeight(s,e){const t=s.text?s.text.length:0;return e*t}function isListened(s,e){return!!((s==="mousemove"||s==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(s==="click"||s==="mouseup"))}var plugin_legend={id:"legend",_element:Legend,start(s,e,t){const i=s.legend=new Legend({ctx:s.ctx,options:t,chart:s});layouts.configure(s,i,t),layouts.addBox(s,i)},stop(s){layouts.removeBox(s,s.legend),delete s.legend},beforeUpdate(s,e,t){const i=s.legend;layouts.configure(s,i,t),i.options=t},afterUpdate(s){const e=s.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(s,e){e.replay||s.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(s,e,t){const i=e.datasetIndex,n=t.chart;n.isDatasetVisible(i)?(n.hide(i),e.hidden=!0):(n.show(i),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:s=>s.chart.options.color,boxWidth:40,padding:10,generateLabels(s){const e=s.data.datasets,{labels:{usePointStyle:t,pointStyle:i,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=s.legend.options;return s._getSortedDatasetMetas().map(l=>{const d=l.controller.getStyle(t?0:void 0),h=toPadding(d.borderWidth);return{text:e[l.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:n||d.textAlign,borderRadius:r&&(a||d.borderRadius),datasetIndex:l.index}},this)}},title:{color:s=>s.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:s=>!s.startsWith("on"),labels:{_scriptable:s=>!["generateLabels","filter","sort"].includes(s)}}};const positioners={average(s){if(!s.length)return!1;let e,t,i=new Set,n=0,o=0;for(e=0,t=s.length;e<t;++e){const a=s[e].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),n+=l.y,++o}}return{x:[...i].reduce((a,l)=>a+l)/i.size,y:n/o}},nearest(s,e){if(!s.length)return!1;let t=e.x,i=e.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=s.length;o<r;++o){const l=s[o].element;if(l&&l.hasValue()){const d=l.getCenterPoint(),h=distanceBetweenPoints(e,d);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();t=l.x,i=l.y}return{x:t,y:i}}};function pushOrConcat(s,e){return e&&(isArray(e)?Array.prototype.push.apply(s,e):s.push(e)),s}function splitNewlines(s){return(typeof s=="string"||s instanceof String)&&s.indexOf(`
|
||
`)>-1?s.split(`
|
||
`):s}function createTooltipItem(s,e){const{element:t,datasetIndex:i,index:n}=e,o=s.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:s,label:r,parsed:o.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:i,element:t}}function getTooltipSize(s,e){const t=s.chart.ctx,{body:i,footer:n,title:o}=s,{boxWidth:r,boxHeight:a}=e,l=toFont(e.bodyFont),d=toFont(e.titleFont),h=toFont(e.footerFont),p=o.length,m=n.length,v=i.length,y=toPadding(e.padding);let b=y.height,S=0,E=i.reduce((A,D)=>A+D.before.length+D.lines.length+D.after.length,0);if(E+=s.beforeBody.length+s.afterBody.length,p&&(b+=p*d.lineHeight+(p-1)*e.titleSpacing+e.titleMarginBottom),E){const A=e.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=v*A+(E-v)*l.lineHeight+(E-1)*e.bodySpacing}m&&(b+=e.footerMarginTop+m*h.lineHeight+(m-1)*e.footerSpacing);let T=0;const R=function(A){S=Math.max(S,t.measureText(A).width+T)};return t.save(),t.font=d.string,each(s.title,R),t.font=l.string,each(s.beforeBody.concat(s.afterBody),R),T=e.displayColors?r+2+e.boxPadding:0,each(i,A=>{each(A.before,R),each(A.lines,R),each(A.after,R)}),T=0,t.font=h.string,each(s.footer,R),t.restore(),S+=y.width,{width:S,height:b}}function determineYAlign(s,e){const{y:t,height:i}=e;return t<i/2?"top":t>s.height-i/2?"bottom":"center"}function doesNotFitWithAlign(s,e,t,i){const{x:n,width:o}=i,r=t.caretSize+t.caretPadding;if(s==="left"&&n+o+r>e.width||s==="right"&&n-o-r<0)return!0}function determineXAlign(s,e,t,i){const{x:n,width:o}=t,{width:r,chartArea:{left:a,right:l}}=s;let d="center";return i==="center"?d=n<=(a+l)/2?"left":"right":n<=o/2?d="left":n>=r-o/2&&(d="right"),doesNotFitWithAlign(d,s,e,t)&&(d="center"),d}function determineAlignment(s,e,t){const i=t.yAlign||e.yAlign||determineYAlign(s,t);return{xAlign:t.xAlign||e.xAlign||determineXAlign(s,e,t,i),yAlign:i}}function alignX(s,e){let{x:t,width:i}=s;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function alignY(s,e,t){let{y:i,height:n}=s;return e==="top"?i+=t:e==="bottom"?i-=n+t:i-=n/2,i}function getBackgroundPoint(s,e,t,i){const{caretSize:n,caretPadding:o,cornerRadius:r}=s,{xAlign:a,yAlign:l}=t,d=n+o,{topLeft:h,topRight:p,bottomLeft:m,bottomRight:v}=toTRBLCorners(r);let y=alignX(e,a);const b=alignY(e,l,d);return l==="center"?a==="left"?y+=d:a==="right"&&(y-=d):a==="left"?y-=Math.max(h,m)+n:a==="right"&&(y+=Math.max(p,v)+n),{x:_limitValue(y,0,i.width-e.width),y:_limitValue(b,0,i.height-e.height)}}function getAlignedX(s,e,t){const i=toPadding(t.padding);return e==="center"?s.x+s.width/2:e==="right"?s.x+s.width-i.right:s.x+i.left}function getBeforeAfterBodyLines(s){return pushOrConcat([],splitNewlines(s))}function createTooltipContext(s,e,t){return createContext(s,{tooltip:e,tooltipItems:t,type:"tooltip"})}function overrideCallbacks(s,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?s.override(t):s}const defaultCallbacks={beforeTitle:noop$1,title(s){if(s.length>0){const e=s[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:noop$1,beforeBody:noop$1,beforeLabel:noop$1,label(s){if(this&&this.options&&this.options.mode==="dataset")return s.label+": "+s.formattedValue||s.formattedValue;let e=s.dataset.label||"";e&&(e+=": ");const t=s.formattedValue;return isNullOrUndef(t)||(e+=t),e},labelColor(s){const t=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(s){const t=s.chart.getDatasetMeta(s.datasetIndex).controller.getStyle(s.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:noop$1,afterBody:noop$1,beforeFooter:noop$1,footer:noop$1,afterFooter:noop$1};function invokeCallbackWithFallback(s,e,t,i){const n=s[e].call(t,i);return typeof n>"u"?defaultCallbacks[e].call(t,i):n}class Tooltip extends Element$1{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&t.options.animation&&i.animations,o=new Animations(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=createTooltipContext(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,n=invokeCallbackWithFallback(i,"beforeTitle",this,e),o=invokeCallbackWithFallback(i,"title",this,e),r=invokeCallbackWithFallback(i,"afterTitle",this,e);let a=[];return a=pushOrConcat(a,splitNewlines(n)),a=pushOrConcat(a,splitNewlines(o)),a=pushOrConcat(a,splitNewlines(r)),a}getBeforeBody(e,t){return getBeforeAfterBodyLines(invokeCallbackWithFallback(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,n=[];return each(e,o=>{const r={before:[],lines:[],after:[]},a=overrideCallbacks(i,o);pushOrConcat(r.before,splitNewlines(invokeCallbackWithFallback(a,"beforeLabel",this,o))),pushOrConcat(r.lines,invokeCallbackWithFallback(a,"label",this,o)),pushOrConcat(r.after,splitNewlines(invokeCallbackWithFallback(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(e,t){return getBeforeAfterBodyLines(invokeCallbackWithFallback(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,n=invokeCallbackWithFallback(i,"beforeFooter",this,e),o=invokeCallbackWithFallback(i,"footer",this,e),r=invokeCallbackWithFallback(i,"afterFooter",this,e);let a=[];return a=pushOrConcat(a,splitNewlines(n)),a=pushOrConcat(a,splitNewlines(o)),a=pushOrConcat(a,splitNewlines(r)),a}_createItems(e){const t=this._active,i=this.chart.data,n=[],o=[],r=[];let a=[],l,d;for(l=0,d=t.length;l<d;++l)a.push(createTooltipItem(this.chart,t[l]));return e.filter&&(a=a.filter((h,p,m)=>e.filter(h,p,m,i))),e.itemSort&&(a=a.sort((h,p)=>e.itemSort(h,p,i))),each(a,h=>{const p=overrideCallbacks(e.callbacks,h);n.push(invokeCallbackWithFallback(p,"labelColor",this,h)),o.push(invokeCallbackWithFallback(p,"labelPointStyle",this,h)),r.push(invokeCallbackWithFallback(p,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(e,t){const i=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=positioners[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=getTooltipSize(this,i),d=Object.assign({},a,l),h=determineAlignment(this.chart,i,d),p=getBackgroundPoint(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:p.x,y:p.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,n){const o=this.getCaretPosition(e,i,n);t.lineTo(o.x1,o.y1),t.lineTo(o.x2,o.y2),t.lineTo(o.x3,o.y3)}getCaretPosition(e,t,i){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:d,bottomLeft:h,bottomRight:p}=toTRBLCorners(a),{x:m,y:v}=e,{width:y,height:b}=t;let S,E,T,R,A,D;return o==="center"?(A=v+b/2,n==="left"?(S=m,E=S-r,R=A+r,D=A-r):(S=m+y,E=S+r,R=A-r,D=A+r),T=S):(n==="left"?E=m+Math.max(l,h)+r:n==="right"?E=m+y-Math.max(d,p)-r:E=this.caretX,o==="top"?(R=v,A=R-r,S=E-r,T=E+r):(R=v+b,A=R+r,S=E+r,T=E-r),D=R),{x1:S,x2:E,x3:T,y1:R,y2:A,y3:D}}drawTitle(e,t,i){const n=this.title,o=n.length;let r,a,l;if(o){const d=getRtlAdapter(i.rtl,this.x,this.width);for(e.x=getAlignedX(this,i.titleAlign,i),t.textAlign=d.textAlign(i.titleAlign),t.textBaseline="middle",r=toFont(i.titleFont),a=i.titleSpacing,t.fillStyle=i.titleColor,t.font=r.string,l=0;l<o;++l)t.fillText(n[l],d.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+a,l+1===o&&(e.y+=i.titleMarginBottom-a)}}_drawColorBox(e,t,i,n,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:d}=o,h=toFont(o.bodyFont),p=getAlignedX(this,"left",o),m=n.x(p),v=l<h.lineHeight?(h.lineHeight-l)/2:0,y=t.y+v;if(o.usePointStyle){const b={radius:Math.min(d,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},S=n.leftForLtr(m,d)+d/2,E=y+l/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,drawPoint(e,b,S,E),e.strokeStyle=r.borderColor,e.fillStyle=r.backgroundColor,drawPoint(e,b,S,E)}else{e.lineWidth=isObject(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,e.strokeStyle=r.borderColor,e.setLineDash(r.borderDash||[]),e.lineDashOffset=r.borderDashOffset||0;const b=n.leftForLtr(m,d),S=n.leftForLtr(n.xPlus(m,1),d-2),E=toTRBLCorners(r.borderRadius);Object.values(E).some(T=>T!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,addRoundedRectPath(e,{x:b,y,w:d,h:l,radius:E}),e.fill(),e.stroke(),e.fillStyle=r.backgroundColor,e.beginPath(),addRoundedRectPath(e,{x:S,y:y+1,w:d-2,h:l-2,radius:E}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(b,y,d,l),e.strokeRect(b,y,d,l),e.fillStyle=r.backgroundColor,e.fillRect(S,y+1,d-2,l-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:d,boxPadding:h}=i,p=toFont(i.bodyFont);let m=p.lineHeight,v=0;const y=getRtlAdapter(i.rtl,this.x,this.width),b=function(I){t.fillText(I,y.x(e.x+v),e.y+m/2),e.y+=m+o},S=y.textAlign(r);let E,T,R,A,D,x,M;for(t.textAlign=r,t.textBaseline="middle",t.font=p.string,e.x=getAlignedX(this,S,i),t.fillStyle=i.bodyColor,each(this.beforeBody,b),v=a&&S!=="right"?r==="center"?d/2+h:d+2+h:0,A=0,x=n.length;A<x;++A){for(E=n[A],T=this.labelTextColors[A],t.fillStyle=T,each(E.before,b),R=E.lines,a&&R.length&&(this._drawColorBox(t,e,A,y,i),m=Math.max(p.lineHeight,l)),D=0,M=R.length;D<M;++D)b(R[D]),m=p.lineHeight;each(E.after,b)}v=0,m=p.lineHeight,each(this.afterBody,b),e.y-=o}drawFooter(e,t,i){const n=this.footer,o=n.length;let r,a;if(o){const l=getRtlAdapter(i.rtl,this.x,this.width);for(e.x=getAlignedX(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=l.textAlign(i.footerAlign),t.textBaseline="middle",r=toFont(i.footerFont),t.fillStyle=i.footerColor,t.font=r.string,a=0;a<o;++a)t.fillText(n[a],l.x(e.x),e.y+r.lineHeight/2),e.y+=r.lineHeight+i.footerSpacing}}drawBackground(e,t,i,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=e,{width:d,height:h}=i,{topLeft:p,topRight:m,bottomLeft:v,bottomRight:y}=toTRBLCorners(n.cornerRadius);t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.beginPath(),t.moveTo(a+p,l),r==="top"&&this.drawCaret(e,t,i,n),t.lineTo(a+d-m,l),t.quadraticCurveTo(a+d,l,a+d,l+m),r==="center"&&o==="right"&&this.drawCaret(e,t,i,n),t.lineTo(a+d,l+h-y),t.quadraticCurveTo(a+d,l+h,a+d-y,l+h),r==="bottom"&&this.drawCaret(e,t,i,n),t.lineTo(a+v,l+h),t.quadraticCurveTo(a,l+h,a,l+h-v),r==="center"&&o==="left"&&this.drawCaret(e,t,i,n),t.lineTo(a,l+p),t.quadraticCurveTo(a,l,a+p,l),t.closePath(),t.fill(),n.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,n=i&&i.x,o=i&&i.y;if(n||o){const r=positioners[e.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=getTooltipSize(this,e),l=Object.assign({},r,this._size),d=determineAlignment(t,e,l),h=getBackgroundPoint(e,l,d,t);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(t);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=toPadding(t.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&a&&(e.save(),e.globalAlpha=i,this.drawBackground(o,e,n,t),overrideTextDirection(e,t.textDirection),o.y+=r.top,this.drawTitle(o,e,t),this.drawBody(o,e,t),this.drawFooter(o,e,t),restoreTextDirection(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,n=e.map(({datasetIndex:a,index:l})=>{const d=this.chart.getDatasetMeta(a);if(!d)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:d.data[l],index:l}}),o=!_elementsEqual(i,n),r=this._positionChanged(n,t);(o||r)&&(this._active=n,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(e,o,t,i),a=this._positionChanged(r,e),l=t||!_elementsEqual(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),l}_getActiveElements(e,t,i,n){const o=this.options;if(e.type==="mouseout")return[];if(!n)return t.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(e,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(e,t){const{caretX:i,caretY:n,options:o}=this,r=positioners[o.position].call(this,e,t);return r!==!1&&(i!==r.x||n!==r.y)}}G(Tooltip,"positioners",positioners);var plugin_tooltip={id:"tooltip",_element:Tooltip,positioners,afterInit(s,e,t){t&&(s.tooltip=new Tooltip({chart:s,options:t}))},beforeUpdate(s,e,t){s.tooltip&&s.tooltip.initialize(t)},reset(s,e,t){s.tooltip&&s.tooltip.initialize(t)},afterDraw(s){const e=s.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(s.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",t)}},afterEvent(s,e){if(s.tooltip){const t=e.replay;s.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(s,e)=>e.bodyFont.size,boxWidth:(s,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:defaultCallbacks},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:s=>s!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const addIfString=(s,e,t,i)=>(typeof e=="string"?(t=s.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function findOrAddLabel(s,e,t,i){const n=s.indexOf(e);if(n===-1)return addIfString(s,e,t,i);const o=s.lastIndexOf(e);return n!==o?t:n}const validIndex=(s,e)=>s===null?null:_limitValue(Math.round(s),0,e);function _getLabelForValue(s){const e=this.getLabels();return s>=0&&s<e.length?e[s]:s}class CategoryScale extends Scale{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const i=this.getLabels();for(const{index:n,label:o}of t)i[n]===o&&i.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(isNullOrUndef(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:findOrAddLabel(i,e,valueOrDefault(t,e),this._addedLabels),validIndex(t,i.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:i,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(i=0),t||(n=this.getLabels().length-1)),this.min=i,this.max=n}buildTicks(){const e=this.min,t=this.max,i=this.options.offset,n=[];let o=this.getLabels();o=e===0&&t===o.length-1?o:o.slice(e,t+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=e;r<=t;r++)n.push({value:r});return n}getLabelForValue(e){return _getLabelForValue.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}G(CategoryScale,"id","category"),G(CategoryScale,"defaults",{ticks:{callback:_getLabelForValue}});function generateTicks$1(s,e){const t=[],{bounds:n,step:o,min:r,max:a,precision:l,count:d,maxTicks:h,maxDigits:p,includeBounds:m}=s,v=o||1,y=h-1,{min:b,max:S}=e,E=!isNullOrUndef(r),T=!isNullOrUndef(a),R=!isNullOrUndef(d),A=(S-b)/(p+1);let D=niceNum((S-b)/y/v)*v,x,M,I,V;if(D<1e-14&&!E&&!T)return[{value:b},{value:S}];V=Math.ceil(S/D)-Math.floor(b/D),V>y&&(D=niceNum(V*D/y/v)*v),isNullOrUndef(l)||(x=Math.pow(10,l),D=Math.ceil(D*x)/x),n==="ticks"?(M=Math.floor(b/D)*D,I=Math.ceil(S/D)*D):(M=b,I=S),E&&T&&o&&almostWhole((a-r)/o,D/1e3)?(V=Math.round(Math.min((a-r)/D,h)),D=(a-r)/V,M=r,I=a):R?(M=E?r:M,I=T?a:I,V=d-1,D=(I-M)/V):(V=(I-M)/D,almostEquals(V,Math.round(V),D/1e3)?V=Math.round(V):V=Math.ceil(V));const z=Math.max(_decimalPlaces(D),_decimalPlaces(M));x=Math.pow(10,isNullOrUndef(l)?z:l),M=Math.round(M*x)/x,I=Math.round(I*x)/x;let B=0;for(E&&(m&&M!==r?(t.push({value:r}),M<r&&B++,almostEquals(Math.round((M+B*D)*x)/x,r,relativeLabelSize(r,A,s))&&B++):M<r&&B++);B<V;++B){const K=Math.round((M+B*D)*x)/x;if(T&&K>a)break;t.push({value:K})}return T&&m&&I!==a?t.length&&almostEquals(t[t.length-1].value,a,relativeLabelSize(a,A,s))?t[t.length-1].value=a:t.push({value:a}):(!T||I===a)&&t.push({value:I}),t}function relativeLabelSize(s,e,{horizontal:t,minRotation:i}){const n=toRadians(i),o=(t?Math.sin(n):Math.cos(n))||.001,r=.75*e*(""+s).length;return Math.min(e/o,r)}class LinearScaleBase extends Scale{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return isNullOrUndef(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=t?n:l,a=l=>o=i?o:l;if(e){const l=sign(n),d=sign(o);l<0&&d<0?a(0):l>0&&d>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),e||r(n-l)}this.min=n,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),t=t||11),t&&(n=Math.min(t,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks:i,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},o=this._range||this,r=generateTicks$1(n,o);return e.bounds==="ticks"&&_setMinAndMaxByKey(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const e=this.ticks;let t=this.min,i=this.max;if(super.configure(),this.options.offset&&e.length){const n=(i-t)/Math.max(e.length-1,1)/2;t-=n,i+=n}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return formatNumber(e,this.chart.options.locale,this.options.ticks.format)}}class LinearScale extends LinearScaleBase{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=isNumberFinite(e)?e:0,this.max=isNumberFinite(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=toRadians(this.options.ticks.minRotation),n=(e?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/n))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}G(LinearScale,"id","linear"),G(LinearScale,"defaults",{ticks:{callback:Ticks.formatters.numeric}});const log10Floor=s=>Math.floor(log10(s)),changeExponent=(s,e)=>Math.pow(10,log10Floor(s)+e);function isMajor(s){return s/Math.pow(10,log10Floor(s))===1}function steps(s,e,t){const i=Math.pow(10,t),n=Math.floor(s/i);return Math.ceil(e/i)-n}function startExp(s,e){const t=e-s;let i=log10Floor(t);for(;steps(s,e,i)>10;)i++;for(;steps(s,e,i)<10;)i--;return Math.min(i,log10Floor(s))}function generateTicks(s,{min:e,max:t}){e=finiteOrDefault(s.min,e);const i=[],n=log10Floor(e);let o=startExp(e,t),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=n>o?Math.pow(10,n):0,d=Math.round((e-l)*r)/r,h=Math.floor((e-l)/a/10)*a*10;let p=Math.floor((d-h)/Math.pow(10,o)),m=finiteOrDefault(s.min,Math.round((l+h+p*Math.pow(10,o))*r)/r);for(;m<t;)i.push({value:m,major:isMajor(m),significand:p}),p>=10?p=p<15?15:20:p++,p>=20&&(o++,p=2,r=o>=0?1:r),m=Math.round((l+h+p*Math.pow(10,o))*r)/r;const v=finiteOrDefault(s.max,m);return i.push({value:v,major:isMajor(v),significand:p}),i}class LogarithmicScale extends Scale{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=LinearScaleBase.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return isNumberFinite(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=isNumberFinite(e)?Math.max(0,e):null,this.max=isNumberFinite(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!isNumberFinite(this._userMin)&&(this.min=e===changeExponent(this.min,0)?changeExponent(this.min,-1):changeExponent(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let i=this.min,n=this.max;const o=a=>i=e?i:a,r=a=>n=t?n:a;i===n&&(i<=0?(o(1),r(10)):(o(changeExponent(i,-1)),r(changeExponent(n,1)))),i<=0&&o(changeExponent(n,-1)),n<=0&&r(changeExponent(i,1)),this.min=i,this.max=n}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},i=generateTicks(t,this);return e.bounds==="ticks"&&_setMinAndMaxByKey(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(e){return e===void 0?"0":formatNumber(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=log10(e),this._valueRange=log10(this.max)-log10(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(log10(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}G(LogarithmicScale,"id","logarithmic"),G(LogarithmicScale,"defaults",{ticks:{callback:Ticks.formatters.logarithmic,major:{enabled:!0}}});function getTickBackdropHeight(s){const e=s.ticks;if(e.display&&s.display){const t=toPadding(e.backdropPadding);return valueOrDefault(e.font&&e.font.size,defaults.font.size)+t.height}return 0}function measureLabelSize(s,e,t){return t=isArray(t)?t:[t],{w:_longestText(s,e.string,t),h:t.length*e.lineHeight}}function determineLimits(s,e,t,i,n){return s===i||s===n?{start:e-t/2,end:e+t/2}:s<i||s>n?{start:e-t,end:e}:{start:e,end:e+t}}function fitWithPointLabels(s){const e={l:s.left+s._padding.left,r:s.right-s._padding.right,t:s.top+s._padding.top,b:s.bottom-s._padding.bottom},t=Object.assign({},e),i=[],n=[],o=s._pointLabels.length,r=s.options.pointLabels,a=r.centerPointLabels?PI/o:0;for(let l=0;l<o;l++){const d=r.setContext(s.getPointLabelContext(l));n[l]=d.padding;const h=s.getPointPosition(l,s.drawingArea+n[l],a),p=toFont(d.font),m=measureLabelSize(s.ctx,p,s._pointLabels[l]);i[l]=m;const v=_normalizeAngle(s.getIndexAngle(l)+a),y=Math.round(toDegrees(v)),b=determineLimits(y,h.x,m.w,0,180),S=determineLimits(y,h.y,m.h,90,270);updateLimits(t,e,v,b,S)}s.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),s._pointLabelItems=buildPointLabelItems(s,i,n)}function updateLimits(s,e,t,i,n){const o=Math.abs(Math.sin(t)),r=Math.abs(Math.cos(t));let a=0,l=0;i.start<e.l?(a=(e.l-i.start)/o,s.l=Math.min(s.l,e.l-a)):i.end>e.r&&(a=(i.end-e.r)/o,s.r=Math.max(s.r,e.r+a)),n.start<e.t?(l=(e.t-n.start)/r,s.t=Math.min(s.t,e.t-l)):n.end>e.b&&(l=(n.end-e.b)/r,s.b=Math.max(s.b,e.b+l))}function createPointLabelItem(s,e,t){const i=s.drawingArea,{extra:n,additionalAngle:o,padding:r,size:a}=t,l=s.getPointPosition(e,i+n+r,o),d=Math.round(toDegrees(_normalizeAngle(l.angle+HALF_PI))),h=yForAngle(l.y,a.h,d),p=getTextAlignForAngle(d),m=leftForTextAlign(l.x,a.w,p);return{visible:!0,x:l.x,y:h,textAlign:p,left:m,top:h,right:m+a.w,bottom:h+a.h}}function isNotOverlapped(s,e){if(!e)return!0;const{left:t,top:i,right:n,bottom:o}=s;return!(_isPointInArea({x:t,y:i},e)||_isPointInArea({x:t,y:o},e)||_isPointInArea({x:n,y:i},e)||_isPointInArea({x:n,y:o},e))}function buildPointLabelItems(s,e,t){const i=[],n=s._pointLabels.length,o=s.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:getTickBackdropHeight(o)/2,additionalAngle:r?PI/n:0};let d;for(let h=0;h<n;h++){l.padding=t[h],l.size=e[h];const p=createPointLabelItem(s,h,l);i.push(p),a==="auto"&&(p.visible=isNotOverlapped(p,d),p.visible&&(d=p))}return i}function getTextAlignForAngle(s){return s===0||s===180?"center":s<180?"left":"right"}function leftForTextAlign(s,e,t){return t==="right"?s-=e:t==="center"&&(s-=e/2),s}function yForAngle(s,e,t){return t===90||t===270?s-=e/2:(t>270||t<90)&&(s-=e),s}function drawPointLabelBox(s,e,t){const{left:i,top:n,right:o,bottom:r}=t,{backdropColor:a}=e;if(!isNullOrUndef(a)){const l=toTRBLCorners(e.borderRadius),d=toPadding(e.backdropPadding);s.fillStyle=a;const h=i-d.left,p=n-d.top,m=o-i+d.width,v=r-n+d.height;Object.values(l).some(y=>y!==0)?(s.beginPath(),addRoundedRectPath(s,{x:h,y:p,w:m,h:v,radius:l}),s.fill()):s.fillRect(h,p,m,v)}}function drawPointLabels(s,e){const{ctx:t,options:{pointLabels:i}}=s;for(let n=e-1;n>=0;n--){const o=s._pointLabelItems[n];if(!o.visible)continue;const r=i.setContext(s.getPointLabelContext(n));drawPointLabelBox(t,r,o);const a=toFont(r.font),{x:l,y:d,textAlign:h}=o;renderText(t,s._pointLabels[n],l,d+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function pathRadiusLine(s,e,t,i){const{ctx:n}=s;if(t)n.arc(s.xCenter,s.yCenter,e,0,TAU);else{let o=s.getPointPosition(0,e);n.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=s.getPointPosition(r,e),n.lineTo(o.x,o.y)}}function drawRadiusLine(s,e,t,i,n){const o=s.ctx,r=e.circular,{color:a,lineWidth:l}=e;!r&&!i||!a||!l||t<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(n.dash),o.lineDashOffset=n.dashOffset,o.beginPath(),pathRadiusLine(s,t,r,i),o.closePath(),o.stroke(),o.restore())}function createPointLabelContext(s,e,t){return createContext(s,{label:t,index:e,type:"pointLabel"})}class RadialLinearScale extends LinearScaleBase{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=toPadding(getTickBackdropHeight(this.options)/2),t=this.width=this.maxWidth-e.width,i=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+i/2+e.top),this.drawingArea=Math.floor(Math.min(t,i)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=isNumberFinite(e)&&!isNaN(e)?e:0,this.max=isNumberFinite(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/getTickBackdropHeight(this.options))}generateTickLabels(e){LinearScaleBase.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const n=callback(this.options.pointLabels.callback,[t,i],this);return n||n===0?n:""}).filter((t,i)=>this.chart.getDataVisibility(i))}fit(){const e=this.options;e.display&&e.pointLabels.display?fitWithPointLabels(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,i,n){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((i-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,i,n))}getIndexAngle(e){const t=TAU/(this._pointLabels.length||1),i=this.options.startAngle||0;return _normalizeAngle(e*t+toRadians(i))}getDistanceFromCenterForValue(e){if(isNullOrUndef(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(isNullOrUndef(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const i=t[e];return createPointLabelContext(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const n=this.getIndexAngle(e)-HALF_PI+i;return{x:Math.cos(n)*t+this.xCenter,y:Math.sin(n)*t+this.yCenter,angle:n}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:i,right:n,bottom:o}=this._pointLabelItems[e];return{left:t,top:i,right:n,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const i=this.ctx;i.save(),i.beginPath(),pathRadiusLine(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),i.closePath(),i.fillStyle=e,i.fill(),i.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:i,grid:n,border:o}=t,r=this._pointLabels.length;let a,l,d;if(t.pointLabels.display&&drawPointLabels(this,r),n.display&&this.ticks.forEach((h,p)=>{if(p!==0||p===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const m=this.getContext(p),v=n.setContext(m),y=o.setContext(m);drawRadiusLine(this,v,l,r,y)}}),i.display){for(e.save(),a=r-1;a>=0;a--){const h=i.setContext(this.getPointLabelContext(a)),{color:p,lineWidth:m}=h;!m||!p||(e.lineWidth=m,e.strokeStyle=p,e.setLineDash(h.borderDash),e.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(t.ticks.reverse?this.min:this.max),d=this.getPointPosition(a,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,i=t.ticks;if(!i.display)return;const n=this.getIndexAngle(0);let o,r;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(n),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!t.reverse)return;const d=i.setContext(this.getContext(l)),h=toFont(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),d.showLabelBackdrop){e.font=h.string,r=e.measureText(a.label).width,e.fillStyle=d.backdropColor;const p=toPadding(d.backdropPadding);e.fillRect(-r/2-p.left,-o-h.size/2-p.top,r+p.width,h.size+p.height)}renderText(e,a.label,0,-o,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}G(RadialLinearScale,"id","radialLinear"),G(RadialLinearScale,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ticks.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),G(RadialLinearScale,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),G(RadialLinearScale,"descriptors",{angleLines:{_fallback:"grid"}});const INTERVALS={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},UNITS=Object.keys(INTERVALS);function sorter(s,e){return s-e}function parse(s,e){if(isNullOrUndef(e))return null;const t=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let r=e;return typeof i=="function"&&(r=i(r)),isNumberFinite(r)||(r=typeof i=="string"?t.parse(r,i):t.parse(r)),r===null?null:(n&&(r=n==="week"&&(isNumber(o)||o===!0)?t.startOf(r,"isoWeek",o):t.startOf(r,n)),+r)}function determineUnitForAutoTicks(s,e,t,i){const n=UNITS.length;for(let o=UNITS.indexOf(s);o<n-1;++o){const r=INTERVALS[UNITS[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((t-e)/(a*r.size))<=i)return UNITS[o]}return UNITS[n-1]}function determineUnitForFormatting(s,e,t,i,n){for(let o=UNITS.length-1;o>=UNITS.indexOf(t);o--){const r=UNITS[o];if(INTERVALS[r].common&&s._adapter.diff(n,i,r)>=e-1)return r}return UNITS[t?UNITS.indexOf(t):0]}function determineMajorUnit(s){for(let e=UNITS.indexOf(s)+1,t=UNITS.length;e<t;++e)if(INTERVALS[UNITS[e]].common)return UNITS[e]}function addTick(s,e,t){if(!t)s[e]=!0;else if(t.length){const{lo:i,hi:n}=_lookup(t,e),o=t[i]>=e?t[i]:t[n];s[o]=!0}}function setMajorTicks(s,e,t,i){const n=s._adapter,o=+n.startOf(e[0].value,i),r=e[e.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,i))l=t[a],l>=0&&(e[l].major=!0);return e}function ticksFromTimestamps(s,e,t){const i=[],n={},o=e.length;let r,a;for(r=0;r<o;++r)a=e[r],n[a]=r,i.push({value:a,major:!1});return o===0||!t?i:setMajorTicks(s,i,n,t)}class TimeScale extends Scale{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const i=e.time||(e.time={}),n=this._adapter=new adapters._date(e.adapters.date);n.init(t),mergeIf(i.displayFormats,n.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:parse(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,i=e.time.unit||"day";let{min:n,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(d){!r&&!isNaN(d.min)&&(n=Math.min(n,d.min)),!a&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!r||!a)&&(l(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=isNumberFinite(n)&&!isNaN(n)?n:+t.startOf(Date.now(),i),o=isNumberFinite(o)&&!isNaN(o)?o:+t.endOf(Date.now(),i)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],i=e[e.length-1]),{min:t,max:i}}buildTicks(){const e=this.options,t=e.time,i=e.ticks,n=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,r=this.max,a=_filterBetween(n,o,r);return this._unit=t.unit||(i.autoSkip?determineUnitForAutoTicks(t.minUnit,this.min,this.max,this._getLabelCapacity(o)):determineUnitForFormatting(this,a.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:determineMajorUnit(this._unit),this.initOffsets(n),e.reverse&&a.reverse(),ticksFromTimestamps(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,i=0,n,o;this.options.offset&&e.length&&(n=this.getDecimalForValue(e[0]),e.length===1?t=1-n:t=(this.getDecimalForValue(e[1])-n)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?i=o:i=(o-this.getDecimalForValue(e[e.length-2]))/2);const r=e.length<3?.5:.25;t=_limitValue(t,0,r),i=_limitValue(i,0,r),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,n=this.options,o=n.time,r=o.unit||determineUnitForAutoTicks(o.minUnit,t,i,this._getLabelCapacity(t)),a=valueOrDefault(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,d=isNumber(l)||l===!0,h={};let p=t,m,v;if(d&&(p=+e.startOf(p,"isoWeek",l)),p=+e.startOf(p,d?"day":r),e.diff(i,t,r)>1e5*a)throw new Error(t+" and "+i+" are too far apart with stepSize of "+a+" "+r);const y=n.ticks.source==="data"&&this.getDataTimestamps();for(m=p,v=0;m<i;m=+e.add(m,a,r),v++)addTick(h,m,y);return(m===i||n.bounds==="ticks"||v===1)&&addTick(h,m,y),Object.keys(h).sort(sorter).map(b=>+b)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const n=this.options.time.displayFormats,o=this._unit,r=t||n[o];return this._adapter.format(e,r)}_tickFormatFunction(e,t,i,n){const o=this.options,r=o.ticks.callback;if(r)return callback(r,[e,t,i],this);const a=o.time.displayFormats,l=this._unit,d=this._majorUnit,h=l&&a[l],p=d&&a[d],m=i[t],v=d&&p&&m&&m.major;return this._adapter.format(e,n||(v?p:h))}generateTickLabels(e){let t,i,n;for(t=0,i=e.length;t<i;++t)n=e[t],n.label=this._tickFormatFunction(n.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,n=toRadians(this.isHorizontal()?t.maxRotation:t.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,n=i[t.unit]||i.millisecond,o=this._tickFormatFunction(e,0,ticksFromTimestamps(this,[e],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],t,i;if(e.length)return e;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,i=n.length;t<i;++t)e=e.concat(n[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,i;if(e.length)return e;const n=this.getLabels();for(t=0,i=n.length;t<i;++t)e.push(parse(this,n[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return _arrayUnique(e.sort(sorter))}}G(TimeScale,"id","time"),G(TimeScale,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function interpolate(s,e,t){let i=0,n=s.length-1,o,r,a,l;t?(e>=s[i].pos&&e<=s[n].pos&&({lo:i,hi:n}=_lookupByKey(s,"pos",e)),{pos:o,time:a}=s[i],{pos:r,time:l}=s[n]):(e>=s[i].time&&e<=s[n].time&&({lo:i,hi:n}=_lookupByKey(s,"time",e)),{time:o,pos:a}=s[i],{time:r,pos:l}=s[n]);const d=r-o;return d?a+(l-a)*(e-o)/d:a}class TimeSeriesScale extends TimeScale{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=interpolate(t,this.min),this._tableRange=interpolate(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,n=[],o=[];let r,a,l,d,h;for(r=0,a=e.length;r<a;++r)d=e[r],d>=t&&d<=i&&n.push(d);if(n.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],l=n[r-1],d=n[r],Math.round((h+l)/2)!==d&&o.push({time:d,pos:r/(a-1)});return o}_generate(){const e=this.min,t=this.max;let i=super.getDataTimestamps();return(!i.includes(e)||!i.length)&&i.splice(0,0,e),(!i.includes(t)||i.length===1)&&i.push(t),i.sort((n,o)=>n-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),i=this.getLabelTimestamps();return t.length&&i.length?e=this.normalize(t.concat(i)):e=t.length?t:i,e=this._cache.all=e,e}getDecimalForValue(e){return(interpolate(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return interpolate(this._table,i*this._tableRange+this._minPos,!0)}}G(TimeSeriesScale,"id","timeseries"),G(TimeSeriesScale,"defaults",TimeScale.defaults);/*!
|
||
* chartjs-chart-sankey v0.12.0
|
||
* https://github.com/kurkle/chartjs-chart-sankey#readme
|
||
* (c) 2022 Jukka Kurkela
|
||
* Released under the MIT license
|
||
*/function toTextLines(s){const e=[],t=isArray(s)?s:isNullOrUndef(s)?[]:[s];for(;t.length;){const i=t.pop();typeof i=="string"?e.unshift.apply(e,i.split(`
|
||
`)):Array.isArray(i)?t.push.apply(t,i):isNullOrUndef(t)||e.unshift(""+i)}return e}function validateSizeValue(s){return!s||["min","max"].indexOf(s)===-1?"max":s}const defined=s=>s!==void 0;function calculateX(s,e){const t=new Set(e.map(r=>r.to)),i=new Set(e.map(r=>r.from)),n=new Set([...s.keys()]);let o=0;for(;n.size;){const r=nextColumn([...n],t);for(const a of r){const l=s.get(a);defined(l.x)||(l.x=o),n.delete(a)}n.size&&(t.clear(),e.filter(a=>n.has(a.from)).forEach(a=>t.add(a.to)),o++)}return[...s.keys()].filter(r=>!i.has(r)).forEach(r=>{const a=s.get(r);a.column||(a.x=o)}),o}function nextColumn(s,e){const t=s.filter(i=>!e.has(i));return t.length?t:s.slice(0,1)}const nodeByXY=(s,e)=>s.x!==e.x?s.x-e.x:s.y-e.y;let prevCountId=-1;function getCountId(){return prevCountId=prevCountId<100?prevCountId+1:0,prevCountId}function nodeCount(s,e,t=getCountId()){let i=0;for(const n of s)n.node._visited!==t&&(n.node._visited=t,i+=n.node[e].length+nodeCount(n.node[e],e,t));return i}const flowByNodeCount=s=>(e,t)=>nodeCount(e.node[s],s)-nodeCount(t.node[s],s)||e.node[s].length-t.node[s].length;function processFrom(s,e){s.from.sort(flowByNodeCount("from"));for(const t of s.from){const i=t.node;defined(i.y)||(i.y=e,processFrom(i,e)),e=Math.max(i.y+i.out,e)}return e}function processTo(s,e){s.to.sort(flowByNodeCount("to"));for(const t of s.to){const i=t.node;defined(i.y)||(i.y=e,processTo(i,e)),e=Math.max(i.y+i.in,e)}return e}function setOrGetY(s,e){return defined(s.y)?s.y:(s.y=e,e)}function processRest(s,e){const t=s.filter(h=>h.x===0),i=s.filter(h=>h.x===e),n=t.filter(h=>!defined(h.y)),o=i.filter(h=>!defined(h.y)),r=s.filter(h=>h.x>0&&h.x<e&&!defined(h.y));let a=t.reduce((h,p)=>Math.max(h,p.y+p.out||0),0),l=i.reduce((h,p)=>Math.max(h,p.y+p.in||0),0),d=0;return a>=l?(n.forEach(h=>{a=setOrGetY(h,a),a=Math.max(a+h.out,processTo(h,a))}),o.forEach(h=>{l=setOrGetY(h,l),l=Math.max(l+h.in,processTo(h,l))})):(o.forEach(h=>{l=setOrGetY(h,l),l=Math.max(l+h.in,processTo(h,l))}),n.forEach(h=>{a=setOrGetY(h,a),a=Math.max(a+h.out,processTo(h,a))})),r.forEach(h=>{let p=s.filter(m=>m.x===h.x&&defined(m.y)).reduce((m,v)=>Math.max(m,v.y+Math.max(v.in,v.out)),0);p=setOrGetY(h,p),p=Math.max(p+h.in,processFrom(h,p)),p=Math.max(p+h.out,processTo(h,p)),d=Math.max(d,p)}),Math.max(a,l,d)}function calculateY(s,e){s.sort((r,a)=>Math.max(a.in,a.out)-Math.max(r.in,r.out));const t=s[0];t.y=0;const i=processFrom(t,0),n=processTo(t,0),o=processRest(s,e);return Math.max(i,n,o)}function calculateYUsingPriority(s,e){let t=0,i=0;for(let n=0;n<=e;n++){let o=i;const r=s.filter(a=>a.x===n).sort((a,l)=>a.priority-l.priority);i=r[0].to.filter(a=>a.node.x>n+1).reduce((a,l)=>a+l.flow,0)||0;for(const a of r)a.y=o,o+=Math.max(a.out,a.in);t=Math.max(o,t)}return t}function addPadding(s,e){let t=1,i=0,n=0,o=0;const r=[];s.sort(nodeByXY);for(const a of s){if(a.y){if(a.x===0)r.push(a.y);else{for(i!==a.x&&(i=a.x,n=0),t=n+1;t<r.length&&!(r[t]>a.y);t++);n=t}a.y+=t*e,t++}o=Math.max(o,a.y+Math.max(a.in,a.out))}return o}function sortFlows(s,e){s.forEach(t=>{const i=Math[e](t.in||t.out,t.out||t.in),n=i<t.in,o=i<t.out;let r=0,a=t.from.length;t.from.sort((l,d)=>l.node.y+l.node.out/2-(d.node.y+d.node.out/2)).forEach((l,d)=>{n?l.addY=d*(i-l.flow)/(a-1):(l.addY=r,r+=l.flow)}),r=0,a=t.to.length,t.to.sort((l,d)=>l.node.y+l.node.in/2-(d.node.y+d.node.in/2)).forEach((l,d)=>{o?l.addY=d*(i-l.flow)/(a-1):(l.addY=r,r+=l.flow)})})}function layout(s,e,t,i){const n=[...s.values()],o=calculateX(s,e),a=(t?calculateYUsingPriority(n,o):calculateY(n,o))*.03,l=addPadding(n,a);return sortFlows(n,i),{maxX:o,maxY:l}}function buildNodesFromRawData(s){const e=new Map;for(let i=0;i<s.length;i++){const{from:n,to:o,flow:r}=s[i];if(!e.has(n))e.set(n,{key:n,in:0,out:r,from:[],to:[{key:o,flow:r,index:i}]});else{const a=e.get(n);a.out+=r,a.to.push({key:o,flow:r,index:i})}if(!e.has(o))e.set(o,{key:o,in:r,out:0,from:[{key:n,flow:r,index:i}],to:[]});else{const a=e.get(o);a.in+=r,a.from.push({key:n,flow:r,index:i})}}const t=(i,n)=>n.flow-i.flow;return[...e.values()].forEach(i=>{i.from=i.from.sort(t),i.from.forEach(n=>{n.node=e.get(n.key)}),i.to=i.to.sort(t),i.to.forEach(n=>{n.node=e.get(n.key)})}),e}function getAddY(s,e,t){for(const i of s)if(i.key===e&&i.index===t)return i.addY;return 0}class SankeyController extends DatasetController{parseObjectData(e,t,i,n){const{from:o="from",to:r="to",flow:a="flow"}=this.options.parsing,l=t.map(({[o]:T,[r]:R,[a]:A})=>({from:T,to:R,flow:A})),{xScale:d,yScale:h}=e,p=[],m=this._nodes=buildNodesFromRawData(l),{column:v,priority:y,size:b}=this.getDataset();if(y)for(const T of m.values())T.key in y&&(T.priority=y[T.key]);if(v)for(const T of m.values())T.key in v&&(T.column=!0,T.x=v[T.key]);const{maxX:S,maxY:E}=layout(m,l,!!y,validateSizeValue(b));this._maxX=S,this._maxY=E;for(let T=0,R=l.length;T<R;++T){const A=l[T],D=m.get(A.from),x=m.get(A.to),M=D.y+getAddY(D.to,A.to,T),I=x.y+getAddY(x.from,A.from,T);p.push({x:d.parse(D.x,T),y:h.parse(M,T),_custom:{from:D,to:x,x:d.parse(x.x,T),y:h.parse(I,T),height:h.parse(A.flow,T)}})}return p.slice(i,i+n)}getMinMax(e){return{min:0,max:e===this._cachedMeta.xScale?this._maxX:this._maxY}}update(e){const{data:t}=this._cachedMeta;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,n){const{xScale:o,yScale:r}=this._cachedMeta,a=this.resolveDataElementOptions(t,n),l=this.getSharedOptions(n,e[t],a),d=this.getDataset(),h=valueOrDefault(d.borderWidth,1)/2+.5,p=valueOrDefault(d.nodeWidth,10);for(let m=t;m<t+i;m++){const v=this.getParsed(m),y=v._custom,b=r.getPixelForValue(v.y);this.updateElement(e[m],m,{x:o.getPixelForValue(v.x)+p+h,y:b,x2:o.getPixelForValue(y.x)-h,y2:r.getPixelForValue(y.y),from:y.from,to:y.to,progress:n==="reset"?0:1,height:Math.abs(r.getPixelForValue(v.y+y.height)-b),options:this.resolveDataElementOptions(m,n)},n)}this.updateSharedOptions(l,n)}_drawLabels(){const e=this._ctx,t=this._nodes||new Map,i=this.getDataset(),n=validateSizeValue(i.size),o=valueOrDefault(i.borderWidth,1),r=valueOrDefault(i.nodeWidth,10),a=i.labels,{xScale:l,yScale:d}=this._cachedMeta;e.save();const h=this.chart.chartArea;for(const p of t.values()){const m=l.getPixelForValue(p.x),v=d.getPixelForValue(p.y),y=Math[n](p.in||p.out,p.out||p.in),b=Math.abs(d.getPixelForValue(p.y+y)-v),S=a&&a[p.key]||p.key;let E=m;e.fillStyle=i.color||"black",e.textBaseline="middle",m<h.width/2?(e.textAlign="left",E+=r+o+4):(e.textAlign="right",E-=o+4),this._drawLabel(S,v,b,e,E)}e.restore()}_drawLabel(e,t,i,n,o){const r=toFont(this.options.font,this.chart.options.font),a=isNullOrUndef(e)?[]:toTextLines(e),l=a.length,d=t+i/2,h=r.lineHeight,p=valueOrDefault(this.options.padding,h/2);if(n.font=r.string,l>1){const m=d-h*l/2+p;for(let v=0;v<l;v++)n.fillText(a[v],o,m+v*h)}else n.fillText(e,o,d)}_drawNodes(){const e=this._ctx,t=this._nodes||new Map,i=this.getDataset(),n=validateSizeValue(i.size),{xScale:o,yScale:r}=this._cachedMeta,a=valueOrDefault(i.borderWidth,1),l=valueOrDefault(i.nodeWidth,10);e.save(),e.strokeStyle=i.borderColor||"black",e.lineWidth=a;for(const d of t.values()){e.fillStyle=d.color;const h=o.getPixelForValue(d.x),p=r.getPixelForValue(d.y),m=Math[n](d.in||d.out,d.out||d.in),v=Math.abs(r.getPixelForValue(d.y+m)-p);a&&e.strokeRect(h,p,l,v),e.fillRect(h,p,l,v)}e.restore()}draw(){const e=this._ctx,t=this.getMeta().data||[],i=[];for(let n=0,o=t.length;n<o;++n){const r=t[n];r.from.color=r.options.colorFrom,r.to.color=r.options.colorTo,r.active&&i.push(r)}for(const n of i)n.from.color=n.options.colorFrom,n.to.color=n.options.colorTo;this._drawNodes();for(let n=0,o=t.length;n<o;++n)t[n].draw(e);this._drawLabels()}}SankeyController.id="sankey";SankeyController.defaults={dataElementType:"flow",animations:{numbers:{type:"number",properties:["x","y","x2","y2","height"]},progress:{easing:"linear",duration:s=>s.type==="data"?(s.parsed._custom.x-s.parsed.x)*200:void 0,delay:s=>s.type==="data"?s.parsed.x*500+s.dataIndex*20:void 0},colors:{type:"color",properties:["colorFrom","colorTo"]}},transitions:{hide:{animations:{colors:{type:"color",properties:["colorFrom","colorTo"],to:"transparent"}}},show:{animations:{colors:{type:"color",properties:["colorFrom","colorTo"],from:"transparent"}}}}};SankeyController.overrides={interaction:{mode:"nearest",intersect:!0},datasets:{clip:!1,parsing:!0},plugins:{tooltip:{callbacks:{title(){return""},label(s){const e=s.dataset.data[s.dataIndex];return e.from+" -> "+e.to+": "+e.flow}}},legend:{display:!1}},scales:{x:{type:"linear",bounds:"data",display:!1,min:0,offset:!1},y:{type:"linear",bounds:"data",display:!1,min:0,reverse:!0,offset:!1}},layout:{padding:{top:3,left:3,right:13,bottom:3}}};const controlPoints=(s,e,t,i)=>s<t?{cp1:{x:s+(t-s)/3*2,y:e},cp2:{x:s+(t-s)/3,y:i}}:{cp1:{x:s-(s-t)/3,y:0},cp2:{x:t+(s-t)/3,y:0}},pointInLine=(s,e,t)=>({x:s.x+t*(e.x-s.x),y:s.y+t*(e.y-s.y)});function setStyle(s,{x:e,x2:t,options:i}){let n;i.colorMode==="from"?n=color(i.colorFrom).alpha(.5).rgbString():i.colorMode==="to"?n=color(i.colorTo).alpha(.5).rgbString():(n=s.createLinearGradient(e,0,t,0),n.addColorStop(0,color(i.colorFrom).alpha(.5).rgbString()),n.addColorStop(1,color(i.colorTo).alpha(.5).rgbString())),s.fillStyle=n,s.strokeStyle=n,s.lineWidth=.5}class Flow extends Element$1{constructor(e){super(),this.options=void 0,this.x=void 0,this.y=void 0,this.x2=void 0,this.y2=void 0,this.height=void 0,e&&Object.assign(this,e)}draw(e){const t=this,{x:i,x2:n,y:o,y2:r,height:a,progress:l}=t,{cp1:d,cp2:h}=controlPoints(i,o,n,r);l!==0&&(e.save(),l<1&&(e.beginPath(),e.rect(i,Math.min(o,r),(n-i)*l+1,Math.abs(r-o)+a+1),e.clip()),setStyle(e,t),e.beginPath(),e.moveTo(i,o),e.bezierCurveTo(d.x,d.y,h.x,h.y,n,r),e.lineTo(n,r+a),e.bezierCurveTo(h.x,h.y+a,d.x,d.y+a,i,o+a),e.lineTo(i,o),e.stroke(),e.closePath(),e.fill(),e.restore())}inRange(e,t,i){const{x:n,y:o,x2:r,y2:a,height:l}=this.getProps(["x","y","x2","y2","height"],i);if(e<n||e>r)return!1;const{cp1:d,cp2:h}=controlPoints(n,o,r,a),p=(e-n)/(r-n),m={x:n,y:o},v={x:r,y:a},y=pointInLine(m,d,p),b=pointInLine(d,h,p),S=pointInLine(h,v,p),E=pointInLine(y,b,p),T=pointInLine(b,S,p),R=pointInLine(E,T,p).y;return t>=R&&t<=R+l}inXRange(e,t){const{x:i,x2:n}=this.getProps(["x","x2"],t);return e>=i&&e<=n}inYRange(e,t){const{y:i,y2:n,height:o}=this.getProps(["y","y2","height"],t),r=Math.min(i,n),a=Math.max(i,n)+o;return e>=r&&e<=a}getCenterPoint(e){const{x:t,y:i,x2:n,y2:o,height:r}=this.getProps(["x","y","x2","y2","height"],e);return{x:(t+n)/2,y:(i+o+r)/2}}tooltipPosition(e){return this.getCenterPoint(e)}getRange(e){return e==="x"?this.width/2:this.height/2}}Flow.id="flow";Flow.defaults={colorFrom:"red",colorTo:"green",colorMode:"gradient",hoverColorFrom:(s,e)=>getHoverColor(e.colorFrom),hoverColorTo:(s,e)=>getHoverColor(e.colorTo)};/*!
|
||
* chartjs-adapter-date-fns v3.0.0
|
||
* https://www.chartjs.org
|
||
* (c) 2022 chartjs-adapter-date-fns Contributors
|
||
* Released under the MIT license
|
||
*/const FORMATS={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};adapters._date.override({_id:"date-fns",formats:function(){return FORMATS},parse:function(s,e){if(s===null||typeof s>"u")return null;const t=typeof s;return t==="number"||s instanceof Date?s=toDate(s):t==="string"&&(typeof e=="string"?s=parse$1(s,e,new Date,this.options):s=parseISO(s,this.options)),isValid(s)?s.getTime():null},format:function(s,e){return format(s,e,this.options)},add:function(s,e,t){switch(t){case"millisecond":return addMilliseconds(s,e);case"second":return addSeconds(s,e);case"minute":return addMinutes(s,e);case"hour":return addHours(s,e);case"day":return addDays(s,e);case"week":return addWeeks(s,e);case"month":return addMonths(s,e);case"quarter":return addQuarters(s,e);case"year":return addYears(s,e);default:return s}},diff:function(s,e,t){switch(t){case"millisecond":return differenceInMilliseconds(s,e);case"second":return differenceInSeconds(s,e);case"minute":return differenceInMinutes(s,e);case"hour":return differenceInHours(s,e);case"day":return differenceInDays(s,e);case"week":return differenceInWeeks(s,e);case"month":return differenceInMonths(s,e);case"quarter":return differenceInQuarters(s,e);case"year":return differenceInYears(s,e);default:return 0}},startOf:function(s,e,t){switch(e){case"second":return startOfSecond(s);case"minute":return startOfMinute(s);case"hour":return startOfHour(s);case"day":return startOfDay(s);case"week":return startOfWeek(s);case"isoWeek":return startOfWeek(s,{weekStartsOn:+t});case"month":return startOfMonth(s);case"quarter":return startOfQuarter(s);case"year":return startOfYear(s);default:return s}},endOf:function(s,e){switch(e){case"second":return endOfSecond(s);case"minute":return endOfMinute(s);case"hour":return endOfHour(s);case"day":return endOfDay(s);case"week":return endOfWeek(s);case"month":return endOfMonth(s);case"quarter":return endOfQuarter(s);case"year":return endOfYear(s);default:return s}}});const leaflet="",DEFAULTS$1={showAllSuggestions:!1,suggestionsThreshold:1,maximumItems:0,autoselectFirst:!0,ignoreEnter:!1,updateOnSelect:!1,highlightTyped:!1,highlightClass:"",fullWidth:!1,fixed:!1,fuzzy:!1,startsWith:!1,fillIn:!1,preventBrowserAutocomplete:!1,itemClass:"",activeClasses:["bg-primary","text-white"],labelField:"label",valueField:"value",searchFields:["label"],queryParam:"query",items:[],source:null,hiddenInput:!1,hiddenValue:"",clearControl:"",datalist:"",server:"",serverMethod:"GET",serverParams:{},serverDataKey:"data",fetchOptions:{},liveServer:!1,noCache:!0,debounceTime:300,notFoundMessage:"",onRenderItem:(s,e,t)=>e,onSelectItem:(s,e)=>{},onServerResponse:(s,e)=>s.json(),onChange:(s,e)=>{},onBeforeFetch:s=>{},onAfterFetch:s=>{}},LOADING_CLASS$1="is-loading",ACTIVE_CLASS$1="is-active",SHOW_CLASS$1="show",NEXT$1="next",PREV$1="prev",INSTANCE_MAP$1=new WeakMap;let counter$1=0,activeCounter=0;function debounce$2(s,e=300){let t;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{s.apply(this,i)},e)}}function removeDiacritics$1(s){return s.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function normalize$1(s){return s?removeDiacritics$1(s.toString()).toLowerCase():""}function fuzzyMatch$1(s,e){if(s.indexOf(e)>=0)return!0;let t=0;for(let i=0;i<e.length;i++){const n=e[i];if(n!=" "&&(t=s.indexOf(n,t)+1,t<=0))return!1}return!0}function insertAfter(s,e){return s.parentNode.insertBefore(e,s.nextSibling)}function decodeHtml(s){var e=document.createElement("textarea");return e.innerHTML=s,e.value}function attrs$1(s,e){for(const[t,i]of Object.entries(e))s.setAttribute(t,i)}function zwijit(s){s.ariaLabel=s.innerText,s.innerHTML=s.innerText.split("").map(e=>e+"‍").join("")}function nested$1(s,e="window"){return s.split(".").reduce((t,i)=>t[i],e)}class Autocomplete{constructor(e,t={}){G(this,"handleEvent",e=>{["scroll","resize"].includes(e.type)?(this._timer&&window.cancelAnimationFrame(this._timer),this._timer=window.requestAnimationFrame(()=>{this[`on${e.type}`](e)})):this[`on${e.type}`](e)});if(!(e instanceof HTMLElement)){console.error("Invalid element",e);return}INSTANCE_MAP$1.set(e,this),counter$1++,activeCounter++,this._searchInput=e,this._configure(t),this._preventInput=!1,this._keyboardNavigation=!1,this._searchFunc=debounce$2(()=>{this._loadFromServer(!0)},this._config.debounceTime),this._configureSearchInput(),this._configureDropElement(),this._config.fixed&&(document.addEventListener("scroll",this,!0),window.addEventListener("resize",this));const i=this._getClearControl();i&&i.addEventListener("click",this),["focus","change","blur","input","keydown"].forEach(n=>{this._searchInput.addEventListener(n,this)}),["mousemove","mouseleave"].forEach(n=>{this._dropElement.addEventListener(n,this)}),this._fetchData()}static init(e="input.autocomplete",t={}){document.querySelectorAll(e).forEach(n=>{this.getOrCreateInstance(n,t)})}static getInstance(e){return INSTANCE_MAP$1.has(e)?INSTANCE_MAP$1.get(e):null}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,t)}dispose(){activeCounter--,["focus","change","blur","input","keydown"].forEach(t=>{this._searchInput.removeEventListener(t,this)}),["mousemove","mouseleave"].forEach(t=>{this._dropElement.removeEventListener(t,this)});const e=this._getClearControl();e&&e.removeEventListener("click",this),this._config.fixed&&activeCounter<=0&&(document.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)),this._dropElement.parentElement.removeChild(this._dropElement),INSTANCE_MAP$1.delete(this._searchInput)}_getClearControl(){if(this._config.clearControl)return document.querySelector(this._config.clearControl)}_configure(e={}){this._config=Object.assign({},DEFAULTS$1);const t={...e,...this._searchInput.dataset},i=n=>["true","false","1","0",!0,!1].includes(n)&&!!JSON.parse(n);for(const[n,o]of Object.entries(DEFAULTS$1)){if(t[n]===void 0)continue;const r=t[n];switch(typeof o){case"number":this._config[n]=parseInt(r);break;case"boolean":this._config[n]=i(r);break;case"string":this._config[n]=r.toString();break;case"object":if(Array.isArray(o))if(typeof r=="string"){const a=r.includes("|")?"|":",";this._config[n]=r.split(a)}else this._config[n]=r;else this._config[n]=typeof r=="string"?JSON.parse(r):r;break;case"function":this._config[n]=typeof r=="string"?window[r]:r;break;default:this._config[n]=r;break}}}_configureSearchInput(){if(this._searchInput.autocomplete="off",this._searchInput.spellcheck=!1,attrs$1(this._searchInput,{"aria-autocomplete":"list","aria-haspopup":"menu","aria-expanded":"false",role:"combobox"}),this._searchInput.id&&this._config.preventBrowserAutocomplete){const e=document.querySelector(`[for="${this._searchInput.id}"]`);e&&zwijit(e)}this._hiddenInput=null,this._config.hiddenInput&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.value=this._config.hiddenValue,this._hiddenInput.name=this._searchInput.name,this._searchInput.name="_"+this._searchInput.name,insertAfter(this._searchInput,this._hiddenInput))}_configureDropElement(){this._dropElement=document.createElement("ul"),this._dropElement.id="ac-menu-"+counter$1,this._dropElement.classList.add("dropdown-menu","autocomplete-menu","p-0"),this._dropElement.style.maxHeight="280px",this._config.fullWidth||(this._dropElement.style.maxWidth="360px"),this._config.fixed&&(this._dropElement.style.position="fixed"),this._dropElement.style.overflowY="auto",this._dropElement.style.overscrollBehavior="contain",this._dropElement.style.textAlign="unset",insertAfter(this._searchInput,this._dropElement),this._searchInput.setAttribute("aria-controls",this._dropElement.id)}onclick(e){e.target.matches(this._config.clearControl)&&this.clear()}oninput(e){this._preventInput||(this._hiddenInput&&(this._hiddenInput.value=null),this.showOrSearch())}onchange(e){const t=this._searchInput.value,i=Object.values(this._items).find(n=>n.label===t);this._config.onChange(i,this)}onblur(e){if(e.relatedTarget&&e.relatedTarget.classList.contains("modal")){this._searchInput.focus();return}setTimeout(()=>{this.hideSuggestions()},100)}onfocus(e){this.showOrSearch()}onkeydown(e){switch(e.keyCode||e.key){case 13:case"Enter":if(this.isDropdownVisible()){const i=this.getSelection();i&&i.click(),(i||!this._config.ignoreEnter)&&e.preventDefault()}break;case 38:case"ArrowUp":e.preventDefault(),this._keyboardNavigation=!0,this._moveSelection(PREV$1);break;case 40:case"ArrowDown":e.preventDefault(),this._keyboardNavigation=!0,this.isDropdownVisible()?this._moveSelection(NEXT$1):this.showOrSearch(!1);break;case 27:case"Escape":this.isDropdownVisible()&&(this._searchInput.focus(),this.hideSuggestions());break}}onmousemove(e){this._keyboardNavigation=!1}onmouseleave(e){this.removeSelection()}onscroll(e){this._positionMenu()}onresize(e){this._positionMenu()}getConfig(e=null){return e!==null?this._config[e]:this._config}setConfig(e,t){this._config[e]=t}setData(e){this._items={},this._addItems(e)}enable(){this._searchInput.setAttribute("disabled","")}disable(){this._searchInput.removeAttribute("disabled")}isDisabled(){return this._searchInput.hasAttribute("disabled")||this._searchInput.disabled||this._searchInput.hasAttribute("readonly")}isDropdownVisible(){return this._dropElement.classList.contains(SHOW_CLASS$1)}clear(){this._searchInput.value="",this._hiddenInput&&(this._hiddenInput.value="")}getSelection(){return this._dropElement.querySelector("a."+ACTIVE_CLASS$1)}removeSelection(){const e=this.getSelection();e&&e.classList.remove(...this._activeClasses())}_activeClasses(){return[...this._config.activeClasses,ACTIVE_CLASS$1]}_isItemEnabled(e){if(e.style.display==="none")return!1;const t=e.firstElementChild;return t.tagName==="A"&&!t.classList.contains("disabled")}_moveSelection(e=NEXT$1,t=null){const i=this.getSelection();if(i){const n=e===NEXT$1?"nextSibling":"previousSibling";t=i.parentNode;do t=t[n];while(t&&!this._isItemEnabled(t));t?(i.classList.remove(...this._activeClasses()),e===PREV$1?t.parentNode.scrollTop=t.offsetTop-t.parentNode.offsetTop:t.offsetTop>t.parentNode.offsetHeight-t.offsetHeight&&(t.parentNode.scrollTop+=t.offsetHeight)):i&&(t=i.parentElement)}else{if(e===PREV$1)return t;if(!t)for(t=this._dropElement.firstChild;t&&!this._isItemEnabled(t);)t=t.nextSibling}if(t){const n=t.querySelector("a");n.classList.add(...this._activeClasses()),this._searchInput.setAttribute("aria-activedescendant",n.id),this._config.updateOnSelect&&(this._searchInput.value=n.dataset.label)}else this._searchInput.setAttribute("aria-activedescendant","");return t}_shouldShow(){return this.isDisabled()?!1:this._searchInput.value.length>=this._config.suggestionsThreshold}showOrSearch(e=!0){if(e&&!this._shouldShow()){this.hideSuggestions();return}this._config.liveServer?this._searchFunc():this._config.source?this._config.source(this._searchInput.value,t=>{this.setData(t),this._showSuggestions()}):this._showSuggestions()}_createGroup(e){const t=this._createLi(),i=document.createElement("span");return t.append(i),i.classList.add("dropdown-header","text-truncate"),i.innerHTML=e,t}_createItem(e,t){let i=t.label;if(this._config.highlightTyped){const r=normalize$1(i).indexOf(e);r!==-1&&(i=i.substring(0,r)+`<mark class="${this._config.highlightClass}">${i.substring(r,r+e.length)}</mark>`+i.substring(r+e.length,i.length))}i=this._config.onRenderItem(t,i,this);const n=this._createLi(),o=document.createElement("a");if(n.append(o),o.id=this._dropElement.id+"-"+this._dropElement.children.length,o.classList.add("dropdown-item","text-truncate"),this._config.itemClass&&o.classList.add(...this._config.itemClass.split(" ")),o.setAttribute("data-value",t.value),o.setAttribute("data-label",t.label),o.setAttribute("tabindex","-1"),o.setAttribute("role","menuitem"),o.setAttribute("href","#"),o.innerHTML=i,t.data)for(const[r,a]of Object.entries(t.data))o.dataset[r]=a;if(this._config.fillIn){const r=document.createElement("button");r.type="button",r.classList.add("btn","btn-link","border-0"),r.innerHTML=`<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
|
||
<path fill-rule="evenodd" d="M2 2.5a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 0 1H3.707l10.147 10.146a.5.5 0 0 1-.708.708L3 3.707V8.5a.5.5 0 0 1-1 0z"/>
|
||
</svg>`,n.append(r),n.classList.add("d-flex","justify-content-between"),r.addEventListener("click",a=>{this._searchInput.value=t.label,this._searchInput.focus()})}return o.addEventListener("mouseenter",r=>{this._keyboardNavigation||(this.removeSelection(),n.querySelector("a").classList.add(...this._activeClasses()))}),o.addEventListener("mousedown",r=>{r.preventDefault()}),o.addEventListener("click",r=>{r.preventDefault(),this._preventInput=!0,this._searchInput.value=decodeHtml(t.label),this._hiddenInput&&(this._hiddenInput.value=t.value),this._config.onSelectItem(t,this),this.hideSuggestions(),this._preventInput=!1}),n}_showSuggestions(){if(document.activeElement!=this._searchInput)return;const e=normalize$1(this._searchInput.value);this._dropElement.innerHTML="";const t=Object.keys(this._items);let i=0,n=null;const o=[];for(let r=0;r<t.length;r++){const a=t[r],l=this._items[a],d=this._config.showAllSuggestions||e.length===0;let h=e.length==0&&this._config.suggestionsThreshold===0;!d&&e.length>0&&this._config.searchFields.forEach(m=>{const v=normalize$1(l[m]);let y=!1;if(this._config.fuzzy)y=fuzzyMatch$1(v,e);else{const b=v.indexOf(e);y=this._config.startsWith?b===0:b>=0}y&&(h=!0)});const p=h||e.length===0;if(d||h){if(i++,l.group&&!o.includes(l.group)){const v=this._createGroup(l.group);this._dropElement.appendChild(v),o.push(l.group)}const m=this._createItem(e,l);if(!n&&p&&(n=m),this._dropElement.appendChild(m),this._config.maximumItems>0&&i>=this._config.maximumItems)break}}if(n&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(NEXT$1,n)),i===0)if(this._config.notFoundMessage){const r=this._createLi();r.innerHTML=`<span class="dropdown-item">${this._config.notFoundMessage}</span>`,this._dropElement.appendChild(r),this._showDropdown()}else this.hideSuggestions();else this._showDropdown()}_createLi(){const e=document.createElement("li");return e.setAttribute("role","presentation"),e}_showDropdown(){this._dropElement.classList.add(SHOW_CLASS$1),this._dropElement.setAttribute("role","menu"),attrs$1(this._searchInput,{"aria-expanded":"true"}),this._positionMenu()}toggleSuggestions(e=!0){this._dropElement.classList.contains(SHOW_CLASS$1)?this.hideSuggestions():this.showOrSearch(e)}hideSuggestions(){this._dropElement.classList.remove(SHOW_CLASS$1),attrs$1(this._searchInput,{"aria-expanded":"false"}),this.removeSelection()}getInput(){return this._searchInput}getDropMenu(){return this._dropElement}_positionMenu(){const e=window.getComputedStyle(this._searchInput),t=this._searchInput.getBoundingClientRect(),i=e.direction==="rtl",n=this._config.fullWidth,o=this._config.fixed;let r=null,a=null;o&&(r=t.x,a=t.y+t.height,i&&!n&&(r-=this._dropElement.offsetWidth-t.width)),this._dropElement.style.transform="unset",n&&(this._dropElement.style.width=this._searchInput.offsetWidth+"px"),r!==null&&(this._dropElement.style.left=r+"px"),a!==null&&(this._dropElement.style.top=a+"px");const l=this._dropElement.getBoundingClientRect(),d=window.innerHeight;if(l.y+l.height>d){const h=n?t.height+4:t.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+h+"px))"}}_fetchData(){this._items={},this._addItems(this._config.items);const e=this._config.datalist;if(e){const t=document.querySelector(`#${e}`);if(t){const i=Array.from(t.children).map(n=>{const o=n.getAttribute("value")??n.innerHTML.toLowerCase(),r=n.innerHTML;return{value:o,label:r}});this._addItems(i)}else console.error(`Datalist not found ${e}`)}this._setHiddenVal(),this._config.server&&!this._config.liveServer&&this._loadFromServer()}_setHiddenVal(){if(this._config.hiddenInput&&!this._config.hiddenValue)for(const[e,t]of Object.entries(this._items))t.label==this._searchInput.value&&(this._hiddenInput.value=e)}_addItems(e){const t=Object.keys(e);for(let i=0;i<t.length;i++){const n=t[i],o=e[n];if(o.group&&o.items){o.items.forEach(l=>l.group=o.group),this._addItems(o.items);continue}const r=typeof o=="string"?o:o.label,a=typeof o!="object"?{}:o;a.label=o[this._config.labelField]??r,a.value=o[this._config.valueField]??n,a.label&&(this._items[a.value]=a)}}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._searchInput.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const i=Object.assign({},this._config.serverParams,t);if(i[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(i.t=Date.now()),i.related){const a=document.getElementById(i.related);if(a){i.related=a.value;const l=a.getAttribute("name");l&&(i[l]=a.value)}}const n=new URLSearchParams(i);let o=this._config.server,r=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});r.method==="POST"?r.body=n:o+="?"+n.toString(),this._searchInput.classList.add(LOADING_CLASS$1),this._config.onBeforeFetch(this),fetch(o,r).then(a=>this._config.onServerResponse(a,this)).then(a=>{const l=nested$1(this._config.serverDataKey,a)||a;this.setData(l),this._setHiddenVal(),this._abortController=null,e&&this._showSuggestions()}).catch(a=>{a.name==="AbortError"||this._abortController.signal.aborted||console.error(a)}).finally(a=>{this._searchInput.classList.remove(LOADING_CLASS$1),this._config.onAfterFetch(this)})}}const DEFAULTS={items:[],allowNew:!1,showAllSuggestions:!1,badgeStyle:"primary",allowClear:!1,clearEnd:!1,selected:[],regex:"",separator:[],max:0,clearLabel:"Clear",searchLabel:"Type a value",showDropIcon:!0,keepOpen:!1,allowSame:!1,baseClass:"",placeholder:"",addOnBlur:!1,showDisabled:!1,hideNativeValidation:!1,suggestionsThreshold:-1,maximumItems:0,autoselectFirst:!0,updateOnSelect:!1,highlightTyped:!1,highlightClass:"",fullWidth:!0,fixed:!1,fuzzy:!1,startsWith:!1,singleBadge:!1,activeClasses:["bg-primary","text-white"],labelField:"label",valueField:"value",searchFields:["label"],queryParam:"query",server:"",serverMethod:"GET",serverParams:{},serverDataKey:"data",fetchOptions:{},liveServer:!1,noCache:!0,allowHtml:!1,debounceTime:300,notFoundMessage:"",inputFilter:s=>s,sanitizer:s=>sanitize(s),onRenderItem:(s,e,t)=>t.config("allowHtml")?e:t.config("sanitizer")(e),onSelectItem:(s,e)=>{},onClearItem:(s,e)=>{},onCreateItem:(s,e)=>{},onBlur:(s,e)=>{},onFocus:(s,e)=>{},onCanAdd:(s,e,t)=>{},confirmClear:(s,e)=>Promise.resolve(),confirmAdd:(s,e)=>Promise.resolve(),onServerResponse:(s,e)=>s.json()},CLASS_PREFIX="tags-",LOADING_CLASS="is-loading",ACTIVE_CLASS="is-active",INVALID_CLASS="is-invalid",MAX_REACHED_CLASS="is-max-reached",SHOW_CLASS="show",VALUE_ATTRIBUTE="data-value",NEXT="next",PREV="prev",FOCUS_CLASS="form-control-focus",PLACEHOLDER_CLASS="form-placeholder-shown",DISABLED_CLASS="form-control-disabled",INSTANCE_MAP=new WeakMap;let counter=0,tooltip=window.bootstrap&&window.bootstrap.Tooltip;function debounce$1(s,e=300){let t;return(...i)=>{clearTimeout(t),t=setTimeout(()=>{s.apply(this,i)},e)}}function calcTextWidth(s,e=null){const t=ce("span");document.body.appendChild(t),t.style.fontSize=e||"inherit",t.style.height="auto",t.style.width="auto",t.style.position="absolute",t.style.whiteSpace="no-wrap",t.innerHTML=sanitize(s);const i=Math.ceil(t.clientWidth);return document.body.removeChild(t),i}function sanitize(s){return s.replace(/[\x26\x0A\<>'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})}function removeDiacritics(s){return s.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function normalize(s){return s?removeDiacritics(s.toString()).toLowerCase():""}function fuzzyMatch(s,e){if(s.indexOf(e)>=0)return!0;let t=0;for(let i=0;i<e.length;i++){const n=e[i];if(n!=" "&&(t=s.indexOf(n,t)+1,t<=0))return!1}return!0}function hideItem(s){s.style.display="none",attrs(s,{"aria-hidden":"true"})}function showItem(s){s.style.display="list-item",attrs(s,{"aria-hidden":"false"})}function attrs(s,e){for(const[t,i]of Object.entries(e))s.setAttribute(t,i)}function rmAttr(s,e){s.hasAttribute(e)&&s.removeAttribute(e)}function parseBool(s){return["true","false","1","0",!0,!1].includes(s)&&!!JSON.parse(s)}function ce(s){return document.createElement(s)}function splitMulti(s,e){let t=e[0];for(let i=1;i<e.length;i++)s=s.split(e[i]).join(t);return s.split(t)}function nested(s,e="window"){return s.split(".").reduce((t,i)=>t[i],e)}class Tags{constructor(e,t={}){if(!(e instanceof HTMLElement)){console.error("Invalid element",e);return}INSTANCE_MAP.set(e,this),counter++,this._selectElement=e,this._configure(t),this._keyboardNavigation=!1,this._searchFunc=debounce$1(()=>{this._loadFromServer(!0)},this._config.debounceTime),this._fireEvents=!0,this._configureParent(),this._holderElement=ce("div"),this._containerElement=ce("div"),this._dropElement=ce("ul"),this._searchInput=ce("input"),this._holderElement.appendChild(this._containerElement),this._selectElement.parentElement.insertBefore(this._holderElement,this._selectElement),this._configureHolderElement(),this._configureContainerElement(),this._configureSelectElement(),this._configureSearchInput(),this._configureDropElement(),this.resetState(),this.handleEvent=i=>{this._handleEvent(i)},this._config.fixed&&(document.addEventListener("scroll",this,!0),window.addEventListener("resize",this)),["focus","blur","input","keydown","paste"].forEach(i=>{this._searchInput.addEventListener(i,this)}),["mousemove","mouseleave"].forEach(i=>{this._dropElement.addEventListener(i,this)}),this.loadData(!0)}static init(e="select[multiple]",t={},i=!1){let n=document.querySelectorAll(e);for(let o=0;o<n.length;o++){const r=Tags.getInstance(n[o]);r&&!i||(r&&r.dispose(),new Tags(n[o],t))}}static getInstance(e){if(INSTANCE_MAP.has(e))return INSTANCE_MAP.get(e)}dispose(){["focus","blur","input","keydown","paste"].forEach(e=>{this._searchInput.removeEventListener(e,this)}),["mousemove","mouseleave"].forEach(e=>{this._dropElement.removeEventListener(e,this)}),this._config.fixed&&(document.removeEventListener("scroll",this,!0),window.removeEventListener("resize",this)),this._selectElement.style.display="block",this._holderElement.parentElement.removeChild(this._holderElement),this.parentForm&&this.parentForm.removeEventListener("reset",this),INSTANCE_MAP.delete(this._selectElement)}handleEvent(e){this._handleEvent(e)}_handleEvent(e){["scroll","resize"].includes(e.type)?(this._timer&&window.cancelAnimationFrame(this._timer),this._timer=window.requestAnimationFrame(()=>{this[`on${e.type}`](e)})):this[`on${e.type}`](e)}_configure(e={}){this._config=Object.assign({},DEFAULTS,{showDropIcon:!!this._findOption()});const t=this._selectElement.dataset.config?JSON.parse(this._selectElement.dataset.config):{},i={...e,...t,...this._selectElement.dataset};for(const[n,o]of Object.entries(DEFAULTS)){if(n=="config"||i[n]===void 0)continue;const r=i[n];switch(typeof o){case"number":this._config[n]=parseInt(r);break;case"boolean":this._config[n]=parseBool(r);break;case"string":this._config[n]=r.toString();break;case"object":this._config[n]=r,typeof r=="string"&&(["{","["].includes(r[0])?this._config[n]=JSON.parse(r):this._config[n]=r.split(r.includes("|")?"|":","));break;case"function":this._config[n]=typeof r=="string"?r.split(".").reduce((a,l)=>a[l],window):r,this._config[n]||console.error("Invalid function",r);break;default:this._config[n]=r;break}}this._config.placeholder||(this._config.placeholder=this._getPlaceholder()),this._config.suggestionsThreshold==-1&&(this._config.suggestionsThreshold=this._config.liveServer?1:0)}config(e=null){return e?this._config[e]:this._config}setConfig(e,t){this._config[e]=t}_configureParent(){for(this.overflowParent=null,this.parentForm=this._selectElement.parentElement;this.parentForm&&(this.parentForm.style.overflow==="hidden"&&(this.overflowParent=this.parentForm),this.parentForm=this.parentForm.parentElement,!(this.parentForm&&this.parentForm.nodeName=="FORM")););this.parentForm&&this.parentForm.addEventListener("reset",this)}_getPlaceholder(){if(this._selectElement.hasAttribute("placeholder"))return this._selectElement.getAttribute("placeholder");if(this._selectElement.dataset.placeholder)return this._selectElement.dataset.placeholder;let e=this._selectElement.querySelector("option");return!e||!this._config.autoselectFirst?"":(rmAttr(e,"selected"),e.selected=!1,e.value?"":e.textContent)}_configureSelectElement(){const e=this._selectElement;this._config.hideNativeValidation?(e.style.position="absolute",e.style.left="-9999px"):e.style.cssText="height:1px;width:1px;opacity:0;padding:0;margin:0;border:0;float:left;flex-basis:100%;min-height:unset;",e.tabIndex=-1,e.addEventListener("focus",t=>{this.onclick(t)}),e.addEventListener("invalid",t=>{this._holderElement.classList.add(INVALID_CLASS)})}_configureDropElement(){const e=this._dropElement;e.classList.add("dropdown-menu",CLASS_PREFIX+"menu"),e.id=CLASS_PREFIX+"menu-"+counter,e.setAttribute("role","menu");const t=e.style;t.padding="0",t.maxHeight="280px",this._config.fullWidth||(t.maxWidth="360px"),this._config.fixed&&(t.position="fixed"),t.overflowY="auto",t.overscrollBehavior="contain",t.textAlign="unset",e.addEventListener("mouseenter",i=>{this._keyboardNavigation=!1}),this._holderElement.appendChild(e),this._searchInput.setAttribute("aria-controls",e.id)}_configureHolderElement(){const e=this._holderElement;e.classList.add("form-control","dropdown"),["form-select-lg","form-select-sm","is-invalid","is-valid"].forEach(t=>{this._selectElement.classList.contains(t)&&e.classList.add(t)}),this._config.suggestionsThreshold==0&&this._config.showDropIcon&&e.classList.add("form-select"),this.overflowParent&&(e.style.position="inherit"),e.style.height="auto",e.addEventListener("click",this)}_configureContainerElement(){this._containerElement.addEventListener("click",t=>{this.isDisabled()||this._searchInput.style.visibility!="hidden"&&this._searchInput.focus()});const e=this._containerElement.style;e.display="flex",e.alignItems="center",e.flexWrap="wrap"}_configureSearchInput(){const e=this._searchInput;e.type="text",e.autocomplete="off",e.spellcheck=!1,attrs(e,{"aria-autocomplete":"list","aria-haspopup":"menu","aria-expanded":"false","aria-label":this._config.searchLabel,role:"combobox"}),e.style.cssText="background-color:transparent;color:currentColor;border:0;padding:0;outline:0;max-width:100%",this.resetSearchInput(!0),this._containerElement.appendChild(e),this._rtl=window.getComputedStyle(e).direction==="rtl"}onfocus(e){this._holderElement.classList.add(FOCUS_CLASS),this.showOrSearch(),this._config.onFocus(e,this)}onblur(e){if(e.relatedTarget&&e.relatedTarget.classList.contains("modal")){this._searchInput.focus();return}this.afteronblur(e)}afteronblur(e){this._abortController&&this._abortController.abort();let t=!0;if(this._config.addOnBlur&&this._searchInput.value&&(t=this._enterValue()),this._holderElement.classList.remove(FOCUS_CLASS),this.hideSuggestions(t),this._fireEvents){const i=this.getSelection(),n={selection:i?i.dataset.value:null,input:this._searchInput.value};this._config.onBlur(e,this),this._selectElement.dispatchEvent(new CustomEvent("tags.blur",{bubbles:!0,detail:n}))}}onpaste(e){const i=(e.clipboardData||window.clipboardData).getData("text/plain").replace(/\r\n|\n/g," ");if(i.length>2&&this._config.separator.length){const n=splitMulti(i,this._config.separator).filter(o=>o);n.length>1&&(e.preventDefault(),n.forEach(o=>{this._addPastedValue(o)}))}}_addPastedValue(e){let t=e,i={};if(this._config.allowNew)i.new=1;else{const n=this.getSelection();if(!n)return;e=n.getAttribute(VALUE_ATTRIBUTE),t=n.dataset.label}this._config.confirmAdd(e,this).then(()=>{this._add(t,e,i)}).catch(()=>{})}oninput(e){const t=this._config.inputFilter(this._searchInput.value);if(t!=this._searchInput.value&&(this._searchInput.value=t),t){const i=t.slice(-1);if(this._config.separator.length&&this._config.separator.includes(i)){this._searchInput.value=this._searchInput.value.slice(0,-1);let n=this._searchInput.value;this._addPastedValue(n);return}}setTimeout(()=>{this._adjustWidth()}),this.showOrSearch()}onkeydown(e){let t=e.keyCode||e.key;const i=e.target;switch(e.keyCode==229&&(t=i.value.charAt(i.selectionStart-1).charCodeAt(0)),t){case 13:case"Enter":e.preventDefault(),this._enterValue();break;case 38:case"ArrowUp":e.preventDefault(),this._keyboardNavigation=!0,this._moveSelection(PREV);break;case 40:case"ArrowDown":e.preventDefault(),this._keyboardNavigation=!0,this.isDropdownVisible()?this._moveSelection(NEXT):this.showOrSearch(!1);break;case 8:case"Backspace":const n=this.getLastItem();this._searchInput.value.length==0&&n&&this._config.confirmClear(n,this).then(()=>{this.removeLastItem(),this._adjustWidth(),this.showOrSearch()}).catch(()=>{});break;case 27:case"Escape":this._searchInput.focus(),this.hideSuggestions();break}}onmousemove(e){this._keyboardNavigation=!1}onmouseleave(e){this.removeSelection()}onscroll(e){this._positionMenu()}onresize(e){this._positionMenu()}onclick(e=null){!this.isSingle()&&this.isMaxReached()||this._searchInput.focus()}onreset(e){this.reset()}loadData(e=!1){Object.keys(this._config.items).length>0?this.setData(this._config.items,!0):this.resetSuggestions(!0),this._config.server&&(this._config.liveServer||this._loadFromServer(!e))}_setSelectedAttributes(){const e=this._selectElement.selectedOptions||[];for(let t=0;t<e.length;t++)e[t].value&&!e[t].hasAttribute("selected")&&e[t].setAttribute("selected","selected")}resetState(){this.isDisabled()?(this._holderElement.setAttribute("readonly",""),this._searchInput.setAttribute("disabled",""),this._holderElement.classList.add(DISABLED_CLASS)):(rmAttr(this._holderElement,"readonly"),rmAttr(this._searchInput,"disabled"),this._holderElement.classList.remove(DISABLED_CLASS))}resetSuggestions(e=!1){this._setSelectedAttributes();const t=n=>({value:n.getAttribute("value"),label:n.textContent,disabled:n.disabled,selected:n.selected,data:Object.assign({disabled:n.disabled},n.dataset)});let i=Array.from(this._selectElement.children).filter(n=>n.hasAttribute("label")||!n.disabled||this._config.showDisabled).map(n=>n.hasAttribute("label")?{group:n.getAttribute("label"),items:Array.from(n.children).map(o=>t(o))}:t(n));this.setData(i,e)}_enterValue(){let e=this.getSelection();if(e)return e.click(),!0;if(this._config.allowNew&&this._searchInput.value){let t=this._searchInput.value;return this._config.confirmAdd(t,this).then(()=>{this._add(t,t,{new:1})}).catch(()=>{}),!0}return!1}_loadFromServer(e=!1){this._abortController&&this._abortController.abort(),this._abortController=new AbortController;let t=this._selectElement.dataset.serverParams||{};typeof t=="string"&&(t=JSON.parse(t));const i=Object.assign({},this._config.serverParams,t);if(i[this._config.queryParam]=this._searchInput.value,this._config.noCache&&(i.t=Date.now()),i.related){const a=document.getElementById(i.related);if(a){i.related=a.value;const l=a.getAttribute("name");l&&(i[l]=a.value)}}const n=new URLSearchParams(i);let o=this._config.server,r=Object.assign(this._config.fetchOptions,{method:this._config.serverMethod||"GET",signal:this._abortController.signal});r.method==="POST"?r.body=n:o+="?"+n.toString(),this._holderElement.classList.add(LOADING_CLASS),fetch(o,r).then(a=>this._config.onServerResponse(a,this)).then(a=>{const l=nested(this._config.serverDataKey,a)||a;this.setData(l,!e),this._abortController=null,e&&this._showSuggestions()}).catch(a=>{a.name==="AbortError"||this._abortController.signal.aborted||console.error(a)}).finally(a=>{this._holderElement.classList.remove(LOADING_CLASS)})}_add(e,t=null,i={}){if(!this.canAdd(e,i))return null;const n=this.addItem(e,t,i);return this._resetHtmlState(),this._config.keepOpen?this._showSuggestions():this.resetSearchInput(),n}_isItemEnabled(e){if(e.style.display==="none")return!1;const t=e.firstElementChild;return t.tagName==="A"&&!t.classList.contains("disabled")}_moveSelection(e=NEXT,t=null){const i=this.getSelection();if(i){const n=e===NEXT?"nextSibling":"previousSibling";t=i.parentNode;do t=t[n];while(t&&!this._isItemEnabled(t));t?i.classList.remove(...this._activeClasses()):i&&(t=i.parentElement)}else{if(e===PREV)return t;if(!t)for(t=this._dropElement.firstChild;t&&!this._isItemEnabled(t);)t=t.nextSibling}if(t){const n=t.offsetHeight,o=t.offsetTop,r=t.parentNode,a=r.offsetHeight,l=r.scrollHeight,d=r.offsetTop;if(n===0&&setTimeout(()=>{r.scrollTop=0}),e===PREV){const p=o-d>10?o-d:0;r.scrollTop=p}else o+n-(a+r.scrollTop)>0&&n>0&&(r.scrollTop=o+n-a+1,r.scrollTop+a>=l-10&&(r.scrollTop=o-d));const h=t.querySelector("a");h.classList.add(...this._activeClasses()),this._searchInput.setAttribute("aria-activedescendant",h.id),this._config.updateOnSelect&&(this._searchInput.value=h.dataset.label,this._adjustWidth())}else this._searchInput.setAttribute("aria-activedescendant","");return t}_adjustWidth(){this._holderElement.classList.remove(PLACEHOLDER_CLASS),this._searchInput.value?this._searchInput.size=this._searchInput.value.length:this.getSelectedValues().length?(this._searchInput.placeholder="",this._searchInput.size=1):(this._searchInput.size=this._config.placeholder.length>0?this._config.placeholder.length:1,this._searchInput.placeholder=this._config.placeholder,this._holderElement.classList.add(PLACEHOLDER_CLASS));const e=this._searchInput.value||this._searchInput.placeholder,t=window.getComputedStyle(this._holderElement).fontSize,i=calcTextWidth(e,t)+16;this._searchInput.style.width=i+"px"}_buildSuggestions(e){for(;this._dropElement.lastChild;)this._dropElement.removeChild(this._dropElement.lastChild);let t=0,i=1;for(let n=0;n<e.length;n++){const o=e[n];if(o){if(o.group&&o.items){const r=ce("li");r.setAttribute("role","presentation"),r.dataset.id=""+i;const a=ce("span");if(r.append(a),a.classList.add("dropdown-header","text-truncate"),a.innerHTML=this._config.sanitizer(o.group),this._dropElement.appendChild(r),o.items)for(let l=0;l<o.items.length;l++){const d=o.items[l];d.group_id=i,this._buildSuggestionsItem(o.items[l],t),t++}i++}this._buildSuggestionsItem(o,t),t++}}if(this._config.notFoundMessage){const n=ce("li");n.setAttribute("role","presentation"),n.classList.add(CLASS_PREFIX+"not-found"),n.innerHTML='<span class="dropdown-item"></span>',this._dropElement.appendChild(n)}}_buildSuggestionsItem(e,t){if(!e[this._config.valueField])return;const i=e[this._config.valueField],n=e[this._config.labelField];let o=this._config.onRenderItem(e,n,this);const r=ce("li");r.setAttribute("role","presentation"),e.group_id&&r.setAttribute("data-group-id",""+e.group_id);const a=ce("a");r.append(a),a.id=this._dropElement.id+"-"+t,a.classList.add("dropdown-item","text-truncate"),e.disabled&&a.classList.add("disabled"),a.setAttribute(VALUE_ATTRIBUTE,i),a.dataset.label=n;const l={};this._config.searchFields.forEach(d=>{l[d]=e[d]}),a.dataset.searchData=JSON.stringify(l),a.setAttribute("href","#"),a.innerHTML=o,this._dropElement.appendChild(r),a.addEventListener("mouseenter",d=>{this._keyboardNavigation||(this.removeSelection(),r.querySelector("a").classList.add(...this._activeClasses()))}),a.addEventListener("mousedown",d=>{d.preventDefault()}),a.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation(),this._config.confirmAdd(i,this).then(()=>{this._add(n,i,e.data),this._config.onSelectItem(e,this)}).catch(()=>{})})}initialOptions(){return this._selectElement.querySelectorAll("option[data-init]")}_removeSelectedAttrs(){this._selectElement.querySelectorAll("option").forEach(e=>{rmAttr(e,"selected")})}reset(){this.removeAll(),this._fireEvents=!1;const e=this.initialOptions();this._removeSelectedAttrs();for(let t=0;t<e.length;t++){const i=e[t],n=Object.assign({},{disabled:i.hasAttribute("disabled")},i.dataset);this.addItem(i.textContent,i.value,n)}this._resetHtmlState(),this._fireEvents=!0}resetSearchInput(e=!1){if(this._searchInput.value="",this._adjustWidth(),this._checkMax(),this.isSingle()&&!e){document.activeElement.blur(),this.hideSuggestions();return}e||(this._shouldShow()||this.hideSuggestions(),this._searchInput===document.activeElement&&this._searchInput.dispatchEvent(new Event("input")))}_checkMax(){this.isMaxReached()?(this._holderElement.classList.add(MAX_REACHED_CLASS),this._searchInput.style.visibility="hidden"):this._searchInput.style.visibility=="hidden"&&(this._searchInput.style.visibility="visible")}getSelectedValues(){const e=this._selectElement.querySelectorAll("option[selected]");return Array.from(e).map(t=>t.value)}getAvailableValues(){const e=this._selectElement.querySelectorAll("option");return Array.from(e).map(t=>t.value)}showOrSearch(e=!0){if(e&&!this._shouldShow()){this.hideSuggestions(!1);return}this._config.liveServer?this._searchFunc():this._showSuggestions()}hideSuggestions(e=!0){this._dropElement.classList.remove(SHOW_CLASS),attrs(this._searchInput,{"aria-expanded":"false"}),this.removeSelection(),e&&this._holderElement.classList.remove(INVALID_CLASS)}toggleSuggestions(e=!0,t=!0){this._dropElement.classList.contains(SHOW_CLASS)?this.hideSuggestions(t):this.showOrSearch(e)}_shouldShow(){return this.isDisabled()||this.isMaxReached()?!1:this._searchInput.value.length>=this._config.suggestionsThreshold}_showSuggestions(){if(this._searchInput.style.visibility=="hidden")return;const e=normalize(this._searchInput.value),t={},i=this._dropElement.querySelectorAll("li");let n=0,o=null,r=!1,a={};for(let l=0;l<i.length;l++){let d=i[l],h=d.firstElementChild;if(h instanceof HTMLSpanElement){d.dataset.id&&(a[d.dataset.id]=!1),hideItem(d);continue}if(h.classList.remove(...this._activeClasses()),!this._config.allowSame){const y=h.getAttribute(VALUE_ATTRIBUTE);if(t[y]=t[y]||0,this._findOption(h.getAttribute(VALUE_ATTRIBUTE),"[selected]",t[y]++)){hideItem(d);continue}}const p=this._config.showAllSuggestions||e.length===0;let m=e.length==0&&this._config.suggestionsThreshold===0;if(!p&&e.length>0){const y=JSON.parse(h.dataset.searchData);this._config.searchFields.forEach(b=>{const S=normalize(y[b]);let E=!1;if(this._config.fuzzy)E=fuzzyMatch(S,e);else{const T=S.indexOf(e);E=this._config.startsWith?T===0:T>=0}E&&(m=!0)})}const v=m||e.length===0;if(p||m?(n++,showItem(d),d.dataset.groupId&&(a[d.dataset.groupId]=!0),!o&&this._isItemEnabled(d)&&v&&(o=d),this._config.maximumItems>0&&n>this._config.maximumItems&&hideItem(d)):hideItem(d),this._config.highlightTyped){const y=h.textContent,b=normalize(y).indexOf(e),S=y.substring(0,b)+`<mark class="${this._config.highlightClass}">${y.substring(b,b+e.length)}</mark>`+y.substring(b+e.length,y.length);h.innerHTML=S}this._isItemEnabled(d)&&(r=!0)}if(!this._config.allowNew&&!(e.length===0&&!r)&&this._holderElement.classList.add(INVALID_CLASS),this._config.allowNew&&this._config.regex&&this.isInvalid()&&this._holderElement.classList.remove(INVALID_CLASS),Array.from(i).filter(l=>l.dataset.id).forEach(l=>{a[l.dataset.id]===!0&&showItem(l)}),r&&(this._holderElement.classList.remove(INVALID_CLASS),o&&this._config.autoselectFirst&&(this.removeSelection(),this._moveSelection(NEXT,o))),n===0)if(this._config.notFoundMessage){const l=this._dropElement.querySelector("."+CLASS_PREFIX+"not-found");l.style.display="block";const d=this._config.notFoundMessage.replace("{{tag}}",this._searchInput.value);l.innerHTML=`<span class="dropdown-item">${d}</span>`,this._showDropdown()}else this.hideSuggestions(!1);else this._showDropdown()}_showDropdown(){const e=this._dropElement.classList.contains(SHOW_CLASS);e||(this._dropElement.classList.add(SHOW_CLASS),attrs(this._searchInput,{"aria-expanded":"true"})),this._positionMenu(e)}_positionMenu(e=!1){const t=this._rtl,i=this._config.fixed,n=this._config.fullWidth,o=this._searchInput.getBoundingClientRect(),r=this._holderElement.getBoundingClientRect();let a=0,l=0;if(i?n?(a=r.x,l=r.y+r.height+2):(a=o.x,l=o.y+o.height):n?(a=0,l=r.height+2):(a=this._searchInput.offsetLeft,l=this._searchInput.offsetHeight+this._searchInput.offsetTop),t&&!n&&(a-=this._dropElement.offsetWidth-o.width),!n){const p=Math.min(window.innerWidth,document.body.offsetWidth),m=t?o.x+o.width-this._dropElement.offsetWidth-1:p-1-(o.x+this._dropElement.offsetWidth);m<0&&(a=t?a-m:a+m)}n&&(this._dropElement.style.width=this._holderElement.offsetWidth+"px"),e||(this._dropElement.style.transform="unset"),Object.assign(this._dropElement.style,{left:a+"px",top:l+"px"});const d=this._dropElement.getBoundingClientRect(),h=window.innerHeight;if(d.y+d.height>h||this._dropElement.style.transform.includes("translateY")){const p=n?r.height+4:o.height;this._dropElement.style.transform="translateY(calc(-100.1% - "+p+"px))"}}_getBootstrapVersion(){let e=5,t=window.jQuery;return t&&t.fn.tooltip&&t.fn.tooltip.Constructor&&(e=parseInt(t.fn.tooltip.Constructor.VERSION.charAt(0))),e}_isSelected(e){return!!Array.from(this._selectElement.querySelectorAll("option")).find(n=>n.textContent==e&&n.getAttribute("selected"))}_isSelectable(e){const i=Array.from(this._selectElement.querySelectorAll("option")).filter(n=>n.textContent==e);return!(i.length>0&&!i.find(o=>!o.getAttribute("selected")))}hasItem(e){for(let t of this._config.items){const i=t.items||[t];for(let n of i)if(n[this._config.labelField]==e)return!0}return!1}getItem(e){for(let t of this._config.items){const i=t.items||[t];for(let n of i)if(n[this._config.valueField]==e)return n}return null}_validateRegex(e){return new RegExp(this._config.regex.trim()).test(e)}getSelection(){return this._dropElement.querySelector("a."+ACTIVE_CLASS)}removeSelection(){const e=this.getSelection();e&&e.classList.remove(...this._activeClasses())}_activeClasses(){return[...this._config.activeClasses,ACTIVE_CLASS]}getActiveSelection(){return this.getSelection()}removeActiveSelection(){return this.removeSelection()}removeAll(){this.getSelectedValues().forEach(t=>{this.removeItem(t,!0)}),this._adjustWidth()}removeLastItem(e=!1){let t=this.getLastItem();t&&this.removeItem(t,e)}getLastItem(){let e=this._containerElement.querySelectorAll("span."+CLASS_PREFIX+"badge");return e.length?e[e.length-1].getAttribute(VALUE_ATTRIBUTE):void 0}enable(){this._selectElement.setAttribute("disabled",""),this.resetState()}disable(){rmAttr(this._selectElement,"disabled"),this.resetState()}isDisabled(){return this._selectElement.hasAttribute("disabled")||this._selectElement.disabled||this._selectElement.hasAttribute("readonly")}isDropdownVisible(){return this._dropElement.classList.contains(SHOW_CLASS)}isInvalid(){return this._holderElement.classList.contains(INVALID_CLASS)}isSingle(){return!this._selectElement.hasAttribute("multiple")}isMaxReached(){return this._config.max&&this.getSelectedValues().length>=this._config.max}canAdd(e,t={}){if(!e||t.new&&!this._config.allowNew||!t.new&&!this.hasItem(e)||this.isDisabled())return!1;if(!this.isSingle()&&!this._config.allowSame){if(t.new){if(this._isSelected(e))return!1}else if(!this._isSelectable(e))return!1}return this.isMaxReached()?!1:this._config.regex&&t.new&&!this._validateRegex(e)?(this._holderElement.classList.add(INVALID_CLASS),!1):this._config.onCanAdd&&this._config.onCanAdd(e,t,this)===!1?(this._holderElement.classList.add(INVALID_CLASS),!1):!0}getData(){return this._config.items}setData(e,t=!1){Array.isArray(e)||(e=Object.entries(e).map(([i,n])=>({value:i,label:n}))),this._config.items!=e&&(this._config.items=e),t&&(this._removeSelectedAttrs(),e.reduce((n,o)=>n.concat(o.group?o.items:[o]),[]).forEach(n=>{const o=n[this._config.valueField],r=n[this._config.labelField];if(o&&(n.selected||this._config.selected.includes(o))){const a=this.addItem(r,o,n.data);a&&a.setAttribute("data-init","true")}})),this._buildSuggestions(e),this._resetHtmlState()}_findOption(e=null,t="",i=0){const o="option"+(e===null?"":'[value="'+CSS.escape(e)+'"]')+t;return this._selectElement.querySelectorAll(o)[i]||null}setItem(e,t={}){let i=null,n=this._findOption(e,":not([selected])");n&&(i=this.addItem(n.textContent,n.value,t));let o=this.getItem(e);if(o){const r=o[this._config.valueField],a=o[this._config.labelField];i=this.addItem(a,r,t)}return this._adjustWidth(),this._checkMax(),i}addItem(e,t=null,i={}){t||(t=e),this.isSingle()&&this.getSelectedValues().length&&this.removeLastItem(!0);let n=this._findOption(t,":not([selected])");if(!n){n=ce("option"),n.value=t,n.innerText=e;for(const[o,r]of Object.entries(i))n.dataset[o]=r;this._selectElement.appendChild(n),this._config.onCreateItem(n,this)}return n&&(i=Object.assign({title:n.getAttribute("title")},i,n.dataset)),n.setAttribute("selected","selected"),n.selected=!0,this._createBadge(e,t,i),this._fireEvents&&this._selectElement.dispatchEvent(new Event("change",{bubbles:!0})),n}_resetHtmlState(){const e=this._selectElement.innerHTML;this._selectElement.innerHTML="",this._selectElement.innerHTML=e,this._adjustWidth()}_createBadge(e,t=null,i={}){const n=this._getBootstrapVersion()===5,o=i.disabled&&parseBool(i.disabled),r=this._config.allowClear&&!o;let a=this._config.allowHtml?e:this._config.sanitizer(e),l=ce("span"),d=[CLASS_PREFIX+"badge"];const h=this.isSingle()&&!this._config.singleBadge;if(!h){d.push("badge");let m=this._config.badgeStyle;i.badgeStyle&&(m=i.badgeStyle),i.badgeClass&&d.push(...i.badgeClass.split(" ")),this._config.baseClass?d.push(...this._config.baseClass.split(" ")):n?d=[...d,"bg-"+m,"text-truncate"]:d=[...d,"badge-"+m],l.style.maxWidth="100%"}o&&d.push("disabled","opacity-50");const p=h?0:2;if(l.style.margin=p+"px 6px "+p+"px 0px",l.style.marginBlock=p+"px",l.style.marginInline="0px 6px",l.style.display="flex",l.style.alignItems="center",l.classList.add(...d),l.setAttribute(VALUE_ATTRIBUTE,t),i.title&&l.setAttribute("title",i.title),r){const m=d.includes("text-dark")||h?"btn-close":"btn-close btn-close-white";let v="margin-inline: 0px 6px;",y="left";this._config.clearEnd&&(y="right"),y=="right"&&(v="margin-inline: 6px 0px;");const b=n?'<button type="button" style="font-size:0.65em;'+v+'" class="'+m+'" aria-label="'+this._config.clearLabel+'"></button>':'<button type="button" style="font-size:1em;'+v+'text-shadow:none;color:currentColor;transform:scale(1.2);float:none" class="close" aria-label="'+this._config.clearLabel+'"><span aria-hidden="true">×</span></button>';a=y=="left"?b+a:a+b}l.innerHTML=a,this._containerElement.insertBefore(l,this._searchInput),i.title&&tooltip&&n&&tooltip.getOrCreateInstance(l),r&&l.querySelector("button").addEventListener("click",m=>{m.preventDefault(),m.stopPropagation(),this.isDisabled()||this._config.confirmClear(t,this).then(()=>{this.removeItem(t),document.activeElement.blur(),this._adjustWidth()}).catch(()=>{})})}getHolder(){return this._holderElement}clear(){this.hideSuggestions(),this.reset()}updateData(e){this.setData(e,!1),this.reset()}removeItem(e,t=!1){const i=CSS.escape(e);let n=this._containerElement.querySelectorAll("span["+VALUE_ATTRIBUTE+'="'+i+'"]');if(!n.length)return;const o=n.length-1,r=n[o];r&&(r.dataset.bsOriginalTitle&&tooltip.getOrCreateInstance(r).dispose(),r.remove());let a=this._findOption(e,"[selected]",o);a&&(rmAttr(a,"selected"),a.selected=!1,this._fireEvents&&!t&&this._selectElement.dispatchEvent(new Event("change",{bubbles:!0}))),this._searchInput.style.visibility=="hidden"&&!this.isMaxReached()&&(this._searchInput.style.visibility="visible",this._holderElement.classList.remove(MAX_REACHED_CLASS)),t||this._config.onClearItem(e,this)}}var leafletSrc={exports:{}};/* @preserve
|
||
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
||
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
||
*/(function(s,e){(function(t,i){i(e)})(commonjsGlobal,function(t){var i="1.9.4";function n(c){var u,g,C,w;for(g=1,C=arguments.length;g<C;g++){w=arguments[g];for(u in w)c[u]=w[u]}return c}var o=Object.create||function(){function c(){}return function(u){return c.prototype=u,new c}}();function r(c,u){var g=Array.prototype.slice;if(c.bind)return c.bind.apply(c,g.call(arguments,1));var C=g.call(arguments,2);return function(){return c.apply(u,C.length?C.concat(g.call(arguments)):arguments)}}var a=0;function l(c){return"_leaflet_id"in c||(c._leaflet_id=++a),c._leaflet_id}function d(c,u,g){var C,w,P,O;return O=function(){C=!1,w&&(P.apply(g,w),w=!1)},P=function(){C?w=arguments:(c.apply(g,arguments),setTimeout(O,u),C=!0)},P}function h(c,u,g){var C=u[1],w=u[0],P=C-w;return c===C&&g?c:((c-w)%P+P)%P+w}function p(){return!1}function m(c,u){if(u===!1)return c;var g=Math.pow(10,u===void 0?6:u);return Math.round(c*g)/g}function v(c){return c.trim?c.trim():c.replace(/^\s+|\s+$/g,"")}function y(c){return v(c).split(/\s+/)}function b(c,u){Object.prototype.hasOwnProperty.call(c,"options")||(c.options=c.options?o(c.options):{});for(var g in u)c.options[g]=u[g];return c.options}function S(c,u,g){var C=[];for(var w in c)C.push(encodeURIComponent(g?w.toUpperCase():w)+"="+encodeURIComponent(c[w]));return(!u||u.indexOf("?")===-1?"?":"&")+C.join("&")}var E=/\{ *([\w_ -]+) *\}/g;function T(c,u){return c.replace(E,function(g,C){var w=u[C];if(w===void 0)throw new Error("No value provided for variable "+g);return typeof w=="function"&&(w=w(u)),w})}var R=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"};function A(c,u){for(var g=0;g<c.length;g++)if(c[g]===u)return g;return-1}var D="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function x(c){return window["webkit"+c]||window["moz"+c]||window["ms"+c]}var M=0;function I(c){var u=+new Date,g=Math.max(0,16-(u-M));return M=u+g,window.setTimeout(c,g)}var V=window.requestAnimationFrame||x("RequestAnimationFrame")||I,z=window.cancelAnimationFrame||x("CancelAnimationFrame")||x("CancelRequestAnimationFrame")||function(c){window.clearTimeout(c)};function B(c,u,g){if(g&&V===I)c.call(u);else return V.call(window,r(c,u))}function K(c){c&&z.call(window,c)}var J={__proto__:null,extend:n,create:o,bind:r,get lastId(){return a},stamp:l,throttle:d,wrapNum:h,falseFn:p,formatNum:m,trim:v,splitWords:y,setOptions:b,getParamString:S,template:T,isArray:R,indexOf:A,emptyImageUrl:D,requestFn:V,cancelFn:z,requestAnimFrame:B,cancelAnimFrame:K};function Z(){}Z.extend=function(c){var u=function(){b(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},g=u.__super__=this.prototype,C=o(g);C.constructor=u,u.prototype=C;for(var w in this)Object.prototype.hasOwnProperty.call(this,w)&&w!=="prototype"&&w!=="__super__"&&(u[w]=this[w]);return c.statics&&n(u,c.statics),c.includes&&(F(c.includes),n.apply(null,[C].concat(c.includes))),n(C,c),delete C.statics,delete C.includes,C.options&&(C.options=g.options?o(g.options):{},n(C.options,c.options)),C._initHooks=[],C.callInitHooks=function(){if(!this._initHooksCalled){g.callInitHooks&&g.callInitHooks.call(this),this._initHooksCalled=!0;for(var P=0,O=C._initHooks.length;P<O;P++)C._initHooks[P].call(this)}},u},Z.include=function(c){var u=this.prototype.options;return n(this.prototype,c),c.options&&(this.prototype.options=u,this.mergeOptions(c.options)),this},Z.mergeOptions=function(c){return n(this.prototype.options,c),this},Z.addInitHook=function(c){var u=Array.prototype.slice.call(arguments,1),g=typeof c=="function"?c:function(){this[c].apply(this,u)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(g),this};function F(c){if(!(typeof L>"u"||!L||!L.Mixin)){c=R(c)?c:[c];for(var u=0;u<c.length;u++)c[u]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var $={on:function(c,u,g){if(typeof c=="object")for(var C in c)this._on(C,c[C],u);else{c=y(c);for(var w=0,P=c.length;w<P;w++)this._on(c[w],u,g)}return this},off:function(c,u,g){if(!arguments.length)delete this._events;else if(typeof c=="object")for(var C in c)this._off(C,c[C],u);else{c=y(c);for(var w=arguments.length===1,P=0,O=c.length;P<O;P++)w?this._off(c[P]):this._off(c[P],u,g)}return this},_on:function(c,u,g,C){if(typeof u!="function"){console.warn("wrong listener type: "+typeof u);return}if(this._listens(c,u,g)===!1){g===this&&(g=void 0);var w={fn:u,ctx:g};C&&(w.once=!0),this._events=this._events||{},this._events[c]=this._events[c]||[],this._events[c].push(w)}},_off:function(c,u,g){var C,w,P;if(this._events&&(C=this._events[c],!!C)){if(arguments.length===1){if(this._firingCount)for(w=0,P=C.length;w<P;w++)C[w].fn=p;delete this._events[c];return}if(typeof u!="function"){console.warn("wrong listener type: "+typeof u);return}var O=this._listens(c,u,g);if(O!==!1){var N=C[O];this._firingCount&&(N.fn=p,this._events[c]=C=C.slice()),C.splice(O,1)}}},fire:function(c,u,g){if(!this.listens(c,g))return this;var C=n({},u,{type:c,target:this,sourceTarget:u&&u.sourceTarget||this});if(this._events){var w=this._events[c];if(w){this._firingCount=this._firingCount+1||1;for(var P=0,O=w.length;P<O;P++){var N=w[P],k=N.fn;N.once&&this.off(c,k,N.ctx),k.call(N.ctx||this,C)}this._firingCount--}}return g&&this._propagateEvent(C),this},listens:function(c,u,g,C){typeof c!="string"&&console.warn('"string" type argument expected');var w=u;typeof u!="function"&&(C=!!u,w=void 0,g=void 0);var P=this._events&&this._events[c];if(P&&P.length&&this._listens(c,w,g)!==!1)return!0;if(C){for(var O in this._eventParents)if(this._eventParents[O].listens(c,u,g,C))return!0}return!1},_listens:function(c,u,g){if(!this._events)return!1;var C=this._events[c]||[];if(!u)return!!C.length;g===this&&(g=void 0);for(var w=0,P=C.length;w<P;w++)if(C[w].fn===u&&C[w].ctx===g)return w;return!1},once:function(c,u,g){if(typeof c=="object")for(var C in c)this._on(C,c[C],u,!0);else{c=y(c);for(var w=0,P=c.length;w<P;w++)this._on(c[w],u,g,!0)}return this},addEventParent:function(c){return this._eventParents=this._eventParents||{},this._eventParents[l(c)]=c,this},removeEventParent:function(c){return this._eventParents&&delete this._eventParents[l(c)],this},_propagateEvent:function(c){for(var u in this._eventParents)this._eventParents[u].fire(c.type,n({layer:c.target,propagatedFrom:c.target},c),!0)}};$.addEventListener=$.on,$.removeEventListener=$.clearAllEventListeners=$.off,$.addOneTimeEventListener=$.once,$.fireEvent=$.fire,$.hasEventListeners=$.listens;var Y=Z.extend($);function W(c,u,g){this.x=g?Math.round(c):c,this.y=g?Math.round(u):u}var X=Math.trunc||function(c){return c>0?Math.floor(c):Math.ceil(c)};W.prototype={clone:function(){return new W(this.x,this.y)},add:function(c){return this.clone()._add(U(c))},_add:function(c){return this.x+=c.x,this.y+=c.y,this},subtract:function(c){return this.clone()._subtract(U(c))},_subtract:function(c){return this.x-=c.x,this.y-=c.y,this},divideBy:function(c){return this.clone()._divideBy(c)},_divideBy:function(c){return this.x/=c,this.y/=c,this},multiplyBy:function(c){return this.clone()._multiplyBy(c)},_multiplyBy:function(c){return this.x*=c,this.y*=c,this},scaleBy:function(c){return new W(this.x*c.x,this.y*c.y)},unscaleBy:function(c){return new W(this.x/c.x,this.y/c.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=X(this.x),this.y=X(this.y),this},distanceTo:function(c){c=U(c);var u=c.x-this.x,g=c.y-this.y;return Math.sqrt(u*u+g*g)},equals:function(c){return c=U(c),c.x===this.x&&c.y===this.y},contains:function(c){return c=U(c),Math.abs(c.x)<=Math.abs(this.x)&&Math.abs(c.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function U(c,u,g){return c instanceof W?c:R(c)?new W(c[0],c[1]):c==null?c:typeof c=="object"&&"x"in c&&"y"in c?new W(c.x,c.y):new W(c,u,g)}function se(c,u){if(c)for(var g=u?[c,u]:c,C=0,w=g.length;C<w;C++)this.extend(g[C])}se.prototype={extend:function(c){var u,g;if(!c)return this;if(c instanceof W||typeof c[0]=="number"||"x"in c)u=g=U(c);else if(c=pe(c),u=c.min,g=c.max,!u||!g)return this;return!this.min&&!this.max?(this.min=u.clone(),this.max=g.clone()):(this.min.x=Math.min(u.x,this.min.x),this.max.x=Math.max(g.x,this.max.x),this.min.y=Math.min(u.y,this.min.y),this.max.y=Math.max(g.y,this.max.y)),this},getCenter:function(c){return U((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,c)},getBottomLeft:function(){return U(this.min.x,this.max.y)},getTopRight:function(){return U(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(c){var u,g;return typeof c[0]=="number"||c instanceof W?c=U(c):c=pe(c),c instanceof se?(u=c.min,g=c.max):u=g=c,u.x>=this.min.x&&g.x<=this.max.x&&u.y>=this.min.y&&g.y<=this.max.y},intersects:function(c){c=pe(c);var u=this.min,g=this.max,C=c.min,w=c.max,P=w.x>=u.x&&C.x<=g.x,O=w.y>=u.y&&C.y<=g.y;return P&&O},overlaps:function(c){c=pe(c);var u=this.min,g=this.max,C=c.min,w=c.max,P=w.x>u.x&&C.x<g.x,O=w.y>u.y&&C.y<g.y;return P&&O},isValid:function(){return!!(this.min&&this.max)},pad:function(c){var u=this.min,g=this.max,C=Math.abs(u.x-g.x)*c,w=Math.abs(u.y-g.y)*c;return pe(U(u.x-C,u.y-w),U(g.x+C,g.y+w))},equals:function(c){return c?(c=pe(c),this.min.equals(c.getTopLeft())&&this.max.equals(c.getBottomRight())):!1}};function pe(c,u){return!c||c instanceof se?c:new se(c,u)}function ae(c,u){if(c)for(var g=u?[c,u]:c,C=0,w=g.length;C<w;C++)this.extend(g[C])}ae.prototype={extend:function(c){var u=this._southWest,g=this._northEast,C,w;if(c instanceof ie)C=c,w=c;else if(c instanceof ae){if(C=c._southWest,w=c._northEast,!C||!w)return this}else return c?this.extend(te(c)||oe(c)):this;return!u&&!g?(this._southWest=new ie(C.lat,C.lng),this._northEast=new ie(w.lat,w.lng)):(u.lat=Math.min(C.lat,u.lat),u.lng=Math.min(C.lng,u.lng),g.lat=Math.max(w.lat,g.lat),g.lng=Math.max(w.lng,g.lng)),this},pad:function(c){var u=this._southWest,g=this._northEast,C=Math.abs(u.lat-g.lat)*c,w=Math.abs(u.lng-g.lng)*c;return new ae(new ie(u.lat-C,u.lng-w),new ie(g.lat+C,g.lng+w))},getCenter:function(){return new ie((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new ie(this.getNorth(),this.getWest())},getSouthEast:function(){return new ie(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(c){typeof c[0]=="number"||c instanceof ie||"lat"in c?c=te(c):c=oe(c);var u=this._southWest,g=this._northEast,C,w;return c instanceof ae?(C=c.getSouthWest(),w=c.getNorthEast()):C=w=c,C.lat>=u.lat&&w.lat<=g.lat&&C.lng>=u.lng&&w.lng<=g.lng},intersects:function(c){c=oe(c);var u=this._southWest,g=this._northEast,C=c.getSouthWest(),w=c.getNorthEast(),P=w.lat>=u.lat&&C.lat<=g.lat,O=w.lng>=u.lng&&C.lng<=g.lng;return P&&O},overlaps:function(c){c=oe(c);var u=this._southWest,g=this._northEast,C=c.getSouthWest(),w=c.getNorthEast(),P=w.lat>u.lat&&C.lat<g.lat,O=w.lng>u.lng&&C.lng<g.lng;return P&&O},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(c,u){return c?(c=oe(c),this._southWest.equals(c.getSouthWest(),u)&&this._northEast.equals(c.getNorthEast(),u)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function oe(c,u){return c instanceof ae?c:new ae(c,u)}function ie(c,u,g){if(isNaN(c)||isNaN(u))throw new Error("Invalid LatLng object: ("+c+", "+u+")");this.lat=+c,this.lng=+u,g!==void 0&&(this.alt=+g)}ie.prototype={equals:function(c,u){if(!c)return!1;c=te(c);var g=Math.max(Math.abs(this.lat-c.lat),Math.abs(this.lng-c.lng));return g<=(u===void 0?1e-9:u)},toString:function(c){return"LatLng("+m(this.lat,c)+", "+m(this.lng,c)+")"},distanceTo:function(c){return be.distance(this,te(c))},wrap:function(){return be.wrapLatLng(this)},toBounds:function(c){var u=180*c/40075017,g=u/Math.cos(Math.PI/180*this.lat);return oe([this.lat-u,this.lng-g],[this.lat+u,this.lng+g])},clone:function(){return new ie(this.lat,this.lng,this.alt)}};function te(c,u,g){return c instanceof ie?c:R(c)&&typeof c[0]!="object"?c.length===3?new ie(c[0],c[1],c[2]):c.length===2?new ie(c[0],c[1]):null:c==null?c:typeof c=="object"&&"lat"in c?new ie(c.lat,"lng"in c?c.lng:c.lon,c.alt):u===void 0?null:new ie(c,u,g)}var Se={latLngToPoint:function(c,u){var g=this.projection.project(c),C=this.scale(u);return this.transformation._transform(g,C)},pointToLatLng:function(c,u){var g=this.scale(u),C=this.transformation.untransform(c,g);return this.projection.unproject(C)},project:function(c){return this.projection.project(c)},unproject:function(c){return this.projection.unproject(c)},scale:function(c){return 256*Math.pow(2,c)},zoom:function(c){return Math.log(c/256)/Math.LN2},getProjectedBounds:function(c){if(this.infinite)return null;var u=this.projection.bounds,g=this.scale(c),C=this.transformation.transform(u.min,g),w=this.transformation.transform(u.max,g);return new se(C,w)},infinite:!1,wrapLatLng:function(c){var u=this.wrapLng?h(c.lng,this.wrapLng,!0):c.lng,g=this.wrapLat?h(c.lat,this.wrapLat,!0):c.lat,C=c.alt;return new ie(g,u,C)},wrapLatLngBounds:function(c){var u=c.getCenter(),g=this.wrapLatLng(u),C=u.lat-g.lat,w=u.lng-g.lng;if(C===0&&w===0)return c;var P=c.getSouthWest(),O=c.getNorthEast(),N=new ie(P.lat-C,P.lng-w),k=new ie(O.lat-C,O.lng-w);return new ae(N,k)}},be=n({},Se,{wrapLng:[-180,180],R:6371e3,distance:function(c,u){var g=Math.PI/180,C=c.lat*g,w=u.lat*g,P=Math.sin((u.lat-c.lat)*g/2),O=Math.sin((u.lng-c.lng)*g/2),N=P*P+Math.cos(C)*Math.cos(w)*O*O,k=2*Math.atan2(Math.sqrt(N),Math.sqrt(1-N));return this.R*k}}),qe=6378137,dt={R:qe,MAX_LATITUDE:85.0511287798,project:function(c){var u=Math.PI/180,g=this.MAX_LATITUDE,C=Math.max(Math.min(g,c.lat),-g),w=Math.sin(C*u);return new W(this.R*c.lng*u,this.R*Math.log((1+w)/(1-w))/2)},unproject:function(c){var u=180/Math.PI;return new ie((2*Math.atan(Math.exp(c.y/this.R))-Math.PI/2)*u,c.x*u/this.R)},bounds:function(){var c=qe*Math.PI;return new se([-c,-c],[c,c])}()};function We(c,u,g,C){if(R(c)){this._a=c[0],this._b=c[1],this._c=c[2],this._d=c[3];return}this._a=c,this._b=u,this._c=g,this._d=C}We.prototype={transform:function(c,u){return this._transform(c.clone(),u)},_transform:function(c,u){return u=u||1,c.x=u*(this._a*c.x+this._b),c.y=u*(this._c*c.y+this._d),c},untransform:function(c,u){return u=u||1,new W((c.x/u-this._b)/this._a,(c.y/u-this._d)/this._c)}};function Be(c,u,g,C){return new We(c,u,g,C)}var Xe=n({},be,{code:"EPSG:3857",projection:dt,transformation:function(){var c=.5/(Math.PI*dt.R);return Be(c,.5,-c,.5)}()}),Zt=n({},Xe,{code:"EPSG:900913"});function Mt(c){return document.createElementNS("http://www.w3.org/2000/svg",c)}function ut(c,u){var g="",C,w,P,O,N,k;for(C=0,P=c.length;C<P;C++){for(N=c[C],w=0,O=N.length;w<O;w++)k=N[w],g+=(w?"L":"M")+k.x+" "+k.y;g+=u?Q.svg?"z":"x":""}return g||"M0 0"}var Qe=document.documentElement.style,Ze="ActiveXObject"in window,Jt=Ze&&!document.addEventListener,Oe="msLaunchUri"in navigator&&!("documentMode"in document),Ge=Me("webkit"),ht=Me("android"),ft=Me("android 2")||Me("android 3"),gt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),xt=ht&&Me("Google")&><537&&!("AudioNode"in window),Je=!!window.opera,mt=!Oe&&Me("chrome"),vt=Me("gecko")&&!Ge&&!Je&&!Ze,Gn=!mt&&Me("safari"),Mi=Me("phantom"),xi="OTransition"in Qe,Vn=navigator.platform.indexOf("Win")===0,Li=Ze&&"transition"in Qe,ei="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ft,Fi="MozPerspective"in Qe,Hn=!window.L_DISABLE_3D&&(Li||ei||Fi)&&!xi&&!Mi,Ct=typeof orientation<"u"||Me("mobile"),Wn=Ct&&Ge,Bn=Ct&&ei,Ii=!window.PointerEvent&&window.MSPointerEvent,Ni=!!(window.PointerEvent||Ii),$i="ontouchstart"in window||!!window.TouchEvent,zn=!window.L_NO_TOUCH&&($i||Ni),jn=Ct&&Je,Un=Ct&&vt,Kn=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Yn=function(){var c=!1;try{var u=Object.defineProperty({},"passive",{get:function(){c=!0}});window.addEventListener("testPassiveEventSupport",p,u),window.removeEventListener("testPassiveEventSupport",p,u)}catch{}return c}(),qn=function(){return!!document.createElement("canvas").getContext}(),ti=!!(document.createElementNS&&Mt("svg").createSVGRect),Xn=!!ti&&function(){var c=document.createElement("div");return c.innerHTML="<svg/>",(c.firstChild&&c.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),Qn=!ti&&function(){try{var c=document.createElement("div");c.innerHTML='<v:shape adj="1"/>';var u=c.firstChild;return u.style.behavior="url(#default#VML)",u&&typeof u.adj=="object"}catch{return!1}}(),Zn=navigator.platform.indexOf("Mac")===0,Jn=navigator.platform.indexOf("Linux")===0;function Me(c){return navigator.userAgent.toLowerCase().indexOf(c)>=0}var Q={ie:Ze,ielt9:Jt,edge:Oe,webkit:Ge,android:ht,android23:ft,androidStock:xt,opera:Je,chrome:mt,gecko:vt,safari:Gn,phantom:Mi,opera12:xi,win:Vn,ie3d:Li,webkit3d:ei,gecko3d:Fi,any3d:Hn,mobile:Ct,mobileWebkit:Wn,mobileWebkit3d:Bn,msPointer:Ii,pointer:Ni,touch:zn,touchNative:$i,mobileOpera:jn,mobileGecko:Un,retina:Kn,passiveEvents:Yn,canvas:qn,svg:ti,vml:Qn,inlineSvg:Xn,mac:Zn,linux:Jn},ki=Q.msPointer?"MSPointerDown":"pointerdown",Gi=Q.msPointer?"MSPointerMove":"pointermove",Vi=Q.msPointer?"MSPointerUp":"pointerup",Hi=Q.msPointer?"MSPointerCancel":"pointercancel",ii={touchstart:ki,touchmove:Gi,touchend:Vi,touchcancel:Hi},Wi={touchstart:rs,touchmove:Lt,touchend:Lt,touchcancel:Lt},et={},Bi=!1;function ts(c,u,g){return u==="touchstart"&&os(),Wi[u]?(g=Wi[u].bind(this,g),c.addEventListener(ii[u],g,!1),g):(console.warn("wrong event specified:",u),p)}function is(c,u,g){if(!ii[u]){console.warn("wrong event specified:",u);return}c.removeEventListener(ii[u],g,!1)}function ns(c){et[c.pointerId]=c}function ss(c){et[c.pointerId]&&(et[c.pointerId]=c)}function zi(c){delete et[c.pointerId]}function os(){Bi||(document.addEventListener(ki,ns,!0),document.addEventListener(Gi,ss,!0),document.addEventListener(Vi,zi,!0),document.addEventListener(Hi,zi,!0),Bi=!0)}function Lt(c,u){if(u.pointerType!==(u.MSPOINTER_TYPE_MOUSE||"mouse")){u.touches=[];for(var g in et)u.touches.push(et[g]);u.changedTouches=[u],c(u)}}function rs(c,u){u.MSPOINTER_TYPE_TOUCH&&u.pointerType===u.MSPOINTER_TYPE_TOUCH&&ye(u),Lt(c,u)}function as(c){var u={},g,C;for(C in c)g=c[C],u[C]=g&&g.bind?g.bind(c):g;return c=u,u.type="dblclick",u.detail=2,u.isTrusted=!1,u._simulated=!0,u}var ls=200;function ds(c,u){c.addEventListener("dblclick",u);var g=0,C;function w(P){if(P.detail!==1){C=P.detail;return}if(!(P.pointerType==="mouse"||P.sourceCapabilities&&!P.sourceCapabilities.firesTouchEvents)){var O=qi(P);if(!(O.some(function(k){return k instanceof HTMLLabelElement&&k.attributes.for})&&!O.some(function(k){return k instanceof HTMLInputElement||k instanceof HTMLSelectElement}))){var N=Date.now();N-g<=ls?(C++,C===2&&u(as(P))):C=1,g=N}}}return c.addEventListener("click",w),{dblclick:u,simDblclick:w}}function us(c,u){c.removeEventListener("dblclick",u.dblclick),c.removeEventListener("click",u.simDblclick)}var ni=Nt(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),_t=Nt(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ji=_t==="webkitTransition"||_t==="OTransition"?_t+"End":"transitionend";function Ui(c){return typeof c=="string"?document.getElementById(c):c}function yt(c,u){var g=c.style[u]||c.currentStyle&&c.currentStyle[u];if((!g||g==="auto")&&document.defaultView){var C=document.defaultView.getComputedStyle(c,null);g=C?C[u]:null}return g==="auto"?null:g}function he(c,u,g){var C=document.createElement(c);return C.className=u||"",g&&g.appendChild(C),C}function ge(c){var u=c.parentNode;u&&u.removeChild(c)}function Ft(c){for(;c.firstChild;)c.removeChild(c.firstChild)}function tt(c){var u=c.parentNode;u&&u.lastChild!==c&&u.appendChild(c)}function nt(c){var u=c.parentNode;u&&u.firstChild!==c&&u.insertBefore(c,u.firstChild)}function si(c,u){if(c.classList!==void 0)return c.classList.contains(u);var g=It(c);return g.length>0&&new RegExp("(^|\\s)"+u+"(\\s|$)").test(g)}function re(c,u){if(c.classList!==void 0)for(var g=y(u),C=0,w=g.length;C<w;C++)c.classList.add(g[C]);else if(!si(c,u)){var P=It(c);oi(c,(P?P+" ":"")+u)}}function me(c,u){c.classList!==void 0?c.classList.remove(u):oi(c,v((" "+It(c)+" ").replace(" "+u+" "," ")))}function oi(c,u){c.className.baseVal===void 0?c.className=u:c.className.baseVal=u}function It(c){return c.correspondingElement&&(c=c.correspondingElement),c.className.baseVal===void 0?c.className:c.className.baseVal}function Pe(c,u){"opacity"in c.style?c.style.opacity=u:"filter"in c.style&&hs(c,u)}function hs(c,u){var g=!1,C="DXImageTransform.Microsoft.Alpha";try{g=c.filters.item(C)}catch{if(u===1)return}u=Math.round(u*100),g?(g.Enabled=u!==100,g.Opacity=u):c.style.filter+=" progid:"+C+"(opacity="+u+")"}function Nt(c){for(var u=document.documentElement.style,g=0;g<c.length;g++)if(c[g]in u)return c[g];return!1}function ze(c,u,g){var C=u||new W(0,0);c.style[ni]=(Q.ie3d?"translate("+C.x+"px,"+C.y+"px)":"translate3d("+C.x+"px,"+C.y+"px,0)")+(g?" scale("+g+")":"")}function ve(c,u){c._leaflet_pos=u,Q.any3d?ze(c,u):(c.style.left=u.x+"px",c.style.top=u.y+"px")}function je(c){return c._leaflet_pos||new W(0,0)}var bt,wt,ri;if("onselectstart"in document)bt=function(){ne(window,"selectstart",ye)},wt=function(){fe(window,"selectstart",ye)};else{var St=Nt(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);bt=function(){if(St){var c=document.documentElement.style;ri=c[St],c[St]="none"}},wt=function(){St&&(document.documentElement.style[St]=ri,ri=void 0)}}function ai(){ne(window,"dragstart",ye)}function li(){fe(window,"dragstart",ye)}var $t,ci;function di(c){for(;c.tabIndex===-1;)c=c.parentNode;c.style&&(kt(),$t=c,ci=c.style.outlineStyle,c.style.outlineStyle="none",ne(window,"keydown",kt))}function kt(){$t&&($t.style.outlineStyle=ci,$t=void 0,ci=void 0,fe(window,"keydown",kt))}function Ki(c){do c=c.parentNode;while((!c.offsetWidth||!c.offsetHeight)&&c!==document.body);return c}function ui(c){var u=c.getBoundingClientRect();return{x:u.width/c.offsetWidth||1,y:u.height/c.offsetHeight||1,boundingClientRect:u}}var ps={__proto__:null,TRANSFORM:ni,TRANSITION:_t,TRANSITION_END:ji,get:Ui,getStyle:yt,create:he,remove:ge,empty:Ft,toFront:tt,toBack:nt,hasClass:si,addClass:re,removeClass:me,setClass:oi,getClass:It,setOpacity:Pe,testProp:Nt,setTransform:ze,setPosition:ve,getPosition:je,get disableTextSelection(){return bt},get enableTextSelection(){return wt},disableImageDrag:ai,enableImageDrag:li,preventOutline:di,restoreOutline:kt,getSizedParentNode:Ki,getScale:ui};function ne(c,u,g,C){if(u&&typeof u=="object")for(var w in u)pi(c,w,u[w],g);else{u=y(u);for(var P=0,O=u.length;P<O;P++)pi(c,u[P],g,C)}return this}var xe="_leaflet_events";function fe(c,u,g,C){if(arguments.length===1)Yi(c),delete c[xe];else if(u&&typeof u=="object")for(var w in u)gi(c,w,u[w],g);else if(u=y(u),arguments.length===2)Yi(c,function(N){return A(u,N)!==-1});else for(var P=0,O=u.length;P<O;P++)gi(c,u[P],g,C);return this}function Yi(c,u){for(var g in c[xe]){var C=g.split(/\d/)[0];(!u||u(C))&&gi(c,C,null,null,g)}}var hi={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function pi(c,u,g,C){var w=u+l(g)+(C?"_"+l(C):"");if(c[xe]&&c[xe][w])return this;var P=function(N){return g.call(C||c,N||window.event)},O=P;!Q.touchNative&&Q.pointer&&u.indexOf("touch")===0?P=ts(c,u,P):Q.touch&&u==="dblclick"?P=ds(c,P):"addEventListener"in c?u==="touchstart"||u==="touchmove"||u==="wheel"||u==="mousewheel"?c.addEventListener(hi[u]||u,P,Q.passiveEvents?{passive:!1}:!1):u==="mouseenter"||u==="mouseleave"?(P=function(N){N=N||window.event,Ci(c,N)&&O(N)},c.addEventListener(hi[u],P,!1)):c.addEventListener(u,O,!1):c.attachEvent("on"+u,P),c[xe]=c[xe]||{},c[xe][w]=P}function gi(c,u,g,C,w){w=w||u+l(g)+(C?"_"+l(C):"");var P=c[xe]&&c[xe][w];if(!P)return this;!Q.touchNative&&Q.pointer&&u.indexOf("touch")===0?is(c,u,P):Q.touch&&u==="dblclick"?us(c,P):"removeEventListener"in c?c.removeEventListener(hi[u]||u,P,!1):c.detachEvent("on"+u,P),c[xe][w]=null}function Ue(c){return c.stopPropagation?c.stopPropagation():c.originalEvent?c.originalEvent._stopped=!0:c.cancelBubble=!0,this}function mi(c){return pi(c,"wheel",Ue),this}function Et(c){return ne(c,"mousedown touchstart dblclick contextmenu",Ue),c._leaflet_disable_click=!0,this}function ye(c){return c.preventDefault?c.preventDefault():c.returnValue=!1,this}function Ke(c){return ye(c),Ue(c),this}function qi(c){if(c.composedPath)return c.composedPath();for(var u=[],g=c.target;g;)u.push(g),g=g.parentNode;return u}function Xi(c,u){if(!u)return new W(c.clientX,c.clientY);var g=ui(u),C=g.boundingClientRect;return new W((c.clientX-C.left)/g.x-u.clientLeft,(c.clientY-C.top)/g.y-u.clientTop)}var fs=Q.linux&&Q.chrome?window.devicePixelRatio:Q.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Qi(c){return Q.edge?c.wheelDeltaY/2:c.deltaY&&c.deltaMode===0?-c.deltaY/fs:c.deltaY&&c.deltaMode===1?-c.deltaY*20:c.deltaY&&c.deltaMode===2?-c.deltaY*60:c.deltaX||c.deltaZ?0:c.wheelDelta?(c.wheelDeltaY||c.wheelDelta)/2:c.detail&&Math.abs(c.detail)<32765?-c.detail*20:c.detail?c.detail/-32765*60:0}function Ci(c,u){var g=u.relatedTarget;if(!g)return!0;try{for(;g&&g!==c;)g=g.parentNode}catch{return!1}return g!==c}var gs={__proto__:null,on:ne,off:fe,stopPropagation:Ue,disableScrollPropagation:mi,disableClickPropagation:Et,preventDefault:ye,stop:Ke,getPropagationPath:qi,getMousePosition:Xi,getWheelDelta:Qi,isExternalTarget:Ci,addListener:ne,removeListener:fe},Zi=Y.extend({run:function(c,u,g,C){this.stop(),this._el=c,this._inProgress=!0,this._duration=g||.25,this._easeOutPower=1/Math.max(C||.5,.2),this._startPos=je(c),this._offset=u.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=B(this._animate,this),this._step()},_step:function(c){var u=+new Date-this._startTime,g=this._duration*1e3;u<g?this._runFrame(this._easeOut(u/g),c):(this._runFrame(1),this._complete())},_runFrame:function(c,u){var g=this._startPos.add(this._offset.multiplyBy(c));u&&g._round(),ve(this._el,g),this.fire("step")},_complete:function(){K(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(c){return 1-Math.pow(1-c,this._easeOutPower)}}),ue=Y.extend({options:{crs:Xe,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(c,u){u=b(this,u),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(c),this._initLayout(),this._onResize=r(this._onResize,this),this._initEvents(),u.maxBounds&&this.setMaxBounds(u.maxBounds),u.zoom!==void 0&&(this._zoom=this._limitZoom(u.zoom)),u.center&&u.zoom!==void 0&&this.setView(te(u.center),u.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=_t&&Q.any3d&&!Q.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),ne(this._proxy,ji,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(c,u,g){if(u=u===void 0?this._zoom:this._limitZoom(u),c=this._limitCenter(te(c),u,this.options.maxBounds),g=g||{},this._stop(),this._loaded&&!g.reset&&g!==!0){g.animate!==void 0&&(g.zoom=n({animate:g.animate},g.zoom),g.pan=n({animate:g.animate,duration:g.duration},g.pan));var C=this._zoom!==u?this._tryAnimatedZoom&&this._tryAnimatedZoom(c,u,g.zoom):this._tryAnimatedPan(c,g.pan);if(C)return clearTimeout(this._sizeTimer),this}return this._resetView(c,u,g.pan&&g.pan.noMoveStart),this},setZoom:function(c,u){return this._loaded?this.setView(this.getCenter(),c,{zoom:u}):(this._zoom=c,this)},zoomIn:function(c,u){return c=c||(Q.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+c,u)},zoomOut:function(c,u){return c=c||(Q.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-c,u)},setZoomAround:function(c,u,g){var C=this.getZoomScale(u),w=this.getSize().divideBy(2),P=c instanceof W?c:this.latLngToContainerPoint(c),O=P.subtract(w).multiplyBy(1-1/C),N=this.containerPointToLatLng(w.add(O));return this.setView(N,u,{zoom:g})},_getBoundsCenterZoom:function(c,u){u=u||{},c=c.getBounds?c.getBounds():oe(c);var g=U(u.paddingTopLeft||u.padding||[0,0]),C=U(u.paddingBottomRight||u.padding||[0,0]),w=this.getBoundsZoom(c,!1,g.add(C));if(w=typeof u.maxZoom=="number"?Math.min(u.maxZoom,w):w,w===1/0)return{center:c.getCenter(),zoom:w};var P=C.subtract(g).divideBy(2),O=this.project(c.getSouthWest(),w),N=this.project(c.getNorthEast(),w),k=this.unproject(O.add(N).divideBy(2).add(P),w);return{center:k,zoom:w}},fitBounds:function(c,u){if(c=oe(c),!c.isValid())throw new Error("Bounds are not valid.");var g=this._getBoundsCenterZoom(c,u);return this.setView(g.center,g.zoom,u)},fitWorld:function(c){return this.fitBounds([[-90,-180],[90,180]],c)},panTo:function(c,u){return this.setView(c,this._zoom,{pan:u})},panBy:function(c,u){if(c=U(c).round(),u=u||{},!c.x&&!c.y)return this.fire("moveend");if(u.animate!==!0&&!this.getSize().contains(c))return this._resetView(this.unproject(this.project(this.getCenter()).add(c)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Zi,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),u.noMoveStart||this.fire("movestart"),u.animate!==!1){re(this._mapPane,"leaflet-pan-anim");var g=this._getMapPanePos().subtract(c).round();this._panAnim.run(this._mapPane,g,u.duration||.25,u.easeLinearity)}else this._rawPanBy(c),this.fire("move").fire("moveend");return this},flyTo:function(c,u,g){if(g=g||{},g.animate===!1||!Q.any3d)return this.setView(c,u,g);this._stop();var C=this.project(this.getCenter()),w=this.project(c),P=this.getSize(),O=this._zoom;c=te(c),u=u===void 0?O:u;var N=Math.max(P.x,P.y),k=N*this.getZoomScale(O,u),H=w.distanceTo(C)||1,q=1.42,ee=q*q;function le(Ce){var Xt=Ce?-1:1,so=Ce?k:N,oo=k*k-N*N+Xt*ee*ee*H*H,ao=2*so*ee*H,Di=oo/ao,In=Math.sqrt(Di*Di+1)-Di,lo=In<1e-9?-18:Math.log(In);return lo}function we(Ce){return(Math.exp(Ce)-Math.exp(-Ce))/2}function _e(Ce){return(Math.exp(Ce)+Math.exp(-Ce))/2}function Re(Ce){return we(Ce)/_e(Ce)}var Ee=le(0);function ct(Ce){return N*(_e(Ee)/_e(Ee+q*Ce))}function Js(Ce){return N*(_e(Ee)*Re(Ee+q*Ce)-we(Ee))/ee}function eo(Ce){return 1-Math.pow(1-Ce,1.5)}var io=Date.now(),Ln=(le(1)-Ee)/q,no=g.duration?1e3*g.duration:1e3*Ln*.8;function Fn(){var Ce=(Date.now()-io)/no,Xt=eo(Ce)*Ln;Ce<=1?(this._flyToFrame=B(Fn,this),this._move(this.unproject(C.add(w.subtract(C).multiplyBy(Js(Xt)/H)),O),this.getScaleZoom(N/ct(Xt),O),{flyTo:!0})):this._move(c,u)._moveEnd(!0)}return this._moveStart(!0,g.noMoveStart),Fn.call(this),this},flyToBounds:function(c,u){var g=this._getBoundsCenterZoom(c,u);return this.flyTo(g.center,g.zoom,u)},setMaxBounds:function(c){return c=oe(c),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),c.isValid()?(this.options.maxBounds=c,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(c){var u=this.options.minZoom;return this.options.minZoom=c,this._loaded&&u!==c&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(c):this},setMaxZoom:function(c){var u=this.options.maxZoom;return this.options.maxZoom=c,this._loaded&&u!==c&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(c):this},panInsideBounds:function(c,u){this._enforcingBounds=!0;var g=this.getCenter(),C=this._limitCenter(g,this._zoom,oe(c));return g.equals(C)||this.panTo(C,u),this._enforcingBounds=!1,this},panInside:function(c,u){u=u||{};var g=U(u.paddingTopLeft||u.padding||[0,0]),C=U(u.paddingBottomRight||u.padding||[0,0]),w=this.project(this.getCenter()),P=this.project(c),O=this.getPixelBounds(),N=pe([O.min.add(g),O.max.subtract(C)]),k=N.getSize();if(!N.contains(P)){this._enforcingBounds=!0;var H=P.subtract(N.getCenter()),q=N.extend(P).getSize().subtract(k);w.x+=H.x<0?-q.x:q.x,w.y+=H.y<0?-q.y:q.y,this.panTo(this.unproject(w),u),this._enforcingBounds=!1}return this},invalidateSize:function(c){if(!this._loaded)return this;c=n({animate:!1,pan:!0},c===!0?{animate:!0}:c);var u=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var g=this.getSize(),C=u.divideBy(2).round(),w=g.divideBy(2).round(),P=C.subtract(w);return!P.x&&!P.y?this:(c.animate&&c.pan?this.panBy(P):(c.pan&&this._rawPanBy(P),this.fire("move"),c.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(r(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:u,newSize:g}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(c){if(c=this._locateOptions=n({timeout:1e4,watch:!1},c),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var u=r(this._handleGeolocationResponse,this),g=r(this._handleGeolocationError,this);return c.watch?this._locationWatchId=navigator.geolocation.watchPosition(u,g,c):navigator.geolocation.getCurrentPosition(u,g,c),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(c){if(this._container._leaflet_id){var u=c.code,g=c.message||(u===1?"permission denied":u===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:u,message:"Geolocation error: "+g+"."})}},_handleGeolocationResponse:function(c){if(this._container._leaflet_id){var u=c.coords.latitude,g=c.coords.longitude,C=new ie(u,g),w=C.toBounds(c.coords.accuracy*2),P=this._locateOptions;if(P.setView){var O=this.getBoundsZoom(w);this.setView(C,P.maxZoom?Math.min(O,P.maxZoom):O)}var N={latlng:C,bounds:w,timestamp:c.timestamp};for(var k in c.coords)typeof c.coords[k]=="number"&&(N[k]=c.coords[k]);this.fire("locationfound",N)}},addHandler:function(c,u){if(!u)return this;var g=this[c]=new u(this);return this._handlers.push(g),this.options[c]&&g.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ge(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(K(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var c;for(c in this._layers)this._layers[c].remove();for(c in this._panes)ge(this._panes[c]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(c,u){var g="leaflet-pane"+(c?" leaflet-"+c.replace("Pane","")+"-pane":""),C=he("div",g,u||this._mapPane);return c&&(this._panes[c]=C),C},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var c=this.getPixelBounds(),u=this.unproject(c.getBottomLeft()),g=this.unproject(c.getTopRight());return new ae(u,g)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(c,u,g){c=oe(c),g=U(g||[0,0]);var C=this.getZoom()||0,w=this.getMinZoom(),P=this.getMaxZoom(),O=c.getNorthWest(),N=c.getSouthEast(),k=this.getSize().subtract(g),H=pe(this.project(N,C),this.project(O,C)).getSize(),q=Q.any3d?this.options.zoomSnap:1,ee=k.x/H.x,le=k.y/H.y,we=u?Math.max(ee,le):Math.min(ee,le);return C=this.getScaleZoom(we,C),q&&(C=Math.round(C/(q/100))*(q/100),C=u?Math.ceil(C/q)*q:Math.floor(C/q)*q),Math.max(w,Math.min(P,C))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new W(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(c,u){var g=this._getTopLeftPoint(c,u);return new se(g,g.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(c){return this.options.crs.getProjectedBounds(c===void 0?this.getZoom():c)},getPane:function(c){return typeof c=="string"?this._panes[c]:c},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(c,u){var g=this.options.crs;return u=u===void 0?this._zoom:u,g.scale(c)/g.scale(u)},getScaleZoom:function(c,u){var g=this.options.crs;u=u===void 0?this._zoom:u;var C=g.zoom(c*g.scale(u));return isNaN(C)?1/0:C},project:function(c,u){return u=u===void 0?this._zoom:u,this.options.crs.latLngToPoint(te(c),u)},unproject:function(c,u){return u=u===void 0?this._zoom:u,this.options.crs.pointToLatLng(U(c),u)},layerPointToLatLng:function(c){var u=U(c).add(this.getPixelOrigin());return this.unproject(u)},latLngToLayerPoint:function(c){var u=this.project(te(c))._round();return u._subtract(this.getPixelOrigin())},wrapLatLng:function(c){return this.options.crs.wrapLatLng(te(c))},wrapLatLngBounds:function(c){return this.options.crs.wrapLatLngBounds(oe(c))},distance:function(c,u){return this.options.crs.distance(te(c),te(u))},containerPointToLayerPoint:function(c){return U(c).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(c){return U(c).add(this._getMapPanePos())},containerPointToLatLng:function(c){var u=this.containerPointToLayerPoint(U(c));return this.layerPointToLatLng(u)},latLngToContainerPoint:function(c){return this.layerPointToContainerPoint(this.latLngToLayerPoint(te(c)))},mouseEventToContainerPoint:function(c){return Xi(c,this._container)},mouseEventToLayerPoint:function(c){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(c))},mouseEventToLatLng:function(c){return this.layerPointToLatLng(this.mouseEventToLayerPoint(c))},_initContainer:function(c){var u=this._container=Ui(c);if(u){if(u._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");ne(u,"scroll",this._onScroll,this),this._containerId=l(u)},_initLayout:function(){var c=this._container;this._fadeAnimated=this.options.fadeAnimation&&Q.any3d,re(c,"leaflet-container"+(Q.touch?" leaflet-touch":"")+(Q.retina?" leaflet-retina":"")+(Q.ielt9?" leaflet-oldie":"")+(Q.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var u=yt(c,"position");u!=="absolute"&&u!=="relative"&&u!=="fixed"&&u!=="sticky"&&(c.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var c=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ve(this._mapPane,new W(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(re(c.markerPane,"leaflet-zoom-hide"),re(c.shadowPane,"leaflet-zoom-hide"))},_resetView:function(c,u,g){ve(this._mapPane,new W(0,0));var C=!this._loaded;this._loaded=!0,u=this._limitZoom(u),this.fire("viewprereset");var w=this._zoom!==u;this._moveStart(w,g)._move(c,u)._moveEnd(w),this.fire("viewreset"),C&&this.fire("load")},_moveStart:function(c,u){return c&&this.fire("zoomstart"),u||this.fire("movestart"),this},_move:function(c,u,g,C){u===void 0&&(u=this._zoom);var w=this._zoom!==u;return this._zoom=u,this._lastCenter=c,this._pixelOrigin=this._getNewPixelOrigin(c),C?g&&g.pinch&&this.fire("zoom",g):((w||g&&g.pinch)&&this.fire("zoom",g),this.fire("move",g)),this},_moveEnd:function(c){return c&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return K(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(c){ve(this._mapPane,this._getMapPanePos().subtract(c))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(c){this._targets={},this._targets[l(this._container)]=this;var u=c?fe:ne;u(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&u(window,"resize",this._onResize,this),Q.any3d&&this.options.transform3DLimit&&(c?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){K(this._resizeRequest),this._resizeRequest=B(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var c=this._getMapPanePos();Math.max(Math.abs(c.x),Math.abs(c.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(c,u){for(var g=[],C,w=u==="mouseout"||u==="mouseover",P=c.target||c.srcElement,O=!1;P;){if(C=this._targets[l(P)],C&&(u==="click"||u==="preclick")&&this._draggableMoved(C)){O=!0;break}if(C&&C.listens(u,!0)&&(w&&!Ci(P,c)||(g.push(C),w))||P===this._container)break;P=P.parentNode}return!g.length&&!O&&!w&&this.listens(u,!0)&&(g=[this]),g},_isClickDisabled:function(c){for(;c&&c!==this._container;){if(c._leaflet_disable_click)return!0;c=c.parentNode}},_handleDOMEvent:function(c){var u=c.target||c.srcElement;if(!(!this._loaded||u._leaflet_disable_events||c.type==="click"&&this._isClickDisabled(u))){var g=c.type;g==="mousedown"&&di(u),this._fireDOMEvent(c,g)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(c,u,g){if(c.type==="click"){var C=n({},c);C.type="preclick",this._fireDOMEvent(C,C.type,g)}var w=this._findEventTargets(c,u);if(g){for(var P=[],O=0;O<g.length;O++)g[O].listens(u,!0)&&P.push(g[O]);w=P.concat(w)}if(w.length){u==="contextmenu"&&ye(c);var N=w[0],k={originalEvent:c};if(c.type!=="keypress"&&c.type!=="keydown"&&c.type!=="keyup"){var H=N.getLatLng&&(!N._radius||N._radius<=10);k.containerPoint=H?this.latLngToContainerPoint(N.getLatLng()):this.mouseEventToContainerPoint(c),k.layerPoint=this.containerPointToLayerPoint(k.containerPoint),k.latlng=H?N.getLatLng():this.layerPointToLatLng(k.layerPoint)}for(O=0;O<w.length;O++)if(w[O].fire(u,k,!0),k.originalEvent._stopped||w[O].options.bubblingMouseEvents===!1&&A(this._mouseEvents,u)!==-1)return}},_draggableMoved:function(c){return c=c.dragging&&c.dragging.enabled()?c:this,c.dragging&&c.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var c=0,u=this._handlers.length;c<u;c++)this._handlers[c].disable()},whenReady:function(c,u){return this._loaded?c.call(u||this,{target:this}):this.on("load",c,u),this},_getMapPanePos:function(){return je(this._mapPane)||new W(0,0)},_moved:function(){var c=this._getMapPanePos();return c&&!c.equals([0,0])},_getTopLeftPoint:function(c,u){var g=c&&u!==void 0?this._getNewPixelOrigin(c,u):this.getPixelOrigin();return g.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(c,u){var g=this.getSize()._divideBy(2);return this.project(c,u)._subtract(g)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(c,u,g){var C=this._getNewPixelOrigin(g,u);return this.project(c,u)._subtract(C)},_latLngBoundsToNewLayerBounds:function(c,u,g){var C=this._getNewPixelOrigin(g,u);return pe([this.project(c.getSouthWest(),u)._subtract(C),this.project(c.getNorthWest(),u)._subtract(C),this.project(c.getSouthEast(),u)._subtract(C),this.project(c.getNorthEast(),u)._subtract(C)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(c){return this.latLngToLayerPoint(c).subtract(this._getCenterLayerPoint())},_limitCenter:function(c,u,g){if(!g)return c;var C=this.project(c,u),w=this.getSize().divideBy(2),P=new se(C.subtract(w),C.add(w)),O=this._getBoundsOffset(P,g,u);return Math.abs(O.x)<=1&&Math.abs(O.y)<=1?c:this.unproject(C.add(O),u)},_limitOffset:function(c,u){if(!u)return c;var g=this.getPixelBounds(),C=new se(g.min.add(c),g.max.add(c));return c.add(this._getBoundsOffset(C,u))},_getBoundsOffset:function(c,u,g){var C=pe(this.project(u.getNorthEast(),g),this.project(u.getSouthWest(),g)),w=C.min.subtract(c.min),P=C.max.subtract(c.max),O=this._rebound(w.x,-P.x),N=this._rebound(w.y,-P.y);return new W(O,N)},_rebound:function(c,u){return c+u>0?Math.round(c-u)/2:Math.max(0,Math.ceil(c))-Math.max(0,Math.floor(u))},_limitZoom:function(c){var u=this.getMinZoom(),g=this.getMaxZoom(),C=Q.any3d?this.options.zoomSnap:1;return C&&(c=Math.round(c/C)*C),Math.max(u,Math.min(g,c))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){me(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(c,u){var g=this._getCenterOffset(c)._trunc();return(u&&u.animate)!==!0&&!this.getSize().contains(g)?!1:(this.panBy(g,u),!0)},_createAnimProxy:function(){var c=this._proxy=he("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(c),this.on("zoomanim",function(u){var g=ni,C=this._proxy.style[g];ze(this._proxy,this.project(u.center,u.zoom),this.getZoomScale(u.zoom,1)),C===this._proxy.style[g]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ge(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var c=this.getCenter(),u=this.getZoom();ze(this._proxy,this.project(c,u),this.getZoomScale(u,1))},_catchTransitionEnd:function(c){this._animatingZoom&&c.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(c,u,g){if(this._animatingZoom)return!0;if(g=g||{},!this._zoomAnimated||g.animate===!1||this._nothingToAnimate()||Math.abs(u-this._zoom)>this.options.zoomAnimationThreshold)return!1;var C=this.getZoomScale(u),w=this._getCenterOffset(c)._divideBy(1-1/C);return g.animate!==!0&&!this.getSize().contains(w)?!1:(B(function(){this._moveStart(!0,g.noMoveStart||!1)._animateZoom(c,u,!0)},this),!0)},_animateZoom:function(c,u,g,C){this._mapPane&&(g&&(this._animatingZoom=!0,this._animateToCenter=c,this._animateToZoom=u,re(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:c,zoom:u,noUpdate:C}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(r(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&me(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function ms(c,u){return new ue(c,u)}var Ae=Z.extend({options:{position:"topright"},initialize:function(c){b(this,c)},getPosition:function(){return this.options.position},setPosition:function(c){var u=this._map;return u&&u.removeControl(this),this.options.position=c,u&&u.addControl(this),this},getContainer:function(){return this._container},addTo:function(c){this.remove(),this._map=c;var u=this._container=this.onAdd(c),g=this.getPosition(),C=c._controlCorners[g];return re(u,"leaflet-control"),g.indexOf("bottom")!==-1?C.insertBefore(u,C.firstChild):C.appendChild(u),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ge(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(c){this._map&&c&&c.screenX>0&&c.screenY>0&&this._map.getContainer().focus()}}),Pt=function(c){return new Ae(c)};ue.include({addControl:function(c){return c.addTo(this),this},removeControl:function(c){return c.remove(),this},_initControlPos:function(){var c=this._controlCorners={},u="leaflet-",g=this._controlContainer=he("div",u+"control-container",this._container);function C(w,P){var O=u+w+" "+u+P;c[w+P]=he("div",O,g)}C("top","left"),C("top","right"),C("bottom","left"),C("bottom","right")},_clearControlPos:function(){for(var c in this._controlCorners)ge(this._controlCorners[c]);ge(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ji=Ae.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(c,u,g,C){return g<C?-1:C<g?1:0}},initialize:function(c,u,g){b(this,g),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var C in c)this._addLayer(c[C],C);for(C in u)this._addLayer(u[C],C,!0)},onAdd:function(c){this._initLayout(),this._update(),this._map=c,c.on("zoomend",this._checkDisabledLayers,this);for(var u=0;u<this._layers.length;u++)this._layers[u].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(c){return Ae.prototype.addTo.call(this,c),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var c=0;c<this._layers.length;c++)this._layers[c].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(c,u){return this._addLayer(c,u),this._map?this._update():this},addOverlay:function(c,u){return this._addLayer(c,u,!0),this._map?this._update():this},removeLayer:function(c){c.off("add remove",this._onLayerChange,this);var u=this._getLayer(l(c));return u&&this._layers.splice(this._layers.indexOf(u),1),this._map?this._update():this},expand:function(){re(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var c=this._map.getSize().y-(this._container.offsetTop+50);return c<this._section.clientHeight?(re(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=c+"px"):me(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return me(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var c="leaflet-control-layers",u=this._container=he("div",c),g=this.options.collapsed;u.setAttribute("aria-haspopup",!0),Et(u),mi(u);var C=this._section=he("section",c+"-list");g&&(this._map.on("click",this.collapse,this),ne(u,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var w=this._layersLink=he("a",c+"-toggle",u);w.href="#",w.title="Layers",w.setAttribute("role","button"),ne(w,{keydown:function(P){P.keyCode===13&&this._expandSafely()},click:function(P){ye(P),this._expandSafely()}},this),g||this.expand(),this._baseLayersList=he("div",c+"-base",C),this._separator=he("div",c+"-separator",C),this._overlaysList=he("div",c+"-overlays",C),u.appendChild(C)},_getLayer:function(c){for(var u=0;u<this._layers.length;u++)if(this._layers[u]&&l(this._layers[u].layer)===c)return this._layers[u]},_addLayer:function(c,u,g){this._map&&c.on("add remove",this._onLayerChange,this),this._layers.push({layer:c,name:u,overlay:g}),this.options.sortLayers&&this._layers.sort(r(function(C,w){return this.options.sortFunction(C.layer,w.layer,C.name,w.name)},this)),this.options.autoZIndex&&c.setZIndex&&(this._lastZIndex++,c.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Ft(this._baseLayersList),Ft(this._overlaysList),this._layerControlInputs=[];var c,u,g,C,w=0;for(g=0;g<this._layers.length;g++)C=this._layers[g],this._addItem(C),u=u||C.overlay,c=c||!C.overlay,w+=C.overlay?0:1;return this.options.hideSingleBase&&(c=c&&w>1,this._baseLayersList.style.display=c?"":"none"),this._separator.style.display=u&&c?"":"none",this},_onLayerChange:function(c){this._handlingClick||this._update();var u=this._getLayer(l(c.target)),g=u.overlay?c.type==="add"?"overlayadd":"overlayremove":c.type==="add"?"baselayerchange":null;g&&this._map.fire(g,u)},_createRadioElement:function(c,u){var g='<input type="radio" class="leaflet-control-layers-selector" name="'+c+'"'+(u?' checked="checked"':"")+"/>",C=document.createElement("div");return C.innerHTML=g,C.firstChild},_addItem:function(c){var u=document.createElement("label"),g=this._map.hasLayer(c.layer),C;c.overlay?(C=document.createElement("input"),C.type="checkbox",C.className="leaflet-control-layers-selector",C.defaultChecked=g):C=this._createRadioElement("leaflet-base-layers_"+l(this),g),this._layerControlInputs.push(C),C.layerId=l(c.layer),ne(C,"click",this._onInputClick,this);var w=document.createElement("span");w.innerHTML=" "+c.name;var P=document.createElement("span");u.appendChild(P),P.appendChild(C),P.appendChild(w);var O=c.overlay?this._overlaysList:this._baseLayersList;return O.appendChild(u),this._checkDisabledLayers(),u},_onInputClick:function(){if(!this._preventClick){var c=this._layerControlInputs,u,g,C=[],w=[];this._handlingClick=!0;for(var P=c.length-1;P>=0;P--)u=c[P],g=this._getLayer(u.layerId).layer,u.checked?C.push(g):u.checked||w.push(g);for(P=0;P<w.length;P++)this._map.hasLayer(w[P])&&this._map.removeLayer(w[P]);for(P=0;P<C.length;P++)this._map.hasLayer(C[P])||this._map.addLayer(C[P]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var c=this._layerControlInputs,u,g,C=this._map.getZoom(),w=c.length-1;w>=0;w--)u=c[w],g=this._getLayer(u.layerId).layer,u.disabled=g.options.minZoom!==void 0&&C<g.options.minZoom||g.options.maxZoom!==void 0&&C>g.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var c=this._section;this._preventClick=!0,ne(c,"click",ye),this.expand();var u=this;setTimeout(function(){fe(c,"click",ye),u._preventClick=!1})}}),vs=function(c,u,g){return new Ji(c,u,g)},_i=Ae.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(c){var u="leaflet-control-zoom",g=he("div",u+" leaflet-bar"),C=this.options;return this._zoomInButton=this._createButton(C.zoomInText,C.zoomInTitle,u+"-in",g,this._zoomIn),this._zoomOutButton=this._createButton(C.zoomOutText,C.zoomOutTitle,u+"-out",g,this._zoomOut),this._updateDisabled(),c.on("zoomend zoomlevelschange",this._updateDisabled,this),g},onRemove:function(c){c.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(c){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(c.shiftKey?3:1))},_zoomOut:function(c){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(c.shiftKey?3:1))},_createButton:function(c,u,g,C,w){var P=he("a",g,C);return P.innerHTML=c,P.href="#",P.title=u,P.setAttribute("role","button"),P.setAttribute("aria-label",u),Et(P),ne(P,"click",Ke),ne(P,"click",w,this),ne(P,"click",this._refocusOnMap,this),P},_updateDisabled:function(){var c=this._map,u="leaflet-disabled";me(this._zoomInButton,u),me(this._zoomOutButton,u),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||c._zoom===c.getMinZoom())&&(re(this._zoomOutButton,u),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||c._zoom===c.getMaxZoom())&&(re(this._zoomInButton,u),this._zoomInButton.setAttribute("aria-disabled","true"))}});ue.mergeOptions({zoomControl:!0}),ue.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new _i,this.addControl(this.zoomControl))});var Cs=function(c){return new _i(c)},en=Ae.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(c){var u="leaflet-control-scale",g=he("div",u),C=this.options;return this._addScales(C,u+"-line",g),c.on(C.updateWhenIdle?"moveend":"move",this._update,this),c.whenReady(this._update,this),g},onRemove:function(c){c.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(c,u,g){c.metric&&(this._mScale=he("div",u,g)),c.imperial&&(this._iScale=he("div",u,g))},_update:function(){var c=this._map,u=c.getSize().y/2,g=c.distance(c.containerPointToLatLng([0,u]),c.containerPointToLatLng([this.options.maxWidth,u]));this._updateScales(g)},_updateScales:function(c){this.options.metric&&c&&this._updateMetric(c),this.options.imperial&&c&&this._updateImperial(c)},_updateMetric:function(c){var u=this._getRoundNum(c),g=u<1e3?u+" m":u/1e3+" km";this._updateScale(this._mScale,g,u/c)},_updateImperial:function(c){var u=c*3.2808399,g,C,w;u>5280?(g=u/5280,C=this._getRoundNum(g),this._updateScale(this._iScale,C+" mi",C/g)):(w=this._getRoundNum(u),this._updateScale(this._iScale,w+" ft",w/u))},_updateScale:function(c,u,g){c.style.width=Math.round(this.options.maxWidth*g)+"px",c.innerHTML=u},_getRoundNum:function(c){var u=Math.pow(10,(Math.floor(c)+"").length-1),g=c/u;return g=g>=10?10:g>=5?5:g>=3?3:g>=2?2:1,u*g}}),_s=function(c){return new en(c)},ys='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',yi=Ae.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(Q.inlineSvg?ys+" ":"")+"Leaflet</a>"},initialize:function(c){b(this,c),this._attributions={}},onAdd:function(c){c.attributionControl=this,this._container=he("div","leaflet-control-attribution"),Et(this._container);for(var u in c._layers)c._layers[u].getAttribution&&this.addAttribution(c._layers[u].getAttribution());return this._update(),c.on("layeradd",this._addAttribution,this),this._container},onRemove:function(c){c.off("layeradd",this._addAttribution,this)},_addAttribution:function(c){c.layer.getAttribution&&(this.addAttribution(c.layer.getAttribution()),c.layer.once("remove",function(){this.removeAttribution(c.layer.getAttribution())},this))},setPrefix:function(c){return this.options.prefix=c,this._update(),this},addAttribution:function(c){return c?(this._attributions[c]||(this._attributions[c]=0),this._attributions[c]++,this._update(),this):this},removeAttribution:function(c){return c?(this._attributions[c]&&(this._attributions[c]--,this._update()),this):this},_update:function(){if(this._map){var c=[];for(var u in this._attributions)this._attributions[u]&&c.push(u);var g=[];this.options.prefix&&g.push(this.options.prefix),c.length&&g.push(c.join(", ")),this._container.innerHTML=g.join(' <span aria-hidden="true">|</span> ')}}});ue.mergeOptions({attributionControl:!0}),ue.addInitHook(function(){this.options.attributionControl&&new yi().addTo(this)});var bs=function(c){return new yi(c)};Ae.Layers=Ji,Ae.Zoom=_i,Ae.Scale=en,Ae.Attribution=yi,Pt.layers=vs,Pt.zoom=Cs,Pt.scale=_s,Pt.attribution=bs;var Le=Z.extend({initialize:function(c){this._map=c},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Le.addTo=function(c,u){return c.addHandler(u,this),this};var ws={Events:$},tn=Q.touch?"touchstart mousedown":"mousedown",Ve=Y.extend({options:{clickTolerance:3},initialize:function(c,u,g,C){b(this,C),this._element=c,this._dragStartTarget=u||c,this._preventOutline=g},enable:function(){this._enabled||(ne(this._dragStartTarget,tn,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ve._dragging===this&&this.finishDrag(!0),fe(this._dragStartTarget,tn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(c){if(this._enabled&&(this._moved=!1,!si(this._element,"leaflet-zoom-anim"))){if(c.touches&&c.touches.length!==1){Ve._dragging===this&&this.finishDrag();return}if(!(Ve._dragging||c.shiftKey||c.which!==1&&c.button!==1&&!c.touches)&&(Ve._dragging=this,this._preventOutline&&di(this._element),ai(),bt(),!this._moving)){this.fire("down");var u=c.touches?c.touches[0]:c,g=Ki(this._element);this._startPoint=new W(u.clientX,u.clientY),this._startPos=je(this._element),this._parentScale=ui(g);var C=c.type==="mousedown";ne(document,C?"mousemove":"touchmove",this._onMove,this),ne(document,C?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(c){if(this._enabled){if(c.touches&&c.touches.length>1){this._moved=!0;return}var u=c.touches&&c.touches.length===1?c.touches[0]:c,g=new W(u.clientX,u.clientY)._subtract(this._startPoint);!g.x&&!g.y||Math.abs(g.x)+Math.abs(g.y)<this.options.clickTolerance||(g.x/=this._parentScale.x,g.y/=this._parentScale.y,ye(c),this._moved||(this.fire("dragstart"),this._moved=!0,re(document.body,"leaflet-dragging"),this._lastTarget=c.target||c.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),re(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(g),this._moving=!0,this._lastEvent=c,this._updatePosition())}},_updatePosition:function(){var c={originalEvent:this._lastEvent};this.fire("predrag",c),ve(this._element,this._newPos),this.fire("drag",c)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(c){me(document.body,"leaflet-dragging"),this._lastTarget&&(me(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),fe(document,"mousemove touchmove",this._onMove,this),fe(document,"mouseup touchend touchcancel",this._onUp,this),li(),wt();var u=this._moved&&this._moving;this._moving=!1,Ve._dragging=!1,u&&this.fire("dragend",{noInertia:c,distance:this._newPos.distanceTo(this._startPos)})}});function sn(c,u,g){var C,w=[1,4,2,8],P,O,N,k,H,q,ee,le;for(P=0,q=c.length;P<q;P++)c[P]._code=Ye(c[P],u);for(N=0;N<4;N++){for(ee=w[N],C=[],P=0,q=c.length,O=q-1;P<q;O=P++)k=c[P],H=c[O],k._code&ee?H._code&ee||(le=Gt(H,k,ee,u,g),le._code=Ye(le,u),C.push(le)):(H._code&ee&&(le=Gt(H,k,ee,u,g),le._code=Ye(le,u),C.push(le)),C.push(k));c=C}return c}function rn(c,u){var g,C,w,P,O,N,k,H,q;if(!c||c.length===0)throw new Error("latlngs not passed");Te(c)||(console.warn("latlngs are not flat! Only the first ring will be used"),c=c[0]);var ee=te([0,0]),le=oe(c),we=le.getNorthWest().distanceTo(le.getSouthWest())*le.getNorthEast().distanceTo(le.getNorthWest());we<1700&&(ee=bi(c));var _e=c.length,Re=[];for(g=0;g<_e;g++){var Ee=te(c[g]);Re.push(u.project(te([Ee.lat-ee.lat,Ee.lng-ee.lng])))}for(N=k=H=0,g=0,C=_e-1;g<_e;C=g++)w=Re[g],P=Re[C],O=w.y*P.x-P.y*w.x,k+=(w.x+P.x)*O,H+=(w.y+P.y)*O,N+=O*3;N===0?q=Re[0]:q=[k/N,H/N];var ct=u.unproject(U(q));return te([ct.lat+ee.lat,ct.lng+ee.lng])}function bi(c){for(var u=0,g=0,C=0,w=0;w<c.length;w++){var P=te(c[w]);u+=P.lat,g+=P.lng,C++}return te([u/C,g/C])}var Ss={__proto__:null,clipPolygon:sn,polygonCenter:rn,centroid:bi};function an(c,u){if(!u||!c.length)return c.slice();var g=u*u;return c=Ts(c,g),c=Ps(c,g),c}function ln(c,u,g){return Math.sqrt(Tt(c,u,g,!0))}function Es(c,u,g){return Tt(c,u,g)}function Ps(c,u){var g=c.length,C=typeof Uint8Array!=void 0+""?Uint8Array:Array,w=new C(g);w[0]=w[g-1]=1,wi(c,w,u,0,g-1);var P,O=[];for(P=0;P<g;P++)w[P]&&O.push(c[P]);return O}function wi(c,u,g,C,w){var P=0,O,N,k;for(N=C+1;N<=w-1;N++)k=Tt(c[N],c[C],c[w],!0),k>P&&(O=N,P=k);P>g&&(u[O]=1,wi(c,u,g,C,O),wi(c,u,g,O,w))}function Ts(c,u){for(var g=[c[0]],C=1,w=0,P=c.length;C<P;C++)Rs(c[C],c[w])>u&&(g.push(c[C]),w=C);return w<P-1&&g.push(c[P-1]),g}var cn;function dn(c,u,g,C,w){var P=C?cn:Ye(c,g),O=Ye(u,g),N,k,H;for(cn=O;;){if(!(P|O))return[c,u];if(P&O)return!1;N=P||O,k=Gt(c,u,N,g,w),H=Ye(k,g),N===P?(c=k,P=H):(u=k,O=H)}}function Gt(c,u,g,C,w){var P=u.x-c.x,O=u.y-c.y,N=C.min,k=C.max,H,q;return g&8?(H=c.x+P*(k.y-c.y)/O,q=k.y):g&4?(H=c.x+P*(N.y-c.y)/O,q=N.y):g&2?(H=k.x,q=c.y+O*(k.x-c.x)/P):g&1&&(H=N.x,q=c.y+O*(N.x-c.x)/P),new W(H,q,w)}function Ye(c,u){var g=0;return c.x<u.min.x?g|=1:c.x>u.max.x&&(g|=2),c.y<u.min.y?g|=4:c.y>u.max.y&&(g|=8),g}function Rs(c,u){var g=u.x-c.x,C=u.y-c.y;return g*g+C*C}function Tt(c,u,g,C){var w=u.x,P=u.y,O=g.x-w,N=g.y-P,k=O*O+N*N,H;return k>0&&(H=((c.x-w)*O+(c.y-P)*N)/k,H>1?(w=g.x,P=g.y):H>0&&(w+=O*H,P+=N*H)),O=c.x-w,N=c.y-P,C?O*O+N*N:new W(w,P)}function Te(c){return!R(c[0])||typeof c[0][0]!="object"&&typeof c[0][0]<"u"}function un(c){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Te(c)}function hn(c,u){var g,C,w,P,O,N,k,H;if(!c||c.length===0)throw new Error("latlngs not passed");Te(c)||(console.warn("latlngs are not flat! Only the first ring will be used"),c=c[0]);var q=te([0,0]),ee=oe(c),le=ee.getNorthWest().distanceTo(ee.getSouthWest())*ee.getNorthEast().distanceTo(ee.getNorthWest());le<1700&&(q=bi(c));var we=c.length,_e=[];for(g=0;g<we;g++){var Re=te(c[g]);_e.push(u.project(te([Re.lat-q.lat,Re.lng-q.lng])))}for(g=0,C=0;g<we-1;g++)C+=_e[g].distanceTo(_e[g+1])/2;if(C===0)H=_e[0];else for(g=0,P=0;g<we-1;g++)if(O=_e[g],N=_e[g+1],w=O.distanceTo(N),P+=w,P>C){k=(P-C)/w,H=[N.x-k*(N.x-O.x),N.y-k*(N.y-O.y)];break}var Ee=u.unproject(U(H));return te([Ee.lat+q.lat,Ee.lng+q.lng])}var As={__proto__:null,simplify:an,pointToSegmentDistance:ln,closestPointOnSegment:Es,clipSegment:dn,_getEdgeIntersection:Gt,_getBitCode:Ye,_sqClosestPointOnSegment:Tt,isFlat:Te,_flat:un,polylineCenter:hn},Si={project:function(c){return new W(c.lng,c.lat)},unproject:function(c){return new ie(c.y,c.x)},bounds:new se([-180,-90],[180,90])},Ei={R:6378137,R_MINOR:6356752314245179e-9,bounds:new se([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(c){var u=Math.PI/180,g=this.R,C=c.lat*u,w=this.R_MINOR/g,P=Math.sqrt(1-w*w),O=P*Math.sin(C),N=Math.tan(Math.PI/4-C/2)/Math.pow((1-O)/(1+O),P/2);return C=-g*Math.log(Math.max(N,1e-10)),new W(c.lng*u*g,C)},unproject:function(c){for(var u=180/Math.PI,g=this.R,C=this.R_MINOR/g,w=Math.sqrt(1-C*C),P=Math.exp(-c.y/g),O=Math.PI/2-2*Math.atan(P),N=0,k=.1,H;N<15&&Math.abs(k)>1e-7;N++)H=w*Math.sin(O),H=Math.pow((1-H)/(1+H),w/2),k=Math.PI/2-2*Math.atan(P*H)-O,O+=k;return new ie(O*u,c.x*u/g)}},Ds={__proto__:null,LonLat:Si,Mercator:Ei,SphericalMercator:dt},Os=n({},be,{code:"EPSG:3395",projection:Ei,transformation:function(){var c=.5/(Math.PI*Ei.R);return Be(c,.5,-c,.5)}()}),pn=n({},be,{code:"EPSG:4326",projection:Si,transformation:Be(1/180,1,-1/180,.5)}),Ms=n({},Se,{projection:Si,transformation:Be(1,0,-1,0),scale:function(c){return Math.pow(2,c)},zoom:function(c){return Math.log(c)/Math.LN2},distance:function(c,u){var g=u.lng-c.lng,C=u.lat-c.lat;return Math.sqrt(g*g+C*C)},infinite:!0});Se.Earth=be,Se.EPSG3395=Os,Se.EPSG3857=Xe,Se.EPSG900913=Zt,Se.EPSG4326=pn,Se.Simple=Ms;var De=Y.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(c){return c.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(c){return c&&c.removeLayer(this),this},getPane:function(c){return this._map.getPane(c?this.options[c]||c:this.options.pane)},addInteractiveTarget:function(c){return this._map._targets[l(c)]=this,this},removeInteractiveTarget:function(c){return delete this._map._targets[l(c)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(c){var u=c.target;if(u.hasLayer(this)){if(this._map=u,this._zoomAnimated=u._zoomAnimated,this.getEvents){var g=this.getEvents();u.on(g,this),this.once("remove",function(){u.off(g,this)},this)}this.onAdd(u),this.fire("add"),u.fire("layeradd",{layer:this})}}});ue.include({addLayer:function(c){if(!c._layerAdd)throw new Error("The provided object is not a Layer.");var u=l(c);return this._layers[u]?this:(this._layers[u]=c,c._mapToAdd=this,c.beforeAdd&&c.beforeAdd(this),this.whenReady(c._layerAdd,c),this)},removeLayer:function(c){var u=l(c);return this._layers[u]?(this._loaded&&c.onRemove(this),delete this._layers[u],this._loaded&&(this.fire("layerremove",{layer:c}),c.fire("remove")),c._map=c._mapToAdd=null,this):this},hasLayer:function(c){return l(c)in this._layers},eachLayer:function(c,u){for(var g in this._layers)c.call(u,this._layers[g]);return this},_addLayers:function(c){c=c?R(c)?c:[c]:[];for(var u=0,g=c.length;u<g;u++)this.addLayer(c[u])},_addZoomLimit:function(c){(!isNaN(c.options.maxZoom)||!isNaN(c.options.minZoom))&&(this._zoomBoundLayers[l(c)]=c,this._updateZoomLevels())},_removeZoomLimit:function(c){var u=l(c);this._zoomBoundLayers[u]&&(delete this._zoomBoundLayers[u],this._updateZoomLevels())},_updateZoomLevels:function(){var c=1/0,u=-1/0,g=this._getZoomSpan();for(var C in this._zoomBoundLayers){var w=this._zoomBoundLayers[C].options;c=w.minZoom===void 0?c:Math.min(c,w.minZoom),u=w.maxZoom===void 0?u:Math.max(u,w.maxZoom)}this._layersMaxZoom=u===-1/0?void 0:u,this._layersMinZoom=c===1/0?void 0:c,g!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var st=De.extend({initialize:function(c,u){b(this,u),this._layers={};var g,C;if(c)for(g=0,C=c.length;g<C;g++)this.addLayer(c[g])},addLayer:function(c){var u=this.getLayerId(c);return this._layers[u]=c,this._map&&this._map.addLayer(c),this},removeLayer:function(c){var u=c in this._layers?c:this.getLayerId(c);return this._map&&this._layers[u]&&this._map.removeLayer(this._layers[u]),delete this._layers[u],this},hasLayer:function(c){var u=typeof c=="number"?c:this.getLayerId(c);return u in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(c){var u=Array.prototype.slice.call(arguments,1),g,C;for(g in this._layers)C=this._layers[g],C[c]&&C[c].apply(C,u);return this},onAdd:function(c){this.eachLayer(c.addLayer,c)},onRemove:function(c){this.eachLayer(c.removeLayer,c)},eachLayer:function(c,u){for(var g in this._layers)c.call(u,this._layers[g]);return this},getLayer:function(c){return this._layers[c]},getLayers:function(){var c=[];return this.eachLayer(c.push,c),c},setZIndex:function(c){return this.invoke("setZIndex",c)},getLayerId:function(c){return l(c)}}),xs=function(c,u){return new st(c,u)},Ie=st.extend({addLayer:function(c){return this.hasLayer(c)?this:(c.addEventParent(this),st.prototype.addLayer.call(this,c),this.fire("layeradd",{layer:c}))},removeLayer:function(c){return this.hasLayer(c)?(c in this._layers&&(c=this._layers[c]),c.removeEventParent(this),st.prototype.removeLayer.call(this,c),this.fire("layerremove",{layer:c})):this},setStyle:function(c){return this.invoke("setStyle",c)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var c=new ae;for(var u in this._layers){var g=this._layers[u];c.extend(g.getBounds?g.getBounds():g.getLatLng())}return c}}),Ls=function(c,u){return new Ie(c,u)},ot=Z.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(c){b(this,c)},createIcon:function(c){return this._createIcon("icon",c)},createShadow:function(c){return this._createIcon("shadow",c)},_createIcon:function(c,u){var g=this._getIconUrl(c);if(!g){if(c==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var C=this._createImg(g,u&&u.tagName==="IMG"?u:null);return this._setIconStyles(C,c),(this.options.crossOrigin||this.options.crossOrigin==="")&&(C.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),C},_setIconStyles:function(c,u){var g=this.options,C=g[u+"Size"];typeof C=="number"&&(C=[C,C]);var w=U(C),P=U(u==="shadow"&&g.shadowAnchor||g.iconAnchor||w&&w.divideBy(2,!0));c.className="leaflet-marker-"+u+" "+(g.className||""),P&&(c.style.marginLeft=-P.x+"px",c.style.marginTop=-P.y+"px"),w&&(c.style.width=w.x+"px",c.style.height=w.y+"px")},_createImg:function(c,u){return u=u||document.createElement("img"),u.src=c,u},_getIconUrl:function(c){return Q.retina&&this.options[c+"RetinaUrl"]||this.options[c+"Url"]}});function Fs(c){return new ot(c)}var Rt=ot.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(c){return typeof Rt.imagePath!="string"&&(Rt.imagePath=this._detectIconPath()),(this.options.imagePath||Rt.imagePath)+ot.prototype._getIconUrl.call(this,c)},_stripUrl:function(c){var u=function(g,C,w){var P=C.exec(g);return P&&P[w]};return c=u(c,/^url\((['"])?(.+)\1\)$/,2),c&&u(c,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var c=he("div","leaflet-default-icon-path",document.body),u=yt(c,"background-image")||yt(c,"backgroundImage");if(document.body.removeChild(c),u=this._stripUrl(u),u)return u;var g=document.querySelector('link[href$="leaflet.css"]');return g?g.href.substring(0,g.href.length-11-1):""}}),fn=Le.extend({initialize:function(c){this._marker=c},addHooks:function(){var c=this._marker._icon;this._draggable||(this._draggable=new Ve(c,c,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),re(c,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&me(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(c){var u=this._marker,g=u._map,C=this._marker.options.autoPanSpeed,w=this._marker.options.autoPanPadding,P=je(u._icon),O=g.getPixelBounds(),N=g.getPixelOrigin(),k=pe(O.min._subtract(N).add(w),O.max._subtract(N).subtract(w));if(!k.contains(P)){var H=U((Math.max(k.max.x,P.x)-k.max.x)/(O.max.x-k.max.x)-(Math.min(k.min.x,P.x)-k.min.x)/(O.min.x-k.min.x),(Math.max(k.max.y,P.y)-k.max.y)/(O.max.y-k.max.y)-(Math.min(k.min.y,P.y)-k.min.y)/(O.min.y-k.min.y)).multiplyBy(C);g.panBy(H,{animate:!1}),this._draggable._newPos._add(H),this._draggable._startPos._add(H),ve(u._icon,this._draggable._newPos),this._onDrag(c),this._panRequest=B(this._adjustPan.bind(this,c))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(c){this._marker.options.autoPan&&(K(this._panRequest),this._panRequest=B(this._adjustPan.bind(this,c)))},_onDrag:function(c){var u=this._marker,g=u._shadow,C=je(u._icon),w=u._map.layerPointToLatLng(C);g&&ve(g,C),u._latlng=w,c.latlng=w,c.oldLatLng=this._oldLatLng,u.fire("move",c).fire("drag",c)},_onDragEnd:function(c){K(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",c)}}),Vt=De.extend({options:{icon:new Rt,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(c,u){b(this,u),this._latlng=te(c)},onAdd:function(c){this._zoomAnimated=this._zoomAnimated&&c.options.markerZoomAnimation,this._zoomAnimated&&c.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(c){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&c.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(c){var u=this._latlng;return this._latlng=te(c),this.update(),this.fire("move",{oldLatLng:u,latlng:this._latlng})},setZIndexOffset:function(c){return this.options.zIndexOffset=c,this.update()},getIcon:function(){return this.options.icon},setIcon:function(c){return this.options.icon=c,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var c=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(c)}return this},_initIcon:function(){var c=this.options,u="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),g=c.icon.createIcon(this._icon),C=!1;g!==this._icon&&(this._icon&&this._removeIcon(),C=!0,c.title&&(g.title=c.title),g.tagName==="IMG"&&(g.alt=c.alt||"")),re(g,u),c.keyboard&&(g.tabIndex="0",g.setAttribute("role","button")),this._icon=g,c.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&ne(g,"focus",this._panOnFocus,this);var w=c.icon.createShadow(this._shadow),P=!1;w!==this._shadow&&(this._removeShadow(),P=!0),w&&(re(w,u),w.alt=""),this._shadow=w,c.opacity<1&&this._updateOpacity(),C&&this.getPane().appendChild(this._icon),this._initInteraction(),w&&P&&this.getPane(c.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&fe(this._icon,"focus",this._panOnFocus,this),ge(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ge(this._shadow),this._shadow=null},_setPos:function(c){this._icon&&ve(this._icon,c),this._shadow&&ve(this._shadow,c),this._zIndex=c.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(c){this._icon&&(this._icon.style.zIndex=this._zIndex+c)},_animateZoom:function(c){var u=this._map._latLngToNewLayerPoint(this._latlng,c.zoom,c.center).round();this._setPos(u)},_initInteraction:function(){if(this.options.interactive&&(re(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),fn)){var c=this.options.draggable;this.dragging&&(c=this.dragging.enabled(),this.dragging.disable()),this.dragging=new fn(this),c&&this.dragging.enable()}},setOpacity:function(c){return this.options.opacity=c,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var c=this.options.opacity;this._icon&&Pe(this._icon,c),this._shadow&&Pe(this._shadow,c)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var c=this._map;if(c){var u=this.options.icon.options,g=u.iconSize?U(u.iconSize):U(0,0),C=u.iconAnchor?U(u.iconAnchor):U(0,0);c.panInside(this._latlng,{paddingTopLeft:C,paddingBottomRight:g.subtract(C)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Is(c,u){return new Vt(c,u)}var He=De.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(c){this._renderer=c.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(c){return b(this,c),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&c&&Object.prototype.hasOwnProperty.call(c,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Ht=He.extend({options:{fill:!0,radius:10},initialize:function(c,u){b(this,u),this._latlng=te(c),this._radius=this.options.radius},setLatLng:function(c){var u=this._latlng;return this._latlng=te(c),this.redraw(),this.fire("move",{oldLatLng:u,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(c){return this.options.radius=this._radius=c,this.redraw()},getRadius:function(){return this._radius},setStyle:function(c){var u=c&&c.radius||this._radius;return He.prototype.setStyle.call(this,c),this.setRadius(u),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var c=this._radius,u=this._radiusY||c,g=this._clickTolerance(),C=[c+g,u+g];this._pxBounds=new se(this._point.subtract(C),this._point.add(C))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(c){return c.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function Ns(c,u){return new Ht(c,u)}var Pi=Ht.extend({initialize:function(c,u,g){if(typeof u=="number"&&(u=n({},g,{radius:u})),b(this,u),this._latlng=te(c),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(c){return this._mRadius=c,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var c=[this._radius,this._radiusY||this._radius];return new ae(this._map.layerPointToLatLng(this._point.subtract(c)),this._map.layerPointToLatLng(this._point.add(c)))},setStyle:He.prototype.setStyle,_project:function(){var c=this._latlng.lng,u=this._latlng.lat,g=this._map,C=g.options.crs;if(C.distance===be.distance){var w=Math.PI/180,P=this._mRadius/be.R/w,O=g.project([u+P,c]),N=g.project([u-P,c]),k=O.add(N).divideBy(2),H=g.unproject(k).lat,q=Math.acos((Math.cos(P*w)-Math.sin(u*w)*Math.sin(H*w))/(Math.cos(u*w)*Math.cos(H*w)))/w;(isNaN(q)||q===0)&&(q=P/Math.cos(Math.PI/180*u)),this._point=k.subtract(g.getPixelOrigin()),this._radius=isNaN(q)?0:k.x-g.project([H,c-q]).x,this._radiusY=k.y-O.y}else{var ee=C.unproject(C.project(this._latlng).subtract([this._mRadius,0]));this._point=g.latLngToLayerPoint(this._latlng),this._radius=this._point.x-g.latLngToLayerPoint(ee).x}this._updateBounds()}});function $s(c,u,g){return new Pi(c,u,g)}var Ne=He.extend({options:{smoothFactor:1,noClip:!1},initialize:function(c,u){b(this,u),this._setLatLngs(c)},getLatLngs:function(){return this._latlngs},setLatLngs:function(c){return this._setLatLngs(c),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(c){for(var u=1/0,g=null,C=Tt,w,P,O=0,N=this._parts.length;O<N;O++)for(var k=this._parts[O],H=1,q=k.length;H<q;H++){w=k[H-1],P=k[H];var ee=C(c,w,P,!0);ee<u&&(u=ee,g=C(c,w,P))}return g&&(g.distance=Math.sqrt(u)),g},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return hn(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(c,u){return u=u||this._defaultShape(),c=te(c),u.push(c),this._bounds.extend(c),this.redraw()},_setLatLngs:function(c){this._bounds=new ae,this._latlngs=this._convertLatLngs(c)},_defaultShape:function(){return Te(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(c){for(var u=[],g=Te(c),C=0,w=c.length;C<w;C++)g?(u[C]=te(c[C]),this._bounds.extend(u[C])):u[C]=this._convertLatLngs(c[C]);return u},_project:function(){var c=new se;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,c),this._bounds.isValid()&&c.isValid()&&(this._rawPxBounds=c,this._updateBounds())},_updateBounds:function(){var c=this._clickTolerance(),u=new W(c,c);this._rawPxBounds&&(this._pxBounds=new se([this._rawPxBounds.min.subtract(u),this._rawPxBounds.max.add(u)]))},_projectLatlngs:function(c,u,g){var C=c[0]instanceof ie,w=c.length,P,O;if(C){for(O=[],P=0;P<w;P++)O[P]=this._map.latLngToLayerPoint(c[P]),g.extend(O[P]);u.push(O)}else for(P=0;P<w;P++)this._projectLatlngs(c[P],u,g)},_clipPoints:function(){var c=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(c))){if(this.options.noClip){this._parts=this._rings;return}var u=this._parts,g,C,w,P,O,N,k;for(g=0,w=0,P=this._rings.length;g<P;g++)for(k=this._rings[g],C=0,O=k.length;C<O-1;C++)N=dn(k[C],k[C+1],c,C,!0),N&&(u[w]=u[w]||[],u[w].push(N[0]),(N[1]!==k[C+1]||C===O-2)&&(u[w].push(N[1]),w++))}},_simplifyPoints:function(){for(var c=this._parts,u=this.options.smoothFactor,g=0,C=c.length;g<C;g++)c[g]=an(c[g],u)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(c,u){var g,C,w,P,O,N,k=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(c))return!1;for(g=0,P=this._parts.length;g<P;g++)for(N=this._parts[g],C=0,O=N.length,w=O-1;C<O;w=C++)if(!(!u&&C===0)&&ln(c,N[w],N[C])<=k)return!0;return!1}});function ks(c,u){return new Ne(c,u)}Ne._flat=un;var rt=Ne.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return rn(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(c){var u=Ne.prototype._convertLatLngs.call(this,c),g=u.length;return g>=2&&u[0]instanceof ie&&u[0].equals(u[g-1])&&u.pop(),u},_setLatLngs:function(c){Ne.prototype._setLatLngs.call(this,c),Te(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Te(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var c=this._renderer._bounds,u=this.options.weight,g=new W(u,u);if(c=new se(c.min.subtract(g),c.max.add(g)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(c))){if(this.options.noClip){this._parts=this._rings;return}for(var C=0,w=this._rings.length,P;C<w;C++)P=sn(this._rings[C],c,!0),P.length&&this._parts.push(P)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(c){var u=!1,g,C,w,P,O,N,k,H;if(!this._pxBounds||!this._pxBounds.contains(c))return!1;for(P=0,k=this._parts.length;P<k;P++)for(g=this._parts[P],O=0,H=g.length,N=H-1;O<H;N=O++)C=g[O],w=g[N],C.y>c.y!=w.y>c.y&&c.x<(w.x-C.x)*(c.y-C.y)/(w.y-C.y)+C.x&&(u=!u);return u||Ne.prototype._containsPoint.call(this,c,!0)}});function Gs(c,u){return new rt(c,u)}var $e=Ie.extend({initialize:function(c,u){b(this,u),this._layers={},c&&this.addData(c)},addData:function(c){var u=R(c)?c:c.features,g,C,w;if(u){for(g=0,C=u.length;g<C;g++)w=u[g],(w.geometries||w.geometry||w.features||w.coordinates)&&this.addData(w);return this}var P=this.options;if(P.filter&&!P.filter(c))return this;var O=Wt(c,P);return O?(O.feature=jt(c),O.defaultOptions=O.options,this.resetStyle(O),P.onEachFeature&&P.onEachFeature(c,O),this.addLayer(O)):this},resetStyle:function(c){return c===void 0?this.eachLayer(this.resetStyle,this):(c.options=n({},c.defaultOptions),this._setLayerStyle(c,this.options.style),this)},setStyle:function(c){return this.eachLayer(function(u){this._setLayerStyle(u,c)},this)},_setLayerStyle:function(c,u){c.setStyle&&(typeof u=="function"&&(u=u(c.feature)),c.setStyle(u))}});function Wt(c,u){var g=c.type==="Feature"?c.geometry:c,C=g?g.coordinates:null,w=[],P=u&&u.pointToLayer,O=u&&u.coordsToLatLng||Ti,N,k,H,q;if(!C&&!g)return null;switch(g.type){case"Point":return N=O(C),gn(P,c,N,u);case"MultiPoint":for(H=0,q=C.length;H<q;H++)N=O(C[H]),w.push(gn(P,c,N,u));return new Ie(w);case"LineString":case"MultiLineString":return k=Bt(C,g.type==="LineString"?0:1,O),new Ne(k,u);case"Polygon":case"MultiPolygon":return k=Bt(C,g.type==="Polygon"?1:2,O),new rt(k,u);case"GeometryCollection":for(H=0,q=g.geometries.length;H<q;H++){var ee=Wt({geometry:g.geometries[H],type:"Feature",properties:c.properties},u);ee&&w.push(ee)}return new Ie(w);case"FeatureCollection":for(H=0,q=g.features.length;H<q;H++){var le=Wt(g.features[H],u);le&&w.push(le)}return new Ie(w);default:throw new Error("Invalid GeoJSON object.")}}function gn(c,u,g,C){return c?c(u,g):new Vt(g,C&&C.markersInheritOptions&&C)}function Ti(c){return new ie(c[1],c[0],c[2])}function Bt(c,u,g){for(var C=[],w=0,P=c.length,O;w<P;w++)O=u?Bt(c[w],u-1,g):(g||Ti)(c[w]),C.push(O);return C}function Ri(c,u){return c=te(c),c.alt!==void 0?[m(c.lng,u),m(c.lat,u),m(c.alt,u)]:[m(c.lng,u),m(c.lat,u)]}function zt(c,u,g,C){for(var w=[],P=0,O=c.length;P<O;P++)w.push(u?zt(c[P],Te(c[P])?0:u-1,g,C):Ri(c[P],C));return!u&&g&&w.length>0&&w.push(w[0].slice()),w}function at(c,u){return c.feature?n({},c.feature,{geometry:u}):jt(u)}function jt(c){return c.type==="Feature"||c.type==="FeatureCollection"?c:{type:"Feature",properties:{},geometry:c}}var Ai={toGeoJSON:function(c){return at(this,{type:"Point",coordinates:Ri(this.getLatLng(),c)})}};Vt.include(Ai),Pi.include(Ai),Ht.include(Ai),Ne.include({toGeoJSON:function(c){var u=!Te(this._latlngs),g=zt(this._latlngs,u?1:0,!1,c);return at(this,{type:(u?"Multi":"")+"LineString",coordinates:g})}}),rt.include({toGeoJSON:function(c){var u=!Te(this._latlngs),g=u&&!Te(this._latlngs[0]),C=zt(this._latlngs,g?2:u?1:0,!0,c);return u||(C=[C]),at(this,{type:(g?"Multi":"")+"Polygon",coordinates:C})}}),st.include({toMultiPoint:function(c){var u=[];return this.eachLayer(function(g){u.push(g.toGeoJSON(c).geometry.coordinates)}),at(this,{type:"MultiPoint",coordinates:u})},toGeoJSON:function(c){var u=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(u==="MultiPoint")return this.toMultiPoint(c);var g=u==="GeometryCollection",C=[];return this.eachLayer(function(w){if(w.toGeoJSON){var P=w.toGeoJSON(c);if(g)C.push(P.geometry);else{var O=jt(P);O.type==="FeatureCollection"?C.push.apply(C,O.features):C.push(O)}}}),g?at(this,{geometries:C,type:"GeometryCollection"}):{type:"FeatureCollection",features:C}}});function mn(c,u){return new $e(c,u)}var Vs=mn,Ut=De.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(c,u,g){this._url=c,this._bounds=oe(u),b(this,g)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(re(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ge(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(c){return this.options.opacity=c,this._image&&this._updateOpacity(),this},setStyle:function(c){return c.opacity&&this.setOpacity(c.opacity),this},bringToFront:function(){return this._map&&tt(this._image),this},bringToBack:function(){return this._map&&nt(this._image),this},setUrl:function(c){return this._url=c,this._image&&(this._image.src=c),this},setBounds:function(c){return this._bounds=oe(c),this._map&&this._reset(),this},getEvents:function(){var c={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(c.zoomanim=this._animateZoom),c},setZIndex:function(c){return this.options.zIndex=c,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var c=this._url.tagName==="IMG",u=this._image=c?this._url:he("img");if(re(u,"leaflet-image-layer"),this._zoomAnimated&&re(u,"leaflet-zoom-animated"),this.options.className&&re(u,this.options.className),u.onselectstart=p,u.onmousemove=p,u.onload=r(this.fire,this,"load"),u.onerror=r(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(u.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),c){this._url=u.src;return}u.src=this._url,u.alt=this.options.alt},_animateZoom:function(c){var u=this._map.getZoomScale(c.zoom),g=this._map._latLngBoundsToNewLayerBounds(this._bounds,c.zoom,c.center).min;ze(this._image,g,u)},_reset:function(){var c=this._image,u=new se(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),g=u.getSize();ve(c,u.min),c.style.width=g.x+"px",c.style.height=g.y+"px"},_updateOpacity:function(){Pe(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var c=this.options.errorOverlayUrl;c&&this._url!==c&&(this._url=c,this._image.src=c)},getCenter:function(){return this._bounds.getCenter()}}),Hs=function(c,u,g){return new Ut(c,u,g)},vn=Ut.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var c=this._url.tagName==="VIDEO",u=this._image=c?this._url:he("video");if(re(u,"leaflet-image-layer"),this._zoomAnimated&&re(u,"leaflet-zoom-animated"),this.options.className&&re(u,this.options.className),u.onselectstart=p,u.onmousemove=p,u.onloadeddata=r(this.fire,this,"load"),c){for(var g=u.getElementsByTagName("source"),C=[],w=0;w<g.length;w++)C.push(g[w].src);this._url=g.length>0?C:[u.src];return}R(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(u.style,"objectFit")&&(u.style.objectFit="fill"),u.autoplay=!!this.options.autoplay,u.loop=!!this.options.loop,u.muted=!!this.options.muted,u.playsInline=!!this.options.playsInline;for(var P=0;P<this._url.length;P++){var O=he("source");O.src=this._url[P],u.appendChild(O)}}});function Ws(c,u,g){return new vn(c,u,g)}var Cn=Ut.extend({_initImage:function(){var c=this._image=this._url;re(c,"leaflet-image-layer"),this._zoomAnimated&&re(c,"leaflet-zoom-animated"),this.options.className&&re(c,this.options.className),c.onselectstart=p,c.onmousemove=p}});function Bs(c,u,g){return new Cn(c,u,g)}var Fe=De.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(c,u){c&&(c instanceof ie||R(c))?(this._latlng=te(c),b(this,u)):(b(this,c),this._source=u),this.options.content&&(this._content=this.options.content)},openOn:function(c){return c=arguments.length?c:this._source._map,c.hasLayer(this)||c.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(c){return this._map?this.close():(arguments.length?this._source=c:c=this._source,this._prepareOpen(),this.openOn(c._map)),this},onAdd:function(c){this._zoomAnimated=c._zoomAnimated,this._container||this._initLayout(),c._fadeAnimated&&Pe(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),c._fadeAnimated&&Pe(this._container,1),this.bringToFront(),this.options.interactive&&(re(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(c){c._fadeAnimated?(Pe(this._container,0),this._removeTimeout=setTimeout(r(ge,void 0,this._container),200)):ge(this._container),this.options.interactive&&(me(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(c){return this._latlng=te(c),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(c){return this._content=c,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var c={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(c.zoomanim=this._animateZoom),c},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&tt(this._container),this},bringToBack:function(){return this._map&&nt(this._container),this},_prepareOpen:function(c){var u=this._source;if(!u._map)return!1;if(u instanceof Ie){u=null;var g=this._source._layers;for(var C in g)if(g[C]._map){u=g[C];break}if(!u)return!1;this._source=u}if(!c)if(u.getCenter)c=u.getCenter();else if(u.getLatLng)c=u.getLatLng();else if(u.getBounds)c=u.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(c),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var c=this._contentNode,u=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof u=="string")c.innerHTML=u;else{for(;c.hasChildNodes();)c.removeChild(c.firstChild);c.appendChild(u)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var c=this._map.latLngToLayerPoint(this._latlng),u=U(this.options.offset),g=this._getAnchor();this._zoomAnimated?ve(this._container,c.add(g)):u=u.add(c).add(g);var C=this._containerBottom=-u.y,w=this._containerLeft=-Math.round(this._containerWidth/2)+u.x;this._container.style.bottom=C+"px",this._container.style.left=w+"px"}},_getAnchor:function(){return[0,0]}});ue.include({_initOverlay:function(c,u,g,C){var w=u;return w instanceof c||(w=new c(C).setContent(u)),g&&w.setLatLng(g),w}}),De.include({_initOverlay:function(c,u,g,C){var w=g;return w instanceof c?(b(w,C),w._source=this):(w=u&&!C?u:new c(C,this),w.setContent(g)),w}});var Kt=Fe.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(c){return c=arguments.length?c:this._source._map,!c.hasLayer(this)&&c._popup&&c._popup.options.autoClose&&c.removeLayer(c._popup),c._popup=this,Fe.prototype.openOn.call(this,c)},onAdd:function(c){Fe.prototype.onAdd.call(this,c),c.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof He||this._source.on("preclick",Ue))},onRemove:function(c){Fe.prototype.onRemove.call(this,c),c.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof He||this._source.off("preclick",Ue))},getEvents:function(){var c=Fe.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(c.preclick=this.close),this.options.keepInView&&(c.moveend=this._adjustPan),c},_initLayout:function(){var c="leaflet-popup",u=this._container=he("div",c+" "+(this.options.className||"")+" leaflet-zoom-animated"),g=this._wrapper=he("div",c+"-content-wrapper",u);if(this._contentNode=he("div",c+"-content",g),Et(u),mi(this._contentNode),ne(u,"contextmenu",Ue),this._tipContainer=he("div",c+"-tip-container",u),this._tip=he("div",c+"-tip",this._tipContainer),this.options.closeButton){var C=this._closeButton=he("a",c+"-close-button",u);C.setAttribute("role","button"),C.setAttribute("aria-label","Close popup"),C.href="#close",C.innerHTML='<span aria-hidden="true">×</span>',ne(C,"click",function(w){ye(w),this.close()},this)}},_updateLayout:function(){var c=this._contentNode,u=c.style;u.width="",u.whiteSpace="nowrap";var g=c.offsetWidth;g=Math.min(g,this.options.maxWidth),g=Math.max(g,this.options.minWidth),u.width=g+1+"px",u.whiteSpace="",u.height="";var C=c.offsetHeight,w=this.options.maxHeight,P="leaflet-popup-scrolled";w&&C>w?(u.height=w+"px",re(c,P)):me(c,P),this._containerWidth=this._container.offsetWidth},_animateZoom:function(c){var u=this._map._latLngToNewLayerPoint(this._latlng,c.zoom,c.center),g=this._getAnchor();ve(this._container,u.add(g))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var c=this._map,u=parseInt(yt(this._container,"marginBottom"),10)||0,g=this._container.offsetHeight+u,C=this._containerWidth,w=new W(this._containerLeft,-g-this._containerBottom);w._add(je(this._container));var P=c.layerPointToContainerPoint(w),O=U(this.options.autoPanPadding),N=U(this.options.autoPanPaddingTopLeft||O),k=U(this.options.autoPanPaddingBottomRight||O),H=c.getSize(),q=0,ee=0;P.x+C+k.x>H.x&&(q=P.x+C-H.x+k.x),P.x-q-N.x<0&&(q=P.x-N.x),P.y+g+k.y>H.y&&(ee=P.y+g-H.y+k.y),P.y-ee-N.y<0&&(ee=P.y-N.y),(q||ee)&&(this.options.keepInView&&(this._autopanning=!0),c.fire("autopanstart").panBy([q,ee]))}},_getAnchor:function(){return U(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),zs=function(c,u){return new Kt(c,u)};ue.mergeOptions({closePopupOnClick:!0}),ue.include({openPopup:function(c,u,g){return this._initOverlay(Kt,c,u,g).openOn(this),this},closePopup:function(c){return c=arguments.length?c:this._popup,c&&c.close(),this}}),De.include({bindPopup:function(c,u){return this._popup=this._initOverlay(Kt,this._popup,c,u),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(c){return this._popup&&(this instanceof Ie||(this._popup._source=this),this._popup._prepareOpen(c||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(c){return this._popup&&this._popup.setContent(c),this},getPopup:function(){return this._popup},_openPopup:function(c){if(!(!this._popup||!this._map)){Ke(c);var u=c.layer||c.target;if(this._popup._source===u&&!(u instanceof He)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(c.latlng);return}this._popup._source=u,this.openPopup(c.latlng)}},_movePopup:function(c){this._popup.setLatLng(c.latlng)},_onKeyPress:function(c){c.originalEvent.keyCode===13&&this._openPopup(c)}});var Yt=Fe.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(c){Fe.prototype.onAdd.call(this,c),this.setOpacity(this.options.opacity),c.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(c){Fe.prototype.onRemove.call(this,c),c.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var c=Fe.prototype.getEvents.call(this);return this.options.permanent||(c.preclick=this.close),c},_initLayout:function(){var c="leaflet-tooltip",u=c+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=he("div",u),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(c){var u,g,C=this._map,w=this._container,P=C.latLngToContainerPoint(C.getCenter()),O=C.layerPointToContainerPoint(c),N=this.options.direction,k=w.offsetWidth,H=w.offsetHeight,q=U(this.options.offset),ee=this._getAnchor();N==="top"?(u=k/2,g=H):N==="bottom"?(u=k/2,g=0):N==="center"?(u=k/2,g=H/2):N==="right"?(u=0,g=H/2):N==="left"?(u=k,g=H/2):O.x<P.x?(N="right",u=0,g=H/2):(N="left",u=k+(q.x+ee.x)*2,g=H/2),c=c.subtract(U(u,g,!0)).add(q).add(ee),me(w,"leaflet-tooltip-right"),me(w,"leaflet-tooltip-left"),me(w,"leaflet-tooltip-top"),me(w,"leaflet-tooltip-bottom"),re(w,"leaflet-tooltip-"+N),ve(w,c)},_updatePosition:function(){var c=this._map.latLngToLayerPoint(this._latlng);this._setPosition(c)},setOpacity:function(c){this.options.opacity=c,this._container&&Pe(this._container,c)},_animateZoom:function(c){var u=this._map._latLngToNewLayerPoint(this._latlng,c.zoom,c.center);this._setPosition(u)},_getAnchor:function(){return U(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),js=function(c,u){return new Yt(c,u)};ue.include({openTooltip:function(c,u,g){return this._initOverlay(Yt,c,u,g).openOn(this),this},closeTooltip:function(c){return c.close(),this}}),De.include({bindTooltip:function(c,u){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Yt,this._tooltip,c,u),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(c){if(!(!c&&this._tooltipHandlersAdded)){var u=c?"off":"on",g={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?g.add=this._openTooltip:(g.mouseover=this._openTooltip,g.mouseout=this.closeTooltip,g.click=this._openTooltip,this._map?this._addFocusListeners():g.add=this._addFocusListeners),this._tooltip.options.sticky&&(g.mousemove=this._moveTooltip),this[u](g),this._tooltipHandlersAdded=!c}},openTooltip:function(c){return this._tooltip&&(this instanceof Ie||(this._tooltip._source=this),this._tooltip._prepareOpen(c)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(c){return this._tooltip&&this._tooltip.setContent(c),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(c){var u=typeof c.getElement=="function"&&c.getElement();u&&(ne(u,"focus",function(){this._tooltip._source=c,this.openTooltip()},this),ne(u,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(c){var u=typeof c.getElement=="function"&&c.getElement();u&&u.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(c){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var u=this;this._map.once("moveend",function(){u._openOnceFlag=!1,u._openTooltip(c)});return}this._tooltip._source=c.layer||c.target,this.openTooltip(this._tooltip.options.sticky?c.latlng:void 0)}},_moveTooltip:function(c){var u=c.latlng,g,C;this._tooltip.options.sticky&&c.originalEvent&&(g=this._map.mouseEventToContainerPoint(c.originalEvent),C=this._map.containerPointToLayerPoint(g),u=this._map.layerPointToLatLng(C)),this._tooltip.setLatLng(u)}});var _n=ot.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(c){var u=c&&c.tagName==="DIV"?c:document.createElement("div"),g=this.options;if(g.html instanceof Element?(Ft(u),u.appendChild(g.html)):u.innerHTML=g.html!==!1?g.html:"",g.bgPos){var C=U(g.bgPos);u.style.backgroundPosition=-C.x+"px "+-C.y+"px"}return this._setIconStyles(u,"icon"),u},createShadow:function(){return null}});function Us(c){return new _n(c)}ot.Default=Rt;var At=De.extend({options:{tileSize:256,opacity:1,updateWhenIdle:Q.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(c){b(this,c)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(c){c._addZoomLimit(this)},onRemove:function(c){this._removeAllTiles(),ge(this._container),c._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(tt(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(nt(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(c){return this.options.opacity=c,this._updateOpacity(),this},setZIndex:function(c){return this.options.zIndex=c,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var c=this._clampZoom(this._map.getZoom());c!==this._tileZoom&&(this._tileZoom=c,this._updateLevels()),this._update()}return this},getEvents:function(){var c={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),c.move=this._onMove),this._zoomAnimated&&(c.zoomanim=this._animateZoom),c},createTile:function(){return document.createElement("div")},getTileSize:function(){var c=this.options.tileSize;return c instanceof W?c:new W(c,c)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(c){for(var u=this.getPane().children,g=-c(-1/0,1/0),C=0,w=u.length,P;C<w;C++)P=u[C].style.zIndex,u[C]!==this._container&&P&&(g=c(g,+P));isFinite(g)&&(this.options.zIndex=g+c(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!Q.ielt9){Pe(this._container,this.options.opacity);var c=+new Date,u=!1,g=!1;for(var C in this._tiles){var w=this._tiles[C];if(!(!w.current||!w.loaded)){var P=Math.min(1,(c-w.loaded)/200);Pe(w.el,P),P<1?u=!0:(w.active?g=!0:this._onOpaqueTile(w),w.active=!0)}}g&&!this._noPrune&&this._pruneTiles(),u&&(K(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this))}},_onOpaqueTile:p,_initContainer:function(){this._container||(this._container=he("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var c=this._tileZoom,u=this.options.maxZoom;if(c!==void 0){for(var g in this._levels)g=Number(g),this._levels[g].el.children.length||g===c?(this._levels[g].el.style.zIndex=u-Math.abs(c-g),this._onUpdateLevel(g)):(ge(this._levels[g].el),this._removeTilesAtZoom(g),this._onRemoveLevel(g),delete this._levels[g]);var C=this._levels[c],w=this._map;return C||(C=this._levels[c]={},C.el=he("div","leaflet-tile-container leaflet-zoom-animated",this._container),C.el.style.zIndex=u,C.origin=w.project(w.unproject(w.getPixelOrigin()),c).round(),C.zoom=c,this._setZoomTransform(C,w.getCenter(),w.getZoom()),p(C.el.offsetWidth),this._onCreateLevel(C)),this._level=C,C}},_onUpdateLevel:p,_onRemoveLevel:p,_onCreateLevel:p,_pruneTiles:function(){if(this._map){var c,u,g=this._map.getZoom();if(g>this.options.maxZoom||g<this.options.minZoom){this._removeAllTiles();return}for(c in this._tiles)u=this._tiles[c],u.retain=u.current;for(c in this._tiles)if(u=this._tiles[c],u.current&&!u.active){var C=u.coords;this._retainParent(C.x,C.y,C.z,C.z-5)||this._retainChildren(C.x,C.y,C.z,C.z+2)}for(c in this._tiles)this._tiles[c].retain||this._removeTile(c)}},_removeTilesAtZoom:function(c){for(var u in this._tiles)this._tiles[u].coords.z===c&&this._removeTile(u)},_removeAllTiles:function(){for(var c in this._tiles)this._removeTile(c)},_invalidateAll:function(){for(var c in this._levels)ge(this._levels[c].el),this._onRemoveLevel(Number(c)),delete this._levels[c];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(c,u,g,C){var w=Math.floor(c/2),P=Math.floor(u/2),O=g-1,N=new W(+w,+P);N.z=+O;var k=this._tileCoordsToKey(N),H=this._tiles[k];return H&&H.active?(H.retain=!0,!0):(H&&H.loaded&&(H.retain=!0),O>C?this._retainParent(w,P,O,C):!1)},_retainChildren:function(c,u,g,C){for(var w=2*c;w<2*c+2;w++)for(var P=2*u;P<2*u+2;P++){var O=new W(w,P);O.z=g+1;var N=this._tileCoordsToKey(O),k=this._tiles[N];if(k&&k.active){k.retain=!0;continue}else k&&k.loaded&&(k.retain=!0);g+1<C&&this._retainChildren(w,P,g+1,C)}},_resetView:function(c){var u=c&&(c.pinch||c.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),u,u)},_animateZoom:function(c){this._setView(c.center,c.zoom,!0,c.noUpdate)},_clampZoom:function(c){var u=this.options;return u.minNativeZoom!==void 0&&c<u.minNativeZoom?u.minNativeZoom:u.maxNativeZoom!==void 0&&u.maxNativeZoom<c?u.maxNativeZoom:c},_setView:function(c,u,g,C){var w=Math.round(u);this.options.maxZoom!==void 0&&w>this.options.maxZoom||this.options.minZoom!==void 0&&w<this.options.minZoom?w=void 0:w=this._clampZoom(w);var P=this.options.updateWhenZooming&&w!==this._tileZoom;(!C||P)&&(this._tileZoom=w,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),w!==void 0&&this._update(c),g||this._pruneTiles(),this._noPrune=!!g),this._setZoomTransforms(c,u)},_setZoomTransforms:function(c,u){for(var g in this._levels)this._setZoomTransform(this._levels[g],c,u)},_setZoomTransform:function(c,u,g){var C=this._map.getZoomScale(g,c.zoom),w=c.origin.multiplyBy(C).subtract(this._map._getNewPixelOrigin(u,g)).round();Q.any3d?ze(c.el,w,C):ve(c.el,w)},_resetGrid:function(){var c=this._map,u=c.options.crs,g=this._tileSize=this.getTileSize(),C=this._tileZoom,w=this._map.getPixelWorldBounds(this._tileZoom);w&&(this._globalTileRange=this._pxBoundsToTileRange(w)),this._wrapX=u.wrapLng&&!this.options.noWrap&&[Math.floor(c.project([0,u.wrapLng[0]],C).x/g.x),Math.ceil(c.project([0,u.wrapLng[1]],C).x/g.y)],this._wrapY=u.wrapLat&&!this.options.noWrap&&[Math.floor(c.project([u.wrapLat[0],0],C).y/g.x),Math.ceil(c.project([u.wrapLat[1],0],C).y/g.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(c){var u=this._map,g=u._animatingZoom?Math.max(u._animateToZoom,u.getZoom()):u.getZoom(),C=u.getZoomScale(g,this._tileZoom),w=u.project(c,this._tileZoom).floor(),P=u.getSize().divideBy(C*2);return new se(w.subtract(P),w.add(P))},_update:function(c){var u=this._map;if(u){var g=this._clampZoom(u.getZoom());if(c===void 0&&(c=u.getCenter()),this._tileZoom!==void 0){var C=this._getTiledPixelBounds(c),w=this._pxBoundsToTileRange(C),P=w.getCenter(),O=[],N=this.options.keepBuffer,k=new se(w.getBottomLeft().subtract([N,-N]),w.getTopRight().add([N,-N]));if(!(isFinite(w.min.x)&&isFinite(w.min.y)&&isFinite(w.max.x)&&isFinite(w.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var H in this._tiles){var q=this._tiles[H].coords;(q.z!==this._tileZoom||!k.contains(new W(q.x,q.y)))&&(this._tiles[H].current=!1)}if(Math.abs(g-this._tileZoom)>1){this._setView(c,g);return}for(var ee=w.min.y;ee<=w.max.y;ee++)for(var le=w.min.x;le<=w.max.x;le++){var we=new W(le,ee);if(we.z=this._tileZoom,!!this._isValidTile(we)){var _e=this._tiles[this._tileCoordsToKey(we)];_e?_e.current=!0:O.push(we)}}if(O.sort(function(Ee,ct){return Ee.distanceTo(P)-ct.distanceTo(P)}),O.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Re=document.createDocumentFragment();for(le=0;le<O.length;le++)this._addTile(O[le],Re);this._level.el.appendChild(Re)}}}},_isValidTile:function(c){var u=this._map.options.crs;if(!u.infinite){var g=this._globalTileRange;if(!u.wrapLng&&(c.x<g.min.x||c.x>g.max.x)||!u.wrapLat&&(c.y<g.min.y||c.y>g.max.y))return!1}if(!this.options.bounds)return!0;var C=this._tileCoordsToBounds(c);return oe(this.options.bounds).overlaps(C)},_keyToBounds:function(c){return this._tileCoordsToBounds(this._keyToTileCoords(c))},_tileCoordsToNwSe:function(c){var u=this._map,g=this.getTileSize(),C=c.scaleBy(g),w=C.add(g),P=u.unproject(C,c.z),O=u.unproject(w,c.z);return[P,O]},_tileCoordsToBounds:function(c){var u=this._tileCoordsToNwSe(c),g=new ae(u[0],u[1]);return this.options.noWrap||(g=this._map.wrapLatLngBounds(g)),g},_tileCoordsToKey:function(c){return c.x+":"+c.y+":"+c.z},_keyToTileCoords:function(c){var u=c.split(":"),g=new W(+u[0],+u[1]);return g.z=+u[2],g},_removeTile:function(c){var u=this._tiles[c];u&&(ge(u.el),delete this._tiles[c],this.fire("tileunload",{tile:u.el,coords:this._keyToTileCoords(c)}))},_initTile:function(c){re(c,"leaflet-tile");var u=this.getTileSize();c.style.width=u.x+"px",c.style.height=u.y+"px",c.onselectstart=p,c.onmousemove=p,Q.ielt9&&this.options.opacity<1&&Pe(c,this.options.opacity)},_addTile:function(c,u){var g=this._getTilePos(c),C=this._tileCoordsToKey(c),w=this.createTile(this._wrapCoords(c),r(this._tileReady,this,c));this._initTile(w),this.createTile.length<2&&B(r(this._tileReady,this,c,null,w)),ve(w,g),this._tiles[C]={el:w,coords:c,current:!0},u.appendChild(w),this.fire("tileloadstart",{tile:w,coords:c})},_tileReady:function(c,u,g){u&&this.fire("tileerror",{error:u,tile:g,coords:c});var C=this._tileCoordsToKey(c);g=this._tiles[C],g&&(g.loaded=+new Date,this._map._fadeAnimated?(Pe(g.el,0),K(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this)):(g.active=!0,this._pruneTiles()),u||(re(g.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:g.el,coords:c})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),Q.ielt9||!this._map._fadeAnimated?B(this._pruneTiles,this):setTimeout(r(this._pruneTiles,this),250)))},_getTilePos:function(c){return c.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(c){var u=new W(this._wrapX?h(c.x,this._wrapX):c.x,this._wrapY?h(c.y,this._wrapY):c.y);return u.z=c.z,u},_pxBoundsToTileRange:function(c){var u=this.getTileSize();return new se(c.min.unscaleBy(u).floor(),c.max.unscaleBy(u).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var c in this._tiles)if(!this._tiles[c].loaded)return!1;return!0}});function Ks(c){return new At(c)}var lt=At.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(c,u){this._url=c,u=b(this,u),u.detectRetina&&Q.retina&&u.maxZoom>0?(u.tileSize=Math.floor(u.tileSize/2),u.zoomReverse?(u.zoomOffset--,u.minZoom=Math.min(u.maxZoom,u.minZoom+1)):(u.zoomOffset++,u.maxZoom=Math.max(u.minZoom,u.maxZoom-1)),u.minZoom=Math.max(0,u.minZoom)):u.zoomReverse?u.minZoom=Math.min(u.maxZoom,u.minZoom):u.maxZoom=Math.max(u.minZoom,u.maxZoom),typeof u.subdomains=="string"&&(u.subdomains=u.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(c,u){return this._url===c&&u===void 0&&(u=!0),this._url=c,u||this.redraw(),this},createTile:function(c,u){var g=document.createElement("img");return ne(g,"load",r(this._tileOnLoad,this,u,g)),ne(g,"error",r(this._tileOnError,this,u,g)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(g.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(g.referrerPolicy=this.options.referrerPolicy),g.alt="",g.src=this.getTileUrl(c),g},getTileUrl:function(c){var u={r:Q.retina?"@2x":"",s:this._getSubdomain(c),x:c.x,y:c.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var g=this._globalTileRange.max.y-c.y;this.options.tms&&(u.y=g),u["-y"]=g}return T(this._url,n(u,this.options))},_tileOnLoad:function(c,u){Q.ielt9?setTimeout(r(c,this,null,u),0):c(null,u)},_tileOnError:function(c,u,g){var C=this.options.errorTileUrl;C&&u.getAttribute("src")!==C&&(u.src=C),c(g,u)},_onTileRemove:function(c){c.tile.onload=null},_getZoomForUrl:function(){var c=this._tileZoom,u=this.options.maxZoom,g=this.options.zoomReverse,C=this.options.zoomOffset;return g&&(c=u-c),c+C},_getSubdomain:function(c){var u=Math.abs(c.x+c.y)%this.options.subdomains.length;return this.options.subdomains[u]},_abortLoading:function(){var c,u;for(c in this._tiles)if(this._tiles[c].coords.z!==this._tileZoom&&(u=this._tiles[c].el,u.onload=p,u.onerror=p,!u.complete)){u.src=D;var g=this._tiles[c].coords;ge(u),delete this._tiles[c],this.fire("tileabort",{tile:u,coords:g})}},_removeTile:function(c){var u=this._tiles[c];if(u)return u.el.setAttribute("src",D),At.prototype._removeTile.call(this,c)},_tileReady:function(c,u,g){if(!(!this._map||g&&g.getAttribute("src")===D))return At.prototype._tileReady.call(this,c,u,g)}});function yn(c,u){return new lt(c,u)}var bn=lt.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(c,u){this._url=c;var g=n({},this.defaultWmsParams);for(var C in u)C in this.options||(g[C]=u[C]);u=b(this,u);var w=u.detectRetina&&Q.retina?2:1,P=this.getTileSize();g.width=P.x*w,g.height=P.y*w,this.wmsParams=g},onAdd:function(c){this._crs=this.options.crs||c.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var u=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[u]=this._crs.code,lt.prototype.onAdd.call(this,c)},getTileUrl:function(c){var u=this._tileCoordsToNwSe(c),g=this._crs,C=pe(g.project(u[0]),g.project(u[1])),w=C.min,P=C.max,O=(this._wmsVersion>=1.3&&this._crs===pn?[w.y,w.x,P.y,P.x]:[w.x,w.y,P.x,P.y]).join(","),N=lt.prototype.getTileUrl.call(this,c);return N+S(this.wmsParams,N,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+O},setParams:function(c,u){return n(this.wmsParams,c),u||this.redraw(),this}});function Ys(c,u){return new bn(c,u)}lt.WMS=bn,yn.wms=Ys;var ke=De.extend({options:{padding:.1},initialize:function(c){b(this,c),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),re(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var c={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(c.zoomanim=this._onAnimZoom),c},_onAnimZoom:function(c){this._updateTransform(c.center,c.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(c,u){var g=this._map.getZoomScale(u,this._zoom),C=this._map.getSize().multiplyBy(.5+this.options.padding),w=this._map.project(this._center,u),P=C.multiplyBy(-g).add(w).subtract(this._map._getNewPixelOrigin(c,u));Q.any3d?ze(this._container,P,g):ve(this._container,P)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var c in this._layers)this._layers[c]._reset()},_onZoomEnd:function(){for(var c in this._layers)this._layers[c]._project()},_updatePaths:function(){for(var c in this._layers)this._layers[c]._update()},_update:function(){var c=this.options.padding,u=this._map.getSize(),g=this._map.containerPointToLayerPoint(u.multiplyBy(-c)).round();this._bounds=new se(g,g.add(u.multiplyBy(1+c*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),wn=ke.extend({options:{tolerance:0},getEvents:function(){var c=ke.prototype.getEvents.call(this);return c.viewprereset=this._onViewPreReset,c},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ke.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var c=this._container=document.createElement("canvas");ne(c,"mousemove",this._onMouseMove,this),ne(c,"click dblclick mousedown mouseup contextmenu",this._onClick,this),ne(c,"mouseout",this._handleMouseOut,this),c._leaflet_disable_events=!0,this._ctx=c.getContext("2d")},_destroyContainer:function(){K(this._redrawRequest),delete this._ctx,ge(this._container),fe(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var c;this._redrawBounds=null;for(var u in this._layers)c=this._layers[u],c._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ke.prototype._update.call(this);var c=this._bounds,u=this._container,g=c.getSize(),C=Q.retina?2:1;ve(u,c.min),u.width=C*g.x,u.height=C*g.y,u.style.width=g.x+"px",u.style.height=g.y+"px",Q.retina&&this._ctx.scale(2,2),this._ctx.translate(-c.min.x,-c.min.y),this.fire("update")}},_reset:function(){ke.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(c){this._updateDashArray(c),this._layers[l(c)]=c;var u=c._order={layer:c,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=u),this._drawLast=u,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(c){this._requestRedraw(c)},_removePath:function(c){var u=c._order,g=u.next,C=u.prev;g?g.prev=C:this._drawLast=C,C?C.next=g:this._drawFirst=g,delete c._order,delete this._layers[l(c)],this._requestRedraw(c)},_updatePath:function(c){this._extendRedrawBounds(c),c._project(),c._update(),this._requestRedraw(c)},_updateStyle:function(c){this._updateDashArray(c),this._requestRedraw(c)},_updateDashArray:function(c){if(typeof c.options.dashArray=="string"){var u=c.options.dashArray.split(/[, ]+/),g=[],C,w;for(w=0;w<u.length;w++){if(C=Number(u[w]),isNaN(C))return;g.push(C)}c.options._dashArray=g}else c.options._dashArray=c.options.dashArray},_requestRedraw:function(c){this._map&&(this._extendRedrawBounds(c),this._redrawRequest=this._redrawRequest||B(this._redraw,this))},_extendRedrawBounds:function(c){if(c._pxBounds){var u=(c.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new se,this._redrawBounds.extend(c._pxBounds.min.subtract([u,u])),this._redrawBounds.extend(c._pxBounds.max.add([u,u]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var c=this._redrawBounds;if(c){var u=c.getSize();this._ctx.clearRect(c.min.x,c.min.y,u.x,u.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var c,u=this._redrawBounds;if(this._ctx.save(),u){var g=u.getSize();this._ctx.beginPath(),this._ctx.rect(u.min.x,u.min.y,g.x,g.y),this._ctx.clip()}this._drawing=!0;for(var C=this._drawFirst;C;C=C.next)c=C.layer,(!u||c._pxBounds&&c._pxBounds.intersects(u))&&c._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(c,u){if(this._drawing){var g,C,w,P,O=c._parts,N=O.length,k=this._ctx;if(N){for(k.beginPath(),g=0;g<N;g++){for(C=0,w=O[g].length;C<w;C++)P=O[g][C],k[C?"lineTo":"moveTo"](P.x,P.y);u&&k.closePath()}this._fillStroke(k,c)}}},_updateCircle:function(c){if(!(!this._drawing||c._empty())){var u=c._point,g=this._ctx,C=Math.max(Math.round(c._radius),1),w=(Math.max(Math.round(c._radiusY),1)||C)/C;w!==1&&(g.save(),g.scale(1,w)),g.beginPath(),g.arc(u.x,u.y/w,C,0,Math.PI*2,!1),w!==1&&g.restore(),this._fillStroke(g,c)}},_fillStroke:function(c,u){var g=u.options;g.fill&&(c.globalAlpha=g.fillOpacity,c.fillStyle=g.fillColor||g.color,c.fill(g.fillRule||"evenodd")),g.stroke&&g.weight!==0&&(c.setLineDash&&c.setLineDash(u.options&&u.options._dashArray||[]),c.globalAlpha=g.opacity,c.lineWidth=g.weight,c.strokeStyle=g.color,c.lineCap=g.lineCap,c.lineJoin=g.lineJoin,c.stroke())},_onClick:function(c){for(var u=this._map.mouseEventToLayerPoint(c),g,C,w=this._drawFirst;w;w=w.next)g=w.layer,g.options.interactive&&g._containsPoint(u)&&(!(c.type==="click"||c.type==="preclick")||!this._map._draggableMoved(g))&&(C=g);this._fireEvent(C?[C]:!1,c)},_onMouseMove:function(c){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var u=this._map.mouseEventToLayerPoint(c);this._handleMouseHover(c,u)}},_handleMouseOut:function(c){var u=this._hoveredLayer;u&&(me(this._container,"leaflet-interactive"),this._fireEvent([u],c,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(c,u){if(!this._mouseHoverThrottled){for(var g,C,w=this._drawFirst;w;w=w.next)g=w.layer,g.options.interactive&&g._containsPoint(u)&&(C=g);C!==this._hoveredLayer&&(this._handleMouseOut(c),C&&(re(this._container,"leaflet-interactive"),this._fireEvent([C],c,"mouseover"),this._hoveredLayer=C)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,c),this._mouseHoverThrottled=!0,setTimeout(r(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(c,u,g){this._map._fireDOMEvent(u,g||u.type,c)},_bringToFront:function(c){var u=c._order;if(u){var g=u.next,C=u.prev;if(g)g.prev=C;else return;C?C.next=g:g&&(this._drawFirst=g),u.prev=this._drawLast,this._drawLast.next=u,u.next=null,this._drawLast=u,this._requestRedraw(c)}},_bringToBack:function(c){var u=c._order;if(u){var g=u.next,C=u.prev;if(C)C.next=g;else return;g?g.prev=C:C&&(this._drawLast=C),u.prev=null,u.next=this._drawFirst,this._drawFirst.prev=u,this._drawFirst=u,this._requestRedraw(c)}}});function Sn(c){return Q.canvas?new wn(c):null}var Dt=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(c){return document.createElement("<lvml:"+c+' class="lvml">')}}catch{}return function(c){return document.createElement("<"+c+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),qs={_initContainer:function(){this._container=he("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ke.prototype._update.call(this),this.fire("update"))},_initPath:function(c){var u=c._container=Dt("shape");re(u,"leaflet-vml-shape "+(this.options.className||"")),u.coordsize="1 1",c._path=Dt("path"),u.appendChild(c._path),this._updateStyle(c),this._layers[l(c)]=c},_addPath:function(c){var u=c._container;this._container.appendChild(u),c.options.interactive&&c.addInteractiveTarget(u)},_removePath:function(c){var u=c._container;ge(u),c.removeInteractiveTarget(u),delete this._layers[l(c)]},_updateStyle:function(c){var u=c._stroke,g=c._fill,C=c.options,w=c._container;w.stroked=!!C.stroke,w.filled=!!C.fill,C.stroke?(u||(u=c._stroke=Dt("stroke")),w.appendChild(u),u.weight=C.weight+"px",u.color=C.color,u.opacity=C.opacity,C.dashArray?u.dashStyle=R(C.dashArray)?C.dashArray.join(" "):C.dashArray.replace(/( *, *)/g," "):u.dashStyle="",u.endcap=C.lineCap.replace("butt","flat"),u.joinstyle=C.lineJoin):u&&(w.removeChild(u),c._stroke=null),C.fill?(g||(g=c._fill=Dt("fill")),w.appendChild(g),g.color=C.fillColor||C.color,g.opacity=C.fillOpacity):g&&(w.removeChild(g),c._fill=null)},_updateCircle:function(c){var u=c._point.round(),g=Math.round(c._radius),C=Math.round(c._radiusY||g);this._setPath(c,c._empty()?"M0 0":"AL "+u.x+","+u.y+" "+g+","+C+" 0,"+65535*360)},_setPath:function(c,u){c._path.v=u},_bringToFront:function(c){tt(c._container)},_bringToBack:function(c){nt(c._container)}},qt=Q.vml?Dt:Mt,Ot=ke.extend({_initContainer:function(){this._container=qt("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=qt("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ge(this._container),fe(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ke.prototype._update.call(this);var c=this._bounds,u=c.getSize(),g=this._container;(!this._svgSize||!this._svgSize.equals(u))&&(this._svgSize=u,g.setAttribute("width",u.x),g.setAttribute("height",u.y)),ve(g,c.min),g.setAttribute("viewBox",[c.min.x,c.min.y,u.x,u.y].join(" ")),this.fire("update")}},_initPath:function(c){var u=c._path=qt("path");c.options.className&&re(u,c.options.className),c.options.interactive&&re(u,"leaflet-interactive"),this._updateStyle(c),this._layers[l(c)]=c},_addPath:function(c){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(c._path),c.addInteractiveTarget(c._path)},_removePath:function(c){ge(c._path),c.removeInteractiveTarget(c._path),delete this._layers[l(c)]},_updatePath:function(c){c._project(),c._update()},_updateStyle:function(c){var u=c._path,g=c.options;u&&(g.stroke?(u.setAttribute("stroke",g.color),u.setAttribute("stroke-opacity",g.opacity),u.setAttribute("stroke-width",g.weight),u.setAttribute("stroke-linecap",g.lineCap),u.setAttribute("stroke-linejoin",g.lineJoin),g.dashArray?u.setAttribute("stroke-dasharray",g.dashArray):u.removeAttribute("stroke-dasharray"),g.dashOffset?u.setAttribute("stroke-dashoffset",g.dashOffset):u.removeAttribute("stroke-dashoffset")):u.setAttribute("stroke","none"),g.fill?(u.setAttribute("fill",g.fillColor||g.color),u.setAttribute("fill-opacity",g.fillOpacity),u.setAttribute("fill-rule",g.fillRule||"evenodd")):u.setAttribute("fill","none"))},_updatePoly:function(c,u){this._setPath(c,ut(c._parts,u))},_updateCircle:function(c){var u=c._point,g=Math.max(Math.round(c._radius),1),C=Math.max(Math.round(c._radiusY),1)||g,w="a"+g+","+C+" 0 1,0 ",P=c._empty()?"M0 0":"M"+(u.x-g)+","+u.y+w+g*2+",0 "+w+-g*2+",0 ";this._setPath(c,P)},_setPath:function(c,u){c._path.setAttribute("d",u)},_bringToFront:function(c){tt(c._path)},_bringToBack:function(c){nt(c._path)}});Q.vml&&Ot.include(qs);function En(c){return Q.svg||Q.vml?new Ot(c):null}ue.include({getRenderer:function(c){var u=c.options.renderer||this._getPaneRenderer(c.options.pane)||this.options.renderer||this._renderer;return u||(u=this._renderer=this._createRenderer()),this.hasLayer(u)||this.addLayer(u),u},_getPaneRenderer:function(c){if(c==="overlayPane"||c===void 0)return!1;var u=this._paneRenderers[c];return u===void 0&&(u=this._createRenderer({pane:c}),this._paneRenderers[c]=u),u},_createRenderer:function(c){return this.options.preferCanvas&&Sn(c)||En(c)}});var Pn=rt.extend({initialize:function(c,u){rt.prototype.initialize.call(this,this._boundsToLatLngs(c),u)},setBounds:function(c){return this.setLatLngs(this._boundsToLatLngs(c))},_boundsToLatLngs:function(c){return c=oe(c),[c.getSouthWest(),c.getNorthWest(),c.getNorthEast(),c.getSouthEast()]}});function Xs(c,u){return new Pn(c,u)}Ot.create=qt,Ot.pointsToPath=ut,$e.geometryToLayer=Wt,$e.coordsToLatLng=Ti,$e.coordsToLatLngs=Bt,$e.latLngToCoords=Ri,$e.latLngsToCoords=zt,$e.getFeature=at,$e.asFeature=jt,ue.mergeOptions({boxZoom:!0});var Tn=Le.extend({initialize:function(c){this._map=c,this._container=c._container,this._pane=c._panes.overlayPane,this._resetStateTimeout=0,c.on("unload",this._destroy,this)},addHooks:function(){ne(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){fe(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ge(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(c){if(!c.shiftKey||c.which!==1&&c.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),bt(),ai(),this._startPoint=this._map.mouseEventToContainerPoint(c),ne(document,{contextmenu:Ke,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(c){this._moved||(this._moved=!0,this._box=he("div","leaflet-zoom-box",this._container),re(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(c);var u=new se(this._point,this._startPoint),g=u.getSize();ve(this._box,u.min),this._box.style.width=g.x+"px",this._box.style.height=g.y+"px"},_finish:function(){this._moved&&(ge(this._box),me(this._container,"leaflet-crosshair")),wt(),li(),fe(document,{contextmenu:Ke,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(c){if(!(c.which!==1&&c.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(r(this._resetState,this),0);var u=new ae(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(u).fire("boxzoomend",{boxZoomBounds:u})}},_onKeyDown:function(c){c.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});ue.addInitHook("addHandler","boxZoom",Tn),ue.mergeOptions({doubleClickZoom:!0});var Rn=Le.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(c){var u=this._map,g=u.getZoom(),C=u.options.zoomDelta,w=c.originalEvent.shiftKey?g-C:g+C;u.options.doubleClickZoom==="center"?u.setZoom(w):u.setZoomAround(c.containerPoint,w)}});ue.addInitHook("addHandler","doubleClickZoom",Rn),ue.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var An=Le.extend({addHooks:function(){if(!this._draggable){var c=this._map;this._draggable=new Ve(c._mapPane,c._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),c.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),c.on("zoomend",this._onZoomEnd,this),c.whenReady(this._onZoomEnd,this))}re(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){me(this._map._container,"leaflet-grab"),me(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var c=this._map;if(c._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var u=oe(this._map.options.maxBounds);this._offsetLimit=pe(this._map.latLngToContainerPoint(u.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(u.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;c.fire("movestart").fire("dragstart"),c.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(c){if(this._map.options.inertia){var u=this._lastTime=+new Date,g=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(g),this._times.push(u),this._prunePositions(u)}this._map.fire("move",c).fire("drag",c)},_prunePositions:function(c){for(;this._positions.length>1&&c-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var c=this._map.getSize().divideBy(2),u=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=u.subtract(c).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(c,u){return c-(c-u)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var c=this._draggable._newPos.subtract(this._draggable._startPos),u=this._offsetLimit;c.x<u.min.x&&(c.x=this._viscousLimit(c.x,u.min.x)),c.y<u.min.y&&(c.y=this._viscousLimit(c.y,u.min.y)),c.x>u.max.x&&(c.x=this._viscousLimit(c.x,u.max.x)),c.y>u.max.y&&(c.y=this._viscousLimit(c.y,u.max.y)),this._draggable._newPos=this._draggable._startPos.add(c)}},_onPreDragWrap:function(){var c=this._worldWidth,u=Math.round(c/2),g=this._initialWorldOffset,C=this._draggable._newPos.x,w=(C-u+g)%c+u-g,P=(C+u+g)%c-u-g,O=Math.abs(w+g)<Math.abs(P+g)?w:P;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=O},_onDragEnd:function(c){var u=this._map,g=u.options,C=!g.inertia||c.noInertia||this._times.length<2;if(u.fire("dragend",c),C)u.fire("moveend");else{this._prunePositions(+new Date);var w=this._lastPos.subtract(this._positions[0]),P=(this._lastTime-this._times[0])/1e3,O=g.easeLinearity,N=w.multiplyBy(O/P),k=N.distanceTo([0,0]),H=Math.min(g.inertiaMaxSpeed,k),q=N.multiplyBy(H/k),ee=H/(g.inertiaDeceleration*O),le=q.multiplyBy(-ee/2).round();!le.x&&!le.y?u.fire("moveend"):(le=u._limitOffset(le,u.options.maxBounds),B(function(){u.panBy(le,{duration:ee,easeLinearity:O,noMoveStart:!0,animate:!0})}))}}});ue.addInitHook("addHandler","dragging",An),ue.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Dn=Le.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(c){this._map=c,this._setPanDelta(c.options.keyboardPanDelta),this._setZoomDelta(c.options.zoomDelta)},addHooks:function(){var c=this._map._container;c.tabIndex<=0&&(c.tabIndex="0"),ne(c,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),fe(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var c=document.body,u=document.documentElement,g=c.scrollTop||u.scrollTop,C=c.scrollLeft||u.scrollLeft;this._map._container.focus(),window.scrollTo(C,g)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(c){var u=this._panKeys={},g=this.keyCodes,C,w;for(C=0,w=g.left.length;C<w;C++)u[g.left[C]]=[-1*c,0];for(C=0,w=g.right.length;C<w;C++)u[g.right[C]]=[c,0];for(C=0,w=g.down.length;C<w;C++)u[g.down[C]]=[0,c];for(C=0,w=g.up.length;C<w;C++)u[g.up[C]]=[0,-1*c]},_setZoomDelta:function(c){var u=this._zoomKeys={},g=this.keyCodes,C,w;for(C=0,w=g.zoomIn.length;C<w;C++)u[g.zoomIn[C]]=c;for(C=0,w=g.zoomOut.length;C<w;C++)u[g.zoomOut[C]]=-c},_addHooks:function(){ne(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){fe(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(c){if(!(c.altKey||c.ctrlKey||c.metaKey)){var u=c.keyCode,g=this._map,C;if(u in this._panKeys){if(!g._panAnim||!g._panAnim._inProgress)if(C=this._panKeys[u],c.shiftKey&&(C=U(C).multiplyBy(3)),g.options.maxBounds&&(C=g._limitOffset(U(C),g.options.maxBounds)),g.options.worldCopyJump){var w=g.wrapLatLng(g.unproject(g.project(g.getCenter()).add(C)));g.panTo(w)}else g.panBy(C)}else if(u in this._zoomKeys)g.setZoom(g.getZoom()+(c.shiftKey?3:1)*this._zoomKeys[u]);else if(u===27&&g._popup&&g._popup.options.closeOnEscapeKey)g.closePopup();else return;Ke(c)}}});ue.addInitHook("addHandler","keyboard",Dn),ue.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var On=Le.extend({addHooks:function(){ne(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){fe(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(c){var u=Qi(c),g=this._map.options.wheelDebounceTime;this._delta+=u,this._lastMousePos=this._map.mouseEventToContainerPoint(c),this._startTime||(this._startTime=+new Date);var C=Math.max(g-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(r(this._performZoom,this),C),Ke(c)},_performZoom:function(){var c=this._map,u=c.getZoom(),g=this._map.options.zoomSnap||0;c._stop();var C=this._delta/(this._map.options.wheelPxPerZoomLevel*4),w=4*Math.log(2/(1+Math.exp(-Math.abs(C))))/Math.LN2,P=g?Math.ceil(w/g)*g:w,O=c._limitZoom(u+(this._delta>0?P:-P))-u;this._delta=0,this._startTime=null,O&&(c.options.scrollWheelZoom==="center"?c.setZoom(u+O):c.setZoomAround(this._lastMousePos,u+O))}});ue.addInitHook("addHandler","scrollWheelZoom",On);var Qs=600;ue.mergeOptions({tapHold:Q.touchNative&&Q.safari&&Q.mobile,tapTolerance:15});var Mn=Le.extend({addHooks:function(){ne(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){fe(this._map._container,"touchstart",this._onDown,this)},_onDown:function(c){if(clearTimeout(this._holdTimeout),c.touches.length===1){var u=c.touches[0];this._startPos=this._newPos=new W(u.clientX,u.clientY),this._holdTimeout=setTimeout(r(function(){this._cancel(),this._isTapValid()&&(ne(document,"touchend",ye),ne(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",u))},this),Qs),ne(document,"touchend touchcancel contextmenu",this._cancel,this),ne(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function c(){fe(document,"touchend",ye),fe(document,"touchend touchcancel",c)},_cancel:function(){clearTimeout(this._holdTimeout),fe(document,"touchend touchcancel contextmenu",this._cancel,this),fe(document,"touchmove",this._onMove,this)},_onMove:function(c){var u=c.touches[0];this._newPos=new W(u.clientX,u.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(c,u){var g=new MouseEvent(c,{bubbles:!0,cancelable:!0,view:window,screenX:u.screenX,screenY:u.screenY,clientX:u.clientX,clientY:u.clientY});g._simulated=!0,u.target.dispatchEvent(g)}});ue.addInitHook("addHandler","tapHold",Mn),ue.mergeOptions({touchZoom:Q.touch,bounceAtZoomLimits:!0});var xn=Le.extend({addHooks:function(){re(this._map._container,"leaflet-touch-zoom"),ne(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){me(this._map._container,"leaflet-touch-zoom"),fe(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(c){var u=this._map;if(!(!c.touches||c.touches.length!==2||u._animatingZoom||this._zooming)){var g=u.mouseEventToContainerPoint(c.touches[0]),C=u.mouseEventToContainerPoint(c.touches[1]);this._centerPoint=u.getSize()._divideBy(2),this._startLatLng=u.containerPointToLatLng(this._centerPoint),u.options.touchZoom!=="center"&&(this._pinchStartLatLng=u.containerPointToLatLng(g.add(C)._divideBy(2))),this._startDist=g.distanceTo(C),this._startZoom=u.getZoom(),this._moved=!1,this._zooming=!0,u._stop(),ne(document,"touchmove",this._onTouchMove,this),ne(document,"touchend touchcancel",this._onTouchEnd,this),ye(c)}},_onTouchMove:function(c){if(!(!c.touches||c.touches.length!==2||!this._zooming)){var u=this._map,g=u.mouseEventToContainerPoint(c.touches[0]),C=u.mouseEventToContainerPoint(c.touches[1]),w=g.distanceTo(C)/this._startDist;if(this._zoom=u.getScaleZoom(w,this._startZoom),!u.options.bounceAtZoomLimits&&(this._zoom<u.getMinZoom()&&w<1||this._zoom>u.getMaxZoom()&&w>1)&&(this._zoom=u._limitZoom(this._zoom)),u.options.touchZoom==="center"){if(this._center=this._startLatLng,w===1)return}else{var P=g._add(C)._divideBy(2)._subtract(this._centerPoint);if(w===1&&P.x===0&&P.y===0)return;this._center=u.unproject(u.project(this._pinchStartLatLng,this._zoom).subtract(P),this._zoom)}this._moved||(u._moveStart(!0,!1),this._moved=!0),K(this._animRequest);var O=r(u._move,u,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=B(O,this,!0),ye(c)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,K(this._animRequest),fe(document,"touchmove",this._onTouchMove,this),fe(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});ue.addInitHook("addHandler","touchZoom",xn),ue.BoxZoom=Tn,ue.DoubleClickZoom=Rn,ue.Drag=An,ue.Keyboard=Dn,ue.ScrollWheelZoom=On,ue.TapHold=Mn,ue.TouchZoom=xn,t.Bounds=se,t.Browser=Q,t.CRS=Se,t.Canvas=wn,t.Circle=Pi,t.CircleMarker=Ht,t.Class=Z,t.Control=Ae,t.DivIcon=_n,t.DivOverlay=Fe,t.DomEvent=gs,t.DomUtil=ps,t.Draggable=Ve,t.Evented=Y,t.FeatureGroup=Ie,t.GeoJSON=$e,t.GridLayer=At,t.Handler=Le,t.Icon=ot,t.ImageOverlay=Ut,t.LatLng=ie,t.LatLngBounds=ae,t.Layer=De,t.LayerGroup=st,t.LineUtil=As,t.Map=ue,t.Marker=Vt,t.Mixin=ws,t.Path=He,t.Point=W,t.PolyUtil=Ss,t.Polygon=rt,t.Polyline=Ne,t.Popup=Kt,t.PosAnimation=Zi,t.Projection=Ds,t.Rectangle=Pn,t.Renderer=ke,t.SVG=Ot,t.SVGOverlay=Cn,t.TileLayer=lt,t.Tooltip=Yt,t.Transformation=We,t.Util=J,t.VideoOverlay=vn,t.bind=r,t.bounds=pe,t.canvas=Sn,t.circle=$s,t.circleMarker=Ns,t.control=Pt,t.divIcon=Us,t.extend=n,t.featureGroup=Ls,t.geoJSON=mn,t.geoJson=Vs,t.gridLayer=Ks,t.icon=Fs,t.imageOverlay=Hs,t.latLng=te,t.latLngBounds=oe,t.layerGroup=xs,t.map=ms,t.marker=Is,t.point=U,t.polygon=Gs,t.polyline=ks,t.popup=zs,t.rectangle=Xs,t.setOptions=b,t.stamp=l,t.svg=En,t.svgOverlay=Bs,t.tileLayer=yn,t.tooltip=js,t.transformation=Be,t.version=i,t.videoOverlay=Ws;var Zs=window.L;t.noConflict=function(){return window.L=Zs,this},window.L=t})})(leafletSrc,leafletSrc.exports);var leafletSrcExports=leafletSrc.exports;const L$1=getDefaultExportFromCjs(leafletSrcExports);function makeNull(s){return s==null||s===""?null:s}function exists(s,e=!1){return s!=null&&(s!==""||e)}function missing(s){return!exists(s)}function missingOrEmpty(s){return s==null||s.length===0}function toStringOrNull(s){return s!=null&&typeof s.toString=="function"?s.toString():null}function attrToNumber(s){if(s===void 0)return;if(s===null||s==="")return null;if(typeof s=="number")return isNaN(s)?void 0:s;const e=parseInt(s,10);return isNaN(e)?void 0:e}function attrToBoolean(s){if(s!==void 0)return s===null||s===""?!1:typeof s=="boolean"?s:/true/i.test(s)}function attrToString(s){if(!(s==null||s===""))return s}function jsonEquals(s,e){const t=s?JSON.stringify(s):null,i=e?JSON.stringify(e):null;return t===i}function defaultComparator(s,e,t=!1){const i=s==null,n=e==null;if(s&&s.toNumber&&(s=s.toNumber()),e&&e.toNumber&&(e=e.toNumber()),i&&n)return 0;if(i)return-1;if(n)return 1;function o(r,a){return r>a?1:r<a?-1:0}if(typeof s!="string"||!t)return o(s,e);try{return s.localeCompare(e)}catch{return o(s,e)}}function values(s){if(s instanceof Set||s instanceof Map){const e=[];return s.forEach(t=>e.push(t)),e}return Object.values(s)}const GenericUtils=Object.freeze(Object.defineProperty({__proto__:null,attrToBoolean,attrToNumber,attrToString,defaultComparator,exists,jsonEquals,makeNull,missing,missingOrEmpty,toStringOrNull,values},Symbol.toStringTag,{value:"Module"}));class ColumnKeyCreator{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=toStringOrNull(e);let i=0;for(;;){let n;if(e?(n=e,i!==0&&(n+="_"+i)):t?(n=t,i!==0&&(n+="_"+i)):n=i,!this.existingKeys[n])return this.existingKeys[n]=!0,String(n);i++}}}function iterateObject(s,e){if(s!=null){if(Array.isArray(s)){for(let t=0;t<s.length;t++)e(t.toString(),s[t]);return}for(const[t,i]of Object.entries(s))e(t,i)}}function cloneObject(s){const e={},t=Object.keys(s);for(let i=0;i<t.length;i++){const n=t[i],o=s[n];e[n]=o}return e}function deepCloneDefinition(s,e){if(!s)return;const t=s,i={};return Object.keys(t).forEach(n=>{if(e&&e.indexOf(n)>=0)return;const o=t[n];isNonNullObject(o)&&o.constructor===Object?i[n]=deepCloneDefinition(o):i[n]=o}),i}function getAllValuesInObject(s){if(!s)return[];const e=Object;if(typeof e.values=="function")return e.values(s);const t=[];for(const i in s)s.hasOwnProperty(i)&&s.propertyIsEnumerable(i)&&t.push(s[i]);return t}function mergeDeep(s,e,t=!0,i=!1){exists(e)&&iterateObject(e,(n,o)=>{let r=s[n];r!==o&&(i&&r==null&&o!=null&&typeof o=="object"&&o.constructor===Object&&(r={},s[n]=r),isNonNullObject(o)&&isNonNullObject(r)&&!Array.isArray(r)?mergeDeep(r,o,t,i):(t||o!==void 0)&&(s[n]=o))})}function getValueUsingField(s,e,t){if(!e||!s)return;if(!t)return s[e];const i=e.split(".");let n=s;for(let o=0;o<i.length;o++){if(n==null)return;n=n[i[o]]}return n}function removeAllReferences(s,e=[],t){Object.keys(s).forEach(r=>{typeof s[r]=="object"&&!e.includes(r)&&(s[r]=void 0)});const i=Object.getPrototypeOf(s),n={},o=r=>`AG Grid: Grid API function ${r}() cannot be called as the grid has been destroyed.
|
||
It is recommended to remove local references to the grid api. Alternatively, check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.
|
||
To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${t}`;Object.getOwnPropertyNames(i).forEach(r=>{if(typeof i[r]=="function"&&!e.includes(r)){const l=()=>{console.warn(o(r))};n[r]={value:l,writable:!0}}}),Object.defineProperties(s,n)}function isNonNullObject(s){return typeof s=="object"&&s!==null}const ObjectUtils=Object.freeze(Object.defineProperty({__proto__:null,cloneObject,deepCloneDefinition,getAllValuesInObject,getValueUsingField,isNonNullObject,iterateObject,mergeDeep,removeAllReferences},Symbol.toStringTag,{value:"Module"})),doOnceFlags={};function doOnce(s,e){doOnceFlags[e]||(s(),doOnceFlags[e]=!0)}function warnOnce(s){doOnce(()=>console.warn("AG Grid: "+s),s)}function errorOnce(s){doOnce(()=>console.error("AG Grid: "+s),s)}function getFunctionName(s){if(s.name)return s.name;const e=/function\s+([^\(]+)/.exec(s.toString());return e&&e.length===2?e[1].trim():null}function isFunction(s){return!!(s&&s.constructor&&s.call&&s.apply)}function executeInAWhile(s){executeAfter(s,400)}const executeNextVMTurnFuncs=[];let executeNextVMTurnPending=!1;function executeNextVMTurn(s){executeNextVMTurnFuncs.push(s),!executeNextVMTurnPending&&(executeNextVMTurnPending=!0,window.setTimeout(()=>{const e=executeNextVMTurnFuncs.slice();executeNextVMTurnFuncs.length=0,executeNextVMTurnPending=!1,e.forEach(t=>t())},0))}function executeAfter(s,e=0){s.length>0&&window.setTimeout(()=>s.forEach(t=>t()),e)}function debounce(s,e){let t;return function(...i){const n=this;window.clearTimeout(t),t=window.setTimeout(function(){s.apply(n,i)},e)}}function throttle(s,e){let t=0;return function(...i){const n=this,o=new Date().getTime();o-t<e||(t=o,s.apply(n,i))}}function waitUntil(s,e,t=100,i){const n=new Date().getTime();let o=null,r=!1;const a=()=>{const l=new Date().getTime()-n>t;(s()||l)&&(e(),r=!0,o!=null&&(window.clearInterval(o),o=null),l&&i&&console.warn(i))};a(),r||(o=window.setInterval(a,10))}function compose(...s){return e=>s.reduce((t,i)=>i(t),e)}const noop=()=>{},FunctionUtils=Object.freeze(Object.defineProperty({__proto__:null,compose,debounce,doOnce,errorOnce,executeAfter,executeInAWhile,executeNextVMTurn,getFunctionName,isFunction,noop,throttle,waitUntil,warnOnce},Symbol.toStringTag,{value:"Module"}));var ModuleNames;(function(s){s.CommunityCoreModule="@ag-grid-community/core",s.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",s.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",s.CsvExportModule="@ag-grid-community/csv-export",s.EnterpriseCoreModule="@ag-grid-enterprise/core",s.RowGroupingModule="@ag-grid-enterprise/row-grouping",s.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",s.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",s.MenuModule="@ag-grid-enterprise/menu",s.SetFilterModule="@ag-grid-enterprise/set-filter",s.MultiFilterModule="@ag-grid-enterprise/multi-filter",s.StatusBarModule="@ag-grid-enterprise/status-bar",s.SideBarModule="@ag-grid-enterprise/side-bar",s.RangeSelectionModule="@ag-grid-enterprise/range-selection",s.MasterDetailModule="@ag-grid-enterprise/master-detail",s.RichSelectModule="@ag-grid-enterprise/rich-select",s.GridChartsModule="@ag-grid-enterprise/charts",s.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",s.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",s.ExcelExportModule="@ag-grid-enterprise/excel-export",s.ClipboardModule="@ag-grid-enterprise/clipboard",s.SparklinesModule="@ag-grid-enterprise/sparklines",s.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",s.AngularModule="@ag-grid-community/angular",s.ReactModule="@ag-grid-community/react",s.VueModule="@ag-grid-community/vue"})(ModuleNames||(ModuleNames={}));class ModuleRegistry{static register(e){ModuleRegistry.__register(e,!0,void 0)}static registerModules(e){ModuleRegistry.__registerModules(e,!0,void 0)}static __register(e,t,i){ModuleRegistry.runVersionChecks(e),i!==void 0?(ModuleRegistry.areGridScopedModules=!0,ModuleRegistry.gridModulesMap[i]===void 0&&(ModuleRegistry.gridModulesMap[i]={}),ModuleRegistry.gridModulesMap[i][e.moduleName]=e):ModuleRegistry.globalModulesMap[e.moduleName]=e,ModuleRegistry.setModuleBased(t)}static __unRegisterGridModules(e){delete ModuleRegistry.gridModulesMap[e]}static __registerModules(e,t,i){ModuleRegistry.setModuleBased(t),e&&e.forEach(n=>ModuleRegistry.__register(n,t,i))}static isValidModuleVersion(e){const[t,i]=e.version.split(".")||[],[n,o]=ModuleRegistry.currentModuleVersion.split(".")||[];return t===n&&i===o}static runVersionChecks(e){if(ModuleRegistry.currentModuleVersion||(ModuleRegistry.currentModuleVersion=e.version),e.version?ModuleRegistry.isValidModuleVersion(e)||console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${e.moduleName}' is version ${e.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`):console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${e.moduleName}' is incompatible. Please update all modules to the same version.`),e.validate){const t=e.validate();t.isValid||console.error(`AG Grid: ${t.message}`)}}static setModuleBased(e){ModuleRegistry.moduleBased===void 0?ModuleRegistry.moduleBased=e:ModuleRegistry.moduleBased!==e&&doOnce(()=>{console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/javascript-grid/packages-modules/ for more information.")},"ModulePackageCheck")}static __setIsBundled(){ModuleRegistry.isBundled=!0}static __assertRegistered(e,t,i){var n;if(this.__isRegistered(e,i))return!0;const o=t+e;let r;if(ModuleRegistry.isBundled)r=`AG Grid: unable to use ${t} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:
|
||
|
||
<script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>
|
||
|
||
For more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(ModuleRegistry.moduleBased||ModuleRegistry.moduleBased===void 0){let a=(n=Object.entries(ModuleNames).find(([l,d])=>d===e))===null||n===void 0?void 0:n[0];r=`AG Grid: unable to use ${t} as the ${a} is not registered${ModuleRegistry.areGridScopedModules?` for gridId: ${i}`:""}. Check if you have registered the module:
|
||
|
||
import { ModuleRegistry } from '@ag-grid-community/core';
|
||
import { ${a} } from '${e}';
|
||
|
||
ModuleRegistry.registerModules([ ${a} ]);
|
||
|
||
For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else r=`AG Grid: unable to use ${t} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:
|
||
|
||
import 'ag-grid-enterprise';
|
||
|
||
For more info see: https://www.ag-grid.com/javascript-grid/packages/`;return doOnce(()=>{console.warn(r)},o),!1}static __warnEnterpriseChartDisabled(e){const i="ag-charts-enterprise"+":"+e,o=`AG Grid: the '${e}' chart type is not supported in AG Charts Community. See https://ag-grid.com/javascript-data-grid/integrated-charts/ for more details.`;doOnce(()=>{console.warn(o)},i)}static __isRegistered(e,t){var i;return!!ModuleRegistry.globalModulesMap[e]||!!(!((i=ModuleRegistry.gridModulesMap[t])===null||i===void 0)&&i[e])}static __getRegisteredModules(e){return[...values(ModuleRegistry.globalModulesMap),...values(ModuleRegistry.gridModulesMap[e]||{})]}static __getGridRegisteredModules(e){var t;return values((t=ModuleRegistry.gridModulesMap[e])!==null&&t!==void 0?t:{})||[]}static __isPackageBased(){return!ModuleRegistry.moduleBased}}ModuleRegistry.globalModulesMap={};ModuleRegistry.gridModulesMap={};ModuleRegistry.areGridScopedModules=!1;class Context{constructor(e,t){if(this.beanWrappers={},this.destroyed=!1,!e||!e.beanClasses)return;this.contextParams=e,this.logger=t,this.logger.log(">> creating ag-Application Context"),this.createBeans();const i=this.getBeanInstances();this.wireBeans(i),this.logger.log(">> ag-Application Context ready - component is alive")}getBeanInstances(){return values(this.beanWrappers).map(e=>e.beanInstance)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.wireBeans([e],t),e}wireBeans(e,t){this.autoWireBeans(e),this.methodWireBeans(e),this.callLifeCycleMethods(e,"preConstructMethods"),exists(t)&&e.forEach(t),this.callLifeCycleMethods(e,"postConstructMethods")}createBeans(){this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),iterateObject(this.beanWrappers,(t,i)=>{let n;i.bean.__agBeanMetaData&&i.bean.__agBeanMetaData.autowireMethods&&i.bean.__agBeanMetaData.autowireMethods.agConstructor&&(n=i.bean.__agBeanMetaData.autowireMethods.agConstructor);const o=this.getBeansForParameters(n,i.bean.name),r=new(i.bean.bind.apply(i.bean,[null,...o]));i.beanInstance=r});const e=Object.keys(this.beanWrappers).join(", ");this.logger.log(`created beans: ${e}`)}createBeanWrapper(e){const t=e.__agBeanMetaData;if(!t){let n;e.prototype.constructor?n=getFunctionName(e.prototype.constructor):n=""+e,console.error(`Context item ${n} is not a bean`);return}const i={bean:e,beanInstance:null,beanName:t.beanName};this.beanWrappers[t.beanName]=i}autoWireBeans(e){e.forEach(t=>{this.forEachMetaDataInHierarchy(t,(i,n)=>{const o=i.agClassAttributes;o&&o.forEach(r=>{const a=this.lookupBeanInstance(n,r.beanName,r.optional);t[r.attributeName]=a})})})}methodWireBeans(e){e.forEach(t=>{this.forEachMetaDataInHierarchy(t,(i,n)=>{iterateObject(i.autowireMethods,(o,r)=>{if(o==="agConstructor")return;const a=this.getBeansForParameters(r,n);t[o].apply(t,a)})})})}forEachMetaDataInHierarchy(e,t){let i=Object.getPrototypeOf(e);for(;i!=null;){const n=i.constructor;if(n.hasOwnProperty("__agBeanMetaData")){const o=n.__agBeanMetaData,r=this.getBeanName(n);t(o,r)}i=Object.getPrototypeOf(i)}}getBeanName(e){if(e.__agBeanMetaData&&e.__agBeanMetaData.beanName)return e.__agBeanMetaData.beanName;const t=e.toString();return t.substring(9,t.indexOf("("))}getBeansForParameters(e,t){const i=[];return e&&iterateObject(e,(n,o)=>{const r=this.lookupBeanInstance(t,o);i[Number(n)]=r}),i}lookupBeanInstance(e,t,i=!1){if(this.destroyed)return this.logger.log(`AG Grid: bean reference ${t} is used after the grid is destroyed!`),null;if(t==="context")return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(t))return this.contextParams.providedBeanInstances[t];const n=this.beanWrappers[t];return n?n.beanInstance:(i||console.error(`AG Grid: unable to find bean reference ${t} while initialising ${e}`),null)}callLifeCycleMethods(e,t){e.forEach(i=>this.callLifeCycleMethodsOnBean(i,t))}callLifeCycleMethodsOnBean(e,t,i){const n={};this.forEachMetaDataInHierarchy(e,r=>{const a=r[t];a&&a.forEach(l=>{l!=i&&(n[l]=!0)})}),Object.keys(n).forEach(r=>e[r]())}getBean(e){return this.lookupBeanInstance("getBean",e,!0)}destroy(){if(this.destroyed)return;this.destroyed=!0,this.logger.log(">> Shutting down ag-Application Context");const e=this.getBeanInstances();this.destroyBeans(e),this.contextParams.providedBeanInstances=null,ModuleRegistry.__unRegisterGridModules(this.contextParams.gridId),this.logger.log(">> ag-Application Context shut down - component is dead")}destroyBean(e){e&&this.destroyBeans([e])}destroyBeans(e){return e?(e.forEach(t=>{this.callLifeCycleMethodsOnBean(t,"preDestroyMethods","destroy");const i=t;typeof i.destroy=="function"&&i.destroy()}),[]):[]}isDestroyed(){return this.destroyed}getGridId(){return this.contextParams.gridId}}function PreConstruct(s,e,t){const i=getOrCreateProps$1(s.constructor);i.preConstructMethods||(i.preConstructMethods=[]),i.preConstructMethods.push(e)}function PostConstruct(s,e,t){const i=getOrCreateProps$1(s.constructor);i.postConstructMethods||(i.postConstructMethods=[]),i.postConstructMethods.push(e)}function PreDestroy(s,e,t){const i=getOrCreateProps$1(s.constructor);i.preDestroyMethods||(i.preDestroyMethods=[]),i.preDestroyMethods.push(e)}function Bean(s){return e=>{const t=getOrCreateProps$1(e);t.beanName=s}}function Autowired(s){return(e,t,i)=>{autowiredFunc(e,s,!1,e,t,null)}}function Optional(s){return(e,t,i)=>{autowiredFunc(e,s,!0,e,t,null)}}function autowiredFunc(s,e,t,i,n,o){if(e===null){console.error("AG Grid: Autowired name should not be null");return}if(typeof o=="number"){console.error("AG Grid: Autowired should be on an attribute");return}const r=getOrCreateProps$1(s.constructor);r.agClassAttributes||(r.agClassAttributes=[]),r.agClassAttributes.push({attributeName:n,beanName:e,optional:t})}function Qualifier(s){return(e,t,i)=>{const n=typeof e=="function"?e:e.constructor;let o;if(typeof i=="number"){let r;t?(o=getOrCreateProps$1(n),r=t):(o=getOrCreateProps$1(n),r="agConstructor"),o.autowireMethods||(o.autowireMethods={}),o.autowireMethods[r]||(o.autowireMethods[r]={}),o.autowireMethods[r][i]=s}}}function getOrCreateProps$1(s){return s.hasOwnProperty("__agBeanMetaData")||(s.__agBeanMetaData={}),s.__agBeanMetaData}var __decorate$2F=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},__param$8=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}};let EventService=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setBeans(e,t,i=null,n=null){if(this.frameworkOverrides=t,this.gridOptionsService=e,i){const o=e.useAsyncEvents();this.addGlobalListener(i,o)}n&&this.addGlobalListener(n,!1)}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const n=t?this.allAsyncListeners:this.allSyncListeners;let o=n.get(e);return!o&&i&&(o=new Set,n.set(e,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const n=this.getListeners(e,i,!1);n&&(n.delete(t),n.size===0&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){let t=e;this.gridOptionsService&&this.gridOptionsService.addGridCommonParams(t),this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){var i;const n=e.type;if(t&&"event"in e){const d=e.event;d instanceof Event&&(e.eventPath=d.composedPath())}const o=(d,h)=>d.forEach(p=>{if(!h.has(p))return;const m=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>p(e)):()=>p(e);t?this.dispatchAsync(m):m()}),r=(i=this.getListeners(n,t,!1))!==null&&i!==void 0?i:new Set,a=new Set(r);a.size>0&&o(a,r),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(d=>{const h=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>d(n,e)):()=>d(n,e);t?this.dispatchAsync(h):h()})}dispatchAsync(e){this.asyncFunctionsQueue.push(e),this.scheduled||(this.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)}),this.scheduled=!0)}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(t=>t())}};__decorate$2F([__param$8(0,Qualifier("gridOptionsService")),__param$8(1,Qualifier("frameworkOverrides")),__param$8(2,Qualifier("globalEventListener")),__param$8(3,Qualifier("globalSyncEventListener"))],EventService.prototype,"setBeans",null);EventService=__decorate$2F([Bean("eventService")],EventService);class FrameworkEventListenerService{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=i=>{this.frameworkOverrides.wrapOutgoing(()=>e(i))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(i,n)=>{this.frameworkOverrides.wrapOutgoing(()=>e(i,n))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){var t;return(t=this.wrappedListeners.get(e))!==null&&t!==void 0?t:e}unwrapGlobal(e){var t;return(t=this.wrappedGlobalListeners.get(e))!==null&&t!==void 0?t:e}}var __decorate$2E=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const COL_DEF_DEFAULTS={resizable:!0,sortable:!0};let instanceIdSequence$4=0;function getNextColInstanceId(){return instanceIdSequence$4++}class Column{constructor(e,t,i,n){this.instanceId=getNextColInstanceId(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new EventService,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=n,this.setState(e)}getInstanceId(){return this.instanceId}setState(e){e.sort!==void 0?(e.sort==="asc"||e.sort==="desc")&&(this.sort=e.sort):(e.initialSort==="asc"||e.initialSort==="desc")&&(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;t!==void 0?t!==null&&(this.sortIndex=t):i!==null&&(this.sortIndex=i);const n=e.hide,o=e.initialHide;n!==void 0?this.visible=!n:this.visible=!o,e.pinned!==void 0?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const r=e.flex,a=e.initialFlex;r!==void 0?this.flex=r:a!==void 0&&(this.flex=a)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.eventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}initialise(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gridOptionsService.get("suppressFieldDotNotation");this.fieldContainsDots=exists(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=exists(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=this.columnUtils.calculateColMinWidth(e),this.maxWidth=this.columnUtils.calculateColMaxWidth(e)}initTooltip(){this.tooltipEnabled=exists(this.colDef.tooltipField)||exists(this.colDef.tooltipValueGetter)||exists(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.columnUtils.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(missing(this.colDef)||missing(this.colDef.showRowGroup))return!1;const t=this.colDef.showRowGroup===!0,i=this.colDef.showRowGroup===e;return t||i}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(e,t){var i,n;this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new FrameworkEventListenerService(this.frameworkOverrides));const o=(n=(i=this.frameworkEventListenerService)===null||i===void 0?void 0:i.wrap(t))!==null&&n!==void 0?n:t;this.eventService.addEventListener(e,o)}removeEventListener(e,t){var i,n;const o=(n=(i=this.frameworkEventListenerService)===null||i===void 0?void 0:i.unwrap(t))!==null&&n!==void 0?n:t;this.eventService.removeEventListener(e,o)}createColumnFunctionCallbackParams(e){return this.gridOptionsService.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if(typeof this.colDef.suppressNavigable=="boolean")return this.colDef.suppressNavigable;if(typeof this.colDef.suppressNavigable=="function"){const t=this.createColumnFunctionCallbackParams(e),i=this.colDef.suppressNavigable;return i(t)}return!1}isCellEditable(e){return e.group&&!this.gridOptionsService.get("enableGroupEdit")?!1:this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){var t;return(t=this.colDef[e])!==null&&t!==void 0?t:COL_DEF_DEFAULTS[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const i=this.createColumnFunctionCallbackParams(e);return t(i)}return!1}setMoving(e,t){this.moving=e,this.eventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gridOptionsService.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.eventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.eventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return missing(this.sort)}isSorting(){return exists(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.eventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,i){this.filterActive!==e&&(this.filterActive=e,this.eventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const n=this.createColumnEvent("filterChanged",t);i&&mergeDeep(n,i),this.eventService.dispatchEvent(n)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){e===!0||e==="left"?this.pinned="left":e==="right"?this.pinned="right":this.pinned=null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const i=e===!0;this.visible!==i&&(this.visible=i,this.eventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}getColDef(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getDefinition(){return this.colDef}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return this.gridOptionsService.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(missing(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(missing(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){this.minWidth!=null&&(e=Math.max(e,this.minWidth)),this.maxWidth!=null&&(e=Math.min(e,this.maxWidth)),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.eventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return this.maxWidth!=null?e>this.maxWidth:!1}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){exists(this.minWidth)&&this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}getMenuTabs(e){warnOnce("As of v31.1, 'getMenuTabs' is deprecated. Use 'getColDef().menuTabs ?? defaultValues' instead.");let t=this.getColDef().menuTabs;return t==null&&(t=e),t}dispatchStateUpdatedEvent(e){this.eventService.dispatchEvent({type:Column.EVENT_STATE_UPDATED,key:e})}}Column.EVENT_MOVING_CHANGED="movingChanged";Column.EVENT_LEFT_CHANGED="leftChanged";Column.EVENT_WIDTH_CHANGED="widthChanged";Column.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged";Column.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged";Column.EVENT_VISIBLE_CHANGED="visibleChanged";Column.EVENT_FILTER_CHANGED="filterChanged";Column.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged";Column.EVENT_SORT_CHANGED="sortChanged";Column.EVENT_COL_DEF_CHANGED="colDefChanged";Column.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged";Column.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged";Column.EVENT_PIVOT_CHANGED="columnPivotChanged";Column.EVENT_VALUE_CHANGED="columnValueChanged";Column.EVENT_STATE_UPDATED="columnStateUpdated";__decorate$2E([Autowired("gridOptionsService")],Column.prototype,"gridOptionsService",void 0);__decorate$2E([Autowired("columnUtils")],Column.prototype,"columnUtils",void 0);__decorate$2E([Autowired("columnHoverService")],Column.prototype,"columnHoverService",void 0);__decorate$2E([Autowired("frameworkOverrides")],Column.prototype,"frameworkOverrides",void 0);__decorate$2E([PostConstruct],Column.prototype,"initialise",null);var __decorate$2D=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class ProvidedColumnGroup{constructor(e,t,i,n){this.localEventService=new EventService,this.expandable=!1,this.instanceId=getNextColInstanceId(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=n}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0)}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e;const t={type:ProvidedColumnGroup.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(t)}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){this.children&&this.children.forEach(t=>{t instanceof Column?e.push(t):t instanceof ProvidedColumnGroup&&t.addLeafColumns(e)})}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach(t=>t.addEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(t=>t.removeEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,i=!1;const n=this.findChildrenRemovingPadding();for(let r=0,a=n.length;r<a;r++){const l=n[r];if(!l.isVisible())continue;const d=l.getColumnGroupShow();d==="open"?(e=!0,i=!0):d==="closed"?(t=!0,i=!0):(e=!0,t=!0)}const o=e&&t&&i;if(this.expandable!==o){this.expandable=o;const r={type:ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(r)}}findChildrenRemovingPadding(){const e=[],t=i=>{i.forEach(n=>{n instanceof ProvidedColumnGroup&&n.isPadding()?t(n.children):e.push(n)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}}ProvidedColumnGroup.EVENT_EXPANDED_CHANGED="expandedChanged";ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED="expandableChanged";__decorate$2D([PreDestroy],ProvidedColumnGroup.prototype,"destroy",null);const DefaultColumnTypes={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function existsAndNotEmpty(s){return s!=null&&s.length>0}function last(s){if(!(!s||!s.length))return s[s.length-1]}function areEqual(s,e,t){return s==null&&e==null?!0:s!=null&&e!=null&&s.length===e.length&&s.every((i,n)=>t?t(i,e[n]):e[n]===i)}function shallowCompare(s,e){return areEqual(s,e)}function sortNumerically(s){return s.sort((e,t)=>e-t)}function removeRepeatsFromArray(s,e){if(s)for(let t=s.length-2;t>=0;t--){const i=s[t]===e,n=s[t+1]===e;i&&n&&s.splice(t+1,1)}}function removeFromUnorderedArray(s,e){const t=s.indexOf(e);t>=0&&(s[t]=s[s.length-1],s.pop())}function removeFromArray(s,e){const t=s.indexOf(e);t>=0&&s.splice(t,1)}function removeAllFromUnorderedArray(s,e){for(let t=0;t<e.length;t++)removeFromUnorderedArray(s,e[t])}function removeAllFromArray(s,e){for(let t=0;t<e.length;t++)removeFromArray(s,e[t])}function insertIntoArray(s,e,t){s.splice(t,0,e)}function insertArrayIntoArray(s,e,t){if(!(s==null||e==null))for(let i=e.length-1;i>=0;i--){const n=e[i];insertIntoArray(s,n,t)}}function moveInArray(s,e,t){removeAllFromArray(s,e),e.slice().reverse().forEach(i=>insertIntoArray(s,i,t))}function includes(s,e){return s.indexOf(e)>-1}function flatten(s){return[].concat.apply([],s)}function pushAll(s,e){e==null||s==null||e.forEach(t=>s.push(t))}function toStrings(s){return s.map(toStringOrNull)}function forEachReverse(s,e){if(s!=null)for(let t=s.length-1;t>=0;t--)e(s[t],t)}const ArrayUtils=Object.freeze(Object.defineProperty({__proto__:null,areEqual,existsAndNotEmpty,flatten,forEachReverse,includes,insertArrayIntoArray,insertIntoArray,last,moveInArray,pushAll,removeAllFromArray,removeAllFromUnorderedArray,removeFromArray,removeFromUnorderedArray,removeRepeatsFromArray,shallowCompare,sortNumerically,toStrings},Symbol.toStringTag,{value:"Module"})),AG_GRID_STOP_PROPAGATION="__ag_Grid_Stop_Propagation",PASSIVE_EVENTS$1=["touchstart","touchend","touchmove","touchcancel","scroll"],supports={};function stopPropagationForAgGrid(s){s[AG_GRID_STOP_PROPAGATION]=!0}function isStopPropagationForAgGrid(s){return s[AG_GRID_STOP_PROPAGATION]===!0}const isEventSupported=(()=>{const s={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if(typeof supports[t]=="boolean")return supports[t];const i=document.createElement(s[t]||"div");return t="on"+t,supports[t]=t in i}})();function getCtrlForEventTarget(s,e,t){let i=e;for(;i;){const n=s.getDomData(i,t);if(n)return n;i=i.parentElement}return null}function isElementInEventPath(s,e){return!e||!s?!1:getEventPath(e).indexOf(s)>=0}function createEventPath(s){const e=[];let t=s.target;for(;t;)e.push(t),t=t.parentElement;return e}function getEventPath(s){const e=s;return e.path?e.path:e.composedPath?e.composedPath():createEventPath(e)}function addSafePassiveEventListener(s,e,t,i){const o=includes(PASSIVE_EVENTS$1,t)?{passive:!0}:void 0;s&&s.addEventListener&&s.addEventListener(e,t,i,o)}const EventUtils=Object.freeze(Object.defineProperty({__proto__:null,addSafePassiveEventListener,createEventPath,getCtrlForEventTarget,getEventPath,isElementInEventPath,isEventSupported,isStopPropagationForAgGrid,stopPropagationForAgGrid},Symbol.toStringTag,{value:"Module"}));var __decorate$2C=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class BeanStub{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.lastChangeSetIdLookup={},this.propertyListenerId=0,this.isAlive=()=>!this.destroyed}getFrameworkOverrides(){return this.frameworkOverrides}getContext(){return this.context}destroy(){this.destroyFunctions.forEach(e=>e()),this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:BeanStub.EVENT_DESTROYED})}addEventListener(e,t){this.localEventService||(this.localEventService=new EventService),this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService&&this.localEventService.removeEventListener(e,t)}dispatchEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedListener(e,t,i){if(this.destroyed)return;e instanceof HTMLElement?addSafePassiveEventListener(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const n=()=>(e.removeEventListener(t,i),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==n),null);return this.destroyFunctions.push(n),n}setupGridOptionListener(e,t){this.gridOptionsService.addEventListener(e,t);const i=()=>(this.gridOptionsService.removeEventListener(e,t),this.destroyFunctions=this.destroyFunctions.filter(n=>n!==i),null);return this.destroyFunctions.push(i),i}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,n=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=o.changeSet.id}const r={type:"gridPropertyChanged",changeSet:o.changeSet,source:o.source};t(r)};e.forEach(o=>this.setupGridOptionListener(o,n))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.getContext()).createBean(e,i)}destroyBean(e,t){return(t||this.getContext()).destroyBean(e)}destroyBeans(e,t){return e&&e.forEach(i=>this.destroyBean(i,t)),[]}}BeanStub.EVENT_DESTROYED="destroyed";__decorate$2C([Autowired("frameworkOverrides")],BeanStub.prototype,"frameworkOverrides",void 0);__decorate$2C([Autowired("context")],BeanStub.prototype,"context",void 0);__decorate$2C([Autowired("eventService")],BeanStub.prototype,"eventService",void 0);__decorate$2C([Autowired("gridOptionsService")],BeanStub.prototype,"gridOptionsService",void 0);__decorate$2C([Autowired("localeService")],BeanStub.prototype,"localeService",void 0);__decorate$2C([Autowired("environment")],BeanStub.prototype,"environment",void 0);__decorate$2C([PreDestroy],BeanStub.prototype,"destroy",null);var __decorate$2B=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},__param$7=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}};let ColumnFactory=class extends BeanStub{setBeans(e){this.logger=e.create("ColumnFactory")}createColumnTree(e,t,i,n){const o=new ColumnKeyCreator,{existingCols:r,existingGroups:a,existingColKeys:l}=this.extractExistingTreeData(i);o.addExistingKeys(l);const d=this.recursivelyCreateColumns(e,0,t,r,o,a,n),h=this.findMaxDept(d,0);this.logger.log("Number of levels for grouped columns is "+h);const p=this.balanceColumnTree(d,0,h,o),m=(v,y)=>{v instanceof ProvidedColumnGroup&&v.setupExpandable(),v.setOriginalParent(y)};return this.columnUtils.depthFirstOriginalTreeSearch(null,p,m),{columnTree:p,treeDept:h}}extractExistingTreeData(e){const t=[],i=[],n=[];return e&&this.columnUtils.depthFirstOriginalTreeSearch(null,e,o=>{if(o instanceof ProvidedColumnGroup){const r=o;i.push(r)}else{const r=o;n.push(r.getId()),t.push(r)}}),{existingCols:t,existingGroups:i,existingColKeys:n}}createForAutoGroups(e,t){return e.map(i=>this.createAutoGroupTreeItem(t,i))}createAutoGroupTreeItem(e,t){const i=this.findDepth(e);let n=t;for(let o=i-1;o>=0;o--){const r=new ProvidedColumnGroup(null,`FAKE_PATH_${t.getId()}}_${o}`,!0,o);this.createBean(r),r.setChildren([n]),n.setOriginalParent(r),n=r}return i===0&&t.setOriginalParent(null),n}findDepth(e){let t=0,i=e;for(;i&&i[0]&&i[0]instanceof ProvidedColumnGroup;)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,n){const o=[];for(let r=0;r<e.length;r++){const a=e[r];if(a instanceof ProvidedColumnGroup){const l=a,d=this.balanceColumnTree(l.getChildren(),t+1,i,n);l.setChildren(d),o.push(l)}else{let l,d;for(let h=i-1;h>=t;h--){const p=n.getUniqueKey(null,null),m=this.createMergedColGroupDef(null),v=new ProvidedColumnGroup(m,p,!0,t);this.createBean(v),d&&d.setChildren([v]),d=v,l||(l=d)}if(l&&d)if(o.push(l),e.some(p=>p instanceof ProvidedColumnGroup)){d.setChildren([a]);continue}else{d.setChildren(e);break}o.push(a)}}return o}findMaxDept(e,t){let i=t;for(let n=0;n<e.length;n++){const o=e[n];if(o instanceof ProvidedColumnGroup){const r=o,a=this.findMaxDept(r.getChildren(),t+1);i<a&&(i=a)}}return i}recursivelyCreateColumns(e,t,i,n,o,r,a){if(!e)return[];const l=new Array(e.length);for(let d=0;d<l.length;d++){const h=e[d];this.isColumnGroup(h)?l[d]=this.createColumnGroup(i,h,t,n,o,r,a):l[d]=this.createColumn(i,h,n,o,a)}return l}createColumnGroup(e,t,i,n,o,r,a){const l=this.createMergedColGroupDef(t),d=o.getUniqueKey(l.groupId||null,null),h=new ProvidedColumnGroup(l,d,!1,i);this.createBean(h);const p=this.findExistingGroup(t,r);p&&r.splice(p.idx,1);let m=p==null?void 0:p.group;m&&h.setExpanded(m.isExpanded());const v=this.recursivelyCreateColumns(l.children,i+1,e,n,o,r,a);return h.setChildren(v),h}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gridOptionsService.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,n,o){const r=this.findExistingColumn(t,i);r&&(i==null||i.splice(r.idx,1));let a=r==null?void 0:r.column;if(a){const l=this.addColumnDefaultAndTypes(t,a.getColId());a.setColDef(l,t,o),this.applyColumnState(a,l,o)}else{const l=n.getUniqueKey(t.colId,t.field),d=this.addColumnDefaultAndTypes(t,l);a=new Column(d,t,l,e),this.context.createBean(a)}return this.dataTypeService.addColumnListeners(a),a}applyColumnState(e,t,i){const n=attrToNumber(t.flex);if(n!==void 0&&e.setFlex(n),e.getFlex()<=0){const l=attrToNumber(t.width);if(l!=null)e.setActualWidth(l,i);else{const d=e.getActualWidth();e.setActualWidth(d,i)}}t.sort!==void 0&&(t.sort=="asc"||t.sort=="desc"?e.setSort(t.sort,i):e.setSort(void 0,i));const r=attrToNumber(t.sortIndex);r!==void 0&&e.setSortIndex(r);const a=attrToBoolean(t.hide);a!==void 0&&e.setVisible(!a,i),t.pinned!==void 0&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const n=t[i].getUserProvidedColDef();if(!n)continue;if(e.colId!=null){if(t[i].getId()===e.colId)return{idx:i,column:t[i]};continue}if(e.field!=null){if(n.field===e.field)return{idx:i,column:t[i]};continue}if(n===e)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(e.groupId!=null)for(let n=0;n<t.length;n++){const o=t[n];if(o.getColGroupDef()&&o.getId()===e.groupId)return{idx:n,group:o}}}addColumnDefaultAndTypes(e,t){const i={},n=this.gridOptionsService.get("defaultColDef");mergeDeep(i,n,!1,!0);const o=this.dataTypeService.updateColDefAndGetColumnType(i,e,t);o&&this.assignColumnTypes(o,i),mergeDeep(i,e,!1,!0);const r=this.gridOptionsService.get("autoGroupColumnDef"),a=this.gridOptionsService.isColumnsSortingCoupledToGroup();return e.rowGroup&&r&&a&&mergeDeep(i,{sort:r.sort,initialSort:r.initialSort},!1,!0),this.dataTypeService.validateColDef(i),i}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},DefaultColumnTypes),n=this.gridOptionsService.get("columnTypes")||{};iterateObject(n,(o,r)=>{o in i?console.warn(`AG Grid: the column type '${o}' is a default column type and cannot be overridden.`):(r.type&&warnOnce("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[o]=r)}),e.forEach(o=>{const r=i[o.trim()];r?mergeDeep(t,r,!1,!0):console.warn("AG Grid: colDef.type '"+o+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return e.children!==void 0}};__decorate$2B([Autowired("columnUtils")],ColumnFactory.prototype,"columnUtils",void 0);__decorate$2B([Autowired("dataTypeService")],ColumnFactory.prototype,"dataTypeService",void 0);__decorate$2B([__param$7(0,Qualifier("loggerFactory"))],ColumnFactory.prototype,"setBeans",null);ColumnFactory=__decorate$2B([Bean("columnFactory")],ColumnFactory);var __decorate$2A=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class ColumnGroup{constructor(e,t,i,n){this.displayedChildren=[],this.localEventService=new EventService,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=n}static createUniqueId(e,t){return e+"_"+t}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return ColumnGroup.createUniqueId(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){if(this.displayedChildren.forEach(e=>{e instanceof ColumnGroup&&e.checkLeft()}),this.displayedChildren.length>0)if(this.gridOptionsService.get("enableRtl")){const t=last(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_LEFT_CHANGED)))}getPinned(){return this.pinned}createAgEvent(e){return{type:e}}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}getGroupId(){return this.groupId}getPartId(){return this.partId}isChildInThisGroupDeepSearch(e){let t=!1;return this.children.forEach(i=>{e===i&&(t=!0),i instanceof ColumnGroup&&i.isChildInThisGroupDeepSearch(e)&&(t=!0)}),t}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach(t=>{e+=t.getActualWidth()}),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach(t=>{t.isResizable()&&(e=!0)}),e}getMinWidth(){let e=0;return this.displayedChildren.forEach(t=>{e+=t.getMinWidth()||0}),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(e){this.displayedChildren.forEach(t=>{t instanceof Column?e.push(t):t instanceof ColumnGroup&&t.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(t=>{t instanceof Column?e.push(t):t instanceof ColumnGroup&&t.addLeafColumns(e)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return!this.isPadding()||!e||!e.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e!=null&&e.isPadding();)e=e.getParent();if(!(e?e.providedColumnGroup.isExpandable():!1)){this.displayedChildren=this.children,this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED));return}this.children.forEach(i=>{if(i instanceof ColumnGroup&&(!i.displayedChildren||!i.displayedChildren.length))return;switch(i.getColumnGroupShow()){case"open":e.providedColumnGroup.isExpanded()&&this.displayedChildren.push(i);break;case"closed":e.providedColumnGroup.isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i);break}}),this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED))}}ColumnGroup.EVENT_LEFT_CHANGED="leftChanged";ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged";__decorate$2A([Autowired("gridOptionsService")],ColumnGroup.prototype,"gridOptionsService",void 0);class Events{}Events.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged";Events.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded";Events.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged";Events.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged";Events.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll";Events.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged";Events.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged";Events.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged";Events.EVENT_COLUMN_MOVED="columnMoved";Events.EVENT_COLUMN_VISIBLE="columnVisible";Events.EVENT_COLUMN_PINNED="columnPinned";Events.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened";Events.EVENT_COLUMN_RESIZED="columnResized";Events.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged";Events.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED="suppressMovableColumns";Events.EVENT_SUPPRESS_MENU_HIDE_CHANGED="suppressMenuHide";Events.EVENT_SUPPRESS_FIELD_DOT_NOTATION="suppressFieldDotNotation";Events.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged";Events.EVENT_COLUMN_HEADER_MOUSE_OVER="columnHeaderMouseOver";Events.EVENT_COLUMN_HEADER_MOUSE_LEAVE="columnHeaderMouseLeave";Events.EVENT_COLUMN_HEADER_CLICKED="columnHeaderClicked";Events.EVENT_COLUMN_HEADER_CONTEXT_MENU="columnHeaderContextMenu";Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed";Events.EVENT_ROW_GROUP_OPENED="rowGroupOpened";Events.EVENT_ROW_DATA_UPDATED="rowDataUpdated";Events.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged";Events.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged";Events.EVENT_CHART_CREATED="chartCreated";Events.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged";Events.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged";Events.EVENT_CHART_DESTROYED="chartDestroyed";Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged";Events.EVENT_TOOL_PANEL_SIZE_CHANGED="toolPanelSizeChanged";Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START="columnPanelItemDragStart";Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END="columnPanelItemDragEnd";Events.EVENT_MODEL_UPDATED="modelUpdated";Events.EVENT_CUT_START="cutStart";Events.EVENT_CUT_END="cutEnd";Events.EVENT_PASTE_START="pasteStart";Events.EVENT_PASTE_END="pasteEnd";Events.EVENT_FILL_START="fillStart";Events.EVENT_FILL_END="fillEnd";Events.EVENT_RANGE_DELETE_START="rangeDeleteStart";Events.EVENT_RANGE_DELETE_END="rangeDeleteEnd";Events.EVENT_UNDO_STARTED="undoStarted";Events.EVENT_UNDO_ENDED="undoEnded";Events.EVENT_REDO_STARTED="redoStarted";Events.EVENT_REDO_ENDED="redoEnded";Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START="keyShortcutChangedCellStart";Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END="keyShortcutChangedCellEnd";Events.EVENT_CELL_CLICKED="cellClicked";Events.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked";Events.EVENT_CELL_MOUSE_DOWN="cellMouseDown";Events.EVENT_CELL_CONTEXT_MENU="cellContextMenu";Events.EVENT_CELL_VALUE_CHANGED="cellValueChanged";Events.EVENT_CELL_EDIT_REQUEST="cellEditRequest";Events.EVENT_ROW_VALUE_CHANGED="rowValueChanged";Events.EVENT_CELL_FOCUSED="cellFocused";Events.EVENT_CELL_FOCUS_CLEARED="cellFocusCleared";Events.EVENT_FULL_WIDTH_ROW_FOCUSED="fullWidthRowFocused";Events.EVENT_ROW_SELECTED="rowSelected";Events.EVENT_SELECTION_CHANGED="selectionChanged";Events.EVENT_TOOLTIP_SHOW="tooltipShow";Events.EVENT_TOOLTIP_HIDE="tooltipHide";Events.EVENT_CELL_KEY_DOWN="cellKeyDown";Events.EVENT_CELL_MOUSE_OVER="cellMouseOver";Events.EVENT_CELL_MOUSE_OUT="cellMouseOut";Events.EVENT_FILTER_CHANGED="filterChanged";Events.EVENT_FILTER_MODIFIED="filterModified";Events.EVENT_FILTER_OPENED="filterOpened";Events.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED="advancedFilterBuilderVisibleChanged";Events.EVENT_SORT_CHANGED="sortChanged";Events.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved";Events.EVENT_ROW_CLICKED="rowClicked";Events.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked";Events.EVENT_GRID_READY="gridReady";Events.EVENT_GRID_PRE_DESTROYED="gridPreDestroyed";Events.EVENT_GRID_SIZE_CHANGED="gridSizeChanged";Events.EVENT_VIEWPORT_CHANGED="viewportChanged";Events.EVENT_SCROLLBAR_WIDTH_CHANGED="scrollbarWidthChanged";Events.EVENT_FIRST_DATA_RENDERED="firstDataRendered";Events.EVENT_DRAG_STARTED="dragStarted";Events.EVENT_DRAG_STOPPED="dragStopped";Events.EVENT_CHECKBOX_CHANGED="checkboxChanged";Events.EVENT_ROW_EDITING_STARTED="rowEditingStarted";Events.EVENT_ROW_EDITING_STOPPED="rowEditingStopped";Events.EVENT_CELL_EDITING_STARTED="cellEditingStarted";Events.EVENT_CELL_EDITING_STOPPED="cellEditingStopped";Events.EVENT_BODY_SCROLL="bodyScroll";Events.EVENT_BODY_SCROLL_END="bodyScrollEnd";Events.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged";Events.EVENT_PAGINATION_CHANGED="paginationChanged";Events.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged";Events.EVENT_STORE_REFRESHED="storeRefreshed";Events.EVENT_STATE_UPDATED="stateUpdated";Events.EVENT_COLUMN_MENU_VISIBLE_CHANGED="columnMenuVisibleChanged";Events.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged";Events.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED="columnContainerWidthChanged";Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged";Events.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged";Events.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged";Events.EVENT_FLASH_CELLS="flashCells";Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED="paginationPixelOffsetChanged";Events.EVENT_DISPLAYED_ROWS_CHANGED="displayedRowsChanged";Events.EVENT_LEFT_PINNED_WIDTH_CHANGED="leftPinnedWidthChanged";Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED="rightPinnedWidthChanged";Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED="rowContainerHeightChanged";Events.EVENT_HEADER_HEIGHT_CHANGED="headerHeightChanged";Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED="columnHeaderHeightChanged";Events.EVENT_ROW_DRAG_ENTER="rowDragEnter";Events.EVENT_ROW_DRAG_MOVE="rowDragMove";Events.EVENT_ROW_DRAG_LEAVE="rowDragLeave";Events.EVENT_ROW_DRAG_END="rowDragEnd";Events.EVENT_GRID_STYLES_CHANGED="gridStylesChanged";Events.EVENT_POPUP_TO_FRONT="popupToFront";Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest";Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest";Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest";Events.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest";Events.EVENT_STORE_UPDATED="storeUpdated";Events.EVENT_FILTER_DESTROYED="filterDestroyed";Events.EVENT_ROW_DATA_UPDATE_STARTED="rowDataUpdateStarted";Events.EVENT_ROW_COUNT_READY="rowCountReady";Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED="advancedFilterEnabledChanged";Events.EVENT_DATA_TYPES_INFERRED="dataTypesInferred";Events.EVENT_FIELD_VALUE_CHANGED="fieldValueChanged";Events.EVENT_FIELD_PICKER_VALUE_SELECTED="fieldPickerValueSelected";Events.EVENT_SIDE_BAR_UPDATED="sideBarUpdated";class GroupInstanceIdCreator{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return typeof t!="number"?i=0:i=t+1,this.existingIds[e]=i,i}}var __decorate$2z=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const GROUP_AUTO_COLUMN_ID="ag-Grid-AutoColumn";let AutoGroupColService=class extends BeanStub{createAutoGroupColumns(e){const t=[],i=this.gridOptionsService.get("treeData");let n=this.gridOptionsService.isGroupMultiAutoColumn();return i&&n&&(console.warn('AG Grid: you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),n=!1),n?e.forEach((o,r)=>{t.push(this.createOneAutoGroupColumn(o,r))}):t.push(this.createOneAutoGroupColumn()),t}updateAutoGroupColumns(e,t){e.forEach((i,n)=>this.updateOneAutoGroupColumn(i,n,t))}createOneAutoGroupColumn(e,t){let i;e?i=`${GROUP_AUTO_COLUMN_ID}-${e.getId()}`:i=GROUP_AUTO_COLUMN_ID;const n=this.createAutoGroupColDef(i,e,t);n.colId=i;const o=new Column(n,null,i,!0);return this.context.createBean(o),o}updateOneAutoGroupColumn(e,t,i){const n=e.getColDef(),o=typeof n.showRowGroup=="string"?n.showRowGroup:void 0,r=o!=null?this.columnModel.getPrimaryColumn(o):void 0,a=this.createAutoGroupColDef(e.getId(),r??void 0,t);e.setColDef(a,null,i),this.columnFactory.applyColumnState(e,a,i)}createAutoGroupColDef(e,t,i){let n=this.createBaseColDef(t);const o=this.gridOptionsService.get("autoGroupColumnDef");mergeDeep(n,o),n=this.columnFactory.addColumnDefaultAndTypes(n,e),this.gridOptionsService.get("treeData")||missing(n.field)&&missing(n.valueGetter)&&missing(n.filterValueGetter)&&n.filter!=="agGroupColumnFilter"&&(n.filter=!1),i&&i>0&&(n.headerCheckboxSelection=!1);const r=this.gridOptionsService.isColumnsSortingCoupledToGroup(),a=n.valueGetter||n.field!=null;return r&&!a&&(n.sortIndex=void 0,n.initialSort=void 0),n}createBaseColDef(e){const t=this.gridOptionsService.get("autoGroupColumnDef"),n={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(t&&(t.cellRenderer||t.cellRendererSelector)||(n.cellRenderer="agGroupCellRenderer"),e){const r=e.getColDef();Object.assign(n,{headerName:this.columnModel.getDisplayNameForColumn(e,"header"),headerValueGetter:r.headerValueGetter}),r.cellRenderer&&Object.assign(n,{cellRendererParams:{innerRenderer:r.cellRenderer,innerRendererParams:r.cellRendererParams}}),n.showRowGroup=e.getColId()}else n.showRowGroup=!0;return n}};__decorate$2z([Autowired("columnModel")],AutoGroupColService.prototype,"columnModel",void 0);__decorate$2z([Autowired("columnFactory")],AutoGroupColService.prototype,"columnFactory",void 0);AutoGroupColService=__decorate$2z([Bean("autoGroupColService")],AutoGroupColService);const reUnescapedHtml=/[&<>"']/g,HTML_ESCAPES={"&":"&","<":"<",">":">",'"':""","'":"'"};function utf8_encode(s){const e=String.fromCharCode;function t(p){const m=[];if(!p)return[];const v=p.length;let y=0,b,S;for(;y<v;)b=p.charCodeAt(y++),b>=55296&&b<=56319&&y<v?(S=p.charCodeAt(y++),(S&64512)==56320?m.push(((b&1023)<<10)+(S&1023)+65536):(m.push(b),y--)):m.push(b);return m}function i(p){if(p>=55296&&p<=57343)throw Error("Lone surrogate U+"+p.toString(16).toUpperCase()+" is not a scalar value")}function n(p,m){return e(p>>m&63|128)}function o(p){if(p>=0&&p<=31&&p!==10)return`_x${p.toString(16).toUpperCase().padStart(4,"0")}_`;if(!(p&4294967168))return e(p);let m="";return p&4294965248?p&4294901760?p&4292870144||(m=e(p>>18&7|240),m+=n(p,12),m+=n(p,6)):(i(p),m=e(p>>12&15|224),m+=n(p,6)):m=e(p>>6&31|192),m+=e(p&63|128),m}const r=t(s),a=r.length;let l=-1,d,h="";for(;++l<a;)d=r[l],h+=o(d);return h}function capitalise(s){return s[0].toUpperCase()+s.substring(1).toLowerCase()}function escapeString(s,e){if(s==null)return null;const t=s.toString().toString();return e?t:t.replace(reUnescapedHtml,i=>HTML_ESCAPES[i])}function camelCaseToHumanText(s){if(!s||s==null)return null;const e=/([a-z])([A-Z])/g,t=/([A-Z]+)([A-Z])([a-z])/g;return s.replace(e,"$1 $2").replace(t,"$1 $2$3").replace(/\./g," ").split(" ").map(n=>n.substring(0,1).toUpperCase()+(n.length>1?n.substring(1,n.length):"")).join(" ")}function camelCaseToHyphenated(s){return s.replace(/[A-Z]/g,e=>`-${e.toLocaleLowerCase()}`)}const StringUtils=Object.freeze(Object.defineProperty({__proto__:null,camelCaseToHumanText,camelCaseToHyphenated,capitalise,escapeString,utf8_encode},Symbol.toStringTag,{value:"Module"}));function convertToMap(s){const e=new Map;return s.forEach(t=>e.set(t[0],t[1])),e}function mapById(s,e){const t=new Map;return s.forEach(i=>t.set(e(i),i)),t}function keys(s){const e=[];return s.forEach((t,i)=>e.push(i)),e}const MapUtils=Object.freeze(Object.defineProperty({__proto__:null,convertToMap,keys,mapById},Symbol.toStringTag,{value:"Module"}));var __decorate$2y=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},__param$6=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}},__rest=globalThis&&globalThis.__rest||function(s,e){var t={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&e.indexOf(i)<0&&(t[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(s);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(t[i[n]]=s[i[n]]);return t};let ColumnModel=class extends BeanStub{constructor(){super(...arguments),this.primaryHeaderRowCount=0,this.secondaryHeaderRowCount=0,this.gridHeaderRowCount=0,this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.displayedColumnsAndGroupsMap={},this.viewportColumns=[],this.viewportColumnsHash="",this.headerViewportColumns=[],this.viewportColumnsCenter=[],this.headerViewportColumnsCenter=[],this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.autoHeightActiveAtLeastOnce=!1,this.rowGroupColumns=[],this.valueColumns=[],this.pivotColumns=[],this.ready=!1,this.changeEventsDispatching=!1,this.autoGroupsNeedBuilding=!1,this.forceRecreateAutoGroups=!1,this.pivotMode=!1,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}init(){this.suppressColumnVirtualisation=this.gridOptionsService.get("suppressColumnVirtualisation");const e=this.gridOptionsService.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],t=>this.buildAutoGroupColumns(convertSourceType(t.source))),this.addManagedPropertyListener("autoGroupColumnDef",t=>this.onAutoGroupColumnDefChanged(convertSourceType(t.source))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],t=>this.onSharedColDefChanged(convertSourceType(t.source))),this.addManagedPropertyListener("pivotMode",t=>this.setPivotMode(this.gridOptionsService.get("pivotMode"),convertSourceType(t.source))),this.addManagedListener(this.eventService,Events.EVENT_FIRST_DATA_RENDERED,()=>this.onFirstDataRendered())}buildAutoGroupColumns(e){this.columnDefs&&(this.autoGroupsNeedBuilding=!0,this.forceRecreateAutoGroups=!0,this.updateGridColumns(),this.updateDisplayedColumns(e))}onAutoGroupColumnDefChanged(e){this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e)}onSharedColDefChanged(e){this.gridColumns&&(this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns,e),this.createColumnsFromColumnDefs(!0,e))}setColumnDefs(e,t){const i=!!this.columnDefs;this.columnDefs=e,this.createColumnsFromColumnDefs(i,t)}recreateColumnDefs(e){this.onSharedColDefChanged(e)}destroyOldColumns(e,t){const i={};if(!e)return;this.columnUtils.depthFirstOriginalTreeSearch(null,e,o=>{i[o.getInstanceId()]=o}),t&&this.columnUtils.depthFirstOriginalTreeSearch(null,t,o=>{i[o.getInstanceId()]=null});const n=Object.values(i).filter(o=>o!=null);this.destroyBeans(n)}destroyColumns(){this.destroyOldColumns(this.primaryColumnTree),this.destroyOldColumns(this.secondaryBalancedTree),this.destroyOldColumns(this.groupAutoColsBalancedTree)}createColumnsFromColumnDefs(e,t){const i=e?this.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire(),this.autoGroupsNeedBuilding=!0;const n=this.primaryColumns,o=this.primaryColumnTree,r=this.columnFactory.createColumnTree(this.columnDefs,!0,o,t);this.destroyOldColumns(this.primaryColumnTree,r.columnTree),this.primaryColumnTree=r.columnTree,this.primaryHeaderRowCount=r.treeDept+1,this.primaryColumns=this.getColumnsFromTree(this.primaryColumnTree),this.primaryColumnsMap={},this.primaryColumns.forEach(d=>this.primaryColumnsMap[d.getId()]=d),this.extractRowGroupColumns(t,n),this.extractPivotColumns(t,n),this.extractValueColumns(t,n),this.ready=!0;const a=this.gridColsArePrimary===void 0;(this.gridColsArePrimary||a||this.autoGroupsNeedBuilding)&&(this.updateGridColumns(),e&&this.gridColsArePrimary&&!this.gridOptionsService.get("maintainColumnOrder")&&this.orderGridColumnsLikePrimary(),this.updateDisplayedColumns(t),this.checkViewportColumns()),this.dispatchEverythingChanged(t),this.changeEventsDispatching=!0,i&&i(),this.changeEventsDispatching=!1,this.dispatchNewColumnsLoaded(t)}shouldRowModelIgnoreRefresh(){return this.changeEventsDispatching}dispatchNewColumnsLoaded(e){const t={type:Events.EVENT_NEW_COLUMNS_LOADED,source:e};this.eventService.dispatchEvent(t),e==="gridInitializing"&&this.onColumnsReady()}dispatchEverythingChanged(e){const t={type:Events.EVENT_COLUMN_EVERYTHING_CHANGED,source:e};this.eventService.dispatchEvent(t)}orderGridColumnsLikePrimary(){const e=this.primaryColumns;if(!e)return;const t=e.filter(n=>this.gridColumns.indexOf(n)>=0),i=this.gridColumns.filter(n=>t.indexOf(n)<0);this.gridColumns=[...i,...t],this.gridColumns=this.placeLockedColumns(this.gridColumns)}getAllDisplayedAutoHeightCols(){return this.displayedAutoHeightCols}setViewport(){this.gridOptionsService.get("enableRtl")?(this.viewportLeft=this.bodyWidth-this.scrollPosition-this.scrollWidth,this.viewportRight=this.bodyWidth-this.scrollPosition):(this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition)}getDisplayedColumnsStartingAt(e){let t=e;const i=[];for(;t!=null;)i.push(t),t=this.getDisplayedColAfter(t);return i}checkViewportColumns(e=!1){if(this.displayedColumnsCenter==null||!this.extractViewport())return;const i={type:Events.EVENT_VIRTUAL_COLUMNS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(i)}setViewportPosition(e,t,i=!1){(e!==this.scrollWidth||t!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=e,this.scrollPosition=t,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns(i))}isPivotMode(){return this.pivotMode}isPivotSettingAllowed(e){return e&&this.gridOptionsService.get("treeData")?(console.warn("AG Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'"),!1):!0}setPivotMode(e,t){if(e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode)||(this.pivotMode=e,!this.gridColumns))return;this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(t);const i={type:Events.EVENT_COLUMN_PIVOT_MODE_CHANGED};this.eventService.dispatchEvent(i)}getSecondaryPivotColumn(e,t){if(missing(this.secondaryColumns))return null;const i=this.getPrimaryColumn(t);let n=null;return this.secondaryColumns.forEach(o=>{const r=o.getColDef().pivotKeys,a=o.getColDef().pivotValueColumn;areEqual(r,e)&&a===i&&(n=o)}),n}setBeans(e){this.logger=e.create("columnModel")}setFirstRightAndLastLeftPinned(e){let t,i;this.gridOptionsService.get("enableRtl")?(t=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,i=this.displayedColumnsRight?last(this.displayedColumnsRight):null):(t=this.displayedColumnsLeft?last(this.displayedColumnsLeft):null,i=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach(n=>{n.setLastLeftPinned(n===t,e),n.setFirstRightPinned(n===i,e)})}autoSizeColumns(e){if(this.shouldQueueResizeOperations){this.resizeOperationQueue.push(()=>this.autoSizeColumns(e));return}const{columns:t,skipHeader:i,skipHeaderGroups:n,stopAtGroup:o,source:r="api"}=e;this.animationFrameService.flushAllFrames();const a=[];let l=-1;const d=i??this.gridOptionsService.get("skipHeaderOnAutoSize"),h=n??d;for(;l!==0;)l=0,this.actionOnGridColumns(t,p=>{if(a.indexOf(p)>=0)return!1;const m=this.autoWidthCalculator.getPreferredWidthForColumn(p,d);if(m>0){const v=this.normaliseColumnWidth(p,m);p.setActualWidth(v,r),a.push(p),l++}return!0},r);h||this.autoSizeColumnGroupsByColumns(t,r,o),this.dispatchColumnResizedEvent(a,!0,"autosizeColumns")}dispatchColumnResizedEvent(e,t,i,n=null){if(e&&e.length){const o={type:Events.EVENT_COLUMN_RESIZED,columns:e,column:e.length===1?e[0]:null,flexColumns:n,finished:t,source:i};this.eventService.dispatchEvent(o)}}dispatchColumnChangedEvent(e,t,i){const n={type:e,columns:t,column:t&&t.length==1?t[0]:null,source:i};this.eventService.dispatchEvent(n)}dispatchColumnMovedEvent(e){const{movedColumns:t,source:i,toIndex:n,finished:o}=e,r={type:Events.EVENT_COLUMN_MOVED,columns:t,column:t&&t.length===1?t[0]:null,toIndex:n,finished:o,source:i};this.eventService.dispatchEvent(r)}dispatchColumnPinnedEvent(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,n=this.getCommonValue(e,r=>r.getPinned()),o={type:Events.EVENT_COLUMN_PINNED,pinned:n??null,columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}dispatchColumnVisibleEvent(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,n=this.getCommonValue(e,r=>r.isVisible()),o={type:Events.EVENT_COLUMN_VISIBLE,visible:n,columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}autoSizeColumn(e,t,i){e&&this.autoSizeColumns({columns:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const n=new Set;this.getGridColumns(e).forEach(l=>{let d=l.getParent();for(;d&&d!=i;)d.isPadding()||n.add(d),d=d.getParent()});let r;const a=[];for(const l of n){for(const d of this.ctrlsService.getHeaderRowContainerCtrls())if(r=d.getHeaderCtrlForColumn(l),r)break;r&&r.resizeLeafColumnsToFit(t)}return a}autoSizeAllColumns(e,t){if(this.shouldQueueResizeOperations){this.resizeOperationQueue.push(()=>this.autoSizeAllColumns(e,t));return}const i=this.getAllDisplayedColumns();this.autoSizeColumns({columns:i,skipHeader:t,source:e})}getColumnsFromTree(e){const t=[],i=n=>{for(let o=0;o<n.length;o++){const r=n[o];r instanceof Column?t.push(r):r instanceof ProvidedColumnGroup&&i(r.getChildren())}};return i(e),t}getAllDisplayedTrees(){return this.displayedTreeLeft&&this.displayedTreeRight&&this.displayedTreeCentre?this.displayedTreeLeft.concat(this.displayedTreeCentre).concat(this.displayedTreeRight):null}getPrimaryColumnTree(){return this.primaryColumnTree}getHeaderRowCount(){return this.gridHeaderRowCount}getDisplayedTreeLeft(){return this.displayedTreeLeft}getDisplayedTreeRight(){return this.displayedTreeRight}getDisplayedTreeCentre(){return this.displayedTreeCentre}isColumnDisplayed(e){return this.getAllDisplayedColumns().indexOf(e)>=0}getAllDisplayedColumns(){return this.displayedColumns}getViewportColumns(){return this.viewportColumns}getDisplayedLeftColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsLeft):this.displayedColumnsLeft}getDisplayedRightColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsRight):this.displayedColumnsRight}isColSpanActive(){return this.colSpanActive}getDisplayedColumnsForRow(e,t,i,n){const o=[];let r=null;for(let a=0;a<t.length;a++){const l=t[a],d=t.length-a,h=Math.min(l.getColSpan(e),d),p=[l];if(h>1){const v=h-1;for(let y=1;y<=v;y++)p.push(t[a+y]);a+=v}let m;i?(m=!1,p.forEach(v=>{i(v)&&(m=!0)})):m=!0,m&&(o.length===0&&r&&(n&&n(l))&&o.push(r),o.push(l)),r=l}return o}getViewportCenterColumnsForRow(e){if(!this.colSpanActive)return this.viewportColumnsCenter;const t=n=>{const o=n.getLeft();return exists(o)&&o>this.viewportLeft},i=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this);return this.getDisplayedColumnsForRow(e,this.displayedColumnsCenter,i,t)}isColumnAtEdge(e,t){const i=this.getAllDisplayedColumns();if(!i.length)return!1;const n=t==="first";let o;if(e instanceof ColumnGroup){const r=e.getDisplayedLeafColumns();if(!r.length)return!1;o=n?r[0]:last(r)}else o=e;return(n?i[0]:last(i))===o}getAriaColumnIndex(e){let t;return e instanceof ColumnGroup?t=e.getLeafColumns()[0]:t=e,this.ariaOrderColumns.indexOf(t)+1}isColumnInHeaderViewport(e){return e.isAutoHeaderHeight()?!0:this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),n=this.viewportLeft-200,o=this.viewportRight+200,r=t<n&&i<n,a=t>o&&i>o;return!r&&!a}getDisplayedColumnsLeftWidth(){return this.getWidthOfColsInList(this.displayedColumnsLeft)}getDisplayedColumnsRightWidth(){return this.getWidthOfColsInList(this.displayedColumnsRight)}updatePrimaryColumnList(e,t,i,n,o,r){if(!e||missingOrEmpty(e))return;let a=!1;if(e.forEach(d=>{if(!d)return;const h=this.getPrimaryColumn(d);if(h){if(i){if(t.indexOf(h)>=0)return;t.push(h)}else{if(t.indexOf(h)<0)return;removeFromArray(t,h)}n(h),a=!0}}),!a)return;this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(r);const l={type:o,columns:t,column:t.length===1?t[0]:null,source:r};this.eventService.dispatchEvent(l)}setRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(e,this.rowGroupColumns,Events.EVENT_COLUMN_ROW_GROUP_CHANGED,!0,this.setRowGroupActive.bind(this),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gridOptionsService.get("suppressRowGroupHidesColumns")&&this.setColumnsVisible([t],!1,i),!e&&!this.gridOptionsService.get("suppressMakeColumnVisibleAfterUnGroup")&&this.setColumnsVisible([t],!0,i))}addRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),Events.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}removeRowGroupColumns(e,t){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),Events.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}addPivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!0,i=>i.setPivotActive(!0,t),Events.EVENT_COLUMN_PIVOT_CHANGED,t)}setPivotColumns(e,t){this.setPrimaryColumnList(e,this.pivotColumns,Events.EVENT_COLUMN_PIVOT_CHANGED,!0,(i,n)=>{n.setPivotActive(i,t)},t)}removePivotColumns(e,t){this.updatePrimaryColumnList(e,this.pivotColumns,!1,i=>i.setPivotActive(!1,t),Events.EVENT_COLUMN_PIVOT_CHANGED,t)}setPrimaryColumnList(e,t,i,n,o,r){if(!this.gridColumns)return;const a=new Map;t.forEach((l,d)=>a.set(l,d)),t.length=0,exists(e)&&e.forEach(l=>{const d=this.getPrimaryColumn(l);d&&t.push(d)}),t.forEach((l,d)=>{const h=a.get(l);if(h===void 0){a.set(l,0);return}n&&h!==d||a.delete(l)}),(this.primaryColumns||[]).forEach(l=>{const d=t.indexOf(l)>=0;o(d,l)}),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(r),this.dispatchColumnChangedEvent(i,[...a.keys()],r)}setValueColumns(e,t){this.setPrimaryColumnList(e,this.valueColumns,Events.EVENT_COLUMN_VALUE_CHANGED,!1,this.setValueActive.bind(this),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc())){const n=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(n)}}addValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!0,this.setValueActive.bind(this,!0),Events.EVENT_COLUMN_VALUE_CHANGED,t)}removeValueColumns(e,t){this.updatePrimaryColumnList(e,this.valueColumns,!1,this.setValueActive.bind(this,!1),Events.EVENT_COLUMN_VALUE_CHANGED,t)}normaliseColumnWidth(e,t){const i=e.getMinWidth();exists(i)&&t<i&&(t=i);const n=e.getMaxWidth();return exists(n)&&e.isGreaterThanMax(t)&&(t=n),t}getPrimaryOrGridColumn(e){return this.getPrimaryColumn(e)||this.getGridColumn(e)}setColumnWidths(e,t,i,n){const o=[];e.forEach(r=>{const a=this.getPrimaryOrGridColumn(r.key);if(!a)return;if(o.push({width:r.newWidth,ratios:[1],columns:[a]}),this.gridOptionsService.get("colResizeDefault")==="shift"&&(t=!t),t){const d=this.getDisplayedColAfter(a);if(!d)return;const h=a.getActualWidth()-r.newWidth,p=d.getActualWidth()+h;o.push({width:p,ratios:[1],columns:[d]})}}),o.length!==0&&this.resizeColumnSets({resizeSets:o,finished:i,source:n})}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let n=0,o=0,r=!0;t.forEach(d=>{const h=d.getMinWidth();n+=h||0;const p=d.getMaxWidth();exists(p)&&p>0?o+=p:r=!1});const a=i>=n,l=!r||i<=o;return a&&l}resizeColumnSets(e){const{resizeSets:t,finished:i,source:n}=e;if(!(!t||t.every(p=>this.checkMinAndMaxWidthsForSet(p)))){if(i){const p=t&&t.length>0?t[0].columns:null;this.dispatchColumnResizedEvent(p,i,n)}return}const r=[],a=[];t.forEach(p=>{const{width:m,columns:v,ratios:y}=p,b={},S={};v.forEach(R=>a.push(R));let E=!0,T=0;for(;E;){if(T++,T>1e3){console.error("AG Grid: infinite loop in resizeColumnSets");break}E=!1;const R=[];let A=0,D=m;v.forEach((M,I)=>{if(S[M.getId()])D-=b[M.getId()];else{R.push(M);const z=y[I];A+=z}});const x=1/A;R.forEach((M,I)=>{const V=I===R.length-1;let z;V?z=D:(z=Math.round(y[I]*m*x),D-=z);const B=M.getMinWidth(),K=M.getMaxWidth();exists(B)&&z<B?(z=B,S[M.getId()]=!0,E=!0):exists(K)&&K>0&&z>K&&(z=K,S[M.getId()]=!0,E=!0),b[M.getId()]=z})}v.forEach(R=>{const A=b[R.getId()];R.getActualWidth()!==A&&(R.setActualWidth(A,n),r.push(R))})});const l=r.length>0;let d=[];l&&(d=this.refreshFlexedColumns({resizingCols:a,skipSetLeft:!0}),this.setLeftValues(n),this.updateBodyWidths(),this.checkViewportColumns());const h=a.concat(d);(l||i)&&this.dispatchColumnResizedEvent(h,i,n,d)}setColumnAggFunc(e,t,i){if(!e)return;const n=this.getPrimaryColumn(e);n&&(n.setAggFunc(t),this.dispatchColumnChangedEvent(Events.EVENT_COLUMN_VALUE_CHANGED,[n],i))}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const n=this.rowGroupColumns[e],o=this.rowGroupColumns.slice(e,t);this.rowGroupColumns.splice(e,1),this.rowGroupColumns.splice(t,0,n);const r={type:Events.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:o,column:o.length===1?o[0]:null,source:i};this.eventService.dispatchEvent(r)}moveColumns(e,t,i,n=!0){if(!this.gridColumns)return;if(this.columnAnimationService.start(),t>this.gridColumns.length-e.length){console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+t),console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");return}const o=this.getGridColumns(e);this.doesMovePassRules(o,t)&&(moveInArray(this.gridColumns,o,t),this.updateDisplayedColumns(i),this.dispatchColumnMovedEvent({movedColumns:o,source:i,toIndex:t,finished:n}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!(!this.doesMovePassMarryChildren(e)||!this.doesMovePassLockedPositions(e))}getProposedColumnOrder(e,t){const i=this.gridColumns.slice();return moveInArray(i,e,t),i}sortColumnsLikeGridColumns(e){!e||e.length<=1||e.filter(i=>this.gridColumns.indexOf(i)<0).length>0||e.sort((i,n)=>{const o=this.gridColumns.indexOf(i),r=this.gridColumns.indexOf(n);return o-r})}doesMovePassLockedPositions(e){let t=0,i=!0;const n=o=>o?o===!0||o==="left"?0:2:1;return e.forEach(o=>{const r=n(o.getColDef().lockPosition);r<t&&(i=!1),t=r}),i}doesMovePassMarryChildren(e){let t=!0;return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,i=>{if(!(i instanceof ProvidedColumnGroup))return;const n=i,o=n.getColGroupDef();if(!(o&&o.marryChildren))return;const a=[];n.getLeafColumns().forEach(m=>{const v=e.indexOf(m);a.push(v)});const l=Math.max.apply(Math,a),d=Math.min.apply(Math,a),h=l-d,p=n.getLeafColumns().length-1;h>p&&(t=!1)}),t}moveColumnByIndex(e,t,i){if(!this.gridColumns)return;const n=this.gridColumns[e];this.moveColumns([n],t,i)}getColumnDefs(){if(!this.primaryColumns)return;const e=this.primaryColumns.slice();return this.gridColsArePrimary?e.sort((t,i)=>this.gridColumns.indexOf(t)-this.gridColumns.indexOf(i)):this.lastPrimaryOrder&&e.sort((t,i)=>this.lastPrimaryOrder.indexOf(t)-this.lastPrimaryOrder.indexOf(i)),this.columnDefFactory.buildColumnDefs(e,this.rowGroupColumns,this.pivotColumns)}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}updateBodyWidths(){const e=this.getWidthOfColsInList(this.displayedColumnsCenter),t=this.getWidthOfColsInList(this.displayedColumnsLeft),i=this.getWidthOfColsInList(this.displayedColumnsRight);if(this.bodyWidthDirty=this.bodyWidth!==e,this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i;const o={type:Events.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED};this.eventService.dispatchEvent(o);const r={type:Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED};this.eventService.dispatchEvent(r)}}getValueColumns(){return this.valueColumns?this.valueColumns:[]}getPivotColumns(){return this.pivotColumns?this.pivotColumns:[]}isPivotActive(){return this.pivotColumns&&this.pivotColumns.length>0&&this.pivotMode}getRowGroupColumns(){return this.rowGroupColumns?this.rowGroupColumns:[]}getDisplayedCenterColumns(){return this.displayedColumnsCenter}getDisplayedLeftColumns(){return this.displayedColumnsLeft}getDisplayedRightColumns(){return this.displayedColumnsRight}getDisplayedColumns(e){switch(e){case"left":return this.getDisplayedLeftColumns();case"right":return this.getDisplayedRightColumns();default:return this.getDisplayedCenterColumns()}}getAllPrimaryColumns(){return this.primaryColumns?this.primaryColumns:null}getSecondaryColumns(){return this.secondaryColumns?this.secondaryColumns:null}getAllColumnsForQuickFilter(){return this.columnsForQuickFilter}getAllGridColumns(){var e;return(e=this.gridColumns)!==null&&e!==void 0?e:[]}isEmpty(){return missingOrEmpty(this.gridColumns)}isRowGroupEmpty(){return missingOrEmpty(this.rowGroupColumns)}setColumnsVisible(e,t=!1,i){this.applyColumnState({state:e.map(n=>({colId:typeof n=="string"?n:n.getColId(),hide:!t}))},i)}setColumnsPinned(e,t,i){if(!this.gridColumns)return;if(this.gridOptionsService.isDomLayout("print")){console.warn("AG Grid: Changing the column pinning status is not allowed with domLayout='print'");return}this.columnAnimationService.start();let n;t===!0||t==="left"?n="left":t==="right"?n="right":n=null,this.actionOnGridColumns(e,o=>o.getPinned()!==n?(o.setPinned(n),!0):!1,i,()=>({type:Events.EVENT_COLUMN_PINNED,pinned:n,column:null,columns:null,source:i})),this.columnAnimationService.finish()}actionOnGridColumns(e,t,i,n){if(missingOrEmpty(e))return;const o=[];if(e.forEach(r=>{if(!r)return;const a=this.getGridColumn(r);if(!a)return;t(a)!==!1&&o.push(a)}),!!o.length&&(this.updateDisplayedColumns(i),exists(n)&&n)){const r=n();r.columns=o,r.column=o.length===1?o[0]:null,this.eventService.dispatchEvent(r)}}getDisplayedColBefore(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i>0?t[i-1]:null}getDisplayedColAfter(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}getDisplayedGroupAfter(e){return this.getDisplayedGroupAtDirection(e,"After")}getDisplayedGroupBefore(e){return this.getDisplayedGroupAtDirection(e,"Before")}getDisplayedGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),n=e.getDisplayedLeafColumns(),o=t==="After"?last(n):n[0],r=`getDisplayedCol${t}`;for(;;){const a=this[r](o);if(!a)return null;const l=this.getColumnGroupAtLevel(a,i);if(l!==e)return l}}getColumnGroupAtLevel(e,t){let i=e.getParent(),n,o;for(;n=i.getProvidedColumnGroup().getLevel(),o=i.getPaddingLevel(),!(n+o<=t);)i=i.getParent();return i}isPinningLeft(){return this.displayedColumnsLeft.length>0}isPinningRight(){return this.displayedColumnsRight.length>0}getPrimaryAndSecondaryAndAutoColumns(){return[].concat(this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[])}createStateItemFromColumn(e){const t=e.isRowGroupActive()?this.rowGroupColumns.indexOf(e):null,i=e.isPivotActive()?this.pivotColumns.indexOf(e):null,n=e.isValueActive()?e.getAggFunc():null,o=e.getSort()!=null?e.getSort():null,r=e.getSortIndex()!=null?e.getSortIndex():null,a=e.getFlex()!=null&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:o,sortIndex:r,aggFunc:n,rowGroup:e.isRowGroupActive(),rowGroupIndex:t,pivot:e.isPivotActive(),pivotIndex:i,flex:a}}getColumnState(){if(missing(this.primaryColumns)||!this.isAlive())return[];const t=this.getPrimaryAndSecondaryAndAutoColumns().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(t),t}orderColumnStateList(e){const t=convertToMap(this.gridColumns.map((i,n)=>[i.getColId(),n]));e.sort((i,n)=>{const o=t.has(i.colId)?t.get(i.colId):-1,r=t.has(n.colId)?t.get(n.colId):-1;return o-r})}resetColumnState(e){if(missingOrEmpty(this.primaryColumns))return;const t=this.getColumnsFromTree(this.primaryColumnTree),i=[];let n=1e3,o=1e3,r=[];this.groupAutoColumns&&(r=r.concat(this.groupAutoColumns)),t&&(r=r.concat(t)),r.forEach(a=>{const l=this.getColumnStateFromColDef(a);missing(l.rowGroupIndex)&&l.rowGroup&&(l.rowGroupIndex=n++),missing(l.pivotIndex)&&l.pivot&&(l.pivotIndex=o++),i.push(l)}),this.applyColumnState({state:i,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(b,S)=>b??S??null,i=e.getColDef(),n=t(i.sort,i.initialSort),o=t(i.sortIndex,i.initialSortIndex),r=t(i.hide,i.initialHide),a=t(i.pinned,i.initialPinned),l=t(i.width,i.initialWidth),d=t(i.flex,i.initialFlex);let h=t(i.rowGroupIndex,i.initialRowGroupIndex),p=t(i.rowGroup,i.initialRowGroup);h==null&&(p==null||p==!1)&&(h=null,p=null);let m=t(i.pivotIndex,i.initialPivotIndex),v=t(i.pivot,i.initialPivot);m==null&&(v==null||v==!1)&&(m=null,v=null);const y=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:n,sortIndex:o,hide:r,pinned:a,width:l,flex:d,rowGroup:p,rowGroupIndex:h,pivot:v,pivotIndex:m,aggFunc:y}}applyColumnState(e,t){if(missingOrEmpty(this.primaryColumns))return!1;if(e&&e.state&&!e.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const i=(r,a,l)=>{const d=this.compareColumnStatesAndDispatchEvents(t);this.autoGroupsNeedBuilding=!0;const h=a.slice(),p={},m={},v=[],y=[];let b=0;const S=this.rowGroupColumns.slice(),E=this.pivotColumns.slice();r.forEach(D=>{const x=D.colId||"";if(x.startsWith(GROUP_AUTO_COLUMN_ID)){v.push(D),y.push(D);return}const I=l(x);I?(this.syncColumnWithStateItem(I,D,e.defaultState,p,m,!1,t),removeFromArray(h,I)):(y.push(D),b+=1)});const T=D=>this.syncColumnWithStateItem(D,null,e.defaultState,p,m,!1,t);h.forEach(T);const R=(D,x,M,I)=>{const V=D[M.getId()],z=D[I.getId()],B=V!=null,K=z!=null;if(B&&K)return V-z;if(B)return-1;if(K)return 1;const J=x.indexOf(M),Z=x.indexOf(I),F=J>=0,$=Z>=0;return F&&$?J-Z:F?-1:1};this.rowGroupColumns.sort(R.bind(this,p,S)),this.pivotColumns.sort(R.bind(this,m,E)),this.updateGridColumns();const A=this.groupAutoColumns?this.groupAutoColumns.slice():[];return v.forEach(D=>{const x=this.getAutoColumn(D.colId);removeFromArray(A,x),this.syncColumnWithStateItem(x,D,e.defaultState,null,null,!0,t)}),A.forEach(T),this.applyOrderAfterApplyState(e),this.updateDisplayedColumns(t),this.dispatchEverythingChanged(t),d(),{unmatchedAndAutoStates:y,unmatchedCount:b}};this.columnAnimationService.start();let{unmatchedAndAutoStates:n,unmatchedCount:o}=i(e.state||[],this.primaryColumns||[],r=>this.getPrimaryColumn(r));return(n.length>0||exists(e.defaultState))&&(o=i(n,this.secondaryColumns||[],r=>this.getSecondaryColumn(r)).unmatchedCount),this.columnAnimationService.finish(),o===0}applyOrderAfterApplyState(e){if(!e.applyOrder||!e.state)return;let t=[];const i={};e.state.forEach(o=>{if(!o.colId||i[o.colId])return;const r=this.gridColumnsMap[o.colId];r&&(t.push(r),i[o.colId]=!0)});let n=0;if(this.gridColumns.forEach(o=>{const r=o.getColId();if(i[r]!=null)return;r.startsWith(GROUP_AUTO_COLUMN_ID)?insertIntoArray(t,o,n++):t.push(o)}),t=this.placeLockedColumns(t),!this.doesMovePassMarryChildren(t)){console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.");return}this.gridColumns=t}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},i=this.getColumnState(),n={};return i.forEach(o=>{n[o.colId]=o}),()=>{const o=this.getPrimaryAndSecondaryAndAutoColumns(),r=(S,E,T,R)=>{const A=E.map(R),D=T.map(R);if(areEqual(A,D))return;const M=new Set(E);T.forEach(z=>{M.delete(z)||M.add(z)});const I=[...M],V={type:S,columns:I,column:I.length===1?I[0]:null,source:e};this.eventService.dispatchEvent(V)},a=S=>{const E=[];return o.forEach(T=>{const R=n[T.getColId()];R&&S(R,T)&&E.push(T)}),E},l=S=>S.getColId();r(Events.EVENT_COLUMN_ROW_GROUP_CHANGED,t.rowGroupColumns,this.rowGroupColumns,l),r(Events.EVENT_COLUMN_PIVOT_CHANGED,t.pivotColumns,this.pivotColumns,l);const h=a((S,E)=>{const T=S.aggFunc!=null,R=T!=E.isValueActive(),A=T&&S.aggFunc!=E.getAggFunc();return R||A});h.length>0&&this.dispatchColumnChangedEvent(Events.EVENT_COLUMN_VALUE_CHANGED,h,e);const p=(S,E)=>S.width!=E.getActualWidth();this.dispatchColumnResizedEvent(a(p),!0,e);const m=(S,E)=>S.pinned!=E.getPinned();this.dispatchColumnPinnedEvent(a(m),e);const v=(S,E)=>S.hide==E.isVisible();this.dispatchColumnVisibleEvent(a(v),e);const b=a((S,E)=>S.sort!=E.getSort()||S.sortIndex!=E.getSortIndex());b.length>0&&this.sortController.dispatchSortChangedEvents(e,b),this.normaliseColumnMovedEventForColumnState(i,e)}}getCommonValue(e,t){if(!e||e.length==0)return;const i=t(e[0]);for(let n=1;n<e.length;n++)if(i!==t(e[n]))return;return i}normaliseColumnMovedEventForColumnState(e,t){const i=this.getColumnState(),n={};i.forEach(d=>n[d.colId]=d);const o={};e.forEach(d=>{n[d.colId]&&(o[d.colId]=!0)});const r=e.filter(d=>o[d.colId]),a=i.filter(d=>o[d.colId]),l=[];a.forEach((d,h)=>{const p=r&&r[h];if(p&&p.colId!==d.colId){const m=this.getGridColumn(p.colId);m&&l.push(m)}}),l.length&&this.dispatchColumnMovedEvent({movedColumns:l,source:t,finished:!0})}syncColumnWithStateItem(e,t,i,n,o,r,a){if(!e)return;const l=(A,D)=>{const x={value1:void 0,value2:void 0};let M=!1;return t&&(t[A]!==void 0&&(x.value1=t[A],M=!0),exists(D)&&t[D]!==void 0&&(x.value2=t[D],M=!0)),!M&&i&&(i[A]!==void 0&&(x.value1=i[A]),exists(D)&&i[D]!==void 0&&(x.value2=i[D])),x},d=l("hide").value1;d!==void 0&&e.setVisible(!d,a);const h=l("pinned").value1;h!==void 0&&e.setPinned(h);const p=this.columnUtils.calculateColMinWidth(e.getColDef()),m=l("flex").value1;if(m!==void 0&&e.setFlex(m),m==null){const A=l("width").value1;A!=null&&p!=null&&A>=p&&e.setActualWidth(A,a)}const v=l("sort").value1;v!==void 0&&(v==="desc"||v==="asc"?e.setSort(v,a):e.setSort(void 0,a));const y=l("sortIndex").value1;if(y!==void 0&&e.setSortIndex(y),r||!e.isPrimary())return;const b=l("aggFunc").value1;b!==void 0&&(typeof b=="string"?(e.setAggFunc(b),e.isValueActive()||(e.setValueActive(!0,a),this.valueColumns.push(e))):(exists(b)&&console.warn("AG Grid: stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,a),removeFromArray(this.valueColumns,e))));const{value1:S,value2:E}=l("rowGroup","rowGroupIndex");(S!==void 0||E!==void 0)&&(typeof E=="number"||S?(e.isRowGroupActive()||(e.setRowGroupActive(!0,a),this.rowGroupColumns.push(e)),n&&typeof E=="number"&&(n[e.getId()]=E)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,a),removeFromArray(this.rowGroupColumns,e)));const{value1:T,value2:R}=l("pivot","pivotIndex");(T!==void 0||R!==void 0)&&(typeof R=="number"||T?(e.isPivotActive()||(e.setPivotActive(!0,a),this.pivotColumns.push(e)),o&&typeof R=="number"&&(o[e.getId()]=R)):e.isPivotActive()&&(e.setPivotActive(!1,a),removeFromArray(this.pivotColumns,e)))}getGridColumns(e){return this.getColumns(e,this.getGridColumn.bind(this))}getColumns(e,t){const i=[];return e&&e.forEach(n=>{const o=t(n);o&&i.push(o)}),i}getColumnWithValidation(e){if(e==null)return null;const t=this.getGridColumn(e);return t||console.warn("AG Grid: could not find column "+e),t}getPrimaryColumn(e){return this.primaryColumns?this.getColumn(e,this.primaryColumns,this.primaryColumnsMap):null}getGridColumn(e){return this.getColumn(e,this.gridColumns,this.gridColumnsMap)}lookupGridColumn(e){return this.gridColumnsMap[e]}getSecondaryColumn(e){return this.secondaryColumns?this.getColumn(e,this.secondaryColumns,this.secondaryColumnsMap):null}getColumn(e,t,i){if(!e||!i)return null;if(typeof e=="string"&&i[e])return i[e];for(let n=0;n<t.length;n++)if(this.columnsMatch(t[n],e))return t[n];return this.getAutoColumn(e)}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(t===!0)return this.rowGroupColumns.slice(0);const i=this.getPrimaryColumn(t);return i?[i]:null}getAutoColumn(e){return!this.groupAutoColumns||!exists(this.groupAutoColumns)||missing(this.groupAutoColumns)?null:this.groupAutoColumns.find(t=>this.columnsMatch(t,e))||null}columnsMatch(e,t){const i=e===t,n=e.getColDef()===t,o=e.getColId()==t;return i||n||o}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const n=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,n):n}getDisplayNameForProvidedColumnGroup(e,t,i){const n=t?t.getColGroupDef():null;return n?this.getHeaderName(n,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,n,o){const r=e.headerValueGetter;if(r){const a=this.gridOptionsService.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:n,location:o});return typeof r=="function"?r(a):typeof r=="string"?this.expressionService.evaluate(r,a):(console.warn("AG Grid: headerValueGetter must be a function or a string"),"")}else{if(e.headerName!=null)return e.headerName;if(e.field)return camelCaseToHumanText(e.field)}return""}wrapHeaderNameWithAggFunc(e,t){if(this.gridOptionsService.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn,n=exists(i);let o=null,r;if(n){const a=this.gridOptionsService.get("removePivotHeaderRowWhenSingleValueColumn")&&this.valueColumns.length===1,l=e.getColDef().pivotTotalColumnIds!==void 0;if(a&&!l)return t;o=i?i.getAggFunc():null,r=!0}else{const a=e.isValueActive(),l=this.pivotMode||!this.isRowGroupEmpty();a&&l?(o=e.getAggFunc(),r=!0):r=!1}if(r){const a=typeof o=="string"?o:"func";return`${this.localeService.getLocaleTextFunc()(a,a)}(${t})`}return t}getColumnGroup(e,t){if(!e)return null;if(e instanceof ColumnGroup)return e;const i=this.getAllDisplayedTrees(),n=typeof t=="number";let o=null;return this.columnUtils.depthFirstAllColumnTreeSearch(i,r=>{if(r instanceof ColumnGroup){const a=r;let l;n?l=e===a.getGroupId()&&t===a.getPartId():l=e===a.getGroupId(),l&&(o=a)}}),o}isReady(){return this.ready}extractValueColumns(e,t){this.valueColumns=this.extractColumns(t,this.valueColumns,(i,n)=>i.setValueActive(n,e),()=>{},()=>{},i=>{const n=i.aggFunc;if(n===null||n==="")return null;if(n!==void 0)return!!n},i=>i.initialAggFunc!=null&&i.initialAggFunc!=""),this.valueColumns.forEach(i=>{const n=i.getColDef();n.aggFunc!=null&&n.aggFunc!=""?i.setAggFunc(n.aggFunc):i.getAggFunc()||i.setAggFunc(n.initialAggFunc)})}extractRowGroupColumns(e,t){this.rowGroupColumns=this.extractColumns(t,this.rowGroupColumns,(i,n)=>i.setRowGroupActive(n,e),i=>i.rowGroupIndex,i=>i.initialRowGroupIndex,i=>i.rowGroup,i=>i.initialRowGroup)}extractColumns(e=[],t=[],i,n,o,r,a){const l=[],d=[];(this.primaryColumns||[]).forEach(m=>{const v=e.indexOf(m)<0,y=m.getColDef(),b=attrToBoolean(r(y)),S=attrToBoolean(a(y)),E=attrToNumber(n(y)),T=attrToNumber(o(y));let R;b!==void 0?R=b:E!==void 0?E===null?R=!1:R=E>=0:v?S!==void 0?R=S:T!==void 0?R=T!=null&&T>=0:R=!1:R=t.indexOf(m)>=0,R&&((v?E!=null||T!=null:E!=null)?l.push(m):d.push(m))});const h=m=>{const v=n(m.getColDef()),y=o(m.getColDef());return v??y};l.sort((m,v)=>{const y=h(m),b=h(v);return y===b?0:y<b?-1:1});const p=[].concat(l);return t.forEach(m=>{d.indexOf(m)>=0&&p.push(m)}),d.forEach(m=>{p.indexOf(m)<0&&p.push(m)}),t.forEach(m=>{p.indexOf(m)<0&&i(m,!1)}),p.forEach(m=>{t.indexOf(m)<0&&i(m,!0)}),p}extractPivotColumns(e,t){this.pivotColumns=this.extractColumns(t,this.pivotColumns,(i,n)=>i.setPivotActive(n,e),i=>i.pivotIndex,i=>i.initialPivotIndex,i=>i.pivot,i=>i.initialPivot)}resetColumnGroupState(e){if(!this.primaryColumnTree)return;const t=[];this.columnUtils.depthFirstOriginalTreeSearch(null,this.primaryColumnTree,i=>{if(i instanceof ProvidedColumnGroup){const n=i.getColGroupDef(),o={groupId:i.getGroupId(),open:n?n.openByDefault:void 0};t.push(o)}}),this.setColumnGroupState(t,e)}getColumnGroupState(){const e=[];return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,t=>{t instanceof ProvidedColumnGroup&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})}),e}setColumnGroupState(e,t){if(!this.gridBalancedTree)return;this.columnAnimationService.start();const i=[];if(e.forEach(n=>{const o=n.groupId,r=n.open,a=this.getProvidedColumnGroup(o);a&&a.isExpanded()!==r&&(this.logger.log("columnGroupOpened("+a.getGroupId()+","+r+")"),a.setExpanded(r),i.push(a))}),this.updateGroupsAndDisplayedColumns(t),this.setFirstRightAndLastLeftPinned(t),i.length){const n={type:Events.EVENT_COLUMN_GROUP_OPENED,columnGroup:ProvidedColumnGroup.length===1?i[0]:void 0,columnGroups:i};this.eventService.dispatchEvent(n)}this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let n;e instanceof ProvidedColumnGroup?n=e.getId():n=e||"",this.setColumnGroupState([{groupId:n,open:t}],i)}getProvidedColumnGroup(e){typeof e!="string"&&console.error("AG Grid: group key must be a string");let t=null;return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,i=>{i instanceof ProvidedColumnGroup&&i.getId()===e&&(t=i)}),t}calculateColumnsForDisplay(){let e;return this.pivotMode&&missing(this.secondaryColumns)?e=this.gridColumns.filter(t=>{const i=this.groupAutoColumns&&includes(this.groupAutoColumns,t),n=this.valueColumns&&includes(this.valueColumns,t);return i||n}):e=this.gridColumns.filter(t=>this.groupAutoColumns&&includes(this.groupAutoColumns,t)||t.isVisible()),e}checkColSpanActiveInCols(e){let t=!1;return e.forEach(i=>{exists(i.getColDef().colSpan)&&(t=!0)}),t}calculateColumnsForGroupDisplay(){this.groupDisplayColumns=[],this.groupDisplayColumnsMap={};const e=t=>{const i=t.getColDef(),n=i.showRowGroup;i&&exists(n)&&(this.groupDisplayColumns.push(t),typeof n=="string"?this.groupDisplayColumnsMap[n]=t:n===!0&&this.getRowGroupColumns().forEach(o=>{this.groupDisplayColumnsMap[o.getId()]=t}))};this.gridColumns.forEach(e)}getGroupDisplayColumns(){return this.groupDisplayColumns}getGroupDisplayColumnForGroup(e){return this.groupDisplayColumnsMap[e]}updateDisplayedColumns(e){const t=this.calculateColumnsForDisplay();this.buildDisplayedTrees(t),this.updateGroupsAndDisplayedColumns(e),this.setFirstRightAndLastLeftPinned(e)}isSecondaryColumnsPresent(){return exists(this.secondaryColumns)}setSecondaryColumns(e,t){if(!this.gridColumns)return;const i=e&&e.length>0;if(!(!i&&missing(this.secondaryColumns))){if(i){this.processSecondaryColumnDefinitions(e);const n=this.columnFactory.createColumnTree(e,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0,t);this.destroyOldColumns(this.secondaryBalancedTree,n.columnTree),this.secondaryBalancedTree=n.columnTree,this.secondaryHeaderRowCount=n.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsMap={},this.secondaryColumns.forEach(o=>this.secondaryColumnsMap[o.getId()]=o),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(t)}}processSecondaryColumnDefinitions(e){const t=this.gridOptionsService.get("processPivotResultColDef"),i=this.gridOptionsService.get("processPivotResultColGroupDef");if(!t&&!i)return;const n=o=>{o.forEach(r=>{if(exists(r.children)){const l=r;i&&i(l),n(l.children)}else t&&t(r)})};e&&n(e)}updateGridColumns(){const e=this.gridBalancedTree;if(this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns,this.createGroupAutoColumnsIfNeeded()){const n=convertToMap(this.groupAutoColumns.map(o=>[o,!0]));this.lastPrimaryOrder&&(this.lastPrimaryOrder=this.lastPrimaryOrder.filter(o=>!n.has(o)),this.lastPrimaryOrder=[...this.groupAutoColumns,...this.lastPrimaryOrder]),this.lastSecondaryOrder&&(this.lastSecondaryOrder=this.lastSecondaryOrder.filter(o=>!n.has(o)),this.lastSecondaryOrder=[...this.groupAutoColumns,...this.lastSecondaryOrder])}let i;if(this.secondaryColumns&&this.secondaryBalancedTree){const n=this.secondaryColumns.some(o=>this.gridColumnsMap[o.getColId()]!==void 0);this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,n&&(i=this.lastSecondaryOrder)}else this.primaryColumns&&(this.gridBalancedTree=this.primaryColumnTree.slice(),this.gridHeaderRowCount=this.primaryHeaderRowCount,this.gridColumns=this.primaryColumns.slice(),this.gridColsArePrimary=!0,i=this.lastPrimaryOrder);if(this.addAutoGroupToGridColumns(),this.orderGridColsLike(i),this.gridColumns=this.placeLockedColumns(this.gridColumns),this.calculateColumnsForGroupDisplay(),this.refreshQuickFilterColumns(),this.clearDisplayedAndViewportColumns(),this.colSpanActive=this.checkColSpanActiveInCols(this.gridColumns),this.gridColumnsMap={},this.gridColumns.forEach(n=>this.gridColumnsMap[n.getId()]=n),this.setAutoHeightActive(),!areEqual(e,this.gridBalancedTree)){const n={type:Events.EVENT_GRID_COLUMNS_CHANGED};this.eventService.dispatchEvent(n)}}setAutoHeightActive(){this.autoHeightActive=this.gridColumns.filter(e=>e.isAutoHeight()).length>0,this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,this.gridOptionsService.isRowModelType("clientSide")||this.gridOptionsService.isRowModelType("serverSide")||warnOnce("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}orderGridColsLike(e){if(missing(e))return;const t=convertToMap(e.map((d,h)=>[d,h]));let i=!0;if(this.gridColumns.forEach(d=>{t.has(d)&&(i=!1)}),i)return;const n=convertToMap(this.gridColumns.map(d=>[d,!0])),o=e.filter(d=>n.has(d)),r=convertToMap(o.map(d=>[d,!0])),a=this.gridColumns.filter(d=>!r.has(d)),l=o.slice();a.forEach(d=>{let h=d.getOriginalParent();if(!h){l.push(d);return}const p=[];for(;!p.length&&h;)h.getLeafColumns().forEach(b=>{const S=l.indexOf(b)>=0,E=p.indexOf(b)<0;S&&E&&p.push(b)}),h=h.getOriginalParent();if(!p.length){l.push(d);return}const m=p.map(y=>l.indexOf(y)),v=Math.max(...m);insertIntoArray(l,d,v+1)}),this.gridColumns=l}isPrimaryColumnGroupsPresent(){return this.primaryHeaderRowCount>1}refreshQuickFilterColumns(){var e;let t=(e=this.isPivotMode()?this.secondaryColumns:this.primaryColumns)!==null&&e!==void 0?e:[];this.groupAutoColumns&&(t=t.concat(this.groupAutoColumns)),this.columnsForQuickFilter=this.gridOptionsService.get("includeHiddenColumnsInQuickFilter")?t:t.filter(i=>i.isVisible()||i.isRowGroupActive())}placeLockedColumns(e){const t=[],i=[],n=[];return e.forEach(o=>{const r=o.getColDef().lockPosition;r==="right"?n.push(o):r==="left"||r===!0?t.push(o):i.push(o)}),[...t,...i,...n]}addAutoGroupToGridColumns(){if(missing(this.groupAutoColumns)){this.destroyOldColumns(this.groupAutoColsBalancedTree),this.groupAutoColsBalancedTree=null;return}this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;const e=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.destroyOldColumns(this.groupAutoColsBalancedTree,e),this.groupAutoColsBalancedTree=e,this.gridBalancedTree=e.concat(this.gridBalancedTree)}clearDisplayedAndViewportColumns(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.ariaOrderColumns=[],this.viewportColumns=[],this.headerViewportColumns=[],this.viewportColumnsHash=""}updateGroupsAndDisplayedColumns(e){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(e),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();const t={type:Events.EVENT_DISPLAYED_COLUMNS_CHANGED};this.eventService.dispatchEvent(t)}deriveDisplayedColumns(e){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinColumnsAriaOrder(),this.joinDisplayedColumns(),this.setLeftValues(e),this.displayedAutoHeightCols=this.displayedColumns.filter(t=>t.isAutoHeight())}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}joinColumnsAriaOrder(){const e=this.getAllGridColumns(),t=[],i=[],n=[];for(const o of e){const r=o.getPinned();r?r===!0||r==="left"?t.push(o):n.push(o):i.push(o)}this.ariaOrderColumns=t.concat(i).concat(n)}joinDisplayedColumns(){this.gridOptionsService.get("enableRtl")?this.displayedColumns=this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft):this.displayedColumns=this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight)}setLeftValues(e){this.setLeftValuesOfColumns(e),this.setLeftValuesOfGroups()}setLeftValuesOfColumns(e){if(!this.primaryColumns)return;const t=this.getPrimaryAndSecondaryAndAutoColumns().slice(0),i=this.gridOptionsService.get("enableRtl");[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach(n=>{if(i){let o=this.getWidthOfColsInList(n);n.forEach(r=>{o-=r.getActualWidth(),r.setLeft(o,e)})}else{let o=0;n.forEach(r=>{r.setLeft(o,e),o+=r.getActualWidth()})}removeAllFromUnorderedArray(t,n)}),t.forEach(n=>{n.setLeft(null,e)})}setLeftValuesOfGroups(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach(e=>{e.forEach(t=>{t instanceof ColumnGroup&&t.checkLeft()})})}derivedDisplayedColumnsFromDisplayedTree(e,t){t.length=0,this.columnUtils.depthFirstDisplayedColumnTreeSearch(e,i=>{i instanceof Column&&t.push(i)})}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}extractViewportColumns(){this.isColumnVirtualisationSuppressed()?(this.viewportColumnsCenter=this.displayedColumnsCenter,this.headerViewportColumnsCenter=this.displayedColumnsCenter):(this.viewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this)),this.headerViewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this))),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight),this.headerViewportColumns=this.headerViewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)}getVirtualHeaderGroupRow(e,t){let i;switch(e){case"left":i=this.viewportRowLeft[t];break;case"right":i=this.viewportRowRight[t];break;default:i=this.viewportRowCenter[t];break}return missing(i)&&(i=[]),i}calculateHeaderRows(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};const e={};this.headerViewportColumns.forEach(i=>e[i.getId()]=!0);const t=(i,n,o)=>{let r=!1;for(let a=0;a<i.length;a++){const l=i[a];let d=!1;if(l instanceof Column)d=e[l.getId()]===!0;else{const p=l.getDisplayedChildren();p&&(d=t(p,n,o+1))}d&&(r=!0,n[o]||(n[o]=[]),n[o].push(l))}return r};t(this.displayedTreeLeft,this.viewportRowLeft,0),t(this.displayedTreeRight,this.viewportRowRight,0),t(this.displayedTreeCentre,this.viewportRowCenter,0)}extractViewport(){const e=n=>`${n.getId()}-${n.getPinned()||"normal"}`;this.extractViewportColumns();const t=this.viewportColumns.map(e).join("#"),i=this.viewportColumnsHash!==t;return i&&(this.viewportColumnsHash=t,this.calculateHeaderRows()),i}refreshFlexedColumns(e={}){var t;const i=e.source?e.source:"flex";if(e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];let n=-1;if(e.resizingCols){const v=new Set(e.resizingCols);let y=this.displayedColumnsCenter;for(let b=y.length-1;b>=0;b--)if(v.has(y[b])){n=b;break}}let o=0,r=[],a=0,l=0;for(let v=0;v<this.displayedColumnsCenter.length;v++)this.displayedColumnsCenter[v].getFlex()&&v>n?(r.push(this.displayedColumnsCenter[v]),l+=this.displayedColumnsCenter[v].getFlex(),a+=(t=this.displayedColumnsCenter[v].getMinWidth())!==null&&t!==void 0?t:0):o+=this.displayedColumnsCenter[v].getActualWidth();if(!r.length)return[];let d=[];o+a>this.flexViewportWidth&&(r.forEach(v=>{var y;return v.setActualWidth((y=v.getMinWidth())!==null&&y!==void 0?y:0,i)}),d=r,r=[]);const h=[];let p;e:for(;;){p=this.flexViewportWidth-o;const v=p/l;for(let y=0;y<r.length;y++){const b=r[y],S=v*b.getFlex();let E=0;const T=b.getMinWidth(),R=b.getMaxWidth();if(exists(T)&&S<T?E=T:exists(R)&&S>R&&(E=R),E){b.setActualWidth(E,i),removeFromUnorderedArray(r,b),l-=b.getFlex(),d.push(b),o+=b.getActualWidth();continue e}h[y]=Math.round(S)}break}let m=p;return r.forEach((v,y)=>{v.setActualWidth(Math.min(h[y],m),i),d.push(v),m-=h[y]}),e.skipSetLeft||this.setLeftValues(i),e.updateBodyWidths&&this.updateBodyWidths(),e.fireResizedEvent&&this.dispatchColumnResizedEvent(d,!0,i,r),r}sizeColumnsToFit(e,t="sizeColumnsToFit",i,n){var o,r,a,l,d;if(this.shouldQueueResizeOperations){this.resizeOperationQueue.push(()=>this.sizeColumnsToFit(e,t,i,n));return}const h={};n&&((o=n==null?void 0:n.columnLimits)===null||o===void 0||o.forEach(T=>{var{key:R}=T,A=__rest(T,["key"]);h[typeof R=="string"?R:R.getColId()]=A}));const p=this.getAllDisplayedColumns(),m=e===this.getWidthOfColsInList(p);if(e<=0||!p.length||m)return;const v=[],y=[];p.forEach(T=>{T.getColDef().suppressSizeToFit===!0?y.push(T):v.push(T)});const b=v.slice(0);let S=!1;const E=T=>{removeFromArray(v,T),y.push(T)};for(v.forEach(T=>{var R,A;T.resetActualWidth(t);const D=h==null?void 0:h[T.getId()],x=(R=D==null?void 0:D.minWidth)!==null&&R!==void 0?R:n==null?void 0:n.defaultMinWidth,M=(A=D==null?void 0:D.maxWidth)!==null&&A!==void 0?A:n==null?void 0:n.defaultMaxWidth,I=T.getActualWidth();typeof x=="number"&&I<x?T.setActualWidth(x,t,!0):typeof M=="number"&&I>M&&T.setActualWidth(M,t,!0)});!S;){S=!0;const T=e-this.getWidthOfColsInList(y);if(T<=0)v.forEach(R=>{var A,D;const x=(D=(A=h==null?void 0:h[R.getId()])===null||A===void 0?void 0:A.minWidth)!==null&&D!==void 0?D:n==null?void 0:n.defaultMinWidth;if(typeof x=="number"){R.setActualWidth(x,t,!0);return}R.setMinimum(t)});else{const R=T/this.getWidthOfColsInList(v);let A=T;for(let D=v.length-1;D>=0;D--){const x=v[D],M=h==null?void 0:h[x.getId()],I=(r=M==null?void 0:M.minWidth)!==null&&r!==void 0?r:n==null?void 0:n.defaultMinWidth,V=(a=M==null?void 0:M.maxWidth)!==null&&a!==void 0?a:n==null?void 0:n.defaultMaxWidth,z=(l=x.getMinWidth())!==null&&l!==void 0?l:0,B=(d=x.getMaxWidth())!==null&&d!==void 0?d:Number.MAX_VALUE,K=typeof I=="number"&&I>z?I:x.getMinWidth(),J=typeof V=="number"&&V<B?V:x.getMaxWidth();let Z=Math.round(x.getActualWidth()*R);exists(K)&&Z<K?(Z=K,E(x),S=!1):exists(J)&&Z>J?(Z=J,E(x),S=!1):D===0&&(Z=A),x.setActualWidth(Z,t,!0),A-=Z}}}b.forEach(T=>{T.fireColumnWidthChangedEvent(t)}),this.setLeftValues(t),this.updateBodyWidths(),!i&&this.dispatchColumnResizedEvent(b,!0,t)}buildDisplayedTrees(e){const t=[],i=[],n=[];e.forEach(r=>{switch(r.getPinned()){case"left":t.push(r);break;case"right":i.push(r);break;default:n.push(r);break}});const o=new GroupInstanceIdCreator;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(t,o,"left",this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(i,o,"right",this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(n,o,null,this.displayedTreeCentre),this.updateDisplayedMap()}updateDisplayedMap(){this.displayedColumnsAndGroupsMap={};const e=t=>{this.displayedColumnsAndGroupsMap[t.getUniqueId()]=t};this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeCentre,e),this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeLeft,e),this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeRight,e)}isDisplayed(e){return this.displayedColumnsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){const e=this.getAllDisplayedTrees();this.columnUtils.depthFirstAllColumnTreeSearch(e,t=>{t instanceof ColumnGroup&&t.calculateDisplayedColumns()})}getGroupAutoColumns(){return this.groupAutoColumns}createGroupAutoColumnsIfNeeded(){const e=this.forceRecreateAutoGroups;if(this.forceRecreateAutoGroups=!1,!this.autoGroupsNeedBuilding)return!1;this.autoGroupsNeedBuilding=!1;const t=this.gridOptionsService.isGroupUseEntireRow(this.pivotMode),i=this.pivotMode?this.gridOptionsService.get("pivotSuppressAutoColumn"):this.isGroupSuppressAutoColumn();if((this.rowGroupColumns.length>0||this.gridOptionsService.get("treeData"))&&!i&&!t){const r=this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);if(!this.autoColsEqual(r,this.groupAutoColumns)||e)return this.groupAutoColumns=r,!0}else this.groupAutoColumns=null;return!1}isGroupSuppressAutoColumn(){return this.gridOptionsService.get("groupDisplayType")==="custom"?!0:this.gridOptionsService.get("treeDataDisplayType")==="custom"}autoColsEqual(e,t){return areEqual(e,t,(i,n)=>i.getColId()===n.getColId())}getWidthOfColsInList(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}getFirstDisplayedColumn(){const e=this.gridOptionsService.get("enableRtl"),t=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];e&&t.reverse();for(let i=0;i<t.length;i++){const n=this[t[i]]();if(n.length)return e?last(n):n[0]}return null}setColumnHeaderHeight(e,t){if(e.setAutoHeaderHeight(t)){const n={type:Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(n)}}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),t=this.getAllDisplayedColumns().filter(i=>i.isAutoHeaderHeight()).map(i=>i.getAutoHeaderHeight()||0);return Math.max(e,...t)}getHeaderHeight(){var e;return(e=this.gridOptionsService.get("headerHeight"))!==null&&e!==void 0?e:this.environment.getFromTheme(25,"headerHeight")}getFloatingFiltersHeight(){var e;return(e=this.gridOptionsService.get("floatingFiltersHeight"))!==null&&e!==void 0?e:this.getHeaderHeight()}getGroupHeaderHeight(){var e;return(e=this.gridOptionsService.get("groupHeaderHeight"))!==null&&e!==void 0?e:this.getHeaderHeight()}getPivotHeaderHeight(){var e;return(e=this.gridOptionsService.get("pivotHeaderHeight"))!==null&&e!==void 0?e:this.getHeaderHeight()}getPivotGroupHeaderHeight(){var e;return(e=this.gridOptionsService.get("pivotGroupHeaderHeight"))!==null&&e!==void 0?e:this.getGroupHeaderHeight()}queueResizeOperations(){this.shouldQueueResizeOperations=!0}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(e=>e()),this.resizeOperationQueue=[]}resetColumnDefIntoColumn(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const n=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(n,i,t),!0}isColumnGroupingLocked(e){const t=this.gridOptionsService.get("groupLockGroupColumns");if(!e.isRowGroupActive()||t===0)return!1;if(t===-1)return!0;const i=this.rowGroupColumns.findIndex(n=>n.getColId()===e.getColId());return t>i}generateColumnStateForRowGroupAndPivotIndexes(e,t){let i={};const n=(o,r,a,l,d,h)=>{if(!r.length||!this.primaryColumns)return[];const p=Object.keys(o),m=new Set(p),v=new Set(p),y=new Set(r.map(x=>{const M=x.getColId();return v.delete(M),M}).concat(p)),b=[],S={};let E=0;for(let x=0;x<this.primaryColumns.length;x++){const M=this.primaryColumns[x].getColId();y.has(M)&&(b.push(M),S[M]=E++)}let T=1e3,R=!1,A=0;const D=x=>{const M=S[x];for(let I=A;I<M;I++){const V=b[I];v.has(V)&&(o[V][d]=T++,v.delete(V))}A=M};r.forEach(x=>{const M=x.getColId();if(m.has(M))D(M),o[M][d]=T++;else{const I=x.getColDef();(I[d]===null||I[d]===void 0&&I[h]==null)&&(R||(I[a]||I[a]===void 0&&I[l]?D(M):(v.forEach(B=>{o[B][d]=T+S[B]}),T+=b.length,R=!0)),i[M]||(i[M]={colId:M}),i[M][d]=T++)}})};return n(e,this.rowGroupColumns,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),n(t,this.pivotColumns,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}onColumnsReady(){const e=this.gridOptionsService.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout(()=>{if(t==="fitGridWidth"){const{columnLimits:i,defaultMinWidth:n,defaultMaxWidth:o}=e,r=i==null?void 0:i.map(({colId:a,minWidth:l,maxWidth:d})=>({key:a,minWidth:l,maxWidth:d}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:n,defaultMaxWidth:o,columnLimits:r})}else t==="fitProvidedWidth"&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")})}onFirstDataRendered(){const e=this.gridOptionsService.get("autoSizeStrategy");if((e==null?void 0:e.type)!=="fitCellContents")return;const{colIds:t,skipHeader:i}=e;setTimeout(()=>{t?this.autoSizeColumns({columns:t,skipHeader:i,source:"autosizeColumns"}):this.autoSizeAllColumns("autosizeColumns",i)})}};__decorate$2y([Autowired("expressionService")],ColumnModel.prototype,"expressionService",void 0);__decorate$2y([Autowired("columnFactory")],ColumnModel.prototype,"columnFactory",void 0);__decorate$2y([Autowired("displayedGroupCreator")],ColumnModel.prototype,"displayedGroupCreator",void 0);__decorate$2y([Autowired("ctrlsService")],ColumnModel.prototype,"ctrlsService",void 0);__decorate$2y([Autowired("autoWidthCalculator")],ColumnModel.prototype,"autoWidthCalculator",void 0);__decorate$2y([Autowired("columnUtils")],ColumnModel.prototype,"columnUtils",void 0);__decorate$2y([Autowired("columnAnimationService")],ColumnModel.prototype,"columnAnimationService",void 0);__decorate$2y([Autowired("autoGroupColService")],ColumnModel.prototype,"autoGroupColService",void 0);__decorate$2y([Optional("aggFuncService")],ColumnModel.prototype,"aggFuncService",void 0);__decorate$2y([Optional("valueCache")],ColumnModel.prototype,"valueCache",void 0);__decorate$2y([Optional("animationFrameService")],ColumnModel.prototype,"animationFrameService",void 0);__decorate$2y([Autowired("sortController")],ColumnModel.prototype,"sortController",void 0);__decorate$2y([Autowired("columnDefFactory")],ColumnModel.prototype,"columnDefFactory",void 0);__decorate$2y([PostConstruct],ColumnModel.prototype,"init",null);__decorate$2y([PreDestroy],ColumnModel.prototype,"destroyColumns",null);__decorate$2y([__param$6(0,Qualifier("loggerFactory"))],ColumnModel.prototype,"setBeans",null);ColumnModel=__decorate$2y([Bean("columnModel")],ColumnModel);function convertSourceType(s){return s==="gridOptionsUpdated"?"gridOptionsChanged":s}var __decorate$2x=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ColumnUtils=class extends BeanStub{calculateColMinWidth(e){return e.minWidth!=null?e.minWidth:this.environment.getMinColWidth()}calculateColMaxWidth(e){return e.maxWidth!=null?e.maxWidth:Number.MAX_SAFE_INTEGER}calculateColInitialWidth(e){const t=this.calculateColMinWidth(e),i=this.calculateColMaxWidth(e);let n;const o=attrToNumber(e.width),r=attrToNumber(e.initialWidth);return o!=null?n=o:r!=null?n=r:n=200,Math.max(Math.min(n,i),t)}getOriginalPathForColumn(e,t){const i=[];let n=!1;const o=(r,a)=>{for(let l=0;l<r.length;l++){if(n)return;const d=r[l];d instanceof ProvidedColumnGroup?(o(d.getChildren(),a+1),i[a]=d):d===e&&(n=!0)}};return o(t,0),n?i:null}depthFirstOriginalTreeSearch(e,t,i){t&&t.forEach(n=>{n instanceof ProvidedColumnGroup&&this.depthFirstOriginalTreeSearch(n,n.getChildren(),i),i(n,e)})}depthFirstAllColumnTreeSearch(e,t){e&&e.forEach(i=>{i instanceof ColumnGroup&&this.depthFirstAllColumnTreeSearch(i.getChildren(),t),t(i)})}depthFirstDisplayedColumnTreeSearch(e,t){e&&e.forEach(i=>{i instanceof ColumnGroup&&this.depthFirstDisplayedColumnTreeSearch(i.getDisplayedChildren(),t),t(i)})}};ColumnUtils=__decorate$2x([Bean("columnUtils")],ColumnUtils);var __decorate$2w=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let DisplayedGroupCreator=class extends BeanStub{createDisplayedGroups(e,t,i,n){const o=this.mapOldGroupsById(n),r=[];let a=e;for(;a.length;){const l=a;a=[];let d=0;const h=p=>{const m=d;d=p;const v=l[m],b=(v instanceof ColumnGroup?v.getProvidedColumnGroup():v).getOriginalParent();if(b==null){for(let E=m;E<p;E++)r.push(l[E]);return}const S=this.createColumnGroup(b,t,o,i);for(let E=m;E<p;E++)S.addChild(l[E]);a.push(S)};for(let p=1;p<l.length;p++){const m=l[p],y=(m instanceof ColumnGroup?m.getProvidedColumnGroup():m).getOriginalParent(),b=l[d],E=(b instanceof ColumnGroup?b.getProvidedColumnGroup():b).getOriginalParent();y!==E&&h(p)}d<l.length&&h(l.length)}return this.setupParentsIntoColumns(r,null),r}createColumnGroup(e,t,i,n){const o=e.getGroupId(),r=t.getInstanceIdForKey(o),a=ColumnGroup.createUniqueId(o,r);let l=i[a];return l&&l.getProvidedColumnGroup()!==e&&(l=null),exists(l)?l.reset():(l=new ColumnGroup(e,o,r,n),this.context.createBean(l)),l}mapOldGroupsById(e){const t={},i=n=>{n.forEach(o=>{if(o instanceof ColumnGroup){const r=o;t[o.getUniqueId()]=r,i(r.getChildren())}})};return e&&i(e),t}setupParentsIntoColumns(e,t){e.forEach(i=>{if(i.setParent(t),i instanceof ColumnGroup){const n=i;this.setupParentsIntoColumns(n.getChildren(),n)}})}};DisplayedGroupCreator=__decorate$2w([Bean("displayedGroupCreator")],DisplayedGroupCreator);const INITIAL_GRID_OPTION_KEYS={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,excludeHiddenColumnsFromQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,enableChartToolPanelsButton:!0,suppressChartToolPanelsButton:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressParentsInRowNodes:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,suppressAggAtRootLevel:!0,removePivotHeaderRowWhenSingleValueColumn:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,functionsPassive:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0};class PropertyKeys{}PropertyKeys.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu"];PropertyKeys.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams","initialState","autoSizeStrategy"];PropertyKeys.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"];PropertyKeys.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex"];PropertyKeys.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressParentsInRowNodes","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressAggAtRootLevel","suppressFocusAfterRefresh","functionsPassive","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","excludeHiddenColumnsFromQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterMovesDown","enterMovesDownAfterEdit","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","enableChartToolPanelsButton","suppressChartToolPanelsButton","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideFilterAllLevels","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents"];PropertyKeys.FUNCTIONAL_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher"];PropertyKeys.CALLBACK_PROPERTIES=["getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering"];PropertyKeys.FUNCTION_PROPERTIES=[...PropertyKeys.FUNCTIONAL_PROPERTIES,...PropertyKeys.CALLBACK_PROPERTIES];PropertyKeys.ALL_PROPERTIES=[...PropertyKeys.ARRAY_PROPERTIES,...PropertyKeys.OBJECT_PROPERTIES,...PropertyKeys.STRING_PROPERTIES,...PropertyKeys.NUMBER_PROPERTIES,...PropertyKeys.FUNCTION_PROPERTIES,...PropertyKeys.BOOLEAN_PROPERTIES];var _a;class ComponentUtil{static getCallbackForEvent(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substring(1)}static getGridOptionKeys(){return this.ALL_PROPERTIES_AND_CALLBACKS}static combineAttributesAndGridOptions(e,t){typeof e!="object"&&(e={});const i=Object.assign({},e);return ComponentUtil.getGridOptionKeys().forEach(o=>{const r=t[o];typeof r<"u"&&r!==ComponentUtil.VUE_OMITTED_PROPERTY&&(i[o]=r)}),i}static processOnChange(e,t){if(!e)return;const i={};let n=!1;if(Object.keys(e).filter(r=>ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS_SET.has(r)).forEach(r=>{i[r]=e[r],n=!0}),!n)return;t.__internalUpdateGridOptions(i);const o={type:Events.EVENT_COMPONENT_STATE_CHANGED};iterateObject(i,(r,a)=>{o[r]=a}),t.dispatchEvent(o)}}_a=ComponentUtil;ComponentUtil.EVENTS=values(Events);ComponentUtil.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY";ComponentUtil.EXCLUDED_INTERNAL_EVENTS=[Events.EVENT_SCROLLBAR_WIDTH_CHANGED,Events.EVENT_CHECKBOX_CHANGED,Events.EVENT_HEIGHT_SCALE_CHANGED,Events.EVENT_BODY_HEIGHT_CHANGED,Events.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,Events.EVENT_SCROLL_VISIBILITY_CHANGED,Events.EVENT_COLUMN_HOVER_CHANGED,Events.EVENT_FLASH_CELLS,Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,Events.EVENT_DISPLAYED_ROWS_CHANGED,Events.EVENT_LEFT_PINNED_WIDTH_CHANGED,Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED,Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,Events.EVENT_POPUP_TO_FRONT,Events.EVENT_STORE_UPDATED,Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START,Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END,Events.EVENT_FILL_START,Events.EVENT_FILL_END,Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,Events.EVENT_FULL_WIDTH_ROW_FOCUSED,Events.EVENT_HEADER_HEIGHT_CHANGED,Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,Events.EVENT_CELL_FOCUS_CLEARED,Events.EVENT_GRID_STYLES_CHANGED,Events.EVENT_FILTER_DESTROYED,Events.EVENT_ROW_DATA_UPDATE_STARTED,Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,Events.EVENT_DATA_TYPES_INFERRED,Events.EVENT_FIELD_VALUE_CHANGED,Events.EVENT_FIELD_PICKER_VALUE_SELECTED,Events.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,Events.EVENT_SUPPRESS_MENU_HIDE_CHANGED,Events.EVENT_SUPPRESS_FIELD_DOT_NOTATION,Events.EVENT_ROW_COUNT_READY,Events.EVENT_SIDE_BAR_UPDATED];ComponentUtil.PUBLIC_EVENTS=ComponentUtil.EVENTS.filter(s=>!includes(ComponentUtil.EXCLUDED_INTERNAL_EVENTS,s));ComponentUtil.EVENT_CALLBACKS=ComponentUtil.EVENTS.map(s=>ComponentUtil.getCallbackForEvent(s));ComponentUtil.STRING_PROPERTIES=PropertyKeys.STRING_PROPERTIES;ComponentUtil.OBJECT_PROPERTIES=PropertyKeys.OBJECT_PROPERTIES;ComponentUtil.ARRAY_PROPERTIES=PropertyKeys.ARRAY_PROPERTIES;ComponentUtil.NUMBER_PROPERTIES=PropertyKeys.NUMBER_PROPERTIES;ComponentUtil.BOOLEAN_PROPERTIES=PropertyKeys.BOOLEAN_PROPERTIES;ComponentUtil.FUNCTION_PROPERTIES=PropertyKeys.FUNCTION_PROPERTIES;ComponentUtil.ALL_PROPERTIES=PropertyKeys.ALL_PROPERTIES;ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS=[..._a.ALL_PROPERTIES,..._a.EVENT_CALLBACKS];ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS);var __decorate$2v=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let AgStackComponentsRegistry=class extends BeanStub{constructor(){super(...arguments),this.componentsMappedByName={}}setupComponents(e){e&&e.forEach(t=>this.addComponent(t))}addComponent(e){const i=e.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().toUpperCase();this.componentsMappedByName[i]=e.componentClass}getComponentClass(e){return this.componentsMappedByName[e]}};AgStackComponentsRegistry=__decorate$2v([Bean("agStackComponentsRegistry")],AgStackComponentsRegistry);function toggleAriaAttribute(s,e,t){t==null||typeof t=="string"&&t==""?removeAriaAttribute(s,e):setAriaAttribute(s,e,t)}function setAriaAttribute(s,e,t){s.setAttribute(ariaAttributeName(e),t.toString())}function removeAriaAttribute(s,e){s.removeAttribute(ariaAttributeName(e))}function ariaAttributeName(s){return`aria-${s}`}function setAriaRole(s,e){e?s.setAttribute("role",e):s.removeAttribute("role")}function getAriaSortState(s){let e;return s==="asc"?e="ascending":s==="desc"?e="descending":s==="mixed"?e="other":e="none",e}function getAriaLevel(s){return parseInt(s.getAttribute("aria-level"),10)}function getAriaPosInSet(s){return parseInt(s.getAttribute("aria-posinset"),10)}function getAriaLabel(s){return s.getAttribute("aria-label")}function setAriaLabel(s,e){toggleAriaAttribute(s,"label",e)}function setAriaLabelledBy(s,e){toggleAriaAttribute(s,"labelledby",e)}function setAriaDescribedBy(s,e){toggleAriaAttribute(s,"describedby",e)}function setAriaLive(s,e){toggleAriaAttribute(s,"live",e)}function setAriaAtomic(s,e){toggleAriaAttribute(s,"atomic",e)}function setAriaRelevant(s,e){toggleAriaAttribute(s,"relevant",e)}function setAriaLevel(s,e){toggleAriaAttribute(s,"level",e)}function setAriaDisabled(s,e){toggleAriaAttribute(s,"disabled",e)}function setAriaHidden(s,e){toggleAriaAttribute(s,"hidden",e)}function setAriaActiveDescendant(s,e){toggleAriaAttribute(s,"activedescendant",e)}function setAriaExpanded(s,e){setAriaAttribute(s,"expanded",e)}function removeAriaExpanded(s){removeAriaAttribute(s,"expanded")}function setAriaSetSize(s,e){setAriaAttribute(s,"setsize",e)}function setAriaPosInSet(s,e){setAriaAttribute(s,"posinset",e)}function setAriaMultiSelectable(s,e){setAriaAttribute(s,"multiselectable",e)}function setAriaRowCount(s,e){setAriaAttribute(s,"rowcount",e)}function setAriaRowIndex(s,e){setAriaAttribute(s,"rowindex",e)}function setAriaColCount(s,e){setAriaAttribute(s,"colcount",e)}function setAriaColIndex(s,e){setAriaAttribute(s,"colindex",e)}function setAriaColSpan(s,e){setAriaAttribute(s,"colspan",e)}function setAriaSort(s,e){setAriaAttribute(s,"sort",e)}function removeAriaSort(s){removeAriaAttribute(s,"sort")}function setAriaSelected(s,e){toggleAriaAttribute(s,"selected",e)}function setAriaChecked(s,e){setAriaAttribute(s,"checked",e===void 0?"mixed":e)}function setAriaControls(s,e){toggleAriaAttribute(s,"controls",e.id),setAriaLabelledBy(e,s.id)}function getAriaCheckboxStateName(s,e){return e===void 0?s("ariaIndeterminate","indeterminate"):e===!0?s("ariaChecked","checked"):s("ariaUnchecked","unchecked")}const AriaUtils=Object.freeze(Object.defineProperty({__proto__:null,getAriaCheckboxStateName,getAriaLabel,getAriaLevel,getAriaPosInSet,getAriaSortState,removeAriaExpanded,removeAriaSort,setAriaActiveDescendant,setAriaAtomic,setAriaChecked,setAriaColCount,setAriaColIndex,setAriaColSpan,setAriaControls,setAriaDescribedBy,setAriaDisabled,setAriaExpanded,setAriaHidden,setAriaLabel,setAriaLabelledBy,setAriaLevel,setAriaLive,setAriaMultiSelectable,setAriaPosInSet,setAriaRelevant,setAriaRole,setAriaRowCount,setAriaRowIndex,setAriaSelected,setAriaSetSize,setAriaSort},Symbol.toStringTag,{value:"Module"}));let isSafari,safariVersion,isChrome,isFirefox,isMacOs,isIOS,invisibleScrollbar,browserScrollbarWidth;function isBrowserSafari(){return isSafari===void 0&&(isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),isSafari}function getSafariVersion(){if(safariVersion===void 0)if(isBrowserSafari()){const s=navigator.userAgent.match(/version\/(\d+)/i);s&&(safariVersion=s[1]!=null?parseFloat(s[1]):0)}else safariVersion=0;return safariVersion}function isBrowserChrome(){if(isChrome===void 0){const s=window;isChrome=!!s.chrome&&(!!s.chrome.webstore||!!s.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return isChrome}function isBrowserFirefox(){return isFirefox===void 0&&(isFirefox=/(firefox)/i.test(navigator.userAgent)),isFirefox}function isMacOsUserAgent(){return isMacOs===void 0&&(isMacOs=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),isMacOs}function isIOSUserAgent(){return isIOS===void 0&&(isIOS=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),isIOS}function browserSupportsPreventScroll(){return!isBrowserSafari()||getSafariVersion()>=15}function getTabIndex(s){if(!s)return null;const e=s.tabIndex,t=s.getAttribute("tabIndex");return e===-1&&(t===null||t===""&&!isBrowserFirefox())?null:e.toString()}function getMaxDivHeight(){if(!document.body)return-1;let s=1e6;const e=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,t=document.createElement("div");for(document.body.appendChild(t);;){const i=s*2;if(t.style.height=i+"px",i>e||t.clientHeight!==i)break;s=i}return document.body.removeChild(t),s}function getBodyWidth(){var s,e,t;return(e=(s=document.body)===null||s===void 0?void 0:s.clientWidth)!==null&&e!==void 0?e:window.innerHeight||((t=document.documentElement)===null||t===void 0?void 0:t.clientWidth)||-1}function getBodyHeight(){var s,e,t;return(e=(s=document.body)===null||s===void 0?void 0:s.clientHeight)!==null&&e!==void 0?e:window.innerHeight||((t=document.documentElement)===null||t===void 0?void 0:t.clientHeight)||-1}function getScrollbarWidth(){return browserScrollbarWidth==null&&initScrollbarWidthAndVisibility(),browserScrollbarWidth}function initScrollbarWidthAndVisibility(){const s=document.body,e=document.createElement("div");e.style.width=e.style.height="100px",e.style.opacity="0",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar",e.style.position="absolute",s.appendChild(e);let t=e.offsetWidth-e.clientWidth;t===0&&e.clientWidth===0&&(t=null),e.parentNode&&e.parentNode.removeChild(e),t!=null&&(browserScrollbarWidth=t,invisibleScrollbar=t===0)}function isInvisibleScrollbar(){return invisibleScrollbar==null&&initScrollbarWidthAndVisibility(),invisibleScrollbar}const BrowserUtils=Object.freeze(Object.defineProperty({__proto__:null,browserSupportsPreventScroll,getBodyHeight,getBodyWidth,getMaxDivHeight,getSafariVersion,getScrollbarWidth,getTabIndex,isBrowserChrome,isBrowserFirefox,isBrowserSafari,isIOSUserAgent,isInvisibleScrollbar,isMacOsUserAgent},Symbol.toStringTag,{value:"Module"}));function padStartWidthZeros(s,e){return s.toString().padStart(e,"0")}function createArrayOfNumbers(s,e){const t=[];for(let i=s;i<=e;i++)t.push(i);return t}function cleanNumber(s){return typeof s=="string"&&(s=parseInt(s,10)),typeof s=="number"?Math.floor(s):null}function decToHex(s,e){let t="";for(let i=0;i<e;i++)t+=String.fromCharCode(s&255),s>>>=8;return t}function formatNumberTwoDecimalPlacesAndCommas(s,e,t){return typeof s!="number"?"":formatNumberCommas(Math.round(s*100)/100,e,t)}function formatNumberCommas(s,e,t){return typeof s!="number"?"":s.toString().replace(".",t).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${e}`)}function sum(s){return s==null?null:s.reduce((e,t)=>e+t,0)}const NumberUtils=Object.freeze(Object.defineProperty({__proto__:null,cleanNumber,createArrayOfNumbers,decToHex,formatNumberCommas,formatNumberTwoDecimalPlacesAndCommas,padStartWidthZeros,sum},Symbol.toStringTag,{value:"Module"}));function serialiseDate(s,e=!0,t="-"){if(!s)return null;let i=[s.getFullYear(),s.getMonth()+1,s.getDate()].map(n=>padStartWidthZeros(n,2)).join(t);return e&&(i+=" "+[s.getHours(),s.getMinutes(),s.getSeconds()].map(n=>padStartWidthZeros(n,2)).join(":")),i}const calculateOrdinal=s=>{if(s>3&&s<21)return"th";switch(s%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function dateToFormattedString(s,e="YYYY-MM-DD"){const t=padStartWidthZeros(s.getFullYear(),4),i=["January","February","March","April","May","June","July","August","September","October","November","December"],n=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],o={YYYY:()=>t.slice(t.length-4,t.length),YY:()=>t.slice(t.length-2,t.length),Y:()=>`${s.getFullYear()}`,MMMM:()=>i[s.getMonth()],MMM:()=>i[s.getMonth()].slice(0,3),MM:()=>padStartWidthZeros(s.getMonth()+1,2),Mo:()=>`${s.getMonth()+1}${calculateOrdinal(s.getMonth()+1)}`,M:()=>`${s.getMonth()+1}`,Do:()=>`${s.getDate()}${calculateOrdinal(s.getDate())}`,DD:()=>padStartWidthZeros(s.getDate(),2),D:()=>`${s.getDate()}`,dddd:()=>n[s.getDay()],ddd:()=>n[s.getDay()].slice(0,3),dd:()=>n[s.getDay()].slice(0,2),do:()=>`${s.getDay()}${calculateOrdinal(s.getDay())}`,d:()=>`${s.getDay()}`},r=new RegExp(Object.keys(o).join("|"),"g");return e.replace(r,a=>a in o?o[a]():a)}function parseDateTimeFromString(s){if(!s)return null;const[e,t]=s.split(" ");if(!e)return null;const i=e.split("-").map(p=>parseInt(p,10));if(i.filter(p=>!isNaN(p)).length!==3)return null;const[n,o,r]=i,a=new Date(n,o-1,r);if(a.getFullYear()!==n||a.getMonth()!==o-1||a.getDate()!==r)return null;if(!t||t==="00:00:00")return a;const[l,d,h]=t.split(":").map(p=>parseInt(p,10));return l>=0&&l<24&&a.setHours(l),d>=0&&d<60&&a.setMinutes(d),h>=0&&h<60&&a.setSeconds(h),a}const DateUtils=Object.freeze(Object.defineProperty({__proto__:null,dateToFormattedString,parseDateTimeFromString,serialiseDate},Symbol.toStringTag,{value:"Module"}));let rtlNegativeScroll;function radioCssClass(s,e,t){const i=s.parentElement;let n=i&&i.firstChild;for(;n;)e&&n.classList.toggle(e,n===s),t&&n.classList.toggle(t,n!==s),n=n.nextSibling}const FOCUSABLE_SELECTOR="[tabindex], input, select, button, textarea, [href]",FOCUSABLE_EXCLUDE="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function isFocusableFormField(s){const e=Element.prototype.matches||Element.prototype.msMatchesSelector,t="input, select, button, textarea",i=e.call(s,t),n=e.call(s,FOCUSABLE_EXCLUDE),o=isVisible(s);return i&&!n&&o}function setDisplayed(s,e,t={}){const{skipAriaHidden:i}=t;s.classList.toggle("ag-hidden",!e),i||setAriaHidden(s,!e)}function setVisible(s,e,t={}){const{skipAriaHidden:i}=t;s.classList.toggle("ag-invisible",!e),i||setAriaHidden(s,!e)}function setDisabled(s,e){const t="disabled",i=e?n=>n.setAttribute(t,""):n=>n.removeAttribute(t);i(s),nodeListForEach(s.querySelectorAll("input"),n=>i(n))}function isElementChildOfClass(s,e,t){let i=0;for(;s;){if(s.classList.contains(e))return!0;if(s=s.parentElement,typeof t=="number"){if(++i>t)break}else if(s===t)break}return!1}function getElementSize(s){const{height:e,width:t,borderTopWidth:i,borderRightWidth:n,borderBottomWidth:o,borderLeftWidth:r,paddingTop:a,paddingRight:l,paddingBottom:d,paddingLeft:h,marginTop:p,marginRight:m,marginBottom:v,marginLeft:y,boxSizing:b}=window.getComputedStyle(s);return{height:parseFloat(e||"0"),width:parseFloat(t||"0"),borderTopWidth:parseFloat(i||"0"),borderRightWidth:parseFloat(n||"0"),borderBottomWidth:parseFloat(o||"0"),borderLeftWidth:parseFloat(r||"0"),paddingTop:parseFloat(a||"0"),paddingRight:parseFloat(l||"0"),paddingBottom:parseFloat(d||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(p||"0"),marginRight:parseFloat(m||"0"),marginBottom:parseFloat(v||"0"),marginLeft:parseFloat(y||"0"),boxSizing:b}}function getInnerHeight(s){const e=getElementSize(s);return e.boxSizing==="border-box"?e.height-e.paddingTop-e.paddingBottom:e.height}function getInnerWidth(s){const e=getElementSize(s);return e.boxSizing==="border-box"?e.width-e.paddingLeft-e.paddingRight:e.width}function getAbsoluteHeight(s){const e=getElementSize(s),t=e.marginBottom+e.marginTop;return Math.ceil(s.offsetHeight+t)}function getAbsoluteWidth(s){const e=getElementSize(s),t=e.marginLeft+e.marginRight;return Math.ceil(s.offsetWidth+t)}function getElementRectWithOffset(s){const e=s.getBoundingClientRect(),{borderTopWidth:t,borderLeftWidth:i,borderRightWidth:n,borderBottomWidth:o}=getElementSize(s);return{top:e.top+(t||0),left:e.left+(i||0),right:e.right+(n||0),bottom:e.bottom+(o||0)}}function isRtlNegativeScroll(){if(typeof rtlNegativeScroll=="boolean")return rtlNegativeScroll;const s=document.createElement("div");return s.style.direction="rtl",s.style.width="1px",s.style.height="1px",s.style.position="fixed",s.style.top="0px",s.style.overflow="hidden",s.dir="rtl",s.innerHTML=`<div style="width: 2px">
|
||
<span style="display: inline-block; width: 1px"></span>
|
||
<span style="display: inline-block; width: 1px"></span>
|
||
</div>`,document.body.appendChild(s),s.scrollLeft=1,rtlNegativeScroll=Math.floor(s.scrollLeft)===0,document.body.removeChild(s),rtlNegativeScroll}function getScrollLeft(s,e){let t=s.scrollLeft;return e&&(t=Math.abs(t),isBrowserChrome()&&!isRtlNegativeScroll()&&(t=s.scrollWidth-s.clientWidth-t)),t}function setScrollLeft(s,e,t){t&&(isRtlNegativeScroll()?e*=-1:(isBrowserSafari()||isBrowserChrome())&&(e=s.scrollWidth-s.clientWidth-e)),s.scrollLeft=e}function clearElement(s){for(;s&&s.firstChild;)s.removeChild(s.firstChild)}function removeFromParent(s){s&&s.parentNode&&s.parentNode.removeChild(s)}function isInDOM(s){return!!s.offsetParent}function isVisible(s){const e=s;return e.checkVisibility?e.checkVisibility({checkVisibilityCSS:!0}):!(!isInDOM(s)||window.getComputedStyle(s).visibility!=="visible")}function loadTemplate(s){const e=document.createElement("div");return e.innerHTML=(s||"").trim(),e.firstChild}function ensureDomOrder(s,e,t){t&&t.nextSibling===e||(t?t.nextSibling?s.insertBefore(e,t.nextSibling):s.appendChild(e):s.firstChild&&s.firstChild!==e&&s.insertAdjacentElement("afterbegin",e))}function setDomChildOrder(s,e){for(let t=0;t<e.length;t++){const i=e[t],n=s.children[t];n!==i&&s.insertBefore(i,n)}}function insertWithDomOrder(s,e,t){t?t.insertAdjacentElement("afterend",e):s.firstChild?s.insertAdjacentElement("afterbegin",e):s.appendChild(e)}function addStylesToElement(s,e){if(e)for(const[t,i]of Object.entries(e)){if(!t||!t.length||i==null)continue;const n=camelCaseToHyphenated(t),o=i.toString(),r=o.replace(/\s*!important/g,""),a=r.length!=o.length?"important":void 0;s.style.setProperty(n,r,a)}}function isHorizontalScrollShowing(s){return s.clientWidth<s.scrollWidth}function isVerticalScrollShowing(s){return s.clientHeight<s.scrollHeight}function setElementWidth(s,e){e==="flex"?(s.style.removeProperty("width"),s.style.removeProperty("minWidth"),s.style.removeProperty("maxWidth"),s.style.flex="1 1 auto"):setFixedWidth(s,e)}function setFixedWidth(s,e){e=formatSize(e),s.style.width=e.toString(),s.style.maxWidth=e.toString(),s.style.minWidth=e.toString()}function setElementHeight(s,e){e==="flex"?(s.style.removeProperty("height"),s.style.removeProperty("minHeight"),s.style.removeProperty("maxHeight"),s.style.flex="1 1 auto"):setFixedHeight(s,e)}function setFixedHeight(s,e){e=formatSize(e),s.style.height=e.toString(),s.style.maxHeight=e.toString(),s.style.minHeight=e.toString()}function formatSize(s){return typeof s=="number"?`${s}px`:s}function isNodeOrElement(s){return s instanceof Node||s instanceof HTMLElement}function copyNodeList(s){if(s==null)return[];const e=[];return nodeListForEach(s,t=>e.push(t)),e}function iterateNamedNodeMap(s,e){if(s)for(let t=0;t<s.length;t++){const i=s[t];e(i.name,i.value)}}function addOrRemoveAttribute(s,e,t){t==null?s.removeAttribute(e):s.setAttribute(e,t.toString())}function nodeListForEach(s,e){if(s!=null)for(let t=0;t<s.length;t++)e(s[t])}function bindCellRendererToHtmlElement(s,e){s.then(t=>{const i=t.getGui();i!=null&&(typeof i=="object"?e.appendChild(i):e.innerHTML=i)})}const DomUtils=Object.freeze(Object.defineProperty({__proto__:null,FOCUSABLE_EXCLUDE,FOCUSABLE_SELECTOR,addOrRemoveAttribute,addStylesToElement,bindCellRendererToHtmlElement,clearElement,copyNodeList,ensureDomOrder,formatSize,getAbsoluteHeight,getAbsoluteWidth,getElementRectWithOffset,getElementSize,getInnerHeight,getInnerWidth,getScrollLeft,insertWithDomOrder,isElementChildOfClass,isFocusableFormField,isHorizontalScrollShowing,isInDOM,isNodeOrElement,isRtlNegativeScroll,isVerticalScrollShowing,isVisible,iterateNamedNodeMap,loadTemplate,nodeListForEach,radioCssClass,removeFromParent,setDisabled,setDisplayed,setDomChildOrder,setElementHeight,setElementWidth,setFixedHeight,setFixedWidth,setScrollLeft,setVisible},Symbol.toStringTag,{value:"Module"}));function fuzzyCheckStrings(s,e,t){const i={},n=s.filter(o=>!e.some(r=>r===o));return n.length>0&&n.forEach(o=>i[o]=fuzzySuggestions(o,t).values),i}function fuzzySuggestions(s,e,t,i){let n=e.map((a,l)=>({value:a,relevance:stringWeightedDistances(s.toLowerCase(),a.toLocaleLowerCase()),idx:l}));if(n.sort((a,l)=>l.relevance-a.relevance),t&&(n=n.filter(a=>a.relevance!==0)),n.length>0&&i&&i>0){const l=n[0].relevance*i;n=n.filter(d=>l-d.relevance<0)}const o=[],r=[];for(const a of n)o.push(a.value),r.push(a.idx);return{values:o,indices:r}}function stringWeightedDistances(s,e){const t=s.replace(/\s/g,""),i=e.replace(/\s/g,"");let n=0,o=-1;for(let r=0;r<t.length;r++){const a=i.indexOf(t[r],o+1);a!==-1&&(o=a,n+=100-o*100/1e4*100)}return n}const FuzzyMatchUtils=Object.freeze(Object.defineProperty({__proto__:null,fuzzyCheckStrings,fuzzySuggestions},Symbol.toStringTag,{value:"Module"})),iconNameClassMap={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus"};function createIcon(s,e,t){const i=createIconNoSpan(s,e,t);if(i){const{className:o}=i;if(typeof o=="string"&&o.indexOf("ag-icon")>-1||typeof o=="object"&&o["ag-icon"])return i}const n=document.createElement("span");return n.appendChild(i),n}function createIconNoSpan(s,e,t,i){let n=null;const o=t&&t.getColDef().icons;if(o&&(n=o[s]),e&&!n){const r=e.get("icons");r&&(n=r[s])}if(n){let r;if(typeof n=="function")r=n();else if(typeof n=="string")r=n;else throw new Error("icon from grid options needs to be a string or a function");if(typeof r=="string")return loadTemplate(r);if(isNodeOrElement(r))return r;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}else{const r=document.createElement("span");let a=iconNameClassMap[s];return a||(i?a=s:(console.warn(`AG Grid: Did not find icon ${s}`),a="")),r.setAttribute("class",`ag-icon ag-icon-${a}`),r.setAttribute("unselectable","on"),setAriaRole(r,"presentation"),r}}const IconUtils=Object.freeze(Object.defineProperty({__proto__:null,createIcon,createIconNoSpan,iconNameClassMap},Symbol.toStringTag,{value:"Module"}));class KeyCode{}KeyCode.BACKSPACE="Backspace";KeyCode.TAB="Tab";KeyCode.ENTER="Enter";KeyCode.ESCAPE="Escape";KeyCode.SPACE=" ";KeyCode.LEFT="ArrowLeft";KeyCode.UP="ArrowUp";KeyCode.RIGHT="ArrowRight";KeyCode.DOWN="ArrowDown";KeyCode.DELETE="Delete";KeyCode.F2="F2";KeyCode.PAGE_UP="PageUp";KeyCode.PAGE_DOWN="PageDown";KeyCode.PAGE_HOME="Home";KeyCode.PAGE_END="End";KeyCode.A="KeyA";KeyCode.C="KeyC";KeyCode.D="KeyD";KeyCode.V="KeyV";KeyCode.X="KeyX";KeyCode.Y="KeyY";KeyCode.Z="KeyZ";const A_KEYCODE=65,C_KEYCODE=67,V_KEYCODE=86,D_KEYCODE=68,Z_KEYCODE=90,Y_KEYCODE=89;function isEventFromPrintableCharacter(s){return s.altKey||s.ctrlKey||s.metaKey?!1:s.key.length===1}function isUserSuppressingKeyboardEvent(s,e,t,i,n){const o=i?i.getColDef().suppressKeyboardEvent:void 0;if(!o)return!1;const r=s.addGridCommonParams({event:e,editing:n,column:i,node:t,data:t.data,colDef:i.getColDef()});return!!(o&&o(r))}function isUserSuppressingHeaderKeyboardEvent(s,e,t,i){const n=i.getDefinition(),o=n&&n.suppressHeaderKeyboardEvent;if(!exists(o))return!1;const r=s.addGridCommonParams({colDef:n,column:i,headerRowIndex:t,event:e});return!!o(r)}function normaliseQwertyAzerty(s){const{keyCode:e}=s;let t;switch(e){case A_KEYCODE:t=KeyCode.A;break;case C_KEYCODE:t=KeyCode.C;break;case V_KEYCODE:t=KeyCode.V;break;case D_KEYCODE:t=KeyCode.D;break;case Z_KEYCODE:t=KeyCode.Z;break;case Y_KEYCODE:t=KeyCode.Y;break;default:t=s.code}return t}function isDeleteKey(s,e=!1){return s===KeyCode.DELETE?!0:!e&&s===KeyCode.BACKSPACE?isMacOsUserAgent():!1}const KeyboardUtils=Object.freeze(Object.defineProperty({__proto__:null,isDeleteKey,isEventFromPrintableCharacter,isUserSuppressingHeaderKeyboardEvent,isUserSuppressingKeyboardEvent,normaliseQwertyAzerty},Symbol.toStringTag,{value:"Module"}));function areEventsNear(s,e,t){if(t===0)return!1;const i=Math.abs(s.clientX-e.clientX),n=Math.abs(s.clientY-e.clientY);return Math.max(i,n)<=t}const MouseUtils=Object.freeze(Object.defineProperty({__proto__:null,areEventsNear},Symbol.toStringTag,{value:"Module"}));function sortRowNodesByOrder(s,e){if(!s)return!1;const t=(r,a)=>{const l=e[r.id],d=e[a.id],h=l!==void 0,p=d!==void 0,m=h&&p,v=!h&&!p;return m?l-d:v?r.__objectId-a.__objectId:h?1:-1};let i,n,o=!1;for(let r=0;r<s.length-1;r++)if(i=s[r],n=s[r+1],t(i,n)>0){o=!0;break}return o?(s.sort(t),!0):!1}const RowNodeUtils=Object.freeze(Object.defineProperty({__proto__:null,sortRowNodesByOrder},Symbol.toStringTag,{value:"Module"}));function convertToSet(s){const e=new Set;return s.forEach(t=>e.add(t)),e}const SetUtils=Object.freeze(Object.defineProperty({__proto__:null,convertToSet},Symbol.toStringTag,{value:"Module"})),utils=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},AriaUtils),ArrayUtils),BrowserUtils),DateUtils),DomUtils),EventUtils),FunctionUtils),FuzzyMatchUtils),GenericUtils),IconUtils),KeyboardUtils),MapUtils),MouseUtils),NumberUtils),ObjectUtils),RowNodeUtils),SetUtils),StringUtils),_=utils;class NumberSequence{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}}var AgPromiseStatus;(function(s){s[s.IN_PROGRESS=0]="IN_PROGRESS",s[s.RESOLVED=1]="RESOLVED"})(AgPromiseStatus||(AgPromiseStatus={}));class AgPromise{constructor(e){this.status=AgPromiseStatus.IN_PROGRESS,this.resolution=null,this.waiters=[],e(t=>this.onDone(t),t=>this.onReject(t))}static all(e){return new AgPromise(t=>{let i=e.length;const n=new Array(i);e.forEach((o,r)=>{o.then(a=>{n[r]=a,i--,i===0&&t(n)})})})}static resolve(e=null){return new AgPromise(t=>t(e))}then(e){return new AgPromise(t=>{this.status===AgPromiseStatus.RESOLVED?t(e(this.resolution)):this.waiters.push(i=>t(e(i)))})}resolveNow(e,t){return this.status===AgPromiseStatus.RESOLVED?t(this.resolution):e}onDone(e){this.status=AgPromiseStatus.RESOLVED,this.resolution=e,this.waiters.forEach(t=>t(e))}onReject(e){console.warn("TBI")}}var __decorate$2u=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},TooltipStates;(function(s){s[s.NOTHING=0]="NOTHING",s[s.WAITING_TO_SHOW=1]="WAITING_TO_SHOW",s[s.SHOWING=2]="SHOWING"})(TooltipStates||(TooltipStates={}));var TooltipTrigger;(function(s){s[s.HOVER=0]="HOVER",s[s.FOCUS=1]="FOCUS"})(TooltipTrigger||(TooltipTrigger={}));class CustomTooltipFeature extends BeanStub{constructor(e,t,i){super(),this.parentComp=e,this.tooltipShowDelayOverride=t,this.tooltipHideDelayOverride=i,this.SHOW_QUICK_TOOLTIP_DIFF=1e3,this.FADE_OUT_TOOLTIP_TIMEOUT=1e3,this.INTERACTIVE_HIDE_DELAY=100,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=TooltipStates.NOTHING,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}postConstruct(){this.gridOptionsService.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gridOptionsService.get("tooltipMouseTrack");const e=this.parentComp.getGui();this.tooltipTrigger===TooltipTrigger.HOVER&&(this.addManagedListener(e,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(e,"mouseleave",this.onMouseLeave.bind(this))),this.tooltipTrigger===TooltipTrigger.FOCUS&&(this.addManagedListener(e,"focusin",this.onFocusIn.bind(this)),this.addManagedListener(e,"focusout",this.onFocusOut.bind(this))),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.interactionEnabled||(this.addManagedListener(e,"mousedown",this.onMouseDown.bind(this)),this.addManagedListener(e,"keydown",this.onKeyDown.bind(this)))}getGridOptionsTooltipDelay(e){const t=this.gridOptionsService.get(e);return t<0&&warnOnce(`${e} should not be lower than 0`),Math.max(200,t)}getTooltipDelay(e){var t,i;return e==="show"?(t=this.tooltipShowDelayOverride)!==null&&t!==void 0?t:this.getGridOptionsTooltipDelay("tooltipShowDelay"):(i=this.tooltipHideDelayOverride)!==null&&i!==void 0?i:this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gridOptionsService.get("tooltipTrigger");return!e||e==="hover"?TooltipTrigger.HOVER:TooltipTrigger.FOCUS}onMouseEnter(e){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),!isIOSUserAgent()&&(CustomTooltipFeature.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(e)},this.INTERACTIVE_HIDE_DELAY):this.prepareToShowTooltip(e))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&this.state===TooltipStates.SHOWING&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){var t;const i=e.relatedTarget,n=this.parentComp.getGui(),o=(t=this.tooltipComp)===null||t===void 0?void 0:t.getGui();this.isInteractingWithTooltip||n.contains(i)||this.interactionEnabled&&(o!=null&&o.contains(i))||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(e){if(this.state!=TooltipStates.NOTHING||CustomTooltipFeature.isLocked)return!1;let t=0;return e&&(t=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=e||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),t),this.state=TooltipStates.WAITING_TO_SHOW,!0}isLastTooltipHiddenRecently(){const e=new Date().getTime(),t=CustomTooltipFeature.lastTooltipHideTime;return e-t<this.SHOW_QUICK_TOOLTIP_DIFF}setToDoNothing(){this.state===TooltipStates.SHOWING&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=TooltipStates.NOTHING,this.lastMouseEvent=null}showTooltip(){const e=Object.assign({},this.parentComp.getTooltipParams());if(!exists(e.value)){this.setToDoNothing();return}this.state=TooltipStates.SHOWING,this.tooltipInstanceCount++;const t=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(t)}hideTooltip(e){if(!e&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),CustomTooltipFeature.lastTooltipHideTime=new Date().getTime());const t={type:Events.EVENT_TOOLTIP_HIDE,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(t),this.state=TooltipStates.NOTHING}newTooltipComponentCallback(e,t){if(this.state!==TooltipStates.SHOWING||this.tooltipInstanceCount!==e){this.getContext().destroyBean(t);return}const n=t.getGui();this.tooltipComp=t,n.classList.contains("ag-tooltip")||n.classList.add("ag-tooltip-custom"),this.tooltipTrigger===TooltipTrigger.HOVER&&n.classList.add("ag-tooltip-animate"),this.interactionEnabled&&n.classList.add("ag-tooltip-interactive");const o=this.localeService.getLocaleTextFunc(),r=this.popupService.addPopup({eChild:n,ariaLabel:o("ariaLabelTooltip","Tooltip")});r&&(this.tooltipPopupDestroyFunc=r.hideFunc),this.positionTooltip(),this.tooltipTrigger===TooltipTrigger.FOCUS&&(this.onBodyScrollEventCallback=this.addManagedListener(this.eventService,Events.EVENT_BODY_SCROLL,this.setToDoNothing.bind(this)),this.onColumnMovedEventCallback=this.addManagedListener(this.eventService,Events.EVENT_COLUMN_MOVED,this.setToDoNothing.bind(this))),this.interactionEnabled&&(this.tooltipTrigger===TooltipTrigger.HOVER?(this.tooltipMouseEnterListener=this.addManagedListener(n,"mouseenter",this.onTooltipMouseEnter.bind(this))||null,this.tooltipMouseLeaveListener=this.addManagedListener(n,"mouseleave",this.onTooltipMouseLeave.bind(this))||null):(this.tooltipFocusInListener=this.addManagedListener(n,"focusin",this.onTooltipFocusIn.bind(this))||null,this.tooltipFocusOutListener=this.addManagedListener(n,"focusout",this.onTooltipFocusOut.bind(this))||null));const a={type:Events.EVENT_TOOLTIP_SHOW,tooltipGui:n,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(a),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(e){var t;const i=this.parentComp.getGui(),n=(t=this.tooltipComp)===null||t===void 0?void 0:t.getGui(),o=e.relatedTarget;n!=null&&n.contains(o)||(this.isInteractingWithTooltip=!1,i.contains(o)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent(Object.assign(Object.assign({},e),{mouseEvent:this.lastMouseEvent})):this.popupService.positionPopupByComponent(Object.assign(Object.assign({},e),{eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5}))}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,i=this.tooltipTrigger===TooltipTrigger.HOVER?this.FADE_OUT_TOOLTIP_TIMEOUT:0;window.setTimeout(()=>{e(),this.getContext().destroyBean(t)},i),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(e=>{e&&e()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){CustomTooltipFeature.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},this.INTERACTIVE_HIDE_DELAY)}unlockService(){CustomTooltipFeature.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}}CustomTooltipFeature.isLocked=!1;__decorate$2u([Autowired("popupService")],CustomTooltipFeature.prototype,"popupService",void 0);__decorate$2u([Autowired("userComponentFactory")],CustomTooltipFeature.prototype,"userComponentFactory",void 0);__decorate$2u([PostConstruct],CustomTooltipFeature.prototype,"postConstruct",null);class CssClassManager{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(n=>this.addCssClass(n));return}if(this.cssClassStates[e]!==!0&&e.length){const n=this.getGui();n&&n.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(n=>this.removeCssClass(n));return}if(this.cssClassStates[e]!==!1&&e.length){const n=this.getGui();n&&n.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return t?t.classList.contains(e):!1}addOrRemoveCssClass(e,t){if(!e)return;if(e.indexOf(" ")>=0){const n=(e||"").split(" ");if(n.length>1){n.forEach(o=>this.addOrRemoveCssClass(o,t));return}}if(this.cssClassStates[e]!==t&&e.length){const n=this.getGui();n&&n.classList.toggle(e,t),this.cssClassStates[e]=t}}}var __decorate$2t=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const compIdSequence=new NumberSequence;class Component extends BeanStub{constructor(e){super(),this.displayed=!0,this.visible=!0,this.compId=compIdSequence.next(),this.cssClassManager=new CssClassManager(()=>this.eGui),e&&this.setTemplate(e)}preConstructOnComponent(){this.usingBrowserTooltips=this.gridOptionsService.get("enableBrowserTooltips")}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(e,t,i){const n=()=>{this.usingBrowserTooltips?this.getGui().removeAttribute("title"):this.tooltipFeature=this.destroyBean(this.tooltipFeature)},o=()=>{this.usingBrowserTooltips?this.getGui().setAttribute("title",this.tooltipText):this.tooltipFeature=this.createBean(new CustomTooltipFeature(this,t,i))};this.tooltipText!=e&&(this.tooltipText&&n(),e!=null&&(this.tooltipText=e,this.tooltipText&&o()))}createChildComponentsFromTags(e,t){copyNodeList(e.childNodes).forEach(n=>{if(!(n instanceof HTMLElement))return;const o=this.createComponentFromElement(n,r=>{r.getGui()&&this.copyAttributesFromNode(n,r.getGui())},t);if(o){if(o.addItems&&n.children.length){this.createChildComponentsFromTags(n,t);const r=Array.prototype.slice.call(n.children);o.addItems(r)}this.swapComponentForNode(o,e,n)}else n.childNodes&&this.createChildComponentsFromTags(n,t)})}createComponentFromElement(e,t,i){const n=e.nodeName,o=i?i[e.getAttribute("ref")]:void 0,r=this.agStackComponentsRegistry.getComponentClass(n);if(r){Component.elementGettingCreated=e;const a=new r(o);return a.setParentComponent(this),this.createBean(a,null,t),a}return null}copyAttributesFromNode(e,t){iterateNamedNodeMap(e.attributes,(i,n)=>t.setAttribute(i,n))}swapComponentForNode(e,t,i){const n=e.getGui();t.replaceChild(n,i),t.insertBefore(document.createComment(i.nodeName),n),this.addDestroyFunc(this.destroyBean.bind(this,e)),this.swapInComponentForQuerySelectors(e,i)}swapInComponentForQuerySelectors(e,t){const i=this;this.iterateOverQuerySelectors(n=>{i[n.attributeName]===t&&(i[n.attributeName]=e)})}iterateOverQuerySelectors(e){let t=Object.getPrototypeOf(this);for(;t!=null;){const i=t.__agComponentMetaData,n=getFunctionName(t.constructor);i&&i[n]&&i[n].querySelectors&&i[n].querySelectors.forEach(o=>e(o)),t=Object.getPrototypeOf(t)}}activateTabIndex(e){const t=this.gridOptionsService.get("tabIndex");e||(e=[]),e.length||e.push(this.getGui()),e.forEach(i=>i.setAttribute("tabindex",t.toString()))}setTemplate(e,t){const i=loadTemplate(e);this.setTemplateFromElement(i,t)}setTemplateFromElement(e,t){this.eGui=e,this.eGui.__agComponent=this,this.wireQuerySelectors(),this.getContext()&&this.createChildComponentsFromTags(this.getGui(),t)}createChildComponentsPreConstruct(){this.getGui()&&this.createChildComponentsFromTags(this.getGui())}wireQuerySelectors(){if(!this.eGui)return;const e=this;this.iterateOverQuerySelectors(t=>{const i=o=>e[t.attributeName]=o;if(t.refSelector&&this.getAttribute("ref")===t.refSelector)i(this.eGui);else{const o=this.eGui.querySelector(t.querySelector);o&&i(o.__agComponent||o)}})}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}queryForHtmlInputElement(e){return this.eGui.querySelector(e)}appendChild(e,t){if(e!=null)if(t||(t=this.eGui),isNodeOrElement(e))t.appendChild(e);else{const i=e;t.appendChild(i.getGui())}}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:i}=t;setVisible(this.eGui,e,{skipAriaHidden:i})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:i}=t;setDisplayed(this.eGui,e,{skipAriaHidden:i});const n={type:Component.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(n)}}destroy(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.parentComponent&&(this.parentComponent=void 0);const e=this.eGui;e&&e.__agComponent&&(e.__agComponent=void 0),super.destroy()}addGuiEventListener(e,t,i){this.eGui.addEventListener(e,t,i),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCssClass(e){this.cssClassManager.addCssClass(e)}removeCssClass(e){this.cssClassManager.removeCssClass(e)}containsCssClass(e){return this.cssClassManager.containsCssClass(e)}addOrRemoveCssClass(e,t){this.cssClassManager.addOrRemoveCssClass(e,t)}getAttribute(e){const{eGui:t}=this;return t?t.getAttribute(e):null}getRefElement(e){return this.queryForHtmlElement(`[ref="${e}"]`)}}Component.EVENT_DISPLAYED_CHANGED="displayedChanged";__decorate$2t([Autowired("agStackComponentsRegistry")],Component.prototype,"agStackComponentsRegistry",void 0);__decorate$2t([PreConstruct],Component.prototype,"preConstructOnComponent",null);__decorate$2t([PreConstruct],Component.prototype,"createChildComponentsPreConstruct",null);function RefSelector(s){return querySelectorFunc.bind(this,`[ref=${s}]`,s)}function querySelectorFunc(s,e,t,i,n){if(s===null){console.error("AG Grid: QuerySelector selector should not be null");return}if(typeof n=="number"){console.error("AG Grid: QuerySelector should be on an attribute");return}addToObjectProps(t,"querySelectors",{attributeName:i,querySelector:s,refSelector:e})}function addToObjectProps(s,e,t){const i=getOrCreateProps(s,getFunctionName(s.constructor));i[e]||(i[e]=[]),i[e].push(t)}function getOrCreateProps(s,e){return s.__agComponentMetaData||(s.__agComponentMetaData={}),s.__agComponentMetaData[e]||(s.__agComponentMetaData[e]={}),s.__agComponentMetaData[e]}var __decorate$2s=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class ReadOnlyFloatingFilter extends Component{constructor(){super(`
|
||
<div class="ag-floating-filter-input" role="presentation">
|
||
<ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>
|
||
</div>`)}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}})}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}}__decorate$2s([RefSelector("eFloatingFilterText")],ReadOnlyFloatingFilter.prototype,"eFloatingFilterText",void 0);__decorate$2s([Autowired("columnModel")],ReadOnlyFloatingFilter.prototype,"columnModel",void 0);class DateCompWrapper{constructor(e,t,i,n){this.alive=!0,this.context=e,this.eParent=n,t.getDateCompDetails(i).newAgStackInstance().then(a=>{if(!this.alive){e.destroyBean(a);return}this.dateComp=a,a&&(n.appendChild(a.getGui()),a.afterGuiAttached&&a.afterGuiAttached(),this.tempValue&&a.setDate(this.tempValue),this.disabled!=null&&this.setDateCompDisabled(this.disabled))})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){setDisplayed(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&typeof this.dateComp.afterGuiAttached=="function"&&this.dateComp.afterGuiAttached(e)}updateParams(e){var t,i;let n=!1;!((t=this.dateComp)===null||t===void 0)&&t.refresh&&typeof this.dateComp.refresh=="function"&&this.dateComp.refresh(e)!==null&&(n=!0),!n&&(!((i=this.dateComp)===null||i===void 0)&&i.onParamsUpdated)&&typeof this.dateComp.onParamsUpdated=="function"&&this.dateComp.onParamsUpdated(e)!==null&&warnOnce("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(e){this.dateComp!=null&&this.dateComp.setDisabled!=null&&this.dateComp.setDisabled(e)}}class OptionsFactory{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(e=>{if(typeof e=="string")return;const t=[["displayKey"],["displayName"],["predicate","test"]],i=n=>n.some(o=>e[o]!=null)?!0:(console.warn(`AG Grid: ignoring FilterOptionDef as it doesn't contain one of '${n}'`),!1);if(!t.every(i)){this.filterOptions=this.filterOptions.filter(n=>n===e)||[];return}this.customFilterOptions[e.displayKey]=e})}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const t=this.filterOptions[0];typeof t=="string"?this.defaultOption=t:t.displayKey?this.defaultOption=t.displayKey:console.warn("AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else console.warn("AG Grid: no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}}const FILTER_LOCALE_TEXT={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"};var __decorate$2r=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class ManagedFocusFeature extends BeanStub{constructor(e,t={}){super(),this.eFocusableElement=e,this.callbacks=t,this.callbacks=Object.assign({shouldStopEventPropagation:()=>!1,onTabKeyDown:i=>{if(i.defaultPrevented)return;const n=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,i.shiftKey);n&&(n.focus(),i.preventDefault())}},t)}postConstruct(){this.eFocusableElement.classList.add(ManagedFocusFeature.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedListener(this.eFocusableElement,"focusin",this.callbacks.onFocusIn),this.callbacks.onFocusOut&&this.addManagedListener(this.eFocusableElement,"focusout",this.callbacks.onFocusOut)}addKeyDownListeners(e){this.addManagedListener(e,"keydown",t=>{if(!(t.defaultPrevented||isStopPropagationForAgGrid(t))){if(this.callbacks.shouldStopEventPropagation(t)){stopPropagationForAgGrid(t);return}t.key===KeyCode.TAB?this.callbacks.onTabKeyDown(t):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(t)}})}}ManagedFocusFeature.FOCUS_MANAGED_CLASS="ag-focus-managed";__decorate$2r([Autowired("focusService")],ManagedFocusFeature.prototype,"focusService",void 0);__decorate$2r([PostConstruct],ManagedFocusFeature.prototype,"postConstruct",null);var __decorate$2q=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const RESIZE_CONTAINER_STYLE="ag-resizer-wrapper",RESIZE_TEMPLATE=`<div class="${RESIZE_CONTAINER_STYLE}">
|
||
<div ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>
|
||
<div ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>
|
||
<div ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>
|
||
<div ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>
|
||
<div ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>
|
||
<div ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>
|
||
<div ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>
|
||
<div ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>
|
||
</div>`;class PositionableFeature extends BeanStub{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,n=e/2-this.getHeight()/2;this.offsetElement(i,n)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:n,minHeight:o,height:r,x:a,y:l}=this.config;this.offsetParent||this.setOffsetParent();let d=0,h=0;const p=isVisible(this.element);if(p){const m=this.findBoundaryElement(),v=window.getComputedStyle(m);if(v.minWidth!=null){const y=m.offsetWidth-this.element.offsetWidth;h=parseInt(v.minWidth,10)-y}if(v.minHeight!=null){const y=m.offsetHeight-this.element.offsetHeight;d=parseInt(v.minHeight,10)-y}}if(this.minHeight=o||d,this.minWidth=i||h,n&&this.setWidth(n),r&&this.setHeight(r),(!n||!r)&&this.refreshSize(),e)this.center();else if(a||l)this.offsetElement(a,l);else if(p&&t){let m=this.boundaryEl,v=!0;if(m||(m=this.findBoundaryElement(),v=!1),m){const y=parseFloat(m.style.top),b=parseFloat(m.style.left);v?this.offsetElement(isNaN(b)?0:b,isNaN(y)?0:y):this.setPosition(b,y)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),typeof e=="boolean"){if(e===!1)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach(t=>{const n=!!e[t],o=this.getResizerElement(t),r={dragStartPixels:0,eElement:o,onDragStart:a=>this.onResizeStart(a,t),onDragging:this.onResize.bind(this),onDragStop:a=>this.onResizeEnd(a,t)};(n||!this.isAlive()&&!n)&&(n?(this.dragService.addDragSource(r),this.resizeListeners.push(r),o.style.pointerEvents="all"):o.style.pointerEvents="none",this.resizable[t]=n)})}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;t!==-1&&(this.element.style.width=`${t}px`),e!==-1&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let n=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)setFixedHeight(i,e),e=getAbsoluteHeight(i),n=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const o=this.getAvailableHeight();o&&e>o&&(e=o)}this.getHeight()!==e&&(n?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?setFixedHeight(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height=typeof e=="number"?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const n=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=e?this.position.y:n.top,a=e?0:o.top;let l=0;if(t){const h=this.element.parentElement;if(h){const{bottom:p}=h.getBoundingClientRect();l=p-n.bottom}}return i+a-r-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let n=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)setFixedWidth(t,e),e=getAbsoluteWidth(t),n=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:o}=this.offsetParent,r=i?this.position.x:this.element.getBoundingClientRect().left;o&&e+r>o&&(e=o-r)}this.getWidth()!==e&&(n?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?setFixedWidth(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width=typeof e=="number"?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,n=i?this.boundaryEl:this.element;n&&(this.popupService.positionPopup({ePopup:n,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(n.style.left),parseFloat(n.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const i=this.getAvailableHeight();this.element.style.setProperty("max-height",`${i}px`)};e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),t):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:n,anywhereWithin:o,topBuffer:r}=e,a=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y,d=this.shouldSkipX(t,!!i,!!o,a)?0:a,h=this.shouldSkipY(t,!!n,r,l)?0:l;return{movementX:d,movementY:h}}shouldSkipX(e,t,i,n){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),a=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:o.left;let d=l<=0&&r.left>=e.clientX||r.right<=e.clientX&&r.right<=a.right;return d?!0:(t?d=n<0&&e.clientX>l+r.left||n>0&&e.clientX<l+r.left:i?d=n<0&&e.clientX>a.right||n>0&&e.clientX<l+r.left:d=n<0&&e.clientX>a.right||n>0&&e.clientX<a.right,d)}shouldSkipY(e,t,i=0,n){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),a=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:o.top;let d=l<=0&&r.top>=e.clientY||r.bottom<=e.clientY&&r.bottom<=a.bottom;return d?!0:(t?d=n<0&&e.clientY>l+r.top+i||n>0&&e.clientY<l+r.top:d=n<0&&e.clientY>a.bottom||n>0&&e.clientY<a.bottom,d)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[ref=eTopLeftResizer]")},top:{element:e.querySelector("[ref=eTopResizer]")},topRight:{element:e.querySelector("[ref=eTopRightResizer]")},right:{element:e.querySelector("[ref=eRightResizer]")},bottomRight:{element:e.querySelector("[ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[ref=eBottomLeftResizer]")},left:{element:e.querySelector("[ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const i=new DOMParser().parseFromString(RESIZE_TEMPLATE,"text/html").body;e.appendChild(i.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${RESIZE_CONTAINER_STYLE}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:n}=this.config;!i&&!n&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const t=this.element.parentElement;return t?Array.prototype.slice.call(t.children).filter(i=>!i.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let n=0;n<e.length;n++){const o=e[n],r=!!o.style.flex&&o.style.flex!=="0 0 auto";if(o===this.element)continue;let a=this.minHeight||0,l=this.minWidth||0;if(r){const d=window.getComputedStyle(o);d.minHeight&&(a=parseInt(d.minHeight,10)),d.minWidth&&(l=parseInt(d.minWidth,10))}else a=o.offsetHeight,l=o.offsetWidth;t+=a,i+=l}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let n=0;n<i.length;n++){const o=i[n];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=i[n+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:n,isRight:o,isBottom:r,isLeft:a}=this.currentResizer,l=o||a,d=r||n,{movementX:h,movementY:p}=this.calculateMouseMovement({e,isLeft:a,isTop:n}),m=this.position.x,v=this.position.y;let y=0,b=0;if(l&&h){const S=a?-1:1,E=this.getWidth(),T=E+h*S;let R=!1;a&&(y=E-T,(m+y<=0||T<=this.minWidth)&&(R=!0,y=0)),R||this.setWidth(T)}if(d&&p){const S=n?-1:1,E=this.getHeight(),T=E+p*S;let R=!1;n?(b=E-T,(v+b<=0||T<=this.minHeight)&&(R=!0,b=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&E<T&&this.getMinSizeOfSiblings().height+T>this.element.parentElement.offsetHeight&&(R=!0),R||this.setHeight(T)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&y||b)&&this.offsetElement(m+y,v+b)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null;const i={type:"resize"};this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchEvent(i)}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let n;this.config.calculateTopBuffer&&(n=this.config.calculateTopBuffer());const{movementX:o,movementY:r}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:n});this.offsetElement(t+o,i+r),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}}__decorate$2q([Autowired("popupService")],PositionableFeature.prototype,"popupService",void 0);__decorate$2q([Autowired("resizeObserverService")],PositionableFeature.prototype,"resizeObserverService",void 0);__decorate$2q([Autowired("dragService")],PositionableFeature.prototype,"dragService",void 0);var __decorate$2p=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class ProvidedFilter extends Component{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.buttonListeners=[]}postConstruct(){this.resetTemplate(),this.createManagedBean(new ManagedFocusFeature(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new PositionableFeature(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const i=`
|
||
<form class="ag-filter-wrapper">
|
||
<div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" ref="eFilterBody">
|
||
${this.createBodyTemplate()}
|
||
</div>
|
||
</form>`;this.setTemplate(i,e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}setParams(e){this.providedFilterParams=e,this.applyActive=ProvidedFilter.isUseApplyButton(e),this.resetButtonsPanel()}updateParams(e){this.providedFilterParams=e,this.applyActive=ProvidedFilter.isUseApplyButton(e),this.resetUiToActiveModel(this.getModel(),()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}resetButtonsPanel(){const{buttons:e}=this.providedFilterParams,t=e&&e.length>0&&!this.isReadOnly();if(this.eButtonsPanel?(clearElement(this.eButtonsPanel),this.buttonListeners.forEach(o=>o==null?void 0:o()),this.buttonListeners=[]):t&&(this.eButtonsPanel=document.createElement("div"),this.eButtonsPanel.classList.add("ag-filter-apply-panel")),!t){this.eButtonsPanel&&removeFromParent(this.eButtonsPanel);return}const i=document.createDocumentFragment(),n=o=>{let r,a;switch(o){case"apply":r=this.translate("applyFilter"),a=h=>this.onBtApply(!1,!1,h);break;case"clear":r=this.translate("clearFilter"),a=()=>this.onBtClear();break;case"reset":r=this.translate("resetFilter"),a=()=>this.onBtReset();break;case"cancel":r=this.translate("cancelFilter"),a=h=>{this.onBtCancel(h)};break;default:console.warn("AG Grid: Unknown button type specified");return}const d=loadTemplate(`<button
|
||
type="${o==="apply"?"submit":"button"}"
|
||
ref="${o}FilterButton"
|
||
class="ag-button ag-standard-button ag-filter-apply-panel-button"
|
||
>${r}
|
||
</button>`);this.buttonListeners.push(this.addManagedListener(d,"click",a)),i.append(d)};convertToSet(e).forEach(o=>n(o)),this.eButtonsPanel.append(i),this.getGui().appendChild(this.eButtonsPanel)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const e=ProvidedFilter.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs()),t=debounce(this.checkApplyDebounce.bind(this),e);this.onBtApplyDebounce=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(e!=null?this.setModelIntoUi(e):this.resetUiToDefaults()).then(()=>{this.updateUiVisibility(),this.applyModel("api")})}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),()=>{this.handleCancelEnd(e)})}handleCancelEnd(e){this.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const i=()=>{this.onUiChanged(!1,"prevent"),t==null||t()};e!=null?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}onBtClear(){this.resetUiToDefaults().then(()=>this.onUiChanged())}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const t=this.getModelFromUi();if(!this.isModelValid(t))return!1;const i=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(i,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,i){if(i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")){const o="columnFilter";this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:o})}const{closeOnApply:n}=this.providedFilterParams;n&&this.applyActive&&!e&&!t&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,i=t&&t.key;let n;(i==="Enter"||i==="Space")&&(n={keyboardEvent:t}),this.hidePopup(n),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const i=this.isModelValid(this.getModelFromUi()),n=this.getRefElement("applyFilterButton");n&&setDisabled(n,!i)}e&&!t||t==="immediately"?this.onBtApply(e):(!this.applyActive&&!t||t==="debounce")&&this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(e==null?void 0:e.container)}refreshFilterResizer(e){if(!this.positionableFeature||e==="toolPanel")return;const t=e==="floatingFilter"||e==="columnFilter",{positionableFeature:i,gridOptionsService:n}=this;t?(i.restoreLastSize(),i.setResizable(n.get("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}static getDebounceMs(e,t){return ProvidedFilter.isUseApplyButton(e)?(e.debounceMs!=null&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):e.debounceMs!=null?e.debounceMs:t}static isUseApplyButton(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}refresh(e){return this.providedFilterParams=e,!0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),this.appliedModel=null,super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,FILTER_LOCALE_TEXT[e])}getCellValue(e){return this.providedFilterParams.getValue(e)}getPositionableElement(){return this.eFilterBody}}__decorate$2p([Autowired("rowModel")],ProvidedFilter.prototype,"rowModel",void 0);__decorate$2p([RefSelector("eFilterBody")],ProvidedFilter.prototype,"eFilterBody",void 0);__decorate$2p([PostConstruct],ProvidedFilter.prototype,"postConstruct",null);var __decorate$2o=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AgAbstractLabel extends Component{constructor(e,t){super(t),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:n}=this.config;e!=null&&this.setLabelSeparator(e),t!=null&&this.setLabel(t),i!=null&&this.setLabelWidth(i),this.setLabelAlignment(n||this.labelAlignment),this.refreshLabel()}refreshLabel(){clearElement(this.eLabel),typeof this.label=="string"?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),this.label===""?(setDisplayed(this.eLabel,!1),setAriaRole(this.eLabel,"presentation")):(setDisplayed(this.eLabel,!0),setAriaRole(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e?this:(this.labelSeparator=e,this.label!=null&&this.refreshLabel(),this)}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e?this:(this.label=e,this.refreshLabel(),this)}setLabelAlignment(e){const i=this.getGui().classList;return i.toggle("ag-label-align-left",e==="left"),i.toggle("ag-label-align-right",e==="right"),i.toggle("ag-label-align-top",e==="top"),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return this.label==null?this:(setElementWidth(this.eLabel,e),this)}setDisabled(e){e=!!e;const t=this.getGui();return setDisabled(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}}__decorate$2o([PostConstruct],AgAbstractLabel.prototype,"postConstruct",null);class AgAbstractField extends AgAbstractLabel{constructor(e,t,i){super(e,t),this.className=i}postConstruct(){super.postConstruct(),this.className&&this.addCssClass(this.className),this.refreshAriaLabelledBy()}refreshAriaLabelledBy(){const e=this.getAriaElement(),t=this.getLabelId();getAriaLabel(e)!==null?setAriaLabelledBy(e,""):setAriaLabelledBy(e,t??"")}setAriaLabel(e){return setAriaLabel(this.getAriaElement(),e),this.refreshAriaLabelledBy(),this}onValueChange(e){return this.addManagedListener(this,Events.EVENT_FIELD_VALUE_CHANGED,()=>e(this.getValue())),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return setFixedWidth(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e?this:(this.previousValue=this.value,this.value=e,t||this.dispatchEvent({type:Events.EVENT_FIELD_VALUE_CHANGED}),this)}}var __decorate$2n=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const TEMPLATE$1=`
|
||
<div class="ag-picker-field" role="presentation">
|
||
<div ref="eLabel"></div>
|
||
<div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">
|
||
<div ref="eDisplayField" class="ag-picker-field-display"></div>
|
||
<div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>
|
||
</div>
|
||
</div>`;class AgPickerField extends AgAbstractField{constructor(e){if(super(e,(e==null?void 0:e.template)||TEMPLATE$1,e==null?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.ariaRole=e==null?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:n,minPickerWidth:o,maxPickerWidth:r}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!n,i!=null&&this.setPickerMaxHeight(i),o!=null&&this.setPickerMinWidth(o),r!=null&&this.setPickerMaxWidth(r)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedListener(t,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(this.eLabel,"mousedown",this.onLabelOrWrapperMouseDown.bind(this)),this.addManagedListener(this.eWrapper,"mousedown",this.onLabelOrWrapperMouseDown.bind(this));const{pickerIcon:i}=this.config;if(i){const n=createIconNoSpan(i,this.gridOptionsService);n&&this.eIcon.appendChild(n)}}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gridOptionsService.get("tabIndex").toString()),setAriaExpanded(e,!1),this.ariaRole&&setAriaRole(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&(e==null?void 0:e.target)===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case KeyCode.UP:case KeyCode.DOWN:case KeyCode.ENTER:case KeyCode.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case KeyCode.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gridOptionsService.getDocument(),t=this.pickerComponent.getGui();this.gridOptionsService.get("suppressScrollWhenPopupsAreOpen")||(this.destroyMouseWheelFunc=this.addManagedListener(this.eventService,Events.EVENT_BODY_SCROLL,()=>{this.hidePicker()}));const i=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:n,pickerAriaLabelValue:o,modalPicker:r=!0}=this.config,a={modal:r,eChild:t,closeOnEsc:!0,closedCallback:()=>{const y=e.activeElement===e.body;this.beforeHidePicker(),y&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:i(n,o)},l=this.popupService.addPopup(a),{maxPickerHeight:d,minPickerWidth:h,maxPickerWidth:p,variableWidth:m}=this;m?(h&&(t.style.minWidth=h),t.style.width=formatSize(getAbsoluteWidth(this.eWrapper)),p&&(t.style.maxWidth=p)):setElementWidth(t,p??getAbsoluteWidth(this.eWrapper));const v=d??`${getInnerHeight(this.popupService.getPopupParent())}px`;return t.style.setProperty("max-height",v),t.style.position="absolute",this.alignPickerToComponent(),l.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gridOptionsService.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();setAriaExpanded(t,e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;!((t=this.pickerComponent)===null||t===void 0)&&t.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return setElementWidth(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}}__decorate$2n([Autowired("popupService")],AgPickerField.prototype,"popupService",void 0);__decorate$2n([RefSelector("eLabel")],AgPickerField.prototype,"eLabel",void 0);__decorate$2n([RefSelector("eWrapper")],AgPickerField.prototype,"eWrapper",void 0);__decorate$2n([RefSelector("eDisplayField")],AgPickerField.prototype,"eDisplayField",void 0);__decorate$2n([RefSelector("eIcon")],AgPickerField.prototype,"eIcon",void 0);var __decorate$2m=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AgList extends Component{constructor(e="default"){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.options=[],this.itemEls=[]}init(){this.addManagedListener(this.getGui(),"keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){const t=e.key;switch(t){case KeyCode.ENTER:if(!this.highlightedEl)this.setValue(this.getValue());else{const o=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(o)}break;case KeyCode.DOWN:case KeyCode.UP:const i=t===KeyCode.DOWN;let n;if(e.preventDefault(),!this.highlightedEl)n=this.itemEls[i?0:this.itemEls.length-1];else{let r=this.itemEls.indexOf(this.highlightedEl)+(i?1:-1);r=Math.min(Math.max(r,0),this.itemEls.length-1),n=this.itemEls[r]}this.highlightItem(n);break}}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){const{value:t,text:i}=e,n=escapeString(i||t);return this.options.push({value:t,text:n}),this.renderOption(t,n),this.updateIndices(),this}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((t,i)=>{setAriaPosInSet(t,i+1),setAriaSetSize(t,e.length)})}renderOption(e,t){const i=document.createElement("div");setAriaRole(i,"option"),i.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`),i.innerHTML=`<span>${t}</span>`,i.tabIndex=-1,this.itemEls.push(i),this.addManagedListener(i,"mouseover",()=>this.highlightItem(i)),this.addManagedListener(i,"mouseleave",()=>this.clearHighlighted()),this.addManagedListener(i,"click",()=>this.setValue(e)),this.getGui().appendChild(i)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(e==null)return this.reset(),this;const i=this.options.findIndex(n=>n.value===e);if(i!==-1){const n=this.options[i];this.value=n.value,this.displayValue=n.text!=null?n.text:n.value,this.highlightItem(this.itemEls[i]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(t=>t.value===this.value);e!==-1&&this.highlightItem(this.itemEls[e])}reset(){this.value=null,this.displayValue=null,this.clearHighlighted(),this.fireChangeEvent()}highlightItem(e){isVisible(e)&&(this.clearHighlighted(),this.highlightedEl=e,this.highlightedEl.classList.add(AgList.ACTIVE_CLASS),setAriaSelected(this.highlightedEl,!0),this.highlightedEl.focus())}clearHighlighted(){!this.highlightedEl||!isVisible(this.highlightedEl)||(this.highlightedEl.classList.remove(AgList.ACTIVE_CLASS),setAriaSelected(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchEvent({type:Events.EVENT_FIELD_VALUE_CHANGED}),this.fireItemSelected()}fireItemSelected(){this.dispatchEvent({type:AgList.EVENT_ITEM_SELECTED})}}AgList.EVENT_ITEM_SELECTED="selectedItem";AgList.ACTIVE_CLASS="ag-active-item";__decorate$2m([PostConstruct],AgList.prototype,"init",null);class AgSelect extends AgPickerField{constructor(e){super(Object.assign({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox"},e))}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gridOptionsService.get("tabIndex")}createListComponent(){this.listComponent=this.createBean(new AgList("select")),this.listComponent.setParentComponent(this);const e=this.listComponent.getAriaElement(),t=`ag-select-list-${this.listComponent.getCompId()}`;e.setAttribute("id",t),setAriaControls(this.getAriaElement(),e),this.listComponent.addGuiEventListener("keydown",i=>{i.key===KeyCode.TAB&&(i.preventDefault(),i.stopImmediatePropagation(),this.getGui().dispatchEvent(new KeyboardEvent("keydown",{key:i.key,shiftKey:i.shiftKey,ctrlKey:i.ctrlKey,bubbles:!0})))}),this.listComponent.addManagedListener(this.listComponent,AgList.EVENT_ITEM_SELECTED,()=>{this.hidePicker(),this.dispatchEvent({type:AgSelect.EVENT_ITEM_SELECTED})}),this.listComponent.addManagedListener(this.listComponent,Events.EVENT_FIELD_VALUE_CHANGED,()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())})}createPickerComponent(){return this.listComponent}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){return this.listComponent.addOption(e),this}setValue(e,t,i){return this.value===e||!this.listComponent?this:(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue()?this:(this.eDisplayField.innerHTML=this.listComponent.getDisplayValue(),super.setValue(e,t)))}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),super.destroy()}}AgSelect.EVENT_ITEM_SELECTED="selectedItem";var __decorate$2l=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AgAbstractInputField extends AgAbstractField{constructor(e,t,i="text",n="input"){super(e,`
|
||
<div role="presentation">
|
||
<div ref="eLabel" class="ag-input-field-label"></div>
|
||
<div ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">
|
||
<${n} ref="eInput" class="ag-input-field-input"></${n}>
|
||
</div>
|
||
</div>`,t),this.inputType=i,this.displayFieldTag=n}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(`${this.className}-label`),this.eWrapper.classList.add(`${this.className}-input-wrapper`),this.eInput.classList.add(`${this.className}-input`),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{width:e,value:t}=this.config;e!=null&&this.setWidth(e),t!=null&&this.setValue(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>this.setValue(e.target.value))}setInputType(){this.displayFieldTag==="input"&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return setElementWidth(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){const t=this.eInput;return t.maxLength=e,this}setInputPlaceholder(e){return addOrRemoveAttribute(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return setAriaLabel(this.eInput,e),this.refreshAriaLabelledBy(),this}setDisabled(e){return setDisabled(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(e===!0)addOrRemoveAttribute(this.eInput,"autocomplete",null);else{const t=typeof e=="string"?e:"off";addOrRemoveAttribute(this.eInput,"autocomplete",t)}return this}}__decorate$2l([RefSelector("eLabel")],AgAbstractInputField.prototype,"eLabel",void 0);__decorate$2l([RefSelector("eWrapper")],AgAbstractInputField.prototype,"eWrapper",void 0);__decorate$2l([RefSelector("eInput")],AgAbstractInputField.prototype,"eInput",void 0);class AgCheckbox extends AgAbstractInputField{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}addInputListeners(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))}getNextValue(){return this.selected===void 0?!0:!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){const t=this.getInputElement();return t.name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected=typeof e=="boolean"?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=e===void 0,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchEvent({type:Events.EVENT_FIELD_VALUE_CHANGED,selected:e,previousValue:t,event:i});const n=this.getInputElement(),o={type:Events.EVENT_CHECKBOX_CHANGED,id:n.id,name:n.name,selected:e,previousValue:t};this.eventService.dispatchEvent(o)}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",e===!0),this.eWrapper.classList.toggle("ag-indeterminate",e==null)}}class AgRadioButton extends AgCheckbox{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedListener(this.eventService,Events.EVENT_CHECKBOX_CHANGED,this.onChange.bind(this))}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}}class SimpleFilterModelFormatter{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=e.operator!=null,i=this.localeService.getLocaleTextFunc();if(t){const n=e;let{conditions:o}=n;if(!o){const{condition1:l,condition2:d}=n;o=[l,d]}const r=o.map(l=>this.getModelAsString(l)),a=n.operator==="AND"?"andCondition":"orCondition";return r.join(` ${i(a,FILTER_LOCALE_TEXT[a])} `)}else{if(e.type===SimpleFilter.BLANK||e.type===SimpleFilter.NOT_BLANK)return i(e.type,e.type);{const n=e,o=this.optionsFactory.getCustomOption(n.type),{displayKey:r,displayName:a,numberOfInputs:l}=o||{};return r&&a&&l===0?(i(r,a),a):this.conditionToString(n,o)}}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){var t;return this.valueFormatter?(t=this.valueFormatter(e??null))!==null&&t!==void 0?t:"":String(e)}}class SimpleFilter extends ProvidedFilter{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(e){const t=this.optionsFactory.getCustomOption(e);if(t){const{numberOfInputs:n}=t;return n??1}const i=[SimpleFilter.EMPTY,SimpleFilter.NOT_BLANK,SimpleFilter.BLANK];return e&&i.indexOf(e)>=0?0:e===SimpleFilter.IN_RANGE?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,i)=>{i===0?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),condition1:e[0],condition2:e[1],conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return this.eJoinOperatorsOr.length===0?this.defaultJoinOperator:this.eJoinOperatorsOr[0].getValue()===!0?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,n=!t.operator;if(!i&&n||i&&!n)return!1;let r;if(i){const a=e,l=t;r=this.areSimpleModelsEqual(a,l)}else{const a=e,l=t;r=a.operator===l.operator&&areEqual(a.conditions,l.conditions,(d,h)=>this.areSimpleModelsEqual(d,h))}return r}shouldRefresh(e){var t,i,n;const o=this.getModel(),r=o?(t=o.conditions)!==null&&t!==void 0?t:[o]:null,a=(n=(i=e.filterOptions)===null||i===void 0?void 0:i.map(d=>typeof d=="string"?d:d.displayKey))!==null&&n!==void 0?n:this.getDefaultFilterOptions();return!(!(!r||r.every(d=>a.find(h=>h===d.type)!==void 0))||typeof e.maxNumConditions=="number"&&r&&r.length>e.maxNumConditions)}refresh(e){return!this.shouldRefresh(e)||!super.refresh(e)?!1:(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0)}setModelIntoUi(e){if(e.operator){let i=e;i.conditions||(i.conditions=[i.condition1,i.condition2]);const n=this.validateAndUpdateConditions(i.conditions),o=this.getNumConditions();if(n<o)this.removeConditionsAndOperators(n);else if(n>o)for(let a=o;a<n;a++)this.createJoinOperatorPanel(),this.createOption();const r=i.operator==="OR";this.eJoinOperatorsAnd.forEach(a=>a.setValue(!r,!0)),this.eJoinOperatorsOr.forEach(a=>a.setValue(r,!0)),i.conditions.forEach((a,l)=>{this.eTypes[l].setValue(a.type,!0),this.setConditionIntoUi(a,l)})}else{const i=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(i.type,!0),this.setConditionIntoUi(i,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),AgPromise.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),warnOnce('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){var t;const i=this.getModel();if(i==null)return!0;const{operator:n}=i,o=[];if(n){const a=i;o.push(...(t=a.conditions)!==null&&t!==void 0?t:[])}else o.push(i);return o[n&&n==="OR"?"some":"every"](a=>this.individualConditionPasses(e,a))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new OptionsFactory,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){var t,i;e.suppressAndOrCondition!=null&&warnOnce('Since v29.2 "filterParams.suppressAndOrCondition" is deprecated. Use "filterParams.maxNumConditions = 1" instead.'),e.alwaysShowBothConditions!=null&&warnOnce('Since v29.2 "filterParams.alwaysShowBothConditions" is deprecated. Use "filterParams.numAlwaysVisibleConditions = 2" instead.'),this.maxNumConditions=(t=e.maxNumConditions)!==null&&t!==void 0?t:e.suppressAndOrCondition?1:2,this.maxNumConditions<1&&(warnOnce('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=(i=e.numAlwaysVisibleConditions)!==null&&i!==void 0?i:e.alwaysShowBothConditions?2:1,this.numAlwaysVisibleConditions<1&&(warnOnce('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(warnOnce('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new AgSelect);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,n=>this.resetInput(n)),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const n=this.eJoinOperatorPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,n,o),this.resetJoinOperatorOr(i,n,o),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const n=this.createManagedBean(new AgRadioButton);return e.push(n),n.addCssClass("ag-filter-condition-operator"),n.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(n.getGui()),n}getDefaultJoinOperator(e){return e==="AND"||e==="OR"?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(t=>typeof t=="string"?this.createBoilerplateListOption(t):this.createCustomListOption(t))}putOptionsIntoDropdown(e){this.filterListOptions.forEach(t=>{e.addOption(t)}),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(t)}}isAllowTwoConditions(){return this.maxNumConditions>=2}createBodyTemplate(){return""}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){var e;let t=-1,i=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?t=n:i=!1;if(this.shouldAddNewConditionAtEnd(i))this.createJoinOperatorPanel(),this.createOption();else{const n=(e=this.lastUiCompletePosition)!==null&&e!==void 0?e:this.getNumConditions()-2;if(t<n){this.removeConditionsAndOperators(n+1);const o=t+1,r=n-o;r>0&&this.removeConditionsAndOperators(o,r),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=t}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((n,o)=>{const r=this.isConditionDisabled(o,e);n.setDisabled(r||this.filterListOptions.length<=1),o===1&&(setDisabled(this.eJoinOperatorPanels[0],r),this.eJoinOperatorsAnd[0].setDisabled(r),this.eJoinOperatorsOr[0].setDisabled(r))}),this.eConditionBodies.forEach((n,o)=>{setDisplayed(n,this.isConditionBodyVisible(o))});const i=(t??this.getJoinOperator())==="OR";this.eJoinOperatorsAnd.forEach((n,o)=>{n.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach((n,o)=>{n.setValue(i,!0)}),this.forEachInput((n,o,r,a)=>{this.setElementDisplayed(n,o<a),this.setElementDisabled(n,this.isConditionDisabled(r,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach(o=>removeFromParent(o))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach(o=>{removeFromParent(o.getGui()),this.destroyBean(o)})}removeItems(e,t,i){return i==null?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus))if(this.isReadOnly())this.eFilterBody.focus();else{const t=this.getInputs(0)[0];if(!t)return;t instanceof AgAbstractInputField&&t.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,n=!1;const o=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,i=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),d=a<t;(l||d)&&(this.removeConditionsAndOperators(a,1),n=!0,d&&i--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(i,o),n&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(isFunction(this.filterPlaceholder)){const n=this.filterPlaceholder,o=this.eTypes[t].getValue(),r=this.translate(o);i=n({filterOptionKey:o,filterOption:r,placeholder:i})}else typeof this.filterPlaceholder=="string"&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((t,i,n,o)=>{if(!(t instanceof AgAbstractInputField))return;const r=i===0&&o>1?"inRangeStart":i===0?"filterOoo":"inRangeEnd",a=i===0&&o>1?e("ariaFilterFromValue","Filter from value"):i===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,n)),t.setInputAriaLabel(a)})}setElementValue(e,t,i){e instanceof AgAbstractInputField&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){e instanceof Component&&setDisplayed(e.getGui(),t)}setElementDisabled(e,t){e instanceof Component&&setDisabled(e.getGui(),t)}attachElementOnChange(e,t){e instanceof AgAbstractInputField&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,i)=>{this.forEachPositionTypeInput(i,t,e)})}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const n=this.getNumberOfInputs(t),o=this.getInputs(e);for(let r=0;r<o.length;r++){const a=o[r];a!=null&&i(a,r,e,n)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)===SimpleFilter.EMPTY||this.getValues(e).some(i=>i==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinOperatorsAnd.forEach((t,i)=>this.resetJoinOperatorAnd(t,i,this.joinOperatorId+i)),this.eJoinOperatorsOr.forEach((t,i)=>this.resetJoinOperatorOr(t,i,this.joinOperatorId+i)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),AgPromise.resolve()}resetType(e){const i=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(i).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,n,o){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(n),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t)),this.eJoinOperatorsOr.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const i=this.mapValuesFromModel(e);this.forEachInput((n,o,r,a)=>{r===t&&this.setElementValue(n,i[o]!=null?i[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,i,n,o)=>{this.setElementValue(t,i===0&&n===0?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,i=>{this.attachElementOnChange(i,this.listener)}))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),n=this.mapValuesFromModel(t),o=this.optionsFactory.getCustomOption(t.type),r=this.evaluateCustomFilter(o,n,i);return r??(i==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(n,i,t,e))}evaluateCustomFilter(e,t,i){if(e==null)return;const{predicate:n}=e;if(n!=null&&!t.some(o=>o==null))return n(t,i)}isBlank(e){return e==null||typeof e=="string"&&e.trim().length===0}hasInvalidInputs(){return!1}}SimpleFilter.EMPTY="empty";SimpleFilter.BLANK="blank";SimpleFilter.NOT_BLANK="notBlank";SimpleFilter.EQUALS="equals";SimpleFilter.NOT_EQUAL="notEqual";SimpleFilter.LESS_THAN="lessThan";SimpleFilter.LESS_THAN_OR_EQUAL="lessThanOrEqual";SimpleFilter.GREATER_THAN="greaterThan";SimpleFilter.GREATER_THAN_OR_EQUAL="greaterThanOrEqual";SimpleFilter.IN_RANGE="inRange";SimpleFilter.CONTAINS="contains";SimpleFilter.NOT_CONTAINS="notContains";SimpleFilter.STARTS_WITH="startsWith";SimpleFilter.ENDS_WITH="endsWith";class ScalarFilter extends SimpleFilter{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case ScalarFilter.EQUALS:case ScalarFilter.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case ScalarFilter.GREATER_THAN:case ScalarFilter.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case ScalarFilter.LESS_THAN:case ScalarFilter.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case ScalarFilter.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case ScalarFilter.BLANK:return!0;case ScalarFilter.NOT_BLANK:return!1}return!1}evaluateNonNullValue(e,t,i){const n=this.comparator(),o=e[0]!=null?n(e[0],t):0;switch(i.type){case ScalarFilter.EQUALS:return o===0;case ScalarFilter.NOT_EQUAL:return o!==0;case ScalarFilter.GREATER_THAN:return o>0;case ScalarFilter.GREATER_THAN_OR_EQUAL:return o>=0;case ScalarFilter.LESS_THAN:return o<0;case ScalarFilter.LESS_THAN_OR_EQUAL:return o<=0;case ScalarFilter.IN_RANGE:{const r=n(e[1],t);return this.scalarFilterParams.inRangeInclusive?o>=0&&r<=0:o>0&&r<0}case ScalarFilter.BLANK:return this.isBlank(t);case ScalarFilter.NOT_BLANK:return!this.isBlank(t);default:return console.warn('AG Grid: Unexpected type of filter "'+i.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}}var __decorate$2k=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const DEFAULT_MIN_YEAR=1e3,DEFAULT_MAX_YEAR=1/0;class DateFilterModelFormatter extends SimpleFilterModelFormatter{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:n}=t||{},o=i==SimpleFilter.IN_RANGE||n===2,r=parseDateTimeFromString(e.dateFrom),a=parseDateTimeFromString(e.dateTo),l=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(o){const d=r!==null?dateToFormattedString(r,l):"null",h=a!==null?dateToFormattedString(a,l):"null";return`${d}-${h}`}return r!=null?dateToFormattedString(r,l):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}}class DateFilter extends ScalarFilter{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=DEFAULT_MIN_YEAR,this.maxValidYear=DEFAULT_MAX_YEAR,this.minValidDate=null,this.maxValidDate=null}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:n}=e||{};return[t&&parseDateTimeFromString(t)||null,i&&parseDateTimeFromString(i)||null].slice(0,this.getNumberOfInputs(n))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){const i=t;return t==null||i<e?-1:i>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(i,n)=>{if(e[i]!=null)if(isNaN(e[i]))console.warn(`AG Grid: DateFilter ${i} is not a number`);else return e[i]==null?n:Number(e[i]);return n};this.minValidYear=t("minValidYear",DEFAULT_MIN_YEAR),this.maxValidYear=t("maxValidYear",DEFAULT_MAX_YEAR),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:parseDateTimeFromString(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:parseDateTimeFromString(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&console.warn("AG Grid: DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new DateFilterModelFormatter(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new DateCompWrapper(this.getContext(),this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc(()=>t.destroy()),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return DateFilter.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,i,n){const o=document.createElement("div");o.classList.add(`ag-filter-${n}`),o.classList.add(`ag-filter-date-${n}`),t.push(o),e.appendChild(o),i.push(this.createDateCompWrapper(o))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach(o=>o.destroy())}isValidDateValue(e){if(e===null)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((i,n,o,r)=>{o!==e||!t||n>=r||(t=t&&this.isValidDateValue(i.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),i={},n=this.getValues(e);return n.length>0&&(i.dateFrom=serialiseDate(n[0])),n.length>1&&(i.dateTo=serialiseDate(n[1])),Object.assign({dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t},i)}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput(n=>{n.setInputPlaceholder(t),n.setInputAriaLabel(i)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(i,n,o,r)=>{n<r&&t.push(i.getDate())}),t}translate(e){return e===ScalarFilter.LESS_THAN?super.translate("before"):e===ScalarFilter.GREATER_THAN?super.translate("after"):super.translate(e)}getModelAsString(e){var t;return(t=this.filterModelFormatter.getModelAsString(e))!==null&&t!==void 0?t:""}}DateFilter.DEFAULT_FILTER_OPTIONS=[ScalarFilter.EQUALS,ScalarFilter.NOT_EQUAL,ScalarFilter.LESS_THAN,ScalarFilter.GREATER_THAN,ScalarFilter.IN_RANGE,ScalarFilter.BLANK,ScalarFilter.NOT_BLANK];__decorate$2k([Autowired("userComponentFactory")],DateFilter.prototype,"userComponentFactory",void 0);class SimpleFloatingFilter extends Component{getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return e==null?void 0:e.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.getDefaultOption();return}const t=e.operator;let i;t?i=e.conditions[0]:i=e,this.lastType=i.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const i=e;return this.isTypeEditable(i.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new OptionsFactory,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return i==null||i==1}isTypeEditable(e){const t=[SimpleFilter.IN_RANGE,SimpleFilter.EMPTY,SimpleFilter.BLANK,SimpleFilter.NOT_BLANK];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}}var __decorate$2j=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class DateFloatingFilter extends SimpleFloatingFilter{constructor(){super(`
|
||
<div class="ag-floating-filter-input" role="presentation">
|
||
<ag-input-text-field ref="eReadOnlyText"></ag-input-text-field>
|
||
<div ref="eDateWrapper" style="display: flex;"></div>
|
||
</div>`)}getDefaultFilterOptions(){return DateFilter.DEFAULT_FILTER_OPTIONS}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new DateFilterModelFormatter(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams}),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){if(e){const i=e;this.dateComp.setDate(parseDateTimeFromString(i.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){setDisplayed(this.eDateWrapper,e),setDisplayed(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(super.setLastTypeFromModel(e),this.updateCompOnModelChange(e))}onDateChanged(){const e=this.dateComp.getDate(),t=serialiseDate(e);this.params.parentFilterInstance(i=>{if(i){const n=parseDateTimeFromString(t);i.onFloatingFilterChanged(this.getLastType()||null,n)}})}getDateComponentParams(){const e=ProvidedFilter.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:debounce(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new DateCompWrapper(this.getContext(),this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper),this.addDestroyFunc(()=>this.dateComp.destroy())}updateDateComponent(){const e=this.gridOptionsService.addGridCommonParams(this.getDateComponentParams());this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}}__decorate$2j([Autowired("userComponentFactory")],DateFloatingFilter.prototype,"userComponentFactory",void 0);__decorate$2j([RefSelector("eReadOnlyText")],DateFloatingFilter.prototype,"eReadOnlyText",void 0);__decorate$2j([RefSelector("eDateWrapper")],DateFloatingFilter.prototype,"eDateWrapper",void 0);var __decorate$2i=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class DefaultDateComponent extends Component{constructor(){super(`
|
||
<div class="ag-filter-filter">
|
||
<ag-input-text-field class="ag-date-filter" ref="eDateInput"></ag-input-text-field>
|
||
</div>`)}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.gridOptionsService.getDocument(),i=this.eDateInput.getInputElement();this.addManagedListener(i,"mousedown",()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||i.focus()}),this.addManagedListener(i,"input",n=>{n.target===t.activeElement&&(this.eDateInput.isDisabled()||this.params.onDateChanged())})}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&isBrowserSafari(),t.type=i?"date":"text";const{minValidYear:n,maxValidYear:o,minValidDate:r,maxValidDate:a}=e.filterParams||{};if(r&&n&&warnOnce("DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),a&&o&&warnOnce("DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),r&&a){const[l,d]=[r,a].map(h=>h instanceof Date?h:parseDateTimeFromString(h));l&&d&&l.getTime()>d.getTime()&&warnOnce("DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate.")}r?r instanceof Date?t.min=dateToFormattedString(r):t.min=r:n&&(t.min=`${n}-01-01`),a?a instanceof Date?t.max=dateToFormattedString(a):t.max=a:o&&(t.max=`${o}-12-31`)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.params=e,this.setParams(e)}getDate(){return parseDateTimeFromString(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(serialiseDate(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){(!e||!e.suppressFocus)&&this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&e.filterParams.browserDatePicker!=null?e.filterParams.browserDatePicker:isBrowserChrome()||isBrowserFirefox()||isBrowserSafari()&&getSafariVersion()>=14.1}}__decorate$2i([RefSelector("eDateInput")],DefaultDateComponent.prototype,"eDateInput",void 0);class AgInputTextField extends AgAbstractInputField{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=exists(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=i=>{isEventFromPrintableCharacter(i)&&i.key&&!e.test(i.key)&&i.preventDefault()};this.addManagedListener(this.eInput,"keydown",t),this.addManagedListener(this.eInput,"paste",i=>{var n;const o=(n=i.clipboardData)===null||n===void 0?void 0:n.getData("text");o&&o.split("").some(r=>!e.test(r))&&i.preventDefault()})}}class AgInputNumberField extends AgInputTextField{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"blur",()=>{const e=parseFloat(this.eInput.value),t=isNaN(e)?"":this.normalizeValue(e.toString());this.value!==t&&this.setValue(t)}),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this)),this.eInput.step="any"}onWheel(e){document.activeElement===this.eInput&&e.preventDefault()}normalizeValue(e){if(e==="")return"";this.precision!=null&&(e=this.adjustPrecision(e));const t=parseFloat(e);return this.min!=null&&t<this.min?e=this.min.toString():this.max!=null&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(this.precision==null)return e;if(t){const n=parseFloat(e).toFixed(this.precision);return parseFloat(n).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e?this:(this.min=e,addOrRemoveAttribute(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,addOrRemoveAttribute(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,addOrRemoveAttribute(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(i=>super.setValue(i,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,i){if(exists(i)){let n=this.isScientificNotation(i);if(n&&this.eInput.validity.valid)return e(i);if(!n){i=this.adjustPrecision(i);const o=this.normalizeValue(i);n=i!=o}if(n)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}}class NumberFilterModelFormatter extends SimpleFilterModelFormatter{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==SimpleFilter.IN_RANGE||i===2?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:e.filter!=null?this.formatValue(e.filter):`${e.type}`}}function getAllowedCharPattern(s){const{allowedCharPattern:e}=s??{};return e??null}class NumberFilter extends ScalarFilter{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern!==e.allowedCharPattern?!1:super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:n}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(n))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new NumberFilterModelFormatter(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return NumberFilter.DEFAULT_FILTER_OPTIONS}setElementValue(e,t,i){const n=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(t??null):t;super.setElementValue(e,n)}createValueElement(){const e=getAllowedCharPattern(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),setAriaRole(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,n){const o=this.createManagedBean(n?new AgInputTextField({allowedCharPattern:n}):new AgInputNumberField);o.addCssClass(`ag-filter-${i}`),o.addCssClass("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,(i,n,o,r)=>{n<r&&t.push(this.processValue(this.stringToFloat(i.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return e==null||isNaN(e)?null:e}stringToFloat(e){if(typeof e=="number")return e;let t=makeNull(e);return t!=null&&t.trim()===""&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):t==null||t.trim()==="-"?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},n=this.getValues(e);return n.length>0&&(i.filter=n[0]),n.length>1&&(i.filterTo=n[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){var t;return(t=this.filterModelFormatter.getModelAsString(e))!==null&&t!==void 0?t:""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{if(!t.getInputElement().validity.valid){e=!0;return}}),e}}NumberFilter.DEFAULT_FILTER_OPTIONS=[ScalarFilter.EQUALS,ScalarFilter.NOT_EQUAL,ScalarFilter.GREATER_THAN,ScalarFilter.GREATER_THAN_OR_EQUAL,ScalarFilter.LESS_THAN,ScalarFilter.LESS_THAN_OR_EQUAL,ScalarFilter.IN_RANGE,ScalarFilter.BLANK,ScalarFilter.NOT_BLANK];class TextFilterModelFormatter extends SimpleFilterModelFormatter{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==SimpleFilter.IN_RANGE||i===2?`${e.filter}-${e.filterTo}`:e.filter!=null?`${e.filter}`:`${e.type}`}}class TextFilter extends SimpleFilter{constructor(){super("textFilter"),this.eValuesFrom=[],this.eValuesTo=[]}static trimInput(e){const t=e&&e.trim();return t===""?e:t}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?TextFilter.DEFAULT_FORMATTER:TextFilter.DEFAULT_LOWERCASE_FORMATTER),this.filterModelFormatter=new TextFilterModelFormatter(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(_.warnOnce("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:t,value:i,filterText:n})=>e(t,i,n)):this.textFilterParams.textMatcher||TextFilter.DEFAULT_MATCHER}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},n=this.getValuesWithSideEffects(e,!0);return n.length>0&&(i.filter=n[0]),n.length>1&&(i.filterTo=n[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(e,t){const i=[];return this.forEachPositionInput(e,(n,o,r,a)=>{var l;if(o<a){let d=makeNull(n.getValue());t&&this.textFilterParams.trimInput&&(d=(l=TextFilter.trimInput(d))!==null&&l!==void 0?l:null,n.setValue(d,!0)),i.push(d)}}),i}getDefaultFilterOptions(){return TextFilter.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),setAriaRole(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const n=this.createManagedBean(new AgInputTextField);n.addCssClass(`ag-filter-${i}`),n.addCssClass("ag-filter-filter"),t.push(n),e.appendChild(n.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:n}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(n))}evaluateNullValue(e){const t=[SimpleFilter.NOT_EQUAL,SimpleFilter.NOT_CONTAINS,SimpleFilter.BLANK];return e?t.indexOf(e)>=0:!1}evaluateNonNullValue(e,t,i,n){const o=e.map(y=>this.formatter(y))||[],r=this.formatter(t),{api:a,colDef:l,column:d,columnApi:h,context:p,textFormatter:m}=this.textFilterParams;if(i.type===SimpleFilter.BLANK)return this.isBlank(t);if(i.type===SimpleFilter.NOT_BLANK)return!this.isBlank(t);const v={api:a,colDef:l,column:d,columnApi:h,context:p,node:n.node,data:n.data,filterOption:i.type,value:r,textFormatter:m};return o.some(y=>this.matcher(Object.assign(Object.assign({},v),{filterText:y})))}getModelAsString(e){var t;return(t=this.filterModelFormatter.getModelAsString(e))!==null&&t!==void 0?t:""}}TextFilter.DEFAULT_FILTER_OPTIONS=[SimpleFilter.CONTAINS,SimpleFilter.NOT_CONTAINS,SimpleFilter.EQUALS,SimpleFilter.NOT_EQUAL,SimpleFilter.STARTS_WITH,SimpleFilter.ENDS_WITH,SimpleFilter.BLANK,SimpleFilter.NOT_BLANK];TextFilter.DEFAULT_FORMATTER=s=>s;TextFilter.DEFAULT_LOWERCASE_FORMATTER=s=>s==null?null:s.toString().toLowerCase();TextFilter.DEFAULT_MATCHER=({filterOption:s,value:e,filterText:t})=>{if(t==null)return!1;switch(s){case TextFilter.CONTAINS:return e.indexOf(t)>=0;case TextFilter.NOT_CONTAINS:return e.indexOf(t)<0;case TextFilter.EQUALS:return e===t;case TextFilter.NOT_EQUAL:return e!=t;case TextFilter.STARTS_WITH:return e.indexOf(t)===0;case TextFilter.ENDS_WITH:const i=e.lastIndexOf(t);return i>=0&&i===e.length-t.length;default:return!1}};var __decorate$2h=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class FloatingFilterTextInputService extends BeanStub{constructor(e){super(),this.params=e,this.valueChangedListener=()=>{}}setupGui(e){var t;this.eFloatingFilterTextInput=this.createManagedBean(new AgInputTextField((t=this.params)===null||t===void 0?void 0:t.config));const i=this.eFloatingFilterTextInput.getGui();e.appendChild(i),this.addManagedListener(i,"input",n=>this.valueChangedListener(n)),this.addManagedListener(i,"keydown",n=>this.valueChangedListener(n))}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}}class TextInputFloatingFilter extends SimpleFloatingFilter{postConstruct(){this.setTemplate(`
|
||
<div class="ag-floating-filter-input" role="presentation" ref="eFloatingFilterInputContainer"></div>
|
||
`)}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){var t;this.params=e;const i=(t=e.browserAutoComplete)!==null&&t!==void 0?t:!1;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:i}),this.applyActive=ProvidedFilter.isUseApplyButton(this.params.filterParams),!this.isReadOnly()){const n=ProvidedFilter.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),o=debounce(this.syncUpWithParentFilter.bind(this),n);this.floatingFilterInputService.setValueChangedListener(o)}}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();clearElement(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}getAriaLabel(e){const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();return`${t} ${i("ariaFilterInput","Filter Input")}`}syncUpWithParentFilter(e){const t=e.key===KeyCode.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=TextFilter.trimInput(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance(n=>{n&&n.onFloatingFilterChanged(this.getLastType()||null,i||null)})}setEditable(e){this.floatingFilterInputService.setEditable(e)}}__decorate$2h([Autowired("columnModel")],TextInputFloatingFilter.prototype,"columnModel",void 0);__decorate$2h([RefSelector("eFloatingFilterInputContainer")],TextInputFloatingFilter.prototype,"eFloatingFilterInputContainer",void 0);__decorate$2h([PostConstruct],TextInputFloatingFilter.prototype,"postConstruct",null);class FloatingFilterNumberInputService extends BeanStub{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new AgInputNumberField),this.eFloatingFilterTextInput=this.createManagedBean(new AgInputTextField),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,n=>this.valueChangedListener(n)),this.setupListeners(i,n=>this.valueChangedListener(n))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListener(e,"input",t),this.addManagedListener(e,"keydown",t)}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}}class NumberFloatingFilter extends TextInputFloatingFilter{init(e){var t;super.init(e),this.filterModelFormatter=new NumberFilterModelFormatter(this.localeService,this.optionsFactory,(t=e.filterParams)===null||t===void 0?void 0:t.numberFormatter)}onParamsUpdated(e){this.refresh(e)}refresh(e){getAllowedCharPattern(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return NumberFilter.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=getAllowedCharPattern(e.filterParams),this.allowedCharPattern?this.createManagedBean(new FloatingFilterTextInputService({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new FloatingFilterNumberInputService)}}class TextFloatingFilter extends TextInputFloatingFilter{init(e){super.init(e),this.filterModelFormatter=new TextFilterModelFormatter(this.localeService,this.optionsFactory)}onParamsUpdated(e){this.refresh(e)}refresh(e){super.refresh(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return TextFilter.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new FloatingFilterTextInputService)}}class TouchListener{constructor(e,t=!1){this.destroyFuncs=[],this.touching=!1,this.eventService=new EventService,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),n=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",n,{passive:!0}),this.eElement.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",n,{passive:!0}),this.eElement.removeEventListener("touchend",o,{passive:!1})})}getActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}onTouchStart(e){if(this.touching)return;this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;const t=this.touchStart;window.setTimeout(()=>{const i=this.touchStart===t;if(this.touching&&i&&!this.moved){this.moved=!0;const n={type:TouchListener.EVENT_LONG_TAP,touchStart:this.touchStart,touchEvent:e};this.eventService.dispatchEvent(n)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!areEventsNear(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const t={type:TouchListener.EVENT_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=new Date().getTime();if(this.lastTapTime&&this.lastTapTime>0)if(e-this.lastTapTime>TouchListener.DOUBLE_TAP_MILLIS){const i={type:TouchListener.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(i),this.lastTapTime=null}else this.lastTapTime=e;else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach(e=>e())}}TouchListener.EVENT_TAP="tap";TouchListener.EVENT_DOUBLE_TAP="doubleTap";TouchListener.EVENT_LONG_TAP="longTap";TouchListener.DOUBLE_TAP_MILLIS=500;var __decorate$2g=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class SortIndicatorComp extends Component{constructor(e){super(),e||this.setTemplate(SortIndicatorComp.TEMPLATE)}attachCustomElements(e,t,i,n,o){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=n,this.eSortNone=o}setupSort(e,t=!1){this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator(),this.column.isSortable()&&(this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addManagedPropertyListener("unSortIcon",()=>this.updateIcons()),this.addManagedListener(this.eventService,Events.EVENT_NEW_COLUMNS_LOADED,()=>this.updateIcons()),this.addManagedListener(this.eventService,Events.EVENT_SORT_CHANGED,()=>this.onSortChanged()),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onSortChanged()),this.onSortChanged())}addInIcon(e,t,i){if(t==null)return;const n=createIconNoSpan(e,this.gridOptionsService,i);n&&t.appendChild(n)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t=e==="asc";setDisplayed(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t=e==="desc";setDisplayed(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gridOptionsService.get("unSortIcon"),i=e==null;setDisplayed(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gridOptionsService.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedListener(this.eventService,Events.EVENT_SORT_CHANGED,()=>this.updateMultiSortIndicator()),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateMultiSortIndicator()),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e=this.sortController.getDisplaySortForColumn(this.column)==="mixed";setDisplayed(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){var e;if(!this.eSortOrder)return;const t=this.sortController.getColumnsWithSortingOrdered(),i=(e=this.sortController.getDisplaySortIndexForColumn(this.column))!==null&&e!==void 0?e:-1,n=t.some(r=>{var a;return(a=this.sortController.getDisplaySortIndexForColumn(r))!==null&&a!==void 0?a:-1>=1}),o=i>=0&&n;setDisplayed(this.eSortOrder,o,{skipAriaHidden:!0}),i>=0?this.eSortOrder.textContent=(i+1).toString():clearElement(this.eSortOrder)}}SortIndicatorComp.TEMPLATE=`<span class="ag-sort-indicator-container">
|
||
<span ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>
|
||
<span ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>
|
||
<span ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>
|
||
<span ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>
|
||
<span ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>
|
||
</span>`;__decorate$2g([RefSelector("eSortOrder")],SortIndicatorComp.prototype,"eSortOrder",void 0);__decorate$2g([RefSelector("eSortAsc")],SortIndicatorComp.prototype,"eSortAsc",void 0);__decorate$2g([RefSelector("eSortDesc")],SortIndicatorComp.prototype,"eSortDesc",void 0);__decorate$2g([RefSelector("eSortMixed")],SortIndicatorComp.prototype,"eSortMixed",void 0);__decorate$2g([RefSelector("eSortNone")],SortIndicatorComp.prototype,"eSortNone",void 0);__decorate$2g([Autowired("columnModel")],SortIndicatorComp.prototype,"columnModel",void 0);__decorate$2g([Autowired("sortController")],SortIndicatorComp.prototype,"sortController",void 0);var __decorate$2f=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class HeaderComp extends Component{constructor(){super(...arguments),this.lastMovingChanged=0}destroy(){super.destroy()}refresh(e){return this.params=e,this.workOutTemplate()!=this.currentTemplate||this.workOutShowMenu()!=this.currentShowMenu||this.workOutSort()!=this.currentSort||this.shouldSuppressMenuHide()!=this.currentSuppressMenuHide?!1:(this.setDisplayName(e),!0)}workOutTemplate(){var e;let t=(e=this.params.template)!==null&&e!==void 0?e:HeaderComp.TEMPLATE;return t=t&&t.trim?t.trim():t,t}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate),this.setupTap(),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setupFilterButton(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=escapeString(this.currentDisplayName,!0);this.eText&&(this.eText.textContent=t)}}addInIcon(e,t,i){if(t==null)return;const n=createIconNoSpan(e,this.gridOptionsService,i);n&&t.appendChild(n)}setupTap(){const{gridOptionsService:e}=this;if(e.get("suppressTouch"))return;const t=new TouchListener(this.getGui(),!0),i=this.shouldSuppressMenuHide(),n=i&&exists(this.eMenu),o=n?new TouchListener(this.eMenu,!0):t;if(this.params.enableMenu){const r=n?"EVENT_TAP":"EVENT_LONG_TAP",a=l=>this.params.showColumnMenuAfterMouseClick(l.touchStart);this.addManagedListener(o,TouchListener[r],a)}if(this.params.enableSorting){const r=a=>{var l,d;const h=a.touchStart.target;i&&(!((l=this.eMenu)===null||l===void 0)&&l.contains(h)||!((d=this.eFilterButton)===null||d===void 0)&&d.contains(h))||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListener(t,TouchListener.EVENT_TAP,r)}if(this.params.enableFilterButton){const r=new TouchListener(this.eFilterButton,!0);this.addManagedListener(r,"tap",()=>this.params.showFilter(this.eFilterButton)),this.addDestroyFunc(()=>r.destroy())}this.addDestroyFunc(()=>t.destroy()),n&&this.addDestroyFunc(()=>o.destroy())}workOutShowMenu(){return this.params.enableMenu&&this.menuService.isHeaderMenuButtonEnabled()}shouldSuppressMenuHide(){return this.menuService.isHeaderMenuButtonAlwaysShowEnabled()}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu){removeFromParent(this.eMenu),this.eMenu=void 0;return}const e=this.menuService.isLegacyMenuEnabled();this.addInIcon(e?"menu":"menuAlt",this.eMenu,this.params.column),this.eMenu.classList.toggle("ag-header-menu-icon",!e),this.currentSuppressMenuHide=this.shouldSuppressMenuHide(),this.addManagedListener(this.eMenu,"click",()=>this.params.showColumnMenu(this.eMenu)),this.eMenu.classList.toggle("ag-header-menu-always-show",this.currentSuppressMenuHide)}onMenuKeyboardShortcut(e){var t,i,n,o;const{column:r}=this.params,a=this.menuService.isLegacyMenuEnabled();if(e&&!a){if(this.menuService.isFilterMenuInHeaderEnabled(r))return this.params.showFilter((i=(t=this.eFilterButton)!==null&&t!==void 0?t:this.eMenu)!==null&&i!==void 0?i:this.getGui()),!0}else if(this.params.enableMenu)return this.params.showColumnMenu((o=(n=this.eMenu)!==null&&n!==void 0?n:this.eFilterButton)!==null&&o!==void 0?o:this.getGui()),!0;return!1}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.context.createBean(new SortIndicatorComp(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;this.addManagedListener(this.params.column,Column.EVENT_MOVING_CHANGED,()=>{this.lastMovingChanged=new Date().getTime()}),this.eLabel&&this.addManagedListener(this.eLabel,"click",t=>{const i=this.params.column.isMoving(),o=new Date().getTime()-this.lastMovingChanged<50;if(!(i||o)){const l=this.gridOptionsService.get("multiSortKey")==="ctrl"?t.ctrlKey||t.metaKey:t.shiftKey;this.params.progressSort(l)}});const e=()=>{if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",this.params.column.isSortAscending()),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",this.params.column.isSortDescending()),this.addOrRemoveCssClass("ag-header-cell-sorted-none",this.params.column.isSortNone()),this.params.column.getColDef().showRowGroup){const t=this.columnModel.getSourceColumnsForGroupColumn(this.params.column),n=!(t==null?void 0:t.every(o=>this.params.column.getSort()==o.getSort()));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",n)}};this.addManagedListener(this.eventService,Events.EVENT_SORT_CHANGED,e),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_ROW_GROUP_CHANGED,e)}setupFilterIcon(){this.eFilter&&this.configureFilter(this.params.enableFilterIcon,this.eFilter,this.onFilterChangedIcon.bind(this))}setupFilterButton(){if(!this.eFilterButton)return;this.configureFilter(this.params.enableFilterButton,this.eFilterButton,this.onFilterChangedButton.bind(this))?this.addManagedListener(this.eFilterButton,"click",()=>this.params.showFilter(this.eFilterButton)):this.eFilterButton=void 0}configureFilter(e,t,i){if(!e)return removeFromParent(t),!1;const{column:n}=this.params;return this.addInIcon("filter",t,n),this.addManagedListener(n,Column.EVENT_FILTER_CHANGED,i),i(),!0}onFilterChangedIcon(){const e=this.params.column.isFilterActive();setDisplayed(this.eFilter,e,{skipAriaHidden:!0})}onFilterChangedButton(){const e=this.params.column.isFilterActive();this.eFilterButton.classList.toggle("ag-filter-active",e)}getAnchorElementForMenu(e){var t,i,n,o;return e?(i=(t=this.eFilterButton)!==null&&t!==void 0?t:this.eMenu)!==null&&i!==void 0?i:this.getGui():(o=(n=this.eMenu)!==null&&n!==void 0?n:this.eFilterButton)!==null&&o!==void 0?o:this.getGui()}}HeaderComp.TEMPLATE=`<div class="ag-cell-label-container" role="presentation">
|
||
<span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>
|
||
<span ref="eFilterButton" class="ag-header-icon ag-header-cell-filter-button" aria-hidden="true"></span>
|
||
<div ref="eLabel" class="ag-header-cell-label" role="presentation">
|
||
<span ref="eText" class="ag-header-cell-text"></span>
|
||
<span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>
|
||
<ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>
|
||
</div>
|
||
</div>`;__decorate$2f([Autowired("sortController")],HeaderComp.prototype,"sortController",void 0);__decorate$2f([Autowired("menuService")],HeaderComp.prototype,"menuService",void 0);__decorate$2f([Autowired("columnModel")],HeaderComp.prototype,"columnModel",void 0);__decorate$2f([RefSelector("eFilter")],HeaderComp.prototype,"eFilter",void 0);__decorate$2f([RefSelector("eFilterButton")],HeaderComp.prototype,"eFilterButton",void 0);__decorate$2f([RefSelector("eSortIndicator")],HeaderComp.prototype,"eSortIndicator",void 0);__decorate$2f([RefSelector("eMenu")],HeaderComp.prototype,"eMenu",void 0);__decorate$2f([RefSelector("eLabel")],HeaderComp.prototype,"eLabel",void 0);__decorate$2f([RefSelector("eText")],HeaderComp.prototype,"eText",void 0);__decorate$2f([RefSelector("eSortOrder")],HeaderComp.prototype,"eSortOrder",void 0);__decorate$2f([RefSelector("eSortAsc")],HeaderComp.prototype,"eSortAsc",void 0);__decorate$2f([RefSelector("eSortDesc")],HeaderComp.prototype,"eSortDesc",void 0);__decorate$2f([RefSelector("eSortMixed")],HeaderComp.prototype,"eSortMixed",void 0);__decorate$2f([RefSelector("eSortNone")],HeaderComp.prototype,"eSortNone",void 0);var __decorate$2e=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class HeaderGroupComp extends Component{constructor(){super(HeaderGroupComp.TEMPLATE)}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){this.params.template&&warnOnce("A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)")}setupExpandIcons(){this.addInIcon("columnGroupOpened","agOpened"),this.addInIcon("columnGroupClosed","agClosed");const e=n=>{if(isStopPropagationForAgGrid(n))return;const o=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),o,"uiColumnExpanded")};this.addTouchAndClickListeners(this.eCloseIcon,e),this.addTouchAndClickListeners(this.eOpenIcon,e);const t=n=>{stopPropagationForAgGrid(n)};this.addManagedListener(this.eCloseIcon,"dblclick",t),this.addManagedListener(this.eOpenIcon,"dblclick",t),this.addManagedListener(this.getGui(),"dblclick",e),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup();this.addManagedListener(i,ProvidedColumnGroup.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(i,ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))}addTouchAndClickListeners(e,t){const i=new TouchListener(e,!0);this.addManagedListener(i,TouchListener.EVENT_TAP,t),this.addDestroyFunc(()=>i.destroy()),this.addManagedListener(e,"click",t)}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const t=this.params.columnGroup.isExpanded();setDisplayed(this.eOpenIcon,t),setDisplayed(this.eCloseIcon,!t)}else setDisplayed(this.eOpenIcon,!1),setDisplayed(this.eCloseIcon,!1)}addInIcon(e,t){const i=createIconNoSpan(e,this.gridOptionsService,null);i&&this.getRefElement(t).appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable()){setDisplayed(this.eOpenIcon,!1),setDisplayed(this.eCloseIcon,!1);return}}setupLabel(){var e;const{displayName:t,columnGroup:i}=this.params;if(exists(t)){const n=escapeString(t,!0);this.getRefElement("agLabel").textContent=n}this.addOrRemoveCssClass("ag-sticky-label",!(!((e=i.getColGroupDef())===null||e===void 0)&&e.suppressStickyLabel))}}HeaderGroupComp.TEMPLATE=`<div class="ag-header-group-cell-label" ref="agContainer" role="presentation">
|
||
<span ref="agLabel" class="ag-header-group-text" role="presentation"></span>
|
||
<span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>
|
||
<span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>
|
||
</div>`;__decorate$2e([Autowired("columnModel")],HeaderGroupComp.prototype,"columnModel",void 0);__decorate$2e([RefSelector("agOpened")],HeaderGroupComp.prototype,"eOpenIcon",void 0);__decorate$2e([RefSelector("agClosed")],HeaderGroupComp.prototype,"eCloseIcon",void 0);class PopupComponent extends Component{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}}var __decorate$2d=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class LargeTextCellEditor extends PopupComponent{constructor(){super(LargeTextCellEditor.TEMPLATE)}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),exists(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===KeyCode.LEFT||t===KeyCode.UP||t===KeyCode.RIGHT||t===KeyCode.DOWN||e.shiftKey&&t===KeyCode.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return!exists(e)&&!exists(this.params.value)?this.params.value:this.params.parseValue(e)}}LargeTextCellEditor.TEMPLATE=`<div class="ag-large-text">
|
||
<ag-input-text-area ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>
|
||
</div>`;__decorate$2d([RefSelector("eTextArea")],LargeTextCellEditor.prototype,"eTextArea",void 0);var __decorate$2c=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class SelectCellEditor extends PopupComponent{constructor(){super(`<div class="ag-cell-edit-wrapper">
|
||
<ag-select class="ag-cell-editor" ref="eSelect"></ag-select>
|
||
</div>`),this.startedByEnter=!1}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueFormatterService:i,gridOptionsService:n}=this,{values:o,value:r,eventKey:a}=e;if(missing(o)){console.warn("AG Grid: no values found for select cellEditor");return}this.startedByEnter=a!=null?a===KeyCode.ENTER:!1;let l=!1;o.forEach(m=>{const v={value:m},y=i.formatValue(e.column,null,m),b=y!=null;v.text=b?y:m,t.addOption(v),l=l||r===m}),l?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:d,valueListMaxWidth:h,valueListMaxHeight:p}=e;d!=null&&t.setPickerGap(d),p!=null&&t.setPickerMaxHeight(p),h!=null&&t.setPickerMaxWidth(h),n.get("editType")!=="fullRow"&&this.addManagedListener(this.eSelect,AgSelect.EVENT_ITEM_SELECTED,()=>e.stopEditing())}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eSelect.showPicker()})}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}}__decorate$2c([Autowired("valueFormatterService")],SelectCellEditor.prototype,"valueFormatterService",void 0);__decorate$2c([RefSelector("eSelect")],SelectCellEditor.prototype,"eSelect",void 0);var __decorate$2b=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class SimpleCellEditor extends PopupComponent{constructor(e){super(`
|
||
<div class="ag-cell-edit-wrapper">
|
||
${e.getTemplate()}
|
||
</div>`),this.cellEditorInput=e}init(e){this.params=e;const t=this.eInput;this.cellEditorInput.init(t,e);let i;if(e.cellStartedEdit){this.focusAfterAttached=!0;const n=e.eventKey;n===KeyCode.BACKSPACE||e.eventKey===KeyCode.DELETE?i="":n&&n.length===1?i=n:(i=this.cellEditorInput.getStartValue(),n!==KeyCode.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,i=this.cellEditorInput.getStartValue();i!=null&&t.setStartValue(i),this.addManagedListener(t.getGui(),"keydown",n=>{const{key:o}=n;(o===KeyCode.PAGE_UP||o===KeyCode.PAGE_DOWN)&&n.preventDefault()})}afterGuiAttached(){var e,t;const i=this.localeService.getLocaleTextFunc(),n=this.eInput;if(n.setInputAriaLabel(i("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;isBrowserSafari()||n.getFocusableElement().focus();const o=n.getInputElement();this.highlightAllOnFocus?o.select():(t=(e=this.cellEditorInput).setCaret)===null||t===void 0||t.call(e)}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}}__decorate$2b([RefSelector("eInput")],SimpleCellEditor.prototype,"eInput",void 0);class TextCellEditorInput{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field>'}init(e,t){this.eInput=e,this.params=t,t.maxLength!=null&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return!exists(e)&&!exists(this.params.value)?this.params.value:this.params.parseValue(e)}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=exists(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}}class TextCellEditor extends SimpleCellEditor{constructor(){super(new TextCellEditorInput)}}var __decorate$2a=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const ARROW_UP="↑",ARROW_DOWN="↓";class AnimateShowChangeCellRenderer extends Component{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-change-delta");const i=document.createElement("span");i.setAttribute("class","ag-value-change-value"),e.appendChild(t),e.appendChild(i),this.setTemplateFromElement(e)}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e,!0)}showDelta(e,t){const i=Math.abs(t),n=e.formatValue(i),o=exists(n)?n:i,r=t>=0;r?this.eDelta.textContent=ARROW_UP+o:this.eDelta.textContent=ARROW_DOWN+o,this.eDelta.classList.toggle("ag-value-change-delta-up",r),this.eDelta.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),clearElement(this.eDelta)}refresh(e,t=!1){const i=e.value;if(i===this.lastValue||(exists(e.valueFormatted)?this.eValue.textContent=e.valueFormatted:exists(e.value)?this.eValue.textContent=i:clearElement(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering()))return!1;if(typeof i=="number"&&typeof this.lastValue=="number"){const n=i-this.lastValue;this.showDelta(e,n)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=i,!0}}__decorate$2a([Autowired("filterManager")],AnimateShowChangeCellRenderer.prototype,"filterManager",void 0);var __decorate$29=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AnimateSlideCellRenderer extends Component{constructor(){super(),this.refreshCount=0;const e=document.createElement("span"),t=document.createElement("span");t.setAttribute("class","ag-value-slide-current"),e.appendChild(t),this.setTemplateFromElement(e),this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}init(e){this.refresh(e,!0)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious);const t=document.createElement("span");t.setAttribute("class","ag-value-slide-previous ag-value-slide-out"),this.ePrevious=t,this.ePrevious.textContent=this.eCurrent.textContent,this.getGui().insertBefore(this.ePrevious,this.eCurrent),this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)})}refresh(e,t=!1){let i=e.value;return missing(i)&&(i=""),i===this.lastValue||this.filterManager.isSuppressFlashingCellsBecauseFiltering()?!1:(t||this.addSlideAnimation(),this.lastValue=i,exists(e.valueFormatted)?this.eCurrent.textContent=e.valueFormatted:exists(e.value)?this.eCurrent.textContent=i:clearElement(this.eCurrent),!0)}}__decorate$29([Autowired("filterManager")],AnimateSlideCellRenderer.prototype,"filterManager",void 0);class RowNode{constructor(e){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=RowNode.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=e}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const i=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const n=this.createDataChangedEvent(e,i,t);this.dispatchLocalEvent(n)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(e,t,i){return{type:RowNode.EVENT_DATA_CHANGED,node:this,oldData:t,newData:e,update:i}}createLocalRowEvent(e){return{type:e,node:this}}getRowIndexString(){return this.rowPinned==="top"?"t-"+this.rowIndex:this.rowPinned==="bottom"?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const e=new RowNode(this.beans);return e.id=this.id,e.data=this.data,e.__daemon=!0,e.selected=this.selected,e.level=this.level,e}setDataAndId(e,t){const i=exists(this.id)?this.createDaemonNode():null,n=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(t),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,i);const o=this.createDataChangedEvent(e,n,!1);this.dispatchLocalEvent(o)}checkRowSelectable(){const e=this.beans.gridOptionsService.get("isRowSelectable");this.setRowSelectable(e?e(this):!0)}setRowSelectable(e,t){if(this.selectable!==e){if(this.selectable=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_SELECTABLE_CHANGED)),t)return;if(this.beans.gridOptionsService.get("groupSelectsChildren")){const n=this.calculateSelectedFromChildren();this.setSelectedParams({newValue:n??!1,source:"selectableChanged"});return}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(e){const t=this.beans.gridOptionsService.getCallback("getRowId");if(t)if(this.data){const i=this.getGroupKeys(!0);this.id=t({data:this.data,parentKeys:i.length>0?i:void 0,level:this.level}),this.id!==null&&typeof this.id=="string"&&this.id.startsWith(RowNode.ID_PREFIX_ROW_GROUP)&&console.error(`AG Grid: Row IDs cannot start with ${RowNode.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`),this.id!==null&&typeof this.id!="string"&&(this.id=""+this.id)}else this.id=void 0;else this.id=e}getGroupKeys(e=!1){const t=[];let i=this;for(e&&(i=i.parent);i&&i.level>=0;)t.push(i.key),i=i.parent;return t.reverse(),t}isPixelInRange(e){return!exists(this.rowTop)||!exists(this.rowHeight)?!1:e>=this.rowTop&&e<this.rowTop+this.rowHeight}setFirstChild(e){this.firstChild!==e&&(this.firstChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_FIRST_CHILD_CHANGED)))}setLastChild(e){this.lastChild!==e&&(this.lastChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_LAST_CHILD_CHANGED)))}setChildIndex(e){this.childIndex!==e&&(this.childIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_CHILD_INDEX_CHANGED)))}setRowTop(e){this.oldRowTop=this.rowTop,this.rowTop!==e&&(this.rowTop=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_TOP_CHANGED)),this.setDisplayed(e!==null))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(e){this.displayed!==e&&(this.displayed=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_DISPLAYED_CHANGED)))}setDragging(e){this.dragging!==e&&(this.dragging=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_DRAGGING_CHANGED)))}setHighlighted(e){e!==this.highlighted&&(this.highlighted=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HIGHLIGHT_CHANGED)))}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(e){this.allChildrenCount!==e&&(this.allChildrenCount=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED)))}setMaster(e){this.master!==e&&(this.master&&!e&&(this.expanded=!1),this.master=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_MASTER_CHANGED)))}setGroup(e){this.group!==e&&(this.group&&!e&&(this.expanded=!1),this.group=e,this.updateHasChildren(),this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_GROUP_CHANGED)))}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HEIGHT_CHANGED))}setRowAutoHeight(e,t){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[t.getId()]=e,e!=null&&(this.checkAutoHeightsDebounced==null&&(this.checkAutoHeightsDebounced=debounce(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,t=!0,i=0;const n=this.__autoHeights;if(n==null||(this.beans.columnModel.getAllDisplayedAutoHeightCols().forEach(a=>{let l=n[a.getId()];if(l==null)if(this.beans.columnModel.isColSpanActive()){let d=[];switch(a.getPinned()){case"left":d=this.beans.columnModel.getDisplayedLeftColumnsForRow(this);break;case"right":d=this.beans.columnModel.getDisplayedRightColumnsForRow(this);break;case null:d=this.beans.columnModel.getViewportCenterColumnsForRow(this);break}if(d.includes(a)){e=!0;return}l=-1}else{e=!0;return}else t=!1;l>i&&(i=l)}),e)||((t||i<10)&&(i=this.beans.gridOptionsService.getRowHeightForNode(this).height),i==this.rowHeight))return;this.setRowHeight(i);const r=this.beans.rowModel;r.onRowHeightChangedDebounced&&r.onRowHeightChangedDebounced()}setRowIndex(e){this.rowIndex!==e&&(this.rowIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_INDEX_CHANGED)))}setUiLevel(e){this.uiLevel!==e&&(this.uiLevel=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_UI_LEVEL_CHANGED)))}setExpanded(e,t){if(this.expanded===e)return;this.expanded=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_EXPANDED_CHANGED));const i=Object.assign({},this.createGlobalRowEvent(Events.EVENT_ROW_GROUP_OPENED),{expanded:e,event:t||null});this.beans.rowNodeEventThrottle.dispatchExpanded(i),this.sibling&&this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(e){return this.beans.gridOptionsService.addGridCommonParams({type:e,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}dispatchLocalEvent(e){this.eventService&&this.eventService.dispatchEvent(e)}setDataValue(e,t,i){const o=(()=>{var l;return typeof e!="string"?e:(l=this.beans.columnModel.getGridColumn(e))!==null&&l!==void 0?l:this.beans.columnModel.getPrimaryColumn(e)})(),r=this.getValueFromValueService(o);if(this.beans.gridOptionsService.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(o,r,t,i),!1;const a=this.beans.valueService.setValue(this,o,t,i);return this.dispatchCellChangedEvent(o,t,r),this.checkRowSelectable(),a}getValueFromValueService(e){const t=this.leafGroup&&this.beans.columnModel.isPivotMode(),i=this.group&&this.expanded&&!this.footer&&!t,o=this.beans.gridOptionsService.getGroupIncludeFooter()({node:this}),r=this.beans.gridOptionsService.get("groupSuppressBlankHeader"),a=i&&o&&!r;return this.beans.valueService.getValue(e,this,!1,a)}dispatchEventForSaveValueReadOnly(e,t,i,n){const o=this.beans.gridOptionsService.addGridCommonParams({type:Events.EVENT_CELL_EDIT_REQUEST,event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:e,colDef:e.getColDef(),data:this.data,node:this,oldValue:t,newValue:i,value:i,source:n});this.beans.eventService.dispatchEvent(o)}setGroupValue(e,t){const i=this.beans.columnModel.getGridColumn(e);missing(this.groupData)&&(this.groupData={});const n=i.getColId(),o=this.groupData[n];o!==t&&(this.groupData[n]=t,this.dispatchCellChangedEvent(i,t,o))}setAggData(e){const t=this.aggData;if(this.aggData=e,this.eventService){const i=n=>{const o=this.aggData?this.aggData[n]:void 0,r=t?t[n]:void 0;if(o===r)return;const a=this.beans.columnModel.lookupGridColumn(n);a&&this.dispatchCellChangedEvent(a,o,r)};for(const n in this.aggData)i(n);for(const n in e)n in this.aggData||i(n)}}updateHasChildren(){let e=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gridOptionsService.isRowModelType("serverSide")){const i=this.beans.gridOptionsService.get("treeData"),n=this.beans.gridOptionsService.get("isServerSideGroup");e=!this.stub&&!this.footer&&(i?!!n&&n(this.data):!!this.group)}e!==this.__hasChildren&&(this.__hasChildren=!!e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(RowNode.EVENT_HAS_CHILDREN_CHANGED)))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return this.group&&missingOrEmpty(this.childrenAfterGroup)}dispatchCellChangedEvent(e,t,i){const n={type:RowNode.EVENT_CELL_CHANGED,node:this,column:e,newValue:t,oldValue:i};this.dispatchLocalEvent(n)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.footer?!1:this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(e){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(t=>t.depthFirstSearch(e)),e(this)}calculateSelectedFromChildren(){var e;let t=!1,i=!1,n=!1;if(!(!((e=this.childrenAfterGroup)===null||e===void 0)&&e.length))return this.selectable?this.selected:null;for(let o=0;o<this.childrenAfterGroup.length;o++){const r=this.childrenAfterGroup[o];let a=r.isSelected();if(!r.selectable){const l=r.calculateSelectedFromChildren();if(l===null)continue;a=l}switch(a){case!0:t=!0;break;case!1:i=!0;break;default:n=!0;break}}if(!(n||t&&i))return t?!0:i?!1:this.selectable?this.selected:null}setSelectedInitialValue(e){this.selected=e}selectThisNode(e,t,i="api"){const n=!this.selectable&&e,o=this.selected===e;if(n||o)return!1;if(this.selected=e,this.eventService){this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_ROW_SELECTED));const a=this.sibling;a&&a.footer&&a.dispatchLocalEvent(a.createLocalRowEvent(RowNode.EVENT_ROW_SELECTED))}const r=Object.assign(Object.assign({},this.createGlobalRowEvent(Events.EVENT_ROW_SELECTED)),{event:t||null,source:i});return this.beans.eventService.dispatchEvent(r),!0}setSelected(e,t=!1,i="api"){if(typeof i=="boolean"){console.warn("AG Grid: since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.");return}this.setSelectedParams({newValue:e,clearSelection:t,rangeSelect:!1,source:i})}setSelectedParams(e){return this.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),0):this.id===void 0?(console.warn("AG Grid: cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected(Object.assign(Object.assign({},e),{nodes:[this.footer?this.sibling:this]}))}isRowPinned(){return this.rowPinned==="top"||this.rowPinned==="bottom"}isParentOfNode(e){let t=this.parent;for(;t;){if(t===e)return!0;t=t.parent}return!1}addEventListener(e,t){var i,n;this.eventService||(this.eventService=new EventService),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.eventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new FrameworkEventListenerService(this.beans.frameworkOverrides));const o=(n=(i=this.frameworkEventListenerService)===null||i===void 0?void 0:i.wrap(t))!==null&&n!==void 0?n:t;this.eventService.addEventListener(e,o)}removeEventListener(e,t){var i,n;if(!this.eventService)return;const o=(n=(i=this.frameworkEventListenerService)===null||i===void 0?void 0:i.unwrap(t))!==null&&n!==void 0?n:t;this.eventService.removeEventListener(e,o),this.eventService.noRegisteredListenersExist()&&(this.eventService=null)}onMouseEnter(){this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_ENTER))}onMouseLeave(){this.dispatchLocalEvent(this.createLocalRowEvent(RowNode.EVENT_MOUSE_LEAVE))}getFirstChildOfFirstChild(e){let t=this,i=!0,n=!1,o=null;for(;i&&!n;){const r=t.parent;exists(r)&&t.firstChild?r.rowGroupColumn===e&&(n=!0,o=r):i=!1,t=r}return n?o:null}isFullWidthCell(){if(this.detail)return!0;const e=this.beans.gridOptionsService.getCallback("isFullWidthRow");return e?e({rowNode:this}):!1}getRoute(){if(this.key==null)return;const e=[];let t=this;for(;t.key!=null;)e.push(t.key),t=t.parent;return e.reverse()}createFooter(){if(this.sibling)return;const e=new Set(["eventService","__objectId","sticky"]),t=new RowNode(this.beans);Object.keys(this).forEach(i=>{e.has(i)||(t[i]=this[i])}),t.footer=!0,t.setRowTop(null),t.setRowIndex(null),t.oldRowTop=null,t.id="rowGroupFooter_"+this.id,t.sibling=this,this.sibling=t}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}}RowNode.ID_PREFIX_ROW_GROUP="row-group-";RowNode.ID_PREFIX_TOP_PINNED="t-";RowNode.ID_PREFIX_BOTTOM_PINNED="b-";RowNode.OBJECT_ID_SEQUENCE=0;RowNode.EVENT_ROW_SELECTED="rowSelected";RowNode.EVENT_DATA_CHANGED="dataChanged";RowNode.EVENT_CELL_CHANGED="cellChanged";RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged";RowNode.EVENT_MASTER_CHANGED="masterChanged";RowNode.EVENT_GROUP_CHANGED="groupChanged";RowNode.EVENT_MOUSE_ENTER="mouseEnter";RowNode.EVENT_MOUSE_LEAVE="mouseLeave";RowNode.EVENT_HEIGHT_CHANGED="heightChanged";RowNode.EVENT_TOP_CHANGED="topChanged";RowNode.EVENT_DISPLAYED_CHANGED="displayedChanged";RowNode.EVENT_FIRST_CHILD_CHANGED="firstChildChanged";RowNode.EVENT_LAST_CHILD_CHANGED="lastChildChanged";RowNode.EVENT_CHILD_INDEX_CHANGED="childIndexChanged";RowNode.EVENT_ROW_INDEX_CHANGED="rowIndexChanged";RowNode.EVENT_EXPANDED_CHANGED="expandedChanged";RowNode.EVENT_HAS_CHILDREN_CHANGED="hasChildrenChanged";RowNode.EVENT_SELECTABLE_CHANGED="selectableChanged";RowNode.EVENT_UI_LEVEL_CHANGED="uiLevelChanged";RowNode.EVENT_HIGHLIGHT_CHANGED="rowHighlightChanged";RowNode.EVENT_DRAGGING_CHANGED="draggingChanged";var __decorate$28=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class CheckboxSelectionComponent extends Component{constructor(){super(`
|
||
<div class="ag-selection-checkbox" role="presentation">
|
||
<ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
|
||
</div>`)}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.rowNode.isSelected();this.eCheckbox.setValue(e,!0)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",n=>{stopPropagationForAgGrid(n)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",n=>{stopPropagationForAgGrid(n);const o=this.gridOptionsService.get("groupSelectsFiltered"),r=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(r,o)?this.onClicked(!0,o,n||{})===0&&this.onClicked(!1,o,n):r?this.onClicked(!1,o,n):this.onClicked(!0,o,n||{})}),this.addManagedListener(this.rowNode,RowNode.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this)),this.gridOptionsService.get("isRowSelectable")||typeof this.getIsVisible()=="function"){const n=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,n),this.addManagedListener(this.rowNode,RowNode.EVENT_DATA_CHANGED,n),this.addManagedListener(this.rowNode,RowNode.EVENT_CELL_CHANGED,n),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(this.eCheckbox.getPreviousValue()===void 0||e===void 0)&&this.gridOptionsService.isRowModelType("clientSide")}showOrHideSelect(){var e,t,i,n;let o=this.rowNode.selectable;const r=this.getIsVisible();if(o)if(typeof r=="function"){const l=(e=this.overrides)===null||e===void 0?void 0:e.callbackParams,d=(t=this.column)===null||t===void 0?void 0:t.createColumnFunctionCallbackParams(this.rowNode);o=d?r(Object.assign(Object.assign({},l),d)):!1}else o=r??!1;if((i=this.column)===null||i===void 0?void 0:i.getColDef().showDisabledCheckboxes){this.eCheckbox.setDisabled(!o),this.setVisible(!0),this.setDisplayed(!0);return}if(!((n=this.overrides)===null||n===void 0)&&n.removeHidden){this.setDisplayed(o);return}this.setVisible(o)}getIsVisible(){var e,t;return this.overrides?this.overrides.isVisible:(t=(e=this.column)===null||e===void 0?void 0:e.getColDef())===null||t===void 0?void 0:t.checkboxSelection}}__decorate$28([RefSelector("eCheckbox")],CheckboxSelectionComponent.prototype,"eCheckbox",void 0);__decorate$28([PostConstruct],CheckboxSelectionComponent.prototype,"postConstruct",null);var VerticalDirection;(function(s){s[s.Up=0]="Up",s[s.Down=1]="Down"})(VerticalDirection||(VerticalDirection={}));var HorizontalDirection;(function(s){s[s.Left=0]="Left",s[s.Right=1]="Right"})(HorizontalDirection||(HorizontalDirection={}));var __decorate$27=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},DragAndDropService_1,DragSourceType;(function(s){s[s.ToolPanel=0]="ToolPanel",s[s.HeaderCell=1]="HeaderCell",s[s.RowDrag=2]="RowDrag",s[s.ChartPanel=3]="ChartPanel",s[s.AdvancedFilterBuilder=4]="AdvancedFilterBuilder"})(DragSourceType||(DragSourceType={}));let DragAndDropService=DragAndDropService_1=class extends BeanStub{constructor(){super(...arguments),this.dragSourceAndParamsList=[],this.dropTargets=[]}init(){this.ePinnedIcon=createIcon("columnMovePin",this.gridOptionsService,null),this.eHideIcon=createIcon("columnMoveHide",this.gridOptionsService,null),this.eMoveIcon=createIcon("columnMoveMove",this.gridOptionsService,null),this.eLeftIcon=createIcon("columnMoveLeft",this.gridOptionsService,null),this.eRightIcon=createIcon("columnMoveRight",this.gridOptionsService,null),this.eGroupIcon=createIcon("columnMoveGroup",this.gridOptionsService,null),this.eAggregateIcon=createIcon("columnMoveValue",this.gridOptionsService,null),this.ePivotIcon=createIcon("columnMovePivot",this.gridOptionsService,null),this.eDropNotAllowedIcon=createIcon("dropNotAllowed",this.gridOptionsService,null)}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find(i=>i.dragSource===e);t&&(this.dragService.removeDragSource(t.params),removeFromArray(this.dragSourceAndParamsList,t))}clearDragSourceParamsList(){this.dragSourceAndParamsList.forEach(e=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()}onDragging(e,t){var i,n,o,r;const a=this.getHorizontalDirection(e),l=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const d=this.dropTargets.filter(p=>this.isMouseOnDropTarget(e,p)),h=this.findCurrentDropTarget(e,d);if(h!==this.lastDropTarget)this.leaveLastTargetIfExists(e,a,l,t),this.lastDropTarget!==null&&h===null&&((n=(i=this.dragSource).onGridExit)===null||n===void 0||n.call(i,this.dragItem)),this.lastDropTarget===null&&h!==null&&((r=(o=this.dragSource).onGridEnter)===null||r===void 0||r.call(o,this.dragItem)),this.enterDragTargetIfExists(h,e,a,l,t),this.lastDropTarget=h;else if(h&&h.onDragging){const p=this.createDropTargetEvent(h,e,a,l,t);h.onDragging(p)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const n=i.getBoundingClientRect();if(n.width===0||n.height===0)return!1;const o=e.clientX>=n.left&&e.clientX<n.right,r=e.clientY>=n.top&&e.clientY<n.bottom;if(!o||!r)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let n=!1;for(const o of i)if(this.allContainersIntersect(e,o)){n=!0;break}return t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement)?!1:n&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement)}findCurrentDropTarget(e,t){const i=t.length;if(i===0)return null;if(i===1)return t[0];const o=this.gridOptionsService.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const r of o)for(const a of t)if(flatten(this.getAllContainersFromDropTarget(a)).indexOf(r)!==-1)return a;return null}enterDragTargetIfExists(e,t,i,n,o){if(e){if(e.onDragEnter){const r=this.createDropTargetEvent(e,t,i,n,o);e.onDragEnter(r)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,n){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,e,t,i,n);this.lastDropTarget.onDragLeave(o)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(i=>i.external).find(i=>i.getContainer()===e.getContainer())||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?HorizontalDirection.Left:HorizontalDirection.Right}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?VerticalDirection.Up:VerticalDirection.Down}createDropTargetEvent(e,t,i,n,o){const r=e.getContainer(),a=r.getBoundingClientRect(),{gridApi:l,columnApi:d,dragItem:h,dragSource:p}=this,m=t.clientX-a.left,v=t.clientY-a.top;return{event:t,x:m,y:v,vDirection:n,hDirection:i,dragSource:p,fromNudge:o,dragItem:h,api:l,columnApi:d,dropZoneTarget:r}}positionGhost(e){const t=this.eGhost;if(!t)return;const n=t.getBoundingClientRect().height,o=getBodyWidth()-2,r=getBodyHeight()-2,a=getElementRectWithOffset(t.offsetParent),{clientY:l,clientX:d}=e;let h=l-a.top-n/2,p=d-a.left-10;const m=this.gridOptionsService.getDocument(),v=m.defaultView||window,y=v.pageYOffset||m.documentElement.scrollTop,b=v.pageXOffset||m.documentElement.scrollLeft;o>0&&p+t.clientWidth>o+b&&(p=o+b-t.clientWidth),p<0&&(p=0),r>0&&h+t.clientHeight>r+y&&(h=r+y-t.clientHeight),h<0&&(h=0),t.style.left=`${p}px`,t.style.top=`${h}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=loadTemplate(DragAndDropService_1.GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost);const{theme:e}=this.environment.getTheme();e&&this.eGhost.classList.add(e),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const t=this.eGhost.querySelector(".ag-dnd-ghost-label");let i=this.dragSource.dragItemName;isFunction(i)&&(i=i()),t.innerHTML=escapeString(i)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const n=this.gridOptionsService.getDocument();let o=null,r=null;try{o=n.fullscreenElement}catch{}finally{o||(o=this.gridOptionsService.getRootNode());const a=o.querySelector("body");a?r=a:o instanceof ShadowRoot?r=o:o instanceof Document?r=o==null?void 0:o.documentElement:r=o}this.eGhostParent=r,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){clearElement(this.eGhostIcon);let i=null;switch(e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():DragAndDropService_1.ICON_NOT_ALLOWED),e){case DragAndDropService_1.ICON_PINNED:i=this.ePinnedIcon;break;case DragAndDropService_1.ICON_MOVE:i=this.eMoveIcon;break;case DragAndDropService_1.ICON_LEFT:i=this.eLeftIcon;break;case DragAndDropService_1.ICON_RIGHT:i=this.eRightIcon;break;case DragAndDropService_1.ICON_GROUP:i=this.eGroupIcon;break;case DragAndDropService_1.ICON_AGGREGATE:i=this.eAggregateIcon;break;case DragAndDropService_1.ICON_PIVOT:i=this.ePivotIcon;break;case DragAndDropService_1.ICON_NOT_ALLOWED:i=this.eDropNotAllowedIcon;break;case DragAndDropService_1.ICON_HIDE:i=this.eHideIcon;break}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),!(i===this.eHideIcon&&this.gridOptionsService.get("suppressDragLeaveHidesColumns"))&&i&&this.eGhostIcon.appendChild(i)}};DragAndDropService.ICON_PINNED="pinned";DragAndDropService.ICON_MOVE="move";DragAndDropService.ICON_LEFT="left";DragAndDropService.ICON_RIGHT="right";DragAndDropService.ICON_GROUP="group";DragAndDropService.ICON_AGGREGATE="aggregate";DragAndDropService.ICON_PIVOT="pivot";DragAndDropService.ICON_NOT_ALLOWED="notAllowed";DragAndDropService.ICON_HIDE="hide";DragAndDropService.GHOST_TEMPLATE=`<div class="ag-dnd-ghost ag-unselectable">
|
||
<span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>
|
||
<div class="ag-dnd-ghost-label"></div>
|
||
</div>`;__decorate$27([Autowired("dragService")],DragAndDropService.prototype,"dragService",void 0);__decorate$27([Autowired("mouseEventService")],DragAndDropService.prototype,"mouseEventService",void 0);__decorate$27([Autowired("columnApi")],DragAndDropService.prototype,"columnApi",void 0);__decorate$27([Autowired("gridApi")],DragAndDropService.prototype,"gridApi",void 0);__decorate$27([PostConstruct],DragAndDropService.prototype,"init",null);__decorate$27([PreDestroy],DragAndDropService.prototype,"clearDragSourceParamsList",null);DragAndDropService=DragAndDropService_1=__decorate$27([Bean("dragAndDropService")],DragAndDropService);var __decorate$26=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class RowDragComp extends Component{constructor(e,t,i,n,o,r){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=n,this.dragStartPixels=o,this.suppressVisibilityChange=r,this.dragSource=null}isCustomGui(){return this.customGui!=null}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(createIconNoSpan("rowDrag",this.gridOptionsService,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gridOptionsService.get("rowDragManaged")?new ManagedVisibilityStrategy(this,this.beans,this.rowNode,this.column):new NonManagedVisibilityStrategy(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gridOptionsService.get("rowDragMultiRow"))return[this.rowNode];const t=this.beans.selectionService.getSelectedNodes();return t.indexOf(this.rowNode)!==-1?t:[this.rowNode]}checkCompatibility(){const e=this.gridOptionsService.get("rowDragManaged");this.gridOptionsService.get("treeData")&&e&&warnOnce("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gridOptionsService.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.localeService.getLocaleTextFunc();this.dragSource={type:DragSourceType.RowDrag,eElement:this.getGui(),dragItemName:()=>{var i;const n=this.getDragItem(),o=((i=n.rowNodes)===null||i===void 0?void 0:i.length)||1,r=this.getRowDragText(this.column);return r?r(n,o):o===1?this.cellValueFn():`${o} ${t("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gridOptionsService.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}}__decorate$26([Autowired("beans")],RowDragComp.prototype,"beans",void 0);__decorate$26([PostConstruct],RowDragComp.prototype,"postConstruct",null);__decorate$26([PreDestroy],RowDragComp.prototype,"removeDragSource",null);class VisibilityStrategy extends BeanStub{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let i=!0,n=!1;this.column&&(i=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),n=isFunction(this.column.getColDef().rowDrag)),n?(this.parent.setDisplayed(!0,t),this.parent.setVisible(i,t)):(this.parent.setDisplayed(i,t),this.parent.setVisible(!0,t))}}}class NonManagedVisibilityStrategy extends VisibilityStrategy{constructor(e,t,i,n){super(e,i,n),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,Events.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gridOptionsService.get("suppressRowDrag");this.setDisplayedOrVisible(e)}}__decorate$26([PostConstruct],NonManagedVisibilityStrategy.prototype,"postConstruct",null);class ManagedVisibilityStrategy extends VisibilityStrategy{constructor(e,t,i,n){super(e,i,n),this.beans=t}postConstruct(){this.addManagedListener(this.beans.eventService,Events.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,Events.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,Events.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,Events.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const t=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),i=t&&t.shouldPreventRowMove(),n=this.gridOptionsService.get("suppressRowDrag"),o=this.beans.dragAndDropService.hasExternalDropZones(),r=i&&!o||n;this.setDisplayedOrVisible(r)}}__decorate$26([PostConstruct],ManagedVisibilityStrategy.prototype,"postConstruct",null);var __decorate$25=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class GroupCellRendererCtrl extends BeanStub{init(e,t,i,n,o,r,a){var l,d,h,p;this.params=a,this.eGui=t,this.eCheckbox=i,this.eExpanded=n,this.eContracted=o,this.comp=e,this.compClass=r;const{node:m,value:v,colDef:y}=a,b=this.isTopLevelFooter();if(!b){if(this.isEmbeddedRowMismatch())return;if(m.footer&&this.gridOptionsService.get("groupHideOpenParents")){const E=y&&y.showRowGroup,T=m.rowGroupColumn&&m.rowGroupColumn.getColId();if(E!==T)return}}if(this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),!b){const S=a.node.footer&&a.node.rowGroupIndex===this.columnModel.getRowGroupColumns().findIndex(M=>{var I;return M.getColId()===((I=a.colDef)===null||I===void 0?void 0:I.showRowGroup)}),T=this.gridOptionsService.get("groupDisplayType")!="multipleColumns"||this.gridOptionsService.get("treeData")||this.gridOptionsService.get("showOpenedGroup")&&!a.node.footer&&(!a.node.group||a.node.rowGroupIndex!=null&&a.node.rowGroupIndex>this.columnModel.getRowGroupColumns().findIndex(M=>{var I;return M.getColId()===((I=a.colDef)===null||I===void 0?void 0:I.showRowGroup)})),R=!m.group&&(((l=this.params.colDef)===null||l===void 0?void 0:l.field)||((d=this.params.colDef)===null||d===void 0?void 0:d.valueGetter)),A=this.isExpandable(),D=this.columnModel.isPivotMode()&&m.leafGroup&&((h=m.rowGroupColumn)===null||h===void 0?void 0:h.getColId())===((p=a.column)===null||p===void 0?void 0:p.getColDef().showRowGroup);if(!this.showingValueForOpenedParent&&!A&&!R&&!T&&!S&&!D)return}this.addExpandAndContract(),this.addFullWidthRowDraggerIfNeeded(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded()}getCellAriaRole(){var e,t;const i=(e=this.params.colDef)===null||e===void 0?void 0:e.cellAriaRole,n=(t=this.params.column)===null||t===void 0?void 0:t.getColDef().cellAriaRole;return i||n||"gridcell"}destroy(){super.destroy(),this.expandListener=null}refreshAriaExpanded(){const{node:e,eGridCell:t}=this.params;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable()){removeAriaExpanded(t);return}const i=()=>{setAriaExpanded(t,!!e.expanded)};this.expandListener=this.addManagedListener(e,RowNode.EVENT_EXPANDED_CHANGED,i)||null,i()}isTopLevelFooter(){if(!this.gridOptionsService.get("groupIncludeTotalFooter")||this.params.value!=null||this.params.node.level!=-1)return!1;const e=this.params.colDef;if(e==null||e.showRowGroup===!0)return!0;const i=this.columnModel.getRowGroupColumns();return!i||i.length===0?!0:i[0].getId()===e.showRowGroup}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gridOptionsService.get("embedFullWidthRows"))return!1;const e=this.params.pinned==="left",t=this.params.pinned==="right",i=!e&&!t;return this.gridOptionsService.get("enableRtl")?this.columnModel.isPinningLeft()?!t:!i:this.columnModel.isPinningLeft()?!e:!i}findDisplayedGroupNode(){const e=this.params.column,t=this.params.node;if(this.showingValueForOpenedParent){let i=t.parent;for(;i!=null;){if(i.rowGroupColumn&&e.isRowGroupDisplayed(i.rowGroupColumn.getId())){this.displayedGroupNode=i;break}i=i.parent}}missing(this.displayedGroupNode)&&(this.displayedGroupNode=t)}setupShowingValueForOpenedParent(){const e=this.params.node,t=this.params.column;if(!this.gridOptionsService.get("groupHideOpenParents")){this.showingValueForOpenedParent=!1;return}if(!e.groupData){this.showingValueForOpenedParent=!1;return}if(e.rowGroupColumn!=null){const o=e.rowGroupColumn.getId();if(t.isRowGroupDisplayed(o)){this.showingValueForOpenedParent=!1;return}}const n=e.groupData[t.getId()]!=null;this.showingValueForOpenedParent=n}addValueElement(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())}addGroupValue(){var e;const t=this.adjustParamsWithDetailsFromRelatedColumn(),i=this.getInnerCompDetails(t),{valueFormatted:n,value:o}=t;let r=n;if(r==null){const a=this.displayedGroupNode.rowGroupColumn&&((e=this.params.column)===null||e===void 0?void 0:e.isRowGroupDisplayed(this.displayedGroupNode.rowGroupColumn.getId()));this.displayedGroupNode.key===""&&this.displayedGroupNode.group&&a?r=this.localeService.getLocaleTextFunc()("blanks","(Blanks)"):r=o??null}this.comp.setInnerRenderer(i,r)}adjustParamsWithDetailsFromRelatedColumn(){const e=this.displayedGroupNode.rowGroupColumn,t=this.params.column;if(!e)return this.params;if(t!=null&&!t.isRowGroupDisplayed(e.getId()))return this.params;const n=this.params,{value:o,node:r}=this.params,a=this.valueFormatterService.formatValue(e,r,o);return Object.assign(Object.assign({},n),{valueFormatted:a})}addFooterValue(){const e=this.params.footerValueGetter;let t="";if(e){const n=cloneObject(this.params);n.value=this.params.value,typeof e=="function"?t=e(n):typeof e=="string"?t=this.expressionService.evaluate(e,n):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else t=this.localeService.getLocaleTextFunc()("footerTotal","Total")+" "+(this.params.value!=null?this.params.value:"");const i=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(i,t)}getInnerCompDetails(e){if(e.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gridOptionsService.get("groupRowRendererParams"),e);const t=this.userComponentFactory.getInnerRendererDetails(e,e),i=a=>a&&a.componentClass==this.compClass;if(t&&!i(t))return t;const n=this.displayedGroupNode.rowGroupColumn,o=n?n.getColDef():void 0;if(!o)return;const r=this.userComponentFactory.getCellRendererDetails(o,e);if(r&&!i(r))return r;if(i(r)&&o.cellRendererParams&&o.cellRendererParams.innerRenderer)return this.userComponentFactory.getInnerRendererDetails(o.cellRendererParams,e)}addChildCount(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())}updateChildCount(){const e=this.displayedGroupNode.allChildrenCount,n=this.isShowRowGroupForThisRow()&&e!=null&&e>=0?`(${e})`:"";this.comp.setChildCount(n)}isShowRowGroupForThisRow(){if(this.gridOptionsService.get("treeData"))return!0;const e=this.displayedGroupNode.rowGroupColumn;if(!e)return!1;const t=this.params.column;return t==null||t.isRowGroupDisplayed(e.getId())}addExpandAndContract(){var e;const t=this.params,i=createIconNoSpan("groupExpanded",this.gridOptionsService,null),n=createIconNoSpan("groupContracted",this.gridOptionsService,null);i&&this.eExpanded.appendChild(i),n&&this.eContracted.appendChild(n);const o=t.eGridCell;!(((e=this.params.column)===null||e===void 0?void 0:e.isCellEditable(t.node))&&this.gridOptionsService.get("enableGroupEdit"))&&this.isExpandable()&&!t.suppressDoubleClickExpand&&this.addManagedListener(o,"dblclick",this.onCellDblClicked.bind(this)),this.addManagedListener(this.eExpanded,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eContracted,"click",this.onExpandClicked.bind(this)),this.addManagedListener(o,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(t.node,RowNode.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();const a=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,RowNode.EVENT_ALL_CHILDREN_COUNT_CHANGED,a),this.addManagedListener(this.displayedGroupNode,RowNode.EVENT_MASTER_CHANGED,a),this.addManagedListener(this.displayedGroupNode,RowNode.EVENT_GROUP_CHANGED,a),this.addManagedListener(this.displayedGroupNode,RowNode.EVENT_HAS_CHILDREN_CHANGED,a)}onExpandClicked(e){isStopPropagationForAgGrid(e)||(stopPropagationForAgGrid(e),this.onExpandOrContract(e))}onExpandOrContract(e){const t=this.displayedGroupNode,i=!t.expanded;!i&&t.sticky&&this.scrollToStickyNode(t),t.setExpanded(i,e)}scrollToStickyNode(e){this.ctrlsService.getGridBodyCtrl().getScrollFeature().setVerticalScrollPosition(e.rowTop-e.stickyRowTop)}isExpandable(){if(this.showingValueForOpenedParent)return!0;const e=this.displayedGroupNode,t=this.columnModel.isPivotMode()&&e.leafGroup;if(!(e.isExpandable()&&!e.footer&&!t))return!1;const n=this.params.column;return n!=null&&typeof n.getColDef().showRowGroup=="string"?this.isShowRowGroupForThisRow():!0}showExpandAndContractIcons(){const{params:e,displayedGroupNode:t,columnModel:i}=this,{node:n}=e,o=this.isExpandable();if(o){const h=this.showingValueForOpenedParent?!0:n.expanded;this.comp.setExpandedDisplayed(h),this.comp.setContractedDisplayed(!h)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);const r=i.isPivotMode(),a=r&&t.leafGroup,l=o&&!a,d=n.footer&&n.level===-1;this.comp.addOrRemoveCssClass("ag-cell-expandable",l),this.comp.addOrRemoveCssClass("ag-row-group",l),r?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",a):d||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!l)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){const e=this.params.node;this.params.suppressPadding||(this.addManagedListener(e,RowNode.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())}setIndent(){if(this.gridOptionsService.get("groupHideOpenParents"))return;const e=this.params,t=e.node,i=!!e.colDef,n=this.gridOptionsService.get("treeData"),r=!i||n||e.colDef.showRowGroup===!0?t.uiLevel:0;this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+r,this.comp.addOrRemoveCssClass(this.indentClass,!0)}addFullWidthRowDraggerIfNeeded(){if(!this.params.fullWidth||!this.params.rowDrag)return;const e=new RowDragComp(()=>this.params.value,this.params.node);this.createManagedBean(e,this.context),this.eGui.insertAdjacentElement("afterbegin",e.getGui())}isUserWantsSelected(){const e=this.params.checkbox;return typeof e=="function"||e===!0}addCheckboxIfNeeded(){const e=this.displayedGroupNode,t=this.isUserWantsSelected()&&!e.footer&&!e.rowPinned&&!e.detail;if(t){const i=new CheckboxSelectionComponent;this.getContext().createBean(i),i.init({rowNode:this.params.node,column:this.params.column,overrides:{isVisible:this.params.checkbox,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(i.getGui()),this.addDestroyFunc(()=>this.getContext().destroyBean(i))}this.comp.setCheckboxVisible(t)}onKeyDown(e){!(e.key===KeyCode.ENTER)||this.params.suppressEnterExpand||this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){if(isStopPropagationForAgGrid(e))return;isElementInEventPath(this.eExpanded,e)||isElementInEventPath(this.eContracted,e)||this.onExpandOrContract(e)}}__decorate$25([Autowired("expressionService")],GroupCellRendererCtrl.prototype,"expressionService",void 0);__decorate$25([Autowired("valueFormatterService")],GroupCellRendererCtrl.prototype,"valueFormatterService",void 0);__decorate$25([Autowired("columnModel")],GroupCellRendererCtrl.prototype,"columnModel",void 0);__decorate$25([Autowired("userComponentFactory")],GroupCellRendererCtrl.prototype,"userComponentFactory",void 0);__decorate$25([Autowired("ctrlsService")],GroupCellRendererCtrl.prototype,"ctrlsService",void 0);var __decorate$24=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class GroupCellRenderer extends Component{constructor(){super(GroupCellRenderer.TEMPLATE)}init(e){const t={setInnerRenderer:(r,a)=>this.setRenderDetails(r,a),setChildCount:r=>this.eChildCount.textContent=r,addOrRemoveCssClass:(r,a)=>this.addOrRemoveCssClass(r,a),setContractedDisplayed:r=>setDisplayed(this.eContracted,r),setExpandedDisplayed:r=>setDisplayed(this.eExpanded,r),setCheckboxVisible:r=>this.eCheckbox.classList.toggle("ag-invisible",!r)},i=this.createManagedBean(new GroupCellRendererCtrl),n=!e.colDef,o=this.getGui();i.init(t,o,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),n&&setAriaRole(o,i.getCellAriaRole())}setRenderDetails(e,t){if(e){const i=e.newAgStackInstance();if(!i)return;i.then(n=>{if(!n)return;const o=()=>this.context.destroyBean(n);this.isAlive()?(this.eValue.appendChild(n.getGui()),this.addDestroyFunc(o)):o()})}else this.eValue.innerText=t}destroy(){this.getContext().destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}}GroupCellRenderer.TEMPLATE=`<span class="ag-cell-wrapper">
|
||
<span class="ag-group-expanded" ref="eExpanded"></span>
|
||
<span class="ag-group-contracted" ref="eContracted"></span>
|
||
<span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>
|
||
<span class="ag-group-value" ref="eValue"></span>
|
||
<span class="ag-group-child-count" ref="eChildCount"></span>
|
||
</span>`;__decorate$24([RefSelector("eExpanded")],GroupCellRenderer.prototype,"eExpanded",void 0);__decorate$24([RefSelector("eContracted")],GroupCellRenderer.prototype,"eContracted",void 0);__decorate$24([RefSelector("eCheckbox")],GroupCellRenderer.prototype,"eCheckbox",void 0);__decorate$24([RefSelector("eValue")],GroupCellRenderer.prototype,"eValue",void 0);__decorate$24([RefSelector("eChildCount")],GroupCellRenderer.prototype,"eChildCount",void 0);var __decorate$23=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class LoadingCellRenderer extends Component{constructor(){super(LoadingCellRenderer.TEMPLATE)}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=createIconNoSpan("groupLoading",this.gridOptionsService,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}}LoadingCellRenderer.TEMPLATE=`<div class="ag-loading">
|
||
<span class="ag-loading-icon" ref="eLoadingIcon"></span>
|
||
<span class="ag-loading-text" ref="eLoadingText"></span>
|
||
</div>`;__decorate$23([RefSelector("eLoadingIcon")],LoadingCellRenderer.prototype,"eLoadingIcon",void 0);__decorate$23([RefSelector("eLoadingText")],LoadingCellRenderer.prototype,"eLoadingText",void 0);let LoadingOverlayComponent$1=class $n extends Component{constructor(){super()}destroy(){super.destroy()}init(e){const t=this.gridOptionsService.get("overlayLoadingTemplate");if(this.setTemplate(t??$n.DEFAULT_LOADING_OVERLAY_TEMPLATE),!t){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("loadingOoo","Loading...")})}}};LoadingOverlayComponent$1.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>';let NoRowsOverlayComponent$1=class kn extends Component{constructor(){super()}destroy(){super.destroy()}init(e){const t=this.gridOptionsService.get("overlayNoRowsTemplate");if(this.setTemplate(t??kn.DEFAULT_NO_ROWS_TEMPLATE),!t){const i=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=i("noRowsToShow","No Rows To Show")})}}};NoRowsOverlayComponent$1.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center"></span>';let TooltipComponent$1=class extends PopupComponent{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=escapeString(t,!0)}};class NumberCellEditorInput{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" ref="eInput"></ag-input-number-field>'}init(e,t){this.eInput=e,this.params=t,t.max!=null&&e.setMax(t.max),t.min!=null&&e.setMin(t.min),t.precision!=null&&e.setPrecision(t.precision),t.step!=null&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedListener(i,"keydown",this.preventStepping):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){(e.key===KeyCode.UP||e.key===KeyCode.DOWN)&&e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!exists(e)&&!exists(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(t==null)return t;if(typeof t=="string"){if(t==="")return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}}class NumberCellEditor extends SimpleCellEditor{constructor(){super(new NumberCellEditorInput)}}class DateCellEditorInput{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,t.min!=null&&e.setMin(t.min),t.max!=null&&e.setMax(t.max),t.step!=null&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return!exists(e)&&!exists(this.params.value)?this.params.value:e??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return serialiseDate(e,!1)}}class DateCellEditor extends SimpleCellEditor{constructor(){super(new DateCellEditorInput)}}var __decorate$22=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class DateStringCellEditorInput{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,t.min!=null&&e.setMin(t.min),t.max!=null&&e.setMax(t.max),t.step!=null&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return!exists(e)&&!exists(this.params.value)?this.params.value:this.params.parseValue(e??"")}getStartValue(){var e,t;return serialiseDate((t=this.parseDate((e=this.params.value)!==null&&e!==void 0?e:void 0))!==null&&t!==void 0?t:null,!1)}parseDate(e){return this.getDataTypeService().getDateParserFunction(this.params.column)(e)}formatDate(e){return this.getDataTypeService().getDateFormatterFunction(this.params.column)(e)}}class DateStringCellEditor extends SimpleCellEditor{constructor(){super(new DateStringCellEditorInput(()=>this.dataTypeService))}}__decorate$22([Autowired("dataTypeService")],DateStringCellEditor.prototype,"dataTypeService",void 0);var __decorate$21=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class CheckboxCellRenderer extends Component{constructor(){super(CheckboxCellRenderer.TEMPLATE)}init(e){this.params=e,this.updateCheckbox(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),setAriaLive(t,"polite"),this.addManagedListener(t,"click",n=>{if(stopPropagationForAgGrid(n),this.eCheckbox.isDisabled())return;const o=this.eCheckbox.getValue();this.onCheckboxChanged(o)}),this.addManagedListener(t,"dblclick",n=>{stopPropagationForAgGrid(n)});const i=this.gridOptionsService.getDocument();this.addManagedListener(this.params.eGridCell,"keydown",n=>{if(n.key===KeyCode.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===i.activeElement&&this.eCheckbox.toggle();const o=this.eCheckbox.getValue();this.onCheckboxChanged(o),n.preventDefault()}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var t,i,n;let o,r=!0;if(e.node.group&&e.column){const p=e.column.getColId();p.startsWith(GROUP_AUTO_COLUMN_ID)?o=e.value==null||e.value===""?void 0:e.value==="true":e.node.aggData&&e.node.aggData[p]!==void 0?o=(t=e.value)!==null&&t!==void 0?t:void 0:r=!1}else o=(i=e.value)!==null&&i!==void 0?i:void 0;if(!r){this.eCheckbox.setDisplayed(!1);return}this.eCheckbox.setValue(o);const a=e.disabled!=null?e.disabled:!(!((n=e.column)===null||n===void 0)&&n.isCellEditable(e.node));this.eCheckbox.setDisabled(a);const l=this.localeService.getLocaleTextFunc(),d=getAriaCheckboxStateName(l,o),h=a?d:`${l("ariaToggleCellValue","Press SPACE to toggle cell value")} (${d})`;this.eCheckbox.setInputAriaLabel(h)}onCheckboxChanged(e){const{column:t,node:i,rowIndex:n,value:o}=this.params,r={type:Events.EVENT_CELL_EDITING_STARTED,column:t,colDef:t==null?void 0:t.getColDef(),data:i.data,node:i,rowIndex:n,rowPinned:i.rowPinned,value:o};this.eventService.dispatchEvent(r);const a=this.params.node.setDataValue(this.params.column,e,"edit"),l={type:Events.EVENT_CELL_EDITING_STOPPED,column:t,colDef:t==null?void 0:t.getColDef(),data:i.data,node:i,rowIndex:n,rowPinned:i.rowPinned,value:o,oldValue:o,newValue:e,valueChanged:a};this.eventService.dispatchEvent(l)}}CheckboxCellRenderer.TEMPLATE=`
|
||
<div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">
|
||
<ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
|
||
</div>`;__decorate$21([RefSelector("eCheckbox")],CheckboxCellRenderer.prototype,"eCheckbox",void 0);var __decorate$20=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class CheckboxCellEditor extends PopupComponent{constructor(){super(`
|
||
<div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">
|
||
<ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>
|
||
</div>`)}init(e){var t;this.params=e;const i=(t=e.value)!==null&&t!==void 0?t:void 0;this.eCheckbox.setValue(i),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(i),this.addManagedListener(this.eCheckbox,Events.EVENT_FIELD_VALUE_CHANGED,o=>this.setAriaLabel(o.selected))}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=getAriaCheckboxStateName(t,e),n=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${n} (${i})`)}}__decorate$20([RefSelector("eCheckbox")],CheckboxCellEditor.prototype,"eCheckbox",void 0);class AgMenuItemRenderer extends Component{constructor(){super(),this.setTemplate("<div></div>")}init(e){var t;this.params=e,this.cssClassPrefix=(t=this.params.cssClassPrefix)!==null&&t!==void 0?t:"ag-menu-option",this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu()}configureDefaults(){return!0}addIcon(){if(this.params.isCompact)return;const e=loadTemplate(`<span ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`);this.params.checked?e.appendChild(createIconNoSpan("check",this.gridOptionsService)):this.params.icon&&(isNodeOrElement(this.params.icon)?e.appendChild(this.params.icon):typeof this.params.icon=="string"?e.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){const e=loadTemplate(`<span ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(e)}addShortcut(){if(this.params.isCompact)return;const e=loadTemplate(`<span ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){const e=loadTemplate(`<span ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const i=this.gridOptionsService.get("enableRtl")?"smallLeft":"smallRight";setAriaExpanded(t,!1),e.appendChild(createIconNoSpan(i,this.gridOptionsService))}t.appendChild(e)}getClassName(e){return`${this.cssClassPrefix}-${e}`}destroy(){super.destroy()}}var __decorate$1$=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let UserComponentRegistry=class extends BeanStub{constructor(){super(...arguments),this.agGridDefaults={agDateInput:DefaultDateComponent,agColumnHeader:HeaderComp,agColumnGroupHeader:HeaderGroupComp,agSortIndicator:SortIndicatorComp,agTextColumnFloatingFilter:TextFloatingFilter,agNumberColumnFloatingFilter:NumberFloatingFilter,agDateColumnFloatingFilter:DateFloatingFilter,agReadOnlyFloatingFilter:ReadOnlyFloatingFilter,agAnimateShowChangeCellRenderer:AnimateShowChangeCellRenderer,agAnimateSlideCellRenderer:AnimateSlideCellRenderer,agGroupCellRenderer:GroupCellRenderer,agGroupRowRenderer:GroupCellRenderer,agLoadingCellRenderer:LoadingCellRenderer,agCheckboxCellRenderer:CheckboxCellRenderer,agCellEditor:TextCellEditor,agTextCellEditor:TextCellEditor,agNumberCellEditor:NumberCellEditor,agDateCellEditor:DateCellEditor,agDateStringCellEditor:DateStringCellEditor,agSelectCellEditor:SelectCellEditor,agLargeTextCellEditor:LargeTextCellEditor,agCheckboxCellEditor:CheckboxCellEditor,agTextColumnFilter:TextFilter,agNumberColumnFilter:NumberFilter,agDateColumnFilter:DateFilter,agLoadingOverlay:LoadingOverlayComponent$1,agNoRowsOverlay:NoRowsOverlayComponent$1,agTooltipComponent:TooltipComponent$1,agMenuItem:AgMenuItemRenderer},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:ModuleNames.SetFilterModule,agSetColumnFloatingFilter:ModuleNames.SetFilterModule,agMultiColumnFilter:ModuleNames.MultiFilterModule,agMultiColumnFloatingFilter:ModuleNames.MultiFilterModule,agGroupColumnFilter:ModuleNames.RowGroupingModule,agGroupColumnFloatingFilter:ModuleNames.RowGroupingModule,agRichSelect:ModuleNames.RichSelectModule,agRichSelectCellEditor:ModuleNames.RichSelectModule,agDetailCellRenderer:ModuleNames.MasterDetailModule,agSparklineCellRenderer:ModuleNames.SparklinesModule},this.jsComps={}}init(){this.gridOptions.components!=null&&iterateObject(this.gridOptions.components,(e,t)=>this.registerJsComponent(e,t))}registerDefaultComponent(e,t){if(this.agGridDefaults[e]){console.error("Trying to overwrite a default component. You should call registerComponent");return}this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(l,d)=>({componentFromFramework:d,component:l}),n=this.getFrameworkOverrides().frameworkComponent(t,this.gridOptions.components);if(n!=null)return i(n,!0);const o=this.jsComps[t];if(o){const l=this.getFrameworkOverrides().isFrameworkComponent(o);return i(o,l)}const r=this.agGridDefaults[t];if(r)return i(r,!1);const a=this.enterpriseAgDefaultCompsModule[t];return a?ModuleRegistry.__assertRegistered(a,`AG Grid '${e}' component: ${t}`,this.context.getGridId()):doOnce(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=[...Object.keys(this.agGridDefaults).filter(o=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(o)),...Object.keys(this.jsComps)],n=fuzzySuggestions(t,i,!0,.8).values;console.warn(`AG Grid: Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),n.length>0&&console.warn(` Did you mean: [${n.slice(0,3)}]?`),console.warn(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}};__decorate$1$([Autowired("gridOptions")],UserComponentRegistry.prototype,"gridOptions",void 0);__decorate$1$([PostConstruct],UserComponentRegistry.prototype,"init",null);UserComponentRegistry=__decorate$1$([Bean("userComponentRegistry")],UserComponentRegistry);const DateComponent={propertyName:"dateComponent",cellRenderer:!1},HeaderComponent={propertyName:"headerComponent",cellRenderer:!1},HeaderGroupComponent={propertyName:"headerGroupComponent",cellRenderer:!1},CellRendererComponent={propertyName:"cellRenderer",cellRenderer:!0},CellEditorComponent={propertyName:"cellEditor",cellRenderer:!1},InnerRendererComponent={propertyName:"innerRenderer",cellRenderer:!0},LoadingOverlayComponent={propertyName:"loadingOverlayComponent",cellRenderer:!1},NoRowsOverlayComponent={propertyName:"noRowsOverlayComponent",cellRenderer:!1},TooltipComponent={propertyName:"tooltipComponent",cellRenderer:!1},FilterComponent={propertyName:"filter",cellRenderer:!1},FloatingFilterComponent={propertyName:"floatingFilterComponent",cellRenderer:!1},ToolPanelComponent={propertyName:"toolPanel",cellRenderer:!1},StatusPanelComponent={propertyName:"statusPanel",cellRenderer:!1},FullWidth={propertyName:"fullWidthCellRenderer",cellRenderer:!0},FullWidthLoading={propertyName:"loadingCellRenderer",cellRenderer:!0},FullWidthGroup={propertyName:"groupRowRenderer",cellRenderer:!0},FullWidthDetail={propertyName:"detailCellRenderer",cellRenderer:!0},MenuItemComponent={propertyName:"menuItem",cellRenderer:!1};class FloatingFilterMapper{static getFloatingFilterType(e){return this.filterToFloatingFilterMapping[e]}}FloatingFilterMapper.filterToFloatingFilterMapping={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"};var __decorate$1_=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let UserComponentFactory=class extends BeanStub{getHeaderCompDetails(e,t){return this.getCompDetails(e,HeaderComponent,"agColumnHeader",t)}getHeaderGroupCompDetails(e){const t=e.columnGroup.getColGroupDef();return this.getCompDetails(t,HeaderGroupComponent,"agColumnGroupHeader",e)}getFullWidthCellRendererDetails(e){return this.getCompDetails(this.gridOptions,FullWidth,null,e,!0)}getFullWidthLoadingCellRendererDetails(e){return this.getCompDetails(this.gridOptions,FullWidthLoading,"agLoadingCellRenderer",e,!0)}getFullWidthGroupCellRendererDetails(e){return this.getCompDetails(this.gridOptions,FullWidthGroup,"agGroupRowRenderer",e,!0)}getFullWidthDetailCellRendererDetails(e){return this.getCompDetails(this.gridOptions,FullWidthDetail,"agDetailCellRenderer",e,!0)}getInnerRendererDetails(e,t){return this.getCompDetails(e,InnerRendererComponent,null,t)}getFullWidthGroupRowInnerCellRenderer(e,t){return this.getCompDetails(e,InnerRendererComponent,null,t)}getCellRendererDetails(e,t){return this.getCompDetails(e,CellRendererComponent,null,t)}getCellEditorDetails(e,t){return this.getCompDetails(e,CellEditorComponent,"agCellEditor",t,!0)}getFilterDetails(e,t,i){return this.getCompDetails(e,FilterComponent,i,t,!0)}getDateCompDetails(e){return this.getCompDetails(this.gridOptions,DateComponent,"agDateInput",e,!0)}getLoadingOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,LoadingOverlayComponent,"agLoadingOverlay",e,!0)}getNoRowsOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,NoRowsOverlayComponent,"agNoRowsOverlay",e,!0)}getTooltipCompDetails(e){return this.getCompDetails(e.colDef,TooltipComponent,"agTooltipComponent",e,!0)}getSetFilterCellRendererDetails(e,t){return this.getCompDetails(e,CellRendererComponent,null,t)}getFloatingFilterCompDetails(e,t,i){return this.getCompDetails(e,FloatingFilterComponent,i,t)}getToolPanelCompDetails(e,t){return this.getCompDetails(e,ToolPanelComponent,null,t,!0)}getStatusPanelCompDetails(e,t){return this.getCompDetails(e,StatusPanelComponent,null,t,!0)}getMenuItemCompDetails(e,t){return this.getCompDetails(e,MenuItemComponent,"agMenuItem",t,!0)}getCompDetails(e,t,i,n,o=!1){const{propertyName:r,cellRenderer:a}=t;let{compName:l,jsComp:d,fwComp:h,paramsFromSelector:p,popupFromSelector:m,popupPositionFromSelector:v}=this.getCompKeys(e,t,n);const y=T=>{const R=this.userComponentRegistry.retrieve(r,T);R&&(d=R.componentFromFramework?void 0:R.component,h=R.componentFromFramework?R.component:void 0)};if(l!=null&&y(l),d==null&&h==null&&i!=null&&y(i),d&&a&&!this.agComponentUtils.doesImplementIComponent(d)&&(d=this.agComponentUtils.adaptFunction(r,d)),!d&&!h){o&&console.error(`AG Grid: Could not find component ${l}, did you forget to configure this component?`);return}const b=this.mergeParamsWithApplicationProvidedParams(e,t,n,p),S=d==null,E=d||h;return{componentFromFramework:S,componentClass:E,params:b,type:t,popupFromSelector:m,popupPositionFromSelector:v,newAgStackInstance:()=>this.newAgStackInstance(E,S,b,t)}}getCompKeys(e,t,i){const{propertyName:n}=t;let o,r,a,l,d,h;if(e){const p=e,m=p[n+"Selector"],v=m?m(i):null,y=b=>{typeof b=="string"?o=b:b!=null&&b!==!0&&(this.getFrameworkOverrides().isFrameworkComponent(b)?a=b:r=b)};v?(y(v.component),l=v.params,d=v.popup,h=v.popupPosition):y(p[n])}return{compName:o,jsComp:r,fwComp:a,paramsFromSelector:l,popupFromSelector:d,popupPositionFromSelector:h}}newAgStackInstance(e,t,i,n){const o=n.propertyName,r=!t;let a;if(r)a=new e;else{const d=this.componentMetadataProvider.retrieve(o);a=this.frameworkComponentWrapper.wrap(e,d.mandatoryMethodList,d.optionalMethodList,n)}const l=this.initComponent(a,i);return l==null?AgPromise.resolve(a):l.then(()=>a)}mergeParamsWithApplicationProvidedParams(e,t,i,n=null){const o=this.gridOptionsService.getGridCommonParams();mergeDeep(o,i);const r=e,a=r&&r[t.propertyName+"Params"];if(typeof a=="function"){const l=a(i);mergeDeep(o,l)}else typeof a=="object"&&mergeDeep(o,a);return mergeDeep(o,n),o}initComponent(e,t){if(this.context.createBean(e),e.init!=null)return e.init(t)}getDefaultFloatingFilterType(e,t){if(e==null)return null;let i=null,{compName:n,jsComp:o,fwComp:r}=this.getCompKeys(e,FilterComponent);return n?i=FloatingFilterMapper.getFloatingFilterType(n):o==null&&r==null&&e.filter===!0&&(i=t()),i}};__decorate$1_([Autowired("gridOptions")],UserComponentFactory.prototype,"gridOptions",void 0);__decorate$1_([Autowired("agComponentUtils")],UserComponentFactory.prototype,"agComponentUtils",void 0);__decorate$1_([Autowired("componentMetadataProvider")],UserComponentFactory.prototype,"componentMetadataProvider",void 0);__decorate$1_([Autowired("userComponentRegistry")],UserComponentFactory.prototype,"userComponentRegistry",void 0);__decorate$1_([Optional("frameworkComponentWrapper")],UserComponentFactory.prototype,"frameworkComponentWrapper",void 0);UserComponentFactory=__decorate$1_([Bean("userComponentFactory")],UserComponentFactory);class ColDefUtil{}ColDefUtil.ColDefPropertyMap={headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0};ColDefUtil.ALL_PROPERTIES=Object.keys(ColDefUtil.ColDefPropertyMap);var ExcelFactoryMode;(function(s){s[s.SINGLE_SHEET=0]="SINGLE_SHEET",s[s.MULTI_SHEET=1]="MULTI_SHEET"})(ExcelFactoryMode||(ExcelFactoryMode={}));var __decorate$1Z=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let DragService=class extends BeanStub{constructor(){super(...arguments),this.dragEndFunctions=[],this.dragSources=[]}removeAllListeners(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const n=e.touchStartListener;t.removeEventListener("touchstart",n,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find(i=>i.dragSource===e);t&&(this.removeListener(t),removeFromArray(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:n,stopPropagationForTouch:o}=e;i.addEventListener("mousedown",t);let r=null;const a=this.gridOptionsService.get("suppressTouch");n&&!a&&(r=l=>{isFocusableFormField(l.target)||(l.cancelable&&(l.preventDefault(),o&&l.stopPropagation()),this.onTouchStart(e,l))},i.addEventListener("touchstart",r,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:r,touchEnabled:!!n})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const n=d=>this.onTouchMove(d,e.eElement),o=d=>this.onTouchUp(d,e.eElement),r=d=>{d.cancelable&&d.preventDefault()},a=t.target,l=[{target:this.gridOptionsService.getRootNode(),type:"touchmove",listener:r,options:{passive:!1}},{target:a,type:"touchmove",listener:n,options:{passive:!0}},{target:a,type:"touchend",listener:o,options:{passive:!0}},{target:a,type:"touchcancel",listener:o,options:{passive:!0}}];this.addTemporaryEvents(l),e.dragStartPixels===0&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t)||i._alreadyProcessedByDragService||(i._alreadyProcessedByDragService=!0,t.button!==0))return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const n=d=>this.onMouseMove(d,e.eElement),o=d=>this.onMouseUp(d,e.eElement),r=d=>d.preventDefault(),a=this.gridOptionsService.getRootNode(),l=[{target:a,type:"mousemove",listener:n},{target:a,type:"mouseup",listener:o},{target:a,type:"contextmenu",listener:r}];this.addTemporaryEvents(l),e.dragStartPixels===0&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(t=>{const{target:i,type:n,listener:o,options:r}=t;i.addEventListener(n,o,r)}),this.dragEndFunctions.push(()=>{e.forEach(t=>{const{target:i,type:n,listener:o,options:r}=t;i.removeEventListener(n,o,r)})})}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams,n=exists(i)?i:4;return areEventsNear(e,t,n)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const n={type:Events.EVENT_DRAG_STARTED,target:i};this.eventService.dispatchEvent(n),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){var i;isBrowserSafari()&&((i=this.gridOptionsService.getDocument().getSelection())===null||i===void 0||i.removeAllRanges()),this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gridOptionsService.get("enableCellTextSelection"),i=e.type==="mousemove";return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=t==null?void 0:t.tagName.toLocaleLowerCase();return!!(i!=null&&i.match("^a$|textarea|input|select|button"))}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const i={type:Events.EVENT_DRAG_STOPPED,target:t};this.eventService.dispatchEvent(i)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(i=>i()),this.dragEndFunctions.length=0}};__decorate$1Z([Autowired("mouseEventService")],DragService.prototype,"mouseEventService",void 0);__decorate$1Z([PreDestroy],DragService.prototype,"removeAllListeners",null);DragService=__decorate$1Z([Bean("dragService")],DragService);class AutoScrollService{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.indexOf("x")!==-1,this.scrollVertically=e.scrollAxis.indexOf("y")!==-1,this.scrollByTick=e.scrollByTick!=null?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const n=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=e.clientX<n.left+o,this.tickRight=e.clientX>n.right-o,this.tickUp=e.clientY<n.top+o&&!i,this.tickDown=e.clientY>n.bottom-o&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;let e;if(e=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}}var __decorate$1Y=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const LIST_ITEM_HOVERED="ag-list-item-hovered";class VirtualListDragFeature extends BeanStub{constructor(e,t,i){super(),this.comp=e,this.virtualList=t,this.params=i,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.addManagedListener(this.params.eventSource,this.params.listItemDragStartEvent,this.listItemDragStart.bind(this)),this.addManagedListener(this.params.eventSource,this.params.listItemDragEndEvent,this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){const e={isInterestedIn:t=>t===this.params.dragSourceType,getIconName:()=>this.moveBlocked?DragAndDropService.ICON_PINNED:DragAndDropService.ICON_MOVE,getContainer:()=>this.comp.getGui(),onDragging:t=>this.onDragging(t),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave()};this.dragAndDropService.addDropTarget(e)}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new AutoScrollService({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;const t=this.getListDragItem(e),i=this.virtualList.getComponentAt(t.rowIndex);if(!i)return;const n=i.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,radioCssClass(n,LIST_ITEM_HOVERED),radioCssClass(n,`ag-item-highlight-${t.position}`))}getListDragItem(e){const t=this.virtualList.getGui(),i=parseFloat(window.getComputedStyle(t).paddingTop),n=this.virtualList.getRowHeight(),o=this.virtualList.getScrollTop(),r=Math.max(0,(e.y-i+o)/n),a=this.params.getNumRows(this.comp)-1,l=Math.min(a,r)|0;return{rowIndex:l,position:Math.round(r)>r||r>a?"bottom":"top",component:this.virtualList.getComponentAt(l)}}onDragStop(){this.moveBlocked||(this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearHoveredItems(),this.autoScrollService.ensureCleared())}onDragLeave(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){this.virtualList.getGui().querySelectorAll(`.${LIST_ITEM_HOVERED}`).forEach(t=>{[LIST_ITEM_HOVERED,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach(i=>{t.classList.remove(i)})}),this.lastHoveredListItem=null}}__decorate$1Y([Autowired("dragAndDropService")],VirtualListDragFeature.prototype,"dragAndDropService",void 0);__decorate$1Y([PostConstruct],VirtualListDragFeature.prototype,"postConstruct",null);var RowHighlightPosition;(function(s){s[s.Above=0]="Above",s[s.Below=1]="Below"})(RowHighlightPosition||(RowHighlightPosition={}));var __decorate$1X=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};function unwrapUserComp(s){const e=s;return e!=null&&e.getFrameworkComponentInstance!=null?e.getFrameworkComponentInstance():s}let GridApi=class{constructor(){this.detailGridInfoMap={},this.destroyCalled=!1}init(){switch(this.rowModel.getType()){case"clientSide":this.clientSideRowModel=this.rowModel;break;case"infinite":this.infiniteRowModel=this.rowModel;break;case"serverSide":this.serverSideRowModel=this.rowModel;break}this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl()})}__getAlignedGridService(){return this.alignedGridsService}__getContext(){return this.context}__getModel(){return this.rowModel}getGridId(){return this.context.getGridId()}addDetailGridInfo(e,t){this.detailGridInfoMap[e]=t}removeDetailGridInfo(e){this.detailGridInfoMap[e]=void 0}getDetailGridInfo(e){return this.detailGridInfoMap[e]}forEachDetailGridInfo(e){let t=0;iterateObject(this.detailGridInfoMap,(i,n)=>{exists(n)&&(e(n,t),t++)})}getDataAsCsv(e){if(ModuleRegistry.__assertRegistered(ModuleNames.CsvExportModule,"api.getDataAsCsv",this.context.getGridId()))return this.csvCreator.getDataAsCsv(e)}exportDataAsCsv(e){ModuleRegistry.__assertRegistered(ModuleNames.CsvExportModule,"api.exportDataAsCSv",this.context.getGridId())&&this.csvCreator.exportDataAsCsv(e)}assertNotExcelMultiSheet(e,t){return ModuleRegistry.__assertRegistered(ModuleNames.ExcelExportModule,"api."+e,this.context.getGridId())?this.excelCreator.getFactoryMode()===ExcelFactoryMode.MULTI_SHEET?(console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'"),!1):!0:!1}getDataAsExcel(e){if(this.assertNotExcelMultiSheet("getDataAsExcel",e))return this.excelCreator.getDataAsExcel(e)}exportDataAsExcel(e){this.assertNotExcelMultiSheet("exportDataAsExcel",e)&&this.excelCreator.exportDataAsExcel(e)}getSheetDataForExcel(e){if(ModuleRegistry.__assertRegistered(ModuleNames.ExcelExportModule,"api.getSheetDataForExcel",this.context.getGridId()))return this.excelCreator.setFactoryMode(ExcelFactoryMode.MULTI_SHEET),this.excelCreator.getSheetDataForExcel(e)}getMultipleSheetsAsExcel(e){if(ModuleRegistry.__assertRegistered(ModuleNames.ExcelExportModule,"api.getMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.getMultipleSheetsAsExcel(e)}exportMultipleSheetsAsExcel(e){ModuleRegistry.__assertRegistered(ModuleNames.ExcelExportModule,"api.exportMultipleSheetsAsExcel",this.context.getGridId())&&this.excelCreator.exportMultipleSheetsAsExcel(e)}setGridAriaProperty(e,t){if(!e)return;const i=this.ctrlsService.getGridBodyCtrl().getGui(),n=`aria-${e}`;t===null?i.removeAttribute(n):i.setAttribute(n,t)}logMissingRowModel(e,...t){console.error(`AG Grid: api.${e} can only be called when gridOptions.rowModelType is ${t.join(" or ")}`)}logDeprecation(e,t,i,n){warnOnce(`Since ${e} api.${t} is deprecated. Please use ${i} instead. ${n}`)}getPinnedTopRowCount(){return this.pinnedRowModel.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.pinnedRowModel.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.pinnedRowModel.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.pinnedRowModel.getPinnedBottomRow(e)}expireValueCache(){this.valueCache.expire()}getVerticalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()}getHorizontalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()}refreshCells(e={}){this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.refreshCells(e))}flashCells(e={}){const t=i=>warnOnce(`Since v31.1 api.flashCells parameter '${i}Delay' is deprecated. Please use '${i}Duration' instead.`);exists(e.fadeDelay)&&t("fade"),exists(e.flashDelay)&&t("flash"),this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.flashCells(e))}redrawRows(e={}){const t=e?e.rowNodes:void 0;this.frameworkOverrides.wrapIncoming(()=>this.rowRenderer.redrawRows(t))}refreshHeader(){this.frameworkOverrides.wrapIncoming(()=>this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh()))}isAnyFilterPresent(){return this.filterManager.isAnyFilterPresent()}isColumnFilterPresent(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()}isQuickFilterPresent(){return this.filterManager.isQuickFilterPresent()}getModel(){return warnOnce("Since v31.1 getModel() is deprecated. Please use the appropriate grid API methods instead."),this.rowModel}setRowNodeExpanded(e,t,i){this.expansionService.setRowNodeExpanded(e,t,i)}onGroupExpandedOrCollapsed(){if(missing(this.clientSideRowModel)){this.logMissingRowModel("onGroupExpandedOrCollapsed","clientSide");return}this.expansionService.onGroupExpandedOrCollapsed()}refreshClientSideRowModel(e){if(missing(this.clientSideRowModel)){this.logMissingRowModel("refreshClientSideRowModel","clientSide");return}this.clientSideRowModel.refreshModel(e)}isAnimationFrameQueueEmpty(){return this.animationFrameService.isQueueEmpty()}flushAllAnimationFrames(){this.animationFrameService.flushAllFrames()}getRowNode(e){return this.rowModel.getRowNode(e)}getSizesForCurrentTheme(){return{rowHeight:this.gos.getRowHeightAsNumber(),headerHeight:this.columnModel.getHeaderHeight()}}expandAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!0):this.logMissingRowModel("expandAll","clientSide","serverSide")}collapseAll(){this.clientSideRowModel||this.serverSideRowModel?this.expansionService.expandAll(!1):this.logMissingRowModel("collapseAll","clientSide","serverSide")}addRenderedRowListener(e,t,i){this.rowRenderer.addRenderedRowListener(e,t,i)}getQuickFilter(){return this.gos.get("quickFilterText")}getAdvancedFilterModel(){return ModuleRegistry.__assertRegistered(ModuleNames.AdvancedFilterModule,"api.getAdvancedFilterModel",this.context.getGridId())?this.filterManager.getAdvancedFilterModel():null}setAdvancedFilterModel(e){this.filterManager.setAdvancedFilterModel(e)}showAdvancedFilterBuilder(){ModuleRegistry.__assertRegistered(ModuleNames.AdvancedFilterModule,"api.setAdvancedFilterModel",this.context.getGridId())&&this.filterManager.showAdvancedFilterBuilder("api")}setNodesSelected(e){if(!e.nodes.every(a=>a.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),!1):a.id===void 0?(console.warn("AG Grid: cannot select node until id for node is known"),!1):!0))return;const{nodes:i,source:n,newValue:o}=e,r=i;this.selectionService.setNodesSelected({nodes:r,source:n??"api",newValue:o})}selectAll(e="apiSelectAll"){this.selectionService.selectAllRowNodes({source:e})}deselectAll(e="apiSelectAll"){this.selectionService.deselectAllRowNodes({source:e})}selectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.selectAllRowNodes({source:e,justFiltered:!0})}deselectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.deselectAllRowNodes({source:e,justFiltered:!0})}getServerSideSelectionState(){return missing(this.serverSideRowModel)?(this.logMissingRowModel("getServerSideSelectionState","serverSide"),null):this.selectionService.getSelectionState()}setServerSideSelectionState(e){if(missing(this.serverSideRowModel)){this.logMissingRowModel("setServerSideSelectionState","serverSide");return}this.selectionService.setSelectionState(e,"api")}selectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.selectAllRowNodes({source:e,justCurrentPage:!0})}deselectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.deselectAllRowNodes({source:e,justCurrentPage:!0})}showLoadingOverlay(){this.overlayService.showLoadingOverlay()}showNoRowsOverlay(){this.overlayService.showNoRowsOverlay()}hideOverlay(){this.overlayService.hideOverlay()}getSelectedNodes(){return this.selectionService.getSelectedNodes()}getSelectedRows(){return this.selectionService.getSelectedRows()}getBestCostNodeSelection(){if(missing(this.clientSideRowModel)){this.logMissingRowModel("getBestCostNodeSelection","clientSide");return}return this.selectionService.getBestCostNodeSelection()}getRenderedNodes(){return this.rowRenderer.getRenderedNodes()}ensureColumnVisible(e,t="auto"){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(e,t),"ensureVisible")}ensureIndexVisible(e,t){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(e,t),"ensureVisible")}ensureNodeVisible(e,t=null){this.frameworkOverrides.wrapIncoming(()=>this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(e,t),"ensureVisible")}forEachLeafNode(e){if(missing(this.clientSideRowModel)){this.logMissingRowModel("forEachLeafNode","clientSide");return}this.clientSideRowModel.forEachLeafNode(e)}forEachNode(e,t){this.rowModel.forEachNode(e,t)}forEachNodeAfterFilter(e){if(missing(this.clientSideRowModel)){this.logMissingRowModel("forEachNodeAfterFilter","clientSide");return}this.clientSideRowModel.forEachNodeAfterFilter(e)}forEachNodeAfterFilterAndSort(e){if(missing(this.clientSideRowModel)){this.logMissingRowModel("forEachNodeAfterFilterAndSort","clientSide");return}this.clientSideRowModel.forEachNodeAfterFilterAndSort(e)}getFilterInstance(e,t){return warnOnce("'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."),this.filterManager.getFilterInstance(e,t)}getColumnFilterInstance(e){return this.filterManager.getColumnFilterInstance(e)}destroyFilter(e){const t=this.columnModel.getPrimaryColumn(e);if(t)return this.filterManager.destroyFilter(t,"api")}getStatusPanel(e){if(!ModuleRegistry.__assertRegistered(ModuleNames.StatusBarModule,"api.getStatusPanel",this.context.getGridId()))return;const t=this.statusBarService.getStatusPanel(e);return unwrapUserComp(t)}getColumnDef(e){const t=this.columnModel.getPrimaryColumn(e);return t?t.getColDef():null}getColumnDefs(){return this.columnModel.getColumnDefs()}onFilterChanged(e="api"){this.filterManager.onFilterChanged({source:e})}onSortChanged(){this.sortController.onSortChanged("api")}setFilterModel(e){this.frameworkOverrides.wrapIncoming(()=>this.filterManager.setFilterModel(e))}getFilterModel(){return this.filterManager.getFilterModel()}getColumnFilterModel(e){return this.filterManager.getColumnFilterModel(e)}setColumnFilterModel(e,t){return this.filterManager.setColumnFilterModel(e,t)}getFocusedCell(){return this.focusService.getFocusedCell()}clearFocusedCell(){return this.focusService.clearFocusedCell()}setFocusedCell(e,t,i){this.focusService.setFocusedCell({rowIndex:e,column:t,rowPinned:i,forceBrowserFocus:!0})}addRowDropZone(e){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(e)}removeRowDropZone(e){const t=this.dragAndDropService.findExternalZone(e);t&&this.dragAndDropService.removeDropTarget(t)}getRowDropZoneParams(e){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(e)}assertSideBarLoaded(e){return ModuleRegistry.__assertRegistered(ModuleNames.SideBarModule,"api."+e,this.context.getGridId())}isSideBarVisible(){return this.assertSideBarLoaded("isSideBarVisible")&&this.sideBarService.getSideBarComp().isDisplayed()}setSideBarVisible(e){this.assertSideBarLoaded("setSideBarVisible")&&this.sideBarService.getSideBarComp().setDisplayed(e)}setSideBarPosition(e){this.assertSideBarLoaded("setSideBarPosition")&&this.sideBarService.getSideBarComp().setSideBarPosition(e)}openToolPanel(e){this.assertSideBarLoaded("openToolPanel")&&this.sideBarService.getSideBarComp().openToolPanel(e,"api")}closeToolPanel(){this.assertSideBarLoaded("closeToolPanel")&&this.sideBarService.getSideBarComp().close("api")}getOpenedToolPanel(){return this.assertSideBarLoaded("getOpenedToolPanel")?this.sideBarService.getSideBarComp().openedItem():null}refreshToolPanel(){this.assertSideBarLoaded("refreshToolPanel")&&this.sideBarService.getSideBarComp().refresh()}isToolPanelShowing(){return this.assertSideBarLoaded("isToolPanelShowing")&&this.sideBarService.getSideBarComp().isToolPanelShowing()}getToolPanelInstance(e){if(this.assertSideBarLoaded("getToolPanelInstance")){const t=this.sideBarService.getSideBarComp().getToolPanelInstance(e);return unwrapUserComp(t)}}getSideBar(){if(this.assertSideBarLoaded("getSideBar"))return this.sideBarService.getSideBarComp().getDef()}resetRowHeights(){if(exists(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive()){console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");return}this.clientSideRowModel.resetRowHeights()}}setRowCount(e,t){if(this.serverSideRowModel){if(this.columnModel.isRowGroupEmpty()){this.serverSideRowModel.setRowCount(e,t);return}console.error("AG Grid: setRowCount cannot be used while using row grouping.");return}if(this.infiniteRowModel){this.infiniteRowModel.setRowCount(e,t);return}this.logMissingRowModel("setRowCount","infinite","serverSide")}onRowHeightChanged(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()}getValue(e,t){let i=this.columnModel.getPrimaryColumn(e);return missing(i)&&(i=this.columnModel.getGridColumn(e)),missing(i)?null:this.valueService.getValue(i,t)}addEventListener(e,t){this.apiEventService.addEventListener(e,t)}addGlobalListener(e){this.apiEventService.addGlobalListener(e)}removeEventListener(e,t){this.apiEventService.removeEventListener(e,t)}removeGlobalListener(e){this.apiEventService.removeGlobalListener(e)}dispatchEvent(e){this.eventService.dispatchEvent(e)}destroy(){const e=`See ${this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}`;if(this.destroyCalled)return;const t={type:Events.EVENT_GRID_PRE_DESTROYED,state:this.getState()};this.dispatchEvent(t),this.destroyCalled=!0;const i=this.ctrlsService.getGridCtrl();i&&i.destroyGridUi(),this.context.destroy(),removeAllReferences(this,["isDestroyed"],e)}isDestroyed(){return this.destroyCalled}resetQuickFilter(){this.filterManager.resetQuickFilterCache()}getCellRanges(){return this.rangeService?this.rangeService.getCellRanges():(ModuleRegistry.__assertRegistered(ModuleNames.RangeSelectionModule,"api.getCellRanges",this.context.getGridId()),null)}addCellRange(e){if(this.rangeService){this.rangeService.addCellRange(e);return}ModuleRegistry.__assertRegistered(ModuleNames.RangeSelectionModule,"api.addCellRange",this.context.getGridId())}clearRangeSelection(){this.rangeService&&this.rangeService.removeAllCellRanges(),ModuleRegistry.__assertRegistered(ModuleNames.RangeSelectionModule,"gridApi.clearRangeSelection",this.context.getGridId())}undoCellEditing(){this.undoRedoService.undo("api")}redoCellEditing(){this.undoRedoService.redo("api")}getCurrentUndoSize(){return this.undoRedoService.getCurrentUndoStackSize()}getCurrentRedoSize(){return this.undoRedoService.getCurrentRedoStackSize()}assertChart(e,t){if(ModuleRegistry.__assertRegistered(ModuleNames.GridChartsModule,"api."+e,this.context.getGridId()))return this.frameworkOverrides.wrapIncoming(()=>t())}getChartModels(){return this.assertChart("getChartModels",()=>this.chartService.getChartModels())}getChartRef(e){return this.assertChart("getChartRef",()=>this.chartService.getChartRef(e))}getChartImageDataURL(e){return this.assertChart("getChartImageDataURL",()=>this.chartService.getChartImageDataURL(e))}downloadChart(e){return this.assertChart("downloadChart",()=>this.chartService.downloadChart(e))}openChartToolPanel(e){return this.assertChart("openChartToolPanel",()=>this.chartService.openChartToolPanel(e))}closeChartToolPanel(e){return this.assertChart("closeChartToolPanel",()=>this.chartService.closeChartToolPanel(e.chartId))}createRangeChart(e){return this.assertChart("createRangeChart",()=>this.chartService.createRangeChart(e))}createPivotChart(e){return this.assertChart("createPivotChart",()=>this.chartService.createPivotChart(e))}createCrossFilterChart(e){return this.assertChart("createCrossFilterChart",()=>this.chartService.createCrossFilterChart(e))}updateChart(e){return this.assertChart("updateChart",()=>this.chartService.updateChart(e))}restoreChart(e,t){return this.assertChart("restoreChart",()=>this.chartService.restoreChart(e,t))}assertClipboard(e,t){ModuleRegistry.__assertRegistered(ModuleNames.ClipboardModule,"api"+e,this.context.getGridId())&&t()}copyToClipboard(e){this.assertClipboard("copyToClipboard",()=>this.clipboardService.copyToClipboard(e))}cutToClipboard(e){this.assertClipboard("cutToClipboard",()=>this.clipboardService.cutToClipboard(e))}copySelectedRowsToClipboard(e){this.assertClipboard("copySelectedRowsToClipboard",()=>this.clipboardService.copySelectedRowsToClipboard(e))}copySelectedRangeToClipboard(e){this.assertClipboard("copySelectedRangeToClipboard",()=>this.clipboardService.copySelectedRangeToClipboard(e))}copySelectedRangeDown(){this.assertClipboard("copySelectedRangeDown",()=>this.clipboardService.copyRangeDown())}pasteFromClipboard(){this.assertClipboard("pasteFromClipboard",()=>this.clipboardService.pasteFromClipboard())}showColumnMenuAfterButtonClick(e,t){warnOnce("'showColumnMenuAfterButtonClick' is deprecated. Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere.");const i=this.columnModel.getGridColumn(e);this.menuService.showColumnMenu({column:i,buttonElement:t,positionBy:"button"})}showColumnMenuAfterMouseClick(e,t){warnOnce("'showColumnMenuAfterMouseClick' is deprecated. Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere.");let i=this.columnModel.getGridColumn(e);if(i||(i=this.columnModel.getPrimaryColumn(e)),!i){console.error(`AG Grid: column '${e}' not found`);return}this.menuService.showColumnMenu({column:i,mouseEvent:t,positionBy:"mouse"})}showColumnChooser(e){this.menuService.showColumnChooser({chooserParams:e})}showColumnFilter(e){const t=this.columnModel.getGridColumn(e);if(!t){console.error(`AG Grid: column '${e}' not found`);return}this.menuService.showFilterMenu({column:t,containerType:"columnFilter",positionBy:"auto"})}showColumnMenu(e){const t=this.columnModel.getGridColumn(e);if(!t){console.error(`AG Grid: column '${e}' not found`);return}this.menuService.showColumnMenu({column:t,positionBy:"auto"})}hidePopupMenu(){this.menuService.hidePopupMenu()}hideColumnChooser(){this.menuService.hideColumnChooser()}tabToNextCell(e){return this.navigationService.tabToNextCell(!1,e)}tabToPreviousCell(e){return this.navigationService.tabToNextCell(!0,e)}getCellRendererInstances(e={}){return this.rowRenderer.getCellRendererInstances(e).map(unwrapUserComp)}getCellEditorInstances(e={}){return this.rowRenderer.getCellEditorInstances(e).map(unwrapUserComp)}getEditingCells(){return this.rowRenderer.getEditingCells()}stopEditing(e=!1){this.rowRenderer.stopEditing(e)}startEditingCell(e){const t=this.columnModel.getGridColumn(e.colKey);if(!t){console.warn(`AG Grid: no column found for ${e.colKey}`);return}const i={rowIndex:e.rowIndex,rowPinned:e.rowPinned||null,column:t};e.rowPinned==null&&this.ensureIndexVisible(e.rowIndex),this.ensureColumnVisible(e.colKey);const o=this.navigationService.getCellByPosition(i);o&&(this.focusService.isCellFocused(i)||this.focusService.setFocusedCell(i),o.startRowOrCellEdit(e.key))}addAggFunc(e,t){this.logDeprecation("v31.1","addAggFunc(key, func)","addAggFuncs({ key: func })"),this.aggFuncService&&this.aggFuncService.addAggFuncs({key:t})}addAggFuncs(e){this.aggFuncService&&this.aggFuncService.addAggFuncs(e)}clearAggFuncs(){this.aggFuncService&&this.aggFuncService.clear()}applyServerSideTransaction(e){if(!this.serverSideTransactionManager){this.logMissingRowModel("applyServerSideTransaction","serverSide");return}return this.serverSideTransactionManager.applyTransaction(e)}applyServerSideTransactionAsync(e,t){if(!this.serverSideTransactionManager){this.logMissingRowModel("applyServerSideTransactionAsync","serverSide");return}return this.serverSideTransactionManager.applyTransactionAsync(e,t)}applyServerSideRowData(e){var t,i;const n=(t=e.startRow)!==null&&t!==void 0?t:0,o=(i=e.route)!==null&&i!==void 0?i:[];if(n<0){console.warn(`AG Grid: invalid value ${e.startRow} for startRow, the value should be >= 0`);return}this.serverSideRowModel?this.serverSideRowModel.applyRowData(e.successParams,n,o):this.logMissingRowModel("setServerSideDatasource","serverSide")}retryServerSideLoads(){if(!this.serverSideRowModel){this.logMissingRowModel("retryServerSideLoads","serverSide");return}this.serverSideRowModel.retryLoads()}flushServerSideAsyncTransactions(){if(!this.serverSideTransactionManager){this.logMissingRowModel("flushServerSideAsyncTransactions","serverSide");return}return this.serverSideTransactionManager.flushAsyncTransactions()}applyTransaction(e){if(!this.clientSideRowModel){this.logMissingRowModel("applyTransaction","clientSide");return}return this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.updateRowData(e))}applyTransactionAsync(e,t){if(!this.clientSideRowModel){this.logMissingRowModel("applyTransactionAsync","clientSide");return}this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.batchUpdateRowData(e,t))}flushAsyncTransactions(){if(!this.clientSideRowModel){this.logMissingRowModel("flushAsyncTransactions","clientSide");return}this.frameworkOverrides.wrapIncoming(()=>this.clientSideRowModel.flushAsyncTransactions())}refreshInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():this.logMissingRowModel("refreshInfiniteCache","infinite")}purgeInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():this.logMissingRowModel("purgeInfiniteCache","infinite")}refreshServerSide(e){if(!this.serverSideRowModel){this.logMissingRowModel("refreshServerSide","serverSide");return}this.serverSideRowModel.refreshStore(e)}getServerSideGroupLevelState(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(this.logMissingRowModel("getServerSideGroupLevelState","serverSide"),[])}getInfiniteRowCount(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();this.logMissingRowModel("getInfiniteRowCount","infinite")}isLastRowIndexKnown(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();this.logMissingRowModel("isLastRowIndexKnown","infinite")}getCacheBlockState(){return this.rowNodeBlockLoader.getBlockState()}getFirstDisplayedRow(){return this.logDeprecation("v31.1","getFirstDisplayedRow","getFirstDisplayedRowIndex"),this.getFirstDisplayedRowIndex()}getFirstDisplayedRowIndex(){return this.rowRenderer.getFirstVirtualRenderedRow()}getLastDisplayedRow(){return this.logDeprecation("v31.1","getLastDisplayedRow","getLastDisplayedRowIndex"),this.getLastDisplayedRowIndex()}getLastDisplayedRowIndex(){return this.rowRenderer.getLastVirtualRenderedRow()}getDisplayedRowAtIndex(e){return this.rowModel.getRow(e)}getDisplayedRowCount(){return this.rowModel.getRowCount()}paginationIsLastPageFound(){return this.paginationProxy.isLastPageFound()}paginationGetPageSize(){return this.paginationProxy.getPageSize()}paginationGetCurrentPage(){return this.paginationProxy.getCurrentPage()}paginationGetTotalPages(){return this.paginationProxy.getTotalPages()}paginationGetRowCount(){return this.paginationProxy.getMasterRowCount()}paginationGoToNextPage(){this.paginationProxy.goToNextPage()}paginationGoToPreviousPage(){this.paginationProxy.goToPreviousPage()}paginationGoToFirstPage(){this.paginationProxy.goToFirstPage()}paginationGoToLastPage(){this.paginationProxy.goToLastPage()}paginationGoToPage(e){this.paginationProxy.goToPage(e)}sizeColumnsToFit(e){typeof e=="number"?this.columnModel.sizeColumnsToFit(e,"api"):this.gridBodyCtrl.sizeColumnsToFit(e)}setColumnGroupOpened(e,t){this.columnModel.setColumnGroupOpened(e,t,"api")}getColumnGroup(e,t){return this.columnModel.getColumnGroup(e,t)}getProvidedColumnGroup(e){return this.columnModel.getProvidedColumnGroup(e)}getDisplayNameForColumn(e,t){return this.columnModel.getDisplayNameForColumn(e,t)||""}getDisplayNameForColumnGroup(e,t){return this.columnModel.getDisplayNameForColumnGroup(e,t)||""}getColumn(e){return this.columnModel.getPrimaryColumn(e)}getColumns(){return this.columnModel.getAllPrimaryColumns()}applyColumnState(e){return this.columnModel.applyColumnState(e,"api")}getColumnState(){return this.columnModel.getColumnState()}resetColumnState(){this.columnModel.resetColumnState("api")}getColumnGroupState(){return this.columnModel.getColumnGroupState()}setColumnGroupState(e){this.columnModel.setColumnGroupState(e,"api")}resetColumnGroupState(){this.columnModel.resetColumnGroupState("api")}isPinning(){return this.columnModel.isPinningLeft()||this.columnModel.isPinningRight()}isPinningLeft(){return this.columnModel.isPinningLeft()}isPinningRight(){return this.columnModel.isPinningRight()}getDisplayedColAfter(e){return this.columnModel.getDisplayedColAfter(e)}getDisplayedColBefore(e){return this.columnModel.getDisplayedColBefore(e)}setColumnVisible(e,t){this.logDeprecation("v31.1","setColumnVisible(key,visible)","setColumnsVisible([key],visible)"),this.columnModel.setColumnsVisible([e],t,"api")}setColumnsVisible(e,t){this.columnModel.setColumnsVisible(e,t,"api")}setColumnPinned(e,t){this.logDeprecation("v31.1","setColumnPinned(key,pinned)","setColumnsPinned([key],pinned)"),this.columnModel.setColumnsPinned([e],t,"api")}setColumnsPinned(e,t){this.columnModel.setColumnsPinned(e,t,"api")}getAllGridColumns(){return this.columnModel.getAllGridColumns()}getDisplayedLeftColumns(){return this.columnModel.getDisplayedLeftColumns()}getDisplayedCenterColumns(){return this.columnModel.getDisplayedCenterColumns()}getDisplayedRightColumns(){return this.columnModel.getDisplayedRightColumns()}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getAllDisplayedVirtualColumns(){return this.columnModel.getViewportColumns()}moveColumn(e,t){this.logDeprecation("v31.1","moveColumn(key, toIndex)","moveColumns([key], toIndex)"),this.columnModel.moveColumns([e],t,"api")}moveColumnByIndex(e,t){this.columnModel.moveColumnByIndex(e,t,"api")}moveColumns(e,t){this.columnModel.moveColumns(e,t,"api")}moveRowGroupColumn(e,t){this.columnModel.moveRowGroupColumn(e,t,"api")}setColumnAggFunc(e,t){this.columnModel.setColumnAggFunc(e,t,"api")}setColumnWidth(e,t,i=!0,n="api"){this.logDeprecation("v31.1","setColumnWidth(col, width)","setColumnWidths([{key: col, newWidth: width}])"),this.columnModel.setColumnWidths([{key:e,newWidth:t}],!1,i,n)}setColumnWidths(e,t=!0,i="api"){this.columnModel.setColumnWidths(e,!1,t,i)}isPivotMode(){return this.columnModel.isPivotMode()}getPivotResultColumn(e,t){return this.columnModel.getSecondaryPivotColumn(e,t)}setValueColumns(e){this.columnModel.setValueColumns(e,"api")}getValueColumns(){return this.columnModel.getValueColumns()}removeValueColumn(e){this.logDeprecation("v31.1","removeValueColumn(colKey)","removeValueColumns([colKey])"),this.columnModel.removeValueColumns([e],"api")}removeValueColumns(e){this.columnModel.removeValueColumns(e,"api")}addValueColumn(e){this.logDeprecation("v31.1","addValueColumn(colKey)","addValueColumns([colKey])"),this.columnModel.addValueColumns([e],"api")}addValueColumns(e){this.columnModel.addValueColumns(e,"api")}setRowGroupColumns(e){this.columnModel.setRowGroupColumns(e,"api")}removeRowGroupColumn(e){this.logDeprecation("v31.1","removeRowGroupColumn(colKey)","removeRowGroupColumns([colKey])"),this.columnModel.removeRowGroupColumns([e],"api")}removeRowGroupColumns(e){this.columnModel.removeRowGroupColumns(e,"api")}addRowGroupColumn(e){this.logDeprecation("v31.1","addRowGroupColumn(colKey)","addRowGroupColumns([colKey])"),this.columnModel.addRowGroupColumns([e],"api")}addRowGroupColumns(e){this.columnModel.addRowGroupColumns(e,"api")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}setPivotColumns(e){this.columnModel.setPivotColumns(e,"api")}removePivotColumn(e){this.logDeprecation("v31.1","removePivotColumn(colKey)","removePivotColumns([colKey])"),this.columnModel.removePivotColumns([e],"api")}removePivotColumns(e){this.columnModel.removePivotColumns(e,"api")}addPivotColumn(e){this.logDeprecation("v31.1","addPivotColumn(colKey)","addPivotColumns([colKey])"),this.columnModel.addPivotColumns([e],"api")}addPivotColumns(e){this.columnModel.addPivotColumns(e,"api")}getPivotColumns(){return this.columnModel.getPivotColumns()}getLeftDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeLeft()}getCenterDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeCentre()}getRightDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeRight()}getAllDisplayedColumnGroups(){return this.columnModel.getAllDisplayedTrees()}autoSizeColumn(e,t){return this.logDeprecation("v31.1","autoSizeColumn(key, skipHeader)","autoSizeColumns([key], skipHeader)"),this.columnModel.autoSizeColumns({columns:[e],skipHeader:t,source:"api"})}autoSizeColumns(e,t){this.columnModel.autoSizeColumns({columns:e,skipHeader:t,source:"api"})}autoSizeAllColumns(e){this.columnModel.autoSizeAllColumns("api",e)}setPivotResultColumns(e){this.columnModel.setSecondaryColumns(e,"api")}getPivotResultColumns(){return this.columnModel.getSecondaryColumns()}getState(){return this.stateService.getState()}getGridOption(e){return this.gos.get(e)}setGridOption(e,t){this.updateGridOptions({[e]:t})}updateGridOptions(e){this.gos.updateGridOptions({options:e})}__internalUpdateGridOptions(e){this.gos.updateGridOptions({options:e,source:"gridOptionsUpdated"})}deprecatedUpdateGridOption(e,t){warnOnce(`set${e.charAt(0).toUpperCase()}${e.slice(1,e.length)} is deprecated. Please use 'api.setGridOption('${e}', newValue)' or 'api.updateGridOptions({ ${e}: newValue })' instead.`),this.setGridOption(e,t)}setPivotMode(e){this.deprecatedUpdateGridOption("pivotMode",e)}setPinnedTopRowData(e){this.deprecatedUpdateGridOption("pinnedTopRowData",e)}setPinnedBottomRowData(e){this.deprecatedUpdateGridOption("pinnedBottomRowData",e)}setPopupParent(e){this.deprecatedUpdateGridOption("popupParent",e)}setSuppressModelUpdateAfterUpdateTransaction(e){this.deprecatedUpdateGridOption("suppressModelUpdateAfterUpdateTransaction",e)}setDataTypeDefinitions(e){this.deprecatedUpdateGridOption("dataTypeDefinitions",e)}setPagination(e){this.deprecatedUpdateGridOption("pagination",e)}paginationSetPageSize(e){this.deprecatedUpdateGridOption("paginationPageSize",e)}setSideBar(e){this.deprecatedUpdateGridOption("sideBar",e)}setSuppressClipboardPaste(e){this.deprecatedUpdateGridOption("suppressClipboardPaste",e)}setGroupRemoveSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveSingleChildren",e)}setGroupRemoveLowestSingleChildren(e){this.deprecatedUpdateGridOption("groupRemoveLowestSingleChildren",e)}setGroupDisplayType(e){this.deprecatedUpdateGridOption("groupDisplayType",e)}setGroupIncludeFooter(e){this.deprecatedUpdateGridOption("groupIncludeFooter",e)}setGroupIncludeTotalFooter(e){this.deprecatedUpdateGridOption("groupIncludeTotalFooter",e)}setRowClass(e){this.deprecatedUpdateGridOption("rowClass",e)}setDeltaSort(e){this.deprecatedUpdateGridOption("deltaSort",e)}setSuppressRowDrag(e){this.deprecatedUpdateGridOption("suppressRowDrag",e)}setSuppressMoveWhenRowDragging(e){this.deprecatedUpdateGridOption("suppressMoveWhenRowDragging",e)}setSuppressRowClickSelection(e){this.deprecatedUpdateGridOption("suppressRowClickSelection",e)}setEnableAdvancedFilter(e){this.deprecatedUpdateGridOption("enableAdvancedFilter",e)}setIncludeHiddenColumnsInAdvancedFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInAdvancedFilter",e)}setAdvancedFilterParent(e){this.deprecatedUpdateGridOption("advancedFilterParent",e)}setAdvancedFilterBuilderParams(e){this.deprecatedUpdateGridOption("advancedFilterBuilderParams",e)}setQuickFilter(e){warnOnce("setQuickFilter is deprecated. Please use 'api.setGridOption('quickFilterText', newValue)' or 'api.updateGridOptions({ quickFilterText: newValue })' instead."),this.gos.updateGridOptions({options:{quickFilterText:e}})}setExcludeHiddenColumnsFromQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",!e)}setIncludeHiddenColumnsInQuickFilter(e){this.deprecatedUpdateGridOption("includeHiddenColumnsInQuickFilter",e)}setQuickFilterParser(e){this.deprecatedUpdateGridOption("quickFilterParser",e)}setQuickFilterMatcher(e){this.deprecatedUpdateGridOption("quickFilterMatcher",e)}setAlwaysShowHorizontalScroll(e){this.deprecatedUpdateGridOption("alwaysShowHorizontalScroll",e)}setAlwaysShowVerticalScroll(e){this.deprecatedUpdateGridOption("alwaysShowVerticalScroll",e)}setFunctionsReadOnly(e){this.deprecatedUpdateGridOption("functionsReadOnly",e)}setColumnDefs(e,t="api"){warnOnce("setColumnDefs is deprecated. Please use 'api.setGridOption('columnDefs', newValue)' or 'api.updateGridOptions({ columnDefs: newValue })' instead."),this.gos.updateGridOptions({options:{columnDefs:e},source:t})}setAutoGroupColumnDef(e,t="api"){warnOnce("setAutoGroupColumnDef is deprecated. Please use 'api.setGridOption('autoGroupColumnDef', newValue)' or 'api.updateGridOptions({ autoGroupColumnDef: newValue })' instead."),this.gos.updateGridOptions({options:{autoGroupColumnDef:e},source:t})}setDefaultColDef(e,t="api"){warnOnce("setDefaultColDef is deprecated. Please use 'api.setGridOption('defaultColDef', newValue)' or 'api.updateGridOptions({ defaultColDef: newValue })' instead."),this.gos.updateGridOptions({options:{defaultColDef:e},source:t})}setColumnTypes(e,t="api"){warnOnce("setColumnTypes is deprecated. Please use 'api.setGridOption('columnTypes', newValue)' or 'api.updateGridOptions({ columnTypes: newValue })' instead."),this.gos.updateGridOptions({options:{columnTypes:e},source:t})}setTreeData(e){this.deprecatedUpdateGridOption("treeData",e)}setServerSideDatasource(e){this.deprecatedUpdateGridOption("serverSideDatasource",e)}setCacheBlockSize(e){this.deprecatedUpdateGridOption("cacheBlockSize",e)}setDatasource(e){this.deprecatedUpdateGridOption("datasource",e)}setViewportDatasource(e){this.deprecatedUpdateGridOption("viewportDatasource",e)}setRowData(e){this.deprecatedUpdateGridOption("rowData",e)}setEnableCellTextSelection(e){this.deprecatedUpdateGridOption("enableCellTextSelection",e)}setHeaderHeight(e){this.deprecatedUpdateGridOption("headerHeight",e)}setDomLayout(e){this.deprecatedUpdateGridOption("domLayout",e)}setFillHandleDirection(e){this.deprecatedUpdateGridOption("fillHandleDirection",e)}setGroupHeaderHeight(e){this.deprecatedUpdateGridOption("groupHeaderHeight",e)}setFloatingFiltersHeight(e){this.deprecatedUpdateGridOption("floatingFiltersHeight",e)}setPivotHeaderHeight(e){this.deprecatedUpdateGridOption("pivotHeaderHeight",e)}setPivotGroupHeaderHeight(e){this.deprecatedUpdateGridOption("pivotGroupHeaderHeight",e)}setAnimateRows(e){this.deprecatedUpdateGridOption("animateRows",e)}setIsExternalFilterPresent(e){this.deprecatedUpdateGridOption("isExternalFilterPresent",e)}setDoesExternalFilterPass(e){this.deprecatedUpdateGridOption("doesExternalFilterPass",e)}setNavigateToNextCell(e){this.deprecatedUpdateGridOption("navigateToNextCell",e)}setTabToNextCell(e){this.deprecatedUpdateGridOption("tabToNextCell",e)}setTabToNextHeader(e){this.deprecatedUpdateGridOption("tabToNextHeader",e)}setNavigateToNextHeader(e){this.deprecatedUpdateGridOption("navigateToNextHeader",e)}setRowGroupPanelShow(e){this.deprecatedUpdateGridOption("rowGroupPanelShow",e)}setGetGroupRowAgg(e){this.deprecatedUpdateGridOption("getGroupRowAgg",e)}setGetBusinessKeyForNode(e){this.deprecatedUpdateGridOption("getBusinessKeyForNode",e)}setGetChildCount(e){this.deprecatedUpdateGridOption("getChildCount",e)}setProcessRowPostCreate(e){this.deprecatedUpdateGridOption("processRowPostCreate",e)}setGetRowId(e){warnOnce("getRowId is a static property and can no longer be updated.")}setGetRowClass(e){this.deprecatedUpdateGridOption("getRowClass",e)}setIsFullWidthRow(e){this.deprecatedUpdateGridOption("isFullWidthRow",e)}setIsRowSelectable(e){this.deprecatedUpdateGridOption("isRowSelectable",e)}setIsRowMaster(e){this.deprecatedUpdateGridOption("isRowMaster",e)}setPostSortRows(e){this.deprecatedUpdateGridOption("postSortRows",e)}setGetDocument(e){this.deprecatedUpdateGridOption("getDocument",e)}setGetContextMenuItems(e){this.deprecatedUpdateGridOption("getContextMenuItems",e)}setGetMainMenuItems(e){this.deprecatedUpdateGridOption("getMainMenuItems",e)}setProcessCellForClipboard(e){this.deprecatedUpdateGridOption("processCellForClipboard",e)}setSendToClipboard(e){this.deprecatedUpdateGridOption("sendToClipboard",e)}setProcessCellFromClipboard(e){this.deprecatedUpdateGridOption("processCellFromClipboard",e)}setProcessPivotResultColDef(e){this.deprecatedUpdateGridOption("processPivotResultColDef",e)}setProcessPivotResultColGroupDef(e){this.deprecatedUpdateGridOption("processPivotResultColGroupDef",e)}setPostProcessPopup(e){this.deprecatedUpdateGridOption("postProcessPopup",e)}setInitialGroupOrderComparator(e){this.deprecatedUpdateGridOption("initialGroupOrderComparator",e)}setGetChartToolbarItems(e){this.deprecatedUpdateGridOption("getChartToolbarItems",e)}setPaginationNumberFormatter(e){this.deprecatedUpdateGridOption("paginationNumberFormatter",e)}setGetServerSideGroupLevelParams(e){this.deprecatedUpdateGridOption("getServerSideGroupLevelParams",e)}setIsServerSideGroupOpenByDefault(e){this.deprecatedUpdateGridOption("isServerSideGroupOpenByDefault",e)}setIsApplyServerSideTransaction(e){this.deprecatedUpdateGridOption("isApplyServerSideTransaction",e)}setIsServerSideGroup(e){this.deprecatedUpdateGridOption("isServerSideGroup",e)}setGetServerSideGroupKey(e){this.deprecatedUpdateGridOption("getServerSideGroupKey",e)}setGetRowStyle(e){this.deprecatedUpdateGridOption("getRowStyle",e)}setGetRowHeight(e){this.deprecatedUpdateGridOption("getRowHeight",e)}};__decorate$1X([Optional("csvCreator")],GridApi.prototype,"csvCreator",void 0);__decorate$1X([Optional("excelCreator")],GridApi.prototype,"excelCreator",void 0);__decorate$1X([Autowired("rowRenderer")],GridApi.prototype,"rowRenderer",void 0);__decorate$1X([Autowired("navigationService")],GridApi.prototype,"navigationService",void 0);__decorate$1X([Autowired("filterManager")],GridApi.prototype,"filterManager",void 0);__decorate$1X([Autowired("columnModel")],GridApi.prototype,"columnModel",void 0);__decorate$1X([Autowired("selectionService")],GridApi.prototype,"selectionService",void 0);__decorate$1X([Autowired("gridOptionsService")],GridApi.prototype,"gos",void 0);__decorate$1X([Autowired("valueService")],GridApi.prototype,"valueService",void 0);__decorate$1X([Autowired("alignedGridsService")],GridApi.prototype,"alignedGridsService",void 0);__decorate$1X([Autowired("eventService")],GridApi.prototype,"eventService",void 0);__decorate$1X([Autowired("pinnedRowModel")],GridApi.prototype,"pinnedRowModel",void 0);__decorate$1X([Autowired("context")],GridApi.prototype,"context",void 0);__decorate$1X([Autowired("rowModel")],GridApi.prototype,"rowModel",void 0);__decorate$1X([Autowired("sortController")],GridApi.prototype,"sortController",void 0);__decorate$1X([Autowired("paginationProxy")],GridApi.prototype,"paginationProxy",void 0);__decorate$1X([Autowired("focusService")],GridApi.prototype,"focusService",void 0);__decorate$1X([Autowired("dragAndDropService")],GridApi.prototype,"dragAndDropService",void 0);__decorate$1X([Optional("rangeService")],GridApi.prototype,"rangeService",void 0);__decorate$1X([Optional("clipboardService")],GridApi.prototype,"clipboardService",void 0);__decorate$1X([Optional("aggFuncService")],GridApi.prototype,"aggFuncService",void 0);__decorate$1X([Autowired("menuService")],GridApi.prototype,"menuService",void 0);__decorate$1X([Autowired("valueCache")],GridApi.prototype,"valueCache",void 0);__decorate$1X([Autowired("animationFrameService")],GridApi.prototype,"animationFrameService",void 0);__decorate$1X([Optional("statusBarService")],GridApi.prototype,"statusBarService",void 0);__decorate$1X([Optional("chartService")],GridApi.prototype,"chartService",void 0);__decorate$1X([Optional("undoRedoService")],GridApi.prototype,"undoRedoService",void 0);__decorate$1X([Optional("rowNodeBlockLoader")],GridApi.prototype,"rowNodeBlockLoader",void 0);__decorate$1X([Optional("ssrmTransactionManager")],GridApi.prototype,"serverSideTransactionManager",void 0);__decorate$1X([Autowired("ctrlsService")],GridApi.prototype,"ctrlsService",void 0);__decorate$1X([Autowired("overlayService")],GridApi.prototype,"overlayService",void 0);__decorate$1X([Optional("sideBarService")],GridApi.prototype,"sideBarService",void 0);__decorate$1X([Autowired("stateService")],GridApi.prototype,"stateService",void 0);__decorate$1X([Autowired("expansionService")],GridApi.prototype,"expansionService",void 0);__decorate$1X([Autowired("apiEventService")],GridApi.prototype,"apiEventService",void 0);__decorate$1X([Autowired("frameworkOverrides")],GridApi.prototype,"frameworkOverrides",void 0);__decorate$1X([PostConstruct],GridApi.prototype,"init",null);GridApi=__decorate$1X([Bean("gridApi")],GridApi);var __decorate$1W=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},QuickFilterService_1;let QuickFilterService=QuickFilterService_1=class extends BeanStub{constructor(){super(...arguments),this.quickFilter=null,this.quickFilterParts=null}postConstruct(){this.addManagedListener(this.eventService,Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,Events.EVENT_NEW_COLUMNS_LOADED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_VISIBLE,()=>{this.gridOptionsService.get("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}),this.addManagedPropertyListener("quickFilterText",e=>this.setQuickFilter(e.currentValue)),this.addManagedPropertyListener("includeHiddenColumnsInQuickFilter",()=>this.onIncludeHiddenColumnsInQuickFilterChanged()),this.quickFilter=this.parseQuickFilter(this.gridOptionsService.get("quickFilterText")),this.parser=this.gridOptionsService.get("quickFilterParser"),this.matcher=this.gridOptionsService.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setQuickFilterParserAndMatcher())}isQuickFilterPresent(){return this.quickFilter!==null}doesRowPassQuickFilter(e){const t=this.gridOptionsService.get("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every(i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i))}resetQuickFilterCache(){this.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseQuickFilter(e){return exists(e)?this.gridOptionsService.isRowModelType("clientSide")?e.toUpperCase():(console.warn("AG Grid - Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(e!=null&&typeof e!="string"){console.warn(`AG Grid - Grid option quickFilterText only supports string inputs, received: ${typeof e}`);return}const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchEvent({type:QuickFilterService_1.EVENT_QUICK_FILTER_CHANGED}))}setQuickFilterParserAndMatcher(){const e=this.gridOptionsService.get("quickFilterParser"),t=this.gridOptionsService.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchEvent({type:QuickFilterService_1.EVENT_QUICK_FILTER_CHANGED}))}onIncludeHiddenColumnsInQuickFilterChanged(){this.columnModel.refreshQuickFilterColumns(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchEvent({type:QuickFilterService_1.EVENT_QUICK_FILTER_CHANGED})}doesRowPassQuickFilterNoCache(e,t){return this.columnModel.getAllColumnsForQuickFilter().some(n=>{const o=this.getQuickFilterTextForColumn(n,e);return exists(o)&&o.indexOf(t)>=0})}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:n,matcher:o}=this;return o(n,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,t){let i=this.valueService.getValue(e,t,!0);const n=e.getColDef();if(n.getQuickFilterText){const o=this.gridOptionsService.addGridCommonParams({value:i,node:t,data:t.data,column:e,colDef:n});i=n.getQuickFilterText(o)}return exists(i)?i.toString().toUpperCase():null}getQuickFilterAggregateText(e){const t=[];return this.columnModel.getAllColumnsForQuickFilter().forEach(n=>{const o=this.getQuickFilterTextForColumn(n,e);exists(o)&&t.push(o)}),t.join(QuickFilterService_1.QUICK_FILTER_SEPARATOR)}};QuickFilterService.EVENT_QUICK_FILTER_CHANGED="quickFilterChanged";QuickFilterService.QUICK_FILTER_SEPARATOR=`
|
||
`;__decorate$1W([Autowired("valueService")],QuickFilterService.prototype,"valueService",void 0);__decorate$1W([Autowired("columnModel")],QuickFilterService.prototype,"columnModel",void 0);__decorate$1W([Autowired("rowModel")],QuickFilterService.prototype,"rowModel",void 0);__decorate$1W([PostConstruct],QuickFilterService.prototype,"postConstruct",null);QuickFilterService=QuickFilterService_1=__decorate$1W([Bean("quickFilterService")],QuickFilterService);var __decorate$1V=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let FilterManager=class extends BeanStub{constructor(){super(...arguments),this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue=[]}init(){var e,t,i;this.addManagedListener(this.eventService,Events.EVENT_GRID_COLUMNS_CHANGED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_VALUE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_PIVOT_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,Events.EVENT_NEW_COLUMNS_LOADED,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_VISIBLE,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,Events.EVENT_ROW_DATA_UPDATED,()=>this.onNewRowsLoaded("rowDataUpdated")),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.addManagedPropertyListener("advancedFilterModel",n=>this.setAdvancedFilterModel(n.currentValue)),this.addManagedListener(this.eventService,Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,({enabled:n})=>this.onAdvancedFilterEnabledChanged(n)),this.addManagedListener(this.eventService,Events.EVENT_DATA_TYPES_INFERRED,()=>this.processFilterModelUpdateQueue()),this.addManagedListener(this.quickFilterService,QuickFilterService.EVENT_QUICK_FILTER_CHANGED,()=>this.onFilterChanged({source:"quickFilter"})),this.initialFilterModel=Object.assign({},(i=(t=(e=this.gridOptionsService.get("initialState"))===null||e===void 0?void 0:e.filter)===null||t===void 0?void 0:t.filterModel)!==null&&i!==void 0?i:{})}isExternalFilterPresentCallback(){const e=this.gridOptionsService.getCallback("isExternalFilterPresent");return typeof e=="function"?e({}):!1}doesExternalFilterPass(e){const t=this.gridOptionsService.get("doesExternalFilterPass");return typeof t=="function"?t(e):!1}setFilterModel(e,t="api"){if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}if(this.dataTypeService.isPendingInference()){this.filterModelUpdateQueue.push({model:e,source:t});return}const i=[],n=this.getFilterModel();if(e){const o=convertToSet(Object.keys(e));this.allColumnFilters.forEach((r,a)=>{const l=e[a];i.push(this.setModelOnFilterWrapper(r.filterPromise,l)),o.delete(a)}),o.forEach(r=>{const a=this.columnModel.getPrimaryColumn(r)||this.columnModel.getGridColumn(r);if(!a){console.warn("AG Grid: setFilterModel() - no column found for colId: "+r);return}if(!a.isFilterAllowed()){console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+r);return}const l=this.getOrCreateFilterWrapper(a,"NO_UI");if(!l){console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+r);return}i.push(this.setModelOnFilterWrapper(l.filterPromise,e[r]))})}else this.allColumnFilters.forEach(o=>{i.push(this.setModelOnFilterWrapper(o.filterPromise,null))});AgPromise.all(i).then(()=>{const o=this.getFilterModel(),r=[];this.allColumnFilters.forEach((a,l)=>{const d=n?n[l]:null,h=o?o[l]:null;_.jsonEquals(d,h)||r.push(a.column)}),r.length>0&&this.onFilterChanged({columns:r,source:t})})}setModelOnFilterWrapper(e,t){return new AgPromise(i=>{e.then(n=>{typeof n.setModel!="function"&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),i()),(n.setModel(t)||AgPromise.resolve()).then(()=>i())})})}getFilterModel(){const e={};return this.allColumnFilters.forEach((t,i)=>{const n=this.getModelFromFilterWrapper(t);exists(n)&&(e[i]=n)}),e}getModelFromFilterWrapper(e){var t;const n=e.filterPromise.resolveNow(null,o=>o);return n==null?(t=this.initialFilterModel[e.column.getColId()])!==null&&t!==void 0?t:null:typeof n.getModel!="function"?(console.warn("AG Grid: filter API missing getModel method, which is needed for getFilterModel"),null):n.getModel()}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){var t;e?this.allColumnFilters.size&&(this.allColumnFilters.forEach(i=>this.disposeFilterWrapper(i,"advancedFilterEnabled")),this.onFilterChanged({source:"advancedFilter"})):!((t=this.advancedFilterService)===null||t===void 0)&&t.isFilterPresent()&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var e;return(e=this.advancedFilterService)===null||e===void 0?void 0:e.isEnabled()}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;const e=n=>n?n.isFilterActive?n.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1):!1,t=!!this.gridOptionsService.getGroupAggFiltering(),i=n=>{if(!n.isPrimary())return!0;const r=!this.columnModel.isPivotActive();return!n.isValueActive()||!r?!1:this.columnModel.isPivotMode()?!0:t};this.allColumnFilters.forEach(n=>{if(n.filterPromise.resolveNow(!1,e)){const o=n.filterPromise.resolveNow(null,r=>r);i(n.column)?this.activeAggregateFilters.push(o):this.activeColumnFilters.push(o)}})}updateFilterFlagInColumns(e,t){this.allColumnFilters.forEach(i=>{const n=i.filterPromise.resolveNow(!1,o=>o.isFilterActive());i.column.setFilterActive(n,e,t)})}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}doColumnFiltersPass(e,t,i){const{data:n,aggData:o}=e,r=i?this.activeAggregateFilters:this.activeColumnFilters,a=i?o:n;for(let l=0;l<r.length;l++){const d=r[l];if(!(d==null||d===t)){if(typeof d.doesFilterPass!="function")throw new Error("Filter is missing method doesFilterPass");if(!d.doesFilterPass({node:e,data:a}))return!1}}return!0}resetQuickFilterCache(){this.quickFilterService.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gridOptionsService.getGroupAggFiltering()&&this.onFilterChanged()}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}onFilterChanged(e={}){const{source:t,filterInstance:i,additionalEventAttributes:n,columns:o}=e;this.updateDependantFilters(),this.updateActiveFilters(),this.updateFilterFlagInColumns("filterChanged",n),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.allColumnFilters.forEach(a=>{a.filterPromise&&a.filterPromise.then(l=>{l&&l!==i&&l.onAnyFilterChanged&&l.onAnyFilterChanged()})});const r={source:t,type:Events.EVENT_FILTER_CHANGED,columns:o||[]};n&&mergeDeep(r,n),this.processingFilterChange=!0,this.eventService.dispatchEvent(r),this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){var e;return!((e=this.gridOptionsService.get("allowShowChangeAfterFilter"))!==null&&e!==void 0?e:!1)&&this.processingFilterChange}isQuickFilterPresent(){return this.quickFilterService.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gridOptionsService.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&(this.aggFiltering||this.columnModel.isPivotMode())}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!(this.aggFiltering||this.columnModel.isPivotMode())}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))}onNewRowsLoaded(e){this.allColumnFilters.forEach(t=>{t.filterPromise.then(i=>{i.onNewRowsLoaded&&i.onNewRowsLoaded()})}),this.updateFilterFlagInColumns(e,{afterDataChange:!0}),this.updateActiveFilters()}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const n=i?this.columnModel.getGridColumn(i):e;return n?this.valueService.getValue(n,t,!0):void 0}}getFilterComponent(e,t,i=!0){var n;if(i)return((n=this.getOrCreateFilterWrapper(e,t))===null||n===void 0?void 0:n.filterPromise)||null;const o=this.cachedFilter(e);return o?o.filterPromise:null}isFilterActive(e){const t=this.cachedFilter(e);return!!t&&t.filterPromise.resolveNow(!1,i=>i.isFilterActive())}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return null;let i=this.cachedFilter(e);return i?t!=="NO_UI"&&this.putIntoGui(i,t):(i=this.createFilterWrapper(e,t),this.setColumnFilterWrapper(e,i)),i}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(ModuleRegistry.__isRegistered(ModuleNames.SetFilterModule,this.context.getGridId()))t="agSetColumnFilter";else{const i=this.dataTypeService.getBaseDataType(e);i==="number"?t="agNumberColumnFilter":i==="date"||i==="dateString"?t="agDateColumnFilter":t="agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(ModuleRegistry.__isRegistered(ModuleNames.SetFilterModule,this.context.getGridId()))t="agSetColumnFloatingFilter";else{const i=this.dataTypeService.getBaseDataType(e);i==="number"?t="agNumberColumnFloatingFilter":i==="date"||i==="dateString"?t="agDateColumnFloatingFilter":t="agTextColumnFloatingFilter"}return t}createFilterInstance(e){const t=this.getDefaultFilter(e),i=e.getColDef();let n;const o=Object.assign(Object.assign({},this.createFilterParams(e,i)),{filterModifiedCallback:()=>this.filterModifiedCallbackFactory(n,e)(),filterChangedCallback:a=>this.filterChangedCallbackFactory(n,e)(a),doesRowPassOtherFilter:a=>this.doesRowPassOtherFilters(n,a)}),r=this.userComponentFactory.getFilterDetails(i,o,t);return r?{filterPromise:()=>{const a=r.newAgStackInstance();return a&&a.then(l=>n=l),a},compDetails:r}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gridOptionsService.addGridCommonParams({column:e,colDef:cloneObject(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e,t){var i;const n={column:e,filterPromise:null,compiledElement:null,guiPromise:AgPromise.resolve(null),compDetails:null},{filterPromise:o,compDetails:r}=this.createFilterInstance(e);return n.filterPromise=(i=o==null?void 0:o())!==null&&i!==void 0?i:null,n.compDetails=r,o&&this.putIntoGui(n,t),n}putIntoGui(e,t){const i=document.createElement("div");i.className="ag-filter",e.guiPromise=new AgPromise(n=>{e.filterPromise.then(o=>{let r=o.getGui();exists(r)||console.warn(`AG Grid: getGui method from filter returned ${r}, it should be a DOM element or an HTML template string.`),typeof r=="string"&&(r=loadTemplate(r)),i.appendChild(r),n(i);const a={type:Events.EVENT_FILTER_OPENED,column:e.column,source:t,eGui:i};this.eventService.dispatchEvent(a)})})}onColumnsChanged(){const e=[];this.allColumnFilters.forEach((t,i)=>{let n;t.column.isPrimary()?n=this.columnModel.getPrimaryColumn(i):n=this.columnModel.getGridColumn(i),!n&&(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))}),e.length>0?this.onFilterChanged({columns:e,source:"api"}):this.updateDependantFilters()}updateDependantFilters(){const e=this.columnModel.getGroupAutoColumns();e==null||e.forEach(t=>{t.getColDef().filter==="agGroupColumnFilter"&&this.getOrCreateFilterWrapper(t,"NO_UI")})}isFilterAllowed(e){var t,i;if(this.isAdvancedFilterEnabled()||!e.isFilterAllowed())return!1;const o=this.allColumnFilters.get(e.getColId());return(i=(t=o==null?void 0:o.filterPromise)===null||t===void 0?void 0:t.resolveNow(!0,r=>typeof(r==null?void 0:r.isFilterAllowed)=="function"?r==null?void 0:r.isFilterAllowed():!0))!==null&&i!==void 0?i:!0}getFloatingFilterCompDetails(e,t){const i=d=>{const h=this.getFilterComponent(e,"NO_UI");h!=null&&h.then(p=>{d(unwrapUserComp(p))})},n=e.getColDef(),o=Object.assign(Object.assign({},this.createFilterParams(e,n)),{filterChangedCallback:()=>i(d=>this.filterChangedCallbackFactory(d,e)())}),r=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(n,FilterComponent,o);let a=this.userComponentFactory.getDefaultFloatingFilterType(n,()=>this.getDefaultFloatingFilter(e));a==null&&(a="agReadOnlyFloatingFilter");const l={column:e,filterParams:r,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(n,l,a)}getCurrentFloatingFilterParentModel(e){const t=this.getFilterComponent(e,"NO_UI",!1);return t?t.resolveNow(null,i=>i&&i.getModel()):null}destroyFilter(e,t="api"){const i=e.getColId(),n=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],n&&(this.disposeFilterWrapper(n,t),this.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{this.getContext().destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const n={type:Events.EVENT_FILTER_DESTROYED,source:t,column:e.column};this.eventService.dispatchEvent(n)})}filterModifiedCallbackFactory(e,t){return()=>{const i={type:Events.EVENT_FILTER_MODIFIED,column:t,filterInstance:e};this.eventService.dispatchEvent(i)}}filterChangedCallbackFactory(e,t){return i=>{var n;const o=(n=i==null?void 0:i.source)!==null&&n!==void 0?n:"api",r={filter:e,additionalEventAttributes:i,columns:[t],source:o};this.callOnFilterChangedOutsideRenderCycle(r)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:n}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,n)){this.destroyFilter(i,"paramsUpdated");return}const o=i.getColDef().filterParams;if(!t.filterPromise){this.destroyFilter(i,"paramsUpdated");return}t.filterPromise.then(r=>{(r!=null&&r.refresh?r.refresh(Object.assign(Object.assign(Object.assign({},this.createFilterParams(i,i.getColDef())),{filterModifiedCallback:this.filterModifiedCallbackFactory(r,i),filterChangedCallback:this.filterChangedCallbackFactory(r,i),doesRowPassOtherFilter:l=>this.doesRowPassOtherFilters(r,l)}),o)):!0)===!1&&this.destroyFilter(i,"paramsUpdated")})}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListener(e,Column.EVENT_COL_DEF_CHANGED,()=>this.checkDestroyFilter(i)))}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:n}=t;return!(i===n||(i==null?void 0:i.render)&&(n==null?void 0:n.render)&&i.render===n.render)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){if(this.isAdvancedFilterEnabled()){if(this.dataTypeService.isPendingInference()){this.advancedFilterModelUpdateQueue.push(e);return}this.advancedFilterService.setModel(e??null),this.onFilterChanged({source:"advancedFilter"})}}showAdvancedFilterBuilder(e){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(e,!0)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return this.isAdvancedFilterEnabled()?!1:this.columnModel.getAllGridColumns().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e,t){if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}const i=this.getFilterInstanceImpl(e,o=>{if(!t)return;const r=unwrapUserComp(o);t(r)});return unwrapUserComp(i)}getColumnFilterInstance(e){return new Promise(t=>{this.getFilterInstance(e,i=>{t(i)})})}getFilterInstanceImpl(e,t){const i=this.columnModel.getPrimaryColumn(e);if(!i)return;const n=this.getFilterComponent(i,"NO_UI"),o=n&&n.resolveNow(null,r=>r);return o?setTimeout(t,0,o):n&&n.then(r=>{t(r)}),o}warnAdvancedFilters(){warnOnce("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){var t;(t=this.advancedFilterService)===null||t===void 0||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:e,source:t})=>this.setFilterModel(e,t)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then(()=>i())}),this.columnFilterModelUpdateQueue=[],this.advancedFilterModelUpdateQueue.forEach(e=>this.setAdvancedFilterModel(e)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){if(this.isAdvancedFilterEnabled())return this.warnAdvancedFilters(),Promise.resolve();if(this.dataTypeService.isPendingInference()){let r=()=>{};const a=new Promise(l=>{r=l});return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:r}),a}const i=this.columnModel.getPrimaryColumn(e),n=i?this.getOrCreateFilterWrapper(i,"NO_UI"):null;return n?(r=>new Promise(a=>{r.then(l=>a(l))}))(this.setModelOnFilterWrapper(n.filterPromise,t)):Promise.resolve()}getFilterWrapper(e){var t;const i=this.columnModel.getPrimaryColumn(e);return i&&(t=this.cachedFilter(i))!==null&&t!==void 0?t:null}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};__decorate$1V([Autowired("valueService")],FilterManager.prototype,"valueService",void 0);__decorate$1V([Autowired("columnModel")],FilterManager.prototype,"columnModel",void 0);__decorate$1V([Autowired("rowModel")],FilterManager.prototype,"rowModel",void 0);__decorate$1V([Autowired("userComponentFactory")],FilterManager.prototype,"userComponentFactory",void 0);__decorate$1V([Autowired("rowRenderer")],FilterManager.prototype,"rowRenderer",void 0);__decorate$1V([Autowired("dataTypeService")],FilterManager.prototype,"dataTypeService",void 0);__decorate$1V([Autowired("quickFilterService")],FilterManager.prototype,"quickFilterService",void 0);__decorate$1V([Optional("advancedFilterService")],FilterManager.prototype,"advancedFilterService",void 0);__decorate$1V([PostConstruct],FilterManager.prototype,"init",null);FilterManager=__decorate$1V([Bean("filterManager")],FilterManager);class AbstractHeaderCellComp extends Component{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}}var __decorate$1U=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class HeaderFilterCellComp extends AbstractHeaderCellComp{constructor(e){super(HeaderFilterCellComp.TEMPLATE,e)}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(i,n)=>this.addOrRemoveCssClass(i,n),addOrRemoveBodyCssClass:(i,n)=>this.eFloatingFilterBody.classList.toggle(i,n),setButtonWrapperDisplayed:i=>setDisplayed(this.eButtonWrapper,i),setCompDetails:i=>this.setCompDetails(i),getFloatingFilterComp:()=>this.compPromise,setWidth:i=>e.style.width=i,setMenuIcon:i=>this.eButtonShowMainFilter.appendChild(i)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(e){if(!e){this.destroyFloatingFilterComp(),this.compPromise=null;return}this.compPromise=e.newAgStackInstance(),this.compPromise.then(t=>this.afterCompCreated(t))}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){if(e){if(!this.isAlive()){this.destroyBean(e);return}this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()}}}HeaderFilterCellComp.TEMPLATE=`<div class="ag-header-cell ag-floating-filter" role="gridcell">
|
||
<div ref="eFloatingFilterBody" role="presentation"></div>
|
||
<div class="ag-floating-filter-button ag-hidden" ref="eButtonWrapper" role="presentation">
|
||
<button type="button" class="ag-button ag-floating-filter-button-button" ref="eButtonShowMainFilter" tabindex="-1"></button>
|
||
</div>
|
||
</div>`;__decorate$1U([RefSelector("eFloatingFilterBody")],HeaderFilterCellComp.prototype,"eFloatingFilterBody",void 0);__decorate$1U([RefSelector("eButtonWrapper")],HeaderFilterCellComp.prototype,"eButtonWrapper",void 0);__decorate$1U([RefSelector("eButtonShowMainFilter")],HeaderFilterCellComp.prototype,"eButtonShowMainFilter",void 0);__decorate$1U([PostConstruct],HeaderFilterCellComp.prototype,"postConstruct",null);__decorate$1U([PreDestroy],HeaderFilterCellComp.prototype,"destroyFloatingFilterComp",null);var __decorate$1T=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},LayoutCssClasses;(function(s){s.AUTO_HEIGHT="ag-layout-auto-height",s.NORMAL="ag-layout-normal",s.PRINT="ag-layout-print"})(LayoutCssClasses||(LayoutCssClasses={}));class LayoutFeature extends BeanStub{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:e==="autoHeight",normal:e==="normal",print:e==="print"},i=t.autoHeight?LayoutCssClasses.AUTO_HEIGHT:t.print?LayoutCssClasses.PRINT:LayoutCssClasses.NORMAL;this.view.updateLayoutClasses(i,t)}getDomLayout(){var e;const t=(e=this.gridOptionsService.get("domLayout"))!==null&&e!==void 0?e:"normal";return["normal","print","autoHeight"].indexOf(t)===-1?(warnOnce(`${t} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):t}}__decorate$1T([PostConstruct],LayoutFeature.prototype,"postConstruct",null);var __decorate$1S=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},ScrollDirection;(function(s){s[s.Vertical=0]="Vertical",s[s.Horizontal=1]="Horizontal"})(ScrollDirection||(ScrollDirection={}));var ScrollSource;(function(s){s[s.Container=0]="Container",s[s.FakeContainer=1]="FakeContainer"})(ScrollSource||(ScrollSource={}));class GridBodyScrollFeature extends BeanStub{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=debounce(()=>this.lastScrollSource[ScrollDirection.Horizontal]=null,500),this.resetLastVScrollDebounced=debounce(()=>this.lastScrollSource[ScrollDirection.Vertical]=null,500)}postConstruct(){this.enableRtl=this.gridOptionsService.get("enableRtl"),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.centerRowContainerCtrl,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){const e=this.ctrlsService.getFakeHScrollComp(),t=this.ctrlsService.getFakeVScrollComp();this.addManagedListener(this.centerRowContainerCtrl.getViewportElement(),"scroll",this.onHScroll.bind(this)),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gridOptionsService.get("debounceVerticalScrollbar"),n=i?debounce(this.onVScroll.bind(this),100):this.onVScroll.bind(this),o=i?debounce(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",n),t.onScrollCallback(o)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(this.centerRowContainerCtrl==null)return;e===void 0&&(e=this.centerRowContainerCtrl.getCenterViewportScrollLeft());const i=this.enableRtl?e:-e,n=this.ctrlsService.getTopCenterRowContainerCtrl(),o=this.ctrlsService.getStickyTopCenterRowContainerCtrl(),r=this.ctrlsService.getBottomCenterRowContainerCtrl(),a=this.ctrlsService.getFakeHScrollComp();this.ctrlsService.getHeaderRowContainerCtrl().setHorizontalScroll(-i),r.setContainerTranslateX(i),n.setContainerTranslateX(i),o.setContainerTranslateX(i);const d=this.centerRowContainerCtrl.getViewportElement(),h=this.lastScrollSource[ScrollDirection.Horizontal]===ScrollSource.Container;e=Math.abs(e),h?a.setScrollPosition(e):setScrollLeft(d,e,this.enableRtl)}isControllingScroll(e,t){return this.lastScrollSource[t]==null?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(ScrollSource.FakeContainer,ScrollDirection.Horizontal)&&this.onHScrollCommon(ScrollSource.FakeContainer)}onHScroll(){this.isControllingScroll(ScrollSource.Container,ScrollDirection.Horizontal)&&this.onHScrollCommon(ScrollSource.Container)}onHScrollCommon(e){const t=this.centerRowContainerCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(ScrollDirection.Horizontal,i,!0))return;let n;e===ScrollSource.Container?n=getScrollLeft(t,this.enableRtl):n=this.ctrlsService.getFakeHScrollComp().getScrollPosition(),this.doHorizontalScroll(Math.round(n)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(ScrollSource.FakeContainer,ScrollDirection.Vertical)&&this.onVScrollCommon(ScrollSource.FakeContainer)}onVScroll(){this.isControllingScroll(ScrollSource.Container,ScrollDirection.Vertical)&&this.onVScrollCommon(ScrollSource.Container)}onVScrollCommon(e){let t;e===ScrollSource.Container?t=this.eBodyViewport.scrollTop:t=this.ctrlsService.getFakeVScrollComp().getScrollPosition(),!this.shouldBlockScrollUpdate(ScrollDirection.Vertical,t,!0)&&(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,e===ScrollSource.Container?this.ctrlsService.getFakeVScrollComp().setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gridOptionsService.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.getFakeHScrollComp().getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(ScrollDirection.Horizontal),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowContainerCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:Events.EVENT_BODY_SCROLL,direction:e===ScrollDirection.Horizontal?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{const i=Object.assign(Object.assign({},t),{type:Events.EVENT_BODY_SCROLL_END});this.eventService.dispatchEvent(i)},100)}shouldBlockScrollUpdate(e,t,i=!1){return i&&!isIOSUserAgent()?!1:e===ScrollDirection.Vertical?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=getInnerHeight(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowContainerCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowContainerCtrl.getViewportElement();if(this.enableRtl&&isRtlNegativeScroll()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(ScrollDirection.Vertical)}checkScrollLeft(){this.scrollLeft!==this.centerRowContainerCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(ScrollSource.Container)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const n=this.centerRowContainerCtrl.getViewportElement().scrollWidth-this.centerRowContainerCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(ScrollDirection.Horizontal,e)&&(this.enableRtl&&isRtlNegativeScroll()?e=e>0?0:n:e=Math.min(Math.max(e,0),n)),setScrollLeft(this.centerRowContainerCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowContainerCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowContainerCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowContainerCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowContainerCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let n=-1;for(let o=0;o<i;o++){const r=this.rowModel.getRow(o);if(typeof e=="function"){if(r&&e(r)){n=o;break}}else if(e===r||e===r.data){n=o;break}}n>=0&&this.ensureIndexVisible(n,t)}ensureIndexVisible(e,t){if(this.gridOptionsService.isDomLayout("print"))return;const i=this.paginationProxy.getRowCount();if(typeof e!="number"||e<0||e>=i){console.warn("AG Grid: Invalid row index for ensureIndexVisible: "+e);return}const o=this.gridOptionsService.get("pagination")&&!this.gridOptionsService.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{o||this.paginationProxy.goToPageWithIndex(e);const a=this.ctrlsService.getGridBodyCtrl().getStickyTopHeight(),l=this.paginationProxy.getRow(e);let d;do{const h=l.rowTop,p=l.rowHeight,m=this.paginationProxy.getPixelOffset(),v=l.rowTop-m,y=v+l.rowHeight,b=this.getVScrollPosition(),S=this.heightScaler.getDivStretchOffset(),E=b.top+S,T=b.bottom+S,R=T-E,A=this.heightScaler.getScrollPositionForPixel(v),D=this.heightScaler.getScrollPositionForPixel(y-R),x=Math.min((A+D)/2,v),M=E+a>v,I=T<y;let V=null;t==="top"?V=A:t==="bottom"?V=D:t==="middle"?V=x:M?V=A-a:I&&(V=D),V!==null&&(this.setVerticalScrollPosition(V),this.rowRenderer.redraw({afterScroll:!0})),d=h!==l.rowTop||p!==l.rowHeight}while(d);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getGridColumn(e);if(!i||i.isPinned()||!this.columnModel.isColumnDisplayed(i))return;const n=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming(()=>{n!==null&&this.centerRowContainerCtrl.setCenterViewportScrollLeft(n),this.centerRowContainerCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowContainerCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:n}=this.isColumnOutsideViewport(e),o=this.centerRowContainerCtrl.getCenterWidth()<e.getActualWidth(),r=this.centerRowContainerCtrl.getCenterWidth(),a=this.enableRtl;let l=(a?i:n)||o,d=a?n:i;t!=="auto"&&(l=t==="start",d=t==="end");const h=t==="middle";if(l||d||h){const{colLeft:p,colMiddle:m,colRight:v}=this.getColumnBounds(e);return h?m-r/2:l?a?v:p:a?p-r:v-r}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:n,colRight:o}=this.getColumnBounds(e),r=this.enableRtl,a=r?t>o:i<o,l=r?i<n:t>n;return{columnBeforeStart:a,columnAfterEnd:l}}getColumnBounds(e){const t=this.enableRtl,i=this.columnModel.getBodyContainerWidth(),n=e.getActualWidth(),o=e.getLeft(),r=t?-1:1,a=t?i-o:o,l=a+n*r,d=a+n/2*r;return{colLeft:a,colMiddle:d,colRight:l}}getViewportBounds(){const e=this.centerRowContainerCtrl.getCenterWidth(),t=this.centerRowContainerCtrl.getCenterViewportScrollLeft(),i=t,n=e+t;return{start:i,end:n,width:e}}}__decorate$1S([Autowired("ctrlsService")],GridBodyScrollFeature.prototype,"ctrlsService",void 0);__decorate$1S([Autowired("animationFrameService")],GridBodyScrollFeature.prototype,"animationFrameService",void 0);__decorate$1S([Autowired("paginationProxy")],GridBodyScrollFeature.prototype,"paginationProxy",void 0);__decorate$1S([Autowired("rowModel")],GridBodyScrollFeature.prototype,"rowModel",void 0);__decorate$1S([Autowired("rowContainerHeightService")],GridBodyScrollFeature.prototype,"heightScaler",void 0);__decorate$1S([Autowired("rowRenderer")],GridBodyScrollFeature.prototype,"rowRenderer",void 0);__decorate$1S([Autowired("columnModel")],GridBodyScrollFeature.prototype,"columnModel",void 0);__decorate$1S([PostConstruct],GridBodyScrollFeature.prototype,"postConstruct",null);var __decorate$1R=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class RowDragFeature extends BeanStub{constructor(e){super(),this.isMultiRowDrag=!1,this.eContainer=e}postConstruct(){this.gridOptionsService.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(()=>{const e=this.ctrlsService.getGridBodyCtrl();this.autoScrollService=new AutoScrollService({scrollContainer:e.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>e.getScrollFeature().getVScrollPosition().top,setVerticalPosition:t=>e.getScrollFeature().setVerticalScrollPosition(t),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}getContainer(){return this.eContainer}isInterestedIn(e){return e===DragSourceType.RowDrag}getIconName(){return this.gridOptionsService.get("rowDragManaged")&&this.shouldPreventRowMove()?DragAndDropService.ICON_NOT_ALLOWED:DragAndDropService.ICON_MOVE}shouldPreventRowMove(){return!!(this.columnModel.getRowGroupColumns().length||this.filterManager.isAnyFilterPresent()||this.sortController.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=this.gridOptionsService.get("rowDragMultiRow"),i=[...this.selectionService.getSelectedNodes()].sort((o,r)=>o.rowIndex==null||r.rowIndex==null?0:this.getRowIndexNumber(o)-this.getRowIndexNumber(r)),n=e.dragItem.rowNode;return t&&i.indexOf(n)!==-1?(this.isMultiRowDrag=!0,i):(this.isMultiRowDrag=!1,[n])}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent(Events.EVENT_ROW_DRAG_ENTER,e),this.getRowNodes(e).forEach(t=>{t.setDragging(!0)}),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gridOptionsService.getDomDataKey()}isDropZoneWithinThisGrid(e){const i=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:n}=e;return!i.contains(n)}onEnterOrDragging(e){this.dispatchGridEvent(Events.EVENT_ROW_DRAG_MOVE,e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gridOptionsService.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),n=this.gridOptionsService.get("rowDragManaged"),o=e.dragItem.rowNodes;n&&this.shouldPreventRowMove()||(this.gridOptionsService.get("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(o[0],t):this.moveRows(o,t))}getRowIndexNumber(e){return parseInt(last(e.getRowIndexString().split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&t.highlighted===RowHighlightPosition.Below,n=this.mouseEventService.getNormalisedPosition(e).y,o=e.dragItem.rowNodes;let r=i?1:0;if(this.isFromThisGrid(e))o.forEach(a=>{a.rowTop<n&&(r-=1)}),this.moveRows(o,n,r);else{const a=this.gridOptionsService.getCallback("getRowId");let l=this.clientSideRowModel.getRowIndexAtPixel(n)+1;this.clientSideRowModel.getHighlightPosition(n)===RowHighlightPosition.Above&&l--,this.clientSideRowModel.updateRowData({add:o.map(d=>d.data).filter(d=>!this.clientSideRowModel.getRowNode(a?a({data:d,level:0}):d.id)),addIndex:l})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),this.rangeService&&this.rangeService.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer()){warnOnce("addRowDropZone - A container target needs to be provided");return}if(this.dragAndDropService.findExternalZone(e)){console.warn("AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");return}let t={getContainer:e.getContainer};e.fromGrid?(e.fromGrid=void 0,t=e):(e.onDragEnter&&(t.onDragEnter=i=>{e.onDragEnter(this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_ENTER,i))}),e.onDragLeave&&(t.onDragLeave=i=>{e.onDragLeave(this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_LEAVE,i))}),e.onDragging&&(t.onDragging=i=>{e.onDragging(this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_MOVE,i))}),e.onDragStop&&(t.onDragStop=i=>{e.onDragStop(this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_END,i))})),this.dragAndDropService.addDropTarget(Object.assign({isInterestedIn:i=>i===DragSourceType.RowDrag,getIconName:()=>DragAndDropService.ICON_MOVE,external:!0},t))}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),n=this.onDragLeave.bind(this),o=this.onDragging.bind(this),r=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?a=>{i(a),e.onDragEnter(this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_ENTER,a))}:i,onDragLeave:e.onDragLeave?a=>{n(a),e.onDragLeave(this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_LEAVE,a))}:n,onDragging:e.onDragging?a=>{o(a),e.onDragging(this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_MOVE,a))}:o,onDragStop:e.onDragStop?a=>{r(a),e.onDragStop(this.draggingToRowDragEvent(Events.EVENT_ROW_DRAG_END,a))}:r,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:n,onDragging:o,onDragStop:r,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y,n=i>this.paginationProxy.getCurrentPageHeight();let o=-1,r;n||(o=this.rowModel.getRowIndexAtPixel(i),r=this.rowModel.getRow(o));let a;switch(t.vDirection){case VerticalDirection.Down:a="down";break;case VerticalDirection.Up:a="up";break;default:a=null;break}return this.gridOptionsService.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:o,overNode:r,y:i,vDirection:a})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent(Events.EVENT_ROW_DRAG_LEAVE,e),this.stopDragging(e),this.gridOptionsService.get("rowDragManaged")&&this.clearRowHighlight(),this.isFromThisGrid(e)&&(this.isMultiRowDrag=!1)}onDragStop(e){this.dispatchGridEvent(Events.EVENT_ROW_DRAG_END,e),this.stopDragging(e),this.gridOptionsService.get("rowDragManaged")&&(this.gridOptionsService.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&!this.isDropZoneWithinThisGrid(e)&&this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(t=>{t.setDragging(!1)})}}__decorate$1R([Autowired("dragAndDropService")],RowDragFeature.prototype,"dragAndDropService",void 0);__decorate$1R([Autowired("rowModel")],RowDragFeature.prototype,"rowModel",void 0);__decorate$1R([Autowired("paginationProxy")],RowDragFeature.prototype,"paginationProxy",void 0);__decorate$1R([Autowired("columnModel")],RowDragFeature.prototype,"columnModel",void 0);__decorate$1R([Autowired("focusService")],RowDragFeature.prototype,"focusService",void 0);__decorate$1R([Autowired("sortController")],RowDragFeature.prototype,"sortController",void 0);__decorate$1R([Autowired("filterManager")],RowDragFeature.prototype,"filterManager",void 0);__decorate$1R([Autowired("selectionService")],RowDragFeature.prototype,"selectionService",void 0);__decorate$1R([Autowired("mouseEventService")],RowDragFeature.prototype,"mouseEventService",void 0);__decorate$1R([Autowired("ctrlsService")],RowDragFeature.prototype,"ctrlsService",void 0);__decorate$1R([Optional("rangeService")],RowDragFeature.prototype,"rangeService",void 0);__decorate$1R([PostConstruct],RowDragFeature.prototype,"postConstruct",null);var __decorate$1Q=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},RowAnimationCssClasses;(function(s){s.ANIMATION_ON="ag-row-animation",s.ANIMATION_OFF="ag-row-no-animation"})(RowAnimationCssClasses||(RowAnimationCssClasses={}));const CSS_CLASS_FORCE_VERTICAL_SCROLL="ag-force-vertical-scroll",CSS_CLASS_CELL_SELECTABLE="ag-selectable",CSS_CLASS_COLUMN_MOVING="ag-column-moving";class GridBodyCtrl extends BeanStub{constructor(){super(...arguments),this.stickyTopHeight=0}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,n,o,r){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=n,this.eBottom=o,this.eStickyTop=r,this.setCellTextSelection(this.gridOptionsService.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",a=>this.setCellTextSelection(a.currentValue)),this.createManagedBean(new LayoutFeature(this.comp)),this.bodyScrollFeature=this.createManagedBean(new GridBodyScrollFeature(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([n,i,o,r]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager.setupAdvancedFilterHeaderComp(n),this.ctrlsService.registerGridBodyCtrl(this)}getComp(){return this.comp}addEventListeners(){this.addManagedListener(this.eventService,Events.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}addFocusListeners(e){e.forEach(t=>{this.addManagedListener(t,"focusin",i=>{const{target:n}=i,o=isElementChildOfClass(n,"ag-root",t);t.classList.toggle("ag-has-focus",!o)}),this.addManagedListener(t,"focusout",i=>{const{target:n,relatedTarget:o}=i,r=t.contains(o),a=isElementChildOfClass(o,"ag-root",t);isElementChildOfClass(n,"ag-root",t)||(!r||a)&&t.classList.remove("ag-has-focus")})})}setColumnMovingCss(e){this.comp.setColumnMovingCss(CSS_CLASS_COLUMN_MOVING,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(CSS_CLASS_CELL_SELECTABLE,e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyTopWidth(e);const t=e&&this.gridOptionsService.getScrollbarWidth()||0,i=isInvisibleScrollbar()?16:0,n=`calc(100% + ${t+i}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(n))}onGridColumnsChanged(){const e=this.columnModel.getAllGridColumns();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedListener(this.eGridBody,"dragstart",e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1})}addStopEditingWhenGridLosesFocus(){if(!this.gridOptionsService.get("stopEditingWhenCellsLoseFocus"))return;const e=i=>{const n=i.relatedTarget;if(getTabIndex(n)===null){this.rowRenderer.stopEditing();return}let o=t.some(r=>r.contains(n))&&this.mouseEventService.isElementInThisGrid(n);if(!o){const r=this.popupService;o=r.getActivePopups().some(a=>a.contains(n))||r.isElementWithinCustomPopup(n)}o||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop];t.forEach(i=>this.addManagedListener(i,"focusout",e))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+this.filterManager.getHeaderRowCount(),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=t===-1?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gridOptionsService.get("alwaysShowVerticalScroll"),t=e?CSS_CLASS_FORCE_VERTICAL_SCROLL:null,i=this.gridOptionsService.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&isVerticalScrollShowing(this.eBodyViewport)}setupRowAnimationCssClass(){const e=()=>{const t=this.gridOptionsService.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),i=t?RowAnimationCssClasses.ANIMATION_ON:RowAnimationCssClasses.ANIMATION_OFF;this.comp.setRowAnimationCssOnBodyViewport(i,t)};e(),this.addManagedListener(this.eventService,Events.EVENT_HEIGHT_SCALE_CHANGED,e),this.addManagedPropertyListener("animateRows",e)}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedListener(this.eBodyViewport,"contextmenu",e),this.mockContextMenuForIPad(e),this.addManagedListener(this.eBodyViewport,"wheel",this.onBodyViewportWheel.bind(this)),this.addManagedListener(this.eStickyTop,"wheel",this.onStickyTopWheel.bind(this)),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedListener(e,"wheel",i=>this.onFullWidthContainerWheel(i,t))}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gridOptionsService.get("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:n}=e||t;(n===this.eBodyViewport||n===this.ctrlsService.getCenterRowContainerCtrl().getViewportElement())&&this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!isIOSUserAgent())return;const t=new TouchListener(this.eBodyViewport),i=n=>{e(void 0,n.touchStart,n.touchEvent)};this.addManagedListener(t,TouchListener.EVENT_LONG_TAP,i),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gridOptionsService.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyTopWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new RowDragFeature(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}onPinnedRowDataChanged(){this.setFloatingHeights()}setFloatingHeights(){const{pinnedRowModel:e}=this;let t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyTopWidth(e){if(!e)this.comp.setStickyTopWidth("100%");else{const t=this.gridOptionsService.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`)}}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const t=this.ctrlsService.getGridHeaderCtrl().getHeaderHeight()+this.filterManager.getHeaderHeight(),i=this.pinnedRowModel.getPinnedTopTotalHeight();let n=0;t>0&&(n+=t+1),i>0&&(n+=i+1),this.comp.setStickyTopTop(`${n}px`)}sizeColumnsToFit(e,t){const n=this.isVerticalScrollShowing()?this.gridOptionsService.getScrollbarWidth():0,r=getInnerWidth(this.eGridBody)-n;if(r>0){this.columnModel.sizeColumnsToFit(r,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFit(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFit(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFit(e,-1)},500):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}}__decorate$1Q([Autowired("animationFrameService")],GridBodyCtrl.prototype,"animationFrameService",void 0);__decorate$1Q([Autowired("rowContainerHeightService")],GridBodyCtrl.prototype,"rowContainerHeightService",void 0);__decorate$1Q([Autowired("ctrlsService")],GridBodyCtrl.prototype,"ctrlsService",void 0);__decorate$1Q([Autowired("columnModel")],GridBodyCtrl.prototype,"columnModel",void 0);__decorate$1Q([Autowired("scrollVisibleService")],GridBodyCtrl.prototype,"scrollVisibleService",void 0);__decorate$1Q([Autowired("menuService")],GridBodyCtrl.prototype,"menuService",void 0);__decorate$1Q([Autowired("headerNavigationService")],GridBodyCtrl.prototype,"headerNavigationService",void 0);__decorate$1Q([Autowired("dragAndDropService")],GridBodyCtrl.prototype,"dragAndDropService",void 0);__decorate$1Q([Autowired("pinnedRowModel")],GridBodyCtrl.prototype,"pinnedRowModel",void 0);__decorate$1Q([Autowired("rowRenderer")],GridBodyCtrl.prototype,"rowRenderer",void 0);__decorate$1Q([Autowired("popupService")],GridBodyCtrl.prototype,"popupService",void 0);__decorate$1Q([Autowired("mouseEventService")],GridBodyCtrl.prototype,"mouseEventService",void 0);__decorate$1Q([Autowired("rowModel")],GridBodyCtrl.prototype,"rowModel",void 0);__decorate$1Q([Autowired("filterManager")],GridBodyCtrl.prototype,"filterManager",void 0);var SelectionHandleType;(function(s){s[s.FILL=0]="FILL",s[s.RANGE=1]="RANGE"})(SelectionHandleType||(SelectionHandleType={}));var CellRangeType;(function(s){s[s.VALUE=0]="VALUE",s[s.DIMENSION=1]="DIMENSION"})(CellRangeType||(CellRangeType={}));const CSS_CELL_RANGE_SELECTED="ag-cell-range-selected",CSS_CELL_RANGE_CHART="ag-cell-range-chart",CSS_CELL_RANGE_SINGLE_CELL="ag-cell-range-single-cell",CSS_CELL_RANGE_CHART_CATEGORY="ag-cell-range-chart-category",CSS_CELL_RANGE_HANDLE="ag-cell-range-handle",CSS_CELL_RANGE_TOP="ag-cell-range-top",CSS_CELL_RANGE_RIGHT="ag-cell-range-right",CSS_CELL_RANGE_BOTTOM="ag-cell-range-bottom",CSS_CELL_RANGE_LEFT="ag-cell-range-left";class CellRangeFeature{constructor(e,t){this.beans=e,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.beans.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SELECTED,this.rangeCount!==0),this.cellComp.addOrRemoveCssClass(`${CSS_CELL_RANGE_SELECTED}-1`,this.rangeCount===1),this.cellComp.addOrRemoveCssClass(`${CSS_CELL_RANGE_SELECTED}-2`,this.rangeCount===2),this.cellComp.addOrRemoveCssClass(`${CSS_CELL_RANGE_SELECTED}-3`,this.rangeCount===3),this.cellComp.addOrRemoveCssClass(`${CSS_CELL_RANGE_SELECTED}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_CHART,this.hasChartRange),setAriaSelected(this.eGui,this.rangeCount>0?!0:void 0),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SINGLE_CELL,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,n=!t&&e.right,o=!t&&e.bottom,r=!t&&e.left;this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_TOP,i),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_RIGHT,n),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_BOTTOM,o),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_LEFT,r)}isSingleCell(){const{rangeService:e}=this.beans;return this.rangeCount===1&&e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(i=>includes([CellRangeType.DIMENSION,CellRangeType.VALUE],i.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gridOptionsService.get("enableRtl");let t=!1,i=!1,n=!1,o=!1;const r=this.cellCtrl.getCellPosition().column,{rangeService:a,columnModel:l}=this.beans;let d,h;e?(d=l.getDisplayedColAfter(r),h=l.getDisplayedColBefore(r)):(d=l.getDisplayedColBefore(r),h=l.getDisplayedColAfter(r));const p=a.getCellRanges().filter(m=>a.isCellInSpecificRange(this.cellCtrl.getCellPosition(),m));d||(o=!0),h||(i=!0);for(let m=0;m<p.length&&!(t&&i&&n&&o);m++){const v=p[m],y=a.getRangeStartRow(v),b=a.getRangeEndRow(v);!t&&this.beans.rowPositionUtils.sameRow(y,this.cellCtrl.getCellPosition())&&(t=!0),!n&&this.beans.rowPositionUtils.sameRow(b,this.cellCtrl.getCellPosition())&&(n=!0),!o&&d&&v.columns.indexOf(d)<0&&(o=!0),!i&&h&&v.columns.indexOf(h)<0&&(i=!0)}return{top:t,right:i,bottom:n,left:o}}refreshHandle(){if(!this.beans.rangeService||this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_HANDLE,!!this.selectionHandle)}shouldHaveSelectionHandle(){const{gridOptionsService:e,rangeService:t}=this.beans,i=t.getCellRanges(),n=i.length;if(this.rangeCount<1||n<1)return!1;const o=last(i),r=this.cellCtrl.getCellPosition(),a=e.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),l=e.get("enableRangeHandle");let d=n===1&&!this.cellCtrl.isEditing()&&(a||l);if(this.hasChartRange){const p=i[0].type===CellRangeType.DIMENSION&&t.isCellInSpecificRange(r,i[0]);this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_CHART_CATEGORY,p),d=o.type===CellRangeType.VALUE}return d&&o.endRow!=null&&t.isContiguousRange(o)&&t.isBottomRightCell(o,r)}addSelectionHandle(){const{gridOptionsService:e,rangeService:t}=this.beans,i=last(t.getCellRanges()).type,o=e.get("enableFillHandle")&&missing(i)?SelectionHandleType.FILL:SelectionHandleType.RANGE;this.selectionHandle&&this.selectionHandle.getType()!==o&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.beans.selectionHandleFactory.createSelectionHandle(o)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}}class CellPositionFeature extends BeanStub{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode(),this.setupColSpan(),this.setupRowSpan()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListener(this.beans.eventService,Events.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}setComp(e){this.eGui=e,this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();areEqual(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){this.column.getColDef().colSpan!=null&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListener(this.beans.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this)),this.addManagedListener(this.beans.eventService,Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this)))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(e===1)t.push(this.column);else{let i=this.column;const n=this.column.getPinned();for(let o=0;i&&o<e&&(t.push(i),i=this.beans.columnModel.getDisplayedColAfter(i),!(!i||missing(i)||n!==i.getPinned()));o++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return this.beans.gridOptionsService.get("enableRtl")&&this.colsSpanning?e=last(this.colsSpanning):e=this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||this.column.getPinned()==="left")return e;const t=this.beans.columnModel.getDisplayedColumnsLeftWidth();if(this.column.getPinned()==="right"){const i=this.beans.columnModel.getBodyContainerWidth();return t+i+(e||0)}return t+(e||0)}applyRowSpan(e){if(this.rowSpan===1&&!e)return;const i=this.beans.gridOptionsService.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${i}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}}class CellCustomStyleFeature extends BeanStub{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gridOptionsService.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,n=>this.cellComp.addOrRemoveCssClass(n,!0),n=>this.cellComp.addOrRemoveCssClass(n,!1)),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if(typeof e.cellStyle=="function"){const i=this.beans.gridOptionsService.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex}),n=e.cellStyle;t=n(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gridOptionsService.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!0))}destroy(){super.destroy()}}class TooltipFeature extends BeanStub{constructor(e,t){super(),this.ctrl=e,this.beans=t}setComp(e){this.eGui=e,this.setupTooltip()}setBrowserTooltip(e){const t="title";e!=null&&e!=""?this.eGui.setAttribute(t,e):this.eGui.removeAttribute(t)}setupTooltip(){this.browserTooltips=this.beans.gridOptionsService.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?this.setBrowserTooltip(this.tooltip):this.createTooltipFeatureIfNeeded()}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var e,t,i,n;if(this.genericTooltipFeature!=null)return;const o={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.genericTooltipFeature=this.createManagedBean(new CustomTooltipFeature(o,(t=(e=this.ctrl).getTooltipShowDelayOverride)===null||t===void 0?void 0:t.call(e),(n=(i=this.ctrl).getTooltipHideDelayOverride)===null||n===void 0?void 0:n.call(i)),this.beans.context)}refreshToolTip(){this.updateTooltipText(),this.browserTooltips&&this.setBrowserTooltip(this.tooltip)}getTooltipParams(){const e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,n=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:n,data:n?n.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>this.genericTooltipFeature.hideTooltip(!0)}}getTooltipText(){return this.tooltip}destroy(){super.destroy()}}var __decorate$1P=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let Beans=class{postConstruct(){this.gridOptionsService.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.gridOptionsService.isRowModelType("serverSide")&&(this.serverSideRowModel=this.rowModel)}};__decorate$1P([Autowired("resizeObserverService")],Beans.prototype,"resizeObserverService",void 0);__decorate$1P([Autowired("paginationProxy")],Beans.prototype,"paginationProxy",void 0);__decorate$1P([Autowired("context")],Beans.prototype,"context",void 0);__decorate$1P([Autowired("columnApi")],Beans.prototype,"columnApi",void 0);__decorate$1P([Autowired("gridApi")],Beans.prototype,"gridApi",void 0);__decorate$1P([Autowired("gridOptionsService")],Beans.prototype,"gridOptionsService",void 0);__decorate$1P([Autowired("expressionService")],Beans.prototype,"expressionService",void 0);__decorate$1P([Autowired("environment")],Beans.prototype,"environment",void 0);__decorate$1P([Autowired("rowRenderer")],Beans.prototype,"rowRenderer",void 0);__decorate$1P([Autowired("templateService")],Beans.prototype,"templateService",void 0);__decorate$1P([Autowired("valueService")],Beans.prototype,"valueService",void 0);__decorate$1P([Autowired("eventService")],Beans.prototype,"eventService",void 0);__decorate$1P([Autowired("columnModel")],Beans.prototype,"columnModel",void 0);__decorate$1P([Autowired("headerNavigationService")],Beans.prototype,"headerNavigationService",void 0);__decorate$1P([Autowired("navigationService")],Beans.prototype,"navigationService",void 0);__decorate$1P([Autowired("columnAnimationService")],Beans.prototype,"columnAnimationService",void 0);__decorate$1P([Optional("rangeService")],Beans.prototype,"rangeService",void 0);__decorate$1P([Autowired("focusService")],Beans.prototype,"focusService",void 0);__decorate$1P([Autowired("popupService")],Beans.prototype,"popupService",void 0);__decorate$1P([Autowired("valueFormatterService")],Beans.prototype,"valueFormatterService",void 0);__decorate$1P([Autowired("stylingService")],Beans.prototype,"stylingService",void 0);__decorate$1P([Autowired("columnHoverService")],Beans.prototype,"columnHoverService",void 0);__decorate$1P([Autowired("userComponentFactory")],Beans.prototype,"userComponentFactory",void 0);__decorate$1P([Autowired("userComponentRegistry")],Beans.prototype,"userComponentRegistry",void 0);__decorate$1P([Autowired("animationFrameService")],Beans.prototype,"animationFrameService",void 0);__decorate$1P([Autowired("dragService")],Beans.prototype,"dragService",void 0);__decorate$1P([Autowired("dragAndDropService")],Beans.prototype,"dragAndDropService",void 0);__decorate$1P([Autowired("sortController")],Beans.prototype,"sortController",void 0);__decorate$1P([Autowired("filterManager")],Beans.prototype,"filterManager",void 0);__decorate$1P([Autowired("rowContainerHeightService")],Beans.prototype,"rowContainerHeightService",void 0);__decorate$1P([Autowired("frameworkOverrides")],Beans.prototype,"frameworkOverrides",void 0);__decorate$1P([Autowired("cellPositionUtils")],Beans.prototype,"cellPositionUtils",void 0);__decorate$1P([Autowired("rowPositionUtils")],Beans.prototype,"rowPositionUtils",void 0);__decorate$1P([Autowired("selectionService")],Beans.prototype,"selectionService",void 0);__decorate$1P([Optional("selectionHandleFactory")],Beans.prototype,"selectionHandleFactory",void 0);__decorate$1P([Autowired("rowCssClassCalculator")],Beans.prototype,"rowCssClassCalculator",void 0);__decorate$1P([Autowired("rowModel")],Beans.prototype,"rowModel",void 0);__decorate$1P([Autowired("ctrlsService")],Beans.prototype,"ctrlsService",void 0);__decorate$1P([Autowired("ctrlsFactory")],Beans.prototype,"ctrlsFactory",void 0);__decorate$1P([Autowired("agStackComponentsRegistry")],Beans.prototype,"agStackComponentsRegistry",void 0);__decorate$1P([Autowired("valueCache")],Beans.prototype,"valueCache",void 0);__decorate$1P([Autowired("rowNodeEventThrottle")],Beans.prototype,"rowNodeEventThrottle",void 0);__decorate$1P([Autowired("localeService")],Beans.prototype,"localeService",void 0);__decorate$1P([Autowired("valueParserService")],Beans.prototype,"valueParserService",void 0);__decorate$1P([Autowired("syncService")],Beans.prototype,"syncService",void 0);__decorate$1P([Autowired("ariaAnnouncementService")],Beans.prototype,"ariaAnnouncementService",void 0);__decorate$1P([PostConstruct],Beans.prototype,"postConstruct",null);Beans=__decorate$1P([Bean("beans")],Beans);class CellMouseListenerFeature extends Beans{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!isStopPropagationForAgGrid(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t);break}}onCellClicked(e){if(this.isDoubleClickOnIPad()){this.onCellDoubleClicked(e),e.preventDefault();return}const{eventService:t,rangeService:i,gridOptionsService:n}=this.beans,o=e.ctrlKey||e.metaKey;i&&o&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const r=this.cellCtrl.createEvent(e,Events.EVENT_CELL_CLICKED);t.dispatchEvent(r);const a=this.column.getColDef();a.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{a.onCellClicked(r)})},0),(n.get("singleClickEdit")||a.singleClickEdit)&&!n.get("suppressClickEdit")&&!(e.shiftKey&&(i==null?void 0:i.getCellRanges().length)!=0)&&this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!isIOSUserAgent()||isEventSupported("dblclick"))return!1;const e=new Date().getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const t=this.column.getColDef(),i=this.cellCtrl.createEvent(e,Events.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(i),typeof t.onCellDoubleClicked=="function"&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.onCellDoubleClicked(i)})},0),!this.beans.gridOptionsService.get("singleClickEdit")&&!this.beans.gridOptionsService.get("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:n}=e,o=e.target,{cellCtrl:r,beans:a}=this,{eventService:l,rangeService:d,focusService:h}=a;if(this.isRightClickInExistingRange(e))return;const p=d&&d.getCellRanges().length!=0;if(!n||!p){const m=isBrowserSafari()&&!r.isEditing()&&!isFocusableFormField(o);r.focusCell(m)}if(n&&p&&!h.isCellFocused(r.getCellPosition())){e.preventDefault();const m=h.getFocusedCell();if(m){const{column:v,rowIndex:y,rowPinned:b}=m,S=a.rowRenderer.getRowByPosition({rowIndex:y,rowPinned:b}),E=S==null?void 0:S.getCellCtrl(v);E!=null&&E.isEditing()&&E.stopEditing(),h.setFocusedCell({column:v,rowIndex:y,rowPinned:b,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(o)){if(d){const m=this.cellCtrl.getCellPosition();if(n)d.extendLatestRangeToCell(m);else{const v=t||i;d.setRangeToCell(m,v)}}l.dispatchEvent(this.cellCtrl.createEvent(e,Events.EVENT_CELL_MOUSE_DOWN))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),n=e.button===2||e.ctrlKey&&this.beans.gridOptionsService.get("allowContextMenuWithControlKey");if(i&&n)return!0}return!1}containsWidget(e){return isElementChildOfClass(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,Events.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,Events.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),n=t.contains(e.relatedTarget);return i&&n}destroy(){}}class CellKeyboardListenerFeature extends BeanStub{constructor(e,t,i,n,o){super(),this.cellCtrl=e,this.beans=t,this.rowNode=n,this.rowCtrl=o}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case KeyCode.ENTER:this.onEnterKeyDown(e);break;case KeyCode.F2:this.onF2KeyDown(e);break;case KeyCode.ESCAPE:this.onEscapeKeyDown(e);break;case KeyCode.TAB:this.onTabKeyDown(e);break;case KeyCode.BACKSPACE:case KeyCode.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case KeyCode.DOWN:case KeyCode.UP:case KeyCode.RIGHT:case KeyCode.LEFT:this.onNavigationKeyDown(e,t);break}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:i,beans:n,rowNode:o}=this,{gridOptionsService:r,rangeService:a,eventService:l}=n;i.isEditing()||(l.dispatchEvent({type:Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),isDeleteKey(e,r.get("enableCellEditingOnBackspace"))?a&&r.get("enableRangeSelection")?a.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"}):i.isCellEditable()&&o.setDataValue(i.getColumn(),null,"cellClear"):i.startRowOrCellEdit(e,t),l.dispatchEvent({type:Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END}))}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gridOptionsService.get("enterNavigatesVertically")){const t=e.shiftKey?KeyCode.UP:KeyCode.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(KeyCode.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(KeyCode.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const n=e.key;n===" "?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(n,e),e.preventDefault())}onSpaceKeyDown(e){const{gridOptionsService:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),n=!i;if(n||!t.get("suppressRowDeselection")){const o=this.beans.gridOptionsService.get("groupSelectsFiltered"),r=this.rowNode.setSelectedParams({newValue:n,rangeSelect:e.shiftKey,groupSelectsFiltered:o,event:e,source:"spaceKey"});i===void 0&&r===0&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:o,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}}var __decorate$1O=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class DndSourceComp extends Component{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(createIconNoSpan("rowDrag",this.gridOptionsService,null)),this.addGuiEventListener("mousedown",t=>{t.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);const i=()=>{try{const n=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",n),e.dataTransfer.setData("text/plain",n)}catch{}};if(t){const n=this.gridOptionsService.addGridCommonParams({rowNode:this.rowNode,dragEvent:e});t(n)}else i()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}}__decorate$1O([PostConstruct],DndSourceComp.prototype,"postConstruct",null);const CSS_FIRST_COLUMN="ag-column-first",CSS_LAST_COLUMN="ag-column-last";class CssClassApplier{static getHeaderClassesFromColDef(e,t,i,n){return missing(e)?[]:this.getColumnClassesFromCollDef(e.headerClass,e,t,i,n)}static getToolPanelClassesFromColDef(e,t,i,n){return missing(e)?[]:this.getColumnClassesFromCollDef(e.toolPanelClass,e,t,i,n)}static refreshFirstAndLastStyles(e,t,i){e.addOrRemoveCssClass(CSS_FIRST_COLUMN,i.isColumnAtEdge(t,"first")),e.addOrRemoveCssClass(CSS_LAST_COLUMN,i.isColumnAtEdge(t,"last"))}static getClassParams(e,t,i,n){return t.addGridCommonParams({colDef:e,column:i,columnGroup:n})}static getColumnClassesFromCollDef(e,t,i,n,o){if(missing(e))return[];let r;if(typeof e=="function"){const a=this.getClassParams(t,i,n,o);r=e(a)}else r=e;return typeof r=="string"?[r]:Array.isArray(r)?[...r]:[]}}const CSS_CELL="ag-cell",CSS_AUTO_HEIGHT="ag-cell-auto-height",CSS_NORMAL_HEIGHT="ag-cell-normal-height",CSS_CELL_FOCUS="ag-cell-focus",CSS_CELL_FIRST_RIGHT_PINNED="ag-cell-first-right-pinned",CSS_CELL_LAST_LEFT_PINNED="ag-cell-last-left-pinned",CSS_CELL_NOT_INLINE_EDITING="ag-cell-not-inline-editing",CSS_COLUMN_HOVER="ag-column-hover",CSS_CELL_WRAP_TEXT="ag-cell-wrap-text";let instanceIdSequence$3=0;class CellCtrl extends BeanStub{constructor(e,t,i,n){super(),this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.column=e,this.rowNode=t,this.beans=i,this.rowCtrl=n,this.instanceId=e.getId()+"-"+instanceIdSequence$3++,this.colIdSanitised=escapeString(this.column.getId()),i.gridOptionsService.get("suppressCellFocus")||(this.tabIndex=-1),this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new CellPositionFeature(this,this.beans),this.addDestroyFunc(()=>{var t;(t=this.cellPositionFeature)===null||t===void 0||t.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new CellCustomStyleFeature(this,this.beans),this.addDestroyFunc(()=>{var t;(t=this.cellCustomStyleFeature)===null||t===void 0||t.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new CellMouseListenerFeature(this,this.beans,this.column),this.addDestroyFunc(()=>{var t;(t=this.cellMouseListenerFeature)===null||t===void 0||t.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new CellKeyboardListenerFeature(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc(()=>{var t;(t=this.cellKeyboardListenerFeature)===null||t===void 0||t.destroy(),this.cellKeyboardListenerFeature=null}),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc(()=>{this.disableTooltipFeature()})),this.beans.rangeService&&this.beans.gridOptionsService.get("enableRangeSelection")&&(this.cellRangeFeature=new CellRangeFeature(this.beans,this),this.addDestroyFunc(()=>{var t;(t=this.cellRangeFeature)===null||t===void 0||t.destroy(),this.cellRangeFeature=null}))}enableTooltipFeature(){const t={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:()=>{const i=this.column.getColDef(),n=this.rowNode.data;if(i.tooltipField&&exists(n))return getValueUsingField(n,i.tooltipField,this.column.isTooltipFieldContainsDots());const o=i.tooltipValueGetter;return o?o(this.beans.gridOptionsService.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},getValueFormatted:()=>this.valueFormatted};this.tooltipFeature=new TooltipFeature(t,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(e,t,i,n,o){var r,a,l,d;this.cellComp=e,this.eGui=t,this.printLayout=n,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(i),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),(r=this.cellPositionFeature)===null||r===void 0||r.setComp(t),(a=this.cellCustomStyleFeature)===null||a===void 0||a.setComp(e),(l=this.tooltipFeature)===null||l===void 0||l.setComp(t),(d=this.cellKeyboardListenerFeature)===null||d===void 0||d.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,t),o&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(h=>h()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!e)return;const t=e.parentElement,i=this.beans.gridOptionsService.getRowHeightForNode(this.rowNode).height,n=a=>{if(this.editing||!this.isAlive())return;const{paddingTop:l,paddingBottom:d,borderBottomWidth:h,borderTopWidth:p}=getElementSize(t),m=l+d+h+p,y=e.offsetHeight+m;if(a<5){const S=this.beans.gridOptionsService.getDocument(),E=!S||!S.contains(e),T=y==0;if(E||T){window.setTimeout(()=>n(a+1),0);return}}const b=Math.max(y,i);this.rowNode.setRowAutoHeight(b,this.column)},o=()=>n(0);o();const r=this.beans.resizeObserverService.observeResize(e,o);this.addDestroyFunc(()=>{r(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){var e;return(e=this.column.getColDef().cellAriaRole)!==null&&e!==void 0?e:"gridcell"}getInstanceId(){return this.instanceId}getIncludeSelection(){return this.includeSelection}getIncludeRowDrag(){return this.includeRowDrag}getIncludeDndSource(){return this.includeDndSource}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const e=this.column.getColDef();return e.cellRenderer!=null||e.cellRendererSelector!=null}getValueToDisplay(){return this.valueFormatted!=null?this.valueFormatted:this.value}showValue(e=!1){const t=this.getValueToDisplay();let i;if(this.isCellRenderer()){const n=this.createCellRendererParams();i=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),n)}this.cellComp.setRenderDetails(i,t,e),this.refreshHandle()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(e.checkboxSelection),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gridOptionsService.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(e){return this.rowNode.rowPinned!=null?!1:typeof e=="function"||e===!0}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),i=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),n=this.includeDndSource!=this.isIncludeControl(e.dndSource);return t||i||n}startEditing(e=null,t=!1,i=null){if(!this.isCellEditable()||this.editing)return;if(!this.cellComp){this.onCellCompAttachedFuncs.push(()=>{this.startEditing(e,t,i)});return}const n=this.createCellEditorParams(e,t),o=this.column.getColDef(),r=this.beans.userComponentFactory.getCellEditorDetails(o,n);this.editCompDetails=r;const a=(r==null?void 0:r.popupFromSelector)!=null?r.popupFromSelector:!!o.cellEditorPopup,l=(r==null?void 0:r.popupPositionFromSelector)!=null?r.popupPositionFromSelector:o.cellEditorPopupPosition;this.setEditing(!0),this.cellComp.setEditDetails(r,a,l,this.beans.gridOptionsService.get("reactiveCustomComponents"));const d=this.createEvent(i,Events.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(d)}setEditing(e){this.editing!==e&&(this.editing=e,this.refreshHandle())}stopRowOrCellEdit(e=!1){this.beans.gridOptionsService.get("editType")==="fullRow"?this.rowCtrl.stopEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.isEditing()&&this.stopEditingAndFocus()}takeValueFromCellEditor(e){const t={newValueExists:!1};if(e)return t;const i=this.cellComp.getCellEditor();return!i||i.isCancelAfterEnd&&i.isCancelAfterEnd()?t:{newValue:i.getValue(),newValueExists:!0}}saveNewValue(e,t){if(t===e)return!1;this.suppressRefreshCell=!0;const i=this.rowNode.setDataValue(this.column,t,"edit");return this.suppressRefreshCell=!1,i}stopEditing(e=!1){if(!this.editing)return!1;const{newValue:t,newValueExists:i}=this.takeValueFromCellEditor(e),n=this.rowNode.getValueFromValueService(this.column);let o=!1;return i&&(o=this.saveNewValue(n,t)),this.setEditing(!1),this.cellComp.setEditDetails(),this.editCompDetails=void 0,this.updateAndFormatValue(!1),this.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.dispatchEditingStoppedEvent(n,t,!e&&!!o),o}dispatchEditingStoppedEvent(e,t,i){const n=Object.assign(Object.assign({},this.createEvent(null,Events.EVENT_CELL_EDITING_STOPPED)),{oldValue:e,newValue:t,valueChanged:i});this.beans.eventService.dispatchEvent(n)}createCellEditorParams(e,t){return this.beans.gridOptionsService.addGridCommonParams({value:this.rowNode.getValueFromValueService(this.column),eventKey:e,column:this.column,colDef:this.column.getColDef(),rowIndex:this.getCellPosition().rowIndex,node:this.rowNode,data:this.rowNode.data,cellStartedEdit:t,onKeyDown:this.onKeyDown.bind(this),stopEditing:this.stopEditingAndFocus.bind(this),eGridCell:this.getGui(),parseValue:this.parseValue.bind(this),formatValue:this.formatValue.bind(this)})}createCellRendererParams(){return this.beans.gridOptionsService.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:t=>this.beans.valueService.setValue(this.rowNode,this.column,t),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,rowIndex:this.getCellPosition().rowIndex,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(t,i,n,o)=>this.registerRowDragger(t,i,o)})}parseValue(e){return this.beans.valueParserService.parseValue(this.column,this.rowNode,e,this.getValue())}setFocusOutOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusOut&&e.focusOut()}setFocusInOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusIn?e.focusIn():this.focusCell(!0)}onCellChanged(e){e.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(e){var t;this.refreshShouldDestroy()?(t=this.rowCtrl)===null||t===void 0||t.refreshCell(this):this.refreshCell(e)}refreshCell(e){var t,i,n;if(this.suppressRefreshCell||this.editing)return;const o=this.column.getColDef(),r=e!=null&&!!e.newData,a=e!=null&&!!e.suppressFlash||!!o.suppressCellFlash,l=o.field==null&&o.valueGetter==null&&o.showRowGroup==null,d=e&&e.forceRefresh||l||r,h=!!this.cellComp,p=this.updateAndFormatValue(h),m=d||p;if(h){if(m){this.showValue(r);const v=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!a&&!v&&(this.beans.gridOptionsService.get("enableCellChangeFlash")||o.enableCellChangeFlash)&&this.flashCell(),(t=this.cellCustomStyleFeature)===null||t===void 0||t.applyUserStyles(),(i=this.cellCustomStyleFeature)===null||i===void 0||i.applyClassesFromColDef()}this.refreshToolTip(),(n=this.cellCustomStyleFeature)===null||n===void 0||n.applyCellClassRules()}}stopEditingAndFocus(e=!1,t=!1){this.stopRowOrCellEdit(),this.focusCell(!0),e||this.navigateAfterEdit(t)}navigateAfterEdit(e){if(this.beans.gridOptionsService.get("enterNavigatesVerticallyAfterEdit")){const i=e?KeyCode.UP:KeyCode.DOWN;this.beans.navigationService.navigateToNextCell(null,i,this.getCellPosition(),!1)}}flashCell(e){var t,i;const n=(t=e==null?void 0:e.flashDuration)!==null&&t!==void 0?t:e==null?void 0:e.flashDelay,o=(i=e==null?void 0:e.fadeDuration)!==null&&i!==void 0?i:e==null?void 0:e.fadeDelay;this.animateCell("data-changed",n,o)}animateCell(e,t,i){if(!this.cellComp)return;const n=`ag-cell-${e}`,o=`ag-cell-${e}-animation`,{gridOptionsService:r}=this.beans;t||(t=r.get("cellFlashDuration")),exists(i)||(i=r.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(n,!0),this.cellComp.addOrRemoveCssClass(o,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(n,!1),this.cellComp.addOrRemoveCssClass(o,!0),this.eGui.style.transition=`background-color ${i}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(o,!1),this.eGui.style.transition="")},i))},t)})}onFlashCells(e){if(!this.cellComp)return;const t=this.beans.cellPositionUtils.createId(this.getCellPosition());e.cells[t]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(e){var t;return(t=this.callValueFormatter(e))!==null&&t!==void 0?t:e}callValueFormatter(e){return this.beans.valueFormatterService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e){const t=this.value,i=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),e?!this.valuesAreEqual(t,this.value)||this.valueFormatted!=i:!0}valuesAreEqual(e,t){const i=this.column.getColDef();return i.equals?i.equals(e,t):e===t}getComp(){return this.cellComp}getValue(){return this.value}getValueFormatted(){return this.valueFormatted}addDomData(){const e=this.getGui();this.beans.gridOptionsService.setDomData(e,CellCtrl.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gridOptionsService.setDomData(e,CellCtrl.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(e,t){return this.beans.gridOptionsService.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:e,rowIndex:this.rowNode.rowIndex})}processCharacter(e){var t;(t=this.cellKeyboardListenerFeature)===null||t===void 0||t.processCharacter(e)}onKeyDown(e){var t;(t=this.cellKeyboardListenerFeature)===null||t===void 0||t.onKeyDown(e)}onMouseEvent(e,t){var i;(i=this.cellMouseListenerFeature)===null||i===void 0||i.onMouseEvent(e,t)}getGui(){return this.eGui}refreshToolTip(){var e;(e=this.tooltipFeature)===null||e===void 0||e.refreshToolTip()}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var e;this.cellComp&&((e=this.cellPositionFeature)===null||e===void 0||e.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:e,column:t,beans:i}=this;CssClassApplier.refreshFirstAndLastStyles(e,t,i.columnModel)}refreshAriaColIndex(){const e=this.beans.columnModel.getAriaColumnIndex(this.column);setAriaColIndex(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var e;return(e=this.cellPositionFeature)===null||e===void 0?void 0:e.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}getBeans(){return this.beans}isPrintLayout(){return this.printLayout}appendChild(e){this.eGui.appendChild(e)}refreshHandle(){this.cellRangeFeature&&this.cellRangeFeature.refreshHandle()}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(e,t=null){if(!this.cellComp){this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(e,t)});return}this.beans.gridOptionsService.get("editType")==="fullRow"?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,t)}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return this.cellRangeFeature!=null}focusCell(e=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:e})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const e=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass(CSS_CELL_FIRST_RIGHT_PINNED,e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass(CSS_CELL_LAST_LEFT_PINNED,e)}onCellFocused(e){if(this.beans.gridOptionsService.get("suppressCellFocus"))return;const t=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp){t&&(e!=null&&e.forceBrowserFocus)&&(this.focusEventToRestore=e);return}this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass(CSS_CELL_FOCUS,t),t&&e&&e.forceBrowserFocus&&this.cellComp.getFocusableElement().focus({preventScroll:!!e.preventScrollOnBrowserFocus});const i=this.beans.gridOptionsService.get("editType")==="fullRow";!t&&!i&&this.editing&&this.stopRowOrCellEdit(),t&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:makeNull(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass(CSS_CELL,!0),this.cellComp.addOrRemoveCssClass(CSS_CELL_NOT_INLINE_EDITING,!0);const e=this.column.isAutoHeight()==!0;this.cellComp.addOrRemoveCssClass(CSS_AUTO_HEIGHT,e),this.cellComp.addOrRemoveCssClass(CSS_NORMAL_HEIGHT,!e)}onColumnHover(){if(!this.cellComp||!this.beans.gridOptionsService.get("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass(CSS_COLUMN_HOVER,e)}onColDefChanged(){var e,t;if(!this.cellComp)return;if(this.column.isAutoHeight()!==this.isAutoHeight&&((e=this.rowCtrl)===null||e===void 0||e.refreshCell(this)),this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature(),(t=this.tooltipFeature)===null||t===void 0||t.setComp(this.eGui)):this.disableTooltipFeature(),this.setWrapText(),!this.editing)this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0});else{const o=this.getCellEditor();if(o!=null&&o.refresh){const{eventKey:r,cellStartedEdit:a}=this.editCompDetails.params,l=this.createCellEditorParams(r,a),d=this.column.getColDef(),h=this.beans.userComponentFactory.getCellEditorDetails(d,l);o.refresh(h.params)}}}setWrapText(){const e=this.column.getColDef().wrapText==!0;this.cellComp.addOrRemoveCssClass(CSS_CELL_WRAP_TEXT,e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),i=this.createEvent(e,Events.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(i),t.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.onCellContextMenu(i)})},0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const e=new CheckboxSelectionComponent;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new DndSourceComp(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,t,i){if(this.customRowDragComp){this.customRowDragComp.setDragElement(e,t);return}const n=this.createRowDragComp(e,t,i);n&&(this.customRowDragComp=n,this.addDestroyFunc(()=>{this.beans.context.destroyBean(n),this.customRowDragComp=null}))}createRowDragComp(e,t,i){const n=this.beans.gridOptionsService.get("pagination"),o=this.beans.gridOptionsService.get("rowDragManaged"),r=this.beans.gridOptionsService.isRowModelType("clientSide");if(o){if(!r){warnOnce("managed row dragging is only allowed in the Client Side Row Model");return}if(n){warnOnce("managed row dragging is not possible when doing pagination");return}}const a=new RowDragComp(()=>this.value,this.rowNode,this.column,e,t,i);return this.beans.context.createBean(a),a}}CellCtrl.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var RowType;(function(s){s.Normal="Normal",s.FullWidth="FullWidth",s.FullWidthLoading="FullWidthLoading",s.FullWidthGroup="FullWidthGroup",s.FullWidthDetail="FullWidthDetail"})(RowType||(RowType={}));let instanceIdSequence$2=0;class RowCtrl extends BeanStub{constructor(e,t,i,n,o){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=t,this.gridOptionsService=t.gridOptionsService,this.rowNode=e,this.paginationPage=t.paginationProxy.getCurrentPage(),this.useAnimationFrameForCreate=n,this.printLayout=o,this.suppressRowTransform=this.gridOptionsService.get("suppressRowTransform"),this.instanceId=e.id+"-"+instanceIdSequence$2++,this.rowId=escapeString(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=t.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(i),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gridOptionsService.get("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gridOptionsService.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!="function")return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=escapeString(e)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(){return this.rowNode.sticky}getBeans(){return this.beans}getInstanceId(){return this.instanceId}setComp(e,t,i){const n={rowComp:e,element:t,containerType:i};this.allRowGuis.push(n),i===RowContainerType.LEFT?this.leftGui=n:i===RowContainerType.RIGHT?this.rightGui=n:i===RowContainerType.FULL_WIDTH?this.fullWidthGui=n:this.centerGui=n,this.initialiseRowComp(n),this.rowType!=="FullWidthLoading"&&!this.rowNode.rowPinned&&this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(e){switch(this.allRowGuis=this.allRowGuis.filter(t=>t.containerType!==e),e){case RowContainerType.LEFT:this.leftGui=void 0;break;case RowContainerType.RIGHT:this.rightGui=void 0;break;case RowContainerType.FULL_WIDTH:this.fullWidthGui=void 0;break;case RowContainerType.CENTER:this.centerGui=void 0;break}}isCacheable(){return this.rowType===RowType.FullWidthDetail&&this.gridOptionsService.get("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach(i=>i.element.style.display=t)}initialiseRowComp(e){const t=this.gridOptionsService;this.listenOnDomOrder(e),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(e),this.updateRowIndexes(e),this.setFocusedClasses(e),this.setStylesFromGridOptions(!1,e),t.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(e),this.updateColumnLists(!this.useAnimationFrameForCreate);const i=e.rowComp;this.getInitialRowClasses(e.containerType).forEach(o=>i.addOrRemoveCssClass(o,!0)),this.executeSlideAndFadeAnimations(e),this.rowNode.group&&setAriaExpanded(e.element,this.rowNode.expanded==!0),this.setRowCompRowId(i),this.setRowCompRowBusinessKey(i),t.setDomData(e.element,RowCtrl.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>t.setDomData(e.element,RowCtrl.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,e.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(e.element),this.isFullWidth()&&this.setupFullWidth(e),t.get("rowDragEntireRow")&&this.addRowDraggerToRow(e),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&e.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){this.businessKeySanitised!=null&&e.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(e){this.rowId=escapeString(this.rowNode.id),this.rowId!=null&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(executeNextVMTurn(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1),this.fadeInAnimation[t]&&(executeNextVMTurn(()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){if(this.gridOptionsService.get("enableRangeSelection")){warnOnce("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");return}const t=this.beans.localeService.getLocaleTextFunc(),i=new RowDragComp(()=>`1 ${t("rowDragRow","row")}`,this.rowNode,void 0,e.element,void 0,!0),n=this.createBean(i,this.beans.context);this.rowDragComps.push(n)}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType),i=this.createFullWidthParams(e.element,t);if(this.rowType==RowType.FullWidthDetail&&!ModuleRegistry.__assertRegistered(ModuleNames.MasterDetailModule,"cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;let n;switch(this.rowType){case RowType.FullWidthDetail:n=this.beans.userComponentFactory.getFullWidthDetailCellRendererDetails(i);break;case RowType.FullWidthGroup:n=this.beans.userComponentFactory.getFullWidthGroupCellRendererDetails(i);break;case RowType.FullWidthLoading:n=this.beans.userComponentFactory.getFullWidthLoadingCellRendererDetails(i);break;default:n=this.beans.userComponentFactory.getFullWidthCellRendererDetails(i);break}e.rowComp.showFullWidth(n)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){var e,t;return this.gridOptionsService.get("embedFullWidthRows")?this.allRowGuis.map(i=>{var n;return(n=i==null?void 0:i.rowComp)===null||n===void 0?void 0:n.getFullWidthCellRenderer()}):[(t=(e=this.fullWidthGui)===null||e===void 0?void 0:e.rowComp)===null||t===void 0?void 0:t.getFullWidthCellRenderer()]}getCellElement(e){const t=this.getCellCtrl(e);return t?t.getGui():null}executeProcessRowPostCreateFunc(){const e=this.gridOptionsService.getCallback("processRowPostCreate");if(!e||!this.areAllContainersReady())return;const t={eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)};e(t)}areAllContainersReady(){const e=!!this.leftGui||!this.beans.columnModel.isPinningLeft(),t=!!this.centerGui,i=!!this.rightGui||!this.beans.columnModel.isPinningRight();return e&&t&&i}setRowType(){const e=this.rowNode.stub,t=this.rowNode.isFullWidthCell(),i=this.gridOptionsService.get("masterDetail")&&this.rowNode.detail,n=this.beans.columnModel.isPivotMode(),r=!!this.rowNode.group&&!this.rowNode.footer&&this.gridOptionsService.isGroupUseEntireRow(n);e?this.rowType=RowType.FullWidthLoading:i?this.rowType=RowType.FullWidthDetail:t?this.rowType=RowType.FullWidth:r?this.rowType=RowType.FullWidthGroup:this.rowType=RowType.Normal}updateColumnLists(e=!1,t=!1){if(this.isFullWidth())return;if(e||this.gridOptionsService.get("suppressAnimationFrame")||this.printLayout){this.updateColumnListsImpl(t);return}this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(e,t,i=null){const n={list:[],map:{}},o=(r,a)=>{n.list.push(a),n.map[r]=a};return t.forEach(r=>{const a=r.getInstanceId();let l=e.map[a];l||(l=new CellCtrl(r,this.rowNode,this.beans,this)),o(a,l)}),e.list.forEach(r=>{if(n.map[r.getColumn().getInstanceId()]!=null)return;if(!this.isCellEligibleToBeRemoved(r,i)){o(r.getColumn().getInstanceId(),r);return}r.destroy()}),n}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach(t=>{const i=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(i,e)})}getCellCtrlsForContainer(e){switch(e){case RowContainerType.LEFT:return this.leftCellCtrls.list;case RowContainerType.RIGHT:return this.rightCellCtrls.list;case RowContainerType.FULL_WIDTH:return[];case RowContainerType.CENTER:return this.centerCellCtrls.list;default:const t=e;throw new Error(`Unhandled case: ${t}`)}}createAllCellCtrls(){const e=this.beans.columnModel;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,e.getAllDisplayedColumns()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const t=e.getViewportCenterColumnsForRow(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t);const i=e.getDisplayedLeftColumnsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,i,"left");const n=e.getDisplayedRightColumnsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,n,"right")}}isCellEligibleToBeRemoved(e,t){if(e.getColumn().getPinned()!=t)return!0;const r=e.isEditing(),a=this.beans.focusService.isCellFocused(e.getCellPosition());if(r||a){const d=e.getColumn();return!(this.beans.columnModel.getAllDisplayedColumns().indexOf(d)>=0)}return!0}getDomOrder(){return this.gridOptionsService.get("ensureDomOrder")||this.gridOptionsService.isDomLayout("print")}listenOnDomOrder(e){const t=()=>{e.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",t),this.addManagedPropertyListener("ensureDomOrder",t)}setAnimateFlags(e){if(this.isSticky()||!e)return;const t=exists(this.rowNode.oldRowTop),i=this.beans.columnModel.isPinningLeft(),n=this.beans.columnModel.isPinningRight();if(t){if(this.isFullWidth()&&!this.gridOptionsService.get("embedFullWidthRows")){this.slideInAnimation.fullWidth=!0;return}this.slideInAnimation.center=!0,this.slideInAnimation.left=i,this.slideInAnimation.right=n}else{if(this.isFullWidth()&&!this.gridOptionsService.get("embedFullWidthRows")){this.fadeInAnimation.fullWidth=!0;return}this.fadeInAnimation.center=!0,this.fadeInAnimation.left=i,this.fadeInAnimation.right=n}}isEditing(){return this.editingRow}isFullWidth(){return this.rowType!==RowType.Normal}getRowType(){return this.rowType}refreshFullWidth(){const e=(a,l)=>a?a.rowComp.refreshFullWidth(()=>this.createFullWidthParams(a.element,l)):!0,t=e(this.fullWidthGui,null),i=e(this.centerGui,null),n=e(this.leftGui,"left"),o=e(this.rightGui,"right");return t&&i&&n&&o}addListeners(){this.addManagedListener(this.rowNode,RowNode.EVENT_HEIGHT_CHANGED,()=>this.onRowHeightChanged()),this.addManagedListener(this.rowNode,RowNode.EVENT_ROW_SELECTED,()=>this.onRowSelected()),this.addManagedListener(this.rowNode,RowNode.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.rowNode.detail&&this.addManagedListener(this.rowNode.parent,RowNode.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_CELL_CHANGED,this.postProcessCss.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_DRAGGING_CHANGED,this.postProcessRowDragging.bind(this)),this.addManagedListener(this.rowNode,RowNode.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));const e=this.beans.eventService;this.addManagedListener(e,Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(e,Events.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(e,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(e,Events.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(e,Events.EVENT_CELL_FOCUSED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,Events.EVENT_CELL_FOCUS_CLEARED,this.onCellFocusChanged.bind(this)),this.addManagedListener(e,Events.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(e,Events.EVENT_MODEL_UPDATED,this.refreshFirstAndLastRowStyles.bind(this)),this.addManagedListener(e,Events.EVENT_COLUMN_MOVED,this.updateColumnLists.bind(this)),this.addDestroyFunc(()=>{this.destroyBeans(this.rowDragComps,this.beans.context)}),this.addManagedPropertyListeners(["rowDragEntireRow"],()=>{if(this.gridOptionsService.get("rowDragEntireRow")){this.allRowGuis.forEach(i=>{this.addRowDraggerToRow(i)});return}this.destroyBeans(this.rowDragComps,this.beans.context),this.rowDragComps=[]}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListener(this.rowNode,RowNode.EVENT_ROW_INDEX_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onRowIndexChanged())}),this.addManagedListener(this.rowNode,RowNode.EVENT_CELL_CHANGED,e=>{this.getAllCellCtrls().forEach(t=>t.onCellChanged(e))})}onRowNodeDataChanged(e){if(this.isFullWidth()!==!!this.rowNode.isFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode);return}this.getAllCellCtrls().forEach(i=>i.refreshCell({suppressFlash:!e.update,newData:!e.update})),this.allRowGuis.forEach(i=>{this.setRowCompRowId(i.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(i.rowComp)}),this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.rowNode.highlighted;this.allRowGuis.forEach(t=>{const i=e===RowHighlightPosition.Above,n=e===RowHighlightPosition.Below;t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",i),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",n)})}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e))}updateExpandedCss(){const e=this.rowNode.isExpandable(),t=this.rowNode.expanded==!0;this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-group",e),i.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&t),i.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!t),setAriaExpanded(i.element,e&&t)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:makeNull(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.allRowGuis.find(l=>l.element.contains(e.target));if(!((t?t.element:null)===e.target))return;const o=this.rowNode,r=this.beans.focusService.getFocusedCell(),a={rowIndex:o.rowIndex,rowPinned:o.rowPinned,column:r&&r.column};this.beans.navigationService.navigateToNextCell(e,e.key,a,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||isStopPropagationForAgGrid(e))return;const t=this.allRowGuis.find(r=>r.element.contains(e.target)),i=t?t.element:null,n=i===e.target;let o=null;n||(o=this.beans.focusService.findNextFocusableElement(i,!1,e.shiftKey)),(this.isFullWidth()&&n||!o)&&this.beans.navigationService.onTabKeyDown(this,e)}onFullWidthRowFocused(e){var t;const i=this.rowNode,n=e?this.isFullWidth()&&e.rowIndex===i.rowIndex&&e.rowPinned==i.rowPinned:!1,o=this.fullWidthGui?this.fullWidthGui.element:(t=this.centerGui)===null||t===void 0?void 0:t.element;o&&(o.classList.toggle("ag-full-width-focus",n),n&&o.focus({preventScroll:!0}))}refreshCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),this.updateColumnLists()}removeCellCtrl(e,t){const i={list:[],map:{}};return e.list.forEach(n=>{n!==t&&(i.list.push(n),i.map[n.getInstanceId()]=n)}),i}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t);break}}createRowEvent(e,t){return this.gridOptionsService.addGridCommonParams({type:e,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:t})}createRowEventWithSource(e,t){const i=this.createRowEvent(e,t);return i.source=this,i}onRowDblClick(e){if(isStopPropagationForAgGrid(e))return;const t=this.createRowEventWithSource(Events.EVENT_ROW_DOUBLE_CLICKED,e);this.beans.eventService.dispatchEvent(t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=isElementChildOfClass(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,i=this.beans.columnModel;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges(),this.beans.focusService.setFocusedCell({rowIndex:t.rowIndex,column:i.getAllDisplayedColumns()[0],rowPinned:t.rowPinned,forceBrowserFocus:!0})}onRowClick(e){if(isStopPropagationForAgGrid(e)||this.lastMouseDownOnDragger)return;const i=this.createRowEventWithSource(Events.EVENT_ROW_CLICKED,e);this.beans.eventService.dispatchEvent(i);const n=e.ctrlKey||e.metaKey,o=e.shiftKey;if(this.gridOptionsService.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gridOptionsService.get("suppressRowClickSelection"))return;const a=this.gridOptionsService.get("rowMultiSelectWithClick"),l=!this.gridOptionsService.get("suppressRowDeselection"),d="rowClicked";if(this.rowNode.isSelected())a?this.rowNode.setSelectedParams({newValue:!1,event:e,source:d}):n?l&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:d}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!o,rangeSelect:o,event:e,source:d});else{const h=a?!1:!n;this.rowNode.setSelectedParams({newValue:!0,clearSelection:h,rangeSelect:o,event:e,source:d})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gridOptionsService.isRowSelection()}setupDetailRowAutoHeight(e){if(this.rowType!==RowType.FullWidthDetail||!this.gridOptionsService.get("detailRowAutoHeight"))return;const t=()=>{const n=e.clientHeight;if(n!=null&&n>0){const o=()=>{this.rowNode.setRowHeight(n),this.beans.clientSideRowModel?this.beans.clientSideRowModel.onRowHeightChanged():this.beans.serverSideRowModel&&this.beans.serverSideRowModel.onRowHeightChanged()};window.setTimeout(o,0)}},i=this.beans.resizeObserverService.observeResize(e,t);this.addDestroyFunc(i),t()}createFullWidthParams(e,t){return this.gridOptionsService.addGridCommonParams({fullWidth:!0,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,valueFormatted:this.rowNode.key,rowIndex:this.rowNode.rowIndex,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(n,o,r,a)=>this.addFullWidthRowDragging(n,o,r,a)})}addFullWidthRowDragging(e,t,i="",n){if(!this.isFullWidth())return;const o=new RowDragComp(()=>i,this.rowNode,void 0,e,t,n);this.createManagedBean(o,this.beans.context)}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,i="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(n=>{n.rowComp.addOrRemoveCssClass(t,!0),n.rowComp.addOrRemoveCssClass(i,!1)})}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageLastRow()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-first",e))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-last",t)))}stopEditing(e=!1){if(this.stoppingRowEdit)return;const t=this.getAllCellCtrls(),i=this.editingRow;this.stoppingRowEdit=!0;let n=!1;for(const o of t){const r=o.stopEditing(e);i&&!e&&!n&&r&&(n=!0)}if(n){const o=this.createRowEvent(Events.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(o)}i&&this.setEditingRow(!1),this.stoppingRowEdit=!1}setInlineEditingCss(e){this.allRowGuis.forEach(t=>{t.rowComp.addOrRemoveCssClass("ag-row-inline-editing",e),t.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!e)})}setEditingRow(e){this.editingRow=e,this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-editing",e));const t=e?this.createRowEvent(Events.EVENT_ROW_EDITING_STARTED):this.createRowEvent(Events.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(t)}startRowEditing(e=null,t=null,i=null){if(this.editingRow)return;this.getAllCellCtrls().reduce((o,r)=>{const a=r===t;return a?r.startEditing(e,a,i):r.startEditing(null,a,i),o?!0:r.isEditing()},!1)&&this.setEditingRow(!0)}getAllCellCtrls(){return this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!e||!e.length||e.forEach(t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!0))},e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!1))})}setStylesFromGridOptions(e,t){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(t,i=>i.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){return e===RowContainerType.LEFT?"left":e===RowContainerType.RIGHT?"right":null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),i={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[e],rowIsEven:this.rowNode.rowIndex%2===0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:t};return this.beans.rowCssClassCalculator.getInitialRowClasses(i)}processStylesFromGridOptions(){const e=this.gridOptionsService.get("rowStyle");if(e&&typeof e=="function"){console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}const t=this.gridOptionsService.getCallback("getRowStyle");let i;if(t){const n={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};i=t(n)}return i||e?Object.assign({},e,i):this.emptyStyle}onRowSelected(e){const t=this.beans.gridOptionsService.getDocument(),i=!!this.rowNode.isSelected();this.forEachGui(e,n=>{n.rowComp.addOrRemoveCssClass("ag-row-selected",i),setAriaSelected(n.element,i),n.element.contains(t.activeElement)&&(n===this.centerGui||n===this.fullWidthGui)&&this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const e=this.rowNode.isSelected();if(e&&this.beans.gridOptionsService.get("suppressRowDeselection"))return;const i=this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(i)}isUseAnimationFrameForCreate(){return this.useAnimationFrameForCreate}addHoverFunctionality(e){this.active&&(this.addManagedListener(e,"mouseenter",()=>this.rowNode.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.rowNode.onMouseLeave()),this.addManagedListener(this.rowNode,RowNode.EVENT_MOUSE_ENTER,()=>{!this.beans.dragService.isDragging()&&!this.gridOptionsService.get("suppressRowHoverHighlight")&&(e.classList.add("ag-row-hover"),this.rowNode.setHovered(!0))}),this.addManagedListener(this.rowNode,RowNode.EVENT_MOUSE_LEAVE,()=>{e.classList.remove("ag-row-hover"),this.rowNode.setHovered(!1)}))}roundRowTopToBounds(e){const t=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),i=this.applyPaginationOffset(t.top,!0)-100,n=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(i,e),n)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,t){e?t(e):this.allRowGuis.forEach(t)}onRowHeightChanged(e){if(this.rowNode.rowHeight==null)return;const t=this.rowNode.rowHeight,i=this.beans.environment.getDefaultRowHeight(),o=this.gridOptionsService.isGetRowHeightFunction()?this.gridOptionsService.getRowHeightForNode(this.rowNode).height:void 0,r=o?`${Math.min(i,o)-2}px`:void 0;this.forEachGui(e,a=>{a.element.style.height=`${t}px`,r&&a.element.style.setProperty("--ag-line-height",r)})}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}destroyFirstPass(e=!1){if(this.active=!1,!e&&this.gridOptionsService.isAnimateRows()&&!this.isSticky())if(this.rowNode.rowTop!=null){const n=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(n)}else this.allRowGuis.forEach(n=>n.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const t=this.createRowEvent(Events.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(t),this.beans.eventService.dispatchEvent(t),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const e=t=>(t.list.forEach(i=>i.destroy()),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,t=>{t.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),t.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const e=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);e!==this.rowFocused&&(this.rowFocused=e,this.setFocusedClasses()),!e&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const e=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return e;const i=this.beans.paginationProxy.getPixelOffset();return e+i*(t?1:-1)}setRowTop(e){if(!this.printLayout&&exists(e)){const t=this.applyPaginationOffset(e),o=`${this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeightService.getRealPixelPosition(t)}px`;this.setRowTopStyle(o)}}getInitialRowTop(e){return this.suppressRowTransform?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";let t;if(this.isSticky())t=this.rowNode.stickyRowTop;else{const i=this.slideInAnimation[e]?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,n=this.applyPaginationOffset(i);t=this.rowNode.isRowPinned()?n:this.beans.rowContainerHeightService.getRealPixelPosition(n)}return t+"px"}setRowTopStyle(e){this.allRowGuis.forEach(t=>this.suppressRowTransform?t.rowComp.setTop(e):t.rowComp.setTransform(`translateY(${e})`))}getRowNode(){return this.rowNode}getCellCtrl(e){let t=null;return this.getAllCellCtrls().forEach(i=>{i.getColumn()==e&&(t=i)}),t!=null||this.getAllCellCtrls().forEach(i=>{i.getColSpanningList().indexOf(e)>=0&&(t=i)}),t}onRowIndexChanged(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(e){const t=this.rowNode.getRowIndexString(),i=this.beans.headerNavigationService.getHeaderRowCount()+this.beans.filterManager.getHeaderRowCount(),n=this.rowNode.rowIndex%2===0,o=i+this.rowNode.rowIndex+1;this.forEachGui(e,r=>{r.rowComp.setRowIndex(t),r.rowComp.addOrRemoveCssClass("ag-row-even",n),r.rowComp.addOrRemoveCssClass("ag-row-odd",!n),setAriaRowIndex(r.element,o)})}}RowCtrl.DOM_DATA_KEY_ROW_CTRL="renderedRow";var __decorate$1N=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class RowContainerEventsFeature extends BeanStub{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedListener(this.element,e,t)}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",isEventSupported("touchstart")?"touchstart":"mousedown"].forEach(i=>{const n=this.processMouseEvent.bind(this,i);this.addManagedListener(this.element,i,n)})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||isStopPropagationForAgGrid(t))return;const i=this.getRowForEvent(t),n=this.mouseEventService.getRenderedCellForEvent(t);e==="contextmenu"?this.handleContextMenuMouseEvent(t,void 0,i,n):(n&&n.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!isIOSUserAgent())return;const e=new TouchListener(this.element),t=i=>{const n=this.getRowForEvent(i.touchEvent),o=this.mouseEventService.getRenderedCellForEvent(i.touchEvent);this.handleContextMenuMouseEvent(void 0,i.touchEvent,n,o)};this.addManagedListener(e,TouchListener.EVENT_LONG_TAP,t),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const i=this.gridOptionsService.getDomData(t,RowCtrl.DOM_DATA_KEY_ROW_CTRL);if(i)return i;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,n){const o=i?i.getRowNode():null,r=n?n.getColumn():null;let a=null;if(r){const h=e||t;n.dispatchCellContextMenuEvent(h??null),a=this.valueService.getValue(r,o)}const l=this.ctrlsService.getGridBodyCtrl(),d=n?n.getGui():l.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:o,column:r,value:a,anchorToElement:d})}getControlsForEventTarget(e){return{cellCtrl:getCtrlForEventTarget(this.gridOptionsService,e,CellCtrl.DOM_DATA_KEY_CELL_CTRL),rowCtrl:getCtrlForEventTarget(this.gridOptionsService,e,RowCtrl.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:n}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):n&&n.isFullWidth()&&this.processFullWidthRowKeyboardEvent(n,e,t))}processCellKeyboardEvent(e,t,i){const n=e.getRowNode(),o=e.getColumn(),r=e.isEditing();if(!isUserSuppressingKeyboardEvent(this.gridOptionsService,i,n,o,r)&&t==="keydown"&&(!r&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),isEventFromPrintableCharacter(i)&&e.processCharacter(i)),t==="keydown"){const l=e.createEvent(i,Events.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(l)}}processFullWidthRowKeyboardEvent(e,t,i){const n=e.getRowNode(),o=this.focusService.getFocusedCell(),r=o&&o.column;if(!isUserSuppressingKeyboardEvent(this.gridOptionsService,i,n,r,!1)){const l=i.key;if(t==="keydown")switch(l){case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:case KeyCode.PAGE_UP:case KeyCode.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case KeyCode.UP:case KeyCode.DOWN:e.onKeyboardNavigate(i);break;case KeyCode.TAB:e.onTabKeyDown(i);break}}if(t==="keydown"){const l=e.createRowEvent(Events.EVENT_CELL_KEY_DOWN,i);this.eventService.dispatchEvent(l)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!this.mouseEventService.isEventFromThisGrid(e))return;const i=normaliseQwertyAzerty(e);if(i===KeyCode.A)return this.onCtrlAndA(e);if(i===KeyCode.C)return this.onCtrlAndC(e);if(i===KeyCode.D)return this.onCtrlAndD(e);if(i===KeyCode.V)return this.onCtrlAndV(e);if(i===KeyCode.X)return this.onCtrlAndX(e);if(i===KeyCode.Y)return this.onCtrlAndY();if(i===KeyCode.Z)return this.onCtrlAndZ(e)}onCtrlAndA(e){const{pinnedRowModel:t,paginationProxy:i,rangeService:n}=this;if(n&&i.isRowsToRender()){const[o,r]=[t.isEmpty("top"),t.isEmpty("bottom")],a=o?null:"top";let l,d;r?(l=null,d=this.paginationProxy.getRowCount()-1):(l="bottom",d=t.getPinnedBottomRowData().length-1);const h=this.columnModel.getAllDisplayedColumns();if(missingOrEmpty(h))return;n.setCellRange({rowStartIndex:0,rowStartPinned:a,rowEndIndex:d,rowEndPinned:l,columnStart:h[0],columnEnd:last(h)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gridOptionsService.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t!=null&&t.isEditing()||i!=null&&i.isEditing()||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gridOptionsService.get("enableCellTextSelection")||this.gridOptionsService.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t!=null&&t.isEditing()||i!=null&&i.isEditing()||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t!=null&&t.isEditing()||i!=null&&i.isEditing()||this.clipboardService&&!this.gridOptionsService.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gridOptionsService.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){this.gridOptionsService.get("undoRedoCellEditing")&&(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService.redo("ui")}}__decorate$1N([Autowired("mouseEventService")],RowContainerEventsFeature.prototype,"mouseEventService",void 0);__decorate$1N([Autowired("valueService")],RowContainerEventsFeature.prototype,"valueService",void 0);__decorate$1N([Autowired("menuService")],RowContainerEventsFeature.prototype,"menuService",void 0);__decorate$1N([Autowired("ctrlsService")],RowContainerEventsFeature.prototype,"ctrlsService",void 0);__decorate$1N([Autowired("navigationService")],RowContainerEventsFeature.prototype,"navigationService",void 0);__decorate$1N([Autowired("focusService")],RowContainerEventsFeature.prototype,"focusService",void 0);__decorate$1N([Autowired("undoRedoService")],RowContainerEventsFeature.prototype,"undoRedoService",void 0);__decorate$1N([Autowired("columnModel")],RowContainerEventsFeature.prototype,"columnModel",void 0);__decorate$1N([Autowired("paginationProxy")],RowContainerEventsFeature.prototype,"paginationProxy",void 0);__decorate$1N([Autowired("pinnedRowModel")],RowContainerEventsFeature.prototype,"pinnedRowModel",void 0);__decorate$1N([Optional("rangeService")],RowContainerEventsFeature.prototype,"rangeService",void 0);__decorate$1N([Optional("clipboardService")],RowContainerEventsFeature.prototype,"clipboardService",void 0);__decorate$1N([PostConstruct],RowContainerEventsFeature.prototype,"postConstruct",null);var __decorate$1M=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class ViewportSizeFeature extends BeanStub{constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl(),this.listenForResize()}),this.addManagedListener(this.eventService,Events.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this)),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=getInnerWidth(e);if(t<=50)return;let i=this.getPinnedColumnsOverflowingViewport(t-50);const n=this.gridOptionsService.getCallback("processUnpinnedColumns");i.length&&(n&&(i=n({columns:i,viewportWidth:t})),this.columnModel.setColumnsPinned(i,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth(),i=this.pinnedWidthService.getPinnedLeftWidth(),n=t+i;if(n<e)return[];const o=[...this.columnModel.getDisplayedLeftColumns()],r=[...this.columnModel.getDisplayedRightColumns()];let a=0,l=0,d=0;const h=[];let p=n-d-e;for(;(l<o.length||a<r.length)&&p>0;){if(a<r.length){const m=r[a++];p-=m.getActualWidth(),h.push(m)}if(l<o.length&&p>0){const m=o[l++];p-=m.getActualWidth(),h.push(m)}}return h}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=getInnerHeight(e);if(this.bodyHeight!==t){this.bodyHeight=t;const i={type:Events.EVENT_BODY_HEIGHT_CHANGED};this.eventService.dispatchEvent(i)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(e,t)}}__decorate$1M([Autowired("ctrlsService")],ViewportSizeFeature.prototype,"ctrlsService",void 0);__decorate$1M([Autowired("pinnedWidthService")],ViewportSizeFeature.prototype,"pinnedWidthService",void 0);__decorate$1M([Autowired("columnModel")],ViewportSizeFeature.prototype,"columnModel",void 0);__decorate$1M([Autowired("scrollVisibleService")],ViewportSizeFeature.prototype,"scrollVisibleService",void 0);__decorate$1M([PostConstruct],ViewportSizeFeature.prototype,"postConstruct",null);var __decorate$1L=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class SetPinnedLeftWidthFeature extends BeanStub{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,Events.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;setDisplayed(this.element,t),setFixedWidth(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}}__decorate$1L([Autowired("pinnedWidthService")],SetPinnedLeftWidthFeature.prototype,"pinnedWidthService",void 0);__decorate$1L([PostConstruct],SetPinnedLeftWidthFeature.prototype,"postConstruct",null);var __decorate$1K=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class SetPinnedRightWidthFeature extends BeanStub{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;setDisplayed(this.element,t),setFixedWidth(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}}__decorate$1K([Autowired("pinnedWidthService")],SetPinnedRightWidthFeature.prototype,"pinnedWidthService",void 0);__decorate$1K([PostConstruct],SetPinnedRightWidthFeature.prototype,"postConstruct",null);var __decorate$1J=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class SetHeightFeature extends BeanStub{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedListener(this.eventService,Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=e!=null?`${e}px`:"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}}__decorate$1J([Autowired("rowContainerHeightService")],SetHeightFeature.prototype,"maxDivHeightScaler",void 0);__decorate$1J([PostConstruct],SetHeightFeature.prototype,"postConstruct",null);var __decorate$1I=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class DragListenerFeature extends BeanStub{constructor(e){super(),this.eContainer=e}postConstruct(){if(missing(this.rangeService))return;this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",t=>{if(t.currentValue){this.enableFeature();return}this.disableFeature()}),this.addDestroyFunc(()=>this.disableFeature()),this.gridOptionsService.get("enableRangeSelection")&&this.enableFeature()}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}}__decorate$1I([Optional("rangeService")],DragListenerFeature.prototype,"rangeService",void 0);__decorate$1I([Autowired("dragService")],DragListenerFeature.prototype,"dragService",void 0);__decorate$1I([PostConstruct],DragListenerFeature.prototype,"postConstruct",null);var __decorate$1H=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class CenterWidthFeature extends BeanStub{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_CONTAINER_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,Events.EVENT_LEFT_PINNED_WIDTH_CHANGED,e),this.addSpacer&&(this.addManagedListener(this.eventService,Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,Events.EVENT_SCROLL_VISIBILITY_CHANGED,e),this.addManagedListener(this.eventService,Events.EVENT_SCROLLBAR_WIDTH_CHANGED,e)),this.setWidth()}setWidth(){const{columnModel:e}=this,t=this.gridOptionsService.isDomLayout("print"),i=e.getBodyContainerWidth(),n=e.getDisplayedColumnsLeftWidth(),o=e.getDisplayedColumnsRightWidth();let r;t?r=i+n+o:(r=i,this.addSpacer&&(this.gridOptionsService.get("enableRtl")?n:o)===0&&this.scrollVisibleService.isVerticalScrollShowing()&&(r+=this.gridOptionsService.getScrollbarWidth())),this.callback(r)}}__decorate$1H([Autowired("columnModel")],CenterWidthFeature.prototype,"columnModel",void 0);__decorate$1H([Autowired("scrollVisibleService")],CenterWidthFeature.prototype,"scrollVisibleService",void 0);__decorate$1H([PostConstruct],CenterWidthFeature.prototype,"postConstruct",null);var __decorate$1G=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},RowContainerName;(function(s){s.LEFT="left",s.RIGHT="right",s.CENTER="center",s.FULL_WIDTH="fullWidth",s.TOP_LEFT="topLeft",s.TOP_RIGHT="topRight",s.TOP_CENTER="topCenter",s.TOP_FULL_WIDTH="topFullWidth",s.STICKY_TOP_LEFT="stickyTopLeft",s.STICKY_TOP_RIGHT="stickyTopRight",s.STICKY_TOP_CENTER="stickyTopCenter",s.STICKY_TOP_FULL_WIDTH="stickyTopFullWidth",s.BOTTOM_LEFT="bottomLeft",s.BOTTOM_RIGHT="bottomRight",s.BOTTOM_CENTER="bottomCenter",s.BOTTOM_FULL_WIDTH="bottomFullWidth"})(RowContainerName||(RowContainerName={}));var RowContainerType;(function(s){s.LEFT="left",s.RIGHT="right",s.CENTER="center",s.FULL_WIDTH="fullWidth"})(RowContainerType||(RowContainerType={}));function getRowContainerTypeForName(s){switch(s){case RowContainerName.CENTER:case RowContainerName.TOP_CENTER:case RowContainerName.STICKY_TOP_CENTER:case RowContainerName.BOTTOM_CENTER:return RowContainerType.CENTER;case RowContainerName.LEFT:case RowContainerName.TOP_LEFT:case RowContainerName.STICKY_TOP_LEFT:case RowContainerName.BOTTOM_LEFT:return RowContainerType.LEFT;case RowContainerName.RIGHT:case RowContainerName.TOP_RIGHT:case RowContainerName.STICKY_TOP_RIGHT:case RowContainerName.BOTTOM_RIGHT:return RowContainerType.RIGHT;case RowContainerName.FULL_WIDTH:case RowContainerName.TOP_FULL_WIDTH:case RowContainerName.STICKY_TOP_FULL_WIDTH:case RowContainerName.BOTTOM_FULL_WIDTH:return RowContainerType.FULL_WIDTH;default:throw Error("Invalid Row Container Type")}}const ContainerCssClasses=convertToMap([[RowContainerName.CENTER,"ag-center-cols-container"],[RowContainerName.LEFT,"ag-pinned-left-cols-container"],[RowContainerName.RIGHT,"ag-pinned-right-cols-container"],[RowContainerName.FULL_WIDTH,"ag-full-width-container"],[RowContainerName.TOP_CENTER,"ag-floating-top-container"],[RowContainerName.TOP_LEFT,"ag-pinned-left-floating-top"],[RowContainerName.TOP_RIGHT,"ag-pinned-right-floating-top"],[RowContainerName.TOP_FULL_WIDTH,"ag-floating-top-full-width-container"],[RowContainerName.STICKY_TOP_CENTER,"ag-sticky-top-container"],[RowContainerName.STICKY_TOP_LEFT,"ag-pinned-left-sticky-top"],[RowContainerName.STICKY_TOP_RIGHT,"ag-pinned-right-sticky-top"],[RowContainerName.STICKY_TOP_FULL_WIDTH,"ag-sticky-top-full-width-container"],[RowContainerName.BOTTOM_CENTER,"ag-floating-bottom-container"],[RowContainerName.BOTTOM_LEFT,"ag-pinned-left-floating-bottom"],[RowContainerName.BOTTOM_RIGHT,"ag-pinned-right-floating-bottom"],[RowContainerName.BOTTOM_FULL_WIDTH,"ag-floating-bottom-full-width-container"]]),ViewportCssClasses=convertToMap([[RowContainerName.CENTER,"ag-center-cols-viewport"],[RowContainerName.TOP_CENTER,"ag-floating-top-viewport"],[RowContainerName.STICKY_TOP_CENTER,"ag-sticky-top-viewport"],[RowContainerName.BOTTOM_CENTER,"ag-floating-bottom-viewport"]]);class RowContainerCtrl extends BeanStub{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.isFullWithContainer=this.name===RowContainerName.TOP_FULL_WIDTH||this.name===RowContainerName.STICKY_TOP_FULL_WIDTH||this.name===RowContainerName.BOTTOM_FULL_WIDTH||this.name===RowContainerName.FULL_WIDTH}static getRowContainerCssClasses(e){const t=ContainerCssClasses.get(e),i=ViewportCssClasses.get(e);return{container:t,viewport:i}}static getPinned(e){switch(e){case RowContainerName.BOTTOM_LEFT:case RowContainerName.TOP_LEFT:case RowContainerName.STICKY_TOP_LEFT:case RowContainerName.LEFT:return"left";case RowContainerName.BOTTOM_RIGHT:case RowContainerName.TOP_RIGHT:case RowContainerName.STICKY_TOP_RIGHT:case RowContainerName.RIGHT:return"right";default:return null}}postConstruct(){this.enableRtl=this.gridOptionsService.get("enableRtl"),this.forContainers([RowContainerName.CENTER],()=>this.viewportSizeFeature=this.createManagedBean(new ViewportSizeFeature(this)))}registerWithCtrlsService(){switch(this.name){case RowContainerName.CENTER:this.ctrlsService.registerCenterRowContainerCtrl(this);break;case RowContainerName.LEFT:this.ctrlsService.registerLeftRowContainerCtrl(this);break;case RowContainerName.RIGHT:this.ctrlsService.registerRightRowContainerCtrl(this);break;case RowContainerName.TOP_CENTER:this.ctrlsService.registerTopCenterRowContainerCtrl(this);break;case RowContainerName.TOP_LEFT:this.ctrlsService.registerTopLeftRowContainerCon(this);break;case RowContainerName.TOP_RIGHT:this.ctrlsService.registerTopRightRowContainerCtrl(this);break;case RowContainerName.STICKY_TOP_CENTER:this.ctrlsService.registerStickyTopCenterRowContainerCtrl(this);break;case RowContainerName.STICKY_TOP_LEFT:this.ctrlsService.registerStickyTopLeftRowContainerCon(this);break;case RowContainerName.STICKY_TOP_RIGHT:this.ctrlsService.registerStickyTopRightRowContainerCtrl(this);break;case RowContainerName.BOTTOM_CENTER:this.ctrlsService.registerBottomCenterRowContainerCtrl(this);break;case RowContainerName.BOTTOM_LEFT:this.ctrlsService.registerBottomLeftRowContainerCtrl(this);break;case RowContainerName.BOTTOM_RIGHT:this.ctrlsService.registerBottomRightRowContainerCtrl(this);break}}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new RowContainerEventsFeature(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();const n=[RowContainerName.TOP_CENTER,RowContainerName.TOP_LEFT,RowContainerName.TOP_RIGHT],o=[RowContainerName.STICKY_TOP_CENTER,RowContainerName.STICKY_TOP_LEFT,RowContainerName.STICKY_TOP_RIGHT],r=[RowContainerName.BOTTOM_CENTER,RowContainerName.BOTTOM_LEFT,RowContainerName.BOTTOM_RIGHT],a=[RowContainerName.CENTER,RowContainerName.LEFT,RowContainerName.RIGHT],l=[...n,...r,...a,...o],d=[RowContainerName.CENTER,RowContainerName.LEFT,RowContainerName.RIGHT,RowContainerName.FULL_WIDTH],h=[RowContainerName.CENTER,RowContainerName.TOP_CENTER,RowContainerName.STICKY_TOP_CENTER,RowContainerName.BOTTOM_CENTER],p=[RowContainerName.LEFT,RowContainerName.BOTTOM_LEFT,RowContainerName.TOP_LEFT,RowContainerName.STICKY_TOP_LEFT],m=[RowContainerName.RIGHT,RowContainerName.BOTTOM_RIGHT,RowContainerName.TOP_RIGHT,RowContainerName.STICKY_TOP_RIGHT];this.forContainers(p,()=>{this.pinnedWidthFeature=this.createManagedBean(new SetPinnedLeftWidthFeature(this.eContainer)),this.addManagedListener(this.eventService,Events.EVENT_LEFT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(m,()=>{this.pinnedWidthFeature=this.createManagedBean(new SetPinnedRightWidthFeature(this.eContainer)),this.addManagedListener(this.eventService,Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(d,()=>this.createManagedBean(new SetHeightFeature(this.eContainer,this.name===RowContainerName.CENTER?i:void 0))),this.forContainers(l,()=>this.createManagedBean(new DragListenerFeature(this.eContainer))),this.forContainers(h,()=>this.createManagedBean(new CenterWidthFeature(v=>this.comp.setContainerWidth(`${v}px`)))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>this.onDisplayedColumnsChanged()),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>this.onDisplayedColumnsWidthChanged()),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_ROWS_CHANGED,e=>this.onDisplayedRowsChanged(e.afterScroll)),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if([RowContainerName.STICKY_TOP_CENTER,RowContainerName.STICKY_TOP_LEFT,RowContainerName.STICKY_TOP_RIGHT,RowContainerName.STICKY_TOP_FULL_WIDTH].indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const i=()=>{const n=this.gridOptionsService.get("ensureDomOrder"),o=this.gridOptionsService.isDomLayout("print");this.comp.setDomOrder(n||o)};this.addManagedPropertyListener("domLayout",i),i()}stopHScrollOnPinnedRows(){this.forContainers([RowContainerName.TOP_CENTER,RowContainerName.STICKY_TOP_CENTER,RowContainerName.BOTTOM_CENTER],()=>{const e=()=>this.eViewport.scrollLeft=0;this.addManagedListener(this.eViewport,"scroll",e)})}onDisplayedColumnsChanged(){this.forContainers([RowContainerName.CENTER],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers([RowContainerName.CENTER],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=t=>{this.dragService.isDragging()&&t.cancelable&&t.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(t,i,e)}getCenterWidth(){return getInnerWidth(this.eViewport)}getCenterViewportScrollLeft(){return getScrollLeft(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return isInDOM(this.eViewport)}getViewportScrollLeft(){return getScrollLeft(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gridOptionsService.get("alwaysShowHorizontalScroll")||isHorizontalScrollShowing(this.eViewport)}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){setScrollLeft(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!RowContainerCtrl.getPinned(this.name)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){if(!this.visible){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const t=this.gridOptionsService.isDomLayout("print"),n=this.gridOptionsService.get("embedFullWidthRows")||t,o=this.getRowCtrls().filter(r=>{const a=r.isFullWidth();return this.isFullWithContainer?!n&&a:n||!a});this.comp.setRowCtrls({rowCtrls:o,useFlushSync:e})}getRowCtrls(){switch(this.name){case RowContainerName.TOP_CENTER:case RowContainerName.TOP_LEFT:case RowContainerName.TOP_RIGHT:case RowContainerName.TOP_FULL_WIDTH:return this.rowRenderer.getTopRowCtrls();case RowContainerName.STICKY_TOP_CENTER:case RowContainerName.STICKY_TOP_LEFT:case RowContainerName.STICKY_TOP_RIGHT:case RowContainerName.STICKY_TOP_FULL_WIDTH:return this.rowRenderer.getStickyTopRowCtrls();case RowContainerName.BOTTOM_CENTER:case RowContainerName.BOTTOM_LEFT:case RowContainerName.BOTTOM_RIGHT:case RowContainerName.BOTTOM_FULL_WIDTH:return this.rowRenderer.getBottomRowCtrls();default:return this.rowRenderer.getCentreRowCtrls()}}}__decorate$1G([Autowired("dragService")],RowContainerCtrl.prototype,"dragService",void 0);__decorate$1G([Autowired("ctrlsService")],RowContainerCtrl.prototype,"ctrlsService",void 0);__decorate$1G([Autowired("columnModel")],RowContainerCtrl.prototype,"columnModel",void 0);__decorate$1G([Autowired("resizeObserverService")],RowContainerCtrl.prototype,"resizeObserverService",void 0);__decorate$1G([Autowired("rowRenderer")],RowContainerCtrl.prototype,"rowRenderer",void 0);__decorate$1G([PostConstruct],RowContainerCtrl.prototype,"postConstruct",null);var __decorate$1F=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const GRID_BODY_TEMPLATE=`<div class="ag-root ag-unselectable" role="treegrid">
|
||
<ag-header-root ref="gridHeader"></ag-header-root>
|
||
<div class="ag-floating-top" ref="eTop" role="presentation">
|
||
<ag-row-container ref="topLeftContainer" name="${RowContainerName.TOP_LEFT}"></ag-row-container>
|
||
<ag-row-container ref="topCenterContainer" name="${RowContainerName.TOP_CENTER}"></ag-row-container>
|
||
<ag-row-container ref="topRightContainer" name="${RowContainerName.TOP_RIGHT}"></ag-row-container>
|
||
<ag-row-container ref="topFullWidthContainer" name="${RowContainerName.TOP_FULL_WIDTH}"></ag-row-container>
|
||
</div>
|
||
<div class="ag-body" ref="eBody" role="presentation">
|
||
<div class="ag-body-viewport" ref="eBodyViewport" role="presentation">
|
||
<ag-row-container ref="leftContainer" name="${RowContainerName.LEFT}"></ag-row-container>
|
||
<ag-row-container ref="centerContainer" name="${RowContainerName.CENTER}"></ag-row-container>
|
||
<ag-row-container ref="rightContainer" name="${RowContainerName.RIGHT}"></ag-row-container>
|
||
<ag-row-container ref="fullWidthContainer" name="${RowContainerName.FULL_WIDTH}"></ag-row-container>
|
||
</div>
|
||
<ag-fake-vertical-scroll></ag-fake-vertical-scroll>
|
||
</div>
|
||
<div class="ag-sticky-top" ref="eStickyTop" role="presentation">
|
||
<ag-row-container ref="stickyTopLeftContainer" name="${RowContainerName.STICKY_TOP_LEFT}"></ag-row-container>
|
||
<ag-row-container ref="stickyTopCenterContainer" name="${RowContainerName.STICKY_TOP_CENTER}"></ag-row-container>
|
||
<ag-row-container ref="stickyTopRightContainer" name="${RowContainerName.STICKY_TOP_RIGHT}"></ag-row-container>
|
||
<ag-row-container ref="stickyTopFullWidthContainer" name="${RowContainerName.STICKY_TOP_FULL_WIDTH}"></ag-row-container>
|
||
</div>
|
||
<div class="ag-floating-bottom" ref="eBottom" role="presentation">
|
||
<ag-row-container ref="bottomLeftContainer" name="${RowContainerName.BOTTOM_LEFT}"></ag-row-container>
|
||
<ag-row-container ref="bottomCenterContainer" name="${RowContainerName.BOTTOM_CENTER}"></ag-row-container>
|
||
<ag-row-container ref="bottomRightContainer" name="${RowContainerName.BOTTOM_RIGHT}"></ag-row-container>
|
||
<ag-row-container ref="bottomFullWidthContainer" name="${RowContainerName.BOTTOM_FULL_WIDTH}"></ag-row-container>
|
||
</div>
|
||
<ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>
|
||
<ag-overlay-wrapper></ag-overlay-wrapper>
|
||
</div>`;class GridBodyComp extends Component{constructor(){super(GRID_BODY_TEMPLATE)}init(){const e=(i,n)=>{const o=`${i}px`;n.style.minHeight=o,n.style.height=o},t={setRowAnimationCssOnBodyViewport:(i,n)=>this.setRowAnimationCssOnBodyViewport(i,n),setColumnCount:i=>setAriaColCount(this.getGui(),i),setRowCount:i=>setAriaRowCount(this.getGui(),i),setTopHeight:i=>e(i,this.eTop),setBottomHeight:i=>e(i,this.eBottom),setTopDisplay:i=>this.eTop.style.display=i,setBottomDisplay:i=>this.eBottom.style.display=i,setStickyTopHeight:i=>this.eStickyTop.style.height=i,setStickyTopTop:i=>this.eStickyTop.style.top=i,setStickyTopWidth:i=>this.eStickyTop.style.width=i,setColumnMovingCss:(i,n)=>this.addOrRemoveCssClass(i,n),updateLayoutClasses:(i,n)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(r=>{r.toggle(LayoutCssClasses.AUTO_HEIGHT,n.autoHeight),r.toggle(LayoutCssClasses.NORMAL,n.normal),r.toggle(LayoutCssClasses.PRINT,n.print)}),this.addOrRemoveCssClass(LayoutCssClasses.AUTO_HEIGHT,n.autoHeight),this.addOrRemoveCssClass(LayoutCssClasses.NORMAL,n.normal),this.addOrRemoveCssClass(LayoutCssClasses.PRINT,n.print)},setAlwaysVerticalScrollClass:(i,n)=>this.eBodyViewport.classList.toggle(CSS_CLASS_FORCE_VERTICAL_SCROLL,n),registerBodyViewportResizeListener:i=>{const n=this.resizeObserverService.observeResize(this.eBodyViewport,i);this.addDestroyFunc(()=>n())},setPinnedTopBottomOverflowY:i=>this.eTop.style.overflowY=this.eBottom.style.overflowY=i,setCellSelectableCss:(i,n)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(o=>o.classList.toggle(i,n))},setBodyViewportWidth:i=>this.eBodyViewport.style.width=i};this.ctrl=this.createManagedBean(new GridBodyCtrl),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop),(this.rangeService&&this.gridOptionsService.get("enableRangeSelection")||this.gridOptionsService.get("rowSelection")==="multiple")&&setAriaMultiSelectable(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle(RowAnimationCssClasses.ANIMATION_ON,t),i.toggle(RowAnimationCssClasses.ANIMATION_OFF,!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}}__decorate$1F([Autowired("resizeObserverService")],GridBodyComp.prototype,"resizeObserverService",void 0);__decorate$1F([Optional("rangeService")],GridBodyComp.prototype,"rangeService",void 0);__decorate$1F([RefSelector("eBodyViewport")],GridBodyComp.prototype,"eBodyViewport",void 0);__decorate$1F([RefSelector("eStickyTop")],GridBodyComp.prototype,"eStickyTop",void 0);__decorate$1F([RefSelector("eTop")],GridBodyComp.prototype,"eTop",void 0);__decorate$1F([RefSelector("eBottom")],GridBodyComp.prototype,"eBottom",void 0);__decorate$1F([RefSelector("gridHeader")],GridBodyComp.prototype,"headerRootComp",void 0);__decorate$1F([RefSelector("eBody")],GridBodyComp.prototype,"eBody",void 0);__decorate$1F([PostConstruct],GridBodyComp.prototype,"init",null);var __decorate$1E=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ScrollVisibleService=class extends BeanStub{postConstruct(){this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this))}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn(()=>{this.columnAnimationService.executeLaterVMTurn(()=>this.updateImpl())}):this.updateImpl()}updateImpl(){const e=this.ctrlsService.getCenterRowContainerCtrl();if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const i={type:Events.EVENT_SCROLL_VISIBILITY_CHANGED};this.eventService.dispatchEvent(i)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}};__decorate$1E([Autowired("ctrlsService")],ScrollVisibleService.prototype,"ctrlsService",void 0);__decorate$1E([Autowired("columnAnimationService")],ScrollVisibleService.prototype,"columnAnimationService",void 0);__decorate$1E([PostConstruct],ScrollVisibleService.prototype,"postConstruct",null);ScrollVisibleService=__decorate$1E([Bean("scrollVisibleService")],ScrollVisibleService);var __decorate$1D=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},MouseEventService_1;let MouseEventService=MouseEventService_1=class extends BeanStub{constructor(){super(...arguments),this.gridInstanceId=MouseEventService_1.gridInstanceSequence.next()}stampTopLevelGridCompWithGridInstance(e){e[MouseEventService_1.GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(e){return getCtrlForEventTarget(this.gridOptionsService,e.target,CellCtrl.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(e){return this.isElementInThisGrid(e.target)}isElementInThisGrid(e){let t=e;for(;t;){const i=t[MouseEventService_1.GRID_DOM_KEY];if(exists(i))return i===this.gridInstanceId;t=t.parentElement}return!1}getCellPositionForEvent(e){const t=this.getRenderedCellForEvent(e);return t?t.getCellPosition():null}getNormalisedPosition(e){const t=this.gridOptionsService.isDomLayout("normal"),i=e;let n,o;if(i.clientX!=null||i.clientY!=null?(n=i.clientX,o=i.clientY):(n=i.x,o=i.y),t){const r=this.ctrlsService.getGridBodyCtrl(),a=r.getScrollFeature().getVScrollPosition(),l=r.getScrollFeature().getHScrollPosition();n+=l.left,o+=a.top}return{x:n,y:o}}};MouseEventService.gridInstanceSequence=new NumberSequence;MouseEventService.GRID_DOM_KEY="__ag_grid_instance";__decorate$1D([Autowired("ctrlsService")],MouseEventService.prototype,"ctrlsService",void 0);MouseEventService=MouseEventService_1=__decorate$1D([Bean("mouseEventService")],MouseEventService);var __decorate$1C=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let NavigationService=class extends BeanStub{constructor(){super(),this.onPageDown=throttle(this.onPageDown,100),this.onPageUp=throttle(this.onPageUp,100)}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,n=e.altKey,o=e.ctrlKey||e.metaKey,r=!!this.rangeService&&e.shiftKey,a=this.mouseEventService.getCellPositionForEvent(e);let l=!1;switch(i){case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:!o&&!n&&(this.onHomeOrEndKey(i),l=!0);break;case KeyCode.LEFT:case KeyCode.RIGHT:case KeyCode.UP:case KeyCode.DOWN:if(!a)return!1;o&&!n&&!r&&(this.onCtrlUpDownLeftRight(i,a),l=!0);break;case KeyCode.PAGE_DOWN:case KeyCode.PAGE_UP:!o&&!n&&(l=this.handlePageUpDown(i,a,t));break}return l&&e.preventDefault(),l}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),t?(e===KeyCode.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0):!1}navigateTo(e){const{scrollIndex:t,scrollType:i,scrollColumn:n,focusIndex:o,focusColumn:r}=e;if(exists(n)&&!n.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(n),exists(t)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t,i),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(o),this.focusService.setFocusedCell({rowIndex:o,column:r,rowPinned:null,forceBrowserFocus:!0}),this.rangeService){const a={rowIndex:o,rowPinned:null,column:r};this.rangeService.setRangeToCell(a)}}onPageDown(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),n=this.getViewportHeight(),o=this.paginationProxy.getPixelOffset(),r=i.top+n,a=this.paginationProxy.getRowIndexAtPixel(r+o);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,a):this.navigateToNextPage(e,a)}onPageUp(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),n=this.paginationProxy.getPixelOffset(),o=i.top,r=this.paginationProxy.getRowIndexAtPixel(o+n);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r,!0):this.navigateToNextPage(e,r,!0)}navigateToNextPage(e,t,i=!1){const n=this.getViewportHeight(),o=this.paginationProxy.getPageFirstRow(),r=this.paginationProxy.getPageLastRow(),a=this.paginationProxy.getPixelOffset(),l=this.paginationProxy.getRow(e.rowIndex),d=i?(l==null?void 0:l.rowHeight)-n-a:n-a,h=(l==null?void 0:l.rowTop)+d;let p=this.paginationProxy.getRowIndexAtPixel(h+a);if(p===e.rowIndex){const v=i?-1:1;t=p=e.rowIndex+v}let m;i?(m="bottom",p<o&&(p=o),t<o&&(t=o)):(m="top",p>r&&(p=r),t>r&&(t=r)),this.isRowTallerThanView(p)&&(t=p,m="top"),this.navigateTo({scrollIndex:t,scrollType:m,scrollColumn:null,focusIndex:p,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const n=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:n,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){var i;const n=t?-1:1,o=this.getViewportHeight(),r=this.paginationProxy.getPageLastRow();let a=0,l=e.rowIndex;for(;l>=0&&l<=r;){const d=this.paginationProxy.getRow(l);if(d){const h=(i=d.rowHeight)!==null&&i!==void 0?i:0;if(a+h>o)break;a+=h}l+=n}return Math.max(0,Math.min(l,r))}getViewportHeight(){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.gridOptionsService.getScrollbarWidth();let n=t.bottom-t.top;return this.ctrlsService.getCenterRowContainerCtrl().isHorizontalScrollShowing()&&(n-=i),n}isRowTallerThanView(e){const t=this.paginationProxy.getRow(e);if(!t)return!1;const i=t.rowHeight;return typeof i!="number"?!1:i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:n,column:o}=i;this.navigateTo({scrollIndex:n,scrollType:null,scrollColumn:o,focusIndex:n,focusColumn:o})}onHomeOrEndKey(e){const t=e===KeyCode.PAGE_HOME,i=this.columnModel.getAllDisplayedColumns(),n=t?i[0]:last(i),o=t?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:n,focusIndex:o,focusColumn:n})}onTabKeyDown(e,t){const i=t.shiftKey;if(this.tabToNextCellCommon(e,i,t)){t.preventDefault();return}if(i){const{rowIndex:o,rowPinned:r}=e.getRowPosition();(r?o===0:o===this.paginationProxy.getPageFirstRow())&&(this.gridOptionsService.get("headerHeight")===0||this.gridOptionsService.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof CellCtrl&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(i)&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let n=this.getCellByPosition(i);return!n&&(n=this.rowRenderer.getRowByPosition(i),!n||!n.isFullWidth())?!1:this.tabToNextCellCommon(n,e,t)}tabToNextCellCommon(e,t,i){let n=e.isEditing();if(!n&&e instanceof CellCtrl){const a=e.getRowCtrl();a&&(n=a.isEditing())}let o;return n?this.gridOptionsService.get("editType")==="fullRow"?o=this.moveToNextEditingRow(e,t,i):o=this.moveToNextEditingCell(e,t,i):o=this.moveToNextCellNotEditing(e,t),o||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const n=e.getCellPosition();e.getGui().focus(),e.stopEditing();const o=this.findNextCellToFocusOn(n,t,!0);return o==null?!1:(o.startEditing(null,!0,i),o.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const n=e.getCellPosition(),o=this.findNextCellToFocusOn(n,t,!0);if(o==null)return!1;const r=o.getCellPosition(),a=this.isCellEditable(n),l=this.isCellEditable(r),d=r&&n.rowIndex===r.rowIndex&&n.rowPinned===r.rowPinned;return a&&e.setFocusOutOnEditor(),d||(e.getRowCtrl().stopEditing(),o.getRowCtrl().startRowEditing(void 0,void 0,i)),l?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.columnModel.getAllDisplayedColumns();let n;e instanceof RowCtrl?n=Object.assign(Object.assign({},e.getRowPosition()),{column:t?i[0]:last(i)}):n=e.getCellPosition();const o=this.findNextCellToFocusOn(n,t,!1);if(o instanceof CellCtrl)o.focusCell(!0);else if(o)return this.tryToFocusFullWidthRow(o.getRowPosition(),t);return exists(o)}findNextCellToFocusOn(e,t,i){let n=e;for(;;){e!==n&&(e=n),t||(n=this.getLastCellOfColSpan(n)),n=this.cellNavigationService.getNextTabbedCell(n,t);const o=this.gridOptionsService.getCallback("tabToNextCell");if(exists(o)){const d=o({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:n||null});exists(d)?(d.floating&&(warnOnce("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),d.rowPinned=d.floating),n={rowIndex:d.rowIndex,column:d.column,rowPinned:d.rowPinned}):n=null}if(!n)return null;if(n.rowIndex<0){const l=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l+n.rowIndex,column:n.column},fromCell:!0}),null}const r=this.gridOptionsService.get("editType")==="fullRow";if(i&&!r&&!this.isCellEditable(n))continue;this.ensureCellVisible(n);const a=this.getCellByPosition(n);if(!a){const l=this.rowRenderer.getRowByPosition(n);if(!l||!l.isFullWidth()||i)continue;return l}if(!a.isSuppressNavigable())return this.rangeService&&this.rangeService.setRangeToCell(n),a}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return t?e.column.isCellEditable(t):!1}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return e.rowPinned==="top"?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):e.rowPinned==="bottom"?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.paginationProxy.getRow(e.rowIndex)}navigateToNextCell(e,t,i,n){let o=i,r=!1;for(;o&&(o===i||!this.isValidNavigateCell(o));)this.gridOptionsService.get("enableRtl")?t===KeyCode.LEFT&&(o=this.getLastCellOfColSpan(o)):t===KeyCode.RIGHT&&(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextCellToFocus(t,o),r=missing(o);if(r&&e&&e.key===KeyCode.UP&&(o={rowIndex:-1,rowPinned:null,column:i.column}),n){const l=this.gridOptionsService.getCallback("navigateToNextCell");if(exists(l)){const h=l({key:t,previousCellPosition:i,nextCellPosition:o||null,event:e});exists(h)?(h.floating&&(warnOnce("tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?"),h.rowPinned=h.floating),o={rowPinned:h.rowPinned,rowIndex:h.rowIndex,column:h.column}):o=null}}if(!o)return;if(o.rowIndex<0){const l=this.headerNavigationService.getHeaderRowCount();this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l+o.rowIndex,column:i.column},event:e||void 0,fromCell:!0});return}const a=this.getNormalisedPosition(o);a?this.focusPosition(a):this.tryToFocusFullWidthRow(o)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.columnModel.getAllDisplayedColumns(),n=this.rowRenderer.getRowByPosition(e);if(!n||!n.isFullWidth())return!1;const o=this.focusService.getFocusedCell(),r={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?last(i):i[0])};this.focusPosition(r);const a=o!=null?this.rowPositionUtils.before(r,o):!1,l={type:Events.EVENT_FULL_WIDTH_ROW_FOCUSED,rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:r.column,isFullWidthCell:!0,floating:r.rowPinned,fromBelow:a};return this.eventService.dispatchEvent(l),!0}focusPosition(e){this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),this.rangeService&&this.rangeService.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return i.length===1?e:{rowIndex:e.rowIndex,column:last(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gridOptionsService.isGroupRowsSticky(),i=this.rowModel.getRow(e.rowIndex);!(t&&(i==null?void 0:i.sticky))&&missing(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}};__decorate$1C([Autowired("mouseEventService")],NavigationService.prototype,"mouseEventService",void 0);__decorate$1C([Autowired("paginationProxy")],NavigationService.prototype,"paginationProxy",void 0);__decorate$1C([Autowired("focusService")],NavigationService.prototype,"focusService",void 0);__decorate$1C([Optional("rangeService")],NavigationService.prototype,"rangeService",void 0);__decorate$1C([Autowired("columnModel")],NavigationService.prototype,"columnModel",void 0);__decorate$1C([Autowired("rowModel")],NavigationService.prototype,"rowModel",void 0);__decorate$1C([Autowired("ctrlsService")],NavigationService.prototype,"ctrlsService",void 0);__decorate$1C([Autowired("rowRenderer")],NavigationService.prototype,"rowRenderer",void 0);__decorate$1C([Autowired("headerNavigationService")],NavigationService.prototype,"headerNavigationService",void 0);__decorate$1C([Autowired("rowPositionUtils")],NavigationService.prototype,"rowPositionUtils",void 0);__decorate$1C([Autowired("cellNavigationService")],NavigationService.prototype,"cellNavigationService",void 0);__decorate$1C([Autowired("pinnedRowModel")],NavigationService.prototype,"pinnedRowModel",void 0);__decorate$1C([PostConstruct],NavigationService.prototype,"postConstruct",null);NavigationService=__decorate$1C([Bean("navigationService")],NavigationService);var __decorate$1B=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class PopupEditorWrapper extends PopupComponent{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gridOptionsService.setDomData(this.getGui(),PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,i=n=>{isUserSuppressingKeyboardEvent(this.gridOptionsService,n,t.node,t.column,!0)||t.onKeyDown(n)};this.addManagedListener(e,"keydown",i)}}PopupEditorWrapper.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper";__decorate$1B([PostConstruct],PopupEditorWrapper.prototype,"postConstruct",null);class CellComp extends Component{constructor(e,t,i,n,o){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=n,this.cellCtrl=t;const r=document.createElement("div");r.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(r);const a=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const l=(p,m)=>{m!=null&&m!=""?a.setAttribute(p,m):a.removeAttribute(p)};setAriaRole(a,t.getCellAriaRole()),l("col-id",t.getColumnIdSanitised());const d=t.getTabIndex();d!==void 0&&l("tabindex",d.toString());const h={addOrRemoveCssClass:(p,m)=>this.addOrRemoveCssClass(p,m),setUserStyles:p=>addStylesToElement(a,p),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:p=>this.includeSelection=p,setIncludeRowDrag:p=>this.includeRowDrag=p,setIncludeDndSource:p=>this.includeDndSource=p,setRenderDetails:(p,m,v)=>this.setRenderDetails(p,m,v),setEditDetails:(p,m,v)=>this.setEditDetails(p,m,v),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(h,this.getGui(),this.eCellWrapper,i,o)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const o=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(i||o)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,n=i&&this.eCellWrapper==null;if(n){const h=document.createElement("div");h.setAttribute("role","presentation"),h.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=h,this.getGui().appendChild(this.eCellWrapper)}const o=!i&&this.eCellWrapper!=null;o&&(removeFromParent(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const r=!e&&i,a=r&&this.eCellValue==null;if(a){const h=document.createElement("span");h.setAttribute("role","presentation"),h.setAttribute("class","ag-cell-value"),this.eCellValue=h,this.eCellWrapper.appendChild(this.eCellValue)}const l=!r&&this.eCellValue!=null;l&&(removeFromParent(this.eCellValue),this.eCellValue=void 0);const d=n||o||a||l;return d&&this.removeControls(),e||t&&this.addControls(),d}addControls(){this.includeRowDrag&&this.rowDraggingComp==null&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&this.dndSourceComp==null&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const n=this.editorVersion,o=e.newAgStackInstance();if(!o)return;const{params:r}=e;o.then(l=>this.afterCellEditorCreated(n,l,r,t,i)),missing(this.cellEditor)&&r.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();clearElement(t);const i=e!=null?escapeString(e,!0):null;i!=null&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),removeFromParent(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),removeFromParent(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer==null||this.cellRenderer.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){const i=!this.beans.gridOptionsService.get("suppressAnimationFrame"),n=this.rendererVersion,{componentClass:o}=e,r=()=>{if(this.rendererVersion!==n||!this.isAlive())return;const l=e.newAgStackInstance(),d=this.afterCellRendererCreated.bind(this,n,o);l&&l.then(d)};i&&this.firstRender?this.beans.animationFrameService.createTask(r,this.rowNode.rowIndex,"createTasksP2"):r()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(i);return}if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),this.cellRendererGui!=null){const o=this.getParentOfValue();clearElement(o),o.appendChild(this.cellRendererGui)}}afterCellEditorCreated(e,t,i,n,o){if(e!==this.editorVersion){this.beans.context.destroyBean(t);return}if(t.isCancelBeforeStart&&t.isCancelBeforeStart()){this.beans.context.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){console.warn(`AG Grid: cellEditor for column ${this.column.getId()} is missing getGui() method`),this.beans.context.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const l=n||t.isPopup!==void 0&&t.isPopup();l?this.addPopupCellEditor(i,o):this.addInCellEditor(),this.refreshEditStyles(!0,l),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),(i=this.rowCtrl)===null||i===void 0||i.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui(),t=this.beans.gridOptionsService.getDocument();e.contains(t.activeElement)&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){this.beans.gridOptionsService.get("editType")==="fullRow"&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new PopupEditorWrapper(e));const n=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&n.appendChild(this.cellEditorGui);const o=this.beans.popupService,r=this.beans.gridOptionsService.get("stopEditingWhenCellsLoseFocus"),a=t??(i.getPopupPosition?i.getPopupPosition():"over"),l=this.beans.gridOptionsService.get("enableRtl"),d={ePopup:n,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:a,alignSide:l?"right":"left",keepWithinBounds:!0},h=o.positionPopupByComponent.bind(o,d),p=this.beans.localeService.getLocaleTextFunc(),m=o.addPopup({modal:r,eChild:n,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:h,ariaLabel:p("ariaLabelCellEditor","Cell Editor")});m&&(this.hideEditorPopup=m.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui(),t=this.beans.gridOptionsService.getDocument();e.contains(t.activeElement)&&browserSupportsPreventScroll()&&e.focus({preventScroll:!0}),clearElement(this.getParentOfValue())}}class RowComp extends Component{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const n=document.createElement("div");n.setAttribute("comp-id",`${this.getCompId()}`),n.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(n);const o=this.getGui(),r=o.style;this.domOrder=this.rowCtrl.getDomOrder(),setAriaRole(o,"row");const a=this.rowCtrl.getTabIndex();a!=null&&o.setAttribute("tabindex",a.toString());const l={setDomOrder:d=>this.domOrder=d,setCellCtrls:d=>this.setCellCtrls(d),showFullWidth:d=>this.showFullWidth(d),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(d,h)=>this.addOrRemoveCssClass(d,h),setUserStyles:d=>addStylesToElement(o,d),setTop:d=>r.top=d,setTransform:d=>r.transform=d,setRowIndex:d=>o.setAttribute("row-index",d),setRowId:d=>o.setAttribute("row-id",d),setRowBusinessKey:d=>o.setAttribute("row-business-key",d),refreshFullWidth:d=>this.refreshFullWidth(d)};e.setComp(l,this.getGui(),i),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=n=>{if(this.isAlive()){const o=n.getGui();this.getGui().appendChild(o),this.rowCtrl.setupDetailRowAutoHeight(o),this.setFullWidthRowComp(n)}else this.beans.context.destroyBean(n)},i=e.newAgStackInstance();i&&i.then(t)}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(n=>{const o=n.getInstanceId();this.cellComps[o]==null?this.newCellComp(n):t[o]=null});const i=getAllValuesInObject(t).filter(n=>n!=null);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(i=>{const n=this.cellComps[i.getInstanceId()];n&&t.push(n.getGui())}),setDomChildOrder(this.getGui(),t)}newCellComp(e){const t=new CellComp(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=getAllValuesInObject(this.cellComps).filter(t=>t!=null);this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&console.error("AG Grid - should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)})}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach(t=>{if(!t)return;const i=t.getCtrl().getInstanceId();this.cellComps[i]===t&&(t.detach(),t.destroy(),this.cellComps[i]=null)})}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const i=e();return t.refresh(i)}}var __decorate$1A=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};function templateFactory(){const s=Component.elementGettingCreated.getAttribute("name"),e=RowContainerCtrl.getRowContainerCssClasses(s);let t;return s===RowContainerName.CENTER||s===RowContainerName.TOP_CENTER||s===RowContainerName.STICKY_TOP_CENTER||s===RowContainerName.BOTTOM_CENTER?t=`<div class="${e.viewport}" ref="eViewport" role="presentation">
|
||
<div class="${e.container}" ref="eContainer"></div>
|
||
</div>`:t=`<div class="${e.container}" ref="eContainer"></div>`,t}class RowContainerComp extends Component{constructor(){super(templateFactory()),this.rowComps={},this.name=Component.elementGettingCreated.getAttribute("name"),this.type=getRowContainerTypeForName(this.name)}postConstruct(){const e={setViewportHeight:i=>this.eViewport.style.height=i,setRowCtrls:({rowCtrls:i})=>this.setRowCtrls(i),setDomOrder:i=>{this.domOrder=i},setContainerWidth:i=>this.eContainer.style.width=i};this.createManagedBean(new RowContainerCtrl(this.name)).setComp(e,this.eContainer,this.eViewport)}preDestroy(){this.setRowCtrls([])}setRowCtrls(e){const t=Object.assign({},this.rowComps);this.rowComps={},this.lastPlacedElement=null;const i=n=>{const o=n.getInstanceId(),r=t[o];if(r)this.rowComps[o]=r,delete t[o],this.ensureDomOrder(r.getGui());else{if(!n.getRowNode().displayed)return;const a=new RowComp(n,this.beans,this.type);this.rowComps[o]=a,this.appendRow(a.getGui())}};e.forEach(i),getAllValuesInObject(t).forEach(n=>{this.eContainer.removeChild(n.getGui()),n.destroy()}),setAriaRole(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?insertWithDomOrder(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(ensureDomOrder(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}}__decorate$1A([Autowired("beans")],RowContainerComp.prototype,"beans",void 0);__decorate$1A([RefSelector("eViewport")],RowContainerComp.prototype,"eViewport",void 0);__decorate$1A([RefSelector("eContainer")],RowContainerComp.prototype,"eContainer",void 0);__decorate$1A([PostConstruct],RowContainerComp.prototype,"postConstruct",null);__decorate$1A([PreDestroy],RowContainerComp.prototype,"preDestroy",null);var __decorate$1z=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class BodyDropPivotTarget{constructor(e){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}onDragEnter(e){if(this.clearColumnsList(),this.gridOptionsService.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach(i=>{i.isPrimary()&&(i.isAnyFunctionActive()||(i.isAllowValue()?this.columnsToAggregate.push(i):i.isAllowRowGroup()?this.columnsToGroup.push(i):i.isAllowPivot()&&this.columnsToPivot.push(i)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?DragAndDropService.ICON_PINNED:DragAndDropService.ICON_MOVE:null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.columnModel.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnModel.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnModel.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}}__decorate$1z([Autowired("columnModel")],BodyDropPivotTarget.prototype,"columnModel",void 0);__decorate$1z([Autowired("gridOptionsService")],BodyDropPivotTarget.prototype,"gridOptionsService",void 0);class ColumnMoveHelper{static attemptMoveColumns(e){const{isFromHeader:t,hDirection:i,xPosition:n,fromEnter:o,fakeEvent:r,pinned:a,gridOptionsService:l,columnModel:d}=e,h=i===HorizontalDirection.Left,p=i===HorizontalDirection.Right;let{allMovingColumns:m}=e;if(t){let D=[];m.forEach(x=>{var M;let I=null,V=x.getParent();for(;V!=null&&V.getDisplayedLeafColumns().length===1;)I=V,V=V.getParent();I!=null?(!!(!((M=I.getColGroupDef())===null||M===void 0)&&M.marryChildren)?I.getProvidedColumnGroup().getLeafColumns():I.getLeafColumns()).forEach(K=>{D.includes(K)||D.push(K)}):D.includes(x)||D.push(x)}),m=D}const v=m.slice();d.sortColumnsLikeGridColumns(v);const y=this.calculateValidMoves({movingCols:v,draggingRight:p,xPosition:n,pinned:a,gridOptionsService:l,columnModel:d}),b=this.calculateOldIndex(v,d);if(y.length===0)return;const S=y[0];let E=b!==null&&!o;if(t&&(E=b!==null),E&&!r&&(h&&S>=b||p&&S<=b))return;const T=d.getAllDisplayedColumns();let R=[],A=null;for(let D=0;D<y.length;D++){const x=y[D],M=d.getProposedColumnOrder(v,x);if(!d.doesOrderPassRules(M))continue;const I=M.filter(z=>T.includes(z));if(A===null)A=I;else if(!areEqual(I,A))break;const V=this.groupFragCount(M);R.push({move:x,fragCount:V})}if(R.length!==0)return R.sort((D,x)=>D.fragCount-x.fragCount),this.moveColumns(m,R[0].move,"uiColumnMoved",!1,d)}static moveColumns(e,t,i,n,o){return o.moveColumns(e,t,i,n),n?null:{columns:e,toIndex:t}}static calculateOldIndex(e,t){const i=t.getAllGridColumns(),n=sortNumerically(e.map(d=>i.indexOf(d))),o=n[0];return last(n)-o!==n.length-1?null:o}static groupFragCount(e){function t(n){let o=[],r=n.getOriginalParent();for(;r!=null;)o.push(r),r=r.getOriginalParent();return o}let i=0;for(let n=0;n<e.length-1;n++){let o=t(e[n]),r=t(e[n+1]);[o,r]=o.length>r.length?[o,r]:[r,o],o.forEach(a=>{r.indexOf(a)===-1&&i++})}return i}static calculateValidMoves(e){const{movingCols:t,draggingRight:i,xPosition:n,pinned:o,gridOptionsService:r,columnModel:a}=e;if(r.get("suppressMovableColumns")||t.some(R=>R.getColDef().suppressMovable))return[];const d=a.getDisplayedColumns(o),h=a.getAllGridColumns(),p=d.filter(R=>includes(t,R)),m=d.filter(R=>!includes(t,R)),v=h.filter(R=>!includes(t,R));let y=0,b=n;if(i){let R=0;p.forEach(A=>R+=A.getActualWidth()),b-=R}if(b>0){for(let R=0;R<m.length;R++){const A=m[R];if(b-=A.getActualWidth(),b<0)break;y++}i&&y++}let S;if(y>0){const R=m[y-1];S=v.indexOf(R)+1}else S=v.indexOf(m[0]),S===-1&&(S=0);const E=[S],T=(R,A)=>R-A;if(i){let R=S+1;const A=h.length-1;for(;R<=A;)E.push(R),R++;E.sort(T)}else{let R=S;const A=h.length-1;let D=h[R];for(;R<=A&&d.indexOf(D)<0;)R++,E.push(R),D=h[R];R=S-1;const x=0;for(;R>=x;)E.push(R),R--;E.sort(T).reverse()}return E}static normaliseX(e,t,i,n,o){const r=o.getHeaderRowContainerCtrl(t).getViewport();return i&&(e-=r.getBoundingClientRect().left),n.get("enableRtl")&&(e=r.clientWidth-e),t==null&&(e+=o.getCenterRowContainerCtrl().getCenterViewportScrollLeft()),e}}var __decorate$1y=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class MoveColumnFeature{constructor(e,t){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.eContainer=t,this.centerContainer=!exists(e)}init(){this.ctrlsService.whenReady(()=>{this.gridBodyCon=this.ctrlsService.getGridBodyCtrl()})}getIconName(){return this.pinned?DragAndDropService.ICON_PINNED:DragAndDropService.ICON_MOVE}onDragEnter(e){const t=e.dragItem.columns;if(e.dragSource.type===DragSourceType.ToolPanel)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const n=e.dragItem.visibleState,o=(t||[]).filter(r=>n[r.getId()]);this.setColumnsVisible(o,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(e){const n=e.filter(o=>!o.getColDef().lockVisible);this.columnModel.setColumnsVisible(n,t,i)}}setColumnsPinned(e,t,i){if(e){const n=e.filter(o=>!o.getColDef().lockPinned);this.columnModel.setColumnsPinned(n,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(e){if(this.centerContainer){const t=this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft(),i=t+this.ctrlsService.getCenterRowContainerCtrl().getCenterWidth();this.gridOptionsService.get("enableRtl")?(this.needToMoveRight=e<t+50,this.needToMoveLeft=e>i-50):(this.needToMoveLeft=e<t+50,this.needToMoveRight=e>i-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,n=!1){var o;if(n){if(this.lastMovedInfo){const{columns:p,toIndex:m}=this.lastMovedInfo;ColumnMoveHelper.moveColumns(p,m,"uiColumnMoved",!0,this.columnModel)}return}if(this.lastDraggingEvent=e,missing(e.hDirection))return;const r=ColumnMoveHelper.normaliseX(e.x,this.pinned,!1,this.gridOptionsService,this.ctrlsService);t||this.checkCenterForScrolling(r);const a=this.normaliseDirection(e.hDirection),l=e.dragSource.type,d=((o=e.dragSource.getDragItem().columns)===null||o===void 0?void 0:o.filter(p=>p.getColDef().lockPinned?p.getPinned()==this.pinned:!0))||[],h=ColumnMoveHelper.attemptMoveColumns({allMovingColumns:d,isFromHeader:l===DragSourceType.HeaderCell,hDirection:a,xPosition:r,pinned:this.pinned,fromEnter:t,fakeEvent:i,gridOptionsService:this.gridOptionsService,columnModel:this.columnModel});h&&(this.lastMovedInfo=h)}normaliseDirection(e){if(this.gridOptionsService.get("enableRtl"))switch(e){case HorizontalDirection.Left:return HorizontalDirection.Right;case HorizontalDirection.Right:return HorizontalDirection.Left;default:console.error(`AG Grid: Unknown direction ${e}`)}else return e}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(DragAndDropService.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(DragAndDropService.ICON_RIGHT,!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(DragAndDropService.ICON_MOVE))}moveInterval(){let e;this.intervalCount++,e=10+this.intervalCount*5,e>100&&(e=100);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const o=this.lastDraggingEvent.dragItem.columns.filter(r=>!r.getColDef().lockPinned);if(o.length>0&&(this.dragAndDropService.setGhostIcon(DragAndDropService.ICON_PINNED),this.failedMoveAttempts>7)){const r=this.needToMoveLeft?"left":"right";this.setColumnsPinned(o,r,"uiColumnDragged"),this.dragAndDropService.nudge()}}}}__decorate$1y([Autowired("columnModel")],MoveColumnFeature.prototype,"columnModel",void 0);__decorate$1y([Autowired("dragAndDropService")],MoveColumnFeature.prototype,"dragAndDropService",void 0);__decorate$1y([Autowired("gridOptionsService")],MoveColumnFeature.prototype,"gridOptionsService",void 0);__decorate$1y([Autowired("ctrlsService")],MoveColumnFeature.prototype,"ctrlsService",void 0);__decorate$1y([PostConstruct],MoveColumnFeature.prototype,"init",null);var __decorate$1x=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class BodyDropTarget extends BeanStub{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.leftRowContainerCtrl.getContainerElement()],[e.bottomLeftRowContainerCtrl.getContainerElement()],[e.topLeftRowContainerCtrl.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.rightRowContainerCtrl.getContainerElement()],[e.bottomRightRowContainerCtrl.getContainerElement()],[e.topRightRowContainerCtrl.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.centerRowContainerCtrl.getViewportElement()],[e.bottomCenterRowContainerCtrl.getViewportElement()],[e.topCenterRowContainerCtrl.getViewportElement()]];break}})}isInterestedIn(e){return e===DragSourceType.HeaderCell||e===DragSourceType.ToolPanel&&this.gridOptionsService.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}init(){this.moveColumnFeature=this.createManagedBean(new MoveColumnFeature(this.pinned,this.eContainer)),this.bodyDropPivotTarget=this.createManagedBean(new BodyDropPivotTarget(this.pinned)),this.dragAndDropService.addDropTarget(this)}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&e.dragSource.type===DragSourceType.ToolPanel}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}}__decorate$1x([Autowired("dragAndDropService")],BodyDropTarget.prototype,"dragAndDropService",void 0);__decorate$1x([Autowired("columnModel")],BodyDropTarget.prototype,"columnModel",void 0);__decorate$1x([Autowired("ctrlsService")],BodyDropTarget.prototype,"ctrlsService",void 0);__decorate$1x([PostConstruct],BodyDropTarget.prototype,"postConstruct",null);__decorate$1x([PostConstruct],BodyDropTarget.prototype,"init",null);var __decorate$1w=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class HeaderCellComp extends AbstractHeaderCellComp{constructor(e){super(HeaderCellComp.TEMPLATE,e),this.headerCompVersion=0,this.column=e.getColumnGroupChild(),this.pinned=e.getPinned()}postConstruct(){const e=this.getGui();((o,r)=>{r!=null&&r!=""?e.setAttribute(o,r):e.removeAttribute(o)})("col-id",this.column.getColId());const i={setWidth:o=>e.style.width=o,addOrRemoveCssClass:(o,r)=>this.addOrRemoveCssClass(o,r),setAriaSort:o=>o?setAriaSort(e,o):removeAriaSort(e),setUserCompDetails:o=>this.setUserCompDetails(o),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(i,this.getGui(),this.eResize,this.eHeaderCompWrapper);const n=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",n)}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(i=>this.afterCompCreated(t,i))}afterCompCreated(e,t){if(e!=this.headerCompVersion||!this.isAlive()){this.destroyBean(t);return}this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}}HeaderCellComp.TEMPLATE=`<div class="ag-header-cell" role="columnheader">
|
||
<div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
|
||
<div ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>
|
||
</div>`;__decorate$1w([RefSelector("eResize")],HeaderCellComp.prototype,"eResize",void 0);__decorate$1w([RefSelector("eHeaderCompWrapper")],HeaderCellComp.prototype,"eHeaderCompWrapper",void 0);__decorate$1w([PostConstruct],HeaderCellComp.prototype,"postConstruct",null);__decorate$1w([PreDestroy],HeaderCellComp.prototype,"destroyHeaderComp",null);var __decorate$1v=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class HeaderGroupCellComp extends AbstractHeaderCellComp{constructor(e){super(HeaderGroupCellComp.TEMPLATE,e)}postConstruct(){const e=this.getGui(),t=(n,o)=>o!=null?e.setAttribute(n,o):e.removeAttribute(n);e.setAttribute("col-id",this.ctrl.getColId());const i={addOrRemoveCssClass:(n,o)=>this.addOrRemoveCssClass(n,o),setResizableDisplayed:n=>setDisplayed(this.eResize,n),setWidth:n=>e.style.width=n,setAriaExpanded:n=>t("aria-expanded",n),setUserCompDetails:n=>this.setUserCompDetails(n),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(i,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then(t=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}const i=this.getGui(),n=e.getGui();i.appendChild(n),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}}HeaderGroupCellComp.TEMPLATE=`<div class="ag-header-group-cell" role="columnheader">
|
||
<div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
|
||
</div>`;__decorate$1v([RefSelector("eResize")],HeaderGroupCellComp.prototype,"eResize",void 0);__decorate$1v([PostConstruct],HeaderGroupCellComp.prototype,"postConstruct",null);var __decorate$1u=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},HeaderRowType;(function(s){s.COLUMN_GROUP="group",s.COLUMN="column",s.FLOATING_FILTER="filter"})(HeaderRowType||(HeaderRowType={}));class HeaderRowComp extends Component{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}init(){setAriaRowIndex(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:t=>this.getGui().style.height=t,setTop:t=>this.getGui().style.top=t,setHeaderCtrls:(t,i)=>this.setHeaderCtrls(t,i),setWidth:t=>this.getGui().style.width=t};this.ctrl.setComp(e)}destroyHeaderCtrls(){this.setHeaderCtrls([],!1)}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach(n=>{const o=n.getInstanceId();let r=i[o];delete i[o],r==null&&(r=this.createHeaderComp(n),this.getGui().appendChild(r.getGui())),this.headerComps[o]=r}),iterateObject(i,(n,o)=>{this.getGui().removeChild(o.getGui()),this.destroyBean(o)}),t){const n=getAllValuesInObject(this.headerComps);n.sort((r,a)=>{const l=r.getCtrl().getColumnGroupChild().getLeft(),d=a.getCtrl().getColumnGroupChild().getLeft();return l-d});const o=n.map(r=>r.getGui());setDomChildOrder(this.getGui(),o)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case HeaderRowType.COLUMN_GROUP:t=new HeaderGroupCellComp(e);break;case HeaderRowType.FLOATING_FILTER:t=new HeaderFilterCellComp(e);break;default:t=new HeaderCellComp(e);break}return this.createBean(t),t.setParentComponent(this),t}}__decorate$1u([PostConstruct],HeaderRowComp.prototype,"init",null);__decorate$1u([PreDestroy],HeaderRowComp.prototype,"destroyHeaderCtrls",null);var __decorate$1t=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let instanceIdSequence$1=0;class AbstractHeaderCellCtrl extends BeanStub{constructor(e,t,i){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=e,this.parentRowCtrl=i,this.beans=t,this.instanceId=e.getUniqueId()+"-"+instanceIdSequence$1++}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],()=>this.refreshTabIndex())}shouldStopEventPropagation(e){const{headerRowIndex:t,column:i}=this.focusService.getFocusedHeader();return isUserSuppressingHeaderKeyboardEvent(this.gridOptionsService,e,t,i)}getWrapperHasFocus(){return this.gridOptionsService.getDocument().activeElement===this.eGui}setGui(e){this.eGui=e,this.addDomData(),this.addManagedListener(this.beans.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onDisplayedColumnsChanged(){!this.comp||!this.column||(this.refreshFirstAndLastStyles(),this.refreshAriaColIndex())}refreshFirstAndLastStyles(){const{comp:e,column:t,beans:i}=this;CssClassApplier.refreshFirstAndLastStyles(e,t,i.columnModel)}refreshAriaColIndex(){const{beans:e,column:t}=this,i=e.columnModel.getAriaColumnIndex(t);setAriaColIndex(this.eGui,i)}addResizeAndMoveKeyboardListeners(){this.resizeFeature&&(this.addManagedListener(this.eGui,"keydown",this.onGuiKeyDown.bind(this)),this.addManagedListener(this.eGui,"keyup",this.onGuiKeyUp.bind(this)))}refreshTabIndex(){this.gridOptionsService.get("suppressHeaderFocus")?this.eGui.removeAttribute("tabindex"):this.eGui.setAttribute("tabindex","-1")}onGuiKeyDown(e){var t;const n=this.gridOptionsService.getDocument().activeElement,o=e.key===KeyCode.LEFT||e.key===KeyCode.RIGHT;if(this.isResizing&&(e.preventDefault(),e.stopImmediatePropagation()),n!==this.eGui||!e.shiftKey&&!e.altKey||((this.isResizing||o)&&(e.preventDefault(),e.stopImmediatePropagation()),!o))return;const r=e.key===KeyCode.LEFT!==this.gridOptionsService.get("enableRtl"),a=HorizontalDirection[r?"Left":"Right"];if(e.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const l=this.getViewportAdjustedResizeDiff(e);this.resizeHeader(l,e.shiftKey),(t=this.resizeFeature)===null||t===void 0||t.toggleColumnResizing(!0)}else this.moveHeader(a)}getViewportAdjustedResizeDiff(e){let t=this.getResizeDiff(e);if(this.column.getPinned()){const n=this.pinnedWidthService.getPinnedLeftWidth(),o=this.pinnedWidthService.getPinnedRightWidth(),r=getInnerWidth(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(n+o+t>r)if(r>n+o)t=r-n-o;else return 0}return t}getResizeDiff(e){let t=e.key===KeyCode.LEFT!==this.gridOptionsService.get("enableRtl");const i=this.column.getPinned(),n=this.gridOptionsService.get("enableRtl");return i&&n!==(i==="right")&&(t=!t),(t?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=setTimeout(()=>{var e;(e=this.resizeFeature)===null||e===void 0||e.toggleColumnResizing(!1)},150))}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case KeyCode.PAGE_DOWN:case KeyCode.PAGE_UP:case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:t&&e.preventDefault()}}addDomData(){const e=AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL;this.gridOptionsService.setDomData(this.eGui,e,this),this.addDestroyFunc(()=>this.gridOptionsService.setDomData(this.eGui,e,null))}getGui(){return this.eGui}focus(e){return this.eGui?(this.lastFocusEvent=e||null,this.eGui.focus(),!0):!1}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(e,t,i){const n=e??t;this.gridOptionsService.get("preventDefaultOnContextMenu")&&n.preventDefault();const o=i instanceof Column?i:void 0;this.menuService.isHeaderContextMenuEnabled(o)&&this.menuService.showHeaderContextMenu(o,e,t),this.dispatchColumnMouseEvent(Events.EVENT_COLUMN_HEADER_CONTEXT_MENU,i)}dispatchColumnMouseEvent(e,t){const i={type:e,column:t};this.eventService.dispatchEvent(i)}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}}AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL="headerCtrl";__decorate$1t([Autowired("pinnedWidthService")],AbstractHeaderCellCtrl.prototype,"pinnedWidthService",void 0);__decorate$1t([Autowired("focusService")],AbstractHeaderCellCtrl.prototype,"focusService",void 0);__decorate$1t([Autowired("userComponentFactory")],AbstractHeaderCellCtrl.prototype,"userComponentFactory",void 0);__decorate$1t([Autowired("ctrlsService")],AbstractHeaderCellCtrl.prototype,"ctrlsService",void 0);__decorate$1t([Autowired("dragAndDropService")],AbstractHeaderCellCtrl.prototype,"dragAndDropService",void 0);__decorate$1t([Autowired("menuService")],AbstractHeaderCellCtrl.prototype,"menuService",void 0);__decorate$1t([PostConstruct],AbstractHeaderCellCtrl.prototype,"postConstruct",null);var __decorate$1s=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class SetLeftFeature extends BeanStub{constructor(e,t,i,n){super(),this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=n,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gridOptionsService.get("enableRtl")&&this.colsSpanning?last(this.colsSpanning):this.columnOrGroup}postConstruct(){this.addManagedListener(this.columnOrGroup,Column.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onLeftChanged.bind(this))}setLeftFirstTime(){const e=this.beans.gridOptionsService.get("suppressColumnMoveAnimation"),t=exists(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),n=this.modifyLeftForPrintLayout(e,i),o=this.modifyLeftForPrintLayout(e,t);this.setLeft(n),this.actualLeft=o,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===o&&this.setLeft(o)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gridOptionsService.isDomLayout("print")||e.getPinned()==="left")return t;const n=this.beans.columnModel.getDisplayedColumnsLeftWidth();if(e.getPinned()==="right"){const o=this.beans.columnModel.getBodyContainerWidth();return n+o+t}return n+t}setLeft(e){if(exists(e)&&(this.eCell.style.left=`${e}px`),this.columnOrGroup instanceof Column)this.columnOrGroup;else{const i=this.columnOrGroup.getLeafColumns();if(!i.length)return;i.length>1&&setAriaColSpan(this.ariaEl,i.length),i[0]}}}__decorate$1s([PostConstruct],SetLeftFeature.prototype,"postConstruct",null);var __decorate$1r=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class HoverFeature extends BeanStub{constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gridOptionsService.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListener(this.element,"mouseout",this.onMouseOut.bind(this)),this.addManagedListener(this.element,"mouseover",this.onMouseOver.bind(this))}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}}__decorate$1r([Autowired("columnHoverService")],HoverFeature.prototype,"columnHoverService",void 0);__decorate$1r([PostConstruct],HoverFeature.prototype,"postConstruct",null);class HeaderFilterCellCtrl extends AbstractHeaderCellCtrl{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,n){this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=n,this.setGui(t),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this)),this.setupFilterChangedListener(),this.addManagedListener(this.column,Column.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=createIconNoSpan("filter",this.gridOptionsService,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new ManagedFocusFeature(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();setAriaLabel(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gridOptionsService.getDocument().activeElement===this.eGui)return;const o=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(o){this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),o.focus();return}const r=this.findNextColumnWithFloatingFilter(e.shiftKey);r&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:r},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.columnModel;let i=this.column;do if(i=e?t.getDisplayedColBefore(i):t.getDisplayedColAfter(i),!i)break;while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case KeyCode.UP:case KeyCode.DOWN:t||e.preventDefault();case KeyCode.LEFT:case KeyCode.RIGHT:if(t)return;e.stopPropagation();case KeyCode.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case KeyCode.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const i=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),n=!!e.relatedTarget&&isElementChildOfClass(e.relatedTarget,"ag-floating-filter");if(i&&n&&e.target===this.eGui){const r=this.lastFocusEvent,a=!!(r&&r.key===KeyCode.TAB);if(r&&a){const l=r.shiftKey;this.focusService.focusInto(this.eGui,l)}}const o=this.getRowIndex();this.beans.focusService.setFocusedHeader(o,this.column)}setupHover(){this.createManagedBean(new HoverFeature([this.column],this.eGui));const e=()=>{if(!this.gridOptionsService.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",t)};this.addManagedListener(this.eventService,Events.EVENT_COLUMN_HOVER_CHANGED,e),e()}setupLeft(){const e=new SetLeftFeature(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const e=this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:e}=this.beans,t=i=>{const n=this.comp.getFloatingFilterComp();n&&n.then(o=>{if(o){const r=e.getCurrentFloatingFilterParentModel(this.column);o.onParentModelChanged(r,i)}})};this.destroySyncListener=this.addManagedListener(this.column,Column.EVENT_FILTER_CHANGED,t),e.isFilterActive(this.column)&&t(null)}setupWidth(){const e=()=>{const t=`${this.column.getActualWidth()}px`;this.comp.setWidth(t)};this.addManagedListener(this.column,Column.EVENT_WIDTH_CHANGED,e),e()}setupFilterChangedListener(){this.active&&(this.destroyFilterChangedListener=this.addManagedListener(this.column,Column.EVENT_FILTER_CHANGED,this.updateFilterButton.bind(this)),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=this.beans.filterManager.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){var e,t;const i=this.active;this.setupActive();const n=!i&&this.active;i&&!this.active&&((e=this.destroySyncListener)===null||e===void 0||e.call(this),(t=this.destroyFilterChangedListener)===null||t===void 0||t.call(this));const o=this.active?this.beans.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();!r||!o?this.updateCompDetails(o,n):r.then(a=>{var l;!a||this.beans.filterManager.areFilterCompsDifferent((l=this.userCompDetails)!==null&&l!==void 0?l:null,o)?this.updateCompDetails(o,n):this.updateFloatingFilterParams(o)})}updateCompDetails(e,t){this.isAlive()&&(this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(e){var t;if(!e)return;const i=e.params;(t=this.comp.getFloatingFilterComp())===null||t===void 0||t.then(n=>{let o=!1;n!=null&&n.refresh&&typeof n.refresh=="function"&&n.refresh(i)!==null&&(o=!0),!o&&(n!=null&&n.onParamsUpdated)&&typeof n.onParamsUpdated=="function"&&n.onParamsUpdated(i)!==null&&warnOnce("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")})}destroy(){super.destroy(),this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.destroySyncListener=null,this.destroyFilterChangedListener=null}}var __decorate$1q=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class ResizeFeature extends BeanStub{constructor(e,t,i,n,o){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=n,this.ctrl=o}postConstruct(){const e=[];let t,i;const n=()=>{if(setDisplayed(this.eResize,t),!t)return;const a=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(a),i){const l=this.gridOptionsService.get("skipHeaderOnAutoSize"),d=()=>{this.columnModel.autoSizeColumn(this.column,"uiColumnResized",l)};this.eResize.addEventListener("dblclick",d);const h=new TouchListener(this.eResize);h.addEventListener(TouchListener.EVENT_DOUBLE_TAP,d),e.push(()=>{this.eResize.removeEventListener("dblclick",d),h.removeEventListener(TouchListener.EVENT_DOUBLE_TAP,d),h.destroy()})}},o=()=>{e.forEach(a=>a()),e.length=0},r=()=>{const a=this.column.isResizable(),l=!this.gridOptionsService.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(a!==t||l!==i)&&(t=a,i=l,o(),n())};r(),this.addDestroyFunc(o),this.ctrl.addRefreshFunction(r)}onResizing(e,t){const{column:i,lastResizeAmount:n,resizeStartWidth:o}=this,r=this.normaliseResizeAmount(t),a=o+r,l=[{key:i,newWidth:a}];if(this.column.getPinned()){const d=this.pinnedWidthService.getPinnedLeftWidth(),h=this.pinnedWidthService.getPinnedRightWidth(),p=getInnerWidth(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(d+h+(r-n)>p)return}this.lastResizeAmount=r,this.columnModel.setColumnWidths(l,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i=this.pinned!=="left",n=this.pinned==="right";return this.gridOptionsService.get("enableRtl")?i&&(t*=-1):n&&(t*=-1),t}}__decorate$1q([Autowired("horizontalResizeService")],ResizeFeature.prototype,"horizontalResizeService",void 0);__decorate$1q([Autowired("pinnedWidthService")],ResizeFeature.prototype,"pinnedWidthService",void 0);__decorate$1q([Autowired("ctrlsService")],ResizeFeature.prototype,"ctrlsService",void 0);__decorate$1q([Autowired("columnModel")],ResizeFeature.prototype,"columnModel",void 0);__decorate$1q([PostConstruct],ResizeFeature.prototype,"postConstruct",null);var __decorate$1p=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class SelectAllFeature extends BeanStub{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}onSpaceKeyDown(e){const t=this.cbSelectAll,i=this.gridOptionsService.getDocument();t.isDisplayed()&&!t.getGui().contains(i.activeElement)&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new AgCheckbox),this.cbSelectAll.addCssClass("ag-header-select-all"),setAriaRole(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,Events.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_PAGINATION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,Events.EVENT_FIELD_VALUE_CHANGED,this.onCbSelectAll.bind(this)),setAriaHidden(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),i=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),n=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${n} (${i})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${n} (${i})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return this.gridOptionsService.get("rowSelection")==="multiple"?!0:(console.warn(`AG Grid: ${e} is only available if using 'multiple' rowSelection.`),!1)}checkRightRowModelType(e){const t=this.rowModel.getType();return t==="clientSide"||t==="serverSide"?!0:(console.warn(`AG Grid: ${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let n="uiSelectAll";i?n="uiSelectAllCurrentPage":t&&(n="uiSelectAllFiltered");const o={source:n,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(o):this.selectionService.deselectAllRowNodes(o)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;if(typeof e=="function"){const t=e,i=this.gridOptionsService.addGridCommonParams({column:this.column,colDef:this.column.getColDef()});e=t(i)}return e?this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection"):!1}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}}__decorate$1p([Autowired("rowModel")],SelectAllFeature.prototype,"rowModel",void 0);__decorate$1p([Autowired("selectionService")],SelectAllFeature.prototype,"selectionService",void 0);class HeaderCellCtrl extends AbstractHeaderCellCtrl{constructor(e,t,i){super(e,t,i),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,n){this.comp=e,this.setGui(t),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(n),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new ResizeFeature(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new HoverFeature([this.column],t)),this.createManagedBean(new SetLeftFeature(this.column,t,this.beans)),this.createManagedBean(new ManagedFocusFeature(t,{shouldStopEventPropagation:o=>this.shouldStopEventPropagation(o),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(),this.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],this.refresh.bind(this)),this.addManagedListener(this.column,Column.EVENT_COL_DEF_CHANGED,this.refresh.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}resizeHeader(e,t){var i,n;if(!this.column.isResizable())return;const o=this.column.getActualWidth(),r=(i=this.column.getMinWidth())!==null&&i!==void 0?i:0,a=(n=this.column.getMaxWidth())!==null&&n!==void 0?n:Number.MAX_SAFE_INTEGER,l=Math.min(Math.max(o+e,r),a);this.beans.columnModel.setColumnWidths([{key:this.column,newWidth:l}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,column:i,gridOptionsService:n,ctrlsService:o}=this,r=this.getPinned(),a=t.getBoundingClientRect().left,l=i.getActualWidth(),d=n.get("enableRtl"),h=e===HorizontalDirection.Left!==d,p=ColumnMoveHelper.normaliseX(h?a-20:a+l+20,r,!0,n,o);ColumnMoveHelper.attemptMoveColumns({allMovingColumns:[i],isFromHeader:!0,hDirection:e,xPosition:p,pinned:r,fromEnter:!1,fakeEvent:!1,gridOptionsService:n,columnModel:this.beans.columnModel}),o.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(i,"auto")}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){return this.gridOptionsService.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:t=>{this.menuService.showColumnMenu({column:this.column,buttonElement:t,positionBy:"button"})},showColumnMenuAfterMouseClick:t=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:t,positionBy:"mouse"})},showFilter:t=>{this.menuService.showFilterMenu({column:this.column,buttonElement:t,containerType:"columnFilter",positionBy:"button"})},progressSort:t=>{this.beans.sortController.progressSort(this.column,!!t,"uiColumnSorted")},setSort:(t,i)=>{this.beans.sortController.setSortForColumn(this.column,t,!!i,"uiColumnSorted")},eGridHeader:this.getGui()})}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new SelectAllFeature(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===KeyCode.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===KeyCode.ENTER&&this.onEnterKeyDown(e),e.key===KeyCode.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();!i||!(i instanceof HeaderComp)||i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const t=this.getRowIndex();this.focusService.setFocusedHeader(t,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(){const e={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>this.eGui,getLocation:()=>"header",getTooltipValue:()=>this.column.getColDef().headerTooltip},t=this.createManagedBean(new TooltipFeature(e,this.beans));t.setComp(this.eGui),this.refreshFunctions.push(()=>t.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const t=this.column.getColDef(),i=CssClassApplier.getHeaderClassesFromColDef(t,this.gridOptionsService,this.column,null),n=this.userHeaderClasses;this.userHeaderClasses=new Set(i),i.forEach(o=>{n.has(o)?n.delete(o):this.comp.addOrRemoveCssClass(o,!0)}),n.forEach(o=>this.comp.addOrRemoveCssClass(o,!1))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:n,dragAndDropService:o,gridOptionsService:r}=this,{columnModel:a}=i;let l=!this.gridOptionsService.get("suppressDragLeaveHidesColumns");const d=this.dragSource={type:DragSourceType.HeaderCell,eElement:e,getDefaultIconName:()=>l?DragAndDropService.ICON_HIDE:DragAndDropService.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(t),dragItemName:n,onDragStarted:()=>{l=!r.get("suppressDragLeaveHidesColumns"),t.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>t.setMoving(!1,"uiColumnMoved"),onGridEnter:h=>{var p;if(l){const m=((p=h==null?void 0:h.columns)===null||p===void 0?void 0:p.filter(v=>!v.getColDef().lockVisible))||[];a.setColumnsVisible(m,!0,"uiColumnMoved")}},onGridExit:h=>{var p;if(l){const m=((p=h==null?void 0:h.columns)===null||p===void 0?void 0:p.filter(v=>!v.getColDef().lockVisible))||[];a.setColumnsVisible(m,!1,"uiColumnMoved")}}};o.addDragSource(d,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(e=>e())}refreshHeaderComp(){const e=this.lookupUserCompDetails();(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==e.componentClass?this.attemptHeaderCompRefresh(e.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.beans.columnModel.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gridOptionsService.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const t=this.column.getActualWidth();this.comp.setWidth(`${t}px`)};this.addManagedListener(this.column,Column.EVENT_WIDTH_CHANGED,e),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListener(this.column,Column.EVENT_MOVING_CHANGED,e),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListener(this.column,Column.EVENT_MENU_VISIBLE_CHANGED,e),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedListener(this.eventService,Column.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))}setupFilterClass(){const e=()=>{const t=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",t),this.refreshAria()};this.addManagedListener(this.column,Column.EVENT_FILTER_ACTIVE_CHANGED,e),e()}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",t)};e(),this.addRefreshFunction(e)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:n}=this;if(!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),i.addOrRemoveCssClass("ag-header-span-total",!1);return}const{numberOfParents:o,isSpanningTotal:r}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",o>0);const{columnModel:a}=n,l=a.getColumnHeaderRowHeight();if(o===0){i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${l}px`);return}i.addOrRemoveCssClass("ag-header-span-total",r);const h=a.isPivotMode()?a.getPivotGroupHeaderHeight():a.getGroupHeaderHeight(),p=o*h;e.style.setProperty("top",`${-p}px`),e.style.setProperty("height",`${l+p}px`)}setupAutoHeight(e){const{columnModel:t,resizeObserverService:i}=this.beans,n=h=>{if(!this.isAlive())return;const{paddingTop:p,paddingBottom:m,borderBottomWidth:v,borderTopWidth:y}=getElementSize(this.getGui()),b=p+m+v+y,E=e.offsetHeight+b;if(h<5){const T=this.beans.gridOptionsService.getDocument(),R=!T||!T.contains(e),A=E==0;if(R||A){window.setTimeout(()=>n(h+1),0);return}}t.setColumnHeaderHeight(this.column,E)};let o=!1,r;const a=()=>{const h=this.column.isAutoHeaderHeight();h&&!o&&l(),!h&&o&&d()},l=()=>{o=!0,n(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),r=i.observeResize(e,()=>n(0))},d=()=>{o=!1,r&&r(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),r=void 0};a(),this.addDestroyFunc(()=>d()),this.addManagedListener(this.column,Column.EVENT_WIDTH_CHANGED,()=>o&&n(0)),this.addManagedListener(this.eventService,Column.EVENT_SORT_CHANGED,()=>{o&&window.setTimeout(()=>n(0))}),this.addRefreshFunction(a)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(getAriaSortState(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){t!=null?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){const e=this.beans.gridOptionsService.getDocument();if(!this.eGui.contains(e.activeElement))return;const t=Array.from(this.ariaDescriptionProperties.keys()).sort((i,n)=>i==="filter"?-1:n.charCodeAt(0)-i.charCodeAt(0)).map(i=>this.ariaDescriptionProperties.get(i)).join(". ");this.beans.ariaAnnouncementService.announceValue(t)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const e=()=>{if(!this.gridOptionsService.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",t)};this.addManagedListener(this.eventService,Events.EVENT_COLUMN_HOVER_CHANGED,e),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=n=>this.handleMouseOverChange(n.type==="mouseenter"),t=()=>this.dispatchColumnMouseEvent(Events.EVENT_COLUMN_HEADER_CLICKED,this.column),i=n=>this.handleContextMenuMouseEvent(n,void 0,this.column);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",t),this.addManagedListener(this.getGui(),"contextmenu",i)}handleMouseOverChange(e){this.setActiveHeader(e);const i={type:e?Events.EVENT_COLUMN_HEADER_MOUSE_OVER:Events.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column};this.eventService.dispatchEvent(i)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof HeaderComp?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}}var __decorate$1o=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class GroupResizeFeature extends BeanStub{constructor(e,t,i,n){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=n}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gridOptionsService.get("suppressAutoSize")){const t=this.gridOptionsService.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const i=[];this.columnGroup.getDisplayedLeafColumns().forEach(o=>{o.getColDef().suppressAutoSize||i.push(o.getColId())}),i.length>0&&this.columnModel.autoSizeColumns({columns:i,skipHeader:t,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const n=this.normaliseDragChange(t),o=this.resizeStartWidth+n;this.resizeColumnsFromLocalValues(o,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),n=this.getSizeRatiosOfColumns(t,i),o={columnsToResize:t,resizeStartWidth:i,resizeRatios:n};let r=null;if(e&&(r=this.columnModel.getDisplayedGroupAfter(this.columnGroup)),r){const a=r.getDisplayedLeafColumns(),l=o.groupAfterColumns=a.filter(h=>h.isResizable()),d=o.groupAfterStartWidth=this.getInitialSizeOfColumns(l);o.groupAfterRatios=this.getSizeRatiosOfColumns(l,d)}else o.groupAfterColumns=void 0,o.groupAfterStartWidth=void 0,o.groupAfterRatios=void 0;return o}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:n,groupAfterColumns:o,groupAfterStartWidth:r,groupAfterRatios:a}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=n,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=r,this.resizeTakeFromRatios=a}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){var n,o,r;if(!this.resizeCols||!this.resizeRatios)return;const a={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:(n=this.resizeTakeFromCols)!==null&&n!==void 0?n:void 0,groupAfterStartWidth:(o=this.resizeTakeFromStartWidth)!==null&&o!==void 0?o:void 0,groupAfterRatios:(r=this.resizeTakeFromRatios)!==null&&r!==void 0?r:void 0};this.resizeColumns(a,e,t,i)}resizeColumns(e,t,i,n=!0){const{columnsToResize:o,resizeStartWidth:r,resizeRatios:a,groupAfterColumns:l,groupAfterStartWidth:d,groupAfterRatios:h}=e,p=[];if(p.push({columns:o,ratios:a,width:t}),l){const m=t-r;p.push({columns:l,ratios:h,width:d-m})}this.columnModel.resizeColumnSets({resizeSets:p,finished:n,source:i}),n&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(t=>t.isResizable())}getInitialSizeOfColumns(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}getSizeRatiosOfColumns(e,t){return e.map(i=>i.getActualWidth()/t)}normaliseDragChange(e){let t=e;return this.gridOptionsService.get("enableRtl")?this.pinned!=="left"&&(t*=-1):this.pinned==="right"&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}}__decorate$1o([Autowired("horizontalResizeService")],GroupResizeFeature.prototype,"horizontalResizeService",void 0);__decorate$1o([Autowired("autoWidthCalculator")],GroupResizeFeature.prototype,"autoWidthCalculator",void 0);__decorate$1o([Autowired("columnModel")],GroupResizeFeature.prototype,"columnModel",void 0);__decorate$1o([PostConstruct],GroupResizeFeature.prototype,"postConstruct",null);var __decorate$1n=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class GroupWidthFeature extends BeanStub{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",e===0)}}__decorate$1n([PostConstruct],GroupWidthFeature.prototype,"postConstruct",null);class HeaderGroupCellCtrl extends AbstractHeaderCellCtrl{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const n=this.getGui();this.setDragSource(n)}},this.column=e}setComp(e,t,i){this.comp=e,this.setGui(t),this.displayName=this.beans.columnModel.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.setupUserComp(),this.addHeaderMouseListeners();const n=this.getParentRowCtrl().getPinned(),o=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new HoverFeature(o,t)),this.createManagedBean(new SetLeftFeature(this.column,t,this.beans)),this.createManagedBean(new GroupWidthFeature(e,this.column)),this.resizeFeature=this.createManagedBean(new GroupResizeFeature(e,i,n,this.column)),this.createManagedBean(new ManagedFocusFeature(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener(Events.EVENT_SUPPRESS_COLUMN_MOVE_CHANGED,this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:n,gridOptionsService:o,ctrlsService:r}=this,a=o.get("enableRtl"),l=e===HorizontalDirection.Left,d=this.getPinned(),h=i.getBoundingClientRect(),p=h.left,m=h.width,v=ColumnMoveHelper.normaliseX(l!==a?p-20:p+m+20,d,!0,o,r),y=n.getGroupId(),b=this.focusService.getFocusedHeader();ColumnMoveHelper.attemptMoveColumns({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:e,xPosition:v,pinned:d,fromEnter:!1,fakeEvent:!1,gridOptionsService:o,columnModel:t.columnModel});const S=n.getDisplayedLeafColumns(),E=l?S[0]:last(S);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(E,"auto"),!this.isAlive()&&b&&this.restoreFocus(y,n,b)}restoreFocus(e,t,i){const n=t.getLeafColumns();if(!n.length)return;const o=n[0].getParent();if(!o)return;const r=this.findGroupWidthId(o,e);r&&this.focusService.focusHeaderPosition({headerPosition:Object.assign(Object.assign({},i),{column:r})})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){const e=this.gridOptionsService.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:i=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),i,"gridInitializing")}}),t=this.userComponentFactory.getHeaderGroupCompDetails(e);this.comp.setUserCompDetails(t)}addHeaderMouseListeners(){const e=n=>this.handleMouseOverChange(n.type==="mouseenter"),t=()=>this.dispatchColumnMouseEvent(Events.EVENT_COLUMN_HEADER_CLICKED,this.column.getProvidedColumnGroup()),i=n=>this.handleContextMenuMouseEvent(n,void 0,this.column.getProvidedColumnGroup());this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e),this.addManagedListener(this.getGui(),"click",t),this.addManagedListener(this.getGui(),"contextmenu",i)}handleMouseOverChange(e){const i={type:e?Events.EVENT_COLUMN_HEADER_MOUSE_OVER:Events.EVENT_COLUMN_HEADER_MOUSE_LEAVE,column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(i)}setupTooltip(){const e=this.column.getColGroupDef(),t={getColumn:()=>this.column,getGui:()=>this.eGui,getLocation:()=>"headerGroup",getTooltipValue:()=>e&&e.headerTooltip};e&&(t.getColDef=()=>e),this.createManagedBean(new TooltipFeature(t,this.beans)).setComp(this.eGui)}setupExpandable(){const e=this.column.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(e,ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(e,ProvidedColumnGroup.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))}refreshExpanded(){const e=this.column;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=this.column.getColGroupDef(),t=CssClassApplier.getHeaderClassesFromColDef(e,this.gridOptionsService,null,this.column);this.column.isPadding()?(t.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(n=>n.isSpanHeaderHeight())&&t.push("ag-header-span-height")):t.push("ag-header-group-cell-with-group"),t.forEach(i=>this.comp.addOrRemoveCssClass(i,!0))}setupMovingCss(){const t=this.column.getProvidedColumnGroup().getLeafColumns(),i=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());t.forEach(n=>{this.addManagedListener(n,Column.EVENT_MOVING_CHANGED,i)}),i()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const t=this.getRowIndex();this.beans.focusService.setFocusedHeader(t,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(!(!this.expandable||!t)&&e.key===KeyCode.ENTER){const i=this.column,n=!i.isExpanded();this.beans.columnModel.setColumnGroupOpened(i.getProvidedColumnGroup(),n,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),!e))return;const{beans:t,column:i,displayName:n,gridOptionsService:o,dragAndDropService:r}=this,{columnModel:a}=t,l=i.getProvidedColumnGroup().getLeafColumns();let d=!o.get("suppressDragLeaveHidesColumns");const h=this.dragSource={type:DragSourceType.HeaderCell,eElement:e,getDefaultIconName:()=>d?DragAndDropService.ICON_HIDE:DragAndDropService.ICON_NOT_ALLOWED,dragItemName:n,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{d=!o.get("suppressDragLeaveHidesColumns"),l.forEach(p=>p.setMoving(!0,"uiColumnDragged"))},onDragStopped:()=>l.forEach(p=>p.setMoving(!1,"uiColumnDragged")),onGridEnter:p=>{var m;if(d){const v=((m=p==null?void 0:p.columns)===null||m===void 0?void 0:m.filter(y=>!y.getColDef().lockVisible))||[];a.setColumnsVisible(v,!0,"uiColumnMoved")}},onGridExit:p=>{var m;if(d){const v=((m=p==null?void 0:p.columns)===null||m===void 0?void 0:m.filter(y=>!y.getColDef().lockVisible))||[];a.setColumnsVisible(v,!1,"uiColumnMoved")}}};r.addDragSource(h,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach(o=>i[o.getId()]=o.isVisible());const n=[];return this.beans.columnModel.getAllDisplayedColumns().forEach(o=>{t.indexOf(o)>=0&&(n.push(o),removeFromArray(t,o))}),t.forEach(o=>n.push(o)),{columns:n,visibleState:i}}isSuppressMoving(){let e=!1;return this.column.getLeafColumns().forEach(i=>{(i.getColDef().suppressMovable||i.getColDef().lockPosition)&&(e=!0)}),e||this.gridOptionsService.get("suppressMovableColumns")}}var __decorate$1m=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let instanceIdSequence=0;class HeaderRowCtrl extends BeanStub{constructor(e,t,i){super(),this.instanceId=instanceIdSequence++,this.rowIndex=e,this.pinned=t,this.type=i;const n=i==HeaderRowType.COLUMN_GROUP?"ag-header-row-column-group":i==HeaderRowType.FLOATING_FILTER?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${n}`}postConstruct(){this.isPrintLayout=this.gridOptionsService.isDomLayout("print"),this.isEnsureDomOrder=this.gridOptionsService.get("ensureDomOrder")}getInstanceId(){return this.instanceId}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){this.addManagedListener(this.eventService,Events.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_VIRTUAL_COLUMNS_CHANGED,e=>this.onVirtualColumnsChanged(e.afterScroll)),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_GRID_STYLES_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",e=>this.isEnsureDomOrder=e.currentValue),this.addManagedPropertyListener("headerHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("groupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotGroupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("floatingFiltersHeight",this.onRowHeightChanged.bind(this))}getHeaderCellCtrl(e){if(this.headerCellCtrls)return values(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.isPrintLayout=this.gridOptionsService.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{columnModel:e}=this.beans;return this.isPrintLayout?this.pinned!=null?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){var{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans;let i=e.getHeaderRowCount();const n=[];let o=0;t.hasFloatingFilters()&&(i++,o=1);const r=e.getColumnGroupHeaderRowHeight(),a=e.getColumnHeaderRowHeight(),l=1+o,d=i-l;for(let m=0;m<d;m++)n.push(r);n.push(a);for(let m=0;m<o;m++)n.push(e.getFloatingFiltersHeight());let h=0;for(let m=0;m<this.rowIndex;m++)h+=n[m];const p=n[this.rowIndex];return{topOffset:h,rowHeight:p}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const o of t)this.recycleAndCreateHeaderCtrls(o,e);const i=o=>{const{focusService:r,columnModel:a}=this.beans;return r.isHeaderWrapperFocused(o)?a.isDisplayed(o.getColumnGroupChild()):!1};if(e)for(const[o,r]of e)i(r)?this.headerCellCtrls.set(o,r):this.destroyBean(r);return Array.from(this.headerCellCtrls.values())}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls||e.isEmptyGroup())return;const i=e.getUniqueId();let n;if(t&&(n=t.get(i),t.delete(i)),n&&n.getColumnGroupChild()!=e&&(this.destroyBean(n),n=void 0),n==null)switch(this.type){case HeaderRowType.FLOATING_FILTER:n=this.createBean(new HeaderFilterCellCtrl(e,this.beans,this));break;case HeaderRowType.COLUMN_GROUP:n=this.createBean(new HeaderGroupCellCtrl(e,this.beans,this));break;default:n=this.createBean(new HeaderCellCtrl(e,this.beans,this));break}this.headerCellCtrls.set(i,n)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(this.pinned!=null)return[];let e=[];const t=this.getActualDepth(),{columnModel:i}=this.beans;return["left",null,"right"].forEach(n=>{const o=i.getVirtualHeaderGroupRow(n,t);e=e.concat(o)}),e}getActualDepth(){return this.type==HeaderRowType.FLOATING_FILTER?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnModel.getVirtualHeaderGroupRow(this.pinned,this.getActualDepth())}focusHeader(e,t){if(!this.headerCellCtrls)return!1;const n=Array.from(this.headerCellCtrls.values()).find(o=>o.getColumnGroupChild()==e);return n?n.focus(t):!1}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach(e=>{this.destroyBean(e)}),this.headerCellCtrls=void 0,super.destroy()}}__decorate$1m([Autowired("beans")],HeaderRowCtrl.prototype,"beans",void 0);__decorate$1m([PostConstruct],HeaderRowCtrl.prototype,"postConstruct",null);var __decorate$1l=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class HeaderRowContainerCtrl extends BeanStub{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport),this.addManagedListener(this.eventService,Events.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}setupDragAndDrop(e){const t=new BodyDropTarget(this.pinned,e);this.createManagedBean(t)}refresh(e=!1){const t=new NumberSequence,i=this.focusService.getFocusHeaderToUseAfterRefresh(),n=()=>{const l=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let d=0;d<l;d++){const h=this.createBean(new HeaderRowCtrl(t.next(),this.pinned,HeaderRowType.COLUMN_GROUP));this.groupsRowCtrls.push(h)}},o=()=>{const l=t.next(),d=!this.hidden&&(this.columnsRowCtrl==null||!e||this.columnsRowCtrl.getRowIndex()!==l);(d||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),d&&(this.columnsRowCtrl=this.createBean(new HeaderRowCtrl(l,this.pinned,HeaderRowType.COLUMN)))},r=()=>{this.includeFloatingFilter=this.filterManager.hasFloatingFilters()&&!this.hidden;const l=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){l();return}const d=t.next();if(this.filtersRowCtrl){const h=this.filtersRowCtrl.getRowIndex()!==d;(!e||h)&&l()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new HeaderRowCtrl(d,this.pinned,HeaderRowType.FLOATING_FILTER)))};n(),o(),r();const a=this.getAllCtrls();this.comp.setCtrls(a),this.restoreFocusOnHeader(i)}restoreFocusOnHeader(e){e==null||e.column.getPinned()!=this.pinned||this.focusService.focusHeaderPosition({headerPosition:e})}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new CenterWidthFeature(e=>this.comp.setCenterWidth(`${e}px`),!0))}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}setupPinnedWidth(){if(this.pinned==null)return;const e=this.pinned==="left",t=this.pinned==="right";this.hidden=!0;const i=()=>{const n=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(n==null)return;const o=n==0,r=this.hidden!==o,a=this.gridOptionsService.get("enableRtl"),l=this.gridOptionsService.getScrollbarWidth(),h=this.scrollVisibleService.isVerticalScrollShowing()&&(a&&e||!a&&t)?n+l:n;this.comp.setPinnedContainerWidth(`${h}px`),this.comp.setDisplayed(!o),r&&(this.hidden=o,this.refresh())};this.addManagedListener(this.eventService,Events.EVENT_LEFT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,Events.EVENT_SCROLL_VISIBILITY_CHANGED,i),this.addManagedListener(this.eventService,Events.EVENT_SCROLLBAR_WIDTH_CHANGED,i)}getHeaderCtrlForColumn(e){if(e instanceof Column)return this.columnsRowCtrl?this.columnsRowCtrl.getHeaderCellCtrl(e):void 0;if(this.groupsRowCtrls.length!==0)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const i=this.getAllCtrls()[e];return i?i.getType():void 0}focusHeader(e,t,i){const o=this.getAllCtrls()[e];return o?o.focusHeader(t,i):!1}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}}__decorate$1l([Autowired("ctrlsService")],HeaderRowContainerCtrl.prototype,"ctrlsService",void 0);__decorate$1l([Autowired("scrollVisibleService")],HeaderRowContainerCtrl.prototype,"scrollVisibleService",void 0);__decorate$1l([Autowired("pinnedWidthService")],HeaderRowContainerCtrl.prototype,"pinnedWidthService",void 0);__decorate$1l([Autowired("columnModel")],HeaderRowContainerCtrl.prototype,"columnModel",void 0);__decorate$1l([Autowired("focusService")],HeaderRowContainerCtrl.prototype,"focusService",void 0);__decorate$1l([Autowired("filterManager")],HeaderRowContainerCtrl.prototype,"filterManager",void 0);var __decorate$1k=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class HeaderRowContainerComp extends Component{constructor(e){super(),this.headerRowComps={},this.rowCompsList=[],this.pinned=e}init(){this.selectAndSetTemplate();const e={setDisplayed:i=>this.setDisplayed(i),setCtrls:i=>this.setCtrls(i),setCenterWidth:i=>this.eCenterContainer.style.width=i,setViewportScrollLeft:i=>this.getGui().scrollLeft=i,setPinnedContainerWidth:i=>{const n=this.getGui();n.style.width=i,n.style.maxWidth=i,n.style.minWidth=i}};this.createManagedBean(new HeaderRowContainerCtrl(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",i=e?HeaderRowContainerComp.PINNED_LEFT_TEMPLATE:t?HeaderRowContainerComp.PINNED_RIGHT_TEMPLATE:HeaderRowContainerComp.CENTER_TEMPLATE;this.setTemplate(i),this.eRowContainer=this.eCenterContainer?this.eCenterContainer:this.getGui()}destroyRowComps(){this.setCtrls([])}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let i;const n=o=>{const r=o.getGui();r.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(r),i&&ensureDomOrder(this.eRowContainer,r,i),i=r};e.forEach(o=>{const r=o.getInstanceId(),a=t[r];delete t[r];const l=a||this.createBean(new HeaderRowComp(o));this.headerRowComps[r]=l,this.rowCompsList.push(l),n(l)}),getAllValuesInObject(t).forEach(o=>this.destroyRowComp(o))}}HeaderRowContainerComp.PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="rowgroup"></div>';HeaderRowContainerComp.PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="rowgroup"></div>';HeaderRowContainerComp.CENTER_TEMPLATE=`<div class="ag-header-viewport" role="presentation">
|
||
<div class="ag-header-container" ref="eCenterContainer" role="rowgroup"></div>
|
||
</div>`;__decorate$1k([RefSelector("eCenterContainer")],HeaderRowContainerComp.prototype,"eCenterContainer",void 0);__decorate$1k([PostConstruct],HeaderRowContainerComp.prototype,"init",null);__decorate$1k([PreDestroy],HeaderRowContainerComp.prototype,"destroyRowComps",null);var __decorate$1j=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},HeaderNavigationDirection;(function(s){s[s.UP=0]="UP",s[s.DOWN=1]="DOWN",s[s.LEFT=2]="LEFT",s[s.RIGHT=3]="RIGHT"})(HeaderNavigationDirection||(HeaderNavigationDirection={}));let HeaderNavigationService=class extends BeanStub{constructor(){super(...arguments),this.currentHeaderRowWithoutSpan=-1}postConstruct(){this.ctrlsService.whenReady(t=>{this.gridBodyCon=t.gridBodyCtrl});const e=this.gridOptionsService.getDocument();this.addManagedListener(e,"mousedown",()=>this.setCurrentHeaderRowWithoutSpan(-1))}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:n,column:o}=t,r=this.getHeaderRowCount(),a=e===HeaderNavigationDirection.UP;let{headerRowIndex:l,column:d,headerRowIndexWithoutSpan:h}=a?this.headerPositionUtils.getColumnVisibleParent(o,n):this.headerPositionUtils.getColumnVisibleChild(o,n),p=!1;return l<0&&(l=0,d=o,p=!0),l>=r?(l=-1,this.setCurrentHeaderRowWithoutSpan(-1)):h!==void 0&&(this.currentHeaderRowWithoutSpan=h),!p&&!d?!1:this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l,column:d},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const n=this.focusService.getFocusedHeader(),o=e===HeaderNavigationDirection.LEFT,r=this.gridOptionsService.get("enableRtl");let a,l;return this.currentHeaderRowWithoutSpan!==-1?n.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=n.headerRowIndex,o!==r?(l="Before",a=this.headerPositionUtils.findHeader(n,l)):(l="After",a=this.headerPositionUtils.findHeader(n,l)),a||!t?this.focusService.focusHeaderPosition({headerPosition:a,direction:l,fromTab:t,allowUserOverride:!0,event:i}):this.focusNextHeaderRow(n,l,i)}focusNextHeaderRow(e,t,i){const n=e.headerRowIndex;let o=null,r;if(t==="Before"?n>0&&(r=n-1,this.currentHeaderRowWithoutSpan-=1,o=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"end")):(r=n+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),o=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"start")),!o)return!1;const{column:a,headerRowIndex:l}=this.headerPositionUtils.getHeaderIndexToFocus(o.column,o==null?void 0:o.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:a,headerRowIndex:l},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(e instanceof ColumnGroup){const n=e.getDisplayedLeafColumns();i=t==="Before"?last(n):n[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}};__decorate$1j([Autowired("focusService")],HeaderNavigationService.prototype,"focusService",void 0);__decorate$1j([Autowired("headerPositionUtils")],HeaderNavigationService.prototype,"headerPositionUtils",void 0);__decorate$1j([Autowired("ctrlsService")],HeaderNavigationService.prototype,"ctrlsService",void 0);__decorate$1j([PostConstruct],HeaderNavigationService.prototype,"postConstruct",null);HeaderNavigationService=__decorate$1j([Bean("headerNavigationService")],HeaderNavigationService);var __decorate$1i=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class GridHeaderCtrl extends BeanStub{setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new ManagedFocusFeature(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onPivotModeChanged(),this.setupHeaderHeight();const n=this.onHeaderContextMenu.bind(this);this.addManagedListener(this.eGui,"contextmenu",n),this.mockContextMenuForIPad(n),this.ctrlsService.registerGridHeaderCtrl(this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,e),this.addManagedListener(this.eventService,Events.EVENT_GRID_STYLES_CHANGED,e),this.addManagedListener(this.eventService,Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,e)}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t=0,i=e.getHeaderRowCount(),n;this.filterManager.hasFloatingFilters()&&(i++,t=1);const r=this.columnModel.getColumnGroupHeaderRowHeight(),a=this.columnModel.getColumnHeaderRowHeight(),l=1+t,d=i-l;if(n=t*e.getFloatingFiltersHeight(),n+=d*r,n+=a,this.headerHeight===n)return;this.headerHeight=n;const h=`${n+1}px`;this.comp.setHeightAndMinHeight(h),this.eventService.dispatchEvent({type:Events.EVENT_HEADER_HEIGHT_CHANGED})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const t=this.columnModel.getAllDisplayedColumns().some(i=>i.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",t)}onTabKeyDown(e){const t=this.gridOptionsService.get("enableRtl"),i=e.shiftKey!==t?HeaderNavigationDirection.LEFT:HeaderNavigationDirection.RIGHT;(this.headerNavigationService.navigateHorizontally(i,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case KeyCode.LEFT:t=HeaderNavigationDirection.LEFT;case KeyCode.RIGHT:exists(t)||(t=HeaderNavigationDirection.RIGHT),this.headerNavigationService.navigateHorizontally(t,!1,e);break;case KeyCode.UP:t=HeaderNavigationDirection.UP;case KeyCode.DOWN:exists(t)||(t=HeaderNavigationDirection.DOWN),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const t=this.gridOptionsService.getDocument(),{relatedTarget:i}=e;!i&&this.eGui.contains(t.activeElement)||this.eGui.contains(i)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:n}=e??t;(n===this.eGui||n===this.ctrlsService.getHeaderRowContainerCtrl().getViewport())&&this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!isIOSUserAgent())return;const t=new TouchListener(this.eGui),i=n=>{e(void 0,n.touchStart,n.touchEvent)};this.addManagedListener(t,TouchListener.EVENT_LONG_TAP,i),this.addDestroyFunc(()=>t.destroy())}}__decorate$1i([Autowired("headerNavigationService")],GridHeaderCtrl.prototype,"headerNavigationService",void 0);__decorate$1i([Autowired("focusService")],GridHeaderCtrl.prototype,"focusService",void 0);__decorate$1i([Autowired("columnModel")],GridHeaderCtrl.prototype,"columnModel",void 0);__decorate$1i([Autowired("ctrlsService")],GridHeaderCtrl.prototype,"ctrlsService",void 0);__decorate$1i([Autowired("filterManager")],GridHeaderCtrl.prototype,"filterManager",void 0);__decorate$1i([Autowired("menuService")],GridHeaderCtrl.prototype,"menuService",void 0);var __decorate$1h=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class GridHeaderComp extends Component{constructor(){super(GridHeaderComp.TEMPLATE)}postConstruct(){const e={addOrRemoveCssClass:(n,o)=>this.addOrRemoveCssClass(n,o),setHeightAndMinHeight:n=>{this.getGui().style.height=n,this.getGui().style.minHeight=n}};this.createManagedBean(new GridHeaderCtrl).setComp(e,this.getGui(),this.getFocusableElement());const i=n=>{this.createManagedBean(n),this.appendChild(n)};i(new HeaderRowContainerComp("left")),i(new HeaderRowContainerComp(null)),i(new HeaderRowContainerComp("right"))}}GridHeaderComp.TEMPLATE='<div class="ag-header" role="presentation"/>';__decorate$1h([PostConstruct],GridHeaderComp.prototype,"postConstruct",null);var __decorate$1g=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let HorizontalResizeService=class extends BeanStub{addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.getGridCtrl();e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.getGridCtrl();e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}};__decorate$1g([Autowired("dragService")],HorizontalResizeService.prototype,"dragService",void 0);__decorate$1g([Autowired("ctrlsService")],HorizontalResizeService.prototype,"ctrlsService",void 0);HorizontalResizeService=__decorate$1g([Bean("horizontalResizeService")],HorizontalResizeService);var __decorate$1f=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let StandardMenuFactory=class extends BeanStub{hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,n=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:n})},i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let n=-1,o="left";const r=this.menuService.isLegacyMenuEnabled();!r&&this.gridOptionsService.get("enableRtl")&&(n=1,o="right");let a=r?void 0:4*n,l=r?void 0:4;this.showPopup(e,d=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:d,nudgeX:a,nudgeY:l,alignSide:o,keepWithinBounds:!0,position:"under",column:e})},i,t,r)}showPopup(e,t,i,n,o){const r=e?this.filterManager.getOrCreateFilterWrapper(e,"COLUMN_MENU"):void 0;if(!r||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const a=document.createElement("div");setAriaRole(a,"presentation"),a.classList.add("ag-menu"),o||a.classList.add("ag-filter-menu"),this.tabListener=this.addManagedListener(a,"keydown",b=>this.trapFocusWithin(b,a)),r.guiPromise.then(b=>a.appendChild(b));let l;const d=()=>{var b;return(b=r.filterPromise)===null||b===void 0?void 0:b.then(S=>{var E;return(E=S==null?void 0:S.afterGuiDetached)===null||E===void 0?void 0:E.call(S)})},h=this.menuService.isColumnMenuAnchoringEnabled()?n??this.ctrlsService.getGridBodyCtrl().getGui():void 0,p=b=>{e.setMenuVisible(!1,"contextMenu");const S=b instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),S&&n&&isVisible(n)){const E=this.focusService.findTabbableParent(n);E&&E.focus()}d(),this.dispatchVisibleChangedEvent(!1,i,e)},m=this.localeService.getLocaleTextFunc(),v=o&&i!=="columnFilter"?m("ariaLabelColumnMenu","Column Menu"):m("ariaLabelColumnFilter","Column Filter"),y=this.popupService.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:p,positionCallback:()=>t(a),anchorToElement:h,ariaLabel:v});y&&(this.hidePopup=l=y.hideFunc),r.filterPromise.then(b=>{t(a),b.afterGuiAttached&&b.afterGuiAttached({container:i,hidePopup:l})}),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==KeyCode.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){const n={type:Events.EVENT_COLUMN_MENU_VISIBLE_CHANGED,visible:e,switchingTab:!1,key:t,column:i??null};this.eventService.dispatchEvent(n)}isMenuEnabled(e){var t;return e.isFilterAllowed()&&((t=e.getColDef().menuTabs)!==null&&t!==void 0?t:["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}};__decorate$1f([Autowired("filterManager")],StandardMenuFactory.prototype,"filterManager",void 0);__decorate$1f([Autowired("popupService")],StandardMenuFactory.prototype,"popupService",void 0);__decorate$1f([Autowired("focusService")],StandardMenuFactory.prototype,"focusService",void 0);__decorate$1f([Autowired("ctrlsService")],StandardMenuFactory.prototype,"ctrlsService",void 0);__decorate$1f([Autowired("menuService")],StandardMenuFactory.prototype,"menuService",void 0);StandardMenuFactory=__decorate$1f([Bean("filterMenuFactory")],StandardMenuFactory);var __decorate$1e=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},TabGuardClassNames;(function(s){s.TAB_GUARD="ag-tab-guard",s.TAB_GUARD_TOP="ag-tab-guard-top",s.TAB_GUARD_BOTTOM="ag-tab-guard-bottom"})(TabGuardClassNames||(TabGuardClassNames={}));class TabGuardCtrl extends BeanStub{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1;const{comp:t,eTopGuard:i,eBottomGuard:n,focusTrapActive:o,forceFocusOutWhenTabGuardsAreEmpty:r,focusInnerElement:a,onFocusIn:l,onFocusOut:d,shouldStopEventPropagation:h,onTabKeyDown:p,handleKeyDown:m,eFocusableElement:v}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=n,this.providedFocusInnerElement=a,this.eFocusableElement=v,this.focusTrapActive=!!o,this.forceFocusOutWhenTabGuardsAreEmpty=!!r,this.providedFocusIn=l,this.providedFocusOut=d,this.providedShouldStopEventPropagation=h,this.providedOnTabKeyDown=p,this.providedHandleKeyDown=m}postConstruct(){this.createManagedBean(new ManagedFocusFeature(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach(e=>this.addManagedListener(e,"focus",this.onFocus.bind(this)))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gridOptionsService.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length===0){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){const t=this.gridOptionsService.getDocument(),i=this.focusService.findFocusableElements(t.body,null,!0),n=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(n===-1)return;let o,r;e?(o=0,r=n):(o=n+1,r=i.length);const a=i.slice(o,r),l=this.gridOptionsService.get("tabIndex");a.sort((d,h)=>{const p=parseInt(d.getAttribute("tabindex")||"0"),m=parseInt(h.getAttribute("tabindex")||"0");return m===l?1:p===l?-1:p===0?1:m===0?-1:p-m}),a[e?a.length-1:0].focus()}onFocusIn(e){this.focusTrapActive||(this.providedFocusIn&&this.providedFocusIn(e),this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(this.focusTrapActive||e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e){return e===this.eTopGuard||e===this.eBottomGuard}}__decorate$1e([Autowired("focusService")],TabGuardCtrl.prototype,"focusService",void 0);__decorate$1e([PostConstruct],TabGuardCtrl.prototype,"postConstruct",null);class TabGuardComp extends Component{initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.getFocusableElement();const t=[this.eTopGuard,this.eBottomGuard],i={setTabIndex:n=>{t.forEach(o=>n!=null?o.setAttribute("tabindex",n):o.removeAttribute("tabindex"))}};this.addTabGuards(this.eTopGuard,this.eBottomGuard),this.tabGuardCtrl=this.createManagedBean(new TabGuardCtrl({comp:i,focusTrapActive:!!e.focusTrapActive,eTopGuard:this.eTopGuard,eBottomGuard:this.eBottomGuard,eFocusableElement:this.eFocusableElement,onFocusIn:e.onFocusIn,onFocusOut:e.onFocusOut,focusInnerElement:e.focusInnerElement,handleKeyDown:e.handleKeyDown,onTabKeyDown:e.onTabKeyDown,shouldStopEventPropagation:e.shouldStopEventPropagation,forceFocusOutWhenTabGuardsAreEmpty:e.forceFocusOutWhenTabGuardsAreEmpty}))}createTabGuard(e){const t=document.createElement("div"),i=e==="top"?TabGuardClassNames.TAB_GUARD_TOP:TabGuardClassNames.TAB_GUARD_BOTTOM;return t.classList.add(TabGuardClassNames.TAB_GUARD,i),setAriaRole(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];clearElement(this.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t){isNodeOrElement(e)||(e=e.getGui());const{eBottomGuard:i}=this;i?i.insertAdjacentElement("beforebegin",e):super.appendChild(e,t)}}var __decorate$1d=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class TabbedLayout extends TabGuardComp{constructor(e){super(TabbedLayout.getTemplate(e.cssClass)),this.items=[],this.tabbedItemScrollMap=new Map,this.params=e,e.items&&e.items.forEach(t=>this.addItem(t))}postConstruct(){this.initialiseTabGuard({onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),focusInnerElement:this.focusInnerElement.bind(this),focusTrapActive:!0}),this.addDestroyFunc(()=>{var e,t,i;return(i=(t=(e=this.activeItem)===null||e===void 0?void 0:e.tabbedItem)===null||t===void 0?void 0:t.afterDetachedCallback)===null||i===void 0?void 0:i.call(t)})}static getTemplate(e){return`<div class="ag-tabs ${e}">
|
||
<div ref="eHeader" role="tablist" class="ag-tabs-header ${e?`${e}-header`:""}"></div>
|
||
<div ref="eBody" role="presentation" class="ag-tabs-body ${e?`${e}-body`:""}"></div>
|
||
</div>`}handleKeyDown(e){const t=this.gridOptionsService.getDocument();switch(e.key){case KeyCode.RIGHT:case KeyCode.LEFT:if(!this.eHeader.contains(t.activeElement))return;const i=e.key===KeyCode.RIGHT,n=this.gridOptionsService.get("enableRtl"),o=this.items.indexOf(this.activeItem),r=i!==n?Math.min(o+1,this.items.length-1):Math.max(o-1,0);if(o===r)return;e.preventDefault();const a=this.items[r];this.showItemWrapper(a),a.eHeaderButton.focus();break;case KeyCode.UP:case KeyCode.DOWN:e.stopPropagation();break}}onTabKeyDown(e){if(e.defaultPrevented)return;const{focusService:t,eHeader:i,eBody:n,activeItem:o}=this,a=this.gridOptionsService.getDocument().activeElement,l=e.target;if(e.preventDefault(),i.contains(a)){this.focusBody(e.shiftKey);return}let d=null;t.isTargetUnderManagedComponent(n,l)&&(e.shiftKey&&(d=this.focusService.findFocusableElementBeforeTabGuard(n,l)),d||(d=o.eHeaderButton)),!d&&n.contains(a)&&(d=t.findNextFocusableElement(n,!1,e.shiftKey),d||this.focusHeader()),d&&d.focus()}focusInnerElement(e){e?this.focusHeader():this.focusBody(!0)}focusHeader(){this.activeItem.eHeaderButton.focus()}focusBody(e){this.focusService.focusInto(this.eBody,e)}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const t=document.createElement("span");setAriaRole(t,"tab"),t.setAttribute("tabindex","-1"),t.appendChild(e.title),t.classList.add("ag-tab"),this.eHeader.appendChild(t),setAriaLabel(t,e.titleLabel);const i={tabbedItem:e,eHeaderButton:t};this.items.push(i),t.addEventListener("click",this.showItemWrapper.bind(this,i))}showItem(e){const t=this.items.find(i=>i.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){var t,i,n,o,r,a;const{tabbedItem:l,eHeaderButton:d}=e;if((i=(t=this.params).onItemClicked)===null||i===void 0||i.call(t,{item:l}),this.activeItem===e){(o=(n=this.params).onActiveItemClicked)===null||o===void 0||o.call(n);return}this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),clearElement(this.eBody),l.bodyPromise.then(h=>{this.eBody.appendChild(h);const p=!this.focusService.isKeyboardMode();if(this.focusService.focusInto(this.eBody,!1,p),l.afterAttachedCallback&&l.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const m=l.getScrollableContainer&&l.getScrollableContainer()||h;this.lastScrollListener=this.addManagedListener(m,"scroll",()=>{this.tabbedItemScrollMap.set(l.name,m.scrollTop)});const v=this.tabbedItemScrollMap.get(l.name);v!==void 0&&setTimeout(()=>{m.scrollTop=v},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),(a=(r=this.activeItem.tabbedItem).afterDetachedCallback)===null||a===void 0||a.call(r)),d.classList.add("ag-tab-selected"),this.activeItem=e}}__decorate$1d([Autowired("focusService")],TabbedLayout.prototype,"focusService",void 0);__decorate$1d([RefSelector("eHeader")],TabbedLayout.prototype,"eHeader",void 0);__decorate$1d([RefSelector("eBody")],TabbedLayout.prototype,"eBody",void 0);__decorate$1d([PostConstruct],TabbedLayout.prototype,"postConstruct",null);var __decorate$1c=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const DEBOUNCE_DELAY=50;let ResizeObserverService=class extends BeanStub{constructor(){super(...arguments),this.polyfillFunctions=[]}observeResize(e,t){const i=this.gridOptionsService.getWindow(),n=()=>{const l=new i.ResizeObserver(t);return l.observe(e),()=>l.disconnect()},o=()=>{var l,d;let h=(l=e==null?void 0:e.clientWidth)!==null&&l!==void 0?l:0,p=(d=e==null?void 0:e.clientHeight)!==null&&d!==void 0?d:0,m=!0;const v=()=>{var y,b;if(m){const S=(y=e==null?void 0:e.clientWidth)!==null&&y!==void 0?y:0,E=(b=e==null?void 0:e.clientHeight)!==null&&b!==void 0?b:0;(S!==h||E!==p)&&(h=S,p=E,t()),this.doNextPolyfillTurn(v)}};return v(),()=>m=!1},r=this.gridOptionsService.get("suppressBrowserResizeObserver");return!!i.ResizeObserver&&!r?n():this.getFrameworkOverrides().wrapIncoming(()=>o(),"resize-observer")}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){if(this.polyfillScheduled)return;const e=()=>{const t=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],t.forEach(i=>i())};this.polyfillScheduled=!0,window.setTimeout(e,DEBOUNCE_DELAY)}};ResizeObserverService=__decorate$1c([Bean("resizeObserverService")],ResizeObserverService);var __decorate$1b=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let AnimationFrameService=class extends BeanStub{constructor(){super(...arguments),this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}setScrollTop(e){const t=this.gridOptionsService.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&e===0){const i=this.paginationProxy.getCurrentPage();i!==this.lastPage&&(this.lastPage=i,this.scrollGoingDown=!0)}this.lastScrollTop=e}init(){this.useAnimationFrame=!this.gridOptionsService.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){this.useAnimationFrame===!1&&console.warn(`AG Grid: AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const n={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],n),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((i,n)=>i.index!==n.index?t*(n.index-i.index):n.createOrder-i.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,n=this.createTasksP2,o=n.list,r=this.destroyTasks,a=new Date().getTime();let l=new Date().getTime()-a;const d=e<=0,h=this.ctrlsService.getGridBodyCtrl();for(;d||l<e;){if(!h.getScrollFeature().scrollGridIfNeeded()){let m;if(i.length)this.sortTaskList(t),m=i.pop().task;else if(o.length)this.sortTaskList(n),m=o.pop().task;else if(r.length)m=r.pop();else{this.cancelledTasks.clear();break}this.cancelledTasks.has(m)||m()}l=new Date().getTime()-a}i.length||o.length||r.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gridOptionsService.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{if(!this.isOn()){window.setTimeout(e,0);return}t||(t=!0,this.addDestroyTask(()=>{t=!1,e()}))}}};__decorate$1b([Autowired("ctrlsService")],AnimationFrameService.prototype,"ctrlsService",void 0);__decorate$1b([Autowired("paginationProxy")],AnimationFrameService.prototype,"paginationProxy",void 0);__decorate$1b([PostConstruct],AnimationFrameService.prototype,"init",null);AnimationFrameService=__decorate$1b([Bean("animationFrameService")],AnimationFrameService);var ClientSideRowModelSteps;(function(s){s.EVERYTHING="group",s.FILTER="filter",s.SORT="sort",s.MAP="map",s.AGGREGATE="aggregate",s.FILTER_AGGREGATES="filter_aggregates",s.PIVOT="pivot",s.NOTHING="nothing"})(ClientSideRowModelSteps||(ClientSideRowModelSteps={}));var __decorate$1a=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ExpansionService=class extends BeanStub{postConstruct(){this.isClientSideRowModel=this.rowModel.getType()==="clientSide"}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode(i=>{i.id&&t.has(i.id)&&(i.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode(({expanded:t,id:i})=>{t&&i&&e.push(i)}),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i){e&&(i&&e.parent&&e.parent.level!==-1&&this.setRowNodeExpanded(e.parent,t,i),e.setExpanded(t))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:ClientSideRowModelSteps.MAP})}};__decorate$1a([Autowired("rowModel")],ExpansionService.prototype,"rowModel",void 0);__decorate$1a([PostConstruct],ExpansionService.prototype,"postConstruct",null);ExpansionService=__decorate$1a([Bean("expansionService")],ExpansionService);var __decorate$19=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let MenuService=class extends BeanStub{postConstruct(){var e;this.activeMenuFactory=(e=this.enterpriseMenuFactory)!==null&&e!==void 0?e:this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}showContextMenu(e){var t,i,n;const{column:o,anchorToElement:r,rowNode:a,value:l}=e;(t=this.contextMenuFactory)===null||t===void 0||t.onContextMenu((i=e.mouseEvent)!==null&&i!==void 0?i:null,(n=e.touchEvent)!==null&&n!==void 0?n:null,a??null,o??null,l,r)}showColumnChooser(e){var t;(t=this.columnChooserFactory)===null||t===void 0||t.showColumnChooser(e)}hidePopupMenu(){var e;(e=this.contextMenuFactory)===null||e===void 0||e.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){var e;(e=this.columnChooserFactory)===null||e===void 0||e.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(i??t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&this.filterManager.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!(e!=null&&e.getColDef().suppressHeaderContextMenu)&&this.getColumnMenuType()==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(isIOSUserAgent()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return this.filterManager.isFilterAllowed(e)&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return this.getColumnMenuType()==="new"}isLegacyMenuEnabled(){return this.getColumnMenuType()==="legacy"}isFloatingFilterButtonEnabled(e){var t;const i=e.getColDef(),n=(t=i.floatingFilterComponentParams)===null||t===void 0?void 0:t.suppressFilterButton;return n!=null&&warnOnce("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),i.suppressFloatingFilterButton==null?!n:!i.suppressFloatingFilterButton}getColumnMenuType(){var e;return(e=this.gridOptionsService.get("columnMenu"))!==null&&e!==void 0?e:"legacy"}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gridOptionsService.get("suppressMenuHide");return this.isLegacyMenuEnabled()||this.gridOptionsService.exists("suppressMenuHide")?e:!0}showColumnMenuCommon(e,t,i,n){const{column:o,positionBy:r}=t;if(r==="button"){const{buttonElement:a}=t;e.showMenuAfterButtonClick(o,a,i,n)}else if(r==="mouse"){const{mouseEvent:a}=t;e.showMenuAfterMouseEvent(o,a,i,n)}else o&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(o,"auto"),this.animationFrameService.requestAnimationFrame(()=>{const a=this.ctrlsService.getHeaderRowContainerCtrl(o.getPinned()).getHeaderCtrlForColumn(o);e.showMenuAfterButtonClick(o,a.getAnchorElementForMenu(n),i,!0)}))}};__decorate$19([Optional("enterpriseMenuFactory")],MenuService.prototype,"enterpriseMenuFactory",void 0);__decorate$19([Autowired("filterMenuFactory")],MenuService.prototype,"filterMenuFactory",void 0);__decorate$19([Optional("contextMenuFactory")],MenuService.prototype,"contextMenuFactory",void 0);__decorate$19([Autowired("ctrlsService")],MenuService.prototype,"ctrlsService",void 0);__decorate$19([Autowired("animationFrameService")],MenuService.prototype,"animationFrameService",void 0);__decorate$19([Optional("columnChooserFactory")],MenuService.prototype,"columnChooserFactory",void 0);__decorate$19([Autowired("filterManager")],MenuService.prototype,"filterManager",void 0);__decorate$19([PostConstruct],MenuService.prototype,"postConstruct",null);MenuService=__decorate$19([Bean("menuService")],MenuService);var __decorate$18=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let AutoWidthCalculator=class extends BeanStub{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.centerRowContainerCtrl})}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const n=this.rowRenderer.getAllCellsForColumn(e);return t||n.push(i),this.addElementsToContainerAndGetWidth(n)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach(r=>this.cloneItemIntoDummy(r,t)),i.appendChild(t);const n=t.offsetWidth;i.removeChild(t);const o=this.getAutoSizePadding();return n+o}getAutoSizePadding(){return this.gridOptionsService.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>{const n=i.getHtmlElementForColumnHeader(e);n!=null&&(t=n)}),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const n=document.createElement("div"),o=n.classList;["ag-header-cell","ag-header-group-cell"].some(l=>i.classList.contains(l))?(o.add("ag-header","ag-header-row"),n.style.position="static"):o.add("ag-row");let a=e.parentElement;for(;a;){if(["ag-header-row","ag-row"].some(d=>a.classList.contains(d))){for(let d=0;d<a.classList.length;d++){const h=a.classList[d];h!="ag-row-position-absolute"&&o.add(h)}break}a=a.parentElement}n.appendChild(i),t.appendChild(n)}};__decorate$18([Autowired("rowRenderer")],AutoWidthCalculator.prototype,"rowRenderer",void 0);__decorate$18([Autowired("ctrlsService")],AutoWidthCalculator.prototype,"ctrlsService",void 0);__decorate$18([Autowired("rowCssClassCalculator")],AutoWidthCalculator.prototype,"rowCssClassCalculator",void 0);__decorate$18([PostConstruct],AutoWidthCalculator.prototype,"postConstruct",null);AutoWidthCalculator=__decorate$18([Bean("autoWidthCalculator")],AutoWidthCalculator);var __decorate$17=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class StickyRowFeature extends BeanStub{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyRowCtrls=[],this.containerHeight=0}postConstruct(){this.isClientSide=this.rowModel.getType()==="clientSide",this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}getStickyRowCtrls(){return this.stickyRowCtrls}checkStickyRows(){let e=0;if(!this.gridOptionsService.isGroupRowsSticky())return this.refreshNodesAndContainerHeight([],e);const t=[],i=this.rowRenderer.getFirstVisibleVerticalPixel(),n=r=>{var a,l,d;t.push(r);let h;if(this.isClientSide){let m=r;for(;m.isExpandable()&&m.expanded;)if(m.master)m=m.detailNode;else if(m.childrenAfterSort){if(m.childrenAfterSort.length===0)break;m=last(m.childrenAfterSort)}h=m.rowTop+m.rowHeight}else if(r.master)h=r.detailNode.rowTop+r.detailNode.rowHeight;else{const m=(a=r.childStore)===null||a===void 0?void 0:a.getStoreBounds();h=((l=m==null?void 0:m.heightPx)!==null&&l!==void 0?l:0)+((d=m==null?void 0:m.topPx)!==null&&d!==void 0?d:0)}const p=i+e+r.rowHeight;h<p?r.stickyRowTop=e+(h-p):r.stickyRowTop=e,e=0,t.forEach(m=>{const v=m.stickyRowTop+m.rowHeight;e<v&&(e=v)})};let o=0;for(;;){const r=i+e,a=this.rowModel.getRowIndexAtPixel(r),l=this.rowModel.getRow(a);if(l==null||l.level<0||o++===100)break;const d=[];let h=l.parent;for(;h.level>=0;)d.push(h),h=h.parent;const p=d.reverse().find(m=>t.indexOf(m)<0&&m.displayed);if(p){n(p);continue}if(l.isExpandable()&&l.expanded&&l.rowTop<r){n(l);continue}break}return this.refreshNodesAndContainerHeight(t,e)}refreshStickyNode(e){const t=[];for(let i=0;i<this.stickyRowCtrls.length;i++){const n=this.stickyRowCtrls[i].getRowNode();n!==e&&t.push(n)}this.refreshNodesAndContainerHeight(t,this.containerHeight)&&this.checkStickyRows()}refreshNodesAndContainerHeight(e,t){let i=!1;const n=this.stickyRowCtrls.filter(l=>e.indexOf(l.getRowNode())===-1),o=e.filter(l=>this.stickyRowCtrls.findIndex(d=>d.getRowNode()===l)===-1);(n.length||o.length)&&(i=!0);const r={};n.forEach(l=>{r[l.getRowNode().id]=l,this.stickyRowCtrls=this.stickyRowCtrls.filter(d=>d!==l)});for(const l of Object.values(r))l.getRowNode().sticky=!1;this.destroyRowCtrls(r,!1);const a=o.map(l=>(l.sticky=!0,this.createRowCon(l,!1,!1)));return this.stickyRowCtrls.push(...a),this.stickyRowCtrls.forEach(l=>l.setRowTop(l.getRowNode().stickyRowTop)),this.stickyRowCtrls.sort((l,d)=>d.getRowNode().rowIndex-l.getRowNode().rowIndex),this.containerHeight!==t&&(this.containerHeight=t,this.gridBodyCtrl.setStickyTopHeight(t),i=!0),i}}__decorate$17([Autowired("rowModel")],StickyRowFeature.prototype,"rowModel",void 0);__decorate$17([Autowired("rowRenderer")],StickyRowFeature.prototype,"rowRenderer",void 0);__decorate$17([Autowired("ctrlsService")],StickyRowFeature.prototype,"ctrlsService",void 0);__decorate$17([PostConstruct],StickyRowFeature.prototype,"postConstruct",null);var __decorate$16=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let RowRenderer=class extends BeanStub{constructor(){super(...arguments),this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach(r=>r.onRangeSelectionChanged())},t=()=>{this.getAllCellCtrls().forEach(r=>r.updateRangeBordersIfRangeCount())},i=()=>{this.eventService.addEventListener(Events.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.addEventListener(Events.EVENT_COLUMN_MOVED,t),this.eventService.addEventListener(Events.EVENT_COLUMN_PINNED,t),this.eventService.addEventListener(Events.EVENT_COLUMN_VISIBLE,t)},n=()=>{this.eventService.removeEventListener(Events.EVENT_RANGE_SELECTION_CHANGED,e),this.eventService.removeEventListener(Events.EVENT_COLUMN_MOVED,t),this.eventService.removeEventListener(Events.EVENT_COLUMN_PINNED,t),this.eventService.removeEventListener(Events.EVENT_COLUMN_VISIBLE,t)};this.addDestroyFunc(()=>n()),this.addManagedPropertyListener("enableRangeSelection",r=>{r.currentValue?i():n()}),this.gridOptionsService.get("enableRangeSelection")&&i()}}postConstruct(){this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl(),this.initialise()})}initialise(){if(this.addManagedListener(this.eventService,Events.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_BODY_SCROLL,this.onBodyScroll.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_BODY_HEIGHT_CHANGED,this.redraw.bind(this)),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListeners(["suppressCellFocus","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.gridOptionsService.isGroupRowsSticky()){const e=this.rowModel.getType();(e==="clientSide"||e==="serverSide")&&(this.stickyRowFeature=this.createManagedBean(new StickyRowFeature(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gridOptionsService.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gridOptionsService.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gridOptionsService.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=e??3;this.cachedRowCtrls=new RowCtrlCache(t)}}getKeepDetailRowsCount(){return this.gridOptionsService.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyRowCtrls():[]}updateAllRowCtrls(){const e=getAllValuesInObject(this.rowCtrlsByRowIndex),t=getAllValuesInObject(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}registerCellEventListeners(){this.addManagedListener(this.eventService,Events.EVENT_CELL_FOCUSED,e=>{this.onCellFocusChanged(e)}),this.addManagedListener(this.eventService,Events.EVENT_CELL_FOCUS_CLEARED,()=>{this.onCellFocusChanged()}),this.addManagedListener(this.eventService,Events.EVENT_FLASH_CELLS,e=>{this.getAllCellCtrls().forEach(t=>t.onFlashCells(e))}),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_HOVER_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onColumnHover())}),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onDisplayedColumnsChanged())}),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>{this.printLayout&&this.getAllCellCtrls().forEach(e=>e.onLeftChanged())}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedListener(this.eventService,Events.EVENT_GRID_COLUMNS_CHANGED,this.refreshListenersToColumnsForCellComps.bind(this)),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getAllGridColumns().forEach(t=>{const i=d=>{this.getAllCellCtrls().forEach(h=>{h.getColumn()===t&&d(h)})},n=()=>{i(d=>d.onLeftChanged())},o=()=>{i(d=>d.onWidthChanged())},r=()=>{i(d=>d.onFirstRightPinnedChanged())},a=()=>{i(d=>d.onLastLeftPinnedChanged())},l=()=>{i(d=>d.onColDefChanged())};t.addEventListener("leftChanged",n),t.addEventListener("widthChanged",o),t.addEventListener("firstRightPinnedChanged",r),t.addEventListener("lastLeftPinnedChanged",a),t.addEventListener("colDefChanged",l),this.destroyFuncsForColumnListeners.push(()=>{t.removeEventListener("leftChanged",n),t.removeEventListener("widthChanged",o),t.removeEventListener("firstRightPinnedChanged",r),t.removeEventListener("lastLeftPinnedChanged",a),t.removeEventListener("colDefChanged",l)})})}onDomLayoutChanged(){const e=this.gridOptionsService.isDomLayout("print"),t=e||this.gridOptionsService.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach(i=>{const n=i.getCellElement(e);n&&t.push(n)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowData()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowData())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){e.forEach(i=>{i.destroyFirstPass(),i.destroySecondPass()}),e.length=0,t&&t.forEach(i=>{const n=new RowCtrl(i,this.beans,!1,!1,this.printLayout);e.push(n)})}onPinnedRowDataChanged(){const e={recycleRows:!0};this.redrawAfterModelUpdate(e)}redrawRow(e,t=!1){var i;if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else if(!((i=this.cachedRowCtrls)===null||i===void 0)&&i.has(e)){this.cachedRowCtrls.removeRow(e);return}else{const n=o=>{const r=o[e.rowIndex];r&&r.getRowNode()===e&&(r.destroyFirstPass(),r.destroySecondPass(),o[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":n(this.topRowCtrls);break;case"bottom":n(this.bottomRowCtrls);break;default:n(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(e!=null){e==null||e.forEach(i=>this.redrawRow(i,!0)),this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=e!=null&&e.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(t==null)return null;const n=this.gridOptionsService.getDocument().activeElement,o=this.gridOptionsService.getDomData(n,CellCtrl.DOM_DATA_KEY_CELL_CTRL),r=this.gridOptionsService.getDomData(n,RowCtrl.DOM_DATA_KEY_ROW_CTRL);return o||r?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,n=e.animate&&this.gridOptionsService.isAnimateRows(),o=i?this.getRowsToRecycle():null;i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature&&this.stickyRowFeature.checkStickyRows(),this.recycleRows(o,n),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),t!=null&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gridOptionsService.get("suppressScrollOnNewData");t&&!i&&this.gridBodyCtrl.getScrollFeature().scrollToTop()}updateContainerHeights(){if(this.printLayout){this.rowContainerHeightService.setModelHeight(null);return}let e=this.paginationProxy.getCurrentPageHeight();e===0&&(e=1),this.rowContainerHeightService.setModelHeight(e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0}releaseLockOnRefresh(){this.refreshInProgress=!1}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&(this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged(this.beans.gridOptionsService.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"mock"})))}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let n=0;n<i;n++){const o=t[n].getAllCellCtrls(),r=o.length;for(let a=0;a<r;a++)e.push(o[a])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyRowCtrls()||[],t=[...this.topRowCtrls,...this.bottomRowCtrls,...e];for(const i of Object.keys(this.rowCtrlsByRowIndex))t.push(this.rowCtrlsByRowIndex[i]);return t}addRenderedRowListener(e,t,i){const n=this.rowCtrlsByRowIndex[t];n&&n.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach(t=>t.flashCell(e))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};this.getCellCtrls(e.rowNodes,e.columns).forEach(i=>i.refreshOrDestroyCell(t)),e.rowNodes&&(this.getRowCtrls(e.rowNodes).forEach(i=>{if(!i.isFullWidth())return;i.refreshFullWidth()||this.redrawRow(i.getRowNode(),!0)}),this.dispatchDisplayedRowsChanged(!1))}getCellRendererInstances(e){var t;const i=this.getCellCtrls(e.rowNodes,e.columns).map(r=>r.getCellRenderer()).filter(r=>r!=null);if(!((t=e.columns)===null||t===void 0)&&t.length)return i;const n=[],o=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(r=>{if(o&&!this.isRowInMap(r.getRowNode(),o)||!r.isFullWidth())return;const a=r.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const d=a[l];d!=null&&n.push(d)}}),[...n,...i]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach(i=>{const n=i.getCellEditor();n&&t.push(n)}),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach(t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}}),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach(i=>{const n=i.id;i.rowPinned==="top"?t.top[n]=i:i.rowPinned==="bottom"?t.bottom[n]=i:t.normal[n]=i}),t}isRowInMap(e,t){const i=e.id,n=e.rowPinned;return n==="bottom"?t.bottom[i]!=null:n==="top"?t.top[i]!=null:t.normal[i]!=null}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return!e||!t?i:i.filter(n=>{const o=n.getRowNode();return this.isRowInMap(o,t)})}getCellCtrls(e,t){let i;exists(t)&&(i={},t.forEach(o=>{const r=this.columnModel.getGridColumn(o);exists(r)&&(i[r.getId()]=!0)}));const n=[];return this.getRowCtrls(e).forEach(o=>{o.getAllCellCtrls().forEach(r=>{const a=r.getColumn().getId();i&&!i[a]||n.push(r)})}),n}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}getRowsToRecycle(){const e=[];iterateObject(this.rowCtrlsByRowIndex,(i,n)=>{n.getRowNode().id==null&&e.push(i)}),this.removeRowCtrls(e);const t={};return iterateObject(this.rowCtrlsByRowIndex,(i,n)=>{const o=n.getRowNode();t[o.id]=n}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach(i=>{const n=this.rowCtrlsByRowIndex[i];n&&(n.destroyFirstPass(t),n.destroySecondPass()),delete this.rowCtrlsByRowIndex[i]})}onBodyScroll(e){e.direction==="vertical"&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&browserSupportsPreventScroll()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const n=this.firstRenderedRow,o=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let r=!1;this.stickyRowFeature&&(r=this.stickyRowFeature.checkStickyRows());const a=this.firstRenderedRow!==n||this.lastRenderedRow!==o;if(!(t&&!r&&!a)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!r),i!=null)){const l=this.getCellToRestoreFocusToAfterRefresh();i!=null&&l==null&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach(r=>i[r]=!0);const o=Object.keys(this.rowCtrlsByRowIndex).filter(r=>!i[r]);this.removeRowCtrls(o,t)}calculateIndexesToDraw(e){let t=createArrayOfNumbers(this.firstRenderedRow,this.lastRenderedRow);const i=(o,r)=>{const a=r.getRowNode().rowIndex;a!=null&&(a<this.firstRenderedRow||a>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(r)&&t.push(a)};iterateObject(this.rowCtrlsByRowIndex,i),iterateObject(e,i),t.sort((o,r)=>o-r);const n=[];for(let o=0;o<t.length;o++){const r=t[o],a=this.paginationProxy.getRow(r);a&&!a.sticky&&n.push(r)}return n}recycleRows(e,t=!1,i=!1){const n=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(n,!t),n.forEach(o=>{this.createOrUpdateRowCtrl(o,e,t,i)}),e&&(i&&!this.gridOptionsService.get("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}):this.destroyRowCtrls(e,t)),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:Events.EVENT_DISPLAYED_ROWS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.columnModel.isPinningLeft(),t=this.columnModel.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter(i=>{if(!i.isFullWidth())return!1;const n=i.getRowNode();return!(t!=null&&!this.isRowInMap(n,t))})}createOrUpdateRowCtrl(e,t,i,n){let o,r=this.rowCtrlsByRowIndex[e];if(r||(o=this.paginationProxy.getRow(e),exists(o)&&exists(t)&&t[o.id]&&o.alreadyRendered&&(r=t[o.id],t[o.id]=null)),!r)if(o||(o=this.paginationProxy.getRow(e)),exists(o))r=this.createRowCon(o,i,n);else return;return o&&(o.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=r,r}destroyRowCtrls(e,t){const i=[];iterateObject(e,(n,o)=>{if(o){if(this.cachedRowCtrls&&o.isCacheable()){this.cachedRowCtrls.addRow(o);return}o.destroyFirstPass(!t),t?(this.zombieRowCtrls[o.getInstanceId()]=o,i.push(()=>{o.destroySecondPass(),delete this.zombieRowCtrls[o.getInstanceId()]})):o.destroySecondPass()}}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),executeInAWhile(i))}getRowBuffer(){return this.gridOptionsService.get("rowBuffer")}getRowBufferInPixels(){const e=this.getRowBuffer(),t=this.gridOptionsService.getRowHeightAsNumber();return e*t}workOutFirstAndLastRowsToRender(){this.rowContainerHeightService.updateOffset();let e,t;if(!this.paginationProxy.isRowsToRender())e=0,t=-1;else if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.paginationProxy.getPageFirstRow(),t=this.paginationProxy.getPageLastRow();else{const l=this.getRowBufferInPixels(),d=this.ctrlsService.getGridBodyCtrl(),h=this.gridOptionsService.get("suppressRowVirtualisation");let p=!1,m,v;do{const T=this.paginationProxy.getPixelOffset(),{pageFirstPixel:R,pageLastPixel:A}=this.paginationProxy.getCurrentPagePixelRange(),D=this.rowContainerHeightService.getDivStretchOffset(),x=d.getScrollFeature().getVScrollPosition(),M=x.top,I=x.bottom;h?(m=R+D,v=A+D):(m=Math.max(M+T-l,R)+D,v=Math.min(I+T+l,A)+D),this.firstVisibleVPixel=Math.max(M+T,R)+D,p=this.ensureAllRowsInRangeHaveHeightsCalculated(m,v)}while(p);let y=this.paginationProxy.getRowIndexAtPixel(m),b=this.paginationProxy.getRowIndexAtPixel(v);const S=this.paginationProxy.getPageFirstRow(),E=this.paginationProxy.getPageLastRow();y<S&&(y=S),b>E&&(b=E),e=y,t=b}const i=this.gridOptionsService.isDomLayout("normal"),n=this.gridOptionsService.get("suppressMaxRenderedRowRestriction"),o=Math.max(this.getRowBuffer(),500);i&&!n&&t-e>o&&(t=e+o);const r=e!==this.firstRenderedRow,a=t!==this.lastRenderedRow;if(r||a){this.firstRenderedRow=e,this.lastRenderedRow=t;const l={type:Events.EVENT_VIEWPORT_CHANGED,firstRow:e,lastRow:t};this.eventService.dispatchEvent(l)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:Events.EVENT_FIRST_DATA_RENDERED,firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent(e)})}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.paginationProxy.ensureRowHeightsValid(e,t,-1,-1);return i&&this.updateContainerHeights(),i}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const n=e.getRowNode(),o=this.focusService.isRowNodeFocused(n),r=e.isEditing(),a=n.detail;return o||r||a?!!this.paginationProxy.isRowPresent(n):!1}createRowCon(e,t,i){const n=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(n)return n;const o=this.gridOptionsService.get("suppressAnimationFrame"),r=i&&!o&&!this.printLayout;return new RowCtrl(e,this.beans,t,r,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.keys(e).map(t=>e[t].getRowNode())}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find(n=>n.getRowNode().rowIndex===i)||null);break}return t}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}isRangeInRenderedViewport(e,t){if(e==null||t==null)return!1;const n=e>this.lastRenderedRow;return!(t<this.firstRenderedRow)&&!n}};__decorate$16([Autowired("animationFrameService")],RowRenderer.prototype,"animationFrameService",void 0);__decorate$16([Autowired("paginationProxy")],RowRenderer.prototype,"paginationProxy",void 0);__decorate$16([Autowired("columnModel")],RowRenderer.prototype,"columnModel",void 0);__decorate$16([Autowired("pinnedRowModel")],RowRenderer.prototype,"pinnedRowModel",void 0);__decorate$16([Autowired("rowModel")],RowRenderer.prototype,"rowModel",void 0);__decorate$16([Autowired("focusService")],RowRenderer.prototype,"focusService",void 0);__decorate$16([Autowired("beans")],RowRenderer.prototype,"beans",void 0);__decorate$16([Autowired("rowContainerHeightService")],RowRenderer.prototype,"rowContainerHeightService",void 0);__decorate$16([Autowired("ctrlsService")],RowRenderer.prototype,"ctrlsService",void 0);__decorate$16([PostConstruct],RowRenderer.prototype,"postConstruct",null);RowRenderer=__decorate$16([Bean("rowRenderer")],RowRenderer);class RowCtrlCache{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const t=this.entriesList[0];t.destroyFirstPass(),t.destroySecondPass(),this.removeFromCache(t)}}getRow(e){if(e==null||e.id==null)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.getRowNode()!=e?null:t):null}has(e){return this.entriesMap[e.id]!=null}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],removeFromArray(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],removeFromArray(this.entriesList,e)}getEntries(){return this.entriesList}}var __decorate$15=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ValueFormatterService=class extends BeanStub{formatValue(e,t,i,n,o=!0){let r=null,a;const l=e.getColDef();if(n?a=n:o&&(a=l.valueFormatter),a){const d=this.gridOptionsService.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:l,column:e});typeof a=="function"?r=a(d):r=this.expressionService.evaluate(a,d)}else if(l.refData)return l.refData[i]||"";return r==null&&Array.isArray(i)&&(r=i.join(", ")),r}};__decorate$15([Autowired("expressionService")],ValueFormatterService.prototype,"expressionService",void 0);ValueFormatterService=__decorate$15([Bean("valueFormatterService")],ValueFormatterService);var __decorate$14=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let PinnedRowModel=class extends BeanStub{init(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",()=>this.setPinnedTopRowData()),this.addManagedPropertyListener("pinnedBottomRowData",()=>this.setPinnedBottomRowData())}isEmpty(e){const t=e==="top"?this.pinnedTopRows:this.pinnedBottomRows;return missingOrEmpty(t)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i=t==="top"?this.pinnedTopRows:this.pinnedBottomRows;if(missingOrEmpty(i))return 0;for(let n=0;n<i.length;n++){const o=i[n];if(o.rowTop+o.rowHeight-1>=e)return n}return i.length-1}setPinnedTopRowData(){const e=this.gridOptionsService.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(e,!0);const t={type:Events.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}setPinnedBottomRowData(){const e=this.gridOptionsService.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(e,!1);const t={type:Events.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}createNodesFromData(e,t){const i=[];if(e){let n=0;e.forEach((o,r)=>{const a=new RowNode(this.beans);a.data=o;const l=t?RowNode.ID_PREFIX_TOP_PINNED:RowNode.ID_PREFIX_BOTTOM_PINNED;a.id=l+r,a.rowPinned=t?"top":"bottom",a.setRowTop(n),a.setRowHeight(this.gridOptionsService.getRowHeightForNode(a).height),a.setRowIndex(r),n+=a.rowHeight,i.push(a)})}return i}getPinnedTopRowData(){return this.pinnedTopRows}getPinnedBottomRowData(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){missingOrEmpty(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){missingOrEmpty(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||e.length===0)return 0;const t=last(e);return t.rowTop+t.rowHeight}};__decorate$14([Autowired("beans")],PinnedRowModel.prototype,"beans",void 0);__decorate$14([PostConstruct],PinnedRowModel.prototype,"init",null);PinnedRowModel=__decorate$14([Bean("pinnedRowModel")],PinnedRowModel);var ServerSideTransactionResultStatus;(function(s){s.Applied="Applied",s.StoreNotFound="StoreNotFound",s.StoreLoading="StoreLoading",s.StoreWaitingToLoad="StoreWaitingToLoad",s.StoreLoadingFailed="StoreLoadingFailed",s.StoreWrongType="StoreWrongType",s.Cancelled="Cancelled",s.StoreNotStarted="StoreNotStarted"})(ServerSideTransactionResultStatus||(ServerSideTransactionResultStatus={}));class ChangedPath{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let n=0;n<e.childrenAfterGroup.length;n++){const o=e.childrenAfterGroup[n];o.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[n],t,i):i&&t(o)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const n={rowNode:t,children:null};this.mapToItems[t.id]=n,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach(n=>this.nodeIdsToColumns[i.id][n.getId()]=!0),i=i.parent}linkPathItems(e,t){let i=e;for(let n=0;n<t;n++){const o=this.mapToItems[i.id],r=this.mapToItems[i.parent.id];r.children||(r.children=[]),r.children.push(o),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter(o=>i[o.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter(o=>!i[o.getId()])}}class RowNodeBlock extends BeanStub{constructor(e){super(),this.state=RowNodeBlock.STATE_WAITING_TO_LOAD,this.version=0,this.id=e}getId(){return this.id}load(){this.state=RowNodeBlock.STATE_LOADING,this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state=RowNodeBlock.STATE_WAITING_TO_LOAD}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state=RowNodeBlock.STATE_FAILED,this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(e,t){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(e)&&(this.state=RowNodeBlock.STATE_LOADED,this.processServerResult(t))}dispatchLoadCompleted(e=!0){const t={type:RowNodeBlock.EVENT_LOAD_COMPLETE,success:e,block:this};this.dispatchEvent(t)}}RowNodeBlock.EVENT_LOAD_COMPLETE="loadComplete";RowNodeBlock.STATE_WAITING_TO_LOAD="needsLoading";RowNodeBlock.STATE_LOADING="loading";RowNodeBlock.STATE_LOADED="loaded";RowNodeBlock.STATE_FAILED="failed";var __decorate$13=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},__param$5=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}},RowNodeBlockLoader_1;let RowNodeBlockLoader=RowNodeBlockLoader_1=class extends BeanStub{constructor(){super(...arguments),this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gridOptionsService.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=_.debounce(this.performCheckBlocksToLoad.bind(this),e))}setBeans(e){this.logger=e.create("RowNodeBlockLoader")}getMaxConcurrentDatasourceRequests(){const e=this.gridOptionsService.get("maxConcurrentDatasourceRequests");if(e==null)return 2;if(!(e<=0))return e}addBlock(e){this.blocks.push(e),e.addEventListener(RowNodeBlock.EVENT_LOAD_COMPLETE,this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){_.removeFromArray(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchEvent({type:RowNodeBlockLoader_1.BLOCK_LOADED_EVENT}),this.activeBlockLoadsCount==0&&this.dispatchEvent({type:RowNodeBlockLoader_1.BLOCK_LOADER_FINISHED_EVENT})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){this.logger.log("checkBlockToLoad: max loads exceeded");return}const e=this.getAvailableLoadingCount(),t=this.blocks.filter(i=>i.getState()===RowNodeBlock.STATE_WAITING_TO_LOAD).slice(0,e);this.registerLoads(t.length),t.forEach(i=>i.load()),this.printCacheStatus()}getBlockState(){if(this.gridOptionsService.isRowModelType("serverSide"))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach(t=>{const{id:i,state:n}=t.getBlockStateJson();e[i]=n}),e}printCacheStatus(){this.logger.isLogging()&&this.logger.log(`printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return this.maxConcurrentRequests!==void 0?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}};RowNodeBlockLoader.BLOCK_LOADED_EVENT="blockLoaded";RowNodeBlockLoader.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished";__decorate$13([Autowired("rowModel")],RowNodeBlockLoader.prototype,"rowModel",void 0);__decorate$13([PostConstruct],RowNodeBlockLoader.prototype,"postConstruct",null);__decorate$13([__param$5(0,Qualifier("loggerFactory"))],RowNodeBlockLoader.prototype,"setBeans",null);RowNodeBlockLoader=RowNodeBlockLoader_1=__decorate$13([Bean("rowNodeBlockLoader")],RowNodeBlockLoader);var __decorate$12=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let PaginationProxy=class extends BeanStub{constructor(){super(...arguments),this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.pixelOffset=0,this.masterRowCount=0}postConstruct(){this.active=this.gridOptionsService.get("pagination"),this.pageSizeFromGridOptions=this.gridOptionsService.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedListener(this.eventService,Events.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this)),this.onModelUpdated()}ensureRowHeightsValid(e,t,i,n){const o=this.rowModel.ensureRowHeightsValid(e,t,this.getPageFirstRow(),this.getPageLastRow());return o&&this.calculatePages(),o}isPaginateChildRows(){return this.gridOptionsService.get("groupRemoveSingleChildren")||this.gridOptionsService.get("groupRemoveLowestSingleChildren")?!0:this.gridOptionsService.get("paginateChildRows")}onModelUpdated(e){this.calculatePages();const t={type:Events.EVENT_PAGINATION_CHANGED,animate:e?e.animate:!1,newData:e?e.newData:!1,newPage:e?e.newPage:!1,newPageSize:e?e.newPageSize:!1,keepRenderedRows:e?e.keepRenderedRows:!1};this.eventService.dispatchEvent(t)}onPaginationGridOptionChanged(){this.active=this.gridOptionsService.get("pagination"),this.calculatePages();const e={type:Events.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,newPageSize:!1,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}onPageSizeGridOptionChanged(){this.setPageSize(this.gridOptionsService.get("paginationPageSize"),"gridOptions")}goToPage(e){if(!this.active||this.currentPage===e||typeof this.currentPage!="number")return;this.currentPage=e;const t={type:Events.EVENT_MODEL_UPDATED,animate:!1,keepRenderedRows:!1,newData:!1,newPage:!0,newPageSize:!1};this.onModelUpdated(t)}getPixelOffset(){return this.pixelOffset}getRow(e){return this.rowModel.getRow(e)}getRowNode(e){return this.rowModel.getRowNode(e)}getRowIndexAtPixel(e){return this.rowModel.getRowIndexAtPixel(e)}getCurrentPageHeight(){return missing(this.topRowBounds)||missing(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){const e=this.topRowBounds?this.topRowBounds.rowTop:0,t=this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0;return{pageFirstPixel:e,pageLastPixel:t}}isRowPresent(e){return this.rowModel.isRowPresent(e)?e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex:!1}isEmpty(){return this.rowModel.isEmpty()}isRowsToRender(){return this.rowModel.isRowsToRender()}forEachNode(e){return this.rowModel.forEachNode(e)}forEachNodeOnPage(e){const t=this.getPageFirstRow(),i=this.getPageLastRow();for(let n=t;n<=i;n++){const o=this.getRow(n);o&&e(o)}}getType(){return this.rowModel.getType()}getRowBounds(e){const t=this.rowModel.getRowBounds(e);return t.rowIndex=e,t}getPageFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getPageLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getRowCount(){return this.rowModel.getRowCount()}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return this.active?this.getPageForIndex(e.rowIndex)===this.currentPage:!0}isLastPageFound(){return this.rowModel.isLastRowIndexKnown()}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return exists(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:exists(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:exists(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:exists(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&this.onModelUpdated({type:Events.EVENT_MODEL_UPDATED,animate:!1,keepRenderedRows:!1,newData:!1,newPage:!1,newPageSize:!0})}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}if(i!==this.pageSize){const n={type:Events.EVENT_MODEL_UPDATED,animate:!1,keepRenderedRows:!1,newData:!1,newPage:!1,newPageSize:!0};this.onModelUpdated(n)}}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.topRowBounds=this.rowModel.getRowBounds(this.topDisplayedRowIndex),this.topRowBounds&&(this.topRowBounds.rowIndex=this.topDisplayedRowIndex),this.bottomRowBounds=this.rowModel.getRowBounds(this.bottomDisplayedRowIndex),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=this.bottomDisplayedRowIndex),this.setPixelOffset(exists(this.topRowBounds)?this.topRowBounds.rowTop:0)}setPixelOffset(e){this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0){this.setZeroRows();return}const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const n=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=n-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),this.masterRowCount===0){this.setZeroRows();return}const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(this.masterRowCount,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}};__decorate$12([Autowired("rowModel")],PaginationProxy.prototype,"rowModel",void 0);__decorate$12([PostConstruct],PaginationProxy.prototype,"postConstruct",null);PaginationProxy=__decorate$12([Bean("paginationProxy")],PaginationProxy);var __decorate$11=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let StylingService=class extends BeanStub{processAllCellClasses(e,t,i,n){this.processClassRules(void 0,e.cellClassRules,t,i,n),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,n,o){if(t==null&&e==null)return;const r={},a={},l=(d,h)=>{d.split(" ").forEach(p=>{p.trim()!=""&&h(p)})};if(t){const d=Object.keys(t);for(let h=0;h<d.length;h++){const p=d[h],m=t[p];let v;typeof m=="string"?v=this.expressionService.evaluate(m,i):typeof m=="function"&&(v=m(i)),l(p,y=>{v?r[y]=!0:a[y]=!0})}}e&&o&&Object.keys(e).forEach(d=>l(d,h=>{r[h]||(a[h]=!0)})),o&&Object.keys(a).forEach(o),Object.keys(r).forEach(n)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let n;return typeof i=="function"?n=i(t):n=i,typeof n=="string"&&(n=[n]),n||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach(o=>{i(o)})}};__decorate$11([Autowired("expressionService")],StylingService.prototype,"expressionService",void 0);StylingService=__decorate$11([Bean("stylingService")],StylingService);class AgToggleButton extends AgCheckbox{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}}class AgInputTextArea extends AgAbstractInputField{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}}class AgInputDateField extends AgInputTextField{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this));const e=isBrowserSafari();this.addManagedListener(this.eInput,"mousedown",()=>{this.isDisabled()||e||this.eInput.focus()}),this.eInput.step="any"}onWheel(e){document.activeElement===this.eInput&&e.preventDefault()}setMin(e){var t;const i=e instanceof Date?(t=serialiseDate(e??null,!1))!==null&&t!==void 0?t:void 0:e;return this.min===i?this:(this.min=i,addOrRemoveAttribute(this.eInput,"min",i),this)}setMax(e){var t;const i=e instanceof Date?(t=serialiseDate(e??null,!1))!==null&&t!==void 0?t:void 0:e;return this.max===i?this:(this.max=i,addOrRemoveAttribute(this.eInput,"max",i),this)}setStep(e){return this.step===e?this:(this.step=e,addOrRemoveAttribute(this.eInput,"step",e),this)}getDate(){var e;if(this.eInput.validity.valid)return(e=parseDateTimeFromString(this.getValue()))!==null&&e!==void 0?e:void 0}setDate(e,t){this.setValue(serialiseDate(e??null,!1),t)}}class AgInputRange extends AgAbstractInputField{constructor(e){super(e,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:e,max:t,step:i}=this.config;e!=null&&this.setMinValue(e),t!=null&&this.setMaxValue(t),this.setStep(i||1)}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>{const t=e.target.value;this.setValue(t)})}setMinValue(e){return this.min=e,this.eInput.setAttribute("min",e.toString()),this}setMaxValue(e){return this.max=e,this.eInput.setAttribute("max",e.toString()),this}setStep(e){return this.eInput.setAttribute("step",e.toString()),this}setValue(e,t){this.min!=null&&(e=Math.max(parseFloat(e),this.min).toString()),this.max!=null&&(e=Math.min(parseFloat(e),this.max).toString());const i=super.setValue(e,t);return this.eInput.value=e,i}}var __decorate$10=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class RichSelectRow extends Component{constructor(e,t){super('<div class="ag-rich-select-row" role="presentation"></div>'),this.params=e,this.wrapperEl=t}postConstruct(){this.addManagedListener(this.getGui(),"click",this.onClick.bind(this))}setState(e){let t="";this.params.valueFormatter&&(t=this.params.valueFormatter(e)),this.populateWithRenderer(e,t)||this.populateWithoutRenderer(e,t),this.value=e}highlightString(e){const{parsedValue:t}=this;if(this.params.cellRenderer||!exists(t))return;let i=exists(e);if(i){const n=t==null?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(n>=0){const o=n+e.length,r=escapeString(t.slice(0,n),!0),a=escapeString(t.slice(n,o),!0),l=escapeString(t.slice(o));this.renderValueWithoutRenderer(`${r}<span class="ag-rich-select-row-text-highlight">${a}</span>${l}`)}else i=!1}i||this.renderValueWithoutRenderer(t)}updateHighlighted(e){var t;const i=this.getGui(),n=`ag-rich-select-row-${this.getCompId()}`;if((t=i.parentElement)===null||t===void 0||t.setAttribute("id",n),e){const o=this.getParentComponent().getAriaElement();setAriaActiveDescendant(o,n),this.wrapperEl.setAttribute("data-active-option",n)}setAriaSelected(i.parentElement,e),this.addOrRemoveCssClass("ag-rich-select-row-selected",e)}populateWithoutRenderer(e,t){const i=this.gridOptionsService.getDocument(),n=this.getGui(),o=i.createElement("span");o.style.overflow="hidden",o.style.textOverflow="ellipsis";const r=escapeString(exists(t)?t:e,!0);this.parsedValue=exists(r)?r:null,n.appendChild(o),this.renderValueWithoutRenderer(r)}renderValueWithoutRenderer(e){const t=this.getGui().querySelector("span");t&&(t.innerHTML=exists(e)?e:" ")}populateWithRenderer(e,t){let i,n;return this.params.cellRenderer&&(n=this.userComponentFactory.getCellRendererDetails(this.params,{value:e,valueFormatted:t})),n&&(i=n.newAgStackInstance()),i&&bindCellRendererToHtmlElement(i,this.getGui()),i?(i.then(o=>{this.addDestroyFunc(()=>{this.getContext().destroyBean(o)})}),!0):!1}onClick(){const e=this.getParentComponent(),t={type:Events.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:!1,value:this.value};e==null||e.dispatchEvent(t)}}__decorate$10([Autowired("userComponentFactory")],RichSelectRow.prototype,"userComponentFactory",void 0);__decorate$10([PostConstruct],RichSelectRow.prototype,"postConstruct",null);var __decorate$$=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class VirtualList extends TabGuardComp{constructor(e){super(VirtualList.getTemplate((e==null?void 0:e.cssIdentifier)||"default")),this.renderedRows=new Map,this.rowHeight=20;const{cssIdentifier:t="default",ariaRole:i="listbox",listName:n}=e||{};this.cssIdentifier=t,this.ariaRole=i,this.listName=n}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)}),this.setAriaProperties(),this.addManagedListener(this.eventService,Events.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanged.bind(this))}onGridStylesChanged(){this.rowHeight=this.getItemHeight(),this.refresh()}setAriaProperties(){const t=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),i=this.eContainer;setAriaRole(i,this.ariaRole),setAriaLabel(i,t)}addResizeObserver(){const e=()=>this.animationFrameService.requestAnimationFrame(()=>this.drawVirtualRows()),t=this.resizeObserverService.observeResize(this.getGui(),e);this.addDestroyFunc(t)}focusInnerElement(e){this.focusRow(e?this.model.getRowCount()-1:0)}onFocusIn(e){const t=e.target;t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=getAriaPosInSet(t)-1)}onFocusOut(e){this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null)}handleKeyDown(e){switch(e.key){case KeyCode.UP:case KeyCode.DOWN:this.navigate(e.key===KeyCode.UP)&&e.preventDefault();break}}onTabKeyDown(e){this.navigate(e.shiftKey)?e.preventDefault():(stopPropagationForAgGrid(e),this.forceFocusOutOfContainer(e.shiftKey))}navigate(e){if(this.lastFocusedRowIndex==null)return!1;const t=this.lastFocusedRowIndex+(e?-1:1);return t<0||t>=this.model.getRowCount()?!1:(this.focusRow(t),!0)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.ensureIndexVisible(e),window.setTimeout(()=>{if(!this.isAlive())return;const t=this.renderedRows.get(e);t&&t.eDiv.focus()},10)}getComponentAt(e){const t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,i)=>e(t.rowComponent,i))}static getTemplate(e){return`<div class="ag-virtual-list-viewport ag-${e}-virtual-list-viewport" role="presentation">
|
||
<div class="ag-virtual-list-container ag-${e}-virtual-list-container" ref="eContainer"></div>
|
||
</div>`}getItemHeight(){return this.environment.getListItemHeight()}ensureIndexVisible(e,t=!0){const i=this.model.getRowCount();if(typeof e!="number"||e<0||e>=i)return console.warn("AG Grid: invalid row index for ensureIndexVisible: "+e),!1;const n=e*this.rowHeight,o=n+this.rowHeight,r=this.getGui(),a=r.scrollTop,l=r.offsetHeight,d=a+l,h=t?0:this.rowHeight,p=a>n+h,m=d<o-h;if(p)return r.scrollTop=n,!0;if(m){const v=o-l;return r.scrollTop=v,!0}return!1}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.rowHeight=e,this.refresh()}refresh(e){if(this.model==null||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=`${t*this.rowHeight}px`,waitUntil(()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&typeof this.model.areRowsEqual=="function"&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),i=t.scrollTop,n=i+t.offsetHeight,o=Math.floor(i/this.rowHeight),r=Math.floor(n/this.rowHeight);this.ensureRowsRendered(o,r,e)}ensureRowsRendered(e,t,i){this.renderedRows.forEach((n,o)=>{(o<e||o>t)&&o!==this.lastFocusedRowIndex&&this.removeRow(o)}),i&&this.refreshRows();for(let n=e;n<=t;n++)this.renderedRows.has(n)||n<this.model.getRowCount()&&this.insertRow(n)}insertRow(e){const t=this.model.getRow(e),i=document.createElement("div");i.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),setAriaRole(i,this.ariaRole==="tree"?"treeitem":"option"),setAriaSetSize(i,this.model.getRowCount()),setAriaPosInSet(i,e+1),i.setAttribute("tabindex","-1"),i.style.height=`${this.rowHeight}px`,i.style.top=`${this.rowHeight*e}px`;const n=this.componentCreator(t,i);n.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),i.appendChild(n.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",i):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",i):this.eContainer.appendChild(i),this.renderedRows.set(e,{rowComponent:n,eDiv:i,value:t})}removeRow(e){const t=this.renderedRows.get(e);this.eContainer.removeChild(t.eDiv),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach((t,i)=>{var n,o;if(i>=e)this.removeRow(i);else{const r=this.model.getRow(i);!((o=(n=this.model).areRowsEqual)===null||o===void 0)&&o.call(n,t.value,r)?this.componentUpdater(r,t.rowComponent):this.removeRow(i)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),super.destroy())}}__decorate$$([Autowired("resizeObserverService")],VirtualList.prototype,"resizeObserverService",void 0);__decorate$$([Autowired("animationFrameService")],VirtualList.prototype,"animationFrameService",void 0);__decorate$$([RefSelector("eContainer")],VirtualList.prototype,"eContainer",void 0);__decorate$$([PostConstruct],VirtualList.prototype,"postConstruct",null);var __decorate$_=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const TEMPLATE=`
|
||
<div class="ag-picker-field" role="presentation">
|
||
<div ref="eLabel"></div>
|
||
<div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed">
|
||
<div ref="eDisplayField" class="ag-picker-field-display"></div>
|
||
<ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>
|
||
<div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>
|
||
</div>
|
||
</div>`;class AgRichSelect extends AgPickerField{constructor(e){var t,i;super(Object.assign(Object.assign({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"smallDown",ariaRole:"combobox",template:(t=e==null?void 0:e.template)!==null&&t!==void 0?t:TEMPLATE,modalPicker:!1},e),{maxPickerHeight:(i=e==null?void 0:e.maxPickerHeight)!==null&&i!==void 0?i:"calc(var(--ag-row-height) * 6.5)"})),this.searchString="",this.highlightedItem=-1,this.lastRowHovered=-1,this.searchStringCreator=null;const{cellRowHeight:n,value:o,valueList:r,searchStringCreator:a}=e||{};n!=null&&(this.cellRowHeight=n),o!==void 0&&(this.value=o),r!=null&&(this.values=r),a&&(this.searchStringCreator=a)}postConstruct(){super.postConstruct(),this.createLoadingElement(),this.createListComponent();const{allowTyping:e,placeholder:t}=this.config;e?(this.eInput.setAutoComplete(!1).setInputPlaceholder(t),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.eWrapper.tabIndex=this.gridOptionsService.get("tabIndex");const{searchDebounceDelay:i=300}=this.config;this.clearSearchString=debounce(this.clearSearchString,i),this.renderSelectedValue(),e&&(this.eInput.onValueChange(n=>this.searchTextFromString(n)),this.addManagedListener(this.eWrapper,"focus",this.onWrapperFocus.bind(this))),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}createLoadingElement(){const e=this.gridOptionsService.getDocument(),t=this.localeService.getLocaleTextFunc(),i=e.createElement("div");i.classList.add("ag-loading-text"),i.innerText=t("loadingOoo","Loading..."),this.eLoading=i}createListComponent(){this.listComponent=this.createBean(new VirtualList({cssIdentifier:"rich-select"})),this.listComponent.setComponentCreator(this.createRowComponent.bind(this));const e=(l,d)=>{};this.listComponent.setComponentUpdater(e),this.listComponent.setParentComponent(this),this.addManagedListener(this.listComponent,Events.EVENT_FIELD_PICKER_VALUE_SELECTED,l=>{this.onListValueSelected(l.value,l.fromEnterKey)});const{cellRowHeight:t}=this;t&&this.listComponent.setRowHeight(t);const i=this.listComponent.getGui(),n=this.listComponent.getAriaElement();this.addManagedListener(i,"mousemove",this.onPickerMouseMove.bind(this)),this.addManagedListener(i,"mousedown",l=>l.preventDefault()),i.classList.add("ag-rich-select-list");const o=`ag-rich-select-list-${this.listComponent.getCompId()}`;n.setAttribute("id",o);const a=this.localeService.getLocaleTextFunc()(this.config.pickerAriaLabelKey,this.config.pickerAriaLabelValue);setAriaLabel(n,a),setAriaControls(this.eWrapper,n)}renderSelectedValue(){const{value:e,eDisplayField:t,config:i}=this,{allowTyping:n,initialInputValue:o}=this.config,r=this.config.valueFormatter?this.config.valueFormatter(e):e;if(n){this.eInput.setValue(o??r);return}let a;i.cellRenderer&&(a=this.userComponentFactory.getCellRendererDetails(this.config,{value:e,valueFormatted:r}));let l;if(a&&(l=a.newAgStackInstance()),l)clearElement(t),bindCellRendererToHtmlElement(l,t),l.then(d=>{this.addDestroyFunc(()=>this.getContext().destroyBean(d))});else if(exists(this.value))t.innerText=r,t.classList.remove("ag-display-as-placeholder");else{const{placeholder:d}=i;exists(d)?(t.innerHTML=`${escapeString(d)}`,t.classList.add("ag-display-as-placeholder")):clearElement(t)}}getCurrentValueIndex(){const{currentList:e,value:t}=this;if(t==null||!e)return-1;for(let i=0;i<e.length;i++)if(e[i]===t)return i;return-1}highlightFilterMatch(){var e;(e=this.listComponent)===null||e===void 0||e.forEachRenderedRow((t,i)=>{t.highlightString(this.searchString)})}highlightSelectedValue(e){var t;e==null&&(e=this.getCurrentValueIndex()),this.highlightedItem=e,(t=this.listComponent)===null||t===void 0||t.forEachRenderedRow((i,n)=>{const o=e===-1?!1:this.highlightedItem===n;i.updateHighlighted(o)})}setRowHeight(e){e!==this.cellRowHeight&&(this.cellRowHeight=e),this.listComponent&&this.listComponent.setRowHeight(e)}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueList(e){const{valueList:t,refresh:i}=e;this.listComponent&&this.currentList!==t&&(this.currentList=t,this.listComponent.setModel({getRowCount:()=>t.length,getRow:n=>t[n],areRowsEqual:(n,o)=>n===o}),i&&(this.values?this.listComponent.refresh(!0):(this.values=t,this.isPickerDisplayed&&this.showCurrentValueInPicker())))}showPicker(){super.showPicker(),this.showCurrentValueInPicker(),this.displayOrHidePicker()}showCurrentValueInPicker(){var e,t;if(!this.listComponent)return;if(!this.currentList){this.isPickerDisplayed&&this.eLoading&&this.listComponent.appendChild(this.eLoading);return}!((e=this.eLoading)===null||e===void 0)&&e.offsetParent&&((t=this.eLoading.parentElement)===null||t===void 0||t.removeChild(this.eLoading));const i=this.getCurrentValueIndex();i!==-1?(this.listComponent.refresh(),this.listComponent.ensureIndexVisible(i),this.listComponent.refresh(!0),this.highlightSelectedValue(i)):this.listComponent.refresh()}beforeHidePicker(){this.highlightedItem=-1,super.beforeHidePicker()}onWrapperFocus(){if(!this.eInput)return;const e=this.eInput.getFocusableElement();e.focus(),e.select()}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===KeyCode.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!isEventFromPrintableCharacter(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){e==null&&(e=""),this.searchString=e,this.runSearch()}buildSearchStrings(e){const{valueFormatter:t=n=>n}=this.config;let i;return typeof e[0]=="number"||typeof e[0]=="string"?i=e.map(n=>t(n)):typeof e[0]=="object"&&this.searchStringCreator&&(i=this.searchStringCreator(e)),i}getSuggestionsAndFilteredValues(e,t){let i=[],n=[];if(!e.length)return{suggestions:i,filteredValues:n};const{searchType:o="fuzzy",filterList:r}=this.config;if(o==="fuzzy"){const a=fuzzySuggestions(this.searchString,t,!0);i=a.values;const l=a.indices;if(r&&l.length)for(let d=0;d<l.length;d++)n.push(this.values[l[d]])}else i=t.filter((a,l)=>{const d=a.toLocaleLowerCase(),h=this.searchString.toLocaleLowerCase(),p=o==="match"?d.startsWith(h):d.indexOf(h)!==-1;return r&&p&&n.push(this.values[l]),p});return{suggestions:i,filteredValues:n}}filterListModel(e){const{filterList:t}=this.config;t&&(this.setValueList({valueList:e,refresh:!0}),this.alignPickerToComponent())}runSearch(){var e,t;const{values:i}=this,n=this.buildSearchStrings(i);if(!n){this.highlightSelectedValue(-1);return}const{suggestions:o,filteredValues:r}=this.getSuggestionsAndFilteredValues(this.searchString,n),{filterList:a,highlightMatch:l,searchType:d="fuzzy"}=this.config,h=r.length,p=!!(a&&this.searchString!=="");if(this.filterListModel(p?r:i),o.length){const m=p?0:n.indexOf(o[0]);this.selectListItem(m)}else if(this.highlightSelectedValue(-1),!p||h)(e=this.listComponent)===null||e===void 0||e.ensureIndexVisible(0);else if(p){this.getAriaElement().removeAttribute("data-active-option");const m=(t=this.listComponent)===null||t===void 0?void 0:t.getAriaElement();m&&setAriaActiveDescendant(m,null)}l&&d!=="fuzzy"&&this.highlightFilterMatch(),this.displayOrHidePicker()}displayOrHidePicker(){var e;const t=(e=this.listComponent)===null||e===void 0?void 0:e.getGui(),i=this.currentList?this.currentList.length===0:!1;t==null||t.classList.toggle("ag-hidden",i)}clearSearchString(){this.searchString=""}selectListItem(e,t){if(!this.isPickerDisplayed||!this.currentList||!this.listComponent||e<0||e>=this.currentList.length)return;this.listComponent.ensureIndexVisible(e,!t)&&!t&&this.listComponent.refresh(!0),this.highlightSelectedValue(e)}setValue(e,t,i){const n=this.currentList?this.currentList.indexOf(e):-1;return n===-1?this:(this.value=e,i||this.selectListItem(n),this.renderSelectedValue(),super.setValue(e,t))}createRowComponent(e){const t=new RichSelectRow(this.config,this.eWrapper);t.setParentComponent(this.listComponent),this.getContext().createBean(t),t.setState(e);const{highlightMatch:i,searchType:n="fuzzy"}=this.config;return i&&n!=="fuzzy"&&t.highlightString(this.searchString),t}getRowForMouseEvent(e){const{listComponent:t}=this;if(!t)return-1;const n=(t==null?void 0:t.getGui()).getBoundingClientRect(),o=t.getScrollTop(),r=e.clientY-n.top+o;return Math.floor(r/t.getRowHeight())}onPickerMouseMove(e){if(!this.listComponent)return;const t=this.getRowForMouseEvent(e);t!==-1&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.selectListItem(t,!0))}onNavigationKeyDown(e,t){e.preventDefault();const i=t===KeyCode.DOWN;if(!this.isPickerDisplayed&&i){this.showPicker();return}const n=this.highlightedItem,r=n===-1?0:n+(i?1:-1);this.selectListItem(r)}onEnterKeyDown(e){this.isPickerDisplayed&&(e.preventDefault(),this.currentList&&this.onListValueSelected(this.currentList[this.highlightedItem],!0))}onTabKeyDown(){!this.isPickerDisplayed||!this.currentList||this.setValue(this.currentList[this.highlightedItem],!1,!0)}onListValueSelected(e,t){this.setValue(e,!1,!0),this.dispatchPickerEvent(e,t),this.hidePicker()}dispatchPickerEvent(e,t){const i={type:Events.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:t,value:e};this.dispatchEvent(i)}getFocusableElement(){const{allowTyping:e}=this.config;return e?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(e){const t=e.key,{allowTyping:i}=this.config;switch(t){case KeyCode.LEFT:case KeyCode.RIGHT:case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:i||e.preventDefault();break;case KeyCode.PAGE_UP:case KeyCode.PAGE_DOWN:e.preventDefault();break;case KeyCode.DOWN:case KeyCode.UP:this.onNavigationKeyDown(e,t);break;case KeyCode.ESCAPE:this.isPickerDisplayed&&(isVisible(this.listComponent.getGui())&&(e.preventDefault(),stopPropagationForAgGrid(e)),this.hidePicker());break;case KeyCode.ENTER:this.onEnterKeyDown(e);break;case KeyCode.TAB:this.onTabKeyDown();break;default:i||this.buildSearchStringFromKeyboardEvent(e)}}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),this.eLoading=void 0,super.destroy()}}__decorate$_([Autowired("userComponentFactory")],AgRichSelect.prototype,"userComponentFactory",void 0);__decorate$_([RefSelector("eInput")],AgRichSelect.prototype,"eInput",void 0);var __decorate$Z=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AgSlider extends AgAbstractLabel{constructor(e){super(e,AgSlider.TEMPLATE),this.labelAlignment="top"}init(){this.eSlider.addCssClass("ag-slider-field")}onValueChange(e){const t=Events.EVENT_FIELD_VALUE_CHANGED;return this.addManagedListener(this.eText,t,()=>{const i=parseFloat(this.eText.getValue());this.eSlider.setValue(i.toString(),!0),e(i||0)}),this.addManagedListener(this.eSlider,t,()=>{const i=this.eSlider.getValue();this.eText.setValue(i,!0),e(parseFloat(i))}),this}setSliderWidth(e){return this.eSlider.setWidth(e),this}setTextFieldWidth(e){return this.eText.setWidth(e),this}setMinValue(e){return this.eSlider.setMinValue(e),this.eText.setMin(e),this}setMaxValue(e){return this.eSlider.setMaxValue(e),this.eText.setMax(e),this}getValue(){return this.eText.getValue()}setValue(e){return this.getValue()===e?this:(this.eText.setValue(e,!0),this.eSlider.setValue(e,!0),this.dispatchEvent({type:Events.EVENT_FIELD_VALUE_CHANGED}),this)}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}}AgSlider.TEMPLATE=`<div class="ag-slider">
|
||
<label ref="eLabel"></label>
|
||
<div class="ag-wrapper ag-slider-wrapper">
|
||
<ag-input-range ref="eSlider"></ag-input-range>
|
||
<ag-input-number-field ref="eText"></ag-input-number-field>
|
||
</div>
|
||
</div>`;__decorate$Z([RefSelector("eLabel")],AgSlider.prototype,"eLabel",void 0);__decorate$Z([RefSelector("eSlider")],AgSlider.prototype,"eSlider",void 0);__decorate$Z([RefSelector("eText")],AgSlider.prototype,"eText",void 0);__decorate$Z([PostConstruct],AgSlider.prototype,"init",null);var __decorate$Y=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AgGroupComponent extends Component{constructor(e={}){super(AgGroupComponent.getTemplate(e)),this.suppressEnabledCheckbox=!0,this.suppressOpenCloseIcons=!1;const{title:t,enabled:i,items:n,suppressEnabledCheckbox:o,suppressOpenCloseIcons:r}=e;this.title=t,this.cssIdentifier=e.cssIdentifier||"default",this.enabled=i??!0,this.items=n||[],this.alignItems=e.alignItems||"center",o!=null&&(this.suppressEnabledCheckbox=o),r!=null&&(this.suppressOpenCloseIcons=r)}static getTemplate(e){const t=e.cssIdentifier||"default",i=e.direction||"vertical";return`<div class="ag-group ag-${t}-group" role="presentation">
|
||
<div class="ag-group-title-bar ag-${t}-group-title-bar ag-unselectable" ref="eTitleBar" role="button">
|
||
<span class="ag-group-title-bar-icon ag-${t}-group-title-bar-icon" ref="eGroupOpenedIcon" role="presentation"></span>
|
||
<span class="ag-group-title-bar-icon ag-${t}-group-title-bar-icon" ref="eGroupClosedIcon" role="presentation"></span>
|
||
<span ref="eTitle" class="ag-group-title ag-${t}-group-title"></span>
|
||
</div>
|
||
<div ref="eToolbar" class="ag-group-toolbar ag-${t}-group-toolbar">
|
||
<ag-checkbox ref="cbGroupEnabled"></ag-checkbox>
|
||
</div>
|
||
<div ref="eContainer" class="ag-group-container ag-group-container-${i} ag-${t}-group-container"></div>
|
||
</div>`}postConstruct(){if(this.items.length){const t=this.items;this.items=[],this.addItems(t)}const e=this.localeService.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.title&&this.setTitle(this.title),this.enabled&&this.setEnabled(this.enabled),this.setAlignItems(this.alignItems),this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract(),this.refreshAriaStatus(),this.refreshChildDisplay()}setupExpandContract(){this.eGroupClosedIcon.appendChild(createIcon("columnSelectClosed",this.gridOptionsService,null)),this.eGroupOpenedIcon.appendChild(createIcon("columnSelectOpen",this.gridOptionsService,null)),this.addManagedListener(this.eTitleBar,"click",()=>this.toggleGroupExpand()),this.addManagedListener(this.eTitleBar,"keydown",e=>{switch(e.key){case KeyCode.ENTER:case KeyCode.SPACE:e.preventDefault(),this.toggleGroupExpand();break;case KeyCode.RIGHT:case KeyCode.LEFT:e.preventDefault(),this.toggleGroupExpand(e.key===KeyCode.RIGHT);break}})}refreshAriaStatus(){this.suppressOpenCloseIcons||setAriaExpanded(this.eTitleBar,this.expanded)}refreshChildDisplay(){const e=!this.suppressOpenCloseIcons;setDisplayed(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),setDisplayed(this.eGroupOpenedIcon,e&&this.expanded),setDisplayed(this.eGroupClosedIcon,e&&!this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCssClass(`ag-group-item-alignment-${this.alignItems}`),this.alignItems=e;const t=`ag-group-item-alignment-${this.alignItems}`;return this.addCssClass(t),this}toggleGroupExpand(e){return this.suppressOpenCloseIcons?(this.expanded=!0,this.refreshChildDisplay(),setDisplayed(this.eContainer,!0),this):(e=e??!this.expanded,this.expanded===e?this:(this.expanded=e,this.refreshAriaStatus(),this.refreshChildDisplay(),setDisplayed(this.eContainer,e),this.dispatchEvent({type:this.expanded?AgGroupComponent.EVENT_EXPANDED:AgGroupComponent.EVENT_COLLAPSED}),this))}addItems(e){e.forEach(t=>this.addItem(t))}prependItem(e){this.insertItem(e,this.eContainer.firstChild)}addItem(e){this.insertItem(e,null)}insertItem(e,t){const i=this.eContainer,n=e instanceof Component?e.getGui():e;n.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),i.insertBefore(n,t),this.items.push(n)}hideItem(e,t){const i=this.items[t];setDisplayed(i,!e)}setTitle(e){return this.eTitle.innerText=e,this}addCssClassToTitleBar(e){this.eTitleBar.classList.add(e)}setEnabled(e,t){return this.enabled=e,this.refreshDisabledStyles(),this.toggleGroupExpand(e),t||this.cbGroupEnabled.setValue(e),this}isEnabled(){return this.enabled}onEnableChange(e){return this.cbGroupEnabled.onValueChange(t=>{this.setEnabled(t,!0),e(t)}),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.toggleGroupExpand(!0),this}refreshDisabledStyles(){this.addOrRemoveCssClass("ag-disabled",!this.enabled),this.suppressEnabledCheckbox&&!this.enabled?(this.eTitleBar.classList.add("ag-disabled-group-title-bar"),this.eTitleBar.removeAttribute("tabindex")):(this.eTitleBar.classList.remove("ag-disabled-group-title-bar"),this.eTitleBar.setAttribute("tabindex","0")),this.eContainer.classList.toggle("ag-disabled-group-container",!this.enabled)}}AgGroupComponent.EVENT_EXPANDED="expanded";AgGroupComponent.EVENT_COLLAPSED="collapsed";__decorate$Y([RefSelector("eTitleBar")],AgGroupComponent.prototype,"eTitleBar",void 0);__decorate$Y([RefSelector("eGroupOpenedIcon")],AgGroupComponent.prototype,"eGroupOpenedIcon",void 0);__decorate$Y([RefSelector("eGroupClosedIcon")],AgGroupComponent.prototype,"eGroupClosedIcon",void 0);__decorate$Y([RefSelector("eToolbar")],AgGroupComponent.prototype,"eToolbar",void 0);__decorate$Y([RefSelector("cbGroupEnabled")],AgGroupComponent.prototype,"cbGroupEnabled",void 0);__decorate$Y([RefSelector("eTitle")],AgGroupComponent.prototype,"eTitle",void 0);__decorate$Y([RefSelector("eContainer")],AgGroupComponent.prototype,"eContainer",void 0);__decorate$Y([PostConstruct],AgGroupComponent.prototype,"postConstruct",null);var __decorate$X=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AgMenuList extends TabGuardComp{constructor(e=0,t){super('<div class="ag-menu-list" role="tree"></div>'),this.level=e,this.menuItems=[],this.params=t??{column:null,node:null,value:null}}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.handleFocusIn(e),onFocusOut:e=>this.handleFocusOut(e)})}onTabKeyDown(e){const t=this.getParentComponent(),i=t&&t.getGui();i&&i.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case KeyCode.UP:case KeyCode.RIGHT:case KeyCode.DOWN:case KeyCode.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case KeyCode.ESCAPE:this.closeIfIsChild()&&stopPropagationForAgGrid(e);break}}handleFocusIn(e){var t,i;const n=e.relatedTarget;!this.tabGuardCtrl.isTabGuard(n)&&(this.getGui().contains(n)||!((i=(t=this.activeMenuItem)===null||t===void 0?void 0:t.getSubMenuGui())===null||i===void 0)&&i.contains(n))||(this.activeMenuItem?this.activeMenuItem.activate():this.activateFirstItem())}handleFocusOut(e){var t;const i=e.relatedTarget;!this.activeMenuItem||this.getGui().contains(i)||!((t=this.activeMenuItem.getSubMenuGui())===null||t===void 0)&&t.contains(i)||this.activeMenuItem.isSubMenuOpening()||this.activeMenuItem.deactivate()}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){e!=null&&AgPromise.all(e.map(t=>t==="separator"?AgPromise.resolve({eGui:this.createSeparator()}):typeof t=="string"?(console.warn(`AG Grid: unrecognised menu item ${t}`),AgPromise.resolve({eGui:null})):this.addItem(t))).then(t=>{t.forEach(i=>{i!=null&&i.eGui&&(this.appendChild(i.eGui),i.comp&&this.menuItems.push(i.comp))})})}addItem(e){const t=this.createManagedBean(new AgMenuItemComponent);return t.init({menuItemDef:e,isAnotherSubMenuOpen:()=>this.menuItems.some(i=>i.isSubMenuOpen()),level:this.level,contextParams:this.params}).then(()=>(t.setParentComponent(this),this.addManagedListener(t,AgMenuItemComponent.EVENT_CLOSE_MENU,i=>{this.dispatchEvent(i)}),this.addManagedListener(t,AgMenuItemComponent.EVENT_MENU_ITEM_ACTIVATED,i=>{this.activeMenuItem&&this.activeMenuItem!==i.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=i.menuItem}),{comp:t,eGui:t.getGui()}))}activateFirstItem(){const e=this.menuItems.filter(t=>!t.isDisabled())[0];e&&e.activate()}createSeparator(){return loadTemplate(`
|
||
<div class="ag-menu-separator" aria-hidden="true">
|
||
<div class="ag-menu-separator-part"></div>
|
||
<div class="ag-menu-separator-part"></div>
|
||
<div class="ag-menu-separator-part"></div>
|
||
<div class="ag-menu-separator-part"></div>
|
||
</div>`)}handleNavKey(e){switch(e){case KeyCode.UP:case KeyCode.DOWN:const i=this.findNextItem(e===KeyCode.UP);i&&i!==this.activeMenuItem&&i.activate();return}const t=this.gridOptionsService.get("enableRtl")?KeyCode.RIGHT:KeyCode.LEFT;e===t?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();return t&&t instanceof AgMenuItemComponent?(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus(),!0):!1}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){const t=this.menuItems.filter(o=>!o.isDisabled());if(!t.length)return;if(!this.activeMenuItem)return e?last(t):t[0];e&&t.reverse();let i,n=!1;for(let o=0;o<t.length;o++){const r=t[o];if(!n){r===this.activeMenuItem&&(n=!0);continue}i=r;break}return n&&!i?t[0]:i||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}}__decorate$X([Autowired("focusService")],AgMenuList.prototype,"focusService",void 0);__decorate$X([PostConstruct],AgMenuList.prototype,"postConstruct",null);var __decorate$W=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AgMenuPanel extends TabGuardComp{constructor(e){super(),this.wrappedComponent=e,this.setTemplateFromElement(e.getGui())}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===KeyCode.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}}__decorate$W([PostConstruct],AgMenuPanel.prototype,"postConstruct",null);var __decorate$V=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AgMenuItemComponent extends BeanStub{constructor(){super(...arguments),this.isActive=!1,this.subMenuIsOpen=!1,this.subMenuIsOpening=!1,this.suppressRootStyles=!0,this.suppressAria=!0,this.suppressFocus=!0}init(e){var t,i;const{menuItemDef:n,isAnotherSubMenuOpen:o,level:r,childComponent:a,contextParams:l}=e;return this.params=e.menuItemDef,this.level=r,this.isAnotherSubMenuOpen=o,this.childComponent=a,this.contextParams=l,this.cssClassPrefix=(i=(t=this.params.menuItemParams)===null||t===void 0?void 0:t.cssClassPrefix)!==null&&i!==void 0?i:"ag-menu-option",this.userComponentFactory.getMenuItemCompDetails(this.params,Object.assign(Object.assign({},n),{level:r,isAnotherSubMenuOpen:o,openSubMenu:h=>this.openSubMenu(h),closeSubMenu:()=>this.closeSubMenu(),closeMenu:h=>this.closeMenu(h),updateTooltip:h=>this.updateTooltip(h),onItemActivated:()=>this.onItemActivated()})).newAgStackInstance().then(h=>{var p;this.menuItemComp=h;const m=(p=h.configureDefaults)===null||p===void 0?void 0:p.call(h);m&&this.configureDefaults(m===!0?void 0:m)})}addListeners(e,t){t!=null&&t.suppressClick||this.addManagedListener(e,"click",i=>this.onItemSelected(i)),t!=null&&t.suppressKeyboardSelect||this.addManagedListener(e,"keydown",i=>{(i.key===KeyCode.ENTER||i.key===KeyCode.SPACE)&&(i.preventDefault(),this.onItemSelected(i))}),t!=null&&t.suppressMouseDown||this.addManagedListener(e,"mousedown",i=>{i.stopPropagation(),i.preventDefault()}),t!=null&&t.suppressMouseOver||(this.addManagedListener(e,"mouseenter",()=>this.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.onMouseLeave()))}isDisabled(){return!!this.params.disabled}openSubMenu(e=!1){var t,i;if(this.closeSubMenu(),!this.params.subMenu)return;this.subMenuIsOpening=!0;const n=loadTemplate('<div class="ag-menu" role="presentation"></div>');this.eSubMenuGui=n;let o,r=()=>{this.subMenuIsOpening=!1};if(this.childComponent){const h=this.createBean(new AgMenuPanel(this.childComponent));h.setParentComponent(this);const p=h.getGui(),m="mouseenter",v=()=>this.cancelDeactivate();p.addEventListener(m,v),o=()=>p.removeEventListener(m,v),n.appendChild(p),this.childComponent.afterGuiAttached&&(r=()=>{this.childComponent.afterGuiAttached(),this.subMenuIsOpening=!1})}else if(this.params.subMenu){const h=this.createBean(new AgMenuList(this.level+1,this.contextParams));h.setParentComponent(this),h.addMenuItems(this.params.subMenu),n.appendChild(h.getGui()),this.addManagedListener(h,AgMenuItemComponent.EVENT_CLOSE_MENU,p=>this.dispatchEvent(p)),h.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),o=()=>this.destroyBean(h),e&&(r=()=>{h.activateFirstItem(),this.subMenuIsOpening=!1})}const a=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:this.eGui,ePopup:n}),l=this.localeService.getLocaleTextFunc(),d=this.popupService.addPopup({modal:!0,eChild:n,positionCallback:a,anchorToElement:this.eGui,ariaLabel:l("ariaLabelSubMenu","SubMenu"),afterGuiAttached:r});this.subMenuIsOpen=!0,this.setAriaExpanded(!0),this.hideSubMenu=()=>{var h,p;d&&d.hideFunc(),this.subMenuIsOpen=!1,this.setAriaExpanded(!1),o(),(p=(h=this.menuItemComp).setExpanded)===null||p===void 0||p.call(h,!1),this.eSubMenuGui=void 0},(i=(t=this.menuItemComp).setExpanded)===null||i===void 0||i.call(t,!0)}setAriaExpanded(e){this.suppressAria||setAriaExpanded(this.eGui,e)}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,this.setAriaExpanded(!1))}isSubMenuOpen(){return this.subMenuIsOpen}isSubMenuOpening(){return this.subMenuIsOpening}activate(e){var t,i;this.cancelActivate(),!this.params.disabled&&(this.isActive=!0,this.suppressRootStyles||this.eGui.classList.add(`${this.cssClassPrefix}-active`),(i=(t=this.menuItemComp).setActive)===null||i===void 0||i.call(t,!0),this.suppressFocus||this.eGui.focus({preventScroll:!0}),e&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){var e,t;this.cancelDeactivate(),this.suppressRootStyles||this.eGui.classList.remove(`${this.cssClassPrefix}-active`),(t=(e=this.menuItemComp).setActive)===null||t===void 0||t.call(e,!1),this.isActive=!1,this.subMenuIsOpen&&this.hideSubMenu()}getGui(){return this.menuItemComp.getGui()}getParentComponent(){return this.parentComponent}setParentComponent(e){this.parentComponent=e}getSubMenuGui(){return this.eSubMenuGui}onItemSelected(e){var t,i;(i=(t=this.menuItemComp).select)===null||i===void 0||i.call(t),this.params.action?this.getFrameworkOverrides().wrapOutgoing(()=>this.params.action(this.gridOptionsService.addGridCommonParams(Object.assign({},this.contextParams)))):this.openSubMenu(e&&e.type==="keydown"),!(this.params.subMenu&&!this.params.action||this.params.suppressCloseOnSelect)&&this.closeMenu(e)}closeMenu(e){const t={type:AgMenuItemComponent.EVENT_CLOSE_MENU,event:e};this.dispatchEvent(t)}onItemActivated(){const e={type:AgMenuItemComponent.EVENT_MENU_ITEM_ACTIVATED,menuItem:this};this.dispatchEvent(e)}cancelActivate(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)}cancelDeactivate(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)}onMouseEnter(){this.cancelDeactivate(),this.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),AgMenuItemComponent.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),AgMenuItemComponent.ACTIVATION_DELAY):this.deactivate()}configureDefaults(e){var t,i,n;if(this.tooltip=this.params.tooltip,!this.menuItemComp){setTimeout(()=>this.configureDefaults(e));return}let o=this.menuItemComp.getGui();const r=(i=(t=this.menuItemComp).getRootElement)===null||i===void 0?void 0:i.call(t);r&&(e!=null&&e.suppressRootStyles||o.classList.add("ag-menu-option-custom"),o=r),this.eGui=o,this.suppressRootStyles=!!(e!=null&&e.suppressRootStyles),this.suppressRootStyles||(o.classList.add(this.cssClassPrefix),(n=this.params.cssClasses)===null||n===void 0||n.forEach(a=>o.classList.add(a)),this.params.disabled&&o.classList.add(`${this.cssClassPrefix}-disabled`)),e!=null&&e.suppressTooltip||this.setTooltip(),this.suppressAria=!!(e!=null&&e.suppressAria),this.suppressAria||(setAriaRole(o,"treeitem"),setAriaLevel(o,this.level+1),this.params.disabled&&setAriaDisabled(o,!0)),e!=null&&e.suppressTabIndex||o.setAttribute("tabindex","-1"),this.params.disabled||this.addListeners(o,e),this.suppressFocus=!!(e!=null&&e.suppressFocus)}updateTooltip(e){this.tooltip=e,!this.tooltipFeature&&this.menuItemComp&&this.setTooltip()}setTooltip(){this.tooltip&&(this.tooltipFeature=this.createManagedBean(new TooltipFeature({getGui:()=>this.getGui(),getTooltipValue:()=>this.tooltip,getLocation:()=>"menu"},this.beans)),this.tooltipFeature.setComp(this.getGui()))}}AgMenuItemComponent.EVENT_CLOSE_MENU="closeMenu";AgMenuItemComponent.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated";AgMenuItemComponent.ACTIVATION_DELAY=80;__decorate$V([Autowired("popupService")],AgMenuItemComponent.prototype,"popupService",void 0);__decorate$V([Autowired("userComponentFactory")],AgMenuItemComponent.prototype,"userComponentFactory",void 0);__decorate$V([Autowired("beans")],AgMenuItemComponent.prototype,"beans",void 0);var __decorate$U=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AgPanel extends Component{constructor(e){super(AgPanel.getTemplate(e)),this.config=e,this.closable=!0}static getTemplate(e){const t=e.cssIdentifier||"default";return`<div class="ag-panel ag-${t}-panel" tabindex="-1">
|
||
<div ref="eTitleBar" class="ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable">
|
||
<span ref="eTitle" class="ag-panel-title-bar-title ag-${t}-panel-title-bar-title"></span>
|
||
<div ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons"></div>
|
||
</div>
|
||
<div ref="eContentWrapper" class="ag-panel-content-wrapper ag-${t}-panel-content-wrapper"></div>
|
||
</div>`}postConstruct(){const{component:e,closable:t,hideTitleBar:i,title:n,minWidth:o=250,width:r,minHeight:a=250,height:l,centered:d,popup:h,x:p,y:m}=this.config;this.positionableFeature=new PositionableFeature(this.getGui(),{minWidth:o,width:r,minHeight:a,height:l,centered:d,x:p,y:m,popup:h,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const v=this.getGui();e&&this.setBodyComponent(e),i?setDisplayed(this.eTitleBar,!1):(n&&this.setTitle(n),this.setClosable(t??this.closable)),this.addManagedListener(this.eTitleBar,"mousedown",y=>{const b=this.gridOptionsService.getDocument();if(v.contains(y.relatedTarget)||v.contains(b.activeElement)||this.eTitleBarButtons.contains(y.target)){y.preventDefault();return}const S=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");S&&S.focus()}),!(h&&this.positionableFeature.isPositioned())&&(this.renderComponent&&this.renderComponent(),this.positionableFeature.initialisePosition(),this.eContentWrapper.style.height="0")}renderComponent(){const e=this.getGui();e.focus(),this.close=()=>{e.parentElement.removeChild(e),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(e){if(e!==this.closable&&(this.closable=e),e){const t=this.closeButtonComp=new Component(AgPanel.CLOSE_BTN_TEMPLATE);this.getContext().createBean(t);const i=t.getGui(),n=createIconNoSpan("close",this.gridOptionsService);n.classList.add("ag-panel-title-bar-button-icon"),i.appendChild(n),this.addTitleBarButton(t),t.addManagedListener(i,"click",this.onBtClose.bind(this))}else if(this.closeButtonComp){const t=this.closeButtonComp.getGui();t.parentElement.removeChild(t),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const i=this.eTitleBarButtons,n=i.children,o=n.length;t==null&&(t=o),t=Math.max(0,Math.min(t,o)),e.addCssClass("ag-panel-title-bar-button");const r=e.getGui();t===0?i.insertAdjacentElement("afterbegin",r):t===o?i.insertAdjacentElement("beforeend",r):n[t-1].insertAdjacentElement("afterend",r),e.setParentComponent(this)}getBodyHeight(){return getInnerHeight(this.eContentWrapper)}getBodyWidth(){return getInnerWidth(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const e=this.getGui();e&&isVisible(e)&&this.close(),super.destroy()}}AgPanel.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>';__decorate$U([RefSelector("eContentWrapper")],AgPanel.prototype,"eContentWrapper",void 0);__decorate$U([RefSelector("eTitleBar")],AgPanel.prototype,"eTitleBar",void 0);__decorate$U([RefSelector("eTitleBarButtons")],AgPanel.prototype,"eTitleBarButtons",void 0);__decorate$U([RefSelector("eTitle")],AgPanel.prototype,"eTitle",void 0);__decorate$U([PostConstruct],AgPanel.prototype,"postConstruct",null);var __decorate$T=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AgDialog extends AgPanel{constructor(e){super(Object.assign(Object.assign({},e),{popup:!0})),this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}postConstruct(){const e=this.getGui(),{movable:t,resizable:i,maximizable:n}=this.config;this.addCssClass("ag-dialog"),super.postConstruct(),this.addManagedListener(e,"focusin",o=>{e.contains(o.relatedTarget)||this.popupService.bringPopupToFront(e)}),t&&this.setMovable(t),n&&this.setMaximizable(n),i&&this.setResizable(i)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:i,title:n,afterGuiAttached:o}=this.config,r=this.localeService.getLocaleTextFunc(),a=this.popupService.addPopup({modal:i,eChild:e,closeOnEsc:!0,closedCallback:this.onClosed.bind(this),alwaysOnTop:t,ariaLabel:n||r("ariaLabelDialog","Dialog"),afterGuiAttached:o});a&&(this.close=a.hideFunc)}onClosed(e){var t,i;this.destroy(),(i=(t=this.config).closedCallback)===null||i===void 0||i.call(t,e)}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:t,y:i,width:n,height:o}=this.lastPosition;this.setWidth(n),this.setHeight(o),this.positionableFeature.offsetElement(t,i)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){setDisplayed(this.maximizeIcon,!this.isMaximized),setDisplayed(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){this.maximizeListeners.length&&(this.maximizeListeners.forEach(e=>e()),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e){this.clearMaximizebleListeners(),this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0);return}const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;const i=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),i.addManagedListener(i.getGui(),"click",this.toggleMaximize.bind(this)),this.addTitleBarButton(i,0),this.maximizeListeners.push(this.addManagedListener(t,"dblclick",this.toggleMaximize.bind(this))),this.resizeListenerDestroy=this.addManagedListener(this,"resize",()=>{this.isMaximized=!1,this.refreshMaximizeIcon()})}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new Component('<div class="ag-dialog-button"></span>')),t=e.getGui();return this.maximizeIcon=createIconNoSpan("maximize",this.gridOptionsService),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=createIconNoSpan("minimize",this.gridOptionsService),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}}__decorate$T([Autowired("popupService")],AgDialog.prototype,"popupService",void 0);var __decorate$S=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},PopupService_1,DIRECTION;(function(s){s[s.vertical=0]="vertical",s[s.horizontal=1]="horizontal"})(DIRECTION||(DIRECTION={}));let instanceIdSeq=0,PopupService=PopupService_1=class extends BeanStub{constructor(){super(...arguments),this.popupList=[]}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl}),this.addManagedListener(this.eventService,Events.EVENT_GRID_STYLES_CHANGED,this.handleThemeChange.bind(this))}getPopupParent(){const e=this.gridOptionsService.get("popupParent");return e||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,n=this.getPopupIndex(i);if(n!==-1){const y=this.popupList[n];y.alignedToElement=t}const o=t.getBoundingClientRect(),r=this.getParentRect(),a=this.keepXYWithinBounds(i,o.top-r.top,DIRECTION.vertical),l=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${l}px`;const h=r.right-r.left-l;let p;this.gridOptionsService.get("enableRtl")?(p=v(),p<0&&(p=m(),this.setAlignedStyles(i,"left")),p>h&&(p=0,this.setAlignedStyles(i,"right"))):(p=m(),p>h&&(p=v(),this.setAlignedStyles(i,"right")),p<0&&(p=0,this.setAlignedStyles(i,"left"))),i.style.left=`${p}px`,i.style.top=`${a}px`;function m(){return o.right-r.left-2}function v(){return o.left-r.left-l}}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:n,skipObserver:o}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:n,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:n,keepWithinBounds:o,eventSource:r,alignSide:a="left",position:l="over",column:d,rowNode:h,type:p}=e,m=r.getBoundingClientRect(),v=this.getParentRect(),y=this.getPopupIndex(t);if(y!==-1){const S=this.popupList[y];S.alignedToElement=r}const b=()=>{let S=m.left-v.left;a==="right"&&(S-=t.offsetWidth-m.width);let E;return l==="over"?(E=m.top-v.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),this.shouldRenderUnderOrAbove(t,m,v,e.nudgeY||0)==="under"?E=m.top-v.top+m.height:E=m.top-t.offsetHeight-(n||0)*2-v.top),{x:S,y:E}};this.positionPopup({ePopup:t,nudgeX:i,nudgeY:n,keepWithinBounds:o,updatePosition:b,postProcessCallback:()=>this.callPostProcessPopup(p,t,r,null,d,h)})}shouldRenderUnderOrAbove(e,t,i,n){const o=i.bottom-t.bottom,r=t.top-i.top,a=e.offsetHeight+n;return o>a?"under":r>a||r>o?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(i===-1)return;const n=this.popupList[i],{alignedToElement:o}=n;!o||(["right","left","over","above","under"].forEach(a=>{o.classList.remove(`ag-has-popup-positioned-${a}`),e.classList.remove(`ag-popup-positioned-${a}`)}),!t)||(o.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}callPostProcessPopup(e,t,i,n,o,r){const a=this.gridOptionsService.getCallback("postProcessPopup");a&&a({column:o,rowNode:r,ePopup:t,type:e,eventSource:i,mouseEvent:n})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:n,nudgeY:o,skipObserver:r,updatePosition:a}=e,l={width:0,height:0},d=(h=!1)=>{let{x:p,y:m}=a();h&&t.clientWidth===l.width&&t.clientHeight===l.height||(l.width=t.clientWidth,l.height=t.clientHeight,n&&(p+=n),o&&(m+=o),i&&(p=this.keepXYWithinBounds(t,p,DIRECTION.horizontal),m=this.keepXYWithinBounds(t,m,DIRECTION.vertical)),t.style.left=`${p}px`,t.style.top=`${m}px`,e.postProcessCallback&&e.postProcessCallback())};if(d(),!r){const h=this.resizeObserverService.observeResize(t,()=>d(!0));setTimeout(()=>h(),PopupService_1.WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=this.gridOptionsService.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:getComputedStyle(t).position==="static"&&(t=t.offsetParent),getElementRectWithOffset(t)}keepXYWithinBounds(e,t,i){const n=i===DIRECTION.vertical,o=n?"clientHeight":"clientWidth",r=n?"top":"left",a=n?"offsetHeight":"offsetWidth",l=n?"scrollTop":"scrollLeft",d=this.gridOptionsService.getDocument(),h=d.documentElement,p=this.getPopupParent(),m=p.getBoundingClientRect(),v=d.documentElement.getBoundingClientRect(),y=p===d.body,b=e[a];let E=y?(n?getAbsoluteHeight:getAbsoluteWidth)(h)+h[l]:p[o];y&&(E-=Math.abs(v[r]-m[r]));const T=E-b;return Math.min(Math.max(t,0),Math.abs(T))}addPopup(e){const t=this.gridOptionsService.getDocument(),{eChild:i,ariaLabel:n,alwaysOnTop:o,positionCallback:r,anchorToElement:a}=e;if(!t)return console.warn("AG Grid: could not find the document, document is empty"),{hideFunc:()=>{}};const l=this.getPopupIndex(i);if(l!==-1)return{hideFunc:this.popupList[l].hideFunc};this.initialisePopupPosition(i);const d=this.createPopupWrapper(i,n,!!o),h=this.addEventListenersToPopup(Object.assign(Object.assign({},e),{wrapperEl:d}));return r&&r(),this.addPopupToPopupList(i,d,h,a),{hideFunc:h}}initialisePopupPosition(e){const i=this.getPopupParent().getBoundingClientRect();exists(e.style.top)||(e.style.top=`${i.top*-1}px`),exists(e.style.left)||(e.style.left=`${i.left*-1}px`)}createPopupWrapper(e,t,i){const n=this.getPopupParent(),o=document.createElement("div"),{allThemes:r}=this.environment.getTheme();return r.length&&o.classList.add(...r),o.classList.add("ag-popup"),e.classList.add(this.gridOptionsService.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||setAriaRole(e,"dialog"),setAriaLabel(e,t),o.appendChild(e),n.appendChild(o),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),o}handleThemeChange(){const{allThemes:e}=this.environment.getTheme();for(const t of this.popupList){for(const i of Array.from(t.wrapper.classList))i.startsWith("ag-theme-")&&t.wrapper.classList.remove(i);e.length&&t.wrapper.classList.add(...e)}}addEventListenersToPopup(e){const t=this.gridOptionsService.getDocument(),i=this.getPopupParent(),{wrapperEl:n,eChild:o,click:r,closedCallback:a,afterGuiAttached:l,closeOnEsc:d,modal:h}=e;let p=!1;const m=S=>{if(!n.contains(t.activeElement))return;S.key===KeyCode.ESCAPE&&!isStopPropagationForAgGrid(S)&&b({keyboardEvent:S})},v=S=>b({mouseEvent:S}),y=S=>b({touchEvent:S}),b=(S={})=>{const{mouseEvent:E,touchEvent:T,keyboardEvent:R}=S;this.isEventFromCurrentPopup({mouseEvent:E,touchEvent:T},o)||p||(p=!0,i.removeChild(n),t.removeEventListener("keydown",m),t.removeEventListener("mousedown",v),t.removeEventListener("touchstart",y),t.removeEventListener("contextmenu",v),this.eventService.removeEventListener(Events.EVENT_DRAG_STARTED,v),a&&a(E||T||R),this.removePopupFromPopupList(o))};return l&&l({hidePopup:b}),window.setTimeout(()=>{d&&t.addEventListener("keydown",m),h&&(t.addEventListener("mousedown",v),this.eventService.addEventListener(Events.EVENT_DRAG_STARTED,v),t.addEventListener("touchstart",y),t.addEventListener("contextmenu",v))},0),b}addPopupToPopupList(e,t,i,n){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:instanceIdSeq++,isAnchored:!!n}),n&&this.setPopupPositionRelatedToElement(e,n)}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(i===-1)return;const n=this.popupList[i];if(n.stopAnchoringPromise&&n.stopAnchoringPromise.then(r=>r&&r()),n.stopAnchoringPromise=void 0,n.isAnchored=!1,!t)return;const o=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:n.hideFunc});return n.stopAnchoringPromise=o,n.isAnchored=!0,o}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:n,ePopup:o}=e,r=n.getBoundingClientRect(),a=i.top-r.top,l=i.left-r.left;let d=a,h=l;const p=o.style.top,m=parseInt(p.substring(0,p.length-1),10),v=o.style.left,y=parseInt(v.substring(0,v.length-1),10);return new AgPromise(b=>{this.getFrameworkOverrides().setInterval(()=>{const S=t.getBoundingClientRect(),E=n.getBoundingClientRect();if(E.top==0&&E.left==0&&E.height==0&&E.width==0){e.hidePopup();return}const R=S.top-E.top;if(R!=d){const D=this.keepXYWithinBounds(o,m+a-R,DIRECTION.vertical);o.style.top=`${D}px`}d=R;const A=S.left-E.left;if(A!=h){const D=this.keepXYWithinBounds(o,y+l-A,DIRECTION.horizontal);o.style.left=`${D}px`}h=A},200).then(S=>{b(()=>{S!=null&&window.clearInterval(S)})})})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:n}=e,o=i||n;if(!o)return!1;const r=this.getPopupIndex(t);if(r===-1)return!1;for(let a=r;a<this.popupList.length;a++){const l=this.popupList[a];if(isElementInEventPath(l.element,o))return!0}return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){const t=this.gridOptionsService.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||e.parentElement===null)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),n=i.length,o=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),r=o.length,a=this.getWrapper(e);if(!a||n<=1||!t.contains(e))return;const l=i.indexOf(a),d=a.querySelectorAll("div"),h=[];for(d.forEach(m=>{m.scrollTop!==0&&h.push([m,m.scrollTop])}),r?a.classList.contains("ag-always-on-top")?l!==n-1&&last(o).insertAdjacentElement("afterend",a):l!==n-r-1&&o[0].insertAdjacentElement("beforebegin",a):l!==n-1&&last(i).insertAdjacentElement("afterend",a);h.length;){const m=h.pop();m[0].scrollTop=m[1]}const p={type:"popupToFront",eWrapper:a};this.eventService.dispatchEvent(p)}};PopupService.WAIT_FOR_POPUP_CONTENT_RESIZE=200;__decorate$S([Autowired("focusService")],PopupService.prototype,"focusService",void 0);__decorate$S([Autowired("ctrlsService")],PopupService.prototype,"ctrlsService",void 0);__decorate$S([Autowired("resizeObserverService")],PopupService.prototype,"resizeObserverService",void 0);__decorate$S([PostConstruct],PopupService.prototype,"postConstruct",null);PopupService=PopupService_1=__decorate$S([Bean("popupService")],PopupService);class AgAutocompleteRow extends Component{constructor(){super(`
|
||
<div class="ag-autocomplete-row" role="presentation">
|
||
<div class="ag-autocomplete-row-label"></div>
|
||
</div>`),this.hasHighlighting=!1}setState(e,t){this.value=e,this.render(),this.updateSelected(t)}updateSelected(e){this.addOrRemoveCssClass("ag-autocomplete-row-selected",e)}setSearchString(e){var t;let i=!1;if(exists(e)){const n=(t=this.value)===null||t===void 0?void 0:t.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(n>=0){i=!0,this.hasHighlighting=!0;const o=n+e.length,r=escapeString(this.value.slice(0,n)),a=escapeString(this.value.slice(n,o)),l=escapeString(this.value.slice(o));this.getGui().lastElementChild.innerHTML=`${r}<b>${a}</b>${l}`}}!i&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){var e;this.getGui().lastElementChild.innerHTML=(e=escapeString(this.value))!==null&&e!==void 0?e:" "}}var __decorate$R=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AgAutocompleteList extends PopupComponent{constructor(e){super(AgAutocompleteList.TEMPLATE),this.params=e,this.searchString=""}destroy(){super.destroy()}init(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new VirtualList({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:t=>this.autocompleteEntries[t]});const e=this.virtualList.getGui();this.addManagedListener(e,"click",()=>this.params.onConfirmed()),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(e,"mousedown",t=>t.preventDefault()),this.setSelectedValue(0)}onNavigationKeyDown(e,t){e.preventDefault();const i=this.autocompleteEntries.indexOf(this.selectedValue),n=t===KeyCode.UP?i-1:i+1;this.checkSetSelectedValue(n)}setSearch(e){this.searchString=e,exists(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0)),this.updateSearchInList()}runContainsSearch(e,t){let i,n=!1;const o=e.toLocaleLowerCase(),r=t.filter(a=>{const d=a.toLocaleLowerCase().indexOf(o),h=d===0,p=d>=0;return p&&(!i||!n&&h||n===h&&a.length<i.length)&&(i=a,n=h),p});return!i&&r.length&&(i=r[0]),{topMatch:i,allMatches:r}}runSearch(){var e,t;const{autocompleteEntries:i}=this.params,n=i.map(d=>{var h;return(h=d.displayValue)!==null&&h!==void 0?h:d.key});let o,r;if(this.params.useFuzzySearch)o=fuzzySuggestions(this.searchString,n,!0).values,r=o.length?o[0]:void 0;else{const d=this.runContainsSearch(this.searchString,n);o=d.allMatches,r=d.topMatch}let a=i.filter(({key:d,displayValue:h})=>o.includes(h??d));if(!a.length&&this.selectedValue&&(!((t=(e=this.params)===null||e===void 0?void 0:e.forceLastSelection)===null||t===void 0)&&t.call(e,this.selectedValue,this.searchString))&&(a=[this.selectedValue]),this.autocompleteEntries=a,this.virtualList.refresh(),!r)return;const l=o.indexOf(r);this.checkSetSelectedValue(l)}updateSearchInList(){this.virtualList.forEachRenderedRow(e=>e.setSearchString(this.searchString))}checkSetSelectedValue(e){e>=0&&e<this.autocompleteEntries.length&&this.setSelectedValue(e)}setSelectedValue(e){const t=this.autocompleteEntries[e];this.selectedValue!==t&&(this.selectedValue=t,this.virtualList.ensureIndexVisible(e),this.virtualList.forEachRenderedRow((i,n)=>{i.updateSelected(e===n)}))}createRowComponent(e){var t;const i=new AgAutocompleteRow;return this.getContext().createBean(i),i.setState((t=e.displayValue)!==null&&t!==void 0?t:e.key,e===this.selectedValue),i}onMouseMove(e){const t=this.virtualList.getGui().getBoundingClientRect(),i=this.virtualList.getScrollTop(),n=e.clientY-t.top+i,o=Math.floor(n/this.virtualList.getRowHeight());this.checkSetSelectedValue(o)}afterGuiAttached(){this.virtualList.refresh()}getSelectedValue(){var e;return this.autocompleteEntries.length&&(e=this.selectedValue)!==null&&e!==void 0?e:null}}AgAutocompleteList.TEMPLATE=`<div class="ag-autocomplete-list-popup">
|
||
<div ref="eList" class="ag-autocomplete-list"></div>
|
||
<div>`;__decorate$R([RefSelector("eList")],AgAutocompleteList.prototype,"eList",void 0);__decorate$R([PostConstruct],AgAutocompleteList.prototype,"init",null);var __decorate$Q=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AgAutocomplete extends Component{constructor(){super(`
|
||
<div class="ag-autocomplete" role="presentation">
|
||
<ag-input-text-field ref="eAutocompleteInput"></ag-input-text-field>
|
||
</div>`),this.isListOpen=!1,this.lastPosition=0,this.valid=!0}postConstruct(){this.eAutocompleteInput.onValueChange(e=>this.onValueChanged(e)),this.eAutocompleteInput.getInputElement().setAttribute("autocomplete","off"),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.addGuiEventListener("click",this.updatePositionAndList.bind(this)),this.addDestroyFunc(()=>{this.destroyBean(this.autocompleteList)}),this.addGuiEventListener("focusout",()=>this.onFocusOut())}onValueChanged(e){const t=makeNull(e);this.updateValue(t),this.updateAutocompleteList(t)}updateValue(e){this.updateLastPosition(),this.dispatchEvent({type:AgAutocomplete.EVENT_VALUE_CHANGED,value:e}),this.validate(e)}updateAutocompleteList(e){var t,i,n,o;const r=(i=(t=this.listGenerator)===null||t===void 0?void 0:t.call(this,e,this.lastPosition))!==null&&i!==void 0?i:{enabled:!1};if((!r.type||r.type!==((n=this.autocompleteListParams)===null||n===void 0?void 0:n.type))&&this.isListOpen&&this.closeList(),this.autocompleteListParams=r,!((o=this.autocompleteListParams)===null||o===void 0)&&o.enabled){this.isListOpen||this.openList();const{searchString:a}=this.autocompleteListParams;this.autocompleteList.setSearch(a??"")}else this.isListOpen&&this.closeList()}onKeyDown(e){const t=e.key;switch(this.updateLastPosition(),t){case KeyCode.ENTER:this.onEnterKeyDown(e);break;case KeyCode.TAB:this.onTabKeyDown(e);break;case KeyCode.DOWN:case KeyCode.UP:this.onUpDownKeyDown(e,t);break;case KeyCode.LEFT:case KeyCode.RIGHT:case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case KeyCode.ESCAPE:this.onEscapeKeyDown(e);break;case KeyCode.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList());break}}confirmSelection(){var e;const t=(e=this.autocompleteList)===null||e===void 0?void 0:e.getSelectedValue();t&&(this.closeList(),this.dispatchEvent({type:AgAutocomplete.EVENT_OPTION_SELECTED,value:this.getValue(),position:this.lastPosition,updateEntry:t,autocompleteType:this.autocompleteListParams.type}))}onTabKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.confirmSelection())}onEnterKeyDown(e){e.preventDefault(),this.isListOpen?this.confirmSelection():this.onCompleted()}onUpDownKeyDown(e,t){var i;e.preventDefault(),this.isListOpen?(i=this.autocompleteList)===null||i===void 0||i.onNavigationKeyDown(e,t):this.forceOpenList()}onEscapeKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.closeList(),this.setCaret(this.lastPosition,!0))}onFocusOut(){this.isListOpen&&this.closeList()}updatePositionAndList(){var e;this.updateLastPosition(),this.updateAutocompleteList((e=this.eAutocompleteInput.getValue())!==null&&e!==void 0?e:null)}setCaret(e,t){const i=this.gridOptionsService.getDocument();t&&i.activeElement===i.body&&this.eAutocompleteInput.getFocusableElement().focus();const n=this.eAutocompleteInput.getInputElement();n.setSelectionRange(e,e),e===n.value.length&&(n.scrollLeft=n.scrollWidth)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){var e;this.lastPosition=(e=this.eAutocompleteInput.getInputElement().selectionStart)!==null&&e!==void 0?e:0}validate(e){var t;this.validator&&(this.validationMessage=this.validator(e),this.eAutocompleteInput.getInputElement().setCustomValidity((t=this.validationMessage)!==null&&t!==void 0?t:""),this.valid=!this.validationMessage,this.dispatchEvent({type:AgAutocomplete.EVENT_VALID_CHANGED,isValid:this.valid,validationMessage:this.validationMessage}))}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new AgAutocompleteList({autocompleteEntries:this.autocompleteListParams.entries,onConfirmed:()=>this.confirmSelection(),forceLastSelection:this.forceLastSelection}));const e=this.autocompleteList.getGui(),t={ePopup:e,type:"autocomplete",eventSource:this.getGui(),position:"under",alignSide:this.gridOptionsService.get("enableRtl")?"right":"left",keepWithinBounds:!0},i=this.popupService.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupService.positionPopupByComponent(t),ariaLabel:this.listAriaLabel});this.hidePopup=i.hideFunc,this.autocompleteList.afterGuiAttached()}closeList(){this.isListOpen=!1,this.hidePopup(),this.destroyBean(this.autocompleteList),this.autocompleteList=null}onCompleted(){this.isListOpen&&this.closeList(),this.dispatchEvent({type:AgAutocomplete.EVENT_VALUE_CONFIRMED,value:this.getValue(),isValid:this.isValid()})}getValue(){return makeNull(this.eAutocompleteInput.getValue())}setInputPlaceholder(e){return this.eAutocompleteInput.setInputPlaceholder(e),this}setInputAriaLabel(e){return this.eAutocompleteInput.setInputAriaLabel(e),this}setListAriaLabel(e){return this.listAriaLabel=e,this}setListGenerator(e){return this.listGenerator=e,this}setValidator(e){return this.validator=e,this}isValid(){return this.valid}setValue(e){const{value:t,position:i,silent:n,updateListOnlyIfOpen:o,restoreFocus:r}=e;this.eAutocompleteInput.setValue(t,!0),this.setCaret(i??this.lastPosition,r),n||this.updateValue(t),(!o||this.isListOpen)&&this.updateAutocompleteList(t)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}}AgAutocomplete.EVENT_VALUE_CHANGED="eventValueChanged";AgAutocomplete.EVENT_VALUE_CONFIRMED="eventValueConfirmed";AgAutocomplete.EVENT_OPTION_SELECTED="eventOptionSelected";AgAutocomplete.EVENT_VALID_CHANGED="eventValidChanged";__decorate$Q([Autowired("popupService")],AgAutocomplete.prototype,"popupService",void 0);__decorate$Q([RefSelector("eAutocompleteInput")],AgAutocomplete.prototype,"eAutocompleteInput",void 0);__decorate$Q([PostConstruct],AgAutocomplete.prototype,"postConstruct",null);const PASSIVE_EVENTS=["touchstart","touchend","touchmove","touchcancel"];class VanillaFrameworkOverrides{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=t=>t(),this.wrapOutgoing=t=>t()}setInterval(e,t){return new AgPromise(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,n){const o=includes(PASSIVE_EVENTS,t);e.addEventListener(t,i,{capture:!!n,passive:o})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${this.frameworkName==="solid"?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}}var __decorate$P=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let CellNavigationService=class extends BeanStub{getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===KeyCode.UP,n=e===KeyCode.DOWN,o=e===KeyCode.LEFT;let r,a;if(i||n)a=i?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow(),r=t.column;else{const l=this.columnModel.getAllDisplayedColumns(),d=this.gridOptionsService.get("enableRtl");a=t.rowIndex,r=o!==d?l[0]:last(l)}return{rowIndex:a,rowPinned:null,column:r}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,n=!1;for(;!n;){switch(e){case KeyCode.UP:i=this.getCellAbove(i);break;case KeyCode.DOWN:i=this.getCellBelow(i);break;case KeyCode.RIGHT:this.gridOptionsService.get("enableRtl")?i=this.getCellToLeft(i):i=this.getCellToRight(i);break;case KeyCode.LEFT:this.gridOptionsService.get("enableRtl")?i=this.getCellToRight(i):i=this.getCellToLeft(i);break;default:i=null,console.warn("AG Grid: unknown key for navigation "+e);break}i?n=this.isCellGoodToFocusOn(i):n=!0}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex);break}return i?!t.isSuppressNavigable(i):!1}getCellToLeft(e){if(!e)return null;const t=this.columnModel.getDisplayedColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.columnModel.getDisplayedColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.paginationProxy.getPageFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const n=this.rowModel.getRow(e.rowIndex),o=this.getNextStickyPosition(n);return o||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gridOptionsService.isGroupRowsSticky()||!e||!e.sticky)return;const i=[...this.rowRenderer.getStickyTopRowCtrls()].sort((a,l)=>a.getRowNode().rowIndex-l.getRowNode().rowIndex),n=t?-1:1,o=i.findIndex(a=>a.getRowNode().rowIndex===e.rowIndex),r=i[o+n];if(r)return{rowIndex:r.getRowNode().rowIndex,rowPinned:null}}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;return t==="top"?this.pinnedRowModel.getPinnedTopRowData().length-1<=i:t==="bottom"?this.pinnedRowModel.getPinnedBottomRowData().length-1<=i:this.paginationProxy.getPageLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?t===0:t===this.paginationProxy.getPageFirstRow())return i==="top"?null:i?this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null:this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const o=this.rowModel.getRow(e.rowIndex),r=this.getNextStickyPosition(o,!0);return r||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.paginationProxy.getPageLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowData().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,n=e.rowPinned,o=this.columnModel.getDisplayedColAfter(e.column);if(!o){o=t[0];const r=this.getRowBelow(e);if(missing(r)||!r.rowPinned&&!this.paginationProxy.isRowInPage(r))return null;i=r?r.rowIndex:null,n=r?r.rowPinned:null}return{rowIndex:i,column:o,rowPinned:n}}getNextTabbedCellBackwards(e){const t=this.columnModel.getAllDisplayedColumns();let i=e.rowIndex,n=e.rowPinned,o=this.columnModel.getDisplayedColBefore(e.column);if(!o){o=last(t);const r=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(missing(r)||!r.rowPinned&&!this.paginationProxy.isRowInPage(r))return null;i=r?r.rowIndex:null,n=r?r.rowPinned:null}return{rowIndex:i,column:o,rowPinned:n}}};__decorate$P([Autowired("columnModel")],CellNavigationService.prototype,"columnModel",void 0);__decorate$P([Autowired("rowModel")],CellNavigationService.prototype,"rowModel",void 0);__decorate$P([Autowired("rowRenderer")],CellNavigationService.prototype,"rowRenderer",void 0);__decorate$P([Autowired("pinnedRowModel")],CellNavigationService.prototype,"pinnedRowModel",void 0);__decorate$P([Autowired("paginationProxy")],CellNavigationService.prototype,"paginationProxy",void 0);CellNavigationService=__decorate$P([Bean("cellNavigationService")],CellNavigationService);var __decorate$O=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},__param$4=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}};let AlignedGridsService=class extends BeanStub{constructor(){super(...arguments),this.consuming=!1}setBeans(e){this.logger=e.create("AlignedGridsService")}getAlignedGridApis(){var e;let t=(e=this.gridOptionsService.get("alignedGrids"))!==null&&e!==void 0?e:[];const i=typeof t=="function";typeof t=="function"&&(t=t());const n=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return t.map(r=>{var a;if(!r){errorOnce("alignedGrids contains an undefined option."),i||errorOnce(`You may want to configure via a callback to avoid setup race conditions:
|
||
"alignedGrids: () => [linkedGrid]"`),errorOnce(n());return}if(r instanceof GridApi)return r;const l=r;return"current"in l?(a=l.current)===null||a===void 0?void 0:a.api:(l.api||errorOnce(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${n()}`),l.api)}).filter(r=>!!r&&!r.isDestroyed())}init(){this.addManagedListener(this.eventService,Events.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach(t=>{const i=t.__getAlignedGridService();e(i)})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent(t=>{t.onColumnEvent(e)})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent(t=>{t.onScrollEvent(e)})}onScrollEvent(e){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach(i=>{t.push(i)}):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach(i=>{t.push(i.getColId())}):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case Events.EVENT_COLUMN_MOVED:case Events.EVENT_COLUMN_VISIBLE:case Events.EVENT_COLUMN_PINNED:case Events.EVENT_COLUMN_RESIZED:const t=e;this.processColumnEvent(t);break;case Events.EVENT_COLUMN_GROUP_OPENED:const i=e;this.processGroupOpenedEvent(i);break;case Events.EVENT_COLUMN_PIVOT_CHANGED:console.warn("AG Grid: pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.");break}})}processGroupOpenedEvent(e){e.columnGroups.forEach(t=>{let i=null;if(t){const n=t.getGroupId();i=this.columnModel.getProvidedColumnGroup(n)}t&&!i||(this.logger.log("onColumnEvent-> processing "+e+" expanded = "+t.isExpanded()),this.columnModel.setColumnGroupOpened(i,t.isExpanded(),"alignedGridChanged"))})}processColumnEvent(e){var t;const i=e.column;let n=null;if(i&&(n=this.columnModel.getPrimaryColumn(i.getColId())),i&&!n)return;const o=this.getMasterColumns(e);switch(e.type){case Events.EVENT_COLUMN_MOVED:{const h=e,m=e.api.getColumnState().map(v=>({colId:v.colId}));this.columnModel.applyColumnState({state:m,applyOrder:!0},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} toIndex = ${h.toIndex}`)}break;case Events.EVENT_COLUMN_VISIBLE:{const h=e,m=e.api.getColumnState().map(v=>({colId:v.colId,hide:v.hide}));this.columnModel.applyColumnState({state:m},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} visible = ${h.visible}`)}break;case Events.EVENT_COLUMN_PINNED:{const h=e,m=e.api.getColumnState().map(v=>({colId:v.colId,pinned:v.pinned}));this.columnModel.applyColumnState({state:m},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} pinned = ${h.pinned}`)}break;case Events.EVENT_COLUMN_RESIZED:const l=e,d={};o.forEach(h=>{this.logger.log(`onColumnEvent-> processing ${e.type} actualWidth = ${h.getActualWidth()}`),d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()}}),(t=l.flexColumns)===null||t===void 0||t.forEach(h=>{d[h.getId()]&&delete d[h.getId()]}),this.columnModel.setColumnWidths(Object.values(d),!1,l.finished,"alignedGridChanged");break}const a=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(l=>{l.setGridOption("alwaysShowVerticalScroll",a)})}};__decorate$O([Autowired("columnModel")],AlignedGridsService.prototype,"columnModel",void 0);__decorate$O([Autowired("ctrlsService")],AlignedGridsService.prototype,"ctrlsService",void 0);__decorate$O([__param$4(0,Qualifier("loggerFactory"))],AlignedGridsService.prototype,"setBeans",null);__decorate$O([PostConstruct],AlignedGridsService.prototype,"init",null);AlignedGridsService=__decorate$O([Bean("alignedGridsService")],AlignedGridsService);var __decorate$N=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let SelectionService=class extends BeanStub{constructor(){super(...arguments),this.selectedNodes=new Map,this.lastRowNode=null}init(){this.rowSelection=this.gridOptionsService.get("rowSelection"),this.groupSelectsChildren=this.gridOptionsService.get("groupSelectsChildren"),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{this.groupSelectsChildren=this.gridOptionsService.get("groupSelectsChildren"),this.rowSelection=this.gridOptionsService.get("rowSelection"),this.deselectAllRowNodes({source:"api"})}),this.addManagedListener(this.eventService,Events.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))}destroy(){super.destroy(),this.resetNodes(),this.lastRowNode=null}isMultiselect(){return this.rowSelection==="multiple"}setNodesSelected(e){var t;const{newValue:i,clearSelection:n,suppressFinishActions:o,rangeSelect:r,nodes:a,event:l,source:d="api"}=e;if(a.length===0)return 0;if(a.length>1&&!this.isMultiselect())return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;const h=this.groupSelectsChildren&&e.groupSelectsFiltered===!0,p=a.map(v=>v.footer?v.sibling:v);if(r){if(a.length>1)return console.warn("AG Grid: cannot range select while selecting multiple rows"),0;let v=null;if(d==="checkboxSelected"&&i===!1&&this.lastRowNode&&(this.lastRowNode.id?v=this.lastRowNode:this.lastRowNode=null),v==null&&(v=this.getLastSelectedNode()),v){const y=p[0];if(y!==v&&this.isMultiselect())return this.selectRange(y,v,i,d)}}this.lastRowNode=i?null:p[0];let m=0;for(let v=0;v<p.length;v++){const y=p[v];h&&y.group||y.selectThisNode(i,l,d)&&m++,this.groupSelectsChildren&&(!((t=y.childrenAfterGroup)===null||t===void 0)&&t.length)&&(m+=this.selectChildren(y,i,h,d))}if(!o&&(i&&(n||!this.isMultiselect())&&(m+=this.clearOtherNodes(p[0],d)),m>0)){this.updateGroupsFromChildrenSelections(d);const y={type:Events.EVENT_SELECTION_CHANGED,source:d};this.eventService.dispatchEvent(y)}return m}selectRange(e,t,i=!0,n){const o=this.rowModel.getNodesInRangeForSelection(e,t);let r=0;o.forEach(l=>{if(l.group&&this.groupSelectsChildren)return;l.selectThisNode(i,void 0,n)&&r++}),this.updateGroupsFromChildrenSelections(n);const a={type:Events.EVENT_SELECTION_CHANGED,source:n};return this.eventService.dispatchEvent(a),r}selectChildren(e,t,i,n){const o=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return missing(o)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:n,nodes:o})}getLastSelectedNode(){const e=Array.from(this.selectedNodes.keys());if(e.length==0)return null;const t=this.selectedNodes.get(last(e));return t||null}getSelectedNodes(){const e=[];return this.selectedNodes.forEach(t=>{t&&e.push(t)}),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>{t&&t.data&&e.push(t.data)}),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((i,n)=>{i&&e(i)&&t.set(n,i)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren||this.rowModel.getType()!=="clientSide")return!1;const n=this.rowModel.getRootNode();t||(t=new ChangedPath(!0,n),t.setInactive());let o=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==n){const a=r.calculateSelectedFromChildren();o=r.selectThisNode(a===null?!1:a,void 0,e)||o}}),o}clearOtherNodes(e,t){const i=new Map;let n=0;return this.selectedNodes.forEach(o=>{if(o&&o.id!==e.id){const r=this.selectedNodes.get(o.id);n+=r.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&o.parent&&i.set(o.parent.id,o.parent)}}),i.forEach(o=>{const r=o.calculateSelectedFromChildren();o.selectThisNode(r===null?!1:r,void 0,t)}),n}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(exists(t)&&e.id!==t.id&&t){const n=t.id;this.selectedNodes.get(n)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();if(this.resetNodes(),t){const i={type:Events.EVENT_SELECTION_CHANGED,source:e};this.eventService.dispatchEvent(i)}}resetNodes(){var e;(e=this.selectedNodes)===null||e===void 0||e.clear()}getBestCostNodeSelection(){if(this.rowModel.getType()!=="clientSide")return;const t=this.rowModel.getTopLevelNodes();if(t===null)return;const i=[];function n(o){for(let r=0,a=o.length;r<a;r++){const l=o[r];if(l.isSelected())i.push(l);else{const d=l;d.group&&d.children&&n(d.children)}}}return n(t),i}isEmpty(){let e=0;return this.selectedNodes.forEach(t=>{t&&e++}),e===0}deselectAllRowNodes(e){const t=l=>l.selectThisNode(!1,void 0,n),i=this.rowModel.getType()==="clientSide",{source:n,justFiltered:o,justCurrentPage:r}=e;if(r||o){if(!i){console.error("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'");return}this.getNodesToSelect(o,r).forEach(t)}else this.selectedNodes.forEach(l=>{l&&t(l)}),this.reset(n);i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(n);const a={type:Events.EVENT_SELECTION_CHANGED,source:n};this.eventService.dispatchEvent(a)}getSelectedCounts(e,t){let i=0,n=0;const o=r=>{this.groupSelectsChildren&&r.group||(r.isSelected()?i++:r.selectable&&n++)};return this.getNodesToSelect(e,t).forEach(o),{selectedCount:i,notSelectedCount:n}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:n}=this.getSelectedCounts(e,t);return i===0&&n===0?!1:i>0&&n>0?null:i>0}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter(i=>i.selectable).length>0}getNodesToSelect(e=!1,t=!1){if(this.rowModel.getType()!=="clientSide")throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const i=[];if(t)return this.paginationProxy.forEachNodeOnPage(o=>{if(!o.group){i.push(o);return}if(!o.expanded){const r=a=>{var l;i.push(a),!((l=a.childrenAfterFilter)===null||l===void 0)&&l.length&&a.childrenAfterFilter.forEach(r)};r(o);return}this.groupSelectsChildren||i.push(o)}),i;const n=this.rowModel;return e?(n.forEachNodeAfterFilter(o=>{i.push(o)}),i):(n.forEachNode(o=>{i.push(o)}),i)}selectAllRowNodes(e){if(this.rowModel.getType()!=="clientSide")throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:i,justCurrentPage:n}=e,o=a=>a.selectThisNode(!0,void 0,t);this.getNodesToSelect(i,n).forEach(o),this.rowModel.getType()==="clientSide"&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t);const r={type:Events.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(r)}getSelectionState(){const e=[];return this.selectedNodes.forEach(t=>{t!=null&&t.id&&e.push(t.id)}),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return;const i=new Set(e),n=[];this.rowModel.forEachNode(o=>{i.has(o.id)&&n.push(o)}),this.setNodesSelected({newValue:!0,nodes:n,source:t})}};__decorate$N([Autowired("rowModel")],SelectionService.prototype,"rowModel",void 0);__decorate$N([Autowired("paginationProxy")],SelectionService.prototype,"paginationProxy",void 0);__decorate$N([PostConstruct],SelectionService.prototype,"init",null);SelectionService=__decorate$N([Bean("selectionService")],SelectionService);var __decorate$M=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ColumnApi=class{constructor(e){this.viaApi=(t,...i)=>(warnOnce(`Since v31, 'columnApi.${t}' is deprecated and moved to 'api.${t}'.`),this.api[t](...i)),this.api=e}sizeColumnsToFit(e){this.viaApi("sizeColumnsToFit",e)}setColumnGroupOpened(e,t){this.viaApi("setColumnGroupOpened",e,t)}getColumnGroup(e,t){return this.viaApi("getColumnGroup",e,t)}getProvidedColumnGroup(e){return this.viaApi("getProvidedColumnGroup",e)}getDisplayNameForColumn(e,t){return this.viaApi("getDisplayNameForColumn",e,t)}getDisplayNameForColumnGroup(e,t){return this.viaApi("getDisplayNameForColumnGroup",e,t)}getColumn(e){return this.viaApi("getColumn",e)}getColumns(){return this.viaApi("getColumns")}applyColumnState(e){return this.viaApi("applyColumnState",e)}getColumnState(){return this.viaApi("getColumnState")}resetColumnState(){this.viaApi("resetColumnState")}getColumnGroupState(){return this.viaApi("getColumnGroupState")}setColumnGroupState(e){this.viaApi("setColumnGroupState",e)}resetColumnGroupState(){this.viaApi("resetColumnGroupState")}isPinning(){return this.viaApi("isPinning")}isPinningLeft(){return this.viaApi("isPinningLeft")}isPinningRight(){return this.viaApi("isPinningRight")}getDisplayedColAfter(e){return this.viaApi("getDisplayedColAfter",e)}getDisplayedColBefore(e){return this.viaApi("getDisplayedColBefore",e)}setColumnVisible(e,t){this.viaApi("setColumnVisible",e,t)}setColumnsVisible(e,t){this.viaApi("setColumnsVisible",e,t)}setColumnPinned(e,t){this.viaApi("setColumnPinned",e,t)}setColumnsPinned(e,t){this.viaApi("setColumnsPinned",e,t)}getAllGridColumns(){return this.viaApi("getAllGridColumns")}getDisplayedLeftColumns(){return this.viaApi("getDisplayedLeftColumns")}getDisplayedCenterColumns(){return this.viaApi("getDisplayedCenterColumns")}getDisplayedRightColumns(){return this.viaApi("getDisplayedRightColumns")}getAllDisplayedColumns(){return this.viaApi("getAllDisplayedColumns")}getAllDisplayedVirtualColumns(){return this.viaApi("getAllDisplayedVirtualColumns")}moveColumn(e,t){this.viaApi("moveColumn",e,t)}moveColumnByIndex(e,t){this.viaApi("moveColumnByIndex",e,t)}moveColumns(e,t){this.viaApi("moveColumns",e,t)}moveRowGroupColumn(e,t){this.viaApi("moveRowGroupColumn",e,t)}setColumnAggFunc(e,t){this.viaApi("setColumnAggFunc",e,t)}setColumnWidth(e,t,i=!0,n){this.viaApi("setColumnWidth",e,t,i,n)}setColumnWidths(e,t=!0,i){this.viaApi("setColumnWidths",e,t,i)}setPivotMode(e){this.viaApi("setPivotMode",e)}isPivotMode(){return this.viaApi("isPivotMode")}getPivotResultColumn(e,t){return this.viaApi("getPivotResultColumn",e,t)}setValueColumns(e){this.viaApi("setValueColumns",e)}getValueColumns(){return this.viaApi("getValueColumns")}removeValueColumn(e){this.viaApi("removeValueColumn",e)}removeValueColumns(e){this.viaApi("removeValueColumns",e)}addValueColumn(e){this.viaApi("addValueColumn",e)}addValueColumns(e){this.viaApi("addValueColumns",e)}setRowGroupColumns(e){this.viaApi("setRowGroupColumns",e)}removeRowGroupColumn(e){this.viaApi("removeRowGroupColumn",e)}removeRowGroupColumns(e){this.viaApi("removeRowGroupColumns",e)}addRowGroupColumn(e){this.viaApi("addRowGroupColumn",e)}addRowGroupColumns(e){this.viaApi("addRowGroupColumns",e)}getRowGroupColumns(){return this.viaApi("getRowGroupColumns")}setPivotColumns(e){this.viaApi("setPivotColumns",e)}removePivotColumn(e){this.viaApi("removePivotColumn",e)}removePivotColumns(e){this.viaApi("removePivotColumns",e)}addPivotColumn(e){this.viaApi("addPivotColumn",e)}addPivotColumns(e){this.viaApi("addPivotColumns",e)}getPivotColumns(){return this.viaApi("getPivotColumns")}getLeftDisplayedColumnGroups(){return this.viaApi("getLeftDisplayedColumnGroups")}getCenterDisplayedColumnGroups(){return this.viaApi("getCenterDisplayedColumnGroups")}getRightDisplayedColumnGroups(){return this.viaApi("getRightDisplayedColumnGroups")}getAllDisplayedColumnGroups(){return this.viaApi("getAllDisplayedColumnGroups")}autoSizeColumn(e,t){return this.viaApi("autoSizeColumn",e,t)}autoSizeColumns(e,t){this.viaApi("autoSizeColumns",e,t)}autoSizeAllColumns(e){this.viaApi("autoSizeAllColumns",e)}setPivotResultColumns(e){this.viaApi("setPivotResultColumns",e)}getPivotResultColumns(){return this.viaApi("getPivotResultColumns")}};__decorate$M([Autowired("gridApi")],ColumnApi.prototype,"api",void 0);ColumnApi=__decorate$M([Bean("columnApi")],ColumnApi);var __decorate$L=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ValueService=class extends BeanStub{constructor(){super(...arguments),this.initialised=!1,this.isSsrm=!1}init(){this.isSsrm=this.gridOptionsService.isRowModelType("serverSide"),this.cellExpressions=this.gridOptionsService.get("enableCellExpressions"),this.isTreeData=this.gridOptionsService.get("treeData"),this.initialised=!0;const e=i=>this.callColumnCellValueChangedHandler(i),t=this.gridOptionsService.useAsyncEvents();this.eventService.addEventListener(Events.EVENT_CELL_VALUE_CHANGED,e,t),this.addDestroyFunc(()=>this.eventService.removeEventListener(Events.EVENT_CELL_VALUE_CHANGED,e,t)),this.addManagedPropertyListener("treeData",i=>this.isTreeData=i.currentValue)}getValue(e,t,i=!1,n=!1){if(this.initialised||this.init(),!t)return;const o=e.getColDef(),r=o.field,a=e.getColId(),l=t.data;let d;const h=t.groupData&&t.groupData[a]!==void 0,p=!n&&t.aggData&&t.aggData[a]!==void 0,m=this.isSsrm&&n&&!!e.getColDef().aggFunc,v=this.isSsrm&&t.footer&&t.field&&(e.getColDef().showRowGroup===!0||e.getColDef().showRowGroup===t.field);if(i&&o.filterValueGetter?d=this.executeFilterValueGetter(o.filterValueGetter,l,e,t):this.isTreeData&&p?d=t.aggData[a]:this.isTreeData&&o.valueGetter?d=this.executeValueGetter(o.valueGetter,l,e,t):this.isTreeData&&r&&l?d=getValueUsingField(l,r,e.isFieldContainsDots()):h?d=t.groupData[a]:p?d=t.aggData[a]:o.valueGetter?d=this.executeValueGetter(o.valueGetter,l,e,t):v?d=getValueUsingField(l,t.field,e.isFieldContainsDots()):r&&l&&!m&&(d=getValueUsingField(l,r,e.isFieldContainsDots())),this.cellExpressions&&typeof d=="string"&&d.indexOf("=")===0){const y=d.substring(1);d=this.executeValueGetter(y,l,e,t)}if(d==null){const y=this.getOpenedGroup(t,e);if(y!=null)return y}return d}getOpenedGroup(e,t){if(!this.gridOptionsService.get("showOpenedGroup")||!t.getColDef().showRowGroup)return;const n=t.getColDef().showRowGroup;let o=e.parent;for(;o!=null;){if(o.rowGroupColumn&&(n===!0||n===o.rowGroupColumn.getColId()))return o.key;o=o.parent}}setValue(e,t,i,n){const o=this.columnModel.getPrimaryColumn(t);if(!e||!o)return!1;missing(e.data)&&(e.data={});const{field:r,valueSetter:a}=o.getColDef();if(missing(r)&&missing(a))return console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work"),!1;if(!this.dataTypeService.checkType(o,i))return console.warn("AG Grid: Data type of the new value does not match the cell data type of the column"),!1;const l=this.gridOptionsService.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(o,e),newValue:i,colDef:o.getColDef(),column:o});l.newValue=i;let d;if(exists(a)?typeof a=="function"?d=a(l):d=this.expressionService.evaluate(a,l):d=this.setValueUsingField(e.data,r,i,o.isFieldContainsDots()),d===void 0&&(d=!0),!d)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),l.newValue=this.getValue(o,e);const h={type:Events.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:l.column,api:l.api,columnApi:l.columnApi,colDef:l.colDef,context:l.context,data:e.data,node:e,oldValue:l.oldValue,newValue:l.newValue,value:l.newValue,source:n};return this.eventService.dispatchEvent(h),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;typeof t=="function"&&this.getFrameworkOverrides().wrapOutgoing(()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,columnApi:e.columnApi,context:e.context})})}setValueUsingField(e,t,i,n){if(!t)return!1;let o=!1;if(!n)o=e[t]===i,o||(e[t]=i);else{const r=t.split(".");let a=e;for(;r.length>0&&a;){const l=r.shift();r.length===0?(o=a[l]===i,o||(a[l]=i)):a=a[l]}}return!o}executeFilterValueGetter(e,t,i,n){const o=this.gridOptionsService.addGridCommonParams({data:t,node:n,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,n)});return typeof e=="function"?e(o):this.expressionService.evaluate(e,o)}executeValueGetter(e,t,i,n){const o=i.getColId(),r=this.valueCache.getValue(n,o);if(r!==void 0)return r;const a=this.gridOptionsService.addGridCommonParams({data:t,node:n,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,n)});let l;return typeof e=="function"?l=e(a):l=this.expressionService.evaluate(e,a),this.valueCache.setValue(n,o,l),l}getValueCallback(e,t){const i=this.columnModel.getPrimaryColumn(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),n=e.getColDef().keyCreator;let o=i;if(n){const r=this.gridOptionsService.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data});o=n(r)}return typeof o=="string"||o==null||(o=String(o),o==="[object Object]"&&warnOnce("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),o}};__decorate$L([Autowired("expressionService")],ValueService.prototype,"expressionService",void 0);__decorate$L([Autowired("columnModel")],ValueService.prototype,"columnModel",void 0);__decorate$L([Autowired("valueCache")],ValueService.prototype,"valueCache",void 0);__decorate$L([Autowired("dataTypeService")],ValueService.prototype,"dataTypeService",void 0);__decorate$L([PostConstruct],ValueService.prototype,"init",null);ValueService=__decorate$L([Bean("valueService")],ValueService);var __decorate$K=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},__param$3=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}};let ExpressionService=class extends BeanStub{constructor(){super(...arguments),this.expressionToFunctionCache={}}setBeans(e){this.logger=e.create("ExpressionService")}evaluate(e,t){if(typeof e=="string")return this.evaluateExpression(e,t);console.error("AG Grid: value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.columnApi,t.getValue,t.column,t.columnGroup)}catch(i){return console.log("Processing of the expression failed"),console.log("Expression = "+e),console.log("Params =",t),console.log("Exception = "+i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}};__decorate$K([__param$3(0,Qualifier("loggerFactory"))],ExpressionService.prototype,"setBeans",null);ExpressionService=__decorate$K([Bean("expressionService")],ExpressionService);var __decorate$J=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let TemplateService=class extends BeanStub{constructor(){super(...arguments),this.templateCache={},this.waitingCallbacks={}}getTemplate(e,t){const i=this.templateCache[e];if(i)return i;let n=this.waitingCallbacks[e];const o=this;if(!n){n=[],this.waitingCallbacks[e]=n;const r=new XMLHttpRequest;r.onload=function(){o.handleHttpResult(this,e)},r.open("GET",e),r.send()}return t&&n.push(t),null}handleHttpResult(e,t){if(e.status!==200||e.response===null){console.warn(`AG Grid: Unable to get template error ${e.status} - ${t}`);return}this.templateCache[t]=e.response||e.responseText;const i=this.waitingCallbacks[t];for(let n=0;n<i.length;n++){const o=i[n];o()}}};TemplateService=__decorate$J([Bean("templateService")],TemplateService);var __decorate$I=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},__param$2=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}};let LoggerFactory=class extends BeanStub{setBeans(e){this.logging=e.get("debug")}create(e){return new Logger(e,this.isLogging.bind(this))}isLogging(){return this.logging}};__decorate$I([__param$2(0,Qualifier("gridOptionsService"))],LoggerFactory.prototype,"setBeans",null);LoggerFactory=__decorate$I([Bean("loggerFactory")],LoggerFactory);class Logger{constructor(e,t){this.name=e,this.isLoggingFunc=t}isLogging(){return this.isLoggingFunc()}log(e){this.isLoggingFunc()&&console.log("AG Grid."+this.name+": "+e)}}var __decorate$H=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class GridCtrl extends BeanStub{setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.context.getGridId()),this.dragAndDropService.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:o=>o===DragSourceType.HeaderCell||o===DragSourceType.ToolPanel,getIconName:()=>DragAndDropService.ICON_NOT_ALLOWED}),this.mouseEventService.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new LayoutFeature(this.view)),this.addRtlSupport();const n=this.resizeObserverService.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>n()),this.ctrlsService.registerGridCtrl(this)}isDetailGrid(){var e;const t=this.focusService.findTabbableParent(this.getGui());return((e=t==null?void 0:t.getAttribute("row-id"))===null||e===void 0?void 0:e.startsWith("detail"))||!1}showDropZones(){return ModuleRegistry.__isRegistered(ModuleNames.RowGroupingModule,this.context.getGridId())}showSideBar(){return ModuleRegistry.__isRegistered(ModuleNames.SideBarModule,this.context.getGridId())}showStatusBar(){return ModuleRegistry.__isRegistered(ModuleNames.StatusBarModule,this.context.getGridId())}showWatermark(){return ModuleRegistry.__isRegistered(ModuleNames.EnterpriseCoreModule,this.context.getGridId())}onGridSizeChanged(){const e={type:Events.EVENT_GRID_SIZE_CHANGED,clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gridOptionsService.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.gridOptionsService.getDocument(),i=this.view.getFocusableContainers(),o=i.findIndex(r=>r.contains(t.activeElement))+(e?-1:1);return o<=0||o>=i.length?!1:this.focusService.focusInto(i[o])}focusInnerElement(e){const t=this.view.getFocusableContainers(),i=this.columnModel.getAllDisplayedColumns();if(e){if(t.length>1)return this.focusService.focusInto(last(t),!0);const n=last(i);if(this.focusService.focusGridView(n,!0))return!0}if(this.gridOptionsService.get("headerHeight")===0||this.gridOptionsService.get("suppressHeaderFocus")){if(this.focusService.focusGridView(i[0]))return!0;for(let n=1;n<t.length;n++)if(this.focusService.focusInto(t[n]))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}}__decorate$H([Autowired("focusService")],GridCtrl.prototype,"focusService",void 0);__decorate$H([Autowired("resizeObserverService")],GridCtrl.prototype,"resizeObserverService",void 0);__decorate$H([Autowired("columnModel")],GridCtrl.prototype,"columnModel",void 0);__decorate$H([Autowired("ctrlsService")],GridCtrl.prototype,"ctrlsService",void 0);__decorate$H([Autowired("mouseEventService")],GridCtrl.prototype,"mouseEventService",void 0);__decorate$H([Autowired("dragAndDropService")],GridCtrl.prototype,"dragAndDropService",void 0);var __decorate$G=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class GridComp extends TabGuardComp{constructor(e){super(),this.eGridDiv=e}postConstruct(){this.logger=this.loggerFactory.create("GridComp");const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:i=>this.addCssClass(i),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:i=>{this.getGui().style.userSelect=i??"",this.getGui().style.webkitUserSelect=i??""},setCursor:i=>{this.getGui().style.cursor=i??""}};this.ctrl=this.createManagedBean(new GridCtrl);const t=this.createTemplate();this.setTemplate(t),this.ctrl.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:i=>this.ctrl.focusInnerElement(i),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.logger.log("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.eRootWrapperBody.classList;i.toggle(LayoutCssClasses.AUTO_HEIGHT,t.autoHeight),i.toggle(LayoutCssClasses.NORMAL,t.normal),i.toggle(LayoutCssClasses.PRINT,t.print),this.addOrRemoveCssClass(LayoutCssClasses.AUTO_HEIGHT,t.autoHeight),this.addOrRemoveCssClass(LayoutCssClasses.NORMAL,t.normal),this.addOrRemoveCssClass(LayoutCssClasses.PRINT,t.print)}createTemplate(){const e=this.ctrl.showDropZones()?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"",t=this.ctrl.showSideBar()?'<ag-side-bar ref="sideBar"></ag-side-bar>':"",i=this.ctrl.showStatusBar()?'<ag-status-bar ref="statusBar"></ag-status-bar>':"",n=this.ctrl.showWatermark()?"<ag-watermark></ag-watermark>":"";return`<div class="ag-root-wrapper" role="presentation">
|
||
${e}
|
||
<div class="ag-root-wrapper-body" ref="rootWrapperBody" role="presentation">
|
||
<ag-grid-body ref="gridBody"></ag-grid-body>
|
||
${t}
|
||
</div>
|
||
${i}
|
||
<ag-pagination></ag-pagination>
|
||
${n}
|
||
</div>`}getFocusableElement(){return this.eRootWrapperBody}getFocusableContainers(){const e=[this.gridBodyComp.getGui()];return this.sideBarComp&&e.push(this.sideBarComp.getGui()),e.filter(t=>isVisible(t))}}__decorate$G([Autowired("loggerFactory")],GridComp.prototype,"loggerFactory",void 0);__decorate$G([RefSelector("gridBody")],GridComp.prototype,"gridBodyComp",void 0);__decorate$G([RefSelector("sideBar")],GridComp.prototype,"sideBarComp",void 0);__decorate$G([RefSelector("rootWrapperBody")],GridComp.prototype,"eRootWrapperBody",void 0);__decorate$G([PostConstruct],GridComp.prototype,"postConstruct",null);var __decorate$F=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},SortController_1;let SortController=SortController_1=class extends BeanStub{progressSort(e,t,i){const n=this.getNextSortDirection(e);this.setSortForColumn(e,n,t,i)}setSortForColumn(e,t,i,n){t!=="asc"&&t!=="desc"&&(t=null);const o=this.gridOptionsService.isColumnsSortingCoupledToGroup();let r=[e];if(o&&e.getColDef().showRowGroup){const d=this.columnModel.getSourceColumnsForGroupColumn(e),h=d==null?void 0:d.filter(p=>p.isSortable());h&&(r=[e,...h])}r.forEach(d=>d.setSort(t,n));const a=(i||this.gridOptionsService.get("alwaysMultiSort"))&&!this.gridOptionsService.get("suppressMultiSort"),l=[];if(!a){const d=this.clearSortBarTheseColumns(r,n);l.push(...d)}this.updateSortIndex(e),l.push(...r),this.dispatchSortChangedEvents(n,l)}updateSortIndex(e){const t=this.gridOptionsService.isColumnsSortingCoupledToGroup(),i=this.columnModel.getGroupDisplayColumnForGroup(e.getId()),n=t&&i||e,o=this.getColumnsWithSortingOrdered();this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(l=>l.setSortIndex(null));const r=o.filter(l=>t&&l.getColDef().showRowGroup?!1:l!==n);(n.getSort()?[...r,n]:r).forEach((l,d)=>{l.setSortIndex(d)})}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const t=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(i=>!!i.getSort());return t&&t.length>0}dispatchSortChangedEvents(e,t){const i={type:Events.EVENT_SORT_CHANGED,source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(n=>{e.includes(n)||(n.getSort()&&i.push(n),n.setSort(void 0,t))}),i}getNextSortDirection(e){let t;if(e.getColDef().sortingOrder?t=e.getColDef().sortingOrder:this.gridOptionsService.get("sortingOrder")?t=this.gridOptionsService.get("sortingOrder"):t=SortController_1.DEFAULT_SORTING_ORDER,!Array.isArray(t)||t.length<=0)return console.warn(`AG Grid: sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),n=i<0,o=i==t.length-1;let r;return n||o?r=t[0]:r=t[i+1],SortController_1.DEFAULT_SORTING_ORDER.indexOf(r)<0?(console.warn("AG Grid: invalid sort type "+r),null):r}getIndexedSortMap(){let e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(r=>!!r.getSort());if(this.columnModel.isPivotMode()){const r=this.gridOptionsService.isColumnsSortingCoupledToGroup();e=e.filter(a=>{const l=!!a.getAggFunc(),d=!a.isPrimary(),h=r?this.columnModel.getGroupDisplayColumnForGroup(a.getId()):a.getColDef().showRowGroup;return l||d||h})}const t=this.columnModel.getRowGroupColumns().filter(r=>!!r.getSort()),i=this.gridOptionsService.isColumnsSortingCoupledToGroup()&&!!t.length;i&&(e=[...new Set(e.map(r=>{var a;return(a=this.columnModel.getGroupDisplayColumnForGroup(r.getId()))!==null&&a!==void 0?a:r}))]);const n={};e.forEach((r,a)=>n[r.getId()]=a),e.sort((r,a)=>{const l=r.getSortIndex(),d=a.getSortIndex();if(l!=null&&d!=null)return l-d;if(l==null&&d==null){const h=n[r.getId()],p=n[a.getId()];return h>p?1:-1}else return d==null?-1:1});const o=new Map;return e.forEach((r,a)=>o.set(r,a)),i&&t.forEach(r=>{const a=this.columnModel.getGroupDisplayColumnForGroup(r.getId());o.set(r,o.get(a))}),o}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,n])=>t-n).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=this.gridOptionsService.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.columnModel.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!(t!=null&&t.length))return e.getSort();const n=e.getColDef().field!=null||!!e.getColDef().valueGetter?[e,...t]:t,o=n[0].getSort();return n.every(a=>a.getSort()==o)?o:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}};SortController.DEFAULT_SORTING_ORDER=["asc","desc",null];__decorate$F([Autowired("columnModel")],SortController.prototype,"columnModel",void 0);SortController=SortController_1=__decorate$F([Bean("sortController")],SortController);var __decorate$E=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},FocusService_1;let FocusService=FocusService_1=class extends BeanStub{static addKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",FocusService_1.toggleKeyboardMode),e.addEventListener("mousedown",FocusService_1.toggleKeyboardMode))}static removeKeyboardModeEvents(e){this.instanceCount>0||(e.addEventListener("keydown",FocusService_1.toggleKeyboardMode),e.addEventListener("mousedown",FocusService_1.toggleKeyboardMode))}static toggleKeyboardMode(e){const t=FocusService_1.keyboardModeActive,i=e.type==="keydown";i&&(e.ctrlKey||e.metaKey||e.altKey)||t!==i&&(FocusService_1.keyboardModeActive=i)}static unregisterGridCompController(e){FocusService_1.removeKeyboardModeEvents(e)}init(){const e=this.clearFocusedCell.bind(this);this.addManagedListener(this.eventService,Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,Events.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverythingChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_GROUP_OPENED,e),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(t=>{this.gridCtrl=t.gridCtrl})}registerKeyboardFocusEvents(){const e=this.gridOptionsService.getDocument();FocusService_1.addKeyboardModeEvents(e),FocusService_1.instanceCount++,this.addDestroyFunc(()=>{FocusService_1.instanceCount--,FocusService_1.unregisterGridCompController(e)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const e=this.focusedCellPosition.column,t=this.columnModel.getGridColumn(e.getId());e!==t&&this.clearFocusedCell()}isKeyboardMode(){return FocusService_1.keyboardModeActive}getFocusCellToUseAfterRefresh(){const e=this.gridOptionsService.getDocument();return this.gridOptionsService.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(e.activeElement,RowCtrl.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){const e=this.gridOptionsService.getDocument();return this.gridOptionsService.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(e.activeElement,AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(e,t){let i=e;for(;i;){if(this.gridOptionsService.getDomData(i,t))return!1;i=i.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(e){return this.isCellRestoreFocused(e)?(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0):!1}isCellRestoreFocused(e){return this.restoredFocusedCellPosition==null?!1:this.cellPositionUtils.equals(e,this.restoredFocusedCellPosition)}setRestoreFocusedCell(e){this.getFrameworkOverrides().renderingEngine==="react"&&(this.restoredFocusedCellPosition=e)}getFocusEventParams(){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCellPosition,n={rowIndex:e,rowPinned:t,column:i,isFullWidthCell:!1},o=this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t});return o&&(n.isFullWidthCell=o.isFullWidth()),n}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,this.focusedCellPosition==null)return;const e=Object.assign({type:Events.EVENT_CELL_FOCUS_CLEARED},this.getFocusEventParams());this.focusedCellPosition=null,this.eventService.dispatchEvent(e)}setFocusedCell(e){const{column:t,rowIndex:i,rowPinned:n,forceBrowserFocus:o=!1,preventScrollOnBrowserFocus:r=!1}=e,a=this.columnModel.getGridColumn(t);if(!a){this.focusedCellPosition=null;return}this.focusedCellPosition=a?{rowIndex:i,rowPinned:makeNull(n),column:a}:null;const l=Object.assign(Object.assign({type:Events.EVENT_CELL_FOCUSED},this.getFocusEventParams()),{forceBrowserFocus:o,preventScrollOnBrowserFocus:r,floating:null});this.eventService.dispatchEvent(l)}isCellFocused(e){return this.focusedCellPosition==null?!1:this.cellPositionUtils.equals(e,this.focusedCellPosition)}isRowNodeFocused(e){return this.isRowFocused(e.rowIndex,e.rowPinned)}isHeaderWrapperFocused(e){if(this.focusedHeaderPosition==null)return!1;const t=e.getColumnGroupChild(),i=e.getRowIndex(),n=e.getPinned(),{column:o,headerRowIndex:r}=this.focusedHeaderPosition;return t===o&&i===r&&n==o.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(e,t){this.focusedHeaderPosition={headerRowIndex:e,column:t}}focusHeaderPosition(e){if(this.gridOptionsService.get("suppressHeaderFocus"))return!1;const{direction:t,fromTab:i,allowUserOverride:n,event:o,fromCell:r,rowWithoutSpanValue:a}=e;let{headerPosition:l}=e;if(r&&this.filterManager.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(l);if(n){const p=this.getFocusedHeader(),m=this.headerNavigationService.getHeaderRowCount();if(i){const v=this.gridOptionsService.getCallback("tabToNextHeader");v&&(l=v({backwards:t==="Before",previousHeaderPosition:p,nextHeaderPosition:l,headerRowCount:m}))}else{const v=this.gridOptionsService.getCallback("navigateToNextHeader");if(v&&o){const y={key:o.key,previousHeaderPosition:p,nextHeaderPosition:l,headerRowCount:m,event:o};l=v(y)}}}if(!l)return!1;if(l.headerRowIndex===-1)return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(l):this.focusGridView(l.column);this.headerNavigationService.scrollToColumn(l.column,t);const h=this.ctrlsService.getHeaderRowContainerCtrl(l.column.getPinned()).focusHeader(l.headerRowIndex,l.column,o);return h&&(a!=null||r)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(a??-1),h}focusFirstHeader(){let e=this.columnModel.getAllDisplayedColumns()[0];if(!e)return!1;e.getParent()&&(e=this.columnModel.getColumnGroupAtLevel(e,0));const t=this.headerPositionUtils.getHeaderIndexToFocus(e,0);return this.focusHeaderPosition({headerPosition:t,rowWithoutSpanValue:0})}focusLastHeader(e){const t=this.headerNavigationService.getHeaderRowCount()-1,i=last(this.columnModel.getAllDisplayedColumns());return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:i},rowWithoutSpanValue:-1,event:e})}focusPreviousFromFirstCell(e){return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(e,t){return this.focusedCellPosition==null?!1:this.focusedCellPosition.rowIndex===e&&this.focusedCellPosition.rowPinned===makeNull(t)}findFocusableElements(e,t,i=!1){const n=FOCUSABLE_SELECTOR;let o=FOCUSABLE_EXCLUDE;t&&(o+=", "+t),i&&(o+=', [tabindex="-1"]');const r=Array.prototype.slice.apply(e.querySelectorAll(n)).filter(d=>isVisible(d)),a=Array.prototype.slice.apply(e.querySelectorAll(o));return a.length?((d,h)=>d.filter(p=>h.indexOf(p)===-1))(r,a):r}focusInto(e,t=!1,i=!1){const n=this.findFocusableElements(e,null,i),o=t?last(n):n[0];return o?(o.focus({preventScroll:!0}),!0):!1}findFocusableElementBeforeTabGuard(e,t){if(!t)return null;const i=this.findFocusableElements(e),n=i.indexOf(t);if(n===-1)return null;let o=-1;for(let r=n-1;r>=0;r--)if(i[r].classList.contains(TabGuardClassNames.TAB_GUARD_TOP)){o=r;break}return o<=0?null:i[o-1]}findNextFocusableElement(e=this.eGridDiv,t,i){const n=this.findFocusableElements(e,t?':not([tabindex="-1"])':null),r=this.gridOptionsService.getDocument().activeElement;let a;t?a=n.findIndex(d=>d.contains(r)):a=n.indexOf(r);const l=a+(i?-1:1);return l<0||l>=n.length?null:n[l]}isTargetUnderManagedComponent(e,t){if(!t)return!1;const i=e.querySelectorAll(`.${ManagedFocusFeature.FOCUS_MANAGED_CLASS}`);if(!i.length)return!1;for(let n=0;n<i.length;n++)if(i[n].contains(t))return!0;return!1}findTabbableParent(e,t=5){let i=0;for(;e&&getTabIndex(e)===null&&++i<=t;)e=e.parentElement;return getTabIndex(e)===null?null:e}focusGridView(e,t){if(this.gridOptionsService.get("suppressCellFocus"))return t?this.gridOptionsService.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const i=t?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!i)return!1;const{rowIndex:n,rowPinned:o}=i,r=this.getFocusedHeader();if(!e&&r&&(e=r.column),n==null||!e)return!1;if(this.navigationService.ensureCellVisible({rowIndex:n,column:e,rowPinned:o}),this.setFocusedCell({rowIndex:n,column:e,rowPinned:makeNull(o),forceBrowserFocus:!0}),this.rangeService){const a={rowIndex:n,rowPinned:o,column:e};this.rangeService.setRangeToCell(a)}return!0}focusNextGridCoreContainer(e,t=!1){return!t&&this.gridCtrl.focusNextInnerContainer(e)?!0:((t||!e&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(e),!1)}focusAdvancedFilter(e){return this.advancedFilterFocusColumn=e==null?void 0:e.column,this.advancedFilterService.getCtrl().focusHeaderComp()}focusNextFromAdvancedFilter(e,t){var i,n;const o=(i=t?void 0:this.advancedFilterFocusColumn)!==null&&i!==void 0?i:(n=this.columnModel.getAllDisplayedColumns())===null||n===void 0?void 0:n[0];return e?this.focusHeaderPosition({headerPosition:{column:o,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(o)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}};FocusService.keyboardModeActive=!1;FocusService.instanceCount=0;__decorate$E([Autowired("eGridDiv")],FocusService.prototype,"eGridDiv",void 0);__decorate$E([Autowired("columnModel")],FocusService.prototype,"columnModel",void 0);__decorate$E([Autowired("headerNavigationService")],FocusService.prototype,"headerNavigationService",void 0);__decorate$E([Autowired("headerPositionUtils")],FocusService.prototype,"headerPositionUtils",void 0);__decorate$E([Autowired("rowRenderer")],FocusService.prototype,"rowRenderer",void 0);__decorate$E([Autowired("rowPositionUtils")],FocusService.prototype,"rowPositionUtils",void 0);__decorate$E([Autowired("cellPositionUtils")],FocusService.prototype,"cellPositionUtils",void 0);__decorate$E([Optional("rangeService")],FocusService.prototype,"rangeService",void 0);__decorate$E([Autowired("navigationService")],FocusService.prototype,"navigationService",void 0);__decorate$E([Autowired("ctrlsService")],FocusService.prototype,"ctrlsService",void 0);__decorate$E([Autowired("filterManager")],FocusService.prototype,"filterManager",void 0);__decorate$E([Optional("advancedFilterService")],FocusService.prototype,"advancedFilterService",void 0);__decorate$E([PostConstruct],FocusService.prototype,"init",null);FocusService=FocusService_1=__decorate$E([Bean("focusService")],FocusService);var __decorate$D=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ColumnHoverService=class extends BeanStub{setMouseOver(e){this.selectedColumns=e;const t={type:Events.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(t)}clearMouseOver(){this.selectedColumns=null;const e={type:Events.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(e)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}};ColumnHoverService=__decorate$D([Bean("columnHoverService")],ColumnHoverService);var __decorate$C=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ColumnAnimationService=class extends BeanStub{constructor(){super(...arguments),this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}postConstruct(){this.ctrlsService.whenReady(e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gridOptionsService.get("suppressColumnMoveAnimation")||this.gridOptionsService.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush(()=>{this.active=!1})}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(e){if(this.executeNextFuncs.length===0&&this.executeLaterFuncs.length===0){e();return}const t=i=>{for(;i.length;){const n=i.pop();n&&n()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>t(this.executeNextFuncs),0),window.setTimeout(()=>{t(this.executeLaterFuncs),e()},200)})}};__decorate$C([Autowired("ctrlsService")],ColumnAnimationService.prototype,"ctrlsService",void 0);__decorate$C([PostConstruct],ColumnAnimationService.prototype,"postConstruct",null);ColumnAnimationService=__decorate$C([Bean("columnAnimationService")],ColumnAnimationService);var __decorate$B=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let PaginationAutoPageSizeService=class extends BeanStub{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCon=e.centerRowContainerCtrl,this.addManagedListener(this.eventService,Events.EVENT_BODY_HEIGHT_CHANGED,this.checkPageSize.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_SCROLL_VISIBILITY_CHANGED,this.checkPageSize.bind(this)),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gridOptionsService.get("paginationAutoPageSize")||this.centerRowContainerCon==null}onPaginationAutoSizeChanged(){this.notActive()?this.paginationProxy.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowContainerCon.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const i=this.gridOptionsService.getRowHeightAsNumber(),n=Math.floor(e/i);this.paginationProxy.setPageSize(n,"autoCalculated")};this.isBodyRendered?debounce(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};__decorate$B([Autowired("ctrlsService")],PaginationAutoPageSizeService.prototype,"ctrlsService",void 0);__decorate$B([Autowired("paginationProxy")],PaginationAutoPageSizeService.prototype,"paginationProxy",void 0);__decorate$B([PostConstruct],PaginationAutoPageSizeService.prototype,"postConstruct",null);PaginationAutoPageSizeService=__decorate$B([Bean("paginationAutoPageSizeService")],PaginationAutoPageSizeService);var __decorate$A=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ValueCache=class extends BeanStub{constructor(){super(...arguments),this.cacheVersion=0}init(){this.active=this.gridOptionsService.get("valueCache"),this.neverExpires=this.gridOptionsService.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(!(!this.active||e.__cacheVersion!==this.cacheVersion))return e.__cacheData[t]}};__decorate$A([PostConstruct],ValueCache.prototype,"init",null);ValueCache=__decorate$A([Bean("valueCache")],ValueCache);var __decorate$z=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const SOURCE_PASTE="paste";let ChangeDetectionService=class extends BeanStub{init(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,Events.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))}onCellValueChanged(e){e.source!==SOURCE_PASTE&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gridOptionsService.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const n=this.gridOptionsService.get("aggregateOnlyChangedColumns"),o=new ChangedPath(n,this.clientSideRowModel.getRootNode());o.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(o),o.forEachChangedNodeDepthFirst(r=>{i.push(r)})}this.rowRenderer.refreshCells({rowNodes:i})}};__decorate$z([Autowired("rowModel")],ChangeDetectionService.prototype,"rowModel",void 0);__decorate$z([Autowired("rowRenderer")],ChangeDetectionService.prototype,"rowRenderer",void 0);__decorate$z([PostConstruct],ChangeDetectionService.prototype,"init",null);ChangeDetectionService=__decorate$z([Bean("changeDetectionService")],ChangeDetectionService);var __decorate$y=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let AgComponentUtils=class extends BeanStub{adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){class t{refresh(n){return!1}getGui(){return this.eGui}init(n){const o=e(n),r=typeof o;if(r==="string"||r==="number"||r==="boolean"){this.eGui=loadTemplate("<span>"+o+"</span>");return}if(o==null){this.eGui=loadTemplate("<span></span>");return}this.eGui=o}}return t}doesImplementIComponent(e){return e?e.prototype&&"getGui"in e.prototype:!1}};__decorate$y([Autowired("componentMetadataProvider")],AgComponentUtils.prototype,"componentMetadataProvider",void 0);AgComponentUtils=__decorate$y([Bean("agComponentUtils")],AgComponentUtils);var __decorate$x=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ComponentMetadataProvider=class extends BeanStub{postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[]},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}};__decorate$x([Autowired("agComponentUtils")],ComponentMetadataProvider.prototype,"agComponentUtils",void 0);__decorate$x([PostConstruct],ComponentMetadataProvider.prototype,"postConstruct",null);ComponentMetadataProvider=__decorate$x([Bean("componentMetadataProvider")],ComponentMetadataProvider);var __decorate$w=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const DEFAULT_ROW_HEIGHT=25,MIN_COL_WIDTH=10,MAT_GRID_SIZE=8,BASE_GRID_SIZE=4,BALHAM_GRID_SIZE=4,ALPINE_GRID_SIZE=6,QUARTZ_ICON_SIZE=16,QUARTZ_FONT_SIZE=14,QUARTZ_GRID_SIZE=8,HARD_CODED_SIZES={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:BASE_GRID_SIZE*5,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:MAT_GRID_SIZE*7,headerCellMinWidth:48,listItemHeight:MAT_GRID_SIZE*4,rowHeight:MAT_GRID_SIZE*6,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:BALHAM_GRID_SIZE*8,headerCellMinWidth:24,listItemHeight:BALHAM_GRID_SIZE*6,rowHeight:BALHAM_GRID_SIZE*7,chartMenuPanelWidth:220},"ag-theme-alpine":{headerHeight:ALPINE_GRID_SIZE*8,headerCellMinWidth:36,listItemHeight:ALPINE_GRID_SIZE*4,rowHeight:ALPINE_GRID_SIZE*7,chartMenuPanelWidth:240},"ag-theme-quartz":{headerHeight:QUARTZ_FONT_SIZE+QUARTZ_GRID_SIZE*4.25,headerCellMinWidth:36,listItemHeight:QUARTZ_ICON_SIZE+QUARTZ_GRID_SIZE,rowHeight:QUARTZ_FONT_SIZE+QUARTZ_GRID_SIZE*3.5,chartMenuPanelWidth:260}},SASS_PROPERTY_BUILDER={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]};let Environment=class extends BeanStub{constructor(){super(...arguments),this.calculatedSizes={}}postConstruct(){var e;const t=(e=this.getTheme().el)!==null&&e!==void 0?e:this.eGridDiv;this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.mutationObserver=new MutationObserver(()=>{this.calculatedSizes={},this.fireGridStylesChangedEvent()}),this.mutationObserver.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]})}fireGridStylesChangedEvent(){const e={type:Events.EVENT_GRID_STYLES_CHANGED};this.eventService.dispatchEvent(e)}getSassVariable(e){const{themeFamily:t,el:i}=this.getTheme();if(!t||t.indexOf("ag-theme")!==0)return;this.calculatedSizes||(this.calculatedSizes={}),this.calculatedSizes[t]||(this.calculatedSizes[t]={});const n=this.calculatedSizes[t][e];return n??(this.calculatedSizes[t][e]=this.calculateValueForSassProperty(e,t,i),this.calculatedSizes[t][e])}calculateValueForSassProperty(e,t,i){const n="ag-theme-"+(t.match("material")?"material":t.match("balham")?"balham":t.match("alpine")?"alpine":"custom"),o=HARD_CODED_SIZES[n][e],r=this.gridOptionsService.getDocument();if(i||(i=this.eGridDiv),!SASS_PROPERTY_BUILDER[e])return o;const a=SASS_PROPERTY_BUILDER[e],l=r.createElement("div"),d=Array.from(i.classList);l.classList.add(t,...d),l.style.position="absolute";const h=a.reduce((m,v)=>{const y=r.createElement("div");return y.style.position="static",y.classList.add(v),m.appendChild(y),y},l);let p=0;if(r.body){r.body.appendChild(l);const m=e.toLowerCase().indexOf("height")!==-1?"height":"width";p=parseInt(window.getComputedStyle(h)[m],10),r.body.removeChild(l)}return p||o}isThemeDark(){const{theme:e}=this.getTheme();return!!e&&e.indexOf("dark")>=0}chartMenuPanelWidth(){return this.getSassVariable("chartMenuPanelWidth")}getTheme(){const e=/\bag-(material|(?:theme-([\w\-]*)))\b/g;let t=this.eGridDiv,i=null,n=[];for(;t;)if(i=e.exec(t.className),!i)t=t.parentElement||void 0;else{const r=t.className.match(e);r&&(n=r);break}if(!i)return{allThemes:n};const o=i[0];return{theme:o,el:t,themeFamily:o.replace(/-dark$/,""),allThemes:n}}getFromTheme(e,t){var i;return(i=this.getSassVariable(t))!==null&&i!==void 0?i:e}getDefaultRowHeight(){return this.getFromTheme(DEFAULT_ROW_HEIGHT,"rowHeight")}getListItemHeight(){return this.getFromTheme(20,"listItemHeight")}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gridOptionsService.get("rowHeight");if(t==null||isNaN(t)||!isFinite(t))return e!==null&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):e!=""?parseFloat(e):-1}getMinColWidth(){const e=this.getFromTheme(null,"headerCellMinWidth");return exists(e)?Math.max(e,MIN_COL_WIDTH):MIN_COL_WIDTH}destroy(){this.calculatedSizes=null,this.mutationObserver&&this.mutationObserver.disconnect(),super.destroy()}};__decorate$w([Autowired("eGridDiv")],Environment.prototype,"eGridDiv",void 0);__decorate$w([PostConstruct],Environment.prototype,"postConstruct",null);Environment=__decorate$w([Bean("environment")],Environment);var __decorate$v=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},__param$1=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}};let RowContainerHeightService=class extends BeanStub{constructor(){super(...arguments),this.scrollY=0,this.uiBodyHeight=0}agWire(e){this.logger=e.create("RowContainerHeightService")}postConstruct(){this.addManagedListener(this.eventService,Events.EVENT_BODY_HEIGHT_CHANGED,this.updateOffset.bind(this)),this.maxDivHeight=getMaxDivHeight(),this.logger.log("maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,i=this.getUiBodyHeight();(t!==this.scrollY||i!==this.uiBodyHeight)&&(this.scrollY=t,this.uiBodyHeight=i,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.logger.log(`Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t=typeof e=="number"?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:Events.EVENT_HEIGHT_SCALE_CHANGED}))}setModelHeight(e){this.modelHeight=e,this.stretching=e!=null&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return t.bottom-t.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=this.modelHeight-this.getUiBodyHeight(),i=e/t;return this.maxScrollY*i}};__decorate$v([Autowired("ctrlsService")],RowContainerHeightService.prototype,"ctrlsService",void 0);__decorate$v([__param$1(0,Qualifier("loggerFactory"))],RowContainerHeightService.prototype,"agWire",null);__decorate$v([PostConstruct],RowContainerHeightService.prototype,"postConstruct",null);RowContainerHeightService=__decorate$v([Bean("rowContainerHeightService")],RowContainerHeightService);var __decorate$u=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let SelectableService=class extends BeanStub{init(){this.addManagedPropertyListener("isRowSelectable",()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const t=!!this.gridOptionsService.get("rowSelection"),i=this.gridOptionsService.get("isRowSelectable");if(!t||!i)return;const n=this.gridOptionsService.get("groupSelectsChildren"),o=this.rowModel.getType()==="clientSide"&&n,r=[],a=l=>{if(e&&!l.group)return;if(o&&l.group){const h=l.childrenAfterGroup.some(p=>p.selectable===!0);l.setRowSelectable(h,!0);return}const d=i?i(l):!0;l.setRowSelectable(d,!0),!d&&l.isSelected()&&r.push(l)};if(o){const l=this.rowModel;new ChangedPath(!1,l.getRootNode()).forEachChangedNodeDepthFirst(a,!0,!0)}else this.rowModel.forEachNode(a);r.length&&this.selectionService.setNodesSelected({nodes:r,newValue:!1,source:"selectableChanged"}),o&&this.selectionService instanceof SelectionService&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}};__decorate$u([Autowired("rowModel")],SelectableService.prototype,"rowModel",void 0);__decorate$u([Autowired("selectionService")],SelectableService.prototype,"selectionService",void 0);__decorate$u([PostConstruct],SelectableService.prototype,"init",null);SelectableService=__decorate$u([Bean("selectableService")],SelectableService);var __decorate$t=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class PaginationComp extends Component{constructor(){super(),this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1}postConstruct(){const e=this.gridOptionsService.get("enableRtl");this.setTemplate(this.getTemplate());const{btFirst:t,btPrevious:i,btNext:n,btLast:o,pageSizeComp:r}=this;this.activateTabIndex([t,i,n,o]),t.insertAdjacentElement("afterbegin",createIconNoSpan(e?"last":"first",this.gridOptionsService)),i.insertAdjacentElement("afterbegin",createIconNoSpan(e?"next":"previous",this.gridOptionsService)),n.insertAdjacentElement("afterbegin",createIconNoSpan(e?"previous":"next",this.gridOptionsService)),o.insertAdjacentElement("afterbegin",createIconNoSpan(e?"first":"last",this.gridOptionsService)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.onPaginationChanged()}onPaginationChanged(){const t=this.gridOptionsService.get("pagination")&&!this.gridOptionsService.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateRowLabels(),this.setCurrentPageLabel(),this.setTotalLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){this.areListenersSetup||(this.addManagedListener(this.eventService,Events.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach(e=>{const{el:t,fn:i}=e;this.addManagedListener(t,"click",i),this.addManagedListener(t,"keydown",n=>{(n.key===KeyCode.ENTER||n.key===KeyCode.SPACE)&&(n.preventDefault(),i())})}),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToFirstPage()}setCurrentPageLabel(){const e=this.paginationProxy.getTotalPages()>0,t=this.paginationProxy.getCurrentPage(),i=e?t+1:0;this.lbCurrent.textContent=this.formatNumber(i)}formatNumber(e){const t=this.gridOptionsService.getCallback("paginationNumberFormatter");if(t)return t({value:e});const i=this.localeService.getLocaleTextFunc(),n=i("thousandSeparator",","),o=i("decimalSeparator",".");return formatNumberCommas(e,n,o)}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),n=e("of","of"),o=e("firstPage","First Page"),r=e("previousPage","Previous Page"),a=e("nextPage","Next Page"),l=e("lastPage","Last Page"),d=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${d}">
|
||
<ag-page-size-selector ref="pageSizeComp"></ag-page-size-selector>
|
||
<span class="ag-paging-row-summary-panel" role="status">
|
||
<span id="ag-${d}-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>
|
||
<span id="ag-${d}-to">${i}</span>
|
||
<span id="ag-${d}-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>
|
||
<span id="ag-${d}-of">${n}</span>
|
||
<span id="ag-${d}-row-count" ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>
|
||
</span>
|
||
<span class="ag-paging-page-summary-panel" role="presentation">
|
||
<div ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>
|
||
<div ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>
|
||
<span class="ag-paging-description" role="status">
|
||
<span id="ag-${d}-start-page">${t}</span>
|
||
<span id="ag-${d}-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>
|
||
<span id="ag-${d}-of-page">${n}</span>
|
||
<span id="ag-${d}-of-page-number" ref="lbTotal" class="ag-paging-number"></span>
|
||
</span>
|
||
<div ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${a}"></div>
|
||
<div ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${l}"></div>
|
||
</span>
|
||
</div>`}onBtNext(){this.nextButtonDisabled||this.paginationProxy.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationProxy.goToLastPage()}enableOrDisableButtons(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.isLastPageFound(),i=this.paginationProxy.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const n=this.isZeroPagesToDisplay(),o=e===i-1;this.nextButtonDisabled=o||n,this.lastButtonDisabled=!t||n||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){setAriaDisabled(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.getPageSize(),i=this.paginationProxy.isLastPageFound(),n=this.paginationProxy.isLastPageFound()?this.paginationProxy.getMasterRowCount():null;let o,r;if(this.isZeroPagesToDisplay()?o=r=0:(o=t*e+1,r=o+t-1,i&&r>n&&(r=n)),this.lbFirstRowOnPage.textContent=this.formatNumber(o),this.rowNodeBlockLoader.isLoading()){const a=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=a("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(r)}isZeroPagesToDisplay(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages();return e&&t===0}setTotalLabels(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages(),i=e?this.paginationProxy.getMasterRowCount():null;if(i===1){const n=this.paginationProxy.getRow(0);if(n&&n.group&&!(n.groupData||n.aggData)){this.setTotalLabelsToZero();return}}if(e)this.lbTotal.textContent=this.formatNumber(t),this.lbRecordCount.textContent=this.formatNumber(i);else{const n=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=n,this.lbRecordCount.innerHTML=n}}setTotalLabelsToZero(){this.lbFirstRowOnPage.textContent=this.formatNumber(0),this.lbCurrent.textContent=this.formatNumber(0),this.lbLastRowOnPage.textContent=this.formatNumber(0),this.lbTotal.textContent=this.formatNumber(0),this.lbRecordCount.textContent=this.formatNumber(0)}}__decorate$t([Autowired("paginationProxy")],PaginationComp.prototype,"paginationProxy",void 0);__decorate$t([Autowired("rowNodeBlockLoader")],PaginationComp.prototype,"rowNodeBlockLoader",void 0);__decorate$t([RefSelector("btFirst")],PaginationComp.prototype,"btFirst",void 0);__decorate$t([RefSelector("btPrevious")],PaginationComp.prototype,"btPrevious",void 0);__decorate$t([RefSelector("btNext")],PaginationComp.prototype,"btNext",void 0);__decorate$t([RefSelector("btLast")],PaginationComp.prototype,"btLast",void 0);__decorate$t([RefSelector("lbRecordCount")],PaginationComp.prototype,"lbRecordCount",void 0);__decorate$t([RefSelector("lbFirstRowOnPage")],PaginationComp.prototype,"lbFirstRowOnPage",void 0);__decorate$t([RefSelector("lbLastRowOnPage")],PaginationComp.prototype,"lbLastRowOnPage",void 0);__decorate$t([RefSelector("lbCurrent")],PaginationComp.prototype,"lbCurrent",void 0);__decorate$t([RefSelector("lbTotal")],PaginationComp.prototype,"lbTotal",void 0);__decorate$t([RefSelector("pageSizeComp")],PaginationComp.prototype,"pageSizeComp",void 0);__decorate$t([PostConstruct],PaginationComp.prototype,"postConstruct",null);var __decorate$s=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class OverlayWrapperComponent extends Component{constructor(){super(OverlayWrapperComponent.TEMPLATE),this.inProgress=!1,this.destroyRequested=!1}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle(LayoutCssClasses.AUTO_HEIGHT,t.autoHeight),i.toggle(LayoutCssClasses.NORMAL,t.normal),i.toggle(LayoutCssClasses.PRINT,t.print)}postConstruct(){this.createManagedBean(new LayoutFeature(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.overlayService.registerOverlayWrapperComp(this)}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;this.activeOverlayWrapperCssClass&&t.toggle(this.activeOverlayWrapperCssClass,!1),this.activeOverlayWrapperCssClass=e,t.toggle(e,!0)}showOverlay(e,t,i){this.inProgress||(this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.inProgress=!0,e&&e.then(n=>{this.inProgress=!1,this.eOverlayWrapper.appendChild(n.getGui()),this.activeOverlay=n,this.updateListenerDestroyFunc=i,this.destroyRequested&&(this.destroyRequested=!1,this.destroyActiveOverlay())}),this.setDisplayed(!0,{skipAriaHidden:!0}))}destroyActiveOverlay(){var e;if(this.inProgress){this.destroyRequested=!0;return}this.activeOverlay&&(this.activeOverlay=this.getContext().destroyBean(this.activeOverlay),(e=this.updateListenerDestroyFunc)===null||e===void 0||e.call(this),clearElement(this.eOverlayWrapper))}hideOverlay(){this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}}OverlayWrapperComponent.TEMPLATE=`
|
||
<div class="ag-overlay" role="presentation">
|
||
<div class="ag-overlay-panel" role="presentation">
|
||
<div class="ag-overlay-wrapper" ref="eOverlayWrapper" role="presentation"></div>
|
||
</div>
|
||
</div>`;__decorate$s([Autowired("overlayService")],OverlayWrapperComponent.prototype,"overlayService",void 0);__decorate$s([RefSelector("eOverlayWrapper")],OverlayWrapperComponent.prototype,"eOverlayWrapper",void 0);__decorate$s([PostConstruct],OverlayWrapperComponent.prototype,"postConstruct",null);var __decorate$r=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let RowPositionUtils=class extends BeanStub{getFirstRow(){let e=0,t;return this.pinnedRowModel.getPinnedTopRowCount()?t="top":this.rowModel.getRowCount()?(t=null,e=this.paginationProxy.getPageFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(t="bottom"),t===void 0?null:{rowIndex:e,rowPinned:t}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),n=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.paginationProxy.getPageLastRow()):n&&(t="top",e=n-1),e===void 0?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t?!0:e&&!t||!e&&t?!1:e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}before(e,t){switch(e.rowPinned){case"top":if(t.rowPinned!=="top")return!0;break;case"bottom":if(t.rowPinned!=="bottom")return!1;break;default:if(exists(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex<t.rowIndex}rowMax(e){let t;return e.forEach(i=>{(t===void 0||this.before(t,i))&&(t=i)}),t}rowMin(e){let t;return e.forEach(i=>{(t===void 0||this.before(i,t))&&(t=i)}),t}};__decorate$r([Autowired("rowModel")],RowPositionUtils.prototype,"rowModel",void 0);__decorate$r([Autowired("pinnedRowModel")],RowPositionUtils.prototype,"pinnedRowModel",void 0);__decorate$r([Autowired("paginationProxy")],RowPositionUtils.prototype,"paginationProxy",void 0);RowPositionUtils=__decorate$r([Bean("rowPositionUtils")],RowPositionUtils);var __decorate$q=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let CellPositionUtils=class extends BeanStub{createId(e){const{rowIndex:t,rowPinned:i,column:n}=e;return this.createIdFromValues({rowIndex:t,column:n,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:n}=e;return`${t}.${i??"null"}.${n.getId()}`}equals(e,t){const i=e.column===t.column,n=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return i&&n&&o}};CellPositionUtils=__decorate$q([Bean("cellPositionUtils")],CellPositionUtils);class UndoRedoAction{constructor(e){this.cellValueChanges=e}}class RangeUndoRedoAction extends UndoRedoAction{constructor(e,t,i,n){super(e),this.initialRange=t,this.finalRange=i,this.ranges=n}}class UndoRedoStack{constructor(e){this.actionStack=[],this.maxStackSize=e||UndoRedoStack.DEFAULT_STACK_SIZE,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}}UndoRedoStack.DEFAULT_STACK_SIZE=10;var __decorate$p=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let UndoRedoService=class extends BeanStub{constructor(){super(...arguments),this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=this.activeCellEdit!==null&&this.cellPositionUtils.equals(this.activeCellEdit,t),n=this.activeRowEdit!==null&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||n||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:a,column:l,oldValue:d,value:h}=e,p={rowPinned:r,rowIndex:a,columnId:l.getColId(),newValue:h,oldValue:d};this.cellValueChanges.push(p)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}init(){if(!this.gridOptionsService.get("undoRedoCellEditing"))return;const e=this.gridOptionsService.get("undoRedoCellEditingLimit");e<=0||(this.undoStack=new UndoRedoStack(e),this.redoStack=new UndoRedoStack(e),this.addRowEditingListeners(),this.addCellEditingListeners(),this.addPasteListeners(),this.addFillListeners(),this.addCellKeyListeners(),this.addManagedListener(this.eventService,Events.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged),this.addManagedListener(this.eventService,Events.EVENT_MODEL_UPDATED,t=>{t.keepUndoRedoStack||this.clearStacks()}),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,Events.EVENT_NEW_COLUMNS_LOADED,this.clearStacks),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_GROUP_OPENED,this.clearStacks),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_MOVED,this.clearStacks),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_PINNED,this.clearStacks),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_VISIBLE,this.clearStacks),this.addManagedListener(this.eventService,Events.EVENT_ROW_DRAG_END,this.clearStacks),this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl()}))}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){const t={type:Events.EVENT_UNDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo"),n={type:Events.EVENT_UNDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(n)}redo(e){const t={type:Events.EVENT_REDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo"),n={type:Events.EVENT_REDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(n)}undoRedo(e,t,i,n,o){if(!e)return!1;const r=e.pop();return!r||!r.cellValueChanges?!1:(this.processAction(r,a=>a[n],o),r instanceof RangeUndoRedoAction?this.processRange(r.ranges||[r[i]]):this.processCell(r.cellValueChanges),t.push(r),!0)}processAction(e,t,i){e.cellValueChanges.forEach(n=>{const{rowIndex:o,rowPinned:r,columnId:a}=n,l={rowIndex:o,rowPinned:r},d=this.getRowNode(l);d.displayed&&d.setDataValue(a,t(n),i)})}processRange(e){let t;this.rangeService.removeAllCellRanges(!0),e.forEach((i,n)=>{if(!i)return;const o=i.startRow,r=i.endRow;n===e.length-1&&(t={rowPinned:o.rowPinned,rowIndex:o.rowIndex,columnId:i.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:i.startColumn,columns:i.columns};this.rangeService.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:n}=t,o={rowIndex:i,rowPinned:n},r=this.getRowNode(o),a={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(a,!!this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:n,rowPinned:o}=e,r=this.gridBodyCtrl.getScrollFeature(),a=this.columnModel.getGridColumn(n);if(!a)return;r.ensureIndexVisible(i),r.ensureColumnVisible(a);const l={rowIndex:i,column:a,rowPinned:o};this.focusService.setFocusedCell(Object.assign(Object.assign({},l),{forceBrowserFocus:!0})),t&&this.rangeService.setRangeToCell(l)}addRowEditingListeners(){this.addManagedListener(this.eventService,Events.EVENT_ROW_EDITING_STARTED,e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,Events.EVENT_ROW_EDITING_STOPPED,()=>{const e=new UndoRedoAction(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null})}addCellEditingListeners(){this.addManagedListener(this.eventService,Events.EVENT_CELL_EDITING_STARTED,e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,Events.EVENT_CELL_EDITING_STOPPED,e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const i=new UndoRedoAction(this.cellValueChanges);this.pushActionsToUndoStack(i)}})}addPasteListeners(){this.addManagedListener(this.eventService,Events.EVENT_PASTE_START,()=>{this.isPasting=!0}),this.addManagedListener(this.eventService,Events.EVENT_PASTE_END,()=>{const e=new UndoRedoAction(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1})}addFillListeners(){this.addManagedListener(this.eventService,Events.EVENT_FILL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,Events.EVENT_FILL_END,e=>{const t=new RangeUndoRedoAction(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1})}addCellKeyListeners(){this.addManagedListener(this.eventService,Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,()=>{let e;this.rangeService&&this.gridOptionsService.get("enableRangeSelection")?e=new RangeUndoRedoAction(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):e=new UndoRedoAction(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}};__decorate$p([Autowired("focusService")],UndoRedoService.prototype,"focusService",void 0);__decorate$p([Autowired("ctrlsService")],UndoRedoService.prototype,"ctrlsService",void 0);__decorate$p([Autowired("rowModel")],UndoRedoService.prototype,"rowModel",void 0);__decorate$p([Autowired("pinnedRowModel")],UndoRedoService.prototype,"pinnedRowModel",void 0);__decorate$p([Autowired("cellPositionUtils")],UndoRedoService.prototype,"cellPositionUtils",void 0);__decorate$p([Autowired("rowPositionUtils")],UndoRedoService.prototype,"rowPositionUtils",void 0);__decorate$p([Autowired("columnModel")],UndoRedoService.prototype,"columnModel",void 0);__decorate$p([Optional("rangeService")],UndoRedoService.prototype,"rangeService",void 0);__decorate$p([PostConstruct],UndoRedoService.prototype,"init",null);UndoRedoService=__decorate$p([Bean("undoRedoService")],UndoRedoService);var __decorate$o=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let HeaderPositionUtils=class extends BeanStub{findHeader(e,t){let i,n,o;if(e.column instanceof ColumnGroup?(n=`getDisplayedGroup${t}`,i=this.columnModel[n](e.column)):(o=`getDisplayedCol${t}`,i=this.columnModel[o](e.column)),!i)return;let{headerRowIndex:r}=e;if(this.getHeaderRowType(r)!==HeaderRowType.FLOATING_FILTER){const d=[i];for(;i.getParent();)i=i.getParent(),d.push(i);i=d[d.length-1-r]}const{column:a,headerRowIndex:l}=this.getHeaderIndexToFocus(i,r);return{column:a,headerRowIndex:l}}getHeaderIndexToFocus(e,t){let i;if(e instanceof ColumnGroup&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const n=e;i=n.getLeafColumns()[0];let o=i;for(;o!==n;)t++,o=o.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return e?e.getLeafColumns().some(t=>t.isSpanHeaderHeight()):!1}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),n=i===HeaderRowType.FLOATING_FILTER,o=i===HeaderRowType.COLUMN;let r=n?e:e.getParent(),a=t-1,l=a;if(o&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;r&&r.isPadding();)r=r.getParent(),a--;l=a,a<0&&(r=e,a=t,l=void 0)}return{column:r,headerRowIndex:a,headerRowIndexWithoutSpan:l}}getColumnVisibleChild(e,t,i="After"){const n=this.getHeaderRowType(t);let o=e,r=t+1,a=r;if(n===HeaderRowType.COLUMN_GROUP){const l=e.getDisplayedLeafColumns(),d=i==="After"?l[0]:last(l),h=[];let p=d;for(;p.getParent()!==e;)p=p.getParent(),h.push(p);if(o=d,d.isSpanHeaderHeight())for(let m=h.length-1;m>=0;m--){const v=h[m];if(!v.isPadding()){o=v;break}r++}else o=last(h),o||(o=d)}return{column:o,headerRowIndex:r,headerRowIndexWithoutSpan:a}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.columnModel.getAllDisplayedColumns(),n=i[t==="start"?0:i.length-1];if(!n)return;const r=this.ctrlsService.getHeaderRowContainerCtrl(n.getPinned()).getRowType(e);if(r==HeaderRowType.COLUMN_GROUP){const a=this.columnModel.getColumnGroupAtLevel(n,e);return{headerRowIndex:e,column:a}}return{headerRowIndex:r==null?-1:e,column:n}}};__decorate$o([Autowired("columnModel")],HeaderPositionUtils.prototype,"columnModel",void 0);__decorate$o([Autowired("ctrlsService")],HeaderPositionUtils.prototype,"ctrlsService",void 0);HeaderPositionUtils=__decorate$o([Bean("headerPositionUtils")],HeaderPositionUtils);var __decorate$n=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ColumnDefFactory=class{buildColumnDefs(e,t,i){const n=[],o={};return e.forEach(r=>{const a=this.createDefFromColumn(r,t,i);let l=!0,d=a,h=r.getOriginalParent(),p=null;for(;h;){let m=null;if(h.isPadding()){h=h.getOriginalParent();continue}const v=o[h.getGroupId()];if(v){v.children.push(d),l=!1;break}if(m=this.createDefFromGroup(h),m&&(m.children=[d],o[m.groupId]=m,d=m,h=h.getOriginalParent()),h!=null&&p===h){l=!1;break}p=h}l&&n.push(d)}),n}createDefFromGroup(e){const t=deepCloneDefinition(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const n=deepCloneDefinition(e.getColDef());return n.colId=e.getColId(),n.width=e.getActualWidth(),n.rowGroup=e.isRowGroupActive(),n.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,n.pivot=e.isPivotActive(),n.pivotIndex=e.isPivotActive()?i.indexOf(e):null,n.aggFunc=e.isValueActive()?e.getAggFunc():null,n.hide=e.isVisible()?void 0:!0,n.pinned=e.isPinned()?e.getPinned():null,n.sort=e.getSort()?e.getSort():null,n.sortIndex=e.getSortIndex()!=null?e.getSortIndex():null,n}};ColumnDefFactory=__decorate$n([Bean("columnDefFactory")],ColumnDefFactory);var __decorate$m=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let RowCssClassCalculator=class{getInitialRowClasses(e){const t=[];return exists(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),pushAll(t,this.processClassesFromGridOptions(e.rowNode)),pushAll(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&(e.pinned==="left"&&t.push("ag-cell-last-left-pinned"),e.pinned==="right"&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=r=>{typeof r=="string"?t.push(r):Array.isArray(r)&&r.forEach(a=>t.push(a))},n=this.gridOptionsService.get("rowClass");if(n){if(typeof n=="function")return console.warn("AG Grid: rowClass should not be a function, please use getRowClass instead"),[];i(n)}const o=this.gridOptionsService.getCallback("getRowClass");if(o){const r={data:e.data,node:e,rowIndex:e.rowIndex},a=o(r);i(a)}return t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,i=>{t.push(i)},i=>{}),t}processRowClassRules(e,t,i){const n=this.gridOptionsService.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gridOptionsService.get("rowClassRules"),n,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}};__decorate$m([Autowired("stylingService")],RowCssClassCalculator.prototype,"stylingService",void 0);__decorate$m([Autowired("gridOptionsService")],RowCssClassCalculator.prototype,"gridOptionsService",void 0);RowCssClassCalculator=__decorate$m([Bean("rowCssClassCalculator")],RowCssClassCalculator);var __decorate$l=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let RowNodeSorter=class extends BeanStub{init(){this.isAccentedSort=this.gridOptionsService.get("accentedSort"),this.primaryColumnsSortGroups=this.gridOptionsService.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=this.gridOptionsService.isColumnsSortingCoupledToGroup())}doFullSort(e,t){const i=(o,r)=>({currentPos:r,rowNode:o}),n=e.map(i);return n.sort(this.compareRowNodes.bind(this,t)),n.map(o=>o.rowNode)}compareRowNodes(e,t,i){const n=t.rowNode,o=i.rowNode;for(let r=0,a=e.length;r<a;r++){const l=e[r],d=l.sort==="desc",h=this.getValue(n,l.column),p=this.getValue(o,l.column);let m;const v=this.getComparator(l,n);if(v?m=v(h,p,n,o,d):m=_.defaultComparator(h,p,this.isAccentedSort),!isNaN(m)&&m!==0)return l.sort==="asc"?m:m*-1}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,n=i.getColDef().comparator;if(n!=null)return n;if(!i.getColDef().showRowGroup)return;const o=!t.group&&i.getColDef().field;if(!o)return;const r=this.columnModel.getPrimaryColumn(o);if(r)return r.getColDef().comparator}getValue(e,t){var i,n;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotActive())){const l=(i=e.allLeafChildren)===null||i===void 0?void 0:i[0];return l?this.valueService.getValue(t,l,!1,!1):void 0}const a=this.columnModel.getGroupDisplayColumnForGroup(t.getId());return a?(n=e.groupData)===null||n===void 0?void 0:n[a.getId()]:void 0}if(!(e.group&&t.getColDef().showRowGroup))return this.valueService.getValue(t,e,!1,!1)}};__decorate$l([Autowired("valueService")],RowNodeSorter.prototype,"valueService",void 0);__decorate$l([Autowired("columnModel")],RowNodeSorter.prototype,"columnModel",void 0);__decorate$l([PostConstruct],RowNodeSorter.prototype,"init",null);RowNodeSorter=__decorate$l([Bean("rowNodeSorter")],RowNodeSorter);var __decorate$k=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},CtrlsService_1;let CtrlsService=CtrlsService_1=class extends BeanStub{constructor(){super(...arguments),this.ready=!1,this.readyCallbacks=[]}checkReady(){if(this.ready=this.gridCtrl!=null&&this.gridBodyCtrl!=null&&this.centerRowContainerCtrl!=null&&this.leftRowContainerCtrl!=null&&this.rightRowContainerCtrl!=null&&this.bottomCenterRowContainerCtrl!=null&&this.bottomLeftRowContainerCtrl!=null&&this.bottomRightRowContainerCtrl!=null&&this.topCenterRowContainerCtrl!=null&&this.topLeftRowContainerCtrl!=null&&this.topRightRowContainerCtrl!=null&&this.stickyTopCenterRowContainerCtrl!=null&&this.stickyTopLeftRowContainerCtrl!=null&&this.stickyTopRightRowContainerCtrl!=null&&this.centerHeaderRowContainerCtrl!=null&&this.leftHeaderRowContainerCtrl!=null&&this.rightHeaderRowContainerCtrl!=null&&this.fakeHScrollComp!=null&&this.fakeVScrollComp!=null&&this.gridHeaderCtrl!=null,this.ready){const e=this.createReadyParams();this.readyCallbacks.forEach(t=>t(e)),this.readyCallbacks.length=0}}whenReady(e){this.ready?e(this.createReadyParams()):this.readyCallbacks.push(e)}createReadyParams(){return{centerRowContainerCtrl:this.centerRowContainerCtrl,leftRowContainerCtrl:this.leftRowContainerCtrl,rightRowContainerCtrl:this.rightRowContainerCtrl,bottomCenterRowContainerCtrl:this.bottomCenterRowContainerCtrl,bottomLeftRowContainerCtrl:this.bottomLeftRowContainerCtrl,bottomRightRowContainerCtrl:this.bottomRightRowContainerCtrl,topCenterRowContainerCtrl:this.topCenterRowContainerCtrl,topLeftRowContainerCtrl:this.topLeftRowContainerCtrl,topRightRowContainerCtrl:this.topRightRowContainerCtrl,stickyTopCenterRowContainerCtrl:this.stickyTopCenterRowContainerCtrl,stickyTopLeftRowContainerCtrl:this.stickyTopLeftRowContainerCtrl,stickyTopRightRowContainerCtrl:this.stickyTopRightRowContainerCtrl,centerHeaderRowContainerCtrl:this.centerHeaderRowContainerCtrl,leftHeaderRowContainerCtrl:this.leftHeaderRowContainerCtrl,rightHeaderRowContainerCtrl:this.rightHeaderRowContainerCtrl,fakeHScrollComp:this.fakeHScrollComp,fakeVScrollComp:this.fakeVScrollComp,gridBodyCtrl:this.gridBodyCtrl,gridCtrl:this.gridCtrl,gridHeaderCtrl:this.gridHeaderCtrl}}registerFakeHScrollComp(e){this.fakeHScrollComp=e,this.checkReady()}registerFakeVScrollComp(e){this.fakeVScrollComp=e,this.checkReady()}registerGridHeaderCtrl(e){this.gridHeaderCtrl=e,this.checkReady()}registerCenterRowContainerCtrl(e){this.centerRowContainerCtrl=e,this.checkReady()}registerLeftRowContainerCtrl(e){this.leftRowContainerCtrl=e,this.checkReady()}registerRightRowContainerCtrl(e){this.rightRowContainerCtrl=e,this.checkReady()}registerTopCenterRowContainerCtrl(e){this.topCenterRowContainerCtrl=e,this.checkReady()}registerTopLeftRowContainerCon(e){this.topLeftRowContainerCtrl=e,this.checkReady()}registerTopRightRowContainerCtrl(e){this.topRightRowContainerCtrl=e,this.checkReady()}registerStickyTopCenterRowContainerCtrl(e){this.stickyTopCenterRowContainerCtrl=e,this.checkReady()}registerStickyTopLeftRowContainerCon(e){this.stickyTopLeftRowContainerCtrl=e,this.checkReady()}registerStickyTopRightRowContainerCtrl(e){this.stickyTopRightRowContainerCtrl=e,this.checkReady()}registerBottomCenterRowContainerCtrl(e){this.bottomCenterRowContainerCtrl=e,this.checkReady()}registerBottomLeftRowContainerCtrl(e){this.bottomLeftRowContainerCtrl=e,this.checkReady()}registerBottomRightRowContainerCtrl(e){this.bottomRightRowContainerCtrl=e,this.checkReady()}registerHeaderContainer(e,t){switch(t){case"left":this.leftHeaderRowContainerCtrl=e;break;case"right":this.rightHeaderRowContainerCtrl=e;break;default:this.centerHeaderRowContainerCtrl=e;break}this.checkReady()}registerGridBodyCtrl(e){this.gridBodyCtrl=e,this.checkReady()}registerGridCtrl(e){this.gridCtrl=e,this.checkReady()}getFakeHScrollComp(){return this.fakeHScrollComp}getFakeVScrollComp(){return this.fakeVScrollComp}getGridHeaderCtrl(){return this.gridHeaderCtrl}getGridCtrl(){return this.gridCtrl}getCenterRowContainerCtrl(){return this.centerRowContainerCtrl}getTopCenterRowContainerCtrl(){return this.topCenterRowContainerCtrl}getBottomCenterRowContainerCtrl(){return this.bottomCenterRowContainerCtrl}getStickyTopCenterRowContainerCtrl(){return this.stickyTopCenterRowContainerCtrl}getGridBodyCtrl(){return this.gridBodyCtrl}getHeaderRowContainerCtrls(){return[this.leftHeaderRowContainerCtrl,this.rightHeaderRowContainerCtrl,this.centerHeaderRowContainerCtrl]}getHeaderRowContainerCtrl(e){switch(e){case"left":return this.leftHeaderRowContainerCtrl;case"right":return this.rightHeaderRowContainerCtrl;default:return this.centerHeaderRowContainerCtrl}}};CtrlsService.NAME="ctrlsService";CtrlsService=CtrlsService_1=__decorate$k([Bean(CtrlsService_1.NAME)],CtrlsService);var __decorate$j=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let CtrlsFactory=class extends BeanStub{constructor(){super(...arguments),this.registry={}}register(e){this.registry[e.controllerName]=e.controllerClass}getInstance(e){const t=this.registry[e];if(t!=null)return new t}};CtrlsFactory=__decorate$j([Bean("ctrlsFactory")],CtrlsFactory);var __decorate$i=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class AbstractFakeScrollComp extends Component{constructor(e,t){super(e),this.direction=t,this.hideTimeout=null}postConstruct(){this.addManagedListener(this.eventService,Events.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",isMacOsUserAgent()||isIOSUserAgent())}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.invisibleScrollbar=isInvisibleScrollbar(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=["mouseenter","mousedown","touchstart"],t=["mouseleave","touchend"],i=this.getGui();e.forEach(n=>this.addManagedListener(i,n,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0))),t.forEach(n=>this.addManagedListener(i,n,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1)))}onScrollVisibilityChanged(){this.invisibleScrollbar===void 0&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedListener(this.eventService,Events.EVENT_BODY_SCROLL,e=>{e.direction===this.direction&&(this.hideTimeout!==null&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))}),this.addManagedListener(this.eventService,Events.EVENT_BODY_SCROLL_END,()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)})}attemptSettingScrollPosition(e){const t=this.getViewport();waitUntil(()=>isVisible(t),()=>this.setScrollPosition(e),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedListener(this.getViewport(),"scroll",e)}}__decorate$i([RefSelector("eViewport")],AbstractFakeScrollComp.prototype,"eViewport",void 0);__decorate$i([RefSelector("eContainer")],AbstractFakeScrollComp.prototype,"eContainer",void 0);__decorate$i([Autowired("scrollVisibleService")],AbstractFakeScrollComp.prototype,"scrollVisibleService",void 0);__decorate$i([Autowired("ctrlsService")],AbstractFakeScrollComp.prototype,"ctrlsService",void 0);__decorate$i([Autowired("animationFrameService")],AbstractFakeScrollComp.prototype,"animationFrameService",void 0);var __decorate$h=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class FakeHScrollComp extends AbstractFakeScrollComp{constructor(){super(FakeHScrollComp.TEMPLATE,"horizontal")}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,Events.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.registerFakeHScrollComp(this),this.createManagedBean(new CenterWidthFeature(t=>this.eContainer.style.width=`${t}px`)),this.addManagedPropertyListeners(["suppressHorizontalScroll"],this.onScrollVisibilityChanged.bind(this))}initialiseInvisibleScrollbar(){this.invisibleScrollbar===void 0&&(this.enableRtl=this.gridOptionsService.get("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=`${e}px`}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.columnModel.getDisplayedColumnsRightWidth();const i=!this.enableRtl&&e,n=this.gridOptionsService.getScrollbarWidth();i&&(t+=n),setFixedWidth(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=n);let o=this.columnModel.getDisplayedColumnsLeftWidth();this.enableRtl&&e&&(o+=n),setFixedWidth(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=n)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gridOptionsService.get("suppressHorizontalScroll"),n=e&&this.gridOptionsService.getScrollbarWidth()||0,r=i?0:n===0&&t?16:n;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),setFixedHeight(this.getGui(),r),setFixedHeight(this.eViewport,r),setFixedHeight(this.eContainer,r),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return getScrollLeft(this.getViewport(),this.enableRtl)}setScrollPosition(e){isVisible(this.getViewport())||this.attemptSettingScrollPosition(e),setScrollLeft(this.getViewport(),e,this.enableRtl)}}FakeHScrollComp.TEMPLATE=`<div class="ag-body-horizontal-scroll" aria-hidden="true">
|
||
<div class="ag-horizontal-left-spacer" ref="eLeftSpacer"></div>
|
||
<div class="ag-body-horizontal-scroll-viewport" ref="eViewport">
|
||
<div class="ag-body-horizontal-scroll-container" ref="eContainer"></div>
|
||
</div>
|
||
<div class="ag-horizontal-right-spacer" ref="eRightSpacer"></div>
|
||
</div>`;__decorate$h([RefSelector("eLeftSpacer")],FakeHScrollComp.prototype,"eLeftSpacer",void 0);__decorate$h([RefSelector("eRightSpacer")],FakeHScrollComp.prototype,"eRightSpacer",void 0);__decorate$h([Autowired("columnModel")],FakeHScrollComp.prototype,"columnModel",void 0);__decorate$h([Autowired("pinnedRowModel")],FakeHScrollComp.prototype,"pinnedRowModel",void 0);__decorate$h([PostConstruct],FakeHScrollComp.prototype,"postConstruct",null);var __decorate$g=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let PinnedWidthService=class extends BeanStub{postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gridOptionsService.isDomLayout("print"),t=e?0:this.columnModel.getDisplayedColumnsLeftWidth(),i=e?0:this.columnModel.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:Events.EVENT_LEFT_PINNED_WIDTH_CHANGED})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}};__decorate$g([Autowired("columnModel")],PinnedWidthService.prototype,"columnModel",void 0);__decorate$g([PostConstruct],PinnedWidthService.prototype,"postConstruct",null);PinnedWidthService=__decorate$g([Bean("pinnedWidthService")],PinnedWidthService);var __decorate$f=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let RowNodeEventThrottle=class extends BeanStub{constructor(){super(...arguments),this.events=[]}postConstruct(){this.rowModel.getType()=="clientSide"&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e){if(this.clientSideRowModel==null){this.eventService.dispatchEvent(e);return}this.events.push(e);const t=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(i=>this.eventService.dispatchEvent(i)),this.events=[]};this.dispatchExpandedDebounced==null&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(t)),this.dispatchExpandedDebounced()}};__decorate$f([Autowired("animationFrameService")],RowNodeEventThrottle.prototype,"animationFrameService",void 0);__decorate$f([Autowired("rowModel")],RowNodeEventThrottle.prototype,"rowModel",void 0);__decorate$f([PostConstruct],RowNodeEventThrottle.prototype,"postConstruct",null);RowNodeEventThrottle=__decorate$f([Bean("rowNodeEventThrottle")],RowNodeEventThrottle);const COLUMN_DEFINITION_DEPRECATIONS={columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."}},CSRM_REQUIRES_ROW_GROUP_MODULE=(s,e)=>{var t;return((t=e.rowModelType)!==null&&t!==void 0?t:"clientSide")==="clientSide"?{module:ModuleNames.RowGroupingModule}:null},COLUMN_DEFINITION_VALIDATIONS={enableRowGroup:CSRM_REQUIRES_ROW_GROUP_MODULE,rowGroup:CSRM_REQUIRES_ROW_GROUP_MODULE,rowGroupIndex:CSRM_REQUIRES_ROW_GROUP_MODULE,enablePivot:CSRM_REQUIRES_ROW_GROUP_MODULE,enableValue:CSRM_REQUIRES_ROW_GROUP_MODULE,pivot:CSRM_REQUIRES_ROW_GROUP_MODULE,pivotIndex:CSRM_REQUIRES_ROW_GROUP_MODULE,aggFunc:CSRM_REQUIRES_ROW_GROUP_MODULE,cellEditor:s=>s.cellEditor==="agRichSelect"||s.cellEditor==="agRichSelectCellEditor"?{module:ModuleNames.RichSelectModule}:null,menuTabs:s=>{var e;const t=["columnsMenuTab","generalMenuTab"];return!((e=s.menuTabs)===null||e===void 0)&&e.some(i=>t.includes(i))?{module:ModuleNames.MenuModule}:null},columnsMenuParams:{module:[ModuleNames.MenuModule,ModuleNames.ColumnsToolPanelModule]},columnChooserParams:{module:[ModuleNames.MenuModule,ModuleNames.ColumnsToolPanelModule]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(s,{rowSelection:e})=>e==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(s,{rowSelection:e})=>e==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(s,{rowSelection:e})=>e==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>COL_DEF_VALIDATORS},COL_DEF_VALIDATORS={objectName:"colDef",allProperties:ColDefUtil.ALL_PROPERTIES,docsUrl:"column-properties/",deprecations:COLUMN_DEFINITION_DEPRECATIONS,validations:COLUMN_DEFINITION_VALIDATIONS},GRID_OPTION_DEPRECATIONS={enableChartToolPanelsButton:{version:"29",message:"The Chart Tool Panels button is now enabled by default. To hide the Chart Tool Panels button and display the hamburger button instead, set suppressChartToolPanelsButton=true."},functionsPassive:{version:"29.2"},onColumnRowGroupChangeRequest:{version:"29.2"},onColumnPivotChangeRequest:{version:"29.2"},onColumnValueChangeRequest:{version:"29.2"},onColumnAggFuncChangeRequest:{version:"29.2"},serverSideFilterAllLevels:{version:"30",message:"All server-side group levels are now filtered by default. This can be toggled using `serverSideOnlyRefreshFilteredGroups`."},suppressAggAtRootLevel:{version:"30",message:"The root level aggregation is now suppressed by default. This can be toggled using `alwaysAggregateAtRootLevel`."},excludeHiddenColumnsFromQuickFilter:{version:"30",message:"Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `includeHiddenColumnsInQuickFilter`."},enterMovesDown:{version:"30",renamed:"enterNavigatesVertically"},enterMovesDownAfterEdit:{version:"30",renamed:"enterNavigatesVerticallyAfterEdit"},suppressParentsInRowNodes:{version:"30.2",message:"Using suppressParentsInRowNodes is no longer recommended. To serialize nodes it is now recommended to instead remove the parent node reference before serialization."},advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"}},GRID_OPTION_DEFAULTS={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!1,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,suppressChartToolPanelsButton:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,functionsPassive:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1},GRID_OPTION_VALIDATIONS={sideBar:{module:ModuleNames.SideBarModule},statusBar:{module:ModuleNames.StatusBarModule},enableCharts:{module:ModuleNames.GridChartsModule},getMainMenuItems:{module:ModuleNames.MenuModule},getContextMenuItems:{module:ModuleNames.MenuModule},allowContextMenuWithControlKey:{module:ModuleNames.MenuModule},enableAdvancedFilter:{module:ModuleNames.AdvancedFilterModule},treeData:{supportedRowModels:["clientSide","serverSide"],module:ModuleNames.RowGroupingModule,dependencies:s=>{var e;const t=(e=s.rowModelType)!==null&&e!==void 0?e:"clientSide";switch(t){case"clientSide":const i=`treeData requires 'getDataPath' in the ${t} row model.`;return s.getDataPath?null:i;case"serverSide":const n=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${t} row model.`;return s.isServerSideGroup&&s.getServerSideGroupKey?null:n}return null}},masterDetail:{module:ModuleNames.MasterDetailModule},enableRangeSelection:{module:ModuleNames.RangeSelectionModule},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:s=>{var e;switch((e=s.rowModelType)!==null&&e!==void 0?e:"clientSide"){case"clientSide":return null;case"serverSide":const i="groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll";return s.suppressServerSideInfiniteScroll?i:null}return null}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},suppressParentsInRowNodes:{dependencies:{groupSelectsChildren:[void 0,!1]}},viewportDatasource:{supportedRowModels:["viewport"],module:ModuleNames.ViewportRowModelModule},serverSideDatasource:{supportedRowModels:["serverSide"],module:ModuleNames.ServerSideRowModelModule},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:ModuleNames.InfiniteRowModelModule},rowData:{supportedRowModels:["clientSide"],module:ModuleNames.ClientSideRowModelModule},columnDefs:()=>COL_DEF_VALIDATORS,defaultColDef:()=>COL_DEF_VALIDATORS,defaultColGroupDef:()=>COL_DEF_VALIDATORS,autoGroupColumnDef:()=>COL_DEF_VALIDATORS},GRID_OPTIONS_VALIDATORS={objectName:"gridOptions",allProperties:[...PropertyKeys.ALL_PROPERTIES,...ComponentUtil.EVENT_CALLBACKS],propertyExceptions:["api","columnApi"],docsUrl:"grid-options/",deprecations:GRID_OPTION_DEPRECATIONS,validations:GRID_OPTION_VALIDATIONS};var __decorate$e=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},GridOptionsService_1;let GridOptionsService=GridOptionsService_1=class{constructor(){this.destroyed=!1,this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new EventService,this.globalEventHandlerFactory=e=>(t,i)=>{if(this.destroyed)return;const n=GridOptionsService_1.alwaysSyncGlobalEvents.has(t);if(n&&!e||!n&&e)return;const o=ComponentUtil.getCallbackForEvent(t),r=this.gridOptions[o];typeof r=="function"&&this.frameworkOverrides.wrapOutgoing(()=>{r(i)})}}get context(){return this.gridOptions.context}init(){this.columnApi=new ColumnApi(this.api);const e=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),e),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth()}destroy(){this.destroyed=!0,this.columnApi=void 0}get(e){var t;return(t=this.gridOptions[e])!==null&&t!==void 0?t:GRID_OPTION_DEFAULTS[e]}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return exists(this.gridOptions[e])}mergeGridCommonParams(e){return e&&(i=>{const n=i;return n.api=this.api,n.columnApi=this.columnApi,n.context=this.context,e(n)})}static toBoolean(e){return typeof e=="boolean"?e:typeof e=="string"?e.toUpperCase()==="TRUE"||e=="":!1}static toNumber(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=parseInt(e);return isNaN(t)?void 0:t}}static toConstrainedNum(e,t){return i=>{const n=GridOptionsService_1.toNumber(i);if(!(n==null||n<e||n>t))return n}}static getCoercedValue(e,t){const i=GridOptionsService_1.PROPERTY_COERCIONS.get(e);return i?i(t):t}static getCoercedGridOptions(e){const t={};return Object.entries(e).forEach(([i,n])=>{const o=GridOptionsService_1.getCoercedValue(i,n);t[i]=o}),t}updateGridOptions({options:e,source:t="api"}){const i={id:GridOptionsService_1.changeSetId++,properties:[]},n=[];Object.entries(e).forEach(([o,r])=>{t==="api"&&INITIAL_GRID_OPTION_KEYS[o]&&warnOnce(`${o} is an initial property and cannot be updated.`);const a=GridOptionsService_1.getCoercedValue(o,r),l=typeof a=="object"&&t==="api",d=this.gridOptions[o];if(l||d!==a){this.gridOptions[o]=a;const h={type:o,currentValue:a,previousValue:d,changeSet:i,source:t};n.push(h)}}),this.validationService.processGridOptions(this.gridOptions),i.properties=n.map(o=>o.type),n.forEach(o=>{this.gridOptions.debug&&console.log(`AG Grid: Updated property ${o.type} from `,o.previousValue," to ",o.currentValue),this.propertyEventService.dispatchEvent(o)})}addEventListener(e,t){this.propertyEventService.addEventListener(e,t)}removeEventListener(e,t){this.propertyEventService.removeEventListener(e,t)}getScrollbarWidth(){if(this.scrollbarWidth==null){const t=typeof this.gridOptions.scrollbarWidth=="number"&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:getScrollbarWidth();t!=null&&(this.scrollbarWidth=t,this.eventService.dispatchEvent({type:Events.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth}isRowModelType(e){return this.gridOptions.rowModelType===e||e==="clientSide"&&missing(this.gridOptions.rowModelType)}isDomLayout(e){var t;return((t=this.gridOptions.domLayout)!==null&&t!==void 0?t:"normal")===e}isRowSelection(){return this.gridOptions.rowSelection==="single"||this.gridOptions.rowSelection==="multiple"}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return typeof this.gridOptions.getRowHeight=="function"}getRowHeightForNode(e,t=!1,i){if(i==null&&(i=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(t)return{height:i,estimated:!0};const o={node:e,data:e.data},r=this.getCallback("getRowHeight")(o);if(this.isNumeric(r))return r===0&&warnOnce("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,r),estimated:!1}}return e.detail&&this.get("masterDetail")?this.getMasterDetailRowHeight():{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:i,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||missing(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const e=this.environment.refreshRowHeightVariable();return e!==-1?e:(console.warn("AG Grid row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(e){return!isNaN(e)&&typeof e=="number"&&isFinite(e)}getDomDataKey(){return this.domDataKey}getDomData(e,t){const i=e[this.getDomDataKey()];return i?i[t]:void 0}setDomData(e,t,i){const n=this.getDomDataKey();let o=e[n];missing(o)&&(o={},e[n]=o),o[t]=i}getDocument(){let e=null;return this.gridOptions.getDocument&&exists(this.gridOptions.getDocument)?e=this.gridOptions.getDocument():this.eGridDiv&&(e=this.eGridDiv.ownerDocument),e&&exists(e)?e:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getAsyncTransactionWaitMillis(){return exists(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return this.get("ensureDomOrder")?!1:this.get("animateRows")}isGroupRowsSticky(){return!(this.get("suppressGroupRowsSticky")||this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){const e=this.gridOptions.autoGroupColumnDef;return!(e!=null&&e.comparator)&&!this.get("treeData")}getGroupAggFiltering(){const e=this.gridOptions.groupAggFiltering;if(typeof e=="function")return this.getCallback("groupAggFiltering");if(e===!0)return()=>!0}isGroupIncludeFooterTrueOrCallback(){const e=this.gridOptions.groupIncludeFooter;return e===!0||typeof e=="function"}getGroupIncludeFooter(){const e=this.gridOptions.groupIncludeFooter;return typeof e=="function"?this.getCallback("groupIncludeFooter"):e===!0?()=>!0:()=>!1}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?this.gridOptions.groupDisplayType==="multipleColumns":this.get("groupHideOpenParents")}isGroupUseEntireRow(e){return e?!1:this.gridOptions.groupDisplayType==="groupRows"}getGridCommonParams(){return{api:this.api,columnApi:this.columnApi,context:this.context}}addGridCommonParams(e){const t=e;return t.api=this.api,t.columnApi=this.columnApi,t.context=this.context,t}};GridOptionsService.alwaysSyncGlobalEvents=new Set([Events.EVENT_GRID_PRE_DESTROYED]);GridOptionsService.PROPERTY_COERCIONS=new Map([...PropertyKeys.BOOLEAN_PROPERTIES.map(s=>[s,GridOptionsService_1.toBoolean]),...PropertyKeys.NUMBER_PROPERTIES.map(s=>[s,GridOptionsService_1.toNumber]),["groupAggFiltering",s=>typeof s=="function"?s:GridOptionsService_1.toBoolean(s)],["pageSize",GridOptionsService_1.toConstrainedNum(1,Number.MAX_VALUE)],["autoSizePadding",GridOptionsService_1.toConstrainedNum(0,Number.MAX_VALUE)],["keepDetailRowsCount",GridOptionsService_1.toConstrainedNum(1,Number.MAX_VALUE)],["rowBuffer",GridOptionsService_1.toConstrainedNum(0,Number.MAX_VALUE)],["infiniteInitialRowCount",GridOptionsService_1.toConstrainedNum(1,Number.MAX_VALUE)],["cacheOverflowSize",GridOptionsService_1.toConstrainedNum(1,Number.MAX_VALUE)],["cacheBlockSize",GridOptionsService_1.toConstrainedNum(1,Number.MAX_VALUE)],["serverSideInitialRowCount",GridOptionsService_1.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelPageSize",GridOptionsService_1.toConstrainedNum(1,Number.MAX_VALUE)],["viewportRowModelBufferSize",GridOptionsService_1.toConstrainedNum(0,Number.MAX_VALUE)]]);GridOptionsService.changeSetId=0;__decorate$e([Autowired("gridOptions")],GridOptionsService.prototype,"gridOptions",void 0);__decorate$e([Autowired("eventService")],GridOptionsService.prototype,"eventService",void 0);__decorate$e([Autowired("environment")],GridOptionsService.prototype,"environment",void 0);__decorate$e([Autowired("frameworkOverrides")],GridOptionsService.prototype,"frameworkOverrides",void 0);__decorate$e([Autowired("eGridDiv")],GridOptionsService.prototype,"eGridDiv",void 0);__decorate$e([Autowired("validationService")],GridOptionsService.prototype,"validationService",void 0);__decorate$e([Autowired("gridApi")],GridOptionsService.prototype,"api",void 0);__decorate$e([PostConstruct],GridOptionsService.prototype,"init",null);__decorate$e([PreDestroy],GridOptionsService.prototype,"destroy",null);GridOptionsService=GridOptionsService_1=__decorate$e([Bean("gridOptionsService")],GridOptionsService);var __decorate$d=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let LocaleService=class extends BeanStub{getLocaleTextFunc(){const e=this.gridOptionsService.getCallback("getLocaleText");if(e)return(i,n,o)=>e({key:i,defaultValue:n,variableValues:o});const t=this.gridOptionsService.get("localeText");return(i,n,o)=>{let r=t&&t[i];if(r&&o&&o.length){let a=0;for(;!(a>=o.length||r.indexOf("${variable}")===-1);)r=r.replace("${variable}",o[a++])}return r??n}}};LocaleService=__decorate$d([Bean("localeService")],LocaleService);var __decorate$c=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class FakeVScrollComp extends AbstractFakeScrollComp{constructor(){super(FakeVScrollComp.TEMPLATE,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new SetHeightFeature(this.eContainer)),this.ctrlsService.registerFakeVScrollComp(this),this.addManagedListener(this.eventService,Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onRowContainerHeightChanged.bind(this))}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.gridOptionsService.getScrollbarWidth()||0,n=i===0&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),setFixedWidth(this.getGui(),n),setFixedWidth(this.eViewport,n),setFixedWidth(this.eContainer,n),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,i=e.getGridBodyCtrl().getBodyViewportElement(),n=this.getScrollPosition(),o=i.scrollTop;n!=o&&this.setScrollPosition(o,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,t){!t&&!isVisible(this.getViewport())&&this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}}FakeVScrollComp.TEMPLATE=`<div class="ag-body-vertical-scroll" aria-hidden="true">
|
||
<div class="ag-body-vertical-scroll-viewport" ref="eViewport">
|
||
<div class="ag-body-vertical-scroll-container" ref="eContainer"></div>
|
||
</div>
|
||
</div>`;__decorate$c([PostConstruct],FakeVScrollComp.prototype,"postConstruct",null);var __decorate$b=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};const MONTH_LOCALE_TEXT={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},MONTH_KEYS=["january","february","march","april","may","june","july","august","september","october","november","december"];let DataTypeService=class extends BeanStub{constructor(){super(...arguments),this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}init(){this.groupHideOpenParents=this.gridOptionsService.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gridOptionsService.get("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(convertSourceType(e.source))})}processDataTypeDefinitions(){var e;const t=this.getDefaultDataTypes();this.dataTypeDefinitions={},Object.entries(t).forEach(([n,o])=>{this.dataTypeDefinitions[n]=Object.assign(Object.assign({},o),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)})});const i=(e=this.gridOptionsService.get("dataTypeDefinitions"))!==null&&e!==void 0?e:{};this.dataTypeMatchers={},Object.entries(i).forEach(([n,o])=>{const r=this.processDataTypeDefinition(o,i,[n],t);r&&(this.dataTypeDefinitions[n]=r,o.dataTypeMatcher&&(this.dataTypeMatchers[n]=o.dataTypeMatcher))}),this.checkObjectValueHandlers(t),["dateString","text","number","boolean","date"].forEach(n=>{const o=this.dataTypeMatchers[n];o&&delete this.dataTypeMatchers[n],this.dataTypeMatchers[n]=o??t[n].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i=Object.assign(Object.assign({},e),t);return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...this.convertColumnTypes(e.columnTypes),...this.convertColumnTypes(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,n){let o;const r=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let a=n[r];const l=t[r];if(a&&l&&(a=l),!this.validateDataTypeDefinition(e,a,r))return;o=this.mergeDataTypeDefinitions(a,e)}else{if(i.includes(r)){warnOnce('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');return}const a=t[r];if(!this.validateDataTypeDefinition(e,a,r))return;const l=this.processDataTypeDefinition(a,t,[...i,r],n);if(!l)return;o=this.mergeDataTypeDefinitions(l,e)}return Object.assign(Object.assign({},o),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)})}validateDataTypeDefinition(e,t,i){return t?t.baseDataType!==e.baseDataType?(warnOnce('The "baseDataType" property of a data type definition must match that of its parent.'),!1):!0:(warnOnce(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{var i,n;if(!((i=t.node)===null||i===void 0)&&i.group){const o=t.column.getAggFunc();if(o){if(o==="first"||o==="last")return e.valueFormatter(t);if(e.baseDataType==="number"&&o!=="count"){if(typeof t.value=="number")return e.valueFormatter(t);if(typeof t.value=="object"){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter(Object.assign(Object.assign({},t),{value:t.value.toNumber()}));if("value"in t.value)return e.valueFormatter(Object.assign(Object.assign({},t),{value:t.value.value}))}}}if(!this.gridOptionsService.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()){if(typeof t.value!="string"||!((n=e.dataTypeMatcher)===null||n===void 0)&&n.call(e,t.value))return e.valueFormatter(t);if(!this.gridOptionsService.get("suppressGroupMaintainValueType"))return}return e.valueFormatter(t)}}updateColDefAndGetDataTypeDefinitionColumnType(e,t,i){let{cellDataType:n}=t;const{field:o}=t;if(n===void 0&&(n=e.cellDataType),(n==null||n===!0)&&(n=this.canInferCellDataType(e,t)?this.inferCellDataType(o,i):!1),!n){e.cellDataType=!1;return}const r=this.dataTypeDefinitions[n];if(!r){warnOnce(`Missing data type definition - "${n}"`);return}return e.cellDataType=n,r.groupSafeValueFormatter&&(e.valueFormatter=r.groupSafeValueFormatter),r.valueParser&&(e.valueParser=r.valueParser),r.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,r,i),r.columnTypes}updateColDefAndGetColumnType(e,t,i){var n,o;const r=this.updateColDefAndGetDataTypeDefinitionColumnType(e,t,i),a=(o=(n=t.type)!==null&&n!==void 0?n:r)!==null&&o!==void 0?o:e.type;return e.type=a,a?this.convertColumnTypes(a):void 0}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=n=>{t.add(n.key)};e.addEventListener(Column.EVENT_STATE_UPDATED,i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener(Column.EVENT_STATE_UPDATED,i))}canInferCellDataType(e,t){var i;if(this.rowModel.getType()!=="clientSide")return!1;const n={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,n))return!1;const o=t.type===null?e.type:t.type;if(o){const r=(i=this.gridOptionsService.get("columnTypes"))!==null&&i!==void 0?i:{};if(this.convertColumnTypes(o).some(l=>{const d=r[l.trim()];return d&&this.doColDefPropsPreventInference(d,n)}))return!1}return!this.doColDefPropsPreventInference(e,n)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,n])=>this.doesColDefPropPreventInference(e,t,i,n))}doesColDefPropPreventInference(e,t,i,n){if(!t[i])return!1;const o=e[i];return o===null?(t[i]=!1,!1):n===void 0?!!o:o===n}inferCellDataType(e,t){var i;if(!e)return;let n;const o=this.getInitialData();if(o){const a=e.indexOf(".")>=0&&!this.gridOptionsService.get("suppressFieldDotNotation");n=getValueUsingField(o,e,a)}else this.initWaitForRowData(t);if(n==null)return;const[r]=(i=Object.entries(this.dataTypeMatchers).find(([a,l])=>l(n)))!==null&&i!==void 0?i:["object"];return r}getInitialData(){const e=this.gridOptionsService.get("rowData");if(e!=null&&e.length)return e[0];if(this.initialData)return this.initialData;{const t=this.rowModel.getRootNode().allLeafChildren;if(t!=null&&t.length)return t[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const i=this.addManagedListener(this.eventService,Events.EVENT_ROW_DATA_UPDATE_STARTED,n=>{const{firstRowData:o}=n;if(!o)return;i==null||i(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(o,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations();const r={type:Events.EVENT_DATA_TYPES_INFERRED};this.eventService.dispatchEvent(r)})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.columnStateUpdateListenerDestroyFuncs.forEach(r=>r()),this.columnStateUpdateListenerDestroyFuncs=[];const n={},o={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([r,a])=>{const l=this.columnModel.getGridColumn(r);if(!l)return;const d=l.getColDef();if(!this.columnModel.resetColumnDefIntoColumn(l,"cellDataTypeInferred"))return;const h=l.getColDef();if(t&&h.type&&h.type!==d.type){const p=this.getUpdatedColumnState(l,a);p.rowGroup&&p.rowGroupIndex==null&&(n[r]=p),p.pivot&&p.pivotIndex==null&&(o[r]=p),i.push(p)}}),t&&i.push(...this.columnModel.generateColumnStateForRowGroupAndPivotIndexes(n,o)),i.length&&this.columnModel.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnModel.getColumnStateFromColDef(e);return t.forEach(n=>{delete i[n],n==="rowGroup"?delete i.rowGroupIndex:n==="pivot"&&delete i.pivotIndex}),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}convertColumnTypes(e){let t=[];return e instanceof Array?e.some(n=>typeof n!="string")?console.warn("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:typeof e=="string"?t=e.split(","):console.warn("colDef.type should be of type 'string' | 'string[]'"),t}getDateStringTypeDefinition(e){var t;return e?(t=this.getDataTypeDefinition(e))!==null&&t!==void 0?t:this.dataTypeDefinitions.dateString:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){var t;return(t=this.getDataTypeDefinition(e))===null||t===void 0?void 0:t.baseDataType}checkType(e,t){var i;if(t==null)return!0;const n=(i=this.getDataTypeDefinition(e))===null||i===void 0?void 0:i.dataTypeMatcher;return n?n(t):!0}validateColDef(e){e.cellDataType==="object"&&(e.valueFormatter===this.dataTypeDefinitions.object.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&warnOnce('Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&warnOnce('Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'))}setColDefPropertiesForBaseDataType(e,t,i){const n=(l,d,h)=>{let p=l.getColDef().valueFormatter;return p===t.groupSafeValueFormatter&&(p=t.valueFormatter),this.valueFormatterService.formatValue(l,d,h,p)},o=ModuleRegistry.__isRegistered(ModuleNames.SetFilterModule,this.context.getGridId()),r=this.localeService.getLocaleTextFunc(),a=l=>{const{filterParams:d}=e;e.filterParams=typeof d=="object"?Object.assign(Object.assign({},d),l):l};switch(t.baseDataType){case"number":{e.cellEditor="agNumberCellEditor",o&&a({comparator:(l,d)=>{const h=l==null?0:parseInt(l),p=d==null?0:parseInt(d);return h===p?0:h>p?1:-1}});break}case"boolean":{e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=l=>!!l.colDef.editable&&l.event.key===KeyCode.SPACE,a(o?{valueFormatter:l=>exists(l.value)?r(String(l.value),l.value?"True":"False"):r("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(l,d)=>d,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(l,d)=>d===!1,numberOfInputs:0}]});break}case"date":{e.cellEditor="agDateCellEditor",e.keyCreator=l=>n(l.column,l.node,l.value),o&&a({valueFormatter:l=>{const d=n(l.column,l.node,l.value);return exists(d)?d:r("blanks","(Blanks)")},treeList:!0,treeListFormatter:(l,d)=>{if(d===1&&l!=null){const h=MONTH_KEYS[Number(l)-1];return r(h,MONTH_LOCALE_TEXT[h])}return l??r("blanks","(Blanks)")}});break}case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=d=>n(d.column,d.node,d.value);const l=t.dateParser;a(o?{valueFormatter:d=>{const h=n(d.column,d.node,d.value);return exists(h)?h:r("blanks","(Blanks)")},treeList:!0,treeListPathGetter:d=>{const h=l(d??void 0);return h?[String(h.getFullYear()),String(h.getMonth()+1),String(h.getDate())]:null},treeListFormatter:(d,h)=>{if(h===1&&d!=null){const p=MONTH_KEYS[Number(d)-1];return r(p,MONTH_LOCALE_TEXT[p])}return d??r("blanks","(Blanks)")}}:{comparator:(d,h)=>{const p=l(h);return h==null||p<d?-1:p>d?1:0}});break}case"object":{e.cellEditorParams={useFormatter:!0},e.comparator=(l,d)=>{const h=this.columnModel.getPrimaryColumn(i),p=h==null?void 0:h.getColDef();if(!h||!p)return 0;const m=l==null?"":n(h,null,l),v=d==null?"":n(h,null,d);return m===v?0:m>v?1:-1},e.keyCreator=l=>n(l.column,l.node,l.value),o?a({valueFormatter:l=>{const d=n(l.column,l.node,l.value);return exists(d)?d:r("blanks","(Blanks)")}}):e.filterValueGetter=l=>n(l.column,l.node,this.valueService.getValue(l.column,l.node));break}}}getDefaultDataTypes(){const e=i=>!!i.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:i=>{var n,o;return((o=(n=i.newValue)===null||n===void 0?void 0:n.trim)===null||o===void 0?void 0:o.call(n))===""?null:Number(i.newValue)},valueFormatter:i=>i.value==null?"":typeof i.value!="number"||isNaN(i.value)?t("invalidNumber","Invalid Number"):String(i.value),dataTypeMatcher:i=>typeof i=="number"},text:{baseDataType:"text",valueParser:i=>i.newValue===""?null:toStringOrNull(i.newValue),dataTypeMatcher:i=>typeof i=="string"},boolean:{baseDataType:"boolean",valueParser:i=>{var n,o;return i.newValue==null?i.newValue:((o=(n=i.newValue)===null||n===void 0?void 0:n.trim)===null||o===void 0?void 0:o.call(n))===""?null:String(i.newValue).toLowerCase()==="true"},valueFormatter:i=>i.value==null?"":String(i.value),dataTypeMatcher:i=>typeof i=="boolean"},date:{baseDataType:"date",valueParser:i=>parseDateTimeFromString(i.newValue==null?null:String(i.newValue)),valueFormatter:i=>{var n;return i.value==null?"":!(i.value instanceof Date)||isNaN(i.value.getTime())?t("invalidDate","Invalid Date"):(n=serialiseDate(i.value,!1))!==null&&n!==void 0?n:""},dataTypeMatcher:i=>i instanceof Date},dateString:{baseDataType:"dateString",dateParser:i=>{var n;return(n=parseDateTimeFromString(i))!==null&&n!==void 0?n:void 0},dateFormatter:i=>{var n;return(n=serialiseDate(i??null,!1))!==null&&n!==void 0?n:void 0},valueParser:i=>e(String(i.newValue))?i.newValue:null,valueFormatter:i=>e(String(i.value))?i.value:"",dataTypeMatcher:i=>typeof i=="string"&&e(i)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:i=>{var n;return(n=toStringOrNull(i.value))!==null&&n!==void 0?n:""}}}}};__decorate$b([Autowired("rowModel")],DataTypeService.prototype,"rowModel",void 0);__decorate$b([Autowired("columnModel")],DataTypeService.prototype,"columnModel",void 0);__decorate$b([Autowired("columnUtils")],DataTypeService.prototype,"columnUtils",void 0);__decorate$b([Autowired("valueService")],DataTypeService.prototype,"valueService",void 0);__decorate$b([Autowired("valueFormatterService")],DataTypeService.prototype,"valueFormatterService",void 0);__decorate$b([PostConstruct],DataTypeService.prototype,"init",null);DataTypeService=__decorate$b([Bean("dataTypeService")],DataTypeService);var __decorate$a=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ValueParserService=class extends BeanStub{parseValue(e,t,i,n){const o=e.getColDef(),r=this.gridOptionsService.addGridCommonParams({node:t,data:t==null?void 0:t.data,oldValue:n,newValue:i,colDef:o,column:e}),a=o.valueParser;return exists(a)?typeof a=="function"?a(r):this.expressionService.evaluate(a,r):i}};__decorate$a([Autowired("expressionService")],ValueParserService.prototype,"expressionService",void 0);ValueParserService=__decorate$a([Bean("valueParserService")],ValueParserService);var __decorate$9=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let SyncService=class extends BeanStub{constructor(){super(...arguments),this.waitingForColumns=!1}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.ctrlsService.whenReady(()=>{const e=this.gridOptionsService.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){this.columnModel.setColumnDefs(e??[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const e=ModuleRegistry.__isRegistered(ModuleNames.EnterpriseCoreModule,this.context.getGridId());new Logger("AG Grid",()=>this.gridOptionsService.get("debug")).log(`initialised successfully, enterprise = ${e}`)}dispatchGridReadyEvent(){const e={type:Events.EVENT_GRID_READY};this.eventService.dispatchEvent(e)}setColumnDefs(e){const t=this.gridOptionsService.get("columnDefs");if(t){if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(t);return}this.columnModel.setColumnDefs(t,convertSourceType(e.source))}}};__decorate$9([Autowired("ctrlsService")],SyncService.prototype,"ctrlsService",void 0);__decorate$9([Autowired("columnModel")],SyncService.prototype,"columnModel",void 0);__decorate$9([Autowired("rowModel")],SyncService.prototype,"rowModel",void 0);__decorate$9([PostConstruct],SyncService.prototype,"postConstruct",null);SyncService=__decorate$9([Bean("syncService")],SyncService);var __decorate$8=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let OverlayService=class extends BeanStub{constructor(){super(...arguments),this.manuallyDisplayed=!1}postConstruct(){this.addManagedListener(this.eventService,Events.EVENT_ROW_DATA_UPDATED,()=>this.onRowDataUpdated()),this.addManagedListener(this.eventService,Events.EVENT_NEW_COLUMNS_LOADED,()=>this.onNewColumnsLoaded())}registerOverlayWrapperComp(e){this.overlayWrapperComp=e,(!this.gridOptionsService.get("columnDefs")||this.gridOptionsService.isRowModelType("clientSide")&&!this.gridOptionsService.get("rowData"))&&this.showLoadingOverlay()}showLoadingOverlay(){if(this.gridOptionsService.get("suppressLoadingOverlay"))return;const e={},t=this.userComponentFactory.getLoadingOverlayCompDetails(e);this.showOverlay(t,"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}showNoRowsOverlay(){if(this.gridOptionsService.get("suppressNoRowsOverlay"))return;const e={},t=this.userComponentFactory.getNoRowsOverlayCompDetails(e);this.showOverlay(t,"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}showOverlay(e,t,i){const n=e.newAgStackInstance(),o=this.addManagedPropertyListener(i,({currentValue:r})=>{n.then(a=>{a.refresh&&a.refresh(this.gridOptionsService.addGridCommonParams(Object.assign({},r??{})))})});this.manuallyDisplayed=this.columnModel.isReady()&&!this.paginationProxy.isEmpty(),this.overlayWrapperComp.showOverlay(n,t,o)}hideOverlay(){this.manuallyDisplayed=!1,this.overlayWrapperComp.hideOverlay()}showOrHideOverlay(){const e=this.paginationProxy.isEmpty(),t=this.gridOptionsService.get("suppressNoRowsOverlay");e&&!t?this.showNoRowsOverlay():this.hideOverlay()}onRowDataUpdated(){this.showOrHideOverlay()}onNewColumnsLoaded(){this.columnModel.isReady()&&!this.paginationProxy.isEmpty()&&!this.manuallyDisplayed&&this.hideOverlay()}};__decorate$8([Autowired("userComponentFactory")],OverlayService.prototype,"userComponentFactory",void 0);__decorate$8([Autowired("paginationProxy")],OverlayService.prototype,"paginationProxy",void 0);__decorate$8([Autowired("columnModel")],OverlayService.prototype,"columnModel",void 0);__decorate$8([PostConstruct],OverlayService.prototype,"postConstruct",null);OverlayService=__decorate$8([Bean("overlayService")],OverlayService);var __decorate$7=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let StateService=class extends BeanStub{constructor(){super(...arguments),this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=debounce(()=>this.dispatchQueuedStateUpdateEvents(),0)}postConstruct(){var e;this.isClientSideRowModel=this.rowModel.getType()==="clientSide",this.cachedState=(e=this.gridOptionsService.get("initialState"))!==null&&e!==void 0?e:{},this.ctrlsService.whenReady(()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const t=this.addManagedListener(this.eventService,Events.EVENT_NEW_COLUMNS_LOADED,({source:o})=>{o==="gridInitializing"&&(t==null||t(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))}),i=this.addManagedListener(this.eventService,Events.EVENT_ROW_COUNT_READY,()=>{i==null||i(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())}),n=this.addManagedListener(this.eventService,Events.EVENT_FIRST_DATA_RENDERED,()=>{n==null||n(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnFirstDataRendered())})}getState(){return this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState()),this.addManagedListener(this.eventService,Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED,()=>this.updateCachedState("sideBar",this.getSideBarState())),this.addManagedListener(this.eventService,Events.EVENT_SIDE_BAR_UPDATED,()=>this.updateCachedState("sideBar",this.getSideBarState()))}setupStateOnColumnsInitialised(){var e;const t=(e=this.gridOptionsService.get("initialState"))!==null&&e!==void 0?e:{};this.setColumnState(t),this.setColumnGroupState(t),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_VALUE_CHANGED,()=>this.updateColumnState(["aggregation"])),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_MOVED,()=>this.updateColumnState(["columnOrder"])),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_PINNED,()=>this.updateColumnState(["columnPinning"])),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_RESIZED,()=>this.updateColumnState(["columnSizing"])),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_VISIBLE,()=>this.updateColumnState(["columnVisibility"])),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_PIVOT_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.updateColumnState(["pivot"])),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateColumnState(["rowGroup"])),this.addManagedListener(this.eventService,Events.EVENT_SORT_CHANGED,()=>this.updateColumnState(["sort"])),this.addManagedListener(this.eventService,Events.EVENT_NEW_COLUMNS_LOADED,()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"])),this.addManagedListener(this.eventService,Events.EVENT_COLUMN_GROUP_OPENED,()=>this.updateCachedState("columnGroup",this.getColumnGroupState()))}setupStateOnRowCountReady(){var e;const{filter:t,rowGroupExpansion:i,rowSelection:n,pagination:o}=(e=this.gridOptionsService.get("initialState"))!==null&&e!==void 0?e:{},r=this.gridOptionsService.get("advancedFilterModel");(t||r)&&this.setFilterState(t,r),i&&this.setRowGroupExpansionState(i),n&&this.setRowSelectionState(n),o&&this.setPaginationState(o),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedListener(this.eventService,Events.EVENT_FILTER_CHANGED,()=>this.updateCachedState("filter",this.getFilterState())),this.addManagedListener(this.eventService,Events.EVENT_ROW_GROUP_OPENED,()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),this.addManagedListener(this.eventService,Events.EVENT_EXPAND_COLLAPSE_ALL,()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState())),this.addManagedListener(this.eventService,Events.EVENT_SELECTION_CHANGED,()=>this.updateCachedState("rowSelection",this.getRowSelectionState())),this.addManagedListener(this.eventService,Events.EVENT_PAGINATION_CHANGED,a=>{(a.newPage||a.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())})}setupStateOnFirstDataRendered(){var e;const{scroll:t,rangeSelection:i,focusedCell:n,columnOrder:o}=(e=this.gridOptionsService.get("initialState"))!==null&&e!==void 0?e:{};n&&this.setFocusedCellState(n),i&&this.setRangeSelectionState(i),t&&this.setScrollState(t),this.setColumnPivotState(!!(o!=null&&o.orderedColIds)),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState()),this.updateCachedState("rangeSelection",this.getRangeSelectionState()),this.updateCachedState("scroll",this.getScrollState()),this.addManagedListener(this.eventService,Events.EVENT_CELL_FOCUSED,()=>this.updateCachedState("focusedCell",this.getFocusedCellState())),this.addManagedListener(this.eventService,Events.EVENT_RANGE_SELECTION_CHANGED,r=>{r.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())}),this.addManagedListener(this.eventService,Events.EVENT_BODY_SCROLL_END,()=>this.updateCachedState("scroll",this.getScrollState()))}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],n=[],o=[],r=[],a=[],l=[],d=[],h=[],p=this.columnModel.getColumnState();for(let m=0;m<p.length;m++){const{colId:v,sort:y,sortIndex:b,rowGroup:S,rowGroupIndex:E,aggFunc:T,pivot:R,pivotIndex:A,pinned:D,hide:x,width:M,flex:I}=p[m];h.push(v),y&&(t[b??0]={colId:v,sort:y}),S&&(i[E??0]=v),typeof T=="string"&&n.push({colId:v,aggFunc:T}),R&&(o[A??0]=v),D&&(D==="right"?a:r).push(v),x&&l.push(v),(I||M)&&d.push({colId:v,flex:I??void 0,width:M})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:n.length?{aggregationModel:n}:void 0,pivot:o.length||e?{pivotMode:e,pivotColIds:o}:void 0,columnPinning:r.length||a.length?{leftColIds:r,rightColIds:a}:void 0,columnVisibility:l.length?{hiddenColIds:l}:void 0,columnSizing:d.length?{columnSizingModel:d}:void 0,columnOrder:h.length?{orderedColIds:h}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:n,pivot:o,columnPinning:r,columnVisibility:a,columnSizing:l,columnOrder:d}=e,h={},p=b=>{let S=h[b];return S||(S={colId:b},h[b]=S,S)};t&&t.sortModel.forEach(({colId:b,sort:S},E)=>{const T=p(b);T.sort=S,T.sortIndex=E}),i&&i.groupColIds.forEach((b,S)=>{const E=p(b);E.rowGroup=!0,E.rowGroupIndex=S}),n&&n.aggregationModel.forEach(({colId:b,aggFunc:S})=>{p(b).aggFunc=S}),o&&(o.pivotColIds.forEach((b,S)=>{const E=p(b);E.pivot=!0,E.pivotIndex=S}),this.gridOptionsService.updateGridOptions({options:{pivotMode:o.pivotMode},source:"gridInitializing"})),r&&(r.leftColIds.forEach(b=>{p(b).pinned="left"}),r.rightColIds.forEach(b=>{p(b).pinned="right"})),a&&a.hiddenColIds.forEach(b=>{p(b).hide=!0}),l&&l.columnSizingModel.forEach(({colId:b,flex:S,width:E})=>{const T=p(b);T.flex=S??null,T.width=E});const m=d==null?void 0:d.orderedColIds,v=!!(m!=null&&m.length),y=v?m.map(b=>p(b)):Object.values(h);if(y.length){this.columnStates=y;const b={sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};this.columnModel.applyColumnState({state:y,applyOrder:v,defaultState:b},"gridInitializing")}}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,!!this.columnModel.isSecondaryColumnsPresent()){if(t){let n=[];for(const o of t)this.columnModel.getSecondaryColumn(o.colId)&&n.push(o);this.columnModel.applyColumnState({state:n,applyOrder:e},"gridInitializing")}i&&this.columnModel.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnModel.getColumnGroupState(),t=[];return e.forEach(({groupId:i,open:n})=>{n&&t.push(i)}),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){var t;if(!e.hasOwnProperty("columnGroup"))return;const i=new Set((t=e.columnGroup)===null||t===void 0?void 0:t.openColumnGroupIds),o=this.columnModel.getColumnGroupState().map(({groupId:r})=>{const a=i.has(r);return a&&i.delete(r),{groupId:r,open:a}});i.forEach(r=>{o.push({groupId:r,open:!0})}),o.length&&(this.columnGroupStates=o),this.columnModel.setColumnGroupState(o,"gridInitializing")}getFilterState(){var e;let t=this.filterManager.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const i=(e=this.filterManager.getAdvancedFilterModel())!==null&&e!==void 0?e:void 0;return t||i?{filterModel:t,advancedFilterModel:i}:void 0}setFilterState(e,t){const{filterModel:i,advancedFilterModel:n}=e??{advancedFilterModel:t};i&&this.filterManager.setFilterModel(i,"columnFilter"),n&&this.filterManager.setAdvancedFilterModel(n)}getRangeSelectionState(){var e;const t=(e=this.rangeService)===null||e===void 0?void 0:e.getCellRanges().map(i=>{const{id:n,type:o,startRow:r,endRow:a,columns:l,startColumn:d}=i;return{id:n,type:o,startRow:r,endRow:a,colIds:l.map(h=>h.getColId()),startColId:d.getColId()}});return t!=null&&t.length?{cellRanges:t}:void 0}setRangeSelectionState(e){var t;if(!this.gridOptionsService.get("enableRangeSelection"))return;const i=e.cellRanges.map(n=>Object.assign(Object.assign({},n),{columns:n.colIds.map(o=>this.columnModel.getGridColumn(o)),startColumn:this.columnModel.getGridColumn(n.startColId)}));(t=this.rangeService)===null||t===void 0||t.setCellRanges(i)}getScrollState(){var e,t,i;if(!this.isClientSideRowModel)return;const n=(e=this.ctrlsService.getGridBodyCtrl())===null||e===void 0?void 0:e.getScrollFeature(),{left:o}=(t=n==null?void 0:n.getHScrollPosition())!==null&&t!==void 0?t:{left:0},{top:r}=(i=n==null?void 0:n.getVScrollPosition())!==null&&i!==void 0?i:{top:0};return r||o?{top:r,left:o}:void 0}setScrollState(e){var t;if(!this.isClientSideRowModel)return;const{top:i,left:n}=e;(t=this.ctrlsService.getGridBodyCtrl())===null||t===void 0||t.getScrollFeature().setScrollPosition(i,n)}getSideBarState(){var e,t;return(t=(e=this.sideBarService)===null||e===void 0?void 0:e.getSideBarComp())===null||t===void 0?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:n}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:n}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:n}=e;this.focusService.setFocusedCell({column:this.columnModel.getGridColumn(t),rowIndex:i,rowPinned:n,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const e=this.paginationProxy.getCurrentPage(),t=this.gridOptionsService.get("paginationAutoPageSize")?void 0:this.paginationProxy.getPageSize();if(!(!e&&!t))return{page:e,pageSize:t}}setPaginationState(e){e.pageSize&&!this.gridOptionsService.get("paginationAutoPageSize")&&this.paginationProxy.setPageSize(e.pageSize,"initialState"),typeof e.page=="number"&&this.paginationProxy.setPage(e.page)}getRowSelectionState(){var e;const t=this.selectionService.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!(!((e=t==null?void 0:t.toggledNodes)===null||e===void 0)&&e.length)?void 0:t}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach(([n,o])=>{jsonEquals(o,this.cachedState[n])||(i=!0)}),this.cachedState=Object.assign(Object.assign({},this.cachedState),t),i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.cachedState=Object.assign(Object.assign({},this.cachedState),{[e]:t}),jsonEquals(t,i)||this.dispatchStateUpdateEvent([e])}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach(t=>this.queuedUpdateSources.add(t)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const t={type:Events.EVENT_STATE_UPDATED,sources:e,state:this.cachedState};this.eventService.dispatchEvent(t)}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}};__decorate$7([Autowired("filterManager")],StateService.prototype,"filterManager",void 0);__decorate$7([Optional("rangeService")],StateService.prototype,"rangeService",void 0);__decorate$7([Autowired("ctrlsService")],StateService.prototype,"ctrlsService",void 0);__decorate$7([Optional("sideBarService")],StateService.prototype,"sideBarService",void 0);__decorate$7([Autowired("focusService")],StateService.prototype,"focusService",void 0);__decorate$7([Autowired("columnModel")],StateService.prototype,"columnModel",void 0);__decorate$7([Autowired("paginationProxy")],StateService.prototype,"paginationProxy",void 0);__decorate$7([Autowired("rowModel")],StateService.prototype,"rowModel",void 0);__decorate$7([Autowired("selectionService")],StateService.prototype,"selectionService",void 0);__decorate$7([Autowired("expansionService")],StateService.prototype,"expansionService",void 0);__decorate$7([Autowired("columnAnimationService")],StateService.prototype,"columnAnimationService",void 0);__decorate$7([PostConstruct],StateService.prototype,"postConstruct",null);StateService=__decorate$7([Bean("stateService")],StateService);var __decorate$6=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ValidationService=class extends BeanStub{init(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,GRID_OPTIONS_VALIDATORS)}processColumnDefs(e){this.processOptions(e,COL_DEF_VALIDATORS)}processOptions(e,t){const{validations:i,deprecations:n,allProperties:o,propertyExceptions:r,objectName:a,docsUrl:l}=t;o&&this.gridOptions.suppressPropertyNamesCheck!==!0&&this.checkProperties(e,[...r??[],...Object.keys(n)],o,a,l);const d=new Set;Object.keys(e).forEach(p=>{var m;const v=n[p];if(v)if("renamed"in v){const{renamed:A,version:D}=v;d.add(`As of v${D}, ${String(p)} is deprecated. Please use ${String(A)} instead.`),e[A]=e[p]}else{const{message:A,version:D}=v;d.add(`As of v${D}, ${String(p)} is deprecated. ${A??""}`)}const y=e[p];if(y==null||y===!1)return;const b=i[p];let S;if(b)if(typeof b=="function"){const A=b(e,this.gridOptions);if(!A)return;if("objectName"in A){const D=e[p];if(Array.isArray(D)){D.forEach(x=>{this.processOptions(x,A)});return}this.processOptions(e[p],A);return}S=A}else S=b;else return;const{module:E,dependencies:T,supportedRowModels:R}=S;if(R){const A=(m=this.gridOptions.rowModelType)!==null&&m!==void 0?m:"clientSide";if(!R.includes(A)){d.add(`${String(p)} is not supported with the '${A}' row model.`);return}}if(E){const A=Array.isArray(E)?E:[E];let D=!0;if(A.forEach(x=>{ModuleRegistry.__assertRegistered(x,String(p),this.context.getGridId())||(D=!1,d.add(`${String(p)} is only available when ${x} is loaded.`))}),!D)return}if(T){const A=this.checkForWarning(p,T,e);if(A){d.add(A);return}}}),d.size>0&&d.forEach(p=>{warnOnce(p)})}checkForWarning(e,t,i){if(typeof t=="function")return t(i,this.gridOptions);const o=Object.entries(t).find(([l,d])=>{const h=i[l];return!d.includes(h)});if(!o)return null;const[r,a]=o;return a.length>1?`'${String(e)}' requires '${r}' to be one of [${a.join(", ")}].`:`'${String(e)}' requires '${r}' to be ${a[0]}.`}checkProperties(e,t,i,n,o){const r=["__ob__","__v_skip","__metadata__"],a=fuzzyCheckStrings(Object.getOwnPropertyNames(e),[...r,...t,...i],i);if(iterateObject(a,(l,d)=>{warnOnce(`invalid ${n} property '${l}' did you mean any of these: ${d.slice(0,8).join(", ")}`)}),Object.keys(a).length>0&&o){const l=this.getFrameworkOverrides().getDocLink(o);warnOnce(`to see all the valid ${n} properties please check: ${l}`)}}};__decorate$6([Autowired("gridOptions")],ValidationService.prototype,"gridOptions",void 0);__decorate$6([PostConstruct],ValidationService.prototype,"init",null);ValidationService=__decorate$6([Bean("validationService")],ValidationService);var __decorate$5=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let ApiEventService=class extends BeanStub{constructor(){super(...arguments),this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.asyncGlobalEventListeners=new Set}postConstruct(){this.frameworkEventWrappingService=new FrameworkEventListenerService(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),n=this.gridOptionsService.useAsyncEvents(),o=n?this.asyncEventListeners:this.syncEventListeners;o.has(e)||o.set(e,new Set),o.get(e).add(i),this.eventService.addEventListener(e,i,n)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e),i=this.gridOptionsService.useAsyncEvents();(i?this.asyncGlobalEventListeners:this.syncGlobalEventListeners).add(t),this.eventService.addGlobalListener(t,i)}removeEventListener(e,t){var i;const n=this.frameworkEventWrappingService.unwrap(t),o=this.asyncEventListeners.get(e),r=!!(o!=null&&o.delete(n));r||(i=this.asyncEventListeners.get(e))===null||i===void 0||i.delete(n),this.eventService.removeEventListener(e,n,r)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e),i=this.asyncGlobalEventListeners.delete(t);i||this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,i)}destroyEventListeners(e,t){e.forEach((i,n)=>{i.forEach(o=>this.eventService.removeEventListener(n,o,t)),i.clear()}),e.clear()}destroyGlobalListeners(e,t){e.forEach(i=>this.eventService.removeGlobalListener(i,t)),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.destroyGlobalListeners(this.asyncGlobalEventListeners,!0)}};__decorate$5([PostConstruct],ApiEventService.prototype,"postConstruct",null);ApiEventService=__decorate$5([Bean("apiEventService")],ApiEventService);var __decorate$4=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class PageSizeSelectorComp extends Component{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationProxy.getPageSize()||(this.paginationProxy.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}init(){this.addManagedPropertyListener("paginationPageSizeSelector",()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedListener(this.eventService,Events.EVENT_PAGINATION_CHANGED,e=>this.handlePaginationChanged(e))}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.paginationProxy.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){clearElement(this.getGui()),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0)}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gridOptionsService.get("pagination")&&!this.gridOptionsService.get("suppressPaginationPanel")&&!this.gridOptionsService.get("paginationAutoPageSize")&&this.gridOptionsService.get("paginationPageSizeSelector")!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationProxy.getPageSize(),i=!t||!e.includes(t);i&&(e.unshift(""),warnOnce(`The paginationPageSize grid option is set to a value that is not in the list of page size options.
|
||
Please make sure that the paginationPageSize grid option is set to one of the values in the
|
||
paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.`)),this.selectPageSizeComp&&(this.destroyBean(this.selectPageSizeComp),this.selectPageSizeComp=void 0);const n=this.localeService.getLocaleTextFunc(),o=n("pageSizeSelectorLabel","Page Size:"),r=e.map(l=>({value:String(l),text:String(l)})),a=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new AgSelect).addOptions(r).setValue(String(i?"":t)).setAriaLabel(a).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.hasEmptyOption=i}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gridOptionsService.get("paginationPageSizeSelector");return!Array.isArray(t)||!this.validateValues(t)?e:[...t].sort((i,n)=>i-n)}validateValues(e){if(!e.length)return warnOnce(`The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.
|
||
If you want to hide the page size selector, please set the paginationPageSizeSelector to false.`),!1;for(let t=0;t<e.length;t++){const i=e[t],n=typeof i=="number",o=i>0;if(!n)return warnOnce(`The paginationPageSizeSelector grid option contains a non-numeric value.
|
||
Please make sure that all values in the paginationPageSizeSelector array are numbers.`),!1;if(!o)return warnOnce(`The paginationPageSizeSelector grid option contains a negative number or zero.
|
||
Please make sure that all values in the paginationPageSizeSelector array are positive.`),!1}return!0}destroy(){this.toggleSelectDisplay(!1),super.destroy()}}__decorate$4([Autowired("localeService")],PageSizeSelectorComp.prototype,"localeService",void 0);__decorate$4([Autowired("gridOptionsService")],PageSizeSelectorComp.prototype,"gridOptionsService",void 0);__decorate$4([Autowired("paginationProxy")],PageSizeSelectorComp.prototype,"paginationProxy",void 0);__decorate$4([PostConstruct],PageSizeSelectorComp.prototype,"init",null);var __decorate$3=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let AriaAnnouncementService=class extends BeanStub{constructor(){super(),this.descriptionContainer=null,this.announceValue=debounce(this.announceValue.bind(this),200)}postConstruct(){const e=this.gridOptionsService.getDocument(),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),setAriaLive(t,"polite"),setAriaRelevant(t,"additions text"),setAriaAtomic(t,!0),this.eGridDiv.appendChild(t)}announceValue(e){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout(()=>{this.descriptionContainer.textContent=e},50))}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(clearElement(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null}};__decorate$3([Autowired("eGridDiv")],AriaAnnouncementService.prototype,"eGridDiv",void 0);__decorate$3([PostConstruct],AriaAnnouncementService.prototype,"postConstruct",null);AriaAnnouncementService=__decorate$3([Bean("ariaAnnouncementService")],AriaAnnouncementService);function createGrid(s,e,t){if(!e)return errorOnce("No gridOptions provided to createGrid"),{};const i=GridOptionsService.getCoercedGridOptions(e),n=new GridCoreCreator().create(s,i,o=>{const r=new GridComp(s);o.createBean(r)},void 0,t);if(!Object.isFrozen(e)&&!(t!=null&&t.frameworkOverrides)){const o="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";Object.defineProperty(e,"api",{get:()=>{errorOnce(`gridOptions.api is no longer supported. See ${o}.`)},configurable:!0}),Object.defineProperty(e,"columnApi",{get:()=>{errorOnce(`gridOptions.columnApi is no longer supported and all methods moved to the grid api. See ${o}.`)},configurable:!0})}return n}let nextGridId=1;class GridCoreCreator{create(e,t,i,n,o){var r;const a=!!t.debug,l=(r=t.gridId)!==null&&r!==void 0?r:String(nextGridId++),d=this.getRegisteredModules(o,l),h=this.createBeansList(t.rowModelType,d,l),p=this.createProvidedBeans(e,t,o);if(!h){errorOnce("Failed to create grid.");return}const m={providedBeanInstances:p,beanClasses:h,debug:a,gridId:l},v=new Logger("Context",()=>m.debug),y=new Context(m,v),b=y.getBean("beans");return this.registerModuleUserComponents(b,d),this.registerStackComponents(b,d),this.registerControllers(b,d),i(y),b.syncService.start(),n&&n(y),b.gridApi}registerControllers(e,t){t.forEach(i=>{i.controllers&&i.controllers.forEach(n=>e.ctrlsFactory.register(n))})}registerStackComponents(e,t){const i=this.createAgStackComponentsList(t);e.agStackComponentsRegistry.setupComponents(i)}getRegisteredModules(e,t){const i=e?e.modules:null,n=ModuleRegistry.__getRegisteredModules(t),o=[],r={},a=(l,d,h)=>{(m=>{r[m.moduleName]||(r[m.moduleName]=!0,o.push(m),ModuleRegistry.__register(m,l,h))})(d),d.dependantModules&&d.dependantModules.forEach(m=>a(l,m,h))};return i&&i.forEach(l=>a(!0,l,t)),n&&n.forEach(l=>a(!ModuleRegistry.__isPackageBased(),l,void 0)),o}registerModuleUserComponents(e,t){this.extractModuleEntity(t,n=>n.userComponents?n.userComponents:[]).forEach(n=>{e.userComponentRegistry.registerDefaultComponent(n.componentName,n.componentClass)})}createProvidedBeans(e,t,i){let n=i?i.frameworkOverrides:null;missing(n)&&(n=new VanillaFrameworkOverrides);const o={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:n};return i&&i.providedBeanInstances&&Object.assign(o,i.providedBeanInstances),o}createAgStackComponentsList(e){let t=[{componentName:"AgCheckbox",componentClass:AgCheckbox},{componentName:"AgRadioButton",componentClass:AgRadioButton},{componentName:"AgToggleButton",componentClass:AgToggleButton},{componentName:"AgInputTextField",componentClass:AgInputTextField},{componentName:"AgInputTextArea",componentClass:AgInputTextArea},{componentName:"AgInputNumberField",componentClass:AgInputNumberField},{componentName:"AgInputDateField",componentClass:AgInputDateField},{componentName:"AgInputRange",componentClass:AgInputRange},{componentName:"AgRichSelect",componentClass:AgRichSelect},{componentName:"AgSelect",componentClass:AgSelect},{componentName:"AgSlider",componentClass:AgSlider},{componentName:"AgGridBody",componentClass:GridBodyComp},{componentName:"AgHeaderRoot",componentClass:GridHeaderComp},{componentName:"AgSortIndicator",componentClass:SortIndicatorComp},{componentName:"AgPagination",componentClass:PaginationComp},{componentName:"AgPageSizeSelector",componentClass:PageSizeSelectorComp},{componentName:"AgOverlayWrapper",componentClass:OverlayWrapperComponent},{componentName:"AgGroupComponent",componentClass:AgGroupComponent},{componentName:"AgRowContainer",componentClass:RowContainerComp},{componentName:"AgFakeHorizontalScroll",componentClass:FakeHScrollComp},{componentName:"AgFakeVerticalScroll",componentClass:FakeVScrollComp},{componentName:"AgAutocomplete",componentClass:AgAutocomplete}];const i=this.extractModuleEntity(e,n=>n.agStackComponents?n.agStackComponents:[]);return t=t.concat(i),t}createBeansList(e="clientSide",t,i){const n=t.filter(d=>!d.rowModel||d.rowModel===e),o={clientSide:ModuleNames.ClientSideRowModelModule,infinite:ModuleNames.InfiniteRowModelModule,serverSide:ModuleNames.ServerSideRowModelModule,viewport:ModuleNames.ViewportRowModelModule};if(!o[e]){errorOnce("Could not find row model for rowModelType = "+e);return}if(!ModuleRegistry.__assertRegistered(o[e],`rowModelType = '${e}'`,i))return;const r=[Beans,RowPositionUtils,CellPositionUtils,HeaderPositionUtils,PaginationAutoPageSizeService,GridApi,UserComponentRegistry,AgComponentUtils,ComponentMetadataProvider,ResizeObserverService,UserComponentFactory,RowContainerHeightService,HorizontalResizeService,LocaleService,ValidationService,PinnedRowModel,DragService,DisplayedGroupCreator,EventService,GridOptionsService,PopupService,SelectionService,FilterManager,ColumnModel,HeaderNavigationService,PaginationProxy,RowRenderer,ExpressionService,ColumnFactory,TemplateService,AlignedGridsService,NavigationService,ValueCache,ValueService,LoggerFactory,ColumnUtils,AutoWidthCalculator,StandardMenuFactory,DragAndDropService,ColumnApi,FocusService,MouseEventService,Environment,CellNavigationService,ValueFormatterService,StylingService,ScrollVisibleService,SortController,ColumnHoverService,ColumnAnimationService,SelectableService,AutoGroupColService,ChangeDetectionService,AnimationFrameService,UndoRedoService,AgStackComponentsRegistry,ColumnDefFactory,RowCssClassCalculator,RowNodeBlockLoader,RowNodeSorter,CtrlsService,PinnedWidthService,RowNodeEventThrottle,CtrlsFactory,DataTypeService,ValueParserService,QuickFilterService,SyncService,OverlayService,StateService,ExpansionService,ApiEventService,AriaAnnouncementService,MenuService],a=this.extractModuleEntity(n,d=>d.beans?d.beans:[]);r.push(...a);const l=[];return r.forEach(d=>{l.indexOf(d)<0&&l.push(d)}),l}extractModuleEntity(e,t){return[].concat(...e.map(t))}}var BarColumnLabelPlacement;(function(s){s.InsideBase="insideBase",s.InsideEnd="insideEnd",s.Center="center",s.OutsideEnd="outsideEnd"})(BarColumnLabelPlacement||(BarColumnLabelPlacement={}));/**
|
||
* @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
|
||
* @version v31.1.1
|
||
* @link https://www.ag-grid.com/
|
||
* @license MIT
|
||
*/const globalObj=typeof global>"u"?{}:global;globalObj.HTMLElement=typeof HTMLElement>"u"?{}:HTMLElement;globalObj.HTMLButtonElement=typeof HTMLButtonElement>"u"?{}:HTMLButtonElement;globalObj.HTMLSelectElement=typeof HTMLSelectElement>"u"?{}:HTMLSelectElement;globalObj.HTMLInputElement=typeof HTMLInputElement>"u"?{}:HTMLInputElement;globalObj.Node=typeof Node>"u"?{}:Node;globalObj.MouseEvent=typeof MouseEvent>"u"?{}:MouseEvent;const agGrid="",agThemeAlpine="";var __decorate$2=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};class InfiniteBlock extends RowNodeBlock{constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){_.exists(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(_.missing(this.params.datasource.getRows)){console.warn("AG Grid: datasource is missing getRows method");return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gridOptionsService.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach((n,o)=>{this.startRow+o<i&&e(n,t.next())})}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new RowNode(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach((i,n)=>{const o=e.rowData?e.rowData[n]:void 0;!i.id&&i.alreadyRendered&&o&&(this.rowNodes[n]=new RowNode(this.beans),this.rowNodes[n].setRowIndex(i.rowIndex),this.rowNodes[n].setRowTop(i.rowTop),this.rowNodes[n].setRowHeight(i.rowHeight),i.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[n],o,this.startRow+n)});const t=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroyRowNodes(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()})}}__decorate$2([Autowired("beans")],InfiniteBlock.prototype,"beans",void 0);__decorate$2([PostConstruct],InfiniteBlock.prototype,"postConstruct",null);__decorate$2([PreDestroy],InfiniteBlock.prototype,"destroyRowNodes",null);var __decorate$1=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},__param=globalThis&&globalThis.__param||function(s,e){return function(t,i){e(t,i,s)}};class InfiniteCache extends BeanStub{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}setBeans(e){this.logger=e.create("InfiniteCache")}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let n=this.blocks[i];if(!n){if(t)return;n=this.createBlock(i)}return n.getRow(e)}createBlock(e){const t=this.createBean(new InfiniteBlock(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){if(this.blockCount==0){this.purgeCache();return}this.getBlocksInOrder().forEach(t=>t.setStateWaitingToLoad()),this.params.rowNodeBlockLoader.checkBlockToLoad()}destroyAllBlocks(){this.getBlocksInOrder().forEach(e=>this.destroyBlock(e))}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.logger.log(`onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(a=>a!=e),i=(a,l)=>l.getLastAccessed()-a.getLastAccessed();t.sort(i);const n=this.params.maxBlocksInCache>0,o=n?this.params.maxBlocksInCache-1:null,r=InfiniteCache.MAX_EMPTY_BLOCKS_TO_KEEP-1;t.forEach((a,l)=>{const d=a.getState()===InfiniteBlock.STATE_WAITING_TO_LOAD&&l>=r,h=n?l>=o:!1;if(d||h){if(this.isBlockCurrentlyDisplayed(a)||this.isBlockFocused(a))return;this.removeBlockFromCache(a)}})}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const i=e.getStartRow(),n=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<n}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const n=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<n&&(this.rowCount=n)}}setRowCount(e,t){this.rowCount=e,_.exists(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new NumberSequence;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){const e=(i,n)=>i.getId()-n.getId();return _.getAllValuesInObject(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach(t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)}),e.length>0&&e.forEach(t=>this.destroyBlock(t))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let n=-1,o=!1;const r=new NumberSequence;_.missing(e)&&(o=!0);let a=!1;return this.getBlocksInOrder().forEach(d=>{if(!a){if(o&&n+1!==d.getId()){a=!0;return}n=d.getId(),d.forEachNode(h=>{const p=h===e||h===t;(o||p)&&i.push(h),p&&(o=!o)},r,this.rowCount)}}),a||o?[]:i}}InfiniteCache.MAX_EMPTY_BLOCKS_TO_KEEP=2;__decorate$1([Autowired("rowRenderer")],InfiniteCache.prototype,"rowRenderer",void 0);__decorate$1([Autowired("focusService")],InfiniteCache.prototype,"focusService",void 0);__decorate$1([__param(0,Qualifier("loggerFactory"))],InfiniteCache.prototype,"setBeans",null);__decorate$1([PreDestroy],InfiniteCache.prototype,"destroyAllBlocks",null);var __decorate=globalThis&&globalThis.__decorate||function(s,e,t,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(r=s[a])&&(o=(n<3?r(o):n>3?r(e,t,o):r(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o};let InfiniteRowModel=class extends BeanStub{getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(e,t,i,n){return!1}init(){this.gridOptionsService.isRowModelType("infinite")&&(this.rowHeight=this.gridOptionsService.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){this.gridOptionsService.exists("initialGroupOrderComparator")&&_.warnOnce("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gridOptionsService.get("datasource"))}destroyDatasource(){this.datasource&&(this.getContext().destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedListener(this.eventService,Events.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,Events.EVENT_STORE_UPDATED,this.onCacheUpdated.bind(this)),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gridOptionsService.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gridOptionsService.getRowHeightAsNumber(),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;this.cacheParams?e=this.isSortModelDifferent():e=!0,e&&this.reset()}isSortModelDifferent(){return!_.jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){if(!this.datasource)return;this.gridOptionsService.getCallback("getRowId")!=null||this.selectionService.reset("rowDataChanged"),this.resetCache()}createModelUpdatedEvent(){return{type:Events.EVENT_MODEL_UPDATED,newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1}}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gridOptionsService.get("infiniteInitialRowCount"),maxBlocksInCache:this.gridOptionsService.get("maxBlocksInCache"),rowHeight:this.gridOptionsService.getRowHeightAsNumber(),overflowSize:this.gridOptionsService.get("cacheOverflowSize"),blockSize:this.gridOptionsService.get("cacheBlockSize"),lastAccessedSequence:new NumberSequence},this.infiniteCache=this.createBean(new InfiniteCache(this.cacheParams)),this.eventService.dispatchEventOnce({type:Events.EVENT_ROW_COUNT_READY});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}updateRowHeights(){this.forEachNode(t=>{t.setRowHeight(this.rowHeight),t.setRowTop(this.rowHeight*t.rowIndex)});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?this.infiniteCache.isLastRowIndexKnown():!1}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};__decorate([Autowired("filterManager")],InfiniteRowModel.prototype,"filterManager",void 0);__decorate([Autowired("sortController")],InfiniteRowModel.prototype,"sortController",void 0);__decorate([Autowired("selectionService")],InfiniteRowModel.prototype,"selectionService",void 0);__decorate([Autowired("rowRenderer")],InfiniteRowModel.prototype,"rowRenderer",void 0);__decorate([Autowired("rowNodeBlockLoader")],InfiniteRowModel.prototype,"rowNodeBlockLoader",void 0);__decorate([PostConstruct],InfiniteRowModel.prototype,"init",null);__decorate([PreDestroy],InfiniteRowModel.prototype,"destroyDatasource",null);InfiniteRowModel=__decorate([Bean("rowModel")],InfiniteRowModel);const VERSION="31.1.1",InfiniteRowModelModule={version:VERSION,moduleName:ModuleNames.InfiniteRowModelModule,rowModel:"infinite",beans:[InfiniteRowModel]};export{fr as $,ArcElement as A,BarController as B,Color as C,subDays as D,Backend$1 as E,Flow as F,Cache as G,Backend as H,InfiniteRowModelModule as I,store$1 as J,observePlugin$1 as K,LineController as L,ModuleRegistry as M,module_default as N,bg as O,PieController as P,cs as Q,da as R,SankeyController as S,TimeScale as T,de as U,el as V,enGB as W,enUS as X,es as Y,ca as Z,fi as _,Chart as a,hu as a0,id as a1,it as a2,ja as a3,ko as a4,nb as a5,nn as a6,nl as a7,pl as a8,ptBR as a9,pt as aa,ro as ab,ru as ac,sk as ad,sl as ae,sv as af,tr as ag,uk as ah,vi as ai,zhTW as aj,zhCN as ak,addMonths as al,subMonths as am,LineElement as b,BarElement as c,index as d,LinearScale as e,format as f,CategoryScale as g,PointElement as h,instance as i,plugin_tooltip as j,plugin_legend as k,L$1 as l,Tags as m,Autocomplete as n,createGrid as o,plugin_colors as p,axios$1 as q,endOfDay as r,startOfDay as s,startOfQuarter as t,endOfQuarter as u,startOfMonth as v,endOfMonth as w,startOfWeek as x,endOfWeek as y,startOfYear as z};
|