@sisense/sdk-ui 2.4.0 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.cjs +1 -1
- package/dist/ai.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +4 -4
- package/dist/index.umd.js +3 -3
- package/dist/{use-common-filters-B3lFbmtY.js → use-common-filters-Br-CoziA.js} +4 -4
- package/dist/{use-common-filters-B2TXBt4b.cjs → use-common-filters-CCXbao1t.cjs} +2 -2
- package/package.json +7 -7
package/dist/index.umd.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var fg=ce;function Rbe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fbe=typeof Object.is=="function"?Object.is:Rbe,jbe=fg.useState,Bbe=fg.useEffect,zbe=fg.useLayoutEffect,$be=fg.useDebugValue;function Wbe(e,t){var r=t(),n=jbe({inst:{value:r,getSnapshot:t}}),i=n[0].inst,o=n[1];return zbe(function(){i.value=r,i.getSnapshot=t,O3(i)&&o({inst:i})},[e,r,t]),Bbe(function(){return O3(i)&&o({inst:i}),e(function(){O3(i)&&o({inst:i})})},[e]),$be(r),r}function O3(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Fbe(e,r)}catch(n){return!0}}function Hbe(e,t){return t()}var Ube=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?Hbe:Wbe;o7.useSyncExternalStore=fg.useSyncExternalStore!==void 0?fg.useSyncExternalStore:Ube,i7.exports=o7;var Gbe=i7.exports;const a7=Gbe.useSyncExternalStore,s7=Ce.createContext(void 0),l7=Ce.createContext(!1);function c7(e,t){return e||(t&&typeof window!="undefined"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=s7),window.ReactQueryClientContext):s7)}const gg=({context:e}={})=>{const t=Ce.useContext(c7(e,Ce.useContext(l7)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},I3=({client:e,children:t,context:r,contextSharing:n=!1})=>{Ce.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=c7(r,n);return Ce.createElement(l7.Provider,{value:!r&&n},Ce.createElement(i.Provider,{value:e},t))},Vbe=Ce.createContext(!1),Ybe=()=>Ce.useContext(Vbe);function qbe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Zbe=Ce.createContext(qbe()),Xbe=()=>Ce.useContext(Zbe);function u7(e,t){return typeof e=="function"?e(...t):!!e}const Kbe=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},Qbe=e=>{Ce.useEffect(()=>{e.clearReset()},[e])},Jbe=({result:e,errorResetBoundary:t,useErrorBoundary:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&u7(r,[e.error,n]),e1e=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},t1e=(e,t)=>e.isLoading&&e.isFetching&&!t,r1e=(e,t,r)=>(e==null?void 0:e.suspense)&&t1e(t,r),n1e=(e,t,r)=>t.fetchOptimistic(e).then(({data:n})=>{e.onSuccess==null||e.onSuccess(n),e.onSettled==null||e.onSettled(n,null)}).catch(n=>{r.clearReset(),e.onError==null||e.onError(n),e.onSettled==null||e.onSettled(void 0,n)});function i1e(e,t){const r=gg({context:e.context}),n=Ybe(),i=Xbe(),o=r.defaultQueryOptions(e);o._optimisticResults=n?"isRestoring":"optimistic",o.onError&&(o.onError=gi.batchCalls(o.onError)),o.onSuccess&&(o.onSuccess=gi.batchCalls(o.onSuccess)),o.onSettled&&(o.onSettled=gi.batchCalls(o.onSettled)),e1e(o),Kbe(o,i),Qbe(i);const[a]=Ce.useState(()=>new t(r,o)),s=a.getOptimisticResult(o);if(a7(Ce.useCallback(l=>{const c=n?()=>{}:a.subscribe(gi.batchCalls(l));return a.updateResult(),c},[a,n]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),Ce.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),r1e(o,s,n))throw n1e(o,a,i);if(Jbe({result:s,errorResetBoundary:i,useErrorBoundary:o.useErrorBoundary,query:a.getCurrentQuery()}))throw s.error;return o.notifyOnChangeProps?s:a.trackResult(s)}function _d(e,t,r){const n=Vv(e,t,r);return i1e(n,Lbe)}function N3(e,t,r){const n=bbe(e,t),i=gg({context:n.context}),[o]=Ce.useState(()=>new Nbe(i,n));Ce.useEffect(()=>{o.setOptions(n)},[o,n]);const a=a7(Ce.useCallback(l=>o.subscribe(gi.batchCalls(l)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),s=Ce.useCallback((l,c)=>{o.mutate(l,c).catch(o1e)},[o]);if(a.error&&u7(o.options.useErrorBoundary,[a.error]))throw a.error;return xe(ue({},a),{mutate:s,mutateAsync:a.mutate})}function o1e(){}const FC=ce.createContext({isInitialized:!1,tracking:{enabled:!0,packageName:"sdk-ui"},errorBoundary:{showErrorBox:!0}}),hr=()=>ce.useContext(FC);class d7{constructor(t,r=!1){this.volatile=r,this.getChatContexts=()=>Jt(this,null,function*(){return(yield this.httpClient.get("api/datasources//"))||[]}),this.getNlgInsights=n=>this.httpClient.post("api/v2/ai/nlg/queryResult",n),this.getQueryRecommendations=(n,i)=>this.httpClient.get(`api/v2/ai/recommendations/query/${n}/${i.numOfRecommendations}`),this.getNlqResult=(n,i)=>this.httpClient.post(`api/v2/ai/nlq/query/${n}`,i),this.setLlmConfig=n=>this.httpClient.post("api/v2/settings/ai/llmProvider",n).catch(i=>{console.error("Unable to set llm config",i)}),this.getAllChats=()=>Jt(this,null,function*(){return this.volatile?[]:this.httpClient.get("api/v2/ai/chats")}),this.getChatById=n=>this.httpClient.get(`api/v2/ai/chats/${n}`),this.createChat=(n,i)=>this.httpClient.post("api/v2/ai/chats",{sourceId:n,volatile:this.volatile,contextDetails:i}),this.postChat=(n,i)=>this.httpClient.post(`api/v2/ai/chats/${n}`,i),this.deleteChatHistory=n=>this.httpClient.delete(`api/v2/ai/chats/${n}/history`),this.sendFeedback=n=>this.httpClient.post("api/v2/ai/feedback",n),this.ai={getNlgInsights:this.getNlgInsights,getNlqResult:this.getNlqResult,getQueryRecommendations:this.getQueryRecommendations,setLlmConfig:this.setLlmConfig,sendFeedback:this.sendFeedback,chat:{getAll:this.getAllChats,getById:this.getChatById,create:this.createChat,post:this.postChat,clearHistory:this.deleteChatHistory}},this.httpClient=t}}const a1e=new P3({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnMount:!1}}}),R3=ce.createContext(void 0),uc=()=>ce.useContext(R3),s1e=({children:e,volatile:t})=>{const{app:r}=hr(),n=ce.useMemo(()=>r?new d7(r.httpClient,t):void 0,[r,t]);return pe(R3.Provider,{value:n,children:pe(I3,{client:a1e,children:e})})},h7=ce.createContext({}),l1e=()=>ce.useContext(h7),p7=({children:e})=>{const[t,r]=ce.useState({}),n=ce.useCallback((a,s)=>{var l;return`${a}_${(l=s==null?void 0:s.dashboardId)!=null?l:""}`},[]),i=ce.useCallback((a,s,l)=>{r(c=>xe(ue({},c),{[n(s,l)]:a}))},[n]),o=ce.useCallback((a,s)=>t[n(a,s)],[t,n]);return pe(h7.Provider,{value:{saveChatId:i,getChatId:o},children:e})};function c1e({children:e,volatile:t}){return pe(p7,{children:pe(s1e,{volatile:t,children:e})})}const u1e={sdkComponentInit:{internal:!0,external:!0},sdkHookInit:{internal:!0,external:!0},sdkError:{internal:!0,external:!1},sdkCliExec:{internal:!0,external:!1},sdkAngularServiceMethodExecuted:{internal:!0,external:!0}},f7="composesdk",g7=(e,t,r,n=!1)=>{const i=Object.assign({action:e,cat:f7,eventType:"product",direct:!0},t);return r.post("api/activities/",[i],{cache:"no-store",redirect:"error",referrerPolicy:"same-origin",priority:"low"}).catch(o=>{console.error(`unable to log action=${e}, category=${f7}`,o)})},m7=(e,t,r,n,i)=>{const o=u1e[`${e}`];return o.internal&&g7(e,t,r,i),o.external&&n&&n(ue({action:e},t)),Promise.resolve()},F3=()=>{var o,a;const{tracking:e,app:t}=hr(),r=(a=(o=t==null?void 0:t.httpClient)==null?void 0:o.auth)==null?void 0:a.type,n=ce.useCallback((s,l={},c=!1)=>t?m7(s,xe(ue({},l),{authType:r}),t.httpClient,e.onTrackingEvent,c):Promise.resolve(),[e,t,r]),i=ce.useCallback((s,l=!1)=>{if(!t)return Promise.resolve();const{packageName:c,packageVersion:d,component:h,error:u}=s;let g="";return typeof u=="string"?g=u:u instanceof Error&&(g=u.message||u.toString()),m7("sdkError",xe(ue({},{packageName:c,packageVersion:d,component:h,error:g}),{authType:r}),t.httpClient,e.onTrackingEvent,l)},[e,t,r]);return{trackEvent:n,trackError:i}},v7="sdkHookInit",d1e=(e,t,r,n)=>{if(!r)return;g7(v7,{packageName:t,packageVersion:"2.4.0",hookName:e},r.httpClient).finally(n)};function h1e(e){const{tracking:t,app:r}=hr(),{trackEvent:n}=F3(),i=ce.useRef(!1);ce.useEffect(()=>{if(!(!t||!r)&&!i.current){const o={packageName:t.packageName||"sdk-ui",packageVersion:"2.4.0",hookName:e};n(v7,o,!t.enabled).finally(()=>i.current=!0)}},[t,e,n,r])}const Xi=e=>t=>(...r)=>(h1e(e),t(...r)),p1e={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class jC{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,r)}init(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||p1e,this.options=r,this.debug=r.debug}log(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}warn(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}error(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"error","")}deprecate(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,n,i){return i&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new jC(this.logger,ue({prefix:`${this.prefix}:${t}:`},this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new jC(this.logger,t)}}var dc=new jC;class BC{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(n=>{this.observers[n]=this.observers[n]||[],this.observers[n].push(r)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(n=>n!==r)}}emit(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.observers[t]&&[].concat(this.observers[t]).forEach(a=>{a(...n)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(a=>{a.apply(a,[t,...n])})}}function qv(){let e,t;const r=new Promise((n,i)=>{e=n,t=i});return r.resolve=e,r.reject=t,r}function y7(e){return e==null?"":""+e}function f1e(e,t,r){e.forEach(n=>{t[n]&&(r[n]=t[n])})}function j3(e,t,r){function n(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!e||typeof e=="string"}const o=typeof t!="string"?[].concat(t):t.split(".");for(;o.length>1;){if(i())return{};const a=n(o.shift());!e[a]&&r&&(e[a]=new r),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:n(o.shift())}}function b7(e,t,r){const{obj:n,k:i}=j3(e,t,Object);n[i]=r}function g1e(e,t,r,n){const{obj:i,k:o}=j3(e,t,Object);i[o]=i[o]||[],i[o].push(r)}function zC(e,t){const{obj:r,k:n}=j3(e,t);if(r)return r[n]}function m1e(e,t,r){const n=zC(e,r);return n!==void 0?n:zC(t,r)}function x7(e,t,r){for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?r&&(e[n]=t[n]):x7(e[n],t[n],r):e[n]=t[n]);return e}function mg(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var v1e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function y1e(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>v1e[t]):e}const b1e=[" ",",","?","!",";"];function x1e(e,t,r){t=t||"",r=r||"";const n=b1e.filter(a=>t.indexOf(a)<0&&r.indexOf(a)<0);if(n.length===0)return!0;const i=new RegExp(`(${n.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(r);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function $C(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const n=t.split(r);let i=e;for(let o=0;o<n.length;++o){if(!i||typeof i[n[o]]=="string"&&o+1<n.length)return;if(i[n[o]]===void 0){let a=2,s=n.slice(o,o+a).join(r),l=i[s];for(;l===void 0&&n.length>o+a;)a++,s=n.slice(o,o+a).join(r),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}const c=n.slice(o+a).join(r);return c?$C(l,c,r):void 0}i=i[n[o]]}return i}function WC(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class w7 extends BC{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s=[t,r];n&&typeof n!="string"&&(s=s.concat(n)),n&&typeof n=="string"&&(s=s.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(s=t.split("."));const l=zC(this.data,s);return l||!a||typeof n!="string"?l:$C(this.data&&this.data[t]&&this.data[t][r],n,o)}addResource(t,r,n,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,r];n&&(s=s.concat(a?n.split(a):n)),t.indexOf(".")>-1&&(s=t.split("."),i=r,r=s[1]),this.addNamespaces(r),b7(this.data,s,i),o.silent||this.emit("added",t,r,n,i)}addResources(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in n)(typeof n[o]=="string"||Object.prototype.toString.apply(n[o])==="[object Array]")&&this.addResource(t,r,o,n[o],{silent:!0});i.silent||this.emit("added",t,r,n)}addResourceBundle(t,r,n,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},s=[t,r];t.indexOf(".")>-1&&(s=t.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let l=zC(this.data,s)||{};i?x7(l,n,o):l=ue(ue({},l),n),b7(this.data,s,l),a.silent||this.emit("added",t,r,n)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?ue({},this.getResource(t,r)):this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var C7={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,r,n,i))}),t}};const _7={};class HC extends BC{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),f1e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=dc.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const n=this.resolve(t,r);return n&&n.res!==void 0}extractFromKey(t,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=r.ns||this.options.defaultNS||[];const a=n&&t.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!x1e(t,n,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};const c=t.split(n);(n!==i||n===i&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(i)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r=ue({},r)),r||(r={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],r),l=s[s.length-1],c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(d){const B=r.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${B}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l}:`${l}${B}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l}:a}const h=this.resolve(t,r);let u=h&&h.res;const g=h&&h.usedKey||a,f=h&&h.exactUsedKey||a,p=Object.prototype.toString.apply(u),x=["[object Number]","[object Function]","[object RegExp]"],S=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject;if(j&&u&&(typeof u!="string"&&typeof u!="boolean"&&typeof u!="number")&&x.indexOf(p)<0&&!(typeof S=="string"&&p==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const B=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,u,xe(ue({},r),{ns:s})):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=B,h):B}if(o){const B=p==="[object Array]",R=B?[]:{},E=B?f:g;for(const N in u)if(Object.prototype.hasOwnProperty.call(u,N)){const M=`${E}${o}${N}`;R[N]=this.translate(M,xe(ue({},r),{joinArrays:!1,ns:s})),R[N]===M&&(R[N]=u[N])}u=R}}else if(j&&typeof S=="string"&&p==="[object Array]")u=u.join(S),u&&(u=this.extendTranslation(u,t,r,n));else{let B=!1,R=!1;const E=r.count!==void 0&&typeof r.count!="string",N=HC.hasDefaultValue(r),M=E?this.pluralResolver.getSuffix(c,r.count,r):"",$=r.ordinal&&E?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",T=r[`defaultValue${M}`]||r[`defaultValue${$}`]||r.defaultValue;!this.isValidLookup(u)&&N&&(B=!0,u=T),this.isValidLookup(u)||(R=!0,u=a);const y=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:u,D=N&&T!==u&&this.options.updateMissing;if(R||B||D){if(this.logger.log(D?"updateKey":"missingKey",c,l,a,D?T:u),o){const q=this.resolve(a,xe(ue({},r),{keySeparator:!1}));q&&q.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 k=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let q=0;q<F.length;q++)k.push(F[q]);else this.options.saveMissingTo==="all"?k=this.languageUtils.toResolveHierarchy(r.lng||this.language):k.push(r.lng||this.language);const V=(q,z,P)=>{const W=N&&P!==u?P:y;this.options.missingKeyHandler?this.options.missingKeyHandler(q,l,z,W,D,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(q,l,z,W,D,r),this.emit("missingKey",q,l,z,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?k.forEach(q=>{this.pluralResolver.getSuffixes(q,r).forEach(z=>{V([q],a+z,r[`defaultValue${z}`]||T)})}):V(k,a,T))}u=this.extendTranslation(u,t,r,h,n),R&&u===a&&this.options.appendNamespaceToMissingKey&&(u=`${l}:${a}`),(R||B)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,B?u:void 0):u=this.options.parseMissingKeyHandler(u))}return i?(h.res=u,h):u}extendTranslation(t,r,n,i,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,ue(ue({},this.options.interpolation.defaultVariables),n),i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(xe(ue({},n),{interpolation:ue(ue({},this.options.interpolation),n.interpolation)}));const c=typeof t=="string"&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(c){const u=t.match(this.interpolator.nestingRegexp);d=u&&u.length}let h=n.replace&&typeof n.replace!="string"?n.replace:n;if(this.options.interpolation.defaultVariables&&(h=ue(ue({},this.options.interpolation.defaultVariables),h)),t=this.interpolator.interpolate(t,h,n.lng||this.language,n),c){const u=t.match(this.interpolator.nestingRegexp),g=u&&u.length;d<g&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(n.lng=i.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var u=arguments.length,g=new Array(u),f=0;f<u;f++)g[f]=arguments[f];return o&&o[0]===g[0]&&!n.context?(a.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${r[0]}`),null):a.translate(...g,r)},n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,l=typeof s=="string"?[s]:s;return t!=null&&l&&l.length&&n.applyPostProcessor!==!1&&(t=C7.handle(l,t,r,this.options&&this.options.postProcessPassResolved?ue({i18nResolved:i},n):n,this)),t}resolve(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,i,o,a,s;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,r),d=c.key;i=d;let h=c.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const u=r.count!==void 0&&typeof r.count!="string",g=u&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),f=r.context!==void 0&&(typeof r.context=="string"||typeof r.context=="number")&&r.context!=="",p=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);h.forEach(x=>{this.isValidLookup(n)||(s=x,!_7[`${p[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(_7[`${p[0]}-${x}`]=!0,this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" 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!!!")),p.forEach(S=>{if(this.isValidLookup(n))return;a=S;const j=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(j,d,S,x,r);else{let B;u&&(B=this.pluralResolver.getSuffix(S,r.count,r));const R=`${this.options.pluralSeparator}zero`,E=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(j.push(d+B),r.ordinal&&B.indexOf(E)===0&&j.push(d+B.replace(E,this.options.pluralSeparator)),g&&j.push(d+R)),f){const N=`${d}${this.options.contextSeparator}${r.context}`;j.push(N),u&&(j.push(N+B),r.ordinal&&B.indexOf(E)===0&&j.push(N+B.replace(E,this.options.pluralSeparator)),g&&j.push(N+R))}}let U;for(;U=j.pop();)this.isValidLookup(n)||(o=U,n=this.getResource(S,x,U,r))}))})}),{res:n,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,r,n,i):this.resourceStore.getResource(t,r,n,i)}static hasDefaultValue(t){const r="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r===n.substring(0,r.length)&&t[n]!==void 0)return!0;return!1}}function B3(e){return e.charAt(0).toUpperCase()+e.slice(1)}class S7{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=dc.create("languageUtils")}getScriptPartFromCode(t){if(t=WC(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=WC(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const r=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map(i=>i.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=B3(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=B3(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=B3(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&t.forEach(n=>{if(r)return;const i=this.getLanguagePartFromCode(n);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&o.indexOf(i)===0)return o})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!r)return t.default||[];let n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}toResolveHierarchy(t,r){const n=this.getFallbackCodes(r||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),n.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}let w1e=[{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}],C1e={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const _1e=["v1","v2","v3"],S1e=["v4"],k7={zero:0,one:1,two:2,few:3,many:4,other:5};function k1e(){const e={};return w1e.forEach(t=>{t.lngs.forEach(r=>{e[r]={numbers:t.nr,plurals:C1e[t.fc]}})}),e}class M1e{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=r,this.logger=dc.create("pluralResolver"),(!this.options.compatibilityJSON||S1e.includes(this.options.compatibilityJSON))&&(typeof Intl=="undefined"||!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=k1e()}addRule(t,r){this.rules[t]=r}getRule(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(WC(t),{type:r.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(i=>`${r}${i}`)}getSuffixes(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((i,o)=>k7[i]-k7[o]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):n.numbers.map(i=>this.getSuffix(t,i,r)):[]}getSuffix(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,n);return i?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:this.getSuffixRetroCompatible(i,r):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,r){const n=t.noAbs?t.plurals(r):t.plurals(Math.abs(r));let i=t.numbers[n];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const o=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!_1e.includes(this.options.compatibilityJSON)}}function M7(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=m1e(e,t,r);return!o&&i&&typeof r=="string"&&(o=$C(e,r,n),o===void 0&&(o=$C(t,r,n))),o}class T1e{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=dc.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(r=>r),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const r=t.interpolation;this.escape=r.escape!==void 0?r.escape:y1e,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?mg(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?mg(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?mg(r.nestingPrefix):r.nestingPrefixEscaped||mg("$t("),this.nestingSuffix=r.nestingSuffix?mg(r.nestingSuffix):r.nestingSuffixEscaped||mg(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const r=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(r,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(t,r,n,i){let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(f){return f.replace(/\$/g,"$$$$")}const d=f=>{if(f.indexOf(this.formatSeparator)<0){const j=M7(r,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(j,void 0,n,xe(ue(ue({},i),r),{interpolationkey:f})):j}const p=f.split(this.formatSeparator),x=p.shift().trim(),S=p.join(this.formatSeparator).trim();return this.format(M7(r,l,x,this.options.keySeparator,this.options.ignoreJSONStructure),S,n,xe(ue(ue({},i),r),{interpolationkey:x}))};this.resetRegExp();const h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,u=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>c(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?c(this.escape(f)):c(f)}].forEach(f=>{for(s=0;o=f.regex.exec(t);){const p=o[1].trim();if(a=d(p),a===void 0)if(typeof h=="function"){const S=h(t,o,i);a=typeof S=="string"?S:""}else if(i&&Object.prototype.hasOwnProperty.call(i,p))a="";else if(u){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${t}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=y7(a));const x=f.safeValue(a);if(t=t.replace(o[0],x),u?(f.regex.lastIndex+=a.length,f.regex.lastIndex-=o[0].length):f.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;function s(l,c){const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const h=l.split(new RegExp(`${d}[ ]*{`));let u=`{${h[1]}`;l=h[0],u=this.interpolate(u,a);const g=u.match(/'/g),f=u.match(/"/g);(g&&g.length%2===0&&!f||f.length%2!==0)&&(u=u.replace(/'/g,'"'));try{a=JSON.parse(u),c&&(a=ue(ue({},c),a))}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,p),`${l}${d}${u}`}return delete a.defaultValue,l}for(;i=this.nestingRegexp.exec(t);){let l=[];a=ue({},n),a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(h=>h.trim());i[1]=d.shift(),l=d,c=!0}if(o=r(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=y7(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),c&&(o=l.reduce((d,h)=>this.format(d,h,n.lng,xe(ue({},n),{interpolationkey:i[1].trim()})),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}function A1e(e){let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);t==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(a=>{if(!a)return;const[s,...l]=a.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,"");r[s.trim()]||(r[s.trim()]=c),c==="false"&&(r[s.trim()]=!1),c==="true"&&(r[s.trim()]=!0),isNaN(c)||(r[s.trim()]=parseInt(c,10))})}return{formatName:t,formatOptions:r}}function vg(e){const t={};return function(n,i,o){const a=i+JSON.stringify(o);let s=t[a];return s||(s=e(WC(i),o),t[a]=s),s(n)}}class E1e{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=dc.create("formatter"),this.options=t,this.formats={number:vg((r,n)=>{const i=new Intl.NumberFormat(r,ue({},n));return o=>i.format(o)}),currency:vg((r,n)=>{const i=new Intl.NumberFormat(r,xe(ue({},n),{style:"currency"}));return o=>i.format(o)}),datetime:vg((r,n)=>{const i=new Intl.DateTimeFormat(r,ue({},n));return o=>i.format(o)}),relativetime:vg((r,n)=>{const i=new Intl.RelativeTimeFormat(r,ue({},n));return o=>i.format(o,n.range||"day")}),list:vg((r,n)=>{const i=new Intl.ListFormat(r,ue({},n));return o=>i.format(o)})},this.init(t)}init(t){const n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=vg(r)}format(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return r.split(this.formatSeparator).reduce((s,l)=>{const{formatName:c,formatOptions:d}=A1e(l);if(this.formats[c]){let h=s;try{const u=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},g=u.locale||u.lng||i.locale||i.lng||n;h=this.formats[c](s,g,ue(ue(ue({},d),i),u))}catch(u){this.logger.warn(u)}return h}else this.logger.warn(`there was no format function for ${c}`);return s},t)}}function P1e(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class D1e extends BC{constructor(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=dc.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,i.backend,i)}queueLoad(t,r,n,i){const o={},a={},s={},l={};return t.forEach(c=>{let d=!0;r.forEach(h=>{const u=`${c}|${h}`;!n.reload&&this.store.hasResourceBundle(c,h)?this.state[u]=2:this.state[u]<0||(this.state[u]===1?a[u]===void 0&&(a[u]=!0):(this.state[u]=1,d=!1,a[u]===void 0&&(a[u]=!0),o[u]===void 0&&(o[u]=!0),l[h]===void 0&&(l[h]=!0)))}),d||(s[c]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,r,n){const i=t.split("|"),o=i[0],a=i[1];r&&this.emit("failedLoading",o,a,r),n&&this.store.addResourceBundle(o,a,n),this.state[t]=r?-1:2;const s={};this.queue.forEach(l=>{g1e(l.loaded,[o],a),P1e(l,t),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const d=l.loaded[c];d.length&&d.forEach(h=>{s[c][h]===void 0&&(s[c][h]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:n,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(c&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,n,i+1,o*2,a)},o);return}a(c,d)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(t,r);c&&typeof c.then=="function"?c.then(d=>s(null,d)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,r,s)}prepareLoading(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=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."),i&&i();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof r=="string"&&(r=[r]);const o=this.queueLoad(t,r,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,r,n){this.prepareLoading(t,r,{},n)}reload(t,r,n){this.prepareLoading(t,r,{reload:!0},n)}loadOne(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=t.split("|"),i=n[0],o=n[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${r}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${r}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,r,n,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" 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(!(n==null||n==="")){if(this.backend&&this.backend.create){const l=xe(ue({},a),{isUpdate:o}),c=this.backend.create.bind(this.backend);if(c.length<6)try{let d;c.length===5?d=c(t,r,n,i,l):d=c(t,r,n,i),d&&typeof d.then=="function"?d.then(h=>s(null,h)).catch(s):s(null,d)}catch(d){s(d)}else c(t,r,n,i,s,l)}!t||!t[0]||this.store.addResource(t[0],r,n,i)}}}function T7(){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(t){let r={};if(typeof t[1]=="object"&&(r=t[1]),typeof t[1]=="string"&&(r.defaultValue=t[1]),typeof t[2]=="string"&&(r.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(i=>{r[i]=n[i]})}return r},interpolation:{escapeValue:!0,format:(e,t,r,n)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function A7(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function UC(){}function L1e(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})}class Zv extends BC{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=A7(t),this.services={},this.logger=dc,this.modules={external:[]},L1e(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(){var t=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;typeof r=="function"&&(n=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(typeof r.ns=="string"?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const i=T7();this.options=ue(ue(ue({},i),this.options),A7(r)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=ue(ue({},i.interpolation),this.options.interpolation)),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);function o(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?dc.init(o(this.modules.logger),this.options):dc.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl!="undefined"&&(d=E1e);const h=new S7(this.options);this.store=new w7(this.options.resources,this.options);const u=this.services;u.logger=dc,u.resourceStore=this.store,u.languageUtils=h,u.pluralResolver=new M1e(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(u.formatter=o(d),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new T1e(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new D1e(o(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(g){for(var f=arguments.length,p=new Array(f>1?f-1:0),x=1;x<f;x++)p[x-1]=arguments[x];t.emit(g,...p)}),this.modules.languageDetector&&(u.languageDetector=o(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=o(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new HC(this.services,this.options),this.translator.on("*",function(g){for(var f=arguments.length,p=new Array(f>1?f-1:0),x=1;x<f;x++)p[x-1]=arguments[x];t.emit(g,...p)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,n||(n=UC),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[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(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const l=qv(),c=()=>{const d=(h,u)=>{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(u),n(h,u)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),l}loadResources(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:UC;const i=typeof t=="string"?t:this.language;if(typeof t=="function"&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode")return n();const o=[],a=s=>{if(!s)return;this.services.languageUtils.toResolveHierarchy(s).forEach(c=>{o.indexOf(c)<0&&o.push(c)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload&&this.options.preload.forEach(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(s)})}else n(null)}reloadResources(t,r,n){const i=qv();return t||(t=this.languages),r||(r=this.options.ns),n||(n=UC),this.services.backendConnector.reload(t,r,o=>{i.resolve(),n(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&C7.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(t,r){var n=this;this.isLanguageChangingTo=t;const i=qv();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,c)=>{c?(o(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return n.t(...arguments)}),r&&r(l,function(){return n.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,d=>{a(d,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,r,n){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),h=2;h<c;h++)d[h-2]=arguments[h];l=i.options.overloadTranslationOptionHandler([a,s].concat(d))}else l=ue({},s);l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix=l.keyPrefix||n||o.keyPrefix;const u=i.options.keySeparator||".";let g;return l.keyPrefix&&Array.isArray(a)?g=a.map(f=>`${l.keyPrefix}${u}${f}`):g=l.keyPrefix?`${l.keyPrefix}${u}${a}`:a,i.t(g,l)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=r,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let r=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 n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===2};if(r.precheck){const s=r.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,t)&&(!i||a(o,t)))}loadNamespaces(t,r){const n=qv();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(t,r){const n=qv();typeof t=="string"&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0);return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{n.resolve(),r&&r(a)}),n):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const r=["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"],n=this.services&&this.services.languageUtils||new S7(T7());return r.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Zv(t,r)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:UC;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const i=xe(ue(ue({},this.options),t),{isClone:!0}),o=new Zv(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services=ue({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new w7(this.store.data,i),o.services.resourceStore=o.store),o.translator=new HC(o.services,i),o.translator.on("*",function(s){for(var l=arguments.length,c=new Array(l>1?l-1:0),d=1;d<l;d++)c[d-1]=arguments[d];o.emit(s,...c)}),o.init(i,r),o.translator.options=i,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 E7=Zv.createInstance();E7.createInstance=Zv.createInstance;const O1e={error:"Error"},I1e={error:"Помилка"},P7="common",N1e={en:O1e,uk:I1e},hc=E7.createInstance({defaultNS:P7,resources:R1e(N1e,P7),lng:"en",fallbackLng:"en"}),z3={i18nextInstance:hc,initPromise:hc.init().then(()=>hc)},GC=new Map;GC.set("common",z3);const VC=e=>{if(GC.has(e.namespace))return GC.get(e.namespace);if(e.plugins)for(const o of e.plugins)hc.use(o);Object.keys(e.resource).forEach(o=>{hc.addResourceBundle(o,e.namespace,e.resource[o])});const t=hc.cloneInstance({defaultNS:e.namespace});let r=z3.initPromise.then(()=>t);t.on("languageChanged",o=>{hc.language!==o&&hc.changeLanguage(o)}),hc.on("languageChanged",o=>{t.language!==o&&t.changeLanguage(o)});const n=e.language||"en";hc.language!==n&&(r=r.then(()=>t.changeLanguage(n)).then(()=>t));const i={initPromise:r,i18nextInstance:t};return GC.set(e.namespace,i),i};function R1e(e,t){return Object.keys(e).reduce((r,n)=>(r[n]={[t]:e[n]},r),{})}class Xv extends Error{constructor(t,r,n){const{key:i,interpolationOptions:o}=r,a=n||z3.i18nextInstance.t,s=Object.assign(Object.assign({},o),{ns:t}),l=a(i,Object.assign(Object.assign({},s),{lng:"en"}));super(l),this.key=i,this.namespace=t,this.interpolationOptions=s}}function yg(e){return e&&e.replace(new RegExp("(?<!\\\\)'","g"),"\\'")}function mu(e,t){if(!e||typeof e!="string")return e;const r=new URL(e);return r.origin+(r.pathname.endsWith("/")?r.pathname:r.pathname+"/")+(t&&r.search?r.search:"")}const F1e={errors:{measure:{unsupportedType:"Unsupported measure type",dimensionalCalculatedMeasure:{noContext:"DimensionalCalculatedMeasure must have 'context' property"},dimensionalBaseMeasure:{noAttributeDimExpression:"DimensionalBaseMeasure must have 'attribute'/'dim'/'expression' property",noAggAggregation:"DimensionalBaseMeasure must have 'agg' or 'aggregation' property"},notAFormula:"Jaql is not a formula"},dataModelConfig:{noName:"'name' must be specified in config for DataModel",noMetadata:"'metadata' must be specified in config for DataModel"},filter:{unsupportedType:"Unsupported filter type: {{filterType}}",unsupportedDatetimeLevel:'Filters do not support the next "datetime" levels: Hours, MinutesRoundTo30, MinutesRoundTo15, Minutes, Seconds',membersFilterNullMember:"MembersFilter of {{attributeId}} - member cannot be null",unsupportedConditionFilter:"Jaql contains unsupported condition filter: {{filter}}",formulaFiltersNotSupported:"Formula-based filter not supported yet: {{filter}}"},unsupportedDimensionalElement:"Unsupported dimensional element type"}},j1e={errors:{measure:{unsupportedType:"Непідтримуваний тип measure",dimensionalCalculatedMeasure:{noContext:"DimensionalCalculatedMeasure має мати властивість 'context'"},dimensionalBaseMeasure:{noAttributeDimExpression:"DimensionalBaseMeasure має мати властивість 'attribute'/'dim'/'expression'",noAggAggregation:"DimensionalBaseMeasure має мати властивість 'agg' або 'aggregation'"},notAFormula:"Jaql не формула"},dataModelConfig:{noName:"'name' має бути вказано в конфігурації для DataModel",noMetadata:"'metadata' має бути вказано в конфігурації для DataModel"},filter:{unsupportedType:"Непідтримуваний тип фільтра: {{filterType}}",unsupportedDatetimeLevel:'Фільтри не підтримують наступні рівні "datetime": Hours, MinutesRoundTo30, MinutesRoundTo15, Minutes, Seconds',membersFilterNullMember:"MembersFilter у {{attributeId}} - member не може бути нульовим",unsupportedConditionFilter:"Jaql містить непідтримуваний condition фільтр: {{filter}}",formulaFiltersNotSupported:"Фільтри, що містять формули наразі не підтримуються: {{filter}}"},unsupportedDimensionalElement:"Непідтримуваний тип елемента"}},D7="sdkData",B1e={en:F1e,uk:j1e};function z1e(){return VC({resource:B1e,language:"en",namespace:D7})}const{i18nextInstance:$1e}=z1e();function W1e(){this.__data__=[],this.size=0}function Kv(e,t){return e===t||e!==e&&t!==t}function YC(e,t){for(var r=e.length;r--;)if(Kv(e[r][0],t))return r;return-1}var H1e=Array.prototype,U1e=H1e.splice;function G1e(e){var t=this.__data__,r=YC(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():U1e.call(t,r,1),--this.size,!0}function V1e(e){var t=this.__data__,r=YC(t,e);return r<0?void 0:t[r][1]}function Y1e(e){return YC(this.__data__,e)>-1}function q1e(e,t){var r=this.__data__,n=YC(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function vu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}vu.prototype.clear=W1e,vu.prototype.delete=G1e,vu.prototype.get=V1e,vu.prototype.has=Y1e,vu.prototype.set=q1e;function Z1e(){this.__data__=new vu,this.size=0}function X1e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function K1e(e){return this.__data__.get(e)}function Q1e(e){return this.__data__.has(e)}var L7=typeof global=="object"&&global&&global.Object===Object&&global,J1e=typeof self=="object"&&self&&self.Object===Object&&self,No=L7||J1e||Function("return this")(),js=No.Symbol,O7=Object.prototype,exe=O7.hasOwnProperty,txe=O7.toString,Qv=js?js.toStringTag:void 0;function rxe(e){var t=exe.call(e,Qv),r=e[Qv];try{e[Qv]=void 0;var n=!0}catch(o){}var i=txe.call(e);return n&&(t?e[Qv]=r:delete e[Qv]),i}var nxe=Object.prototype,ixe=nxe.toString;function oxe(e){return ixe.call(e)}var axe="[object Null]",sxe="[object Undefined]",I7=js?js.toStringTag:void 0;function Al(e){return e==null?e===void 0?sxe:axe:I7&&I7 in Object(e)?rxe(e):oxe(e)}function po(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var lxe="[object AsyncFunction]",cxe="[object Function]",uxe="[object GeneratorFunction]",dxe="[object Proxy]";function yu(e){if(!po(e))return!1;var t=Al(e);return t==cxe||t==uxe||t==lxe||t==dxe}var $3=No["__core-js_shared__"],N7=function(){var e=/[^.]+$/.exec($3&&$3.keys&&$3.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function hxe(e){return!!N7&&N7 in e}var pxe=Function.prototype,fxe=pxe.toString;function tp(e){if(e!=null){try{return fxe.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var gxe=/[\\^$.*+?()[\]{}|]/g,mxe=/^\[object .+?Constructor\]$/,vxe=Function.prototype,yxe=Object.prototype,bxe=vxe.toString,xxe=yxe.hasOwnProperty,wxe=RegExp("^"+bxe.call(xxe).replace(gxe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Cxe(e){if(!po(e)||hxe(e))return!1;var t=yu(e)?wxe:mxe;return t.test(tp(e))}function _xe(e,t){return e==null?void 0:e[t]}function rp(e,t){var r=_xe(e,t);return Cxe(r)?r:void 0}var Jv=rp(No,"Map"),ey=rp(Object,"create");function Sxe(){this.__data__=ey?ey(null):{},this.size=0}function kxe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Mxe="__lodash_hash_undefined__",Txe=Object.prototype,Axe=Txe.hasOwnProperty;function Exe(e){var t=this.__data__;if(ey){var r=t[e];return r===Mxe?void 0:r}return Axe.call(t,e)?t[e]:void 0}var Pxe=Object.prototype,Dxe=Pxe.hasOwnProperty;function Lxe(e){var t=this.__data__;return ey?t[e]!==void 0:Dxe.call(t,e)}var Oxe="__lodash_hash_undefined__";function Ixe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ey&&t===void 0?Oxe:t,this}function np(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}np.prototype.clear=Sxe,np.prototype.delete=kxe,np.prototype.get=Exe,np.prototype.has=Lxe,np.prototype.set=Ixe;function Nxe(){this.size=0,this.__data__={hash:new np,map:new(Jv||vu),string:new np}}function Rxe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function qC(e,t){var r=e.__data__;return Rxe(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Fxe(e){var t=qC(this,e).delete(e);return this.size-=t?1:0,t}function jxe(e){return qC(this,e).get(e)}function Bxe(e){return qC(this,e).has(e)}function zxe(e,t){var r=qC(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function bu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}bu.prototype.clear=Nxe,bu.prototype.delete=Fxe,bu.prototype.get=jxe,bu.prototype.has=Bxe,bu.prototype.set=zxe;var $xe=200;function Wxe(e,t){var r=this.__data__;if(r instanceof vu){var n=r.__data__;if(!Jv||n.length<$xe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new bu(n)}return r.set(e,t),this.size=r.size,this}function El(e){var t=this.__data__=new vu(e);this.size=t.size}El.prototype.clear=Z1e,El.prototype.delete=X1e,El.prototype.get=K1e,El.prototype.has=Q1e,El.prototype.set=Wxe;function R7(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var ZC=function(){try{var e=rp(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();function ty(e,t,r){t=="__proto__"&&ZC?ZC(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Hxe=Object.prototype,Uxe=Hxe.hasOwnProperty;function W3(e,t,r){var n=e[t];(!(Uxe.call(e,t)&&Kv(n,r))||r===void 0&&!(t in e))&&ty(e,t,r)}function bg(e,t,r,n){var i=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=void 0;l===void 0&&(l=e[s]),i?ty(r,s,l):W3(r,s,l)}return r}function Gxe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Jo(e){return e!=null&&typeof e=="object"}var Vxe="[object Arguments]";function F7(e){return Jo(e)&&Al(e)==Vxe}var j7=Object.prototype,Yxe=j7.hasOwnProperty,qxe=j7.propertyIsEnumerable,ry=F7(function(){return arguments}())?F7:function(e){return Jo(e)&&Yxe.call(e,"callee")&&!qxe.call(e,"callee")},vn=Array.isArray;function Zxe(){return!1}var B7=typeof Ge=="object"&&Ge&&!Ge.nodeType&&Ge,z7=B7&&typeof module=="object"&&module&&!module.nodeType&&module,Xxe=z7&&z7.exports===B7,$7=Xxe?No.Buffer:void 0,Kxe=$7?$7.isBuffer:void 0,ny=Kxe||Zxe,Qxe=9007199254740991,Jxe=/^(?:0|[1-9]\d*)$/;function iy(e,t){var r=typeof e;return t=t==null?Qxe:t,!!t&&(r=="number"||r!="symbol"&&Jxe.test(e))&&e>-1&&e%1==0&&e<t}var ewe=9007199254740991;function H3(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ewe}var twe="[object Arguments]",rwe="[object Array]",nwe="[object Boolean]",iwe="[object Date]",owe="[object Error]",awe="[object Function]",swe="[object Map]",lwe="[object Number]",cwe="[object Object]",uwe="[object RegExp]",dwe="[object Set]",hwe="[object String]",pwe="[object WeakMap]",fwe="[object ArrayBuffer]",gwe="[object DataView]",mwe="[object Float32Array]",vwe="[object Float64Array]",ywe="[object Int8Array]",bwe="[object Int16Array]",xwe="[object Int32Array]",wwe="[object Uint8Array]",Cwe="[object Uint8ClampedArray]",_we="[object Uint16Array]",Swe="[object Uint32Array]",Yn={};Yn[mwe]=Yn[vwe]=Yn[ywe]=Yn[bwe]=Yn[xwe]=Yn[wwe]=Yn[Cwe]=Yn[_we]=Yn[Swe]=!0,Yn[twe]=Yn[rwe]=Yn[fwe]=Yn[nwe]=Yn[gwe]=Yn[iwe]=Yn[owe]=Yn[awe]=Yn[swe]=Yn[lwe]=Yn[cwe]=Yn[uwe]=Yn[dwe]=Yn[hwe]=Yn[pwe]=!1;function kwe(e){return Jo(e)&&H3(e.length)&&!!Yn[Al(e)]}function oy(e){return function(t){return e(t)}}var W7=typeof Ge=="object"&&Ge&&!Ge.nodeType&&Ge,ay=W7&&typeof module=="object"&&module&&!module.nodeType&&module,Mwe=ay&&ay.exports===W7,U3=Mwe&&L7.process,Sd=function(){try{var e=ay&&ay.require&&ay.require("util").types;return e||U3&&U3.binding&&U3.binding("util")}catch(t){}}(),H7=Sd&&Sd.isTypedArray,G3=H7?oy(H7):kwe,Twe=Object.prototype,Awe=Twe.hasOwnProperty;function U7(e,t){var r=vn(e),n=!r&&ry(e),i=!r&&!n&&ny(e),o=!r&&!n&&!i&&G3(e),a=r||n||i||o,s=a?Gxe(e.length,String):[],l=s.length;for(var c in e)(t||Awe.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||iy(c,l)))&&s.push(c);return s}var Ewe=Object.prototype;function V3(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Ewe;return e===r}function G7(e,t){return function(r){return e(t(r))}}var Pwe=G7(Object.keys,Object),Dwe=Object.prototype,Lwe=Dwe.hasOwnProperty;function Owe(e){if(!V3(e))return Pwe(e);var t=[];for(var r in Object(e))Lwe.call(e,r)&&r!="constructor"&&t.push(r);return t}function sy(e){return e!=null&&H3(e.length)&&!yu(e)}function ly(e){return sy(e)?U7(e):Owe(e)}function Iwe(e,t){return e&&bg(t,ly(t),e)}function Nwe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var Rwe=Object.prototype,Fwe=Rwe.hasOwnProperty;function jwe(e){if(!po(e))return Nwe(e);var t=V3(e),r=[];for(var n in e)n=="constructor"&&(t||!Fwe.call(e,n))||r.push(n);return r}function cy(e){return sy(e)?U7(e,!0):jwe(e)}function Bwe(e,t){return e&&bg(t,cy(t),e)}var V7=typeof Ge=="object"&&Ge&&!Ge.nodeType&&Ge,Y7=V7&&typeof module=="object"&&module&&!module.nodeType&&module,zwe=Y7&&Y7.exports===V7,q7=zwe?No.Buffer:void 0,Z7=q7?q7.allocUnsafe:void 0;function X7(e,t){if(t)return e.slice();var r=e.length,n=Z7?Z7(r):new e.constructor(r);return e.copy(n),n}function XC(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function $we(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function K7(){return[]}var Wwe=Object.prototype,Hwe=Wwe.propertyIsEnumerable,Q7=Object.getOwnPropertySymbols,Y3=Q7?function(e){return e==null?[]:(e=Object(e),$we(Q7(e),function(t){return Hwe.call(e,t)}))}:K7;function Uwe(e,t){return bg(e,Y3(e),t)}function q3(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Z3=G7(Object.getPrototypeOf,Object),Gwe=Object.getOwnPropertySymbols,J7=Gwe?function(e){for(var t=[];e;)q3(t,Y3(e)),e=Z3(e);return t}:K7;function Vwe(e,t){return bg(e,J7(e),t)}function e$(e,t,r){var n=t(e);return vn(e)?n:q3(n,r(e))}function X3(e){return e$(e,ly,Y3)}function K3(e){return e$(e,cy,J7)}var Q3=rp(No,"DataView"),J3=rp(No,"Promise"),xg=rp(No,"Set"),uy=rp(No,"WeakMap"),t$="[object Map]",Ywe="[object Object]",r$="[object Promise]",n$="[object Set]",i$="[object WeakMap]",o$="[object DataView]",qwe=tp(Q3),Zwe=tp(Jv),Xwe=tp(J3),Kwe=tp(xg),Qwe=tp(uy),Pl=Al;(Q3&&Pl(new Q3(new ArrayBuffer(1)))!=o$||Jv&&Pl(new Jv)!=t$||J3&&Pl(J3.resolve())!=r$||xg&&Pl(new xg)!=n$||uy&&Pl(new uy)!=i$)&&(Pl=function(e){var t=Al(e),r=t==Ywe?e.constructor:void 0,n=r?tp(r):"";if(n)switch(n){case qwe:return o$;case Zwe:return t$;case Xwe:return r$;case Kwe:return n$;case Qwe:return i$}return t});var Jwe=Object.prototype,eCe=Jwe.hasOwnProperty;function tCe(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&eCe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var KC=No.Uint8Array;function eD(e){var t=new e.constructor(e.byteLength);return new KC(t).set(new KC(e)),t}function rCe(e,t){var r=t?eD(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var nCe=/\w*$/;function iCe(e){var t=new e.constructor(e.source,nCe.exec(e));return t.lastIndex=e.lastIndex,t}var a$=js?js.prototype:void 0,s$=a$?a$.valueOf:void 0;function oCe(e){return s$?Object(s$.call(e)):{}}function l$(e,t){var r=t?eD(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var aCe="[object Boolean]",sCe="[object Date]",lCe="[object Map]",cCe="[object Number]",uCe="[object RegExp]",dCe="[object Set]",hCe="[object String]",pCe="[object Symbol]",fCe="[object ArrayBuffer]",gCe="[object DataView]",mCe="[object Float32Array]",vCe="[object Float64Array]",yCe="[object Int8Array]",bCe="[object Int16Array]",xCe="[object Int32Array]",wCe="[object Uint8Array]",CCe="[object Uint8ClampedArray]",_Ce="[object Uint16Array]",SCe="[object Uint32Array]";function kCe(e,t,r){var n=e.constructor;switch(t){case fCe:return eD(e);case aCe:case sCe:return new n(+e);case gCe:return rCe(e,r);case mCe:case vCe:case yCe:case bCe:case xCe:case wCe:case CCe:case _Ce:case SCe:return l$(e,r);case lCe:return new n;case cCe:case hCe:return new n(e);case uCe:return iCe(e);case dCe:return new n;case pCe:return oCe(e)}}var c$=Object.create,QC=function(){function e(){}return function(t){if(!po(t))return{};if(c$)return c$(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function u$(e){return typeof e.constructor=="function"&&!V3(e)?QC(Z3(e)):{}}var MCe="[object Map]";function TCe(e){return Jo(e)&&Pl(e)==MCe}var d$=Sd&&Sd.isMap,ACe=d$?oy(d$):TCe,ECe="[object Set]";function PCe(e){return Jo(e)&&Pl(e)==ECe}var h$=Sd&&Sd.isSet,DCe=h$?oy(h$):PCe,LCe=1,OCe=2,ICe=4,p$="[object Arguments]",NCe="[object Array]",RCe="[object Boolean]",FCe="[object Date]",jCe="[object Error]",f$="[object Function]",BCe="[object GeneratorFunction]",zCe="[object Map]",$Ce="[object Number]",g$="[object Object]",WCe="[object RegExp]",HCe="[object Set]",UCe="[object String]",GCe="[object Symbol]",VCe="[object WeakMap]",YCe="[object ArrayBuffer]",qCe="[object DataView]",ZCe="[object Float32Array]",XCe="[object Float64Array]",KCe="[object Int8Array]",QCe="[object Int16Array]",JCe="[object Int32Array]",e_e="[object Uint8Array]",t_e="[object Uint8ClampedArray]",r_e="[object Uint16Array]",n_e="[object Uint32Array]",Nn={};Nn[p$]=Nn[NCe]=Nn[YCe]=Nn[qCe]=Nn[RCe]=Nn[FCe]=Nn[ZCe]=Nn[XCe]=Nn[KCe]=Nn[QCe]=Nn[JCe]=Nn[zCe]=Nn[$Ce]=Nn[g$]=Nn[WCe]=Nn[HCe]=Nn[UCe]=Nn[GCe]=Nn[e_e]=Nn[t_e]=Nn[r_e]=Nn[n_e]=!0,Nn[jCe]=Nn[f$]=Nn[VCe]=!1;function wg(e,t,r,n,i,o){var a,s=t&LCe,l=t&OCe,c=t&ICe;if(r&&(a=i?r(e,n,i,o):r(e)),a!==void 0)return a;if(!po(e))return e;var d=vn(e);if(d){if(a=tCe(e),!s)return XC(e,a)}else{var h=Pl(e),u=h==f$||h==BCe;if(ny(e))return X7(e,s);if(h==g$||h==p$||u&&!i){if(a=l||u?{}:u$(e),!s)return l?Vwe(e,Bwe(a,e)):Uwe(e,Iwe(a,e))}else{if(!Nn[h])return i?e:{};a=kCe(e,h,s)}}o||(o=new El);var g=o.get(e);if(g)return g;o.set(e,a),DCe(e)?e.forEach(function(x){a.add(wg(x,t,r,x,e,o))}):ACe(e)&&e.forEach(function(x,S){a.set(S,wg(x,t,r,S,e,o))});var f=c?l?K3:X3:l?cy:ly,p=d?void 0:f(e);return R7(p||e,function(x,S){p&&(S=x,x=e[S]),W3(a,S,wg(x,t,r,S,e,o))}),a}var i_e=1,o_e=4;function ki(e){return wg(e,i_e|o_e)}function a_e(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var l=a[++i];if(r(o[l],l,o)===!1)break}return t}}var m$=a_e();function tD(e,t){return e&&m$(e,t,ly)}var s_e="__lodash_hash_undefined__";function l_e(e){return this.__data__.set(e,s_e),this}function c_e(e){return this.__data__.has(e)}function dy(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new bu;++t<r;)this.add(e[t])}dy.prototype.add=dy.prototype.push=l_e,dy.prototype.has=c_e;function u_e(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function v$(e,t){return e.has(t)}var d_e=1,h_e=2;function y$(e,t,r,n,i,o){var a=r&d_e,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(e),d=o.get(t);if(c&&d)return c==t&&d==e;var h=-1,u=!0,g=r&h_e?new dy:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var f=e[h],p=t[h];if(n)var x=a?n(p,f,h,t,e,o):n(f,p,h,e,t,o);if(x!==void 0){if(x)continue;u=!1;break}if(g){if(!u_e(t,function(S,j){if(!v$(g,j)&&(f===S||i(f,S,r,n,o)))return g.push(j)})){u=!1;break}}else if(!(f===p||i(f,p,r,n,o))){u=!1;break}}return o.delete(e),o.delete(t),u}function p_e(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function rD(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var f_e=1,g_e=2,m_e="[object Boolean]",v_e="[object Date]",y_e="[object Error]",b_e="[object Map]",x_e="[object Number]",w_e="[object RegExp]",C_e="[object Set]",__e="[object String]",S_e="[object Symbol]",k_e="[object ArrayBuffer]",M_e="[object DataView]",b$=js?js.prototype:void 0,nD=b$?b$.valueOf:void 0;function T_e(e,t,r,n,i,o,a){switch(r){case M_e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case k_e:return!(e.byteLength!=t.byteLength||!o(new KC(e),new KC(t)));case m_e:case v_e:case x_e:return Kv(+e,+t);case y_e:return e.name==t.name&&e.message==t.message;case w_e:case __e:return e==t+"";case b_e:var s=p_e;case C_e:var l=n&f_e;if(s||(s=rD),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=g_e,a.set(e,t);var d=y$(s(e),s(t),n,i,o,a);return a.delete(e),d;case S_e:if(nD)return nD.call(e)==nD.call(t)}return!1}var A_e=1,E_e=Object.prototype,P_e=E_e.hasOwnProperty;function D_e(e,t,r,n,i,o){var a=r&A_e,s=X3(e),l=s.length,c=X3(t),d=c.length;if(l!=d&&!a)return!1;for(var h=l;h--;){var u=s[h];if(!(a?u in t:P_e.call(t,u)))return!1}var g=o.get(e),f=o.get(t);if(g&&f)return g==t&&f==e;var p=!0;o.set(e,t),o.set(t,e);for(var x=a;++h<l;){u=s[h];var S=e[u],j=t[u];if(n)var U=a?n(j,S,u,t,e,o):n(S,j,u,e,t,o);if(!(U===void 0?S===j||i(S,j,r,n,o):U)){p=!1;break}x||(x=u=="constructor")}if(p&&!x){var B=e.constructor,R=t.constructor;B!=R&&"constructor"in e&&"constructor"in t&&!(typeof B=="function"&&B instanceof B&&typeof R=="function"&&R instanceof R)&&(p=!1)}return o.delete(e),o.delete(t),p}var L_e=1,x$="[object Arguments]",w$="[object Array]",JC="[object Object]",O_e=Object.prototype,C$=O_e.hasOwnProperty;function I_e(e,t,r,n,i,o){var a=vn(e),s=vn(t),l=a?w$:Pl(e),c=s?w$:Pl(t);l=l==x$?JC:l,c=c==x$?JC:c;var d=l==JC,h=c==JC,u=l==c;if(u&&ny(e)){if(!ny(t))return!1;a=!0,d=!1}if(u&&!d)return o||(o=new El),a||G3(e)?y$(e,t,r,n,i,o):T_e(e,t,l,r,n,i,o);if(!(r&L_e)){var g=d&&C$.call(e,"__wrapped__"),f=h&&C$.call(t,"__wrapped__");if(g||f){var p=g?e.value():e,x=f?t.value():t;return o||(o=new El),i(p,x,r,n,o)}}return u?(o||(o=new El),D_e(e,t,r,n,i,o)):!1}function hy(e,t,r,n,i){return e===t?!0:e==null||t==null||!Jo(e)&&!Jo(t)?e!==e&&t!==t:I_e(e,t,r,n,hy,i)}var N_e=1,R_e=2;function F_e(e,t,r,n){var i=r.length,o=i;if(e==null)return!o;for(e=Object(e);i--;){var a=r[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=r[i];var s=a[0],l=e[s],c=a[1];if(a[2]){if(l===void 0&&!(s in e))return!1}else{var d=new El,h;if(!(h===void 0?hy(c,l,N_e|R_e,n,d):h))return!1}}return!0}function _$(e){return e===e&&!po(e)}function j_e(e){for(var t=ly(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,_$(i)]}return t}function S$(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function B_e(e){var t=j_e(e);return t.length==1&&t[0][2]?S$(t[0][0],t[0][1]):function(r){return r===e||F_e(r,e,t)}}var z_e="[object Symbol]";function e_(e){return typeof e=="symbol"||Jo(e)&&Al(e)==z_e}var $_e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W_e=/^\w*$/;function iD(e,t){if(vn(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||e_(e)?!0:W_e.test(e)||!$_e.test(e)||t!=null&&e in Object(t)}var H_e="Expected a function";function oD(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(H_e);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(oD.Cache||bu),r}oD.Cache=bu;var U_e=500;function G_e(e){var t=oD(e,function(n){return r.size===U_e&&r.clear(),n}),r=t.cache;return t}var V_e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y_e=/\\(\\)?/g,q_e=G_e(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(V_e,function(r,n,i,o){t.push(i?o.replace(Y_e,"$1"):n||r)}),t});function py(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Z_e=1/0,k$=js?js.prototype:void 0,M$=k$?k$.toString:void 0;function aD(e){if(typeof e=="string")return e;if(vn(e))return py(e,aD)+"";if(e_(e))return M$?M$.call(e):"";var t=e+"";return t=="0"&&1/e==-Z_e?"-0":t}function kd(e){return e==null?"":aD(e)}function Cg(e,t){return vn(e)?e:iD(e,t)?[e]:q_e(kd(e))}var X_e=1/0;function _g(e){if(typeof e=="string"||e_(e))return e;var t=e+"";return t=="0"&&1/e==-X_e?"-0":t}function t_(e,t){t=Cg(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[_g(t[r++])];return r&&r==n?e:void 0}function Md(e,t,r){var n=e==null?void 0:t_(e,t);return n===void 0?r:n}function K_e(e,t){return e!=null&&t in Object(e)}function Q_e(e,t,r){t=Cg(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var a=_g(t[n]);if(!(o=e!=null&&r(e,a)))break;e=e[a]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&H3(i)&&iy(a,i)&&(vn(e)||ry(e)))}function T$(e,t){return e!=null&&Q_e(e,t,K_e)}var J_e=1,eSe=2;function tSe(e,t){return iD(e)&&_$(t)?S$(_g(e),t):function(r){var n=Md(r,e);return n===void 0&&n===t?T$(r,e):hy(t,n,J_e|eSe)}}function r_(e){return e}function rSe(e){return function(t){return t==null?void 0:t[e]}}function nSe(e){return function(t){return t_(t,e)}}function iSe(e){return iD(e)?rSe(_g(e)):nSe(e)}function ip(e){return typeof e=="function"?e:e==null?r_:typeof e=="object"?vn(e)?tSe(e[0],e[1]):B_e(e):iSe(e)}function oSe(e,t){var r={};return t=ip(t),tD(e,function(n,i,o){ty(r,i,t(n,i,o))}),r}function aSe(e){for(var t=e.length,r=5381,n=52711,i;t--;)i=e.charCodeAt(t),r=r*33^i,n=n*33^i;return(r>>>0)*4096+(n>>>0)}var fy="|",sSe=/\[object ([HTML|SVG](.*)Element)\]/,lSe={"[object Arguments]":0,"[object Array]":1,"[object ArrayBuffer]":2,"[object AsyncFunction]":3,"[object AsyncGeneratorFunction]":4,"[object BigInt]":5,"[object BigInt64Array]":6,"[object BigUint64Array]":7,"[object Boolean]":8,"[object DataView]":9,"[object Date]":10,"[object DocumentFragment]":11,"[object Error]":12,"[object Event]":13,"[object Float32Array]":14,"[object Float64Array]":15,"[object Function]":16,"[object Generator]":17,"[object GeneratorFunction]":18,"[object Int8Array]":19,"[object Int16Array]":20,"[object Map]":21,"[object Number]":22,"[object Object]":23,"[object Promise]":24,"[object RegExp]":25,"[object Set]":26,"[object SharedArrayBuffer]":27,"[object String]":28,"[object Uint8Array]":29,"[object Uint8ClampedArray]":30,"[object Uint16Array]":31,"[object Uint32Array]":32,"[object WeakMap]":33,"[object WeakRef]":34,"[object WeakSet]":35,CUSTOM:36,ELEMENT:37},cSe={"[object Arguments]":1,"[object Array]":2},A$={"[object Generator]":1,"[object Promise]":2,"[object WeakMap]":3,"[object WeakRef]":4,"[object WeakSet]":5},uSe={"[object AsyncFunction]":1,"[object AsyncGeneratorFunction]":2,"[object Boolean]":3,"[object Function]":4,"[object GeneratorFunction]":5,"[object Number]":6,"[object String]":7},dSe={"[object BigInt64Array]":1,"[object BigUint64Array]":2,"[object Float32Array]":3,"[object Float64Array]":4,"[object Int8Array]":5,"[object Int16Array]":6,"[object Uint8Array]":7,"[object Uint8ClampedArray]":8,"[object Uint16Array]":9,"[object Uint32Array]":10},hSe={"[object Arguments]":1,"[object Array]":2,"[object ArrayBuffer]":3,"[object BigInt64Array]":4,"[object BigUint64Array]":5,"[object DataView]":6,"[object Float32Array]":7,"[object Float64Array]":8,"[object Int8Array]":9,"[object Int16Array]":10,"[object Map]":11,"[object Object]":12,"[object Set]":13,"[object SharedArrayBuffer]":14,"[object Uint8Array]":15,"[object Uint8ClampedArray]":16,"[object Uint16Array]":17,"[object Uint32Array]":18,CUSTOM:19},gy={bigint:"i",boolean:"b",empty:"e",function:"g",number:"n",object:"o",string:"s",symbol:"s"};function pSe(e,t){return e[0]>t[0]}function E$(e,t){return e>t}function sD(e,t){for(var r,n,i=0;i<e.length;++i){for(n=e[i],r=i-1;~r&&t(e[r],n);--r)e[r+1]=e[r];e[r+1]=n}return e}function fo(e,t){return gy.object+fy+lSe[e]+fy+t}var P$=new WeakMap,fSe=0;function lD(e,t){var r=P$.get(e);if(r)return r;var n=fo(t,"NOT_ENUMERABLE"+fy+fSe++);return P$.set(e,n),n}var gSe=Object.prototype.toString;function mSe(e,t,r){if(hSe[t])return D$(t,e,r);if(t==="[object Date]")return fo(t,e.getTime());if(t==="[object RegExp]")return fo(t,e.toString());if(t==="[object Event]")return fo(t,[e.bubbles,e.cancelBubble,e.cancelable,e.composed,e.currentTarget,e.defaultPrevented,e.eventPhase,e.isTrusted,e.returnValue,e.target,e.type].join());if(t==="[object Error]")return fo(t,e.message+fy+e.stack);if(t==="[object DocumentFragment]")return fo(t,wSe(e));var n=t.match(sSe);return n?fo("ELEMENT",n[1]+fy+e.outerHTML):A$[t]?lD(e,t):uSe[t]?fo(t,e.toString()):D$("CUSTOM",e,r)}function D$(e,t,r){var n=r.cache.get(t);return n?fo(e,"RECURSIVE~"+n):(r.cache.set(t,++r.id),e==="[object Object]"?t[Symbol.iterator]?lD(t,e):fo(e,O$(t,r)):cSe[e]?fo(e,vSe(t,r)):e==="[object Map]"?fo(e,CSe(t,r)):e==="[object Set]"?fo(e,_Se(t,r)):dSe[e]?fo(e,t.join()):e==="[object ArrayBuffer]"?fo(e,L$(t)):e==="[object DataView]"?fo(e,L$(t.buffer)):A$[e]?lD(t,e):fo("CUSTOM",O$(t,r)))}function vSe(e,t){for(var r=e.length,n=new Array(r);--r>=0;)n[r]=Sg(e[r],t);return n.join()}function ySe(e){return Buffer.from(e).toString("utf8")}function bSe(e){return String.fromCharCode.apply(null,new Uint16Array(e))}function xSe(){return"UNSUPPORTED"}function wSe(e){for(var t=e.children,r=t.length,n=new Array(r);--r>=0;)n[r]=t[r].outerHTML;return n.join()}var L$=typeof Buffer!="undefined"&&typeof Buffer.from=="function"?ySe:typeof Uint16Array=="function"?bSe:xSe;function CSe(e,t){var r=new Array(e.size),n=0;for(e.forEach(function(i,o){r[n++]=[Sg(o,t),Sg(i,t)]}),sD(r,pSe);--n>=0;)r[n]="["+r[n][0]+","+r[n][1]+"]";return"["+r.join()+"]"}function O$(e,t){for(var r=sD(Object.getOwnPropertyNames(e),E$),n=r.length,i=new Array(n),o=n;--o>=0;)i[o]=r[o]+":"+Sg(e[r[o]],t);return"{"+i.join()+"}"}function _Se(e,t){var r=new Array(e.size),n=0;return e.forEach(function(i){r[n++]=Sg(i,t)}),"["+sD(r,E$).join()+"]"}function Sg(e,t){var r=typeof e;return e==null||r==="undefined"?gy.empty+e:r==="object"?mSe(e,gSe.call(e),t||{cache:new WeakMap,id:1}):r==="function"||r==="symbol"?gy[r]+e.toString():r==="boolean"?gy.boolean+ +e:gy[r]+e}function I$(e){return aSe(Sg(e,void 0))}function cD(e,t,r){(r!==void 0&&!Kv(e[t],r)||r===void 0&&!(t in e))&&ty(e,t,r)}function N$(e){return Jo(e)&&sy(e)}var SSe="[object Object]",kSe=Function.prototype,MSe=Object.prototype,R$=kSe.toString,TSe=MSe.hasOwnProperty,ASe=R$.call(Object);function F$(e){if(!Jo(e)||Al(e)!=SSe)return!1;var t=Z3(e);if(t===null)return!0;var r=TSe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&R$.call(r)==ASe}function uD(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function ESe(e){return bg(e,cy(e))}function PSe(e,t,r,n,i,o,a){var s=uD(e,r),l=uD(t,r),c=a.get(l);if(c){cD(e,r,c);return}var d=o?o(s,l,r+"",e,t,a):void 0,h=d===void 0;if(h){var u=vn(l),g=!u&&ny(l),f=!u&&!g&&G3(l);d=l,u||g||f?vn(s)?d=s:N$(s)?d=XC(s):g?(h=!1,d=X7(l,!0)):f?(h=!1,d=l$(l,!0)):d=[]:F$(l)||ry(l)?(d=s,ry(s)?d=ESe(s):(!po(s)||yu(s))&&(d=u$(l))):h=!1}h&&(a.set(l,d),i(d,l,n,o,a),a.delete(l)),cD(e,r,d)}function dD(e,t,r,n,i){e!==t&&m$(t,function(o,a){if(i||(i=new El),po(o))PSe(e,t,a,r,dD,n,i);else{var s=n?n(uD(e,a),o,a+"",e,t,i):void 0;s===void 0&&(s=o),cD(e,a,s)}},cy)}function n_(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var j$=Math.max;function B$(e,t,r){return t=j$(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=j$(n.length-t,0),a=Array(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),n_(e,this,s)}}function DSe(e){return function(){return e}}var LSe=ZC?function(e,t){return ZC(e,"toString",{configurable:!0,enumerable:!1,value:DSe(t),writable:!0})}:r_,OSe=800,ISe=16,NSe=Date.now;function z$(e){var t=0,r=0;return function(){var n=NSe(),i=ISe-(n-r);if(r=n,i>0){if(++t>=OSe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var hD=z$(LSe);function i_(e,t){return hD(B$(e,t,r_),e+"")}function $$(e,t,r){if(!po(r))return!1;var n=typeof t;return(n=="number"?sy(r)&&iy(t,r.length):n=="string"&&t in r)?Kv(r[t],e):!1}function W$(e){return i_(function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&$$(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,o)}return t})}var pD=W$(function(e,t,r){dD(e,t,r)});function fD(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function H$(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}function RSe(e,t){return t.length<2?e:t_(e,H$(t,0,-1))}function FSe(e,t){return t=Cg(t,e),e=RSe(e,t),e==null||delete e[_g(fD(t))]}function jSe(e){return F$(e)?void 0:e}var U$=js?js.isConcatSpreadable:void 0;function BSe(e){return vn(e)||ry(e)||!!(U$&&e&&e[U$])}function G$(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=BSe),i||(i=[]);++o<a;){var s=e[o];r(s)?q3(i,s):n||(i[i.length]=s)}return i}function zSe(e){var t=e==null?0:e.length;return t?G$(e):[]}function o_(e){return hD(B$(e,void 0,zSe),e+"")}var $Se=1,WSe=2,HSe=4,a_=o_(function(e,t){var r={};if(e==null)return r;var n=!1;t=py(t,function(o){return o=Cg(o,e),n||(n=o.length>1),o}),bg(e,K3(e),r),n&&(r=wg(r,$Se|WSe|HSe,jSe));for(var i=t.length;i--;)FSe(r,t[i]);return r});let my=class extends Xv{constructor(t,r){super(D7,{key:t,interpolationOptions:r},$1e.t)}};class kg{constructor(t,r,n,i,o){this._name=t,this.type=r,this.description=n||"",i&&(this._dataSource=i),o&&(this.composeCode=o)}get name(){return this._name}set name(t){this._name=t}get dataSource(){return this._dataSource}serialize(){return{name:this.name,type:this.type,description:this.description,dataSource:this.dataSource,composeCode:this.composeCode,__serializable:"DimensionalElement"}}toJSON(){return this.serialize()}toString(){return this.jaql()}}function pc(e){let t=e.replace(/[^a-zA-Z0-9_.]/g,"").replace(/\./g,"_");return t.charAt(0).match(/[0-9]/)&&(t="_"+t),t}const gD="DM",wr={Sum:"sum",Average:"avg",Min:"min",Max:"max",Count:"count",CountDistinct:"countDistinct",Median:"median",Variance:"var",StandardDeviation:"stdev"};var Br;(function(e){e[e.None=0]="None",e[e.Ascending=1]="Ascending",e[e.Descending=2]="Descending"})(Br=Br||(Br={}));const It={Measure:"measure",MeasureTemplate:"measuretemplate",BaseMeasure:"basemeasure",CalculatedMeasure:"calculatedmeasure",Dimension:"dimension",DateDimension:"datedimension",TextDimension:"textdimension",NumericDimension:"numericdimension",DateLevel:"datelevel",Attribute:"attribute",TextAttribute:"text-attribute",NumericAttribute:"numeric-attribute",Filter:"filter",DimensionFilter:"dimensionfilter",MeasureFilter:"measurefilter",isMetadata(e){return It.isMeasure(e)||It.isDimension(e)||It.isAttribute(e)||It.isFilter(e)},isMeasureTemplate(e){return e?typeof e=="string"?e.toLowerCase()===It.MeasureTemplate:e.agg==="*"||e.aggregation==="*"||e.type&&e.type.toLowerCase()===It.MeasureTemplate:!1},isBaseMeasure(e){return e?typeof e=="string"?e.toLowerCase()===It.BaseMeasure:(e.agg||e.aggregation)&&(e.attribute||e.jaql)&&!this.isMeasureTemplate(e):!1},isMeasure(e){if(!e)return!1;if(typeof e=="string"){const t=e;return t.toLowerCase()===It.Measure||t.toLowerCase()===It.BaseMeasure||t.toLowerCase()===It.MeasureTemplate||t.toLowerCase()===It.CalculatedMeasure}return this.isBaseMeasure(e)||this.isCalculatedMeasure(e)||this.isMeasureTemplate(e)},isCalculatedMeasure(e){return e?typeof e=="string"?e.toLowerCase()===It.CalculatedMeasure:(e.expression||e.formula)&&e.context:!1},isDateDimension(e){return e?typeof e=="string"?e.toLowerCase()===It.DateDimension:(e.dim||e.expression)&&e.level:!1},isTextDimension(e){return e&&typeof e=="string"?e.toLowerCase()===It.TextDimension:!1},isNumericDimension(e){return e&&typeof e=="string"?e.toLowerCase()===It.NumericDimension:!1},isDimension(e){if(e&&typeof e=="object"&&(e=e.type),typeof e=="string"){const t=e;return t.toLowerCase()===It.DateDimension||t.toLowerCase()===It.Dimension||t.toLowerCase()===It.TextDimension||t.toLowerCase()===It.NumericDimension}return!1},isAttribute(e){if(typeof e=="string"){const t=e;return t.toLowerCase()===It.Attribute||t.toLowerCase()===It.TextAttribute||t.toLowerCase()===It.NumericAttribute||t.toLowerCase()===It.DateLevel}return e&&e.type?this.isAttribute(e.type):!1},isFilter(e){if(e&&typeof e=="object"&&(e=e.type),typeof e=="string"){const t=e;return t.toLowerCase()===It.Filter||t.toLowerCase()===It.DimensionFilter||t.toLowerCase()===It.MeasureFilter}return!1}},Ze={Years:"Years",Quarters:"Quarters",Months:"Months",Weeks:"Weeks",Days:"Days",Hours:"Hours",MinutesRoundTo30:"MinutesRoundTo30",MinutesRoundTo15:"MinutesRoundTo15",Minutes:"Minutes",Seconds:"Seconds",AggHours:"AggHours",AggMinutesRoundTo30:"AggMinutesRoundTo30",AggMinutesRoundTo15:"AggMinutesRoundTo15",AggMinutesRoundTo1:"AggMinutesRoundTo1",get all(){return[Ze.Years,Ze.Quarters,Ze.Months,Ze.Weeks,Ze.Days,Ze.Hours,Ze.MinutesRoundTo30,Ze.MinutesRoundTo15,Ze.Minutes,Ze.Seconds,Ze.AggHours,Ze.AggMinutesRoundTo30,Ze.AggMinutesRoundTo15,Ze.AggMinutesRoundTo1]}};var s_;(function(e){e.TEXT="text",e.NUMERIC="numeric",e.DATETIME="datetime"})(s_=s_||(s_={}));var vy;(function(e){e.ASC="asc",e.DESC="desc"})(vy=vy||(vy={}));var mD;(function(e){e.PRE="pre",e.POST="post"})(mD=mD||(mD={}));class Td extends kg{constructor(t,r,n,i,o,a,s,l,c,d){if(super(t,o||It.Dimension,a,l,c),this._dimensions=[],this._attributes=[],this._sort=Br.None,!c&&r){const{table:h,column:u}=cp(r);this.composeCode=Ay(h,u,"",gD)}this._sort=s||Br.None,this._expression=r,this.setDimensions(i||[]),this.setAttributes(n),d&&(this.defaultAttribute=d)}static parseType(t){switch(t){case"datetime":case It.DateDimension:return It.DateDimension;case"text":case It.TextDimension:return It.TextDimension;case"numeric":case It.NumericDimension:return It.NumericDimension}return It.TextDimension}getAttachedName(t,r){let n=t;const i=pc(t);return(i==="id"||i==="name"||Object.getOwnPropertyDescriptor(this,i)!==void 0||this[i]!==void 0)&&(n=r),n}setDimensions(t){this._dimensions=t;for(let r=0;r<t.length;r++){const n=this.getAttachedName(t[r].name,t[r].attributes[0].expression);this[pc(n)]=t[r],n!=t[r].name&&(t[r].name=n)}}setAttributes(t){this._attributes=t||[];for(let r=0;r<t.length;r++){const n=this.getAttachedName(t[r].name,t[r].expression);this[pc(n)]=t[r],t[r].name!=n&&(t[r].name=n)}}get id(){return this._expression}get attributes(){return this._attributes}get dimensions(){return this._dimensions}get expression(){return this._expression}getSort(){return this._sort}sort(t){return new Td(this.name,this.expression,this.attributes,this.dimensions,this.type,this.description,t,this.dataSource,this.composeCode,this.defaultAttribute)}serialize(){const t=super.serialize();return t.__serializable="DimensionalDimension",t.expression=this.expression,this.getSort()!==void 0&&(t.sort=this.getSort()),t.attributes=this._attributes.map(r=>r.serialize()),t.dimensions=this._dimensions.map(r=>r.serialize()),this.defaultAttribute&&(t.defaultAttribute=this.defaultAttribute.serialize()),t}jaql(t){if(this.defaultAttribute)return this.defaultAttribute.jaql(t);if(this.dimensions.length>0)return this.dimensions[0].jaql(t);const r={jaql:{title:this.name,dim:this.expression,datatype:UD(this.type)}};return this._sort!=Br.None&&(r.jaql.sort=this._sort==Br.Ascending?"asc":"desc"),t===!0?r.jaql:r}}class Mg extends Td{constructor(t,r,n,i,o,a){super(t,r,[],[],It.DateDimension,n,i,o,a),this.defaultLevel=Ze.Years,this.Years=new Gr(Ze.Years,r,Ze.Years,"yyyy",n,i,o),this.Quarters=new Gr(Ze.Quarters,r,Ze.Quarters,"Q yyyy",n,i,o),this.Months=new Gr(Ze.Months,r,Ze.Months,"yyyy-MM",n,i,o),this.Weeks=new Gr(Ze.Weeks,r,Ze.Weeks,"ww yyyy",n,i,o),this.Days=new Gr(Ze.Days,r,Ze.Days,"yyyy-MM-dd",n,i,o),this.Hours=new Gr(Ze.Hours,r,Ze.Hours,"yyyy-MM-dd HH:mm",n,i,o),this.MinutesRoundTo30=new Gr(Ze.MinutesRoundTo30,r,Ze.MinutesRoundTo30,"yyyy-MM-dd HH:mm",n,i,o),this.MinutesRoundTo15=new Gr(Ze.MinutesRoundTo15,r,Ze.MinutesRoundTo15,"yyyy-MM-dd HH:mm",n,i,o),this.Minutes=new Gr(Ze.Minutes,r,Ze.Minutes,"yyyy-MM-dd HH:mm",n,i,o),this.Seconds=new Gr(Ze.Seconds,r,Ze.Seconds,"yyyy-MM-dd HH:mm:ss",n,i,o),this.AggHours=new Gr(Ze.AggHours,r,Ze.AggHours,"HH:mm",n,i,o),this.AggMinutesRoundTo30=new Gr(Ze.AggMinutesRoundTo30,r,Ze.AggMinutesRoundTo30,"HH:mm",n,i,o),this.AggMinutesRoundTo15=new Gr(Ze.AggMinutesRoundTo15,r,Ze.AggMinutesRoundTo15,"HH:mm",n,i,o),this.AggMinutesRoundTo1=new Gr(Ze.AggMinutesRoundTo1,r,Ze.AggMinutesRoundTo1,"HH:mm",n,i,o),this.setAttributes([this.Years,this.Quarters,this.Months,this.Weeks,this.Days,this.Hours,this.MinutesRoundTo30,this.MinutesRoundTo15,this.Minutes,this.Seconds,this.AggHours,this.AggMinutesRoundTo30,this.AggMinutesRoundTo15,this.AggMinutesRoundTo1])}get id(){return this.expression}setDimensions(){}setAttributes(t){this._attributes=t}getSort(){return this._sort}sort(t){return new Mg(this.name,this.expression,this.description,t,this.dataSource,this.composeCode)}serialize(){const t=super.serialize();return t.__serializable="DimensionalDateDimension",t}jaql(t){const r=this[this.defaultLevel].jaql();return r.jaql.title=this.name,t?r.jaql:r}}function V$(e){const t=e.name||e.title,r=e.desc||e.description,n=e.expression||e.dim,i=Td.parseType(e.dimtype||e.type),o=e.sort,a=e.dataSource;if(i==It.DateDimension)return new Mg(t,n,r,o,a);const s=Object.getOwnPropertyNames(e).map(d=>e[d]).filter(d=>It.isAttribute(d==null?void 0:d.type));if(s.length==0)if(e.attributes){let d;for(let h=0;h<e.attributes.length;h++)d=e.attributes[h],s.push(new xu(d.name,d.expression,d.type,d.description,d.sort,d.dataSource))}else n&&s.push(new xu(t,n,i,r,o,a));const l=Object.getOwnPropertyNames(e).map(d=>e[d]).filter(d=>It.isDimension(d==null?void 0:d.type));if(l.length==0&&e.dimensions)for(let d=0;d<e.dimensions.length;d++)l.push(V$(e.dimensions[d]));const c=new Td(t,n,s,l,i,r,o,a);return e.defaultAttribute&&(c.defaultAttribute=s.find(d=>d.name===e.defaultAttribute)),c}function USe(e){const t=e.name||e.title,r=e.expression||e.dim,n=e.desc||e.description,i=e.sort,o=e.dataSource;return new Mg(t,r,n,i,o)}function GSe(e,t){const r=e.map(i=>VSe(i,t)),n=YSe(r);return Object.values(n).map(i=>V$(i))}const VSe=(e,t)=>{const r=e.table,n=e.tableTitle||r,i=e.id,o=e.title||i,a=Lg(t)?t:{title:t,live:!1},s=e.dimtype==="datetime"?USe({name:o,expression:i,dataSource:a,description:e.description}):xW({name:o,type:e.dimtype==="text"?"text-attribute":"numeric-attribute",expression:i,dataSource:a,description:e.description});return{dimension:{id:r,name:n,description:e.tableDescription},attribute:s}},YSe=e=>e.reduce((t,{dimension:r,attribute:n})=>{const i=t[r.name]||{name:r.name,expression:r.id,description:r.description};return Object.assign(Object.assign({},t),{[r.name]:Object.assign(Object.assign({},i),{[n.name]:n})})},{});function vD(e,t=[]){try{return e==null?String(e):typeof e=="string"?`'${yg(e)}'`:typeof e=="number"||typeof e=="boolean"?String(e):e instanceof Date?`new Date('${e.toISOString()}')`:Array.isArray(e)?`[${e.map(r=>vD(r,t)).join(", ")}]`:typeof e=="object"&&e!==null?"composeCode"in e?e.composeCode:`{ ${Object.entries(e).filter(([n])=>!t.includes(n)).map(([n,i])=>`${/[^a-zA-Z0-9_$]/.test(n)?`'${n}'`:n}: ${vD(i,t)}`).join(", ")} }`:JSON.stringify(e)}catch(r){return console.error(r,JSON.stringify(e,null,2)),JSON.stringify(e)}}function qSe(e){let t=e.length;for(;t>0&&e[t-1]===void 0;)t--;return e.slice(0,t)}function l_(e,t){return function(r){return function(...n){const i=qSe(n),o=i.length,a=i.map(c=>vD(c,["guid"])).filter((c,d)=>!(["","{ }","[]","undefined","null"].includes(c)&&d===o-1)).join(", "),s=`${e}.${t!=null?t:r.name}(${a})`,l=r(...n);return l.composeCode=s,l}}}function Nr(e,t){return l_("filterFactory",t)(e)}function Y$(e,t){return l_("filterFactory.logic",t)(e)}function q$(e,t){return l_("analyticsFactory",t)(e)}function Bs(e,t){return l_("measureFactory",t)(e)}function ZSe(e,t,r){if(typeof r=="number")e.push(r.toString());else if(r&&It.isMeasureTemplate(r.type)){r=r.sum();const n=`[${pc(r.name)}]`;e.push(n),t[n]=r}else if(r&&It.isMeasure(r.type)){const n=`[${pc(r.name)}]`;e.push(n),t[n]=r}else if(r&&It.isFilter(r.type)){const n=`[${pc(r.name)}]`;e.push(n),t[n]=r}else if(r&&It.isAttribute(r.type)){const n=`[${pc(r.name)}]`;e.push(n),t[n]=r}}function Z$(e,t,r,n){const i={},o=[r+"("];return ZSe(o,i,e),n&&o.push(`, ${n}`),o.push(")"),new op(t,o.join(""),i)}const Ro=Bs((e,t,r)=>{const n=Object.fromEntries(Object.entries(r).map(([i,o])=>[i.startsWith("[")?i:`[${i}]`,o]));return new op(e,t,n)},"customFormula"),fc=Bs((e,t,r,n)=>new rs(r!=null?r:`${t.toString()} ${e.name}`,e,t,n),"aggregate"),yD=Bs((e,t,r)=>fc(e,wr.Sum,t,r),"sum"),XSe=Bs((e,t,r)=>fc(e,wr.Average,t,r),"average"),KSe=Bs((e,t,r)=>fc(e,wr.Average,t,r),"avg"),bD=Bs((e,t,r)=>fc(e,wr.Min,t,r),"min"),c_=Bs((e,t,r)=>fc(e,wr.Max,t,r),"max"),xD=Bs((e,t,r)=>fc(e,wr.Median,t,r),"median"),X$=Bs((e,t,r)=>fc(e,wr.Count,t,r),"count"),u_=Bs((e,t,r)=>fc(e,wr.CountDistinct,t,r),"countDistinct"),QSe=Bs((e,t,r)=>{let n;const i=o=>o.replace("advancedSmoothing","smooth").replace("localEstimates","local");return r&&(n=Object.entries(r).map(o=>i(`"${o[0]}=${o[1]}"`)).join(",")),Z$(e,t!=null?t:e.name+" Trend","trend",n)},"trend"),JSe=Bs((e,t,r)=>{let n;if(r){const i=Object.assign({forecastHorizon:3},r);if(i.startDate){const o=new Date(i.startDate);i.startDate=o.toISOString().replace(/.\d+Z$/g,"")}if(i.endDate){const o=new Date(i.endDate);i.endDate=o.toISOString().replace(/.\d+Z$/g,"")}n=Object.entries(i).map(o=>`"${o[0]}=${o[1]}"`).join(",")}else n='"forecastHorizon=3"';return Z$(e,t!=null?t:e.name+" Forecast","forecast",n)},"forecast");class wD extends kg{constructor(t,r,n,i,o,a,s){super(t,r,i,a,s),this._sort=Br.None,this._format="#,#.00",this._format=n,this._sort=o||Br.None}getSort(){return this._sort}getFormat(){return this._format}serialize(){const t=super.serialize();return this.getFormat()!==void 0&&(t.format=this.getFormat()),this.getSort()!==void 0&&(t.sort=this.getSort()),t}}class rs extends wD{constructor(t,r,n,i,o,a,s,l){super(t,It.BaseMeasure,i,o,a,s,l),this.attribute=r,this.aggregation=n}static aggregationFromJAQL(t){switch(t){case"sum":return wr.Sum;case"avg":return wr.Average;case"min":return wr.Min;case"max":return wr.Max;case"countduplicates":return wr.Count;case"median":return wr.Median;case"count":return wr.CountDistinct;case"var":return wr.Variance;case"stdev":return wr.StandardDeviation}return wr.Sum}static aggregationToJAQL(t){switch(t){case wr.Sum:return"sum";case wr.Average:return"avg";case wr.Min:return"min";case wr.Max:return"max";case wr.Count:return"countduplicates";case wr.CountDistinct:return"count";case wr.Median:return"median";case wr.Variance:return"var";case wr.StandardDeviation:return"stdev"}return wr.Sum}sort(t){return new rs(this.name,this.attribute,this.aggregation,this._format,this.description,t,this.dataSource,this.composeCode)}format(t){return new rs(this.name,this.attribute,this.aggregation,t,this.description,this._sort,this.dataSource,this.composeCode)}get id(){return`${this.attribute.expression}_${this.aggregation}`}serialize(){const t=super.serialize();return t.__serializable="DimensionalBaseMeasure",t.aggregation=this.aggregation,t.attribute=this.attribute.serialize(),t}jaql(t){const r=this.attribute.jaql(!0),n={jaql:Object.assign(Object.assign({},r),{title:this.name,agg:rs.aggregationToJAQL(this.aggregation)})};return this._format&&(n.format={number:this._format}),this._sort!=Br.None&&(n.jaql.sort=this._sort==Br.Ascending?"asc":"desc"),t===!0?n.jaql:n}}class op extends wD{constructor(t,r,n,i,o,a,s,l){super(t,It.CalculatedMeasure,i,o,a,s,l),this.expression=r,this.context=n}sort(t){return new op(this.name,this.expression,this.context,this._format,this.description,t,this.dataSource,this.composeCode)}format(t){return new op(this.name,this.expression,this.context,t,this.description,this._sort,this.dataSource,this.composeCode)}get id(){return this.expression}serialize(){const t=super.serialize();return t.__serializable="DimensionalCalculatedMeasure",t.expression=this.expression,t.context=Object.fromEntries(Object.entries(this.context).map(([r,n])=>[r,n.serialize?n.serialize(n):n])),t}jaql(t){const r={jaql:{title:this.name,formula:this.expression}},n={};return Object.getOwnPropertyNames(this.context).forEach(o=>n[o]=this.context[o].jaql(!0)),r.jaql.context=n,this._format&&(r.format={number:this._format}),this._sort!=Br.None&&(r.jaql.sort=this._sort==Br.Ascending?"asc":"desc"),t===!0?r.jaql:r}}class yy extends wD{constructor(t,r,n,i,o,a,s){super(t,It.MeasureTemplate,n,i,o,a,s),this.attribute=r}get id(){return`${this.attribute.expression}_*`}serialize(){const t=super.serialize();return t.__serializable="DimensionalMeasureTemplate",t.attribute=this.attribute.serialize(),t}sort(t){return new yy(this.name,this.attribute,this._format,this.description,t,this.dataSource,this.composeCode)}format(t){return new yy(this.name,this.attribute,t,this.description,this._sort,this.dataSource,this.composeCode)}jaql(t){return this.sum().sort(this._sort).jaql(t)}sum(t){return yD(this.attribute,t).sort(this._sort)}average(t){return XSe(this.attribute,t).sort(this._sort)}median(t){return xD(this.attribute,t).sort(this._sort)}min(t){return xD(this.attribute,t).sort(this._sort)}max(t){return c_(this.attribute,t).sort(this._sort)}count(t){return X$(this.attribute,t).sort(this._sort)}countDistinct(t){return u_(this.attribute,t).sort(this._sort)}}function Fo(e,t){return hy(e,t)}const d_=()=>({guid:bW(13),disabled:!1,locked:!1}),K$=()=>Object.assign(Object.assign({},d_()),{excludeMembers:!1,enableMultiSelection:!0,deactivatedMembers:[]});function e2e(e){return"excludeMembers"in e}const Q$=e=>{const t=e2e(e)?K$():d_();return Object.fromEntries(Object.entries(e).filter(([r,n])=>!Fo(n,t[r])))},Ki={Contains:"contains",StartsWith:"startsWith",EndsWith:"endsWith",Equals:"equals",DoesntEqual:"doesntEqual",DoesntStartWith:"doesntStartWith",DoesntContain:"doesntContain",DoesntEndWith:"doesntEndWith",Like:"like"},Tn={Equals:"equals",DoesntEqual:"doesntEqual",From:"from",FromNotEqual:"fromNotEqual",To:"to",ToNotEqual:"toNotEqual"},zs={From:"from",To:"to",Last:"last",Next:"next",Anchor:"Anchor"},J$={Union:"or",Intersection:"and",Exclude:"exclude"},h_={Top:"top",Bottom:"bottom"},Tt={logicalAttribute:"logicalAttribute",members:"members",exclude:"exclude",measure:"measure",ranking:"ranking",text:"text",numeric:"numeric",dateRange:"dateRange",relativeDate:"relativeDate",cascading:"cascading",advanced:"advanced"};class ns extends kg{constructor(t,r,n,i){super("filter",It.Filter,void 0,void 0,i),this.filterType=r,this.isScope=!0,ns.checkAttributeSupport(t),this.attribute=t,this.config=pD({},d_(),n!=null?n:{})}get name(){return I$(this.jaql()).toString(16)}serialize(){const t=super.serialize();return t.__serializable="AbstractFilter",t.filterType=this.filterType,t.attribute=this.attribute.serialize(),this.config&&(t.config=this.config),t.composeCode=this.composeCode,t}jaql(t){if(this.config.disabled)return ns.disabledJaql(t);const r=this.attribute.jaql(!1),n=this.attribute;if(n.getFormat&&n.getFormat()!==void 0){const i=n.translateGranularityToJaql();r.format={mask:{[i.level]:n.getFormat()}}}return r.jaql.filter=this.filterJaql(),this.attribute.dataSource&&(r.jaql.datasource=this.attribute.dataSource),this.isScope&&(r.panel="scope"),t===!0?r.jaql:r}static checkAttributeSupport(t){const{granularity:r}=t;if(r===Ze.Hours||r===Ze.MinutesRoundTo30||r===Ze.MinutesRoundTo15||r===Ze.Minutes||r===Ze.Seconds)throw new my("errors.filter.unsupportedDatetimeLevel")}static disabledJaql(t){return t?{filter:{}}:{jaql:{filter:{}}}}}class p_ extends ns{constructor(t,r,n,i){super(t[0].attribute,Tt.logicalAttribute,n,i),this.operator=r,this.filters=t}get id(){return`${this.operator}_${this.filters.map(t=>t.id).join()}`}serialize(){const t=super.serialize();return t.__serializable="LogicalAttributeFilter",t.operator=this.operator,t.filters=this.filters.map(r=>r.serialize()),t}filterJaql(){const t={};return t[this.operator]=this.filters.map(r=>r.filterJaql()),t}}class CD extends ns{constructor(t,r,n,i){if(super(t,Tt.members,void 0,i),this.members=r!=null?r:[],this.members.filter(o=>o==null).length>0)throw new my("errors.filter.membersFilterNullMember",{attributeId:t.id});this.config=pD({},K$(),n!=null?n:{})}get id(){return`${this.attribute.id}_${this.members.map(t=>t.toString()).join()}`}get name(){return I$([this.jaql(),a_(this.config,["guid","originalFilterJaql"])]).toString(16)}serialize(){const t=super.serialize();return t.__serializable="MembersFilter",this.config&&(t.config=this.config.backgroundFilter?Object.assign(Object.assign({},this.config),{backgroundFilter:this.config.backgroundFilter.serialize()}):this.config),t.members=this.members,t}filterJaql(){const t={members:this.members.map(n=>n.toString())},r=this.config.excludeMembers?{exclude:t}:t;return this.config.backgroundFilter?{and:[r,this.config.backgroundFilter.filterJaql()]}:r}}class by extends ns{constructor(t,r,n){super(t[0].attribute,Tt.cascading,r,n),this._filters=t}get filters(){const{disabled:t,locked:r}=this.config;return this._filters.map(n=>(n.config=Object.assign(Object.assign({},n.config),{disabled:t,locked:r}),n))}get id(){return`${this.filterType}_${this._filters.map(t=>t.id).join()}`}serialize(){const t=super.serialize();return t.__serializable="CascadingFilter",t._filters=this.filters.map(r=>r.serialize()),t}filterJaql(){return{}}jaql(t){return this.config.disabled?ns.disabledJaql(t):this.filters.map(r=>(r.isScope=!0,r.jaql(t)))}}class _D extends ns{constructor(t,r,n,i){super(t.attribute,Tt.exclude,n,i),this.input=r,this.filter=t}get id(){let t=`exclude_${this.filter.id}`;return this.input&&(t+="_from_"+this.input.id),t}serialize(){const t=super.serialize();return t.__serializable="ExcludeFilter",t.filter=this.filter.serialize(),this.input&&(t.input=this.input.serialize()),t}filterJaql(){const t={},r=this.filter.filterJaql();return this.input?(t.filter=this.input.filterJaql(),t.filter.filter={exclude:r}):t.exclude=r,t}}class f_ extends ns{constructor(t,r,n,i,o,a,s,l){super(t,r,s,l),n&&i!==void 0&&(this.valueA=i,this.operatorA=n),o&&a!==void 0&&(this.operatorB=o,this.valueB=a)}get id(){let t=`${this.attribute.id}`;return this.operatorA&&this.valueA!==void 0&&(t+=`_${this.operatorA}:${this.valueA}`),this.operatorB&&this.valueB!==void 0&&(t+=`_${this.operatorB}:${this.valueB}`),t}serialize(){const t=super.serialize();return t.__serializable="DoubleOperatorFilter",this.operatorA&&(t.operatorA=this.operatorA),this.operatorB&&(t.operatorB=this.operatorB),this.valueA!==void 0&&(t.valueA=this.valueA),this.valueB!==void 0&&(t.valueB=this.valueB),t}filterJaql(){const t={};return this.operatorA&&this.valueA!==void 0&&(t[this.operatorA]=this.valueA),this.operatorB&&this.valueB!==void 0&&(t[this.operatorB]=this.valueB),t}}class SD extends f_{constructor(t,r,n,i,o,a,s,l){super(t,Tt.measure,n,i,o,a,s,l),this.measure=r}get id(){let t=`${this.attribute.id}_${this.measure.id}`;return this.operatorA&&this.valueA!==void 0&&(t+=`_${this.operatorA}:${this.valueA}`),this.operatorB&&this.valueB!==void 0&&(t+=`_${this.operatorB}${this.valueB}`),t}serialize(){const t=super.serialize();return t.__serializable="MeasureFilter",t.measure=this.measure.serialize(),t}jaql(t){if(this.config.disabled)return ns.disabledJaql(t);const r=super.jaql(t);return this.measure instanceof rs&&Object.entries(this.measure.jaql().jaql).forEach(([n,i])=>{r.jaql[n]=i}),r}}class g_ extends ns{constructor(t,r,n,i,o,a){super(t,Tt.ranking,o,a),this.count=i,this.operator=n,this.measure=r}get id(){return`${this.operator}_${this.count}_${this.attribute.id}_by_${this.measure.id}`}serialize(){const t=super.serialize();return t.__serializable="RankingFilter",t.count=this.count,t.operator=this.operator,t.measure=this.measure.serialize(),t}filterJaql(){const t={};return t[this.operator]=this.count,t.by=this.measure.jaql(!0),t}}class kD extends f_{constructor(t,r,n,i,o,a,s){super(t,Tt.numeric,r,n,i,o,a,s)}serialize(){const t=super.serialize();return t.__serializable="NumericFilter",t}}class Dl extends f_{constructor(t,r,n,i,o){super(t,Tt.text,r,n,void 0,void 0,i,o)}serialize(){const t=super.serialize();return t.__serializable="TextFilter",t}}class MD extends f_{constructor(t,r,n,i,o){super(t,Tt.dateRange,zs.From,r,zs.To,n,i,o),typeof r=="object"&&(this.valueA=r.toISOString()),typeof n=="object"&&(this.valueB=n.toISOString())}get level(){return this.attribute}get from(){return this.valueA}get to(){return this.valueB}filterJaql(){return super.filterJaql()}serialize(){const t=super.serialize();return t.__serializable="DateRangeFilter",t}}let xy=class extends ns{constructor(t,r,n,i,o,a,s){super(t,Tt.relativeDate,a,s),i||(i=zs.Next),this.anchor=o,this.operator=i,this.offset=r,this.count=n}get level(){return this.attribute}get id(){let t=`${this.level.id}_${this.operator}_${this.offset}_${this.count}`;return this.anchor&&(typeof this.anchor=="string"?t+=`_${this.anchor}`:typeof this.anchor=="object"&&(t+=`_${this.anchor.toISOString()}`)),t}serialize(){const t=super.serialize();return t.__serializable="RelativeDateFilter",t.offset=this.offset,t.count=this.count,t.operator=this.operator,this.anchor&&(t.anchor=typeof this.anchor=="string"?this.anchor:this.anchor.toISOString()),t}filterJaql(){const t={};return t[this.operator]={offset:this.offset,count:this.count},this.anchor&&(typeof this.anchor=="string"?t[this.operator].anchor=this.anchor:typeof this.anchor=="object"&&(t[this.operator].anchor=this.anchor.toISOString())),t}};class TD extends ns{constructor(t,r,n,i){super(t,Tt.advanced,n,i),delete r.filterType,this.jaqlExpression=r}get id(){return`custom_${this.attribute.id}_${this.config.guid}`}filterJaql(){return this.jaqlExpression}serialize(){const t=super.serialize();return t.__serializable="CustomFilter",t.jaqlExpression=this.jaqlExpression,t}}function AD(e){return"filterType"in e&&e.filterType===Tt.advanced}function go(e){return"filterType"in e&&e.filterType===Tt.members}function ED(e){return"filterType"in e&&e.filterType===Tt.numeric}function wy(e){return"filterType"in e&&e.filterType===Tt.ranking}function PD(e){return"filterType"in e&&e.filterType===Tt.measure}function Qi(e){return"filterType"in e&&e.filterType===Tt.cascading}function m_(e){return"filterType"in e&&e.filterType===Tt.relativeDate}function DD(e){return"filterType"in e&&e.filterType===Tt.text}function Tg(e){return"filterType"in e&&e.filterType===Tt.dateRange}const t2e=Nr((e,t)=>new p_(e,J$.Union,t),"union"),r2e=Nr((e,t)=>new p_(e,J$.Intersection,t),"intersection"),LD=Nr((e,t,r)=>new _D(e,t,r),"exclude"),eW=Nr((e,t,r)=>new Dl(e,Ki.DoesntContain,t,r),"doesntContain"),tW=Nr((e,t,r)=>new Dl(e,Ki.DoesntEndWith,t,r),"doesntEndWith"),rW=Nr((e,t,r)=>new Dl(e,Ki.DoesntStartWith,t,r),"doesntStartWith"),OD=Nr((e,t,r)=>new Dl(e,Ki.Contains,t,r),"contains"),nW=Nr((e,t,r)=>new Dl(e,Ki.EndsWith,t,r),"endsWith"),iW=Nr((e,t,r)=>new Dl(e,Ki.StartsWith,t,r),"startsWith"),n2e=Nr((e,t,r)=>new Dl(e,Ki.Like,t,r),"like"),ID=Nr((e,t,r)=>typeof t=="string"?new Dl(e,Ki.DoesntEqual,t,r):ap(e,Tn.DoesntEqual,t,void 0,void 0,r),"doesntEqual"),ND=Nr((e,t,r)=>typeof t=="string"?new Dl(e,Ki.Equals,t,r):ap(e,Tn.Equals,t,void 0,void 0,r),"equals"),oW=Nr((e,t,r)=>ap(e,Tn.FromNotEqual,t,void 0,void 0,r),"greaterThan"),aW=Nr((e,t,r)=>ap(e,Tn.From,t,void 0,void 0,r),"greaterThanOrEqual"),sW=Nr((e,t,r)=>ap(e,Tn.ToNotEqual,t,void 0,void 0,r),"lessThan"),lW=Nr((e,t,r)=>ap(e,Tn.To,t,void 0,void 0,r),"lessThanOrEqual"),Ag=Nr((e,t,r,n)=>ap(e,Tn.From,t,Tn.To,r,n),"between"),ap=Nr((e,t,r,n,i,o)=>new kD(e,t,r,n,i,o),"numeric"),Hi=Nr((e,t,r)=>new CD(e,t,r),"members"),RD=Nr((e,t,r,n)=>new MD(e,t,r,n),"dateRange"),i2e=Nr((e,t,r,n,i)=>new xy(e,t,r,void 0,n,i),"dateRelative"),FD=Nr((e,t,r,n,i)=>new xy(e,t,r,zs.Next,n,i),"dateRelativeFrom"),Cy=Nr((e,t,r,n,i)=>new xy(e,t,r,zs.Last,n,i),"dateRelativeTo");function Eg(e,t,r,n,i,o,a){return new SD(e,t,r,n,i,o,a)}const o2e=Nr((e,t,r)=>Eg(e.attribute,e,Tn.Equals,t,void 0,void 0,r),"measureEquals"),a2e=Nr((e,t,r)=>Eg(e.attribute,e,Tn.FromNotEqual,t,void 0,void 0,r),"measureGreaterThan"),s2e=Nr((e,t,r)=>Eg(e.attribute,e,Tn.From,t,void 0,void 0,r),"measureGreaterThanOrEqual"),l2e=Nr((e,t,r)=>Eg(e.attribute,e,Tn.To,t,void 0,void 0,r),"measureLessThanOrEqual"),c2e=Nr((e,t,r)=>Eg(e.attribute,e,Tn.ToNotEqual,t,void 0,void 0,r),"measureLessThan"),cW=Nr((e,t,r,n)=>Eg(e.attribute,e,Tn.From,t,Tn.To,r,n),"measureBetween"),uW=Nr((e,t,r,n)=>new g_(e,t,h_.Top,r,n),"topRanking"),dW=Nr((e,t,r,n)=>new g_(e,t,h_.Bottom,r,n),"bottomRanking"),sp=e=>{if(Array.isArray(e)){const[t,...r]=e;return r.length===0?sp(t):{operator:"AND",left:sp(t),right:sp(r)}}return e},jD=Nr((e,t)=>new by(e,t),"cascading");var _y;(function(e){e.and=Y$((t,r)=>({operator:"AND",left:sp(t),right:sp(r)}),"and"),e.or=Y$((t,r)=>({operator:"OR",left:sp(t),right:sp(r)}),"or")})(_y=_y||(_y={}));const u2e=Nr((e,t,r)=>new TD(e,t,r),"customFilter"),d2e=e=>{const{dim:t,datatype:r,title:n,datasource:i}=e;return w_({expression:t,dataType:r,granularity:Ty(e),title:n,dataSource:i})},h2e=e=>{const{dim:t,title:r,datatype:n,agg:i,datasource:o}=e;if(i)return C_({expression:t,dataType:n,agg:i,granularity:Ty(e),format:void 0,sort:void 0,title:r,dataSource:o})},hW=(e,t)=>{if("formula"in e)return HD(e);const{dim:r,datatype:n,agg:i}=e;return C_({expression:r,granularity:Ty(e),dataType:n,agg:i,format:void 0,sort:void 0,title:t})};var v_;(function(e){e.INCLUDE_ALL="INCLUDE_ALL",e.ADVANCED="ADVANCED",e.INVALID="INVALID",e.CONDITION="CONDITION",e.SPECIFIC_ITEMS="SPECIFIC_ITEMS"})(v_=v_||(v_={}));var y_;(function(e){e.PERIOD="PERIOD",e.DATE_RANGE="DATE_RANGE"})(y_=y_||(y_={}));var b_;(function(e){e.NUMERIC_RANGE="NUMERIC_RANGE"})(b_=b_||(b_={}));var Ad;(function(e){e.YEARS="years",e.QUARTERS="quarters",e.MONTHS="months",e.WEEKS="weeks",e.DAYS="days",e.HOURS="hours",e.MINUTES="minutes"})(Ad=Ad||(Ad={}));var Pg;(function(e){e.DATE_TIME="datetime",e.NUMERIC="numeric",e.TEXT="text"})(Pg=Pg||(Pg={}));const p2e=["1","30"],Ur=Object.assign(Object.assign(Object.assign({},v_),y_),b_),f2e={filter:{[Ur.INCLUDE_ALL]:{all:!0,filterType:Ur.INCLUDE_ALL},[Ur.PERIOD]:{last:{count:1,offset:1},isNotCurrentPeriod:!0,filterType:Ur.PERIOD},[Ur.DATE_RANGE]:{filterType:Ur.DATE_RANGE},[Ur.NUMERIC_RANGE]:{filterType:Ur.NUMERIC_RANGE},[Ur.CONDITION]:{explicit:!1,multiSelection:!0,exclude:{members:[]},filterType:Ur.CONDITION},[Ur.SPECIFIC_ITEMS]:{explicit:!0,multiSelection:!0,members:[],filterType:Ur.SPECIFIC_ITEMS}}.INCLUDE_ALL,level:Ad.YEARS};var St;(function(e){e.IS="members",e.IS_NOT="exclude",e.IS_WITHIN="isWithin",e.TOP="top",e.BOTTOM="bottom",e.AFTER="after",e.BEFORE="before",e.STARTS_WITH="startsWith",e.DOESNT_START_WITH="doesntStartWith",e.ENDS_WITH="endsWith",e.DOESNT_END_WITH="doesntEndWith",e.CONTAINS="contains",e.DOESNT_CONTAIN="doesntContain",e.EQUALS="equals",e.DOESNT_EQUAL="doesntEqual",e.IS_EMPTY="isEmpty",e.IS_NOT_EMPTY="isNotEmpty",e.GREATER_THAN="fromNotEqual",e.GREATER_THAN_OR_EQUAL="from",e.LESS_THAN="toNotEqual",e.LESS_THAN_OR_EQUAL="to",e.BETWEEN="between",e.IS_NOT_BETWEEN="isNotBetween",e.MULTIPLE_CONDITION="multipleCondition",e.NONE="none"})(St=St||(St={}));const g2e=e=>e.top!==void 0,m2e=e=>e.bottom!==void 0,v2e=e=>{var t;return!!(!((t=e.exclude)===null||t===void 0)&&t.members)},y2e=e=>!!e.members&&!!e.isCondition,b2e=e=>{var t,r;return((t=e.last)===null||t===void 0?void 0:t.anchor)!==void 0||((r=e.next)===null||r===void 0?void 0:r.anchor)!==void 0},x2e=e=>e.fromNotEqual!==void 0,w2e=e=>e.from!==void 0&&!e.isBetween,C2e=e=>e.toNotEqual!==void 0,_2e=e=>e.to!==void 0&&!e.isBetween,S2e=e=>e.equals!==void 0,k2e=e=>e.doesntEqual!==void 0,M2e=e=>!!(e.equals===""&&e.isEmpty),T2e=e=>!!(e.doesntEqual===""&&e.isEmpty),A2e=e=>e.contains!==void 0,E2e=e=>e.doesntContain!==void 0,P2e=e=>e.startsWith!==void 0,D2e=e=>e.doesntStartWith!==void 0,L2e=e=>e.endsWith!==void 0,O2e=e=>e.doesntEndWith!==void 0,I2e=e=>e.from!==void 0&&e.to!==void 0,N2e=e=>{var t,r;return((t=e.exclude)===null||t===void 0?void 0:t.from)!==void 0&&((r=e.exclude)===null||r===void 0?void 0:r.to)!==void 0},R2e=e=>!!(e.or||e.and),Dg=e=>m2e(e)?St.BOTTOM:g2e(e)?St.TOP:v2e(e)?St.IS_NOT:b2e(e)?St.IS_WITHIN:x2e(e)?St.GREATER_THAN:C2e(e)?St.LESS_THAN:S2e(e)?St.EQUALS:k2e(e)?St.DOESNT_EQUAL:M2e(e)?St.IS_EMPTY:T2e(e)?St.IS_NOT_EMPTY:A2e(e)?St.CONTAINS:E2e(e)?St.DOESNT_CONTAIN:O2e(e)?St.DOESNT_END_WITH:D2e(e)?St.DOESNT_START_WITH:L2e(e)?St.ENDS_WITH:P2e(e)?St.STARTS_WITH:N2e(e)?St.IS_NOT_BETWEEN:y2e(e)?St.IS:R2e(e)?St.MULTIPLE_CONDITION:I2e(e)?St.BETWEEN:w2e(e)?St.GREATER_THAN_OR_EQUAL:_2e(e)?St.LESS_THAN_OR_EQUAL:St.NONE,BD=(e,t,r)=>{var n,i,o,a,s,l,c;switch(Dg(t)){case St.BOTTOM:if(t.by)return dW(e,hW(t.by,t.rankingMessage),t[St.BOTTOM],{guid:r});break;case St.EQUALS:return ND(e,t[St.EQUALS],{guid:r});case St.DOESNT_EQUAL:return ID(e,t[St.DOESNT_EQUAL],{guid:r});case St.GREATER_THAN:return oW(e,t[St.GREATER_THAN],{guid:r});case St.GREATER_THAN_OR_EQUAL:return aW(e,t[St.GREATER_THAN_OR_EQUAL],{guid:r});case St.TOP:if(t.by)return uW(e,hW(t.by,t.rankingMessage),t[St.TOP],{guid:r});break;case St.STARTS_WITH:return iW(e,t[St.STARTS_WITH],{guid:r});case St.DOESNT_START_WITH:return rW(e,t[St.DOESNT_START_WITH],{guid:r});case St.ENDS_WITH:return nW(e,t[St.ENDS_WITH],{guid:r});case St.DOESNT_END_WITH:return tW(e,t[St.DOESNT_END_WITH],{guid:r});case St.CONTAINS:return OD(e,t[St.CONTAINS],{guid:r});case St.DOESNT_CONTAIN:return eW(e,t[St.DOESNT_CONTAIN],{guid:r});case St.LESS_THAN:return sW(e,t[St.LESS_THAN],{guid:r});case St.LESS_THAN_OR_EQUAL:return lW(e,t[St.LESS_THAN_OR_EQUAL],{guid:r});case St.BETWEEN:return Ag(e,t.from,t.to,{guid:r});case St.IS_NOT_BETWEEN:return LD(Ag(e,(n=t.exclude)===null||n===void 0?void 0:n.from,(i=t.exclude)===null||i===void 0?void 0:i.to,{guid:r}),void 0,{guid:r});case St.MULTIPLE_CONDITION:if(t.and)return r2e(t.and.map(h=>BD(e,h,r)),{guid:r});if(t.or)return t2e(t.or.map(h=>BD(e,h,r)),{guid:r});break;case St.IS_NOT:{const h=((o=t.filter)===null||o===void 0?void 0:o.turnedOff)&&((a=t.filter.exclude)===null||a===void 0?void 0:a.members)||[],u=((l=(s=t.exclude)===null||s===void 0?void 0:s.members)===null||l===void 0?void 0:l.filter(f=>!h.includes(f)))||[],g=Q$({guid:r,excludeMembers:!0,enableMultiSelection:(c=t.multiSelection)!==null&&c!==void 0?c:!0,deactivatedMembers:h});return Hi(e,u,g)}}throw new my("errors.filter.unsupportedConditionFilter",{filter:JSON.stringify(t)})},F2e=(e,t,r)=>{var n,i;switch(Dg(t)){case St.EQUALS:return o2e(e,t[St.EQUALS],{guid:r});case St.GREATER_THAN:return a2e(e,t[St.GREATER_THAN],{guid:r});case St.GREATER_THAN_OR_EQUAL:return s2e(e,t[St.GREATER_THAN_OR_EQUAL],{guid:r});case St.LESS_THAN:return c2e(e,t[St.LESS_THAN],{guid:r});case St.LESS_THAN_OR_EQUAL:return l2e(e,t[St.LESS_THAN_OR_EQUAL],{guid:r});case St.BETWEEN:return cW(e,t.from,t.to,{guid:r});case St.IS_NOT_BETWEEN:return LD(cW(e,(n=t.exclude)===null||n===void 0?void 0:n.from,(i=t.exclude)===null||i===void 0?void 0:i.to,{guid:r}),void 0,{guid:r})}throw new my("errors.filter.unsupportedConditionFilter",{filter:JSON.stringify(t)})},j2e=(e,t)=>{let r=e?e.toLocaleLowerCase():Ad.YEARS;return r===Ad.MINUTES&&t==="60"&&(r=Ad.HOURS),r},B2e=e=>e==null?void 0:e.all,z2e=e=>e.last?e.last:e.next,$2e=e=>{var t;return((t=z2e(e))===null||t===void 0?void 0:t.offset)<2},pW=e=>{var t;return((t=e==null?void 0:e.members)===null||t===void 0?void 0:t.length)>=0},W2e=(e,t)=>e&&typeof e=="string"||t&&typeof t=="string",H2e=(e,t)=>e===""&&t==="",U2e=(e,t)=>{const{from:r,to:n}=e;return t!==Pg.DATE_TIME?!1:W2e(r,n)?!0:H2e(r,n)},G2e=e=>{const{from:t,to:r}=e;return t!==void 0&&r!==void 0&&!e.isBetween},fW=e=>Dg(e)!==St.NONE,V2e=e=>Object.keys(e).includes("isAdvanced"),Y2e=e=>!!(e.level&&e.bucket&&e.level===Ad.MINUTES&&p2e.includes(e.bucket)),q2e=e=>e.filterType===Ur.INVALID,gW=(e,t=Pg.DATE_TIME,r)=>r&&Y2e(r)||V2e(e)?Ur.ADVANCED:B2e(e)?Ur.INCLUDE_ALL:$2e(e)?Ur.PERIOD:pW(e)?Ur.SPECIFIC_ITEMS:U2e(e,t)?Ur.DATE_RANGE:G2e(e)?Ur.NUMERIC_RANGE:fW(e)?Ur.CONDITION:(q2e(e),Ur.INVALID),Z2e=(e,t)=>{const{level:r,filter:n,bucket:i}=e,o=n||f2e.filter,a={filter:Object.assign(Object.assign({},o),{filterType:gW(o,t)})};if(t===Pg.DATE_TIME){const s=o,l=(s==null?void 0:s.level)||r;a.level=j2e(l,i),a.filter.filterType=gW(o,t,{level:l,bucket:i})}return a},mW=(e,t)=>{const r={config:Object.assign(Object.assign({},d_()),{guid:t,originalFilterJaql:e}),jaql:n=>n?e:{jaql:e,panel:"scope"},attribute:{id:e.dim},type:"filter"};return Object.assign({},r)},X2e=(e,t)=>Hi(e,[],{guid:t,excludeMembers:!0}),K2e=(e,t,r,n)=>{const i=Q2e(t),o=J2e(t,i),a=Q$({guid:r,excludeMembers:!1,enableMultiSelection:n!=null?n:!0,deactivatedMembers:i});return Hi(e,o,a)};function Q2e(e){var t,r,n,i;return!((t=e.filter)===null||t===void 0)&&t.turnedOff?(i=(n=(r=e.filter)===null||r===void 0?void 0:r.exclude)===null||n===void 0?void 0:n.members)!==null&&i!==void 0?i:[]:[]}function J2e(e,t){const r=e.members;return t?r.filter(n=>!t.includes(n)):r}const eke=(e,t,r)=>RD(e,t.from,t.to,{guid:r}),tke=(e,t,r)=>Ag(e,t.from,t.to,{guid:r}),rke=(e,t,r)=>t.last?Cy(e,t.last.offset,t.last.count,t.last.anchor,{guid:r}):FD(e,t.next.offset,t.next.count,t.next.anchor,{guid:r}),nke=(e,t,r)=>u2e(e,t,{guid:r}),vW=(e,t)=>{try{if("formula"in e)throw new my("errors.filter.formulaFiltersNotSupported",{filter:JSON.stringify(e)});const r=Z2e(e,e.datatype),{filter:n}=r,{filterType:i}=n,o=d2e(e),a=h2e(e);switch(i){case Ur.INCLUDE_ALL:return X2e(o,t);case Ur.SPECIFIC_ITEMS:return K2e(o,n,t,n.multiSelection);case Ur.CONDITION:return a?F2e(a,n,t):BD(o,n,t);case Ur.DATE_RANGE:return eke(o,n,t);case Ur.PERIOD:return rke(o,n,t);case Ur.NUMERIC_RANGE:return tke(o,n,t);case Ur.ADVANCED:return nke(o,n,t);case Ur.INVALID:return mW(e,t)}}catch(r){console.debug("Fall back to generic pass-through JAQL filter due to filter translation error:",r)}return mW(e,t)},ike=e=>["__int4","__int8","int","tinyint","bigint","int2","int4","int8","smallint","mediumint","serial","integer","byteint","int64"].includes(e.toLowerCase()),oke=e=>["basemeasure","calculatedmeasure","float","float4","float8","double precision","double","numeric","decimal","real","number","float64"].includes(e.toLowerCase()),qn=e=>ike(e)||oke(e)||e==="numeric-attribute",Sy=e=>["textdimension","string","varchar","text","ntext","char","character","character varying","smalltext","nchar","nvarchar","json","jsonb","object","text-attribute"].includes(e.toLowerCase()),mo=e=>["datelevel","date","time","datetime","timestamp without time zone","timestamp","timestamp with time zone","timestamp(6)","timestamp_tz","timestamp_ntz","timestamp_ltz","timestampltz","timestampntz","timestamptz","datetime64[ns]","timewithtimezone","timestampwithtimezone","timestamp_with_timezone"].includes(e.toLowerCase()),yW=e=>["bool","boolean","bit","logical"].includes(e.toLowerCase()),zD=e=>qn(e)?"number":mo(e)?"datetime":Sy(e)?"text":yW(e)?"boolean":"text",bW=function(e){e||(e=20);const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=new Array(e);let n=0,i;for(let o=0;o<e;o+=1){if(o>0&&o%5==0){r[o]="-";continue}n<=2&&(n=33554432+Math.random()*16777216|0),i=n&15,n=n>>4,r[o]=t[o==19?i&3|8:i]}return r.join("")},is=e=>{if(!e)return{filters:void 0,relations:void 0};if(Array.isArray(e))return{filters:e,relations:void 0};const t=new Set;function r(a){const[s,...l]=a;if(t.add(s),!l.length)return n({instanceid:s.config.guid});const c=n(s),d=r(l);return{left:c,right:d,operator:"AND"}}function n(a){return a&&(ake(a)?Qi(a)?r(a.filters):(t.add(a),{instanceid:a.config.guid}):("left"in a&&(a.left=n(a.left)),"right"in a&&(a.right=n(a.right)),"composeCode"in a&&delete a.composeCode,a))}const i=ki(e),o=n(i);return{filters:Array.from(t),relations:o}};function ake(e){return"config"in e&&"guid"in e.config}function gc(e){return typeof e=="string"?e:e.title}function Lg(e){return typeof e=="object"&&"type"in e&&"title"in e}function ky(e){return{id:e.id,address:e.address,title:e.title,type:e.live?"live":"elasticube"}}function $D(e){return Lg(e)?{title:e.title,live:e.type==="live"}:{title:e,live:!1}}function ske(e){var t;return Lg(e)?{title:e.title,live:e.type==="live",id:(t=e.id)!==null&&t!==void 0?t:"",address:e.address}:{title:e,id:""}}function lke(e){return e?e==="asc"?Br.Ascending:Br.Descending:Br.None}function cke(e){switch(e){case"sortAsc":return Br.Ascending;case"sortDesc":return Br.Descending;default:return Br.None}}const lp=(e,t,r=!1,n=!1)=>{const i=e.filter.filter&&!("turnedOff"in e.filter.filter),o=t||bW(),a=vW(e,o);if(i){const s=vW(Object.assign(Object.assign({},e),{filter:e.filter.filter}),`${t}-bg`),l=a.config;return a.config=Object.assign(Object.assign({},l),{backgroundFilter:s}),a}return a.config=Object.assign(Object.assign({},a.config),{originalFilterJaql:e,disabled:r,locked:n}),a};function cp(e){const[t,r]=e.slice(1,-1).split(".");return{table:t,column:r?r.replace("(Calendar)","").trim():""}}function WD(e){return cp(e.expression).table}function x_(e){return cp(e.expression).column}function Og(e){switch(e){case vy.ASC:return"sortAsc";case vy.DESC:return"sortDesc";default:return"sortNone"}}const w_=({expression:e,dataType:t,granularity:r,format:n,sort:i,title:o,panel:a,dataSource:s})=>{const l=cp(e).column,c=lke(i);if(t===s_.DATETIME)return new Gr(o!=null?o:l,e,r||Ze.Years,n||Gr.getDefaultFormatForGranularity(r||Ze.Years),void 0,c,s,void 0,a);const h=!t||qn(t)?It.NumericAttribute:It.TextAttribute;return new xu(o!=null?o:l,e,h,void 0,c,s,void 0,a)},C_=({expression:e,dataType:t,agg:r,granularity:n,format:i,sort:o,title:a,dataSource:s})=>{const l=w_({expression:e,dataType:t,granularity:n,format:i,sort:o,title:a,dataSource:s}),c=rs.aggregationFromJAQL(r),d=cp(e).column,h=a!=null?a:`${c} ${d}`;switch(c){case wr.Sum:return yD(l,h,i);case wr.Average:return KSe(l,h,i);case wr.Min:return bD(l,h,i);case wr.Max:return c_(l,h,i);case wr.Count:return X$(l,h,i);case wr.CountDistinct:return u_(l,h,i);case wr.Median:return xD(l,h,i);case wr.Variance:return fc(l,wr.Variance,h,i);case wr.StandardDeviation:return fc(l,wr.StandardDeviation,h,i);default:return yD(l,h,i)}},HD=e=>{var t;const r=oSe((t=e.context)!==null&&t!==void 0?t:{},n=>typeof n=="string"?n:n&&My(n));return Ro(e.title,e.formula,r)};function My(e,t,r){if("filter"in e)return lp(e);if("formula"in e)return HD(e);const o="datasource"in e?e.datasource:void 0;return e.agg?C_({expression:e.dim,dataType:e.datatype,agg:e.agg||"",granularity:Ty(e),format:t,sort:e.sort,title:e.title,dataSource:o}):w_({expression:e.dim,dataType:e.datatype,granularity:Ty(e),format:t,sort:e.sort,title:e.title,panel:r,dataSource:o})}function Ty(e){return e!=null&&e.datatype&&mo(e.datatype)?Gr.translateJaqlToGranularity(e):void 0}const UD=e=>zD(e).replace("number","numeric");class xu extends kg{constructor(t,r,n,i,o,a,s,l){if(super(t,n||It.Attribute,i,a,s),this._sort=Br.None,this.expression=r,!s&&r){const{table:c,column:d}=cp(r);this.composeCode=Ay(c,d,"",gD)}l==="columns"&&(this.panel=l),this._sort=o||Br.None}get id(){return this.expression}getSort(){return this._sort}sort(t){return new xu(this.name,this.expression,this.type,this.description,t,this.dataSource,this.composeCode,this.panel)}jaql(t){const r={jaql:{title:this.name,dim:this.expression,datatype:UD(this.type)}};return this.panel&&(r.panel=this.panel),this._sort!=Br.None&&(r.jaql.sort=this._sort==Br.Ascending?"asc":"desc"),t===!0?r.jaql:r}serialize(){const t=super.serialize();return t.__serializable="DimensionalAttribute",t.expression=this.expression,this.getSort()!==Br.None&&(t.sort=this.getSort()),t}}class Gr extends xu{constructor(t,r,n,i,o,a,s,l,c){if(super(t,r,It.DateLevel,o,a,s,l),this._format=i,this.granularity=n,!l&&r){const{table:d,column:h}=cp(r);this.composeCode=Ay(d,h,n,gD)}c==="columns"&&(this.panel=c)}get id(){let t=`${this.expression}`;const{level:r="",dateTimeLevel:n="",bucket:i}=this.translateGranularityToJaql();return t+=`_${(r||n).toLowerCase()}`,i&&(t+=`_${i}`),t}getSort(){return this._sort}sort(t){return new Gr(this.name,this.expression,this.granularity,this._format,this.description,t,this.dataSource,this.composeCode)}getFormat(){return this._format}format(t){return new Gr(this.name,this.expression,this.granularity,t,this.description,this._sort,this.dataSource,this.composeCode)}setGranularity(t){return new Gr(this.name,this.expression,t,this._format,this.description,this._sort,this.dataSource,this.composeCode)}serialize(){const t=super.serialize();return t.__serializable="DimensionalLevelAttribute",t.granularity=this.granularity,this.getFormat()!==void 0&&(t.format=this.getFormat()),t}jaql(t){const r={jaql:Object.assign({title:this.name,dim:this.expression,datatype:UD(this.type)},this.translateGranularityToJaql())};if(this.panel&&(r.panel=this.panel),this._format!==void 0){const n=r.jaql.dateTimeLevel||r.jaql.level;r.format={mask:{}},r.format.mask[n]=this._format}return this._sort!=Br.None&&(r.jaql.sort=this._sort==Br.Ascending?"asc":"desc"),t===!0?r.jaql:r}translateGranularityToJaql(){const t="minutes",r="seconds";switch(this.granularity){case Ze.Years:case Ze.Quarters:case Ze.Months:case Ze.Weeks:case Ze.Days:return{level:this.granularity.toLowerCase()};case Ze.Hours:return{dateTimeLevel:t,bucket:"60"};case Ze.MinutesRoundTo30:return{dateTimeLevel:t,bucket:"30"};case Ze.MinutesRoundTo15:return{dateTimeLevel:t,bucket:"15"};case Ze.Minutes:return{dateTimeLevel:t,bucket:"1"};case Ze.Seconds:return{dateTimeLevel:r,bucket:"0"};case Ze.AggHours:return{level:t,bucket:"60"};case Ze.AggMinutesRoundTo30:return{level:t,bucket:"30"};case Ze.AggMinutesRoundTo15:return{level:t,bucket:"15"};case Ze.AggMinutesRoundTo1:return{level:t,bucket:"1"};default:return console.warn("Unsupported level"),{level:this.granularity}}}static translateJaqlToGranularity(t){const r=n=>(console.warn("Unsupported granularity",n),n);if(t.dateTimeLevel){if(t.dateTimeLevel!=="minutes"&&t.dateTimeLevel!=="seconds")return r(t.dateTimeLevel);switch(t.bucket){case"60":return Ze.Hours;case"30":return Ze.MinutesRoundTo30;case"15":return Ze.MinutesRoundTo15;case"1":return Ze.Minutes;case"0":return Ze.Seconds;default:return r(t.dateTimeLevel)}}switch(t.level){case"years":return Ze.Years;case"quarters":return Ze.Quarters;case"months":return Ze.Months;case"weeks":return Ze.Weeks;case"days":return Ze.Days;case"minutes":switch(t.bucket){case"60":return Ze.AggHours;case"30":return Ze.AggMinutesRoundTo30;case"15":return Ze.AggMinutesRoundTo15;case"1":return Ze.AggMinutesRoundTo1;default:return r(t.level)}default:return r(t.level)}}static getDefaultFormatForGranularity(t){switch(t){case Ze.Years:return"yyyy";case Ze.Quarters:return"Q yyyy";case Ze.Months:return"yyyy-MM";case Ze.Weeks:return"ww yyyy";case Ze.Days:return"yyyy-MM-dd";case Ze.Hours:return"yyyy-MM-dd HH:mm";case Ze.MinutesRoundTo30:return"yyyy-MM-dd HH:mm";case Ze.MinutesRoundTo15:return"yyyy-MM-dd HH:mm";case Ze.Minutes:return"yyyy-MM-dd HH:mm";case Ze.Seconds:return"yyyy-MM-dd HH:mm:ss";case Ze.AggHours:return"HH:mm";case Ze.AggMinutesRoundTo30:return"HH:mm";case Ze.AggMinutesRoundTo15:return"HH:mm";case Ze.AggMinutesRoundTo1:return"HH:mm";default:return""}}}function xW(e){return e.granularity?uke(e):new xu(e.name||e.title,e.attribute||e.expression||e.dim,e.type,e.desc||e.description,e.sort,e.dataSource)}function uke(e){return new Gr(e.name||e.title,e.attribute||e.expression||e.dim,e.granularity,e.format,e.desc||e.description,e.sort,e.dataSource)}function Ay(e,t,r,n){return(n.length>0?n+".":"")+pc(e)+"."+pc(t)+(r&&r.length>0?"."+r:"")}const wW=e=>{if(e!==void 0)return`${e}`},CW=e=>{if(e!==void 0)return new Date(e).toISOString()},GD=()=>!1;function _W(e,t){const r=t.filter;return"or"in r?n=>r.or.map(i=>e(Object.assign(Object.assign({},t),{filter:i}))).reduce((i,o)=>i||o(n),!1):"and"in r?n=>r.and.map(i=>e(Object.assign(Object.assign({},t),{filter:i}))).reduce((i,o)=>i&&o(n),!0):e(t)}function dke(e){const{datatype:t}=e,r=e.filter,n=t==="datetime"?CW:wW;return i=>{const o=r.members.map(n),a=n(i);return o.includes(a)}}function hke(e){const{datatype:t}=e,r=e.filter,n=t==="datetime"?CW:wW;return i=>{var o,a;const s=((a=(o=r.exclude)===null||o===void 0?void 0:o.members)===null||a===void 0?void 0:a.map(n))||[],l=n(i);return!s.includes(l)}}function pke(e){const t=e.filter,r=Dg(t);return r===St.STARTS_WITH?n=>new RegExp(`^${t.startsWith}`,"i").test(n):r===St.ENDS_WITH?n=>new RegExp(`${t.endsWith}$`,"i").test(n):r===St.CONTAINS?n=>new RegExp(t.contains,"i").test(n):r===St.EQUALS?n=>n.localeCompare(t.equals,void 0,{sensitivity:"base"})===0:r===St.DOESNT_START_WITH?n=>!new RegExp(`^${t.doesntStartWith}`,"i").test(n):r===St.DOESNT_END_WITH?n=>!new RegExp(`${t.doesntEndWith}$`,"i").test(n):r===St.DOESNT_CONTAIN?n=>!new RegExp(t.doesntContain,"i").test(n):r===St.DOESNT_EQUAL?n=>n.localeCompare(t.doesntEqual,void 0,{sensitivity:"base"})!==0:GD}function fke(e){const t=e.filter,r=Dg(t);return r===St.EQUALS?n=>Number(t.equals)===Number(n):r===St.DOESNT_EQUAL?n=>Number(t.doesntEqual)!==Number(n):r===St.LESS_THAN?n=>Number(n)<Number(t.toNotEqual):r===St.GREATER_THAN?n=>Number(n)>Number(t.fromNotEqual):r===St.BETWEEN?n=>Number(t.to)>=Number(n)&&Number(n)>=Number(t.from):r===St.GREATER_THAN_OR_EQUAL?n=>Number(n)>=Number(t.from):r===St.LESS_THAN_OR_EQUAL?n=>Number(t.to)>=Number(n):GD}function gke(e){const t=e,{datatype:r}=t,n=t.filter;return pW(n)?dke(t):fW(n)&&Dg(n)===St.IS_NOT?hke(t):r==="text"?_W(pke,t):r==="numeric"?_W(fke,t):GD}function VD(e){return"attribute"in e}function mke(e){return"measure"in e}const vke={rows:!1,columns:!1};class __ extends kg{constructor(t,r){var n;super((n=t.jaql.title)!==null&&n!==void 0?n:"",r),this.expression=t.jaql.dim||t.jaql.formula,this.metadataItem=t,t.jaql.agg?this.aggregation=t.jaql.agg:delete this.aggregation,t.jaql.formula?this.formula=t.jaql.formula:delete this.formula,t.jaql.sort?this.sortType=Og(t.jaql.sort):delete this.sortType,this.skipValidation=!0}get id(){return this.expression}jaql(t){return t===!0?this.metadataItem.jaql:this.metadataItem}serialize(){const t=super.serialize();return t.__serializable="JaqlElement",t.metadataItem=this.metadataItem,t.type=this.type,t}}const yke={text:It.TextAttribute,numeric:It.NumericAttribute,datetime:It.DateLevel};function bke(e){var t;return new __(e,(t=yke[e.jaql.datatype])!==null&&t!==void 0?t:"numeric")}function SW(e){const{jaql:t}=e;if(t.formula)return HD(t);const r=Gr.translateJaqlToGranularity(t);return"agg"in t&&t.dim&&t.datatype?C_({expression:t.dim,dataType:t.datatype,agg:t.agg||"",granularity:r,format:void 0,sort:t.sort,title:t.title,dataSource:t.datasource}):t.dim&&t.datatype?w_({expression:t.dim,dataType:t.datatype,granularity:r,sort:t.sort,title:t.title,panel:e.panel,dataSource:t.datasource}):bke(e)}function Ed(e){return e===void 0||typeof e=="string"||"title"in e&&"type"in e}const ea={BOX_MIN_VALUE_NAME:"Box Min",BOX_MEDIAN_VALUE_NAME:"Box Median",BOX_MAX_VALUE_NAME:"Box Max",WHISKER_MIN_VALUE_NAME:"Whisker Min",WHISKER_MAX_VALUE_NAME:"Whisker Max",OUTLIER_COUNT_VALUE_NAME:"Outlier Count",OUTLIER_MIN_VALUE_NAME:"Outlier Min",OUTLIER_MAX_VALUE_NAME:"Outlier Max"};function YD(e){return[Ro(ea.BOX_MIN_VALUE_NAME,"QUARTILE([Attr], 1)",{Attr:e}),Ro(ea.BOX_MEDIAN_VALUE_NAME,"MEDIAN([Attr])",{Attr:e}),Ro(ea.BOX_MAX_VALUE_NAME,"QUARTILE([Attr], 3)",{Attr:e})]}function xke(e){return[...YD(e),Ro(ea.WHISKER_MIN_VALUE_NAME,"LOWERWHISKERMAX_IQR([Attr])",{Attr:e}),Ro(ea.WHISKER_MAX_VALUE_NAME,"UPPERWHISKERMIN_IQR([Attr])",{Attr:e}),Ro(ea.OUTLIER_COUNT_VALUE_NAME,"OUTLIERSCOUNT_IQR([Attr])",{Attr:e})]}function wke(e){return[...YD(e),Ro(ea.WHISKER_MIN_VALUE_NAME,"MIN([Attr])",{Attr:e}),Ro(ea.WHISKER_MAX_VALUE_NAME,"MAX([Attr])",{Attr:e})]}function Cke(e){return[...YD(e),Ro(ea.WHISKER_MIN_VALUE_NAME,"LOWERWHISKERMAX_STDEVP([Attr])",{Attr:e}),Ro(ea.WHISKER_MAX_VALUE_NAME,"UPPERWHISKERMIN_STDEVP([Attr])",{Attr:e}),Ro(ea.OUTLIER_COUNT_VALUE_NAME,"OUTLIERSCOUNT_STDEVP([Attr])",{Attr:e})]}const _ke=q$(e=>{const t=ki(e),r=Ro(ea.OUTLIER_MAX_VALUE_NAME,"(UPPERWHISKERMIN_IQR([Attr]), all([Attr]))",{Attr:e}),n=Ro(ea.OUTLIER_MIN_VALUE_NAME,"(LOWERWHISKERMAX_IQR([Attr]), all([Attr]))",{Attr:e});return t.name=`${t.name} (Outliers)`,t.jaql=i=>{const o=Object.assign(Object.assign({},e.jaql(!0)),{filter:{or:[{fromNotEqual:r.jaql(!0)},{toNotEqual:n.jaql(!0)}]}});return i?o:{jaql:o}},t},"boxWhiskerIqrOutliers"),Ske=q$(e=>{const t=ki(e),r=Ro(ea.OUTLIER_MAX_VALUE_NAME,"(UPPERWHISKERMIN_STDEVP([Attr]), all([Attr]))",{Attr:e}),n=Ro(ea.OUTLIER_MIN_VALUE_NAME,"(LOWERWHISKERMAX_STDEVP([Attr]), all([Attr]))",{Attr:e});return t.jaql=i=>{const o=Object.assign(Object.assign({},e.jaql(!0)),{filter:{or:[{fromNotEqual:r.jaql(!0)},{toNotEqual:n.jaql(!0)}]}});return i?o:{jaql:o}},t},"boxWhiskerStdDevOutliers");function wu(e){return!!e&&"operator"in e&&(e.operator==="AND"||e.operator==="OR")&&!!e.right&&!!e.left}function S_(e=[],t=[]){if(!wu(e)&&!wu(t))return Ui(e,t);const{filters:r,relations:n}=Ll(e),i=k_(t),o=Ui(r,i),a=Ol(r,n,o);return os(o,a)}function Ll(e){if(!e)return{filters:[],relations:null};if(vn(e))return{filters:e,relations:null};const t=new Set;function r(i){if(MW(i))return t.add(i),{instanceid:i.config.guid};if(wu(i)){const o=r(i.left),a=r(i.right);return{left:o,right:a,operator:i.operator}}throw new A_}const n=r(e);return{filters:Array.from(t),relations:n}}function k_(e){return e?Ll(e).filters:[]}function os(e,t){if(!t||qD(t))return e;const r=n(t);return MW(r)?[r]:r;function n(i){if(M_(i))return e.find(o=>o.config.guid===i.instanceid);if(T_(i))return(i.operator==="AND"?_y.and:_y.or)(n(i.left),n(i.right));throw new A_}}function qD(e){return!!e&&"instanceid"in e}function Ol(e,t,r){if(t===null)return null;const n=Mke(e,r);return n.length===0?t:n.reduce((i,o)=>{switch(o.type){case"add":return Tke(o.payload,i);case"remove":return ZD(o.payload,i)}},t)}function kW(e,t){return e.config.guid===t.config.guid}function kke(e,t,r){if(!e)return null;return i(e);function i(o){if(M_(o))return o.instanceid===t.config.guid?{instanceid:r.config.guid}:o;if(T_(o))return{left:i(o.left),right:i(o.right),operator:o.operator};throw new A_}}function Mke(e,t){const r=[],n=[...e],i=[...t];return n.forEach(o=>{i.some(s=>kW(o,s))||r.push({type:"remove",payload:o})}),i.forEach(o=>{n.some(s=>kW(o,s))||r.push({type:"add",payload:o})}),r}function Tke(e,t){return t?{left:t,right:{instanceid:e.config.guid},operator:"AND"}:{instanceid:e.config.guid}}function ZD(e,t){if(!t)return null;if(qD(t))return t.instanceid===e.config.guid?null:t;const r=ZD(e,t.left),n=ZD(e,t.right);return r===null&&n?n:n===null&&r?r:r===null&&n===null?null:{left:r,right:n,operator:t.operator}}function Ake(e,t){if(!e)return null;function r(n){if(Eke(n))return{instanceid:n.instanceId};if(Pke(n))return r(n.value);if(Dke(n))return{operator:n.operator,left:r(n.left),right:r(n.right)};if(Lke(n)){const i=t.find(o=>{if(!Qi(o))return!1;const a=o.filters.map(s=>s.config.guid);return n.levels.every(s=>a.includes(s.instanceId))});if(i)return{instanceid:i.config.guid};throw new Error("Broken filter relations model. Cascading filter not found.")}throw new Error("Broken filter relations model. Unknown node type.")}return r(e)}function Eke(e){return"instanceId"in e}function Pke(e){return"value"in e}function Dke(e){return"operator"in e}function Lke(e){return"levels"in e&&vn(e.levels)}function M_(e){return"instanceid"in e}function T_(e){return"operator"in e}function MW(e){return"config"in e&&"guid"in e.config}function Oke(e,t){if(!e)return;function r(n){if(M_(n)){const i=t.find(o=>o.config.guid===n.instanceid);return i&&Qi(i)?{type:"CascadingIdentifier",levels:i.filters.map(a=>({type:"Identifier",instanceId:a.config.guid}))}:{type:"Identifier",instanceId:n.instanceid}}else{if(T_(n))return{type:"LogicalExpression",operator:n.operator,left:r(n.left),right:r(n.right)};throw new Error("Unknown node type in filter relations rules.")}}return r(e)}function Ike(e,t){return e.find(r=>r.config.guid===t)}class A_ extends Error{constructor(){super("Broken filter relations. Unknown node type.")}}function XD(e){return e.nodeType==="openBracket"}function KD(e){return e.nodeType==="closeBracket"}function Nke(e){return e.nodeType==="attribute"}function Rke(e){return e.nodeType==="operator"}function Ey(e){if(Qi(e))return e.filters.map(Ey).join("-");const{attribute:t}=e,r=e.jaql().jaql,n=t.expression||r.dim,i=t.granularity||((r==null?void 0:r.datatype)==="datetime"?Gr.translateJaqlToGranularity(r):"");return`${n}${i}`}function Ui(e=[],t=[]){const r=[...e];return t.forEach(n=>{const i=r.findIndex(a=>Ey(n)===Ey(a));i!==-1?r[i]=n:r.push(n)}),r}function Fke(e){if(!e)return e;const t=ki(e);function r(n){if("instanceId"in n)return{instanceid:n.instanceId};if("value"in n)return r(n.value);if("operator"in n){const i={operator:n.operator};return"left"in n&&(i.left=r(n.left)),"right"in n&&(i.right=r(n.right)),i}return n}return r(t)}function jke(e){return t=>{if(wu(t)){const{filters:r,relations:n}=Ll(t),i=[...r,e],o=Ol(r,n,i);return os(i,o)}return[...t||[],e]}}function Bke(e){return t=>{if(wu(t)){const{filters:r,relations:n}=Ll(t),i=[...r,...e],o=Ol(r,n,i);return os(i,o)}return[...t||[],...e]}}function zke(e){return t=>{if(wu(t)){const{filters:r,relations:n}=Ll(t),i=r.filter(a=>a.config.guid!==e.config.guid),o=Ol(r,n,i);return os(i,o)}return(t||[]).filter(r=>r.config.guid!==e.config.guid)}}function $ke(e){return t=>{if(wu(t)){const{filters:r,relations:n}=Ll(t),i=r.filter(a=>!e.some(s=>a.config.guid===s.config.guid)),o=Ol(r,n,i);return os(i,o)}return(t||[]).filter(r=>!e.some(n=>r.config.guid===n.config.guid))}}function Wke(e,t){return r=>{if(wu(r)){const{filters:n,relations:i}=Ll(r),o=n.map(s=>s.config.guid===e.config.guid?t:s),a=kke(i,e,t);return os(o,a)}return(r||[]).map(n=>n.config.guid===e.config.guid?t:n)}}const Hke={errors:{invalidAttribute:"Invalid attribute {{attributeName}}. Hint: attributes for query should be extracted from the data model generated by the CLI tool.",noDimensionsOrMeasures:"Neither dimensions nor measures found. Query should have at least one dimension or measure.",invalidMeasure:'Invalid measure "{{measureName}}". Hint: measures for the query can be constructed using the "measureFactory" functions.',invalidFilter:'Invalid filter "{{filterName}}". Hint: filters for the query can be constructed using the "filterFactory" functions.',invalidHighlight:'Invalid highlight "{{highlightName}}". Hint: highlights for the query can be constructed using the "filterFactory" functions.',invalidCountNegative:'Invalid count "{{count}}". Count should be non-negative.',invalidOffset:'Invalid offset "{{offset}}". Offset should be non-negative.',missingHttpClient:"Query requires httpClient to work properly.",missingPostMethod:'httpClient must provide "post" method.',noJaqlResponse:"No jaql response received from the server",dataSourceNotFound:'Failed to get fields for data source "{{dataSource}}". Please make sure the data source exists and is accessible.'}},Uke={errors:{invalidAttribute:"Недійсний атрибут {{attributeName}}. Підказка: атрибути для запиту повинні бути витягнуті з моделі даних, створеної за допомогою CLI-інструменту.",noDimensionsOrMeasures:"Не знайдено ні вимірів, ні показників. Запит повинен мати щонайменше один вимір або показник.",invalidMeasure:'Недійсний показник "{{measureName}}". Підказка: показники для запиту можна створити за допомогою функцій "measureFactory".',invalidFilter:'Недійсний фільтр "{{filterName}}". Підказка: фільтри для запиту можна створити за допомогою функцій "filterFactory".',invalidHighlight:'Недійсне виділення "{{highlightName}}". Підказка: виділення для запиту можна створити за допомогою функцій "filterFactory".',invalidCountNegative:`Недійсний count "{{count}}". Count повинен бути не від'ємним.`,invalidOffset:`Недійсний offset "{{offset}}". Offset повинен бути не від'ємним.`,missingHttpClient:"Для запиту потрібен httpClient, щоб працювати належним чином.",missingPostMethod:'httpClient повинен мати метод "post".',noJaqlResponse:"Відповіді, що містить jaql, від сервера не отримано",dataSourceNotFound:'Не вдалося отримати поля для джерела даних "{{dataSource}}". Переконайтесь що джерело існує і доступне.'}},TW="sdkQueryClient",Gke={en:Hke,uk:Uke};function Vke(){return VC({resource:Gke,language:"en",namespace:TW})}const{i18nextInstance:Yke}=Vke(),AW=e=>{if(typeof e=="object"&&e!==null){if(typeof Object.getPrototypeOf=="function"){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}return Object.prototype.toString.call(e)==="[object Object]"}return!1},yn=(...e)=>e.reduce((t,r)=>{if(Array.isArray(r))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(r).forEach(n=>{["__proto__","constructor","prototype"].includes(n)||(Array.isArray(t[n])&&Array.isArray(r[n])?t[n]=yn.options.mergeArrays?Array.from(new Set(t[n].concat(r[n]))):r[n]:AW(t[n])&&AW(r[n])?t[n]=yn(t[n],r[n]):t[n]=r[n])}),t},{}),EW={mergeArrays:!0};yn.options=EW,yn.withOptions=(e,...t)=>{yn.options=Object.assign({mergeArrays:!0},e);const r=yn(...t);return yn.options=EW,r};let E_;const qke=new Uint8Array(16);function Zke(){if(!E_&&(E_=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!E_))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return E_(qke)}const vo=[];for(let e=0;e<256;++e)vo.push((e+256).toString(16).slice(1));function Xke(e,t=0){return vo[e[t+0]]+vo[e[t+1]]+vo[e[t+2]]+vo[e[t+3]]+"-"+vo[e[t+4]]+vo[e[t+5]]+"-"+vo[e[t+6]]+vo[e[t+7]]+"-"+vo[e[t+8]]+vo[e[t+9]]+"-"+vo[e[t+10]]+vo[e[t+11]]+vo[e[t+12]]+vo[e[t+13]]+vo[e[t+14]]+vo[e[t+15]]}const PW={randomUUID:typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function DW(e,t,r){if(PW.randomUUID&&!t&&!e)return PW.randomUUID();e=e||{};const n=e.random||(e.rng||Zke)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Xke(n)}function Kke(e,t){const r=t==null?void 0:t.find(n=>LW(e)===n.attribute.id);return r&&!r.config.disabled&&(r.isScope&&(r.isScope=!1),e.jaql.in={selected:r.jaql()}),e}function Qke(e,t){const r=[],n=[];return t.forEach(i=>{e.some(a=>LW(a)===i.attribute.id)?r.push(i):n.push(i)}),[r,n]}function LW(e){const{dim:t,level:r,dateTimeLevel:n,bucket:i}=e.jaql;let o=`${t}`;return(r||n)&&(o+=`_${r||n}`),i&&(o+=`_${i}`),o}var Jke=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};function eMe(e,t,r){return{rowsCount:e.length,columnsCount:t.length,measuresCount:r.length}}function tMe(e){switch(e){case"sortAsc":return"asc";case"sortDesc":return"desc";default:return"none"}}function rMe(e,t,r){const n=tMe(e.direction),i=t===r.rowsCount-1,o={dir:n,initialized:!0,field:e.by&&"valuesIndex"in e.by?r.rowsCount+r.columnsCount+e.by.valuesIndex:t};return i&&(o.sortingLastDimension=!0),e.by&&(o.measurePath=(e.by.columnsMembersPath||[]).reduce((a,s,l)=>Object.assign(Object.assign({},a),{[r.rowsCount+l]:s}),{})),{sort:n,sortDetails:o}}function nMe(e,t){if(t.rowsCount===0)return;const r=t.rowsCount-1,n=e[r],i=n.jaql,{sortDetails:o,sort:a}=i,s=Jke(i,["sortDetails","sort"]);if(o&&o.field!==r&&o.field<e.length){const c=e[o.field];c.jaql.sortDetails=o,c.jaql.sort=a,n.jaql=s}}const P_="ComposeSDK";function QD(e,t){const{attributes:r,measures:n,filters:i,filterRelations:o,highlights:a,dataSource:s,count:l,offset:c,ungroup:d}=e,h=d&&n.length===0,u=Object.assign({metadata:oMe({attributes:r,measures:n,filters:i,filterRelations:o,highlights:a},t)},aMe(s,l,c,h));return o?Object.assign(Object.assign({},u),{filterRelations:o}):u}function OW(e,t,r,n,i){const[o,a]=Qke(e,n);e.forEach(c=>Kke(c,o));const s=c=>{const d=c.jaql();return r?Array.isArray(d)?d.map(h=>Object.assign(Object.assign({},h),{instanceid:c.config.guid})):Object.assign(Object.assign({},d),{instanceid:c.config.guid}):d},l=(i?t.flatMap(c=>s(c)):[...t,...a].flatMap(c=>s(c))).filter(c=>Object.keys(c.jaql.filter||{}).length!==0);return i&&a.length>0&&console.warn(`The following highlight filters were not applied due to missing attributes: [${a.map(c=>c.attribute.name).join(", ")}].`),l}function iMe(e){var t,r;const n=(t=e.jaql)===null||t===void 0?void 0:t.formula;if(!n||!n.includes("trend")&&!n.includes("forecast"))return e;const i=structuredClone(e),o=(r=i.jaql)===null||r===void 0?void 0:r.context;if(o)for(const a in o){const s=o[a];s.datatype==="text"&&s.agg==="count"&&(s.datatype="numeric")}return i}function oMe(e,t){const{attributes:r,measures:n,filters:i,filterRelations:o,highlights:a}=e,s=r.map(d=>d.jaql()),l=n.map(d=>iMe(d.jaql())),c=OW(s,i,o,a,t);return[...s,...l,...c]}function aMe(e,t,r,n){return Object.assign(Object.assign(Object.assign({datasource:$D(e),by:P_,queryGuid:DW()},n?{ungroup:!0}:{}),t?{count:t}:{}),r?{offset:r}:{})}function sMe(e,t){const{rowsAttributes:r,columnsAttributes:n,measures:i,filters:o,filterRelations:a,grandTotals:s,highlights:l,dataSource:c,count:d,offset:h}=e,u=Object.assign({metadata:cMe({rowsAttributes:r,columnsAttributes:n,measures:i,filters:o,highlights:l,filterRelations:a},t)},uMe(c,s,d,h));return a?Object.assign(Object.assign({},u),{filterRelations:a}):u}function IW(e,t,r,n){const i=t==="rows"&&VD(e)&&e.sort&&e.sort.direction!=="sortNone",o=Object.assign(Object.assign({},VD(e)?e.attribute.jaql(!0):e.jaql(!0)),i&&rMe(e.sort,r,n));return Object.assign(Object.assign({jaql:o},VD(e)&&e.includeSubTotals?{format:{subtotal:!0}}:{}),{panel:t,field:{index:r,id:`${t}-${r}`}})}function lMe(e,t,r){return Object.assign(Object.assign({},mke(e)?yn(e.measure.jaql(),{jaql:{subtotalAgg:e.totalsCalculation},format:Object.assign({databars:e.dataBars||!1},e.shouldRequestMinMax&&{color:{type:"range"}})}):e.jaql()),{panel:t,field:{index:r,id:`${t}-${r}`}})}function cMe(e,t){const{rowsAttributes:r,columnsAttributes:n,measures:i,filters:o,filterRelations:a,highlights:s}=e,l=eMe(r,n,i);let c=0;const d=r.map((x,S)=>IW(x,"rows",S+c,l));c=c+r.length;const h=n.map((x,S)=>IW(x,"columns",S+c,l));c=c+n.length;const u=[...d,...h],g=i.map((x,S)=>lMe(x,"measures",S+c)),f=OW(u,o,a,s,t),p=[...u,...g,...f];return nMe(p,l),p}function uMe(e,t,r,n){return Object.assign(Object.assign(Object.assign({datasource:$D(e),by:P_,queryGuid:DW(),dashboard:P_,widget:P_,format:"pivot"},r?{count:r}:{}),n?{offset:n}:{}),{grandTotals:Object.assign(Object.assign({},vke),t)})}var JD=function(t,r){var n=arguments;if(r==null||!Uv.call(r,"css"))return Ce.createElement.apply(void 0,n);var i=n.length,o=new Array(i);o[0]=S3,o[1]=_3(t,r);for(var a=2;a<i;a++)o[a]=n[a];return Ce.createElement.apply(null,o)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(JD||(JD={}));var dMe=w3(function(e,t){var r=e.styles,n=dg([r],void 0,Ce.useContext(hg)),i=Ce.useRef();return B9(function(){var o=t.key+"-global",a=new t.sheet.constructor({key:o,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),s=!1,l=document.querySelector('style[data-emotion="'+o+" "+n.name+'"]');return t.sheet.tags.length&&(a.before=t.sheet.tags[0]),l!==null&&(s=!0,l.setAttribute("data-emotion",o),a.hydrate([l])),i.current=[a,s],function(){a.flush()}},[t]),B9(function(){var o=i.current,a=o[0],s=o[1];if(s){o[1]=!1;return}if(n.next!==void 0&&y3(t,n.next,!0),a.tags.length){var l=a.tags[a.tags.length-1].nextElementSibling;a.before=l,a.flush()}t.insert("",n,a,!1)},[t,n.name]),null});function un(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return dg(t)}function mc(){var e=un.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var hMe=function(t){return t()},pMe=Ce[`useInsertionEffect${Math.random()}`.slice(0,18)]?Ce[`useInsertionEffect${Math.random()}`.slice(0,18)]:!1,fMe=pMe||hMe,gMe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,mMe=A9(function(e){return gMe.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),vMe=!1,yMe=mMe,bMe=function(t){return t!=="theme"},NW=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?yMe:bMe},RW=function(t,r,n){var i;if(r){var o=r.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&n&&(i=t.__emotion_forwardProp),i},xMe=function(t){var r=t.cache,n=t.serialized,i=t.isStringTag;return v3(r,n,i),fMe(function(){return y3(r,n,i)}),null},wMe=function e(t,r){var n=t.__emotion_real===t,i=n&&t.__emotion_base||t,o,a;r!==void 0&&(o=r.label,a=r.target);var s=RW(t,r,n),l=s||NW(i),c=!l("as");return function(){var d=arguments,h=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&h.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)h.push.apply(h,d);else{var u=d[0];h.push(u[0]);for(var g=d.length,f=1;f<g;f++)h.push(d[f],u[f])}var p=w3(function(x,S,j){var U=c&&x.as||i,B="",R=[],E=x;if(x.theme==null){E={};for(var N in x)E[N]=x[N];E.theme=Ce.useContext(hg)}typeof x.className=="string"?B=O9(S.registered,R,x.className):x.className!=null&&(B=x.className+" ");var M=dg(h.concat(R),S.registered,E);B+=S.key+"-"+M.name,a!==void 0&&(B+=" "+a);var $=c&&s===void 0?NW(U):l,T={};for(var C in x)c&&C==="as"||$(C)&&(T[C]=x[C]);return T.className=B,j&&(T.ref=j),Ce.createElement(Ce.Fragment,null,Ce.createElement(xMe,{cache:S,serialized:M,isStringTag:typeof U=="string"}),Ce.createElement(U,T))});return p.displayName=o!==void 0?o:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",p.defaultProps=t.defaultProps,p.__emotion_real=p,p.__emotion_base=i,p.__emotion_styles=h,p.__emotion_forwardProp=s,Object.defineProperty(p,"toString",{value:function(){return a===void 0&&vMe?"NO_COMPONENT_SELECTOR":"."+a}}),p.withComponent=function(x,S){var j=e(x,xC({},r,S,{shouldForwardProp:RW(p,S,!0)}));return j.apply(void 0,h)},p}},CMe=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Ye=wMe.bind(null);CMe.forEach(function(e){Ye[e]=Ye(e)});var _Me=Object.defineProperty,SMe=Object.defineProperties,kMe=Object.getOwnPropertyDescriptors,D_=Object.getOwnPropertySymbols,FW=Object.prototype.hasOwnProperty,jW=Object.prototype.propertyIsEnumerable,Pd=Math.pow,eL=(e,t,r)=>t in e?_Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Me=(e,t)=>{for(var r in t||(t={}))FW.call(t,r)&&eL(e,r,t[r]);if(D_)for(var r of D_(t))jW.call(t,r)&&eL(e,r,t[r]);return e},We=(e,t)=>SMe(e,kMe(t)),tL=e=>typeof e=="symbol"?e:e+"",wt=(e,t)=>{var r={};for(var n in e)FW.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&D_)for(var n of D_(e))t.indexOf(n)<0&&jW.call(e,n)&&(r[n]=e[n]);return r},Re=(e,t,r)=>(eL(e,typeof t!="symbol"?t+"":t,r),r),BW=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});const MMe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};let TMe=class y9{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,r)}init(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||MMe,this.options=r,this.debug=r.debug}log(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}warn(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}error(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"error","")}deprecate(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,n,i){return i&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new y9(this.logger,Me({prefix:`${this.prefix}:${t}:`},this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new y9(this.logger,t)}};var vc=new TMe;let L_=class{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(n=>{this.observers[n]=this.observers[n]||[],this.observers[n].push(r)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(n=>n!==r)}}emit(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.observers[t]&&[].concat(this.observers[t]).forEach(o=>{o(...n)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(o=>{o.apply(o,[t,...n])})}};function Py(){let e,t;const r=new Promise((n,i)=>{e=n,t=i});return r.resolve=e,r.reject=t,r}function zW(e){return e==null?"":""+e}function AMe(e,t,r){e.forEach(n=>{t[n]&&(r[n]=t[n])})}function rL(e,t,r){function n(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!e||typeof e=="string"}const o=typeof t!="string"?[].concat(t):t.split(".");for(;o.length>1;){if(i())return{};const a=n(o.shift());!e[a]&&r&&(e[a]=new r),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:n(o.shift())}}function $W(e,t,r){const{obj:n,k:i}=rL(e,t,Object);n[i]=r}function EMe(e,t,r,n){const{obj:i,k:o}=rL(e,t,Object);i[o]=i[o]||[],i[o].push(r)}function O_(e,t){const{obj:r,k:n}=rL(e,t);if(r)return r[n]}function PMe(e,t,r){const n=O_(e,r);return n!==void 0?n:O_(t,r)}function WW(e,t,r){for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?r&&(e[n]=t[n]):WW(e[n],t[n],r):e[n]=t[n]);return e}function Ig(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var DMe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function LMe(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>DMe[t]):e}const OMe=[" ",",","?","!",";"];function IMe(e,t,r){t=t||"",r=r||"";const n=OMe.filter(a=>t.indexOf(a)<0&&r.indexOf(a)<0);if(n.length===0)return!0;const i=new RegExp(`(${n.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(r);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function I_(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const n=t.split(r);let i=e;for(let o=0;o<n.length;++o){if(!i||typeof i[n[o]]=="string"&&o+1<n.length)return;if(i[n[o]]===void 0){let a=2,s=n.slice(o,o+a).join(r),l=i[s];for(;l===void 0&&n.length>o+a;)a++,s=n.slice(o,o+a).join(r),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}const c=n.slice(o+a).join(r);return c?I_(l,c,r):void 0}i=i[n[o]]}return i}function N_(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class HW extends L_{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s=[t,r];n&&typeof n!="string"&&(s=s.concat(n)),n&&typeof n=="string"&&(s=s.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(s=t.split("."));const l=O_(this.data,s);return l||!a||typeof n!="string"?l:I_(this.data&&this.data[t]&&this.data[t][r],n,o)}addResource(t,r,n,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,r];n&&(s=s.concat(a?n.split(a):n)),t.indexOf(".")>-1&&(s=t.split("."),i=r,r=s[1]),this.addNamespaces(r),$W(this.data,s,i),o.silent||this.emit("added",t,r,n,i)}addResources(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in n)(typeof n[o]=="string"||Object.prototype.toString.apply(n[o])==="[object Array]")&&this.addResource(t,r,o,n[o],{silent:!0});i.silent||this.emit("added",t,r,n)}addResourceBundle(t,r,n,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},s=[t,r];t.indexOf(".")>-1&&(s=t.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let l=O_(this.data,s)||{};i?WW(l,n,o):l=Me(Me({},l),n),$W(this.data,s,l),a.silent||this.emit("added",t,r,n)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Me({},this.getResource(t,r)):this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(n=>r[n]&&Object.keys(r[n]).length>0)}toJSON(){return this.data}}var UW={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,r,n,i))}),t}};const GW={};let VW=class _ye extends L_{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),AMe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=vc.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const n=this.resolve(t,r);return n&&n.res!==void 0}extractFromKey(t,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=r.ns||this.options.defaultNS||[];const a=n&&t.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!IMe(t,n,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};const c=t.split(n);(n!==i||n===i&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(i)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r=Me({},r)),r||(r={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],r),l=s[s.length-1],c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(d){const U=r.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${U}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l}:`${l}${U}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l}:a}const h=this.resolve(t,r);let u=h&&h.res;const g=h&&h.usedKey||a,f=h&&h.exactUsedKey||a,p=Object.prototype.toString.apply(u),x=["[object Number]","[object Function]","[object RegExp]"],S=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject;if(j&&u&&typeof u!="string"&&typeof u!="boolean"&&typeof u!="number"&&x.indexOf(p)<0&&!(typeof S=="string"&&p==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const U=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,u,We(Me({},r),{ns:s})):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=U,h):U}if(o){const U=p==="[object Array]",B=U?[]:{},R=U?f:g;for(const E in u)if(Object.prototype.hasOwnProperty.call(u,E)){const N=`${R}${o}${E}`;B[E]=this.translate(N,We(Me({},r),{joinArrays:!1,ns:s})),B[E]===N&&(B[E]=u[E])}u=B}}else if(j&&typeof S=="string"&&p==="[object Array]")u=u.join(S),u&&(u=this.extendTranslation(u,t,r,n));else{let U=!1,B=!1;const R=r.count!==void 0&&typeof r.count!="string",E=_ye.hasDefaultValue(r),N=R?this.pluralResolver.getSuffix(c,r.count,r):"",M=r.ordinal&&R?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",$=r[`defaultValue${N}`]||r[`defaultValue${M}`]||r.defaultValue;!this.isValidLookup(u)&&E&&(U=!0,u=$),this.isValidLookup(u)||(B=!0,u=a);const T=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:u,C=E&&$!==u&&this.options.updateMissing;if(B||U||C){if(this.logger.log(C?"updateKey":"missingKey",c,l,a,C?$:u),o){const F=this.resolve(a,We(Me({},r),{keySeparator:!1}));F&&F.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 y=[];const D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&D&&D[0])for(let F=0;F<D.length;F++)y.push(D[F]);else this.options.saveMissingTo==="all"?y=this.languageUtils.toResolveHierarchy(r.lng||this.language):y.push(r.lng||this.language);const k=(F,V,q)=>{const z=E&&q!==u?q:T;this.options.missingKeyHandler?this.options.missingKeyHandler(F,l,V,z,C,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(F,l,V,z,C,r),this.emit("missingKey",F,l,V,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?y.forEach(F=>{this.pluralResolver.getSuffixes(F,r).forEach(V=>{k([F],a+V,r[`defaultValue${V}`]||$)})}):k(y,a,$))}u=this.extendTranslation(u,t,r,h,n),B&&u===a&&this.options.appendNamespaceToMissingKey&&(u=`${l}:${a}`),(B||U)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,U?u:void 0):u=this.options.parseMissingKeyHandler(u))}return i?(h.res=u,h):u}extendTranslation(t,r,n,i,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,Me(Me({},this.options.interpolation.defaultVariables),n),i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(We(Me({},n),{interpolation:Me(Me({},this.options.interpolation),n.interpolation)}));const c=typeof t=="string"&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(c){const u=t.match(this.interpolator.nestingRegexp);d=u&&u.length}let h=n.replace&&typeof n.replace!="string"?n.replace:n;if(this.options.interpolation.defaultVariables&&(h=Me(Me({},this.options.interpolation.defaultVariables),h)),t=this.interpolator.interpolate(t,h,n.lng||this.language,n),c){const u=t.match(this.interpolator.nestingRegexp),g=u&&u.length;d<g&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(n.lng=i.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var u=arguments.length,g=new Array(u),f=0;f<u;f++)g[f]=arguments[f];return o&&o[0]===g[0]&&!n.context?(a.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${r[0]}`),null):a.translate(...g,r)},n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,l=typeof s=="string"?[s]:s;return t!=null&&l&&l.length&&n.applyPostProcessor!==!1&&(t=UW.handle(l,t,r,this.options&&this.options.postProcessPassResolved?Me({i18nResolved:i},n):n,this)),t}resolve(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,i,o,a,s;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,r),d=c.key;i=d;let h=c.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const u=r.count!==void 0&&typeof r.count!="string",g=u&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),f=r.context!==void 0&&(typeof r.context=="string"||typeof r.context=="number")&&r.context!=="",p=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);h.forEach(x=>{this.isValidLookup(n)||(s=x,!GW[`${p[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(GW[`${p[0]}-${x}`]=!0,this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" 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!!!")),p.forEach(S=>{if(this.isValidLookup(n))return;a=S;const j=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(j,d,S,x,r);else{let B;u&&(B=this.pluralResolver.getSuffix(S,r.count,r));const R=`${this.options.pluralSeparator}zero`,E=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(j.push(d+B),r.ordinal&&B.indexOf(E)===0&&j.push(d+B.replace(E,this.options.pluralSeparator)),g&&j.push(d+R)),f){const N=`${d}${this.options.contextSeparator}${r.context}`;j.push(N),u&&(j.push(N+B),r.ordinal&&B.indexOf(E)===0&&j.push(N+B.replace(E,this.options.pluralSeparator)),g&&j.push(N+R))}}let U;for(;U=j.pop();)this.isValidLookup(n)||(o=U,n=this.getResource(S,x,U,r))}))})}),{res:n,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,r,n,i):this.resourceStore.getResource(t,r,n,i)}static hasDefaultValue(t){const r="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r===n.substring(0,r.length)&&t[n]!==void 0)return!0;return!1}};function nL(e){return e.charAt(0).toUpperCase()+e.slice(1)}class YW{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=vc.create("languageUtils")}getScriptPartFromCode(t){if(t=N_(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=N_(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const r=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map(i=>i.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=nL(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=nL(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=nL(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&t.forEach(n=>{if(r)return;const i=this.getLanguagePartFromCode(n);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.find(o=>{if(o===i||!(o.indexOf("-")<0&&i.indexOf("-")<0)&&o.indexOf(i)===0)return o})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!r)return t.default||[];let n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}toResolveHierarchy(t,r){const n=this.getFallbackCodes(r||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),n.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}let NMe=[{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}],RMe={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const FMe=["v1","v2","v3"],jMe=["v4"],qW={zero:0,one:1,two:2,few:3,many:4,other:5};function BMe(){const e={};return NMe.forEach(t=>{t.lngs.forEach(r=>{e[r]={numbers:t.nr,plurals:RMe[t.fc]}})}),e}class zMe{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=r,this.logger=vc.create("pluralResolver"),(!this.options.compatibilityJSON||jMe.includes(this.options.compatibilityJSON))&&(typeof Intl=="undefined"||!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=BMe()}addRule(t,r){this.rules[t]=r}getRule(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(N_(t),{type:r.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(i=>`${r}${i}`)}getSuffixes(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((i,o)=>qW[i]-qW[o]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):n.numbers.map(i=>this.getSuffix(t,i,r)):[]}getSuffix(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,n);return i?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:this.getSuffixRetroCompatible(i,r):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,r){const n=t.noAbs?t.plurals(r):t.plurals(Math.abs(r));let i=t.numbers[n];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const o=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!FMe.includes(this.options.compatibilityJSON)}}function ZW(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=PMe(e,t,r);return!o&&i&&typeof r=="string"&&(o=I_(e,r,n),o===void 0&&(o=I_(t,r,n))),o}class $Me{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=vc.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(r=>r),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const r=t.interpolation;this.escape=r.escape!==void 0?r.escape:LMe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Ig(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Ig(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Ig(r.nestingPrefix):r.nestingPrefixEscaped||Ig("$t("),this.nestingSuffix=r.nestingSuffix?Ig(r.nestingSuffix):r.nestingSuffixEscaped||Ig(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const r=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(r,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(t,r,n,i){let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(g){return g.replace(/\$/g,"$$$$")}const d=g=>{if(g.indexOf(this.formatSeparator)<0){const S=ZW(r,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(S,void 0,n,We(Me(Me({},i),r),{interpolationkey:g})):S}const f=g.split(this.formatSeparator),p=f.shift().trim(),x=f.join(this.formatSeparator).trim();return this.format(ZW(r,l,p,this.options.keySeparator,this.options.ignoreJSONStructure),x,n,We(Me(Me({},i),r),{interpolationkey:p}))};this.resetRegExp();const h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,u=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>c(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?c(this.escape(g)):c(g)}].forEach(g=>{for(s=0;o=g.regex.exec(t);){const f=o[1].trim();if(a=d(f),a===void 0)if(typeof h=="function"){const x=h(t,o,i);a=typeof x=="string"?x:""}else if(i&&Object.prototype.hasOwnProperty.call(i,f))a="";else if(u){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${f} for interpolating ${t}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=zW(a));const p=g.safeValue(a);if(t=t.replace(o[0],p),u?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=o[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;function s(l,c){const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const h=l.split(new RegExp(`${d}[ ]*{`));let u=`{${h[1]}`;l=h[0],u=this.interpolate(u,a);const g=u.match(/'/g),f=u.match(/"/g);(g&&g.length%2===0&&!f||f.length%2!==0)&&(u=u.replace(/'/g,'"'));try{a=JSON.parse(u),c&&(a=Me(Me({},c),a))}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,p),`${l}${d}${u}`}return delete a.defaultValue,l}for(;i=this.nestingRegexp.exec(t);){let l=[];a=Me({},n),a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(h=>h.trim());i[1]=d.shift(),l=d,c=!0}if(o=r(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=zW(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),c&&(o=l.reduce((d,h)=>this.format(d,h,n.lng,We(Me({},n),{interpolationkey:i[1].trim()})),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}function WMe(e){let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);t==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(o=>{if(!o)return;const[a,...s]=o.split(":"),l=s.join(":").trim().replace(/^'+|'+$/g,"");r[a.trim()]||(r[a.trim()]=l),l==="false"&&(r[a.trim()]=!1),l==="true"&&(r[a.trim()]=!0),isNaN(l)||(r[a.trim()]=parseInt(l,10))})}return{formatName:t,formatOptions:r}}function Ng(e){const t={};return function(r,n,i){const o=n+JSON.stringify(i);let a=t[o];return a||(a=e(N_(n),i),t[o]=a),a(r)}}class HMe{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=vc.create("formatter"),this.options=t,this.formats={number:Ng((r,n)=>{const i=new Intl.NumberFormat(r,Me({},n));return o=>i.format(o)}),currency:Ng((r,n)=>{const i=new Intl.NumberFormat(r,We(Me({},n),{style:"currency"}));return o=>i.format(o)}),datetime:Ng((r,n)=>{const i=new Intl.DateTimeFormat(r,Me({},n));return o=>i.format(o)}),relativetime:Ng((r,n)=>{const i=new Intl.RelativeTimeFormat(r,Me({},n));return o=>i.format(o,n.range||"day")}),list:Ng((r,n)=>{const i=new Intl.ListFormat(r,Me({},n));return o=>i.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=Ng(r)}format(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return r.split(this.formatSeparator).reduce((o,a)=>{const{formatName:s,formatOptions:l}=WMe(a);if(this.formats[s]){let c=o;try{const d=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},h=d.locale||d.lng||i.locale||i.lng||n;c=this.formats[s](o,h,Me(Me(Me({},l),i),d))}catch(d){this.logger.warn(d)}return c}else this.logger.warn(`there was no format function for ${s}`);return o},t)}}function UMe(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class GMe extends L_{constructor(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=vc.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,i.backend,i)}queueLoad(t,r,n,i){const o={},a={},s={},l={};return t.forEach(c=>{let d=!0;r.forEach(h=>{const u=`${c}|${h}`;!n.reload&&this.store.hasResourceBundle(c,h)?this.state[u]=2:this.state[u]<0||(this.state[u]===1?a[u]===void 0&&(a[u]=!0):(this.state[u]=1,d=!1,a[u]===void 0&&(a[u]=!0),o[u]===void 0&&(o[u]=!0),l[h]===void 0&&(l[h]=!0)))}),d||(s[c]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,r,n){const i=t.split("|"),o=i[0],a=i[1];r&&this.emit("failedLoading",o,a,r),n&&this.store.addResourceBundle(o,a,n),this.state[t]=r?-1:2;const s={};this.queue.forEach(l=>{EMe(l.loaded,[o],a),UMe(l,t),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const d=l.loaded[c];d.length&&d.forEach(h=>{s[c][h]===void 0&&(s[c][h]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:n,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(c&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,n,i+1,o*2,a)},o);return}a(c,d)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(t,r);c&&typeof c.then=="function"?c.then(d=>s(null,d)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,r,s)}prepareLoading(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=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."),i&&i();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof r=="string"&&(r=[r]);const o=this.queueLoad(t,r,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,r,n){this.prepareLoading(t,r,{},n)}reload(t,r,n){this.prepareLoading(t,r,{reload:!0},n)}loadOne(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=t.split("|"),i=n[0],o=n[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${r}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${r}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,r,n,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" 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(!(n==null||n==="")){if(this.backend&&this.backend.create){const l=We(Me({},a),{isUpdate:o}),c=this.backend.create.bind(this.backend);if(c.length<6)try{let d;c.length===5?d=c(t,r,n,i,l):d=c(t,r,n,i),d&&typeof d.then=="function"?d.then(h=>s(null,h)).catch(s):s(null,d)}catch(d){s(d)}else c(t,r,n,i,s,l)}!t||!t[0]||this.store.addResource(t[0],r,n,i)}}}function XW(){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 r=e[3]||e[2];Object.keys(r).forEach(n=>{t[n]=r[n]})}return t},interpolation:{escapeValue:!0,format:(e,t,r,n)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function KW(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function R_(){}function VMe(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]=="function"&&(e[t]=e[t].bind(e))})}class Dy extends L_{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=KW(t),this.services={},this.logger=vc,this.modules={external:[]},VMe(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(){var t=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;typeof r=="function"&&(n=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(typeof r.ns=="string"?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const i=XW();this.options=Me(Me(Me({},i),this.options),KW(r)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Me(Me({},i.interpolation),this.options.interpolation)),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);function o(l){return l?typeof l=="function"?new l:l:null}if(!this.options.isClone){this.modules.logger?vc.init(o(this.modules.logger),this.options):vc.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:typeof Intl!="undefined"&&(l=HMe);const c=new YW(this.options);this.store=new HW(this.options.resources,this.options);const d=this.services;d.logger=vc,d.resourceStore=this.store,d.languageUtils=c,d.pluralResolver=new zMe(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(d.formatter=o(l),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new $Me(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new GMe(o(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(h){for(var u=arguments.length,g=new Array(u>1?u-1:0),f=1;f<u;f++)g[f-1]=arguments[f];t.emit(h,...g)}),this.modules.languageDetector&&(d.languageDetector=o(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=o(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new VW(this.services,this.options),this.translator.on("*",function(h){for(var u=arguments.length,g=new Array(u>1?u-1:0),f=1;f<u;f++)g[f-1]=arguments[f];t.emit(h,...g)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=R_),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[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(l=>{this[l]=function(){return t.store[l](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=function(){return t.store[l](...arguments),t}});const a=Py(),s=()=>{const l=(c,d)=>{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),a.resolve(d),n(c,d)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),a}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R_;const n=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()==="cimode")return r();const i=[],o=a=>{a&&this.services.languageUtils.toResolveHierarchy(a).forEach(s=>{i.indexOf(s)<0&&i.push(s)})};n?o(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(a=>o(a)),this.options.preload&&this.options.preload.forEach(a=>o(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,r,n){const i=Py();return t||(t=this.languages),r||(r=this.options.ns),n||(n=R_),this.services.backendConnector.reload(t,r,o=>{i.resolve(),n(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&UW.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(t,r){var n=this;this.isLanguageChangingTo=t;const i=Py();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,c)=>{c?(o(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return n.t(...arguments)}),r&&r(l,function(){return n.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,d=>{a(d,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,r,n){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),h=2;h<c;h++)d[h-2]=arguments[h];l=i.options.overloadTranslationOptionHandler([a,s].concat(d))}else l=Me({},s);l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix=l.keyPrefix||n||o.keyPrefix;const u=i.options.keySeparator||".";let g;return l.keyPrefix&&Array.isArray(a)?g=a.map(f=>`${l.keyPrefix}${u}${f}`):g=l.keyPrefix?`${l.keyPrefix}${u}${a}`:a,i.t(g,l)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=r,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let r=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 n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===2};if(r.precheck){const s=r.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,t)&&(!i||a(o,t)))}loadNamespaces(t,r){const n=Py();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(t,r){const n=Py();typeof t=="string"&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0);return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{n.resolve(),r&&r(a)}),n):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const r=["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"],n=this.services&&this.services.languageUtils||new YW(XW());return r.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Dy(t,r)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R_;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const i=We(Me(Me({},this.options),t),{isClone:!0}),o=new Dy(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(a=>{o[a]=this[a]}),o.services=Me({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new HW(this.store.data,i),o.services.resourceStore=o.store),o.translator=new VW(o.services,i),o.translator.on("*",function(a){for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;c<s;c++)l[c-1]=arguments[c];o.emit(a,...l)}),o.init(i,r),o.translator.options=i,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 QW=Dy.createInstance();QW.createInstance=Dy.createInstance;const YMe={error:"Error"},qMe={error:"Помилка"},JW="common",ZMe={en:YMe,uk:qMe},yc=QW.createInstance({defaultNS:JW,resources:XMe(ZMe,JW),lng:"en",fallbackLng:"en"}),eH={i18nextInstance:yc,initPromise:yc.init().then(()=>yc)},F_=new Map;F_.set("common",eH);const tH=e=>{if(F_.has(e.namespace))return F_.get(e.namespace);if(e.plugins)for(const o of e.plugins)yc.use(o);Object.keys(e.resource).forEach(o=>{yc.addResourceBundle(o,e.namespace,e.resource[o])});const t=yc.cloneInstance({defaultNS:e.namespace});let r=eH.initPromise.then(()=>t);t.on("languageChanged",o=>{yc.language!==o&&yc.changeLanguage(o)}),yc.on("languageChanged",o=>{t.language!==o&&t.changeLanguage(o)});const n=e.language||"en";yc.language!==n&&(r=r.then(()=>t.changeLanguage(n)).then(()=>t));const i={initPromise:r,i18nextInstance:t};return F_.set(e.namespace,i),i};function XMe(e,t){return Object.keys(e).reduce((r,n)=>(r[n]={[t]:e[n]},r),{})}function KMe(e){return e&&e.replace(new RegExp("(?<!\\\\)'","g"),"\\'")}function QMe(e,t){if(!e||typeof e!="string")return e;const r=new URL(e);return r.origin+(r.pathname.endsWith("/")?r.pathname:r.pathname+"/")+""}var rH=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function up(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function JMe(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var j_={exports:{}},nH;function eTe(){if(nH)return j_.exports;nH=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(B,R,E){return Function.prototype.apply.call(B,R,E)},r;e&&typeof e.ownKeys=="function"?r=e.ownKeys:Object.getOwnPropertySymbols?r=function(B){return Object.getOwnPropertyNames(B).concat(Object.getOwnPropertySymbols(B))}:r=function(B){return Object.getOwnPropertyNames(B)};function n(B){console&&console.warn&&console.warn(B)}var i=Number.isNaN||function(B){return B!==B};function o(){o.init.call(this)}j_.exports=o,j_.exports.once=S,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(B){if(typeof B!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof B)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(B){if(typeof B!="number"||B<0||i(B))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+B+".");a=B}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(B){if(typeof B!="number"||B<0||i(B))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+B+".");return this._maxListeners=B,this};function l(B){return B._maxListeners===void 0?o.defaultMaxListeners:B._maxListeners}o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(B){for(var R=[],E=1;E<arguments.length;E++)R.push(arguments[E]);var N=B==="error",M=this._events;if(M!==void 0)N=N&&M.error===void 0;else if(!N)return!1;if(N){var $;if(R.length>0&&($=R[0]),$ instanceof Error)throw $;var T=new Error("Unhandled error."+($?" ("+$.message+")":""));throw T.context=$,T}var C=M[B];if(C===void 0)return!1;if(typeof C=="function")t(C,this,R);else for(var y=C.length,D=f(C,y),E=0;E<y;++E)t(D[E],this,R);return!0};function c(B,R,E,N){var M,$,T;if(s(E),$=B._events,$===void 0?($=B._events=Object.create(null),B._eventsCount=0):($.newListener!==void 0&&(B.emit("newListener",R,E.listener?E.listener:E),$=B._events),T=$[R]),T===void 0)T=$[R]=E,++B._eventsCount;else if(typeof T=="function"?T=$[R]=N?[E,T]:[T,E]:N?T.unshift(E):T.push(E),M=l(B),M>0&&T.length>M&&!T.warned){T.warned=!0;var C=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(R)+" listeners added. Use emitter.setMaxListeners() to increase limit");C.name="MaxListenersExceededWarning",C.emitter=B,C.type=R,C.count=T.length,n(C)}return B}o.prototype.addListener=function(B,R){return c(this,B,R,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(B,R){return c(this,B,R,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(B,R,E){var N={fired:!1,wrapFn:void 0,target:B,type:R,listener:E},M=d.bind(N);return M.listener=E,N.wrapFn=M,M}o.prototype.once=function(B,R){return s(R),this.on(B,h(this,B,R)),this},o.prototype.prependOnceListener=function(B,R){return s(R),this.prependListener(B,h(this,B,R)),this},o.prototype.removeListener=function(B,R){var E,N,M,$,T;if(s(R),N=this._events,N===void 0)return this;if(E=N[B],E===void 0)return this;if(E===R||E.listener===R)--this._eventsCount===0?this._events=Object.create(null):(delete N[B],N.removeListener&&this.emit("removeListener",B,E.listener||R));else if(typeof E!="function"){for(M=-1,$=E.length-1;$>=0;$--)if(E[$]===R||E[$].listener===R){T=E[$].listener,M=$;break}if(M<0)return this;M===0?E.shift():p(E,M),E.length===1&&(N[B]=E[0]),N.removeListener!==void 0&&this.emit("removeListener",B,T||R)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(B){var R,E,N;if(E=this._events,E===void 0)return this;if(E.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):E[B]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete E[B]),this;if(arguments.length===0){var M=Object.keys(E),$;for(N=0;N<M.length;++N)$=M[N],$!=="removeListener"&&this.removeAllListeners($);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(R=E[B],typeof R=="function")this.removeListener(B,R);else if(R!==void 0)for(N=R.length-1;N>=0;N--)this.removeListener(B,R[N]);return this};function u(B,R,E){var N=B._events;if(N===void 0)return[];var M=N[R];return M===void 0?[]:typeof M=="function"?E?[M.listener||M]:[M]:E?x(M):f(M,M.length)}o.prototype.listeners=function(B){return u(this,B,!0)},o.prototype.rawListeners=function(B){return u(this,B,!1)},o.listenerCount=function(B,R){return typeof B.listenerCount=="function"?B.listenerCount(R):g.call(B,R)},o.prototype.listenerCount=g;function g(B){var R=this._events;if(R!==void 0){var E=R[B];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function f(B,R){for(var E=new Array(R),N=0;N<R;++N)E[N]=B[N];return E}function p(B,R){for(;R+1<B.length;R++)B[R]=B[R+1];B.pop()}function x(B){for(var R=new Array(B.length),E=0;E<R.length;++E)R[E]=B[E].listener||B[E];return R}function S(B,R){return new Promise(function(E,N){function M(T){B.removeListener(R,$),N(T)}function $(){typeof B.removeListener=="function"&&B.removeListener("error",M),E([].slice.call(arguments))}U(B,R,$,{once:!0}),R!=="error"&&j(B,M,{once:!0})})}function j(B,R,E){typeof B.on=="function"&&U(B,"error",R,E)}function U(B,R,E,N){if(typeof B.on=="function")N.once?B.once(R,E):B.on(R,E);else if(typeof B.addEventListener=="function")B.addEventListener(R,function M($){N.once&&B.removeEventListener(R,M),E($)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof B)}return j_.exports}var tTe=eTe();const Ly=up(tTe);function rTe(){this.__data__=[],this.size=0}function iH(e,t){return e===t||e!==e&&t!==t}function B_(e,t){for(var r=e.length;r--;)if(iH(e[r][0],t))return r;return-1}var nTe=Array.prototype,iTe=nTe.splice;function oTe(e){var t=this.__data__,r=B_(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():iTe.call(t,r,1),--this.size,!0}function aTe(e){var t=this.__data__,r=B_(t,e);return r<0?void 0:t[r][1]}function sTe(e){return B_(this.__data__,e)>-1}function lTe(e,t){var r=this.__data__,n=B_(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Cu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Cu.prototype.clear=rTe,Cu.prototype.delete=oTe,Cu.prototype.get=aTe,Cu.prototype.has=sTe,Cu.prototype.set=lTe;function cTe(){this.__data__=new Cu,this.size=0}function uTe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function dTe(e){return this.__data__.get(e)}function hTe(e){return this.__data__.has(e)}var pTe=typeof global=="object"&&global&&global.Object===Object&&global;const oH=pTe;var fTe=typeof self=="object"&&self&&self.Object===Object&&self,gTe=oH||fTe||Function("return this")();const bc=gTe;var mTe=bc.Symbol;const Rg=mTe;var aH=Object.prototype,vTe=aH.hasOwnProperty,yTe=aH.toString,Oy=Rg?Rg.toStringTag:void 0;function bTe(e){var t=vTe.call(e,Oy),r=e[Oy];try{e[Oy]=void 0;var n=!0}catch(o){}var i=yTe.call(e);return n&&(t?e[Oy]=r:delete e[Oy]),i}var xTe=Object.prototype,wTe=xTe.toString;function CTe(e){return wTe.call(e)}var _Te="[object Null]",STe="[object Undefined]",sH=Rg?Rg.toStringTag:void 0;function Fg(e){return e==null?e===void 0?STe:_Te:sH&&sH in Object(e)?bTe(e):CTe(e)}function Iy(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var kTe="[object AsyncFunction]",MTe="[object Function]",TTe="[object GeneratorFunction]",ATe="[object Proxy]";function lH(e){if(!Iy(e))return!1;var t=Fg(e);return t==MTe||t==TTe||t==kTe||t==ATe}var ETe=bc["__core-js_shared__"];const iL=ETe;var cH=function(){var e=/[^.]+$/.exec(iL&&iL.keys&&iL.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function PTe(e){return!!cH&&cH in e}var DTe=Function.prototype,LTe=DTe.toString;function dp(e){if(e!=null){try{return LTe.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var OTe=/[\\^$.*+?()[\]{}|]/g,ITe=/^\[object .+?Constructor\]$/,NTe=Function.prototype,RTe=Object.prototype,FTe=NTe.toString,jTe=RTe.hasOwnProperty,BTe=RegExp("^"+FTe.call(jTe).replace(OTe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zTe(e){if(!Iy(e)||PTe(e))return!1;var t=lH(e)?BTe:ITe;return t.test(dp(e))}function $Te(e,t){return e==null?void 0:e[t]}function jg(e,t){var r=$Te(e,t);return zTe(r)?r:void 0}var WTe=jg(bc,"Map");const Ny=WTe;var HTe=jg(Object,"create");const Ry=HTe;function UTe(){this.__data__=Ry?Ry(null):{},this.size=0}function GTe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var VTe="__lodash_hash_undefined__",YTe=Object.prototype,qTe=YTe.hasOwnProperty;function ZTe(e){var t=this.__data__;if(Ry){var r=t[e];return r===VTe?void 0:r}return qTe.call(t,e)?t[e]:void 0}var XTe=Object.prototype,KTe=XTe.hasOwnProperty;function QTe(e){var t=this.__data__;return Ry?t[e]!==void 0:KTe.call(t,e)}var JTe="__lodash_hash_undefined__";function eAe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ry&&t===void 0?JTe:t,this}function hp(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}hp.prototype.clear=UTe,hp.prototype.delete=GTe,hp.prototype.get=ZTe,hp.prototype.has=QTe,hp.prototype.set=eAe;function tAe(){this.size=0,this.__data__={hash:new hp,map:new(Ny||Cu),string:new hp}}function rAe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function z_(e,t){var r=e.__data__;return rAe(t)?r[typeof t=="string"?"string":"hash"]:r.map}function nAe(e){var t=z_(this,e).delete(e);return this.size-=t?1:0,t}function iAe(e){return z_(this,e).get(e)}function oAe(e){return z_(this,e).has(e)}function aAe(e,t){var r=z_(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function pp(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}pp.prototype.clear=tAe,pp.prototype.delete=nAe,pp.prototype.get=iAe,pp.prototype.has=oAe,pp.prototype.set=aAe;var sAe=200;function lAe(e,t){var r=this.__data__;if(r instanceof Cu){var n=r.__data__;if(!Ny||n.length<sAe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new pp(n)}return r.set(e,t),this.size=r.size,this}function Dd(e){var t=this.__data__=new Cu(e);this.size=t.size}Dd.prototype.clear=cTe,Dd.prototype.delete=uTe,Dd.prototype.get=dTe,Dd.prototype.has=hTe,Dd.prototype.set=lAe;var cAe="__lodash_hash_undefined__";function uAe(e){return this.__data__.set(e,cAe),this}function dAe(e){return this.__data__.has(e)}function $_(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new pp;++t<r;)this.add(e[t])}$_.prototype.add=$_.prototype.push=uAe,$_.prototype.has=dAe;function hAe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function pAe(e,t){return e.has(t)}var fAe=1,gAe=2;function uH(e,t,r,n,i,o){var a=r&fAe,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(e),d=o.get(t);if(c&&d)return c==t&&d==e;var h=-1,u=!0,g=r&gAe?new $_:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var f=e[h],p=t[h];if(n)var x=a?n(p,f,h,t,e,o):n(f,p,h,e,t,o);if(x!==void 0){if(x)continue;u=!1;break}if(g){if(!hAe(t,function(S,j){if(!pAe(g,j)&&(f===S||i(f,S,r,n,o)))return g.push(j)})){u=!1;break}}else if(!(f===p||i(f,p,r,n,o))){u=!1;break}}return o.delete(e),o.delete(t),u}var mAe=bc.Uint8Array;const dH=mAe;function vAe(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function yAe(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var bAe=1,xAe=2,wAe="[object Boolean]",CAe="[object Date]",_Ae="[object Error]",SAe="[object Map]",kAe="[object Number]",MAe="[object RegExp]",TAe="[object Set]",AAe="[object String]",EAe="[object Symbol]",PAe="[object ArrayBuffer]",DAe="[object DataView]",hH=Rg?Rg.prototype:void 0,oL=hH?hH.valueOf:void 0;function LAe(e,t,r,n,i,o,a){switch(r){case DAe:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case PAe:return!(e.byteLength!=t.byteLength||!o(new dH(e),new dH(t)));case wAe:case CAe:case kAe:return iH(+e,+t);case _Ae:return e.name==t.name&&e.message==t.message;case MAe:case AAe:return e==t+"";case SAe:var s=vAe;case TAe:var l=n&bAe;if(s||(s=yAe),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=xAe,a.set(e,t);var d=uH(s(e),s(t),n,i,o,a);return a.delete(e),d;case EAe:if(oL)return oL.call(e)==oL.call(t)}return!1}function OAe(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var IAe=Array.isArray;const W_=IAe;function NAe(e,t,r){var n=t(e);return W_(e)?n:OAe(n,r(e))}function RAe(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function FAe(){return[]}var jAe=Object.prototype,BAe=jAe.propertyIsEnumerable,pH=Object.getOwnPropertySymbols,zAe=pH?function(e){return e==null?[]:(e=Object(e),RAe(pH(e),function(t){return BAe.call(e,t)}))}:FAe;const $Ae=zAe;function WAe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Bg(e){return e!=null&&typeof e=="object"}var HAe="[object Arguments]";function fH(e){return Bg(e)&&Fg(e)==HAe}var gH=Object.prototype,UAe=gH.hasOwnProperty,GAe=gH.propertyIsEnumerable,VAe=fH(function(){return arguments}())?fH:function(e){return Bg(e)&&UAe.call(e,"callee")&&!GAe.call(e,"callee")};const YAe=VAe;function qAe(){return!1}var mH=typeof Ge=="object"&&Ge&&!Ge.nodeType&&Ge,vH=mH&&typeof module=="object"&&module&&!module.nodeType&&module,ZAe=vH&&vH.exports===mH,yH=ZAe?bc.Buffer:void 0,XAe=yH?yH.isBuffer:void 0,KAe=XAe||qAe;const aL=KAe;var QAe=9007199254740991,JAe=/^(?:0|[1-9]\d*)$/;function eEe(e,t){var r=typeof e;return t=t==null?QAe:t,!!t&&(r=="number"||r!="symbol"&&JAe.test(e))&&e>-1&&e%1==0&&e<t}var tEe=9007199254740991;function bH(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=tEe}var rEe="[object Arguments]",nEe="[object Array]",iEe="[object Boolean]",oEe="[object Date]",aEe="[object Error]",sEe="[object Function]",lEe="[object Map]",cEe="[object Number]",uEe="[object Object]",dEe="[object RegExp]",hEe="[object Set]",pEe="[object String]",fEe="[object WeakMap]",gEe="[object ArrayBuffer]",mEe="[object DataView]",vEe="[object Float32Array]",yEe="[object Float64Array]",bEe="[object Int8Array]",xEe="[object Int16Array]",wEe="[object Int32Array]",CEe="[object Uint8Array]",_Ee="[object Uint8ClampedArray]",SEe="[object Uint16Array]",kEe="[object Uint32Array]",Zn={};Zn[vEe]=Zn[yEe]=Zn[bEe]=Zn[xEe]=Zn[wEe]=Zn[CEe]=Zn[_Ee]=Zn[SEe]=Zn[kEe]=!0,Zn[rEe]=Zn[nEe]=Zn[gEe]=Zn[iEe]=Zn[mEe]=Zn[oEe]=Zn[aEe]=Zn[sEe]=Zn[lEe]=Zn[cEe]=Zn[uEe]=Zn[dEe]=Zn[hEe]=Zn[pEe]=Zn[fEe]=!1;function MEe(e){return Bg(e)&&bH(e.length)&&!!Zn[Fg(e)]}function TEe(e){return function(t){return e(t)}}var xH=typeof Ge=="object"&&Ge&&!Ge.nodeType&&Ge,Fy=xH&&typeof module=="object"&&module&&!module.nodeType&&module,AEe=Fy&&Fy.exports===xH,sL=AEe&&oH.process,EEe=function(){try{var e=Fy&&Fy.require&&Fy.require("util").types;return e||sL&&sL.binding&&sL.binding("util")}catch(t){}}();const wH=EEe;var CH=wH&&wH.isTypedArray,PEe=CH?TEe(CH):MEe;const _H=PEe;var DEe=Object.prototype,LEe=DEe.hasOwnProperty;function OEe(e,t){var r=W_(e),n=!r&&YAe(e),i=!r&&!n&&aL(e),o=!r&&!n&&!i&&_H(e),a=r||n||i||o,s=a?WAe(e.length,String):[],l=s.length;for(var c in e)LEe.call(e,c)&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||eEe(c,l)))&&s.push(c);return s}var IEe=Object.prototype;function NEe(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||IEe;return e===r}function REe(e,t){return function(r){return e(t(r))}}var FEe=REe(Object.keys,Object);const jEe=FEe;var BEe=Object.prototype,zEe=BEe.hasOwnProperty;function $Ee(e){if(!NEe(e))return jEe(e);var t=[];for(var r in Object(e))zEe.call(e,r)&&r!="constructor"&&t.push(r);return t}function WEe(e){return e!=null&&bH(e.length)&&!lH(e)}function HEe(e){return WEe(e)?OEe(e):$Ee(e)}function SH(e){return NAe(e,HEe,$Ae)}var UEe=1,GEe=Object.prototype,VEe=GEe.hasOwnProperty;function YEe(e,t,r,n,i,o){var a=r&UEe,s=SH(e),l=s.length,c=SH(t),d=c.length;if(l!=d&&!a)return!1;for(var h=l;h--;){var u=s[h];if(!(a?u in t:VEe.call(t,u)))return!1}var g=o.get(e),f=o.get(t);if(g&&f)return g==t&&f==e;var p=!0;o.set(e,t),o.set(t,e);for(var x=a;++h<l;){u=s[h];var S=e[u],j=t[u];if(n)var U=a?n(j,S,u,t,e,o):n(S,j,u,e,t,o);if(!(U===void 0?S===j||i(S,j,r,n,o):U)){p=!1;break}x||(x=u=="constructor")}if(p&&!x){var B=e.constructor,R=t.constructor;B!=R&&"constructor"in e&&"constructor"in t&&!(typeof B=="function"&&B instanceof B&&typeof R=="function"&&R instanceof R)&&(p=!1)}return o.delete(e),o.delete(t),p}var qEe=jg(bc,"DataView");const lL=qEe;var ZEe=jg(bc,"Promise");const cL=ZEe;var XEe=jg(bc,"Set");const uL=XEe;var KEe=jg(bc,"WeakMap");const dL=KEe;var kH="[object Map]",QEe="[object Object]",MH="[object Promise]",TH="[object Set]",AH="[object WeakMap]",EH="[object DataView]",JEe=dp(lL),ePe=dp(Ny),tPe=dp(cL),rPe=dp(uL),nPe=dp(dL),fp=Fg;(lL&&fp(new lL(new ArrayBuffer(1)))!=EH||Ny&&fp(new Ny)!=kH||cL&&fp(cL.resolve())!=MH||uL&&fp(new uL)!=TH||dL&&fp(new dL)!=AH)&&(fp=function(e){var t=Fg(e),r=t==QEe?e.constructor:void 0,n=r?dp(r):"";if(n)switch(n){case JEe:return EH;case ePe:return kH;case tPe:return MH;case rPe:return TH;case nPe:return AH}return t});const PH=fp;var iPe=1,DH="[object Arguments]",LH="[object Array]",H_="[object Object]",oPe=Object.prototype,OH=oPe.hasOwnProperty;function aPe(e,t,r,n,i,o){var a=W_(e),s=W_(t),l=a?LH:PH(e),c=s?LH:PH(t);l=l==DH?H_:l,c=c==DH?H_:c;var d=l==H_,h=c==H_,u=l==c;if(u&&aL(e)){if(!aL(t))return!1;a=!0,d=!1}if(u&&!d)return o||(o=new Dd),a||_H(e)?uH(e,t,r,n,i,o):LAe(e,t,l,r,n,i,o);if(!(r&iPe)){var g=d&&OH.call(e,"__wrapped__"),f=h&&OH.call(t,"__wrapped__");if(g||f){var p=g?e.value():e,x=f?t.value():t;return o||(o=new Dd),i(p,x,r,n,o)}}return u?(o||(o=new Dd),YEe(e,t,r,n,i,o)):!1}function IH(e,t,r,n,i){return e===t?!0:e==null||t==null||!Bg(e)&&!Bg(t)?e!==e&&t!==t:aPe(e,t,r,n,IH,i)}function hL(e,t){return IH(e,t)}const ur={HEADERS:"headers",METADATA:"metadata",DATA:"data",GRAND:"grand",FINISH:"finish",ERROR:"error",TOTAL_ROWS:"totalRows",DATA_FINISH:"dataFinish",DATABARS:"dataBars",RANGE_MIN_MAX:"rangeMinMax"},sPe=[ur.ERROR,ur.HEADERS,ur.GRAND,ur.METADATA,ur.DATA,ur.DATA_FINISH,ur.TOTAL_ROWS,ur.DATABARS,ur.RANGE_MIN_MAX,ur.FINISH],or={ROWS:"rows",COLUMNS:"columns",MEASURES:"measures",SCOPE:"scope"},Mi={ASC:"asc",DESC:"desc"},Tr={SUB_TOTAL:"subTotal",GRAND_TOTAL:"grandTotal",MEASURE_TOP:"measureTop",MEASURE_BOTTOM:"measureBottom",CORNER:"corner"},NH={COLOR:"color",CONDITION:"condition"},_u={DATETIME:"datetime",TEXT:"text",NUMERIC:"numeric"},zg={MEMBER:"member",VALUE:"value",SUB_TOTAL:"subtotal",GRAND_TOTAL:"grandtotal"},Ld={MEMBER:"member",INDEX:"index",TITLE:"title",NAME:"name",AGG:"agg",DIM:"dim"};class lPe{constructor(t,r,n,i){Re(this,"rowIndex"),Re(this,"colIndex"),Re(this,"node"),Re(this,"parent"),Re(this,"childColCells",[]),Re(this,"childRowCells",[]),Re(this,"indexInParent",-1),Re(this,"siblingCount",0),this.rowIndex=t,this.colIndex=r,this.node=n,this.parent=i}isChild(){return!this.node}hasChildren(){return!!(this.childColCells.length||this.childRowCells.length)}hasColCell(){return this.childColCells.length>0}addColCell(t){this.childColCells.push(t)}getColCell(){return this.childColCells||[]}hasRowCell(){return this.childRowCells.length>0}addRowCell(t){this.childRowCells.push(t)}getRowCell(){return this.childRowCells||[]}getStopRowIndex(){return this.hasRowCell()?this.rowIndex+this.getRowCell().length:this.rowIndex}getStopColIndex(){return this.hasColCell()?this.colIndex+this.getColCell().length:this.colIndex}setIndexInParent(t,r){this.indexInParent=t,this.siblingCount=r}getIndexInParent(){return{indexInParent:this.indexInParent,siblingCount:this.siblingCount}}getParenPosition(){if(!this.parent)return;const t=(this.parent||"").match(/\d+/g)||[];return[Number(t[0]),Number(t[1])]}}const U_=["S&PManager","Cache"],G_=["null"];class jy{constructor(t=""){Re(this,"name"),Re(this,"log"),Re(this,"warn"),Re(this,"error"),Re(this,"console"),this.name=t,this.log=()=>{},this.warn=()=>{},this.error=()=>{},this.console=jy.createMockConsole(),this.createLogFn()}setName(t){this.name=t,this.createLogFn()}getName(){return this.name}createLogFn(){this.log=()=>{},this.warn=()=>{},this.error=()=>{}}isExcludedName(){return G_.length&&!this.hasNamePartsInList(G_)?!0:U_.length?this.hasNamePartsInList(U_):!1}hasNamePartsInList(t){const r=this.name.toLowerCase();return t.some(n=>r.includes(n.toLowerCase()))}static createMockConsole(){return{log:()=>{},warn:()=>{},error:()=>{}}}static createMock(){const t=jy.createMockConsole();return We(Me({setName:()=>{},getName:()=>""},t),{console:t})}}const cPe=e=>new jy(e),uPe=(e="")=>{U_.push(e.toLowerCase())},dPe=(e="")=>{G_.push(e.toLowerCase())},hPe=()=>{U_.length=0,G_.length=0},Od={Logger:jy,create:cPe,excludeLogs:uPe,includeLogs:dPe,clearIncludeExclude:hPe},RH=[Date,Error,RegExp,Promise];function FH(e,t=RH){return t.some(r=>e instanceof r)}function jH(e,t=[]){let r=!1;return t.forEach(n=>{e.includes(n)&&(r=!0)}),r}function BH(e=[],t,r){const n=[];return r&&e.forEach(i=>{n.push(`${i}.$`)}),e.length?e.forEach(i=>{n.push(`${i}.${t}`)}):n.push(t),n}function By(e){return!(e===null||typeof e=="undefined"||typeof e!="object")}function pPe(e,t){return By(e)&&e?Array.isArray(e)?!e.length:FH(e,t)?!1:!Object.keys(e).length:e==null}function fPe(e=""){const t=e.split(".");return t.length>1?(t.pop(),t.join(".")):t[0]}function zH(e,t,r){return e.length?jH(e,r):t.length?!jH(t,r):!0}function $H(e,t=[],r=[],n=[],i={},o={},a=[],s=[]){if(!By(e))return{commonIncludeKeys:[],commonExcludeKeys:[]};const l=a.indexOf(e);if(l!==-1)return s[l];a.push(e);const c=Object.keys(e),d=Array.isArray(e);let h=[],u=[];const g=[],f=[];if(c.forEach(p=>{const x=e[p],S=BH(n,p,d),j=n[0]||"&";i[j]=i[j]||[],o[j]=o[j]||[],S.forEach(U=>{(t||[]).includes(U)&&(i[j].push(U),h.push(U)),(t||[]).forEach(B=>{const R=fPe(B);(`${R}.$`===j||R===j)&&(i[j].includes(B)||i[j].push(B),h.includes(B)||h.push(B))}),(r||[]).includes(U)&&(o[j].push(U),u.push(U))}),By(x)&&$H(x,t,r,S,i,o,a,s)}),By(e)){let p=n[0]||"&";Array.isArray(e)&&(p=`${p}.$`),i[p]=(i[p]||[]).concat(g),h=h.concat(g),o[p]=(o[p]||[]).concat(f),u=h.concat(f)}return s.push({commonIncludeKeys:h,commonExcludeKeys:u}),{commonIncludeKeys:h,commonExcludeKeys:u}}function WH(e,t,r=new WeakMap){const{includeKeys:n,includeKeysObj:i,excludeKeys:o,excludeKeysObj:a,parentKeys:s=[],excludeEmpty:l,referenceClone:c}=t||{};if(!By(e)||FH(e,c))return e;if(r.has(e))return r.get(e);const d=Object.keys(e),h=Array.isArray(e),u=h?[]:{};r.set(e,u);const g=s[0]||"&",f=(i||{})[g]||[],p=(a||{})[g]||[];return d.forEach(x=>{const S=e[x];let j=[],U=!0;if(n||o?U=zH(n||[],o||[],[x]):(i||a)&&(j=BH(s,x,h),U=zH(f,p,j)),U){const B=WH(S,We(Me({},t),{parentKeys:j}),r);(!l||!pPe(B,c))&&(h?u.push(B):u[x]=B)}}),u}function Ta(e,t){const r=t||{},{include:n,exclude:i}=r,o=wt(r,["include","exclude"]);let a,s;(n||i)&&(a={},s={},$H(e,n,i,[],a,s));const l=We(Me({},o),{includeKeysObj:a,excludeKeysObj:s});return WH(e,l)}Ta.REFERENCE_CLONE_TYPES=RH;const pL=e=>t=>e.replace(/{{(\w+)}}/g,(r,n)=>typeof t[n]!="undefined"?t[n]:n),HH=(e,t)=>{let r,n,i=null;const o=(...a)=>{r?i=a:(e(...a),r=!0,i=null,n=setTimeout(()=>{r=!1,i&&(e(...i),i=null)},t))};return o.cancel=()=>{clearTimeout(n),r=!1},o},UH=(e,t)=>{const r={};return Object.keys(e).forEach(n=>{e[n]!==t[n]&&(r[n]=t[n])}),Object.keys(t).forEach(n=>{typeof r[n]=="undefined"&&e[n]!==t[n]&&(r[n]=t[n])}),r};function fL(e=!0){let t={},r=null;return({callback:n,indices:i})=>{const o=Object.keys(i),a=!e||o.every(l=>{const c=i[l];return Array.isArray(c)?c.length>0:c>=0}),s=o.length!==Object.keys(t).length||o.some(l=>{const c=t[l],d=i[l];return Array.isArray(d)?c.join(",")!==d.join(","):c!==d});return t=i,a&&s&&(r=n(i)),r}}function GH(e,t,r=0){for(let n=r;n<e.length;n+=1){const i=e[n];if(t(i,n,e))return n}return-1}const zy="$*$root$*$";function gPe(e,t,r,n){const i={value:e};return t&&(i.children=t),r&&(i.data=r),typeof n!="undefined"&&(i.index=n),i}function V_(e){return!!(e&&e.children&&e.children.length)}function Il(e){return e&&e.children||[]}function gL(e,t){e&&t&&Array.isArray(t)&&(e.children=t)}function mPe(e,t){e&&(e.level=t)}function vPe(e){return e&&typeof e.level!="undefined"?e.level||0:-1}function $g(e){if(!e)return;if(e&&!Array.isArray(e)&&e.value===zy)return e;const t={value:zy,children:[]};return Array.isArray(e)?t.children=e:(t.children||[])[0]=e,t}function VH(e,t,r=0){let n;if(!e||!t)return n;if(t(e,r)&&(n=e),V_(e)){const i=Il(e),o=i.length;for(let a=0;a<o;a+=1){const s=VH(i[a],t,r+1);if(s){n=s;break}}}return n}function yPe(e,t){if(!e&&!t)return;if(!e&&t)return $g(t);if(e&&!t)return $g(e);const r=$g(e),n=$g(t),i=r&&r.children||[],o=n&&n.children||[],a=i.concat(o);return $g(a)}const YH=(e,t=0)=>{if(!e||!e.isPart)return;e.level=t;const r=Il(e),n=r[r.length-1];return n&&YH(n,t+1)||e},qH=(e,t,r=0)=>{if(!e||!e.isPart)return;if(e.level=r,e&&t&&e.value===t.value&&e.level===t.level)return e;const n=Il(e)[0];return n&&qH(n,t,r+1)||e};function bPe(e,t){let r=YH(e),n=qH(t,r);r&&r.children&&Array.isArray(r.children)&&n&&n.children&&Array.isArray(n.children)&&n.children.length>0&&(r.children=r.children.concat(n.children),n.isHandled=!0);let i=!1;for(r=e,n=t;r&&r.children&&Array.isArray(r.children)&&n&&n.children&&Array.isArray(n.children)&&!n.isHandled;){const o=r.children;r=r.children[r.children.length-1];let a=0;for(n.children[0]&&!i&&(i=!Il(n.children[0]).some(s=>s.isPart),a=1);a<n.children.length;)o.push(n.children[a]),a+=1;n=n.children[0]}return e}function ZH(e,t,r){!e||!t||e.forEach(n=>{t(n,r),V_(n)&&ZH(Il(n),t,n)})}function XH(e,t=[],r=0,n={maxLevel:0}){return e.forEach(i=>{n.maxLevel<r&&(n.maxLevel=r),V_(i)?XH(Il(i),t,r+1,n):t.push(i)}),t}function Y_(e,t={}){if(t||(t={}),typeof t.callCount!="number"?t.callCount=1:t.callCount+=1,!e)return 0;let r=t.clearCache||!1;!Array.isArray(e)&&e.value===zy&&(r=!0);let n=1,i=[];return Array.isArray(e)?(n=0,i=e):e.children&&(i=Il(e)),i&&i.length&&(!r&&!Array.isArray(e)&&typeof e.childCount=="number"?n=e.childCount:(n=0,i.forEach(o=>{n+=Y_(o,t)}),Array.isArray(e)||(e.childCount=n))),n}function KH(e,t={}){if(t||(t={}),typeof t.callCount!="number"?t.callCount=1:t.callCount+=1,!e)return 0;let r=t.clearCache||!1;!Array.isArray(e)&&e.value===zy&&(r=!0);let n=0,i=[];if(e&&!Array.isArray(e)&&typeof e.value!="undefined"&&(n=1),Array.isArray(e)?(n=0,i=e):e.children&&(i=Il(e)),i&&i.length)if(!r&&!Array.isArray(e)&&typeof e.childDeep=="number")n+=e.childDeep;else{let o=0;i.forEach(a=>{const s=KH(a,t);s>o&&(o=s)}),n+=o,Array.isArray(e)||(e.childDeep=o)}return n}function QH(e=[],t=0,r){const n=[];let i=0,o=-1,a=-1;const s=e.length;if(typeof t=="number"&&typeof r=="number"&&t>r)throw new Error('Wrong "getNodesByChildCount" diapason');if(typeof t=="number"&&t<0)throw new Error('Wrong "from" index for "getNodesByChildCount"');for(let l=0;l<s;l+=1){const c=e[l],d=Y_(c);if(i+d>t&&(o<0&&(o=i),n.push(c),typeof r=="number"&&i+d>=r)){a=i+d;break}a=i+d,i+=d}return{nodes:n,start:o,stop:a}}function xPe(e){e.isMapped!==void 0&&(e.isMapped=void 0),e.minLevel!==void 0&&(e.minLevel=void 0),e.childCount!==void 0&&(e.childCount=void 0),e.childDeep!==void 0&&(e.childDeep=void 0)}function mL(e=[],t=0,r,n){const{cloneFn:i=Ta}=n||{},o=[],{nodes:a,start:s,stop:l}=QH(e,t,r),c=a.length;let d,h,u=!0;if(s<t){const g=a[0]||{},f=t-s;let p;c===1&&typeof r=="number"&&(p=r-s,u=!1),d=i(g,!0);const x=mL(Il(g),f,p,n);gL(d,x)}if(typeof r=="number"&&l>r&&u){const g=a[c-1]||{},f=0,p=Y_(g)-(l-r);h=i(g,!0);const x=mL(Il(g),f,p,n);gL(h,x)}return a.forEach((g,f)=>{if(d&&f===0)o.push(d);else if(h&&f===c-1)o.push(h);else{const p=i(g);o.push(p)}}),o}const Nt={ROOT:zy,create:gPe,hasChildren:V_,getChildren:Il,setChildren:gL,setLevel:mPe,getLevel:vPe,getLastLevelNodes:XH,iterateThroughTree:ZH,wrapInRootNode:$g,findNode:VH,merge:yPe,deepMerge:bPe,getChildLength:Y_,getDeepLength:KH,getNodesByChildCount:QH,getCutNodesByChildCount:mL,clearNodeCache:xPe},yo={FIRST:"first",LAST:"last",EVEN:"even",ODD:"odd"},Wg=(e,t)=>`${e}-${t}`;class wPe{constructor(t,r=!1,n){Re(this,"tree"),Re(this,"hasGrandTotals",!1),Re(this,"isVertical",!1),Re(this,"deep"),Re(this,"columns",[]),Re(this,"lastLevel",[]),Re(this,"map",{}),Re(this,"metadataCache",{}),Re(this,"valueNode"),Re(this,"grid"),this.isVertical=r,this.deep=n,t&&(this.tree=t,this.columns=this.cacheLevels(Nt.getChildren(this.tree)))}destroy(){this.tree=void 0,this.columns=[],this.lastLevel=[],this.map={},this.metadataCache={},this.valueNode=void 0,this.grid=void 0}getMainCellWidth(t,r,n,i,o={offsetTop:-1,columnsOffset:0}){const{columnsOffset:a=0}=o,s=this.getItem(t,r),l=s&&s.hasChildren()&&s.hasColCell();let c=Number.NaN,d=!0;if(s&&l){const h=s.getColCell(),u=n({index:r+a});c=h.reduce((g,f)=>{const p=n({index:f.colIndex+a});return p||(d=!1),g+p},u),c-=i,c=Math.ceil(c)}return d?c:Number.NaN}extend(t){t&&(this.grid=void 0,this.tree=Nt.merge(this.tree,t),this.columns=this.cacheLevels(Nt.getChildren(t),this.columns))}getGrid(){if(this.grid)return this.grid;let t=this.getTreeDeepsLength(),r=this.getTreeChildLength();return this.isVertical?([t,r]=[r,t],this.map=this.fillMapVertical(Nt.getChildren(this.tree),r,this.map)):this.map=this.fillMap(Nt.getChildren(this.tree),t,this.map),this.grid=Array.from(Array(t)).map((n,i)=>Array.from(Array(r)).map((o,a)=>{const s=Wg(i,a),l=this.map[s];if(!l)throw new Error(`Key "${s}" does not found in TreeService`);return l.node?l.node:l.parent})),this.grid}getPartialGrid(t,r){if(!this.isVertical)throw new Error('"getPartialGrid" can only be used for "vertical" tree');const n=this.getTreeDeepsLength(),i=Nt.getChildren(this.tree),{nodes:o,start:a,stop:s}=Nt.getNodesByChildCount(i,t,r);this.fillMapVertical(o,n,this.map,{parentRowIndex:a,parentColIndex:0,prevChildren:0,parentKey:""});const l=Math.max(a,t),c=Math.min(s,r),d=Math.max(0,c-t);return Array.from(Array(d)).map((h,u)=>Array.from(Array(n)).map((g,f)=>{const p=l+u,x=Wg(p,f),S=this.map[x];if(!S)throw new Error(`Key "${x}" does not found in TreeService`);return S.node?S.node:S.parent||""}))}getPartialTree(t,r,n){const i=Nt.getChildren(this.tree);return Nt.getCutNodesByChildCount(i,t,r,n)}getTreeNode(t,r){const n=this.getItem(t,r);if(n&&n.node)return n.node}isChildren(t,r){const n=this.getItem(t,r);if(n)return n.isChild();if(typeof this.deep=="number"&&(this.isVertical?r:t)<this.deep)return!0;throw new Error(`Item "${t}-${r}" does not found in TreeService`)}hasChildren(t,r){const n=this.getItem(t,r);if(n)return n.hasChildren();throw new Error(`Item "${t}-${r}" does not found in TreeService`)}getMainCellSpans(t,r){const n={},i=this.getItem(t,r);return i&&i.hasColCell()&&(n.colSpan=i.getColCell().length+1),i&&i.hasRowCell()&&(n.rowSpan=i.getRowCell().length+1),n}alignStartIndex(t,r=!1){let n=0,i=t;if(r&&(n=t,i=0),this.isVertical===r){let o=this.getItem(n,i);if(o&&o.isChild()&&(o=this.getItemByKey(o.parent||"")),o)return r?o.rowIndex:o.colIndex}return t}alignStopIndex(t,r=!1){let n=0,i=t;if(r&&(n=t,i=0),this.isVertical===r){let o=this.getItem(n,i);if(o&&o.isChild()&&(o=this.getItemByKey(o.parent||"")),o)return r?o.getStopRowIndex():o.getStopColIndex()}return t}getTreeChildLength(t=Nt.getChildren(this.tree),r){return Nt.getChildLength(t,r)}getTreeDeepsLength(t=Nt.getChildren(this.tree),r){return typeof this.deep!="undefined"&&this.deep!==void 0?this.deep:Nt.getDeepLength(t,r)}getLastLevelNodes(){return this.lastLevel}extractData(t){if(!t)return[];const r=t.getLastLevelNodes().map(n=>n.index);return this.getLastLevelNodes().map(n=>typeof n.data=="undefined"?[n.data]:r?r.map(i=>{let o;return typeof i!="undefined"&&n.data&&(o=n.data[i]),o}):n.data)}getMetadata(t,r,n){const i=this.getTreeDeepsLength();t===1/0&&(t=i&&i-1),r===1/0&&(r=i&&i-1);const o=`${t}-${r}`;if(this.metadataCache[o])return this.metadataCache[o];let a=this.getItemByKey(o);if(!a)throw new Error(`Can not find metadata info for ${o} cell`);let s=a?a.node:void 0;if(s||(a=this.getItemByKey(a.parent||"")),!a)throw new Error(`Can not find metadata info for parent ${o} cell`);s=a?a.node:void 0;const l=this.getItemByKey(`${t+1}-${r}`),c=l?l.node:void 0,d=s&&s.level||0,h=this.isVertical?a.getStopColIndex():a.getStopRowIndex();let{indexInParent:u,siblingCount:g}=a.getIndexInParent(),f=u;if(d===0&&(g=this.getTreeChildLength(),u=this.isVertical?a.rowIndex:a.colIndex,f=u+(this.isVertical?a.getRowCell().length:a.getColCell().length)),n){const j=n.to-n.from;g<=j&&f>j-1&&(f=j-1)}const p={levels:[],siblings:[],root:void 0,parent:void 0,valueNode:this.valueNode,nextNode:c},{indexDivergence:x}=s||{};if(typeof x=="number"){const j=x===0?yo.EVEN:yo.ODD;p.siblings.push(j)}if(d===0&&p.levels.push(yo.FIRST),h===i-1&&p.levels.push(yo.LAST),u===0&&p.siblings.push(yo.FIRST),f===g-1&&p.siblings.push(yo.LAST),s&&d!==0){const j=this.isVertical?t:0,U=this.isVertical?0:r;p.root=this.getMetadata(j,U,n)}const S=this.getItemByKey(a.parent||"");if(S&&d!==0&&(p.parent=this.getMetadata(S.rowIndex,S.colIndex,n)),n){const j=this.isVertical?a.rowIndex:a.colIndex,U=this.isVertical?a.getStopRowIndex():a.getStopColIndex();let B;S&&(B=this.isVertical?S.getStopRowIndex():S.getStopColIndex()),B!==void 0&&B>=n.to-n.from&&U>=n.to-n.from-1&&!p.siblings.includes(yo.LAST)&&p.siblings.push(yo.LAST),j===0&&!p.siblings.includes(yo.FIRST)&&p.siblings.push(yo.FIRST)}return this.metadataCache[o]=p,p}setValueNode(t){typeof t=="object"&&(this.valueNode=t)}cacheLevels(t,r=[],n={level:0}){const{level:i}=n;return t.forEach(o=>{if(r[i]||(r[i]=[]),Nt.setLevel(o,i),r[i].push(o),Nt.hasChildren(o)){const a=i+1;this.cacheLevels(Nt.getChildren(o),r,{level:a})}else this.lastLevel.push(o)}),r}fillMap(t,r,n={},i){const o=i||{parentRowIndex:0,parentColIndex:0,prevChildren:0,parentKey:""},a=t.length;return t.forEach((s,l)=>{const{parentRowIndex:c,parentColIndex:d,prevChildren:h,parentKey:u}=o,g=Nt.getLevel(s)+c,f=l+d+h,p=Wg(g,f),x=this.createTreeCellMap({rowIndex:g,colIndex:f,node:s,parent:u});x.setIndexInParent(l,a),n[p]=x;let S=0,j=0;if(Nt.hasChildren(s)?(S=this.getTreeChildLength(s),typeof s.minLevel=="number"&&(j=s.minLevel+1-g||0)):j=(r||0)-(g||0),(S>1||j>1)&&this.fillChildMap(n,p,g,f,j,S),Nt.hasChildren(s)){const U=We(Me({},o),{parentRowIndex:j>1?j-1:0,parentColIndex:l+d,parentKey:p});this.fillMap(Nt.getChildren(s),r,n,U),S>1&&(o.prevChildren+=S-1)}}),n}fillMapVertical(t,r,n={},i){const o=i||{parentRowIndex:0,parentColIndex:0,prevChildren:0,parentKey:""},a=t.length;return t.forEach((s,l)=>{if(s.isMapped){o.parentRowIndex+=Nt.getChildLength(s)-1;return}s.isMapped=!0;const{parentRowIndex:c,prevChildren:d,parentKey:h}=o,u=Nt.getLevel(s),g=l+c+d,f=Wg(g,u),p=this.createTreeCellMap({rowIndex:g,colIndex:u,node:s,parent:h});p.setIndexInParent(l,a),n[f]=p;let x=0,S=0;if(Nt.hasChildren(s)?S=this.getTreeChildLength(s):x=(r||0)-(u||0),(x>1||S>1)&&this.fillChildMap(n,f,g,u,S,x),Nt.hasChildren(s)){const j=We(Me({},o),{parentRowIndex:l+c,parentKey:f});this.fillMapVertical(Nt.getChildren(s),r,n,j),S>1&&(o.prevChildren+=S-1)}}),n}fillChildMap(t,r,n,i,o,a){const s=t[r],l=Math.max(1,o),c=Math.max(1,a);Array.from(Array(l)).forEach((d,h)=>{Array.from(Array(c)).forEach((u,g)=>{if(h===0&&g===0)return;const f=n+h,p=i+g,x=Wg(f,p),S=this.createTreeCellMap({rowIndex:f,colIndex:p,parent:r});t[x]=S,!(h!==0&&g!==0)&&(g===0&&s.addRowCell(S),h===0&&s.addColCell(S))})})}createTreeCellMap({rowIndex:t,colIndex:r,node:n,parent:i}){return new lPe(t,r,n,i)}getItemByKey(t){return this.map[t]}getItem(t,r){const n=Wg(t,r);return this.getItemByKey(n)}}class gp extends wPe{}class Hg extends Error{constructor(t="Loading canceled"){super(t),this.name="LoadingCanceledError";const r=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,r)}}class JH{constructor(t=[],r){Re(this,"divergence",0);const n=r?r.getDivergence():0,i=Nt.getLastLevelNodes(t);this.divergence=(n+i.length)%2;for(let o=0;o<i.length;o+=1)i[o].indexDivergence=(o+n)%2}getDivergence(){return this.divergence}}function q_(e=[]){const t={};return e.forEach(r=>{const{index:n=1/0}=r.field||{},i=`${n}`;t[i]=r.jaql.datatype||_u.TEXT}),t}function vL(e,t){if(e&&t===_u.DATETIME)try{return new Date(e).toISOString()}catch(r){return e}return e}function eU(e){if(e!==null&&!hL(e,{}))return e}function Z_(e,t,r={}){const n=eU(e),i=eU(t);let o=!1;if(typeof n=="object"&&n!==null&&typeof i=="object"&&i!==null){o=!0;const a=Object.keys(n),s=Object.keys(i);a.length!==s.length?o=!1:a.forEach(l=>{const c=r[l]||"";let d=(n||{})[l],h=(i||{})[l];if(typeof d=="undefined"||typeof h=="undefined"){o=!1;return}c===_u.DATETIME&&(d=vL(d,c),h=vL(h,c)),d!==h&&(o=!1)})}else o=n===i;return o}function tU(e,t,r=vL){if(!e||typeof e!="object")return e;const n={};return Object.keys(e).forEach(i=>{const o=t[i],a=(e||{})[i],s=r(a,o);n[i]=s}),n}const Su=(e,t)=>{let r=e&&e.metadata||[];return t&&(r=r.filter(n=>n.panel===t)),r.sort((n,i)=>{const o={index:1/0},a=n.field||o,s=i.field||o;return a.index-s.index}),r},$y=(e,t,r)=>typeof t=="undefined"?void 0:Su(e,r).filter(n=>(n.field||{index:1/0}).index===t)[0],CPe=(e,t)=>{const r=e.field||{index:1/0};if(e.panel===or.MEASURES)return!0;if(e.panel===or.ROWS){const n=Su(t,or.ROWS),i=(n[n.length-1]||{}).field||{index:1/0};if(n.length&&i.index===r.index)return!0;n.length||console.error("Missing rows panel in jaql!")}return!1};function _Pe(e,t){return!e||typeof e.field!="number"?!1:e.field!==t}const SPe=(e,t=or.ROWS)=>{const r=Su(e,t).map((n,i)=>{const o=Nt.create(n.jaql.title,void 0,void 0,i),a=bo(o,t);switch(a.jaqlIndex=n.field?n.field.index:void 0,t){case or.ROWS:{a.measurePath=void 0;const s=_Pe(n.jaql.sortDetails,a.jaqlIndex);n.jaql.sort&&!s?a.dir=n.jaql.sort:a.dir=null;break}case or.MEASURES:a.databars=n.format?n.format.databars:!1,a.measureJaqlIndex=a.jaqlIndex,Su(e,or.COLUMNS).length||(a.measurePath=void 0,n.jaql.sortDetails&&n.jaql.sortDetails.measurePath===null?a.dir=n.jaql.sortDetails.dir:a.dir=null);break}return a});return Nt.wrapInRootNode(r)},rU=e=>{(e&&e.metadata?e.metadata:[]).forEach(t=>{t&&t.jaql&&t.jaql.sort&&t.jaql.sortDetails&&t.jaql.sortDetails.sortingLastDimension&&(t.jaql.sort=null,delete t.jaql.sortDetails)})},nU=e=>{e&&e.jaql&&(e.jaql.sort=null,delete e.jaql.sortDetails)},iU=e=>{(e&&e.metadata?e.metadata:[]).forEach(t=>nU(t))},kPe=e=>(e.metadata||[]).reverse().find(t=>!!t.jaql.sortDetails),MPe=e=>(e.metadata||[]).find(t=>!!(t.jaql.sortDetails&&t.jaql.sortDetails.isLastApplied)),TPe=e=>{const t=MPe(e)||kPe(e);if(!t)return;const r=t.field&&t.field.index;(e.metadata||[]).forEach(n=>{(n.field&&n.field.index)!==r&&nU(n)})},oU=(e,t)=>{e.metadata.forEach(r=>{const n=r.field&&r.field.index;if(t.field===n){r.jaql.sortDetails=r.jaql.sortDetails||t,r.jaql.sortDetails.isLastApplied=!0;return}r.jaql.sortDetails&&r.jaql.sortDetails&&delete r.jaql.sortDetails.isLastApplied})},APe=(e,t,r)=>{const{isSingleRowTree:n=!1,formatter:i}=r||{};if(!t){console.warn("jaql is undefined or null!");return}const o=$y(t,e.field);if(o&&o.panel===or.COLUMNS){console.warn('Should not be sorted by "COLUMN" type panels!');return}if(!o)return;const a=CPe(o,t);switch(n?iU(t):a&&rU(t),e.dir){case Mi.DESC:case null:o.jaql.sort=Mi.ASC;break;case Mi.ASC:o.jaql.sort=Mi.DESC;break;default:o.jaql.sort=void 0}const s=o.field||{index:1/0};if(o.jaql.sort){let{measurePath:l}=e;if(l){const c=Su(t),d=q_(c);l=tU(l,d,i)}o.jaql.sortDetails={field:s.index,dir:o.jaql.sort,sortingLastDimension:a,measurePath:l,initialized:!0}}else o.jaql.sortDetails=void 0;t&&t.metadata&&s.index!==void 0&&(t.metadata[s.index]=o),oU(t,e)},EPe=(e,t,r)=>{if(!e)return;const n=$y(e,t);n&&(n.format=n.format||{},n.format.width=r)},PPe=e=>{const t={};return e&&Su(e).forEach(r=>{const n=r.field||{index:1/0};r.format&&typeof r.format.width!="undefined"&&typeof n.index!="undefined"&&(t[n.index]=r.format.width)}),t},DPe=(e,t)=>{if(typeof t.measureJaqlIndex!="undefined"){const r=Su(e),n=q_(r),i=r.filter(a=>a.panel===or.ROWS).find(a=>{const s=a.jaql.sortDetails;return!s||s.field!==t.measureJaqlIndex?!1:!!Z_(t.measurePath,s.measurePath,n)});if(i){t.dir=i.jaql.sort?i.jaql.sort:null;return}const o=$y(e,t.measureJaqlIndex);if(o&&o.jaql.sortDetails){const a=o.jaql.sortDetails.measurePath,s=t.measurePath;if(Z_(a,s,n)){t.dir=o.jaql.sort||null;return}}}t.dir=null};function LPe(e,t,r,n){const{isSingleRowTree:i,formatter:o}=n;i&&iU(e),e.metadata.forEach(a=>{a.jaql.sortDetails&&delete a.jaql.sortDetails.isLastApplied}),t.forEach((a,s)=>{let l;s===t.length-1?(a.selected&&rU(e),l=r.field):l=a.indexInJaql;const c=$y(e,l);if(!c){console.warn(new Error("Panel not found"));return}a.selected&&!a.direction&&console.warn(new Error("Direction should be defined and equal to 'asc' or 'desc'"));const d=Su(e),h=q_(d);if(!a.direction||!a.selected){const{sortDetails:u}=c.jaql;u&&r.field===u.field&&Z_(r.measurePath,u.measurePath,h)&&(delete c.jaql.sort,delete c.jaql.sortDetails)}if(a.selected&&a.direction){c.jaql.sort=a.direction;let{measurePath:u}=r;u&&(u=tU(u,h,o)),r.measurePath===void 0&&c.field&&c.panel==="rows"&&r.field!==c.field.index&&(u={}),c.jaql.sortDetails={field:r.field,dir:a.direction,sortingLastDimension:!1,measurePath:u,isLastApplied:!0,initialized:!0}}})}function OPe(e,t,r,n){return e.jaql.sortDetails?!1:r?Ti.isMeasurePathEqual(t.measurePath,r.measurePath,n):!1}function yL(e){const t=e&&e.dir;switch(t){case"asc":case"desc":return t;default:return null}}function IPe(e,t){var r,n;const i=e.metadata.filter(f=>f.panel==="rows"),o=Ti.getMetadataPanelByIndex(e,t.field),a=o.jaql.datatype,s=o.jaql.sortDetails,l=Ti.getDataTypes(Ti.getMetadataPanels(e)),c=[];for(let f=0;f<i.length-1;f+=1){const p=i[f],x=!!(p.jaql.sortDetails&&p.jaql.sortDetails.field===t.field&&Ti.isMeasurePathEqual(t.measurePath,p.jaql.sortDetails.measurePath,l)),S=yL(p.jaql.sortDetails);c.push({title:p.jaql.title,datatype:a,selected:x,direction:S,indexInJaql:(r=p.field)==null?void 0:r.index})}const d=i[i.length-1],h=OPe(d,t,s,l),u=yL(s),g={title:d.jaql.title,datatype:a,selected:h,direction:u,indexInJaql:(n=o.field)==null?void 0:n.index};return c.push(g),c}function NPe(e,t,r){return e.filter(n=>n.field&&t.field===n.field.index).map(n=>{const{sortDetails:i}=n.jaql,o=!!(i&&Ti.isMeasurePathEqual(t.measurePath,i.measurePath,r)),a=o?yL(i):null;return{title:n.jaql.title,datatype:n.jaql.datatype,selected:o,direction:a}})[0]}const Ti={isMeasurePathEqual:Z_,getDataTypes:q_,updatePanelsSortingMetadata:APe,getMetadataTree:SPe,getMetadataPanels:Su,getMetadataPanelByIndex:$y,setResizeWidthToJaql:EPe,getResizeWidthFromJaql:PPe,markSortedNode:DPe,normalizeSingleBranchTreeSortDetails:TPe,updateLastAppliedSortingFlag:oU,handleComplexSortingSettingsUpdate:LPe,mapWidgetJaqlToSimpleSortingSettings:NPe,mapWidgetJaqlToComplexSortingSettings:IPe};function aU(e,t){if(!Nt.hasChildren(e))return!1;let r=!1;t===or.COLUMNS&&e&&e.isPart&&(r=!0);const n=Nt.getChildren(e);if(n.length>1||r)return!0;const[i]=n;return aU(i)}function RPe(e){return e==null}const bL=(e,t,r,n,i)=>{const o=[];return e.forEach(a=>{if(o.push(a),Nt.hasChildren(a)){const s=Nt.getChildren(a),l=bL(s,t,r,n,i);Nt.setChildren(a,l);let c=!1;if((i||aU(a,r))&&(r===or.COLUMNS?typeof a.index!="undefined"&&a.index>-1&&(c=!0):r===or.ROWS&&typeof a.data!="undefined"&&(c=!0)),c){const{value:d,index:h,data:u,jaqlIndex:g,measurePath:f}=a;let p;if(r===or.COLUMNS?p=Nt.create(d,void 0,void 0,h):r===or.ROWS&&(p=Nt.create(d,void 0,u)),p){const x=bo(p,r);x.userType=Tr.SUB_TOTAL,x.jaqlIndex=g,x.measurePath=f,x.master=a,o.push(x)}}}}),o},sU=(e,t)=>{e.userType===Tr.SUB_TOTAL&&e.master&&(e.measurePath=e.master.measurePath)},lU=(e,t,r,n)=>{const i=e;if(r===or.COLUMNS&&t){const o=bo(t);if(typeof o.index=="number"){const a=Ti.getMetadataTree(n,or.MEASURES);Nt.getChildren(a).forEach((s,l)=>{const c=We(Me({},s),{index:(o.index||0)+l}),d=bo(c,r);d.userType=Tr.GRAND_TOTAL,d.measureJaqlIndex=d.jaqlIndex,i.push(d)})}}return i},cU=(e,t)=>{e.userType===Tr.GRAND_TOTAL&&(e.measurePath=void 0,e.metadataType===or.ROWS&&(e.parent=void 0,e.jaqlIndex=0))},uU=(e,t,r,n)=>{let i=e;if(r===or.COLUMNS){const o=Ti.getMetadataTree(n,or.MEASURES),a=Nt.getChildLength(o),s={maxLevel:0},l=Nt.getLastLevelNodes(i,[],0,s);if(a>1)l.forEach(c=>{if(c.userType===Tr.GRAND_TOTAL)return;const d=Nt.getChildren(o),h=[];for(let u=0;u<d.length;u+=1){if(typeof c.maxChilds=="number"&&u>=c.maxChilds)continue;const g=We(Me({},d[u]),{index:(c.index||0)+u,measurePath:c.measurePath}),f=bo(g,or.MEASURES);f.userType=Tr.MEASURE_BOTTOM,f.measureJaqlIndex=f.jaqlIndex,h.push(f)}c.minLevel=s.maxLevel,Nt.setChildren(c,h)});else if(a===1){const c=Nt.getChildren(o)[0];if(c){const d=Me({},c),h=bo(d,or.MEASURES);h.userType=Tr.MEASURE_TOP,Nt.setChildren(h,i),i=[h],l.forEach(u=>{u.measureJaqlIndex=c.jaqlIndex})}}}return i},dU=(e,t)=>{!Nt.hasChildren(e)&&typeof e.measureJaqlIndex!="undefined"&&Ti.markSortedNode(t,e)},FPe=(e,t,r,n)=>{let i={};if(t.userType===Tr.SUB_TOTAL||t.userType===Tr.GRAND_TOTAL||r.userType===Tr.SUB_TOTAL||r.userType===Tr.GRAND_TOTAL||r.parent&&r.parent.userType===Tr.SUB_TOTAL||r.parent&&r.parent.userType===Tr.GRAND_TOTAL)return;const o=n&&n.format&&n.format.color||null;if(!o)return;const{value:a,cf:s=-1}=e;if(o.type===NH.COLOR&&o.color&&o.color!=="transparent"&&(i.backgroundColor=o.color),o.type===NH.CONDITION&&o.conditions&&o.conditions.length)for(let l=0,c=o.conditions.length;l<c&&!RPe(a);l+=1){const d=o.conditions||[],{color:h}=d[l]||{};if(h&&s===l){i.backgroundColor=h;break}}Object.keys(i).length>0&&(e.style=e.style||{},Object.assign(e.style,i)),i=void 0},hU=(e,t,r,n)=>{const i=[],{level:o=0,measurePath:a={}}=n||{};let s;Array.isArray(e)?s=e:s=Nt.getChildren(e);const l=Ti.getMetadataPanels(r,t)[o],c=l?(l.field||{index:1/0}).index:void 0;return s.forEach(d=>{const h=bo(d,t);if(h.jaqlIndex=c,typeof c!="undefined"&&(h.measurePath=We(Me({},a),{[c]:h.value})),i.push(h),Nt.hasChildren(h)){const u=Nt.getChildren(h),g={level:o+1,measurePath:h.measurePath},f=hU(u,t,r,g);Nt.setChildren(h,f)}}),i},pU=(e,t,r)=>{const{skipFormatEvent:n=!1,onlyFormatEvents:i=!1,iterateFn:o,emitFn:a}=r||{};e.forEach(s=>{if(o&&o(s),(n||!i)&&(sU(s),cU(s),dU(s,t)),a&&(i||!n)){const l=Ti.getMetadataPanelByIndex(t,s.jaqlIndex,s.metadataType||"");a(s,l,t)}if(Nt.hasChildren(s)){const l=Nt.getChildren(s);pU(l,t,r)}})},jPe=(e,t,r,n)=>{const{originalData:i,applyIndexDivergence:o,subtotalsForSingleRow:a}=n||{};o&&o(e);let s=bL(e,i,t,r,a);return s=lU(s,i,t,r),s=uU(s,i,t,r),Nt.iterateThroughTree(s,(l,c)=>{l.parent=c}),s},Wy={insertSubTotals:bL,postProcessSubTotal:sU,insertGrandTotals:lU,postProcessGrandTotal:cU,insertMeasureNodes:uU,postProcessMeasureNode:dU,applyColorFormatting:FPe,preProcessTree:hU,modifyTree:jPe,postProcessTree:pU},bo=(e,t)=>{const r=e;return t&&(r.metadataType=t),r};function Ug(e,t,r){return!t||!t.length?!1:t.some(n=>{let i=!0;return r&&r.fields&&r.fields.length&&r.fields.forEach(o=>{e[o]!==void 0&&n[o]===void 0?i=!1:e[o]!==void 0&&n[o]!==void 0&&(Array.isArray(e[o])?i=i&&e[o].indexOf(n[o])!==-1:i=i&&e[o]===n[o])}),i})}const BPe=(e,t=[])=>{let r=!1;return!t||!t.length?!1:e.length===0?!0:(e.forEach(n=>{t.includes(n)&&(r=!0)}),r)},fU=(e,t)=>{let r=!0;return!t||!t.length?r=!1:e.forEach(n=>{if(n.index){const i=t[t.length-1];r=r&&Ug(n,[i],{fields:[Ld.INDEX]})}if(n.dim&&(n.name=n.dim,n.members&&(n.member=n.members),r=r&&Ug(n,t,{fields:[Ld.NAME,Ld.MEMBER]})),n.title){const i=t[t.length-1];r=r&&Ug(n,[i],{fields:[Ld.TITLE]})}}),r},zPe=(e,t)=>{let r=!0;return!t||!t.length?r=!1:e.forEach(n=>{n.index&&(r=r&&Ug(n,t,{fields:[Ld.INDEX]})),n.dim&&(n.name=n.dim,r=r&&Ug(n,t,{fields:[Ld.DIM,Ld.AGG]})),n.title&&(r=r&&Ug(n,t,{fields:[Ld.TITLE]}))}),r},$Pe=(e,t)=>{let r=!0;if(e.type&&r&&(r=r&&BPe(e.type,t.type)),e.rows&&e.rows.length&&r){const n=t.rows?t.rows:[];r=r&&fU(e.rows,n)}if(e.columns&&r){const n=t.columns?t.columns:[];r=r&&fU(e.columns,n)}if(e.values&&r){const n=t.measure?[t.measure]:[];r=r&&zPe(e.values,n)}return r},WPe=(e,t)=>e.metadata.find(r=>r.field&&r.field.index===t),X_=(e,t,r=[],n=[])=>{if(!t||!e||typeof e.jaqlIndex=="undefined")return{dimensionsMeta:r,type:n};const i=WPe(t,e.jaqlIndex);if(i&&i.jaql&&e.metadataType!==or.MEASURES&&r.unshift({title:i.jaql.title,name:i.jaql.dim,member:e.value,index:e.jaqlIndex}),e&&e.userType&&(e.userType===Tr.SUB_TOTAL||e.userType===Tr.GRAND_TOTAL)){const o=e.userType.toLowerCase();n.push(o)}return e.parent&&e.parent.metadataType!==or.MEASURES?X_(e.parent,t,r,n):{dimensionsMeta:r,type:n}},gU=e=>{let t={};if(e){const r=e.jaql;t=wt(r,["type","datatype","table","column"]),e.field&&(t.index=e.field.index)}return t},xo={CORNER:"corner",COLUMNS:"columns",ROWS:"rows",DATA:"data"};function xL(e,t="",r=""){let n="";return e&&(e.levels.length&&e.levels.forEach(i=>{n+=` ${t}--${r?`${r}-`:""}level-${i}`}),e.siblings.length&&e.siblings.forEach(i=>{n+=` ${t}--${r?`${r}-`:""}sibling-${i}`}),e.root&&e.root.siblings&&e.root.siblings.length&&e.root.siblings.forEach(i=>{n+=` ${t}--${r?`${r}-root-`:"root-"}sibling-${i}`}),e.parent&&e.parent.siblings&&e.parent.siblings.length&&e.parent.siblings.forEach(i=>{n+=` ${t}--${r?`${r}-parent-`:"parent-"}sibling-${i}`})),n}function HPe(e,t){const{metadata:r,rowMetadata:n,rowTreeNode:i,columnTreeNode:o,merge:a}=t||{},s={t:!0,r:!0,b:!0,l:!0};if(e===xo.CORNER||e===xo.COLUMNS)return s;if(e===xo.ROWS){const l=a&&a.colSpan,c=r&&r.nextNode&&r.nextNode.userType===Tr.GRAND_TOTAL;r&&r.levels.includes(yo.LAST)&&!r.siblings.includes(yo.LAST)&&!l&&!c&&(s.b=!1),r&&r.levels.includes(yo.FIRST)&&r.levels.includes(yo.LAST)&&!r.siblings.includes(yo.LAST)&&!l&&!c&&(s.b=!1)}if(e===xo.DATA){const l=i&&i.userType===Tr.SUB_TOTAL,c=o&&o.userType===Tr.SUB_TOTAL,d=o&&o.userType===Tr.GRAND_TOTAL,h=n&&n.nextNode&&n.nextNode.userType===Tr.GRAND_TOTAL;n&&n.levels.includes(yo.LAST)&&!n.siblings.includes(yo.LAST)&&!l&&!c&&!d&&!h&&(s.b=!1)}return s}function wL(e,t="",r=""){let n="";return e&&e.userType&&(n=`${t}--${r?`${r}-`:""}user-type-${e.userType}`),n}function CL(e,t="",r=""){let n="";return e&&e.colSpan&&(n=`${t}--${r?`${r}-`:""}merged-columns`),e&&e.rowSpan&&(n=` ${t}--${r?`${r}-`:""}merged-rows`),n}function _L(e){return e&&e.colSpan?e.colSpan-1:0}function mU(e,t){if(e===void 0)return e;let r=typeof e=="number"?e:parseInt(e,10);return r-=t||1,r}function Hy(e){const{isDataCell:t,dataNode:r,treeNode:n}=e,i=t?r:n;return i&&i.style||{}}const UPe=e=>{const t={};return Object.keys(e).forEach(r=>{(!r.startsWith("border")||r==="borderColor")&&(t[r]=e[r])}),t},GPe=e=>{const t={};return Object.keys(e).forEach(r=>{(!r.startsWith("color")&&!r.startsWith("padding")&&!r.startsWith("border")&&!r.startsWith("font")&&!r.startsWith("lineHeight")&&!r.startsWith("databarColor")||r==="borderColor")&&(t[r]=e[r])}),t},VPe=e=>{const t={};return Object.keys(e).forEach(r=>{(r.startsWith("color")||r.startsWith("padding")||r.startsWith("font")||r.startsWith("lineHeight"))&&(t[r]=e[r])}),t},YPe=e=>{const t={};return e.databarColor&&(t.backgroundColor=e.databarColor),t},qPe=(e,t,r=0)=>t&&e&&t.offsetWidth+r>=e.offsetWidth&&t.textContent||"",ZPe=(e,t,r)=>{if(!e||!t||!r||r.measureJaqlIndex===void 0)return;const[n,i]=e[r.measureJaqlIndex]||[];if(n==null)return;const o=t&&t.store&&t.store.compileRange,a=t&&t.store&&t.store.compileRangeContext,s=t&&t.store&&t.store.compileRangeArgs;if(!o||!s||!a||!t||!t.value)return;const l=We(Me({},s),{minvalue:n,midvalue:n+(i-n)/2,maxvalue:i});let c,d;return l.min===void 0&&(l.maxvalue<=0&&(d=!0),l.min=l.minDef),l.max===void 0&&(l.minvalue>=0&&(c=!0),l.max=l.maxDef),d&&(l.max=l.maxGray),c&&(l.min=l.minGray),o.call(a,l)(t.value)},Uy="text";let XPe=class Sye{constructor(t,r,n){Re(this,"plugins",[]),Re(this,"globalStyles"),Re(this,"jaql"),Re(this,"indexHelper"),Re(this,"columnsMetadata",[]),Re(this,"metadataCache",new Map),this.plugins=t,this.jaql=r,this.globalStyles=n,this.indexHelper={measuresLevel:this.getMeasuresLevel(),columnStartFrom:0,rowStartFrom:0},this.globalStyles&&(this.globalStyles=UPe(this.globalStyles))}getJaqlPanels(t){if(!this.jaql)throw new Error("No Jaql in Plugin service!");return this.jaql.metadata.filter(r=>r.panel===t)}getMeasuresLevel(){const t=this.getJaqlPanels(or.COLUMNS);return this.getJaqlPanels(or.MEASURES).length>1?t.length:0}getRowsColumnLength(){return this.getJaqlPanels(or.ROWS).length}getTotalTypes(t){const r=t.filter(n=>n===zg.SUB_TOTAL||n===zg.GRAND_TOTAL);return r&&r.length?r.filter((n,i,o)=>o.indexOf(n)===i):[]}getMeasureMetaByIndex(t){const r=this.getJaqlPanels(or.MEASURES);if(r.length===1)return gU(r[0]);const n=t%r.length;return gU(r[n])}resetRowStartFrom(){this.indexHelper.rowStartFrom=1}applyToColumns(t){t.length!==0&&(this.indexHelper.columnStartFrom===0&&(this.indexHelper.columnStartFrom=this.getRowsColumnLength()),this._applyToColumns(t,{row:-1}))}_applyToColumns(t,r){t.forEach((n,i)=>{const{dimensionsMeta:o,type:a}=X_(n,this.jaql);a.push(zg.MEMBER);let s=r.row>=0?r.row+1:0;s>=this.indexHelper.rowStartFrom&&(this.indexHelper.rowStartFrom=s+1),n.metadataType===or.MEASURES&&(s=this.indexHelper.measuresLevel);let l=i===0?0:1;l+=this.indexHelper.columnStartFrom;const c={type:a,rowIndex:s,colIndex:l,index:n.jaqlIndex,columns:o};n.metadataType===or.MEASURES&&(c.measure=this.getMeasureMetaByIndex(n.index||0));const d={value:n.value||"",content:n.content||"",contentType:n.contentType||Uy,style:n.style||{},store:n.store||{},state:n.state};if(this.applyGlobal(d),this.apply(c,d),this.addToMetadata(c,d,c.rowIndex,c.colIndex),Object.assign(n,d),this.indexHelper.columnStartFrom=l,n.children){const h={row:s,column:l};this._applyToColumns(n.children,h)}else this.columnsMetadata.push({type:a,metadata:o});return!0})}applyToHeaders(t){!t||!t.children||t.children.length===0||t.children.forEach(r=>{const{dimensionsMeta:n}=X_(r,this.jaql),i={type:[zg.MEMBER],rowIndex:0,colIndex:r.index||0,index:r.jaqlIndex,rows:n},o={value:r.value,content:r.content||"",contentType:r.contentType||Uy,style:r.style?r.style:{},store:r.store||{},state:r.state};this.applyGlobal(o),this.apply(i,o),this.addToMetadata(i,o,i.rowIndex,i.colIndex),Object.assign(r,o)})}applyToRows(t){if(t.length===0)return;const r=this.getJaqlPanels(or.ROWS),n=this.getJaqlPanels(or.MEASURES),i=this.getJaqlPanels(or.COLUMNS);this.indexHelper.rowStartFrom=Sye.getRowStartFromForPage(r.length,n.length,i.length),this._applyToRows(t)}static getRowStartFromForPage(t,r,n){if(t===0&&n===0)return 0;const i=n+(r===0?0:1);return i===0?1:i}_applyToRows(t){t.forEach((r,n)=>{const{dimensionsMeta:i,type:o}=X_(r,this.jaql);o.push(zg.MEMBER);const a=r.level?r.level:0,s=n===0?this.indexHelper.rowStartFrom:this.indexHelper.rowStartFrom+1,l={type:o,rowIndex:s,colIndex:a,index:r.jaqlIndex,rows:i},c={value:r.value,content:r.content||"",contentType:r.contentType||Uy,style:r.style||{},store:r.store||{},state:r.state};return this.applyGlobal(c),this.apply(l,c),this.addToMetadata(l,c,l.rowIndex,l.colIndex),this.indexHelper.rowStartFrom=s,r.children?this._applyToRows(r.children):r.data&&r.data.length&&this.applyToValues(r.data,{type:o,metadata:i},{rowIndex:s,colIndex:this.getRowsColumnLength()}),Object.assign(r,c),!0})}applyToValues(t,r,n){t.length&&t.forEach((i,o)=>{const a=[zg.VALUE],s=this.columnsMetadata[o];if(!s)return;const l=this.getTotalTypes([...r.type,...s.type]),c=this.getMeasureMetaByIndex(o),d={type:a.concat(l),rows:r.metadata,columns:s.metadata,measure:c,colIndex:o+n.colIndex,rowIndex:n.rowIndex,index:c&&c.index?c.index:0};let h={value:i,content:i,contentType:Uy,style:{},store:i&&i.store||{},state:i&&i.state||void 0};i!=null&&typeof i=="object"&&(h={value:i.value?i.value:null,content:i.content||"",contentType:i.contentType||Uy,style:i.style||{},store:i.store||{},state:i.state}),this.applyGlobal(h),this.apply(d,h),this.addToMetadata(d,h,d.rowIndex,d.colIndex),t[o]=h})}addToMetadata(t,r,n,i){const o=Me({cellData:{value:r.value,content:r.content}},t);this.metadataCache.set(`${n}-${i}`,o)}applyGlobal(t){const{globalStyles:r}=this;r&&(t.style=Me(Me({},t.style),r))}apply(t,r){this.plugins&&this.plugins.length&&this.plugins.forEach(n=>{if($Pe(n.target,t)){const i=n.handler;i(t,r)}})}};const SL=(e,t)=>{const r=e||{metadata:[],grandTotals:null};let{metadata:n}=r;return n=n.map(i=>{const o=i.field||{},a=t.find(({field:l})=>l&&l.index===o.index),s=a?a.format:null;return s?We(Me({},i),{format:s}):i}),We(Me({},r),{metadata:n})},vU=100,KPe="dataLoad",kL="dataChunkLoaded",QPe="dataBarChunkLoaded",JPe="rangeMinMaxChunkLoaded",ML="grandChunkLoaded",e3e="dataFinishChunkLoaded",t3e="finishChunkLoaded",K_="progressError",Q_="headerCellFormat",TL="dataCellFormat",AL="totalRowsCountLoaded",EL="totalColumnsCountLoaded",yU=1e3,r3e=0,n3e={throttle:HH,throttleTime:r3e,PluginService:XPe,skipInternalColorFormatting:!1,subtotalsForSingleRow:!1};class Aa{constructor(t,r,n,i){Re(this,"logger"),Re(this,"events"),Re(this,"loadService"),Re(this,"options"),Re(this,"tempDataChunks",[]),Re(this,"lastNotHandledChunkIndex",0),Re(this,"lastReadyNotHandledChunkIndex",0),Re(this,"rowsGrand"),Re(this,"rowsTreeService"),Re(this,"columnsTreeService"),Re(this,"cornerTreeService"),Re(this,"pageSize",vU),Re(this,"isPaginated",!1),Re(this,"loadedPagesCount",0),Re(this,"isLoadInProgress",!1),Re(this,"loadPromiseResolve"),Re(this,"loadPromiseReject"),Re(this,"loadPromiseCache"),Re(this,"loadAllPromise"),Re(this,"loadAllPromiseResolve"),Re(this,"loadAllPromiseReject"),Re(this,"isWholeDataLoaded",!1),Re(this,"hasDataFinishEvent",!1),Re(this,"isDataHandlerThrottled",!1),Re(this,"onDataHandlerThrottle"),Re(this,"metadata",[]),Re(this,"dataBars"),Re(this,"rangeMinMax"),Re(this,"divergenceComparator",new JH),Re(this,"pluginService"),Re(this,"rawJaql"),Re(this,"triggeredEventsData",{}),Re(this,"callPlugins",[]),Re(this,"globalStyles"),Re(this,"columnsCount"),Re(this,"totalColumnsCount"),Re(this,"rowsCount"),Re(this,"totalRowsCount"),Re(this,"totalRecordsCount"),Re(this,"limitReached"),Re(this,"onMetadataHandler",()=>{const o={metadata:this.getMetadata()};this.isSingleRowTree()&&Ti.normalizeSingleBranchTreeSortDetails(o)}),Re(this,"onHeadersHandler",o=>{const a=this.getJaql.bind(this),s=this.getRawJaql.bind(this),l=this.applyIndexDivergence.bind(this),c=(g,f,p)=>this.emit(Q_,g,f,p,this.options),d=Aa.createColumnsTreeServiceBuilder({getJaql:a,getRawJaql:s,pluginService:this.pluginService,applyIndexDivergence:l},{emitHeaderCellFormatEvent:c})(o);this.columnsTreeService=d.columnsTreeService,this.columnsCount=d.columnsCount,this.totalColumnsCount=d.totalColumnsCount,this.emit(EL,{columnsCount:this.columnsCount||0,totalColumnsCount:this.totalColumnsCount||0});const h=Aa.createCornerTreeServiceBuilder({getJaql:a,getRawJaql:s,pluginService:this.pluginService,columnsTreeService:this.columnsTreeService},{emitHeaderCellFormatEvent:c}),{cornerTreeService:u}=h();this.cornerTreeService=u}),Re(this,"onDataHandler",o=>{this.tempDataChunks=this.tempDataChunks||[],Array.isArray(o)?(o||[]).forEach(a=>{Aa.fillDataChunks(this.tempDataChunks,a,this.pageSize)}):Aa.fillDataChunks(this.tempDataChunks,o,this.pageSize),this.tempDataChunks.length&&(this.isDataHandlerThrottled=!0,this.onDataHandlerThrottle())}),Re(this,"onGrandHandler",o=>{const a=this.preProcessTree([o],or.ROWS)[0],s="Rows grand total",l=a?a.data:[],c=Nt.create(s,void 0,l),d=bo(c,or.ROWS);d.userType=Tr.GRAND_TOTAL,this.postProcessTree([d]),this.postProcessData([d]),this.rowsGrand=d,this.emit(ML,Nt.wrapInRootNode(this.rowsGrand))}),Re(this,"onFinishHandler",()=>{this.emit(t3e,{totalRows:typeof this.totalRowsCount=="number"?this.totalRowsCount:this.getTotalItemsCount(),totalColumns:typeof this.totalColumnsCount=="number"?this.totalColumnsCount:this.getLoadedColumnsCount()})}),Re(this,"onTotalRowsHandler",o=>{const{rowsCount:a,queryRowsCount:s,limitReached:l}=o||{};this.totalRowsCount=a,this.totalRecordsCount=s,this.limitReached=l,this.emit(AL,o)}),Re(this,"onDataBarsHandler",o=>{const{data:a=[]}=o;let s=0;this.cornerTreeService&&(s=this.cornerTreeService.getTreeChildLength()),this.dataBars=[...Array(s),...a],this.emit(QPe,this.dataBars)}),Re(this,"onRangeMinMaxHandler",o=>{const{data:a=[]}=o,s=this.getJaql(),l=Ti.getMetadataTree(s,or.MEASURES),c=Nt.getChildren(l),d=[];c.forEach((h,u)=>{d[h.measureJaqlIndex||0]=a[u]}),this.rangeMinMax=d,this.emit(JPe,this.rangeMinMax)}),Re(this,"onDataFinishHandler",({rowsCount:o}={})=>{if(this.finishRequest(),this.rowsCount=o,this.tempDataChunks.length){const a=this.tempDataChunks[this.tempDataChunks.length-1];a.ready=!0}this.onDataHandlerThrottle(),this.checkLoadPromise(),this.emit(e3e,{limitedRows:this.rowsCount,limitedColumns:this.columnsCount})}),Re(this,"onErrorHandler",o=>{!this.isLoadInProgress&&!this.isWholeDataLoaded&&!(o instanceof Hg)&&this.emit(K_,o)}),this.loadService=t,this.events=r||new Ly,this.logger=i||Od.create("DataService"),this.options=Me(Me({},n3e),n),this.attachEvent(),this.onDataHandlerThrottle=this.options.throttle(()=>{const o=GH(this.tempDataChunks,h=>h.ready&&!h.handled,this.lastReadyNotHandledChunkIndex);if(o===-1)return;this.lastReadyNotHandledChunkIndex=o;const a=this.tempDataChunks[o],s=this.preProcessTree(a.list,or.ROWS),l=this.modifyTree(s,or.ROWS);this.postProcessTree(l,{skipFormatEvent:!0}),this.postProcessData(l,{skipFormatEvent:!0});const c=Nt.wrapInRootNode(l);this.rowsTreeService?this.rowsTreeService.extend(c):this.rowsTreeService=new gp(c,!0),this.emit(kL,this.getLoadedElementsCount()),a.handled=!0;const d=GH(this.tempDataChunks,h=>!h.handled,this.lastNotHandledChunkIndex);if(d!==-1?(this.lastNotHandledChunkIndex=d,this.onDataHandlerThrottle()):this.isDataHandlerThrottled=!1,this.hasDataFinishEvent&&this.tempDataChunks.length){const h=this.tempDataChunks[this.tempDataChunks.length-1];h.ready=!0}this.hasDataFinishEvent&&d===-1?(this.finishRequest(),this.checkLoadPromise()):this.checkLoadPromise()},this.options.throttleTime)}destroy(){this.detachEvent(),this.rowsGrand=void 0,this.rowsTreeService=void 0,this.columnsTreeService=void 0,this.cornerTreeService=void 0,this.tempDataChunks=[],this.lastNotHandledChunkIndex=0,this.lastReadyNotHandledChunkIndex=0,this.events.removeAllListeners()}on(t,r){this.events.on(t,r),this.triggeredEventsData[t]&&(this.triggeredEventsData[t].forEach(n=>{this.events.emit(t,...n)}),delete this.triggeredEventsData[t])}emit(t,...r){this.events.listeners(t).length===0?(this.triggeredEventsData[t]=this.triggeredEventsData[t]||[],this.triggeredEventsData[t].push(r)):this.events.emit(t,...r)}off(t,r){this.events.removeListener(t,r),this.triggeredEventsData[t]&&delete this.triggeredEventsData[t]}loadData(t,r){const{pageSize:n=vU,isPaginated:i=!1,cacheResult:o=!1,metadata:a}=r||{},s=this.pageSize===n;if(this.clearLoadAllPromise(),t&&this.clearCache(),this.pageSize=n,this.isPaginated=i,this.emit(KPe),this.loadPromiseCache&&s){const c=Promise.resolve(this.loadPromiseCache);return this.loadPromiseCache=void 0,c}this.isLoadInProgress=!0,t&&(this.metadata=a||[],this.rawJaql=SL(t,this.metadata),this.initPluginService(this.rawJaql),this.loadService.load(t).then(c=>{if(c==null)return;const d=!("data"in c);if(c.dataFinish[0]&&d)throw{error:{error:!0,details:"metadata undefined."}}}).catch(c=>{this.loadPromiseReject&&this.loadPromiseReject(c.error)}));const l=new Promise((c,d)=>{this.loadPromiseResolve=c,this.loadPromiseReject=d}).then(c=>this.sendInitPage(c)).then(c=>(o&&(this.loadPromiseCache=c),this.loadedPagesCount=1,c)).catch(c=>{throw c instanceof Hg&&this.clearLoadPromise(),c});return this.checkLoadPromise(),l}loadAllData(){if(this.isWholeDataLoaded){const t={loadedRowsCount:this.getLoadedElementsCount(),totalItemsCount:typeof this.totalRowsCount=="number"?this.totalRowsCount:this.getTotalItemsCount(),totalRecordsCount:this.totalRecordsCount,limitReached:this.limitReached,dataBars:this.dataBars,rangeMinMax:this.rangeMinMax};return this.columnsCount!==0&&this.totalColumnsCount!==0&&(t.columnsCount=this.columnsCount,t.totalColumnsCount=this.totalColumnsCount),Promise.resolve(t)}return this.loadAllPromise||(this.loadAllPromise=new Promise((t,r)=>{this.loadAllPromiseResolve=t,this.loadAllPromiseReject=r}).then(()=>({loadedRowsCount:this.getLoadedElementsCount(),totalItemsCount:typeof this.totalRowsCount=="number"?this.totalRowsCount:this.getTotalItemsCount(),totalRecordsCount:this.totalRecordsCount,limitReached:this.limitReached,dataBars:this.dataBars,rangeMinMax:this.rangeMinMax})).catch(t=>{throw t instanceof Hg&&this.clearLoadAllPromise(),t})),this.loadAllPromise}getSelectedPageData(t,r){return Promise.resolve(this.sendPaginatedPage(t,r))}getIndexedPageData(t,r,n=!1){return Promise.resolve(this.sendPartialPage(t,r,n))}getJaql(){return this.loadService.getJaql()||{metadata:[],grandTotals:null}}isSingleRowTree(){return this.loadService.isSingleRowTree()}setPluginHandlers(t){this.callPlugins=t}setGlobalStyles(t){this.globalStyles=t}getRawJaql(){return this.rawJaql||this.getJaql()}getMetadata(){return this.metadata.length>0?this.metadata:this.getJaql().metadata}preProcessTree(t,r,n){return Wy.preProcessTree(t,r,this.getJaql(),n)}postProcessTree(t,r){const n=(o,a,s)=>this.emit(Q_,o,a,s,this.options),i=We(Me({},r||{}),{emitFn:n});return Wy.postProcessTree(t,this.getRawJaql(),i)}postProcessData(t,r){const{skipFormatEvent:n=!1,onlyFormatEvents:i=!1}=r||{},o=this.columnsTreeService?this.columnsTreeService.getLastLevelNodes():[],a=Nt.getLastLevelNodes(t),s=this.getRawJaql();n||a.forEach(l=>{const c=bo(l);o.forEach(d=>{const h=bo(d),u=Ti.getMetadataPanelByIndex(s,h.measureJaqlIndex,or.MEASURES);if(typeof c.data!="undefined"&&typeof h.index!="undefined"){const{data:g=[]}=c,{index:f}=h,p=g[f],x=typeof p=="object"&&p!==null&&p!==void 0?p:{value:p};if(g[f]=x,i||!n){const{skipInternalColorFormatting:S=!1}=this.options;S||Wy.applyColorFormatting(x,c,h,u),this.emit(TL,x,c,h,u,s,this.options)}}})})}modifyTree(t,r,n){const i=this.getJaql();return Wy.modifyTree(t,r,i,{originalData:n,applyIndexDivergence:this.applyIndexDivergence.bind(this),subtotalsForSingleRow:this.options.subtotalsForSingleRow})}applyIndexDivergence(t){this.divergenceComparator=new JH(t,this.divergenceComparator)}initPluginService(t){this.pluginService=new this.options.PluginService(this.callPlugins,t,this.globalStyles)}cancelLoading(){const t=new Hg;this.loadPromiseReject&&typeof this.loadPromiseReject=="function"&&this.loadPromiseReject(t),this.loadAllPromiseReject&&typeof this.loadAllPromiseReject=="function"&&this.loadAllPromiseReject(t),this.detachEvent()}getPageSize(){return this.pageSize}sendInitPage(t){if(this.loadService.hasError()||!this.loadService.hasData())return Aa.getEmptyPage();let r,n;const i=this.getPageSize();if(this.rowsTreeService){const a=i>t?t:i,s=Aa.cloneTreeNode,l=this.rowsTreeService.getPartialTree(0,a,{cloneFn:s});this.rowsGrand&&l.push(Ta(this.rowsGrand)),this.postProcessTree(l,{onlyFormatEvents:!0,iterateFn:Nt.clearNodeCache}),this.postProcessData(l,{onlyFormatEvents:!0});const c=this.rowsTreeService?this.rowsTreeService.getTreeDeepsLength():0,d=Nt.wrapInRootNode(l);this.pluginService&&d&&d.children&&(this.pluginService.applyToRows(d.children),n=this.pluginService.metadataCache),r=new gp(d,!0,c),r.hasGrandTotals=!!this.rowsGrand}const o=this.isWholeDataLoaded&&i>=t;return{rowsTreeService:r,columnsTreeService:this.columnsTreeService,cornerTreeService:this.cornerTreeService,isLastPage:o,cellsMetadata:n}}sendPaginatedPage(t,r){if(this.loadService.hasError()||!this.loadService.hasData())return Aa.getEmptyPage();r&&(this.pageSize=r);const n=this.getPageSize(),i=this.getLoadedElementsCount();if(t*n>=i)throw new Error("Selected page is out of elements range!");if(t<0)throw new Error("Selected page must be >= 0");let o,a;if(this.rowsTreeService){const s=t>=0?t*n:0,l=(t+1)*n>i?i:(t+1)*n,c=Aa.cloneTreeNode,d=this.rowsTreeService.getPartialTree(s,l,{cloneFn:c});this.rowsGrand&&d.push(Ta(this.rowsGrand)),this.postProcessTree(d,{onlyFormatEvents:!0,iterateFn:Nt.clearNodeCache}),this.postProcessData(d,{onlyFormatEvents:!0});const h=this.rowsTreeService?this.rowsTreeService.getTreeDeepsLength():0,u=Nt.wrapInRootNode(d);this.pluginService&&u&&u.children&&(this.pluginService.applyToRows(u.children),a=this.pluginService.metadataCache),o=new gp(u,!0,h),o.hasGrandTotals=!!this.rowsGrand}return{rowsTreeService:o,columnsTreeService:this.columnsTreeService,cornerTreeService:this.cornerTreeService,isLastPage:!0,cellsMetadata:a}}sendPartialPage(t,r,n){if(this.loadService.hasError()||!this.loadService.hasData())return Aa.getEmptyPage();const i=this.getLoadedElementsCount();let[o,a]=[Math.min(t,r),Math.max(t,r)];o=o>=0?o:0,a=a>=0?a:0,a=a<i?a:i;let s,l;if(o>i)s=void 0;else{let c;if(this.rowsTreeService){const u=Aa.cloneTreeNode;c=this.rowsTreeService.getPartialTree(o,a,{cloneFn:u}),n&&this.rowsGrand&&c.push(Ta(this.rowsGrand)),this.postProcessTree(c,{onlyFormatEvents:!0,iterateFn:Nt.clearNodeCache}),this.postProcessData(c,{onlyFormatEvents:!0})}const d=this.rowsTreeService?this.rowsTreeService.getTreeDeepsLength():0,h=Nt.wrapInRootNode(c);this.pluginService&&h&&h.children&&(this.pluginService.applyToRows(h.children),l=this.pluginService.metadataCache),s=new gp(h,!0,d),s.hasGrandTotals=!!(n&&this.rowsGrand)}return{rowsTreeService:s,columnsTreeService:this.columnsTreeService,cornerTreeService:this.cornerTreeService,isLastPage:!0,cellsMetadata:l}}getLoadedElementsCount(){return this.rowsTreeService?this.rowsTreeService.getTreeChildLength():0}getTotalItemsCount(){return this.loadService.getTotalItemsCount()}getLoadedColumnsCount(){return this.columnsTreeService?this.columnsTreeService.getTreeChildLength():0}attachEvent(){this.loadService.listenerCount(ur.HEADERS)&&this.loadService.offAll(ur.HEADERS),this.loadService.on(ur.HEADERS,this.onHeadersHandler),this.loadService.on(ur.METADATA,this.onMetadataHandler),this.loadService.on(ur.DATA,this.onDataHandler),this.loadService.on(ur.GRAND,this.onGrandHandler),this.loadService.on(ur.DATA_FINISH,this.onDataFinishHandler),this.loadService.on(ur.TOTAL_ROWS,this.onTotalRowsHandler),this.loadService.on(ur.DATABARS,this.onDataBarsHandler),this.loadService.on(ur.RANGE_MIN_MAX,this.onRangeMinMaxHandler),this.loadService.on(ur.FINISH,this.onFinishHandler),this.loadService.on(ur.ERROR,this.onErrorHandler)}detachEvent(){this.loadService.off(ur.HEADERS,this.onHeadersHandler),this.loadService.off(ur.METADATA,this.onMetadataHandler),this.loadService.off(ur.DATA,this.onDataHandler),this.loadService.off(ur.GRAND,this.onGrandHandler),this.loadService.off(ur.DATA_FINISH,this.onDataFinishHandler),this.loadService.off(ur.TOTAL_ROWS,this.onTotalRowsHandler),this.loadService.off(ur.DATABARS,this.onDataBarsHandler),this.loadService.off(ur.RANGE_MIN_MAX,this.onRangeMinMaxHandler),this.loadService.off(ur.FINISH,this.onFinishHandler),this.loadService.off(ur.ERROR,this.onErrorHandler)}checkLoadPromise(){if(!this.isLoadInProgress)return;const t=this.getLoadedElementsCount();(t>=this.getPageSize()||this.isWholeDataLoaded)&&(this.isLoadInProgress=!1,typeof this.loadPromiseResolve=="function"&&(this.loadPromiseResolve(t),this.clearLoadPromise()))}clearLoadAllPromise(){this.loadAllPromise=void 0,this.loadAllPromiseReject=void 0,this.loadAllPromiseResolve=void 0}clearLoadPromise(){this.loadPromiseReject=void 0,this.loadPromiseResolve=void 0}finishRequest(){this.logger.log("finishRequest"),this.hasDataFinishEvent=!0,!this.isDataHandlerThrottled&&(this.isWholeDataLoaded=!0,this.loadAllPromiseResolve&&typeof this.loadAllPromiseResolve=="function"&&(this.loadAllPromiseResolve(),this.clearLoadAllPromise()))}clearCache(){this.rowsGrand=void 0,this.rowsTreeService=void 0,this.columnsTreeService=void 0,this.loadedPagesCount=0,this.hasDataFinishEvent=!1,this.isWholeDataLoaded=!1,this.isLoadInProgress=!1,this.tempDataChunks=[],this.lastNotHandledChunkIndex=0,this.lastReadyNotHandledChunkIndex=0,this.isDataHandlerThrottled=!1}static getEmptyPage(){return{isLastPage:!0}}static fillDataChunks(t,r,n=yU,i=yU){const o=t.length<2?n:i;let a=t[Math.max(0,t.length-1)],s,l=!a;if(!r||typeof r.children=="undefined"&&typeof r.value=="undefined"&&r.data&&!r.data.length){a&&(a.ready=!0);return}if(a){const c=Math.max(0,a.list.length-1);s=a.list[c];const d=a.size?`${a.size}`:"0",h=parseInt(d,10)+(r.size||1);(a.handled||h>o&&!(s.isPart&&s.value===r.value))&&(l=!0)}r&&r.isPart&&s&&(!s.isPart||s.value!==r.value)&&(l=!0,s.value!==r.value&&(s=void 0)),l&&(a&&(a.ready=!0),a={list:[],size:0,ready:!1,handled:!1},t.push(a)),a&&(s&&s.isPart&&r&&r.isPart?(Nt.deepMerge(s,r),a.size+=r.size||1):(a.list.push(r),a.size+=r.size||1))}static cloneTreeNode(t,r){const n=t,{children:i,isMapped:o,minLevel:a,childCount:s,childDeep:l,parent:c,master:d,data:h,state:u,style:g,store:f}=n,p=wt(n,["children","isMapped","minLevel","childCount","childDeep","parent","master","data","state","style","store"]),x=Ta(p);return c&&(x.parent=c),d&&(x.master=d),h&&(x.data=Ta(h)),u&&(x.state=Ta(u)),g&&(x.style=Ta(g)),f&&(x.store=Ta(f)),!r&&i&&(x.children=i.map(S=>{const j=Aa.cloneTreeNode(S);return j.parent=x,j})),x}static createColumnsTreeServiceBuilder(t,r){return n=>{const i=t.getJaql(),o=t.getRawJaql?t.getRawJaql():SL(i,i.metadata||[]),a=Ti.getMetadataTree(i,or.MEASURES),s=Nt.getChildren(a),{preProcessTree:l,modifyTree:c,postProcessTree:d}=Wy;let h,u,g=0,f=0;if(Nt.hasChildren(n)){n.columnsCount&&n.totalColumnsCount&&(g=n.columnsCount,f=n.totalColumnsCount);const p=l(n,or.COLUMNS,i),x=c(p,or.COLUMNS,i,{originalData:n,applyIndexDivergence:t.applyIndexDivergence});d(x,o,{emitFn:r&&r.emitHeaderCellFormatEvent});const S=Nt.wrapInRootNode(x);t.pluginService&&S&&S.children&&t.pluginService.applyToColumns(S.children),h=S,u=new gp(S),s.length===1&&u.setValueNode(s[0])}else Nt.hasChildren(a)?(n.columnsCount&&n.totalColumnsCount&&(g=n.columnsCount,f=n.totalColumnsCount),typeof n.maxChilds=="number"&&(g=n.maxChilds,a.children=Nt.getChildren(a).filter((p,x)=>x<n.maxChilds)),t.pluginService&&a.children&&t.pluginService.applyToColumns(a.children),d(Nt.getChildren(a),o,{emitFn:r&&r.emitHeaderCellFormatEvent}),h=a,u=new gp(a)):(t.pluginService&&t.pluginService.resetRowStartFrom(),h=void 0,u=void 0,g=0,f=0);return{columnsTree:h,columnsTreeService:u,columnsCount:g,totalColumnsCount:f}}}static createCornerTreeServiceBuilder(t,r){return()=>{const n=t.getJaql(),i=t.getRawJaql?t.getRawJaql():SL(n,n.metadata||[]),o=Ti.getMetadataTree(n,or.ROWS);let a;if(Nt.hasChildren(o)){Nt.iterateThroughTree(Nt.getChildren(o),l=>{l.userType=Tr.CORNER;const c=Ti.getMetadataPanelByIndex(i,l.jaqlIndex,l.metadataType||"");r&&r.emitHeaderCellFormatEvent&&r.emitHeaderCellFormatEvent(l,c,i)});let s;t.columnsTreeService&&(s=t.columnsTreeService.getTreeDeepsLength()),t.pluginService&&t.pluginService.applyToHeaders(o),a=new gp(o,!1,s)}return{cornerTree:o,cornerTreeService:a}}}}var bU={exports:{}};/*!
|
|
17
|
+
*/var fg=ce;function Rbe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Fbe=typeof Object.is=="function"?Object.is:Rbe,jbe=fg.useState,Bbe=fg.useEffect,zbe=fg.useLayoutEffect,$be=fg.useDebugValue;function Wbe(e,t){var r=t(),n=jbe({inst:{value:r,getSnapshot:t}}),i=n[0].inst,o=n[1];return zbe(function(){i.value=r,i.getSnapshot=t,O3(i)&&o({inst:i})},[e,r,t]),Bbe(function(){return O3(i)&&o({inst:i}),e(function(){O3(i)&&o({inst:i})})},[e]),$be(r),r}function O3(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Fbe(e,r)}catch(n){return!0}}function Hbe(e,t){return t()}var Ube=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?Hbe:Wbe;o7.useSyncExternalStore=fg.useSyncExternalStore!==void 0?fg.useSyncExternalStore:Ube,i7.exports=o7;var Gbe=i7.exports;const a7=Gbe.useSyncExternalStore,s7=Ce.createContext(void 0),l7=Ce.createContext(!1);function c7(e,t){return e||(t&&typeof window!="undefined"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=s7),window.ReactQueryClientContext):s7)}const gg=({context:e}={})=>{const t=Ce.useContext(c7(e,Ce.useContext(l7)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},I3=({client:e,children:t,context:r,contextSharing:n=!1})=>{Ce.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=c7(r,n);return Ce.createElement(l7.Provider,{value:!r&&n},Ce.createElement(i.Provider,{value:e},t))},Vbe=Ce.createContext(!1),Ybe=()=>Ce.useContext(Vbe);function qbe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const Zbe=Ce.createContext(qbe()),Xbe=()=>Ce.useContext(Zbe);function u7(e,t){return typeof e=="function"?e(...t):!!e}const Kbe=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},Qbe=e=>{Ce.useEffect(()=>{e.clearReset()},[e])},Jbe=({result:e,errorResetBoundary:t,useErrorBoundary:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&u7(r,[e.error,n]),e1e=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},t1e=(e,t)=>e.isLoading&&e.isFetching&&!t,r1e=(e,t,r)=>(e==null?void 0:e.suspense)&&t1e(t,r),n1e=(e,t,r)=>t.fetchOptimistic(e).then(({data:n})=>{e.onSuccess==null||e.onSuccess(n),e.onSettled==null||e.onSettled(n,null)}).catch(n=>{r.clearReset(),e.onError==null||e.onError(n),e.onSettled==null||e.onSettled(void 0,n)});function i1e(e,t){const r=gg({context:e.context}),n=Ybe(),i=Xbe(),o=r.defaultQueryOptions(e);o._optimisticResults=n?"isRestoring":"optimistic",o.onError&&(o.onError=gi.batchCalls(o.onError)),o.onSuccess&&(o.onSuccess=gi.batchCalls(o.onSuccess)),o.onSettled&&(o.onSettled=gi.batchCalls(o.onSettled)),e1e(o),Kbe(o,i),Qbe(i);const[a]=Ce.useState(()=>new t(r,o)),s=a.getOptimisticResult(o);if(a7(Ce.useCallback(l=>{const c=n?()=>{}:a.subscribe(gi.batchCalls(l));return a.updateResult(),c},[a,n]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),Ce.useEffect(()=>{a.setOptions(o,{listeners:!1})},[o,a]),r1e(o,s,n))throw n1e(o,a,i);if(Jbe({result:s,errorResetBoundary:i,useErrorBoundary:o.useErrorBoundary,query:a.getCurrentQuery()}))throw s.error;return o.notifyOnChangeProps?s:a.trackResult(s)}function _d(e,t,r){const n=Vv(e,t,r);return i1e(n,Lbe)}function N3(e,t,r){const n=bbe(e,t),i=gg({context:n.context}),[o]=Ce.useState(()=>new Nbe(i,n));Ce.useEffect(()=>{o.setOptions(n)},[o,n]);const a=a7(Ce.useCallback(l=>o.subscribe(gi.batchCalls(l)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),s=Ce.useCallback((l,c)=>{o.mutate(l,c).catch(o1e)},[o]);if(a.error&&u7(o.options.useErrorBoundary,[a.error]))throw a.error;return xe(ue({},a),{mutate:s,mutateAsync:a.mutate})}function o1e(){}const FC=ce.createContext({isInitialized:!1,tracking:{enabled:!0,packageName:"sdk-ui"},errorBoundary:{showErrorBox:!0}}),hr=()=>ce.useContext(FC);class d7{constructor(t,r=!1){this.volatile=r,this.getChatContexts=()=>Jt(this,null,function*(){return(yield this.httpClient.get("api/datasources//"))||[]}),this.getNlgInsights=n=>this.httpClient.post("api/v2/ai/nlg/queryResult",n),this.getQueryRecommendations=(n,i)=>this.httpClient.get(`api/v2/ai/recommendations/query/${n}/${i.numOfRecommendations}`),this.getNlqResult=(n,i)=>this.httpClient.post(`api/v2/ai/nlq/query/${n}`,i),this.setLlmConfig=n=>this.httpClient.post("api/v2/settings/ai/llmProvider",n).catch(i=>{console.error("Unable to set llm config",i)}),this.getAllChats=()=>Jt(this,null,function*(){return this.volatile?[]:this.httpClient.get("api/v2/ai/chats")}),this.getChatById=n=>this.httpClient.get(`api/v2/ai/chats/${n}`),this.createChat=(n,i)=>this.httpClient.post("api/v2/ai/chats",{sourceId:n,volatile:this.volatile,contextDetails:i}),this.postChat=(n,i)=>this.httpClient.post(`api/v2/ai/chats/${n}`,i),this.deleteChatHistory=n=>this.httpClient.delete(`api/v2/ai/chats/${n}/history`),this.sendFeedback=n=>this.httpClient.post("api/v2/ai/feedback",n),this.ai={getNlgInsights:this.getNlgInsights,getNlqResult:this.getNlqResult,getQueryRecommendations:this.getQueryRecommendations,setLlmConfig:this.setLlmConfig,sendFeedback:this.sendFeedback,chat:{getAll:this.getAllChats,getById:this.getChatById,create:this.createChat,post:this.postChat,clearHistory:this.deleteChatHistory}},this.httpClient=t}}const a1e=new P3({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnMount:!1}}}),R3=ce.createContext(void 0),uc=()=>ce.useContext(R3),s1e=({children:e,volatile:t})=>{const{app:r}=hr(),n=ce.useMemo(()=>r?new d7(r.httpClient,t):void 0,[r,t]);return pe(R3.Provider,{value:n,children:pe(I3,{client:a1e,children:e})})},h7=ce.createContext({}),l1e=()=>ce.useContext(h7),p7=({children:e})=>{const[t,r]=ce.useState({}),n=ce.useCallback((a,s)=>{var l;return`${a}_${(l=s==null?void 0:s.dashboardId)!=null?l:""}`},[]),i=ce.useCallback((a,s,l)=>{r(c=>xe(ue({},c),{[n(s,l)]:a}))},[n]),o=ce.useCallback((a,s)=>t[n(a,s)],[t,n]);return pe(h7.Provider,{value:{saveChatId:i,getChatId:o},children:e})};function c1e({children:e,volatile:t}){return pe(p7,{children:pe(s1e,{volatile:t,children:e})})}const u1e={sdkComponentInit:{internal:!0,external:!0},sdkHookInit:{internal:!0,external:!0},sdkError:{internal:!0,external:!1},sdkCliExec:{internal:!0,external:!1},sdkAngularServiceMethodExecuted:{internal:!0,external:!0}},f7="composesdk",g7=(e,t,r,n=!1)=>{const i=Object.assign({action:e,cat:f7,eventType:"product",direct:!0},t);return r.post("api/activities/",[i],{cache:"no-store",redirect:"error",referrerPolicy:"same-origin",priority:"low"}).catch(o=>{console.error(`unable to log action=${e}, category=${f7}`,o)})},m7=(e,t,r,n,i)=>{const o=u1e[`${e}`];return o.internal&&g7(e,t,r,i),o.external&&n&&n(ue({action:e},t)),Promise.resolve()},F3=()=>{var o,a;const{tracking:e,app:t}=hr(),r=(a=(o=t==null?void 0:t.httpClient)==null?void 0:o.auth)==null?void 0:a.type,n=ce.useCallback((s,l={},c=!1)=>t?m7(s,xe(ue({},l),{authType:r}),t.httpClient,e.onTrackingEvent,c):Promise.resolve(),[e,t,r]),i=ce.useCallback((s,l=!1)=>{if(!t)return Promise.resolve();const{packageName:c,packageVersion:d,component:h,error:u}=s;let g="";return typeof u=="string"?g=u:u instanceof Error&&(g=u.message||u.toString()),m7("sdkError",xe(ue({},{packageName:c,packageVersion:d,component:h,error:g}),{authType:r}),t.httpClient,e.onTrackingEvent,l)},[e,t,r]);return{trackEvent:n,trackError:i}},v7="sdkHookInit",d1e=(e,t,r,n)=>{if(!r)return;g7(v7,{packageName:t,packageVersion:"2.4.1",hookName:e},r.httpClient).finally(n)};function h1e(e){const{tracking:t,app:r}=hr(),{trackEvent:n}=F3(),i=ce.useRef(!1);ce.useEffect(()=>{if(!(!t||!r)&&!i.current){const o={packageName:t.packageName||"sdk-ui",packageVersion:"2.4.1",hookName:e};n(v7,o,!t.enabled).finally(()=>i.current=!0)}},[t,e,n,r])}const Xi=e=>t=>(...r)=>(h1e(e),t(...r)),p1e={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class jC{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,r)}init(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||p1e,this.options=r,this.debug=r.debug}log(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}warn(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}error(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"error","")}deprecate(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,n,i){return i&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new jC(this.logger,ue({prefix:`${this.prefix}:${t}:`},this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new jC(this.logger,t)}}var dc=new jC;class BC{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(n=>{this.observers[n]=this.observers[n]||[],this.observers[n].push(r)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(n=>n!==r)}}emit(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.observers[t]&&[].concat(this.observers[t]).forEach(a=>{a(...n)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(a=>{a.apply(a,[t,...n])})}}function qv(){let e,t;const r=new Promise((n,i)=>{e=n,t=i});return r.resolve=e,r.reject=t,r}function y7(e){return e==null?"":""+e}function f1e(e,t,r){e.forEach(n=>{t[n]&&(r[n]=t[n])})}function j3(e,t,r){function n(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!e||typeof e=="string"}const o=typeof t!="string"?[].concat(t):t.split(".");for(;o.length>1;){if(i())return{};const a=n(o.shift());!e[a]&&r&&(e[a]=new r),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:n(o.shift())}}function b7(e,t,r){const{obj:n,k:i}=j3(e,t,Object);n[i]=r}function g1e(e,t,r,n){const{obj:i,k:o}=j3(e,t,Object);i[o]=i[o]||[],i[o].push(r)}function zC(e,t){const{obj:r,k:n}=j3(e,t);if(r)return r[n]}function m1e(e,t,r){const n=zC(e,r);return n!==void 0?n:zC(t,r)}function x7(e,t,r){for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?r&&(e[n]=t[n]):x7(e[n],t[n],r):e[n]=t[n]);return e}function mg(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var v1e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function y1e(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>v1e[t]):e}const b1e=[" ",",","?","!",";"];function x1e(e,t,r){t=t||"",r=r||"";const n=b1e.filter(a=>t.indexOf(a)<0&&r.indexOf(a)<0);if(n.length===0)return!0;const i=new RegExp(`(${n.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(r);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function $C(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const n=t.split(r);let i=e;for(let o=0;o<n.length;++o){if(!i||typeof i[n[o]]=="string"&&o+1<n.length)return;if(i[n[o]]===void 0){let a=2,s=n.slice(o,o+a).join(r),l=i[s];for(;l===void 0&&n.length>o+a;)a++,s=n.slice(o,o+a).join(r),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}const c=n.slice(o+a).join(r);return c?$C(l,c,r):void 0}i=i[n[o]]}return i}function WC(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class w7 extends BC{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s=[t,r];n&&typeof n!="string"&&(s=s.concat(n)),n&&typeof n=="string"&&(s=s.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(s=t.split("."));const l=zC(this.data,s);return l||!a||typeof n!="string"?l:$C(this.data&&this.data[t]&&this.data[t][r],n,o)}addResource(t,r,n,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,r];n&&(s=s.concat(a?n.split(a):n)),t.indexOf(".")>-1&&(s=t.split("."),i=r,r=s[1]),this.addNamespaces(r),b7(this.data,s,i),o.silent||this.emit("added",t,r,n,i)}addResources(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in n)(typeof n[o]=="string"||Object.prototype.toString.apply(n[o])==="[object Array]")&&this.addResource(t,r,o,n[o],{silent:!0});i.silent||this.emit("added",t,r,n)}addResourceBundle(t,r,n,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},s=[t,r];t.indexOf(".")>-1&&(s=t.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let l=zC(this.data,s)||{};i?x7(l,n,o):l=ue(ue({},l),n),b7(this.data,s,l),a.silent||this.emit("added",t,r,n)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?ue({},this.getResource(t,r)):this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(i=>r[i]&&Object.keys(r[i]).length>0)}toJSON(){return this.data}}var C7={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,r,n,i))}),t}};const _7={};class HC extends BC{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),f1e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=dc.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const n=this.resolve(t,r);return n&&n.res!==void 0}extractFromKey(t,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=r.ns||this.options.defaultNS||[];const a=n&&t.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!x1e(t,n,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};const c=t.split(n);(n!==i||n===i&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(i)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r=ue({},r)),r||(r={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],r),l=s[s.length-1],c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(d){const B=r.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${B}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l}:`${l}${B}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l}:a}const h=this.resolve(t,r);let u=h&&h.res;const g=h&&h.usedKey||a,f=h&&h.exactUsedKey||a,p=Object.prototype.toString.apply(u),x=["[object Number]","[object Function]","[object RegExp]"],S=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject;if(j&&u&&(typeof u!="string"&&typeof u!="boolean"&&typeof u!="number")&&x.indexOf(p)<0&&!(typeof S=="string"&&p==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const B=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,u,xe(ue({},r),{ns:s})):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=B,h):B}if(o){const B=p==="[object Array]",R=B?[]:{},E=B?f:g;for(const N in u)if(Object.prototype.hasOwnProperty.call(u,N)){const M=`${E}${o}${N}`;R[N]=this.translate(M,xe(ue({},r),{joinArrays:!1,ns:s})),R[N]===M&&(R[N]=u[N])}u=R}}else if(j&&typeof S=="string"&&p==="[object Array]")u=u.join(S),u&&(u=this.extendTranslation(u,t,r,n));else{let B=!1,R=!1;const E=r.count!==void 0&&typeof r.count!="string",N=HC.hasDefaultValue(r),M=E?this.pluralResolver.getSuffix(c,r.count,r):"",$=r.ordinal&&E?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",T=r[`defaultValue${M}`]||r[`defaultValue${$}`]||r.defaultValue;!this.isValidLookup(u)&&N&&(B=!0,u=T),this.isValidLookup(u)||(R=!0,u=a);const y=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&R?void 0:u,D=N&&T!==u&&this.options.updateMissing;if(R||B||D){if(this.logger.log(D?"updateKey":"missingKey",c,l,a,D?T:u),o){const q=this.resolve(a,xe(ue({},r),{keySeparator:!1}));q&&q.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 k=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let q=0;q<F.length;q++)k.push(F[q]);else this.options.saveMissingTo==="all"?k=this.languageUtils.toResolveHierarchy(r.lng||this.language):k.push(r.lng||this.language);const V=(q,z,P)=>{const W=N&&P!==u?P:y;this.options.missingKeyHandler?this.options.missingKeyHandler(q,l,z,W,D,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(q,l,z,W,D,r),this.emit("missingKey",q,l,z,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?k.forEach(q=>{this.pluralResolver.getSuffixes(q,r).forEach(z=>{V([q],a+z,r[`defaultValue${z}`]||T)})}):V(k,a,T))}u=this.extendTranslation(u,t,r,h,n),R&&u===a&&this.options.appendNamespaceToMissingKey&&(u=`${l}:${a}`),(R||B)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,B?u:void 0):u=this.options.parseMissingKeyHandler(u))}return i?(h.res=u,h):u}extendTranslation(t,r,n,i,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,ue(ue({},this.options.interpolation.defaultVariables),n),i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(xe(ue({},n),{interpolation:ue(ue({},this.options.interpolation),n.interpolation)}));const c=typeof t=="string"&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(c){const u=t.match(this.interpolator.nestingRegexp);d=u&&u.length}let h=n.replace&&typeof n.replace!="string"?n.replace:n;if(this.options.interpolation.defaultVariables&&(h=ue(ue({},this.options.interpolation.defaultVariables),h)),t=this.interpolator.interpolate(t,h,n.lng||this.language,n),c){const u=t.match(this.interpolator.nestingRegexp),g=u&&u.length;d<g&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(n.lng=i.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var u=arguments.length,g=new Array(u),f=0;f<u;f++)g[f]=arguments[f];return o&&o[0]===g[0]&&!n.context?(a.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${r[0]}`),null):a.translate(...g,r)},n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,l=typeof s=="string"?[s]:s;return t!=null&&l&&l.length&&n.applyPostProcessor!==!1&&(t=C7.handle(l,t,r,this.options&&this.options.postProcessPassResolved?ue({i18nResolved:i},n):n,this)),t}resolve(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,i,o,a,s;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,r),d=c.key;i=d;let h=c.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const u=r.count!==void 0&&typeof r.count!="string",g=u&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),f=r.context!==void 0&&(typeof r.context=="string"||typeof r.context=="number")&&r.context!=="",p=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);h.forEach(x=>{this.isValidLookup(n)||(s=x,!_7[`${p[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(_7[`${p[0]}-${x}`]=!0,this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" 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!!!")),p.forEach(S=>{if(this.isValidLookup(n))return;a=S;const j=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(j,d,S,x,r);else{let B;u&&(B=this.pluralResolver.getSuffix(S,r.count,r));const R=`${this.options.pluralSeparator}zero`,E=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(j.push(d+B),r.ordinal&&B.indexOf(E)===0&&j.push(d+B.replace(E,this.options.pluralSeparator)),g&&j.push(d+R)),f){const N=`${d}${this.options.contextSeparator}${r.context}`;j.push(N),u&&(j.push(N+B),r.ordinal&&B.indexOf(E)===0&&j.push(N+B.replace(E,this.options.pluralSeparator)),g&&j.push(N+R))}}let U;for(;U=j.pop();)this.isValidLookup(n)||(o=U,n=this.getResource(S,x,U,r))}))})}),{res:n,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,r,n,i):this.resourceStore.getResource(t,r,n,i)}static hasDefaultValue(t){const r="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r===n.substring(0,r.length)&&t[n]!==void 0)return!0;return!1}}function B3(e){return e.charAt(0).toUpperCase()+e.slice(1)}class S7{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=dc.create("languageUtils")}getScriptPartFromCode(t){if(t=WC(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=WC(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const r=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map(i=>i.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=B3(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=B3(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=B3(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&t.forEach(n=>{if(r)return;const i=this.getLanguagePartFromCode(n);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&o.indexOf(i)===0)return o})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!r)return t.default||[];let n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}toResolveHierarchy(t,r){const n=this.getFallbackCodes(r||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),n.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}let w1e=[{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}],C1e={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const _1e=["v1","v2","v3"],S1e=["v4"],k7={zero:0,one:1,two:2,few:3,many:4,other:5};function k1e(){const e={};return w1e.forEach(t=>{t.lngs.forEach(r=>{e[r]={numbers:t.nr,plurals:C1e[t.fc]}})}),e}class M1e{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=r,this.logger=dc.create("pluralResolver"),(!this.options.compatibilityJSON||S1e.includes(this.options.compatibilityJSON))&&(typeof Intl=="undefined"||!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=k1e()}addRule(t,r){this.rules[t]=r}getRule(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(WC(t),{type:r.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(i=>`${r}${i}`)}getSuffixes(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((i,o)=>k7[i]-k7[o]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):n.numbers.map(i=>this.getSuffix(t,i,r)):[]}getSuffix(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,n);return i?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:this.getSuffixRetroCompatible(i,r):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,r){const n=t.noAbs?t.plurals(r):t.plurals(Math.abs(r));let i=t.numbers[n];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const o=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!_1e.includes(this.options.compatibilityJSON)}}function M7(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=m1e(e,t,r);return!o&&i&&typeof r=="string"&&(o=$C(e,r,n),o===void 0&&(o=$C(t,r,n))),o}class T1e{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=dc.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(r=>r),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const r=t.interpolation;this.escape=r.escape!==void 0?r.escape:y1e,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?mg(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?mg(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?mg(r.nestingPrefix):r.nestingPrefixEscaped||mg("$t("),this.nestingSuffix=r.nestingSuffix?mg(r.nestingSuffix):r.nestingSuffixEscaped||mg(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const r=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(r,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(t,r,n,i){let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(f){return f.replace(/\$/g,"$$$$")}const d=f=>{if(f.indexOf(this.formatSeparator)<0){const j=M7(r,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(j,void 0,n,xe(ue(ue({},i),r),{interpolationkey:f})):j}const p=f.split(this.formatSeparator),x=p.shift().trim(),S=p.join(this.formatSeparator).trim();return this.format(M7(r,l,x,this.options.keySeparator,this.options.ignoreJSONStructure),S,n,xe(ue(ue({},i),r),{interpolationkey:x}))};this.resetRegExp();const h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,u=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>c(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?c(this.escape(f)):c(f)}].forEach(f=>{for(s=0;o=f.regex.exec(t);){const p=o[1].trim();if(a=d(p),a===void 0)if(typeof h=="function"){const S=h(t,o,i);a=typeof S=="string"?S:""}else if(i&&Object.prototype.hasOwnProperty.call(i,p))a="";else if(u){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${t}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=y7(a));const x=f.safeValue(a);if(t=t.replace(o[0],x),u?(f.regex.lastIndex+=a.length,f.regex.lastIndex-=o[0].length):f.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;function s(l,c){const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const h=l.split(new RegExp(`${d}[ ]*{`));let u=`{${h[1]}`;l=h[0],u=this.interpolate(u,a);const g=u.match(/'/g),f=u.match(/"/g);(g&&g.length%2===0&&!f||f.length%2!==0)&&(u=u.replace(/'/g,'"'));try{a=JSON.parse(u),c&&(a=ue(ue({},c),a))}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,p),`${l}${d}${u}`}return delete a.defaultValue,l}for(;i=this.nestingRegexp.exec(t);){let l=[];a=ue({},n),a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(h=>h.trim());i[1]=d.shift(),l=d,c=!0}if(o=r(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=y7(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),c&&(o=l.reduce((d,h)=>this.format(d,h,n.lng,xe(ue({},n),{interpolationkey:i[1].trim()})),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}function A1e(e){let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);t==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(a=>{if(!a)return;const[s,...l]=a.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,"");r[s.trim()]||(r[s.trim()]=c),c==="false"&&(r[s.trim()]=!1),c==="true"&&(r[s.trim()]=!0),isNaN(c)||(r[s.trim()]=parseInt(c,10))})}return{formatName:t,formatOptions:r}}function vg(e){const t={};return function(n,i,o){const a=i+JSON.stringify(o);let s=t[a];return s||(s=e(WC(i),o),t[a]=s),s(n)}}class E1e{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=dc.create("formatter"),this.options=t,this.formats={number:vg((r,n)=>{const i=new Intl.NumberFormat(r,ue({},n));return o=>i.format(o)}),currency:vg((r,n)=>{const i=new Intl.NumberFormat(r,xe(ue({},n),{style:"currency"}));return o=>i.format(o)}),datetime:vg((r,n)=>{const i=new Intl.DateTimeFormat(r,ue({},n));return o=>i.format(o)}),relativetime:vg((r,n)=>{const i=new Intl.RelativeTimeFormat(r,ue({},n));return o=>i.format(o,n.range||"day")}),list:vg((r,n)=>{const i=new Intl.ListFormat(r,ue({},n));return o=>i.format(o)})},this.init(t)}init(t){const n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=vg(r)}format(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return r.split(this.formatSeparator).reduce((s,l)=>{const{formatName:c,formatOptions:d}=A1e(l);if(this.formats[c]){let h=s;try{const u=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},g=u.locale||u.lng||i.locale||i.lng||n;h=this.formats[c](s,g,ue(ue(ue({},d),i),u))}catch(u){this.logger.warn(u)}return h}else this.logger.warn(`there was no format function for ${c}`);return s},t)}}function P1e(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class D1e extends BC{constructor(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=dc.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,i.backend,i)}queueLoad(t,r,n,i){const o={},a={},s={},l={};return t.forEach(c=>{let d=!0;r.forEach(h=>{const u=`${c}|${h}`;!n.reload&&this.store.hasResourceBundle(c,h)?this.state[u]=2:this.state[u]<0||(this.state[u]===1?a[u]===void 0&&(a[u]=!0):(this.state[u]=1,d=!1,a[u]===void 0&&(a[u]=!0),o[u]===void 0&&(o[u]=!0),l[h]===void 0&&(l[h]=!0)))}),d||(s[c]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,r,n){const i=t.split("|"),o=i[0],a=i[1];r&&this.emit("failedLoading",o,a,r),n&&this.store.addResourceBundle(o,a,n),this.state[t]=r?-1:2;const s={};this.queue.forEach(l=>{g1e(l.loaded,[o],a),P1e(l,t),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const d=l.loaded[c];d.length&&d.forEach(h=>{s[c][h]===void 0&&(s[c][h]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:n,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(c&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,n,i+1,o*2,a)},o);return}a(c,d)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(t,r);c&&typeof c.then=="function"?c.then(d=>s(null,d)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,r,s)}prepareLoading(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=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."),i&&i();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof r=="string"&&(r=[r]);const o=this.queueLoad(t,r,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,r,n){this.prepareLoading(t,r,{},n)}reload(t,r,n){this.prepareLoading(t,r,{reload:!0},n)}loadOne(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=t.split("|"),i=n[0],o=n[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${r}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${r}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,r,n,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" 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(!(n==null||n==="")){if(this.backend&&this.backend.create){const l=xe(ue({},a),{isUpdate:o}),c=this.backend.create.bind(this.backend);if(c.length<6)try{let d;c.length===5?d=c(t,r,n,i,l):d=c(t,r,n,i),d&&typeof d.then=="function"?d.then(h=>s(null,h)).catch(s):s(null,d)}catch(d){s(d)}else c(t,r,n,i,s,l)}!t||!t[0]||this.store.addResource(t[0],r,n,i)}}}function T7(){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(t){let r={};if(typeof t[1]=="object"&&(r=t[1]),typeof t[1]=="string"&&(r.defaultValue=t[1]),typeof t[2]=="string"&&(r.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(i=>{r[i]=n[i]})}return r},interpolation:{escapeValue:!0,format:(e,t,r,n)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function A7(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function UC(){}function L1e(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})}class Zv extends BC{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=A7(t),this.services={},this.logger=dc,this.modules={external:[]},L1e(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(){var t=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;typeof r=="function"&&(n=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(typeof r.ns=="string"?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const i=T7();this.options=ue(ue(ue({},i),this.options),A7(r)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=ue(ue({},i.interpolation),this.options.interpolation)),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);function o(d){return d?typeof d=="function"?new d:d:null}if(!this.options.isClone){this.modules.logger?dc.init(o(this.modules.logger),this.options):dc.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:typeof Intl!="undefined"&&(d=E1e);const h=new S7(this.options);this.store=new w7(this.options.resources,this.options);const u=this.services;u.logger=dc,u.resourceStore=this.store,u.languageUtils=h,u.pluralResolver=new M1e(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),d&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(u.formatter=o(d),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new T1e(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new D1e(o(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",function(g){for(var f=arguments.length,p=new Array(f>1?f-1:0),x=1;x<f;x++)p[x-1]=arguments[x];t.emit(g,...p)}),this.modules.languageDetector&&(u.languageDetector=o(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=o(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new HC(this.services,this.options),this.translator.on("*",function(g){for(var f=arguments.length,p=new Array(f>1?f-1:0),x=1;x<f;x++)p[x-1]=arguments[x];t.emit(g,...p)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,n||(n=UC),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[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(d=>{this[d]=function(){return t.store[d](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=function(){return t.store[d](...arguments),t}});const l=qv(),c=()=>{const d=(h,u)=>{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(u),n(h,u)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),l}loadResources(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:UC;const i=typeof t=="string"?t:this.language;if(typeof t=="function"&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode")return n();const o=[],a=s=>{if(!s)return;this.services.languageUtils.toResolveHierarchy(s).forEach(c=>{o.indexOf(c)<0&&o.push(c)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload&&this.options.preload.forEach(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(s)})}else n(null)}reloadResources(t,r,n){const i=qv();return t||(t=this.languages),r||(r=this.options.ns),n||(n=UC),this.services.backendConnector.reload(t,r,o=>{i.resolve(),n(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&C7.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(t,r){var n=this;this.isLanguageChangingTo=t;const i=qv();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,c)=>{c?(o(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return n.t(...arguments)}),r&&r(l,function(){return n.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,d=>{a(d,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,r,n){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),h=2;h<c;h++)d[h-2]=arguments[h];l=i.options.overloadTranslationOptionHandler([a,s].concat(d))}else l=ue({},s);l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix=l.keyPrefix||n||o.keyPrefix;const u=i.options.keySeparator||".";let g;return l.keyPrefix&&Array.isArray(a)?g=a.map(f=>`${l.keyPrefix}${u}${f}`):g=l.keyPrefix?`${l.keyPrefix}${u}${a}`:a,i.t(g,l)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=r,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let r=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 n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===2};if(r.precheck){const s=r.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,t)&&(!i||a(o,t)))}loadNamespaces(t,r){const n=qv();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(t,r){const n=qv();typeof t=="string"&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0);return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{n.resolve(),r&&r(a)}),n):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const r=["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"],n=this.services&&this.services.languageUtils||new S7(T7());return r.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Zv(t,r)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:UC;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const i=xe(ue(ue({},this.options),t),{isClone:!0}),o=new Zv(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services=ue({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new w7(this.store.data,i),o.services.resourceStore=o.store),o.translator=new HC(o.services,i),o.translator.on("*",function(s){for(var l=arguments.length,c=new Array(l>1?l-1:0),d=1;d<l;d++)c[d-1]=arguments[d];o.emit(s,...c)}),o.init(i,r),o.translator.options=i,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 E7=Zv.createInstance();E7.createInstance=Zv.createInstance;const O1e={error:"Error"},I1e={error:"Помилка"},P7="common",N1e={en:O1e,uk:I1e},hc=E7.createInstance({defaultNS:P7,resources:R1e(N1e,P7),lng:"en",fallbackLng:"en"}),z3={i18nextInstance:hc,initPromise:hc.init().then(()=>hc)},GC=new Map;GC.set("common",z3);const VC=e=>{if(GC.has(e.namespace))return GC.get(e.namespace);if(e.plugins)for(const o of e.plugins)hc.use(o);Object.keys(e.resource).forEach(o=>{hc.addResourceBundle(o,e.namespace,e.resource[o])});const t=hc.cloneInstance({defaultNS:e.namespace});let r=z3.initPromise.then(()=>t);t.on("languageChanged",o=>{hc.language!==o&&hc.changeLanguage(o)}),hc.on("languageChanged",o=>{t.language!==o&&t.changeLanguage(o)});const n=e.language||"en";hc.language!==n&&(r=r.then(()=>t.changeLanguage(n)).then(()=>t));const i={initPromise:r,i18nextInstance:t};return GC.set(e.namespace,i),i};function R1e(e,t){return Object.keys(e).reduce((r,n)=>(r[n]={[t]:e[n]},r),{})}class Xv extends Error{constructor(t,r,n){const{key:i,interpolationOptions:o}=r,a=n||z3.i18nextInstance.t,s=Object.assign(Object.assign({},o),{ns:t}),l=a(i,Object.assign(Object.assign({},s),{lng:"en"}));super(l),this.key=i,this.namespace=t,this.interpolationOptions=s}}function yg(e){return e&&e.replace(new RegExp("(?<!\\\\)'","g"),"\\'")}function mu(e,t){if(!e||typeof e!="string")return e;const r=new URL(e);return r.origin+(r.pathname.endsWith("/")?r.pathname:r.pathname+"/")+(t&&r.search?r.search:"")}const F1e={errors:{measure:{unsupportedType:"Unsupported measure type",dimensionalCalculatedMeasure:{noContext:"DimensionalCalculatedMeasure must have 'context' property"},dimensionalBaseMeasure:{noAttributeDimExpression:"DimensionalBaseMeasure must have 'attribute'/'dim'/'expression' property",noAggAggregation:"DimensionalBaseMeasure must have 'agg' or 'aggregation' property"},notAFormula:"Jaql is not a formula"},dataModelConfig:{noName:"'name' must be specified in config for DataModel",noMetadata:"'metadata' must be specified in config for DataModel"},filter:{unsupportedType:"Unsupported filter type: {{filterType}}",unsupportedDatetimeLevel:'Filters do not support the next "datetime" levels: Hours, MinutesRoundTo30, MinutesRoundTo15, Minutes, Seconds',membersFilterNullMember:"MembersFilter of {{attributeId}} - member cannot be null",unsupportedConditionFilter:"Jaql contains unsupported condition filter: {{filter}}",formulaFiltersNotSupported:"Formula-based filter not supported yet: {{filter}}"},unsupportedDimensionalElement:"Unsupported dimensional element type"}},j1e={errors:{measure:{unsupportedType:"Непідтримуваний тип measure",dimensionalCalculatedMeasure:{noContext:"DimensionalCalculatedMeasure має мати властивість 'context'"},dimensionalBaseMeasure:{noAttributeDimExpression:"DimensionalBaseMeasure має мати властивість 'attribute'/'dim'/'expression'",noAggAggregation:"DimensionalBaseMeasure має мати властивість 'agg' або 'aggregation'"},notAFormula:"Jaql не формула"},dataModelConfig:{noName:"'name' має бути вказано в конфігурації для DataModel",noMetadata:"'metadata' має бути вказано в конфігурації для DataModel"},filter:{unsupportedType:"Непідтримуваний тип фільтра: {{filterType}}",unsupportedDatetimeLevel:'Фільтри не підтримують наступні рівні "datetime": Hours, MinutesRoundTo30, MinutesRoundTo15, Minutes, Seconds',membersFilterNullMember:"MembersFilter у {{attributeId}} - member не може бути нульовим",unsupportedConditionFilter:"Jaql містить непідтримуваний condition фільтр: {{filter}}",formulaFiltersNotSupported:"Фільтри, що містять формули наразі не підтримуються: {{filter}}"},unsupportedDimensionalElement:"Непідтримуваний тип елемента"}},D7="sdkData",B1e={en:F1e,uk:j1e};function z1e(){return VC({resource:B1e,language:"en",namespace:D7})}const{i18nextInstance:$1e}=z1e();function W1e(){this.__data__=[],this.size=0}function Kv(e,t){return e===t||e!==e&&t!==t}function YC(e,t){for(var r=e.length;r--;)if(Kv(e[r][0],t))return r;return-1}var H1e=Array.prototype,U1e=H1e.splice;function G1e(e){var t=this.__data__,r=YC(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():U1e.call(t,r,1),--this.size,!0}function V1e(e){var t=this.__data__,r=YC(t,e);return r<0?void 0:t[r][1]}function Y1e(e){return YC(this.__data__,e)>-1}function q1e(e,t){var r=this.__data__,n=YC(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function vu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}vu.prototype.clear=W1e,vu.prototype.delete=G1e,vu.prototype.get=V1e,vu.prototype.has=Y1e,vu.prototype.set=q1e;function Z1e(){this.__data__=new vu,this.size=0}function X1e(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function K1e(e){return this.__data__.get(e)}function Q1e(e){return this.__data__.has(e)}var L7=typeof global=="object"&&global&&global.Object===Object&&global,J1e=typeof self=="object"&&self&&self.Object===Object&&self,No=L7||J1e||Function("return this")(),js=No.Symbol,O7=Object.prototype,exe=O7.hasOwnProperty,txe=O7.toString,Qv=js?js.toStringTag:void 0;function rxe(e){var t=exe.call(e,Qv),r=e[Qv];try{e[Qv]=void 0;var n=!0}catch(o){}var i=txe.call(e);return n&&(t?e[Qv]=r:delete e[Qv]),i}var nxe=Object.prototype,ixe=nxe.toString;function oxe(e){return ixe.call(e)}var axe="[object Null]",sxe="[object Undefined]",I7=js?js.toStringTag:void 0;function Al(e){return e==null?e===void 0?sxe:axe:I7&&I7 in Object(e)?rxe(e):oxe(e)}function po(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var lxe="[object AsyncFunction]",cxe="[object Function]",uxe="[object GeneratorFunction]",dxe="[object Proxy]";function yu(e){if(!po(e))return!1;var t=Al(e);return t==cxe||t==uxe||t==lxe||t==dxe}var $3=No["__core-js_shared__"],N7=function(){var e=/[^.]+$/.exec($3&&$3.keys&&$3.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function hxe(e){return!!N7&&N7 in e}var pxe=Function.prototype,fxe=pxe.toString;function tp(e){if(e!=null){try{return fxe.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var gxe=/[\\^$.*+?()[\]{}|]/g,mxe=/^\[object .+?Constructor\]$/,vxe=Function.prototype,yxe=Object.prototype,bxe=vxe.toString,xxe=yxe.hasOwnProperty,wxe=RegExp("^"+bxe.call(xxe).replace(gxe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Cxe(e){if(!po(e)||hxe(e))return!1;var t=yu(e)?wxe:mxe;return t.test(tp(e))}function _xe(e,t){return e==null?void 0:e[t]}function rp(e,t){var r=_xe(e,t);return Cxe(r)?r:void 0}var Jv=rp(No,"Map"),ey=rp(Object,"create");function Sxe(){this.__data__=ey?ey(null):{},this.size=0}function kxe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Mxe="__lodash_hash_undefined__",Txe=Object.prototype,Axe=Txe.hasOwnProperty;function Exe(e){var t=this.__data__;if(ey){var r=t[e];return r===Mxe?void 0:r}return Axe.call(t,e)?t[e]:void 0}var Pxe=Object.prototype,Dxe=Pxe.hasOwnProperty;function Lxe(e){var t=this.__data__;return ey?t[e]!==void 0:Dxe.call(t,e)}var Oxe="__lodash_hash_undefined__";function Ixe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ey&&t===void 0?Oxe:t,this}function np(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}np.prototype.clear=Sxe,np.prototype.delete=kxe,np.prototype.get=Exe,np.prototype.has=Lxe,np.prototype.set=Ixe;function Nxe(){this.size=0,this.__data__={hash:new np,map:new(Jv||vu),string:new np}}function Rxe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function qC(e,t){var r=e.__data__;return Rxe(t)?r[typeof t=="string"?"string":"hash"]:r.map}function Fxe(e){var t=qC(this,e).delete(e);return this.size-=t?1:0,t}function jxe(e){return qC(this,e).get(e)}function Bxe(e){return qC(this,e).has(e)}function zxe(e,t){var r=qC(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function bu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}bu.prototype.clear=Nxe,bu.prototype.delete=Fxe,bu.prototype.get=jxe,bu.prototype.has=Bxe,bu.prototype.set=zxe;var $xe=200;function Wxe(e,t){var r=this.__data__;if(r instanceof vu){var n=r.__data__;if(!Jv||n.length<$xe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new bu(n)}return r.set(e,t),this.size=r.size,this}function El(e){var t=this.__data__=new vu(e);this.size=t.size}El.prototype.clear=Z1e,El.prototype.delete=X1e,El.prototype.get=K1e,El.prototype.has=Q1e,El.prototype.set=Wxe;function R7(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var ZC=function(){try{var e=rp(Object,"defineProperty");return e({},"",{}),e}catch(t){}}();function ty(e,t,r){t=="__proto__"&&ZC?ZC(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Hxe=Object.prototype,Uxe=Hxe.hasOwnProperty;function W3(e,t,r){var n=e[t];(!(Uxe.call(e,t)&&Kv(n,r))||r===void 0&&!(t in e))&&ty(e,t,r)}function bg(e,t,r,n){var i=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=void 0;l===void 0&&(l=e[s]),i?ty(r,s,l):W3(r,s,l)}return r}function Gxe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Jo(e){return e!=null&&typeof e=="object"}var Vxe="[object Arguments]";function F7(e){return Jo(e)&&Al(e)==Vxe}var j7=Object.prototype,Yxe=j7.hasOwnProperty,qxe=j7.propertyIsEnumerable,ry=F7(function(){return arguments}())?F7:function(e){return Jo(e)&&Yxe.call(e,"callee")&&!qxe.call(e,"callee")},vn=Array.isArray;function Zxe(){return!1}var B7=typeof Ge=="object"&&Ge&&!Ge.nodeType&&Ge,z7=B7&&typeof module=="object"&&module&&!module.nodeType&&module,Xxe=z7&&z7.exports===B7,$7=Xxe?No.Buffer:void 0,Kxe=$7?$7.isBuffer:void 0,ny=Kxe||Zxe,Qxe=9007199254740991,Jxe=/^(?:0|[1-9]\d*)$/;function iy(e,t){var r=typeof e;return t=t==null?Qxe:t,!!t&&(r=="number"||r!="symbol"&&Jxe.test(e))&&e>-1&&e%1==0&&e<t}var ewe=9007199254740991;function H3(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ewe}var twe="[object Arguments]",rwe="[object Array]",nwe="[object Boolean]",iwe="[object Date]",owe="[object Error]",awe="[object Function]",swe="[object Map]",lwe="[object Number]",cwe="[object Object]",uwe="[object RegExp]",dwe="[object Set]",hwe="[object String]",pwe="[object WeakMap]",fwe="[object ArrayBuffer]",gwe="[object DataView]",mwe="[object Float32Array]",vwe="[object Float64Array]",ywe="[object Int8Array]",bwe="[object Int16Array]",xwe="[object Int32Array]",wwe="[object Uint8Array]",Cwe="[object Uint8ClampedArray]",_we="[object Uint16Array]",Swe="[object Uint32Array]",Yn={};Yn[mwe]=Yn[vwe]=Yn[ywe]=Yn[bwe]=Yn[xwe]=Yn[wwe]=Yn[Cwe]=Yn[_we]=Yn[Swe]=!0,Yn[twe]=Yn[rwe]=Yn[fwe]=Yn[nwe]=Yn[gwe]=Yn[iwe]=Yn[owe]=Yn[awe]=Yn[swe]=Yn[lwe]=Yn[cwe]=Yn[uwe]=Yn[dwe]=Yn[hwe]=Yn[pwe]=!1;function kwe(e){return Jo(e)&&H3(e.length)&&!!Yn[Al(e)]}function oy(e){return function(t){return e(t)}}var W7=typeof Ge=="object"&&Ge&&!Ge.nodeType&&Ge,ay=W7&&typeof module=="object"&&module&&!module.nodeType&&module,Mwe=ay&&ay.exports===W7,U3=Mwe&&L7.process,Sd=function(){try{var e=ay&&ay.require&&ay.require("util").types;return e||U3&&U3.binding&&U3.binding("util")}catch(t){}}(),H7=Sd&&Sd.isTypedArray,G3=H7?oy(H7):kwe,Twe=Object.prototype,Awe=Twe.hasOwnProperty;function U7(e,t){var r=vn(e),n=!r&&ry(e),i=!r&&!n&&ny(e),o=!r&&!n&&!i&&G3(e),a=r||n||i||o,s=a?Gxe(e.length,String):[],l=s.length;for(var c in e)(t||Awe.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||iy(c,l)))&&s.push(c);return s}var Ewe=Object.prototype;function V3(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Ewe;return e===r}function G7(e,t){return function(r){return e(t(r))}}var Pwe=G7(Object.keys,Object),Dwe=Object.prototype,Lwe=Dwe.hasOwnProperty;function Owe(e){if(!V3(e))return Pwe(e);var t=[];for(var r in Object(e))Lwe.call(e,r)&&r!="constructor"&&t.push(r);return t}function sy(e){return e!=null&&H3(e.length)&&!yu(e)}function ly(e){return sy(e)?U7(e):Owe(e)}function Iwe(e,t){return e&&bg(t,ly(t),e)}function Nwe(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}var Rwe=Object.prototype,Fwe=Rwe.hasOwnProperty;function jwe(e){if(!po(e))return Nwe(e);var t=V3(e),r=[];for(var n in e)n=="constructor"&&(t||!Fwe.call(e,n))||r.push(n);return r}function cy(e){return sy(e)?U7(e,!0):jwe(e)}function Bwe(e,t){return e&&bg(t,cy(t),e)}var V7=typeof Ge=="object"&&Ge&&!Ge.nodeType&&Ge,Y7=V7&&typeof module=="object"&&module&&!module.nodeType&&module,zwe=Y7&&Y7.exports===V7,q7=zwe?No.Buffer:void 0,Z7=q7?q7.allocUnsafe:void 0;function X7(e,t){if(t)return e.slice();var r=e.length,n=Z7?Z7(r):new e.constructor(r);return e.copy(n),n}function XC(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function $we(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function K7(){return[]}var Wwe=Object.prototype,Hwe=Wwe.propertyIsEnumerable,Q7=Object.getOwnPropertySymbols,Y3=Q7?function(e){return e==null?[]:(e=Object(e),$we(Q7(e),function(t){return Hwe.call(e,t)}))}:K7;function Uwe(e,t){return bg(e,Y3(e),t)}function q3(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Z3=G7(Object.getPrototypeOf,Object),Gwe=Object.getOwnPropertySymbols,J7=Gwe?function(e){for(var t=[];e;)q3(t,Y3(e)),e=Z3(e);return t}:K7;function Vwe(e,t){return bg(e,J7(e),t)}function e$(e,t,r){var n=t(e);return vn(e)?n:q3(n,r(e))}function X3(e){return e$(e,ly,Y3)}function K3(e){return e$(e,cy,J7)}var Q3=rp(No,"DataView"),J3=rp(No,"Promise"),xg=rp(No,"Set"),uy=rp(No,"WeakMap"),t$="[object Map]",Ywe="[object Object]",r$="[object Promise]",n$="[object Set]",i$="[object WeakMap]",o$="[object DataView]",qwe=tp(Q3),Zwe=tp(Jv),Xwe=tp(J3),Kwe=tp(xg),Qwe=tp(uy),Pl=Al;(Q3&&Pl(new Q3(new ArrayBuffer(1)))!=o$||Jv&&Pl(new Jv)!=t$||J3&&Pl(J3.resolve())!=r$||xg&&Pl(new xg)!=n$||uy&&Pl(new uy)!=i$)&&(Pl=function(e){var t=Al(e),r=t==Ywe?e.constructor:void 0,n=r?tp(r):"";if(n)switch(n){case qwe:return o$;case Zwe:return t$;case Xwe:return r$;case Kwe:return n$;case Qwe:return i$}return t});var Jwe=Object.prototype,eCe=Jwe.hasOwnProperty;function tCe(e){var t=e.length,r=new e.constructor(t);return t&&typeof e[0]=="string"&&eCe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}var KC=No.Uint8Array;function eD(e){var t=new e.constructor(e.byteLength);return new KC(t).set(new KC(e)),t}function rCe(e,t){var r=t?eD(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}var nCe=/\w*$/;function iCe(e){var t=new e.constructor(e.source,nCe.exec(e));return t.lastIndex=e.lastIndex,t}var a$=js?js.prototype:void 0,s$=a$?a$.valueOf:void 0;function oCe(e){return s$?Object(s$.call(e)):{}}function l$(e,t){var r=t?eD(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}var aCe="[object Boolean]",sCe="[object Date]",lCe="[object Map]",cCe="[object Number]",uCe="[object RegExp]",dCe="[object Set]",hCe="[object String]",pCe="[object Symbol]",fCe="[object ArrayBuffer]",gCe="[object DataView]",mCe="[object Float32Array]",vCe="[object Float64Array]",yCe="[object Int8Array]",bCe="[object Int16Array]",xCe="[object Int32Array]",wCe="[object Uint8Array]",CCe="[object Uint8ClampedArray]",_Ce="[object Uint16Array]",SCe="[object Uint32Array]";function kCe(e,t,r){var n=e.constructor;switch(t){case fCe:return eD(e);case aCe:case sCe:return new n(+e);case gCe:return rCe(e,r);case mCe:case vCe:case yCe:case bCe:case xCe:case wCe:case CCe:case _Ce:case SCe:return l$(e,r);case lCe:return new n;case cCe:case hCe:return new n(e);case uCe:return iCe(e);case dCe:return new n;case pCe:return oCe(e)}}var c$=Object.create,QC=function(){function e(){}return function(t){if(!po(t))return{};if(c$)return c$(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function u$(e){return typeof e.constructor=="function"&&!V3(e)?QC(Z3(e)):{}}var MCe="[object Map]";function TCe(e){return Jo(e)&&Pl(e)==MCe}var d$=Sd&&Sd.isMap,ACe=d$?oy(d$):TCe,ECe="[object Set]";function PCe(e){return Jo(e)&&Pl(e)==ECe}var h$=Sd&&Sd.isSet,DCe=h$?oy(h$):PCe,LCe=1,OCe=2,ICe=4,p$="[object Arguments]",NCe="[object Array]",RCe="[object Boolean]",FCe="[object Date]",jCe="[object Error]",f$="[object Function]",BCe="[object GeneratorFunction]",zCe="[object Map]",$Ce="[object Number]",g$="[object Object]",WCe="[object RegExp]",HCe="[object Set]",UCe="[object String]",GCe="[object Symbol]",VCe="[object WeakMap]",YCe="[object ArrayBuffer]",qCe="[object DataView]",ZCe="[object Float32Array]",XCe="[object Float64Array]",KCe="[object Int8Array]",QCe="[object Int16Array]",JCe="[object Int32Array]",e_e="[object Uint8Array]",t_e="[object Uint8ClampedArray]",r_e="[object Uint16Array]",n_e="[object Uint32Array]",Nn={};Nn[p$]=Nn[NCe]=Nn[YCe]=Nn[qCe]=Nn[RCe]=Nn[FCe]=Nn[ZCe]=Nn[XCe]=Nn[KCe]=Nn[QCe]=Nn[JCe]=Nn[zCe]=Nn[$Ce]=Nn[g$]=Nn[WCe]=Nn[HCe]=Nn[UCe]=Nn[GCe]=Nn[e_e]=Nn[t_e]=Nn[r_e]=Nn[n_e]=!0,Nn[jCe]=Nn[f$]=Nn[VCe]=!1;function wg(e,t,r,n,i,o){var a,s=t&LCe,l=t&OCe,c=t&ICe;if(r&&(a=i?r(e,n,i,o):r(e)),a!==void 0)return a;if(!po(e))return e;var d=vn(e);if(d){if(a=tCe(e),!s)return XC(e,a)}else{var h=Pl(e),u=h==f$||h==BCe;if(ny(e))return X7(e,s);if(h==g$||h==p$||u&&!i){if(a=l||u?{}:u$(e),!s)return l?Vwe(e,Bwe(a,e)):Uwe(e,Iwe(a,e))}else{if(!Nn[h])return i?e:{};a=kCe(e,h,s)}}o||(o=new El);var g=o.get(e);if(g)return g;o.set(e,a),DCe(e)?e.forEach(function(x){a.add(wg(x,t,r,x,e,o))}):ACe(e)&&e.forEach(function(x,S){a.set(S,wg(x,t,r,S,e,o))});var f=c?l?K3:X3:l?cy:ly,p=d?void 0:f(e);return R7(p||e,function(x,S){p&&(S=x,x=e[S]),W3(a,S,wg(x,t,r,S,e,o))}),a}var i_e=1,o_e=4;function ki(e){return wg(e,i_e|o_e)}function a_e(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var l=a[++i];if(r(o[l],l,o)===!1)break}return t}}var m$=a_e();function tD(e,t){return e&&m$(e,t,ly)}var s_e="__lodash_hash_undefined__";function l_e(e){return this.__data__.set(e,s_e),this}function c_e(e){return this.__data__.has(e)}function dy(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new bu;++t<r;)this.add(e[t])}dy.prototype.add=dy.prototype.push=l_e,dy.prototype.has=c_e;function u_e(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function v$(e,t){return e.has(t)}var d_e=1,h_e=2;function y$(e,t,r,n,i,o){var a=r&d_e,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(e),d=o.get(t);if(c&&d)return c==t&&d==e;var h=-1,u=!0,g=r&h_e?new dy:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var f=e[h],p=t[h];if(n)var x=a?n(p,f,h,t,e,o):n(f,p,h,e,t,o);if(x!==void 0){if(x)continue;u=!1;break}if(g){if(!u_e(t,function(S,j){if(!v$(g,j)&&(f===S||i(f,S,r,n,o)))return g.push(j)})){u=!1;break}}else if(!(f===p||i(f,p,r,n,o))){u=!1;break}}return o.delete(e),o.delete(t),u}function p_e(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function rD(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var f_e=1,g_e=2,m_e="[object Boolean]",v_e="[object Date]",y_e="[object Error]",b_e="[object Map]",x_e="[object Number]",w_e="[object RegExp]",C_e="[object Set]",__e="[object String]",S_e="[object Symbol]",k_e="[object ArrayBuffer]",M_e="[object DataView]",b$=js?js.prototype:void 0,nD=b$?b$.valueOf:void 0;function T_e(e,t,r,n,i,o,a){switch(r){case M_e:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case k_e:return!(e.byteLength!=t.byteLength||!o(new KC(e),new KC(t)));case m_e:case v_e:case x_e:return Kv(+e,+t);case y_e:return e.name==t.name&&e.message==t.message;case w_e:case __e:return e==t+"";case b_e:var s=p_e;case C_e:var l=n&f_e;if(s||(s=rD),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=g_e,a.set(e,t);var d=y$(s(e),s(t),n,i,o,a);return a.delete(e),d;case S_e:if(nD)return nD.call(e)==nD.call(t)}return!1}var A_e=1,E_e=Object.prototype,P_e=E_e.hasOwnProperty;function D_e(e,t,r,n,i,o){var a=r&A_e,s=X3(e),l=s.length,c=X3(t),d=c.length;if(l!=d&&!a)return!1;for(var h=l;h--;){var u=s[h];if(!(a?u in t:P_e.call(t,u)))return!1}var g=o.get(e),f=o.get(t);if(g&&f)return g==t&&f==e;var p=!0;o.set(e,t),o.set(t,e);for(var x=a;++h<l;){u=s[h];var S=e[u],j=t[u];if(n)var U=a?n(j,S,u,t,e,o):n(S,j,u,e,t,o);if(!(U===void 0?S===j||i(S,j,r,n,o):U)){p=!1;break}x||(x=u=="constructor")}if(p&&!x){var B=e.constructor,R=t.constructor;B!=R&&"constructor"in e&&"constructor"in t&&!(typeof B=="function"&&B instanceof B&&typeof R=="function"&&R instanceof R)&&(p=!1)}return o.delete(e),o.delete(t),p}var L_e=1,x$="[object Arguments]",w$="[object Array]",JC="[object Object]",O_e=Object.prototype,C$=O_e.hasOwnProperty;function I_e(e,t,r,n,i,o){var a=vn(e),s=vn(t),l=a?w$:Pl(e),c=s?w$:Pl(t);l=l==x$?JC:l,c=c==x$?JC:c;var d=l==JC,h=c==JC,u=l==c;if(u&&ny(e)){if(!ny(t))return!1;a=!0,d=!1}if(u&&!d)return o||(o=new El),a||G3(e)?y$(e,t,r,n,i,o):T_e(e,t,l,r,n,i,o);if(!(r&L_e)){var g=d&&C$.call(e,"__wrapped__"),f=h&&C$.call(t,"__wrapped__");if(g||f){var p=g?e.value():e,x=f?t.value():t;return o||(o=new El),i(p,x,r,n,o)}}return u?(o||(o=new El),D_e(e,t,r,n,i,o)):!1}function hy(e,t,r,n,i){return e===t?!0:e==null||t==null||!Jo(e)&&!Jo(t)?e!==e&&t!==t:I_e(e,t,r,n,hy,i)}var N_e=1,R_e=2;function F_e(e,t,r,n){var i=r.length,o=i;if(e==null)return!o;for(e=Object(e);i--;){var a=r[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=r[i];var s=a[0],l=e[s],c=a[1];if(a[2]){if(l===void 0&&!(s in e))return!1}else{var d=new El,h;if(!(h===void 0?hy(c,l,N_e|R_e,n,d):h))return!1}}return!0}function _$(e){return e===e&&!po(e)}function j_e(e){for(var t=ly(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,_$(i)]}return t}function S$(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function B_e(e){var t=j_e(e);return t.length==1&&t[0][2]?S$(t[0][0],t[0][1]):function(r){return r===e||F_e(r,e,t)}}var z_e="[object Symbol]";function e_(e){return typeof e=="symbol"||Jo(e)&&Al(e)==z_e}var $_e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W_e=/^\w*$/;function iD(e,t){if(vn(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||e_(e)?!0:W_e.test(e)||!$_e.test(e)||t!=null&&e in Object(t)}var H_e="Expected a function";function oD(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(H_e);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(oD.Cache||bu),r}oD.Cache=bu;var U_e=500;function G_e(e){var t=oD(e,function(n){return r.size===U_e&&r.clear(),n}),r=t.cache;return t}var V_e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y_e=/\\(\\)?/g,q_e=G_e(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(V_e,function(r,n,i,o){t.push(i?o.replace(Y_e,"$1"):n||r)}),t});function py(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Z_e=1/0,k$=js?js.prototype:void 0,M$=k$?k$.toString:void 0;function aD(e){if(typeof e=="string")return e;if(vn(e))return py(e,aD)+"";if(e_(e))return M$?M$.call(e):"";var t=e+"";return t=="0"&&1/e==-Z_e?"-0":t}function kd(e){return e==null?"":aD(e)}function Cg(e,t){return vn(e)?e:iD(e,t)?[e]:q_e(kd(e))}var X_e=1/0;function _g(e){if(typeof e=="string"||e_(e))return e;var t=e+"";return t=="0"&&1/e==-X_e?"-0":t}function t_(e,t){t=Cg(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[_g(t[r++])];return r&&r==n?e:void 0}function Md(e,t,r){var n=e==null?void 0:t_(e,t);return n===void 0?r:n}function K_e(e,t){return e!=null&&t in Object(e)}function Q_e(e,t,r){t=Cg(t,e);for(var n=-1,i=t.length,o=!1;++n<i;){var a=_g(t[n]);if(!(o=e!=null&&r(e,a)))break;e=e[a]}return o||++n!=i?o:(i=e==null?0:e.length,!!i&&H3(i)&&iy(a,i)&&(vn(e)||ry(e)))}function T$(e,t){return e!=null&&Q_e(e,t,K_e)}var J_e=1,eSe=2;function tSe(e,t){return iD(e)&&_$(t)?S$(_g(e),t):function(r){var n=Md(r,e);return n===void 0&&n===t?T$(r,e):hy(t,n,J_e|eSe)}}function r_(e){return e}function rSe(e){return function(t){return t==null?void 0:t[e]}}function nSe(e){return function(t){return t_(t,e)}}function iSe(e){return iD(e)?rSe(_g(e)):nSe(e)}function ip(e){return typeof e=="function"?e:e==null?r_:typeof e=="object"?vn(e)?tSe(e[0],e[1]):B_e(e):iSe(e)}function oSe(e,t){var r={};return t=ip(t),tD(e,function(n,i,o){ty(r,i,t(n,i,o))}),r}function aSe(e){for(var t=e.length,r=5381,n=52711,i;t--;)i=e.charCodeAt(t),r=r*33^i,n=n*33^i;return(r>>>0)*4096+(n>>>0)}var fy="|",sSe=/\[object ([HTML|SVG](.*)Element)\]/,lSe={"[object Arguments]":0,"[object Array]":1,"[object ArrayBuffer]":2,"[object AsyncFunction]":3,"[object AsyncGeneratorFunction]":4,"[object BigInt]":5,"[object BigInt64Array]":6,"[object BigUint64Array]":7,"[object Boolean]":8,"[object DataView]":9,"[object Date]":10,"[object DocumentFragment]":11,"[object Error]":12,"[object Event]":13,"[object Float32Array]":14,"[object Float64Array]":15,"[object Function]":16,"[object Generator]":17,"[object GeneratorFunction]":18,"[object Int8Array]":19,"[object Int16Array]":20,"[object Map]":21,"[object Number]":22,"[object Object]":23,"[object Promise]":24,"[object RegExp]":25,"[object Set]":26,"[object SharedArrayBuffer]":27,"[object String]":28,"[object Uint8Array]":29,"[object Uint8ClampedArray]":30,"[object Uint16Array]":31,"[object Uint32Array]":32,"[object WeakMap]":33,"[object WeakRef]":34,"[object WeakSet]":35,CUSTOM:36,ELEMENT:37},cSe={"[object Arguments]":1,"[object Array]":2},A$={"[object Generator]":1,"[object Promise]":2,"[object WeakMap]":3,"[object WeakRef]":4,"[object WeakSet]":5},uSe={"[object AsyncFunction]":1,"[object AsyncGeneratorFunction]":2,"[object Boolean]":3,"[object Function]":4,"[object GeneratorFunction]":5,"[object Number]":6,"[object String]":7},dSe={"[object BigInt64Array]":1,"[object BigUint64Array]":2,"[object Float32Array]":3,"[object Float64Array]":4,"[object Int8Array]":5,"[object Int16Array]":6,"[object Uint8Array]":7,"[object Uint8ClampedArray]":8,"[object Uint16Array]":9,"[object Uint32Array]":10},hSe={"[object Arguments]":1,"[object Array]":2,"[object ArrayBuffer]":3,"[object BigInt64Array]":4,"[object BigUint64Array]":5,"[object DataView]":6,"[object Float32Array]":7,"[object Float64Array]":8,"[object Int8Array]":9,"[object Int16Array]":10,"[object Map]":11,"[object Object]":12,"[object Set]":13,"[object SharedArrayBuffer]":14,"[object Uint8Array]":15,"[object Uint8ClampedArray]":16,"[object Uint16Array]":17,"[object Uint32Array]":18,CUSTOM:19},gy={bigint:"i",boolean:"b",empty:"e",function:"g",number:"n",object:"o",string:"s",symbol:"s"};function pSe(e,t){return e[0]>t[0]}function E$(e,t){return e>t}function sD(e,t){for(var r,n,i=0;i<e.length;++i){for(n=e[i],r=i-1;~r&&t(e[r],n);--r)e[r+1]=e[r];e[r+1]=n}return e}function fo(e,t){return gy.object+fy+lSe[e]+fy+t}var P$=new WeakMap,fSe=0;function lD(e,t){var r=P$.get(e);if(r)return r;var n=fo(t,"NOT_ENUMERABLE"+fy+fSe++);return P$.set(e,n),n}var gSe=Object.prototype.toString;function mSe(e,t,r){if(hSe[t])return D$(t,e,r);if(t==="[object Date]")return fo(t,e.getTime());if(t==="[object RegExp]")return fo(t,e.toString());if(t==="[object Event]")return fo(t,[e.bubbles,e.cancelBubble,e.cancelable,e.composed,e.currentTarget,e.defaultPrevented,e.eventPhase,e.isTrusted,e.returnValue,e.target,e.type].join());if(t==="[object Error]")return fo(t,e.message+fy+e.stack);if(t==="[object DocumentFragment]")return fo(t,wSe(e));var n=t.match(sSe);return n?fo("ELEMENT",n[1]+fy+e.outerHTML):A$[t]?lD(e,t):uSe[t]?fo(t,e.toString()):D$("CUSTOM",e,r)}function D$(e,t,r){var n=r.cache.get(t);return n?fo(e,"RECURSIVE~"+n):(r.cache.set(t,++r.id),e==="[object Object]"?t[Symbol.iterator]?lD(t,e):fo(e,O$(t,r)):cSe[e]?fo(e,vSe(t,r)):e==="[object Map]"?fo(e,CSe(t,r)):e==="[object Set]"?fo(e,_Se(t,r)):dSe[e]?fo(e,t.join()):e==="[object ArrayBuffer]"?fo(e,L$(t)):e==="[object DataView]"?fo(e,L$(t.buffer)):A$[e]?lD(t,e):fo("CUSTOM",O$(t,r)))}function vSe(e,t){for(var r=e.length,n=new Array(r);--r>=0;)n[r]=Sg(e[r],t);return n.join()}function ySe(e){return Buffer.from(e).toString("utf8")}function bSe(e){return String.fromCharCode.apply(null,new Uint16Array(e))}function xSe(){return"UNSUPPORTED"}function wSe(e){for(var t=e.children,r=t.length,n=new Array(r);--r>=0;)n[r]=t[r].outerHTML;return n.join()}var L$=typeof Buffer!="undefined"&&typeof Buffer.from=="function"?ySe:typeof Uint16Array=="function"?bSe:xSe;function CSe(e,t){var r=new Array(e.size),n=0;for(e.forEach(function(i,o){r[n++]=[Sg(o,t),Sg(i,t)]}),sD(r,pSe);--n>=0;)r[n]="["+r[n][0]+","+r[n][1]+"]";return"["+r.join()+"]"}function O$(e,t){for(var r=sD(Object.getOwnPropertyNames(e),E$),n=r.length,i=new Array(n),o=n;--o>=0;)i[o]=r[o]+":"+Sg(e[r[o]],t);return"{"+i.join()+"}"}function _Se(e,t){var r=new Array(e.size),n=0;return e.forEach(function(i){r[n++]=Sg(i,t)}),"["+sD(r,E$).join()+"]"}function Sg(e,t){var r=typeof e;return e==null||r==="undefined"?gy.empty+e:r==="object"?mSe(e,gSe.call(e),t||{cache:new WeakMap,id:1}):r==="function"||r==="symbol"?gy[r]+e.toString():r==="boolean"?gy.boolean+ +e:gy[r]+e}function I$(e){return aSe(Sg(e,void 0))}function cD(e,t,r){(r!==void 0&&!Kv(e[t],r)||r===void 0&&!(t in e))&&ty(e,t,r)}function N$(e){return Jo(e)&&sy(e)}var SSe="[object Object]",kSe=Function.prototype,MSe=Object.prototype,R$=kSe.toString,TSe=MSe.hasOwnProperty,ASe=R$.call(Object);function F$(e){if(!Jo(e)||Al(e)!=SSe)return!1;var t=Z3(e);if(t===null)return!0;var r=TSe.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&R$.call(r)==ASe}function uD(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function ESe(e){return bg(e,cy(e))}function PSe(e,t,r,n,i,o,a){var s=uD(e,r),l=uD(t,r),c=a.get(l);if(c){cD(e,r,c);return}var d=o?o(s,l,r+"",e,t,a):void 0,h=d===void 0;if(h){var u=vn(l),g=!u&&ny(l),f=!u&&!g&&G3(l);d=l,u||g||f?vn(s)?d=s:N$(s)?d=XC(s):g?(h=!1,d=X7(l,!0)):f?(h=!1,d=l$(l,!0)):d=[]:F$(l)||ry(l)?(d=s,ry(s)?d=ESe(s):(!po(s)||yu(s))&&(d=u$(l))):h=!1}h&&(a.set(l,d),i(d,l,n,o,a),a.delete(l)),cD(e,r,d)}function dD(e,t,r,n,i){e!==t&&m$(t,function(o,a){if(i||(i=new El),po(o))PSe(e,t,a,r,dD,n,i);else{var s=n?n(uD(e,a),o,a+"",e,t,i):void 0;s===void 0&&(s=o),cD(e,a,s)}},cy)}function n_(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var j$=Math.max;function B$(e,t,r){return t=j$(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=j$(n.length-t,0),a=Array(o);++i<o;)a[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(a),n_(e,this,s)}}function DSe(e){return function(){return e}}var LSe=ZC?function(e,t){return ZC(e,"toString",{configurable:!0,enumerable:!1,value:DSe(t),writable:!0})}:r_,OSe=800,ISe=16,NSe=Date.now;function z$(e){var t=0,r=0;return function(){var n=NSe(),i=ISe-(n-r);if(r=n,i>0){if(++t>=OSe)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var hD=z$(LSe);function i_(e,t){return hD(B$(e,t,r_),e+"")}function $$(e,t,r){if(!po(r))return!1;var n=typeof t;return(n=="number"?sy(r)&&iy(t,r.length):n=="string"&&t in r)?Kv(r[t],e):!1}function W$(e){return i_(function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&$$(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,o)}return t})}var pD=W$(function(e,t,r){dD(e,t,r)});function fD(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function H$(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(i);++n<i;)o[n]=e[n+t];return o}function RSe(e,t){return t.length<2?e:t_(e,H$(t,0,-1))}function FSe(e,t){return t=Cg(t,e),e=RSe(e,t),e==null||delete e[_g(fD(t))]}function jSe(e){return F$(e)?void 0:e}var U$=js?js.isConcatSpreadable:void 0;function BSe(e){return vn(e)||ry(e)||!!(U$&&e&&e[U$])}function G$(e,t,r,n,i){var o=-1,a=e.length;for(r||(r=BSe),i||(i=[]);++o<a;){var s=e[o];r(s)?q3(i,s):n||(i[i.length]=s)}return i}function zSe(e){var t=e==null?0:e.length;return t?G$(e):[]}function o_(e){return hD(B$(e,void 0,zSe),e+"")}var $Se=1,WSe=2,HSe=4,a_=o_(function(e,t){var r={};if(e==null)return r;var n=!1;t=py(t,function(o){return o=Cg(o,e),n||(n=o.length>1),o}),bg(e,K3(e),r),n&&(r=wg(r,$Se|WSe|HSe,jSe));for(var i=t.length;i--;)FSe(r,t[i]);return r});let my=class extends Xv{constructor(t,r){super(D7,{key:t,interpolationOptions:r},$1e.t)}};class kg{constructor(t,r,n,i,o){this._name=t,this.type=r,this.description=n||"",i&&(this._dataSource=i),o&&(this.composeCode=o)}get name(){return this._name}set name(t){this._name=t}get dataSource(){return this._dataSource}serialize(){return{name:this.name,type:this.type,description:this.description,dataSource:this.dataSource,composeCode:this.composeCode,__serializable:"DimensionalElement"}}toJSON(){return this.serialize()}toString(){return this.jaql()}}function pc(e){let t=e.replace(/[^a-zA-Z0-9_.]/g,"").replace(/\./g,"_");return t.charAt(0).match(/[0-9]/)&&(t="_"+t),t}const gD="DM",wr={Sum:"sum",Average:"avg",Min:"min",Max:"max",Count:"count",CountDistinct:"countDistinct",Median:"median",Variance:"var",StandardDeviation:"stdev"};var Br;(function(e){e[e.None=0]="None",e[e.Ascending=1]="Ascending",e[e.Descending=2]="Descending"})(Br=Br||(Br={}));const It={Measure:"measure",MeasureTemplate:"measuretemplate",BaseMeasure:"basemeasure",CalculatedMeasure:"calculatedmeasure",Dimension:"dimension",DateDimension:"datedimension",TextDimension:"textdimension",NumericDimension:"numericdimension",DateLevel:"datelevel",Attribute:"attribute",TextAttribute:"text-attribute",NumericAttribute:"numeric-attribute",Filter:"filter",DimensionFilter:"dimensionfilter",MeasureFilter:"measurefilter",isMetadata(e){return It.isMeasure(e)||It.isDimension(e)||It.isAttribute(e)||It.isFilter(e)},isMeasureTemplate(e){return e?typeof e=="string"?e.toLowerCase()===It.MeasureTemplate:e.agg==="*"||e.aggregation==="*"||e.type&&e.type.toLowerCase()===It.MeasureTemplate:!1},isBaseMeasure(e){return e?typeof e=="string"?e.toLowerCase()===It.BaseMeasure:(e.agg||e.aggregation)&&(e.attribute||e.jaql)&&!this.isMeasureTemplate(e):!1},isMeasure(e){if(!e)return!1;if(typeof e=="string"){const t=e;return t.toLowerCase()===It.Measure||t.toLowerCase()===It.BaseMeasure||t.toLowerCase()===It.MeasureTemplate||t.toLowerCase()===It.CalculatedMeasure}return this.isBaseMeasure(e)||this.isCalculatedMeasure(e)||this.isMeasureTemplate(e)},isCalculatedMeasure(e){return e?typeof e=="string"?e.toLowerCase()===It.CalculatedMeasure:(e.expression||e.formula)&&e.context:!1},isDateDimension(e){return e?typeof e=="string"?e.toLowerCase()===It.DateDimension:(e.dim||e.expression)&&e.level:!1},isTextDimension(e){return e&&typeof e=="string"?e.toLowerCase()===It.TextDimension:!1},isNumericDimension(e){return e&&typeof e=="string"?e.toLowerCase()===It.NumericDimension:!1},isDimension(e){if(e&&typeof e=="object"&&(e=e.type),typeof e=="string"){const t=e;return t.toLowerCase()===It.DateDimension||t.toLowerCase()===It.Dimension||t.toLowerCase()===It.TextDimension||t.toLowerCase()===It.NumericDimension}return!1},isAttribute(e){if(typeof e=="string"){const t=e;return t.toLowerCase()===It.Attribute||t.toLowerCase()===It.TextAttribute||t.toLowerCase()===It.NumericAttribute||t.toLowerCase()===It.DateLevel}return e&&e.type?this.isAttribute(e.type):!1},isFilter(e){if(e&&typeof e=="object"&&(e=e.type),typeof e=="string"){const t=e;return t.toLowerCase()===It.Filter||t.toLowerCase()===It.DimensionFilter||t.toLowerCase()===It.MeasureFilter}return!1}},Ze={Years:"Years",Quarters:"Quarters",Months:"Months",Weeks:"Weeks",Days:"Days",Hours:"Hours",MinutesRoundTo30:"MinutesRoundTo30",MinutesRoundTo15:"MinutesRoundTo15",Minutes:"Minutes",Seconds:"Seconds",AggHours:"AggHours",AggMinutesRoundTo30:"AggMinutesRoundTo30",AggMinutesRoundTo15:"AggMinutesRoundTo15",AggMinutesRoundTo1:"AggMinutesRoundTo1",get all(){return[Ze.Years,Ze.Quarters,Ze.Months,Ze.Weeks,Ze.Days,Ze.Hours,Ze.MinutesRoundTo30,Ze.MinutesRoundTo15,Ze.Minutes,Ze.Seconds,Ze.AggHours,Ze.AggMinutesRoundTo30,Ze.AggMinutesRoundTo15,Ze.AggMinutesRoundTo1]}};var s_;(function(e){e.TEXT="text",e.NUMERIC="numeric",e.DATETIME="datetime"})(s_=s_||(s_={}));var vy;(function(e){e.ASC="asc",e.DESC="desc"})(vy=vy||(vy={}));var mD;(function(e){e.PRE="pre",e.POST="post"})(mD=mD||(mD={}));class Td extends kg{constructor(t,r,n,i,o,a,s,l,c,d){if(super(t,o||It.Dimension,a,l,c),this._dimensions=[],this._attributes=[],this._sort=Br.None,!c&&r){const{table:h,column:u}=cp(r);this.composeCode=Ay(h,u,"",gD)}this._sort=s||Br.None,this._expression=r,this.setDimensions(i||[]),this.setAttributes(n),d&&(this.defaultAttribute=d)}static parseType(t){switch(t){case"datetime":case It.DateDimension:return It.DateDimension;case"text":case It.TextDimension:return It.TextDimension;case"numeric":case It.NumericDimension:return It.NumericDimension}return It.TextDimension}getAttachedName(t,r){let n=t;const i=pc(t);return(i==="id"||i==="name"||Object.getOwnPropertyDescriptor(this,i)!==void 0||this[i]!==void 0)&&(n=r),n}setDimensions(t){this._dimensions=t;for(let r=0;r<t.length;r++){const n=this.getAttachedName(t[r].name,t[r].attributes[0].expression);this[pc(n)]=t[r],n!=t[r].name&&(t[r].name=n)}}setAttributes(t){this._attributes=t||[];for(let r=0;r<t.length;r++){const n=this.getAttachedName(t[r].name,t[r].expression);this[pc(n)]=t[r],t[r].name!=n&&(t[r].name=n)}}get id(){return this._expression}get attributes(){return this._attributes}get dimensions(){return this._dimensions}get expression(){return this._expression}getSort(){return this._sort}sort(t){return new Td(this.name,this.expression,this.attributes,this.dimensions,this.type,this.description,t,this.dataSource,this.composeCode,this.defaultAttribute)}serialize(){const t=super.serialize();return t.__serializable="DimensionalDimension",t.expression=this.expression,this.getSort()!==void 0&&(t.sort=this.getSort()),t.attributes=this._attributes.map(r=>r.serialize()),t.dimensions=this._dimensions.map(r=>r.serialize()),this.defaultAttribute&&(t.defaultAttribute=this.defaultAttribute.serialize()),t}jaql(t){if(this.defaultAttribute)return this.defaultAttribute.jaql(t);if(this.dimensions.length>0)return this.dimensions[0].jaql(t);const r={jaql:{title:this.name,dim:this.expression,datatype:UD(this.type)}};return this._sort!=Br.None&&(r.jaql.sort=this._sort==Br.Ascending?"asc":"desc"),t===!0?r.jaql:r}}class Mg extends Td{constructor(t,r,n,i,o,a){super(t,r,[],[],It.DateDimension,n,i,o,a),this.defaultLevel=Ze.Years,this.Years=new Gr(Ze.Years,r,Ze.Years,"yyyy",n,i,o),this.Quarters=new Gr(Ze.Quarters,r,Ze.Quarters,"Q yyyy",n,i,o),this.Months=new Gr(Ze.Months,r,Ze.Months,"yyyy-MM",n,i,o),this.Weeks=new Gr(Ze.Weeks,r,Ze.Weeks,"ww yyyy",n,i,o),this.Days=new Gr(Ze.Days,r,Ze.Days,"yyyy-MM-dd",n,i,o),this.Hours=new Gr(Ze.Hours,r,Ze.Hours,"yyyy-MM-dd HH:mm",n,i,o),this.MinutesRoundTo30=new Gr(Ze.MinutesRoundTo30,r,Ze.MinutesRoundTo30,"yyyy-MM-dd HH:mm",n,i,o),this.MinutesRoundTo15=new Gr(Ze.MinutesRoundTo15,r,Ze.MinutesRoundTo15,"yyyy-MM-dd HH:mm",n,i,o),this.Minutes=new Gr(Ze.Minutes,r,Ze.Minutes,"yyyy-MM-dd HH:mm",n,i,o),this.Seconds=new Gr(Ze.Seconds,r,Ze.Seconds,"yyyy-MM-dd HH:mm:ss",n,i,o),this.AggHours=new Gr(Ze.AggHours,r,Ze.AggHours,"HH:mm",n,i,o),this.AggMinutesRoundTo30=new Gr(Ze.AggMinutesRoundTo30,r,Ze.AggMinutesRoundTo30,"HH:mm",n,i,o),this.AggMinutesRoundTo15=new Gr(Ze.AggMinutesRoundTo15,r,Ze.AggMinutesRoundTo15,"HH:mm",n,i,o),this.AggMinutesRoundTo1=new Gr(Ze.AggMinutesRoundTo1,r,Ze.AggMinutesRoundTo1,"HH:mm",n,i,o),this.setAttributes([this.Years,this.Quarters,this.Months,this.Weeks,this.Days,this.Hours,this.MinutesRoundTo30,this.MinutesRoundTo15,this.Minutes,this.Seconds,this.AggHours,this.AggMinutesRoundTo30,this.AggMinutesRoundTo15,this.AggMinutesRoundTo1])}get id(){return this.expression}setDimensions(){}setAttributes(t){this._attributes=t}getSort(){return this._sort}sort(t){return new Mg(this.name,this.expression,this.description,t,this.dataSource,this.composeCode)}serialize(){const t=super.serialize();return t.__serializable="DimensionalDateDimension",t}jaql(t){const r=this[this.defaultLevel].jaql();return r.jaql.title=this.name,t?r.jaql:r}}function V$(e){const t=e.name||e.title,r=e.desc||e.description,n=e.expression||e.dim,i=Td.parseType(e.dimtype||e.type),o=e.sort,a=e.dataSource;if(i==It.DateDimension)return new Mg(t,n,r,o,a);const s=Object.getOwnPropertyNames(e).map(d=>e[d]).filter(d=>It.isAttribute(d==null?void 0:d.type));if(s.length==0)if(e.attributes){let d;for(let h=0;h<e.attributes.length;h++)d=e.attributes[h],s.push(new xu(d.name,d.expression,d.type,d.description,d.sort,d.dataSource))}else n&&s.push(new xu(t,n,i,r,o,a));const l=Object.getOwnPropertyNames(e).map(d=>e[d]).filter(d=>It.isDimension(d==null?void 0:d.type));if(l.length==0&&e.dimensions)for(let d=0;d<e.dimensions.length;d++)l.push(V$(e.dimensions[d]));const c=new Td(t,n,s,l,i,r,o,a);return e.defaultAttribute&&(c.defaultAttribute=s.find(d=>d.name===e.defaultAttribute)),c}function USe(e){const t=e.name||e.title,r=e.expression||e.dim,n=e.desc||e.description,i=e.sort,o=e.dataSource;return new Mg(t,r,n,i,o)}function GSe(e,t){const r=e.map(i=>VSe(i,t)),n=YSe(r);return Object.values(n).map(i=>V$(i))}const VSe=(e,t)=>{const r=e.table,n=e.tableTitle||r,i=e.id,o=e.title||i,a=Lg(t)?t:{title:t,live:!1},s=e.dimtype==="datetime"?USe({name:o,expression:i,dataSource:a,description:e.description}):xW({name:o,type:e.dimtype==="text"?"text-attribute":"numeric-attribute",expression:i,dataSource:a,description:e.description});return{dimension:{id:r,name:n,description:e.tableDescription},attribute:s}},YSe=e=>e.reduce((t,{dimension:r,attribute:n})=>{const i=t[r.name]||{name:r.name,expression:r.id,description:r.description};return Object.assign(Object.assign({},t),{[r.name]:Object.assign(Object.assign({},i),{[n.name]:n})})},{});function vD(e,t=[]){try{return e==null?String(e):typeof e=="string"?`'${yg(e)}'`:typeof e=="number"||typeof e=="boolean"?String(e):e instanceof Date?`new Date('${e.toISOString()}')`:Array.isArray(e)?`[${e.map(r=>vD(r,t)).join(", ")}]`:typeof e=="object"&&e!==null?"composeCode"in e?e.composeCode:`{ ${Object.entries(e).filter(([n])=>!t.includes(n)).map(([n,i])=>`${/[^a-zA-Z0-9_$]/.test(n)?`'${n}'`:n}: ${vD(i,t)}`).join(", ")} }`:JSON.stringify(e)}catch(r){return console.error(r,JSON.stringify(e,null,2)),JSON.stringify(e)}}function qSe(e){let t=e.length;for(;t>0&&e[t-1]===void 0;)t--;return e.slice(0,t)}function l_(e,t){return function(r){return function(...n){const i=qSe(n),o=i.length,a=i.map(c=>vD(c,["guid"])).filter((c,d)=>!(["","{ }","[]","undefined","null"].includes(c)&&d===o-1)).join(", "),s=`${e}.${t!=null?t:r.name}(${a})`,l=r(...n);return l.composeCode=s,l}}}function Nr(e,t){return l_("filterFactory",t)(e)}function Y$(e,t){return l_("filterFactory.logic",t)(e)}function q$(e,t){return l_("analyticsFactory",t)(e)}function Bs(e,t){return l_("measureFactory",t)(e)}function ZSe(e,t,r){if(typeof r=="number")e.push(r.toString());else if(r&&It.isMeasureTemplate(r.type)){r=r.sum();const n=`[${pc(r.name)}]`;e.push(n),t[n]=r}else if(r&&It.isMeasure(r.type)){const n=`[${pc(r.name)}]`;e.push(n),t[n]=r}else if(r&&It.isFilter(r.type)){const n=`[${pc(r.name)}]`;e.push(n),t[n]=r}else if(r&&It.isAttribute(r.type)){const n=`[${pc(r.name)}]`;e.push(n),t[n]=r}}function Z$(e,t,r,n){const i={},o=[r+"("];return ZSe(o,i,e),n&&o.push(`, ${n}`),o.push(")"),new op(t,o.join(""),i)}const Ro=Bs((e,t,r)=>{const n=Object.fromEntries(Object.entries(r).map(([i,o])=>[i.startsWith("[")?i:`[${i}]`,o]));return new op(e,t,n)},"customFormula"),fc=Bs((e,t,r,n)=>new rs(r!=null?r:`${t.toString()} ${e.name}`,e,t,n),"aggregate"),yD=Bs((e,t,r)=>fc(e,wr.Sum,t,r),"sum"),XSe=Bs((e,t,r)=>fc(e,wr.Average,t,r),"average"),KSe=Bs((e,t,r)=>fc(e,wr.Average,t,r),"avg"),bD=Bs((e,t,r)=>fc(e,wr.Min,t,r),"min"),c_=Bs((e,t,r)=>fc(e,wr.Max,t,r),"max"),xD=Bs((e,t,r)=>fc(e,wr.Median,t,r),"median"),X$=Bs((e,t,r)=>fc(e,wr.Count,t,r),"count"),u_=Bs((e,t,r)=>fc(e,wr.CountDistinct,t,r),"countDistinct"),QSe=Bs((e,t,r)=>{let n;const i=o=>o.replace("advancedSmoothing","smooth").replace("localEstimates","local");return r&&(n=Object.entries(r).map(o=>i(`"${o[0]}=${o[1]}"`)).join(",")),Z$(e,t!=null?t:e.name+" Trend","trend",n)},"trend"),JSe=Bs((e,t,r)=>{let n;if(r){const i=Object.assign({forecastHorizon:3},r);if(i.startDate){const o=new Date(i.startDate);i.startDate=o.toISOString().replace(/.\d+Z$/g,"")}if(i.endDate){const o=new Date(i.endDate);i.endDate=o.toISOString().replace(/.\d+Z$/g,"")}n=Object.entries(i).map(o=>`"${o[0]}=${o[1]}"`).join(",")}else n='"forecastHorizon=3"';return Z$(e,t!=null?t:e.name+" Forecast","forecast",n)},"forecast");class wD extends kg{constructor(t,r,n,i,o,a,s){super(t,r,i,a,s),this._sort=Br.None,this._format="#,#.00",this._format=n,this._sort=o||Br.None}getSort(){return this._sort}getFormat(){return this._format}serialize(){const t=super.serialize();return this.getFormat()!==void 0&&(t.format=this.getFormat()),this.getSort()!==void 0&&(t.sort=this.getSort()),t}}class rs extends wD{constructor(t,r,n,i,o,a,s,l){super(t,It.BaseMeasure,i,o,a,s,l),this.attribute=r,this.aggregation=n}static aggregationFromJAQL(t){switch(t){case"sum":return wr.Sum;case"avg":return wr.Average;case"min":return wr.Min;case"max":return wr.Max;case"countduplicates":return wr.Count;case"median":return wr.Median;case"count":return wr.CountDistinct;case"var":return wr.Variance;case"stdev":return wr.StandardDeviation}return wr.Sum}static aggregationToJAQL(t){switch(t){case wr.Sum:return"sum";case wr.Average:return"avg";case wr.Min:return"min";case wr.Max:return"max";case wr.Count:return"countduplicates";case wr.CountDistinct:return"count";case wr.Median:return"median";case wr.Variance:return"var";case wr.StandardDeviation:return"stdev"}return wr.Sum}sort(t){return new rs(this.name,this.attribute,this.aggregation,this._format,this.description,t,this.dataSource,this.composeCode)}format(t){return new rs(this.name,this.attribute,this.aggregation,t,this.description,this._sort,this.dataSource,this.composeCode)}get id(){return`${this.attribute.expression}_${this.aggregation}`}serialize(){const t=super.serialize();return t.__serializable="DimensionalBaseMeasure",t.aggregation=this.aggregation,t.attribute=this.attribute.serialize(),t}jaql(t){const r=this.attribute.jaql(!0),n={jaql:Object.assign(Object.assign({},r),{title:this.name,agg:rs.aggregationToJAQL(this.aggregation)})};return this._format&&(n.format={number:this._format}),this._sort!=Br.None&&(n.jaql.sort=this._sort==Br.Ascending?"asc":"desc"),t===!0?n.jaql:n}}class op extends wD{constructor(t,r,n,i,o,a,s,l){super(t,It.CalculatedMeasure,i,o,a,s,l),this.expression=r,this.context=n}sort(t){return new op(this.name,this.expression,this.context,this._format,this.description,t,this.dataSource,this.composeCode)}format(t){return new op(this.name,this.expression,this.context,t,this.description,this._sort,this.dataSource,this.composeCode)}get id(){return this.expression}serialize(){const t=super.serialize();return t.__serializable="DimensionalCalculatedMeasure",t.expression=this.expression,t.context=Object.fromEntries(Object.entries(this.context).map(([r,n])=>[r,n.serialize?n.serialize(n):n])),t}jaql(t){const r={jaql:{title:this.name,formula:this.expression}},n={};return Object.getOwnPropertyNames(this.context).forEach(o=>n[o]=this.context[o].jaql(!0)),r.jaql.context=n,this._format&&(r.format={number:this._format}),this._sort!=Br.None&&(r.jaql.sort=this._sort==Br.Ascending?"asc":"desc"),t===!0?r.jaql:r}}class yy extends wD{constructor(t,r,n,i,o,a,s){super(t,It.MeasureTemplate,n,i,o,a,s),this.attribute=r}get id(){return`${this.attribute.expression}_*`}serialize(){const t=super.serialize();return t.__serializable="DimensionalMeasureTemplate",t.attribute=this.attribute.serialize(),t}sort(t){return new yy(this.name,this.attribute,this._format,this.description,t,this.dataSource,this.composeCode)}format(t){return new yy(this.name,this.attribute,t,this.description,this._sort,this.dataSource,this.composeCode)}jaql(t){return this.sum().sort(this._sort).jaql(t)}sum(t){return yD(this.attribute,t).sort(this._sort)}average(t){return XSe(this.attribute,t).sort(this._sort)}median(t){return xD(this.attribute,t).sort(this._sort)}min(t){return xD(this.attribute,t).sort(this._sort)}max(t){return c_(this.attribute,t).sort(this._sort)}count(t){return X$(this.attribute,t).sort(this._sort)}countDistinct(t){return u_(this.attribute,t).sort(this._sort)}}function Fo(e,t){return hy(e,t)}const d_=()=>({guid:bW(13),disabled:!1,locked:!1}),K$=()=>Object.assign(Object.assign({},d_()),{excludeMembers:!1,enableMultiSelection:!0,deactivatedMembers:[]});function e2e(e){return"excludeMembers"in e}const Q$=e=>{const t=e2e(e)?K$():d_();return Object.fromEntries(Object.entries(e).filter(([r,n])=>!Fo(n,t[r])))},Ki={Contains:"contains",StartsWith:"startsWith",EndsWith:"endsWith",Equals:"equals",DoesntEqual:"doesntEqual",DoesntStartWith:"doesntStartWith",DoesntContain:"doesntContain",DoesntEndWith:"doesntEndWith",Like:"like"},Tn={Equals:"equals",DoesntEqual:"doesntEqual",From:"from",FromNotEqual:"fromNotEqual",To:"to",ToNotEqual:"toNotEqual"},zs={From:"from",To:"to",Last:"last",Next:"next",Anchor:"Anchor"},J$={Union:"or",Intersection:"and",Exclude:"exclude"},h_={Top:"top",Bottom:"bottom"},Tt={logicalAttribute:"logicalAttribute",members:"members",exclude:"exclude",measure:"measure",ranking:"ranking",text:"text",numeric:"numeric",dateRange:"dateRange",relativeDate:"relativeDate",cascading:"cascading",advanced:"advanced"};class ns extends kg{constructor(t,r,n,i){super("filter",It.Filter,void 0,void 0,i),this.filterType=r,this.isScope=!0,ns.checkAttributeSupport(t),this.attribute=t,this.config=pD({},d_(),n!=null?n:{})}get name(){return I$(this.jaql()).toString(16)}serialize(){const t=super.serialize();return t.__serializable="AbstractFilter",t.filterType=this.filterType,t.attribute=this.attribute.serialize(),this.config&&(t.config=this.config),t.composeCode=this.composeCode,t}jaql(t){if(this.config.disabled)return ns.disabledJaql(t);const r=this.attribute.jaql(!1),n=this.attribute;if(n.getFormat&&n.getFormat()!==void 0){const i=n.translateGranularityToJaql();r.format={mask:{[i.level]:n.getFormat()}}}return r.jaql.filter=this.filterJaql(),this.attribute.dataSource&&(r.jaql.datasource=this.attribute.dataSource),this.isScope&&(r.panel="scope"),t===!0?r.jaql:r}static checkAttributeSupport(t){const{granularity:r}=t;if(r===Ze.Hours||r===Ze.MinutesRoundTo30||r===Ze.MinutesRoundTo15||r===Ze.Minutes||r===Ze.Seconds)throw new my("errors.filter.unsupportedDatetimeLevel")}static disabledJaql(t){return t?{filter:{}}:{jaql:{filter:{}}}}}class p_ extends ns{constructor(t,r,n,i){super(t[0].attribute,Tt.logicalAttribute,n,i),this.operator=r,this.filters=t}get id(){return`${this.operator}_${this.filters.map(t=>t.id).join()}`}serialize(){const t=super.serialize();return t.__serializable="LogicalAttributeFilter",t.operator=this.operator,t.filters=this.filters.map(r=>r.serialize()),t}filterJaql(){const t={};return t[this.operator]=this.filters.map(r=>r.filterJaql()),t}}class CD extends ns{constructor(t,r,n,i){if(super(t,Tt.members,void 0,i),this.members=r!=null?r:[],this.members.filter(o=>o==null).length>0)throw new my("errors.filter.membersFilterNullMember",{attributeId:t.id});this.config=pD({},K$(),n!=null?n:{})}get id(){return`${this.attribute.id}_${this.members.map(t=>t.toString()).join()}`}get name(){return I$([this.jaql(),a_(this.config,["guid","originalFilterJaql"])]).toString(16)}serialize(){const t=super.serialize();return t.__serializable="MembersFilter",this.config&&(t.config=this.config.backgroundFilter?Object.assign(Object.assign({},this.config),{backgroundFilter:this.config.backgroundFilter.serialize()}):this.config),t.members=this.members,t}filterJaql(){const t={members:this.members.map(n=>n.toString())},r=this.config.excludeMembers?{exclude:t}:t;return this.config.backgroundFilter?{and:[r,this.config.backgroundFilter.filterJaql()]}:r}}class by extends ns{constructor(t,r,n){super(t[0].attribute,Tt.cascading,r,n),this._filters=t}get filters(){const{disabled:t,locked:r}=this.config;return this._filters.map(n=>(n.config=Object.assign(Object.assign({},n.config),{disabled:t,locked:r}),n))}get id(){return`${this.filterType}_${this._filters.map(t=>t.id).join()}`}serialize(){const t=super.serialize();return t.__serializable="CascadingFilter",t._filters=this.filters.map(r=>r.serialize()),t}filterJaql(){return{}}jaql(t){return this.config.disabled?ns.disabledJaql(t):this.filters.map(r=>(r.isScope=!0,r.jaql(t)))}}class _D extends ns{constructor(t,r,n,i){super(t.attribute,Tt.exclude,n,i),this.input=r,this.filter=t}get id(){let t=`exclude_${this.filter.id}`;return this.input&&(t+="_from_"+this.input.id),t}serialize(){const t=super.serialize();return t.__serializable="ExcludeFilter",t.filter=this.filter.serialize(),this.input&&(t.input=this.input.serialize()),t}filterJaql(){const t={},r=this.filter.filterJaql();return this.input?(t.filter=this.input.filterJaql(),t.filter.filter={exclude:r}):t.exclude=r,t}}class f_ extends ns{constructor(t,r,n,i,o,a,s,l){super(t,r,s,l),n&&i!==void 0&&(this.valueA=i,this.operatorA=n),o&&a!==void 0&&(this.operatorB=o,this.valueB=a)}get id(){let t=`${this.attribute.id}`;return this.operatorA&&this.valueA!==void 0&&(t+=`_${this.operatorA}:${this.valueA}`),this.operatorB&&this.valueB!==void 0&&(t+=`_${this.operatorB}:${this.valueB}`),t}serialize(){const t=super.serialize();return t.__serializable="DoubleOperatorFilter",this.operatorA&&(t.operatorA=this.operatorA),this.operatorB&&(t.operatorB=this.operatorB),this.valueA!==void 0&&(t.valueA=this.valueA),this.valueB!==void 0&&(t.valueB=this.valueB),t}filterJaql(){const t={};return this.operatorA&&this.valueA!==void 0&&(t[this.operatorA]=this.valueA),this.operatorB&&this.valueB!==void 0&&(t[this.operatorB]=this.valueB),t}}class SD extends f_{constructor(t,r,n,i,o,a,s,l){super(t,Tt.measure,n,i,o,a,s,l),this.measure=r}get id(){let t=`${this.attribute.id}_${this.measure.id}`;return this.operatorA&&this.valueA!==void 0&&(t+=`_${this.operatorA}:${this.valueA}`),this.operatorB&&this.valueB!==void 0&&(t+=`_${this.operatorB}${this.valueB}`),t}serialize(){const t=super.serialize();return t.__serializable="MeasureFilter",t.measure=this.measure.serialize(),t}jaql(t){if(this.config.disabled)return ns.disabledJaql(t);const r=super.jaql(t);return this.measure instanceof rs&&Object.entries(this.measure.jaql().jaql).forEach(([n,i])=>{r.jaql[n]=i}),r}}class g_ extends ns{constructor(t,r,n,i,o,a){super(t,Tt.ranking,o,a),this.count=i,this.operator=n,this.measure=r}get id(){return`${this.operator}_${this.count}_${this.attribute.id}_by_${this.measure.id}`}serialize(){const t=super.serialize();return t.__serializable="RankingFilter",t.count=this.count,t.operator=this.operator,t.measure=this.measure.serialize(),t}filterJaql(){const t={};return t[this.operator]=this.count,t.by=this.measure.jaql(!0),t}}class kD extends f_{constructor(t,r,n,i,o,a,s){super(t,Tt.numeric,r,n,i,o,a,s)}serialize(){const t=super.serialize();return t.__serializable="NumericFilter",t}}class Dl extends f_{constructor(t,r,n,i,o){super(t,Tt.text,r,n,void 0,void 0,i,o)}serialize(){const t=super.serialize();return t.__serializable="TextFilter",t}}class MD extends f_{constructor(t,r,n,i,o){super(t,Tt.dateRange,zs.From,r,zs.To,n,i,o),typeof r=="object"&&(this.valueA=r.toISOString()),typeof n=="object"&&(this.valueB=n.toISOString())}get level(){return this.attribute}get from(){return this.valueA}get to(){return this.valueB}filterJaql(){return super.filterJaql()}serialize(){const t=super.serialize();return t.__serializable="DateRangeFilter",t}}let xy=class extends ns{constructor(t,r,n,i,o,a,s){super(t,Tt.relativeDate,a,s),i||(i=zs.Next),this.anchor=o,this.operator=i,this.offset=r,this.count=n}get level(){return this.attribute}get id(){let t=`${this.level.id}_${this.operator}_${this.offset}_${this.count}`;return this.anchor&&(typeof this.anchor=="string"?t+=`_${this.anchor}`:typeof this.anchor=="object"&&(t+=`_${this.anchor.toISOString()}`)),t}serialize(){const t=super.serialize();return t.__serializable="RelativeDateFilter",t.offset=this.offset,t.count=this.count,t.operator=this.operator,this.anchor&&(t.anchor=typeof this.anchor=="string"?this.anchor:this.anchor.toISOString()),t}filterJaql(){const t={};return t[this.operator]={offset:this.offset,count:this.count},this.anchor&&(typeof this.anchor=="string"?t[this.operator].anchor=this.anchor:typeof this.anchor=="object"&&(t[this.operator].anchor=this.anchor.toISOString())),t}};class TD extends ns{constructor(t,r,n,i){super(t,Tt.advanced,n,i),delete r.filterType,this.jaqlExpression=r}get id(){return`custom_${this.attribute.id}_${this.config.guid}`}filterJaql(){return this.jaqlExpression}serialize(){const t=super.serialize();return t.__serializable="CustomFilter",t.jaqlExpression=this.jaqlExpression,t}}function AD(e){return"filterType"in e&&e.filterType===Tt.advanced}function go(e){return"filterType"in e&&e.filterType===Tt.members}function ED(e){return"filterType"in e&&e.filterType===Tt.numeric}function wy(e){return"filterType"in e&&e.filterType===Tt.ranking}function PD(e){return"filterType"in e&&e.filterType===Tt.measure}function Qi(e){return"filterType"in e&&e.filterType===Tt.cascading}function m_(e){return"filterType"in e&&e.filterType===Tt.relativeDate}function DD(e){return"filterType"in e&&e.filterType===Tt.text}function Tg(e){return"filterType"in e&&e.filterType===Tt.dateRange}const t2e=Nr((e,t)=>new p_(e,J$.Union,t),"union"),r2e=Nr((e,t)=>new p_(e,J$.Intersection,t),"intersection"),LD=Nr((e,t,r)=>new _D(e,t,r),"exclude"),eW=Nr((e,t,r)=>new Dl(e,Ki.DoesntContain,t,r),"doesntContain"),tW=Nr((e,t,r)=>new Dl(e,Ki.DoesntEndWith,t,r),"doesntEndWith"),rW=Nr((e,t,r)=>new Dl(e,Ki.DoesntStartWith,t,r),"doesntStartWith"),OD=Nr((e,t,r)=>new Dl(e,Ki.Contains,t,r),"contains"),nW=Nr((e,t,r)=>new Dl(e,Ki.EndsWith,t,r),"endsWith"),iW=Nr((e,t,r)=>new Dl(e,Ki.StartsWith,t,r),"startsWith"),n2e=Nr((e,t,r)=>new Dl(e,Ki.Like,t,r),"like"),ID=Nr((e,t,r)=>typeof t=="string"?new Dl(e,Ki.DoesntEqual,t,r):ap(e,Tn.DoesntEqual,t,void 0,void 0,r),"doesntEqual"),ND=Nr((e,t,r)=>typeof t=="string"?new Dl(e,Ki.Equals,t,r):ap(e,Tn.Equals,t,void 0,void 0,r),"equals"),oW=Nr((e,t,r)=>ap(e,Tn.FromNotEqual,t,void 0,void 0,r),"greaterThan"),aW=Nr((e,t,r)=>ap(e,Tn.From,t,void 0,void 0,r),"greaterThanOrEqual"),sW=Nr((e,t,r)=>ap(e,Tn.ToNotEqual,t,void 0,void 0,r),"lessThan"),lW=Nr((e,t,r)=>ap(e,Tn.To,t,void 0,void 0,r),"lessThanOrEqual"),Ag=Nr((e,t,r,n)=>ap(e,Tn.From,t,Tn.To,r,n),"between"),ap=Nr((e,t,r,n,i,o)=>new kD(e,t,r,n,i,o),"numeric"),Hi=Nr((e,t,r)=>new CD(e,t,r),"members"),RD=Nr((e,t,r,n)=>new MD(e,t,r,n),"dateRange"),i2e=Nr((e,t,r,n,i)=>new xy(e,t,r,void 0,n,i),"dateRelative"),FD=Nr((e,t,r,n,i)=>new xy(e,t,r,zs.Next,n,i),"dateRelativeFrom"),Cy=Nr((e,t,r,n,i)=>new xy(e,t,r,zs.Last,n,i),"dateRelativeTo");function Eg(e,t,r,n,i,o,a){return new SD(e,t,r,n,i,o,a)}const o2e=Nr((e,t,r)=>Eg(e.attribute,e,Tn.Equals,t,void 0,void 0,r),"measureEquals"),a2e=Nr((e,t,r)=>Eg(e.attribute,e,Tn.FromNotEqual,t,void 0,void 0,r),"measureGreaterThan"),s2e=Nr((e,t,r)=>Eg(e.attribute,e,Tn.From,t,void 0,void 0,r),"measureGreaterThanOrEqual"),l2e=Nr((e,t,r)=>Eg(e.attribute,e,Tn.To,t,void 0,void 0,r),"measureLessThanOrEqual"),c2e=Nr((e,t,r)=>Eg(e.attribute,e,Tn.ToNotEqual,t,void 0,void 0,r),"measureLessThan"),cW=Nr((e,t,r,n)=>Eg(e.attribute,e,Tn.From,t,Tn.To,r,n),"measureBetween"),uW=Nr((e,t,r,n)=>new g_(e,t,h_.Top,r,n),"topRanking"),dW=Nr((e,t,r,n)=>new g_(e,t,h_.Bottom,r,n),"bottomRanking"),sp=e=>{if(Array.isArray(e)){const[t,...r]=e;return r.length===0?sp(t):{operator:"AND",left:sp(t),right:sp(r)}}return e},jD=Nr((e,t)=>new by(e,t),"cascading");var _y;(function(e){e.and=Y$((t,r)=>({operator:"AND",left:sp(t),right:sp(r)}),"and"),e.or=Y$((t,r)=>({operator:"OR",left:sp(t),right:sp(r)}),"or")})(_y=_y||(_y={}));const u2e=Nr((e,t,r)=>new TD(e,t,r),"customFilter"),d2e=e=>{const{dim:t,datatype:r,title:n,datasource:i}=e;return w_({expression:t,dataType:r,granularity:Ty(e),title:n,dataSource:i})},h2e=e=>{const{dim:t,title:r,datatype:n,agg:i,datasource:o}=e;if(i)return C_({expression:t,dataType:n,agg:i,granularity:Ty(e),format:void 0,sort:void 0,title:r,dataSource:o})},hW=(e,t)=>{if("formula"in e)return HD(e);const{dim:r,datatype:n,agg:i}=e;return C_({expression:r,granularity:Ty(e),dataType:n,agg:i,format:void 0,sort:void 0,title:t})};var v_;(function(e){e.INCLUDE_ALL="INCLUDE_ALL",e.ADVANCED="ADVANCED",e.INVALID="INVALID",e.CONDITION="CONDITION",e.SPECIFIC_ITEMS="SPECIFIC_ITEMS"})(v_=v_||(v_={}));var y_;(function(e){e.PERIOD="PERIOD",e.DATE_RANGE="DATE_RANGE"})(y_=y_||(y_={}));var b_;(function(e){e.NUMERIC_RANGE="NUMERIC_RANGE"})(b_=b_||(b_={}));var Ad;(function(e){e.YEARS="years",e.QUARTERS="quarters",e.MONTHS="months",e.WEEKS="weeks",e.DAYS="days",e.HOURS="hours",e.MINUTES="minutes"})(Ad=Ad||(Ad={}));var Pg;(function(e){e.DATE_TIME="datetime",e.NUMERIC="numeric",e.TEXT="text"})(Pg=Pg||(Pg={}));const p2e=["1","30"],Ur=Object.assign(Object.assign(Object.assign({},v_),y_),b_),f2e={filter:{[Ur.INCLUDE_ALL]:{all:!0,filterType:Ur.INCLUDE_ALL},[Ur.PERIOD]:{last:{count:1,offset:1},isNotCurrentPeriod:!0,filterType:Ur.PERIOD},[Ur.DATE_RANGE]:{filterType:Ur.DATE_RANGE},[Ur.NUMERIC_RANGE]:{filterType:Ur.NUMERIC_RANGE},[Ur.CONDITION]:{explicit:!1,multiSelection:!0,exclude:{members:[]},filterType:Ur.CONDITION},[Ur.SPECIFIC_ITEMS]:{explicit:!0,multiSelection:!0,members:[],filterType:Ur.SPECIFIC_ITEMS}}.INCLUDE_ALL,level:Ad.YEARS};var St;(function(e){e.IS="members",e.IS_NOT="exclude",e.IS_WITHIN="isWithin",e.TOP="top",e.BOTTOM="bottom",e.AFTER="after",e.BEFORE="before",e.STARTS_WITH="startsWith",e.DOESNT_START_WITH="doesntStartWith",e.ENDS_WITH="endsWith",e.DOESNT_END_WITH="doesntEndWith",e.CONTAINS="contains",e.DOESNT_CONTAIN="doesntContain",e.EQUALS="equals",e.DOESNT_EQUAL="doesntEqual",e.IS_EMPTY="isEmpty",e.IS_NOT_EMPTY="isNotEmpty",e.GREATER_THAN="fromNotEqual",e.GREATER_THAN_OR_EQUAL="from",e.LESS_THAN="toNotEqual",e.LESS_THAN_OR_EQUAL="to",e.BETWEEN="between",e.IS_NOT_BETWEEN="isNotBetween",e.MULTIPLE_CONDITION="multipleCondition",e.NONE="none"})(St=St||(St={}));const g2e=e=>e.top!==void 0,m2e=e=>e.bottom!==void 0,v2e=e=>{var t;return!!(!((t=e.exclude)===null||t===void 0)&&t.members)},y2e=e=>!!e.members&&!!e.isCondition,b2e=e=>{var t,r;return((t=e.last)===null||t===void 0?void 0:t.anchor)!==void 0||((r=e.next)===null||r===void 0?void 0:r.anchor)!==void 0},x2e=e=>e.fromNotEqual!==void 0,w2e=e=>e.from!==void 0&&!e.isBetween,C2e=e=>e.toNotEqual!==void 0,_2e=e=>e.to!==void 0&&!e.isBetween,S2e=e=>e.equals!==void 0,k2e=e=>e.doesntEqual!==void 0,M2e=e=>!!(e.equals===""&&e.isEmpty),T2e=e=>!!(e.doesntEqual===""&&e.isEmpty),A2e=e=>e.contains!==void 0,E2e=e=>e.doesntContain!==void 0,P2e=e=>e.startsWith!==void 0,D2e=e=>e.doesntStartWith!==void 0,L2e=e=>e.endsWith!==void 0,O2e=e=>e.doesntEndWith!==void 0,I2e=e=>e.from!==void 0&&e.to!==void 0,N2e=e=>{var t,r;return((t=e.exclude)===null||t===void 0?void 0:t.from)!==void 0&&((r=e.exclude)===null||r===void 0?void 0:r.to)!==void 0},R2e=e=>!!(e.or||e.and),Dg=e=>m2e(e)?St.BOTTOM:g2e(e)?St.TOP:v2e(e)?St.IS_NOT:b2e(e)?St.IS_WITHIN:x2e(e)?St.GREATER_THAN:C2e(e)?St.LESS_THAN:S2e(e)?St.EQUALS:k2e(e)?St.DOESNT_EQUAL:M2e(e)?St.IS_EMPTY:T2e(e)?St.IS_NOT_EMPTY:A2e(e)?St.CONTAINS:E2e(e)?St.DOESNT_CONTAIN:O2e(e)?St.DOESNT_END_WITH:D2e(e)?St.DOESNT_START_WITH:L2e(e)?St.ENDS_WITH:P2e(e)?St.STARTS_WITH:N2e(e)?St.IS_NOT_BETWEEN:y2e(e)?St.IS:R2e(e)?St.MULTIPLE_CONDITION:I2e(e)?St.BETWEEN:w2e(e)?St.GREATER_THAN_OR_EQUAL:_2e(e)?St.LESS_THAN_OR_EQUAL:St.NONE,BD=(e,t,r)=>{var n,i,o,a,s,l,c;switch(Dg(t)){case St.BOTTOM:if(t.by)return dW(e,hW(t.by,t.rankingMessage),t[St.BOTTOM],{guid:r});break;case St.EQUALS:return ND(e,t[St.EQUALS],{guid:r});case St.DOESNT_EQUAL:return ID(e,t[St.DOESNT_EQUAL],{guid:r});case St.GREATER_THAN:return oW(e,t[St.GREATER_THAN],{guid:r});case St.GREATER_THAN_OR_EQUAL:return aW(e,t[St.GREATER_THAN_OR_EQUAL],{guid:r});case St.TOP:if(t.by)return uW(e,hW(t.by,t.rankingMessage),t[St.TOP],{guid:r});break;case St.STARTS_WITH:return iW(e,t[St.STARTS_WITH],{guid:r});case St.DOESNT_START_WITH:return rW(e,t[St.DOESNT_START_WITH],{guid:r});case St.ENDS_WITH:return nW(e,t[St.ENDS_WITH],{guid:r});case St.DOESNT_END_WITH:return tW(e,t[St.DOESNT_END_WITH],{guid:r});case St.CONTAINS:return OD(e,t[St.CONTAINS],{guid:r});case St.DOESNT_CONTAIN:return eW(e,t[St.DOESNT_CONTAIN],{guid:r});case St.LESS_THAN:return sW(e,t[St.LESS_THAN],{guid:r});case St.LESS_THAN_OR_EQUAL:return lW(e,t[St.LESS_THAN_OR_EQUAL],{guid:r});case St.BETWEEN:return Ag(e,t.from,t.to,{guid:r});case St.IS_NOT_BETWEEN:return LD(Ag(e,(n=t.exclude)===null||n===void 0?void 0:n.from,(i=t.exclude)===null||i===void 0?void 0:i.to,{guid:r}),void 0,{guid:r});case St.MULTIPLE_CONDITION:if(t.and)return r2e(t.and.map(h=>BD(e,h,r)),{guid:r});if(t.or)return t2e(t.or.map(h=>BD(e,h,r)),{guid:r});break;case St.IS_NOT:{const h=((o=t.filter)===null||o===void 0?void 0:o.turnedOff)&&((a=t.filter.exclude)===null||a===void 0?void 0:a.members)||[],u=((l=(s=t.exclude)===null||s===void 0?void 0:s.members)===null||l===void 0?void 0:l.filter(f=>!h.includes(f)))||[],g=Q$({guid:r,excludeMembers:!0,enableMultiSelection:(c=t.multiSelection)!==null&&c!==void 0?c:!0,deactivatedMembers:h});return Hi(e,u,g)}}throw new my("errors.filter.unsupportedConditionFilter",{filter:JSON.stringify(t)})},F2e=(e,t,r)=>{var n,i;switch(Dg(t)){case St.EQUALS:return o2e(e,t[St.EQUALS],{guid:r});case St.GREATER_THAN:return a2e(e,t[St.GREATER_THAN],{guid:r});case St.GREATER_THAN_OR_EQUAL:return s2e(e,t[St.GREATER_THAN_OR_EQUAL],{guid:r});case St.LESS_THAN:return c2e(e,t[St.LESS_THAN],{guid:r});case St.LESS_THAN_OR_EQUAL:return l2e(e,t[St.LESS_THAN_OR_EQUAL],{guid:r});case St.BETWEEN:return cW(e,t.from,t.to,{guid:r});case St.IS_NOT_BETWEEN:return LD(cW(e,(n=t.exclude)===null||n===void 0?void 0:n.from,(i=t.exclude)===null||i===void 0?void 0:i.to,{guid:r}),void 0,{guid:r})}throw new my("errors.filter.unsupportedConditionFilter",{filter:JSON.stringify(t)})},j2e=(e,t)=>{let r=e?e.toLocaleLowerCase():Ad.YEARS;return r===Ad.MINUTES&&t==="60"&&(r=Ad.HOURS),r},B2e=e=>e==null?void 0:e.all,z2e=e=>e.last?e.last:e.next,$2e=e=>{var t;return((t=z2e(e))===null||t===void 0?void 0:t.offset)<2},pW=e=>{var t;return((t=e==null?void 0:e.members)===null||t===void 0?void 0:t.length)>=0},W2e=(e,t)=>e&&typeof e=="string"||t&&typeof t=="string",H2e=(e,t)=>e===""&&t==="",U2e=(e,t)=>{const{from:r,to:n}=e;return t!==Pg.DATE_TIME?!1:W2e(r,n)?!0:H2e(r,n)},G2e=e=>{const{from:t,to:r}=e;return t!==void 0&&r!==void 0&&!e.isBetween},fW=e=>Dg(e)!==St.NONE,V2e=e=>Object.keys(e).includes("isAdvanced"),Y2e=e=>!!(e.level&&e.bucket&&e.level===Ad.MINUTES&&p2e.includes(e.bucket)),q2e=e=>e.filterType===Ur.INVALID,gW=(e,t=Pg.DATE_TIME,r)=>r&&Y2e(r)||V2e(e)?Ur.ADVANCED:B2e(e)?Ur.INCLUDE_ALL:$2e(e)?Ur.PERIOD:pW(e)?Ur.SPECIFIC_ITEMS:U2e(e,t)?Ur.DATE_RANGE:G2e(e)?Ur.NUMERIC_RANGE:fW(e)?Ur.CONDITION:(q2e(e),Ur.INVALID),Z2e=(e,t)=>{const{level:r,filter:n,bucket:i}=e,o=n||f2e.filter,a={filter:Object.assign(Object.assign({},o),{filterType:gW(o,t)})};if(t===Pg.DATE_TIME){const s=o,l=(s==null?void 0:s.level)||r;a.level=j2e(l,i),a.filter.filterType=gW(o,t,{level:l,bucket:i})}return a},mW=(e,t)=>{const r={config:Object.assign(Object.assign({},d_()),{guid:t,originalFilterJaql:e}),jaql:n=>n?e:{jaql:e,panel:"scope"},attribute:{id:e.dim},type:"filter"};return Object.assign({},r)},X2e=(e,t)=>Hi(e,[],{guid:t,excludeMembers:!0}),K2e=(e,t,r,n)=>{const i=Q2e(t),o=J2e(t,i),a=Q$({guid:r,excludeMembers:!1,enableMultiSelection:n!=null?n:!0,deactivatedMembers:i});return Hi(e,o,a)};function Q2e(e){var t,r,n,i;return!((t=e.filter)===null||t===void 0)&&t.turnedOff?(i=(n=(r=e.filter)===null||r===void 0?void 0:r.exclude)===null||n===void 0?void 0:n.members)!==null&&i!==void 0?i:[]:[]}function J2e(e,t){const r=e.members;return t?r.filter(n=>!t.includes(n)):r}const eke=(e,t,r)=>RD(e,t.from,t.to,{guid:r}),tke=(e,t,r)=>Ag(e,t.from,t.to,{guid:r}),rke=(e,t,r)=>t.last?Cy(e,t.last.offset,t.last.count,t.last.anchor,{guid:r}):FD(e,t.next.offset,t.next.count,t.next.anchor,{guid:r}),nke=(e,t,r)=>u2e(e,t,{guid:r}),vW=(e,t)=>{try{if("formula"in e)throw new my("errors.filter.formulaFiltersNotSupported",{filter:JSON.stringify(e)});const r=Z2e(e,e.datatype),{filter:n}=r,{filterType:i}=n,o=d2e(e),a=h2e(e);switch(i){case Ur.INCLUDE_ALL:return X2e(o,t);case Ur.SPECIFIC_ITEMS:return K2e(o,n,t,n.multiSelection);case Ur.CONDITION:return a?F2e(a,n,t):BD(o,n,t);case Ur.DATE_RANGE:return eke(o,n,t);case Ur.PERIOD:return rke(o,n,t);case Ur.NUMERIC_RANGE:return tke(o,n,t);case Ur.ADVANCED:return nke(o,n,t);case Ur.INVALID:return mW(e,t)}}catch(r){console.debug("Fall back to generic pass-through JAQL filter due to filter translation error:",r)}return mW(e,t)},ike=e=>["__int4","__int8","int","tinyint","bigint","int2","int4","int8","smallint","mediumint","serial","integer","byteint","int64"].includes(e.toLowerCase()),oke=e=>["basemeasure","calculatedmeasure","float","float4","float8","double precision","double","numeric","decimal","real","number","float64"].includes(e.toLowerCase()),qn=e=>ike(e)||oke(e)||e==="numeric-attribute",Sy=e=>["textdimension","string","varchar","text","ntext","char","character","character varying","smalltext","nchar","nvarchar","json","jsonb","object","text-attribute"].includes(e.toLowerCase()),mo=e=>["datelevel","date","time","datetime","timestamp without time zone","timestamp","timestamp with time zone","timestamp(6)","timestamp_tz","timestamp_ntz","timestamp_ltz","timestampltz","timestampntz","timestamptz","datetime64[ns]","timewithtimezone","timestampwithtimezone","timestamp_with_timezone"].includes(e.toLowerCase()),yW=e=>["bool","boolean","bit","logical"].includes(e.toLowerCase()),zD=e=>qn(e)?"number":mo(e)?"datetime":Sy(e)?"text":yW(e)?"boolean":"text",bW=function(e){e||(e=20);const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=new Array(e);let n=0,i;for(let o=0;o<e;o+=1){if(o>0&&o%5==0){r[o]="-";continue}n<=2&&(n=33554432+Math.random()*16777216|0),i=n&15,n=n>>4,r[o]=t[o==19?i&3|8:i]}return r.join("")},is=e=>{if(!e)return{filters:void 0,relations:void 0};if(Array.isArray(e))return{filters:e,relations:void 0};const t=new Set;function r(a){const[s,...l]=a;if(t.add(s),!l.length)return n({instanceid:s.config.guid});const c=n(s),d=r(l);return{left:c,right:d,operator:"AND"}}function n(a){return a&&(ake(a)?Qi(a)?r(a.filters):(t.add(a),{instanceid:a.config.guid}):("left"in a&&(a.left=n(a.left)),"right"in a&&(a.right=n(a.right)),"composeCode"in a&&delete a.composeCode,a))}const i=ki(e),o=n(i);return{filters:Array.from(t),relations:o}};function ake(e){return"config"in e&&"guid"in e.config}function gc(e){return typeof e=="string"?e:e.title}function Lg(e){return typeof e=="object"&&"type"in e&&"title"in e}function ky(e){return{id:e.id,address:e.address,title:e.title,type:e.live?"live":"elasticube"}}function $D(e){return Lg(e)?{title:e.title,live:e.type==="live"}:{title:e,live:!1}}function ske(e){var t;return Lg(e)?{title:e.title,live:e.type==="live",id:(t=e.id)!==null&&t!==void 0?t:"",address:e.address}:{title:e,id:""}}function lke(e){return e?e==="asc"?Br.Ascending:Br.Descending:Br.None}function cke(e){switch(e){case"sortAsc":return Br.Ascending;case"sortDesc":return Br.Descending;default:return Br.None}}const lp=(e,t,r=!1,n=!1)=>{const i=e.filter.filter&&!("turnedOff"in e.filter.filter),o=t||bW(),a=vW(e,o);if(i){const s=vW(Object.assign(Object.assign({},e),{filter:e.filter.filter}),`${t}-bg`),l=a.config;return a.config=Object.assign(Object.assign({},l),{backgroundFilter:s}),a}return a.config=Object.assign(Object.assign({},a.config),{originalFilterJaql:e,disabled:r,locked:n}),a};function cp(e){const[t,r]=e.slice(1,-1).split(".");return{table:t,column:r?r.replace("(Calendar)","").trim():""}}function WD(e){return cp(e.expression).table}function x_(e){return cp(e.expression).column}function Og(e){switch(e){case vy.ASC:return"sortAsc";case vy.DESC:return"sortDesc";default:return"sortNone"}}const w_=({expression:e,dataType:t,granularity:r,format:n,sort:i,title:o,panel:a,dataSource:s})=>{const l=cp(e).column,c=lke(i);if(t===s_.DATETIME)return new Gr(o!=null?o:l,e,r||Ze.Years,n||Gr.getDefaultFormatForGranularity(r||Ze.Years),void 0,c,s,void 0,a);const h=!t||qn(t)?It.NumericAttribute:It.TextAttribute;return new xu(o!=null?o:l,e,h,void 0,c,s,void 0,a)},C_=({expression:e,dataType:t,agg:r,granularity:n,format:i,sort:o,title:a,dataSource:s})=>{const l=w_({expression:e,dataType:t,granularity:n,format:i,sort:o,title:a,dataSource:s}),c=rs.aggregationFromJAQL(r),d=cp(e).column,h=a!=null?a:`${c} ${d}`;switch(c){case wr.Sum:return yD(l,h,i);case wr.Average:return KSe(l,h,i);case wr.Min:return bD(l,h,i);case wr.Max:return c_(l,h,i);case wr.Count:return X$(l,h,i);case wr.CountDistinct:return u_(l,h,i);case wr.Median:return xD(l,h,i);case wr.Variance:return fc(l,wr.Variance,h,i);case wr.StandardDeviation:return fc(l,wr.StandardDeviation,h,i);default:return yD(l,h,i)}},HD=e=>{var t;const r=oSe((t=e.context)!==null&&t!==void 0?t:{},n=>typeof n=="string"?n:n&&My(n));return Ro(e.title,e.formula,r)};function My(e,t,r){if("filter"in e)return lp(e);if("formula"in e)return HD(e);const o="datasource"in e?e.datasource:void 0;return e.agg?C_({expression:e.dim,dataType:e.datatype,agg:e.agg||"",granularity:Ty(e),format:t,sort:e.sort,title:e.title,dataSource:o}):w_({expression:e.dim,dataType:e.datatype,granularity:Ty(e),format:t,sort:e.sort,title:e.title,panel:r,dataSource:o})}function Ty(e){return e!=null&&e.datatype&&mo(e.datatype)?Gr.translateJaqlToGranularity(e):void 0}const UD=e=>zD(e).replace("number","numeric");class xu extends kg{constructor(t,r,n,i,o,a,s,l){if(super(t,n||It.Attribute,i,a,s),this._sort=Br.None,this.expression=r,!s&&r){const{table:c,column:d}=cp(r);this.composeCode=Ay(c,d,"",gD)}l==="columns"&&(this.panel=l),this._sort=o||Br.None}get id(){return this.expression}getSort(){return this._sort}sort(t){return new xu(this.name,this.expression,this.type,this.description,t,this.dataSource,this.composeCode,this.panel)}jaql(t){const r={jaql:{title:this.name,dim:this.expression,datatype:UD(this.type)}};return this.panel&&(r.panel=this.panel),this._sort!=Br.None&&(r.jaql.sort=this._sort==Br.Ascending?"asc":"desc"),t===!0?r.jaql:r}serialize(){const t=super.serialize();return t.__serializable="DimensionalAttribute",t.expression=this.expression,this.getSort()!==Br.None&&(t.sort=this.getSort()),t}}class Gr extends xu{constructor(t,r,n,i,o,a,s,l,c){if(super(t,r,It.DateLevel,o,a,s,l),this._format=i,this.granularity=n,!l&&r){const{table:d,column:h}=cp(r);this.composeCode=Ay(d,h,n,gD)}c==="columns"&&(this.panel=c)}get id(){let t=`${this.expression}`;const{level:r="",dateTimeLevel:n="",bucket:i}=this.translateGranularityToJaql();return t+=`_${(r||n).toLowerCase()}`,i&&(t+=`_${i}`),t}getSort(){return this._sort}sort(t){return new Gr(this.name,this.expression,this.granularity,this._format,this.description,t,this.dataSource,this.composeCode)}getFormat(){return this._format}format(t){return new Gr(this.name,this.expression,this.granularity,t,this.description,this._sort,this.dataSource,this.composeCode)}setGranularity(t){return new Gr(this.name,this.expression,t,this._format,this.description,this._sort,this.dataSource,this.composeCode)}serialize(){const t=super.serialize();return t.__serializable="DimensionalLevelAttribute",t.granularity=this.granularity,this.getFormat()!==void 0&&(t.format=this.getFormat()),t}jaql(t){const r={jaql:Object.assign({title:this.name,dim:this.expression,datatype:UD(this.type)},this.translateGranularityToJaql())};if(this.panel&&(r.panel=this.panel),this._format!==void 0){const n=r.jaql.dateTimeLevel||r.jaql.level;r.format={mask:{}},r.format.mask[n]=this._format}return this._sort!=Br.None&&(r.jaql.sort=this._sort==Br.Ascending?"asc":"desc"),t===!0?r.jaql:r}translateGranularityToJaql(){const t="minutes",r="seconds";switch(this.granularity){case Ze.Years:case Ze.Quarters:case Ze.Months:case Ze.Weeks:case Ze.Days:return{level:this.granularity.toLowerCase()};case Ze.Hours:return{dateTimeLevel:t,bucket:"60"};case Ze.MinutesRoundTo30:return{dateTimeLevel:t,bucket:"30"};case Ze.MinutesRoundTo15:return{dateTimeLevel:t,bucket:"15"};case Ze.Minutes:return{dateTimeLevel:t,bucket:"1"};case Ze.Seconds:return{dateTimeLevel:r,bucket:"0"};case Ze.AggHours:return{level:t,bucket:"60"};case Ze.AggMinutesRoundTo30:return{level:t,bucket:"30"};case Ze.AggMinutesRoundTo15:return{level:t,bucket:"15"};case Ze.AggMinutesRoundTo1:return{level:t,bucket:"1"};default:return console.warn("Unsupported level"),{level:this.granularity}}}static translateJaqlToGranularity(t){const r=n=>(console.warn("Unsupported granularity",n),n);if(t.dateTimeLevel){if(t.dateTimeLevel!=="minutes"&&t.dateTimeLevel!=="seconds")return r(t.dateTimeLevel);switch(t.bucket){case"60":return Ze.Hours;case"30":return Ze.MinutesRoundTo30;case"15":return Ze.MinutesRoundTo15;case"1":return Ze.Minutes;case"0":return Ze.Seconds;default:return r(t.dateTimeLevel)}}switch(t.level){case"years":return Ze.Years;case"quarters":return Ze.Quarters;case"months":return Ze.Months;case"weeks":return Ze.Weeks;case"days":return Ze.Days;case"minutes":switch(t.bucket){case"60":return Ze.AggHours;case"30":return Ze.AggMinutesRoundTo30;case"15":return Ze.AggMinutesRoundTo15;case"1":return Ze.AggMinutesRoundTo1;default:return r(t.level)}default:return r(t.level)}}static getDefaultFormatForGranularity(t){switch(t){case Ze.Years:return"yyyy";case Ze.Quarters:return"Q yyyy";case Ze.Months:return"yyyy-MM";case Ze.Weeks:return"ww yyyy";case Ze.Days:return"yyyy-MM-dd";case Ze.Hours:return"yyyy-MM-dd HH:mm";case Ze.MinutesRoundTo30:return"yyyy-MM-dd HH:mm";case Ze.MinutesRoundTo15:return"yyyy-MM-dd HH:mm";case Ze.Minutes:return"yyyy-MM-dd HH:mm";case Ze.Seconds:return"yyyy-MM-dd HH:mm:ss";case Ze.AggHours:return"HH:mm";case Ze.AggMinutesRoundTo30:return"HH:mm";case Ze.AggMinutesRoundTo15:return"HH:mm";case Ze.AggMinutesRoundTo1:return"HH:mm";default:return""}}}function xW(e){return e.granularity?uke(e):new xu(e.name||e.title,e.attribute||e.expression||e.dim,e.type,e.desc||e.description,e.sort,e.dataSource)}function uke(e){return new Gr(e.name||e.title,e.attribute||e.expression||e.dim,e.granularity,e.format,e.desc||e.description,e.sort,e.dataSource)}function Ay(e,t,r,n){return(n.length>0?n+".":"")+pc(e)+"."+pc(t)+(r&&r.length>0?"."+r:"")}const wW=e=>{if(e!==void 0)return`${e}`},CW=e=>{if(e!==void 0)return new Date(e).toISOString()},GD=()=>!1;function _W(e,t){const r=t.filter;return"or"in r?n=>r.or.map(i=>e(Object.assign(Object.assign({},t),{filter:i}))).reduce((i,o)=>i||o(n),!1):"and"in r?n=>r.and.map(i=>e(Object.assign(Object.assign({},t),{filter:i}))).reduce((i,o)=>i&&o(n),!0):e(t)}function dke(e){const{datatype:t}=e,r=e.filter,n=t==="datetime"?CW:wW;return i=>{const o=r.members.map(n),a=n(i);return o.includes(a)}}function hke(e){const{datatype:t}=e,r=e.filter,n=t==="datetime"?CW:wW;return i=>{var o,a;const s=((a=(o=r.exclude)===null||o===void 0?void 0:o.members)===null||a===void 0?void 0:a.map(n))||[],l=n(i);return!s.includes(l)}}function pke(e){const t=e.filter,r=Dg(t);return r===St.STARTS_WITH?n=>new RegExp(`^${t.startsWith}`,"i").test(n):r===St.ENDS_WITH?n=>new RegExp(`${t.endsWith}$`,"i").test(n):r===St.CONTAINS?n=>new RegExp(t.contains,"i").test(n):r===St.EQUALS?n=>n.localeCompare(t.equals,void 0,{sensitivity:"base"})===0:r===St.DOESNT_START_WITH?n=>!new RegExp(`^${t.doesntStartWith}`,"i").test(n):r===St.DOESNT_END_WITH?n=>!new RegExp(`${t.doesntEndWith}$`,"i").test(n):r===St.DOESNT_CONTAIN?n=>!new RegExp(t.doesntContain,"i").test(n):r===St.DOESNT_EQUAL?n=>n.localeCompare(t.doesntEqual,void 0,{sensitivity:"base"})!==0:GD}function fke(e){const t=e.filter,r=Dg(t);return r===St.EQUALS?n=>Number(t.equals)===Number(n):r===St.DOESNT_EQUAL?n=>Number(t.doesntEqual)!==Number(n):r===St.LESS_THAN?n=>Number(n)<Number(t.toNotEqual):r===St.GREATER_THAN?n=>Number(n)>Number(t.fromNotEqual):r===St.BETWEEN?n=>Number(t.to)>=Number(n)&&Number(n)>=Number(t.from):r===St.GREATER_THAN_OR_EQUAL?n=>Number(n)>=Number(t.from):r===St.LESS_THAN_OR_EQUAL?n=>Number(t.to)>=Number(n):GD}function gke(e){const t=e,{datatype:r}=t,n=t.filter;return pW(n)?dke(t):fW(n)&&Dg(n)===St.IS_NOT?hke(t):r==="text"?_W(pke,t):r==="numeric"?_W(fke,t):GD}function VD(e){return"attribute"in e}function mke(e){return"measure"in e}const vke={rows:!1,columns:!1};class __ extends kg{constructor(t,r){var n;super((n=t.jaql.title)!==null&&n!==void 0?n:"",r),this.expression=t.jaql.dim||t.jaql.formula,this.metadataItem=t,t.jaql.agg?this.aggregation=t.jaql.agg:delete this.aggregation,t.jaql.formula?this.formula=t.jaql.formula:delete this.formula,t.jaql.sort?this.sortType=Og(t.jaql.sort):delete this.sortType,this.skipValidation=!0}get id(){return this.expression}jaql(t){return t===!0?this.metadataItem.jaql:this.metadataItem}serialize(){const t=super.serialize();return t.__serializable="JaqlElement",t.metadataItem=this.metadataItem,t.type=this.type,t}}const yke={text:It.TextAttribute,numeric:It.NumericAttribute,datetime:It.DateLevel};function bke(e){var t;return new __(e,(t=yke[e.jaql.datatype])!==null&&t!==void 0?t:"numeric")}function SW(e){const{jaql:t}=e;if(t.formula)return HD(t);const r=Gr.translateJaqlToGranularity(t);return"agg"in t&&t.dim&&t.datatype?C_({expression:t.dim,dataType:t.datatype,agg:t.agg||"",granularity:r,format:void 0,sort:t.sort,title:t.title,dataSource:t.datasource}):t.dim&&t.datatype?w_({expression:t.dim,dataType:t.datatype,granularity:r,sort:t.sort,title:t.title,panel:e.panel,dataSource:t.datasource}):bke(e)}function Ed(e){return e===void 0||typeof e=="string"||"title"in e&&"type"in e}const ea={BOX_MIN_VALUE_NAME:"Box Min",BOX_MEDIAN_VALUE_NAME:"Box Median",BOX_MAX_VALUE_NAME:"Box Max",WHISKER_MIN_VALUE_NAME:"Whisker Min",WHISKER_MAX_VALUE_NAME:"Whisker Max",OUTLIER_COUNT_VALUE_NAME:"Outlier Count",OUTLIER_MIN_VALUE_NAME:"Outlier Min",OUTLIER_MAX_VALUE_NAME:"Outlier Max"};function YD(e){return[Ro(ea.BOX_MIN_VALUE_NAME,"QUARTILE([Attr], 1)",{Attr:e}),Ro(ea.BOX_MEDIAN_VALUE_NAME,"MEDIAN([Attr])",{Attr:e}),Ro(ea.BOX_MAX_VALUE_NAME,"QUARTILE([Attr], 3)",{Attr:e})]}function xke(e){return[...YD(e),Ro(ea.WHISKER_MIN_VALUE_NAME,"LOWERWHISKERMAX_IQR([Attr])",{Attr:e}),Ro(ea.WHISKER_MAX_VALUE_NAME,"UPPERWHISKERMIN_IQR([Attr])",{Attr:e}),Ro(ea.OUTLIER_COUNT_VALUE_NAME,"OUTLIERSCOUNT_IQR([Attr])",{Attr:e})]}function wke(e){return[...YD(e),Ro(ea.WHISKER_MIN_VALUE_NAME,"MIN([Attr])",{Attr:e}),Ro(ea.WHISKER_MAX_VALUE_NAME,"MAX([Attr])",{Attr:e})]}function Cke(e){return[...YD(e),Ro(ea.WHISKER_MIN_VALUE_NAME,"LOWERWHISKERMAX_STDEVP([Attr])",{Attr:e}),Ro(ea.WHISKER_MAX_VALUE_NAME,"UPPERWHISKERMIN_STDEVP([Attr])",{Attr:e}),Ro(ea.OUTLIER_COUNT_VALUE_NAME,"OUTLIERSCOUNT_STDEVP([Attr])",{Attr:e})]}const _ke=q$(e=>{const t=ki(e),r=Ro(ea.OUTLIER_MAX_VALUE_NAME,"(UPPERWHISKERMIN_IQR([Attr]), all([Attr]))",{Attr:e}),n=Ro(ea.OUTLIER_MIN_VALUE_NAME,"(LOWERWHISKERMAX_IQR([Attr]), all([Attr]))",{Attr:e});return t.name=`${t.name} (Outliers)`,t.jaql=i=>{const o=Object.assign(Object.assign({},e.jaql(!0)),{filter:{or:[{fromNotEqual:r.jaql(!0)},{toNotEqual:n.jaql(!0)}]}});return i?o:{jaql:o}},t},"boxWhiskerIqrOutliers"),Ske=q$(e=>{const t=ki(e),r=Ro(ea.OUTLIER_MAX_VALUE_NAME,"(UPPERWHISKERMIN_STDEVP([Attr]), all([Attr]))",{Attr:e}),n=Ro(ea.OUTLIER_MIN_VALUE_NAME,"(LOWERWHISKERMAX_STDEVP([Attr]), all([Attr]))",{Attr:e});return t.jaql=i=>{const o=Object.assign(Object.assign({},e.jaql(!0)),{filter:{or:[{fromNotEqual:r.jaql(!0)},{toNotEqual:n.jaql(!0)}]}});return i?o:{jaql:o}},t},"boxWhiskerStdDevOutliers");function wu(e){return!!e&&"operator"in e&&(e.operator==="AND"||e.operator==="OR")&&!!e.right&&!!e.left}function S_(e=[],t=[]){if(!wu(e)&&!wu(t))return Ui(e,t);const{filters:r,relations:n}=Ll(e),i=k_(t),o=Ui(r,i),a=Ol(r,n,o);return os(o,a)}function Ll(e){if(!e)return{filters:[],relations:null};if(vn(e))return{filters:e,relations:null};const t=new Set;function r(i){if(MW(i))return t.add(i),{instanceid:i.config.guid};if(wu(i)){const o=r(i.left),a=r(i.right);return{left:o,right:a,operator:i.operator}}throw new A_}const n=r(e);return{filters:Array.from(t),relations:n}}function k_(e){return e?Ll(e).filters:[]}function os(e,t){if(!t||qD(t))return e;const r=n(t);return MW(r)?[r]:r;function n(i){if(M_(i))return e.find(o=>o.config.guid===i.instanceid);if(T_(i))return(i.operator==="AND"?_y.and:_y.or)(n(i.left),n(i.right));throw new A_}}function qD(e){return!!e&&"instanceid"in e}function Ol(e,t,r){if(t===null)return null;const n=Mke(e,r);return n.length===0?t:n.reduce((i,o)=>{switch(o.type){case"add":return Tke(o.payload,i);case"remove":return ZD(o.payload,i)}},t)}function kW(e,t){return e.config.guid===t.config.guid}function kke(e,t,r){if(!e)return null;return i(e);function i(o){if(M_(o))return o.instanceid===t.config.guid?{instanceid:r.config.guid}:o;if(T_(o))return{left:i(o.left),right:i(o.right),operator:o.operator};throw new A_}}function Mke(e,t){const r=[],n=[...e],i=[...t];return n.forEach(o=>{i.some(s=>kW(o,s))||r.push({type:"remove",payload:o})}),i.forEach(o=>{n.some(s=>kW(o,s))||r.push({type:"add",payload:o})}),r}function Tke(e,t){return t?{left:t,right:{instanceid:e.config.guid},operator:"AND"}:{instanceid:e.config.guid}}function ZD(e,t){if(!t)return null;if(qD(t))return t.instanceid===e.config.guid?null:t;const r=ZD(e,t.left),n=ZD(e,t.right);return r===null&&n?n:n===null&&r?r:r===null&&n===null?null:{left:r,right:n,operator:t.operator}}function Ake(e,t){if(!e)return null;function r(n){if(Eke(n))return{instanceid:n.instanceId};if(Pke(n))return r(n.value);if(Dke(n))return{operator:n.operator,left:r(n.left),right:r(n.right)};if(Lke(n)){const i=t.find(o=>{if(!Qi(o))return!1;const a=o.filters.map(s=>s.config.guid);return n.levels.every(s=>a.includes(s.instanceId))});if(i)return{instanceid:i.config.guid};throw new Error("Broken filter relations model. Cascading filter not found.")}throw new Error("Broken filter relations model. Unknown node type.")}return r(e)}function Eke(e){return"instanceId"in e}function Pke(e){return"value"in e}function Dke(e){return"operator"in e}function Lke(e){return"levels"in e&&vn(e.levels)}function M_(e){return"instanceid"in e}function T_(e){return"operator"in e}function MW(e){return"config"in e&&"guid"in e.config}function Oke(e,t){if(!e)return;function r(n){if(M_(n)){const i=t.find(o=>o.config.guid===n.instanceid);return i&&Qi(i)?{type:"CascadingIdentifier",levels:i.filters.map(a=>({type:"Identifier",instanceId:a.config.guid}))}:{type:"Identifier",instanceId:n.instanceid}}else{if(T_(n))return{type:"LogicalExpression",operator:n.operator,left:r(n.left),right:r(n.right)};throw new Error("Unknown node type in filter relations rules.")}}return r(e)}function Ike(e,t){return e.find(r=>r.config.guid===t)}class A_ extends Error{constructor(){super("Broken filter relations. Unknown node type.")}}function XD(e){return e.nodeType==="openBracket"}function KD(e){return e.nodeType==="closeBracket"}function Nke(e){return e.nodeType==="attribute"}function Rke(e){return e.nodeType==="operator"}function Ey(e){if(Qi(e))return e.filters.map(Ey).join("-");const{attribute:t}=e,r=e.jaql().jaql,n=t.expression||r.dim,i=t.granularity||((r==null?void 0:r.datatype)==="datetime"?Gr.translateJaqlToGranularity(r):"");return`${n}${i}`}function Ui(e=[],t=[]){const r=[...e];return t.forEach(n=>{const i=r.findIndex(a=>Ey(n)===Ey(a));i!==-1?r[i]=n:r.push(n)}),r}function Fke(e){if(!e)return e;const t=ki(e);function r(n){if("instanceId"in n)return{instanceid:n.instanceId};if("value"in n)return r(n.value);if("operator"in n){const i={operator:n.operator};return"left"in n&&(i.left=r(n.left)),"right"in n&&(i.right=r(n.right)),i}return n}return r(t)}function jke(e){return t=>{if(wu(t)){const{filters:r,relations:n}=Ll(t),i=[...r,e],o=Ol(r,n,i);return os(i,o)}return[...t||[],e]}}function Bke(e){return t=>{if(wu(t)){const{filters:r,relations:n}=Ll(t),i=[...r,...e],o=Ol(r,n,i);return os(i,o)}return[...t||[],...e]}}function zke(e){return t=>{if(wu(t)){const{filters:r,relations:n}=Ll(t),i=r.filter(a=>a.config.guid!==e.config.guid),o=Ol(r,n,i);return os(i,o)}return(t||[]).filter(r=>r.config.guid!==e.config.guid)}}function $ke(e){return t=>{if(wu(t)){const{filters:r,relations:n}=Ll(t),i=r.filter(a=>!e.some(s=>a.config.guid===s.config.guid)),o=Ol(r,n,i);return os(i,o)}return(t||[]).filter(r=>!e.some(n=>r.config.guid===n.config.guid))}}function Wke(e,t){return r=>{if(wu(r)){const{filters:n,relations:i}=Ll(r),o=n.map(s=>s.config.guid===e.config.guid?t:s),a=kke(i,e,t);return os(o,a)}return(r||[]).map(n=>n.config.guid===e.config.guid?t:n)}}const Hke={errors:{invalidAttribute:"Invalid attribute {{attributeName}}. Hint: attributes for query should be extracted from the data model generated by the CLI tool.",noDimensionsOrMeasures:"Neither dimensions nor measures found. Query should have at least one dimension or measure.",invalidMeasure:'Invalid measure "{{measureName}}". Hint: measures for the query can be constructed using the "measureFactory" functions.',invalidFilter:'Invalid filter "{{filterName}}". Hint: filters for the query can be constructed using the "filterFactory" functions.',invalidHighlight:'Invalid highlight "{{highlightName}}". Hint: highlights for the query can be constructed using the "filterFactory" functions.',invalidCountNegative:'Invalid count "{{count}}". Count should be non-negative.',invalidOffset:'Invalid offset "{{offset}}". Offset should be non-negative.',missingHttpClient:"Query requires httpClient to work properly.",missingPostMethod:'httpClient must provide "post" method.',noJaqlResponse:"No jaql response received from the server",dataSourceNotFound:'Failed to get fields for data source "{{dataSource}}". Please make sure the data source exists and is accessible.'}},Uke={errors:{invalidAttribute:"Недійсний атрибут {{attributeName}}. Підказка: атрибути для запиту повинні бути витягнуті з моделі даних, створеної за допомогою CLI-інструменту.",noDimensionsOrMeasures:"Не знайдено ні вимірів, ні показників. Запит повинен мати щонайменше один вимір або показник.",invalidMeasure:'Недійсний показник "{{measureName}}". Підказка: показники для запиту можна створити за допомогою функцій "measureFactory".',invalidFilter:'Недійсний фільтр "{{filterName}}". Підказка: фільтри для запиту можна створити за допомогою функцій "filterFactory".',invalidHighlight:'Недійсне виділення "{{highlightName}}". Підказка: виділення для запиту можна створити за допомогою функцій "filterFactory".',invalidCountNegative:`Недійсний count "{{count}}". Count повинен бути не від'ємним.`,invalidOffset:`Недійсний offset "{{offset}}". Offset повинен бути не від'ємним.`,missingHttpClient:"Для запиту потрібен httpClient, щоб працювати належним чином.",missingPostMethod:'httpClient повинен мати метод "post".',noJaqlResponse:"Відповіді, що містить jaql, від сервера не отримано",dataSourceNotFound:'Не вдалося отримати поля для джерела даних "{{dataSource}}". Переконайтесь що джерело існує і доступне.'}},TW="sdkQueryClient",Gke={en:Hke,uk:Uke};function Vke(){return VC({resource:Gke,language:"en",namespace:TW})}const{i18nextInstance:Yke}=Vke(),AW=e=>{if(typeof e=="object"&&e!==null){if(typeof Object.getPrototypeOf=="function"){const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}return Object.prototype.toString.call(e)==="[object Object]"}return!1},yn=(...e)=>e.reduce((t,r)=>{if(Array.isArray(r))throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");return Object.keys(r).forEach(n=>{["__proto__","constructor","prototype"].includes(n)||(Array.isArray(t[n])&&Array.isArray(r[n])?t[n]=yn.options.mergeArrays?Array.from(new Set(t[n].concat(r[n]))):r[n]:AW(t[n])&&AW(r[n])?t[n]=yn(t[n],r[n]):t[n]=r[n])}),t},{}),EW={mergeArrays:!0};yn.options=EW,yn.withOptions=(e,...t)=>{yn.options=Object.assign({mergeArrays:!0},e);const r=yn(...t);return yn.options=EW,r};let E_;const qke=new Uint8Array(16);function Zke(){if(!E_&&(E_=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!E_))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return E_(qke)}const vo=[];for(let e=0;e<256;++e)vo.push((e+256).toString(16).slice(1));function Xke(e,t=0){return vo[e[t+0]]+vo[e[t+1]]+vo[e[t+2]]+vo[e[t+3]]+"-"+vo[e[t+4]]+vo[e[t+5]]+"-"+vo[e[t+6]]+vo[e[t+7]]+"-"+vo[e[t+8]]+vo[e[t+9]]+"-"+vo[e[t+10]]+vo[e[t+11]]+vo[e[t+12]]+vo[e[t+13]]+vo[e[t+14]]+vo[e[t+15]]}const PW={randomUUID:typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function DW(e,t,r){if(PW.randomUUID&&!t&&!e)return PW.randomUUID();e=e||{};const n=e.random||(e.rng||Zke)();return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Xke(n)}function Kke(e,t){const r=t==null?void 0:t.find(n=>LW(e)===n.attribute.id);return r&&!r.config.disabled&&(r.isScope&&(r.isScope=!1),e.jaql.in={selected:r.jaql()}),e}function Qke(e,t){const r=[],n=[];return t.forEach(i=>{e.some(a=>LW(a)===i.attribute.id)?r.push(i):n.push(i)}),[r,n]}function LW(e){const{dim:t,level:r,dateTimeLevel:n,bucket:i}=e.jaql;let o=`${t}`;return(r||n)&&(o+=`_${r||n}`),i&&(o+=`_${i}`),o}var Jke=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};function eMe(e,t,r){return{rowsCount:e.length,columnsCount:t.length,measuresCount:r.length}}function tMe(e){switch(e){case"sortAsc":return"asc";case"sortDesc":return"desc";default:return"none"}}function rMe(e,t,r){const n=tMe(e.direction),i=t===r.rowsCount-1,o={dir:n,initialized:!0,field:e.by&&"valuesIndex"in e.by?r.rowsCount+r.columnsCount+e.by.valuesIndex:t};return i&&(o.sortingLastDimension=!0),e.by&&(o.measurePath=(e.by.columnsMembersPath||[]).reduce((a,s,l)=>Object.assign(Object.assign({},a),{[r.rowsCount+l]:s}),{})),{sort:n,sortDetails:o}}function nMe(e,t){if(t.rowsCount===0)return;const r=t.rowsCount-1,n=e[r],i=n.jaql,{sortDetails:o,sort:a}=i,s=Jke(i,["sortDetails","sort"]);if(o&&o.field!==r&&o.field<e.length){const c=e[o.field];c.jaql.sortDetails=o,c.jaql.sort=a,n.jaql=s}}const P_="ComposeSDK";function QD(e,t){const{attributes:r,measures:n,filters:i,filterRelations:o,highlights:a,dataSource:s,count:l,offset:c,ungroup:d}=e,h=d&&n.length===0,u=Object.assign({metadata:oMe({attributes:r,measures:n,filters:i,filterRelations:o,highlights:a},t)},aMe(s,l,c,h));return o?Object.assign(Object.assign({},u),{filterRelations:o}):u}function OW(e,t,r,n,i){const[o,a]=Qke(e,n);e.forEach(c=>Kke(c,o));const s=c=>{const d=c.jaql();return r?Array.isArray(d)?d.map(h=>Object.assign(Object.assign({},h),{instanceid:c.config.guid})):Object.assign(Object.assign({},d),{instanceid:c.config.guid}):d},l=(i?t.flatMap(c=>s(c)):[...t,...a].flatMap(c=>s(c))).filter(c=>Object.keys(c.jaql.filter||{}).length!==0);return i&&a.length>0&&console.warn(`The following highlight filters were not applied due to missing attributes: [${a.map(c=>c.attribute.name).join(", ")}].`),l}function iMe(e){var t,r;const n=(t=e.jaql)===null||t===void 0?void 0:t.formula;if(!n||!n.includes("trend")&&!n.includes("forecast"))return e;const i=structuredClone(e),o=(r=i.jaql)===null||r===void 0?void 0:r.context;if(o)for(const a in o){const s=o[a];s.datatype==="text"&&s.agg==="count"&&(s.datatype="numeric")}return i}function oMe(e,t){const{attributes:r,measures:n,filters:i,filterRelations:o,highlights:a}=e,s=r.map(d=>d.jaql()),l=n.map(d=>iMe(d.jaql())),c=OW(s,i,o,a,t);return[...s,...l,...c]}function aMe(e,t,r,n){return Object.assign(Object.assign(Object.assign({datasource:$D(e),by:P_,queryGuid:DW()},n?{ungroup:!0}:{}),t?{count:t}:{}),r?{offset:r}:{})}function sMe(e,t){const{rowsAttributes:r,columnsAttributes:n,measures:i,filters:o,filterRelations:a,grandTotals:s,highlights:l,dataSource:c,count:d,offset:h}=e,u=Object.assign({metadata:cMe({rowsAttributes:r,columnsAttributes:n,measures:i,filters:o,highlights:l,filterRelations:a},t)},uMe(c,s,d,h));return a?Object.assign(Object.assign({},u),{filterRelations:a}):u}function IW(e,t,r,n){const i=t==="rows"&&VD(e)&&e.sort&&e.sort.direction!=="sortNone",o=Object.assign(Object.assign({},VD(e)?e.attribute.jaql(!0):e.jaql(!0)),i&&rMe(e.sort,r,n));return Object.assign(Object.assign({jaql:o},VD(e)&&e.includeSubTotals?{format:{subtotal:!0}}:{}),{panel:t,field:{index:r,id:`${t}-${r}`}})}function lMe(e,t,r){return Object.assign(Object.assign({},mke(e)?yn(e.measure.jaql(),{jaql:{subtotalAgg:e.totalsCalculation},format:Object.assign({databars:e.dataBars||!1},e.shouldRequestMinMax&&{color:{type:"range"}})}):e.jaql()),{panel:t,field:{index:r,id:`${t}-${r}`}})}function cMe(e,t){const{rowsAttributes:r,columnsAttributes:n,measures:i,filters:o,filterRelations:a,highlights:s}=e,l=eMe(r,n,i);let c=0;const d=r.map((x,S)=>IW(x,"rows",S+c,l));c=c+r.length;const h=n.map((x,S)=>IW(x,"columns",S+c,l));c=c+n.length;const u=[...d,...h],g=i.map((x,S)=>lMe(x,"measures",S+c)),f=OW(u,o,a,s,t),p=[...u,...g,...f];return nMe(p,l),p}function uMe(e,t,r,n){return Object.assign(Object.assign(Object.assign({datasource:$D(e),by:P_,queryGuid:DW(),dashboard:P_,widget:P_,format:"pivot"},r?{count:r}:{}),n?{offset:n}:{}),{grandTotals:Object.assign(Object.assign({},vke),t)})}var JD=function(t,r){var n=arguments;if(r==null||!Uv.call(r,"css"))return Ce.createElement.apply(void 0,n);var i=n.length,o=new Array(i);o[0]=S3,o[1]=_3(t,r);for(var a=2;a<i;a++)o[a]=n[a];return Ce.createElement.apply(null,o)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(JD||(JD={}));var dMe=w3(function(e,t){var r=e.styles,n=dg([r],void 0,Ce.useContext(hg)),i=Ce.useRef();return B9(function(){var o=t.key+"-global",a=new t.sheet.constructor({key:o,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),s=!1,l=document.querySelector('style[data-emotion="'+o+" "+n.name+'"]');return t.sheet.tags.length&&(a.before=t.sheet.tags[0]),l!==null&&(s=!0,l.setAttribute("data-emotion",o),a.hydrate([l])),i.current=[a,s],function(){a.flush()}},[t]),B9(function(){var o=i.current,a=o[0],s=o[1];if(s){o[1]=!1;return}if(n.next!==void 0&&y3(t,n.next,!0),a.tags.length){var l=a.tags[a.tags.length-1].nextElementSibling;a.before=l,a.flush()}t.insert("",n,a,!1)},[t,n.name]),null});function un(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return dg(t)}function mc(){var e=un.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var hMe=function(t){return t()},pMe=Ce[`useInsertionEffect${Math.random()}`.slice(0,18)]?Ce[`useInsertionEffect${Math.random()}`.slice(0,18)]:!1,fMe=pMe||hMe,gMe=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,mMe=A9(function(e){return gMe.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),vMe=!1,yMe=mMe,bMe=function(t){return t!=="theme"},NW=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?yMe:bMe},RW=function(t,r,n){var i;if(r){var o=r.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&n&&(i=t.__emotion_forwardProp),i},xMe=function(t){var r=t.cache,n=t.serialized,i=t.isStringTag;return v3(r,n,i),fMe(function(){return y3(r,n,i)}),null},wMe=function e(t,r){var n=t.__emotion_real===t,i=n&&t.__emotion_base||t,o,a;r!==void 0&&(o=r.label,a=r.target);var s=RW(t,r,n),l=s||NW(i),c=!l("as");return function(){var d=arguments,h=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&h.push("label:"+o+";"),d[0]==null||d[0].raw===void 0)h.push.apply(h,d);else{var u=d[0];h.push(u[0]);for(var g=d.length,f=1;f<g;f++)h.push(d[f],u[f])}var p=w3(function(x,S,j){var U=c&&x.as||i,B="",R=[],E=x;if(x.theme==null){E={};for(var N in x)E[N]=x[N];E.theme=Ce.useContext(hg)}typeof x.className=="string"?B=O9(S.registered,R,x.className):x.className!=null&&(B=x.className+" ");var M=dg(h.concat(R),S.registered,E);B+=S.key+"-"+M.name,a!==void 0&&(B+=" "+a);var $=c&&s===void 0?NW(U):l,T={};for(var C in x)c&&C==="as"||$(C)&&(T[C]=x[C]);return T.className=B,j&&(T.ref=j),Ce.createElement(Ce.Fragment,null,Ce.createElement(xMe,{cache:S,serialized:M,isStringTag:typeof U=="string"}),Ce.createElement(U,T))});return p.displayName=o!==void 0?o:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",p.defaultProps=t.defaultProps,p.__emotion_real=p,p.__emotion_base=i,p.__emotion_styles=h,p.__emotion_forwardProp=s,Object.defineProperty(p,"toString",{value:function(){return a===void 0&&vMe?"NO_COMPONENT_SELECTOR":"."+a}}),p.withComponent=function(x,S){var j=e(x,xC({},r,S,{shouldForwardProp:RW(p,S,!0)}));return j.apply(void 0,h)},p}},CMe=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],Ye=wMe.bind(null);CMe.forEach(function(e){Ye[e]=Ye(e)});var _Me=Object.defineProperty,SMe=Object.defineProperties,kMe=Object.getOwnPropertyDescriptors,D_=Object.getOwnPropertySymbols,FW=Object.prototype.hasOwnProperty,jW=Object.prototype.propertyIsEnumerable,Pd=Math.pow,eL=(e,t,r)=>t in e?_Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Me=(e,t)=>{for(var r in t||(t={}))FW.call(t,r)&&eL(e,r,t[r]);if(D_)for(var r of D_(t))jW.call(t,r)&&eL(e,r,t[r]);return e},We=(e,t)=>SMe(e,kMe(t)),tL=e=>typeof e=="symbol"?e:e+"",wt=(e,t)=>{var r={};for(var n in e)FW.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&D_)for(var n of D_(e))t.indexOf(n)<0&&jW.call(e,n)&&(r[n]=e[n]);return r},Re=(e,t,r)=>(eL(e,typeof t!="symbol"?t+"":t,r),r),BW=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(c){i(c)}},a=l=>{try{s(r.throw(l))}catch(c){i(c)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});const MMe={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};let TMe=class y9{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,r)}init(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||MMe,this.options=r,this.debug=r.debug}log(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}warn(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}error(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"error","")}deprecate(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,n,i){return i&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new y9(this.logger,Me({prefix:`${this.prefix}:${t}:`},this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new y9(this.logger,t)}};var vc=new TMe;let L_=class{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(n=>{this.observers[n]=this.observers[n]||[],this.observers[n].push(r)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(n=>n!==r)}}emit(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.observers[t]&&[].concat(this.observers[t]).forEach(o=>{o(...n)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(o=>{o.apply(o,[t,...n])})}};function Py(){let e,t;const r=new Promise((n,i)=>{e=n,t=i});return r.resolve=e,r.reject=t,r}function zW(e){return e==null?"":""+e}function AMe(e,t,r){e.forEach(n=>{t[n]&&(r[n]=t[n])})}function rL(e,t,r){function n(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!e||typeof e=="string"}const o=typeof t!="string"?[].concat(t):t.split(".");for(;o.length>1;){if(i())return{};const a=n(o.shift());!e[a]&&r&&(e[a]=new r),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:n(o.shift())}}function $W(e,t,r){const{obj:n,k:i}=rL(e,t,Object);n[i]=r}function EMe(e,t,r,n){const{obj:i,k:o}=rL(e,t,Object);i[o]=i[o]||[],i[o].push(r)}function O_(e,t){const{obj:r,k:n}=rL(e,t);if(r)return r[n]}function PMe(e,t,r){const n=O_(e,r);return n!==void 0?n:O_(t,r)}function WW(e,t,r){for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?typeof e[n]=="string"||e[n]instanceof String||typeof t[n]=="string"||t[n]instanceof String?r&&(e[n]=t[n]):WW(e[n],t[n],r):e[n]=t[n]);return e}function Ig(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var DMe={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function LMe(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>DMe[t]):e}const OMe=[" ",",","?","!",";"];function IMe(e,t,r){t=t||"",r=r||"";const n=OMe.filter(a=>t.indexOf(a)<0&&r.indexOf(a)<0);if(n.length===0)return!0;const i=new RegExp(`(${n.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(r);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function I_(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const n=t.split(r);let i=e;for(let o=0;o<n.length;++o){if(!i||typeof i[n[o]]=="string"&&o+1<n.length)return;if(i[n[o]]===void 0){let a=2,s=n.slice(o,o+a).join(r),l=i[s];for(;l===void 0&&n.length>o+a;)a++,s=n.slice(o,o+a).join(r),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}const c=n.slice(o+a).join(r);return c?I_(l,c,r):void 0}i=i[n[o]]}return i}function N_(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class HW extends L_{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s=[t,r];n&&typeof n!="string"&&(s=s.concat(n)),n&&typeof n=="string"&&(s=s.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(s=t.split("."));const l=O_(this.data,s);return l||!a||typeof n!="string"?l:I_(this.data&&this.data[t]&&this.data[t][r],n,o)}addResource(t,r,n,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,r];n&&(s=s.concat(a?n.split(a):n)),t.indexOf(".")>-1&&(s=t.split("."),i=r,r=s[1]),this.addNamespaces(r),$W(this.data,s,i),o.silent||this.emit("added",t,r,n,i)}addResources(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in n)(typeof n[o]=="string"||Object.prototype.toString.apply(n[o])==="[object Array]")&&this.addResource(t,r,o,n[o],{silent:!0});i.silent||this.emit("added",t,r,n)}addResourceBundle(t,r,n,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},s=[t,r];t.indexOf(".")>-1&&(s=t.split("."),i=n,n=r,r=s[1]),this.addNamespaces(r);let l=O_(this.data,s)||{};i?WW(l,n,o):l=Me(Me({},l),n),$W(this.data,s,l),a.silent||this.emit("added",t,r,n)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Me({},this.getResource(t,r)):this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(n=>r[n]&&Object.keys(r[n]).length>0)}toJSON(){return this.data}}var UW={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,r,n,i))}),t}};const GW={};let VW=class _ye extends L_{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),AMe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=vc.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const n=this.resolve(t,r);return n&&n.res!==void 0}extractFromKey(t,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const i=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=r.ns||this.options.defaultNS||[];const a=n&&t.indexOf(n)>-1,s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!IMe(t,n,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};const c=t.split(n);(n!==i||n===i&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(i)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof r=="object"&&(r=Me({},r)),r||(r={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],r),l=s[s.length-1],c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(d){const U=r.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${U}${a}`,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l}:`${l}${U}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:c,usedNS:l}:a}const h=this.resolve(t,r);let u=h&&h.res;const g=h&&h.usedKey||a,f=h&&h.exactUsedKey||a,p=Object.prototype.toString.apply(u),x=["[object Number]","[object Function]","[object RegExp]"],S=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject;if(j&&u&&typeof u!="string"&&typeof u!="boolean"&&typeof u!="number"&&x.indexOf(p)<0&&!(typeof S=="string"&&p==="[object Array]")){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const U=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,u,We(Me({},r),{ns:s})):`key '${a} (${this.language})' returned an object instead of string.`;return i?(h.res=U,h):U}if(o){const U=p==="[object Array]",B=U?[]:{},R=U?f:g;for(const E in u)if(Object.prototype.hasOwnProperty.call(u,E)){const N=`${R}${o}${E}`;B[E]=this.translate(N,We(Me({},r),{joinArrays:!1,ns:s})),B[E]===N&&(B[E]=u[E])}u=B}}else if(j&&typeof S=="string"&&p==="[object Array]")u=u.join(S),u&&(u=this.extendTranslation(u,t,r,n));else{let U=!1,B=!1;const R=r.count!==void 0&&typeof r.count!="string",E=_ye.hasDefaultValue(r),N=R?this.pluralResolver.getSuffix(c,r.count,r):"",M=r.ordinal&&R?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",$=r[`defaultValue${N}`]||r[`defaultValue${M}`]||r.defaultValue;!this.isValidLookup(u)&&E&&(U=!0,u=$),this.isValidLookup(u)||(B=!0,u=a);const T=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:u,C=E&&$!==u&&this.options.updateMissing;if(B||U||C){if(this.logger.log(C?"updateKey":"missingKey",c,l,a,C?$:u),o){const F=this.resolve(a,We(Me({},r),{keySeparator:!1}));F&&F.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 y=[];const D=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&D&&D[0])for(let F=0;F<D.length;F++)y.push(D[F]);else this.options.saveMissingTo==="all"?y=this.languageUtils.toResolveHierarchy(r.lng||this.language):y.push(r.lng||this.language);const k=(F,V,q)=>{const z=E&&q!==u?q:T;this.options.missingKeyHandler?this.options.missingKeyHandler(F,l,V,z,C,r):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(F,l,V,z,C,r),this.emit("missingKey",F,l,V,u)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?y.forEach(F=>{this.pluralResolver.getSuffixes(F,r).forEach(V=>{k([F],a+V,r[`defaultValue${V}`]||$)})}):k(y,a,$))}u=this.extendTranslation(u,t,r,h,n),B&&u===a&&this.options.appendNamespaceToMissingKey&&(u=`${l}:${a}`),(B||U)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?u=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,U?u:void 0):u=this.options.parseMissingKeyHandler(u))}return i?(h.res=u,h):u}extendTranslation(t,r,n,i,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,Me(Me({},this.options.interpolation.defaultVariables),n),i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(We(Me({},n),{interpolation:Me(Me({},this.options.interpolation),n.interpolation)}));const c=typeof t=="string"&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(c){const u=t.match(this.interpolator.nestingRegexp);d=u&&u.length}let h=n.replace&&typeof n.replace!="string"?n.replace:n;if(this.options.interpolation.defaultVariables&&(h=Me(Me({},this.options.interpolation.defaultVariables),h)),t=this.interpolator.interpolate(t,h,n.lng||this.language,n),c){const u=t.match(this.interpolator.nestingRegexp),g=u&&u.length;d<g&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(n.lng=i.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var u=arguments.length,g=new Array(u),f=0;f<u;f++)g[f]=arguments[f];return o&&o[0]===g[0]&&!n.context?(a.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${r[0]}`),null):a.translate(...g,r)},n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,l=typeof s=="string"?[s]:s;return t!=null&&l&&l.length&&n.applyPostProcessor!==!1&&(t=UW.handle(l,t,r,this.options&&this.options.postProcessPassResolved?Me({i18nResolved:i},n):n,this)),t}resolve(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,i,o,a,s;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,r),d=c.key;i=d;let h=c.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const u=r.count!==void 0&&typeof r.count!="string",g=u&&!r.ordinal&&r.count===0&&this.pluralResolver.shouldUseIntlApi(),f=r.context!==void 0&&(typeof r.context=="string"||typeof r.context=="number")&&r.context!=="",p=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);h.forEach(x=>{this.isValidLookup(n)||(s=x,!GW[`${p[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(GW[`${p[0]}-${x}`]=!0,this.logger.warn(`key "${i}" for languages "${p.join(", ")}" won't get resolved as namespace "${s}" 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!!!")),p.forEach(S=>{if(this.isValidLookup(n))return;a=S;const j=[d];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(j,d,S,x,r);else{let B;u&&(B=this.pluralResolver.getSuffix(S,r.count,r));const R=`${this.options.pluralSeparator}zero`,E=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(j.push(d+B),r.ordinal&&B.indexOf(E)===0&&j.push(d+B.replace(E,this.options.pluralSeparator)),g&&j.push(d+R)),f){const N=`${d}${this.options.contextSeparator}${r.context}`;j.push(N),u&&(j.push(N+B),r.ordinal&&B.indexOf(E)===0&&j.push(N+B.replace(E,this.options.pluralSeparator)),g&&j.push(N+R))}}let U;for(;U=j.pop();)this.isValidLookup(n)||(o=U,n=this.getResource(S,x,U,r))}))})}),{res:n,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,r,n,i):this.resourceStore.getResource(t,r,n,i)}static hasDefaultValue(t){const r="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r===n.substring(0,r.length)&&t[n]!==void 0)return!0;return!1}};function nL(e){return e.charAt(0).toUpperCase()+e.slice(1)}class YW{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=vc.create("languageUtils")}getScriptPartFromCode(t){if(t=N_(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=N_(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const r=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map(i=>i.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=nL(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),r.indexOf(n[1].toLowerCase())>-1&&(n[1]=nL(n[1].toLowerCase())),r.indexOf(n[2].toLowerCase())>-1&&(n[2]=nL(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(n=>{if(r)return;const i=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(i))&&(r=i)}),!r&&this.options.supportedLngs&&t.forEach(n=>{if(r)return;const i=this.getLanguagePartFromCode(n);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.find(o=>{if(o===i||!(o.indexOf("-")<0&&i.indexOf("-")<0)&&o.indexOf(i)===0)return o})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!r)return t.default||[];let n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}toResolveHierarchy(t,r){const n=this.getFallbackCodes(r||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),n.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}let NMe=[{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}],RMe={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const FMe=["v1","v2","v3"],jMe=["v4"],qW={zero:0,one:1,two:2,few:3,many:4,other:5};function BMe(){const e={};return NMe.forEach(t=>{t.lngs.forEach(r=>{e[r]={numbers:t.nr,plurals:RMe[t.fc]}})}),e}class zMe{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=r,this.logger=vc.create("pluralResolver"),(!this.options.compatibilityJSON||jMe.includes(this.options.compatibilityJSON))&&(typeof Intl=="undefined"||!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=BMe()}addRule(t,r){this.rules[t]=r}getRule(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(N_(t),{type:r.ordinal?"ordinal":"cardinal"})}catch(n){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(i=>`${r}${i}`)}getSuffixes(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(t,r);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((i,o)=>qW[i]-qW[o]).map(i=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i}`):n.numbers.map(i=>this.getSuffix(t,i,r)):[]}getSuffix(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,n);return i?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i.select(r)}`:this.getSuffixRetroCompatible(i,r):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,r){const n=t.noAbs?t.plurals(r):t.plurals(Math.abs(r));let i=t.numbers[n];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const o=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!FMe.includes(this.options.compatibilityJSON)}}function ZW(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=PMe(e,t,r);return!o&&i&&typeof r=="string"&&(o=I_(e,r,n),o===void 0&&(o=I_(t,r,n))),o}class $Me{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=vc.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(r=>r),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const r=t.interpolation;this.escape=r.escape!==void 0?r.escape:LMe,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Ig(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Ig(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Ig(r.nestingPrefix):r.nestingPrefixEscaped||Ig("$t("),this.nestingSuffix=r.nestingSuffix?Ig(r.nestingSuffix):r.nestingSuffixEscaped||Ig(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const r=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(r,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(t,r,n,i){let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(g){return g.replace(/\$/g,"$$$$")}const d=g=>{if(g.indexOf(this.formatSeparator)<0){const S=ZW(r,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(S,void 0,n,We(Me(Me({},i),r),{interpolationkey:g})):S}const f=g.split(this.formatSeparator),p=f.shift().trim(),x=f.join(this.formatSeparator).trim();return this.format(ZW(r,l,p,this.options.keySeparator,this.options.ignoreJSONStructure),x,n,We(Me(Me({},i),r),{interpolationkey:p}))};this.resetRegExp();const h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,u=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>c(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?c(this.escape(g)):c(g)}].forEach(g=>{for(s=0;o=g.regex.exec(t);){const f=o[1].trim();if(a=d(f),a===void 0)if(typeof h=="function"){const x=h(t,o,i);a=typeof x=="string"?x:""}else if(i&&Object.prototype.hasOwnProperty.call(i,f))a="";else if(u){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${f} for interpolating ${t}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=zW(a));const p=g.safeValue(a);if(t=t.replace(o[0],p),u?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=o[0].length):g.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;function s(l,c){const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const h=l.split(new RegExp(`${d}[ ]*{`));let u=`{${h[1]}`;l=h[0],u=this.interpolate(u,a);const g=u.match(/'/g),f=u.match(/"/g);(g&&g.length%2===0&&!f||f.length%2!==0)&&(u=u.replace(/'/g,'"'));try{a=JSON.parse(u),c&&(a=Me(Me({},c),a))}catch(p){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,p),`${l}${d}${u}`}return delete a.defaultValue,l}for(;i=this.nestingRegexp.exec(t);){let l=[];a=Me({},n),a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let c=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const d=i[1].split(this.formatSeparator).map(h=>h.trim());i[1]=d.shift(),l=d,c=!0}if(o=r(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=zW(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),c&&(o=l.reduce((d,h)=>this.format(d,h,n.lng,We(Me({},n),{interpolationkey:i[1].trim()})),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}function WMe(e){let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const i=n[1].substring(0,n[1].length-1);t==="currency"&&i.indexOf(":")<0?r.currency||(r.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?r.range||(r.range=i.trim()):i.split(";").forEach(o=>{if(!o)return;const[a,...s]=o.split(":"),l=s.join(":").trim().replace(/^'+|'+$/g,"");r[a.trim()]||(r[a.trim()]=l),l==="false"&&(r[a.trim()]=!1),l==="true"&&(r[a.trim()]=!0),isNaN(l)||(r[a.trim()]=parseInt(l,10))})}return{formatName:t,formatOptions:r}}function Ng(e){const t={};return function(r,n,i){const o=n+JSON.stringify(i);let a=t[o];return a||(a=e(N_(n),i),t[o]=a),a(r)}}class HMe{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=vc.create("formatter"),this.options=t,this.formats={number:Ng((r,n)=>{const i=new Intl.NumberFormat(r,Me({},n));return o=>i.format(o)}),currency:Ng((r,n)=>{const i=new Intl.NumberFormat(r,We(Me({},n),{style:"currency"}));return o=>i.format(o)}),datetime:Ng((r,n)=>{const i=new Intl.DateTimeFormat(r,Me({},n));return o=>i.format(o)}),relativetime:Ng((r,n)=>{const i=new Intl.RelativeTimeFormat(r,Me({},n));return o=>i.format(o,n.range||"day")}),list:Ng((r,n)=>{const i=new Intl.ListFormat(r,Me({},n));return o=>i.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=Ng(r)}format(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return r.split(this.formatSeparator).reduce((o,a)=>{const{formatName:s,formatOptions:l}=WMe(a);if(this.formats[s]){let c=o;try{const d=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},h=d.locale||d.lng||i.locale||i.lng||n;c=this.formats[s](o,h,Me(Me(Me({},l),i),d))}catch(d){this.logger.warn(d)}return c}else this.logger.warn(`there was no format function for ${s}`);return o},t)}}function UMe(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class GMe extends L_{constructor(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=i,this.logger=vc.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,i.backend,i)}queueLoad(t,r,n,i){const o={},a={},s={},l={};return t.forEach(c=>{let d=!0;r.forEach(h=>{const u=`${c}|${h}`;!n.reload&&this.store.hasResourceBundle(c,h)?this.state[u]=2:this.state[u]<0||(this.state[u]===1?a[u]===void 0&&(a[u]=!0):(this.state[u]=1,d=!1,a[u]===void 0&&(a[u]=!0),o[u]===void 0&&(o[u]=!0),l[h]===void 0&&(l[h]=!0)))}),d||(s[c]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,r,n){const i=t.split("|"),o=i[0],a=i[1];r&&this.emit("failedLoading",o,a,r),n&&this.store.addResourceBundle(o,a,n),this.state[t]=r?-1:2;const s={};this.queue.forEach(l=>{EMe(l.loaded,[o],a),UMe(l,t),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{s[c]||(s[c]={});const d=l.loaded[c];d.length&&d.forEach(h=>{s[c][h]===void 0&&(s[c][h]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,r,n){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:n,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(c&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,n,i+1,o*2,a)},o);return}a(c,d)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(t,r);c&&typeof c.then=="function"?c.then(d=>s(null,d)).catch(s):s(null,c)}catch(c){s(c)}return}return l(t,r,s)}prepareLoading(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=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."),i&&i();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof r=="string"&&(r=[r]);const o=this.queueLoad(t,r,n,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,r,n){this.prepareLoading(t,r,{},n)}reload(t,r,n){this.prepareLoading(t,r,{reload:!0},n)}loadOne(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=t.split("|"),i=n[0],o=n[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${r}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${r}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,r,n,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(r)){this.logger.warn(`did not save key "${n}" as the namespace "${r}" 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(!(n==null||n==="")){if(this.backend&&this.backend.create){const l=We(Me({},a),{isUpdate:o}),c=this.backend.create.bind(this.backend);if(c.length<6)try{let d;c.length===5?d=c(t,r,n,i,l):d=c(t,r,n,i),d&&typeof d.then=="function"?d.then(h=>s(null,h)).catch(s):s(null,d)}catch(d){s(d)}else c(t,r,n,i,s,l)}!t||!t[0]||this.store.addResource(t[0],r,n,i)}}}function XW(){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 r=e[3]||e[2];Object.keys(r).forEach(n=>{t[n]=r[n]})}return t},interpolation:{escapeValue:!0,format:(e,t,r,n)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function KW(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function R_(){}function VMe(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{typeof e[t]=="function"&&(e[t]=e[t].bind(e))})}class Dy extends L_{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=KW(t),this.services={},this.logger=vc,this.modules={external:[]},VMe(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(){var t=this;let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;typeof r=="function"&&(n=r,r={}),!r.defaultNS&&r.defaultNS!==!1&&r.ns&&(typeof r.ns=="string"?r.defaultNS=r.ns:r.ns.indexOf("translation")<0&&(r.defaultNS=r.ns[0]));const i=XW();this.options=Me(Me(Me({},i),this.options),KW(r)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Me(Me({},i.interpolation),this.options.interpolation)),r.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=r.keySeparator),r.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=r.nsSeparator);function o(l){return l?typeof l=="function"?new l:l:null}if(!this.options.isClone){this.modules.logger?vc.init(o(this.modules.logger),this.options):vc.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:typeof Intl!="undefined"&&(l=HMe);const c=new YW(this.options);this.store=new HW(this.options.resources,this.options);const d=this.services;d.logger=vc,d.resourceStore=this.store,d.languageUtils=c,d.pluralResolver=new zMe(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(d.formatter=o(l),d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new $Me(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new GMe(o(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",function(h){for(var u=arguments.length,g=new Array(u>1?u-1:0),f=1;f<u;f++)g[f-1]=arguments[f];t.emit(h,...g)}),this.modules.languageDetector&&(d.languageDetector=o(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=o(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new VW(this.services,this.options),this.translator.on("*",function(h){for(var u=arguments.length,g=new Array(u>1?u-1:0),f=1;f<u;f++)g[f-1]=arguments[f];t.emit(h,...g)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=R_),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[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(l=>{this[l]=function(){return t.store[l](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=function(){return t.store[l](...arguments),t}});const a=Py(),s=()=>{const l=(c,d)=>{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),a.resolve(d),n(c,d)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),a}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R_;const n=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(n&&n.toLowerCase()==="cimode")return r();const i=[],o=a=>{a&&this.services.languageUtils.toResolveHierarchy(a).forEach(s=>{i.indexOf(s)<0&&i.push(s)})};n?o(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(a=>o(a)),this.options.preload&&this.options.preload.forEach(a=>o(a)),this.services.backendConnector.load(i,this.options.ns,a=>{!a&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(a)})}else r(null)}reloadResources(t,r,n){const i=Py();return t||(t=this.languages),r||(r=this.options.ns),n||(n=R_),this.services.backendConnector.reload(t,r,o=>{i.resolve(),n(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&UW.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let r=0;r<this.languages.length;r++){const n=this.languages[r];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(t,r){var n=this;this.isLanguageChangingTo=t;const i=Py();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,c)=>{c?(o(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve(function(){return n.t(...arguments)}),r&&r(l,function(){return n.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const c=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);c&&(this.language||o(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,d=>{a(d,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,r,n){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var c=arguments.length,d=new Array(c>2?c-2:0),h=2;h<c;h++)d[h-2]=arguments[h];l=i.options.overloadTranslationOptionHandler([a,s].concat(d))}else l=Me({},s);l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix=l.keyPrefix||n||o.keyPrefix;const u=i.options.keySeparator||".";let g;return l.keyPrefix&&Array.isArray(a)?g=a.map(f=>`${l.keyPrefix}${u}${f}`):g=l.keyPrefix?`${l.keyPrefix}${u}${a}`:a,i.t(g,l)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=r,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let r=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 n=r.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const c=this.services.backendConnector.state[`${s}|${l}`];return c===-1||c===2};if(r.precheck){const s=r.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(n,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(n,t)&&(!i||a(o,t)))}loadNamespaces(t,r){const n=Py();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{n.resolve(),r&&r(i)}),n):(r&&r(),Promise.resolve())}loadLanguages(t,r){const n=Py();typeof t=="string"&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0);return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{n.resolve(),r&&r(a)}),n):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const r=["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"],n=this.services&&this.services.languageUtils||new YW(XW());return r.indexOf(n.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return new Dy(t,r)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:R_;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const i=We(Me(Me({},this.options),t),{isClone:!0}),o=new Dy(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(a=>{o[a]=this[a]}),o.services=Me({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new HW(this.store.data,i),o.services.resourceStore=o.store),o.translator=new VW(o.services,i),o.translator.on("*",function(a){for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;c<s;c++)l[c-1]=arguments[c];o.emit(a,...l)}),o.init(i,r),o.translator.options=i,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 QW=Dy.createInstance();QW.createInstance=Dy.createInstance;const YMe={error:"Error"},qMe={error:"Помилка"},JW="common",ZMe={en:YMe,uk:qMe},yc=QW.createInstance({defaultNS:JW,resources:XMe(ZMe,JW),lng:"en",fallbackLng:"en"}),eH={i18nextInstance:yc,initPromise:yc.init().then(()=>yc)},F_=new Map;F_.set("common",eH);const tH=e=>{if(F_.has(e.namespace))return F_.get(e.namespace);if(e.plugins)for(const o of e.plugins)yc.use(o);Object.keys(e.resource).forEach(o=>{yc.addResourceBundle(o,e.namespace,e.resource[o])});const t=yc.cloneInstance({defaultNS:e.namespace});let r=eH.initPromise.then(()=>t);t.on("languageChanged",o=>{yc.language!==o&&yc.changeLanguage(o)}),yc.on("languageChanged",o=>{t.language!==o&&t.changeLanguage(o)});const n=e.language||"en";yc.language!==n&&(r=r.then(()=>t.changeLanguage(n)).then(()=>t));const i={initPromise:r,i18nextInstance:t};return F_.set(e.namespace,i),i};function XMe(e,t){return Object.keys(e).reduce((r,n)=>(r[n]={[t]:e[n]},r),{})}function KMe(e){return e&&e.replace(new RegExp("(?<!\\\\)'","g"),"\\'")}function QMe(e,t){if(!e||typeof e!="string")return e;const r=new URL(e);return r.origin+(r.pathname.endsWith("/")?r.pathname:r.pathname+"/")+""}var rH=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function up(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function JMe(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),r}var j_={exports:{}},nH;function eTe(){if(nH)return j_.exports;nH=1;var e=typeof Reflect=="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(B,R,E){return Function.prototype.apply.call(B,R,E)},r;e&&typeof e.ownKeys=="function"?r=e.ownKeys:Object.getOwnPropertySymbols?r=function(B){return Object.getOwnPropertyNames(B).concat(Object.getOwnPropertySymbols(B))}:r=function(B){return Object.getOwnPropertyNames(B)};function n(B){console&&console.warn&&console.warn(B)}var i=Number.isNaN||function(B){return B!==B};function o(){o.init.call(this)}j_.exports=o,j_.exports.once=S,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var a=10;function s(B){if(typeof B!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof B)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(B){if(typeof B!="number"||B<0||i(B))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+B+".");a=B}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(B){if(typeof B!="number"||B<0||i(B))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+B+".");return this._maxListeners=B,this};function l(B){return B._maxListeners===void 0?o.defaultMaxListeners:B._maxListeners}o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(B){for(var R=[],E=1;E<arguments.length;E++)R.push(arguments[E]);var N=B==="error",M=this._events;if(M!==void 0)N=N&&M.error===void 0;else if(!N)return!1;if(N){var $;if(R.length>0&&($=R[0]),$ instanceof Error)throw $;var T=new Error("Unhandled error."+($?" ("+$.message+")":""));throw T.context=$,T}var C=M[B];if(C===void 0)return!1;if(typeof C=="function")t(C,this,R);else for(var y=C.length,D=f(C,y),E=0;E<y;++E)t(D[E],this,R);return!0};function c(B,R,E,N){var M,$,T;if(s(E),$=B._events,$===void 0?($=B._events=Object.create(null),B._eventsCount=0):($.newListener!==void 0&&(B.emit("newListener",R,E.listener?E.listener:E),$=B._events),T=$[R]),T===void 0)T=$[R]=E,++B._eventsCount;else if(typeof T=="function"?T=$[R]=N?[E,T]:[T,E]:N?T.unshift(E):T.push(E),M=l(B),M>0&&T.length>M&&!T.warned){T.warned=!0;var C=new Error("Possible EventEmitter memory leak detected. "+T.length+" "+String(R)+" listeners added. Use emitter.setMaxListeners() to increase limit");C.name="MaxListenersExceededWarning",C.emitter=B,C.type=R,C.count=T.length,n(C)}return B}o.prototype.addListener=function(B,R){return c(this,B,R,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(B,R){return c(this,B,R,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(B,R,E){var N={fired:!1,wrapFn:void 0,target:B,type:R,listener:E},M=d.bind(N);return M.listener=E,N.wrapFn=M,M}o.prototype.once=function(B,R){return s(R),this.on(B,h(this,B,R)),this},o.prototype.prependOnceListener=function(B,R){return s(R),this.prependListener(B,h(this,B,R)),this},o.prototype.removeListener=function(B,R){var E,N,M,$,T;if(s(R),N=this._events,N===void 0)return this;if(E=N[B],E===void 0)return this;if(E===R||E.listener===R)--this._eventsCount===0?this._events=Object.create(null):(delete N[B],N.removeListener&&this.emit("removeListener",B,E.listener||R));else if(typeof E!="function"){for(M=-1,$=E.length-1;$>=0;$--)if(E[$]===R||E[$].listener===R){T=E[$].listener,M=$;break}if(M<0)return this;M===0?E.shift():p(E,M),E.length===1&&(N[B]=E[0]),N.removeListener!==void 0&&this.emit("removeListener",B,T||R)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(B){var R,E,N;if(E=this._events,E===void 0)return this;if(E.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):E[B]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete E[B]),this;if(arguments.length===0){var M=Object.keys(E),$;for(N=0;N<M.length;++N)$=M[N],$!=="removeListener"&&this.removeAllListeners($);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(R=E[B],typeof R=="function")this.removeListener(B,R);else if(R!==void 0)for(N=R.length-1;N>=0;N--)this.removeListener(B,R[N]);return this};function u(B,R,E){var N=B._events;if(N===void 0)return[];var M=N[R];return M===void 0?[]:typeof M=="function"?E?[M.listener||M]:[M]:E?x(M):f(M,M.length)}o.prototype.listeners=function(B){return u(this,B,!0)},o.prototype.rawListeners=function(B){return u(this,B,!1)},o.listenerCount=function(B,R){return typeof B.listenerCount=="function"?B.listenerCount(R):g.call(B,R)},o.prototype.listenerCount=g;function g(B){var R=this._events;if(R!==void 0){var E=R[B];if(typeof E=="function")return 1;if(E!==void 0)return E.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]};function f(B,R){for(var E=new Array(R),N=0;N<R;++N)E[N]=B[N];return E}function p(B,R){for(;R+1<B.length;R++)B[R]=B[R+1];B.pop()}function x(B){for(var R=new Array(B.length),E=0;E<R.length;++E)R[E]=B[E].listener||B[E];return R}function S(B,R){return new Promise(function(E,N){function M(T){B.removeListener(R,$),N(T)}function $(){typeof B.removeListener=="function"&&B.removeListener("error",M),E([].slice.call(arguments))}U(B,R,$,{once:!0}),R!=="error"&&j(B,M,{once:!0})})}function j(B,R,E){typeof B.on=="function"&&U(B,"error",R,E)}function U(B,R,E,N){if(typeof B.on=="function")N.once?B.once(R,E):B.on(R,E);else if(typeof B.addEventListener=="function")B.addEventListener(R,function M($){N.once&&B.removeEventListener(R,M),E($)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof B)}return j_.exports}var tTe=eTe();const Ly=up(tTe);function rTe(){this.__data__=[],this.size=0}function iH(e,t){return e===t||e!==e&&t!==t}function B_(e,t){for(var r=e.length;r--;)if(iH(e[r][0],t))return r;return-1}var nTe=Array.prototype,iTe=nTe.splice;function oTe(e){var t=this.__data__,r=B_(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():iTe.call(t,r,1),--this.size,!0}function aTe(e){var t=this.__data__,r=B_(t,e);return r<0?void 0:t[r][1]}function sTe(e){return B_(this.__data__,e)>-1}function lTe(e,t){var r=this.__data__,n=B_(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function Cu(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Cu.prototype.clear=rTe,Cu.prototype.delete=oTe,Cu.prototype.get=aTe,Cu.prototype.has=sTe,Cu.prototype.set=lTe;function cTe(){this.__data__=new Cu,this.size=0}function uTe(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}function dTe(e){return this.__data__.get(e)}function hTe(e){return this.__data__.has(e)}var pTe=typeof global=="object"&&global&&global.Object===Object&&global;const oH=pTe;var fTe=typeof self=="object"&&self&&self.Object===Object&&self,gTe=oH||fTe||Function("return this")();const bc=gTe;var mTe=bc.Symbol;const Rg=mTe;var aH=Object.prototype,vTe=aH.hasOwnProperty,yTe=aH.toString,Oy=Rg?Rg.toStringTag:void 0;function bTe(e){var t=vTe.call(e,Oy),r=e[Oy];try{e[Oy]=void 0;var n=!0}catch(o){}var i=yTe.call(e);return n&&(t?e[Oy]=r:delete e[Oy]),i}var xTe=Object.prototype,wTe=xTe.toString;function CTe(e){return wTe.call(e)}var _Te="[object Null]",STe="[object Undefined]",sH=Rg?Rg.toStringTag:void 0;function Fg(e){return e==null?e===void 0?STe:_Te:sH&&sH in Object(e)?bTe(e):CTe(e)}function Iy(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var kTe="[object AsyncFunction]",MTe="[object Function]",TTe="[object GeneratorFunction]",ATe="[object Proxy]";function lH(e){if(!Iy(e))return!1;var t=Fg(e);return t==MTe||t==TTe||t==kTe||t==ATe}var ETe=bc["__core-js_shared__"];const iL=ETe;var cH=function(){var e=/[^.]+$/.exec(iL&&iL.keys&&iL.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function PTe(e){return!!cH&&cH in e}var DTe=Function.prototype,LTe=DTe.toString;function dp(e){if(e!=null){try{return LTe.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var OTe=/[\\^$.*+?()[\]{}|]/g,ITe=/^\[object .+?Constructor\]$/,NTe=Function.prototype,RTe=Object.prototype,FTe=NTe.toString,jTe=RTe.hasOwnProperty,BTe=RegExp("^"+FTe.call(jTe).replace(OTe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zTe(e){if(!Iy(e)||PTe(e))return!1;var t=lH(e)?BTe:ITe;return t.test(dp(e))}function $Te(e,t){return e==null?void 0:e[t]}function jg(e,t){var r=$Te(e,t);return zTe(r)?r:void 0}var WTe=jg(bc,"Map");const Ny=WTe;var HTe=jg(Object,"create");const Ry=HTe;function UTe(){this.__data__=Ry?Ry(null):{},this.size=0}function GTe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var VTe="__lodash_hash_undefined__",YTe=Object.prototype,qTe=YTe.hasOwnProperty;function ZTe(e){var t=this.__data__;if(Ry){var r=t[e];return r===VTe?void 0:r}return qTe.call(t,e)?t[e]:void 0}var XTe=Object.prototype,KTe=XTe.hasOwnProperty;function QTe(e){var t=this.__data__;return Ry?t[e]!==void 0:KTe.call(t,e)}var JTe="__lodash_hash_undefined__";function eAe(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Ry&&t===void 0?JTe:t,this}function hp(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}hp.prototype.clear=UTe,hp.prototype.delete=GTe,hp.prototype.get=ZTe,hp.prototype.has=QTe,hp.prototype.set=eAe;function tAe(){this.size=0,this.__data__={hash:new hp,map:new(Ny||Cu),string:new hp}}function rAe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function z_(e,t){var r=e.__data__;return rAe(t)?r[typeof t=="string"?"string":"hash"]:r.map}function nAe(e){var t=z_(this,e).delete(e);return this.size-=t?1:0,t}function iAe(e){return z_(this,e).get(e)}function oAe(e){return z_(this,e).has(e)}function aAe(e,t){var r=z_(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function pp(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}pp.prototype.clear=tAe,pp.prototype.delete=nAe,pp.prototype.get=iAe,pp.prototype.has=oAe,pp.prototype.set=aAe;var sAe=200;function lAe(e,t){var r=this.__data__;if(r instanceof Cu){var n=r.__data__;if(!Ny||n.length<sAe-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new pp(n)}return r.set(e,t),this.size=r.size,this}function Dd(e){var t=this.__data__=new Cu(e);this.size=t.size}Dd.prototype.clear=cTe,Dd.prototype.delete=uTe,Dd.prototype.get=dTe,Dd.prototype.has=hTe,Dd.prototype.set=lAe;var cAe="__lodash_hash_undefined__";function uAe(e){return this.__data__.set(e,cAe),this}function dAe(e){return this.__data__.has(e)}function $_(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new pp;++t<r;)this.add(e[t])}$_.prototype.add=$_.prototype.push=uAe,$_.prototype.has=dAe;function hAe(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function pAe(e,t){return e.has(t)}var fAe=1,gAe=2;function uH(e,t,r,n,i,o){var a=r&fAe,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(e),d=o.get(t);if(c&&d)return c==t&&d==e;var h=-1,u=!0,g=r&gAe?new $_:void 0;for(o.set(e,t),o.set(t,e);++h<s;){var f=e[h],p=t[h];if(n)var x=a?n(p,f,h,t,e,o):n(f,p,h,e,t,o);if(x!==void 0){if(x)continue;u=!1;break}if(g){if(!hAe(t,function(S,j){if(!pAe(g,j)&&(f===S||i(f,S,r,n,o)))return g.push(j)})){u=!1;break}}else if(!(f===p||i(f,p,r,n,o))){u=!1;break}}return o.delete(e),o.delete(t),u}var mAe=bc.Uint8Array;const dH=mAe;function vAe(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}function yAe(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var bAe=1,xAe=2,wAe="[object Boolean]",CAe="[object Date]",_Ae="[object Error]",SAe="[object Map]",kAe="[object Number]",MAe="[object RegExp]",TAe="[object Set]",AAe="[object String]",EAe="[object Symbol]",PAe="[object ArrayBuffer]",DAe="[object DataView]",hH=Rg?Rg.prototype:void 0,oL=hH?hH.valueOf:void 0;function LAe(e,t,r,n,i,o,a){switch(r){case DAe:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case PAe:return!(e.byteLength!=t.byteLength||!o(new dH(e),new dH(t)));case wAe:case CAe:case kAe:return iH(+e,+t);case _Ae:return e.name==t.name&&e.message==t.message;case MAe:case AAe:return e==t+"";case SAe:var s=vAe;case TAe:var l=n&bAe;if(s||(s=yAe),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;n|=xAe,a.set(e,t);var d=uH(s(e),s(t),n,i,o,a);return a.delete(e),d;case EAe:if(oL)return oL.call(e)==oL.call(t)}return!1}function OAe(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var IAe=Array.isArray;const W_=IAe;function NAe(e,t,r){var n=t(e);return W_(e)?n:OAe(n,r(e))}function RAe(e,t){for(var r=-1,n=e==null?0:e.length,i=0,o=[];++r<n;){var a=e[r];t(a,r,e)&&(o[i++]=a)}return o}function FAe(){return[]}var jAe=Object.prototype,BAe=jAe.propertyIsEnumerable,pH=Object.getOwnPropertySymbols,zAe=pH?function(e){return e==null?[]:(e=Object(e),RAe(pH(e),function(t){return BAe.call(e,t)}))}:FAe;const $Ae=zAe;function WAe(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Bg(e){return e!=null&&typeof e=="object"}var HAe="[object Arguments]";function fH(e){return Bg(e)&&Fg(e)==HAe}var gH=Object.prototype,UAe=gH.hasOwnProperty,GAe=gH.propertyIsEnumerable,VAe=fH(function(){return arguments}())?fH:function(e){return Bg(e)&&UAe.call(e,"callee")&&!GAe.call(e,"callee")};const YAe=VAe;function qAe(){return!1}var mH=typeof Ge=="object"&&Ge&&!Ge.nodeType&&Ge,vH=mH&&typeof module=="object"&&module&&!module.nodeType&&module,ZAe=vH&&vH.exports===mH,yH=ZAe?bc.Buffer:void 0,XAe=yH?yH.isBuffer:void 0,KAe=XAe||qAe;const aL=KAe;var QAe=9007199254740991,JAe=/^(?:0|[1-9]\d*)$/;function eEe(e,t){var r=typeof e;return t=t==null?QAe:t,!!t&&(r=="number"||r!="symbol"&&JAe.test(e))&&e>-1&&e%1==0&&e<t}var tEe=9007199254740991;function bH(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=tEe}var rEe="[object Arguments]",nEe="[object Array]",iEe="[object Boolean]",oEe="[object Date]",aEe="[object Error]",sEe="[object Function]",lEe="[object Map]",cEe="[object Number]",uEe="[object Object]",dEe="[object RegExp]",hEe="[object Set]",pEe="[object String]",fEe="[object WeakMap]",gEe="[object ArrayBuffer]",mEe="[object DataView]",vEe="[object Float32Array]",yEe="[object Float64Array]",bEe="[object Int8Array]",xEe="[object Int16Array]",wEe="[object Int32Array]",CEe="[object Uint8Array]",_Ee="[object Uint8ClampedArray]",SEe="[object Uint16Array]",kEe="[object Uint32Array]",Zn={};Zn[vEe]=Zn[yEe]=Zn[bEe]=Zn[xEe]=Zn[wEe]=Zn[CEe]=Zn[_Ee]=Zn[SEe]=Zn[kEe]=!0,Zn[rEe]=Zn[nEe]=Zn[gEe]=Zn[iEe]=Zn[mEe]=Zn[oEe]=Zn[aEe]=Zn[sEe]=Zn[lEe]=Zn[cEe]=Zn[uEe]=Zn[dEe]=Zn[hEe]=Zn[pEe]=Zn[fEe]=!1;function MEe(e){return Bg(e)&&bH(e.length)&&!!Zn[Fg(e)]}function TEe(e){return function(t){return e(t)}}var xH=typeof Ge=="object"&&Ge&&!Ge.nodeType&&Ge,Fy=xH&&typeof module=="object"&&module&&!module.nodeType&&module,AEe=Fy&&Fy.exports===xH,sL=AEe&&oH.process,EEe=function(){try{var e=Fy&&Fy.require&&Fy.require("util").types;return e||sL&&sL.binding&&sL.binding("util")}catch(t){}}();const wH=EEe;var CH=wH&&wH.isTypedArray,PEe=CH?TEe(CH):MEe;const _H=PEe;var DEe=Object.prototype,LEe=DEe.hasOwnProperty;function OEe(e,t){var r=W_(e),n=!r&&YAe(e),i=!r&&!n&&aL(e),o=!r&&!n&&!i&&_H(e),a=r||n||i||o,s=a?WAe(e.length,String):[],l=s.length;for(var c in e)LEe.call(e,c)&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||eEe(c,l)))&&s.push(c);return s}var IEe=Object.prototype;function NEe(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||IEe;return e===r}function REe(e,t){return function(r){return e(t(r))}}var FEe=REe(Object.keys,Object);const jEe=FEe;var BEe=Object.prototype,zEe=BEe.hasOwnProperty;function $Ee(e){if(!NEe(e))return jEe(e);var t=[];for(var r in Object(e))zEe.call(e,r)&&r!="constructor"&&t.push(r);return t}function WEe(e){return e!=null&&bH(e.length)&&!lH(e)}function HEe(e){return WEe(e)?OEe(e):$Ee(e)}function SH(e){return NAe(e,HEe,$Ae)}var UEe=1,GEe=Object.prototype,VEe=GEe.hasOwnProperty;function YEe(e,t,r,n,i,o){var a=r&UEe,s=SH(e),l=s.length,c=SH(t),d=c.length;if(l!=d&&!a)return!1;for(var h=l;h--;){var u=s[h];if(!(a?u in t:VEe.call(t,u)))return!1}var g=o.get(e),f=o.get(t);if(g&&f)return g==t&&f==e;var p=!0;o.set(e,t),o.set(t,e);for(var x=a;++h<l;){u=s[h];var S=e[u],j=t[u];if(n)var U=a?n(j,S,u,t,e,o):n(S,j,u,e,t,o);if(!(U===void 0?S===j||i(S,j,r,n,o):U)){p=!1;break}x||(x=u=="constructor")}if(p&&!x){var B=e.constructor,R=t.constructor;B!=R&&"constructor"in e&&"constructor"in t&&!(typeof B=="function"&&B instanceof B&&typeof R=="function"&&R instanceof R)&&(p=!1)}return o.delete(e),o.delete(t),p}var qEe=jg(bc,"DataView");const lL=qEe;var ZEe=jg(bc,"Promise");const cL=ZEe;var XEe=jg(bc,"Set");const uL=XEe;var KEe=jg(bc,"WeakMap");const dL=KEe;var kH="[object Map]",QEe="[object Object]",MH="[object Promise]",TH="[object Set]",AH="[object WeakMap]",EH="[object DataView]",JEe=dp(lL),ePe=dp(Ny),tPe=dp(cL),rPe=dp(uL),nPe=dp(dL),fp=Fg;(lL&&fp(new lL(new ArrayBuffer(1)))!=EH||Ny&&fp(new Ny)!=kH||cL&&fp(cL.resolve())!=MH||uL&&fp(new uL)!=TH||dL&&fp(new dL)!=AH)&&(fp=function(e){var t=Fg(e),r=t==QEe?e.constructor:void 0,n=r?dp(r):"";if(n)switch(n){case JEe:return EH;case ePe:return kH;case tPe:return MH;case rPe:return TH;case nPe:return AH}return t});const PH=fp;var iPe=1,DH="[object Arguments]",LH="[object Array]",H_="[object Object]",oPe=Object.prototype,OH=oPe.hasOwnProperty;function aPe(e,t,r,n,i,o){var a=W_(e),s=W_(t),l=a?LH:PH(e),c=s?LH:PH(t);l=l==DH?H_:l,c=c==DH?H_:c;var d=l==H_,h=c==H_,u=l==c;if(u&&aL(e)){if(!aL(t))return!1;a=!0,d=!1}if(u&&!d)return o||(o=new Dd),a||_H(e)?uH(e,t,r,n,i,o):LAe(e,t,l,r,n,i,o);if(!(r&iPe)){var g=d&&OH.call(e,"__wrapped__"),f=h&&OH.call(t,"__wrapped__");if(g||f){var p=g?e.value():e,x=f?t.value():t;return o||(o=new Dd),i(p,x,r,n,o)}}return u?(o||(o=new Dd),YEe(e,t,r,n,i,o)):!1}function IH(e,t,r,n,i){return e===t?!0:e==null||t==null||!Bg(e)&&!Bg(t)?e!==e&&t!==t:aPe(e,t,r,n,IH,i)}function hL(e,t){return IH(e,t)}const ur={HEADERS:"headers",METADATA:"metadata",DATA:"data",GRAND:"grand",FINISH:"finish",ERROR:"error",TOTAL_ROWS:"totalRows",DATA_FINISH:"dataFinish",DATABARS:"dataBars",RANGE_MIN_MAX:"rangeMinMax"},sPe=[ur.ERROR,ur.HEADERS,ur.GRAND,ur.METADATA,ur.DATA,ur.DATA_FINISH,ur.TOTAL_ROWS,ur.DATABARS,ur.RANGE_MIN_MAX,ur.FINISH],or={ROWS:"rows",COLUMNS:"columns",MEASURES:"measures",SCOPE:"scope"},Mi={ASC:"asc",DESC:"desc"},Tr={SUB_TOTAL:"subTotal",GRAND_TOTAL:"grandTotal",MEASURE_TOP:"measureTop",MEASURE_BOTTOM:"measureBottom",CORNER:"corner"},NH={COLOR:"color",CONDITION:"condition"},_u={DATETIME:"datetime",TEXT:"text",NUMERIC:"numeric"},zg={MEMBER:"member",VALUE:"value",SUB_TOTAL:"subtotal",GRAND_TOTAL:"grandtotal"},Ld={MEMBER:"member",INDEX:"index",TITLE:"title",NAME:"name",AGG:"agg",DIM:"dim"};class lPe{constructor(t,r,n,i){Re(this,"rowIndex"),Re(this,"colIndex"),Re(this,"node"),Re(this,"parent"),Re(this,"childColCells",[]),Re(this,"childRowCells",[]),Re(this,"indexInParent",-1),Re(this,"siblingCount",0),this.rowIndex=t,this.colIndex=r,this.node=n,this.parent=i}isChild(){return!this.node}hasChildren(){return!!(this.childColCells.length||this.childRowCells.length)}hasColCell(){return this.childColCells.length>0}addColCell(t){this.childColCells.push(t)}getColCell(){return this.childColCells||[]}hasRowCell(){return this.childRowCells.length>0}addRowCell(t){this.childRowCells.push(t)}getRowCell(){return this.childRowCells||[]}getStopRowIndex(){return this.hasRowCell()?this.rowIndex+this.getRowCell().length:this.rowIndex}getStopColIndex(){return this.hasColCell()?this.colIndex+this.getColCell().length:this.colIndex}setIndexInParent(t,r){this.indexInParent=t,this.siblingCount=r}getIndexInParent(){return{indexInParent:this.indexInParent,siblingCount:this.siblingCount}}getParenPosition(){if(!this.parent)return;const t=(this.parent||"").match(/\d+/g)||[];return[Number(t[0]),Number(t[1])]}}const U_=["S&PManager","Cache"],G_=["null"];class jy{constructor(t=""){Re(this,"name"),Re(this,"log"),Re(this,"warn"),Re(this,"error"),Re(this,"console"),this.name=t,this.log=()=>{},this.warn=()=>{},this.error=()=>{},this.console=jy.createMockConsole(),this.createLogFn()}setName(t){this.name=t,this.createLogFn()}getName(){return this.name}createLogFn(){this.log=()=>{},this.warn=()=>{},this.error=()=>{}}isExcludedName(){return G_.length&&!this.hasNamePartsInList(G_)?!0:U_.length?this.hasNamePartsInList(U_):!1}hasNamePartsInList(t){const r=this.name.toLowerCase();return t.some(n=>r.includes(n.toLowerCase()))}static createMockConsole(){return{log:()=>{},warn:()=>{},error:()=>{}}}static createMock(){const t=jy.createMockConsole();return We(Me({setName:()=>{},getName:()=>""},t),{console:t})}}const cPe=e=>new jy(e),uPe=(e="")=>{U_.push(e.toLowerCase())},dPe=(e="")=>{G_.push(e.toLowerCase())},hPe=()=>{U_.length=0,G_.length=0},Od={Logger:jy,create:cPe,excludeLogs:uPe,includeLogs:dPe,clearIncludeExclude:hPe},RH=[Date,Error,RegExp,Promise];function FH(e,t=RH){return t.some(r=>e instanceof r)}function jH(e,t=[]){let r=!1;return t.forEach(n=>{e.includes(n)&&(r=!0)}),r}function BH(e=[],t,r){const n=[];return r&&e.forEach(i=>{n.push(`${i}.$`)}),e.length?e.forEach(i=>{n.push(`${i}.${t}`)}):n.push(t),n}function By(e){return!(e===null||typeof e=="undefined"||typeof e!="object")}function pPe(e,t){return By(e)&&e?Array.isArray(e)?!e.length:FH(e,t)?!1:!Object.keys(e).length:e==null}function fPe(e=""){const t=e.split(".");return t.length>1?(t.pop(),t.join(".")):t[0]}function zH(e,t,r){return e.length?jH(e,r):t.length?!jH(t,r):!0}function $H(e,t=[],r=[],n=[],i={},o={},a=[],s=[]){if(!By(e))return{commonIncludeKeys:[],commonExcludeKeys:[]};const l=a.indexOf(e);if(l!==-1)return s[l];a.push(e);const c=Object.keys(e),d=Array.isArray(e);let h=[],u=[];const g=[],f=[];if(c.forEach(p=>{const x=e[p],S=BH(n,p,d),j=n[0]||"&";i[j]=i[j]||[],o[j]=o[j]||[],S.forEach(U=>{(t||[]).includes(U)&&(i[j].push(U),h.push(U)),(t||[]).forEach(B=>{const R=fPe(B);(`${R}.$`===j||R===j)&&(i[j].includes(B)||i[j].push(B),h.includes(B)||h.push(B))}),(r||[]).includes(U)&&(o[j].push(U),u.push(U))}),By(x)&&$H(x,t,r,S,i,o,a,s)}),By(e)){let p=n[0]||"&";Array.isArray(e)&&(p=`${p}.$`),i[p]=(i[p]||[]).concat(g),h=h.concat(g),o[p]=(o[p]||[]).concat(f),u=h.concat(f)}return s.push({commonIncludeKeys:h,commonExcludeKeys:u}),{commonIncludeKeys:h,commonExcludeKeys:u}}function WH(e,t,r=new WeakMap){const{includeKeys:n,includeKeysObj:i,excludeKeys:o,excludeKeysObj:a,parentKeys:s=[],excludeEmpty:l,referenceClone:c}=t||{};if(!By(e)||FH(e,c))return e;if(r.has(e))return r.get(e);const d=Object.keys(e),h=Array.isArray(e),u=h?[]:{};r.set(e,u);const g=s[0]||"&",f=(i||{})[g]||[],p=(a||{})[g]||[];return d.forEach(x=>{const S=e[x];let j=[],U=!0;if(n||o?U=zH(n||[],o||[],[x]):(i||a)&&(j=BH(s,x,h),U=zH(f,p,j)),U){const B=WH(S,We(Me({},t),{parentKeys:j}),r);(!l||!pPe(B,c))&&(h?u.push(B):u[x]=B)}}),u}function Ta(e,t){const r=t||{},{include:n,exclude:i}=r,o=wt(r,["include","exclude"]);let a,s;(n||i)&&(a={},s={},$H(e,n,i,[],a,s));const l=We(Me({},o),{includeKeysObj:a,excludeKeysObj:s});return WH(e,l)}Ta.REFERENCE_CLONE_TYPES=RH;const pL=e=>t=>e.replace(/{{(\w+)}}/g,(r,n)=>typeof t[n]!="undefined"?t[n]:n),HH=(e,t)=>{let r,n,i=null;const o=(...a)=>{r?i=a:(e(...a),r=!0,i=null,n=setTimeout(()=>{r=!1,i&&(e(...i),i=null)},t))};return o.cancel=()=>{clearTimeout(n),r=!1},o},UH=(e,t)=>{const r={};return Object.keys(e).forEach(n=>{e[n]!==t[n]&&(r[n]=t[n])}),Object.keys(t).forEach(n=>{typeof r[n]=="undefined"&&e[n]!==t[n]&&(r[n]=t[n])}),r};function fL(e=!0){let t={},r=null;return({callback:n,indices:i})=>{const o=Object.keys(i),a=!e||o.every(l=>{const c=i[l];return Array.isArray(c)?c.length>0:c>=0}),s=o.length!==Object.keys(t).length||o.some(l=>{const c=t[l],d=i[l];return Array.isArray(d)?c.join(",")!==d.join(","):c!==d});return t=i,a&&s&&(r=n(i)),r}}function GH(e,t,r=0){for(let n=r;n<e.length;n+=1){const i=e[n];if(t(i,n,e))return n}return-1}const zy="$*$root$*$";function gPe(e,t,r,n){const i={value:e};return t&&(i.children=t),r&&(i.data=r),typeof n!="undefined"&&(i.index=n),i}function V_(e){return!!(e&&e.children&&e.children.length)}function Il(e){return e&&e.children||[]}function gL(e,t){e&&t&&Array.isArray(t)&&(e.children=t)}function mPe(e,t){e&&(e.level=t)}function vPe(e){return e&&typeof e.level!="undefined"?e.level||0:-1}function $g(e){if(!e)return;if(e&&!Array.isArray(e)&&e.value===zy)return e;const t={value:zy,children:[]};return Array.isArray(e)?t.children=e:(t.children||[])[0]=e,t}function VH(e,t,r=0){let n;if(!e||!t)return n;if(t(e,r)&&(n=e),V_(e)){const i=Il(e),o=i.length;for(let a=0;a<o;a+=1){const s=VH(i[a],t,r+1);if(s){n=s;break}}}return n}function yPe(e,t){if(!e&&!t)return;if(!e&&t)return $g(t);if(e&&!t)return $g(e);const r=$g(e),n=$g(t),i=r&&r.children||[],o=n&&n.children||[],a=i.concat(o);return $g(a)}const YH=(e,t=0)=>{if(!e||!e.isPart)return;e.level=t;const r=Il(e),n=r[r.length-1];return n&&YH(n,t+1)||e},qH=(e,t,r=0)=>{if(!e||!e.isPart)return;if(e.level=r,e&&t&&e.value===t.value&&e.level===t.level)return e;const n=Il(e)[0];return n&&qH(n,t,r+1)||e};function bPe(e,t){let r=YH(e),n=qH(t,r);r&&r.children&&Array.isArray(r.children)&&n&&n.children&&Array.isArray(n.children)&&n.children.length>0&&(r.children=r.children.concat(n.children),n.isHandled=!0);let i=!1;for(r=e,n=t;r&&r.children&&Array.isArray(r.children)&&n&&n.children&&Array.isArray(n.children)&&!n.isHandled;){const o=r.children;r=r.children[r.children.length-1];let a=0;for(n.children[0]&&!i&&(i=!Il(n.children[0]).some(s=>s.isPart),a=1);a<n.children.length;)o.push(n.children[a]),a+=1;n=n.children[0]}return e}function ZH(e,t,r){!e||!t||e.forEach(n=>{t(n,r),V_(n)&&ZH(Il(n),t,n)})}function XH(e,t=[],r=0,n={maxLevel:0}){return e.forEach(i=>{n.maxLevel<r&&(n.maxLevel=r),V_(i)?XH(Il(i),t,r+1,n):t.push(i)}),t}function Y_(e,t={}){if(t||(t={}),typeof t.callCount!="number"?t.callCount=1:t.callCount+=1,!e)return 0;let r=t.clearCache||!1;!Array.isArray(e)&&e.value===zy&&(r=!0);let n=1,i=[];return Array.isArray(e)?(n=0,i=e):e.children&&(i=Il(e)),i&&i.length&&(!r&&!Array.isArray(e)&&typeof e.childCount=="number"?n=e.childCount:(n=0,i.forEach(o=>{n+=Y_(o,t)}),Array.isArray(e)||(e.childCount=n))),n}function KH(e,t={}){if(t||(t={}),typeof t.callCount!="number"?t.callCount=1:t.callCount+=1,!e)return 0;let r=t.clearCache||!1;!Array.isArray(e)&&e.value===zy&&(r=!0);let n=0,i=[];if(e&&!Array.isArray(e)&&typeof e.value!="undefined"&&(n=1),Array.isArray(e)?(n=0,i=e):e.children&&(i=Il(e)),i&&i.length)if(!r&&!Array.isArray(e)&&typeof e.childDeep=="number")n+=e.childDeep;else{let o=0;i.forEach(a=>{const s=KH(a,t);s>o&&(o=s)}),n+=o,Array.isArray(e)||(e.childDeep=o)}return n}function QH(e=[],t=0,r){const n=[];let i=0,o=-1,a=-1;const s=e.length;if(typeof t=="number"&&typeof r=="number"&&t>r)throw new Error('Wrong "getNodesByChildCount" diapason');if(typeof t=="number"&&t<0)throw new Error('Wrong "from" index for "getNodesByChildCount"');for(let l=0;l<s;l+=1){const c=e[l],d=Y_(c);if(i+d>t&&(o<0&&(o=i),n.push(c),typeof r=="number"&&i+d>=r)){a=i+d;break}a=i+d,i+=d}return{nodes:n,start:o,stop:a}}function xPe(e){e.isMapped!==void 0&&(e.isMapped=void 0),e.minLevel!==void 0&&(e.minLevel=void 0),e.childCount!==void 0&&(e.childCount=void 0),e.childDeep!==void 0&&(e.childDeep=void 0)}function mL(e=[],t=0,r,n){const{cloneFn:i=Ta}=n||{},o=[],{nodes:a,start:s,stop:l}=QH(e,t,r),c=a.length;let d,h,u=!0;if(s<t){const g=a[0]||{},f=t-s;let p;c===1&&typeof r=="number"&&(p=r-s,u=!1),d=i(g,!0);const x=mL(Il(g),f,p,n);gL(d,x)}if(typeof r=="number"&&l>r&&u){const g=a[c-1]||{},f=0,p=Y_(g)-(l-r);h=i(g,!0);const x=mL(Il(g),f,p,n);gL(h,x)}return a.forEach((g,f)=>{if(d&&f===0)o.push(d);else if(h&&f===c-1)o.push(h);else{const p=i(g);o.push(p)}}),o}const Nt={ROOT:zy,create:gPe,hasChildren:V_,getChildren:Il,setChildren:gL,setLevel:mPe,getLevel:vPe,getLastLevelNodes:XH,iterateThroughTree:ZH,wrapInRootNode:$g,findNode:VH,merge:yPe,deepMerge:bPe,getChildLength:Y_,getDeepLength:KH,getNodesByChildCount:QH,getCutNodesByChildCount:mL,clearNodeCache:xPe},yo={FIRST:"first",LAST:"last",EVEN:"even",ODD:"odd"},Wg=(e,t)=>`${e}-${t}`;class wPe{constructor(t,r=!1,n){Re(this,"tree"),Re(this,"hasGrandTotals",!1),Re(this,"isVertical",!1),Re(this,"deep"),Re(this,"columns",[]),Re(this,"lastLevel",[]),Re(this,"map",{}),Re(this,"metadataCache",{}),Re(this,"valueNode"),Re(this,"grid"),this.isVertical=r,this.deep=n,t&&(this.tree=t,this.columns=this.cacheLevels(Nt.getChildren(this.tree)))}destroy(){this.tree=void 0,this.columns=[],this.lastLevel=[],this.map={},this.metadataCache={},this.valueNode=void 0,this.grid=void 0}getMainCellWidth(t,r,n,i,o={offsetTop:-1,columnsOffset:0}){const{columnsOffset:a=0}=o,s=this.getItem(t,r),l=s&&s.hasChildren()&&s.hasColCell();let c=Number.NaN,d=!0;if(s&&l){const h=s.getColCell(),u=n({index:r+a});c=h.reduce((g,f)=>{const p=n({index:f.colIndex+a});return p||(d=!1),g+p},u),c-=i,c=Math.ceil(c)}return d?c:Number.NaN}extend(t){t&&(this.grid=void 0,this.tree=Nt.merge(this.tree,t),this.columns=this.cacheLevels(Nt.getChildren(t),this.columns))}getGrid(){if(this.grid)return this.grid;let t=this.getTreeDeepsLength(),r=this.getTreeChildLength();return this.isVertical?([t,r]=[r,t],this.map=this.fillMapVertical(Nt.getChildren(this.tree),r,this.map)):this.map=this.fillMap(Nt.getChildren(this.tree),t,this.map),this.grid=Array.from(Array(t)).map((n,i)=>Array.from(Array(r)).map((o,a)=>{const s=Wg(i,a),l=this.map[s];if(!l)throw new Error(`Key "${s}" does not found in TreeService`);return l.node?l.node:l.parent})),this.grid}getPartialGrid(t,r){if(!this.isVertical)throw new Error('"getPartialGrid" can only be used for "vertical" tree');const n=this.getTreeDeepsLength(),i=Nt.getChildren(this.tree),{nodes:o,start:a,stop:s}=Nt.getNodesByChildCount(i,t,r);this.fillMapVertical(o,n,this.map,{parentRowIndex:a,parentColIndex:0,prevChildren:0,parentKey:""});const l=Math.max(a,t),c=Math.min(s,r),d=Math.max(0,c-t);return Array.from(Array(d)).map((h,u)=>Array.from(Array(n)).map((g,f)=>{const p=l+u,x=Wg(p,f),S=this.map[x];if(!S)throw new Error(`Key "${x}" does not found in TreeService`);return S.node?S.node:S.parent||""}))}getPartialTree(t,r,n){const i=Nt.getChildren(this.tree);return Nt.getCutNodesByChildCount(i,t,r,n)}getTreeNode(t,r){const n=this.getItem(t,r);if(n&&n.node)return n.node}isChildren(t,r){const n=this.getItem(t,r);if(n)return n.isChild();if(typeof this.deep=="number"&&(this.isVertical?r:t)<this.deep)return!0;throw new Error(`Item "${t}-${r}" does not found in TreeService`)}hasChildren(t,r){const n=this.getItem(t,r);if(n)return n.hasChildren();throw new Error(`Item "${t}-${r}" does not found in TreeService`)}getMainCellSpans(t,r){const n={},i=this.getItem(t,r);return i&&i.hasColCell()&&(n.colSpan=i.getColCell().length+1),i&&i.hasRowCell()&&(n.rowSpan=i.getRowCell().length+1),n}alignStartIndex(t,r=!1){let n=0,i=t;if(r&&(n=t,i=0),this.isVertical===r){let o=this.getItem(n,i);if(o&&o.isChild()&&(o=this.getItemByKey(o.parent||"")),o)return r?o.rowIndex:o.colIndex}return t}alignStopIndex(t,r=!1){let n=0,i=t;if(r&&(n=t,i=0),this.isVertical===r){let o=this.getItem(n,i);if(o&&o.isChild()&&(o=this.getItemByKey(o.parent||"")),o)return r?o.getStopRowIndex():o.getStopColIndex()}return t}getTreeChildLength(t=Nt.getChildren(this.tree),r){return Nt.getChildLength(t,r)}getTreeDeepsLength(t=Nt.getChildren(this.tree),r){return typeof this.deep!="undefined"&&this.deep!==void 0?this.deep:Nt.getDeepLength(t,r)}getLastLevelNodes(){return this.lastLevel}extractData(t){if(!t)return[];const r=t.getLastLevelNodes().map(n=>n.index);return this.getLastLevelNodes().map(n=>typeof n.data=="undefined"?[n.data]:r?r.map(i=>{let o;return typeof i!="undefined"&&n.data&&(o=n.data[i]),o}):n.data)}getMetadata(t,r,n){const i=this.getTreeDeepsLength();t===1/0&&(t=i&&i-1),r===1/0&&(r=i&&i-1);const o=`${t}-${r}`;if(this.metadataCache[o])return this.metadataCache[o];let a=this.getItemByKey(o);if(!a)throw new Error(`Can not find metadata info for ${o} cell`);let s=a?a.node:void 0;if(s||(a=this.getItemByKey(a.parent||"")),!a)throw new Error(`Can not find metadata info for parent ${o} cell`);s=a?a.node:void 0;const l=this.getItemByKey(`${t+1}-${r}`),c=l?l.node:void 0,d=s&&s.level||0,h=this.isVertical?a.getStopColIndex():a.getStopRowIndex();let{indexInParent:u,siblingCount:g}=a.getIndexInParent(),f=u;if(d===0&&(g=this.getTreeChildLength(),u=this.isVertical?a.rowIndex:a.colIndex,f=u+(this.isVertical?a.getRowCell().length:a.getColCell().length)),n){const j=n.to-n.from;g<=j&&f>j-1&&(f=j-1)}const p={levels:[],siblings:[],root:void 0,parent:void 0,valueNode:this.valueNode,nextNode:c},{indexDivergence:x}=s||{};if(typeof x=="number"){const j=x===0?yo.EVEN:yo.ODD;p.siblings.push(j)}if(d===0&&p.levels.push(yo.FIRST),h===i-1&&p.levels.push(yo.LAST),u===0&&p.siblings.push(yo.FIRST),f===g-1&&p.siblings.push(yo.LAST),s&&d!==0){const j=this.isVertical?t:0,U=this.isVertical?0:r;p.root=this.getMetadata(j,U,n)}const S=this.getItemByKey(a.parent||"");if(S&&d!==0&&(p.parent=this.getMetadata(S.rowIndex,S.colIndex,n)),n){const j=this.isVertical?a.rowIndex:a.colIndex,U=this.isVertical?a.getStopRowIndex():a.getStopColIndex();let B;S&&(B=this.isVertical?S.getStopRowIndex():S.getStopColIndex()),B!==void 0&&B>=n.to-n.from&&U>=n.to-n.from-1&&!p.siblings.includes(yo.LAST)&&p.siblings.push(yo.LAST),j===0&&!p.siblings.includes(yo.FIRST)&&p.siblings.push(yo.FIRST)}return this.metadataCache[o]=p,p}setValueNode(t){typeof t=="object"&&(this.valueNode=t)}cacheLevels(t,r=[],n={level:0}){const{level:i}=n;return t.forEach(o=>{if(r[i]||(r[i]=[]),Nt.setLevel(o,i),r[i].push(o),Nt.hasChildren(o)){const a=i+1;this.cacheLevels(Nt.getChildren(o),r,{level:a})}else this.lastLevel.push(o)}),r}fillMap(t,r,n={},i){const o=i||{parentRowIndex:0,parentColIndex:0,prevChildren:0,parentKey:""},a=t.length;return t.forEach((s,l)=>{const{parentRowIndex:c,parentColIndex:d,prevChildren:h,parentKey:u}=o,g=Nt.getLevel(s)+c,f=l+d+h,p=Wg(g,f),x=this.createTreeCellMap({rowIndex:g,colIndex:f,node:s,parent:u});x.setIndexInParent(l,a),n[p]=x;let S=0,j=0;if(Nt.hasChildren(s)?(S=this.getTreeChildLength(s),typeof s.minLevel=="number"&&(j=s.minLevel+1-g||0)):j=(r||0)-(g||0),(S>1||j>1)&&this.fillChildMap(n,p,g,f,j,S),Nt.hasChildren(s)){const U=We(Me({},o),{parentRowIndex:j>1?j-1:0,parentColIndex:l+d,parentKey:p});this.fillMap(Nt.getChildren(s),r,n,U),S>1&&(o.prevChildren+=S-1)}}),n}fillMapVertical(t,r,n={},i){const o=i||{parentRowIndex:0,parentColIndex:0,prevChildren:0,parentKey:""},a=t.length;return t.forEach((s,l)=>{if(s.isMapped){o.parentRowIndex+=Nt.getChildLength(s)-1;return}s.isMapped=!0;const{parentRowIndex:c,prevChildren:d,parentKey:h}=o,u=Nt.getLevel(s),g=l+c+d,f=Wg(g,u),p=this.createTreeCellMap({rowIndex:g,colIndex:u,node:s,parent:h});p.setIndexInParent(l,a),n[f]=p;let x=0,S=0;if(Nt.hasChildren(s)?S=this.getTreeChildLength(s):x=(r||0)-(u||0),(x>1||S>1)&&this.fillChildMap(n,f,g,u,S,x),Nt.hasChildren(s)){const j=We(Me({},o),{parentRowIndex:l+c,parentKey:f});this.fillMapVertical(Nt.getChildren(s),r,n,j),S>1&&(o.prevChildren+=S-1)}}),n}fillChildMap(t,r,n,i,o,a){const s=t[r],l=Math.max(1,o),c=Math.max(1,a);Array.from(Array(l)).forEach((d,h)=>{Array.from(Array(c)).forEach((u,g)=>{if(h===0&&g===0)return;const f=n+h,p=i+g,x=Wg(f,p),S=this.createTreeCellMap({rowIndex:f,colIndex:p,parent:r});t[x]=S,!(h!==0&&g!==0)&&(g===0&&s.addRowCell(S),h===0&&s.addColCell(S))})})}createTreeCellMap({rowIndex:t,colIndex:r,node:n,parent:i}){return new lPe(t,r,n,i)}getItemByKey(t){return this.map[t]}getItem(t,r){const n=Wg(t,r);return this.getItemByKey(n)}}class gp extends wPe{}class Hg extends Error{constructor(t="Loading canceled"){super(t),this.name="LoadingCanceledError";const r=new.target.prototype;Object.setPrototypeOf&&Object.setPrototypeOf(this,r)}}class JH{constructor(t=[],r){Re(this,"divergence",0);const n=r?r.getDivergence():0,i=Nt.getLastLevelNodes(t);this.divergence=(n+i.length)%2;for(let o=0;o<i.length;o+=1)i[o].indexDivergence=(o+n)%2}getDivergence(){return this.divergence}}function q_(e=[]){const t={};return e.forEach(r=>{const{index:n=1/0}=r.field||{},i=`${n}`;t[i]=r.jaql.datatype||_u.TEXT}),t}function vL(e,t){if(e&&t===_u.DATETIME)try{return new Date(e).toISOString()}catch(r){return e}return e}function eU(e){if(e!==null&&!hL(e,{}))return e}function Z_(e,t,r={}){const n=eU(e),i=eU(t);let o=!1;if(typeof n=="object"&&n!==null&&typeof i=="object"&&i!==null){o=!0;const a=Object.keys(n),s=Object.keys(i);a.length!==s.length?o=!1:a.forEach(l=>{const c=r[l]||"";let d=(n||{})[l],h=(i||{})[l];if(typeof d=="undefined"||typeof h=="undefined"){o=!1;return}c===_u.DATETIME&&(d=vL(d,c),h=vL(h,c)),d!==h&&(o=!1)})}else o=n===i;return o}function tU(e,t,r=vL){if(!e||typeof e!="object")return e;const n={};return Object.keys(e).forEach(i=>{const o=t[i],a=(e||{})[i],s=r(a,o);n[i]=s}),n}const Su=(e,t)=>{let r=e&&e.metadata||[];return t&&(r=r.filter(n=>n.panel===t)),r.sort((n,i)=>{const o={index:1/0},a=n.field||o,s=i.field||o;return a.index-s.index}),r},$y=(e,t,r)=>typeof t=="undefined"?void 0:Su(e,r).filter(n=>(n.field||{index:1/0}).index===t)[0],CPe=(e,t)=>{const r=e.field||{index:1/0};if(e.panel===or.MEASURES)return!0;if(e.panel===or.ROWS){const n=Su(t,or.ROWS),i=(n[n.length-1]||{}).field||{index:1/0};if(n.length&&i.index===r.index)return!0;n.length||console.error("Missing rows panel in jaql!")}return!1};function _Pe(e,t){return!e||typeof e.field!="number"?!1:e.field!==t}const SPe=(e,t=or.ROWS)=>{const r=Su(e,t).map((n,i)=>{const o=Nt.create(n.jaql.title,void 0,void 0,i),a=bo(o,t);switch(a.jaqlIndex=n.field?n.field.index:void 0,t){case or.ROWS:{a.measurePath=void 0;const s=_Pe(n.jaql.sortDetails,a.jaqlIndex);n.jaql.sort&&!s?a.dir=n.jaql.sort:a.dir=null;break}case or.MEASURES:a.databars=n.format?n.format.databars:!1,a.measureJaqlIndex=a.jaqlIndex,Su(e,or.COLUMNS).length||(a.measurePath=void 0,n.jaql.sortDetails&&n.jaql.sortDetails.measurePath===null?a.dir=n.jaql.sortDetails.dir:a.dir=null);break}return a});return Nt.wrapInRootNode(r)},rU=e=>{(e&&e.metadata?e.metadata:[]).forEach(t=>{t&&t.jaql&&t.jaql.sort&&t.jaql.sortDetails&&t.jaql.sortDetails.sortingLastDimension&&(t.jaql.sort=null,delete t.jaql.sortDetails)})},nU=e=>{e&&e.jaql&&(e.jaql.sort=null,delete e.jaql.sortDetails)},iU=e=>{(e&&e.metadata?e.metadata:[]).forEach(t=>nU(t))},kPe=e=>(e.metadata||[]).reverse().find(t=>!!t.jaql.sortDetails),MPe=e=>(e.metadata||[]).find(t=>!!(t.jaql.sortDetails&&t.jaql.sortDetails.isLastApplied)),TPe=e=>{const t=MPe(e)||kPe(e);if(!t)return;const r=t.field&&t.field.index;(e.metadata||[]).forEach(n=>{(n.field&&n.field.index)!==r&&nU(n)})},oU=(e,t)=>{e.metadata.forEach(r=>{const n=r.field&&r.field.index;if(t.field===n){r.jaql.sortDetails=r.jaql.sortDetails||t,r.jaql.sortDetails.isLastApplied=!0;return}r.jaql.sortDetails&&r.jaql.sortDetails&&delete r.jaql.sortDetails.isLastApplied})},APe=(e,t,r)=>{const{isSingleRowTree:n=!1,formatter:i}=r||{};if(!t){console.warn("jaql is undefined or null!");return}const o=$y(t,e.field);if(o&&o.panel===or.COLUMNS){console.warn('Should not be sorted by "COLUMN" type panels!');return}if(!o)return;const a=CPe(o,t);switch(n?iU(t):a&&rU(t),e.dir){case Mi.DESC:case null:o.jaql.sort=Mi.ASC;break;case Mi.ASC:o.jaql.sort=Mi.DESC;break;default:o.jaql.sort=void 0}const s=o.field||{index:1/0};if(o.jaql.sort){let{measurePath:l}=e;if(l){const c=Su(t),d=q_(c);l=tU(l,d,i)}o.jaql.sortDetails={field:s.index,dir:o.jaql.sort,sortingLastDimension:a,measurePath:l,initialized:!0}}else o.jaql.sortDetails=void 0;t&&t.metadata&&s.index!==void 0&&(t.metadata[s.index]=o),oU(t,e)},EPe=(e,t,r)=>{if(!e)return;const n=$y(e,t);n&&(n.format=n.format||{},n.format.width=r)},PPe=e=>{const t={};return e&&Su(e).forEach(r=>{const n=r.field||{index:1/0};r.format&&typeof r.format.width!="undefined"&&typeof n.index!="undefined"&&(t[n.index]=r.format.width)}),t},DPe=(e,t)=>{if(typeof t.measureJaqlIndex!="undefined"){const r=Su(e),n=q_(r),i=r.filter(a=>a.panel===or.ROWS).find(a=>{const s=a.jaql.sortDetails;return!s||s.field!==t.measureJaqlIndex?!1:!!Z_(t.measurePath,s.measurePath,n)});if(i){t.dir=i.jaql.sort?i.jaql.sort:null;return}const o=$y(e,t.measureJaqlIndex);if(o&&o.jaql.sortDetails){const a=o.jaql.sortDetails.measurePath,s=t.measurePath;if(Z_(a,s,n)){t.dir=o.jaql.sort||null;return}}}t.dir=null};function LPe(e,t,r,n){const{isSingleRowTree:i,formatter:o}=n;i&&iU(e),e.metadata.forEach(a=>{a.jaql.sortDetails&&delete a.jaql.sortDetails.isLastApplied}),t.forEach((a,s)=>{let l;s===t.length-1?(a.selected&&rU(e),l=r.field):l=a.indexInJaql;const c=$y(e,l);if(!c){console.warn(new Error("Panel not found"));return}a.selected&&!a.direction&&console.warn(new Error("Direction should be defined and equal to 'asc' or 'desc'"));const d=Su(e),h=q_(d);if(!a.direction||!a.selected){const{sortDetails:u}=c.jaql;u&&r.field===u.field&&Z_(r.measurePath,u.measurePath,h)&&(delete c.jaql.sort,delete c.jaql.sortDetails)}if(a.selected&&a.direction){c.jaql.sort=a.direction;let{measurePath:u}=r;u&&(u=tU(u,h,o)),r.measurePath===void 0&&c.field&&c.panel==="rows"&&r.field!==c.field.index&&(u={}),c.jaql.sortDetails={field:r.field,dir:a.direction,sortingLastDimension:!1,measurePath:u,isLastApplied:!0,initialized:!0}}})}function OPe(e,t,r,n){return e.jaql.sortDetails?!1:r?Ti.isMeasurePathEqual(t.measurePath,r.measurePath,n):!1}function yL(e){const t=e&&e.dir;switch(t){case"asc":case"desc":return t;default:return null}}function IPe(e,t){var r,n;const i=e.metadata.filter(f=>f.panel==="rows"),o=Ti.getMetadataPanelByIndex(e,t.field),a=o.jaql.datatype,s=o.jaql.sortDetails,l=Ti.getDataTypes(Ti.getMetadataPanels(e)),c=[];for(let f=0;f<i.length-1;f+=1){const p=i[f],x=!!(p.jaql.sortDetails&&p.jaql.sortDetails.field===t.field&&Ti.isMeasurePathEqual(t.measurePath,p.jaql.sortDetails.measurePath,l)),S=yL(p.jaql.sortDetails);c.push({title:p.jaql.title,datatype:a,selected:x,direction:S,indexInJaql:(r=p.field)==null?void 0:r.index})}const d=i[i.length-1],h=OPe(d,t,s,l),u=yL(s),g={title:d.jaql.title,datatype:a,selected:h,direction:u,indexInJaql:(n=o.field)==null?void 0:n.index};return c.push(g),c}function NPe(e,t,r){return e.filter(n=>n.field&&t.field===n.field.index).map(n=>{const{sortDetails:i}=n.jaql,o=!!(i&&Ti.isMeasurePathEqual(t.measurePath,i.measurePath,r)),a=o?yL(i):null;return{title:n.jaql.title,datatype:n.jaql.datatype,selected:o,direction:a}})[0]}const Ti={isMeasurePathEqual:Z_,getDataTypes:q_,updatePanelsSortingMetadata:APe,getMetadataTree:SPe,getMetadataPanels:Su,getMetadataPanelByIndex:$y,setResizeWidthToJaql:EPe,getResizeWidthFromJaql:PPe,markSortedNode:DPe,normalizeSingleBranchTreeSortDetails:TPe,updateLastAppliedSortingFlag:oU,handleComplexSortingSettingsUpdate:LPe,mapWidgetJaqlToSimpleSortingSettings:NPe,mapWidgetJaqlToComplexSortingSettings:IPe};function aU(e,t){if(!Nt.hasChildren(e))return!1;let r=!1;t===or.COLUMNS&&e&&e.isPart&&(r=!0);const n=Nt.getChildren(e);if(n.length>1||r)return!0;const[i]=n;return aU(i)}function RPe(e){return e==null}const bL=(e,t,r,n,i)=>{const o=[];return e.forEach(a=>{if(o.push(a),Nt.hasChildren(a)){const s=Nt.getChildren(a),l=bL(s,t,r,n,i);Nt.setChildren(a,l);let c=!1;if((i||aU(a,r))&&(r===or.COLUMNS?typeof a.index!="undefined"&&a.index>-1&&(c=!0):r===or.ROWS&&typeof a.data!="undefined"&&(c=!0)),c){const{value:d,index:h,data:u,jaqlIndex:g,measurePath:f}=a;let p;if(r===or.COLUMNS?p=Nt.create(d,void 0,void 0,h):r===or.ROWS&&(p=Nt.create(d,void 0,u)),p){const x=bo(p,r);x.userType=Tr.SUB_TOTAL,x.jaqlIndex=g,x.measurePath=f,x.master=a,o.push(x)}}}}),o},sU=(e,t)=>{e.userType===Tr.SUB_TOTAL&&e.master&&(e.measurePath=e.master.measurePath)},lU=(e,t,r,n)=>{const i=e;if(r===or.COLUMNS&&t){const o=bo(t);if(typeof o.index=="number"){const a=Ti.getMetadataTree(n,or.MEASURES);Nt.getChildren(a).forEach((s,l)=>{const c=We(Me({},s),{index:(o.index||0)+l}),d=bo(c,r);d.userType=Tr.GRAND_TOTAL,d.measureJaqlIndex=d.jaqlIndex,i.push(d)})}}return i},cU=(e,t)=>{e.userType===Tr.GRAND_TOTAL&&(e.measurePath=void 0,e.metadataType===or.ROWS&&(e.parent=void 0,e.jaqlIndex=0))},uU=(e,t,r,n)=>{let i=e;if(r===or.COLUMNS){const o=Ti.getMetadataTree(n,or.MEASURES),a=Nt.getChildLength(o),s={maxLevel:0},l=Nt.getLastLevelNodes(i,[],0,s);if(a>1)l.forEach(c=>{if(c.userType===Tr.GRAND_TOTAL)return;const d=Nt.getChildren(o),h=[];for(let u=0;u<d.length;u+=1){if(typeof c.maxChilds=="number"&&u>=c.maxChilds)continue;const g=We(Me({},d[u]),{index:(c.index||0)+u,measurePath:c.measurePath}),f=bo(g,or.MEASURES);f.userType=Tr.MEASURE_BOTTOM,f.measureJaqlIndex=f.jaqlIndex,h.push(f)}c.minLevel=s.maxLevel,Nt.setChildren(c,h)});else if(a===1){const c=Nt.getChildren(o)[0];if(c){const d=Me({},c),h=bo(d,or.MEASURES);h.userType=Tr.MEASURE_TOP,Nt.setChildren(h,i),i=[h],l.forEach(u=>{u.measureJaqlIndex=c.jaqlIndex})}}}return i},dU=(e,t)=>{!Nt.hasChildren(e)&&typeof e.measureJaqlIndex!="undefined"&&Ti.markSortedNode(t,e)},FPe=(e,t,r,n)=>{let i={};if(t.userType===Tr.SUB_TOTAL||t.userType===Tr.GRAND_TOTAL||r.userType===Tr.SUB_TOTAL||r.userType===Tr.GRAND_TOTAL||r.parent&&r.parent.userType===Tr.SUB_TOTAL||r.parent&&r.parent.userType===Tr.GRAND_TOTAL)return;const o=n&&n.format&&n.format.color||null;if(!o)return;const{value:a,cf:s=-1}=e;if(o.type===NH.COLOR&&o.color&&o.color!=="transparent"&&(i.backgroundColor=o.color),o.type===NH.CONDITION&&o.conditions&&o.conditions.length)for(let l=0,c=o.conditions.length;l<c&&!RPe(a);l+=1){const d=o.conditions||[],{color:h}=d[l]||{};if(h&&s===l){i.backgroundColor=h;break}}Object.keys(i).length>0&&(e.style=e.style||{},Object.assign(e.style,i)),i=void 0},hU=(e,t,r,n)=>{const i=[],{level:o=0,measurePath:a={}}=n||{};let s;Array.isArray(e)?s=e:s=Nt.getChildren(e);const l=Ti.getMetadataPanels(r,t)[o],c=l?(l.field||{index:1/0}).index:void 0;return s.forEach(d=>{const h=bo(d,t);if(h.jaqlIndex=c,typeof c!="undefined"&&(h.measurePath=We(Me({},a),{[c]:h.value})),i.push(h),Nt.hasChildren(h)){const u=Nt.getChildren(h),g={level:o+1,measurePath:h.measurePath},f=hU(u,t,r,g);Nt.setChildren(h,f)}}),i},pU=(e,t,r)=>{const{skipFormatEvent:n=!1,onlyFormatEvents:i=!1,iterateFn:o,emitFn:a}=r||{};e.forEach(s=>{if(o&&o(s),(n||!i)&&(sU(s),cU(s),dU(s,t)),a&&(i||!n)){const l=Ti.getMetadataPanelByIndex(t,s.jaqlIndex,s.metadataType||"");a(s,l,t)}if(Nt.hasChildren(s)){const l=Nt.getChildren(s);pU(l,t,r)}})},jPe=(e,t,r,n)=>{const{originalData:i,applyIndexDivergence:o,subtotalsForSingleRow:a}=n||{};o&&o(e);let s=bL(e,i,t,r,a);return s=lU(s,i,t,r),s=uU(s,i,t,r),Nt.iterateThroughTree(s,(l,c)=>{l.parent=c}),s},Wy={insertSubTotals:bL,postProcessSubTotal:sU,insertGrandTotals:lU,postProcessGrandTotal:cU,insertMeasureNodes:uU,postProcessMeasureNode:dU,applyColorFormatting:FPe,preProcessTree:hU,modifyTree:jPe,postProcessTree:pU},bo=(e,t)=>{const r=e;return t&&(r.metadataType=t),r};function Ug(e,t,r){return!t||!t.length?!1:t.some(n=>{let i=!0;return r&&r.fields&&r.fields.length&&r.fields.forEach(o=>{e[o]!==void 0&&n[o]===void 0?i=!1:e[o]!==void 0&&n[o]!==void 0&&(Array.isArray(e[o])?i=i&&e[o].indexOf(n[o])!==-1:i=i&&e[o]===n[o])}),i})}const BPe=(e,t=[])=>{let r=!1;return!t||!t.length?!1:e.length===0?!0:(e.forEach(n=>{t.includes(n)&&(r=!0)}),r)},fU=(e,t)=>{let r=!0;return!t||!t.length?r=!1:e.forEach(n=>{if(n.index){const i=t[t.length-1];r=r&&Ug(n,[i],{fields:[Ld.INDEX]})}if(n.dim&&(n.name=n.dim,n.members&&(n.member=n.members),r=r&&Ug(n,t,{fields:[Ld.NAME,Ld.MEMBER]})),n.title){const i=t[t.length-1];r=r&&Ug(n,[i],{fields:[Ld.TITLE]})}}),r},zPe=(e,t)=>{let r=!0;return!t||!t.length?r=!1:e.forEach(n=>{n.index&&(r=r&&Ug(n,t,{fields:[Ld.INDEX]})),n.dim&&(n.name=n.dim,r=r&&Ug(n,t,{fields:[Ld.DIM,Ld.AGG]})),n.title&&(r=r&&Ug(n,t,{fields:[Ld.TITLE]}))}),r},$Pe=(e,t)=>{let r=!0;if(e.type&&r&&(r=r&&BPe(e.type,t.type)),e.rows&&e.rows.length&&r){const n=t.rows?t.rows:[];r=r&&fU(e.rows,n)}if(e.columns&&r){const n=t.columns?t.columns:[];r=r&&fU(e.columns,n)}if(e.values&&r){const n=t.measure?[t.measure]:[];r=r&&zPe(e.values,n)}return r},WPe=(e,t)=>e.metadata.find(r=>r.field&&r.field.index===t),X_=(e,t,r=[],n=[])=>{if(!t||!e||typeof e.jaqlIndex=="undefined")return{dimensionsMeta:r,type:n};const i=WPe(t,e.jaqlIndex);if(i&&i.jaql&&e.metadataType!==or.MEASURES&&r.unshift({title:i.jaql.title,name:i.jaql.dim,member:e.value,index:e.jaqlIndex}),e&&e.userType&&(e.userType===Tr.SUB_TOTAL||e.userType===Tr.GRAND_TOTAL)){const o=e.userType.toLowerCase();n.push(o)}return e.parent&&e.parent.metadataType!==or.MEASURES?X_(e.parent,t,r,n):{dimensionsMeta:r,type:n}},gU=e=>{let t={};if(e){const r=e.jaql;t=wt(r,["type","datatype","table","column"]),e.field&&(t.index=e.field.index)}return t},xo={CORNER:"corner",COLUMNS:"columns",ROWS:"rows",DATA:"data"};function xL(e,t="",r=""){let n="";return e&&(e.levels.length&&e.levels.forEach(i=>{n+=` ${t}--${r?`${r}-`:""}level-${i}`}),e.siblings.length&&e.siblings.forEach(i=>{n+=` ${t}--${r?`${r}-`:""}sibling-${i}`}),e.root&&e.root.siblings&&e.root.siblings.length&&e.root.siblings.forEach(i=>{n+=` ${t}--${r?`${r}-root-`:"root-"}sibling-${i}`}),e.parent&&e.parent.siblings&&e.parent.siblings.length&&e.parent.siblings.forEach(i=>{n+=` ${t}--${r?`${r}-parent-`:"parent-"}sibling-${i}`})),n}function HPe(e,t){const{metadata:r,rowMetadata:n,rowTreeNode:i,columnTreeNode:o,merge:a}=t||{},s={t:!0,r:!0,b:!0,l:!0};if(e===xo.CORNER||e===xo.COLUMNS)return s;if(e===xo.ROWS){const l=a&&a.colSpan,c=r&&r.nextNode&&r.nextNode.userType===Tr.GRAND_TOTAL;r&&r.levels.includes(yo.LAST)&&!r.siblings.includes(yo.LAST)&&!l&&!c&&(s.b=!1),r&&r.levels.includes(yo.FIRST)&&r.levels.includes(yo.LAST)&&!r.siblings.includes(yo.LAST)&&!l&&!c&&(s.b=!1)}if(e===xo.DATA){const l=i&&i.userType===Tr.SUB_TOTAL,c=o&&o.userType===Tr.SUB_TOTAL,d=o&&o.userType===Tr.GRAND_TOTAL,h=n&&n.nextNode&&n.nextNode.userType===Tr.GRAND_TOTAL;n&&n.levels.includes(yo.LAST)&&!n.siblings.includes(yo.LAST)&&!l&&!c&&!d&&!h&&(s.b=!1)}return s}function wL(e,t="",r=""){let n="";return e&&e.userType&&(n=`${t}--${r?`${r}-`:""}user-type-${e.userType}`),n}function CL(e,t="",r=""){let n="";return e&&e.colSpan&&(n=`${t}--${r?`${r}-`:""}merged-columns`),e&&e.rowSpan&&(n=` ${t}--${r?`${r}-`:""}merged-rows`),n}function _L(e){return e&&e.colSpan?e.colSpan-1:0}function mU(e,t){if(e===void 0)return e;let r=typeof e=="number"?e:parseInt(e,10);return r-=t||1,r}function Hy(e){const{isDataCell:t,dataNode:r,treeNode:n}=e,i=t?r:n;return i&&i.style||{}}const UPe=e=>{const t={};return Object.keys(e).forEach(r=>{(!r.startsWith("border")||r==="borderColor")&&(t[r]=e[r])}),t},GPe=e=>{const t={};return Object.keys(e).forEach(r=>{(!r.startsWith("color")&&!r.startsWith("padding")&&!r.startsWith("border")&&!r.startsWith("font")&&!r.startsWith("lineHeight")&&!r.startsWith("databarColor")||r==="borderColor")&&(t[r]=e[r])}),t},VPe=e=>{const t={};return Object.keys(e).forEach(r=>{(r.startsWith("color")||r.startsWith("padding")||r.startsWith("font")||r.startsWith("lineHeight"))&&(t[r]=e[r])}),t},YPe=e=>{const t={};return e.databarColor&&(t.backgroundColor=e.databarColor),t},qPe=(e,t,r=0)=>t&&e&&t.offsetWidth+r>=e.offsetWidth&&t.textContent||"",ZPe=(e,t,r)=>{if(!e||!t||!r||r.measureJaqlIndex===void 0)return;const[n,i]=e[r.measureJaqlIndex]||[];if(n==null)return;const o=t&&t.store&&t.store.compileRange,a=t&&t.store&&t.store.compileRangeContext,s=t&&t.store&&t.store.compileRangeArgs;if(!o||!s||!a||!t||!t.value)return;const l=We(Me({},s),{minvalue:n,midvalue:n+(i-n)/2,maxvalue:i});let c,d;return l.min===void 0&&(l.maxvalue<=0&&(d=!0),l.min=l.minDef),l.max===void 0&&(l.minvalue>=0&&(c=!0),l.max=l.maxDef),d&&(l.max=l.maxGray),c&&(l.min=l.minGray),o.call(a,l)(t.value)},Uy="text";let XPe=class Sye{constructor(t,r,n){Re(this,"plugins",[]),Re(this,"globalStyles"),Re(this,"jaql"),Re(this,"indexHelper"),Re(this,"columnsMetadata",[]),Re(this,"metadataCache",new Map),this.plugins=t,this.jaql=r,this.globalStyles=n,this.indexHelper={measuresLevel:this.getMeasuresLevel(),columnStartFrom:0,rowStartFrom:0},this.globalStyles&&(this.globalStyles=UPe(this.globalStyles))}getJaqlPanels(t){if(!this.jaql)throw new Error("No Jaql in Plugin service!");return this.jaql.metadata.filter(r=>r.panel===t)}getMeasuresLevel(){const t=this.getJaqlPanels(or.COLUMNS);return this.getJaqlPanels(or.MEASURES).length>1?t.length:0}getRowsColumnLength(){return this.getJaqlPanels(or.ROWS).length}getTotalTypes(t){const r=t.filter(n=>n===zg.SUB_TOTAL||n===zg.GRAND_TOTAL);return r&&r.length?r.filter((n,i,o)=>o.indexOf(n)===i):[]}getMeasureMetaByIndex(t){const r=this.getJaqlPanels(or.MEASURES);if(r.length===1)return gU(r[0]);const n=t%r.length;return gU(r[n])}resetRowStartFrom(){this.indexHelper.rowStartFrom=1}applyToColumns(t){t.length!==0&&(this.indexHelper.columnStartFrom===0&&(this.indexHelper.columnStartFrom=this.getRowsColumnLength()),this._applyToColumns(t,{row:-1}))}_applyToColumns(t,r){t.forEach((n,i)=>{const{dimensionsMeta:o,type:a}=X_(n,this.jaql);a.push(zg.MEMBER);let s=r.row>=0?r.row+1:0;s>=this.indexHelper.rowStartFrom&&(this.indexHelper.rowStartFrom=s+1),n.metadataType===or.MEASURES&&(s=this.indexHelper.measuresLevel);let l=i===0?0:1;l+=this.indexHelper.columnStartFrom;const c={type:a,rowIndex:s,colIndex:l,index:n.jaqlIndex,columns:o};n.metadataType===or.MEASURES&&(c.measure=this.getMeasureMetaByIndex(n.index||0));const d={value:n.value||"",content:n.content||"",contentType:n.contentType||Uy,style:n.style||{},store:n.store||{},state:n.state};if(this.applyGlobal(d),this.apply(c,d),this.addToMetadata(c,d,c.rowIndex,c.colIndex),Object.assign(n,d),this.indexHelper.columnStartFrom=l,n.children){const h={row:s,column:l};this._applyToColumns(n.children,h)}else this.columnsMetadata.push({type:a,metadata:o});return!0})}applyToHeaders(t){!t||!t.children||t.children.length===0||t.children.forEach(r=>{const{dimensionsMeta:n}=X_(r,this.jaql),i={type:[zg.MEMBER],rowIndex:0,colIndex:r.index||0,index:r.jaqlIndex,rows:n},o={value:r.value,content:r.content||"",contentType:r.contentType||Uy,style:r.style?r.style:{},store:r.store||{},state:r.state};this.applyGlobal(o),this.apply(i,o),this.addToMetadata(i,o,i.rowIndex,i.colIndex),Object.assign(r,o)})}applyToRows(t){if(t.length===0)return;const r=this.getJaqlPanels(or.ROWS),n=this.getJaqlPanels(or.MEASURES),i=this.getJaqlPanels(or.COLUMNS);this.indexHelper.rowStartFrom=Sye.getRowStartFromForPage(r.length,n.length,i.length),this._applyToRows(t)}static getRowStartFromForPage(t,r,n){if(t===0&&n===0)return 0;const i=n+(r===0?0:1);return i===0?1:i}_applyToRows(t){t.forEach((r,n)=>{const{dimensionsMeta:i,type:o}=X_(r,this.jaql);o.push(zg.MEMBER);const a=r.level?r.level:0,s=n===0?this.indexHelper.rowStartFrom:this.indexHelper.rowStartFrom+1,l={type:o,rowIndex:s,colIndex:a,index:r.jaqlIndex,rows:i},c={value:r.value,content:r.content||"",contentType:r.contentType||Uy,style:r.style||{},store:r.store||{},state:r.state};return this.applyGlobal(c),this.apply(l,c),this.addToMetadata(l,c,l.rowIndex,l.colIndex),this.indexHelper.rowStartFrom=s,r.children?this._applyToRows(r.children):r.data&&r.data.length&&this.applyToValues(r.data,{type:o,metadata:i},{rowIndex:s,colIndex:this.getRowsColumnLength()}),Object.assign(r,c),!0})}applyToValues(t,r,n){t.length&&t.forEach((i,o)=>{const a=[zg.VALUE],s=this.columnsMetadata[o];if(!s)return;const l=this.getTotalTypes([...r.type,...s.type]),c=this.getMeasureMetaByIndex(o),d={type:a.concat(l),rows:r.metadata,columns:s.metadata,measure:c,colIndex:o+n.colIndex,rowIndex:n.rowIndex,index:c&&c.index?c.index:0};let h={value:i,content:i,contentType:Uy,style:{},store:i&&i.store||{},state:i&&i.state||void 0};i!=null&&typeof i=="object"&&(h={value:i.value?i.value:null,content:i.content||"",contentType:i.contentType||Uy,style:i.style||{},store:i.store||{},state:i.state}),this.applyGlobal(h),this.apply(d,h),this.addToMetadata(d,h,d.rowIndex,d.colIndex),t[o]=h})}addToMetadata(t,r,n,i){const o=Me({cellData:{value:r.value,content:r.content}},t);this.metadataCache.set(`${n}-${i}`,o)}applyGlobal(t){const{globalStyles:r}=this;r&&(t.style=Me(Me({},t.style),r))}apply(t,r){this.plugins&&this.plugins.length&&this.plugins.forEach(n=>{if($Pe(n.target,t)){const i=n.handler;i(t,r)}})}};const SL=(e,t)=>{const r=e||{metadata:[],grandTotals:null};let{metadata:n}=r;return n=n.map(i=>{const o=i.field||{},a=t.find(({field:l})=>l&&l.index===o.index),s=a?a.format:null;return s?We(Me({},i),{format:s}):i}),We(Me({},r),{metadata:n})},vU=100,KPe="dataLoad",kL="dataChunkLoaded",QPe="dataBarChunkLoaded",JPe="rangeMinMaxChunkLoaded",ML="grandChunkLoaded",e3e="dataFinishChunkLoaded",t3e="finishChunkLoaded",K_="progressError",Q_="headerCellFormat",TL="dataCellFormat",AL="totalRowsCountLoaded",EL="totalColumnsCountLoaded",yU=1e3,r3e=0,n3e={throttle:HH,throttleTime:r3e,PluginService:XPe,skipInternalColorFormatting:!1,subtotalsForSingleRow:!1};class Aa{constructor(t,r,n,i){Re(this,"logger"),Re(this,"events"),Re(this,"loadService"),Re(this,"options"),Re(this,"tempDataChunks",[]),Re(this,"lastNotHandledChunkIndex",0),Re(this,"lastReadyNotHandledChunkIndex",0),Re(this,"rowsGrand"),Re(this,"rowsTreeService"),Re(this,"columnsTreeService"),Re(this,"cornerTreeService"),Re(this,"pageSize",vU),Re(this,"isPaginated",!1),Re(this,"loadedPagesCount",0),Re(this,"isLoadInProgress",!1),Re(this,"loadPromiseResolve"),Re(this,"loadPromiseReject"),Re(this,"loadPromiseCache"),Re(this,"loadAllPromise"),Re(this,"loadAllPromiseResolve"),Re(this,"loadAllPromiseReject"),Re(this,"isWholeDataLoaded",!1),Re(this,"hasDataFinishEvent",!1),Re(this,"isDataHandlerThrottled",!1),Re(this,"onDataHandlerThrottle"),Re(this,"metadata",[]),Re(this,"dataBars"),Re(this,"rangeMinMax"),Re(this,"divergenceComparator",new JH),Re(this,"pluginService"),Re(this,"rawJaql"),Re(this,"triggeredEventsData",{}),Re(this,"callPlugins",[]),Re(this,"globalStyles"),Re(this,"columnsCount"),Re(this,"totalColumnsCount"),Re(this,"rowsCount"),Re(this,"totalRowsCount"),Re(this,"totalRecordsCount"),Re(this,"limitReached"),Re(this,"onMetadataHandler",()=>{const o={metadata:this.getMetadata()};this.isSingleRowTree()&&Ti.normalizeSingleBranchTreeSortDetails(o)}),Re(this,"onHeadersHandler",o=>{const a=this.getJaql.bind(this),s=this.getRawJaql.bind(this),l=this.applyIndexDivergence.bind(this),c=(g,f,p)=>this.emit(Q_,g,f,p,this.options),d=Aa.createColumnsTreeServiceBuilder({getJaql:a,getRawJaql:s,pluginService:this.pluginService,applyIndexDivergence:l},{emitHeaderCellFormatEvent:c})(o);this.columnsTreeService=d.columnsTreeService,this.columnsCount=d.columnsCount,this.totalColumnsCount=d.totalColumnsCount,this.emit(EL,{columnsCount:this.columnsCount||0,totalColumnsCount:this.totalColumnsCount||0});const h=Aa.createCornerTreeServiceBuilder({getJaql:a,getRawJaql:s,pluginService:this.pluginService,columnsTreeService:this.columnsTreeService},{emitHeaderCellFormatEvent:c}),{cornerTreeService:u}=h();this.cornerTreeService=u}),Re(this,"onDataHandler",o=>{this.tempDataChunks=this.tempDataChunks||[],Array.isArray(o)?(o||[]).forEach(a=>{Aa.fillDataChunks(this.tempDataChunks,a,this.pageSize)}):Aa.fillDataChunks(this.tempDataChunks,o,this.pageSize),this.tempDataChunks.length&&(this.isDataHandlerThrottled=!0,this.onDataHandlerThrottle())}),Re(this,"onGrandHandler",o=>{const a=this.preProcessTree([o],or.ROWS)[0],s="Rows grand total",l=a?a.data:[],c=Nt.create(s,void 0,l),d=bo(c,or.ROWS);d.userType=Tr.GRAND_TOTAL,this.postProcessTree([d]),this.postProcessData([d]),this.rowsGrand=d,this.emit(ML,Nt.wrapInRootNode(this.rowsGrand))}),Re(this,"onFinishHandler",()=>{this.emit(t3e,{totalRows:typeof this.totalRowsCount=="number"?this.totalRowsCount:this.getTotalItemsCount(),totalColumns:typeof this.totalColumnsCount=="number"?this.totalColumnsCount:this.getLoadedColumnsCount()})}),Re(this,"onTotalRowsHandler",o=>{const{rowsCount:a,queryRowsCount:s,limitReached:l}=o||{};this.totalRowsCount=a,this.totalRecordsCount=s,this.limitReached=l,this.emit(AL,o)}),Re(this,"onDataBarsHandler",o=>{const{data:a=[]}=o;let s=0;this.cornerTreeService&&(s=this.cornerTreeService.getTreeChildLength()),this.dataBars=[...Array(s),...a],this.emit(QPe,this.dataBars)}),Re(this,"onRangeMinMaxHandler",o=>{const{data:a=[]}=o,s=this.getJaql(),l=Ti.getMetadataTree(s,or.MEASURES),c=Nt.getChildren(l),d=[];c.forEach((h,u)=>{d[h.measureJaqlIndex||0]=a[u]}),this.rangeMinMax=d,this.emit(JPe,this.rangeMinMax)}),Re(this,"onDataFinishHandler",({rowsCount:o}={})=>{if(this.finishRequest(),this.rowsCount=o,this.tempDataChunks.length){const a=this.tempDataChunks[this.tempDataChunks.length-1];a.ready=!0}this.onDataHandlerThrottle(),this.checkLoadPromise(),this.emit(e3e,{limitedRows:this.rowsCount,limitedColumns:this.columnsCount})}),Re(this,"onErrorHandler",o=>{!this.isLoadInProgress&&!this.isWholeDataLoaded&&!(o instanceof Hg)&&this.emit(K_,o)}),this.loadService=t,this.events=r||new Ly,this.logger=i||Od.create("DataService"),this.options=Me(Me({},n3e),n),this.attachEvent(),this.onDataHandlerThrottle=this.options.throttle(()=>{const o=GH(this.tempDataChunks,h=>h.ready&&!h.handled,this.lastReadyNotHandledChunkIndex);if(o===-1)return;this.lastReadyNotHandledChunkIndex=o;const a=this.tempDataChunks[o],s=this.preProcessTree(a.list,or.ROWS),l=this.modifyTree(s,or.ROWS);this.postProcessTree(l,{skipFormatEvent:!0}),this.postProcessData(l,{skipFormatEvent:!0});const c=Nt.wrapInRootNode(l);this.rowsTreeService?this.rowsTreeService.extend(c):this.rowsTreeService=new gp(c,!0),this.emit(kL,this.getLoadedElementsCount()),a.handled=!0;const d=GH(this.tempDataChunks,h=>!h.handled,this.lastNotHandledChunkIndex);if(d!==-1?(this.lastNotHandledChunkIndex=d,this.onDataHandlerThrottle()):this.isDataHandlerThrottled=!1,this.hasDataFinishEvent&&this.tempDataChunks.length){const h=this.tempDataChunks[this.tempDataChunks.length-1];h.ready=!0}this.hasDataFinishEvent&&d===-1?(this.finishRequest(),this.checkLoadPromise()):this.checkLoadPromise()},this.options.throttleTime)}destroy(){this.detachEvent(),this.rowsGrand=void 0,this.rowsTreeService=void 0,this.columnsTreeService=void 0,this.cornerTreeService=void 0,this.tempDataChunks=[],this.lastNotHandledChunkIndex=0,this.lastReadyNotHandledChunkIndex=0,this.events.removeAllListeners()}on(t,r){this.events.on(t,r),this.triggeredEventsData[t]&&(this.triggeredEventsData[t].forEach(n=>{this.events.emit(t,...n)}),delete this.triggeredEventsData[t])}emit(t,...r){this.events.listeners(t).length===0?(this.triggeredEventsData[t]=this.triggeredEventsData[t]||[],this.triggeredEventsData[t].push(r)):this.events.emit(t,...r)}off(t,r){this.events.removeListener(t,r),this.triggeredEventsData[t]&&delete this.triggeredEventsData[t]}loadData(t,r){const{pageSize:n=vU,isPaginated:i=!1,cacheResult:o=!1,metadata:a}=r||{},s=this.pageSize===n;if(this.clearLoadAllPromise(),t&&this.clearCache(),this.pageSize=n,this.isPaginated=i,this.emit(KPe),this.loadPromiseCache&&s){const c=Promise.resolve(this.loadPromiseCache);return this.loadPromiseCache=void 0,c}this.isLoadInProgress=!0,t&&(this.metadata=a||[],this.rawJaql=SL(t,this.metadata),this.initPluginService(this.rawJaql),this.loadService.load(t).then(c=>{if(c==null)return;const d=!("data"in c);if(c.dataFinish[0]&&d)throw{error:{error:!0,details:"metadata undefined."}}}).catch(c=>{this.loadPromiseReject&&this.loadPromiseReject(c.error)}));const l=new Promise((c,d)=>{this.loadPromiseResolve=c,this.loadPromiseReject=d}).then(c=>this.sendInitPage(c)).then(c=>(o&&(this.loadPromiseCache=c),this.loadedPagesCount=1,c)).catch(c=>{throw c instanceof Hg&&this.clearLoadPromise(),c});return this.checkLoadPromise(),l}loadAllData(){if(this.isWholeDataLoaded){const t={loadedRowsCount:this.getLoadedElementsCount(),totalItemsCount:typeof this.totalRowsCount=="number"?this.totalRowsCount:this.getTotalItemsCount(),totalRecordsCount:this.totalRecordsCount,limitReached:this.limitReached,dataBars:this.dataBars,rangeMinMax:this.rangeMinMax};return this.columnsCount!==0&&this.totalColumnsCount!==0&&(t.columnsCount=this.columnsCount,t.totalColumnsCount=this.totalColumnsCount),Promise.resolve(t)}return this.loadAllPromise||(this.loadAllPromise=new Promise((t,r)=>{this.loadAllPromiseResolve=t,this.loadAllPromiseReject=r}).then(()=>({loadedRowsCount:this.getLoadedElementsCount(),totalItemsCount:typeof this.totalRowsCount=="number"?this.totalRowsCount:this.getTotalItemsCount(),totalRecordsCount:this.totalRecordsCount,limitReached:this.limitReached,dataBars:this.dataBars,rangeMinMax:this.rangeMinMax})).catch(t=>{throw t instanceof Hg&&this.clearLoadAllPromise(),t})),this.loadAllPromise}getSelectedPageData(t,r){return Promise.resolve(this.sendPaginatedPage(t,r))}getIndexedPageData(t,r,n=!1){return Promise.resolve(this.sendPartialPage(t,r,n))}getJaql(){return this.loadService.getJaql()||{metadata:[],grandTotals:null}}isSingleRowTree(){return this.loadService.isSingleRowTree()}setPluginHandlers(t){this.callPlugins=t}setGlobalStyles(t){this.globalStyles=t}getRawJaql(){return this.rawJaql||this.getJaql()}getMetadata(){return this.metadata.length>0?this.metadata:this.getJaql().metadata}preProcessTree(t,r,n){return Wy.preProcessTree(t,r,this.getJaql(),n)}postProcessTree(t,r){const n=(o,a,s)=>this.emit(Q_,o,a,s,this.options),i=We(Me({},r||{}),{emitFn:n});return Wy.postProcessTree(t,this.getRawJaql(),i)}postProcessData(t,r){const{skipFormatEvent:n=!1,onlyFormatEvents:i=!1}=r||{},o=this.columnsTreeService?this.columnsTreeService.getLastLevelNodes():[],a=Nt.getLastLevelNodes(t),s=this.getRawJaql();n||a.forEach(l=>{const c=bo(l);o.forEach(d=>{const h=bo(d),u=Ti.getMetadataPanelByIndex(s,h.measureJaqlIndex,or.MEASURES);if(typeof c.data!="undefined"&&typeof h.index!="undefined"){const{data:g=[]}=c,{index:f}=h,p=g[f],x=typeof p=="object"&&p!==null&&p!==void 0?p:{value:p};if(g[f]=x,i||!n){const{skipInternalColorFormatting:S=!1}=this.options;S||Wy.applyColorFormatting(x,c,h,u),this.emit(TL,x,c,h,u,s,this.options)}}})})}modifyTree(t,r,n){const i=this.getJaql();return Wy.modifyTree(t,r,i,{originalData:n,applyIndexDivergence:this.applyIndexDivergence.bind(this),subtotalsForSingleRow:this.options.subtotalsForSingleRow})}applyIndexDivergence(t){this.divergenceComparator=new JH(t,this.divergenceComparator)}initPluginService(t){this.pluginService=new this.options.PluginService(this.callPlugins,t,this.globalStyles)}cancelLoading(){const t=new Hg;this.loadPromiseReject&&typeof this.loadPromiseReject=="function"&&this.loadPromiseReject(t),this.loadAllPromiseReject&&typeof this.loadAllPromiseReject=="function"&&this.loadAllPromiseReject(t),this.detachEvent()}getPageSize(){return this.pageSize}sendInitPage(t){if(this.loadService.hasError()||!this.loadService.hasData())return Aa.getEmptyPage();let r,n;const i=this.getPageSize();if(this.rowsTreeService){const a=i>t?t:i,s=Aa.cloneTreeNode,l=this.rowsTreeService.getPartialTree(0,a,{cloneFn:s});this.rowsGrand&&l.push(Ta(this.rowsGrand)),this.postProcessTree(l,{onlyFormatEvents:!0,iterateFn:Nt.clearNodeCache}),this.postProcessData(l,{onlyFormatEvents:!0});const c=this.rowsTreeService?this.rowsTreeService.getTreeDeepsLength():0,d=Nt.wrapInRootNode(l);this.pluginService&&d&&d.children&&(this.pluginService.applyToRows(d.children),n=this.pluginService.metadataCache),r=new gp(d,!0,c),r.hasGrandTotals=!!this.rowsGrand}const o=this.isWholeDataLoaded&&i>=t;return{rowsTreeService:r,columnsTreeService:this.columnsTreeService,cornerTreeService:this.cornerTreeService,isLastPage:o,cellsMetadata:n}}sendPaginatedPage(t,r){if(this.loadService.hasError()||!this.loadService.hasData())return Aa.getEmptyPage();r&&(this.pageSize=r);const n=this.getPageSize(),i=this.getLoadedElementsCount();if(t*n>=i)throw new Error("Selected page is out of elements range!");if(t<0)throw new Error("Selected page must be >= 0");let o,a;if(this.rowsTreeService){const s=t>=0?t*n:0,l=(t+1)*n>i?i:(t+1)*n,c=Aa.cloneTreeNode,d=this.rowsTreeService.getPartialTree(s,l,{cloneFn:c});this.rowsGrand&&d.push(Ta(this.rowsGrand)),this.postProcessTree(d,{onlyFormatEvents:!0,iterateFn:Nt.clearNodeCache}),this.postProcessData(d,{onlyFormatEvents:!0});const h=this.rowsTreeService?this.rowsTreeService.getTreeDeepsLength():0,u=Nt.wrapInRootNode(d);this.pluginService&&u&&u.children&&(this.pluginService.applyToRows(u.children),a=this.pluginService.metadataCache),o=new gp(u,!0,h),o.hasGrandTotals=!!this.rowsGrand}return{rowsTreeService:o,columnsTreeService:this.columnsTreeService,cornerTreeService:this.cornerTreeService,isLastPage:!0,cellsMetadata:a}}sendPartialPage(t,r,n){if(this.loadService.hasError()||!this.loadService.hasData())return Aa.getEmptyPage();const i=this.getLoadedElementsCount();let[o,a]=[Math.min(t,r),Math.max(t,r)];o=o>=0?o:0,a=a>=0?a:0,a=a<i?a:i;let s,l;if(o>i)s=void 0;else{let c;if(this.rowsTreeService){const u=Aa.cloneTreeNode;c=this.rowsTreeService.getPartialTree(o,a,{cloneFn:u}),n&&this.rowsGrand&&c.push(Ta(this.rowsGrand)),this.postProcessTree(c,{onlyFormatEvents:!0,iterateFn:Nt.clearNodeCache}),this.postProcessData(c,{onlyFormatEvents:!0})}const d=this.rowsTreeService?this.rowsTreeService.getTreeDeepsLength():0,h=Nt.wrapInRootNode(c);this.pluginService&&h&&h.children&&(this.pluginService.applyToRows(h.children),l=this.pluginService.metadataCache),s=new gp(h,!0,d),s.hasGrandTotals=!!(n&&this.rowsGrand)}return{rowsTreeService:s,columnsTreeService:this.columnsTreeService,cornerTreeService:this.cornerTreeService,isLastPage:!0,cellsMetadata:l}}getLoadedElementsCount(){return this.rowsTreeService?this.rowsTreeService.getTreeChildLength():0}getTotalItemsCount(){return this.loadService.getTotalItemsCount()}getLoadedColumnsCount(){return this.columnsTreeService?this.columnsTreeService.getTreeChildLength():0}attachEvent(){this.loadService.listenerCount(ur.HEADERS)&&this.loadService.offAll(ur.HEADERS),this.loadService.on(ur.HEADERS,this.onHeadersHandler),this.loadService.on(ur.METADATA,this.onMetadataHandler),this.loadService.on(ur.DATA,this.onDataHandler),this.loadService.on(ur.GRAND,this.onGrandHandler),this.loadService.on(ur.DATA_FINISH,this.onDataFinishHandler),this.loadService.on(ur.TOTAL_ROWS,this.onTotalRowsHandler),this.loadService.on(ur.DATABARS,this.onDataBarsHandler),this.loadService.on(ur.RANGE_MIN_MAX,this.onRangeMinMaxHandler),this.loadService.on(ur.FINISH,this.onFinishHandler),this.loadService.on(ur.ERROR,this.onErrorHandler)}detachEvent(){this.loadService.off(ur.HEADERS,this.onHeadersHandler),this.loadService.off(ur.METADATA,this.onMetadataHandler),this.loadService.off(ur.DATA,this.onDataHandler),this.loadService.off(ur.GRAND,this.onGrandHandler),this.loadService.off(ur.DATA_FINISH,this.onDataFinishHandler),this.loadService.off(ur.TOTAL_ROWS,this.onTotalRowsHandler),this.loadService.off(ur.DATABARS,this.onDataBarsHandler),this.loadService.off(ur.RANGE_MIN_MAX,this.onRangeMinMaxHandler),this.loadService.off(ur.FINISH,this.onFinishHandler),this.loadService.off(ur.ERROR,this.onErrorHandler)}checkLoadPromise(){if(!this.isLoadInProgress)return;const t=this.getLoadedElementsCount();(t>=this.getPageSize()||this.isWholeDataLoaded)&&(this.isLoadInProgress=!1,typeof this.loadPromiseResolve=="function"&&(this.loadPromiseResolve(t),this.clearLoadPromise()))}clearLoadAllPromise(){this.loadAllPromise=void 0,this.loadAllPromiseReject=void 0,this.loadAllPromiseResolve=void 0}clearLoadPromise(){this.loadPromiseReject=void 0,this.loadPromiseResolve=void 0}finishRequest(){this.logger.log("finishRequest"),this.hasDataFinishEvent=!0,!this.isDataHandlerThrottled&&(this.isWholeDataLoaded=!0,this.loadAllPromiseResolve&&typeof this.loadAllPromiseResolve=="function"&&(this.loadAllPromiseResolve(),this.clearLoadAllPromise()))}clearCache(){this.rowsGrand=void 0,this.rowsTreeService=void 0,this.columnsTreeService=void 0,this.loadedPagesCount=0,this.hasDataFinishEvent=!1,this.isWholeDataLoaded=!1,this.isLoadInProgress=!1,this.tempDataChunks=[],this.lastNotHandledChunkIndex=0,this.lastReadyNotHandledChunkIndex=0,this.isDataHandlerThrottled=!1}static getEmptyPage(){return{isLastPage:!0}}static fillDataChunks(t,r,n=yU,i=yU){const o=t.length<2?n:i;let a=t[Math.max(0,t.length-1)],s,l=!a;if(!r||typeof r.children=="undefined"&&typeof r.value=="undefined"&&r.data&&!r.data.length){a&&(a.ready=!0);return}if(a){const c=Math.max(0,a.list.length-1);s=a.list[c];const d=a.size?`${a.size}`:"0",h=parseInt(d,10)+(r.size||1);(a.handled||h>o&&!(s.isPart&&s.value===r.value))&&(l=!0)}r&&r.isPart&&s&&(!s.isPart||s.value!==r.value)&&(l=!0,s.value!==r.value&&(s=void 0)),l&&(a&&(a.ready=!0),a={list:[],size:0,ready:!1,handled:!1},t.push(a)),a&&(s&&s.isPart&&r&&r.isPart?(Nt.deepMerge(s,r),a.size+=r.size||1):(a.list.push(r),a.size+=r.size||1))}static cloneTreeNode(t,r){const n=t,{children:i,isMapped:o,minLevel:a,childCount:s,childDeep:l,parent:c,master:d,data:h,state:u,style:g,store:f}=n,p=wt(n,["children","isMapped","minLevel","childCount","childDeep","parent","master","data","state","style","store"]),x=Ta(p);return c&&(x.parent=c),d&&(x.master=d),h&&(x.data=Ta(h)),u&&(x.state=Ta(u)),g&&(x.style=Ta(g)),f&&(x.store=Ta(f)),!r&&i&&(x.children=i.map(S=>{const j=Aa.cloneTreeNode(S);return j.parent=x,j})),x}static createColumnsTreeServiceBuilder(t,r){return n=>{const i=t.getJaql(),o=t.getRawJaql?t.getRawJaql():SL(i,i.metadata||[]),a=Ti.getMetadataTree(i,or.MEASURES),s=Nt.getChildren(a),{preProcessTree:l,modifyTree:c,postProcessTree:d}=Wy;let h,u,g=0,f=0;if(Nt.hasChildren(n)){n.columnsCount&&n.totalColumnsCount&&(g=n.columnsCount,f=n.totalColumnsCount);const p=l(n,or.COLUMNS,i),x=c(p,or.COLUMNS,i,{originalData:n,applyIndexDivergence:t.applyIndexDivergence});d(x,o,{emitFn:r&&r.emitHeaderCellFormatEvent});const S=Nt.wrapInRootNode(x);t.pluginService&&S&&S.children&&t.pluginService.applyToColumns(S.children),h=S,u=new gp(S),s.length===1&&u.setValueNode(s[0])}else Nt.hasChildren(a)?(n.columnsCount&&n.totalColumnsCount&&(g=n.columnsCount,f=n.totalColumnsCount),typeof n.maxChilds=="number"&&(g=n.maxChilds,a.children=Nt.getChildren(a).filter((p,x)=>x<n.maxChilds)),t.pluginService&&a.children&&t.pluginService.applyToColumns(a.children),d(Nt.getChildren(a),o,{emitFn:r&&r.emitHeaderCellFormatEvent}),h=a,u=new gp(a)):(t.pluginService&&t.pluginService.resetRowStartFrom(),h=void 0,u=void 0,g=0,f=0);return{columnsTree:h,columnsTreeService:u,columnsCount:g,totalColumnsCount:f}}}static createCornerTreeServiceBuilder(t,r){return()=>{const n=t.getJaql(),i=t.getRawJaql?t.getRawJaql():SL(n,n.metadata||[]),o=Ti.getMetadataTree(n,or.ROWS);let a;if(Nt.hasChildren(o)){Nt.iterateThroughTree(Nt.getChildren(o),l=>{l.userType=Tr.CORNER;const c=Ti.getMetadataPanelByIndex(i,l.jaqlIndex,l.metadataType||"");r&&r.emitHeaderCellFormatEvent&&r.emitHeaderCellFormatEvent(l,c,i)});let s;t.columnsTreeService&&(s=t.columnsTreeService.getTreeDeepsLength()),t.pluginService&&t.pluginService.applyToHeaders(o),a=new gp(o,!1,s)}return{cornerTree:o,cornerTreeService:a}}}}var bU={exports:{}};/*!
|
|
18
18
|
Copyright (c) 2018 Jed Watson.
|
|
19
19
|
Licensed under the MIT License (MIT), see
|
|
20
20
|
http://jedwatson.github.io/classnames
|
|
@@ -1161,7 +1161,7 @@ import { DashboardById } from '@sisense/sdk-ui-vue';
|
|
|
1161
1161
|
*/(function(e,t){(function(r,n){n(t)})(ri,function(r){var n="1.9.4";function i(Y){var oe,he,be,Pe;for(he=1,be=arguments.length;he<be;he++){Pe=arguments[he];for(oe in Pe)Y[oe]=Pe[oe]}return Y}var o=Object.create||function(){function Y(){}return function(oe){return Y.prototype=oe,new Y}}();function a(Y,oe){var he=Array.prototype.slice;if(Y.bind)return Y.bind.apply(Y,he.call(arguments,1));var be=he.call(arguments,2);return function(){return Y.apply(oe,be.length?be.concat(he.call(arguments)):arguments)}}var s=0;function l(Y){return"_leaflet_id"in Y||(Y._leaflet_id=++s),Y._leaflet_id}function c(Y,oe,he){var be,Pe,Ne,$e;return $e=function(){be=!1,Pe&&(Ne.apply(he,Pe),Pe=!1)},Ne=function(){be?Pe=arguments:(Y.apply(he,arguments),setTimeout($e,oe),be=!0)},Ne}function d(Y,oe,he){var be=oe[1],Pe=oe[0],Ne=be-Pe;return Y===be&&he?Y:((Y-Pe)%Ne+Ne)%Ne+Pe}function h(){return!1}function u(Y,oe){if(oe===!1)return Y;var he=Math.pow(10,oe===void 0?6:oe);return Math.round(Y*he)/he}function g(Y){return Y.trim?Y.trim():Y.replace(/^\s+|\s+$/g,"")}function f(Y){return g(Y).split(/\s+/)}function p(Y,oe){Object.prototype.hasOwnProperty.call(Y,"options")||(Y.options=Y.options?o(Y.options):{});for(var he in oe)Y.options[he]=oe[he];return Y.options}function x(Y,oe,he){var be=[];for(var Pe in Y)be.push(encodeURIComponent(he?Pe.toUpperCase():Pe)+"="+encodeURIComponent(Y[Pe]));return(!oe||oe.indexOf("?")===-1?"?":"&")+be.join("&")}var S=/\{ *([\w_ -]+) *\}/g;function j(Y,oe){return Y.replace(S,function(he,be){var Pe=oe[be];if(Pe===void 0)throw new Error("No value provided for variable "+he);return typeof Pe=="function"&&(Pe=Pe(oe)),Pe})}var U=Array.isArray||function(Y){return Object.prototype.toString.call(Y)==="[object Array]"};function B(Y,oe){for(var he=0;he<Y.length;he++)if(Y[he]===oe)return he;return-1}var R="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function E(Y){return window["webkit"+Y]||window["moz"+Y]||window["ms"+Y]}var N=0;function M(Y){var oe=+new Date,he=Math.max(0,16-(oe-N));return N=oe+he,window.setTimeout(Y,he)}var $=window.requestAnimationFrame||E("RequestAnimationFrame")||M,T=window.cancelAnimationFrame||E("CancelAnimationFrame")||E("CancelRequestAnimationFrame")||function(Y){window.clearTimeout(Y)};function C(Y,oe,he){if(he&&$===M)Y.call(oe);else return $.call(window,a(Y,oe))}function y(Y){Y&&T.call(window,Y)}var D={__proto__:null,extend:i,create:o,bind:a,get lastId(){return s},stamp:l,throttle:c,wrapNum:d,falseFn:h,formatNum:u,trim:g,splitWords:f,setOptions:p,getParamString:x,template:j,isArray:U,indexOf:B,emptyImageUrl:R,requestFn:$,cancelFn:T,requestAnimFrame:C,cancelAnimFrame:y};function k(){}k.extend=function(Y){var oe=function(){p(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},he=oe.__super__=this.prototype,be=o(he);be.constructor=oe,oe.prototype=be;for(var Pe in this)Object.prototype.hasOwnProperty.call(this,Pe)&&Pe!=="prototype"&&Pe!=="__super__"&&(oe[Pe]=this[Pe]);return Y.statics&&i(oe,Y.statics),Y.includes&&(F(Y.includes),i.apply(null,[be].concat(Y.includes))),i(be,Y),delete be.statics,delete be.includes,be.options&&(be.options=he.options?o(he.options):{},i(be.options,Y.options)),be._initHooks=[],be.callInitHooks=function(){if(!this._initHooksCalled){he.callInitHooks&&he.callInitHooks.call(this),this._initHooksCalled=!0;for(var Ne=0,$e=be._initHooks.length;Ne<$e;Ne++)be._initHooks[Ne].call(this)}},oe},k.include=function(Y){var oe=this.prototype.options;return i(this.prototype,Y),Y.options&&(this.prototype.options=oe,this.mergeOptions(Y.options)),this},k.mergeOptions=function(Y){return i(this.prototype.options,Y),this},k.addInitHook=function(Y){var oe=Array.prototype.slice.call(arguments,1),he=typeof Y=="function"?Y:function(){this[Y].apply(this,oe)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(he),this};function F(Y){if(!(typeof L=="undefined"||!L||!L.Mixin)){Y=U(Y)?Y:[Y];for(var oe=0;oe<Y.length;oe++)Y[oe]===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 V={on:function(Y,oe,he){if(typeof Y=="object")for(var be in Y)this._on(be,Y[be],oe);else{Y=f(Y);for(var Pe=0,Ne=Y.length;Pe<Ne;Pe++)this._on(Y[Pe],oe,he)}return this},off:function(Y,oe,he){if(!arguments.length)delete this._events;else if(typeof Y=="object")for(var be in Y)this._off(be,Y[be],oe);else{Y=f(Y);for(var Pe=arguments.length===1,Ne=0,$e=Y.length;Ne<$e;Ne++)Pe?this._off(Y[Ne]):this._off(Y[Ne],oe,he)}return this},_on:function(Y,oe,he,be){if(typeof oe!="function"){console.warn("wrong listener type: "+typeof oe);return}if(this._listens(Y,oe,he)===!1){he===this&&(he=void 0);var Pe={fn:oe,ctx:he};be&&(Pe.once=!0),this._events=this._events||{},this._events[Y]=this._events[Y]||[],this._events[Y].push(Pe)}},_off:function(Y,oe,he){var be,Pe,Ne;if(this._events&&(be=this._events[Y],!!be)){if(arguments.length===1){if(this._firingCount)for(Pe=0,Ne=be.length;Pe<Ne;Pe++)be[Pe].fn=h;delete this._events[Y];return}if(typeof oe!="function"){console.warn("wrong listener type: "+typeof oe);return}var $e=this._listens(Y,oe,he);if($e!==!1){var Ke=be[$e];this._firingCount&&(Ke.fn=h,this._events[Y]=be=be.slice()),be.splice($e,1)}}},fire:function(Y,oe,he){if(!this.listens(Y,he))return this;var be=i({},oe,{type:Y,target:this,sourceTarget:oe&&oe.sourceTarget||this});if(this._events){var Pe=this._events[Y];if(Pe){this._firingCount=this._firingCount+1||1;for(var Ne=0,$e=Pe.length;Ne<$e;Ne++){var Ke=Pe[Ne],tt=Ke.fn;Ke.once&&this.off(Y,tt,Ke.ctx),tt.call(Ke.ctx||this,be)}this._firingCount--}}return he&&this._propagateEvent(be),this},listens:function(Y,oe,he,be){typeof Y!="string"&&console.warn('"string" type argument expected');var Pe=oe;typeof oe!="function"&&(be=!!oe,Pe=void 0,he=void 0);var Ne=this._events&&this._events[Y];if(Ne&&Ne.length&&this._listens(Y,Pe,he)!==!1)return!0;if(be){for(var $e in this._eventParents)if(this._eventParents[$e].listens(Y,oe,he,be))return!0}return!1},_listens:function(Y,oe,he){if(!this._events)return!1;var be=this._events[Y]||[];if(!oe)return!!be.length;he===this&&(he=void 0);for(var Pe=0,Ne=be.length;Pe<Ne;Pe++)if(be[Pe].fn===oe&&be[Pe].ctx===he)return Pe;return!1},once:function(Y,oe,he){if(typeof Y=="object")for(var be in Y)this._on(be,Y[be],oe,!0);else{Y=f(Y);for(var Pe=0,Ne=Y.length;Pe<Ne;Pe++)this._on(Y[Pe],oe,he,!0)}return this},addEventParent:function(Y){return this._eventParents=this._eventParents||{},this._eventParents[l(Y)]=Y,this},removeEventParent:function(Y){return this._eventParents&&delete this._eventParents[l(Y)],this},_propagateEvent:function(Y){for(var oe in this._eventParents)this._eventParents[oe].fire(Y.type,i({layer:Y.target,propagatedFrom:Y.target},Y),!0)}};V.addEventListener=V.on,V.removeEventListener=V.clearAllEventListeners=V.off,V.addOneTimeEventListener=V.once,V.fireEvent=V.fire,V.hasEventListeners=V.listens;var q=k.extend(V);function z(Y,oe,he){this.x=he?Math.round(Y):Y,this.y=he?Math.round(oe):oe}var P=Math.trunc||function(Y){return Y>0?Math.floor(Y):Math.ceil(Y)};z.prototype={clone:function(){return new z(this.x,this.y)},add:function(Y){return this.clone()._add(W(Y))},_add:function(Y){return this.x+=Y.x,this.y+=Y.y,this},subtract:function(Y){return this.clone()._subtract(W(Y))},_subtract:function(Y){return this.x-=Y.x,this.y-=Y.y,this},divideBy:function(Y){return this.clone()._divideBy(Y)},_divideBy:function(Y){return this.x/=Y,this.y/=Y,this},multiplyBy:function(Y){return this.clone()._multiplyBy(Y)},_multiplyBy:function(Y){return this.x*=Y,this.y*=Y,this},scaleBy:function(Y){return new z(this.x*Y.x,this.y*Y.y)},unscaleBy:function(Y){return new z(this.x/Y.x,this.y/Y.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=P(this.x),this.y=P(this.y),this},distanceTo:function(Y){Y=W(Y);var oe=Y.x-this.x,he=Y.y-this.y;return Math.sqrt(oe*oe+he*he)},equals:function(Y){return Y=W(Y),Y.x===this.x&&Y.y===this.y},contains:function(Y){return Y=W(Y),Math.abs(Y.x)<=Math.abs(this.x)&&Math.abs(Y.y)<=Math.abs(this.y)},toString:function(){return"Point("+u(this.x)+", "+u(this.y)+")"}};function W(Y,oe,he){return Y instanceof z?Y:U(Y)?new z(Y[0],Y[1]):Y==null?Y:typeof Y=="object"&&"x"in Y&&"y"in Y?new z(Y.x,Y.y):new z(Y,oe,he)}function _(Y,oe){if(Y)for(var he=oe?[Y,oe]:Y,be=0,Pe=he.length;be<Pe;be++)this.extend(he[be])}_.prototype={extend:function(Y){var oe,he;if(!Y)return this;if(Y instanceof z||typeof Y[0]=="number"||"x"in Y)oe=he=W(Y);else if(Y=A(Y),oe=Y.min,he=Y.max,!oe||!he)return this;return!this.min&&!this.max?(this.min=oe.clone(),this.max=he.clone()):(this.min.x=Math.min(oe.x,this.min.x),this.max.x=Math.max(he.x,this.max.x),this.min.y=Math.min(oe.y,this.min.y),this.max.y=Math.max(he.y,this.max.y)),this},getCenter:function(Y){return W((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,Y)},getBottomLeft:function(){return W(this.min.x,this.max.y)},getTopRight:function(){return W(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(Y){var oe,he;return typeof Y[0]=="number"||Y instanceof z?Y=W(Y):Y=A(Y),Y instanceof _?(oe=Y.min,he=Y.max):oe=he=Y,oe.x>=this.min.x&&he.x<=this.max.x&&oe.y>=this.min.y&&he.y<=this.max.y},intersects:function(Y){Y=A(Y);var oe=this.min,he=this.max,be=Y.min,Pe=Y.max,Ne=Pe.x>=oe.x&&be.x<=he.x,$e=Pe.y>=oe.y&&be.y<=he.y;return Ne&&$e},overlaps:function(Y){Y=A(Y);var oe=this.min,he=this.max,be=Y.min,Pe=Y.max,Ne=Pe.x>oe.x&&be.x<he.x,$e=Pe.y>oe.y&&be.y<he.y;return Ne&&$e},isValid:function(){return!!(this.min&&this.max)},pad:function(Y){var oe=this.min,he=this.max,be=Math.abs(oe.x-he.x)*Y,Pe=Math.abs(oe.y-he.y)*Y;return A(W(oe.x-be,oe.y-Pe),W(he.x+be,he.y+Pe))},equals:function(Y){return Y?(Y=A(Y),this.min.equals(Y.getTopLeft())&&this.max.equals(Y.getBottomRight())):!1}};function A(Y,oe){return!Y||Y instanceof _?Y:new _(Y,oe)}function m(Y,oe){if(Y)for(var he=oe?[Y,oe]:Y,be=0,Pe=he.length;be<Pe;be++)this.extend(he[be])}m.prototype={extend:function(Y){var oe=this._southWest,he=this._northEast,be,Pe;if(Y instanceof w)be=Y,Pe=Y;else if(Y instanceof m){if(be=Y._southWest,Pe=Y._northEast,!be||!Pe)return this}else return Y?this.extend(v(Y)||b(Y)):this;return!oe&&!he?(this._southWest=new w(be.lat,be.lng),this._northEast=new w(Pe.lat,Pe.lng)):(oe.lat=Math.min(be.lat,oe.lat),oe.lng=Math.min(be.lng,oe.lng),he.lat=Math.max(Pe.lat,he.lat),he.lng=Math.max(Pe.lng,he.lng)),this},pad:function(Y){var oe=this._southWest,he=this._northEast,be=Math.abs(oe.lat-he.lat)*Y,Pe=Math.abs(oe.lng-he.lng)*Y;return new m(new w(oe.lat-be,oe.lng-Pe),new w(he.lat+be,he.lng+Pe))},getCenter:function(){return new w((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 w(this.getNorth(),this.getWest())},getSouthEast:function(){return new w(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(Y){typeof Y[0]=="number"||Y instanceof w||"lat"in Y?Y=v(Y):Y=b(Y);var oe=this._southWest,he=this._northEast,be,Pe;return Y instanceof m?(be=Y.getSouthWest(),Pe=Y.getNorthEast()):be=Pe=Y,be.lat>=oe.lat&&Pe.lat<=he.lat&&be.lng>=oe.lng&&Pe.lng<=he.lng},intersects:function(Y){Y=b(Y);var oe=this._southWest,he=this._northEast,be=Y.getSouthWest(),Pe=Y.getNorthEast(),Ne=Pe.lat>=oe.lat&&be.lat<=he.lat,$e=Pe.lng>=oe.lng&&be.lng<=he.lng;return Ne&&$e},overlaps:function(Y){Y=b(Y);var oe=this._southWest,he=this._northEast,be=Y.getSouthWest(),Pe=Y.getNorthEast(),Ne=Pe.lat>oe.lat&&be.lat<he.lat,$e=Pe.lng>oe.lng&&be.lng<he.lng;return Ne&&$e},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(Y,oe){return Y?(Y=b(Y),this._southWest.equals(Y.getSouthWest(),oe)&&this._northEast.equals(Y.getNorthEast(),oe)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function b(Y,oe){return Y instanceof m?Y:new m(Y,oe)}function w(Y,oe,he){if(isNaN(Y)||isNaN(oe))throw new Error("Invalid LatLng object: ("+Y+", "+oe+")");this.lat=+Y,this.lng=+oe,he!==void 0&&(this.alt=+he)}w.prototype={equals:function(Y,oe){if(!Y)return!1;Y=v(Y);var he=Math.max(Math.abs(this.lat-Y.lat),Math.abs(this.lng-Y.lng));return he<=(oe===void 0?1e-9:oe)},toString:function(Y){return"LatLng("+u(this.lat,Y)+", "+u(this.lng,Y)+")"},distanceTo:function(Y){return O.distance(this,v(Y))},wrap:function(){return O.wrapLatLng(this)},toBounds:function(Y){var oe=180*Y/40075017,he=oe/Math.cos(Math.PI/180*this.lat);return b([this.lat-oe,this.lng-he],[this.lat+oe,this.lng+he])},clone:function(){return new w(this.lat,this.lng,this.alt)}};function v(Y,oe,he){return Y instanceof w?Y:U(Y)&&typeof Y[0]!="object"?Y.length===3?new w(Y[0],Y[1],Y[2]):Y.length===2?new w(Y[0],Y[1]):null:Y==null?Y:typeof Y=="object"&&"lat"in Y?new w(Y.lat,"lng"in Y?Y.lng:Y.lon,Y.alt):oe===void 0?null:new w(Y,oe,he)}var I={latLngToPoint:function(Y,oe){var he=this.projection.project(Y),be=this.scale(oe);return this.transformation._transform(he,be)},pointToLatLng:function(Y,oe){var he=this.scale(oe),be=this.transformation.untransform(Y,he);return this.projection.unproject(be)},project:function(Y){return this.projection.project(Y)},unproject:function(Y){return this.projection.unproject(Y)},scale:function(Y){return 256*Math.pow(2,Y)},zoom:function(Y){return Math.log(Y/256)/Math.LN2},getProjectedBounds:function(Y){if(this.infinite)return null;var oe=this.projection.bounds,he=this.scale(Y),be=this.transformation.transform(oe.min,he),Pe=this.transformation.transform(oe.max,he);return new _(be,Pe)},infinite:!1,wrapLatLng:function(Y){var oe=this.wrapLng?d(Y.lng,this.wrapLng,!0):Y.lng,he=this.wrapLat?d(Y.lat,this.wrapLat,!0):Y.lat,be=Y.alt;return new w(he,oe,be)},wrapLatLngBounds:function(Y){var oe=Y.getCenter(),he=this.wrapLatLng(oe),be=oe.lat-he.lat,Pe=oe.lng-he.lng;if(be===0&&Pe===0)return Y;var Ne=Y.getSouthWest(),$e=Y.getNorthEast(),Ke=new w(Ne.lat-be,Ne.lng-Pe),tt=new w($e.lat-be,$e.lng-Pe);return new m(Ke,tt)}},O=i({},I,{wrapLng:[-180,180],R:6371e3,distance:function(Y,oe){var he=Math.PI/180,be=Y.lat*he,Pe=oe.lat*he,Ne=Math.sin((oe.lat-Y.lat)*he/2),$e=Math.sin((oe.lng-Y.lng)*he/2),Ke=Ne*Ne+Math.cos(be)*Math.cos(Pe)*$e*$e,tt=2*Math.atan2(Math.sqrt(Ke),Math.sqrt(1-Ke));return this.R*tt}}),H=6378137,X={R:H,MAX_LATITUDE:85.0511287798,project:function(Y){var oe=Math.PI/180,he=this.MAX_LATITUDE,be=Math.max(Math.min(he,Y.lat),-he),Pe=Math.sin(be*oe);return new z(this.R*Y.lng*oe,this.R*Math.log((1+Pe)/(1-Pe))/2)},unproject:function(Y){var oe=180/Math.PI;return new w((2*Math.atan(Math.exp(Y.y/this.R))-Math.PI/2)*oe,Y.x*oe/this.R)},bounds:function(){var Y=H*Math.PI;return new _([-Y,-Y],[Y,Y])}()};function Q(Y,oe,he,be){if(U(Y)){this._a=Y[0],this._b=Y[1],this._c=Y[2],this._d=Y[3];return}this._a=Y,this._b=oe,this._c=he,this._d=be}Q.prototype={transform:function(Y,oe){return this._transform(Y.clone(),oe)},_transform:function(Y,oe){return oe=oe||1,Y.x=oe*(this._a*Y.x+this._b),Y.y=oe*(this._c*Y.y+this._d),Y},untransform:function(Y,oe){return oe=oe||1,new z((Y.x/oe-this._b)/this._a,(Y.y/oe-this._d)/this._c)}};function J(Y,oe,he,be){return new Q(Y,oe,he,be)}var G=i({},O,{code:"EPSG:3857",projection:X,transformation:function(){var Y=.5/(Math.PI*X.R);return J(Y,.5,-Y,.5)}()}),Z=i({},G,{code:"EPSG:900913"});function K(Y){return document.createElementNS("http://www.w3.org/2000/svg",Y)}function ne(Y,oe){var he="",be,Pe,Ne,$e,Ke,tt;for(be=0,Ne=Y.length;be<Ne;be++){for(Ke=Y[be],Pe=0,$e=Ke.length;Pe<$e;Pe++)tt=Ke[Pe],he+=(Pe?"L":"M")+tt.x+" "+tt.y;he+=oe?_t.svg?"z":"x":""}return he||"M0 0"}var ie=document.documentElement.style,ee="ActiveXObject"in window,te=ee&&!document.addEventListener,re="msLaunchUri"in navigator&&!("documentMode"in document),le=Ot("webkit"),se=Ot("android"),ae=Ot("android 2")||Ot("android 3"),de=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ge=se&&Ot("Google")&&de<537&&!("AudioNode"in window),fe=!!window.opera,ve=!re&&Ot("chrome"),we=Ot("gecko")&&!le&&!fe&&!ee,Te=!ve&&Ot("safari"),Ae=Ot("phantom"),Le="OTransition"in ie,Ee=navigator.platform.indexOf("Win")===0,_e=ee&&"transition"in ie,me="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ae,ye="MozPerspective"in ie,Se=!window.L_DISABLE_3D&&(_e||me||ye)&&!Le&&!Ae,De=typeof orientation!="undefined"||Ot("mobile"),Ie=De&&le,Oe=De&&me,je=!window.PointerEvent&&window.MSPointerEvent,ze=!!(window.PointerEvent||je),Be="ontouchstart"in window||!!window.TouchEvent,Ue=!window.L_NO_TOUCH&&(Be||ze),Xe=De&&fe,qe=De&&we,rt=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,nt=function(){var Y=!1;try{var oe=Object.defineProperty({},"passive",{get:function(){Y=!0}});window.addEventListener("testPassiveEventSupport",h,oe),window.removeEventListener("testPassiveEventSupport",h,oe)}catch(he){}return Y}(),Qe=function(){return!!document.createElement("canvas").getContext}(),it=!!(document.createElementNS&&K("svg").createSVGRect),Je=!!it&&function(){var Y=document.createElement("div");return Y.innerHTML="<svg/>",(Y.firstChild&&Y.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),ct=!it&&function(){try{var Y=document.createElement("div");Y.innerHTML='<v:shape adj="1"/>';var oe=Y.firstChild;return oe.style.behavior="url(#default#VML)",oe&&typeof oe.adj=="object"}catch(he){return!1}}(),st=navigator.platform.indexOf("Mac")===0,Ct=navigator.platform.indexOf("Linux")===0;function Ot(Y){return navigator.userAgent.toLowerCase().indexOf(Y)>=0}var _t={ie:ee,ielt9:te,edge:re,webkit:le,android:se,android23:ae,androidStock:ge,opera:fe,chrome:ve,gecko:we,safari:Te,phantom:Ae,opera12:Le,win:Ee,ie3d:_e,webkit3d:me,gecko3d:ye,any3d:Se,mobile:De,mobileWebkit:Ie,mobileWebkit3d:Oe,msPointer:je,pointer:ze,touch:Ue,touchNative:Be,mobileOpera:Xe,mobileGecko:qe,retina:rt,passiveEvents:nt,canvas:Qe,svg:it,vml:ct,inlineSvg:Je,mac:st,linux:Ct},Bt=_t.msPointer?"MSPointerDown":"pointerdown",Xt=_t.msPointer?"MSPointerMove":"pointermove",zr=_t.msPointer?"MSPointerUp":"pointerup",et=_t.msPointer?"MSPointerCancel":"pointercancel",bt={touchstart:Bt,touchmove:Xt,touchend:zr,touchcancel:et},Ut={touchstart:$r,touchmove:ln,touchend:ln,touchcancel:ln},Zt={},fn=!1;function gn(Y,oe,he){return oe==="touchstart"&&yr(),Ut[oe]?(he=Ut[oe].bind(this,he),Y.addEventListener(bt[oe],he,!1),he):(console.warn("wrong event specified:",oe),h)}function Mt(Y,oe,he){if(!bt[oe]){console.warn("wrong event specified:",oe);return}Y.removeEventListener(bt[oe],he,!1)}function He(Y){Zt[Y.pointerId]=Y}function gt(Y){Zt[Y.pointerId]&&(Zt[Y.pointerId]=Y)}function kt(Y){delete Zt[Y.pointerId]}function yr(){fn||(document.addEventListener(Bt,He,!0),document.addEventListener(Xt,gt,!0),document.addEventListener(zr,kt,!0),document.addEventListener(et,kt,!0),fn=!0)}function ln(Y,oe){if(oe.pointerType!==(oe.MSPOINTER_TYPE_MOUSE||"mouse")){oe.touches=[];for(var he in Zt)oe.touches.push(Zt[he]);oe.changedTouches=[oe],Y(oe)}}function $r(Y,oe){oe.MSPOINTER_TYPE_TOUCH&&oe.pointerType===oe.MSPOINTER_TYPE_TOUCH&&Oo(oe),ln(Y,oe)}function In(Y){var oe={},he,be;for(be in Y)he=Y[be],oe[be]=he&&he.bind?he.bind(Y):he;return Y=oe,oe.type="dblclick",oe.detail=2,oe.isTrusted=!1,oe._simulated=!0,oe}var cr=200;function Gn(Y,oe){Y.addEventListener("dblclick",oe);var he=0,be;function Pe(Ne){if(Ne.detail!==1){be=Ne.detail;return}if(!(Ne.pointerType==="mouse"||Ne.sourceCapabilities&&!Ne.sourceCapabilities.firesTouchEvents)){var $e=Fve(Ne);if(!($e.some(function(tt){return tt instanceof HTMLLabelElement&&tt.attributes.for})&&!$e.some(function(tt){return tt instanceof HTMLInputElement||tt instanceof HTMLSelectElement}))){var Ke=Date.now();Ke-he<=cr?(be++,be===2&&oe(In(Ne))):be=1,he=Ke}}}return Y.addEventListener("click",Pe),{dblclick:oe,simDblclick:Pe}}function cn(Y,oe){Y.removeEventListener("dblclick",oe.dblclick),Y.removeEventListener("click",oe.simDblclick)}var Za=GP(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Xa=GP(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Dv=Xa==="webkitTransition"||Xa==="OTransition"?Xa+"End":"transitionend";function dt(Y){return typeof Y=="string"?document.getElementById(Y):Y}function fr(Y,oe){var he=Y.style[oe]||Y.currentStyle&&Y.currentStyle[oe];if((!he||he==="auto")&&document.defaultView){var be=document.defaultView.getComputedStyle(Y,null);he=be?be[oe]:null}return he==="auto"?null:he}function Yt(Y,oe,he){var be=document.createElement(Y);return be.className=oe||"",he&&he.appendChild(be),be}function Or(Y){var oe=Y.parentNode;oe&&oe.removeChild(Y)}function Ka(Y){for(;Y.firstChild;)Y.removeChild(Y.firstChild)}function hu(Y){var oe=Y.parentNode;oe&&oe.lastChild!==Y&&oe.appendChild(Y)}function ic(Y){var oe=Y.parentNode;oe&&oe.firstChild!==Y&&oe.insertBefore(Y,oe.firstChild)}function Jw(Y,oe){if(Y.classList!==void 0)return Y.classList.contains(oe);var he=UP(Y);return he.length>0&&new RegExp("(^|\\s)"+oe+"(\\s|$)").test(he)}function br(Y,oe){if(Y.classList!==void 0)for(var he=f(oe),be=0,Pe=he.length;be<Pe;be++)Y.classList.add(he[be]);else if(!Jw(Y,oe)){var Ne=UP(Y);eC(Y,(Ne?Ne+" ":"")+oe)}}function fi(Y,oe){Y.classList!==void 0?Y.classList.remove(oe):eC(Y,g((" "+UP(Y)+" ").replace(" "+oe+" "," ")))}function eC(Y,oe){Y.className.baseVal===void 0?Y.className=oe:Y.className.baseVal=oe}function UP(Y){return Y.correspondingElement&&(Y=Y.correspondingElement),Y.className.baseVal===void 0?Y.className:Y.className.baseVal}function kl(Y,oe){"opacity"in Y.style?Y.style.opacity=oe:"filter"in Y.style&&ttr(Y,oe)}function ttr(Y,oe){var he=!1,be="DXImageTransform.Microsoft.Alpha";try{he=Y.filters.item(be)}catch(Pe){if(oe===1)return}oe=Math.round(oe*100),he?(he.Enabled=oe!==100,he.Opacity=oe):Y.style.filter+=" progid:"+be+"(opacity="+oe+")"}function GP(Y){for(var oe=document.documentElement.style,he=0;he<Y.length;he++)if(Y[he]in oe)return Y[he];return!1}function ng(Y,oe,he){var be=oe||new z(0,0);Y.style[Za]=(_t.ie3d?"translate("+be.x+"px,"+be.y+"px)":"translate3d("+be.x+"px,"+be.y+"px,0)")+(he?" scale("+he+")":"")}function $i(Y,oe){Y._leaflet_pos=oe,_t.any3d?ng(Y,oe):(Y.style.left=oe.x+"px",Y.style.top=oe.y+"px")}function ig(Y){return Y._leaflet_pos||new z(0,0)}var tC,rC,qz;if("onselectstart"in document)tC=function(){xr(window,"selectstart",Oo)},rC=function(){Vn(window,"selectstart",Oo)};else{var nC=GP(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);tC=function(){if(nC){var Y=document.documentElement.style;qz=Y[nC],Y[nC]="none"}},rC=function(){nC&&(document.documentElement.style[nC]=qz,qz=void 0)}}function Zz(){xr(window,"dragstart",Oo)}function Xz(){Vn(window,"dragstart",Oo)}var VP,Kz;function Qz(Y){for(;Y.tabIndex===-1;)Y=Y.parentNode;Y.style&&(YP(),VP=Y,Kz=Y.style.outlineStyle,Y.style.outlineStyle="none",xr(window,"keydown",YP))}function YP(){VP&&(VP.style.outlineStyle=Kz,VP=void 0,Kz=void 0,Vn(window,"keydown",YP))}function Nve(Y){do Y=Y.parentNode;while((!Y.offsetWidth||!Y.offsetHeight)&&Y!==document.body);return Y}function Jz(Y){var oe=Y.getBoundingClientRect();return{x:oe.width/Y.offsetWidth||1,y:oe.height/Y.offsetHeight||1,boundingClientRect:oe}}var rtr={__proto__:null,TRANSFORM:Za,TRANSITION:Xa,TRANSITION_END:Dv,get:dt,getStyle:fr,create:Yt,remove:Or,empty:Ka,toFront:hu,toBack:ic,hasClass:Jw,addClass:br,removeClass:fi,setClass:eC,getClass:UP,setOpacity:kl,testProp:GP,setTransform:ng,setPosition:$i,getPosition:ig,get disableTextSelection(){return tC},get enableTextSelection(){return rC},disableImageDrag:Zz,enableImageDrag:Xz,preventOutline:Qz,restoreOutline:YP,getSizedParentNode:Nve,getScale:Jz};function xr(Y,oe,he,be){if(oe&&typeof oe=="object")for(var Pe in oe)t9(Y,Pe,oe[Pe],he);else{oe=f(oe);for(var Ne=0,$e=oe.length;Ne<$e;Ne++)t9(Y,oe[Ne],he,be)}return this}var pu="_leaflet_events";function Vn(Y,oe,he,be){if(arguments.length===1)Rve(Y),delete Y[pu];else if(oe&&typeof oe=="object")for(var Pe in oe)r9(Y,Pe,oe[Pe],he);else if(oe=f(oe),arguments.length===2)Rve(Y,function(Ke){return B(oe,Ke)!==-1});else for(var Ne=0,$e=oe.length;Ne<$e;Ne++)r9(Y,oe[Ne],he,be);return this}function Rve(Y,oe){for(var he in Y[pu]){var be=he.split(/\d/)[0];(!oe||oe(be))&&r9(Y,be,null,null,he)}}var e9={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function t9(Y,oe,he,be){var Pe=oe+l(he)+(be?"_"+l(be):"");if(Y[pu]&&Y[pu][Pe])return this;var Ne=function(Ke){return he.call(be||Y,Ke||window.event)},$e=Ne;!_t.touchNative&&_t.pointer&&oe.indexOf("touch")===0?Ne=gn(Y,oe,Ne):_t.touch&&oe==="dblclick"?Ne=Gn(Y,Ne):"addEventListener"in Y?oe==="touchstart"||oe==="touchmove"||oe==="wheel"||oe==="mousewheel"?Y.addEventListener(e9[oe]||oe,Ne,_t.passiveEvents?{passive:!1}:!1):oe==="mouseenter"||oe==="mouseleave"?(Ne=function(Ke){Ke=Ke||window.event,i9(Y,Ke)&&$e(Ke)},Y.addEventListener(e9[oe],Ne,!1)):Y.addEventListener(oe,$e,!1):Y.attachEvent("on"+oe,Ne),Y[pu]=Y[pu]||{},Y[pu][Pe]=Ne}function r9(Y,oe,he,be,Pe){Pe=Pe||oe+l(he)+(be?"_"+l(be):"");var Ne=Y[pu]&&Y[pu][Pe];if(!Ne)return this;!_t.touchNative&&_t.pointer&&oe.indexOf("touch")===0?Mt(Y,oe,Ne):_t.touch&&oe==="dblclick"?cn(Y,Ne):"removeEventListener"in Y?Y.removeEventListener(e9[oe]||oe,Ne,!1):Y.detachEvent("on"+oe,Ne),Y[pu][Pe]=null}function og(Y){return Y.stopPropagation?Y.stopPropagation():Y.originalEvent?Y.originalEvent._stopped=!0:Y.cancelBubble=!0,this}function n9(Y){return t9(Y,"wheel",og),this}function iC(Y){return xr(Y,"mousedown touchstart dblclick contextmenu",og),Y._leaflet_disable_click=!0,this}function Oo(Y){return Y.preventDefault?Y.preventDefault():Y.returnValue=!1,this}function ag(Y){return Oo(Y),og(Y),this}function Fve(Y){if(Y.composedPath)return Y.composedPath();for(var oe=[],he=Y.target;he;)oe.push(he),he=he.parentNode;return oe}function jve(Y,oe){if(!oe)return new z(Y.clientX,Y.clientY);var he=Jz(oe),be=he.boundingClientRect;return new z((Y.clientX-be.left)/he.x-oe.clientLeft,(Y.clientY-be.top)/he.y-oe.clientTop)}var ntr=_t.linux&&_t.chrome?window.devicePixelRatio:_t.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Bve(Y){return _t.edge?Y.wheelDeltaY/2:Y.deltaY&&Y.deltaMode===0?-Y.deltaY/ntr:Y.deltaY&&Y.deltaMode===1?-Y.deltaY*20:Y.deltaY&&Y.deltaMode===2?-Y.deltaY*60:Y.deltaX||Y.deltaZ?0:Y.wheelDelta?(Y.wheelDeltaY||Y.wheelDelta)/2:Y.detail&&Math.abs(Y.detail)<32765?-Y.detail*20:Y.detail?Y.detail/-32765*60:0}function i9(Y,oe){var he=oe.relatedTarget;if(!he)return!0;try{for(;he&&he!==Y;)he=he.parentNode}catch(be){return!1}return he!==Y}var itr={__proto__:null,on:xr,off:Vn,stopPropagation:og,disableScrollPropagation:n9,disableClickPropagation:iC,preventDefault:Oo,stop:ag,getPropagationPath:Fve,getMousePosition:jve,getWheelDelta:Bve,isExternalTarget:i9,addListener:xr,removeListener:Vn},zve=q.extend({run:function(Y,oe,he,be){this.stop(),this._el=Y,this._inProgress=!0,this._duration=he||.25,this._easeOutPower=1/Math.max(be||.5,.2),this._startPos=ig(Y),this._offset=oe.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=C(this._animate,this),this._step()},_step:function(Y){var oe=+new Date-this._startTime,he=this._duration*1e3;oe<he?this._runFrame(this._easeOut(oe/he),Y):(this._runFrame(1),this._complete())},_runFrame:function(Y,oe){var he=this._startPos.add(this._offset.multiplyBy(Y));oe&&he._round(),$i(this._el,he),this.fire("step")},_complete:function(){y(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(Y){return 1-Math.pow(1-Y,this._easeOutPower)}}),Ir=q.extend({options:{crs:G,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(Y,oe){oe=p(this,oe),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(Y),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),oe.maxBounds&&this.setMaxBounds(oe.maxBounds),oe.zoom!==void 0&&(this._zoom=this._limitZoom(oe.zoom)),oe.center&&oe.zoom!==void 0&&this.setView(v(oe.center),oe.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Xa&&_t.any3d&&!_t.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),xr(this._proxy,Dv,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(Y,oe,he){if(oe=oe===void 0?this._zoom:this._limitZoom(oe),Y=this._limitCenter(v(Y),oe,this.options.maxBounds),he=he||{},this._stop(),this._loaded&&!he.reset&&he!==!0){he.animate!==void 0&&(he.zoom=i({animate:he.animate},he.zoom),he.pan=i({animate:he.animate,duration:he.duration},he.pan));var be=this._zoom!==oe?this._tryAnimatedZoom&&this._tryAnimatedZoom(Y,oe,he.zoom):this._tryAnimatedPan(Y,he.pan);if(be)return clearTimeout(this._sizeTimer),this}return this._resetView(Y,oe,he.pan&&he.pan.noMoveStart),this},setZoom:function(Y,oe){return this._loaded?this.setView(this.getCenter(),Y,{zoom:oe}):(this._zoom=Y,this)},zoomIn:function(Y,oe){return Y=Y||(_t.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+Y,oe)},zoomOut:function(Y,oe){return Y=Y||(_t.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-Y,oe)},setZoomAround:function(Y,oe,he){var be=this.getZoomScale(oe),Pe=this.getSize().divideBy(2),Ne=Y instanceof z?Y:this.latLngToContainerPoint(Y),$e=Ne.subtract(Pe).multiplyBy(1-1/be),Ke=this.containerPointToLatLng(Pe.add($e));return this.setView(Ke,oe,{zoom:he})},_getBoundsCenterZoom:function(Y,oe){oe=oe||{},Y=Y.getBounds?Y.getBounds():b(Y);var he=W(oe.paddingTopLeft||oe.padding||[0,0]),be=W(oe.paddingBottomRight||oe.padding||[0,0]),Pe=this.getBoundsZoom(Y,!1,he.add(be));if(Pe=typeof oe.maxZoom=="number"?Math.min(oe.maxZoom,Pe):Pe,Pe===1/0)return{center:Y.getCenter(),zoom:Pe};var Ne=be.subtract(he).divideBy(2),$e=this.project(Y.getSouthWest(),Pe),Ke=this.project(Y.getNorthEast(),Pe),tt=this.unproject($e.add(Ke).divideBy(2).add(Ne),Pe);return{center:tt,zoom:Pe}},fitBounds:function(Y,oe){if(Y=b(Y),!Y.isValid())throw new Error("Bounds are not valid.");var he=this._getBoundsCenterZoom(Y,oe);return this.setView(he.center,he.zoom,oe)},fitWorld:function(Y){return this.fitBounds([[-90,-180],[90,180]],Y)},panTo:function(Y,oe){return this.setView(Y,this._zoom,{pan:oe})},panBy:function(Y,oe){if(Y=W(Y).round(),oe=oe||{},!Y.x&&!Y.y)return this.fire("moveend");if(oe.animate!==!0&&!this.getSize().contains(Y))return this._resetView(this.unproject(this.project(this.getCenter()).add(Y)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new zve,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),oe.noMoveStart||this.fire("movestart"),oe.animate!==!1){br(this._mapPane,"leaflet-pan-anim");var he=this._getMapPanePos().subtract(Y).round();this._panAnim.run(this._mapPane,he,oe.duration||.25,oe.easeLinearity)}else this._rawPanBy(Y),this.fire("move").fire("moveend");return this},flyTo:function(Y,oe,he){if(he=he||{},he.animate===!1||!_t.any3d)return this.setView(Y,oe,he);this._stop();var be=this.project(this.getCenter()),Pe=this.project(Y),Ne=this.getSize(),$e=this._zoom;Y=v(Y),oe=oe===void 0?$e:oe;var Ke=Math.max(Ne.x,Ne.y),tt=Ke*this.getZoomScale($e,oe),mt=Pe.distanceTo(be)||1,Rt=1.42,rr=Rt*Rt;function Mr(Wi){var o3=Wi?-1:1,Vtr=Wi?tt:Ke,Ytr=tt*tt-Ke*Ke+o3*rr*rr*mt*mt,qtr=2*Vtr*rr*mt,g9=Ytr/qtr,xye=Math.sqrt(g9*g9+1)-g9,Ztr=xye<1e-9?-18:Math.log(xye);return Ztr}function Ca(Wi){return(Math.exp(Wi)-Math.exp(-Wi))/2}function uo(Wi){return(Math.exp(Wi)+Math.exp(-Wi))/2}function Tl(Wi){return Ca(Wi)/uo(Wi)}var Qa=Mr(0);function Fv(Wi){return Ke*(uo(Qa)/uo(Qa+Rt*Wi))}function Wtr(Wi){return Ke*(uo(Qa)*Tl(Qa+Rt*Wi)-Ca(Qa))/rr}function Htr(Wi){return 1-Math.pow(1-Wi,1.5)}var Utr=Date.now(),yye=(Mr(1)-Qa)/Rt,Gtr=he.duration?1e3*he.duration:1e3*yye*.8;function bye(){var Wi=(Date.now()-Utr)/Gtr,o3=Htr(Wi)*yye;Wi<=1?(this._flyToFrame=C(bye,this),this._move(this.unproject(be.add(Pe.subtract(be).multiplyBy(Wtr(o3)/mt)),$e),this.getScaleZoom(Ke/Fv(o3),$e),{flyTo:!0})):this._move(Y,oe)._moveEnd(!0)}return this._moveStart(!0,he.noMoveStart),bye.call(this),this},flyToBounds:function(Y,oe){var he=this._getBoundsCenterZoom(Y,oe);return this.flyTo(he.center,he.zoom,oe)},setMaxBounds:function(Y){return Y=b(Y),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),Y.isValid()?(this.options.maxBounds=Y,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(Y){var oe=this.options.minZoom;return this.options.minZoom=Y,this._loaded&&oe!==Y&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(Y):this},setMaxZoom:function(Y){var oe=this.options.maxZoom;return this.options.maxZoom=Y,this._loaded&&oe!==Y&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(Y):this},panInsideBounds:function(Y,oe){this._enforcingBounds=!0;var he=this.getCenter(),be=this._limitCenter(he,this._zoom,b(Y));return he.equals(be)||this.panTo(be,oe),this._enforcingBounds=!1,this},panInside:function(Y,oe){oe=oe||{};var he=W(oe.paddingTopLeft||oe.padding||[0,0]),be=W(oe.paddingBottomRight||oe.padding||[0,0]),Pe=this.project(this.getCenter()),Ne=this.project(Y),$e=this.getPixelBounds(),Ke=A([$e.min.add(he),$e.max.subtract(be)]),tt=Ke.getSize();if(!Ke.contains(Ne)){this._enforcingBounds=!0;var mt=Ne.subtract(Ke.getCenter()),Rt=Ke.extend(Ne).getSize().subtract(tt);Pe.x+=mt.x<0?-Rt.x:Rt.x,Pe.y+=mt.y<0?-Rt.y:Rt.y,this.panTo(this.unproject(Pe),oe),this._enforcingBounds=!1}return this},invalidateSize:function(Y){if(!this._loaded)return this;Y=i({animate:!1,pan:!0},Y===!0?{animate:!0}:Y);var oe=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var he=this.getSize(),be=oe.divideBy(2).round(),Pe=he.divideBy(2).round(),Ne=be.subtract(Pe);return!Ne.x&&!Ne.y?this:(Y.animate&&Y.pan?this.panBy(Ne):(Y.pan&&this._rawPanBy(Ne),this.fire("move"),Y.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:oe,newSize:he}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(Y){if(Y=this._locateOptions=i({timeout:1e4,watch:!1},Y),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var oe=a(this._handleGeolocationResponse,this),he=a(this._handleGeolocationError,this);return Y.watch?this._locationWatchId=navigator.geolocation.watchPosition(oe,he,Y):navigator.geolocation.getCurrentPosition(oe,he,Y),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(Y){if(this._container._leaflet_id){var oe=Y.code,he=Y.message||(oe===1?"permission denied":oe===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:oe,message:"Geolocation error: "+he+"."})}},_handleGeolocationResponse:function(Y){if(this._container._leaflet_id){var oe=Y.coords.latitude,he=Y.coords.longitude,be=new w(oe,he),Pe=be.toBounds(Y.coords.accuracy*2),Ne=this._locateOptions;if(Ne.setView){var $e=this.getBoundsZoom(Pe);this.setView(be,Ne.maxZoom?Math.min($e,Ne.maxZoom):$e)}var Ke={latlng:be,bounds:Pe,timestamp:Y.timestamp};for(var tt in Y.coords)typeof Y.coords[tt]=="number"&&(Ke[tt]=Y.coords[tt]);this.fire("locationfound",Ke)}},addHandler:function(Y,oe){if(!oe)return this;var he=this[Y]=new oe(this);return this._handlers.push(he),this.options[Y]&&he.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(oe){this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Or(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(y(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var Y;for(Y in this._layers)this._layers[Y].remove();for(Y in this._panes)Or(this._panes[Y]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(Y,oe){var he="leaflet-pane"+(Y?" leaflet-"+Y.replace("Pane","")+"-pane":""),be=Yt("div",he,oe||this._mapPane);return Y&&(this._panes[Y]=be),be},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var Y=this.getPixelBounds(),oe=this.unproject(Y.getBottomLeft()),he=this.unproject(Y.getTopRight());return new m(oe,he)},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(Y,oe,he){Y=b(Y),he=W(he||[0,0]);var be=this.getZoom()||0,Pe=this.getMinZoom(),Ne=this.getMaxZoom(),$e=Y.getNorthWest(),Ke=Y.getSouthEast(),tt=this.getSize().subtract(he),mt=A(this.project(Ke,be),this.project($e,be)).getSize(),Rt=_t.any3d?this.options.zoomSnap:1,rr=tt.x/mt.x,Mr=tt.y/mt.y,Ca=oe?Math.max(rr,Mr):Math.min(rr,Mr);return be=this.getScaleZoom(Ca,be),Rt&&(be=Math.round(be/(Rt/100))*(Rt/100),be=oe?Math.ceil(be/Rt)*Rt:Math.floor(be/Rt)*Rt),Math.max(Pe,Math.min(Ne,be))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new z(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(Y,oe){var he=this._getTopLeftPoint(Y,oe);return new _(he,he.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(Y){return this.options.crs.getProjectedBounds(Y===void 0?this.getZoom():Y)},getPane:function(Y){return typeof Y=="string"?this._panes[Y]:Y},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(Y,oe){var he=this.options.crs;return oe=oe===void 0?this._zoom:oe,he.scale(Y)/he.scale(oe)},getScaleZoom:function(Y,oe){var he=this.options.crs;oe=oe===void 0?this._zoom:oe;var be=he.zoom(Y*he.scale(oe));return isNaN(be)?1/0:be},project:function(Y,oe){return oe=oe===void 0?this._zoom:oe,this.options.crs.latLngToPoint(v(Y),oe)},unproject:function(Y,oe){return oe=oe===void 0?this._zoom:oe,this.options.crs.pointToLatLng(W(Y),oe)},layerPointToLatLng:function(Y){var oe=W(Y).add(this.getPixelOrigin());return this.unproject(oe)},latLngToLayerPoint:function(Y){var oe=this.project(v(Y))._round();return oe._subtract(this.getPixelOrigin())},wrapLatLng:function(Y){return this.options.crs.wrapLatLng(v(Y))},wrapLatLngBounds:function(Y){return this.options.crs.wrapLatLngBounds(b(Y))},distance:function(Y,oe){return this.options.crs.distance(v(Y),v(oe))},containerPointToLayerPoint:function(Y){return W(Y).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(Y){return W(Y).add(this._getMapPanePos())},containerPointToLatLng:function(Y){var oe=this.containerPointToLayerPoint(W(Y));return this.layerPointToLatLng(oe)},latLngToContainerPoint:function(Y){return this.layerPointToContainerPoint(this.latLngToLayerPoint(v(Y)))},mouseEventToContainerPoint:function(Y){return jve(Y,this._container)},mouseEventToLayerPoint:function(Y){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(Y))},mouseEventToLatLng:function(Y){return this.layerPointToLatLng(this.mouseEventToLayerPoint(Y))},_initContainer:function(Y){var oe=this._container=dt(Y);if(oe){if(oe._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");xr(oe,"scroll",this._onScroll,this),this._containerId=l(oe)},_initLayout:function(){var Y=this._container;this._fadeAnimated=this.options.fadeAnimation&&_t.any3d,br(Y,"leaflet-container"+(_t.touch?" leaflet-touch":"")+(_t.retina?" leaflet-retina":"")+(_t.ielt9?" leaflet-oldie":"")+(_t.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var oe=fr(Y,"position");oe!=="absolute"&&oe!=="relative"&&oe!=="fixed"&&oe!=="sticky"&&(Y.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var Y=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),$i(this._mapPane,new z(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(br(Y.markerPane,"leaflet-zoom-hide"),br(Y.shadowPane,"leaflet-zoom-hide"))},_resetView:function(Y,oe,he){$i(this._mapPane,new z(0,0));var be=!this._loaded;this._loaded=!0,oe=this._limitZoom(oe),this.fire("viewprereset");var Pe=this._zoom!==oe;this._moveStart(Pe,he)._move(Y,oe)._moveEnd(Pe),this.fire("viewreset"),be&&this.fire("load")},_moveStart:function(Y,oe){return Y&&this.fire("zoomstart"),oe||this.fire("movestart"),this},_move:function(Y,oe,he,be){oe===void 0&&(oe=this._zoom);var Pe=this._zoom!==oe;return this._zoom=oe,this._lastCenter=Y,this._pixelOrigin=this._getNewPixelOrigin(Y),be?he&&he.pinch&&this.fire("zoom",he):((Pe||he&&he.pinch)&&this.fire("zoom",he),this.fire("move",he)),this},_moveEnd:function(Y){return Y&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return y(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(Y){$i(this._mapPane,this._getMapPanePos().subtract(Y))},_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(Y){this._targets={},this._targets[l(this._container)]=this;var oe=Y?Vn:xr;oe(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&oe(window,"resize",this._onResize,this),_t.any3d&&this.options.transform3DLimit&&(Y?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){y(this._resizeRequest),this._resizeRequest=C(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var Y=this._getMapPanePos();Math.max(Math.abs(Y.x),Math.abs(Y.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(Y,oe){for(var he=[],be,Pe=oe==="mouseout"||oe==="mouseover",Ne=Y.target||Y.srcElement,$e=!1;Ne;){if(be=this._targets[l(Ne)],be&&(oe==="click"||oe==="preclick")&&this._draggableMoved(be)){$e=!0;break}if(be&&be.listens(oe,!0)&&(Pe&&!i9(Ne,Y)||(he.push(be),Pe))||Ne===this._container)break;Ne=Ne.parentNode}return!he.length&&!$e&&!Pe&&this.listens(oe,!0)&&(he=[this]),he},_isClickDisabled:function(Y){for(;Y&&Y!==this._container;){if(Y._leaflet_disable_click)return!0;Y=Y.parentNode}},_handleDOMEvent:function(Y){var oe=Y.target||Y.srcElement;if(!(!this._loaded||oe._leaflet_disable_events||Y.type==="click"&&this._isClickDisabled(oe))){var he=Y.type;he==="mousedown"&&Qz(oe),this._fireDOMEvent(Y,he)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(Y,oe,he){if(Y.type==="click"){var be=i({},Y);be.type="preclick",this._fireDOMEvent(be,be.type,he)}var Pe=this._findEventTargets(Y,oe);if(he){for(var Ne=[],$e=0;$e<he.length;$e++)he[$e].listens(oe,!0)&&Ne.push(he[$e]);Pe=Ne.concat(Pe)}if(Pe.length){oe==="contextmenu"&&Oo(Y);var Ke=Pe[0],tt={originalEvent:Y};if(Y.type!=="keypress"&&Y.type!=="keydown"&&Y.type!=="keyup"){var mt=Ke.getLatLng&&(!Ke._radius||Ke._radius<=10);tt.containerPoint=mt?this.latLngToContainerPoint(Ke.getLatLng()):this.mouseEventToContainerPoint(Y),tt.layerPoint=this.containerPointToLayerPoint(tt.containerPoint),tt.latlng=mt?Ke.getLatLng():this.layerPointToLatLng(tt.layerPoint)}for($e=0;$e<Pe.length;$e++)if(Pe[$e].fire(oe,tt,!0),tt.originalEvent._stopped||Pe[$e].options.bubblingMouseEvents===!1&&B(this._mouseEvents,oe)!==-1)return}},_draggableMoved:function(Y){return Y=Y.dragging&&Y.dragging.enabled()?Y:this,Y.dragging&&Y.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var Y=0,oe=this._handlers.length;Y<oe;Y++)this._handlers[Y].disable()},whenReady:function(Y,oe){return this._loaded?Y.call(oe||this,{target:this}):this.on("load",Y,oe),this},_getMapPanePos:function(){return ig(this._mapPane)||new z(0,0)},_moved:function(){var Y=this._getMapPanePos();return Y&&!Y.equals([0,0])},_getTopLeftPoint:function(Y,oe){var he=Y&&oe!==void 0?this._getNewPixelOrigin(Y,oe):this.getPixelOrigin();return he.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(Y,oe){var he=this.getSize()._divideBy(2);return this.project(Y,oe)._subtract(he)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(Y,oe,he){var be=this._getNewPixelOrigin(he,oe);return this.project(Y,oe)._subtract(be)},_latLngBoundsToNewLayerBounds:function(Y,oe,he){var be=this._getNewPixelOrigin(he,oe);return A([this.project(Y.getSouthWest(),oe)._subtract(be),this.project(Y.getNorthWest(),oe)._subtract(be),this.project(Y.getSouthEast(),oe)._subtract(be),this.project(Y.getNorthEast(),oe)._subtract(be)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(Y){return this.latLngToLayerPoint(Y).subtract(this._getCenterLayerPoint())},_limitCenter:function(Y,oe,he){if(!he)return Y;var be=this.project(Y,oe),Pe=this.getSize().divideBy(2),Ne=new _(be.subtract(Pe),be.add(Pe)),$e=this._getBoundsOffset(Ne,he,oe);return Math.abs($e.x)<=1&&Math.abs($e.y)<=1?Y:this.unproject(be.add($e),oe)},_limitOffset:function(Y,oe){if(!oe)return Y;var he=this.getPixelBounds(),be=new _(he.min.add(Y),he.max.add(Y));return Y.add(this._getBoundsOffset(be,oe))},_getBoundsOffset:function(Y,oe,he){var be=A(this.project(oe.getNorthEast(),he),this.project(oe.getSouthWest(),he)),Pe=be.min.subtract(Y.min),Ne=be.max.subtract(Y.max),$e=this._rebound(Pe.x,-Ne.x),Ke=this._rebound(Pe.y,-Ne.y);return new z($e,Ke)},_rebound:function(Y,oe){return Y+oe>0?Math.round(Y-oe)/2:Math.max(0,Math.ceil(Y))-Math.max(0,Math.floor(oe))},_limitZoom:function(Y){var oe=this.getMinZoom(),he=this.getMaxZoom(),be=_t.any3d?this.options.zoomSnap:1;return be&&(Y=Math.round(Y/be)*be),Math.max(oe,Math.min(he,Y))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){fi(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(Y,oe){var he=this._getCenterOffset(Y)._trunc();return(oe&&oe.animate)!==!0&&!this.getSize().contains(he)?!1:(this.panBy(he,oe),!0)},_createAnimProxy:function(){var Y=this._proxy=Yt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(Y),this.on("zoomanim",function(oe){var he=Za,be=this._proxy.style[he];ng(this._proxy,this.project(oe.center,oe.zoom),this.getZoomScale(oe.zoom,1)),be===this._proxy.style[he]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Or(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var Y=this.getCenter(),oe=this.getZoom();ng(this._proxy,this.project(Y,oe),this.getZoomScale(oe,1))},_catchTransitionEnd:function(Y){this._animatingZoom&&Y.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(Y,oe,he){if(this._animatingZoom)return!0;if(he=he||{},!this._zoomAnimated||he.animate===!1||this._nothingToAnimate()||Math.abs(oe-this._zoom)>this.options.zoomAnimationThreshold)return!1;var be=this.getZoomScale(oe),Pe=this._getCenterOffset(Y)._divideBy(1-1/be);return he.animate!==!0&&!this.getSize().contains(Pe)?!1:(C(function(){this._moveStart(!0,he.noMoveStart||!1)._animateZoom(Y,oe,!0)},this),!0)},_animateZoom:function(Y,oe,he,be){this._mapPane&&(he&&(this._animatingZoom=!0,this._animateToCenter=Y,this._animateToZoom=oe,br(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:Y,zoom:oe,noUpdate:be}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&fi(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 otr(Y,oe){return new Ir(Y,oe)}var oc=k.extend({options:{position:"topright"},initialize:function(Y){p(this,Y)},getPosition:function(){return this.options.position},setPosition:function(Y){var oe=this._map;return oe&&oe.removeControl(this),this.options.position=Y,oe&&oe.addControl(this),this},getContainer:function(){return this._container},addTo:function(Y){this.remove(),this._map=Y;var oe=this._container=this.onAdd(Y),he=this.getPosition(),be=Y._controlCorners[he];return br(oe,"leaflet-control"),he.indexOf("bottom")!==-1?be.insertBefore(oe,be.firstChild):be.appendChild(oe),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Or(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(Y){this._map&&Y&&Y.screenX>0&&Y.screenY>0&&this._map.getContainer().focus()}}),oC=function(Y){return new oc(Y)};Ir.include({addControl:function(Y){return Y.addTo(this),this},removeControl:function(Y){return Y.remove(),this},_initControlPos:function(){var Y=this._controlCorners={},oe="leaflet-",he=this._controlContainer=Yt("div",oe+"control-container",this._container);function be(Pe,Ne){var $e=oe+Pe+" "+oe+Ne;Y[Pe+Ne]=Yt("div",$e,he)}be("top","left"),be("top","right"),be("bottom","left"),be("bottom","right")},_clearControlPos:function(){for(var Y in this._controlCorners)Or(this._controlCorners[Y]);Or(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var $ve=oc.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(Y,oe,he,be){return he<be?-1:be<he?1:0}},initialize:function(Y,oe,he){p(this,he),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var be in Y)this._addLayer(Y[be],be);for(be in oe)this._addLayer(oe[be],be,!0)},onAdd:function(Y){this._initLayout(),this._update(),this._map=Y,Y.on("zoomend",this._checkDisabledLayers,this);for(var oe=0;oe<this._layers.length;oe++)this._layers[oe].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(Y){return oc.prototype.addTo.call(this,Y),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var Y=0;Y<this._layers.length;Y++)this._layers[Y].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(Y,oe){return this._addLayer(Y,oe),this._map?this._update():this},addOverlay:function(Y,oe){return this._addLayer(Y,oe,!0),this._map?this._update():this},removeLayer:function(Y){Y.off("add remove",this._onLayerChange,this);var oe=this._getLayer(l(Y));return oe&&this._layers.splice(this._layers.indexOf(oe),1),this._map?this._update():this},expand:function(){br(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var Y=this._map.getSize().y-(this._container.offsetTop+50);return Y<this._section.clientHeight?(br(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=Y+"px"):fi(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return fi(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var Y="leaflet-control-layers",oe=this._container=Yt("div",Y),he=this.options.collapsed;oe.setAttribute("aria-haspopup",!0),iC(oe),n9(oe);var be=this._section=Yt("section",Y+"-list");he&&(this._map.on("click",this.collapse,this),xr(oe,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var Pe=this._layersLink=Yt("a",Y+"-toggle",oe);Pe.href="#",Pe.title="Layers",Pe.setAttribute("role","button"),xr(Pe,{keydown:function(Ne){Ne.keyCode===13&&this._expandSafely()},click:function(Ne){Oo(Ne),this._expandSafely()}},this),he||this.expand(),this._baseLayersList=Yt("div",Y+"-base",be),this._separator=Yt("div",Y+"-separator",be),this._overlaysList=Yt("div",Y+"-overlays",be),oe.appendChild(be)},_getLayer:function(Y){for(var oe=0;oe<this._layers.length;oe++)if(this._layers[oe]&&l(this._layers[oe].layer)===Y)return this._layers[oe]},_addLayer:function(Y,oe,he){this._map&&Y.on("add remove",this._onLayerChange,this),this._layers.push({layer:Y,name:oe,overlay:he}),this.options.sortLayers&&this._layers.sort(a(function(be,Pe){return this.options.sortFunction(be.layer,Pe.layer,be.name,Pe.name)},this)),this.options.autoZIndex&&Y.setZIndex&&(this._lastZIndex++,Y.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Ka(this._baseLayersList),Ka(this._overlaysList),this._layerControlInputs=[];var Y,oe,he,be,Pe=0;for(he=0;he<this._layers.length;he++)be=this._layers[he],this._addItem(be),oe=oe||be.overlay,Y=Y||!be.overlay,Pe+=be.overlay?0:1;return this.options.hideSingleBase&&(Y=Y&&Pe>1,this._baseLayersList.style.display=Y?"":"none"),this._separator.style.display=oe&&Y?"":"none",this},_onLayerChange:function(Y){this._handlingClick||this._update();var oe=this._getLayer(l(Y.target)),he=oe.overlay?Y.type==="add"?"overlayadd":"overlayremove":Y.type==="add"?"baselayerchange":null;he&&this._map.fire(he,oe)},_createRadioElement:function(Y,oe){var he='<input type="radio" class="leaflet-control-layers-selector" name="'+Y+'"'+(oe?' checked="checked"':"")+"/>",be=document.createElement("div");return be.innerHTML=he,be.firstChild},_addItem:function(Y){var oe=document.createElement("label"),he=this._map.hasLayer(Y.layer),be;Y.overlay?(be=document.createElement("input"),be.type="checkbox",be.className="leaflet-control-layers-selector",be.defaultChecked=he):be=this._createRadioElement("leaflet-base-layers_"+l(this),he),this._layerControlInputs.push(be),be.layerId=l(Y.layer),xr(be,"click",this._onInputClick,this);var Pe=document.createElement("span");Pe.innerHTML=" "+Y.name;var Ne=document.createElement("span");oe.appendChild(Ne),Ne.appendChild(be),Ne.appendChild(Pe);var $e=Y.overlay?this._overlaysList:this._baseLayersList;return $e.appendChild(oe),this._checkDisabledLayers(),oe},_onInputClick:function(){if(!this._preventClick){var Y=this._layerControlInputs,oe,he,be=[],Pe=[];this._handlingClick=!0;for(var Ne=Y.length-1;Ne>=0;Ne--)oe=Y[Ne],he=this._getLayer(oe.layerId).layer,oe.checked?be.push(he):oe.checked||Pe.push(he);for(Ne=0;Ne<Pe.length;Ne++)this._map.hasLayer(Pe[Ne])&&this._map.removeLayer(Pe[Ne]);for(Ne=0;Ne<be.length;Ne++)this._map.hasLayer(be[Ne])||this._map.addLayer(be[Ne]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var Y=this._layerControlInputs,oe,he,be=this._map.getZoom(),Pe=Y.length-1;Pe>=0;Pe--)oe=Y[Pe],he=this._getLayer(oe.layerId).layer,oe.disabled=he.options.minZoom!==void 0&&be<he.options.minZoom||he.options.maxZoom!==void 0&&be>he.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var Y=this._section;this._preventClick=!0,xr(Y,"click",Oo),this.expand();var oe=this;setTimeout(function(){Vn(Y,"click",Oo),oe._preventClick=!1})}}),atr=function(Y,oe,he){return new $ve(Y,oe,he)},o9=oc.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(Y){var oe="leaflet-control-zoom",he=Yt("div",oe+" leaflet-bar"),be=this.options;return this._zoomInButton=this._createButton(be.zoomInText,be.zoomInTitle,oe+"-in",he,this._zoomIn),this._zoomOutButton=this._createButton(be.zoomOutText,be.zoomOutTitle,oe+"-out",he,this._zoomOut),this._updateDisabled(),Y.on("zoomend zoomlevelschange",this._updateDisabled,this),he},onRemove:function(Y){Y.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(Y){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(Y.shiftKey?3:1))},_zoomOut:function(Y){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(Y.shiftKey?3:1))},_createButton:function(Y,oe,he,be,Pe){var Ne=Yt("a",he,be);return Ne.innerHTML=Y,Ne.href="#",Ne.title=oe,Ne.setAttribute("role","button"),Ne.setAttribute("aria-label",oe),iC(Ne),xr(Ne,"click",ag),xr(Ne,"click",Pe,this),xr(Ne,"click",this._refocusOnMap,this),Ne},_updateDisabled:function(){var Y=this._map,oe="leaflet-disabled";fi(this._zoomInButton,oe),fi(this._zoomOutButton,oe),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||Y._zoom===Y.getMinZoom())&&(br(this._zoomOutButton,oe),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||Y._zoom===Y.getMaxZoom())&&(br(this._zoomInButton,oe),this._zoomInButton.setAttribute("aria-disabled","true"))}});Ir.mergeOptions({zoomControl:!0}),Ir.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o9,this.addControl(this.zoomControl))});var str=function(Y){return new o9(Y)},Wve=oc.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(Y){var oe="leaflet-control-scale",he=Yt("div",oe),be=this.options;return this._addScales(be,oe+"-line",he),Y.on(be.updateWhenIdle?"moveend":"move",this._update,this),Y.whenReady(this._update,this),he},onRemove:function(Y){Y.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(Y,oe,he){Y.metric&&(this._mScale=Yt("div",oe,he)),Y.imperial&&(this._iScale=Yt("div",oe,he))},_update:function(){var Y=this._map,oe=Y.getSize().y/2,he=Y.distance(Y.containerPointToLatLng([0,oe]),Y.containerPointToLatLng([this.options.maxWidth,oe]));this._updateScales(he)},_updateScales:function(Y){this.options.metric&&Y&&this._updateMetric(Y),this.options.imperial&&Y&&this._updateImperial(Y)},_updateMetric:function(Y){var oe=this._getRoundNum(Y),he=oe<1e3?oe+" m":oe/1e3+" km";this._updateScale(this._mScale,he,oe/Y)},_updateImperial:function(Y){var oe=Y*3.2808399,he,be,Pe;oe>5280?(he=oe/5280,be=this._getRoundNum(he),this._updateScale(this._iScale,be+" mi",be/he)):(Pe=this._getRoundNum(oe),this._updateScale(this._iScale,Pe+" ft",Pe/oe))},_updateScale:function(Y,oe,he){Y.style.width=Math.round(this.options.maxWidth*he)+"px",Y.innerHTML=oe},_getRoundNum:function(Y){var oe=Math.pow(10,(Math.floor(Y)+"").length-1),he=Y/oe;return he=he>=10?10:he>=5?5:he>=3?3:he>=2?2:1,oe*he}}),ltr=function(Y){return new Wve(Y)},ctr='<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>',a9=oc.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(_t.inlineSvg?ctr+" ":"")+"Leaflet</a>"},initialize:function(Y){p(this,Y),this._attributions={}},onAdd:function(Y){Y.attributionControl=this,this._container=Yt("div","leaflet-control-attribution"),iC(this._container);for(var oe in Y._layers)Y._layers[oe].getAttribution&&this.addAttribution(Y._layers[oe].getAttribution());return this._update(),Y.on("layeradd",this._addAttribution,this),this._container},onRemove:function(Y){Y.off("layeradd",this._addAttribution,this)},_addAttribution:function(Y){Y.layer.getAttribution&&(this.addAttribution(Y.layer.getAttribution()),Y.layer.once("remove",function(){this.removeAttribution(Y.layer.getAttribution())},this))},setPrefix:function(Y){return this.options.prefix=Y,this._update(),this},addAttribution:function(Y){return Y?(this._attributions[Y]||(this._attributions[Y]=0),this._attributions[Y]++,this._update(),this):this},removeAttribution:function(Y){return Y?(this._attributions[Y]&&(this._attributions[Y]--,this._update()),this):this},_update:function(){if(this._map){var Y=[];for(var oe in this._attributions)this._attributions[oe]&&Y.push(oe);var he=[];this.options.prefix&&he.push(this.options.prefix),Y.length&&he.push(Y.join(", ")),this._container.innerHTML=he.join(' <span aria-hidden="true">|</span> ')}}});Ir.mergeOptions({attributionControl:!0}),Ir.addInitHook(function(){this.options.attributionControl&&new a9().addTo(this)});var utr=function(Y){return new a9(Y)};oc.Layers=$ve,oc.Zoom=o9,oc.Scale=Wve,oc.Attribution=a9,oC.layers=atr,oC.zoom=str,oC.scale=ltr,oC.attribution=utr;var fu=k.extend({initialize:function(Y){this._map=Y},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}});fu.addTo=function(Y,oe){return Y.addHandler(oe,this),this};var dtr={Events:V},Hve=_t.touch?"touchstart mousedown":"mousedown",Qh=q.extend({options:{clickTolerance:3},initialize:function(Y,oe,he,be){p(this,be),this._element=Y,this._dragStartTarget=oe||Y,this._preventOutline=he},enable:function(){this._enabled||(xr(this._dragStartTarget,Hve,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Qh._dragging===this&&this.finishDrag(!0),Vn(this._dragStartTarget,Hve,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(Y){if(this._enabled&&(this._moved=!1,!Jw(this._element,"leaflet-zoom-anim"))){if(Y.touches&&Y.touches.length!==1){Qh._dragging===this&&this.finishDrag();return}if(!(Qh._dragging||Y.shiftKey||Y.which!==1&&Y.button!==1&&!Y.touches)&&(Qh._dragging=this,this._preventOutline&&Qz(this._element),Zz(),tC(),!this._moving)){this.fire("down");var oe=Y.touches?Y.touches[0]:Y,he=Nve(this._element);this._startPoint=new z(oe.clientX,oe.clientY),this._startPos=ig(this._element),this._parentScale=Jz(he);var be=Y.type==="mousedown";xr(document,be?"mousemove":"touchmove",this._onMove,this),xr(document,be?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(Y){if(this._enabled){if(Y.touches&&Y.touches.length>1){this._moved=!0;return}var oe=Y.touches&&Y.touches.length===1?Y.touches[0]:Y,he=new z(oe.clientX,oe.clientY)._subtract(this._startPoint);!he.x&&!he.y||Math.abs(he.x)+Math.abs(he.y)<this.options.clickTolerance||(he.x/=this._parentScale.x,he.y/=this._parentScale.y,Oo(Y),this._moved||(this.fire("dragstart"),this._moved=!0,br(document.body,"leaflet-dragging"),this._lastTarget=Y.target||Y.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),br(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(he),this._moving=!0,this._lastEvent=Y,this._updatePosition())}},_updatePosition:function(){var Y={originalEvent:this._lastEvent};this.fire("predrag",Y),$i(this._element,this._newPos),this.fire("drag",Y)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(Y){fi(document.body,"leaflet-dragging"),this._lastTarget&&(fi(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),Vn(document,"mousemove touchmove",this._onMove,this),Vn(document,"mouseup touchend touchcancel",this._onUp,this),Xz(),rC();var oe=this._moved&&this._moving;this._moving=!1,Qh._dragging=!1,oe&&this.fire("dragend",{noInertia:Y,distance:this._newPos.distanceTo(this._startPos)})}});function Uve(Y,oe,he){var be,Pe=[1,4,2,8],Ne,$e,Ke,tt,mt,Rt,rr,Mr;for(Ne=0,Rt=Y.length;Ne<Rt;Ne++)Y[Ne]._code=sg(Y[Ne],oe);for(Ke=0;Ke<4;Ke++){for(rr=Pe[Ke],be=[],Ne=0,Rt=Y.length,$e=Rt-1;Ne<Rt;$e=Ne++)tt=Y[Ne],mt=Y[$e],tt._code&rr?mt._code&rr||(Mr=qP(mt,tt,rr,oe,he),Mr._code=sg(Mr,oe),be.push(Mr)):(mt._code&rr&&(Mr=qP(mt,tt,rr,oe,he),Mr._code=sg(Mr,oe),be.push(Mr)),be.push(tt));Y=be}return Y}function Gve(Y,oe){var he,be,Pe,Ne,$e,Ke,tt,mt,Rt;if(!Y||Y.length===0)throw new Error("latlngs not passed");Ml(Y)||(console.warn("latlngs are not flat! Only the first ring will be used"),Y=Y[0]);var rr=v([0,0]),Mr=b(Y),Ca=Mr.getNorthWest().distanceTo(Mr.getSouthWest())*Mr.getNorthEast().distanceTo(Mr.getNorthWest());Ca<1700&&(rr=s9(Y));var uo=Y.length,Tl=[];for(he=0;he<uo;he++){var Qa=v(Y[he]);Tl.push(oe.project(v([Qa.lat-rr.lat,Qa.lng-rr.lng])))}for(Ke=tt=mt=0,he=0,be=uo-1;he<uo;be=he++)Pe=Tl[he],Ne=Tl[be],$e=Pe.y*Ne.x-Ne.y*Pe.x,tt+=(Pe.x+Ne.x)*$e,mt+=(Pe.y+Ne.y)*$e,Ke+=$e*3;Ke===0?Rt=Tl[0]:Rt=[tt/Ke,mt/Ke];var Fv=oe.unproject(W(Rt));return v([Fv.lat+rr.lat,Fv.lng+rr.lng])}function s9(Y){for(var oe=0,he=0,be=0,Pe=0;Pe<Y.length;Pe++){var Ne=v(Y[Pe]);oe+=Ne.lat,he+=Ne.lng,be++}return v([oe/be,he/be])}var htr={__proto__:null,clipPolygon:Uve,polygonCenter:Gve,centroid:s9};function Vve(Y,oe){if(!oe||!Y.length)return Y.slice();var he=oe*oe;return Y=gtr(Y,he),Y=ftr(Y,he),Y}function Yve(Y,oe,he){return Math.sqrt(aC(Y,oe,he,!0))}function ptr(Y,oe,he){return aC(Y,oe,he)}function ftr(Y,oe){var he=Y.length,be=typeof Uint8Array!="undefined"?Uint8Array:Array,Pe=new be(he);Pe[0]=Pe[he-1]=1,l9(Y,Pe,oe,0,he-1);var Ne,$e=[];for(Ne=0;Ne<he;Ne++)Pe[Ne]&&$e.push(Y[Ne]);return $e}function l9(Y,oe,he,be,Pe){var Ne=0,$e,Ke,tt;for(Ke=be+1;Ke<=Pe-1;Ke++)tt=aC(Y[Ke],Y[be],Y[Pe],!0),tt>Ne&&($e=Ke,Ne=tt);Ne>he&&(oe[$e]=1,l9(Y,oe,he,be,$e),l9(Y,oe,he,$e,Pe))}function gtr(Y,oe){for(var he=[Y[0]],be=1,Pe=0,Ne=Y.length;be<Ne;be++)mtr(Y[be],Y[Pe])>oe&&(he.push(Y[be]),Pe=be);return Pe<Ne-1&&he.push(Y[Ne-1]),he}var qve;function Zve(Y,oe,he,be,Pe){var Ne=be?qve:sg(Y,he),$e=sg(oe,he),Ke,tt,mt;for(qve=$e;;){if(!(Ne|$e))return[Y,oe];if(Ne&$e)return!1;Ke=Ne||$e,tt=qP(Y,oe,Ke,he,Pe),mt=sg(tt,he),Ke===Ne?(Y=tt,Ne=mt):(oe=tt,$e=mt)}}function qP(Y,oe,he,be,Pe){var Ne=oe.x-Y.x,$e=oe.y-Y.y,Ke=be.min,tt=be.max,mt,Rt;return he&8?(mt=Y.x+Ne*(tt.y-Y.y)/$e,Rt=tt.y):he&4?(mt=Y.x+Ne*(Ke.y-Y.y)/$e,Rt=Ke.y):he&2?(mt=tt.x,Rt=Y.y+$e*(tt.x-Y.x)/Ne):he&1&&(mt=Ke.x,Rt=Y.y+$e*(Ke.x-Y.x)/Ne),new z(mt,Rt,Pe)}function sg(Y,oe){var he=0;return Y.x<oe.min.x?he|=1:Y.x>oe.max.x&&(he|=2),Y.y<oe.min.y?he|=4:Y.y>oe.max.y&&(he|=8),he}function mtr(Y,oe){var he=oe.x-Y.x,be=oe.y-Y.y;return he*he+be*be}function aC(Y,oe,he,be){var Pe=oe.x,Ne=oe.y,$e=he.x-Pe,Ke=he.y-Ne,tt=$e*$e+Ke*Ke,mt;return tt>0&&(mt=((Y.x-Pe)*$e+(Y.y-Ne)*Ke)/tt,mt>1?(Pe=he.x,Ne=he.y):mt>0&&(Pe+=$e*mt,Ne+=Ke*mt)),$e=Y.x-Pe,Ke=Y.y-Ne,be?$e*$e+Ke*Ke:new z(Pe,Ne)}function Ml(Y){return!U(Y[0])||typeof Y[0][0]!="object"&&typeof Y[0][0]!="undefined"}function Xve(Y){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ml(Y)}function Kve(Y,oe){var he,be,Pe,Ne,$e,Ke,tt,mt;if(!Y||Y.length===0)throw new Error("latlngs not passed");Ml(Y)||(console.warn("latlngs are not flat! Only the first ring will be used"),Y=Y[0]);var Rt=v([0,0]),rr=b(Y),Mr=rr.getNorthWest().distanceTo(rr.getSouthWest())*rr.getNorthEast().distanceTo(rr.getNorthWest());Mr<1700&&(Rt=s9(Y));var Ca=Y.length,uo=[];for(he=0;he<Ca;he++){var Tl=v(Y[he]);uo.push(oe.project(v([Tl.lat-Rt.lat,Tl.lng-Rt.lng])))}for(he=0,be=0;he<Ca-1;he++)be+=uo[he].distanceTo(uo[he+1])/2;if(be===0)mt=uo[0];else for(he=0,Ne=0;he<Ca-1;he++)if($e=uo[he],Ke=uo[he+1],Pe=$e.distanceTo(Ke),Ne+=Pe,Ne>be){tt=(Ne-be)/Pe,mt=[Ke.x-tt*(Ke.x-$e.x),Ke.y-tt*(Ke.y-$e.y)];break}var Qa=oe.unproject(W(mt));return v([Qa.lat+Rt.lat,Qa.lng+Rt.lng])}var vtr={__proto__:null,simplify:Vve,pointToSegmentDistance:Yve,closestPointOnSegment:ptr,clipSegment:Zve,_getEdgeIntersection:qP,_getBitCode:sg,_sqClosestPointOnSegment:aC,isFlat:Ml,_flat:Xve,polylineCenter:Kve},c9={project:function(Y){return new z(Y.lng,Y.lat)},unproject:function(Y){return new w(Y.y,Y.x)},bounds:new _([-180,-90],[180,90])},u9={R:6378137,R_MINOR:6356752314245179e-9,bounds:new _([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(Y){var oe=Math.PI/180,he=this.R,be=Y.lat*oe,Pe=this.R_MINOR/he,Ne=Math.sqrt(1-Pe*Pe),$e=Ne*Math.sin(be),Ke=Math.tan(Math.PI/4-be/2)/Math.pow((1-$e)/(1+$e),Ne/2);return be=-he*Math.log(Math.max(Ke,1e-10)),new z(Y.lng*oe*he,be)},unproject:function(Y){for(var oe=180/Math.PI,he=this.R,be=this.R_MINOR/he,Pe=Math.sqrt(1-be*be),Ne=Math.exp(-Y.y/he),$e=Math.PI/2-2*Math.atan(Ne),Ke=0,tt=.1,mt;Ke<15&&Math.abs(tt)>1e-7;Ke++)mt=Pe*Math.sin($e),mt=Math.pow((1-mt)/(1+mt),Pe/2),tt=Math.PI/2-2*Math.atan(Ne*mt)-$e,$e+=tt;return new w($e*oe,Y.x*oe/he)}},ytr={__proto__:null,LonLat:c9,Mercator:u9,SphericalMercator:X},btr=i({},O,{code:"EPSG:3395",projection:u9,transformation:function(){var Y=.5/(Math.PI*u9.R);return J(Y,.5,-Y,.5)}()}),Qve=i({},O,{code:"EPSG:4326",projection:c9,transformation:J(1/180,1,-1/180,.5)}),xtr=i({},I,{projection:c9,transformation:J(1,0,-1,0),scale:function(Y){return Math.pow(2,Y)},zoom:function(Y){return Math.log(Y)/Math.LN2},distance:function(Y,oe){var he=oe.lng-Y.lng,be=oe.lat-Y.lat;return Math.sqrt(he*he+be*be)},infinite:!0});I.Earth=O,I.EPSG3395=btr,I.EPSG3857=G,I.EPSG900913=Z,I.EPSG4326=Qve,I.Simple=xtr;var ac=q.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(Y){return Y.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(Y){return Y&&Y.removeLayer(this),this},getPane:function(Y){return this._map.getPane(Y?this.options[Y]||Y:this.options.pane)},addInteractiveTarget:function(Y){return this._map._targets[l(Y)]=this,this},removeInteractiveTarget:function(Y){return delete this._map._targets[l(Y)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(Y){var oe=Y.target;if(oe.hasLayer(this)){if(this._map=oe,this._zoomAnimated=oe._zoomAnimated,this.getEvents){var he=this.getEvents();oe.on(he,this),this.once("remove",function(){oe.off(he,this)},this)}this.onAdd(oe),this.fire("add"),oe.fire("layeradd",{layer:this})}}});Ir.include({addLayer:function(Y){if(!Y._layerAdd)throw new Error("The provided object is not a Layer.");var oe=l(Y);return this._layers[oe]?this:(this._layers[oe]=Y,Y._mapToAdd=this,Y.beforeAdd&&Y.beforeAdd(this),this.whenReady(Y._layerAdd,Y),this)},removeLayer:function(Y){var oe=l(Y);return this._layers[oe]?(this._loaded&&Y.onRemove(this),delete this._layers[oe],this._loaded&&(this.fire("layerremove",{layer:Y}),Y.fire("remove")),Y._map=Y._mapToAdd=null,this):this},hasLayer:function(Y){return l(Y)in this._layers},eachLayer:function(Y,oe){for(var he in this._layers)Y.call(oe,this._layers[he]);return this},_addLayers:function(Y){Y=Y?U(Y)?Y:[Y]:[];for(var oe=0,he=Y.length;oe<he;oe++)this.addLayer(Y[oe])},_addZoomLimit:function(Y){(!isNaN(Y.options.maxZoom)||!isNaN(Y.options.minZoom))&&(this._zoomBoundLayers[l(Y)]=Y,this._updateZoomLevels())},_removeZoomLimit:function(Y){var oe=l(Y);this._zoomBoundLayers[oe]&&(delete this._zoomBoundLayers[oe],this._updateZoomLevels())},_updateZoomLevels:function(){var Y=1/0,oe=-1/0,he=this._getZoomSpan();for(var be in this._zoomBoundLayers){var Pe=this._zoomBoundLayers[be].options;Y=Pe.minZoom===void 0?Y:Math.min(Y,Pe.minZoom),oe=Pe.maxZoom===void 0?oe:Math.max(oe,Pe.maxZoom)}this._layersMaxZoom=oe===-1/0?void 0:oe,this._layersMinZoom=Y===1/0?void 0:Y,he!==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 Lv=ac.extend({initialize:function(Y,oe){p(this,oe),this._layers={};var he,be;if(Y)for(he=0,be=Y.length;he<be;he++)this.addLayer(Y[he])},addLayer:function(Y){var oe=this.getLayerId(Y);return this._layers[oe]=Y,this._map&&this._map.addLayer(Y),this},removeLayer:function(Y){var oe=Y in this._layers?Y:this.getLayerId(Y);return this._map&&this._layers[oe]&&this._map.removeLayer(this._layers[oe]),delete this._layers[oe],this},hasLayer:function(Y){var oe=typeof Y=="number"?Y:this.getLayerId(Y);return oe in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(Y){var oe=Array.prototype.slice.call(arguments,1),he,be;for(he in this._layers)be=this._layers[he],be[Y]&&be[Y].apply(be,oe);return this},onAdd:function(Y){this.eachLayer(Y.addLayer,Y)},onRemove:function(Y){this.eachLayer(Y.removeLayer,Y)},eachLayer:function(Y,oe){for(var he in this._layers)Y.call(oe,this._layers[he]);return this},getLayer:function(Y){return this._layers[Y]},getLayers:function(){var Y=[];return this.eachLayer(Y.push,Y),Y},setZIndex:function(Y){return this.invoke("setZIndex",Y)},getLayerId:function(Y){return l(Y)}}),wtr=function(Y,oe){return new Lv(Y,oe)},yd=Lv.extend({addLayer:function(Y){return this.hasLayer(Y)?this:(Y.addEventParent(this),Lv.prototype.addLayer.call(this,Y),this.fire("layeradd",{layer:Y}))},removeLayer:function(Y){return this.hasLayer(Y)?(Y in this._layers&&(Y=this._layers[Y]),Y.removeEventParent(this),Lv.prototype.removeLayer.call(this,Y),this.fire("layerremove",{layer:Y})):this},setStyle:function(Y){return this.invoke("setStyle",Y)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var Y=new m;for(var oe in this._layers){var he=this._layers[oe];Y.extend(he.getBounds?he.getBounds():he.getLatLng())}return Y}}),Ctr=function(Y,oe){return new yd(Y,oe)},Ov=k.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(Y){p(this,Y)},createIcon:function(Y){return this._createIcon("icon",Y)},createShadow:function(Y){return this._createIcon("shadow",Y)},_createIcon:function(Y,oe){var he=this._getIconUrl(Y);if(!he){if(Y==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var be=this._createImg(he,oe&&oe.tagName==="IMG"?oe:null);return this._setIconStyles(be,Y),(this.options.crossOrigin||this.options.crossOrigin==="")&&(be.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),be},_setIconStyles:function(Y,oe){var he=this.options,be=he[oe+"Size"];typeof be=="number"&&(be=[be,be]);var Pe=W(be),Ne=W(oe==="shadow"&&he.shadowAnchor||he.iconAnchor||Pe&&Pe.divideBy(2,!0));Y.className="leaflet-marker-"+oe+" "+(he.className||""),Ne&&(Y.style.marginLeft=-Ne.x+"px",Y.style.marginTop=-Ne.y+"px"),Pe&&(Y.style.width=Pe.x+"px",Y.style.height=Pe.y+"px")},_createImg:function(Y,oe){return oe=oe||document.createElement("img"),oe.src=Y,oe},_getIconUrl:function(Y){return _t.retina&&this.options[Y+"RetinaUrl"]||this.options[Y+"Url"]}});function _tr(Y){return new Ov(Y)}var sC=Ov.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(Y){return typeof sC.imagePath!="string"&&(sC.imagePath=this._detectIconPath()),(this.options.imagePath||sC.imagePath)+Ov.prototype._getIconUrl.call(this,Y)},_stripUrl:function(Y){var oe=function(he,be,Pe){var Ne=be.exec(he);return Ne&&Ne[Pe]};return Y=oe(Y,/^url\((['"])?(.+)\1\)$/,2),Y&&oe(Y,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var Y=Yt("div","leaflet-default-icon-path",document.body),oe=fr(Y,"background-image")||fr(Y,"backgroundImage");if(document.body.removeChild(Y),oe=this._stripUrl(oe),oe)return oe;var he=document.querySelector('link[href$="leaflet.css"]');return he?he.href.substring(0,he.href.length-11-1):""}}),Jve=fu.extend({initialize:function(Y){this._marker=Y},addHooks:function(){var Y=this._marker._icon;this._draggable||(this._draggable=new Qh(Y,Y,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),br(Y,"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&&fi(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(Y){var oe=this._marker,he=oe._map,be=this._marker.options.autoPanSpeed,Pe=this._marker.options.autoPanPadding,Ne=ig(oe._icon),$e=he.getPixelBounds(),Ke=he.getPixelOrigin(),tt=A($e.min._subtract(Ke).add(Pe),$e.max._subtract(Ke).subtract(Pe));if(!tt.contains(Ne)){var mt=W((Math.max(tt.max.x,Ne.x)-tt.max.x)/($e.max.x-tt.max.x)-(Math.min(tt.min.x,Ne.x)-tt.min.x)/($e.min.x-tt.min.x),(Math.max(tt.max.y,Ne.y)-tt.max.y)/($e.max.y-tt.max.y)-(Math.min(tt.min.y,Ne.y)-tt.min.y)/($e.min.y-tt.min.y)).multiplyBy(be);he.panBy(mt,{animate:!1}),this._draggable._newPos._add(mt),this._draggable._startPos._add(mt),$i(oe._icon,this._draggable._newPos),this._onDrag(Y),this._panRequest=C(this._adjustPan.bind(this,Y))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(Y){this._marker.options.autoPan&&(y(this._panRequest),this._panRequest=C(this._adjustPan.bind(this,Y)))},_onDrag:function(Y){var oe=this._marker,he=oe._shadow,be=ig(oe._icon),Pe=oe._map.layerPointToLatLng(be);he&&$i(he,be),oe._latlng=Pe,Y.latlng=Pe,Y.oldLatLng=this._oldLatLng,oe.fire("move",Y).fire("drag",Y)},_onDragEnd:function(Y){y(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",Y)}}),ZP=ac.extend({options:{icon:new sC,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(Y,oe){p(this,oe),this._latlng=v(Y)},onAdd:function(Y){this._zoomAnimated=this._zoomAnimated&&Y.options.markerZoomAnimation,this._zoomAnimated&&Y.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(Y){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&Y.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(Y){var oe=this._latlng;return this._latlng=v(Y),this.update(),this.fire("move",{oldLatLng:oe,latlng:this._latlng})},setZIndexOffset:function(Y){return this.options.zIndexOffset=Y,this.update()},getIcon:function(){return this.options.icon},setIcon:function(Y){return this.options.icon=Y,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 Y=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(Y)}return this},_initIcon:function(){var Y=this.options,oe="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),he=Y.icon.createIcon(this._icon),be=!1;he!==this._icon&&(this._icon&&this._removeIcon(),be=!0,Y.title&&(he.title=Y.title),he.tagName==="IMG"&&(he.alt=Y.alt||"")),br(he,oe),Y.keyboard&&(he.tabIndex="0",he.setAttribute("role","button")),this._icon=he,Y.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&xr(he,"focus",this._panOnFocus,this);var Pe=Y.icon.createShadow(this._shadow),Ne=!1;Pe!==this._shadow&&(this._removeShadow(),Ne=!0),Pe&&(br(Pe,oe),Pe.alt=""),this._shadow=Pe,Y.opacity<1&&this._updateOpacity(),be&&this.getPane().appendChild(this._icon),this._initInteraction(),Pe&&Ne&&this.getPane(Y.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Vn(this._icon,"focus",this._panOnFocus,this),Or(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Or(this._shadow),this._shadow=null},_setPos:function(Y){this._icon&&$i(this._icon,Y),this._shadow&&$i(this._shadow,Y),this._zIndex=Y.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(Y){this._icon&&(this._icon.style.zIndex=this._zIndex+Y)},_animateZoom:function(Y){var oe=this._map._latLngToNewLayerPoint(this._latlng,Y.zoom,Y.center).round();this._setPos(oe)},_initInteraction:function(){if(this.options.interactive&&(br(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Jve)){var Y=this.options.draggable;this.dragging&&(Y=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Jve(this),Y&&this.dragging.enable()}},setOpacity:function(Y){return this.options.opacity=Y,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var Y=this.options.opacity;this._icon&&kl(this._icon,Y),this._shadow&&kl(this._shadow,Y)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var Y=this._map;if(Y){var oe=this.options.icon.options,he=oe.iconSize?W(oe.iconSize):W(0,0),be=oe.iconAnchor?W(oe.iconAnchor):W(0,0);Y.panInside(this._latlng,{paddingTopLeft:be,paddingBottomRight:he.subtract(be)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Str(Y,oe){return new ZP(Y,oe)}var Jh=ac.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(Y){this._renderer=Y.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(Y){return p(this,Y),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&Y&&Object.prototype.hasOwnProperty.call(Y,"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)}}),XP=Jh.extend({options:{fill:!0,radius:10},initialize:function(Y,oe){p(this,oe),this._latlng=v(Y),this._radius=this.options.radius},setLatLng:function(Y){var oe=this._latlng;return this._latlng=v(Y),this.redraw(),this.fire("move",{oldLatLng:oe,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(Y){return this.options.radius=this._radius=Y,this.redraw()},getRadius:function(){return this._radius},setStyle:function(Y){var oe=Y&&Y.radius||this._radius;return Jh.prototype.setStyle.call(this,Y),this.setRadius(oe),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var Y=this._radius,oe=this._radiusY||Y,he=this._clickTolerance(),be=[Y+he,oe+he];this._pxBounds=new _(this._point.subtract(be),this._point.add(be))},_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(Y){return Y.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function ktr(Y,oe){return new XP(Y,oe)}var d9=XP.extend({initialize:function(Y,oe,he){if(typeof oe=="number"&&(oe=i({},he,{radius:oe})),p(this,oe),this._latlng=v(Y),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(Y){return this._mRadius=Y,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var Y=[this._radius,this._radiusY||this._radius];return new m(this._map.layerPointToLatLng(this._point.subtract(Y)),this._map.layerPointToLatLng(this._point.add(Y)))},setStyle:Jh.prototype.setStyle,_project:function(){var Y=this._latlng.lng,oe=this._latlng.lat,he=this._map,be=he.options.crs;if(be.distance===O.distance){var Pe=Math.PI/180,Ne=this._mRadius/O.R/Pe,$e=he.project([oe+Ne,Y]),Ke=he.project([oe-Ne,Y]),tt=$e.add(Ke).divideBy(2),mt=he.unproject(tt).lat,Rt=Math.acos((Math.cos(Ne*Pe)-Math.sin(oe*Pe)*Math.sin(mt*Pe))/(Math.cos(oe*Pe)*Math.cos(mt*Pe)))/Pe;(isNaN(Rt)||Rt===0)&&(Rt=Ne/Math.cos(Math.PI/180*oe)),this._point=tt.subtract(he.getPixelOrigin()),this._radius=isNaN(Rt)?0:tt.x-he.project([mt,Y-Rt]).x,this._radiusY=tt.y-$e.y}else{var rr=be.unproject(be.project(this._latlng).subtract([this._mRadius,0]));this._point=he.latLngToLayerPoint(this._latlng),this._radius=this._point.x-he.latLngToLayerPoint(rr).x}this._updateBounds()}});function Mtr(Y,oe,he){return new d9(Y,oe,he)}var bd=Jh.extend({options:{smoothFactor:1,noClip:!1},initialize:function(Y,oe){p(this,oe),this._setLatLngs(Y)},getLatLngs:function(){return this._latlngs},setLatLngs:function(Y){return this._setLatLngs(Y),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(Y){for(var oe=1/0,he=null,be=aC,Pe,Ne,$e=0,Ke=this._parts.length;$e<Ke;$e++)for(var tt=this._parts[$e],mt=1,Rt=tt.length;mt<Rt;mt++){Pe=tt[mt-1],Ne=tt[mt];var rr=be(Y,Pe,Ne,!0);rr<oe&&(oe=rr,he=be(Y,Pe,Ne))}return he&&(he.distance=Math.sqrt(oe)),he},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Kve(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(Y,oe){return oe=oe||this._defaultShape(),Y=v(Y),oe.push(Y),this._bounds.extend(Y),this.redraw()},_setLatLngs:function(Y){this._bounds=new m,this._latlngs=this._convertLatLngs(Y)},_defaultShape:function(){return Ml(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(Y){for(var oe=[],he=Ml(Y),be=0,Pe=Y.length;be<Pe;be++)he?(oe[be]=v(Y[be]),this._bounds.extend(oe[be])):oe[be]=this._convertLatLngs(Y[be]);return oe},_project:function(){var Y=new _;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,Y),this._bounds.isValid()&&Y.isValid()&&(this._rawPxBounds=Y,this._updateBounds())},_updateBounds:function(){var Y=this._clickTolerance(),oe=new z(Y,Y);this._rawPxBounds&&(this._pxBounds=new _([this._rawPxBounds.min.subtract(oe),this._rawPxBounds.max.add(oe)]))},_projectLatlngs:function(Y,oe,he){var be=Y[0]instanceof w,Pe=Y.length,Ne,$e;if(be){for($e=[],Ne=0;Ne<Pe;Ne++)$e[Ne]=this._map.latLngToLayerPoint(Y[Ne]),he.extend($e[Ne]);oe.push($e)}else for(Ne=0;Ne<Pe;Ne++)this._projectLatlngs(Y[Ne],oe,he)},_clipPoints:function(){var Y=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(Y))){if(this.options.noClip){this._parts=this._rings;return}var oe=this._parts,he,be,Pe,Ne,$e,Ke,tt;for(he=0,Pe=0,Ne=this._rings.length;he<Ne;he++)for(tt=this._rings[he],be=0,$e=tt.length;be<$e-1;be++)Ke=Zve(tt[be],tt[be+1],Y,be,!0),Ke&&(oe[Pe]=oe[Pe]||[],oe[Pe].push(Ke[0]),(Ke[1]!==tt[be+1]||be===$e-2)&&(oe[Pe].push(Ke[1]),Pe++))}},_simplifyPoints:function(){for(var Y=this._parts,oe=this.options.smoothFactor,he=0,be=Y.length;he<be;he++)Y[he]=Vve(Y[he],oe)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(Y,oe){var he,be,Pe,Ne,$e,Ke,tt=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(Y))return!1;for(he=0,Ne=this._parts.length;he<Ne;he++)for(Ke=this._parts[he],be=0,$e=Ke.length,Pe=$e-1;be<$e;Pe=be++)if(!(!oe&&be===0)&&Yve(Y,Ke[Pe],Ke[be])<=tt)return!0;return!1}});function Ttr(Y,oe){return new bd(Y,oe)}bd._flat=Xve;var Iv=bd.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 Gve(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(Y){var oe=bd.prototype._convertLatLngs.call(this,Y),he=oe.length;return he>=2&&oe[0]instanceof w&&oe[0].equals(oe[he-1])&&oe.pop(),oe},_setLatLngs:function(Y){bd.prototype._setLatLngs.call(this,Y),Ml(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ml(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var Y=this._renderer._bounds,oe=this.options.weight,he=new z(oe,oe);if(Y=new _(Y.min.subtract(he),Y.max.add(he)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(Y))){if(this.options.noClip){this._parts=this._rings;return}for(var be=0,Pe=this._rings.length,Ne;be<Pe;be++)Ne=Uve(this._rings[be],Y,!0),Ne.length&&this._parts.push(Ne)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(Y){var oe=!1,he,be,Pe,Ne,$e,Ke,tt,mt;if(!this._pxBounds||!this._pxBounds.contains(Y))return!1;for(Ne=0,tt=this._parts.length;Ne<tt;Ne++)for(he=this._parts[Ne],$e=0,mt=he.length,Ke=mt-1;$e<mt;Ke=$e++)be=he[$e],Pe=he[Ke],be.y>Y.y!=Pe.y>Y.y&&Y.x<(Pe.x-be.x)*(Y.y-be.y)/(Pe.y-be.y)+be.x&&(oe=!oe);return oe||bd.prototype._containsPoint.call(this,Y,!0)}});function Atr(Y,oe){return new Iv(Y,oe)}var xd=yd.extend({initialize:function(Y,oe){p(this,oe),this._layers={},Y&&this.addData(Y)},addData:function(Y){var oe=U(Y)?Y:Y.features,he,be,Pe;if(oe){for(he=0,be=oe.length;he<be;he++)Pe=oe[he],(Pe.geometries||Pe.geometry||Pe.features||Pe.coordinates)&&this.addData(Pe);return this}var Ne=this.options;if(Ne.filter&&!Ne.filter(Y))return this;var $e=KP(Y,Ne);return $e?($e.feature=e3(Y),$e.defaultOptions=$e.options,this.resetStyle($e),Ne.onEachFeature&&Ne.onEachFeature(Y,$e),this.addLayer($e)):this},resetStyle:function(Y){return Y===void 0?this.eachLayer(this.resetStyle,this):(Y.options=i({},Y.defaultOptions),this._setLayerStyle(Y,this.options.style),this)},setStyle:function(Y){return this.eachLayer(function(oe){this._setLayerStyle(oe,Y)},this)},_setLayerStyle:function(Y,oe){Y.setStyle&&(typeof oe=="function"&&(oe=oe(Y.feature)),Y.setStyle(oe))}});function KP(Y,oe){var he=Y.type==="Feature"?Y.geometry:Y,be=he?he.coordinates:null,Pe=[],Ne=oe&&oe.pointToLayer,$e=oe&&oe.coordsToLatLng||h9,Ke,tt,mt,Rt;if(!be&&!he)return null;switch(he.type){case"Point":return Ke=$e(be),eye(Ne,Y,Ke,oe);case"MultiPoint":for(mt=0,Rt=be.length;mt<Rt;mt++)Ke=$e(be[mt]),Pe.push(eye(Ne,Y,Ke,oe));return new yd(Pe);case"LineString":case"MultiLineString":return tt=QP(be,he.type==="LineString"?0:1,$e),new bd(tt,oe);case"Polygon":case"MultiPolygon":return tt=QP(be,he.type==="Polygon"?1:2,$e),new Iv(tt,oe);case"GeometryCollection":for(mt=0,Rt=he.geometries.length;mt<Rt;mt++){var rr=KP({geometry:he.geometries[mt],type:"Feature",properties:Y.properties},oe);rr&&Pe.push(rr)}return new yd(Pe);case"FeatureCollection":for(mt=0,Rt=he.features.length;mt<Rt;mt++){var Mr=KP(he.features[mt],oe);Mr&&Pe.push(Mr)}return new yd(Pe);default:throw new Error("Invalid GeoJSON object.")}}function eye(Y,oe,he,be){return Y?Y(oe,he):new ZP(he,be&&be.markersInheritOptions&&be)}function h9(Y){return new w(Y[1],Y[0],Y[2])}function QP(Y,oe,he){for(var be=[],Pe=0,Ne=Y.length,$e;Pe<Ne;Pe++)$e=oe?QP(Y[Pe],oe-1,he):(he||h9)(Y[Pe]),be.push($e);return be}function p9(Y,oe){return Y=v(Y),Y.alt!==void 0?[u(Y.lng,oe),u(Y.lat,oe),u(Y.alt,oe)]:[u(Y.lng,oe),u(Y.lat,oe)]}function JP(Y,oe,he,be){for(var Pe=[],Ne=0,$e=Y.length;Ne<$e;Ne++)Pe.push(oe?JP(Y[Ne],Ml(Y[Ne])?0:oe-1,he,be):p9(Y[Ne],be));return!oe&&he&&Pe.length>0&&Pe.push(Pe[0].slice()),Pe}function Nv(Y,oe){return Y.feature?i({},Y.feature,{geometry:oe}):e3(oe)}function e3(Y){return Y.type==="Feature"||Y.type==="FeatureCollection"?Y:{type:"Feature",properties:{},geometry:Y}}var f9={toGeoJSON:function(Y){return Nv(this,{type:"Point",coordinates:p9(this.getLatLng(),Y)})}};ZP.include(f9),d9.include(f9),XP.include(f9),bd.include({toGeoJSON:function(Y){var oe=!Ml(this._latlngs),he=JP(this._latlngs,oe?1:0,!1,Y);return Nv(this,{type:(oe?"Multi":"")+"LineString",coordinates:he})}}),Iv.include({toGeoJSON:function(Y){var oe=!Ml(this._latlngs),he=oe&&!Ml(this._latlngs[0]),be=JP(this._latlngs,he?2:oe?1:0,!0,Y);return oe||(be=[be]),Nv(this,{type:(he?"Multi":"")+"Polygon",coordinates:be})}}),Lv.include({toMultiPoint:function(Y){var oe=[];return this.eachLayer(function(he){oe.push(he.toGeoJSON(Y).geometry.coordinates)}),Nv(this,{type:"MultiPoint",coordinates:oe})},toGeoJSON:function(Y){var oe=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(oe==="MultiPoint")return this.toMultiPoint(Y);var he=oe==="GeometryCollection",be=[];return this.eachLayer(function(Pe){if(Pe.toGeoJSON){var Ne=Pe.toGeoJSON(Y);if(he)be.push(Ne.geometry);else{var $e=e3(Ne);$e.type==="FeatureCollection"?be.push.apply(be,$e.features):be.push($e)}}}),he?Nv(this,{geometries:be,type:"GeometryCollection"}):{type:"FeatureCollection",features:be}}});function tye(Y,oe){return new xd(Y,oe)}var Etr=tye,t3=ac.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(Y,oe,he){this._url=Y,this._bounds=b(oe),p(this,he)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(br(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Or(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(Y){return this.options.opacity=Y,this._image&&this._updateOpacity(),this},setStyle:function(Y){return Y.opacity&&this.setOpacity(Y.opacity),this},bringToFront:function(){return this._map&&hu(this._image),this},bringToBack:function(){return this._map&&ic(this._image),this},setUrl:function(Y){return this._url=Y,this._image&&(this._image.src=Y),this},setBounds:function(Y){return this._bounds=b(Y),this._map&&this._reset(),this},getEvents:function(){var Y={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(Y.zoomanim=this._animateZoom),Y},setZIndex:function(Y){return this.options.zIndex=Y,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var Y=this._url.tagName==="IMG",oe=this._image=Y?this._url:Yt("img");if(br(oe,"leaflet-image-layer"),this._zoomAnimated&&br(oe,"leaflet-zoom-animated"),this.options.className&&br(oe,this.options.className),oe.onselectstart=h,oe.onmousemove=h,oe.onload=a(this.fire,this,"load"),oe.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(oe.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),Y){this._url=oe.src;return}oe.src=this._url,oe.alt=this.options.alt},_animateZoom:function(Y){var oe=this._map.getZoomScale(Y.zoom),he=this._map._latLngBoundsToNewLayerBounds(this._bounds,Y.zoom,Y.center).min;ng(this._image,he,oe)},_reset:function(){var Y=this._image,oe=new _(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),he=oe.getSize();$i(Y,oe.min),Y.style.width=he.x+"px",Y.style.height=he.y+"px"},_updateOpacity:function(){kl(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 Y=this.options.errorOverlayUrl;Y&&this._url!==Y&&(this._url=Y,this._image.src=Y)},getCenter:function(){return this._bounds.getCenter()}}),Ptr=function(Y,oe,he){return new t3(Y,oe,he)},rye=t3.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var Y=this._url.tagName==="VIDEO",oe=this._image=Y?this._url:Yt("video");if(br(oe,"leaflet-image-layer"),this._zoomAnimated&&br(oe,"leaflet-zoom-animated"),this.options.className&&br(oe,this.options.className),oe.onselectstart=h,oe.onmousemove=h,oe.onloadeddata=a(this.fire,this,"load"),Y){for(var he=oe.getElementsByTagName("source"),be=[],Pe=0;Pe<he.length;Pe++)be.push(he[Pe].src);this._url=he.length>0?be:[oe.src];return}U(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(oe.style,"objectFit")&&(oe.style.objectFit="fill"),oe.autoplay=!!this.options.autoplay,oe.loop=!!this.options.loop,oe.muted=!!this.options.muted,oe.playsInline=!!this.options.playsInline;for(var Ne=0;Ne<this._url.length;Ne++){var $e=Yt("source");$e.src=this._url[Ne],oe.appendChild($e)}}});function Dtr(Y,oe,he){return new rye(Y,oe,he)}var nye=t3.extend({_initImage:function(){var Y=this._image=this._url;br(Y,"leaflet-image-layer"),this._zoomAnimated&&br(Y,"leaflet-zoom-animated"),this.options.className&&br(Y,this.options.className),Y.onselectstart=h,Y.onmousemove=h}});function Ltr(Y,oe,he){return new nye(Y,oe,he)}var gu=ac.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(Y,oe){Y&&(Y instanceof w||U(Y))?(this._latlng=v(Y),p(this,oe)):(p(this,Y),this._source=oe),this.options.content&&(this._content=this.options.content)},openOn:function(Y){return Y=arguments.length?Y:this._source._map,Y.hasLayer(this)||Y.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(Y){return this._map?this.close():(arguments.length?this._source=Y:Y=this._source,this._prepareOpen(),this.openOn(Y._map)),this},onAdd:function(Y){this._zoomAnimated=Y._zoomAnimated,this._container||this._initLayout(),Y._fadeAnimated&&kl(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),Y._fadeAnimated&&kl(this._container,1),this.bringToFront(),this.options.interactive&&(br(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(Y){Y._fadeAnimated?(kl(this._container,0),this._removeTimeout=setTimeout(a(Or,void 0,this._container),200)):Or(this._container),this.options.interactive&&(fi(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(Y){return this._latlng=v(Y),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(Y){return this._content=Y,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 Y={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(Y.zoomanim=this._animateZoom),Y},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&hu(this._container),this},bringToBack:function(){return this._map&&ic(this._container),this},_prepareOpen:function(Y){var oe=this._source;if(!oe._map)return!1;if(oe instanceof yd){oe=null;var he=this._source._layers;for(var be in he)if(he[be]._map){oe=he[be];break}if(!oe)return!1;this._source=oe}if(!Y)if(oe.getCenter)Y=oe.getCenter();else if(oe.getLatLng)Y=oe.getLatLng();else if(oe.getBounds)Y=oe.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(Y),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var Y=this._contentNode,oe=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof oe=="string")Y.innerHTML=oe;else{for(;Y.hasChildNodes();)Y.removeChild(Y.firstChild);Y.appendChild(oe)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var Y=this._map.latLngToLayerPoint(this._latlng),oe=W(this.options.offset),he=this._getAnchor();this._zoomAnimated?$i(this._container,Y.add(he)):oe=oe.add(Y).add(he);var be=this._containerBottom=-oe.y,Pe=this._containerLeft=-Math.round(this._containerWidth/2)+oe.x;this._container.style.bottom=be+"px",this._container.style.left=Pe+"px"}},_getAnchor:function(){return[0,0]}});Ir.include({_initOverlay:function(Y,oe,he,be){var Pe=oe;return Pe instanceof Y||(Pe=new Y(be).setContent(oe)),he&&Pe.setLatLng(he),Pe}}),ac.include({_initOverlay:function(Y,oe,he,be){var Pe=he;return Pe instanceof Y?(p(Pe,be),Pe._source=this):(Pe=oe&&!be?oe:new Y(be,this),Pe.setContent(he)),Pe}});var r3=gu.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(Y){return Y=arguments.length?Y:this._source._map,!Y.hasLayer(this)&&Y._popup&&Y._popup.options.autoClose&&Y.removeLayer(Y._popup),Y._popup=this,gu.prototype.openOn.call(this,Y)},onAdd:function(Y){gu.prototype.onAdd.call(this,Y),Y.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Jh||this._source.on("preclick",og))},onRemove:function(Y){gu.prototype.onRemove.call(this,Y),Y.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Jh||this._source.off("preclick",og))},getEvents:function(){var Y=gu.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(Y.preclick=this.close),this.options.keepInView&&(Y.moveend=this._adjustPan),Y},_initLayout:function(){var Y="leaflet-popup",oe=this._container=Yt("div",Y+" "+(this.options.className||"")+" leaflet-zoom-animated"),he=this._wrapper=Yt("div",Y+"-content-wrapper",oe);if(this._contentNode=Yt("div",Y+"-content",he),iC(oe),n9(this._contentNode),xr(oe,"contextmenu",og),this._tipContainer=Yt("div",Y+"-tip-container",oe),this._tip=Yt("div",Y+"-tip",this._tipContainer),this.options.closeButton){var be=this._closeButton=Yt("a",Y+"-close-button",oe);be.setAttribute("role","button"),be.setAttribute("aria-label","Close popup"),be.href="#close",be.innerHTML='<span aria-hidden="true">×</span>',xr(be,"click",function(Pe){Oo(Pe),this.close()},this)}},_updateLayout:function(){var Y=this._contentNode,oe=Y.style;oe.width="",oe.whiteSpace="nowrap";var he=Y.offsetWidth;he=Math.min(he,this.options.maxWidth),he=Math.max(he,this.options.minWidth),oe.width=he+1+"px",oe.whiteSpace="",oe.height="";var be=Y.offsetHeight,Pe=this.options.maxHeight,Ne="leaflet-popup-scrolled";Pe&&be>Pe?(oe.height=Pe+"px",br(Y,Ne)):fi(Y,Ne),this._containerWidth=this._container.offsetWidth},_animateZoom:function(Y){var oe=this._map._latLngToNewLayerPoint(this._latlng,Y.zoom,Y.center),he=this._getAnchor();$i(this._container,oe.add(he))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var Y=this._map,oe=parseInt(fr(this._container,"marginBottom"),10)||0,he=this._container.offsetHeight+oe,be=this._containerWidth,Pe=new z(this._containerLeft,-he-this._containerBottom);Pe._add(ig(this._container));var Ne=Y.layerPointToContainerPoint(Pe),$e=W(this.options.autoPanPadding),Ke=W(this.options.autoPanPaddingTopLeft||$e),tt=W(this.options.autoPanPaddingBottomRight||$e),mt=Y.getSize(),Rt=0,rr=0;Ne.x+be+tt.x>mt.x&&(Rt=Ne.x+be-mt.x+tt.x),Ne.x-Rt-Ke.x<0&&(Rt=Ne.x-Ke.x),Ne.y+he+tt.y>mt.y&&(rr=Ne.y+he-mt.y+tt.y),Ne.y-rr-Ke.y<0&&(rr=Ne.y-Ke.y),(Rt||rr)&&(this.options.keepInView&&(this._autopanning=!0),Y.fire("autopanstart").panBy([Rt,rr]))}},_getAnchor:function(){return W(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Otr=function(Y,oe){return new r3(Y,oe)};Ir.mergeOptions({closePopupOnClick:!0}),Ir.include({openPopup:function(Y,oe,he){return this._initOverlay(r3,Y,oe,he).openOn(this),this},closePopup:function(Y){return Y=arguments.length?Y:this._popup,Y&&Y.close(),this}}),ac.include({bindPopup:function(Y,oe){return this._popup=this._initOverlay(r3,this._popup,Y,oe),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(Y){return this._popup&&(this instanceof yd||(this._popup._source=this),this._popup._prepareOpen(Y||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(Y){return this._popup&&this._popup.setContent(Y),this},getPopup:function(){return this._popup},_openPopup:function(Y){if(!(!this._popup||!this._map)){ag(Y);var oe=Y.layer||Y.target;if(this._popup._source===oe&&!(oe instanceof Jh)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(Y.latlng);return}this._popup._source=oe,this.openPopup(Y.latlng)}},_movePopup:function(Y){this._popup.setLatLng(Y.latlng)},_onKeyPress:function(Y){Y.originalEvent.keyCode===13&&this._openPopup(Y)}});var n3=gu.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(Y){gu.prototype.onAdd.call(this,Y),this.setOpacity(this.options.opacity),Y.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(Y){gu.prototype.onRemove.call(this,Y),Y.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var Y=gu.prototype.getEvents.call(this);return this.options.permanent||(Y.preclick=this.close),Y},_initLayout:function(){var Y="leaflet-tooltip",oe=Y+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Yt("div",oe),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(Y){var oe,he,be=this._map,Pe=this._container,Ne=be.latLngToContainerPoint(be.getCenter()),$e=be.layerPointToContainerPoint(Y),Ke=this.options.direction,tt=Pe.offsetWidth,mt=Pe.offsetHeight,Rt=W(this.options.offset),rr=this._getAnchor();Ke==="top"?(oe=tt/2,he=mt):Ke==="bottom"?(oe=tt/2,he=0):Ke==="center"?(oe=tt/2,he=mt/2):Ke==="right"?(oe=0,he=mt/2):Ke==="left"?(oe=tt,he=mt/2):$e.x<Ne.x?(Ke="right",oe=0,he=mt/2):(Ke="left",oe=tt+(Rt.x+rr.x)*2,he=mt/2),Y=Y.subtract(W(oe,he,!0)).add(Rt).add(rr),fi(Pe,"leaflet-tooltip-right"),fi(Pe,"leaflet-tooltip-left"),fi(Pe,"leaflet-tooltip-top"),fi(Pe,"leaflet-tooltip-bottom"),br(Pe,"leaflet-tooltip-"+Ke),$i(Pe,Y)},_updatePosition:function(){var Y=this._map.latLngToLayerPoint(this._latlng);this._setPosition(Y)},setOpacity:function(Y){this.options.opacity=Y,this._container&&kl(this._container,Y)},_animateZoom:function(Y){var oe=this._map._latLngToNewLayerPoint(this._latlng,Y.zoom,Y.center);this._setPosition(oe)},_getAnchor:function(){return W(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Itr=function(Y,oe){return new n3(Y,oe)};Ir.include({openTooltip:function(Y,oe,he){return this._initOverlay(n3,Y,oe,he).openOn(this),this},closeTooltip:function(Y){return Y.close(),this}}),ac.include({bindTooltip:function(Y,oe){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(n3,this._tooltip,Y,oe),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(Y){if(!(!Y&&this._tooltipHandlersAdded)){var oe=Y?"off":"on",he={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?he.add=this._openTooltip:(he.mouseover=this._openTooltip,he.mouseout=this.closeTooltip,he.click=this._openTooltip,this._map?this._addFocusListeners():he.add=this._addFocusListeners),this._tooltip.options.sticky&&(he.mousemove=this._moveTooltip),this[oe](he),this._tooltipHandlersAdded=!Y}},openTooltip:function(Y){return this._tooltip&&(this instanceof yd||(this._tooltip._source=this),this._tooltip._prepareOpen(Y)&&(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(Y){return this._tooltip&&this._tooltip.setContent(Y),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(Y){var oe=typeof Y.getElement=="function"&&Y.getElement();oe&&(xr(oe,"focus",function(){this._tooltip._source=Y,this.openTooltip()},this),xr(oe,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(Y){var oe=typeof Y.getElement=="function"&&Y.getElement();oe&&oe.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(Y){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var oe=this;this._map.once("moveend",function(){oe._openOnceFlag=!1,oe._openTooltip(Y)});return}this._tooltip._source=Y.layer||Y.target,this.openTooltip(this._tooltip.options.sticky?Y.latlng:void 0)}},_moveTooltip:function(Y){var oe=Y.latlng,he,be;this._tooltip.options.sticky&&Y.originalEvent&&(he=this._map.mouseEventToContainerPoint(Y.originalEvent),be=this._map.containerPointToLayerPoint(he),oe=this._map.layerPointToLatLng(be)),this._tooltip.setLatLng(oe)}});var iye=Ov.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(Y){var oe=Y&&Y.tagName==="DIV"?Y:document.createElement("div"),he=this.options;if(he.html instanceof Element?(Ka(oe),oe.appendChild(he.html)):oe.innerHTML=he.html!==!1?he.html:"",he.bgPos){var be=W(he.bgPos);oe.style.backgroundPosition=-be.x+"px "+-be.y+"px"}return this._setIconStyles(oe,"icon"),oe},createShadow:function(){return null}});function Ntr(Y){return new iye(Y)}Ov.Default=sC;var lC=ac.extend({options:{tileSize:256,opacity:1,updateWhenIdle:_t.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(Y){p(this,Y)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(Y){Y._addZoomLimit(this)},onRemove:function(Y){this._removeAllTiles(),Or(this._container),Y._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(hu(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ic(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(Y){return this.options.opacity=Y,this._updateOpacity(),this},setZIndex:function(Y){return this.options.zIndex=Y,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var Y=this._clampZoom(this._map.getZoom());Y!==this._tileZoom&&(this._tileZoom=Y,this._updateLevels()),this._update()}return this},getEvents:function(){var Y={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=c(this._onMoveEnd,this.options.updateInterval,this)),Y.move=this._onMove),this._zoomAnimated&&(Y.zoomanim=this._animateZoom),Y},createTile:function(){return document.createElement("div")},getTileSize:function(){var Y=this.options.tileSize;return Y instanceof z?Y:new z(Y,Y)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(Y){for(var oe=this.getPane().children,he=-Y(-1/0,1/0),be=0,Pe=oe.length,Ne;be<Pe;be++)Ne=oe[be].style.zIndex,oe[be]!==this._container&&Ne&&(he=Y(he,+Ne));isFinite(he)&&(this.options.zIndex=he+Y(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!_t.ielt9){kl(this._container,this.options.opacity);var Y=+new Date,oe=!1,he=!1;for(var be in this._tiles){var Pe=this._tiles[be];if(!(!Pe.current||!Pe.loaded)){var Ne=Math.min(1,(Y-Pe.loaded)/200);kl(Pe.el,Ne),Ne<1?oe=!0:(Pe.active?he=!0:this._onOpaqueTile(Pe),Pe.active=!0)}}he&&!this._noPrune&&this._pruneTiles(),oe&&(y(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=Yt("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var Y=this._tileZoom,oe=this.options.maxZoom;if(Y!==void 0){for(var he in this._levels)he=Number(he),this._levels[he].el.children.length||he===Y?(this._levels[he].el.style.zIndex=oe-Math.abs(Y-he),this._onUpdateLevel(he)):(Or(this._levels[he].el),this._removeTilesAtZoom(he),this._onRemoveLevel(he),delete this._levels[he]);var be=this._levels[Y],Pe=this._map;return be||(be=this._levels[Y]={},be.el=Yt("div","leaflet-tile-container leaflet-zoom-animated",this._container),be.el.style.zIndex=oe,be.origin=Pe.project(Pe.unproject(Pe.getPixelOrigin()),Y).round(),be.zoom=Y,this._setZoomTransform(be,Pe.getCenter(),Pe.getZoom()),this._onCreateLevel(be)),this._level=be,be}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var Y,oe,he=this._map.getZoom();if(he>this.options.maxZoom||he<this.options.minZoom){this._removeAllTiles();return}for(Y in this._tiles)oe=this._tiles[Y],oe.retain=oe.current;for(Y in this._tiles)if(oe=this._tiles[Y],oe.current&&!oe.active){var be=oe.coords;this._retainParent(be.x,be.y,be.z,be.z-5)||this._retainChildren(be.x,be.y,be.z,be.z+2)}for(Y in this._tiles)this._tiles[Y].retain||this._removeTile(Y)}},_removeTilesAtZoom:function(Y){for(var oe in this._tiles)this._tiles[oe].coords.z===Y&&this._removeTile(oe)},_removeAllTiles:function(){for(var Y in this._tiles)this._removeTile(Y)},_invalidateAll:function(){for(var Y in this._levels)Or(this._levels[Y].el),this._onRemoveLevel(Number(Y)),delete this._levels[Y];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(Y,oe,he,be){var Pe=Math.floor(Y/2),Ne=Math.floor(oe/2),$e=he-1,Ke=new z(+Pe,+Ne);Ke.z=+$e;var tt=this._tileCoordsToKey(Ke),mt=this._tiles[tt];return mt&&mt.active?(mt.retain=!0,!0):(mt&&mt.loaded&&(mt.retain=!0),$e>be?this._retainParent(Pe,Ne,$e,be):!1)},_retainChildren:function(Y,oe,he,be){for(var Pe=2*Y;Pe<2*Y+2;Pe++)for(var Ne=2*oe;Ne<2*oe+2;Ne++){var $e=new z(Pe,Ne);$e.z=he+1;var Ke=this._tileCoordsToKey($e),tt=this._tiles[Ke];if(tt&&tt.active){tt.retain=!0;continue}else tt&&tt.loaded&&(tt.retain=!0);he+1<be&&this._retainChildren(Pe,Ne,he+1,be)}},_resetView:function(Y){var oe=Y&&(Y.pinch||Y.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),oe,oe)},_animateZoom:function(Y){this._setView(Y.center,Y.zoom,!0,Y.noUpdate)},_clampZoom:function(Y){var oe=this.options;return oe.minNativeZoom!==void 0&&Y<oe.minNativeZoom?oe.minNativeZoom:oe.maxNativeZoom!==void 0&&oe.maxNativeZoom<Y?oe.maxNativeZoom:Y},_setView:function(Y,oe,he,be){var Pe=Math.round(oe);this.options.maxZoom!==void 0&&Pe>this.options.maxZoom||this.options.minZoom!==void 0&&Pe<this.options.minZoom?Pe=void 0:Pe=this._clampZoom(Pe);var Ne=this.options.updateWhenZooming&&Pe!==this._tileZoom;(!be||Ne)&&(this._tileZoom=Pe,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),Pe!==void 0&&this._update(Y),he||this._pruneTiles(),this._noPrune=!!he),this._setZoomTransforms(Y,oe)},_setZoomTransforms:function(Y,oe){for(var he in this._levels)this._setZoomTransform(this._levels[he],Y,oe)},_setZoomTransform:function(Y,oe,he){var be=this._map.getZoomScale(he,Y.zoom),Pe=Y.origin.multiplyBy(be).subtract(this._map._getNewPixelOrigin(oe,he)).round();_t.any3d?ng(Y.el,Pe,be):$i(Y.el,Pe)},_resetGrid:function(){var Y=this._map,oe=Y.options.crs,he=this._tileSize=this.getTileSize(),be=this._tileZoom,Pe=this._map.getPixelWorldBounds(this._tileZoom);Pe&&(this._globalTileRange=this._pxBoundsToTileRange(Pe)),this._wrapX=oe.wrapLng&&!this.options.noWrap&&[Math.floor(Y.project([0,oe.wrapLng[0]],be).x/he.x),Math.ceil(Y.project([0,oe.wrapLng[1]],be).x/he.y)],this._wrapY=oe.wrapLat&&!this.options.noWrap&&[Math.floor(Y.project([oe.wrapLat[0],0],be).y/he.x),Math.ceil(Y.project([oe.wrapLat[1],0],be).y/he.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(Y){var oe=this._map,he=oe._animatingZoom?Math.max(oe._animateToZoom,oe.getZoom()):oe.getZoom(),be=oe.getZoomScale(he,this._tileZoom),Pe=oe.project(Y,this._tileZoom).floor(),Ne=oe.getSize().divideBy(be*2);return new _(Pe.subtract(Ne),Pe.add(Ne))},_update:function(Y){var oe=this._map;if(oe){var he=this._clampZoom(oe.getZoom());if(Y===void 0&&(Y=oe.getCenter()),this._tileZoom!==void 0){var be=this._getTiledPixelBounds(Y),Pe=this._pxBoundsToTileRange(be),Ne=Pe.getCenter(),$e=[],Ke=this.options.keepBuffer,tt=new _(Pe.getBottomLeft().subtract([Ke,-Ke]),Pe.getTopRight().add([Ke,-Ke]));if(!(isFinite(Pe.min.x)&&isFinite(Pe.min.y)&&isFinite(Pe.max.x)&&isFinite(Pe.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var mt in this._tiles){var Rt=this._tiles[mt].coords;(Rt.z!==this._tileZoom||!tt.contains(new z(Rt.x,Rt.y)))&&(this._tiles[mt].current=!1)}if(Math.abs(he-this._tileZoom)>1){this._setView(Y,he);return}for(var rr=Pe.min.y;rr<=Pe.max.y;rr++)for(var Mr=Pe.min.x;Mr<=Pe.max.x;Mr++){var Ca=new z(Mr,rr);if(Ca.z=this._tileZoom,!!this._isValidTile(Ca)){var uo=this._tiles[this._tileCoordsToKey(Ca)];uo?uo.current=!0:$e.push(Ca)}}if($e.sort(function(Qa,Fv){return Qa.distanceTo(Ne)-Fv.distanceTo(Ne)}),$e.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Tl=document.createDocumentFragment();for(Mr=0;Mr<$e.length;Mr++)this._addTile($e[Mr],Tl);this._level.el.appendChild(Tl)}}}},_isValidTile:function(Y){var oe=this._map.options.crs;if(!oe.infinite){var he=this._globalTileRange;if(!oe.wrapLng&&(Y.x<he.min.x||Y.x>he.max.x)||!oe.wrapLat&&(Y.y<he.min.y||Y.y>he.max.y))return!1}if(!this.options.bounds)return!0;var be=this._tileCoordsToBounds(Y);return b(this.options.bounds).overlaps(be)},_keyToBounds:function(Y){return this._tileCoordsToBounds(this._keyToTileCoords(Y))},_tileCoordsToNwSe:function(Y){var oe=this._map,he=this.getTileSize(),be=Y.scaleBy(he),Pe=be.add(he),Ne=oe.unproject(be,Y.z),$e=oe.unproject(Pe,Y.z);return[Ne,$e]},_tileCoordsToBounds:function(Y){var oe=this._tileCoordsToNwSe(Y),he=new m(oe[0],oe[1]);return this.options.noWrap||(he=this._map.wrapLatLngBounds(he)),he},_tileCoordsToKey:function(Y){return Y.x+":"+Y.y+":"+Y.z},_keyToTileCoords:function(Y){var oe=Y.split(":"),he=new z(+oe[0],+oe[1]);return he.z=+oe[2],he},_removeTile:function(Y){var oe=this._tiles[Y];oe&&(Or(oe.el),delete this._tiles[Y],this.fire("tileunload",{tile:oe.el,coords:this._keyToTileCoords(Y)}))},_initTile:function(Y){br(Y,"leaflet-tile");var oe=this.getTileSize();Y.style.width=oe.x+"px",Y.style.height=oe.y+"px",Y.onselectstart=h,Y.onmousemove=h,_t.ielt9&&this.options.opacity<1&&kl(Y,this.options.opacity)},_addTile:function(Y,oe){var he=this._getTilePos(Y),be=this._tileCoordsToKey(Y),Pe=this.createTile(this._wrapCoords(Y),a(this._tileReady,this,Y));this._initTile(Pe),this.createTile.length<2&&C(a(this._tileReady,this,Y,null,Pe)),$i(Pe,he),this._tiles[be]={el:Pe,coords:Y,current:!0},oe.appendChild(Pe),this.fire("tileloadstart",{tile:Pe,coords:Y})},_tileReady:function(Y,oe,he){oe&&this.fire("tileerror",{error:oe,tile:he,coords:Y});var be=this._tileCoordsToKey(Y);he=this._tiles[be],he&&(he.loaded=+new Date,this._map._fadeAnimated?(kl(he.el,0),y(this._fadeFrame),this._fadeFrame=C(this._updateOpacity,this)):(he.active=!0,this._pruneTiles()),oe||(br(he.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:he.el,coords:Y})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),_t.ielt9||!this._map._fadeAnimated?C(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(Y){return Y.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(Y){var oe=new z(this._wrapX?d(Y.x,this._wrapX):Y.x,this._wrapY?d(Y.y,this._wrapY):Y.y);return oe.z=Y.z,oe},_pxBoundsToTileRange:function(Y){var oe=this.getTileSize();return new _(Y.min.unscaleBy(oe).floor(),Y.max.unscaleBy(oe).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var Y in this._tiles)if(!this._tiles[Y].loaded)return!1;return!0}});function Rtr(Y){return new lC(Y)}var Rv=lC.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(Y,oe){this._url=Y,oe=p(this,oe),oe.detectRetina&&_t.retina&&oe.maxZoom>0?(oe.tileSize=Math.floor(oe.tileSize/2),oe.zoomReverse?(oe.zoomOffset--,oe.minZoom=Math.min(oe.maxZoom,oe.minZoom+1)):(oe.zoomOffset++,oe.maxZoom=Math.max(oe.minZoom,oe.maxZoom-1)),oe.minZoom=Math.max(0,oe.minZoom)):oe.zoomReverse?oe.minZoom=Math.min(oe.maxZoom,oe.minZoom):oe.maxZoom=Math.max(oe.minZoom,oe.maxZoom),typeof oe.subdomains=="string"&&(oe.subdomains=oe.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(Y,oe){return this._url===Y&&oe===void 0&&(oe=!0),this._url=Y,oe||this.redraw(),this},createTile:function(Y,oe){var he=document.createElement("img");return xr(he,"load",a(this._tileOnLoad,this,oe,he)),xr(he,"error",a(this._tileOnError,this,oe,he)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(he.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(he.referrerPolicy=this.options.referrerPolicy),he.alt="",he.src=this.getTileUrl(Y),he},getTileUrl:function(Y){var oe={r:_t.retina?"@2x":"",s:this._getSubdomain(Y),x:Y.x,y:Y.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var he=this._globalTileRange.max.y-Y.y;this.options.tms&&(oe.y=he),oe["-y"]=he}return j(this._url,i(oe,this.options))},_tileOnLoad:function(Y,oe){_t.ielt9?setTimeout(a(Y,this,null,oe),0):Y(null,oe)},_tileOnError:function(Y,oe,he){var be=this.options.errorTileUrl;be&&oe.getAttribute("src")!==be&&(oe.src=be),Y(he,oe)},_onTileRemove:function(Y){Y.tile.onload=null},_getZoomForUrl:function(){var Y=this._tileZoom,oe=this.options.maxZoom,he=this.options.zoomReverse,be=this.options.zoomOffset;return he&&(Y=oe-Y),Y+be},_getSubdomain:function(Y){var oe=Math.abs(Y.x+Y.y)%this.options.subdomains.length;return this.options.subdomains[oe]},_abortLoading:function(){var Y,oe;for(Y in this._tiles)if(this._tiles[Y].coords.z!==this._tileZoom&&(oe=this._tiles[Y].el,oe.onload=h,oe.onerror=h,!oe.complete)){oe.src=R;var he=this._tiles[Y].coords;Or(oe),delete this._tiles[Y],this.fire("tileabort",{tile:oe,coords:he})}},_removeTile:function(Y){var oe=this._tiles[Y];if(oe)return oe.el.setAttribute("src",R),lC.prototype._removeTile.call(this,Y)},_tileReady:function(Y,oe,he){if(!(!this._map||he&&he.getAttribute("src")===R))return lC.prototype._tileReady.call(this,Y,oe,he)}});function oye(Y,oe){return new Rv(Y,oe)}var aye=Rv.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(Y,oe){this._url=Y;var he=i({},this.defaultWmsParams);for(var be in oe)be in this.options||(he[be]=oe[be]);oe=p(this,oe);var Pe=oe.detectRetina&&_t.retina?2:1,Ne=this.getTileSize();he.width=Ne.x*Pe,he.height=Ne.y*Pe,this.wmsParams=he},onAdd:function(Y){this._crs=this.options.crs||Y.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var oe=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[oe]=this._crs.code,Rv.prototype.onAdd.call(this,Y)},getTileUrl:function(Y){var oe=this._tileCoordsToNwSe(Y),he=this._crs,be=A(he.project(oe[0]),he.project(oe[1])),Pe=be.min,Ne=be.max,$e=(this._wmsVersion>=1.3&&this._crs===Qve?[Pe.y,Pe.x,Ne.y,Ne.x]:[Pe.x,Pe.y,Ne.x,Ne.y]).join(","),Ke=Rv.prototype.getTileUrl.call(this,Y);return Ke+x(this.wmsParams,Ke,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+$e},setParams:function(Y,oe){return i(this.wmsParams,Y),oe||this.redraw(),this}});function Ftr(Y,oe){return new aye(Y,oe)}Rv.WMS=aye,oye.wms=Ftr;var wd=ac.extend({options:{padding:.1},initialize:function(Y){p(this,Y),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),br(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 Y={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(Y.zoomanim=this._onAnimZoom),Y},_onAnimZoom:function(Y){this._updateTransform(Y.center,Y.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(Y,oe){var he=this._map.getZoomScale(oe,this._zoom),be=this._map.getSize().multiplyBy(.5+this.options.padding),Pe=this._map.project(this._center,oe),Ne=be.multiplyBy(-he).add(Pe).subtract(this._map._getNewPixelOrigin(Y,oe));_t.any3d?ng(this._container,Ne,he):$i(this._container,Ne)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var Y in this._layers)this._layers[Y]._reset()},_onZoomEnd:function(){for(var Y in this._layers)this._layers[Y]._project()},_updatePaths:function(){for(var Y in this._layers)this._layers[Y]._update()},_update:function(){var Y=this.options.padding,oe=this._map.getSize(),he=this._map.containerPointToLayerPoint(oe.multiplyBy(-Y)).round();this._bounds=new _(he,he.add(oe.multiplyBy(1+Y*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),sye=wd.extend({options:{tolerance:0},getEvents:function(){var Y=wd.prototype.getEvents.call(this);return Y.viewprereset=this._onViewPreReset,Y},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){wd.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var Y=this._container=document.createElement("canvas");xr(Y,"mousemove",this._onMouseMove,this),xr(Y,"click dblclick mousedown mouseup contextmenu",this._onClick,this),xr(Y,"mouseout",this._handleMouseOut,this),Y._leaflet_disable_events=!0,this._ctx=Y.getContext("2d")},_destroyContainer:function(){y(this._redrawRequest),delete this._ctx,Or(this._container),Vn(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var Y;this._redrawBounds=null;for(var oe in this._layers)Y=this._layers[oe],Y._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){wd.prototype._update.call(this);var Y=this._bounds,oe=this._container,he=Y.getSize(),be=_t.retina?2:1;$i(oe,Y.min),oe.width=be*he.x,oe.height=be*he.y,oe.style.width=he.x+"px",oe.style.height=he.y+"px",_t.retina&&this._ctx.scale(2,2),this._ctx.translate(-Y.min.x,-Y.min.y),this.fire("update")}},_reset:function(){wd.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(Y){this._updateDashArray(Y),this._layers[l(Y)]=Y;var oe=Y._order={layer:Y,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=oe),this._drawLast=oe,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(Y){this._requestRedraw(Y)},_removePath:function(Y){var oe=Y._order,he=oe.next,be=oe.prev;he?he.prev=be:this._drawLast=be,be?be.next=he:this._drawFirst=he,delete Y._order,delete this._layers[l(Y)],this._requestRedraw(Y)},_updatePath:function(Y){this._extendRedrawBounds(Y),Y._project(),Y._update(),this._requestRedraw(Y)},_updateStyle:function(Y){this._updateDashArray(Y),this._requestRedraw(Y)},_updateDashArray:function(Y){if(typeof Y.options.dashArray=="string"){var oe=Y.options.dashArray.split(/[, ]+/),he=[],be,Pe;for(Pe=0;Pe<oe.length;Pe++){if(be=Number(oe[Pe]),isNaN(be))return;he.push(be)}Y.options._dashArray=he}else Y.options._dashArray=Y.options.dashArray},_requestRedraw:function(Y){this._map&&(this._extendRedrawBounds(Y),this._redrawRequest=this._redrawRequest||C(this._redraw,this))},_extendRedrawBounds:function(Y){if(Y._pxBounds){var oe=(Y.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new _,this._redrawBounds.extend(Y._pxBounds.min.subtract([oe,oe])),this._redrawBounds.extend(Y._pxBounds.max.add([oe,oe]))}},_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 Y=this._redrawBounds;if(Y){var oe=Y.getSize();this._ctx.clearRect(Y.min.x,Y.min.y,oe.x,oe.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 Y,oe=this._redrawBounds;if(this._ctx.save(),oe){var he=oe.getSize();this._ctx.beginPath(),this._ctx.rect(oe.min.x,oe.min.y,he.x,he.y),this._ctx.clip()}this._drawing=!0;for(var be=this._drawFirst;be;be=be.next)Y=be.layer,(!oe||Y._pxBounds&&Y._pxBounds.intersects(oe))&&Y._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(Y,oe){if(this._drawing){var he,be,Pe,Ne,$e=Y._parts,Ke=$e.length,tt=this._ctx;if(Ke){for(tt.beginPath(),he=0;he<Ke;he++){for(be=0,Pe=$e[he].length;be<Pe;be++)Ne=$e[he][be],tt[be?"lineTo":"moveTo"](Ne.x,Ne.y);oe&&tt.closePath()}this._fillStroke(tt,Y)}}},_updateCircle:function(Y){if(!(!this._drawing||Y._empty())){var oe=Y._point,he=this._ctx,be=Math.max(Math.round(Y._radius),1),Pe=(Math.max(Math.round(Y._radiusY),1)||be)/be;Pe!==1&&(he.save(),he.scale(1,Pe)),he.beginPath(),he.arc(oe.x,oe.y/Pe,be,0,Math.PI*2,!1),Pe!==1&&he.restore(),this._fillStroke(he,Y)}},_fillStroke:function(Y,oe){var he=oe.options;he.fill&&(Y.globalAlpha=he.fillOpacity,Y.fillStyle=he.fillColor||he.color,Y.fill(he.fillRule||"evenodd")),he.stroke&&he.weight!==0&&(Y.setLineDash&&Y.setLineDash(oe.options&&oe.options._dashArray||[]),Y.globalAlpha=he.opacity,Y.lineWidth=he.weight,Y.strokeStyle=he.color,Y.lineCap=he.lineCap,Y.lineJoin=he.lineJoin,Y.stroke())},_onClick:function(Y){for(var oe=this._map.mouseEventToLayerPoint(Y),he,be,Pe=this._drawFirst;Pe;Pe=Pe.next)he=Pe.layer,he.options.interactive&&he._containsPoint(oe)&&(!(Y.type==="click"||Y.type==="preclick")||!this._map._draggableMoved(he))&&(be=he);this._fireEvent(be?[be]:!1,Y)},_onMouseMove:function(Y){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var oe=this._map.mouseEventToLayerPoint(Y);this._handleMouseHover(Y,oe)}},_handleMouseOut:function(Y){var oe=this._hoveredLayer;oe&&(fi(this._container,"leaflet-interactive"),this._fireEvent([oe],Y,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(Y,oe){if(!this._mouseHoverThrottled){for(var he,be,Pe=this._drawFirst;Pe;Pe=Pe.next)he=Pe.layer,he.options.interactive&&he._containsPoint(oe)&&(be=he);be!==this._hoveredLayer&&(this._handleMouseOut(Y),be&&(br(this._container,"leaflet-interactive"),this._fireEvent([be],Y,"mouseover"),this._hoveredLayer=be)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,Y),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(Y,oe,he){this._map._fireDOMEvent(oe,he||oe.type,Y)},_bringToFront:function(Y){var oe=Y._order;if(oe){var he=oe.next,be=oe.prev;if(he)he.prev=be;else return;be?be.next=he:he&&(this._drawFirst=he),oe.prev=this._drawLast,this._drawLast.next=oe,oe.next=null,this._drawLast=oe,this._requestRedraw(Y)}},_bringToBack:function(Y){var oe=Y._order;if(oe){var he=oe.next,be=oe.prev;if(be)be.next=he;else return;he?he.prev=be:be&&(this._drawLast=be),oe.prev=null,oe.next=this._drawFirst,this._drawFirst.prev=oe,this._drawFirst=oe,this._requestRedraw(Y)}}});function lye(Y){return _t.canvas?new sye(Y):null}var cC=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(Y){return document.createElement("<lvml:"+Y+' class="lvml">')}}catch(Y){}return function(Y){return document.createElement("<"+Y+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),jtr={_initContainer:function(){this._container=Yt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(wd.prototype._update.call(this),this.fire("update"))},_initPath:function(Y){var oe=Y._container=cC("shape");br(oe,"leaflet-vml-shape "+(this.options.className||"")),oe.coordsize="1 1",Y._path=cC("path"),oe.appendChild(Y._path),this._updateStyle(Y),this._layers[l(Y)]=Y},_addPath:function(Y){var oe=Y._container;this._container.appendChild(oe),Y.options.interactive&&Y.addInteractiveTarget(oe)},_removePath:function(Y){var oe=Y._container;Or(oe),Y.removeInteractiveTarget(oe),delete this._layers[l(Y)]},_updateStyle:function(Y){var oe=Y._stroke,he=Y._fill,be=Y.options,Pe=Y._container;Pe.stroked=!!be.stroke,Pe.filled=!!be.fill,be.stroke?(oe||(oe=Y._stroke=cC("stroke")),Pe.appendChild(oe),oe.weight=be.weight+"px",oe.color=be.color,oe.opacity=be.opacity,be.dashArray?oe.dashStyle=U(be.dashArray)?be.dashArray.join(" "):be.dashArray.replace(/( *, *)/g," "):oe.dashStyle="",oe.endcap=be.lineCap.replace("butt","flat"),oe.joinstyle=be.lineJoin):oe&&(Pe.removeChild(oe),Y._stroke=null),be.fill?(he||(he=Y._fill=cC("fill")),Pe.appendChild(he),he.color=be.fillColor||be.color,he.opacity=be.fillOpacity):he&&(Pe.removeChild(he),Y._fill=null)},_updateCircle:function(Y){var oe=Y._point.round(),he=Math.round(Y._radius),be=Math.round(Y._radiusY||he);this._setPath(Y,Y._empty()?"M0 0":"AL "+oe.x+","+oe.y+" "+he+","+be+" 0,"+65535*360)},_setPath:function(Y,oe){Y._path.v=oe},_bringToFront:function(Y){hu(Y._container)},_bringToBack:function(Y){ic(Y._container)}},i3=_t.vml?cC:K,uC=wd.extend({_initContainer:function(){this._container=i3("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=i3("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Or(this._container),Vn(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){wd.prototype._update.call(this);var Y=this._bounds,oe=Y.getSize(),he=this._container;(!this._svgSize||!this._svgSize.equals(oe))&&(this._svgSize=oe,he.setAttribute("width",oe.x),he.setAttribute("height",oe.y)),$i(he,Y.min),he.setAttribute("viewBox",[Y.min.x,Y.min.y,oe.x,oe.y].join(" ")),this.fire("update")}},_initPath:function(Y){var oe=Y._path=i3("path");Y.options.className&&br(oe,Y.options.className),Y.options.interactive&&br(oe,"leaflet-interactive"),this._updateStyle(Y),this._layers[l(Y)]=Y},_addPath:function(Y){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(Y._path),Y.addInteractiveTarget(Y._path)},_removePath:function(Y){Or(Y._path),Y.removeInteractiveTarget(Y._path),delete this._layers[l(Y)]},_updatePath:function(Y){Y._project(),Y._update()},_updateStyle:function(Y){var oe=Y._path,he=Y.options;oe&&(he.stroke?(oe.setAttribute("stroke",he.color),oe.setAttribute("stroke-opacity",he.opacity),oe.setAttribute("stroke-width",he.weight),oe.setAttribute("stroke-linecap",he.lineCap),oe.setAttribute("stroke-linejoin",he.lineJoin),he.dashArray?oe.setAttribute("stroke-dasharray",he.dashArray):oe.removeAttribute("stroke-dasharray"),he.dashOffset?oe.setAttribute("stroke-dashoffset",he.dashOffset):oe.removeAttribute("stroke-dashoffset")):oe.setAttribute("stroke","none"),he.fill?(oe.setAttribute("fill",he.fillColor||he.color),oe.setAttribute("fill-opacity",he.fillOpacity),oe.setAttribute("fill-rule",he.fillRule||"evenodd")):oe.setAttribute("fill","none"))},_updatePoly:function(Y,oe){this._setPath(Y,ne(Y._parts,oe))},_updateCircle:function(Y){var oe=Y._point,he=Math.max(Math.round(Y._radius),1),be=Math.max(Math.round(Y._radiusY),1)||he,Pe="a"+he+","+be+" 0 1,0 ",Ne=Y._empty()?"M0 0":"M"+(oe.x-he)+","+oe.y+Pe+he*2+",0 "+Pe+-he*2+",0 ";this._setPath(Y,Ne)},_setPath:function(Y,oe){Y._path.setAttribute("d",oe)},_bringToFront:function(Y){hu(Y._path)},_bringToBack:function(Y){ic(Y._path)}});_t.vml&&uC.include(jtr);function cye(Y){return _t.svg||_t.vml?new uC(Y):null}Ir.include({getRenderer:function(Y){var oe=Y.options.renderer||this._getPaneRenderer(Y.options.pane)||this.options.renderer||this._renderer;return oe||(oe=this._renderer=this._createRenderer()),this.hasLayer(oe)||this.addLayer(oe),oe},_getPaneRenderer:function(Y){if(Y==="overlayPane"||Y===void 0)return!1;var oe=this._paneRenderers[Y];return oe===void 0&&(oe=this._createRenderer({pane:Y}),this._paneRenderers[Y]=oe),oe},_createRenderer:function(Y){return this.options.preferCanvas&&lye(Y)||cye(Y)}});var uye=Iv.extend({initialize:function(Y,oe){Iv.prototype.initialize.call(this,this._boundsToLatLngs(Y),oe)},setBounds:function(Y){return this.setLatLngs(this._boundsToLatLngs(Y))},_boundsToLatLngs:function(Y){return Y=b(Y),[Y.getSouthWest(),Y.getNorthWest(),Y.getNorthEast(),Y.getSouthEast()]}});function Btr(Y,oe){return new uye(Y,oe)}uC.create=i3,uC.pointsToPath=ne,xd.geometryToLayer=KP,xd.coordsToLatLng=h9,xd.coordsToLatLngs=QP,xd.latLngToCoords=p9,xd.latLngsToCoords=JP,xd.getFeature=Nv,xd.asFeature=e3,Ir.mergeOptions({boxZoom:!0});var dye=fu.extend({initialize:function(Y){this._map=Y,this._container=Y._container,this._pane=Y._panes.overlayPane,this._resetStateTimeout=0,Y.on("unload",this._destroy,this)},addHooks:function(){xr(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Vn(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Or(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(Y){if(!Y.shiftKey||Y.which!==1&&Y.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),tC(),Zz(),this._startPoint=this._map.mouseEventToContainerPoint(Y),xr(document,{contextmenu:ag,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(Y){this._moved||(this._moved=!0,this._box=Yt("div","leaflet-zoom-box",this._container),br(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(Y);var oe=new _(this._point,this._startPoint),he=oe.getSize();$i(this._box,oe.min),this._box.style.width=he.x+"px",this._box.style.height=he.y+"px"},_finish:function(){this._moved&&(Or(this._box),fi(this._container,"leaflet-crosshair")),rC(),Xz(),Vn(document,{contextmenu:ag,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(Y){if(!(Y.which!==1&&Y.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var oe=new m(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(oe).fire("boxzoomend",{boxZoomBounds:oe})}},_onKeyDown:function(Y){Y.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Ir.addInitHook("addHandler","boxZoom",dye),Ir.mergeOptions({doubleClickZoom:!0});var hye=fu.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(Y){var oe=this._map,he=oe.getZoom(),be=oe.options.zoomDelta,Pe=Y.originalEvent.shiftKey?he-be:he+be;oe.options.doubleClickZoom==="center"?oe.setZoom(Pe):oe.setZoomAround(Y.containerPoint,Pe)}});Ir.addInitHook("addHandler","doubleClickZoom",hye),Ir.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var pye=fu.extend({addHooks:function(){if(!this._draggable){var Y=this._map;this._draggable=new Qh(Y._mapPane,Y._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),Y.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),Y.on("zoomend",this._onZoomEnd,this),Y.whenReady(this._onZoomEnd,this))}br(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){fi(this._map._container,"leaflet-grab"),fi(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 Y=this._map;if(Y._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var oe=b(this._map.options.maxBounds);this._offsetLimit=A(this._map.latLngToContainerPoint(oe.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(oe.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;Y.fire("movestart").fire("dragstart"),Y.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(Y){if(this._map.options.inertia){var oe=this._lastTime=+new Date,he=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(he),this._times.push(oe),this._prunePositions(oe)}this._map.fire("move",Y).fire("drag",Y)},_prunePositions:function(Y){for(;this._positions.length>1&&Y-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var Y=this._map.getSize().divideBy(2),oe=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=oe.subtract(Y).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(Y,oe){return Y-(Y-oe)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var Y=this._draggable._newPos.subtract(this._draggable._startPos),oe=this._offsetLimit;Y.x<oe.min.x&&(Y.x=this._viscousLimit(Y.x,oe.min.x)),Y.y<oe.min.y&&(Y.y=this._viscousLimit(Y.y,oe.min.y)),Y.x>oe.max.x&&(Y.x=this._viscousLimit(Y.x,oe.max.x)),Y.y>oe.max.y&&(Y.y=this._viscousLimit(Y.y,oe.max.y)),this._draggable._newPos=this._draggable._startPos.add(Y)}},_onPreDragWrap:function(){var Y=this._worldWidth,oe=Math.round(Y/2),he=this._initialWorldOffset,be=this._draggable._newPos.x,Pe=(be-oe+he)%Y+oe-he,Ne=(be+oe+he)%Y-oe-he,$e=Math.abs(Pe+he)<Math.abs(Ne+he)?Pe:Ne;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=$e},_onDragEnd:function(Y){var oe=this._map,he=oe.options,be=!he.inertia||Y.noInertia||this._times.length<2;if(oe.fire("dragend",Y),be)oe.fire("moveend");else{this._prunePositions(+new Date);var Pe=this._lastPos.subtract(this._positions[0]),Ne=(this._lastTime-this._times[0])/1e3,$e=he.easeLinearity,Ke=Pe.multiplyBy($e/Ne),tt=Ke.distanceTo([0,0]),mt=Math.min(he.inertiaMaxSpeed,tt),Rt=Ke.multiplyBy(mt/tt),rr=mt/(he.inertiaDeceleration*$e),Mr=Rt.multiplyBy(-rr/2).round();!Mr.x&&!Mr.y?oe.fire("moveend"):(Mr=oe._limitOffset(Mr,oe.options.maxBounds),C(function(){oe.panBy(Mr,{duration:rr,easeLinearity:$e,noMoveStart:!0,animate:!0})}))}}});Ir.addInitHook("addHandler","dragging",pye),Ir.mergeOptions({keyboard:!0,keyboardPanDelta:80});var fye=fu.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(Y){this._map=Y,this._setPanDelta(Y.options.keyboardPanDelta),this._setZoomDelta(Y.options.zoomDelta)},addHooks:function(){var Y=this._map._container;Y.tabIndex<=0&&(Y.tabIndex="0"),xr(Y,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),Vn(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 Y=document.body,oe=document.documentElement,he=Y.scrollTop||oe.scrollTop,be=Y.scrollLeft||oe.scrollLeft;this._map._container.focus(),window.scrollTo(be,he)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(Y){var oe=this._panKeys={},he=this.keyCodes,be,Pe;for(be=0,Pe=he.left.length;be<Pe;be++)oe[he.left[be]]=[-1*Y,0];for(be=0,Pe=he.right.length;be<Pe;be++)oe[he.right[be]]=[Y,0];for(be=0,Pe=he.down.length;be<Pe;be++)oe[he.down[be]]=[0,Y];for(be=0,Pe=he.up.length;be<Pe;be++)oe[he.up[be]]=[0,-1*Y]},_setZoomDelta:function(Y){var oe=this._zoomKeys={},he=this.keyCodes,be,Pe;for(be=0,Pe=he.zoomIn.length;be<Pe;be++)oe[he.zoomIn[be]]=Y;for(be=0,Pe=he.zoomOut.length;be<Pe;be++)oe[he.zoomOut[be]]=-Y},_addHooks:function(){xr(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){Vn(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(Y){if(!(Y.altKey||Y.ctrlKey||Y.metaKey)){var oe=Y.keyCode,he=this._map,be;if(oe in this._panKeys){if(!he._panAnim||!he._panAnim._inProgress)if(be=this._panKeys[oe],Y.shiftKey&&(be=W(be).multiplyBy(3)),he.options.maxBounds&&(be=he._limitOffset(W(be),he.options.maxBounds)),he.options.worldCopyJump){var Pe=he.wrapLatLng(he.unproject(he.project(he.getCenter()).add(be)));he.panTo(Pe)}else he.panBy(be)}else if(oe in this._zoomKeys)he.setZoom(he.getZoom()+(Y.shiftKey?3:1)*this._zoomKeys[oe]);else if(oe===27&&he._popup&&he._popup.options.closeOnEscapeKey)he.closePopup();else return;ag(Y)}}});Ir.addInitHook("addHandler","keyboard",fye),Ir.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var gye=fu.extend({addHooks:function(){xr(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){Vn(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(Y){var oe=Bve(Y),he=this._map.options.wheelDebounceTime;this._delta+=oe,this._lastMousePos=this._map.mouseEventToContainerPoint(Y),this._startTime||(this._startTime=+new Date);var be=Math.max(he-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),be),ag(Y)},_performZoom:function(){var Y=this._map,oe=Y.getZoom(),he=this._map.options.zoomSnap||0;Y._stop();var be=this._delta/(this._map.options.wheelPxPerZoomLevel*4),Pe=4*Math.log(2/(1+Math.exp(-Math.abs(be))))/Math.LN2,Ne=he?Math.ceil(Pe/he)*he:Pe,$e=Y._limitZoom(oe+(this._delta>0?Ne:-Ne))-oe;this._delta=0,this._startTime=null,$e&&(Y.options.scrollWheelZoom==="center"?Y.setZoom(oe+$e):Y.setZoomAround(this._lastMousePos,oe+$e))}});Ir.addInitHook("addHandler","scrollWheelZoom",gye);var ztr=600;Ir.mergeOptions({tapHold:_t.touchNative&&_t.safari&&_t.mobile,tapTolerance:15});var mye=fu.extend({addHooks:function(){xr(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Vn(this._map._container,"touchstart",this._onDown,this)},_onDown:function(Y){if(clearTimeout(this._holdTimeout),Y.touches.length===1){var oe=Y.touches[0];this._startPos=this._newPos=new z(oe.clientX,oe.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(xr(document,"touchend",Oo),xr(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",oe))},this),ztr),xr(document,"touchend touchcancel contextmenu",this._cancel,this),xr(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function Y(){Vn(document,"touchend",Oo),Vn(document,"touchend touchcancel",Y)},_cancel:function(){clearTimeout(this._holdTimeout),Vn(document,"touchend touchcancel contextmenu",this._cancel,this),Vn(document,"touchmove",this._onMove,this)},_onMove:function(Y){var oe=Y.touches[0];this._newPos=new z(oe.clientX,oe.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(Y,oe){var he=new MouseEvent(Y,{bubbles:!0,cancelable:!0,view:window,screenX:oe.screenX,screenY:oe.screenY,clientX:oe.clientX,clientY:oe.clientY});he._simulated=!0,oe.target.dispatchEvent(he)}});Ir.addInitHook("addHandler","tapHold",mye),Ir.mergeOptions({touchZoom:_t.touch,bounceAtZoomLimits:!0});var vye=fu.extend({addHooks:function(){br(this._map._container,"leaflet-touch-zoom"),xr(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){fi(this._map._container,"leaflet-touch-zoom"),Vn(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(Y){var oe=this._map;if(!(!Y.touches||Y.touches.length!==2||oe._animatingZoom||this._zooming)){var he=oe.mouseEventToContainerPoint(Y.touches[0]),be=oe.mouseEventToContainerPoint(Y.touches[1]);this._centerPoint=oe.getSize()._divideBy(2),this._startLatLng=oe.containerPointToLatLng(this._centerPoint),oe.options.touchZoom!=="center"&&(this._pinchStartLatLng=oe.containerPointToLatLng(he.add(be)._divideBy(2))),this._startDist=he.distanceTo(be),this._startZoom=oe.getZoom(),this._moved=!1,this._zooming=!0,oe._stop(),xr(document,"touchmove",this._onTouchMove,this),xr(document,"touchend touchcancel",this._onTouchEnd,this),Oo(Y)}},_onTouchMove:function(Y){if(!(!Y.touches||Y.touches.length!==2||!this._zooming)){var oe=this._map,he=oe.mouseEventToContainerPoint(Y.touches[0]),be=oe.mouseEventToContainerPoint(Y.touches[1]),Pe=he.distanceTo(be)/this._startDist;if(this._zoom=oe.getScaleZoom(Pe,this._startZoom),!oe.options.bounceAtZoomLimits&&(this._zoom<oe.getMinZoom()&&Pe<1||this._zoom>oe.getMaxZoom()&&Pe>1)&&(this._zoom=oe._limitZoom(this._zoom)),oe.options.touchZoom==="center"){if(this._center=this._startLatLng,Pe===1)return}else{var Ne=he._add(be)._divideBy(2)._subtract(this._centerPoint);if(Pe===1&&Ne.x===0&&Ne.y===0)return;this._center=oe.unproject(oe.project(this._pinchStartLatLng,this._zoom).subtract(Ne),this._zoom)}this._moved||(oe._moveStart(!0,!1),this._moved=!0),y(this._animRequest);var $e=a(oe._move,oe,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=C($e,this,!0),Oo(Y)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,y(this._animRequest),Vn(document,"touchmove",this._onTouchMove,this),Vn(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))}});Ir.addInitHook("addHandler","touchZoom",vye),Ir.BoxZoom=dye,Ir.DoubleClickZoom=hye,Ir.Drag=pye,Ir.Keyboard=fye,Ir.ScrollWheelZoom=gye,Ir.TapHold=mye,Ir.TouchZoom=vye,r.Bounds=_,r.Browser=_t,r.CRS=I,r.Canvas=sye,r.Circle=d9,r.CircleMarker=XP,r.Class=k,r.Control=oc,r.DivIcon=iye,r.DivOverlay=gu,r.DomEvent=itr,r.DomUtil=rtr,r.Draggable=Qh,r.Evented=q,r.FeatureGroup=yd,r.GeoJSON=xd,r.GridLayer=lC,r.Handler=fu,r.Icon=Ov,r.ImageOverlay=t3,r.LatLng=w,r.LatLngBounds=m,r.Layer=ac,r.LayerGroup=Lv,r.LineUtil=vtr,r.Map=Ir,r.Marker=ZP,r.Mixin=dtr,r.Path=Jh,r.Point=z,r.PolyUtil=htr,r.Polygon=Iv,r.Polyline=bd,r.Popup=r3,r.PosAnimation=zve,r.Projection=ytr,r.Rectangle=uye,r.Renderer=wd,r.SVG=uC,r.SVGOverlay=nye,r.TileLayer=Rv,r.Tooltip=n3,r.Transformation=Q,r.Util=D,r.VideoOverlay=rye,r.bind=a,r.bounds=A,r.canvas=lye,r.circle=Mtr,r.circleMarker=ktr,r.control=oC,r.divIcon=Ntr,r.extend=i,r.featureGroup=Ctr,r.geoJSON=tye,r.geoJson=Etr,r.gridLayer=Rtr,r.icon=_tr,r.imageOverlay=Ptr,r.latLng=v,r.latLngBounds=b,r.layerGroup=wtr,r.map=otr,r.marker=Str,r.point=W,r.polygon=Atr,r.polyline=Ttr,r.popup=Otr,r.rectangle=Btr,r.setOptions=p,r.stamp=l,r.svg=cye,r.svgOverlay=Ltr,r.tileLayer=oye,r.tooltip=Itr,r.transformation=J,r.version=n,r.videoOverlay=Dtr;var $tr=window.L;r.noConflict=function(){return window.L=$tr,this},window.L=r})})(K4,K4.exports);var Ire=K4.exports;const Rc=Ma(Ire);var PXe={exports:{}};function DXe(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}var Zp=1,Xp=2,t0=3,LXe=4,Q4=5,Nre=6378137,OXe=6356752314e-3,Rre=.0066943799901413165,L1=484813681109536e-20,vt=Math.PI/2,IXe=.16666666666666666,NXe=.04722222222222222,RXe=.022156084656084655,Et=1e-10,To=.017453292519943295,Fc=57.29577951308232,rn=Math.PI/4,O1=Math.PI*2,Di=3.14159265359,Ba={};Ba.greenwich=0,Ba.lisbon=-9.131906111111,Ba.paris=2.337229166667,Ba.bogota=-74.080916666667,Ba.madrid=-3.687938888889,Ba.rome=12.452333333333,Ba.bern=7.439583333333,Ba.jakarta=106.807719444444,Ba.ferro=-17.666666666667,Ba.brussels=4.367975,Ba.stockholm=18.058277777778,Ba.athens=23.7163375,Ba.oslo=10.722916666667;const FXe={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var Fre=/[\s_\-\/\(\)]/g;function ph(e,t){if(e[t])return e[t];for(var r=Object.keys(e),n=t.toLowerCase().replace(Fre,""),i=-1,o,a;++i<r.length;)if(o=r[i],a=o.toLowerCase().replace(Fre,""),a===n)return e[o]}function J4(e){var t={},r=e.split("+").map(function(s){return s.trim()}).filter(function(s){return s}).reduce(function(s,l){var c=l.split("=");return c.push(!0),s[c[0].toLowerCase()]=c[1],s},{}),n,i,o,a={proj:"projName",datum:"datumCode",rf:function(s){t.rf=parseFloat(s)},lat_0:function(s){t.lat0=s*To},lat_1:function(s){t.lat1=s*To},lat_2:function(s){t.lat2=s*To},lat_ts:function(s){t.lat_ts=s*To},lon_0:function(s){t.long0=s*To},lon_1:function(s){t.long1=s*To},lon_2:function(s){t.long2=s*To},alpha:function(s){t.alpha=parseFloat(s)*To},gamma:function(s){t.rectified_grid_angle=parseFloat(s)},lonc:function(s){t.longc=s*To},x_0:function(s){t.x0=parseFloat(s)},y_0:function(s){t.y0=parseFloat(s)},k_0:function(s){t.k0=parseFloat(s)},k:function(s){t.k0=parseFloat(s)},a:function(s){t.a=parseFloat(s)},b:function(s){t.b=parseFloat(s)},r:function(s){t.a=t.b=parseFloat(s)},r_a:function(){t.R_A=!0},zone:function(s){t.zone=parseInt(s,10)},south:function(){t.utmSouth=!0},towgs84:function(s){t.datum_params=s.split(",").map(function(l){return parseFloat(l)})},to_meter:function(s){t.to_meter=parseFloat(s)},units:function(s){t.units=s;var l=ph(FXe,s);l&&(t.to_meter=l.to_meter)},from_greenwich:function(s){t.from_greenwich=s*To},pm:function(s){var l=ph(Ba,s);t.from_greenwich=(l||parseFloat(s))*To},nadgrids:function(s){s==="@null"?t.datumCode="none":t.nadgrids=s},axis:function(s){var l="ewnsud";s.length===3&&l.indexOf(s.substr(0,1))!==-1&&l.indexOf(s.substr(1,1))!==-1&&l.indexOf(s.substr(2,1))!==-1&&(t.axis=s)},approx:function(){t.approx=!0}};for(n in r)i=r[n],n in a?(o=a[n],typeof o=="function"?o(i):t[o]=i):t[n]=i;return typeof t.datumCode=="string"&&t.datumCode!=="WGS84"&&(t.datumCode=t.datumCode.toLowerCase()),t}var I1=1,jre=2,Bre=3,NM=4,zre=5,e6=-1,jXe=/\s/,BXe=/[A-Za-z]/,zXe=/[A-Za-z84_]/,RM=/[,\]]/,$re=/[\d\.E\-\+]/;function Uu(e){if(typeof e!="string")throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=I1}Uu.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==NM)for(;jXe.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case I1:return this.neutral(e);case jre:return this.keyword(e);case NM:return this.quoted(e);case zre:return this.afterquote(e);case Bre:return this.number(e);case e6:return}},Uu.prototype.afterquote=function(e){if(e==='"'){this.word+='"',this.state=NM;return}if(RM.test(e)){this.word=this.word.trim(),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in afterquote yet, index '+this.place)},Uu.prototype.afterItem=function(e){if(e===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=I1;return}if(e==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=I1,this.currentObject=this.stack.pop(),this.currentObject||(this.state=e6);return}},Uu.prototype.number=function(e){if($re.test(e)){this.word+=e;return}if(RM.test(e)){this.word=parseFloat(this.word),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in number yet, index '+this.place)},Uu.prototype.quoted=function(e){if(e==='"'){this.state=zre;return}this.word+=e},Uu.prototype.keyword=function(e){if(zXe.test(e)){this.word+=e;return}if(e==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=I1;return}if(RM.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in keyword yet, index '+this.place)},Uu.prototype.neutral=function(e){if(BXe.test(e)){this.word=e,this.state=jre;return}if(e==='"'){this.word="",this.state=NM;return}if($re.test(e)){this.word=e,this.state=Bre;return}if(RM.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in neutral yet, index '+this.place)},Uu.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===e6)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function $Xe(e){var t=new Uu(e);return t.output()}function Wre(e,t,r){Array.isArray(t)&&(r.unshift(t),t=null);var n=t?{}:e,i=r.reduce(function(o,a){return r0(a,o),o},n);t&&(e[t]=i)}function r0(e,t){if(!Array.isArray(e)){t[e]=!0;return}var r=e.shift();if(r==="PARAMETER"&&(r=e.shift()),e.length===1){if(Array.isArray(e[0])){t[r]={},r0(e[0],t[r]);return}t[r]=e[0];return}if(!e.length){t[r]=!0;return}if(r==="TOWGS84"){t[r]=e;return}if(r==="AXIS"){r in t||(t[r]=[]),t[r].push(e);return}Array.isArray(r)||(t[r]={});var n;switch(r){case"UNIT":case"PRIMEM":case"VERT_DATUM":t[r]={name:e[0].toLowerCase(),convert:e[1]},e.length===3&&r0(e[2],t[r]);return;case"SPHEROID":case"ELLIPSOID":t[r]={name:e[0],a:e[1],rf:e[2]},e.length===4&&r0(e[3],t[r]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":e[0]=["name",e[0]],Wre(t,r,e);return;default:for(n=-1;++n<e.length;)if(!Array.isArray(e[n]))return r0(e,t[r]);return Wre(t,r,e)}}var WXe=.017453292519943295;function HXe(e,t){var r=t[0],n=t[1];!(r in e)&&n in e&&(e[r]=e[n],t.length===3&&(e[r]=t[2](e[r])))}function jc(e){return e*WXe}function UXe(e){if(e.type==="GEOGCS"?e.projName="longlat":e.type==="LOCAL_CS"?(e.projName="identity",e.local=!0):typeof e.PROJECTION=="object"?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var t="",r=0,n=e.AXIS.length;r<n;++r){var i=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][1].toLowerCase()];i[0].indexOf("north")!==-1||(i[0]==="y"||i[0]==="lat")&&i[1]==="north"?t+="n":i[0].indexOf("south")!==-1||(i[0]==="y"||i[0]==="lat")&&i[1]==="south"?t+="s":i[0].indexOf("east")!==-1||(i[0]==="x"||i[0]==="lon")&&i[1]==="east"?t+="e":(i[0].indexOf("west")!==-1||(i[0]==="x"||i[0]==="lon")&&i[1]==="west")&&(t+="w")}t.length===2&&(t+="u"),t.length===3&&(e.axis=t)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.UNIT.convert&&(e.type==="GEOGCS"?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var o=e.GEOGCS;e.type==="GEOGCS"&&(o=e),o&&(o.DATUM?e.datumCode=o.DATUM.name.toLowerCase():e.datumCode=o.name.toLowerCase(),e.datumCode.slice(0,2)==="d_"&&(e.datumCode=e.datumCode.slice(2)),(e.datumCode==="new_zealand_geodetic_datum_1949"||e.datumCode==="new_zealand_1949")&&(e.datumCode="nzgd49"),(e.datumCode==="wgs_1984"||e.datumCode==="world_geodetic_system_1984")&&(e.PROJECTION==="Mercator_Auxiliary_Sphere"&&(e.sphere=!0),e.datumCode="wgs84"),e.datumCode.slice(-6)==="_ferro"&&(e.datumCode=e.datumCode.slice(0,-6)),e.datumCode.slice(-8)==="_jakarta"&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(e.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),e.ellps.toLowerCase().slice(0,13)==="international"&&(e.ellps="intl"),e.a=o.DATUM.SPHEROID.a,e.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(e.datum_params=o.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),e.datumCode==="ch1903+"&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a);function a(c){var d=e.to_meter||1;return c*d}var s=function(c){return HXe(e,c)},l=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",jc],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",jc],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",jc],["lat0","latitude_of_origin",jc],["lat0","standard_parallel_1",jc],["lat1","standard_parallel_1",jc],["lat2","standard_parallel_2",jc],["azimuth","Azimuth"],["alpha","azimuth",jc],["srsCode","name"]];l.forEach(s),!e.long0&&e.longc&&(e.projName==="Albers_Conic_Equal_Area"||e.projName==="Lambert_Azimuthal_Equal_Area")&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&(e.projName==="Stereographic_South_Pole"||e.projName==="Polar Stereographic (variant B)")?(e.lat0=jc(e.lat1>0?90:-90),e.lat_ts=e.lat1):!e.lat_ts&&e.lat0&&e.projName==="Polar_Stereographic"&&(e.lat_ts=e.lat0,e.lat0=jc(e.lat0>0?90:-90))}function Hre(e){var t=$Xe(e),r=t.shift(),n=t.shift();t.unshift(["name",n]),t.unshift(["type",r]);var i={};return r0(t,i),UXe(i),i}function sa(e){var t=this;if(arguments.length===2){var r=arguments[1];typeof r=="string"?r.charAt(0)==="+"?sa[e]=J4(arguments[1]):sa[e]=Hre(arguments[1]):sa[e]=r}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(n){Array.isArray(n)?sa.apply(t,n):sa(n)});if(typeof e=="string"){if(e in sa)return sa[e]}else"EPSG"in e?sa["EPSG:"+e.EPSG]=e:"ESRI"in e?sa["ESRI:"+e.ESRI]=e:"IAU2000"in e?sa["IAU2000:"+e.IAU2000]=e:console.log(e);return}}DXe(sa);function GXe(e){return typeof e=="string"}function VXe(e){return e in sa}var YXe=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function qXe(e){return YXe.some(function(t){return e.indexOf(t)>-1})}var ZXe=["3857","900913","3785","102113"];function XXe(e){var t=ph(e,"authority");if(t){var r=ph(t,"epsg");return r&&ZXe.indexOf(r)>-1}}function KXe(e){var t=ph(e,"extension");if(t)return ph(t,"proj4")}function QXe(e){return e[0]==="+"}function JXe(e){if(GXe(e)){if(VXe(e))return sa[e];if(qXe(e)){var t=Hre(e);if(XXe(t))return sa["EPSG:3857"];var r=KXe(t);return r?J4(r):t}if(QXe(e))return J4(e)}else return e}function Ure(e,t){e=e||{};var r,n;if(!t)return e;for(n in t)r=t[n],r!==void 0&&(e[n]=r);return e}function Bc(e,t,r){var n=e*t;return r/Math.sqrt(1-n*n)}function N1(e){return e<0?-1:1}function Ft(e){return Math.abs(e)<=Di?e:e-N1(e)*O1}function ql(e,t,r){var n=e*r,i=.5*e;return n=Math.pow((1-n)/(1+n),i),Math.tan(.5*(vt-t))/n}function R1(e,t){for(var r=.5*e,n,i,o=vt-2*Math.atan(t),a=0;a<=15;a++)if(n=e*Math.sin(o),i=vt-2*Math.atan(t*Math.pow((1-n)/(1+n),r))-o,o+=i,Math.abs(i)<=1e-10)return o;return-9999}function eKe(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Bc(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function tKe(e){var t=e.x,r=e.y;if(r*Fc>90&&r*Fc<-90&&t*Fc>180&&t*Fc<-180)return null;var n,i;if(Math.abs(Math.abs(r)-vt)<=Et)return null;if(this.sphere)n=this.x0+this.a*this.k0*Ft(t-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(rn+.5*r));else{var o=Math.sin(r),a=ql(this.e,r,o);n=this.x0+this.a*this.k0*Ft(t-this.long0),i=this.y0-this.a*this.k0*Math.log(a)}return e.x=n,e.y=i,e}function rKe(e){var t=e.x-this.x0,r=e.y-this.y0,n,i;if(this.sphere)i=vt-2*Math.atan(Math.exp(-r/(this.a*this.k0)));else{var o=Math.exp(-r/(this.a*this.k0));if(i=R1(this.e,o),i===-9999)return null}return n=Ft(this.long0+t/(this.a*this.k0)),e.x=n,e.y=i,e}var nKe=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const iKe={init:eKe,forward:tKe,inverse:rKe,names:nKe};function oKe(){}function Gre(e){return e}var aKe=["longlat","identity"],sKe=[iKe,{init:oKe,forward:Gre,inverse:Gre,names:aKe}],FM={},jM=[];function Vre(e,t){var r=jM.length;return e.names?(jM[r]=e,e.names.forEach(function(n){FM[n.toLowerCase()]=r}),this):(console.log(t),!0)}function lKe(e){if(!e)return!1;var t=e.toLowerCase();if(typeof FM[t]!="undefined"&&jM[FM[t]])return jM[FM[t]]}function cKe(){sKe.forEach(Vre)}const uKe={start:cKe,add:Vre,get:lKe};var lr={};lr.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},lr.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},lr.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},lr.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},lr.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},lr.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},lr.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},lr.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},lr.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},lr.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},lr.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},lr.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},lr.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},lr.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},lr.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},lr.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},lr.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},lr.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},lr.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},lr.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},lr.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},lr.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},lr.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},lr.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},lr.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},lr.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},lr.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},lr.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},lr.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},lr.hough={a:6378270,rf:297,ellipseName:"Hough"},lr.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},lr.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lr.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},lr.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},lr.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},lr.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},lr.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},lr.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},lr.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},lr.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},lr.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},lr.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var dKe=lr.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};lr.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function hKe(e,t,r,n){var i=e*e,o=t*t,a=(i-o)/i,s=0;n?(e*=1-a*(IXe+a*(NXe+a*RXe)),i=e*e,a=0):s=Math.sqrt(a);var l=(i-o)/o;return{es:a,e:s,ep2:l}}function pKe(e,t,r,n,i){if(!e){var o=ph(lr,n);o||(o=dKe),e=o.a,t=o.b,r=o.rf}return r&&!t&&(t=(1-1/r)*e),(r===0||Math.abs(e-t)<Et)&&(i=!0,t=e),{a:e,b:t,rf:r,sphere:i}}var Yi={};Yi.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Yi.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Yi.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Yi.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Yi.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Yi.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Yi.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Yi.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},Yi.militargeographische_institut={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},Yi.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Yi.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Yi.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Yi.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Yi.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Yi.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Yi.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Yi.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Yi.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function fKe(e,t,r,n,i,o,a){var s={};return e===void 0||e==="none"?s.datum_type=Q4:s.datum_type=LXe,t&&(s.datum_params=t.map(parseFloat),(s.datum_params[0]!==0||s.datum_params[1]!==0||s.datum_params[2]!==0)&&(s.datum_type=Zp),s.datum_params.length>3&&(s.datum_params[3]!==0||s.datum_params[4]!==0||s.datum_params[5]!==0||s.datum_params[6]!==0)&&(s.datum_type=Xp,s.datum_params[3]*=L1,s.datum_params[4]*=L1,s.datum_params[5]*=L1,s.datum_params[6]=s.datum_params[6]/1e6+1)),a&&(s.datum_type=t0,s.grids=a),s.a=r,s.b=n,s.es=i,s.ep2=o,s}var Yre={};function gKe(e,t){var r=new DataView(t),n=yKe(r),i=bKe(r,n),o=xKe(r,i,n),a={header:i,subgrids:o};return Yre[e]=a,a}function mKe(e){if(e===void 0)return null;var t=e.split(",");return t.map(vKe)}function vKe(e){if(e.length===0)return null;var t=e[0]==="@";return t&&(e=e.slice(1)),e==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:Yre[e]||null,isNull:!1}}function n0(e){return e/3600*Math.PI/180}function yKe(e){var t=e.getInt32(8,!1);return t===11?!1:(t=e.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function bKe(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:t6(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}function t6(e,t,r){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,r)))}function xKe(e,t,r){for(var n=176,i=[],o=0;o<t.nSubgrids;o++){var a=CKe(e,n,r),s=_Ke(e,n,a,r),l=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),c=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);i.push({ll:[n0(a.lowerLongitude),n0(a.lowerLatitude)],del:[n0(a.longitudeInterval),n0(a.latitudeInterval)],lim:[l,c],count:a.gridNodeCount,cvs:wKe(s)}),n+=176+a.gridNodeCount*16}return i}function wKe(e){return e.map(function(t){return[n0(t.longitudeShift),n0(t.latitudeShift)]})}function CKe(e,t,r){return{name:t6(e,t+8,t+16).trim(),parent:t6(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,r),upperLatitude:e.getFloat64(t+88,r),lowerLongitude:e.getFloat64(t+104,r),upperLongitude:e.getFloat64(t+120,r),latitudeInterval:e.getFloat64(t+136,r),longitudeInterval:e.getFloat64(t+152,r),gridNodeCount:e.getInt32(t+168,r)}}function _Ke(e,t,r,n){for(var i=t+176,o=16,a=[],s=0;s<r.gridNodeCount;s++){var l={latitudeShift:e.getFloat32(i+s*o,n),longitudeShift:e.getFloat32(i+s*o+4,n),latitudeAccuracy:e.getFloat32(i+s*o+8,n),longitudeAccuracy:e.getFloat32(i+s*o+12,n)};a.push(l)}return a}function zc(e,t){if(!(this instanceof zc))return new zc(e);t=t||function(c){if(c)throw c};var r=JXe(e);if(typeof r!="object"){t(e);return}var n=zc.projections.get(r.projName);if(!n){t(e);return}if(r.datumCode&&r.datumCode!=="none"){var i=ph(Yi,r.datumCode);i&&(r.datum_params=r.datum_params||(i.towgs84?i.towgs84.split(","):null),r.ellps=i.ellipse,r.datumName=i.datumName?i.datumName:r.datumCode)}r.k0=r.k0||1,r.axis=r.axis||"enu",r.ellps=r.ellps||"wgs84",r.lat1=r.lat1||r.lat0;var o=pKe(r.a,r.b,r.rf,r.ellps,r.sphere),a=hKe(o.a,o.b,o.rf,r.R_A),s=mKe(r.nadgrids),l=r.datum||fKe(r.datumCode,r.datum_params,o.a,o.b,a.es,a.ep2,s);Ure(this,r),Ure(this,n),this.a=o.a,this.b=o.b,this.rf=o.rf,this.sphere=o.sphere,this.es=a.es,this.e=a.e,this.ep2=a.ep2,this.datum=l,this.init(),t(null,this)}zc.projections=uKe,zc.projections.start();function SKe(e,t){return e.datum_type!==t.datum_type||e.a!==t.a||Math.abs(e.es-t.es)>5e-11?!1:e.datum_type===Zp?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type===Xp?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]:!0}function qre(e,t,r){var n=e.x,i=e.y,o=e.z?e.z:0,a,s,l,c;if(i<-vt&&i>-1.001*vt)i=-vt;else if(i>vt&&i<1.001*vt)i=vt;else{if(i<-vt)return{x:-1/0,y:-1/0,z:e.z};if(i>vt)return{x:1/0,y:1/0,z:e.z}}return n>Math.PI&&(n-=2*Math.PI),s=Math.sin(i),c=Math.cos(i),l=s*s,a=r/Math.sqrt(1-t*l),{x:(a+o)*c*Math.cos(n),y:(a+o)*c*Math.sin(n),z:(a*(1-t)+o)*s}}function Zre(e,t,r,n){var i=1e-12,o=i*i,a=30,s,l,c,d,h,u,g,f,p,x,S,j,U,B=e.x,R=e.y,E=e.z?e.z:0,N,M,$;if(s=Math.sqrt(B*B+R*R),l=Math.sqrt(B*B+R*R+E*E),s/r<i){if(N=0,l/r<i)return M=vt,$=-n,{x:e.x,y:e.y,z:e.z}}else N=Math.atan2(R,B);c=E/l,d=s/l,h=1/Math.sqrt(1-t*(2-t)*d*d),f=d*(1-t)*h,p=c*h,U=0;do U++,g=r/Math.sqrt(1-t*p*p),$=s*f+E*p-g*(1-t*p*p),u=t*g/(g+$),h=1/Math.sqrt(1-u*(2-u)*d*d),x=d*(1-u)*h,S=c*h,j=S*f-x*p,f=x,p=S;while(j*j>o&&U<a);return M=Math.atan(S/Math.abs(x)),{x:N,y:M,z:$}}function kKe(e,t,r){if(t===Zp)return{x:e.x+r[0],y:e.y+r[1],z:e.z+r[2]};if(t===Xp){var n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=r[5],c=r[6];return{x:c*(e.x-l*e.y+s*e.z)+n,y:c*(l*e.x+e.y-a*e.z)+i,z:c*(-s*e.x+a*e.y+e.z)+o}}}function MKe(e,t,r){if(t===Zp)return{x:e.x-r[0],y:e.y-r[1],z:e.z-r[2]};if(t===Xp){var n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=r[5],c=r[6],d=(e.x-n)/c,h=(e.y-i)/c,u=(e.z-o)/c;return{x:d+l*h-s*u,y:-l*d+h+a*u,z:s*d-a*h+u}}}function BM(e){return e===Zp||e===Xp}function TKe(e,t,r){if(SKe(e,t)||e.datum_type===Q4||t.datum_type===Q4)return r;var n=e.a,i=e.es;if(e.datum_type===t0){var o=Xre(e,!1,r);if(o!==0)return;n=Nre,i=Rre}var a=t.a,s=t.b,l=t.es;if(t.datum_type===t0&&(a=Nre,s=OXe,l=Rre),i===l&&n===a&&!BM(e.datum_type)&&!BM(t.datum_type))return r;if(r=qre(r,i,n),BM(e.datum_type)&&(r=kKe(r,e.datum_type,e.datum_params)),BM(t.datum_type)&&(r=MKe(r,t.datum_type,t.datum_params)),r=Zre(r,l,a,s),t.datum_type===t0){var c=Xre(t,!0,r);if(c!==0)return}return r}function Xre(e,t,r){if(e.grids===null||e.grids.length===0)return console.log("Grid shift grids not found"),-1;var n={x:-r.x,y:r.y},i={x:Number.NaN,y:Number.NaN},o=[];e:for(var a=0;a<e.grids.length;a++){var s=e.grids[a];if(o.push(s.name),s.isNull){i=n;break}if(s.grid===null){if(s.mandatory)return console.log("Unable to find mandatory grid '"+s.name+"'"),-1;continue}for(var l=s.grid.subgrids,c=0,d=l.length;c<d;c++){var h=l[c],u=(Math.abs(h.del[1])+Math.abs(h.del[0]))/1e4,g=h.ll[0]-u,f=h.ll[1]-u,p=h.ll[0]+(h.lim[0]-1)*h.del[0]+u,x=h.ll[1]+(h.lim[1]-1)*h.del[1]+u;if(!(f>n.y||g>n.x||x<n.y||p<n.x)&&(i=AKe(n,t,h),!isNaN(i.x)))break e}}return isNaN(i.x)?(console.log("Failed to find a grid shift table for location '"+-n.x*Fc+" "+n.y*Fc+" tried: '"+o+"'"),-1):(r.x=-i.x,r.y=i.y,0)}function AKe(e,t,r){var n={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return n;var i={x:e.x,y:e.y};i.x-=r.ll[0],i.y-=r.ll[1],i.x=Ft(i.x-Math.PI)+Math.PI;var o=Kre(i,r);if(t){if(isNaN(o.x))return n;o.x=i.x-o.x,o.y=i.y-o.y;var a=9,s=1e-12,l,c;do{if(c=Kre(o,r),isNaN(c.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}l={x:i.x-(c.x+o.x),y:i.y-(c.y+o.y)},o.x+=l.x,o.y+=l.y}while(a--&&Math.abs(l.x)>s&&Math.abs(l.y)>s);if(a<0)return console.log("Inverse grid shift iterator failed to converge."),n;n.x=Ft(o.x+r.ll[0]),n.y=o.y+r.ll[1]}else isNaN(o.x)||(n.x=e.x+o.x,n.y=e.y+o.y);return n}function Kre(e,t){var r={x:e.x/t.del[0],y:e.y/t.del[1]},n={x:Math.floor(r.x),y:Math.floor(r.y)},i={x:r.x-1*n.x,y:r.y-1*n.y},o={x:Number.NaN,y:Number.NaN},a;if(n.x<0||n.x>=t.lim[0]||n.y<0||n.y>=t.lim[1])return o;a=n.y*t.lim[0]+n.x;var s={x:t.cvs[a][0],y:t.cvs[a][1]};a++;var l={x:t.cvs[a][0],y:t.cvs[a][1]};a+=t.lim[0];var c={x:t.cvs[a][0],y:t.cvs[a][1]};a--;var d={x:t.cvs[a][0],y:t.cvs[a][1]},h=i.x*i.y,u=i.x*(1-i.y),g=(1-i.x)*(1-i.y),f=(1-i.x)*i.y;return o.x=g*s.x+u*l.x+f*d.x+h*c.x,o.y=g*s.y+u*l.y+f*d.y+h*c.y,o}function Qre(e,t,r){var n=r.x,i=r.y,o=r.z||0,a,s,l,c={};for(l=0;l<3;l++)if(!(t&&l===2&&r.z===void 0))switch(l===0?(a=n,"ew".indexOf(e.axis[l])!==-1?s="x":s="y"):l===1?(a=i,"ns".indexOf(e.axis[l])!==-1?s="y":s="x"):(a=o,s="z"),e.axis[l]){case"e":c[s]=a;break;case"w":c[s]=-a;break;case"n":c[s]=a;break;case"s":c[s]=-a;break;case"u":r[s]!==void 0&&(c.z=a);break;case"d":r[s]!==void 0&&(c.z=-a);break;default:return null}return c}function Jre(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function EKe(e){ene(e.x),ene(e.y)}function ene(e){if(typeof Number.isFinite=="function"){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if(typeof e!="number"||e!==e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function PKe(e,t){return(e.datum.datum_type===Zp||e.datum.datum_type===Xp||e.datum.datum_type===t0)&&t.datumCode!=="WGS84"||(t.datum.datum_type===Zp||t.datum.datum_type===Xp||t.datum.datum_type===t0)&&e.datumCode!=="WGS84"}function zM(e,t,r,n){var i;Array.isArray(r)?r=Jre(r):r={x:r.x,y:r.y,z:r.z,m:r.m};var o=r.z!==void 0;if(EKe(r),e.datum&&t.datum&&PKe(e,t)&&(i=new zc("WGS84"),r=zM(e,i,r,n),e=i),n&&e.axis!=="enu"&&(r=Qre(e,!1,r)),e.projName==="longlat")r={x:r.x*To,y:r.y*To,z:r.z||0};else if(e.to_meter&&(r={x:r.x*e.to_meter,y:r.y*e.to_meter,z:r.z||0}),r=e.inverse(r),!r)return;if(e.from_greenwich&&(r.x+=e.from_greenwich),r=TKe(e.datum,t.datum,r),!!r)return t.from_greenwich&&(r={x:r.x-t.from_greenwich,y:r.y,z:r.z||0}),t.projName==="longlat"?r={x:r.x*Fc,y:r.y*Fc,z:r.z||0}:(r=t.forward(r),t.to_meter&&(r={x:r.x/t.to_meter,y:r.y/t.to_meter,z:r.z||0})),n&&t.axis!=="enu"?Qre(t,!0,r):(r&&!o&&delete r.z,r)}var tne=zc("WGS84");function r6(e,t,r,n){var i,o,a;return Array.isArray(r)?(i=zM(e,t,r,n)||{x:NaN,y:NaN},r.length>2?typeof e.name!="undefined"&&e.name==="geocent"||typeof t.name!="undefined"&&t.name==="geocent"?typeof i.z=="number"?[i.x,i.y,i.z].concat(r.splice(3)):[i.x,i.y,r[2]].concat(r.splice(3)):[i.x,i.y].concat(r.splice(2)):[i.x,i.y]):(o=zM(e,t,r,n),a=Object.keys(r),a.length===2||a.forEach(function(s){if(typeof e.name!="undefined"&&e.name==="geocent"||typeof t.name!="undefined"&&t.name==="geocent"){if(s==="x"||s==="y"||s==="z")return}else if(s==="x"||s==="y")return;o[s]=r[s]}),o)}function rne(e){return e instanceof zc?e:e.oProj?e.oProj:zc(e)}function _s(e,t,r){e=rne(e);var n=!1,i;return typeof t=="undefined"?(t=e,e=tne,n=!0):(typeof t.x!="undefined"||Array.isArray(t))&&(r=t,t=e,e=tne,n=!0),t=rne(t),r?r6(e,t,r):(i={forward:function(o,a){return r6(e,t,o,a)},inverse:function(o,a){return r6(t,e,o,a)}},n&&(i.oProj=t),i)}var nne=6,ine="AJSAJS",one="AFAFAF",i0=65,za=73,al=79,F1=86,j1=90;const DKe={forward:ane,inverse:LKe,toPoint:sne};function ane(e,t){return t=t||5,NKe(OKe({lat:e[1],lon:e[0]}),t)}function LKe(e){var t=i6(une(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function sne(e){var t=i6(une(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function n6(e){return e*(Math.PI/180)}function lne(e){return 180*(e/Math.PI)}function OKe(e){var t=e.lat,r=e.lon,n=6378137,i=.00669438,o=.9996,a,s,l,c,d,h,u,g=n6(t),f=n6(r),p,x;x=Math.floor((r+180)/6)+1,r===180&&(x=60),t>=56&&t<64&&r>=3&&r<12&&(x=32),t>=72&&t<84&&(r>=0&&r<9?x=31:r>=9&&r<21?x=33:r>=21&&r<33?x=35:r>=33&&r<42&&(x=37)),a=(x-1)*6-180+3,p=n6(a),s=i/(1-i),l=n/Math.sqrt(1-i*Math.sin(g)*Math.sin(g)),c=Math.tan(g)*Math.tan(g),d=s*Math.cos(g)*Math.cos(g),h=Math.cos(g)*(f-p),u=n*((1-i/4-3*i*i/64-5*i*i*i/256)*g-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*g)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*g)-35*i*i*i/3072*Math.sin(6*g));var S=o*l*(h+(1-c+d)*h*h*h/6+(5-18*c+c*c+72*d-58*s)*h*h*h*h*h/120)+5e5,j=o*(u+l*Math.tan(g)*(h*h/2+(5-c+9*d+4*d*d)*h*h*h*h/24+(61-58*c+c*c+600*d-330*s)*h*h*h*h*h*h/720));return t<0&&(j+=1e7),{northing:Math.round(j),easting:Math.round(S),zoneNumber:x,zoneLetter:IKe(t)}}function i6(e){var t=e.northing,r=e.easting,n=e.zoneLetter,i=e.zoneNumber;if(i<0||i>60)return null;var o=.9996,a=6378137,s=.00669438,l,c=(1-Math.sqrt(1-s))/(1+Math.sqrt(1-s)),d,h,u,g,f,p,x,S,j,U=r-5e5,B=t;n<"N"&&(B-=1e7),x=(i-1)*6-180+3,l=s/(1-s),p=B/o,S=p/(a*(1-s/4-3*s*s/64-5*s*s*s/256)),j=S+(3*c/2-27*c*c*c/32)*Math.sin(2*S)+(21*c*c/16-55*c*c*c*c/32)*Math.sin(4*S)+151*c*c*c/96*Math.sin(6*S),d=a/Math.sqrt(1-s*Math.sin(j)*Math.sin(j)),h=Math.tan(j)*Math.tan(j),u=l*Math.cos(j)*Math.cos(j),g=a*(1-s)/Math.pow(1-s*Math.sin(j)*Math.sin(j),1.5),f=U/(d*o);var R=j-d*Math.tan(j)/g*(f*f/2-(5+3*h+10*u-4*u*u-9*l)*f*f*f*f/24+(61+90*h+298*u+45*h*h-252*l-3*u*u)*f*f*f*f*f*f/720);R=lne(R);var E=(f-(1+2*h+u)*f*f*f/6+(5-2*u+28*h-3*u*u+8*l+24*h*h)*f*f*f*f*f/120)/Math.cos(j);E=x+lne(E);var N;if(e.accuracy){var M=i6({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});N={top:M.lat,right:M.lon,bottom:R,left:E}}else N={lat:R,lon:E};return N}function IKe(e){var t="Z";return 84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C"),t}function NKe(e,t){var r="00000"+e.easting,n="00000"+e.northing;return e.zoneNumber+e.zoneLetter+RKe(e.easting,e.northing,e.zoneNumber)+r.substr(r.length-5,t)+n.substr(n.length-5,t)}function RKe(e,t,r){var n=cne(r),i=Math.floor(e/1e5),o=Math.floor(t/1e5)%20;return FKe(i,o,n)}function cne(e){var t=e%nne;return t===0&&(t=nne),t}function FKe(e,t,r){var n=r-1,i=ine.charCodeAt(n),o=one.charCodeAt(n),a=i+e-1,s=o+t,l=!1;a>j1&&(a=a-j1+i0-1,l=!0),(a===za||i<za&&a>za||(a>za||i<za)&&l)&&a++,(a===al||i<al&&a>al||(a>al||i<al)&&l)&&(a++,a===za&&a++),a>j1&&(a=a-j1+i0-1),s>F1?(s=s-F1+i0-1,l=!0):l=!1,(s===za||o<za&&s>za||(s>za||o<za)&&l)&&s++,(s===al||o<al&&s>al||(s>al||o<al)&&l)&&(s++,s===za&&s++),s>F1&&(s=s-F1+i0-1);var c=String.fromCharCode(a)+String.fromCharCode(s);return c}function une(e){if(e&&e.length===0)throw"MGRSPoint coverting from nothing";for(var t=e.length,r=null,n="",i,o=0;!/[A-Z]/.test(i=e.charAt(o));){if(o>=2)throw"MGRSPoint bad conversion from: "+e;n+=i,o++}var a=parseInt(n,10);if(o===0||o+3>t)throw"MGRSPoint bad conversion from: "+e;var s=e.charAt(o++);if(s<="A"||s==="B"||s==="Y"||s>="Z"||s==="I"||s==="O")throw"MGRSPoint zone letter "+s+" not handled: "+e;r=e.substring(o,o+=2);for(var l=cne(a),c=jKe(r.charAt(0),l),d=BKe(r.charAt(1),l);d<zKe(s);)d+=2e6;var h=t-o;if(h%2!==0)throw`MGRSPoint has to have an even number
|
|
1162
1162
|
of digits after the zone letter and two 100km letters - front
|
|
1163
1163
|
half for easting meters, second half for
|
|
1164
|
-
northing meters`+e;var u=h/2,g=0,f=0,p,x,S,j,U;return u>0&&(p=1e5/Math.pow(10,u),x=e.substring(o,o+u),g=parseFloat(x)*p,S=e.substring(o+u),f=parseFloat(S)*p),j=g+c,U=f+d,{easting:j,northing:U,zoneLetter:s,zoneNumber:a,accuracy:p}}function jKe(e,t){for(var r=ine.charCodeAt(t-1),n=1e5,i=!1;r!==e.charCodeAt(0);){if(r++,r===za&&r++,r===al&&r++,r>j1){if(i)throw"Bad character: "+e;r=i0,i=!0}n+=1e5}return n}function BKe(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var r=one.charCodeAt(t-1),n=0,i=!1;r!==e.charCodeAt(0);){if(r++,r===za&&r++,r===al&&r++,r>F1){if(i)throw"Bad character: "+e;r=i0,i=!0}n+=1e5}return n}function zKe(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function o0(e,t,r){if(!(this instanceof o0))return new o0(e,t,r);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e=="object")this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e=="string"&&typeof t=="undefined"){var n=e.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=e,this.y=t,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}o0.fromMGRS=function(e){return new o0(sne(e))},o0.prototype.toMGRS=function(e){return ane([this.x,this.y],e)};var $Ke=1,WKe=.25,dne=.046875,hne=.01953125,pne=.01068115234375,HKe=.75,UKe=.46875,GKe=.013020833333333334,VKe=.007120768229166667,YKe=.3645833333333333,qKe=.005696614583333333,ZKe=.3076171875;function fne(e){var t=[];t[0]=$Ke-e*(WKe+e*(dne+e*(hne+e*pne))),t[1]=e*(HKe-e*(dne+e*(hne+e*pne)));var r=e*e;return t[2]=r*(UKe-e*(GKe+e*VKe)),r*=e,t[3]=r*(YKe-e*qKe),t[4]=r*e*ZKe,t}function $M(e,t,r,n){return r*=t,t*=t,n[0]*e-r*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var XKe=20;function gne(e,t,r){for(var n=1/(1-t),i=e,o=XKe;o;--o){var a=Math.sin(i),s=1-t*a*a;if(s=($M(i,a,Math.cos(i),r)-e)*(s*Math.sqrt(s))*n,i-=s,Math.abs(s)<Et)return i}return i}function KKe(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=fne(this.es),this.ml0=$M(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function QKe(e){var t=e.x,r=e.y,n=Ft(t-this.long0),i,o,a,s=Math.sin(r),l=Math.cos(r);if(this.es){var d=l*n,h=Math.pow(d,2),u=this.ep2*Math.pow(l,2),g=Math.pow(u,2),f=Math.abs(l)>Et?Math.tan(r):0,p=Math.pow(f,2),x=Math.pow(p,2);i=1-this.es*Math.pow(s,2),d=d/Math.sqrt(i);var S=$M(r,s,l,this.en);o=this.a*(this.k0*d*(1+h/6*(1-p+u+h/20*(5-18*p+x+14*u-58*p*u+h/42*(61+179*x-x*p-479*p)))))+this.x0,a=this.a*(this.k0*(S-this.ml0+s*n*d/2*(1+h/12*(5-p+9*u+4*g+h/30*(61+x-58*p+270*u-330*p*u+h/56*(1385+543*x-x*p-3111*p))))))+this.y0}else{var c=l*Math.sin(n);if(Math.abs(Math.abs(c)-1)<Et)return 93;if(o=.5*this.a*this.k0*Math.log((1+c)/(1-c))+this.x0,a=l*Math.cos(n)/Math.sqrt(1-Math.pow(c,2)),c=Math.abs(a),c>=1){if(c-1>Et)return 93;a=0}else a=Math.acos(a);r<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return e.x=o,e.y=a,e}function JKe(e){var t,r,n,i,o=(e.x-this.x0)*(1/this.a),a=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+a/this.k0,r=gne(t,this.es,this.en),Math.abs(r)<vt){var h=Math.sin(r),u=Math.cos(r),g=Math.abs(u)>Et?Math.tan(r):0,f=this.ep2*Math.pow(u,2),p=Math.pow(f,2),x=Math.pow(g,2),S=Math.pow(x,2);t=1-this.es*Math.pow(h,2);var j=o*Math.sqrt(t)/this.k0,U=Math.pow(j,2);t=t*g,n=r-t*U/(1-this.es)*.5*(1-U/12*(5+3*x-9*f*x+f-4*p-U/30*(61+90*x-252*f*x+45*S+46*f-U/56*(1385+3633*x+4095*S+1574*S*x)))),i=Ft(this.long0+j*(1-U/6*(1+2*x+f-U/20*(5+28*x+24*S+8*f*x+6*f-U/42*(61+662*x+1320*S+720*S*x))))/u)}else n=vt*N1(a),i=0;else{var s=Math.exp(o/this.k0),l=.5*(s-1/s),c=this.lat0+a/this.k0,d=Math.cos(c);t=Math.sqrt((1-Math.pow(d,2))/(1+Math.pow(l,2))),n=Math.asin(t),a<0&&(n=-n),l===0&&d===0?i=0:i=Ft(Math.atan2(l,d)+this.long0)}return e.x=i,e.y=n,e}var eQe=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const WM={init:KKe,forward:QKe,inverse:JKe,names:eQe};function mne(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function sl(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),n=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}function tQe(e){var t=1+e,r=t-1;return r===0?e:e*Math.log(t)/r}function rQe(e){var t=Math.abs(e);return t=tQe(t*(1+t/(sl(1,t)+1))),e<0?-t:t}function o6(e,t){for(var r=2*Math.cos(2*t),n=e.length-1,i=e[n],o=0,a;--n>=0;)a=-o+r*i+e[n],o=i,i=a;return t+a*Math.sin(2*t)}function nQe(e,t){for(var r=2*Math.cos(t),n=e.length-1,i=e[n],o=0,a;--n>=0;)a=-o+r*i+e[n],o=i,i=a;return Math.sin(t)*a}function iQe(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function vne(e,t,r){for(var n=Math.sin(t),i=Math.cos(t),o=mne(r),a=iQe(r),s=2*i*a,l=-2*n*o,c=e.length-1,d=e[c],h=0,u=0,g=0,f,p;--c>=0;)f=u,p=h,u=d,h=g,d=-f+s*u-l*h+e[c],g=-p+l*u+s*h;return s=n*a,l=i*o,[s*d-l*g,s*g+l*d]}function oQe(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(WM.init.apply(this),this.forward=WM.forward,this.inverse=WM.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),r=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),r=r*t,this.cgb[1]=r*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),r=r*t,this.cgb[2]=r*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=r*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),r=r*t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(-12/5+t*(-24832/14175))),r=r*t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),r=r*t,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=r*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=r*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),r=r*t,this.utg[2]=r*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=r*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),r=r*t,this.utg[3]=r*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=r*(49561/161280+t*(-179/168+t*(6601661/7257600))),r=r*t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r=r*t,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=r*(212378941/319334400);var n=o6(this.cbg,this.lat0);this.Zb=-this.Qn*(n+nQe(this.gtu,2*n))}function aQe(e){var t=Ft(e.x-this.long0),r=e.y;r=o6(this.cbg,r);var n=Math.sin(r),i=Math.cos(r),o=Math.sin(t),a=Math.cos(t);r=Math.atan2(n,a*i),t=Math.atan2(o*i,sl(n,i*a)),t=rQe(Math.tan(t));var s=vne(this.gtu,2*r,2*t);r=r+s[0],t=t+s[1];var l,c;return Math.abs(t)<=2.623395162778?(l=this.a*(this.Qn*t)+this.x0,c=this.a*(this.Qn*r+this.Zb)+this.y0):(l=1/0,c=1/0),e.x=l,e.y=c,e}function sQe(e){var t=(e.x-this.x0)*(1/this.a),r=(e.y-this.y0)*(1/this.a);r=(r-this.Zb)/this.Qn,t=t/this.Qn;var n,i;if(Math.abs(t)<=2.623395162778){var o=vne(this.utg,2*r,2*t);r=r+o[0],t=t+o[1],t=Math.atan(mne(t));var a=Math.sin(r),s=Math.cos(r),l=Math.sin(t),c=Math.cos(t);r=Math.atan2(a*c,sl(l,c*s)),t=Math.atan2(l,c*s),n=Ft(t+this.long0),i=o6(this.cgb,r)}else n=1/0,i=1/0;return e.x=n,e.y=i,e}var lQe=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const HM={init:oQe,forward:aQe,inverse:sQe,names:lQe};function cQe(e,t){if(e===void 0){if(e=Math.floor((Ft(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var uQe="etmerc";function dQe(){var e=cQe(this.zone,this.long0);if(e===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*To,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,HM.init.apply(this),this.forward=HM.forward,this.inverse=HM.inverse}var hQe=["Universal Transverse Mercator System","utm"];const pQe={init:dQe,names:hQe,dependsOn:uQe};function a6(e,t){return Math.pow((1-e)/(1+e),t)}var fQe=20;function gQe(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+rn)/(Math.pow(Math.tan(.5*this.lat0+rn),this.C)*a6(this.e*e,this.ratexp))}function mQe(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+rn),this.C)*a6(this.e*Math.sin(r),this.ratexp))-vt,e.x=this.C*t,e}function vQe(e){for(var t=1e-14,r=e.x/this.C,n=e.y,i=Math.pow(Math.tan(.5*n+rn)/this.K,1/this.C),o=fQe;o>0&&(n=2*Math.atan(i*a6(this.e*Math.sin(e.y),-.5*this.e))-vt,!(Math.abs(n-e.y)<t));--o)e.y=n;return o?(e.x=r,e.y=n,e):null}var yQe=["gauss"];const s6={init:gQe,forward:mQe,inverse:vQe,names:yQe};function bQe(){s6.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function xQe(e){var t,r,n,i;return e.x=Ft(e.x-this.long0),s6.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),n=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*n),e.x=i*r*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*r*n),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function wQe(e){var t,r,n,i,o;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,o=sl(e.x,e.y)){var a=2*Math.atan2(o,this.R2);t=Math.sin(a),r=Math.cos(a),i=Math.asin(r*this.sinc0+e.y*t*this.cosc0/o),n=Math.atan2(e.x*t,o*this.cosc0*r-e.y*this.sinc0*t)}else i=this.phic0,n=0;return e.x=n,e.y=i,s6.inverse.apply(this,[e]),e.x=Ft(e.x+this.long0),e}var CQe=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const _Qe={init:bQe,forward:xQe,inverse:wQe,names:CQe};function SQe(e,t,r){return t*=r,Math.tan(.5*(vt+e))*Math.pow((1-t)/(1+t),.5*r)}function kQe(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Et&&(this.k0=.5*(1+N1(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Et&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Et&&Math.abs(Math.cos(this.lat_ts))>Et&&(this.k0=.5*this.cons*Bc(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/ql(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Bc(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-vt,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function MQe(e){var t=e.x,r=e.y,n=Math.sin(r),i=Math.cos(r),o,a,s,l,c,d,h=Ft(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=Et&&Math.abs(r+this.lat0)<=Et?(e.x=NaN,e.y=NaN,e):this.sphere?(o=2*this.k0/(1+this.sinlat0*n+this.coslat0*i*Math.cos(h)),e.x=this.a*o*i*Math.sin(h)+this.x0,e.y=this.a*o*(this.coslat0*n-this.sinlat0*i*Math.cos(h))+this.y0,e):(a=2*Math.atan(this.ssfn_(r,n,this.e))-vt,l=Math.cos(a),s=Math.sin(a),Math.abs(this.coslat0)<=Et?(c=ql(this.e,r*this.con,this.con*n),d=2*this.a*this.k0*c/this.cons,e.x=this.x0+d*Math.sin(t-this.long0),e.y=this.y0-this.con*d*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<Et?(o=2*this.a*this.k0/(1+l*Math.cos(h)),e.y=o*s):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*s+this.cosX0*l*Math.cos(h))),e.y=o*(this.cosX0*s-this.sinX0*l*Math.cos(h))+this.y0),e.x=o*l*Math.sin(h)+this.x0,e))}function TQe(e){e.x-=this.x0,e.y-=this.y0;var t,r,n,i,o,a=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(a/(2*this.a*this.k0));return t=this.long0,r=this.lat0,a<=Et?(e.x=t,e.y=r,e):(r=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/a),Math.abs(this.coslat0)<Et?this.lat0>0?t=Ft(this.long0+Math.atan2(e.x,-1*e.y)):t=Ft(this.long0+Math.atan2(e.x,e.y)):t=Ft(this.long0+Math.atan2(e.x*Math.sin(s),a*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s))),e.x=t,e.y=r,e)}else if(Math.abs(this.coslat0)<=Et){if(a<=Et)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,n=a*this.cons/(2*this.a*this.k0),r=this.con*R1(this.e,n),t=this.con*Ft(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else i=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=Et?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/a),t=Ft(this.long0+Math.atan2(e.x*Math.sin(i),a*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)))),r=-1*R1(this.e,Math.tan(.5*(vt+o)));return e.x=t,e.y=r,e}var AQe=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const EQe={init:kQe,forward:MQe,inverse:TQe,names:AQe,ssfn_:SQe};function PQe(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),r=this.a,n=this.rf,i=1/n,o=2*i-Math.pow(i,2),a=this.e=Math.sqrt(o);this.R=this.k0*r*Math.sqrt(1-o)/(1-o*Math.pow(t,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var s=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+e/2)),c=Math.log((1+a*t)/(1-a*t));this.K=s-this.alpha*l+this.alpha*a/2*c}function DQe(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),n=-this.alpha*(t+r)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(e.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*a+this.x0,e}function LQe(e){for(var t=e.x-this.x0,r=e.y-this.y0,n=t/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),a=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+a/this.alpha,l=0,c=o,d=-1e3,h=0;Math.abs(c-d)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),d=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=s,e.y=c,e}var OQe=["somerc"];const IQe={init:PQe,forward:DQe,inverse:LQe,names:OQe};var a0=1e-7;function NQe(e){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],r=typeof e.PROJECTION=="object"?Object.keys(e.PROJECTION)[0]:e.PROJECTION;return"no_uoff"in e||"no_off"in e||t.indexOf(r)!==-1}function RQe(){var e,t,r,n,i,o,a,s,l,c,d=0,h,u=0,g=0,f=0,p=0,x=0,S=0;this.no_off=NQe(this),this.no_rot="no_rot"in this;var j=!1;"alpha"in this&&(j=!0);var U=!1;if("rectified_grid_angle"in this&&(U=!0),j&&(S=this.alpha),U&&(d=this.rectified_grid_angle*To),j||U)u=this.longc;else if(g=this.long1,p=this.lat1,f=this.long2,x=this.lat2,Math.abs(p-x)<=a0||(e=Math.abs(p))<=a0||Math.abs(e-vt)<=a0||Math.abs(Math.abs(this.lat0)-vt)<=a0||Math.abs(Math.abs(x)-vt)<=a0)throw new Error;var B=1-this.es;t=Math.sqrt(B),Math.abs(this.lat0)>Et?(s=Math.sin(this.lat0),r=Math.cos(this.lat0),e=1-this.es*s*s,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/B),this.A=this.B*this.k0*t/e,n=this.B*t/(r*Math.sqrt(e)),i=n*n-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(ql(this.e,this.lat0,s),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=i=1),j||U?(j?(h=Math.asin(Math.sin(S)/n),U||(d=S)):(h=d,S=Math.asin(n*Math.sin(h))),this.lam0=u-Math.asin(.5*(i-1/i)*Math.tan(h))/this.B):(o=Math.pow(ql(this.e,p,Math.sin(p)),this.B),a=Math.pow(ql(this.e,x,Math.sin(x)),this.B),i=this.E/o,l=(a-o)/(a+o),c=this.E*this.E,c=(c-a*o)/(c+a*o),e=g-f,e<-Math.pi?f-=O1:e>Math.pi&&(f+=O1),this.lam0=Ft(.5*(g+f)-Math.atan(c*Math.tan(.5*this.B*(g-f))/l)/this.B),h=Math.atan(2*Math.sin(this.B*Ft(g-this.lam0))/(i-1/i)),d=S=Math.asin(n*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(S))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(rn-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(rn+i))}function FQe(e){var t={},r,n,i,o,a,s,l,c;if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-vt)>Et){if(a=this.E/Math.pow(ql(this.e,e.y,Math.sin(e.y)),this.B),s=1/a,r=.5*(a-s),n=.5*(a+s),o=Math.sin(this.B*e.x),i=(r*this.singam-o*this.cosgam)/n,Math.abs(Math.abs(i)-1)<Et)throw new Error;c=.5*this.ArB*Math.log((1-i)/(1+i)),s=Math.cos(this.B*e.x),Math.abs(s)<a0?l=this.A*e.x:l=this.ArB*Math.atan2(r*this.cosgam+o*this.singam,s)}else c=e.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*e.y;return this.no_rot?(t.x=l,t.y=c):(l-=this.u_0,t.x=c*this.cosrot+l*this.sinrot,t.y=l*this.cosrot-c*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function jQe(e){var t,r,n,i,o,a,s,l={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(r=e.y,t=e.x):(r=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*r),i=.5*(n-1/n),o=.5*(n+1/n),a=Math.sin(this.BrA*t),s=(a*this.cosgam+i*this.singam)/o,Math.abs(Math.abs(s)-1)<Et)l.x=0,l.y=s<0?-vt:vt;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=R1(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(i*this.cosgam-a*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l}var BQe=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const zQe={init:RQe,forward:FQe,inverse:jQe,names:BQe};function $Qe(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Et)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),r=Math.cos(this.lat1),n=Bc(this.e,t,r),i=ql(this.e,this.lat1,t),o=Math.sin(this.lat2),a=Math.cos(this.lat2),s=Bc(this.e,o,a),l=ql(this.e,this.lat2,o),c=ql(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Et?this.ns=Math.log(n/s)/Math.log(i/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function WQe(e){var t=e.x,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=Et&&(r=N1(r)*(vt-2*Et));var n=Math.abs(Math.abs(r)-vt),i,o;if(n>Et)i=ql(this.e,r,Math.sin(r)),o=this.a*this.f0*Math.pow(i,this.ns);else{if(n=r*this.ns,n<=0)return null;o=0}var a=this.ns*Ft(t-this.long0);return e.x=this.k0*(o*Math.sin(a))+this.x0,e.y=this.k0*(this.rh-o*Math.cos(a))+this.y0,e}function HQe(e){var t,r,n,i,o,a=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+s*s),r=1):(t=-Math.sqrt(a*a+s*s),r=-1);var l=0;if(t!==0&&(l=Math.atan2(r*a,r*s)),t!==0||this.ns>0){if(r=1/this.ns,n=Math.pow(t/(this.a*this.f0),r),i=R1(this.e,n),i===-9999)return null}else i=-vt;return o=Ft(l/this.ns+this.long0),e.x=o,e.y=i,e}var UQe=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const GQe={init:$Qe,forward:WQe,inverse:HQe,names:UQe};function VQe(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function YQe(e){var t,r,n,i,o,a,s,l=e.x,c=e.y,d=Ft(l-this.long0);return t=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/t)-this.s45),n=-d*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),o=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),e.y=s*Math.cos(a)/1,e.x=s*Math.sin(a)/1,this.czech||(e.y*=-1,e.x*=-1),e}function qQe(e){var t,r,n,i,o,a,s,l,c=e.x;e.x=e.y,e.y=c,this.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),o=Math.atan2(e.y,e.x),i=o/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),r=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(t)),e.x=this.long0-r/this.alfa,s=t,l=0;var d=0;do e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)),this.e/2))-this.s45),Math.abs(s-e.y)<1e-10&&(l=1),s=e.y,d+=1;while(l===0&&d<15);return d>=15?null:e}var ZQe=["Krovak","krovak"];const XQe={init:VQe,forward:YQe,inverse:qQe,names:ZQe};function la(e,t,r,n,i){return e*i-t*Math.sin(2*i)+r*Math.sin(4*i)-n*Math.sin(6*i)}function B1(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function z1(e){return .375*e*(1+.25*e*(1+.46875*e))}function $1(e){return .05859375*e*e*(1+.75*e)}function W1(e){return e*e*e*(35/3072)}function s0(e,t,r){var n=t*r;return e/Math.sqrt(1-n*n)}function l0(e){return Math.abs(e)<vt?e:e-N1(e)*Math.PI}function UM(e,t,r,n,i){var o,a;o=e/t;for(var s=0;s<15;s++)if(a=(e-(t*o-r*Math.sin(2*o)+n*Math.sin(4*o)-i*Math.sin(6*o)))/(t-2*r*Math.cos(2*o)+4*n*Math.cos(4*o)-6*i*Math.cos(6*o)),o+=a,Math.abs(a)<=1e-10)return o;return NaN}function KQe(){this.sphere||(this.e0=B1(this.es),this.e1=z1(this.es),this.e2=$1(this.es),this.e3=W1(this.es),this.ml0=this.a*la(this.e0,this.e1,this.e2,this.e3,this.lat0))}function QQe(e){var t,r,n=e.x,i=e.y;if(n=Ft(n-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(i)*Math.sin(n)),r=this.a*(Math.atan2(Math.tan(i),Math.cos(n))-this.lat0);else{var o=Math.sin(i),a=Math.cos(i),s=s0(this.a,this.e,o),l=Math.tan(i)*Math.tan(i),c=n*Math.cos(i),d=c*c,h=this.es*a*a/(1-this.es),u=this.a*la(this.e0,this.e1,this.e2,this.e3,i);t=s*c*(1-d*l*(1/6-(8-l+8*h)*d/120)),r=u-this.ml0+s*o/a*d*(.5+(5-l+6*h)*d/24)}return e.x=t+this.x0,e.y=r+this.y0,e}function JQe(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,r=e.y/this.a,n,i;if(this.sphere){var o=r+this.lat0;n=Math.asin(Math.sin(o)*Math.cos(t)),i=Math.atan2(Math.tan(t),Math.cos(o))}else{var a=this.ml0/this.a+r,s=UM(a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-vt)<=Et)return e.x=this.long0,e.y=vt,r<0&&(e.y*=-1),e;var l=s0(this.a,this.e,Math.sin(s)),c=l*l*l/this.a/this.a*(1-this.es),d=Math.pow(Math.tan(s),2),h=t*this.a/l,u=h*h;n=s-l*Math.tan(s)/c*h*h*(.5-(1+3*d)*h*h/24),i=h*(1-u*(d/3+(1+3*d)*d*u/15))/Math.cos(s)}return e.x=Ft(i+this.long0),e.y=l0(n),e}var eJe=["Cassini","Cassini_Soldner","cass"];const tJe={init:KQe,forward:QQe,inverse:JQe,names:eJe};function fh(e,t){var r;return e>1e-7?(r=e*t,(1-e*e)*(t/(1-r*r)-.5/e*Math.log((1-r)/(1+r)))):2*t}var rJe=1,nJe=2,iJe=3,oJe=4;function aJe(){var e=Math.abs(this.lat0);if(Math.abs(e-vt)<Et?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<Et?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var t;switch(this.qp=fh(this.e,1),this.mmf=.5/(1-this.es),this.apa=gJe(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=fh(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function sJe(e){var t,r,n,i,o,a,s,l,c,d,h=e.x,u=e.y;if(h=Ft(h-this.long0),this.sphere){if(o=Math.sin(u),d=Math.cos(u),n=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(r=this.mode===this.EQUIT?1+d*n:1+this.sinph0*o+this.cosph0*d*n,r<=Et)return null;r=Math.sqrt(2/r),t=r*d*Math.sin(h),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*d*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(u+this.lat0)<Et)return null;r=rn-u*.5,r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)),t=r*Math.sin(h),r*=n}}else{switch(s=0,l=0,c=0,n=Math.cos(h),i=Math.sin(h),o=Math.sin(u),a=fh(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(s=a/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:c=1+this.sinb1*s+this.cosb1*l*n;break;case this.EQUIT:c=1+l*n;break;case this.N_POLE:c=vt+u,a=this.qp-a;break;case this.S_POLE:c=u-vt,a=this.qp+a;break}if(Math.abs(c)<Et)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),this.mode===this.OBLIQ?r=this.ymf*c*(this.cosb1*s-this.sinb1*l*n):r=(c=Math.sqrt(2/(1+l*n)))*s*this.ymf,t=this.xmf*c*l*i;break;case this.N_POLE:case this.S_POLE:a>=0?(t=(c=Math.sqrt(a))*i,r=n*(this.mode===this.S_POLE?c:-c)):t=r=0;break}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e}function lJe(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,r=e.y/this.a,n,i,o,a,s,l,c;if(this.sphere){var d=0,h,u=0;if(h=Math.sqrt(t*t+r*r),i=h*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(u=Math.sin(i),d=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(h)<=Et?0:Math.asin(r*u/h),t*=u,r=d*h;break;case this.OBLIQ:i=Math.abs(h)<=Et?this.lat0:Math.asin(d*this.sinph0+r*u*this.cosph0/h),t*=u*this.cosph0,r=(d-Math.sin(i)*this.sinph0)*h;break;case this.N_POLE:r=-r,i=vt-i;break;case this.S_POLE:i-=vt;break}n=r===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,r)}else{if(c=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,r*=this.dd,l=Math.sqrt(t*t+r*r),l<Et)return e.x=this.long0,e.y=this.lat0,e;a=2*Math.asin(.5*l/this.rq),o=Math.cos(a),t*=a=Math.sin(a),this.mode===this.OBLIQ?(c=o*this.sinb1+r*a*this.cosb1/l,s=this.qp*c,r=l*this.cosb1*o-r*this.sinb1*a):(c=r*a/l,s=this.qp*c,r=l*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),s=t*t+r*r,!s)return e.x=this.long0,e.y=this.lat0,e;c=1-s/this.qp,this.mode===this.S_POLE&&(c=-c)}n=Math.atan2(t,r),i=mJe(Math.asin(c),this.apa)}return e.x=Ft(this.long0+n),e.y=i,e}var cJe=.3333333333333333,uJe=.17222222222222222,dJe=.10257936507936508,hJe=.06388888888888888,pJe=.0664021164021164,fJe=.016415012942191543;function gJe(e){var t,r=[];return r[0]=e*cJe,t=e*e,r[0]+=t*uJe,r[1]=t*hJe,t*=e,r[0]+=t*dJe,r[1]+=t*pJe,r[2]=t*fJe,r}function mJe(e,t){var r=e+e;return e+t[0]*Math.sin(r)+t[1]*Math.sin(r+r)+t[2]*Math.sin(r+r+r)}var vJe=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const yJe={init:aJe,forward:sJe,inverse:lJe,names:vJe,S_POLE:rJe,N_POLE:nJe,EQUIT:iJe,OBLIQ:oJe};function gh(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function bJe(){Math.abs(this.lat1+this.lat2)<Et||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Bc(this.e3,this.sin_po,this.cos_po),this.qs1=fh(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Bc(this.e3,this.sin_po,this.cos_po),this.qs2=fh(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=fh(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>Et?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function xJe(e){var t=e.x,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=fh(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*Ft(t-this.long0),a=i*Math.sin(o)+this.x0,s=this.rh-i*Math.cos(o)+this.y0;return e.x=a,e.y=s,e}function wJe(e){var t,r,n,i,o,a;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),n=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),n=-1),i=0,t!==0&&(i=Math.atan2(n*e.x,n*e.y)),n=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,r)),o=Ft(i/this.ns0+this.long0),e.x=o,e.y=a,e}function CJe(e,t){var r,n,i,o,a,s=gh(.5*t);if(e<Et)return s;for(var l=e*e,c=1;c<=25;c++)if(r=Math.sin(s),n=Math.cos(s),i=e*r,o=1-i*i,a=.5*o*o/n*(t/(1-l)-r/o+.5/e*Math.log((1-i)/(1+i))),s=s+a,Math.abs(a)<=1e-7)return s;return null}var _Je=["Albers_Conic_Equal_Area","Albers","aea"];const SJe={init:bJe,forward:xJe,inverse:wJe,names:_Je,phi1z:CJe};function kJe(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function MJe(e){var t,r,n,i,o,a,s,l,c=e.x,d=e.y;return n=Ft(c-this.long0),t=Math.sin(d),r=Math.cos(d),i=Math.cos(n),a=this.sin_p14*t+this.cos_p14*r*i,o=1,a>0||Math.abs(a)<=Et?(s=this.x0+this.a*o*r*Math.sin(n)/a,l=this.y0+this.a*o*(this.cos_p14*t-this.sin_p14*r*i)/a):(s=this.x0+this.infinity_dist*r*Math.sin(n),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*i)),e.x=s,e.y=l,e}function TJe(e){var t,r,n,i,o,a;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(i=Math.atan2(t,this.rc),r=Math.sin(i),n=Math.cos(i),a=gh(n*this.sin_p14+e.y*r*this.cos_p14/t),o=Math.atan2(e.x*r,t*this.cos_p14*n-e.y*this.sin_p14*r),o=Ft(this.long0+o)):(a=this.phic0,o=0),e.x=o,e.y=a,e}var AJe=["gnom"];const EJe={init:kJe,forward:MJe,inverse:TJe,names:AJe};function PJe(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-r)<1e-6)return t<0?-1*vt:vt;for(var n=Math.asin(.5*t),i,o,a,s,l=0;l<30;l++)if(o=Math.sin(n),a=Math.cos(n),s=e*o,i=Math.pow(1-s*s,2)/(2*a)*(t/(1-e*e)-o/(1-s*s)+.5/e*Math.log((1-s)/(1+s))),n+=i,Math.abs(i)<=1e-10)return n;return NaN}function DJe(){this.sphere||(this.k0=Bc(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function LJe(e){var t=e.x,r=e.y,n,i,o=Ft(t-this.long0);if(this.sphere)n=this.x0+this.a*o*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var a=fh(this.e,Math.sin(r));n=this.x0+this.a*this.k0*o,i=this.y0+this.a*a*.5/this.k0}return e.x=n,e.y=i,e}function OJe(e){e.x-=this.x0,e.y-=this.y0;var t,r;return this.sphere?(t=Ft(this.long0+e.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(r=PJe(this.e,2*e.y*this.k0/this.a),t=Ft(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=r,e}var IJe=["cea"];const NJe={init:DJe,forward:LJe,inverse:OJe,names:IJe};function RJe(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function FJe(e){var t=e.x,r=e.y,n=Ft(t-this.long0),i=l0(r-this.lat0);return e.x=this.x0+this.a*n*this.rc,e.y=this.y0+this.a*i,e}function jJe(e){var t=e.x,r=e.y;return e.x=Ft(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=l0(this.lat0+(r-this.y0)/this.a),e}var BJe=["Equirectangular","Equidistant_Cylindrical","eqc"];const zJe={init:RJe,forward:FJe,inverse:jJe,names:BJe};var yne=20;function $Je(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=B1(this.es),this.e1=z1(this.es),this.e2=$1(this.es),this.e3=W1(this.es),this.ml0=this.a*la(this.e0,this.e1,this.e2,this.e3,this.lat0)}function WJe(e){var t=e.x,r=e.y,n,i,o,a=Ft(t-this.long0);if(o=a*Math.sin(r),this.sphere)Math.abs(r)<=Et?(n=this.a*a,i=-1*this.a*this.lat0):(n=this.a*Math.sin(o)/Math.tan(r),i=this.a*(l0(r-this.lat0)+(1-Math.cos(o))/Math.tan(r)));else if(Math.abs(r)<=Et)n=this.a*a,i=-1*this.ml0;else{var s=s0(this.a,this.e,Math.sin(r))/Math.tan(r);n=s*Math.sin(o),i=this.a*la(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+s*(1-Math.cos(o))}return e.x=n+this.x0,e.y=i+this.y0,e}function HJe(e){var t,r,n,i,o,a,s,l,c;if(n=e.x-this.x0,i=e.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=Et)t=Ft(n/this.a+this.long0),r=0;else{a=this.lat0+i/this.a,s=n*n/this.a/this.a+a*a,l=a;var d;for(o=yne;o;--o)if(d=Math.tan(l),c=-1*(a*(l*d+1)-l-.5*(l*l+s)*d)/((l-a)/d-1),l+=c,Math.abs(c)<=Et){r=l;break}t=Ft(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=Et)r=0,t=Ft(this.long0+n/this.a);else{a=(this.ml0+i)/this.a,s=n*n/this.a/this.a+a*a,l=a;var h,u,g,f,p;for(o=yne;o;--o)if(p=this.e*Math.sin(l),h=Math.sqrt(1-p*p)*Math.tan(l),u=this.a*la(this.e0,this.e1,this.e2,this.e3,l),g=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),f=u/this.a,c=(a*(h*f+1)-f-.5*h*(f*f+s))/(this.es*Math.sin(2*l)*(f*f+s-2*a*f)/(4*h)+(a-f)*(h*g-2/Math.sin(2*l))-g),l-=c,Math.abs(c)<=Et){r=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),t=Ft(this.long0+Math.asin(n*h/this.a)/Math.sin(r))}return e.x=t,e.y=r,e}var UJe=["Polyconic","poly"];const GJe={init:$Je,forward:WJe,inverse:HJe,names:UJe};function VJe(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function YJe(e){var t,r=e.x,n=e.y,i=n-this.lat0,o=r-this.long0,a=i/L1*1e-5,s=o,l=1,c=0;for(t=1;t<=10;t++)l=l*a,c=c+this.A[t]*l;var d=c,h=s,u=1,g=0,f,p,x=0,S=0;for(t=1;t<=6;t++)f=u*d-g*h,p=g*d+u*h,u=f,g=p,x=x+this.B_re[t]*u-this.B_im[t]*g,S=S+this.B_im[t]*u+this.B_re[t]*g;return e.x=S*this.a+this.x0,e.y=x*this.a+this.y0,e}function qJe(e){var t,r=e.x,n=e.y,i=r-this.x0,o=n-this.y0,a=o/this.a,s=i/this.a,l=1,c=0,d,h,u=0,g=0;for(t=1;t<=6;t++)d=l*a-c*s,h=c*a+l*s,l=d,c=h,u=u+this.C_re[t]*l-this.C_im[t]*c,g=g+this.C_im[t]*l+this.C_re[t]*c;for(var f=0;f<this.iterations;f++){var p=u,x=g,S,j,U=a,B=s;for(t=2;t<=6;t++)S=p*u-x*g,j=x*u+p*g,p=S,x=j,U=U+(t-1)*(this.B_re[t]*p-this.B_im[t]*x),B=B+(t-1)*(this.B_im[t]*p+this.B_re[t]*x);p=1,x=0;var R=this.B_re[1],E=this.B_im[1];for(t=2;t<=6;t++)S=p*u-x*g,j=x*u+p*g,p=S,x=j,R=R+t*(this.B_re[t]*p-this.B_im[t]*x),E=E+t*(this.B_im[t]*p+this.B_re[t]*x);var N=R*R+E*E;u=(U*R+B*E)/N,g=(B*R-U*E)/N}var M=u,$=g,T=1,C=0;for(t=1;t<=9;t++)T=T*M,C=C+this.D[t]*T;var y=this.lat0+C*L1*1e5,D=this.long0+$;return e.x=D,e.y=y,e}var ZJe=["New_Zealand_Map_Grid","nzmg"];const XJe={init:VJe,forward:YJe,inverse:qJe,names:ZJe};function KJe(){}function QJe(e){var t=e.x,r=e.y,n=Ft(t-this.long0),i=this.x0+this.a*n,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return e.x=i,e.y=o,e}function JJe(e){e.x-=this.x0,e.y-=this.y0;var t=Ft(this.long0+e.x/this.a),r=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=r,e}var eet=["Miller_Cylindrical","mill"];const tet={init:KJe,forward:QJe,inverse:JJe,names:eet};var ret=20;function net(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=fne(this.es)}function iet(e){var t,r,n=e.x,i=e.y;if(n=Ft(n-this.long0),this.sphere){if(!this.m)i=this.n!==1?Math.asin(this.n*Math.sin(i)):i;else for(var o=this.n*Math.sin(i),a=ret;a;--a){var s=(this.m*i+Math.sin(i)-o)/(this.m+Math.cos(i));if(i-=s,Math.abs(s)<Et)break}t=this.a*this.C_x*n*(this.m+Math.cos(i)),r=this.a*this.C_y*i}else{var l=Math.sin(i),c=Math.cos(i);r=this.a*$M(i,l,c,this.en),t=this.a*n*c/Math.sqrt(1-this.es*l*l)}return e.x=t,e.y=r,e}function oet(e){var t,r,n,i;return e.x-=this.x0,n=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,n=n/(this.C_x*(this.m+Math.cos(t))),this.m?t=gh((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=gh(Math.sin(t)/this.n)),n=Ft(n+this.long0),t=l0(t)):(t=gne(e.y/this.a,this.es,this.en),i=Math.abs(t),i<vt?(i=Math.sin(t),r=this.long0+e.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)),n=Ft(r)):i-Et<vt&&(n=this.long0)),e.x=n,e.y=t,e}var aet=["Sinusoidal","sinu"];const set={init:net,forward:iet,inverse:oet,names:aet};function cet(){}function uet(e){for(var t=e.x,r=e.y,n=Ft(t-this.long0),i=r,o=Math.PI*Math.sin(r);;){var a=-(i+Math.sin(i)-o)/(1+Math.cos(i));if(i+=a,Math.abs(a)<Et)break}i/=2,Math.PI/2-Math.abs(r)<Et&&(n=0);var s=.900316316158*this.a*n*Math.cos(i)+this.x0,l=1.4142135623731*this.a*Math.sin(i)+this.y0;return e.x=s,e.y=l,e}function det(e){var t,r;e.x-=this.x0,e.y-=this.y0,r=e.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),t=Math.asin(r);var n=Ft(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return e.x=n,e.y=i,e}var het=["Mollweide","moll"];const pet={init:cet,forward:uet,inverse:det,names:het};function fet(){Math.abs(this.lat1+this.lat2)<Et||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=B1(this.es),this.e1=z1(this.es),this.e2=$1(this.es),this.e3=W1(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Bc(this.e,this.sinphi,this.cosphi),this.ml1=la(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Et?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Bc(this.e,this.sinphi,this.cosphi),this.ml2=la(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=la(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function get(e){var t=e.x,r=e.y,n;if(this.sphere)n=this.a*(this.g-r);else{var i=la(this.e0,this.e1,this.e2,this.e3,r);n=this.a*(this.g-i)}var o=this.ns*Ft(t-this.long0),a=this.x0+n*Math.sin(o),s=this.y0+this.rh-n*Math.cos(o);return e.x=a,e.y=s,e}function met(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,r,n,i;this.ns>=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var o=0;if(r!==0&&(o=Math.atan2(t*e.x,t*e.y)),this.sphere)return i=Ft(this.long0+o/this.ns),n=l0(this.g-r/this.a),e.x=i,e.y=n,e;var a=this.g-r/this.a;return n=UM(a,this.e0,this.e1,this.e2,this.e3),i=Ft(this.long0+o/this.ns),e.x=i,e.y=n,e}var vet=["Equidistant_Conic","eqdc"];const yet={init:fet,forward:get,inverse:met,names:vet};function bet(){this.R=this.a}function xet(e){var t=e.x,r=e.y,n=Ft(t-this.long0),i,o;Math.abs(r)<=Et&&(i=this.x0+this.R*n,o=this.y0);var a=gh(2*Math.abs(r/Math.PI));(Math.abs(n)<=Et||Math.abs(Math.abs(r)-vt)<=Et)&&(i=this.x0,r>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*a):o=this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/n-n/Math.PI),l=s*s,c=Math.sin(a),d=Math.cos(a),h=d/(c+d-1),u=h*h,g=h*(2/c-1),f=g*g,p=Math.PI*this.R*(s*(h-f)+Math.sqrt(l*(h-f)*(h-f)-(f+l)*(u-f)))/(f+l);n<0&&(p=-p),i=this.x0+p;var x=l+h;return p=Math.PI*this.R*(g*x-s*Math.sqrt((f+l)*(l+1)-x*x))/(f+l),r>=0?o=this.y0+p:o=this.y0-p,e.x=i,e.y=o,e}function wet(e){var t,r,n,i,o,a,s,l,c,d,h,u,g;return e.x-=this.x0,e.y-=this.y0,h=Math.PI*this.R,n=e.x/h,i=e.y/h,o=n*n+i*i,a=-Math.abs(i)*(1+o),s=a-2*i*i+n*n,l=-2*a+1+2*i*i+o*o,g=i*i/l+(2*s*s*s/l/l/l-9*a*s/l/l)/27,c=(a-s*s/3/l)/l,d=2*Math.sqrt(-c/3),h=3*g/c/d,Math.abs(h)>1&&(h>=0?h=1:h=-1),u=Math.acos(h)/3,e.y>=0?r=(-d*Math.cos(u+Math.PI/3)-s/3/l)*Math.PI:r=-(-d*Math.cos(u+Math.PI/3)-s/3/l)*Math.PI,Math.abs(n)<Et?t=this.long0:t=Ft(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(n*n-i*i)+o*o))/2/n),e.x=t,e.y=r,e}var Cet=["Van_der_Grinten_I","VanDerGrinten","vandg"];const _et={init:bet,forward:xet,inverse:wet,names:Cet};function ket(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function Met(e){var t=e.x,r=e.y,n=Math.sin(e.y),i=Math.cos(e.y),o=Ft(t-this.long0),a,s,l,c,d,h,u,g,f,p,x,S,j,U,B,R,E,N,M,$,T,C,y;return this.sphere?Math.abs(this.sin_p12-1)<=Et?(e.x=this.x0+this.a*(vt-r)*Math.sin(o),e.y=this.y0-this.a*(vt-r)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=Et?(e.x=this.x0+this.a*(vt+r)*Math.sin(o),e.y=this.y0+this.a*(vt+r)*Math.cos(o),e):(N=this.sin_p12*n+this.cos_p12*i*Math.cos(o),R=Math.acos(N),E=R?R/Math.sin(R):1,e.x=this.x0+this.a*E*i*Math.sin(o),e.y=this.y0+this.a*E*(this.cos_p12*n-this.sin_p12*i*Math.cos(o)),e):(a=B1(this.es),s=z1(this.es),l=$1(this.es),c=W1(this.es),Math.abs(this.sin_p12-1)<=Et?(d=this.a*la(a,s,l,c,vt),h=this.a*la(a,s,l,c,r),e.x=this.x0+(d-h)*Math.sin(o),e.y=this.y0-(d-h)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=Et?(d=this.a*la(a,s,l,c,vt),h=this.a*la(a,s,l,c,r),e.x=this.x0+(d+h)*Math.sin(o),e.y=this.y0+(d+h)*Math.cos(o),e):(u=n/i,g=s0(this.a,this.e,this.sin_p12),f=s0(this.a,this.e,n),p=Math.atan((1-this.es)*u+this.es*g*this.sin_p12/(f*i)),x=Math.atan2(Math.sin(o),this.cos_p12*Math.tan(p)-this.sin_p12*Math.cos(o)),x===0?M=Math.asin(this.cos_p12*Math.sin(p)-this.sin_p12*Math.cos(p)):Math.abs(Math.abs(x)-Math.PI)<=Et?M=-Math.asin(this.cos_p12*Math.sin(p)-this.sin_p12*Math.cos(p)):M=Math.asin(Math.sin(o)*Math.cos(p)/Math.sin(x)),S=this.e*this.sin_p12/Math.sqrt(1-this.es),j=this.e*this.cos_p12*Math.cos(x)/Math.sqrt(1-this.es),U=S*j,B=j*j,$=M*M,T=$*M,C=T*M,y=C*M,R=g*M*(1-$*B*(1-B)/6+T/8*U*(1-2*B)+C/120*(B*(4-7*B)-3*S*S*(1-7*B))-y/48*U),e.x=this.x0+R*Math.sin(x),e.y=this.y0+R*Math.cos(x),e))}function Tet(e){e.x-=this.x0,e.y-=this.y0;var t,r,n,i,o,a,s,l,c,d,h,u,g,f,p,x,S,j,U,B,R,E,N,M;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*vt*this.a?void 0:(r=t/this.a,n=Math.sin(r),i=Math.cos(r),o=this.long0,Math.abs(t)<=Et?a=this.lat0:(a=gh(i*this.sin_p12+e.y*n*this.cos_p12/t),s=Math.abs(this.lat0)-vt,Math.abs(s)<=Et?this.lat0>=0?o=Ft(this.long0+Math.atan2(e.x,-e.y)):o=Ft(this.long0-Math.atan2(-e.x,e.y)):o=Ft(this.long0+Math.atan2(e.x*n,t*this.cos_p12*i-e.y*this.sin_p12*n))),e.x=o,e.y=a,e)):(l=B1(this.es),c=z1(this.es),d=$1(this.es),h=W1(this.es),Math.abs(this.sin_p12-1)<=Et?(u=this.a*la(l,c,d,h,vt),t=Math.sqrt(e.x*e.x+e.y*e.y),g=u-t,a=UM(g/this.a,l,c,d,h),o=Ft(this.long0+Math.atan2(e.x,-1*e.y)),e.x=o,e.y=a,e):Math.abs(this.sin_p12+1)<=Et?(u=this.a*la(l,c,d,h,vt),t=Math.sqrt(e.x*e.x+e.y*e.y),g=t-u,a=UM(g/this.a,l,c,d,h),o=Ft(this.long0+Math.atan2(e.x,e.y)),e.x=o,e.y=a,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),x=Math.atan2(e.x,e.y),f=s0(this.a,this.e,this.sin_p12),S=Math.cos(x),j=this.e*this.cos_p12*S,U=-j*j/(1-this.es),B=3*this.es*(1-U)*this.sin_p12*this.cos_p12*S/(1-this.es),R=t/f,E=R-U*(1+U)*Math.pow(R,3)/6-B*(1+3*U)*Math.pow(R,4)/24,N=1-U*E*E/2-R*E*E*E/6,p=Math.asin(this.sin_p12*Math.cos(E)+this.cos_p12*Math.sin(E)*S),o=Ft(this.long0+Math.asin(Math.sin(x)*Math.sin(E)/Math.cos(p))),M=Math.sin(p),a=Math.atan2((M-this.es*N*this.sin_p12)*Math.tan(p),M*(1-this.es)),e.x=o,e.y=a,e))}var Aet=["Azimuthal_Equidistant","aeqd"];const Eet={init:ket,forward:Met,inverse:Tet,names:Aet};function Pet(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Det(e){var t,r,n,i,o,a,s,l,c=e.x,d=e.y;return n=Ft(c-this.long0),t=Math.sin(d),r=Math.cos(d),i=Math.cos(n),a=this.sin_p14*t+this.cos_p14*r*i,o=1,(a>0||Math.abs(a)<=Et)&&(s=this.a*o*r*Math.sin(n),l=this.y0+this.a*o*(this.cos_p14*t-this.sin_p14*r*i)),e.x=s,e.y=l,e}function Let(e){var t,r,n,i,o,a,s;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),r=gh(t/this.a),n=Math.sin(r),i=Math.cos(r),a=this.long0,Math.abs(t)<=Et?(s=this.lat0,e.x=a,e.y=s,e):(s=gh(i*this.sin_p14+e.y*n*this.cos_p14/t),o=Math.abs(this.lat0)-vt,Math.abs(o)<=Et?(this.lat0>=0?a=Ft(this.long0+Math.atan2(e.x,-e.y)):a=Ft(this.long0-Math.atan2(-e.x,e.y)),e.x=a,e.y=s,e):(a=Ft(this.long0+Math.atan2(e.x*n,t*this.cos_p14*i-e.y*this.sin_p14*n)),e.x=a,e.y=s,e))}var Oet=["ortho"];const Iet={init:Pet,forward:Det,inverse:Let,names:Oet};var ui={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},nn={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Net(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=vt-rn/2?this.face=ui.TOP:this.lat0<=-(vt-rn/2)?this.face=ui.BOTTOM:Math.abs(this.long0)<=rn?this.face=ui.FRONT:Math.abs(this.long0)<=vt+rn?this.face=this.long0>0?ui.RIGHT:ui.LEFT:this.face=ui.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Ret(e){var t={x:0,y:0},r,n,i,o,a,s,l={value:0};if(e.x-=this.long0,this.es!==0?r=Math.atan(this.one_minus_f_squared*Math.tan(e.y)):r=e.y,n=e.x,this.face===ui.TOP)o=vt-r,n>=rn&&n<=vt+rn?(l.value=nn.AREA_0,i=n-vt):n>vt+rn||n<=-(vt+rn)?(l.value=nn.AREA_1,i=n>0?n-Di:n+Di):n>-(vt+rn)&&n<=-rn?(l.value=nn.AREA_2,i=n+vt):(l.value=nn.AREA_3,i=n);else if(this.face===ui.BOTTOM)o=vt+r,n>=rn&&n<=vt+rn?(l.value=nn.AREA_0,i=-n+vt):n<rn&&n>=-rn?(l.value=nn.AREA_1,i=-n):n<-rn&&n>=-(vt+rn)?(l.value=nn.AREA_2,i=-n-vt):(l.value=nn.AREA_3,i=n>0?-n+Di:-n-Di);else{var c,d,h,u,g,f,p;this.face===ui.RIGHT?n=c0(n,+vt):this.face===ui.BACK?n=c0(n,+Di):this.face===ui.LEFT&&(n=c0(n,-vt)),u=Math.sin(r),g=Math.cos(r),f=Math.sin(n),p=Math.cos(n),c=g*p,d=g*f,h=u,this.face===ui.FRONT?(o=Math.acos(c),i=GM(o,h,d,l)):this.face===ui.RIGHT?(o=Math.acos(d),i=GM(o,h,-c,l)):this.face===ui.BACK?(o=Math.acos(-c),i=GM(o,h,-d,l)):this.face===ui.LEFT?(o=Math.acos(-d),i=GM(o,h,c,l)):(o=i=0,l.value=nn.AREA_0)}return s=Math.atan(12/Di*(i+Math.acos(Math.sin(i)*Math.cos(rn))-vt)),a=Math.sqrt((1-Math.cos(o))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===nn.AREA_1?s+=vt:l.value===nn.AREA_2?s+=Di:l.value===nn.AREA_3&&(s+=1.5*Di),t.x=a*Math.cos(s),t.y=a*Math.sin(s),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function Fet(e){var t={lam:0,phi:0},r,n,i,o,a,s,l,c,d,h={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,n=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),r=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?h.value=nn.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(h.value=nn.AREA_1,r-=vt):e.x<0&&-e.x>=Math.abs(e.y)?(h.value=nn.AREA_2,r=r<0?r+Di:r-Di):(h.value=nn.AREA_3,r+=vt),d=Di/12*Math.tan(r),a=Math.sin(d)/(Math.cos(d)-1/Math.sqrt(2)),s=Math.atan(a),i=Math.cos(r),o=Math.tan(n),l=1-i*i*o*o*(1-Math.cos(Math.atan(1/Math.cos(s)))),l<-1?l=-1:l>1&&(l=1),this.face===ui.TOP)c=Math.acos(l),t.phi=vt-c,h.value===nn.AREA_0?t.lam=s+vt:h.value===nn.AREA_1?t.lam=s<0?s+Di:s-Di:h.value===nn.AREA_2?t.lam=s-vt:t.lam=s;else if(this.face===ui.BOTTOM)c=Math.acos(l),t.phi=c-vt,h.value===nn.AREA_0?t.lam=-s+vt:h.value===nn.AREA_1?t.lam=-s:h.value===nn.AREA_2?t.lam=-s-vt:t.lam=s<0?-s-Di:-s+Di;else{var u,g,f;u=l,d=u*u,d>=1?f=0:f=Math.sqrt(1-d)*Math.sin(s),d+=f*f,d>=1?g=0:g=Math.sqrt(1-d),h.value===nn.AREA_1?(d=g,g=-f,f=d):h.value===nn.AREA_2?(g=-g,f=-f):h.value===nn.AREA_3&&(d=g,g=f,f=-d),this.face===ui.RIGHT?(d=u,u=-g,g=d):this.face===ui.BACK?(u=-u,g=-g):this.face===ui.LEFT&&(d=u,u=g,g=-d),t.phi=Math.acos(-f)-vt,t.lam=Math.atan2(g,u),this.face===ui.RIGHT?t.lam=c0(t.lam,-vt):this.face===ui.BACK?t.lam=c0(t.lam,-Di):this.face===ui.LEFT&&(t.lam=c0(t.lam,+vt))}if(this.es!==0){var p,x,S;p=t.phi<0?1:0,x=Math.tan(t.phi),S=this.b/Math.sqrt(x*x+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-S*S)/(this.one_minus_f*S)),p&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function GM(e,t,r,n){var i;return e<Et?(n.value=nn.AREA_0,i=0):(i=Math.atan2(t,r),Math.abs(i)<=rn?n.value=nn.AREA_0:i>rn&&i<=vt+rn?(n.value=nn.AREA_1,i-=vt):i>vt+rn||i<=-(vt+rn)?(n.value=nn.AREA_2,i=i>=0?i-Di:i+Di):(n.value=nn.AREA_3,i+=vt)),i}function c0(e,t){var r=e+t;return r<-Di?r+=O1:r>+Di&&(r-=O1),r}var jet=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const Bet={init:Net,forward:Ret,inverse:Fet,names:jet};var l6=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],H1=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],bne=.8487,xne=1.3523,wne=Fc/5,zet=1/wne,u0=18,VM=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},$et=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function Wet(e,t,r,n){for(var i=t;n;--n){var o=e(i);if(i-=o,Math.abs(o)<r)break}return i}function Het(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function Uet(e){var t=Ft(e.x-this.long0),r=Math.abs(e.y),n=Math.floor(r*wne);n<0?n=0:n>=u0&&(n=u0-1),r=Fc*(r-zet*n);var i={x:VM(l6[n],r)*t,y:VM(H1[n],r)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*bne+this.x0,i.y=i.y*this.a*xne+this.y0,i}function Get(e){var t={x:(e.x-this.x0)/(this.a*bne),y:Math.abs(e.y-this.y0)/(this.a*xne)};if(t.y>=1)t.x/=l6[u0][0],t.y=e.y<0?-vt:vt;else{var r=Math.floor(t.y*u0);for(r<0?r=0:r>=u0&&(r=u0-1);;)if(H1[r][0]>t.y)--r;else if(H1[r+1][0]<=t.y)++r;else break;var n=H1[r],i=5*(t.y-n[0])/(H1[r+1][0]-n[0]);i=Wet(function(o){return(VM(n,o)-t.y)/$et(n,o)},i,Et,100),t.x/=VM(l6[r],i),t.y=(5*r+i)*To,e.y<0&&(t.y=-t.y)}return t.x=Ft(t.x+this.long0),t}var Vet=["Robinson","robin"];const Yet={init:Het,forward:Uet,inverse:Get,names:Vet};function qet(){this.name="geocent"}function Zet(e){var t=qre(e,this.es,this.a);return t}function Xet(e){var t=Zre(e,this.es,this.a,this.b);return t}var Ket=["Geocentric","geocentric","geocent","Geocent"];const Qet={init:qet,forward:Zet,inverse:Xet,names:Ket};var Zo={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},U1={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Jet(){if(Object.keys(U1).forEach(function(r){if(typeof this[r]=="undefined")this[r]=U1[r].def;else{if(U1[r].num&&isNaN(this[r]))throw new Error("Invalid parameter value, must be numeric "+r+" = "+this[r]);U1[r].num&&(this[r]=parseFloat(this[r]))}U1[r].degrees&&(this[r]=this[r]*To)}.bind(this)),Math.abs(Math.abs(this.lat0)-vt)<Et?this.mode=this.lat0<0?Zo.S_POLE:Zo.N_POLE:Math.abs(this.lat0)<Et?this.mode=Zo.EQUIT:(this.mode=Zo.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function ett(e){e.x-=this.long0;var t=Math.sin(e.y),r=Math.cos(e.y),n=Math.cos(e.x),i,o;switch(this.mode){case Zo.OBLIQ:o=this.sinph0*t+this.cosph0*r*n;break;case Zo.EQUIT:o=r*n;break;case Zo.S_POLE:o=-t;break;case Zo.N_POLE:o=t;break}switch(o=this.pn1/(this.p-o),i=o*r*Math.sin(e.x),this.mode){case Zo.OBLIQ:o*=this.cosph0*t-this.sinph0*r*n;break;case Zo.EQUIT:o*=t;break;case Zo.N_POLE:o*=-(r*n);break;case Zo.S_POLE:o*=r*n;break}var a,s;return a=o*this.cg+i*this.sg,s=1/(a*this.sw*this.h1+this.cw),i=(i*this.cg-o*this.sg)*this.cw*s,o=a*s,e.x=i*this.a,e.y=o*this.a,e}function ttt(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},r,n,i;i=1/(this.pn1-e.y*this.sw),r=this.pn1*e.x*i,n=this.pn1*e.y*this.cw*i,e.x=r*this.cg+n*this.sg,e.y=n*this.cg-r*this.sg;var o=sl(e.x,e.y);if(Math.abs(o)<Et)t.x=0,t.y=e.y;else{var a,s;switch(s=1-o*o*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/o+o/this.pn1),a=Math.sqrt(1-s*s),this.mode){case Zo.OBLIQ:t.y=Math.asin(a*this.sinph0+e.y*s*this.cosph0/o),e.y=(a-this.sinph0*Math.sin(t.y))*o,e.x*=s*this.cosph0;break;case Zo.EQUIT:t.y=Math.asin(e.y*s/o),e.y=a*o,e.x*=s;break;case Zo.N_POLE:t.y=Math.asin(a),e.y=-e.y;break;case Zo.S_POLE:t.y=-Math.asin(a);break}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var rtt=["Tilted_Perspective","tpers"];const ntt={init:Jet,forward:ett,inverse:ttt,names:rtt};function itt(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function ott(e){var t=e.x,r=e.y,n,i,o,a;if(t=t-this.long0,this.shape==="ellipse"){r=Math.atan(this.radius_p2*Math.tan(r));var s=this.radius_p/sl(this.radius_p*Math.cos(r),Math.sin(r));if(i=s*Math.cos(t)*Math.cos(r),o=s*Math.sin(t)*Math.cos(r),a=s*Math.sin(r),(this.radius_g-i)*i-o*o-a*a*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;n=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(o/sl(a,n)),e.y=this.radius_g_1*Math.atan(a/n)):(e.x=this.radius_g_1*Math.atan(o/n),e.y=this.radius_g_1*Math.atan(a/sl(o,n)))}else this.shape==="sphere"&&(n=Math.cos(r),i=Math.cos(t)*n,o=Math.sin(t)*n,a=Math.sin(r),n=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(o/sl(a,n)),e.y=this.radius_g_1*Math.atan(a/n)):(e.x=this.radius_g_1*Math.atan(o/n),e.y=this.radius_g_1*Math.atan(a/sl(o,n))));return e.x=e.x*this.a,e.y=e.y*this.a,e}function att(e){var t=-1,r=0,n=0,i,o,a,s;if(e.x=e.x/this.a,e.y=e.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(e.y/this.radius_g_1),r=Math.tan(e.x/this.radius_g_1)*sl(1,n)):(r=Math.tan(e.x/this.radius_g_1),n=Math.tan(e.y/this.radius_g_1)*sl(1,r));var l=n/this.radius_p;if(i=r*r+l*l+t*t,o=2*this.radius_g*t,a=o*o-4*i*this.C,a<0)return e.x=Number.NaN,e.y=Number.NaN,e;s=(-o-Math.sqrt(a))/(2*i),t=this.radius_g+s*t,r*=s,n*=s,e.x=Math.atan2(r,t),e.y=Math.atan(n*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(e.y/this.radius_g_1),r=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+n*n)):(r=Math.tan(e.x/this.radius_g_1),n=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+r*r)),i=r*r+n*n+t*t,o=2*this.radius_g*t,a=o*o-4*i*this.C,a<0)return e.x=Number.NaN,e.y=Number.NaN,e;s=(-o-Math.sqrt(a))/(2*i),t=this.radius_g+s*t,r*=s,n*=s,e.x=Math.atan2(r,t),e.y=Math.atan(n*Math.cos(e.x)/t)}return e.x=e.x+this.long0,e}var stt=["Geostationary Satellite View","Geostationary_Satellite","geos"];const ltt={init:itt,forward:ott,inverse:att,names:stt};var G1=1.340264,V1=-.081106,Y1=893e-6,q1=.003796,YM=Math.sqrt(3)/2;function ctt(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function utt(e){var t=Ft(e.x-this.long0),r=e.y,n=Math.asin(YM*Math.sin(r)),i=n*n,o=i*i*i;return e.x=t*Math.cos(n)/(YM*(G1+3*V1*i+o*(7*Y1+9*q1*i))),e.y=n*(G1+V1*i+o*(Y1+q1*i)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function dtt(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t=1e-9,r=12,n=e.y,i,o,a,s,l,c;for(c=0;c<r&&(i=n*n,o=i*i*i,a=n*(G1+V1*i+o*(Y1+q1*i))-e.y,s=G1+3*V1*i+o*(7*Y1+9*q1*i),n-=l=a/s,!(Math.abs(l)<t));++c);return i=n*n,o=i*i*i,e.x=YM*e.x*(G1+3*V1*i+o*(7*Y1+9*q1*i))/Math.cos(n),e.y=Math.asin(Math.sin(n)/YM),e.x=Ft(e.x+this.long0),e}var htt=["eqearth","Equal Earth","Equal_Earth"];const ptt={init:ctt,forward:utt,inverse:dtt,names:htt};function ftt(e){e.Proj.projections.add(WM),e.Proj.projections.add(HM),e.Proj.projections.add(pQe),e.Proj.projections.add(_Qe),e.Proj.projections.add(EQe),e.Proj.projections.add(IQe),e.Proj.projections.add(zQe),e.Proj.projections.add(GQe),e.Proj.projections.add(XQe),e.Proj.projections.add(tJe),e.Proj.projections.add(yJe),e.Proj.projections.add(SJe),e.Proj.projections.add(EJe),e.Proj.projections.add(NJe),e.Proj.projections.add(zJe),e.Proj.projections.add(GJe),e.Proj.projections.add(XJe),e.Proj.projections.add(tet),e.Proj.projections.add(set),e.Proj.projections.add(pet),e.Proj.projections.add(yet),e.Proj.projections.add(_et),e.Proj.projections.add(Eet),e.Proj.projections.add(Iet),e.Proj.projections.add(Bet),e.Proj.projections.add(Yet),e.Proj.projections.add(Qet),e.Proj.projections.add(ntt),e.Proj.projections.add(ltt),e.Proj.projections.add(ptt)}_s.defaultDatum="WGS84",_s.Proj=zc,_s.WGS84=new _s.Proj("WGS84"),_s.Point=o0,_s.toPoint=Jre,_s.defs=sa,_s.nadgrid=gKe,_s.transform=zM,_s.mgrs=DKe,_s.version="__VERSION__",ftt(_s);const gtt=D9(Object.freeze(Object.defineProperty({__proto__:null,default:_s},Symbol.toStringTag,{value:"Module"})));(function(e){(function(t){var r,n;r=Ire,n=gtt,e.exports=t(r,n)})(function(t,r){return r.__esModule&&r.default&&(r=r.default),t.Proj={},t.Proj._isProj4Obj=function(n){return typeof n.inverse!="undefined"&&typeof n.forward!="undefined"},t.Proj.Projection=t.Class.extend({initialize:function(n,i,o){var a=t.Proj._isProj4Obj(n);this._proj=a?n:this._projFromCodeDef(n,i),this.bounds=a?i:o},project:function(n){var i=this._proj.forward([n.lng,n.lat]);return new t.Point(i[0],i[1])},unproject:function(n,i){var o=this._proj.inverse([n.x,n.y]);return new t.LatLng(o[1],o[0],i)},_projFromCodeDef:function(n,i){if(i)r.defs(n,i);else if(r.defs[n]===void 0){var o=n.split(":");if(o.length>3&&(n=o[o.length-3]+":"+o[o.length-1]),r.defs[n]===void 0)throw"No projection definition for code "+n}return r(n)}}),t.Proj.CRS=t.Class.extend({includes:t.CRS,options:{transformation:new t.Transformation(1,0,-1,0)},initialize:function(n,i,o){var a,s,l,c;if(t.Proj._isProj4Obj(n)?(s=n,a=s.srsCode,c=i||{},this.projection=new t.Proj.Projection(s,c.bounds)):(a=n,l=i,c=o||{},this.projection=new t.Proj.Projection(a,l,c.bounds)),t.Util.setOptions(this,c),this.code=a,this.transformation=this.options.transformation,this.options.origin&&(this.transformation=new t.Transformation(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales)this._scales=this.options.scales;else if(this.options.resolutions){this._scales=[];for(var d=this.options.resolutions.length-1;d>=0;d--)this.options.resolutions[d]&&(this._scales[d]=1/this.options.resolutions[d])}this.infinite=!this.options.bounds},scale:function(n){var i=Math.floor(n),o,a,s,l;return n===i?this._scales[n]:(o=this._scales[i],a=this._scales[i+1],s=a-o,l=n-i,o+s*l)},zoom:function(n){var i=this._closestElement(this._scales,n),o=this._scales.indexOf(i),a,s,l;return n===i?o:i===void 0?-1/0:(s=o+1,a=this._scales[s],a===void 0?1/0:(l=a-i,(n-i)/l+o))},distance:t.CRS.Earth.distance,R:t.CRS.Earth.R,_closestElement:function(n,i){for(var o,a=n.length;a--;)n[a]<=i&&(o===void 0||o<n[a])&&(o=n[a]);return o}}),t.Proj.GeoJSON=t.GeoJSON.extend({initialize:function(n,i){this._callLevel=0,t.GeoJSON.prototype.initialize.call(this,n,i)},addData:function(n){var i;n&&(n.crs&&n.crs.type==="name"?i=new t.Proj.CRS(n.crs.properties.name):n.crs&&n.crs.type&&(i=new t.Proj.CRS(n.crs.type+":"+n.crs.properties.code)),i!==void 0&&(this.options.coordsToLatLng=function(o){var a=t.point(o[0],o[1]);return i.projection.unproject(a)})),this._callLevel++;try{t.GeoJSON.prototype.addData.call(this,n)}finally{this._callLevel--,this._callLevel===0&&delete this.options.coordsToLatLng}}}),t.Proj.geoJson=function(n,i){return new t.Proj.GeoJSON(n,i)},t.Proj.ImageOverlay=t.ImageOverlay.extend({initialize:function(n,i,o){t.ImageOverlay.prototype.initialize.call(this,n,null,o),this._projectedBounds=i},_animateZoom:function(n){var i=this._map.getZoomScale(n.zoom),o=t.point(this._projectedBounds.min.x,this._projectedBounds.max.y),a=this._projectedToNewLayerPoint(o,n.zoom,n.center);t.DomUtil.setTransform(this._image,a,i)},_reset:function(){var n=this._map.getZoom(),i=this._map.getPixelOrigin(),o=t.bounds(this._transform(this._projectedBounds.min,n)._subtract(i),this._transform(this._projectedBounds.max,n)._subtract(i)),a=o.getSize();t.DomUtil.setPosition(this._image,o.min),this._image.style.width=a.x+"px",this._image.style.height=a.y+"px"},_projectedToNewLayerPoint:function(n,i,o){var a=this._map.getSize()._divideBy(2),s=this._map.project(o,i)._subtract(a)._round(),l=s.add(this._map._getMapPanePos());return this._transform(n,i)._subtract(l)},_transform:function(n,i){var o=this._map.options.crs,a=o.transformation,s=o.scale(i);return a.transform(n,s)}}),t.Proj.imageOverlay=function(n,i,o){return new t.Proj.ImageOverlay(n,i,o)},t.Proj})})(PXe);const mtt=[{officialName:"Afghanistan",allNames:["af","afġānistān","afghanistan","afg"],id:"AFG"},{id:"ALA",officialName:"Åland Islands",allNames:["ax","ala","åland islands","aland islands"]},{officialName:"Albania",allNames:["al","shqipëri","shqipëria","shqipnia","albania","alb"],id:"ALB"},{officialName:"Algeria",allNames:["dz","dzayer","algérie","algeria","dza"],id:"DZA"},{officialName:"American Samoa",allNames:["as","amerika sāmoa","amelika sāmoa","sāmoa amelika","american samoa","asm"],id:"ASM"},{id:"AND",officialName:"Andorra",allNames:["ad","and","andorra"]},{officialName:"Angola",allNames:["ao","república de angola","ʁɛpublika de an'ɡɔla","angola","ago"],id:"AGO"},{officialName:"Anguilla",allNames:["ai","anguilla","aia"],id:"AIA"},{id:"ATA",officialName:"Antarctica",allNames:["aq","ata","antarctica"]},{officialName:"Antigua and Barbuda",allNames:["ag","antigua and barbuda","atg"],id:"ATG"},{officialName:"Argentina",allNames:["ar","argentine republic","república argentina","argentina","arg"],id:"ARG"},{officialName:"Armenia",allNames:["am","hayastan","republic of armenia","հայաստանի հանրապետություն","armenia","arm"],id:"ARM"},{officialName:"Aruba",allNames:["aw","aruba","abw"],id:"ABW"},{officialName:"Australia",allNames:["au","australia","aus"],id:"AUS"},{officialName:"Austria",allNames:["at","österreich","osterreich","oesterreich","austria","aut"],id:"AUT"},{officialName:"Azerbaijan",allNames:["az","republic of azerbaijan","azərbaycan respublikası","azerbaijan","aze","azerbaijan republic"],id:"AZE"},{officialName:"Bahrain",allNames:["bh","kingdom of bahrain","mamlakat al-baḥrayn","bahrain","bhr"],id:"BHR"},{officialName:"Bangladesh",allNames:["bd","people's republic of bangladesh","gônôprôjatôntri bangladesh","bangladesh","bgd"],id:"BGD"},{officialName:"Barbados",allNames:["bb","barbados","brb"],id:"BRB"},{officialName:"Belarus",allNames:["by","bielaruś","republic of belarus","белоруссия","республика беларусь","belorussiya","respublika belarus’","belarus","blr"],id:"BLR"},{officialName:"Belgium",allNames:["be","belgië","belgie","belgien","belgique","kingdom of belgium","koninkrijk belgië","royaume de belgique","königreich belgien","belgium","bel"],id:"BEL"},{officialName:"Belize",allNames:["bz","belize","blz"],id:"BLZ"},{officialName:"Benin",allNames:["bj","republic of benin","république du bénin","benin","ben"],id:"BEN"},{officialName:"Bermuda",allNames:["bm","the islands ofbermuda","the bermudas","somers isles","bermuda","bmu"],id:"BMU"},{officialName:"Bhutan",allNames:["bt","kingdom of bhutan","bhutan","btn"],id:"BTN"},{officialName:"Bolivia",allNames:["bo","buliwya","wuliwya","plurinational state of bolivia","estado plurinacional de bolivia","buliwya mamallaqta","wuliwya suyu","tetã volívia","bolivia","bol","plurinational state of"],id:"BOL"},{id:"BES",officialName:"Bonaire",allNames:["bq","bes","bonaire","sint eustatius and saba","caribbean netherlands"]},{officialName:"Bosnia and Herzegovina",allNames:["ba","bosnia-herzegovina","босна и херцеговина","bosnia and herzegovina","bih"],id:"BIH"},{officialName:"Botswana",allNames:["bw","republic of botswana","lefatshe la botswana","botswana","bwa"],id:"BWA"},{id:"BVT",officialName:"Bouvet Island",allNames:["bv","bvt","bouvet island"]},{officialName:"Brazil",allNames:["br","brasil","federative republic of brazil","república federativa do brasil","brazil","bra"],id:"BRA"},{officialName:"British Indian Ocean Territory",allNames:["io","british indian ocean territory","iot"],id:"IOT"},{officialName:"Brunei",allNames:["bn","nation of brunei","the abode of peace","brunei","brn","brunei darussalam"],id:"BRN"},{officialName:"Bulgaria",allNames:["bg","republic of bulgaria","република българия","bulgaria","bgr"],id:"BGR"},{officialName:"Burkina Faso",allNames:["bf","burkina faso","bfa"],id:"BFA"},{officialName:"Burundi",allNames:["bi","republic of burundi","republika y'uburundi","république du burundi","burundi","bdi"],id:"BDI"},{officialName:"Cambodia",allNames:["kh","kingdom of cambodia","cambodia","khm"],id:"KHM"},{officialName:"Cameroon",allNames:["cm","republic of cameroon","république du cameroun","cameroon","cmr"],id:"CMR"},{officialName:"Canada",allNames:["ca","canada","can"],id:"CAN"},{officialName:"Cape Verde",allNames:["cv","republic of cabo verde","república de cabo verde","cape verde","cpv"],id:"CPV"},{officialName:"Cayman Islands",allNames:["ky","cayman islands","cym"],id:"CYM"},{officialName:"Central African Republic",allNames:["cf","central african republic","république centrafricaine","central african republic","caf"],id:"CAF"},{officialName:"Chad",allNames:["td","tchad","republic of chad","république du tchad","chad","tcd"],id:"TCD"},{officialName:"Chile",allNames:["cl","republic of chile","república de chile","chile","chl"],id:"CHL"},{officialName:"China",allNames:["cn","zhōngguó","zhongguo","zhonghua","people's republic of china","中华人民共和国","zhōnghuá rénmín gònghéguó","china","chn"],id:"CHN"},{officialName:"Christmas Island",allNames:["cx","territory of christmas island","christmas island","cxr"],id:"CXR"},{officialName:"Cocos (Keeling) Islands",allNames:["cc","territoryof the cocos (keeling) islands","keeling islands","cocos (keeling) islands","cck","cocos islands","cocos [keeling] islands"],id:"CCK"},{officialName:"Colombia",allNames:["co","republic of colombia","república de colombia","colombia","col"],id:"COL"},{officialName:"Comoros",allNames:["km","union of the comoros","union des comores","udzima wa komori","al-ittiḥād al-qumurī","comoros","com"],id:"COM"},{officialName:"Cook Islands",allNames:["ck","kūki 'āirani","cook islands","cok"],id:"COK"},{officialName:"Costa Rica",allNames:["cr","republic of costa rica","república de costa rica","costa rica","cri"],id:"CRI"},{officialName:"Croatia",allNames:["hr","hrvatska","republic of croatia","republika hrvatska","croatia","hrv","croatia, republic of","croatia democratic republic of the"],id:"HRV"},{officialName:"Cuba",allNames:["cu","republic of cuba","república de cuba","cuba","cub"],id:"CUB"},{id:"CUW",officialName:"Curaçao",allNames:["cw","cuw","curaçao","curacao"]},{officialName:"Cyprus",allNames:["cy","kýpros","kıbrıs","republic of cyprus","κυπριακή δημοκρατία","kıbrıs cumhuriyeti","cyprus","cyp"],id:"CYP"},{officialName:"Czech Republic",allNames:["cz","česká republika","česko","czech republic","cze"],id:"CZE"},{officialName:"Democratic Republic of the Congo",allNames:["cd","dr congo","congo-kinshasa","drc","democratic republic of the congo","cod","congo (kinshasa)","the democratic republic of the congo","congo, the democratic republic of the","congo [drc]","congo, dem. rep."],id:"COD"},{officialName:"Denmark",allNames:["dk","danmark","kingdom of denmark","kongeriget danmark","denmark","dnk"],id:"DNK"},{officialName:"Djibouti",allNames:["dj","jabuuti","gabuuti","republic of djibouti","république de djibouti","gabuutih ummuuno","jamhuuriyadda jabuuti","djibouti","dji"],id:"DJI"},{officialName:"Dominica",allNames:["dm","dominique","wai‘tu kubuli","commonwealth of dominica","dominica","dma"],id:"DMA"},{officialName:"Dominican Republic",allNames:["do","dominican republic","dom"],id:"DOM"},{officialName:"East Timor",allNames:["tl","east timor","democratic republic of timor-leste","república democrática de timor-leste","repúblika demokrátika timór-leste","east timor","tls","timor-leste"],id:"TLS"},{officialName:"Ecuador",allNames:["ec","republic of ecuador","república del ecuador","ecuador","ecu"],id:"ECU"},{officialName:"Egypt",allNames:["eg","arab republic of egypt","egypt","egy"],id:"EGY"},{officialName:"El Salvador",allNames:["sv","republic of el salvador","república de el salvador","el salvador","slv"],id:"SLV"},{officialName:"Equatorial Guinea",allNames:["gq","republic of equatorial guinea","república de guinea ecuatorial","république de guinée équatoriale","república da guiné equatorial","equatorial guinea","gnq"],id:"GNQ"},{officialName:"Eritrea",allNames:["er","state of eritrea","ሃገረ ኤርትራ","dawlatiritriyá","ʾertrā","iritriyā","eritrea","eri"],id:"ERI"},{officialName:"Estonia",allNames:["ee","eesti","republic of estonia","eesti vabariik","estonia","est"],id:"EST"},{officialName:"Ethiopia",allNames:["et","ʾītyōṗṗyā","federal democratic republic of ethiopia","የኢትዮጵያ ፌዴራላዊ ዲሞክራሲያዊ ሪፐብሊክ","ethiopia","eth"],id:"ETH"},{officialName:"Falkland Islands",allNames:["fk","islas malvinas","falkland islands","flk","falkland islands (malvinas)","falkland islands (islas malvinas)","falkland islands [malvinas]","falkland islands [islas malvinas]"],id:"FLK"},{officialName:"Faroe Islands",allNames:["fo","føroyar","færøerne","faroe islands","fro"],id:"FRO"},{officialName:"Federated States of Micronesia",allNames:["fm","federated states of micronesia","federated states of micronesia","fsm","micronesia","federated states of"],id:"FSM"},{officialName:"Fiji",allNames:["fj","viti","republic of fiji","matanitu ko viti","fijī gaṇarājya","fiji","fji"],id:"FJI"},{officialName:"Finland",allNames:["fi","suomi","republic of finland","suomen tasavalta","republiken finland","finland","fin"],id:"FIN"},{officialName:"France",allNames:["fr","french republic","république française","france","fra"],id:"FRA"},{officialName:"French Guiana",allNames:["gf","guiana","guyane","french guiana","guf"],id:"GUF"},{officialName:"French Polynesia",allNames:["pf","polynésie française","french polynesia","pōrīnetia farāni","french polynesia","pyf"],id:"PYF"},{officialName:"French Southern and Antarctic Lands",allNames:["tf","french southern andantarctic lands","atf","french southern territories"],id:"ATF"},{officialName:"Gabon",allNames:["ga","gabonese republic","république gabonaise","gabon","gab","gabon republic"],id:"GAB"},{officialName:"Georgia",allNames:["ge","sakartvelo","georgia","geo"],id:"GEO"},{officialName:"Germany",allNames:["de","federal republic of germany","bundesrepublik deutschland","germany","deu"],id:"DEU"},{officialName:"Ghana",allNames:["gh","ghana","gha"],id:"GHA"},{officialName:"Gibraltar",allNames:["gi","gibraltar","gib"],id:"GIB"},{officialName:"Greece",allNames:["gr","elláda","hellenic republic","ελληνική δημοκρατία","greece","grc"],id:"GRC"},{officialName:"Greenland",allNames:["gl","grønland","greenland","grl"],id:"GRL"},{officialName:"Grenada",allNames:["gd","grenada","grd"],id:"GRD"},{officialName:"Guadeloupe",allNames:["gp","gwadloup","guadeloupe","glp"],id:"GLP"},{officialName:"Guam",allNames:["gu","guåhån","guam","gum"],id:"GUM"},{officialName:"Guatemala",allNames:["gt","guatemala","gtm"],id:"GTM"},{officialName:"Guernsey",allNames:["gg","bailiwick of guernsey","bailliage de guernesey","guernsey","ggy"],id:"GGY"},{officialName:"Guinea",allNames:["gn","republic of guinea","république de guinée","guinea","gin"],id:"GIN"},{officialName:"Guinea-Bissau",allNames:["gw","republic of guinea-bissau","república da guiné-bissau","guinea-bissau","gnb"],id:"GNB"},{officialName:"Guyana",allNames:["gy","co-operative republic of guyana","guyana","guy"],id:"GUY"},{officialName:"Haiti",allNames:["ht","republic of haiti","république d'haïti","repiblik ayiti","haiti","hti"],id:"HTI"},{officialName:"Heard Island and McDonald Islands",allNames:["hm","heard island and mcdonald islands","hmd","heard and mcdonald islands"],id:"HMD"},{officialName:"Honduras",allNames:["hn","republic of honduras","república de honduras","honduras","hnd"],id:"HND"},{officialName:"Hong Kong",allNames:["hk","香港","hongkong","hkg","hong kong","hong kong, china"],id:"HKG"},{officialName:"Hungary",allNames:["hu","hungary","hun"],id:"HUN"},{officialName:"Iceland",allNames:["is","island","republic of iceland","lýðveldið ísland","iceland","isl"],id:"ISL"},{officialName:"India",allNames:["in","bhārat","republic of india","bharat ganrajya","india","ind"],id:"IND"},{officialName:"Indonesia",allNames:["id","republic of indonesia","republik indonesia","indonesia","idn"],id:"IDN"},{officialName:"Iran",allNames:["ir","islamic republic of iran","jomhuri-ye eslāmi-ye irān","iran","irn","islamic republic of"],id:"IRN"},{officialName:"Iraq",allNames:["iq","republic of iraq","jumhūriyyat al-‘irāq","iraq","irq"],id:"IRQ"},{officialName:"Ireland",allNames:["ie","éire","republic of ireland","poblacht na héireann","ireland","irl"],id:"IRL"},{officialName:"Isle of Man",allNames:["im","ellan vannin","mann","mannin","isle of man","imn"],id:"IMN"},{officialName:"Israel",allNames:["il","state of israel","medīnat yisrā'el","israel","isr"],id:"ISR"},{officialName:"Italy",allNames:["it","italian republic","repubblica italiana","italy","ita"],id:"ITA"},{officialName:"Ivory Coast",allNames:["ci","ivory coast","republic of côte d'ivoire","république de côte d'ivoire","ivory coast","civ","côte d'ivoire","cote d'ivoire","cote divoire","cã´te d'ivoire","cote d'lvoire"],id:"CIV"},{officialName:"Jamaica",allNames:["jm","jamaica","jam"],id:"JAM"},{officialName:"Japan",allNames:["jp","nippon","nihon","japan","jpn"],id:"JPN"},{officialName:"Jersey",allNames:["je","bailiwick of jersey","bailliage de jersey","bailliage dé jèrri","jersey","jey"],id:"JEY"},{officialName:"Jordan",allNames:["jo","hashemite kingdomof jordan","al-mamlakah al-urdunīyah al-hāshimīyah","jordan","jor"],id:"JOR"},{officialName:"Kazakhstan",allNames:["kz","qazaqstan","казахстан","republic of kazakhstan","қазақстан республикасы","qazaqstan respublïkası","республика казахстан","respublika kazakhstan","kazakhstan","kaz"],id:"KAZ"},{officialName:"Kenya",allNames:["ke","republic of kenya","jamhuri ya kenya","kenya","ken"],id:"KEN"},{officialName:"Kiribati",allNames:["ki","republic of kiribati","ribaberiki kiribati","kiribati","kir"],id:"KIR"},{officialName:"Kuwait",allNames:["kw","state of kuwait","dawlat al-kuwait","kuwait","kwt"],id:"KWT"},{officialName:"Kyrgyzstan",allNames:["kg","киргизия","kyrgyz republic","кыргыз республикасы","kyrgyz respublikasy","kyrgyzstan","kgz"],id:"KGZ"},{officialName:"Laos",allNames:["la","lao","lao people's democratic republic","sathalanalat paxathipatai paxaxon lao","laos","lao"],id:"LAO"},{officialName:"Latvia",allNames:["lv","republic of latvia","latvijas republika","latvia","lva"],id:"LVA"},{officialName:"Lebanon",allNames:["lb","lebanese republic","al-jumhūrīyah al-libnānīyah","lebanon","lbn"],id:"LBN"},{officialName:"Lesotho",allNames:["ls","kingdom of lesotho","muso oa lesotho","lesotho","lso"],id:"LSO"},{officialName:"Liberia",allNames:["lr","republic of liberia","liberia","lbr"],id:"LBR"},{officialName:"Libya",allNames:["ly","state of libya","dawlat libya","libya","lby"],id:"LBY"},{officialName:"Liechtenstein",allNames:["li","principality of liechtenstein","fürstentum liechtenstein","liechtenstein","lie"],id:"LIE"},{officialName:"Lithuania",allNames:["lt","republic of lithuania","lietuvos respublika","lithuania","ltu"],id:"LTU"},{officialName:"Luxembourg",allNames:["lu","grand duchy of luxembourg","grand-duché de luxembourg","großherzogtum luxemburg","groussherzogtum lëtzebuerg","luxembourg","lux"],id:"LUX"},{officialName:"Macau",allNames:["mo","澳门","macao special administrative region of the people's republic of china","中華人民共和國澳門特別行政區","região administrativa especial de macau da república popular da china","macau","mac","macao","macao, china","macau, china"],id:"MAC"},{officialName:"Madagascar",allNames:["mg","republic of madagascar","repoblikan'i madagasikara","république de madagascar","madagascar","mdg"],id:"MDG"},{officialName:"Malawi",allNames:["mw","republic of malawi","malawi","mwi"],id:"MWI"},{officialName:"Malaysia",allNames:["my","malaysia","mys"],id:"MYS"},{officialName:"Maldives",allNames:["mv","maldive islands","republic of the maldives","dhivehi raajjeyge jumhooriyya","maldives","mdv"],id:"MDV"},{officialName:"Mali",allNames:["ml","republic of mali","république du mali","mali","mli"],id:"MLI"},{officialName:"Malta",allNames:["mt","republic of malta","repubblika ta' malta","malta","mlt"],id:"MLT"},{officialName:"Marshall Islands",allNames:["mh","republic of the marshall islands","aolepān aorōkin m̧ajeļ","marshall islands","mhl"],id:"MHL"},{officialName:"Martinique",allNames:["mq","martinique","mtq"],id:"MTQ"},{officialName:"Mauritania",allNames:["mr","islamic republic of mauritania","al-jumhūriyyah al-ʾislāmiyyah al-mūrītāniyyah","mauritania","mrt"],id:"MRT"},{officialName:"Mauritius",allNames:["mu","republic of mauritius","république de maurice","mauritius","mus"],id:"MUS"},{officialName:"Mayotte",allNames:["yt","department of mayotte","département de mayotte","mayotte","myt"],id:"MYT"},{officialName:"Mexico",allNames:["mx","mexicanos","united mexican states","estados unidos mexicanos","mexico","mex"],id:"MEX"},{officialName:"Moldova",allNames:["md","republic of moldova","republica moldova","moldova","mda","republic of"],id:"MDA"},{officialName:"Monaco",allNames:["mc","principality of monaco","principauté de monaco","monaco","mco"],id:"MCO"},{officialName:"Mongolia",allNames:["mn","mongolia","mng"],id:"MNG"},{id:"MNE",officialName:"Montenegro",allNames:["me","mne","montenegro"]},{officialName:"Montserrat",allNames:["ms","montserrat","msr"],id:"MSR"},{officialName:"Morocco",allNames:["ma","kingdom of morocco","al-mamlakah al-maġribiyah","morocco","mar","morroco"],id:"MAR"},{officialName:"Mozambique",allNames:["mz","republic of mozambique","república de moçambique","mozambique","moz"],id:"MOZ"},{id:"MMR",officialName:"Myanmar",allNames:["mm","mmr","myanmar","myanmar (burma)","myanmar [burma]","burma"]},{officialName:"Namibia",allNames:["na","namibië","republic of namibia","namibia","nam"],id:"NAM"},{officialName:"Nauru",allNames:["nr","naoero","pleasant island","republic of nauru","ripublik naoero","nauru","nru"],id:"NRU"},{officialName:"Nepal",allNames:["np","federal democratic republic of nepal","loktāntrik ganatantra nepāl","nepal","npl"],id:"NPL"},{officialName:"Netherlands",allNames:["nl","holland","nederland","netherlands","nld","the netherlands"],id:"NLD"},{officialName:"New Caledonia",allNames:["nc","new caledonia","ncl"],id:"NCL"},{officialName:"New Zealand",allNames:["nz","aotearoa","new zealand","nzl"],id:"NZL"},{officialName:"Nicaragua",allNames:["ni","republic of nicaragua","república de nicaragua","nicaragua","nic"],id:"NIC"},{officialName:"Niger",allNames:["ne","nijar","republic of niger","république du niger","niger","ner"],id:"NER"},{officialName:"Nigeria",allNames:["ng","nijeriya","naíjíríà","federal republic of nigeria","nigeria","nga"],id:"NGA"},{officialName:"Niue",allNames:["nu","niue","niu"],id:"NIU"},{officialName:"Norfolk Island",allNames:["nf","territory of norfolk island","teratri of norf'k ailen","norfolk island","nfk"],id:"NFK"},{officialName:"North Korea",allNames:["kp","democratic people's republic of korea","조선민주주의인민공화국","chosŏn minjujuŭi inmin konghwaguk","north korea","prk","korea, democratic people's republic of","korea, north"],id:"PRK"},{officialName:"Northern Mariana Islands",allNames:["mp","commonwealth of the northern mariana islands","sankattan siha na islas mariånas","northern mariana islands","mnp"],id:"MNP"},{officialName:"Norway",allNames:["no","norge","noreg","kingdom of norway","kongeriket norge","kongeriket noreg","norway","nor"],id:"NOR"},{officialName:"Oman",allNames:["om","sultanate of oman","salṭanat ʻumān","oman","omn"],id:"OMN"},{officialName:"Pakistan",allNames:["pk","pākistān","islamic republic of pakistan","islāmī jumhūriya'eh pākistān","pakistan","pak"],id:"PAK"},{officialName:"Palau",allNames:["pw","republic of palau","beluuer a belau","palau","plw"],id:"PLW"},{id:"PSE",officialName:"Palestinian Authority",allNames:["ps","pse","palestinian authority","palestinian territory"]},{officialName:"Panama",allNames:["pa","republic of panama","república de panamá","panama","pan"],id:"PAN"},{officialName:"Papua New Guinea",allNames:["pg","independent state of papua new guinea","independen stet bilong papua niugini","papua new guinea","png"],id:"PNG"},{officialName:"Paraguay",allNames:["py","republic of paraguay","república del paraguay","tetã paraguái","paraguay","pry"],id:"PRY"},{officialName:"Peru",allNames:["pe","republic of peru","república del perú","peru","per"],id:"PER"},{officialName:"Philippines",allNames:["ph","republic of the philippines","repúblika ng pilipinas","philippines","phl"],id:"PHL"},{officialName:"Pitcairn Islands",allNames:["pn","pitcairn henderson ducie and oeno islands","pitcairn islands","pcn","pitcairn"],id:"PCN"},{officialName:"Poland",allNames:["pl","republic of poland","rzeczpospolita polska","poland","pol"],id:"POL"},{officialName:"Portugal",allNames:["pt","portuguesa","portuguese republic","república portuguesa","portugal","prt"],id:"PRT"},{officialName:"Puerto Rico",allNames:["pr","commonwealth of puerto rico","estado libre asociado de puerto rico","puerto rico","pri"],id:"PRI"},{officialName:"Qatar",allNames:["qa","state of qatar","dawlat qaṭar","qatar","qat"],id:"QAT"},{officialName:"Republic of Macedonia",allNames:["mk","republic of macedonia","република македонија","republic of macedonia","mkd","macedonia","macedonia (fyrom)","macedonia [fyrom]","the former yugoslav republic of","the former yugoslav republic of macedonia"],id:"MKD"},{officialName:"Republic of the Congo",allNames:["cg","congo-brazzaville","republic of the congo","cog","congo (brazzaville)","congo [republic]","congo","congo, rep."],id:"COG"},{officialName:"Réunion",allNames:["re","reunion","réunion","reu","rã©union"],id:"REU"},{officialName:"Romania",allNames:["ro","rumania","roumania","românia","romania","rou"],id:"ROU"},{officialName:"Russia",allNames:["ru","rossiya","russian federation","российская федерация","rossiyskaya federatsiya","russia","rus"],id:"RUS"},{officialName:"Rwanda",allNames:["rw","republic of rwanda","repubulika y'u rwanda","république du rwanda","rwanda","rwa"],id:"RWA"},{id:"BLM",officialName:"Saint Barthélemy",allNames:["bl","blm","saint barthélemy","saint barthelemy","st barthelemy"]},{officialName:"Saint Helena",allNames:["sh","saint helena","shn","st helena","ascension and tristan da cunha"],id:"SHN"},{officialName:"Saint Kitts and Nevis",allNames:["kn","federation of saint christopher and nevis","saint kitts and nevis","kna","st kitts and nevis","saint kitts-nevis","st kitts-nevis"],id:"KNA"},{officialName:"Saint Lucia",allNames:["lc","saint lucia","lca","st lucia"],id:"LCA"},{officialName:"Saint Pierre and Miquelon",allNames:["pm","collectivité territoriale de saint-pierre-et-miquelon","saint pierre andmiquelon","spm","st pierre and miquelon","saint pierre and miquelon","st. pierre and miquelon"],id:"SPM"},{officialName:"Saint Vincent and the Grenadines",allNames:["vc","saint vincent and the grenadines","vct","st vincent and the grenadines"],id:"VCT"},{officialName:"Samoa",allNames:["ws","independent state of samoa","malo saʻoloto tutoʻatasi o sāmoa","samoa","wsm","western samoa"],id:"WSM"},{officialName:"San Marino",allNames:["sm","republic of san marino","repubblica di san marino","san marino","smr"],id:"SMR"},{officialName:"São Tomé and Príncipe",allNames:["st","democratic republic of são tomé and príncipe","república democrática de são tomé e príncipe","são tomé and príncipe","stp","sao tome and principe","sã£o tomã© and prãncipe"],id:"STP"},{officialName:"Saudi Arabia",allNames:["sa","kingdom of saudi arabia","al-mamlakah al-‘arabiyyah as-su‘ūdiyyah","saudi arabia","sau"],id:"SAU"},{officialName:"Senegal",allNames:["sn","republic of senegal","république du sénégal","senegal","sen"],id:"SEN"},{id:"SRB",officialName:"Serbia",allNames:["rs","srb","serbia"]},{officialName:"Seychelles",allNames:["sc","republic of seychelles","repiblik sesel","république des seychelles","seychelles","syc"],id:"SYC"},{officialName:"Sierra Leone",allNames:["sl","republic of sierra leone","sierra leone","sle"],id:"SLE"},{officialName:"Singapore",allNames:["sg","singapura","republik singapura","新加坡共和国","singapore","sgp"],id:"SGP"},{officialName:"Slovakia",allNames:["sk","slovak republic","slovenská republika","slovakia","svk","slovakia (slovak republic)"],id:"SVK"},{officialName:"Slovenia",allNames:["si","republic of slovenia","republika slovenija","slovenia","svn"],id:"SVN"},{officialName:"Solomon Islands",allNames:["sb","solomon islands","slb"],id:"SLB"},{officialName:"Somalia",allNames:["so","aṣ-ṣūmāl","federal republic of somalia","jamhuuriyadda federaalka soomaaliya","jumhūriyyat aṣ-ṣūmāl al-fiderāliyya","somalia","som"],id:"SOM"},{officialName:"South Africa",allNames:["za","rsa","suid-afrika","republic of south africa","south africa","zaf"],id:"ZAF"},{officialName:"South Georgia",allNames:["gs","south georgia and the south sandwich islands","south georgia","sgs"],id:"SGS"},{officialName:"South Korea",allNames:["kr","republic of korea","south korea","kor","korea, republic of","korea, south"],id:"KOR"},{officialName:"South Sudan",allNames:["ss","south sudan","ssd"],id:"SSD"},{officialName:"Spain",allNames:["es","kingdom of spain","reino deespaña","spain","esp"],id:"ESP"},{officialName:"Sri Lanka",allNames:["lk","ilaṅkai","democraticsocialist republic of sri lanka","sri lanka","lka"],id:"LKA"},{id:"SXM",officialName:"St Maarten",allNames:["sx","sxm","st maarten","sint maarten","sint maarten (dutch part)","saint-martin (pays-bas)"]},{id:"MAF",officialName:"St Martin (French part)",allNames:["mf","maf","st martin (french part)","saint martin (french part)","saint-martin (france)"]},{officialName:"Sudan",allNames:["sd","republic of the sudan","jumhūrīyat as-sūdān","sudan","sdn"],id:"SDN"},{officialName:"Suriname",allNames:["sr","sarnam","sranangron","republic of suriname","republiek suriname","suriname","sur"],id:"SUR"},{officialName:"Svalbard and Jan Mayen",allNames:["sj","svalbard and jan mayen islands","svalbard and jan mayen","sjm"],id:"SJM"},{officialName:"Swaziland",allNames:["sz","weswatini","swatini","ngwane","kingdom of swaziland","umbuso waseswatini","swaziland","swz"],id:"SWZ"},{officialName:"Sweden",allNames:["se","kingdom of sweden","konungariket sverige","sweden","swe"],id:"SWE"},{officialName:"Switzerland",allNames:["ch","swiss confederation","schweiz","suisse","svizzera","svizra","switzerland","che"],id:"CHE"},{officialName:"Syria",allNames:["sy","syrian arab republic","al-jumhūrīyah al-ʻarabīyah as-sūrīyah","syria","syr"],id:"SYR"},{officialName:"Taiwan",allNames:["tw","táiwān","republic of china","中華民國","zhōnghuá mínguó","taiwan","twn","taiwan, province of china"],id:"TWN"},{officialName:"Tajikistan",allNames:["tj","toçikiston","republic of tajikistan","ҷумҳурии тоҷикистон","çumhuriyi toçikiston","tajikistan","tjk"],id:"TJK"},{officialName:"Tanzania",allNames:["tz","united republic of tanzania","jamhuri ya muungano wa tanzania","tanzania","tza","united republic of"],id:"TZA"},{officialName:"Thailand",allNames:["th","prathet","thai","kingdom of thailand","ราชอาณาจักรไทย","ratcha anachak thai","thailand","tha"],id:"THA"},{officialName:"The Bahamas",allNames:["bs","commonwealth of the bahamas","the bahamas","bhs","bahamas"],id:"BHS"},{officialName:"The Gambia",allNames:["gm","republic of the gambia","the gambia","gmb","gambia"],id:"GMB"},{officialName:"Togo",allNames:["tg","togolese","togolese republic","république togolaise","togo","tgo"],id:"TGO"},{officialName:"Tokelau",allNames:["tk","tokelau","tkl"],id:"TKL"},{officialName:"Tonga",allNames:["to","tonga","ton"],id:"TON"},{officialName:"Trinidad and Tobago",allNames:["tt","republic of trinidad and tobago","trinidad and tobago","tto"],id:"TTO"},{officialName:"Tunisia",allNames:["tn","republic of tunisia","al-jumhūriyyah at-tūnisiyyah","tunisia","tun"],id:"TUN"},{officialName:"Turkey",allNames:["tr","turkiye","republic of turkey","türkiye cumhuriyeti","turkey","tur"],id:"TUR"},{officialName:"Turkmenistan",allNames:["tm","turkmenistan","tkm"],id:"TKM"},{id:"TCA",officialName:"Turks and Caicos Islands",allNames:["tc","tca","turks and caicos islands"]},{officialName:"Tuvalu",allNames:["tv","tuvalu","tuv"],id:"TUV"},{officialName:"Uganda",allNames:["ug","republic of uganda","jamhuri ya uganda","uganda","uga"],id:"UGA"},{officialName:"Ukraine",allNames:["ua","ukrayina","ukraine","ukr"],id:"UKR"},{officialName:"United Arab Emirates",allNames:["ae","uae","united arab emirates","are"],id:"ARE"},{officialName:"United Kingdom",allNames:["gb","uk","great britain","united kingdom","gbr","britain","england"],id:"GBR"},{officialName:"United States",allNames:["us","usa","united states of america","united states","usa"],id:"USA"},{id:"UMI",officialName:"United States Minor Outlying Islands",allNames:["um","umi","united states minor outlying islands"]},{officialName:"Uruguay",allNames:["uy","oriental republic of uruguay","república oriental del uruguay","uruguay","ury"],id:"URY"},{officialName:"Uzbekistan",allNames:["uz","republic of uzbekistan","o‘zbekiston respublikasi","ўзбекистон республикаси","uzbekistan","uzb"],id:"UZB"},{officialName:"Vanuatu",allNames:["vu","republic of vanuatu","ripablik blong vanuatu","république de vanuatu","vanuatu","vut"],id:"VUT"},{id:"VAT",officialName:"Vatican",allNames:["va","vat","vatican","vatican city","vatican city state","holy see (vatican city state)","holy see [vatican city state]"]},{officialName:"Venezuela",allNames:["ve","bolivarian republic of venezuela","república bolivariana de venezuela","venezuela","ven","bolivarian republic of"],id:"VEN"},{officialName:"Vietnam",allNames:["vn","socialist republic of vietnam","cộng hòa xã hội chủ nghĩa việt nam","vietnam","vnm","viet nam"],id:"VNM"},{id:"VGB",officialName:"Virgin Islands",allNames:["vg","vgb","virgin islands","british","british virgin islands","virgin islands (british)"]},{id:"VIR",officialName:"Virgin Islands",allNames:["vi","vir","virgin islands","u.s.","us virgin islands","u.s. virgin islands","virgin islands (u.s.)"]},{officialName:"Wallis and Futuna",allNames:["wf","territory of the wallis and futuna islands","territoire des îles wallis et futuna","wallis and futuna","wlf","wallis and futuna islands"],id:"WLF"},{officialName:"Western Sahara",allNames:["eh","taneẓroft tutrimt","western sahara","esh"],id:"ESH"},{officialName:"Yemen",allNames:["ye","yemeni republic","al-jumhūriyyah al-yamaniyyah","yemen","yem"],id:"YEM"},{officialName:"Zambia",allNames:["zm","republic of zambia","zambia","zmb"],id:"ZMB"},{officialName:"Zimbabwe",allNames:["zw","republic of zimbabwe","zimbabwe","zwe"],id:"ZWE"}],vtt="#d6d9dc",ytt="#FBFAFA";function btt(e,t,r){return e.reduce((i,o)=>{const a=o.id;let s;if(r==="world"){const l=mtt.find(c=>c.id===a);l?s=t.find(c=>l.allNames.includes(c.geoName.trim().toLowerCase())):s=t.find(c=>c.geoName.trim().toLowerCase()===o.properties.name.trim().toLowerCase())}else s=t.find(l=>l.geoName.trim().toLowerCase()===o.properties.name.trim().toLowerCase());return i[a]={geoDataElement:s,style:{color:vtt,weight:1,opacity:1,fillColor:s&&s.color||ytt,fillOpacity:1},displayName:(s==null?void 0:s.geoName)||o.properties.name},i},{})}const xtt="sdkComponentInit",Cne=ce.createContext(!1),wtt=({skipNested:e=!0,children:t})=>pe(Cne.Provider,{value:e,children:t}),Ctt=(e,t)=>{const{tracking:r,app:n}=hr(),{trackEvent:i}=F3(),o=ce.useContext(Cne),a=ce.useRef(!1);ce.useEffect(()=>{if(!r||!n)return;if(!a.current&&!o){const l={packageName:r.packageName,packageVersion:"2.4.0",componentName:e,attributesUsed:Object.entries(t).filter(([,c])=>!!c).map(([c])=>c).join(", ")};i(xtt,l,!r.enabled).finally(()=>a.current=!0)}},[e,t,r,o,i,n])};var _tt="[object Boolean]";function _ne(e){return e===!0||e===!1||Jo(e)&&Al(e)==_tt}const Yz=class Yz extends ce.Component{constructor(t){super(t),this.postponedErrors=[],this.handler=t.handler,this.componentName=t.componentName}componentDidMount(){var t;this.context.isInitialized&&(this.httpClient=(t=this.context.app)==null?void 0:t.httpClient)}componentDidCatch(t){throw this.context.tracking.enabled&&(this.httpClient?this.sendErrorTracking(t):this.postponedErrors.push(t)),t}sendErrorTracking(t){try{this.handler({packageName:"sdk-ui",packageVersion:"2.4.0",component:this.componentName,error:t})}catch(r){console.log("Failed to send tracking error event: ",r)}}render(){return this.httpClient&&this.postponedErrors.length>0&&this.postponedErrors.forEach(t=>this.sendErrorTracking(t)),this.postponedErrors=[],this.props.children}};Yz.contextType=FC;let c6=Yz;const Stt=({componentName:e,config:t})=>{const{skip:r,transparent:n}=t||{};return i=>function(a){const{trackError:s}=F3();return _ne(r)&&r||yu(r)&&r(a)?pe(i,ue({},a)):(Ctt(e,a),pe(wtt,{skipNested:!n,children:pe(c6,{componentName:e,handler:s,children:pe(i,ue({},a))})}))}},u6={container:"_container_1wquj_1",card:"_card_1wquj_11",text:"_text_1wquj_19"};function Sne({color:e="#FFCB05"}){return pe("svg",{width:"53px",height:"53px",viewBox:"0 0 53 53",children:pe("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:Ve("g",{children:[pe("polygon",{points:"26.4996 -0.000100000005 -0.000400000001 26.5009 26.4996 52.9999 53.0006 26.5009",fill:e}),pe("path",{d:"M24.5,39.054 L24.5,35.054 L28.5,35.054 L28.5,39.054 L24.5,39.054 Z M28.5,31.0536 L24.5,31.0536 L23.5,13.0536 L29.5,13.0536 L28.5,31.0536 Z",fill:"#FFFFFF"})]})})})}const d6="#F2F2F2",h6=4,p6="#D5D5D5",d0=1,kne="#DADADA",f6=15,ktt={chart:{backgroundColor:"#FFFFFF",textColor:"#000000",secondaryTextColor:"#E4E4E4",animation:{init:{duration:"auto"},redraw:{duration:"auto"}}},typography:{fontFamily:'"Open Sans","Roboto","Helvetica","Arial",sans-serif',primaryTextColor:"#5B6372",secondaryTextColor:"#9EA2AB"},palette:{variantColors:["#00cee6","#9b9bd7","#6eda55","#fc7570","#fbb755","#218a8c"]},general:{backgroundColor:"#ffffff",brandColor:"#ffcb05",primaryButtonTextColor:"#3a4356",primaryButtonHoverColor:"#f2b900",popover:{cornerRadius:0,shadow:"0 -1px 5px 1px rgba(58, 67, 86, .2)",header:{backgroundColor:"#F4F4F8",textColor:"#5B6372"},footer:{backgroundColor:"#FFFFFF",textColor:"#5B6372"},content:{backgroundColor:"#FFFFFF",textColor:"#5B6372",clickableList:{item:{textColor:"#5B6372",backgroundColor:"#FFFFFF",hover:{textColor:"#000000",backgroundColor:"#F4F4F8"}}}},input:{backgroundColor:"#F4F4F8",textColor:"#5B6372",borderColor:{default:"transparent",focus:"#5B6372",hover:"transparent"},cornerRadius:4,dropdownList:{backgroundColor:"#FFFFFF",textColor:"#5B6372",borderColor:"#9EA2AB",cornerRadius:4,shadow:"0 -1px 5px 1px rgba(58, 67, 86, .2)",item:{backgroundColor:{default:"#FFFFFF",focus:"#FFFFFF",hover:"#F4F4F8"},textColor:"#5B6372"}},datepicker:{backgroundColor:"#FFFFFF",textColor:"#5B6372",cornerRadius:4,shadow:"0 -1px 5px 1px rgba(58, 67, 86, .2)",item:{backgroundColor:{default:"#FFFFFF",focus:"#FFFFFF",hover:"#F4F4F8"},textColor:{default:"#5B6372",focus:"#5B6372",hover:"#5B6372"}}}}},buttons:{cancel:{backgroundColor:{default:"#EDEEF1",focus:"#D0D3DB",hover:"#D0D3DB"},textColor:"#3A4356"}}},widget:{spaceAround:"None",cornerRadius:"None",shadow:"None",border:!1,borderColor:"#9EA2AB",header:{titleTextColor:"#5B6372",titleFontSize:f6,titleAlignment:"Left",dividerLine:!1,dividerLineColor:"#5B6372",backgroundColor:"#FFFFFF"}},dashboard:{backgroundColor:"#FFFFFF",dividerLineWidth:h6,dividerLineColor:d6,borderColor:p6,borderWidth:d0,toolbar:{primaryTextColor:"#5B6372",secondaryTextColor:"#9EA2AB",backgroundColor:"#FFFFFF"}},filter:{panel:{titleColor:"#5B6372",backgroundColor:"#F6F6F6",borderColor:kne,borderWidth:d0}},aiChat:{backgroundColor:"rgba(244, 244, 248, 1)",primaryTextColor:"rgba(38, 46, 61, 0.8)",secondaryTextColor:"rgba(38, 46, 61, 0.55)",primaryFontSize:["13px","18px"],body:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"16px",paddingBottom:"1px",gapBetweenMessages:"16px"},footer:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"12px",paddingBottom:"16px"},userMessages:{backgroundColor:"rgba(255, 255, 255, 1)"},systemMessages:{backgroundColor:"rgba(255, 255, 255, 1)"},input:{backgroundColor:"rgba(255, 255, 255, 1)",focus:{outlineColor:"rgba(38, 46, 61, 0.5)"}},header:{textColor:"rgba(38, 46, 61, 0.8)",backgroundColor:"rgba(255, 255, 255, 1)"},dropup:{backgroundColor:"rgba(255, 255, 255, 1)",boxShadow:"0px 1px 2px rgba(9, 9, 10, 0.1), 0px 2px 4px rgba(9, 9, 10, 0.1)",borderRadius:"4px",headers:{textColor:"rgba(38, 46, 61, 0.8)",hover:{backgroundColor:"rgba(244, 244, 248, 1)"}},items:{textColor:"rgba(38, 46, 61, 0.8)",hover:{backgroundColor:"rgba(244, 244, 248, 1)"}}},border:"1px solid #c6c9ce",borderRadius:"30px",suggestions:{textColor:"rgba(38, 46, 61, 1)",backgroundColor:"rgba(244, 244, 248, 1)",border:"1px solid",borderRadius:"16px",borderGradient:["rgba(75, 153, 233, 1)","rgba(102, 57, 191, 1)"],hover:{textColor:"rgba(38, 46, 61, 1)",backgroundColor:"rgba(12, 14, 18, 0.07)"},loadingGradient:["rgba(194, 196, 203, 1)","rgba(236, 236, 239, 1)"],gap:"8px"},clickableMessages:{textColor:"rgba(38, 46, 61, 1)",backgroundColor:"rgba(244, 244, 248, 1)",border:"1px solid",borderGradient:["rgba(75, 153, 233, 1)","rgba(102, 57, 191, 1)"],hover:{textColor:"rgba(38, 46, 61, 1)",backgroundColor:"rgba(12, 14, 18, 0.07)"}},dataTopics:{backgroundColor:"rgba(255, 255, 255, 1)",items:{textColor:"rgba(38, 46, 61, 1)",backgroundColor:"rgba(244, 244, 248, 1)"}},icons:{color:"rgba(38, 46, 61, 0.67)",feedbackIcons:{hoverColor:"rgba(12, 14, 18, 0.07)"}},tooltips:{backgroundColor:"rgba(255, 255, 255, 1)",textColor:"rgba(38, 46, 61, 0.8)",boxShadow:"0px 4px 12px 0px rgba(9, 9, 10, 0.20), 0px 1px 4px 0px rgba(9, 9, 10, 0.10)"}}},Mtt={chart:{backgroundColor:"#313138",textColor:"#FFFFFF",secondaryTextColor:"#C5C8CF",animation:{init:{duration:"auto"},redraw:{duration:"auto"}}},typography:{fontFamily:'"Open Sans","Roboto","Helvetica","Arial",sans-serif',primaryTextColor:"#FFFFFF",secondaryTextColor:"#C5C8CF"},palette:{variantColors:["#00cee6","#9b9bd7","#6eda55","#fc7570","#fbb755","#218a8c"]},general:{backgroundColor:"#16161C",brandColor:"#FFCB05",primaryButtonTextColor:"#3A4356",primaryButtonHoverColor:"#F2B900",popover:{cornerRadius:0,shadow:"0 -1px 5px 1px rgba(58, 67, 86, .2)",header:{backgroundColor:"#313138",textColor:"#FFFFFF"},footer:{backgroundColor:"#16161C",textColor:"#FFFFFF"},content:{backgroundColor:"#16161C",textColor:"#FFFFFF",clickableList:{item:{textColor:"#FFFFFF",backgroundColor:"#16161C",hover:{textColor:"#FFFFFF",backgroundColor:"#3C3C42"}}}},input:{cornerRadius:4,backgroundColor:"#3C3C42",textColor:"#FFFFFF",borderColor:{default:"transparent",focus:"#FFFFFF",hover:"transparent"},dropdownList:{backgroundColor:"#16161C",textColor:"#FFFFFF",borderColor:"#9EA2AB",cornerRadius:4,shadow:"0 -1px 5px 1px rgba(58, 67, 86, .2)",item:{backgroundColor:{default:"#16161C",focus:"#16161C",hover:"#3C3C42"},textColor:"#FFFFFF"}},datepicker:{backgroundColor:"#FFFFFF",textColor:"#5B6372",cornerRadius:4,shadow:"0 -1px 5px 1px rgba(58, 67, 86, .2)",item:{backgroundColor:{default:"#FFFFFF",focus:"#FFFFFF",hover:"#F4F4F8"},textColor:{default:"#5B6372",focus:"#5B6372",hover:"#5B6372"}}}}},buttons:{cancel:{backgroundColor:{default:"#EDEEF1",focus:"#D0D3DB",hover:"#D0D3DB"},textColor:"#3A4356"}}},widget:{spaceAround:"None",cornerRadius:"None",shadow:"None",border:!1,borderColor:"#C5C8CF",header:{titleTextColor:"#FFFFFF",titleAlignment:"Left",titleFontSize:f6,dividerLine:!1,dividerLineColor:"#FFFFFF",backgroundColor:"#313138"}},dashboard:{backgroundColor:"#313138",dividerLineWidth:h6,dividerLineColor:d6,borderColor:p6,borderWidth:d0,toolbar:{primaryTextColor:"#FFFFFF",secondaryTextColor:"#C5C8CF",backgroundColor:"#313138"}},filter:{panel:{titleColor:"#FFFFFF",backgroundColor:"#313138",borderColor:"#DADADA",borderWidth:d0}},aiChat:{backgroundColor:"rgba(23, 28, 38, 1)",primaryTextColor:"rgba(242, 247, 255, 0.9)",secondaryTextColor:"rgba(242, 247, 255, 0.4)",primaryFontSize:["13px","18px"],body:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"16px",paddingBottom:"1px",gapBetweenMessages:"16px"},footer:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"12px",paddingBottom:"16px"},userMessages:{backgroundColor:"rgba(31, 92, 153, 1)"},systemMessages:{backgroundColor:"rgba(46, 55, 77, 1)"},input:{backgroundColor:"rgba(242, 247, 255, 0.1)",focus:{outlineColor:"rgba(242, 247, 255, 0.5)"}},header:{backgroundColor:"#313138",textColor:"rgba(242, 247, 255, 0.9)"},dropup:{backgroundColor:"rgba(38, 46, 64, 1)",boxShadow:"0px 1px 4px 0px #020203, 0px 2px 12px 2px rgba(2, 2, 3, 0.25)",borderRadius:"8px",headers:{textColor:"rgba(242, 247, 255, 0.6)",hover:{backgroundColor:"rgba(242, 247, 255, 0.1)"}},items:{textColor:"rgba(242, 247, 255, 0.9)",hover:{backgroundColor:"rgba(242, 247, 255, 0.1)"}}},border:!1,borderRadius:"30px",suggestions:{textColor:"rgba(88, 192, 244, 1)",backgroundColor:"rgba(23, 28, 38, 1)",border:"1px solid",borderRadius:"16px",borderGradient:["rgba(75, 153, 233, 1)","rgba(102, 57, 191, 1)"],hover:{textColor:"rgba(88, 192, 244, 1)",backgroundColor:"rgba(242, 247, 255, 0.1)"},loadingGradient:["rgba(242, 247, 255, 0.1)","rgba(242, 247, 255, 0.3)"],gap:"8px"},clickableMessages:{textColor:"rgba(88, 192, 244, 1)",backgroundColor:"rgba(23, 28, 38, 1)",border:"1px solid",borderGradient:["rgba(75, 153, 233, 1)","rgba(102, 57, 191, 1)"],hover:{textColor:"rgba(88, 192, 244, 1)",backgroundColor:"rgba(242, 247, 255, 0.1)"}},dataTopics:{backgroundColor:"rgba(23, 28, 38, 1)",items:{textColor:"rgba(242, 247, 255, 0.9)",backgroundColor:"rgba(46, 55, 77, 1)"}},icons:{color:"rgba(242, 247, 255, 0.5)",feedbackIcons:{hoverColor:"rgba(242, 247, 255, 0.1)"}},tooltips:{textColor:"rgba(242, 247, 255, 0.9)",backgroundColor:"rgba(46, 55, 77, 1)",boxShadow:"0px 1px 8px 0px #020203, 0px 4px 24px 4px rgba(2, 2, 3, 0.25)"}}},Z1=(e=!1)=>ki(e?Mtt:ktt),g6=ce.createContext({themeSettings:Z1()}),pt=()=>ce.useContext(g6),Mne=({error:e=new ft("errors.componentRenderError")})=>{var u,g,f,p,x,S;const{themeSettings:t}=pt(),{app:r}=hr(),{t:n}=At(),[i,o]=ce.useState(!1),a=()=>{o(!0)},s=()=>{o(!1)},l=pe("div",{className:"csdk-flex csdk-justify-center csdk-mb-[10px]",children:pe(Sne,{color:(u=t==null?void 0:t.general)==null?void 0:u.brandColor})}),c=e instanceof Xv?n(e.key,ue({},e.interpolationOptions)):n(e instanceof Error?e.message:e),d=n("errorBoxText",{errorMessage:c,interpolation:{escapeValue:!1}}),h=(f=(g=r==null?void 0:r.settings)==null?void 0:g.errorBoundaryConfig)==null?void 0:f.alwaysShowErrorText;return pe("div",{onMouseEnter:h?void 0:a,onMouseLeave:h?void 0:s,className:u6.container,"aria-label":"error-box",children:Ve("div",{className:u6.card,style:{backgroundColor:((p=t==null?void 0:t.general)==null?void 0:p.backgroundColor)||"rgba(255,255,255,0.5)"},children:[l,(h||i)&&pe("div",{className:u6.text,style:{color:((x=t==null?void 0:t.typography)==null?void 0:x.primaryTextColor)||no,fontFamily:((S=t==null?void 0:t.typography)==null?void 0:S.fontFamily)||"inherit"},children:d})]})})};let qM=class extends ce.Component{constructor(t){super(t),this.showErrorBox=!0,this.onError=t.onError,this.isContainerComponent=t.isContainerComponent||!1,this.state={error:null,customErrorUI:null}}static getDerivedStateFromError(t){return{error:t,customErrorUI:null}}componentDidCatch(t){const r=t instanceof Error?t:new Error(t);if(this.onError){const n=this.onError(r);if(n!==void 0&&ce.isValidElement(n)){this.setState({error:t,customErrorUI:n});return}}this.setState({error:t})}componentDidUpdate(t,r){if(r.error!==null&&Ttt(t.resetKeys,this.props.resetKeys)&&this.setState({error:null,customErrorUI:null}),this.props.error&&!t.error&&!r.error&&!this.state.error&&this.onError){const n=this.props.error instanceof Error?this.props.error:new Error(String(this.props.error)),i=this.onError(n);i!==void 0&&ce.isValidElement(i)&&this.setState({customErrorUI:i})}}render(){const{error:t,customErrorUI:r}=this.state,{shouldRenderChildrenWithProvidedError:n,showErrorBox:i,error:o,children:a}=this.props,s=t||o;return!s||o&&!t&&n?a:i?r||pe(Mne,{error:s}):null}};function Ttt(e=[],t=[]){return e.length!==t.length||e.some((r,n)=>!Fo(r,t[n]))}const m6=({componentName:e})=>t=>function(n){const i=hr(),o=a=>{var s,l;return(l=(s=i.errorBoundary).onError)==null?void 0:l.call(s,a,{componentName:e,componentProps:n})};return pe(qM,{resetKeys:Object.values(n),showErrorBox:i.errorBoundary.showErrorBox,onError:o,isContainerComponent:!!(n!=null&&n.children),children:pe(t,ue({},n))})};function Tne(){var e,t;return(t=(e=document.head.querySelector('meta[property="csp-nonce"]'))==null?void 0:e.getAttribute("content"))!=null?t:void 0}const Att=()=>{const e=Tne();return e?bC({key:"css",nonce:e}):null},v6=({children:e})=>{const t=ce.useMemo(()=>Att(),[]);return t?pe(x3,{value:t,children:e}):pe(Kt,{children:e})},Ane=Tne(),ZM=({color:e})=>{const t={backgroundColor:e||"#333333",float:"left",width:"10px",height:"10px",marginRight:"7px",WebkitAnimation:"loading-dots-animation 1.8s infinite ease-in-out",animation:"loading-dots-animation 1.8s infinite ease-in-out",borderRadius:"50%",opacity:.75},r=xe(ue({},t),{WebkitAnimationDelay:"-0.32s",animationDelay:"-0.32s"}),n=xe(ue({},t),{WebkitAnimationDelay:"-0.16s",animationDelay:"-0.16s"}),i=xe(ue({},t),{marginRight:"unset"}),o={"0%, 80%, 100%":{WebkitTransform:"scale(0) rotate(0deg)",transform:"scale(0) rotate(0deg)"},"40%":{WebkitTransform:"scale(1) rotate(0.02deg)",transform:"scale(1) rotate(0.02deg)"}};return Ve("div",{children:[pe("style",xe(ue({},Ane&&{nonce:Ane}),{children:`
|
|
1164
|
+
northing meters`+e;var u=h/2,g=0,f=0,p,x,S,j,U;return u>0&&(p=1e5/Math.pow(10,u),x=e.substring(o,o+u),g=parseFloat(x)*p,S=e.substring(o+u),f=parseFloat(S)*p),j=g+c,U=f+d,{easting:j,northing:U,zoneLetter:s,zoneNumber:a,accuracy:p}}function jKe(e,t){for(var r=ine.charCodeAt(t-1),n=1e5,i=!1;r!==e.charCodeAt(0);){if(r++,r===za&&r++,r===al&&r++,r>j1){if(i)throw"Bad character: "+e;r=i0,i=!0}n+=1e5}return n}function BKe(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var r=one.charCodeAt(t-1),n=0,i=!1;r!==e.charCodeAt(0);){if(r++,r===za&&r++,r===al&&r++,r>F1){if(i)throw"Bad character: "+e;r=i0,i=!0}n+=1e5}return n}function zKe(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function o0(e,t,r){if(!(this instanceof o0))return new o0(e,t,r);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e=="object")this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e=="string"&&typeof t=="undefined"){var n=e.split(",");this.x=parseFloat(n[0],10),this.y=parseFloat(n[1],10),this.z=parseFloat(n[2],10)||0}else this.x=e,this.y=t,this.z=r||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}o0.fromMGRS=function(e){return new o0(sne(e))},o0.prototype.toMGRS=function(e){return ane([this.x,this.y],e)};var $Ke=1,WKe=.25,dne=.046875,hne=.01953125,pne=.01068115234375,HKe=.75,UKe=.46875,GKe=.013020833333333334,VKe=.007120768229166667,YKe=.3645833333333333,qKe=.005696614583333333,ZKe=.3076171875;function fne(e){var t=[];t[0]=$Ke-e*(WKe+e*(dne+e*(hne+e*pne))),t[1]=e*(HKe-e*(dne+e*(hne+e*pne)));var r=e*e;return t[2]=r*(UKe-e*(GKe+e*VKe)),r*=e,t[3]=r*(YKe-e*qKe),t[4]=r*e*ZKe,t}function $M(e,t,r,n){return r*=t,t*=t,n[0]*e-r*(n[1]+t*(n[2]+t*(n[3]+t*n[4])))}var XKe=20;function gne(e,t,r){for(var n=1/(1-t),i=e,o=XKe;o;--o){var a=Math.sin(i),s=1-t*a*a;if(s=($M(i,a,Math.cos(i),r)-e)*(s*Math.sqrt(s))*n,i-=s,Math.abs(s)<Et)return i}return i}function KKe(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=fne(this.es),this.ml0=$M(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function QKe(e){var t=e.x,r=e.y,n=Ft(t-this.long0),i,o,a,s=Math.sin(r),l=Math.cos(r);if(this.es){var d=l*n,h=Math.pow(d,2),u=this.ep2*Math.pow(l,2),g=Math.pow(u,2),f=Math.abs(l)>Et?Math.tan(r):0,p=Math.pow(f,2),x=Math.pow(p,2);i=1-this.es*Math.pow(s,2),d=d/Math.sqrt(i);var S=$M(r,s,l,this.en);o=this.a*(this.k0*d*(1+h/6*(1-p+u+h/20*(5-18*p+x+14*u-58*p*u+h/42*(61+179*x-x*p-479*p)))))+this.x0,a=this.a*(this.k0*(S-this.ml0+s*n*d/2*(1+h/12*(5-p+9*u+4*g+h/30*(61+x-58*p+270*u-330*p*u+h/56*(1385+543*x-x*p-3111*p))))))+this.y0}else{var c=l*Math.sin(n);if(Math.abs(Math.abs(c)-1)<Et)return 93;if(o=.5*this.a*this.k0*Math.log((1+c)/(1-c))+this.x0,a=l*Math.cos(n)/Math.sqrt(1-Math.pow(c,2)),c=Math.abs(a),c>=1){if(c-1>Et)return 93;a=0}else a=Math.acos(a);r<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return e.x=o,e.y=a,e}function JKe(e){var t,r,n,i,o=(e.x-this.x0)*(1/this.a),a=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+a/this.k0,r=gne(t,this.es,this.en),Math.abs(r)<vt){var h=Math.sin(r),u=Math.cos(r),g=Math.abs(u)>Et?Math.tan(r):0,f=this.ep2*Math.pow(u,2),p=Math.pow(f,2),x=Math.pow(g,2),S=Math.pow(x,2);t=1-this.es*Math.pow(h,2);var j=o*Math.sqrt(t)/this.k0,U=Math.pow(j,2);t=t*g,n=r-t*U/(1-this.es)*.5*(1-U/12*(5+3*x-9*f*x+f-4*p-U/30*(61+90*x-252*f*x+45*S+46*f-U/56*(1385+3633*x+4095*S+1574*S*x)))),i=Ft(this.long0+j*(1-U/6*(1+2*x+f-U/20*(5+28*x+24*S+8*f*x+6*f-U/42*(61+662*x+1320*S+720*S*x))))/u)}else n=vt*N1(a),i=0;else{var s=Math.exp(o/this.k0),l=.5*(s-1/s),c=this.lat0+a/this.k0,d=Math.cos(c);t=Math.sqrt((1-Math.pow(d,2))/(1+Math.pow(l,2))),n=Math.asin(t),a<0&&(n=-n),l===0&&d===0?i=0:i=Ft(Math.atan2(l,d)+this.long0)}return e.x=i,e.y=n,e}var eQe=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const WM={init:KKe,forward:QKe,inverse:JKe,names:eQe};function mne(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function sl(e,t){e=Math.abs(e),t=Math.abs(t);var r=Math.max(e,t),n=Math.min(e,t)/(r||1);return r*Math.sqrt(1+Math.pow(n,2))}function tQe(e){var t=1+e,r=t-1;return r===0?e:e*Math.log(t)/r}function rQe(e){var t=Math.abs(e);return t=tQe(t*(1+t/(sl(1,t)+1))),e<0?-t:t}function o6(e,t){for(var r=2*Math.cos(2*t),n=e.length-1,i=e[n],o=0,a;--n>=0;)a=-o+r*i+e[n],o=i,i=a;return t+a*Math.sin(2*t)}function nQe(e,t){for(var r=2*Math.cos(t),n=e.length-1,i=e[n],o=0,a;--n>=0;)a=-o+r*i+e[n],o=i,i=a;return Math.sin(t)*a}function iQe(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function vne(e,t,r){for(var n=Math.sin(t),i=Math.cos(t),o=mne(r),a=iQe(r),s=2*i*a,l=-2*n*o,c=e.length-1,d=e[c],h=0,u=0,g=0,f,p;--c>=0;)f=u,p=h,u=d,h=g,d=-f+s*u-l*h+e[c],g=-p+l*u+s*h;return s=n*a,l=i*o,[s*d-l*g,s*g+l*d]}function oQe(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(WM.init.apply(this),this.forward=WM.forward,this.inverse=WM.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),r=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),r=r*t,this.cgb[1]=r*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=r*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),r=r*t,this.cgb[2]=r*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=r*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),r=r*t,this.cgb[3]=r*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=r*(1237/630+t*(-12/5+t*(-24832/14175))),r=r*t,this.cgb[4]=r*(4174/315+t*(-144838/6237)),this.cbg[4]=r*(-734/315+t*(109598/31185)),r=r*t,this.cgb[5]=r*(601676/22275),this.cbg[5]=r*(444337/155925),r=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+r*(1/4+r*(1/64+r/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=r*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=r*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),r=r*t,this.utg[2]=r*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=r*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),r=r*t,this.utg[3]=r*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=r*(49561/161280+t*(-179/168+t*(6601661/7257600))),r=r*t,this.utg[4]=r*(-4583/161280+t*(108847/3991680)),this.gtu[4]=r*(34729/80640+t*(-3418889/1995840)),r=r*t,this.utg[5]=r*(-20648693/638668800),this.gtu[5]=r*(212378941/319334400);var n=o6(this.cbg,this.lat0);this.Zb=-this.Qn*(n+nQe(this.gtu,2*n))}function aQe(e){var t=Ft(e.x-this.long0),r=e.y;r=o6(this.cbg,r);var n=Math.sin(r),i=Math.cos(r),o=Math.sin(t),a=Math.cos(t);r=Math.atan2(n,a*i),t=Math.atan2(o*i,sl(n,i*a)),t=rQe(Math.tan(t));var s=vne(this.gtu,2*r,2*t);r=r+s[0],t=t+s[1];var l,c;return Math.abs(t)<=2.623395162778?(l=this.a*(this.Qn*t)+this.x0,c=this.a*(this.Qn*r+this.Zb)+this.y0):(l=1/0,c=1/0),e.x=l,e.y=c,e}function sQe(e){var t=(e.x-this.x0)*(1/this.a),r=(e.y-this.y0)*(1/this.a);r=(r-this.Zb)/this.Qn,t=t/this.Qn;var n,i;if(Math.abs(t)<=2.623395162778){var o=vne(this.utg,2*r,2*t);r=r+o[0],t=t+o[1],t=Math.atan(mne(t));var a=Math.sin(r),s=Math.cos(r),l=Math.sin(t),c=Math.cos(t);r=Math.atan2(a*c,sl(l,c*s)),t=Math.atan2(l,c*s),n=Ft(t+this.long0),i=o6(this.cgb,r)}else n=1/0,i=1/0;return e.x=n,e.y=i,e}var lQe=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const HM={init:oQe,forward:aQe,inverse:sQe,names:lQe};function cQe(e,t){if(e===void 0){if(e=Math.floor((Ft(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var uQe="etmerc";function dQe(){var e=cQe(this.zone,this.long0);if(e===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*To,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,HM.init.apply(this),this.forward=HM.forward,this.inverse=HM.inverse}var hQe=["Universal Transverse Mercator System","utm"];const pQe={init:dQe,names:hQe,dependsOn:uQe};function a6(e,t){return Math.pow((1-e)/(1+e),t)}var fQe=20;function gQe(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+rn)/(Math.pow(Math.tan(.5*this.lat0+rn),this.C)*a6(this.e*e,this.ratexp))}function mQe(e){var t=e.x,r=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*r+rn),this.C)*a6(this.e*Math.sin(r),this.ratexp))-vt,e.x=this.C*t,e}function vQe(e){for(var t=1e-14,r=e.x/this.C,n=e.y,i=Math.pow(Math.tan(.5*n+rn)/this.K,1/this.C),o=fQe;o>0&&(n=2*Math.atan(i*a6(this.e*Math.sin(e.y),-.5*this.e))-vt,!(Math.abs(n-e.y)<t));--o)e.y=n;return o?(e.x=r,e.y=n,e):null}var yQe=["gauss"];const s6={init:gQe,forward:mQe,inverse:vQe,names:yQe};function bQe(){s6.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function xQe(e){var t,r,n,i;return e.x=Ft(e.x-this.long0),s6.forward.apply(this,[e]),t=Math.sin(e.y),r=Math.cos(e.y),n=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*r*n),e.x=i*r*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*r*n),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function wQe(e){var t,r,n,i,o;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,o=sl(e.x,e.y)){var a=2*Math.atan2(o,this.R2);t=Math.sin(a),r=Math.cos(a),i=Math.asin(r*this.sinc0+e.y*t*this.cosc0/o),n=Math.atan2(e.x*t,o*this.cosc0*r-e.y*this.sinc0*t)}else i=this.phic0,n=0;return e.x=n,e.y=i,s6.inverse.apply(this,[e]),e.x=Ft(e.x+this.long0),e}var CQe=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const _Qe={init:bQe,forward:xQe,inverse:wQe,names:CQe};function SQe(e,t,r){return t*=r,Math.tan(.5*(vt+e))*Math.pow((1-t)/(1+t),.5*r)}function kQe(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Et&&(this.k0=.5*(1+N1(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Et&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Et&&Math.abs(Math.cos(this.lat_ts))>Et&&(this.k0=.5*this.cons*Bc(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/ql(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Bc(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-vt,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function MQe(e){var t=e.x,r=e.y,n=Math.sin(r),i=Math.cos(r),o,a,s,l,c,d,h=Ft(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=Et&&Math.abs(r+this.lat0)<=Et?(e.x=NaN,e.y=NaN,e):this.sphere?(o=2*this.k0/(1+this.sinlat0*n+this.coslat0*i*Math.cos(h)),e.x=this.a*o*i*Math.sin(h)+this.x0,e.y=this.a*o*(this.coslat0*n-this.sinlat0*i*Math.cos(h))+this.y0,e):(a=2*Math.atan(this.ssfn_(r,n,this.e))-vt,l=Math.cos(a),s=Math.sin(a),Math.abs(this.coslat0)<=Et?(c=ql(this.e,r*this.con,this.con*n),d=2*this.a*this.k0*c/this.cons,e.x=this.x0+d*Math.sin(t-this.long0),e.y=this.y0-this.con*d*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<Et?(o=2*this.a*this.k0/(1+l*Math.cos(h)),e.y=o*s):(o=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*s+this.cosX0*l*Math.cos(h))),e.y=o*(this.cosX0*s-this.sinX0*l*Math.cos(h))+this.y0),e.x=o*l*Math.sin(h)+this.x0,e))}function TQe(e){e.x-=this.x0,e.y-=this.y0;var t,r,n,i,o,a=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var s=2*Math.atan(a/(2*this.a*this.k0));return t=this.long0,r=this.lat0,a<=Et?(e.x=t,e.y=r,e):(r=Math.asin(Math.cos(s)*this.sinlat0+e.y*Math.sin(s)*this.coslat0/a),Math.abs(this.coslat0)<Et?this.lat0>0?t=Ft(this.long0+Math.atan2(e.x,-1*e.y)):t=Ft(this.long0+Math.atan2(e.x,e.y)):t=Ft(this.long0+Math.atan2(e.x*Math.sin(s),a*this.coslat0*Math.cos(s)-e.y*this.sinlat0*Math.sin(s))),e.x=t,e.y=r,e)}else if(Math.abs(this.coslat0)<=Et){if(a<=Et)return r=this.lat0,t=this.long0,e.x=t,e.y=r,e;e.x*=this.con,e.y*=this.con,n=a*this.cons/(2*this.a*this.k0),r=this.con*R1(this.e,n),t=this.con*Ft(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else i=2*Math.atan(a*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,a<=Et?o=this.X0:(o=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/a),t=Ft(this.long0+Math.atan2(e.x*Math.sin(i),a*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)))),r=-1*R1(this.e,Math.tan(.5*(vt+o)));return e.x=t,e.y=r,e}var AQe=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const EQe={init:kQe,forward:MQe,inverse:TQe,names:AQe,ssfn_:SQe};function PQe(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),r=this.a,n=this.rf,i=1/n,o=2*i-Math.pow(i,2),a=this.e=Math.sqrt(o);this.R=this.k0*r*Math.sqrt(1-o)/(1-o*Math.pow(t,2)),this.alpha=Math.sqrt(1+o/(1-o)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var s=Math.log(Math.tan(Math.PI/4+this.b0/2)),l=Math.log(Math.tan(Math.PI/4+e/2)),c=Math.log((1+a*t)/(1-a*t));this.K=s-this.alpha*l+this.alpha*a/2*c}function DQe(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),r=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),n=-this.alpha*(t+r)+this.K,i=2*(Math.atan(Math.exp(n))-Math.PI/4),o=this.alpha*(e.x-this.lambda0),a=Math.atan(Math.sin(o)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(o))),s=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(o));return e.y=this.R/2*Math.log((1+Math.sin(s))/(1-Math.sin(s)))+this.y0,e.x=this.R*a+this.x0,e}function LQe(e){for(var t=e.x-this.x0,r=e.y-this.y0,n=t/this.R,i=2*(Math.atan(Math.exp(r/this.R))-Math.PI/4),o=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(n)),a=Math.atan(Math.sin(n)/(Math.cos(this.b0)*Math.cos(n)-Math.sin(this.b0)*Math.tan(i))),s=this.lambda0+a/this.alpha,l=0,c=o,d=-1e3,h=0;Math.abs(c-d)>1e-7;){if(++h>20)return;l=1/this.alpha*(Math.log(Math.tan(Math.PI/4+o/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(c))/2)),d=c,c=2*Math.atan(Math.exp(l))-Math.PI/2}return e.x=s,e.y=c,e}var OQe=["somerc"];const IQe={init:PQe,forward:DQe,inverse:LQe,names:OQe};var a0=1e-7;function NQe(e){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],r=typeof e.PROJECTION=="object"?Object.keys(e.PROJECTION)[0]:e.PROJECTION;return"no_uoff"in e||"no_off"in e||t.indexOf(r)!==-1}function RQe(){var e,t,r,n,i,o,a,s,l,c,d=0,h,u=0,g=0,f=0,p=0,x=0,S=0;this.no_off=NQe(this),this.no_rot="no_rot"in this;var j=!1;"alpha"in this&&(j=!0);var U=!1;if("rectified_grid_angle"in this&&(U=!0),j&&(S=this.alpha),U&&(d=this.rectified_grid_angle*To),j||U)u=this.longc;else if(g=this.long1,p=this.lat1,f=this.long2,x=this.lat2,Math.abs(p-x)<=a0||(e=Math.abs(p))<=a0||Math.abs(e-vt)<=a0||Math.abs(Math.abs(this.lat0)-vt)<=a0||Math.abs(Math.abs(x)-vt)<=a0)throw new Error;var B=1-this.es;t=Math.sqrt(B),Math.abs(this.lat0)>Et?(s=Math.sin(this.lat0),r=Math.cos(this.lat0),e=1-this.es*s*s,this.B=r*r,this.B=Math.sqrt(1+this.es*this.B*this.B/B),this.A=this.B*this.k0*t/e,n=this.B*t/(r*Math.sqrt(e)),i=n*n-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=n,this.E*=Math.pow(ql(this.e,this.lat0,s),this.B)):(this.B=1/t,this.A=this.k0,this.E=n=i=1),j||U?(j?(h=Math.asin(Math.sin(S)/n),U||(d=S)):(h=d,S=Math.asin(n*Math.sin(h))),this.lam0=u-Math.asin(.5*(i-1/i)*Math.tan(h))/this.B):(o=Math.pow(ql(this.e,p,Math.sin(p)),this.B),a=Math.pow(ql(this.e,x,Math.sin(x)),this.B),i=this.E/o,l=(a-o)/(a+o),c=this.E*this.E,c=(c-a*o)/(c+a*o),e=g-f,e<-Math.pi?f-=O1:e>Math.pi&&(f+=O1),this.lam0=Ft(.5*(g+f)-Math.atan(c*Math.tan(.5*this.B*(g-f))/l)/this.B),h=Math.atan(2*Math.sin(this.B*Ft(g-this.lam0))/(i-1/i)),d=S=Math.asin(n*Math.sin(h))),this.singam=Math.sin(h),this.cosgam=Math.cos(h),this.sinrot=Math.sin(d),this.cosrot=Math.cos(d),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(n*n-1)/Math.cos(S))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*h,this.v_pole_n=this.ArB*Math.log(Math.tan(rn-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(rn+i))}function FQe(e){var t={},r,n,i,o,a,s,l,c;if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-vt)>Et){if(a=this.E/Math.pow(ql(this.e,e.y,Math.sin(e.y)),this.B),s=1/a,r=.5*(a-s),n=.5*(a+s),o=Math.sin(this.B*e.x),i=(r*this.singam-o*this.cosgam)/n,Math.abs(Math.abs(i)-1)<Et)throw new Error;c=.5*this.ArB*Math.log((1-i)/(1+i)),s=Math.cos(this.B*e.x),Math.abs(s)<a0?l=this.A*e.x:l=this.ArB*Math.atan2(r*this.cosgam+o*this.singam,s)}else c=e.y>0?this.v_pole_n:this.v_pole_s,l=this.ArB*e.y;return this.no_rot?(t.x=l,t.y=c):(l-=this.u_0,t.x=c*this.cosrot+l*this.sinrot,t.y=l*this.cosrot-c*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function jQe(e){var t,r,n,i,o,a,s,l={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(r=e.y,t=e.x):(r=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),n=Math.exp(-this.BrA*r),i=.5*(n-1/n),o=.5*(n+1/n),a=Math.sin(this.BrA*t),s=(a*this.cosgam+i*this.singam)/o,Math.abs(Math.abs(s)-1)<Et)l.x=0,l.y=s<0?-vt:vt;else{if(l.y=this.E/Math.sqrt((1+s)/(1-s)),l.y=R1(this.e,Math.pow(l.y,1/this.B)),l.y===1/0)throw new Error;l.x=-this.rB*Math.atan2(i*this.cosgam-a*this.singam,Math.cos(this.BrA*t))}return l.x+=this.lam0,l}var BQe=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const zQe={init:RQe,forward:FQe,inverse:jQe,names:BQe};function $Qe(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Et)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),r=Math.cos(this.lat1),n=Bc(this.e,t,r),i=ql(this.e,this.lat1,t),o=Math.sin(this.lat2),a=Math.cos(this.lat2),s=Bc(this.e,o,a),l=ql(this.e,this.lat2,o),c=ql(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Et?this.ns=Math.log(n/s)/Math.log(i/l):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=n/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(c,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function WQe(e){var t=e.x,r=e.y;Math.abs(2*Math.abs(r)-Math.PI)<=Et&&(r=N1(r)*(vt-2*Et));var n=Math.abs(Math.abs(r)-vt),i,o;if(n>Et)i=ql(this.e,r,Math.sin(r)),o=this.a*this.f0*Math.pow(i,this.ns);else{if(n=r*this.ns,n<=0)return null;o=0}var a=this.ns*Ft(t-this.long0);return e.x=this.k0*(o*Math.sin(a))+this.x0,e.y=this.k0*(this.rh-o*Math.cos(a))+this.y0,e}function HQe(e){var t,r,n,i,o,a=(e.x-this.x0)/this.k0,s=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(a*a+s*s),r=1):(t=-Math.sqrt(a*a+s*s),r=-1);var l=0;if(t!==0&&(l=Math.atan2(r*a,r*s)),t!==0||this.ns>0){if(r=1/this.ns,n=Math.pow(t/(this.a*this.f0),r),i=R1(this.e,n),i===-9999)return null}else i=-vt;return o=Ft(l/this.ns+this.long0),e.x=o,e.y=i,e}var UQe=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const GQe={init:$Qe,forward:WQe,inverse:HQe,names:UQe};function VQe(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function YQe(e){var t,r,n,i,o,a,s,l=e.x,c=e.y,d=Ft(l-this.long0);return t=Math.pow((1+this.e*Math.sin(c))/(1-this.e*Math.sin(c)),this.alfa*this.e/2),r=2*(Math.atan(this.k*Math.pow(Math.tan(c/2+this.s45),this.alfa)/t)-this.s45),n=-d*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(r)+Math.sin(this.ad)*Math.cos(r)*Math.cos(n)),o=Math.asin(Math.cos(r)*Math.sin(n)/Math.cos(i)),a=this.n*o,s=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),e.y=s*Math.cos(a)/1,e.x=s*Math.sin(a)/1,this.czech||(e.y*=-1,e.x*=-1),e}function qQe(e){var t,r,n,i,o,a,s,l,c=e.x;e.x=e.y,e.y=c,this.czech||(e.y*=-1,e.x*=-1),a=Math.sqrt(e.x*e.x+e.y*e.y),o=Math.atan2(e.y,e.x),i=o/Math.sin(this.s0),n=2*(Math.atan(Math.pow(this.ro0/a,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(n)-Math.sin(this.ad)*Math.cos(n)*Math.cos(i)),r=Math.asin(Math.cos(n)*Math.sin(i)/Math.cos(t)),e.x=this.long0-r/this.alfa,s=t,l=0;var d=0;do e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(s))/(1-this.e*Math.sin(s)),this.e/2))-this.s45),Math.abs(s-e.y)<1e-10&&(l=1),s=e.y,d+=1;while(l===0&&d<15);return d>=15?null:e}var ZQe=["Krovak","krovak"];const XQe={init:VQe,forward:YQe,inverse:qQe,names:ZQe};function la(e,t,r,n,i){return e*i-t*Math.sin(2*i)+r*Math.sin(4*i)-n*Math.sin(6*i)}function B1(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function z1(e){return .375*e*(1+.25*e*(1+.46875*e))}function $1(e){return .05859375*e*e*(1+.75*e)}function W1(e){return e*e*e*(35/3072)}function s0(e,t,r){var n=t*r;return e/Math.sqrt(1-n*n)}function l0(e){return Math.abs(e)<vt?e:e-N1(e)*Math.PI}function UM(e,t,r,n,i){var o,a;o=e/t;for(var s=0;s<15;s++)if(a=(e-(t*o-r*Math.sin(2*o)+n*Math.sin(4*o)-i*Math.sin(6*o)))/(t-2*r*Math.cos(2*o)+4*n*Math.cos(4*o)-6*i*Math.cos(6*o)),o+=a,Math.abs(a)<=1e-10)return o;return NaN}function KQe(){this.sphere||(this.e0=B1(this.es),this.e1=z1(this.es),this.e2=$1(this.es),this.e3=W1(this.es),this.ml0=this.a*la(this.e0,this.e1,this.e2,this.e3,this.lat0))}function QQe(e){var t,r,n=e.x,i=e.y;if(n=Ft(n-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(i)*Math.sin(n)),r=this.a*(Math.atan2(Math.tan(i),Math.cos(n))-this.lat0);else{var o=Math.sin(i),a=Math.cos(i),s=s0(this.a,this.e,o),l=Math.tan(i)*Math.tan(i),c=n*Math.cos(i),d=c*c,h=this.es*a*a/(1-this.es),u=this.a*la(this.e0,this.e1,this.e2,this.e3,i);t=s*c*(1-d*l*(1/6-(8-l+8*h)*d/120)),r=u-this.ml0+s*o/a*d*(.5+(5-l+6*h)*d/24)}return e.x=t+this.x0,e.y=r+this.y0,e}function JQe(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,r=e.y/this.a,n,i;if(this.sphere){var o=r+this.lat0;n=Math.asin(Math.sin(o)*Math.cos(t)),i=Math.atan2(Math.tan(t),Math.cos(o))}else{var a=this.ml0/this.a+r,s=UM(a,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(s)-vt)<=Et)return e.x=this.long0,e.y=vt,r<0&&(e.y*=-1),e;var l=s0(this.a,this.e,Math.sin(s)),c=l*l*l/this.a/this.a*(1-this.es),d=Math.pow(Math.tan(s),2),h=t*this.a/l,u=h*h;n=s-l*Math.tan(s)/c*h*h*(.5-(1+3*d)*h*h/24),i=h*(1-u*(d/3+(1+3*d)*d*u/15))/Math.cos(s)}return e.x=Ft(i+this.long0),e.y=l0(n),e}var eJe=["Cassini","Cassini_Soldner","cass"];const tJe={init:KQe,forward:QQe,inverse:JQe,names:eJe};function fh(e,t){var r;return e>1e-7?(r=e*t,(1-e*e)*(t/(1-r*r)-.5/e*Math.log((1-r)/(1+r)))):2*t}var rJe=1,nJe=2,iJe=3,oJe=4;function aJe(){var e=Math.abs(this.lat0);if(Math.abs(e-vt)<Et?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<Et?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var t;switch(this.qp=fh(this.e,1),this.mmf=.5/(1-this.es),this.apa=gJe(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=fh(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function sJe(e){var t,r,n,i,o,a,s,l,c,d,h=e.x,u=e.y;if(h=Ft(h-this.long0),this.sphere){if(o=Math.sin(u),d=Math.cos(u),n=Math.cos(h),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(r=this.mode===this.EQUIT?1+d*n:1+this.sinph0*o+this.cosph0*d*n,r<=Et)return null;r=Math.sqrt(2/r),t=r*d*Math.sin(h),r*=this.mode===this.EQUIT?o:this.cosph0*o-this.sinph0*d*n}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),Math.abs(u+this.lat0)<Et)return null;r=rn-u*.5,r=2*(this.mode===this.S_POLE?Math.cos(r):Math.sin(r)),t=r*Math.sin(h),r*=n}}else{switch(s=0,l=0,c=0,n=Math.cos(h),i=Math.sin(h),o=Math.sin(u),a=fh(this.e,o),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(s=a/this.qp,l=Math.sqrt(1-s*s)),this.mode){case this.OBLIQ:c=1+this.sinb1*s+this.cosb1*l*n;break;case this.EQUIT:c=1+l*n;break;case this.N_POLE:c=vt+u,a=this.qp-a;break;case this.S_POLE:c=u-vt,a=this.qp+a;break}if(Math.abs(c)<Et)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),this.mode===this.OBLIQ?r=this.ymf*c*(this.cosb1*s-this.sinb1*l*n):r=(c=Math.sqrt(2/(1+l*n)))*s*this.ymf,t=this.xmf*c*l*i;break;case this.N_POLE:case this.S_POLE:a>=0?(t=(c=Math.sqrt(a))*i,r=n*(this.mode===this.S_POLE?c:-c)):t=r=0;break}}return e.x=this.a*t+this.x0,e.y=this.a*r+this.y0,e}function lJe(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,r=e.y/this.a,n,i,o,a,s,l,c;if(this.sphere){var d=0,h,u=0;if(h=Math.sqrt(t*t+r*r),i=h*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(u=Math.sin(i),d=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(h)<=Et?0:Math.asin(r*u/h),t*=u,r=d*h;break;case this.OBLIQ:i=Math.abs(h)<=Et?this.lat0:Math.asin(d*this.sinph0+r*u*this.cosph0/h),t*=u*this.cosph0,r=(d-Math.sin(i)*this.sinph0)*h;break;case this.N_POLE:r=-r,i=vt-i;break;case this.S_POLE:i-=vt;break}n=r===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,r)}else{if(c=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,r*=this.dd,l=Math.sqrt(t*t+r*r),l<Et)return e.x=this.long0,e.y=this.lat0,e;a=2*Math.asin(.5*l/this.rq),o=Math.cos(a),t*=a=Math.sin(a),this.mode===this.OBLIQ?(c=o*this.sinb1+r*a*this.cosb1/l,s=this.qp*c,r=l*this.cosb1*o-r*this.sinb1*a):(c=r*a/l,s=this.qp*c,r=l*o)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),s=t*t+r*r,!s)return e.x=this.long0,e.y=this.lat0,e;c=1-s/this.qp,this.mode===this.S_POLE&&(c=-c)}n=Math.atan2(t,r),i=mJe(Math.asin(c),this.apa)}return e.x=Ft(this.long0+n),e.y=i,e}var cJe=.3333333333333333,uJe=.17222222222222222,dJe=.10257936507936508,hJe=.06388888888888888,pJe=.0664021164021164,fJe=.016415012942191543;function gJe(e){var t,r=[];return r[0]=e*cJe,t=e*e,r[0]+=t*uJe,r[1]=t*hJe,t*=e,r[0]+=t*dJe,r[1]+=t*pJe,r[2]=t*fJe,r}function mJe(e,t){var r=e+e;return e+t[0]*Math.sin(r)+t[1]*Math.sin(r+r)+t[2]*Math.sin(r+r+r)}var vJe=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const yJe={init:aJe,forward:sJe,inverse:lJe,names:vJe,S_POLE:rJe,N_POLE:nJe,EQUIT:iJe,OBLIQ:oJe};function gh(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function bJe(){Math.abs(this.lat1+this.lat2)<Et||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Bc(this.e3,this.sin_po,this.cos_po),this.qs1=fh(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Bc(this.e3,this.sin_po,this.cos_po),this.qs2=fh(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=fh(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>Et?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function xJe(e){var t=e.x,r=e.y;this.sin_phi=Math.sin(r),this.cos_phi=Math.cos(r);var n=fh(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*n)/this.ns0,o=this.ns0*Ft(t-this.long0),a=i*Math.sin(o)+this.x0,s=this.rh-i*Math.cos(o)+this.y0;return e.x=a,e.y=s,e}function wJe(e){var t,r,n,i,o,a;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),n=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),n=-1),i=0,t!==0&&(i=Math.atan2(n*e.x,n*e.y)),n=t*this.ns0/this.a,this.sphere?a=Math.asin((this.c-n*n)/(2*this.ns0)):(r=(this.c-n*n)/this.ns0,a=this.phi1z(this.e3,r)),o=Ft(i/this.ns0+this.long0),e.x=o,e.y=a,e}function CJe(e,t){var r,n,i,o,a,s=gh(.5*t);if(e<Et)return s;for(var l=e*e,c=1;c<=25;c++)if(r=Math.sin(s),n=Math.cos(s),i=e*r,o=1-i*i,a=.5*o*o/n*(t/(1-l)-r/o+.5/e*Math.log((1-i)/(1+i))),s=s+a,Math.abs(a)<=1e-7)return s;return null}var _Je=["Albers_Conic_Equal_Area","Albers","aea"];const SJe={init:bJe,forward:xJe,inverse:wJe,names:_Je,phi1z:CJe};function kJe(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function MJe(e){var t,r,n,i,o,a,s,l,c=e.x,d=e.y;return n=Ft(c-this.long0),t=Math.sin(d),r=Math.cos(d),i=Math.cos(n),a=this.sin_p14*t+this.cos_p14*r*i,o=1,a>0||Math.abs(a)<=Et?(s=this.x0+this.a*o*r*Math.sin(n)/a,l=this.y0+this.a*o*(this.cos_p14*t-this.sin_p14*r*i)/a):(s=this.x0+this.infinity_dist*r*Math.sin(n),l=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*r*i)),e.x=s,e.y=l,e}function TJe(e){var t,r,n,i,o,a;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(i=Math.atan2(t,this.rc),r=Math.sin(i),n=Math.cos(i),a=gh(n*this.sin_p14+e.y*r*this.cos_p14/t),o=Math.atan2(e.x*r,t*this.cos_p14*n-e.y*this.sin_p14*r),o=Ft(this.long0+o)):(a=this.phic0,o=0),e.x=o,e.y=a,e}var AJe=["gnom"];const EJe={init:kJe,forward:MJe,inverse:TJe,names:AJe};function PJe(e,t){var r=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-r)<1e-6)return t<0?-1*vt:vt;for(var n=Math.asin(.5*t),i,o,a,s,l=0;l<30;l++)if(o=Math.sin(n),a=Math.cos(n),s=e*o,i=Math.pow(1-s*s,2)/(2*a)*(t/(1-e*e)-o/(1-s*s)+.5/e*Math.log((1-s)/(1+s))),n+=i,Math.abs(i)<=1e-10)return n;return NaN}function DJe(){this.sphere||(this.k0=Bc(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function LJe(e){var t=e.x,r=e.y,n,i,o=Ft(t-this.long0);if(this.sphere)n=this.x0+this.a*o*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(r)/Math.cos(this.lat_ts);else{var a=fh(this.e,Math.sin(r));n=this.x0+this.a*this.k0*o,i=this.y0+this.a*a*.5/this.k0}return e.x=n,e.y=i,e}function OJe(e){e.x-=this.x0,e.y-=this.y0;var t,r;return this.sphere?(t=Ft(this.long0+e.x/this.a/Math.cos(this.lat_ts)),r=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(r=PJe(this.e,2*e.y*this.k0/this.a),t=Ft(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=r,e}var IJe=["cea"];const NJe={init:DJe,forward:LJe,inverse:OJe,names:IJe};function RJe(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function FJe(e){var t=e.x,r=e.y,n=Ft(t-this.long0),i=l0(r-this.lat0);return e.x=this.x0+this.a*n*this.rc,e.y=this.y0+this.a*i,e}function jJe(e){var t=e.x,r=e.y;return e.x=Ft(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=l0(this.lat0+(r-this.y0)/this.a),e}var BJe=["Equirectangular","Equidistant_Cylindrical","eqc"];const zJe={init:RJe,forward:FJe,inverse:jJe,names:BJe};var yne=20;function $Je(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=B1(this.es),this.e1=z1(this.es),this.e2=$1(this.es),this.e3=W1(this.es),this.ml0=this.a*la(this.e0,this.e1,this.e2,this.e3,this.lat0)}function WJe(e){var t=e.x,r=e.y,n,i,o,a=Ft(t-this.long0);if(o=a*Math.sin(r),this.sphere)Math.abs(r)<=Et?(n=this.a*a,i=-1*this.a*this.lat0):(n=this.a*Math.sin(o)/Math.tan(r),i=this.a*(l0(r-this.lat0)+(1-Math.cos(o))/Math.tan(r)));else if(Math.abs(r)<=Et)n=this.a*a,i=-1*this.ml0;else{var s=s0(this.a,this.e,Math.sin(r))/Math.tan(r);n=s*Math.sin(o),i=this.a*la(this.e0,this.e1,this.e2,this.e3,r)-this.ml0+s*(1-Math.cos(o))}return e.x=n+this.x0,e.y=i+this.y0,e}function HJe(e){var t,r,n,i,o,a,s,l,c;if(n=e.x-this.x0,i=e.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=Et)t=Ft(n/this.a+this.long0),r=0;else{a=this.lat0+i/this.a,s=n*n/this.a/this.a+a*a,l=a;var d;for(o=yne;o;--o)if(d=Math.tan(l),c=-1*(a*(l*d+1)-l-.5*(l*l+s)*d)/((l-a)/d-1),l+=c,Math.abs(c)<=Et){r=l;break}t=Ft(this.long0+Math.asin(n*Math.tan(l)/this.a)/Math.sin(r))}else if(Math.abs(i+this.ml0)<=Et)r=0,t=Ft(this.long0+n/this.a);else{a=(this.ml0+i)/this.a,s=n*n/this.a/this.a+a*a,l=a;var h,u,g,f,p;for(o=yne;o;--o)if(p=this.e*Math.sin(l),h=Math.sqrt(1-p*p)*Math.tan(l),u=this.a*la(this.e0,this.e1,this.e2,this.e3,l),g=this.e0-2*this.e1*Math.cos(2*l)+4*this.e2*Math.cos(4*l)-6*this.e3*Math.cos(6*l),f=u/this.a,c=(a*(h*f+1)-f-.5*h*(f*f+s))/(this.es*Math.sin(2*l)*(f*f+s-2*a*f)/(4*h)+(a-f)*(h*g-2/Math.sin(2*l))-g),l-=c,Math.abs(c)<=Et){r=l;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(r),2))*Math.tan(r),t=Ft(this.long0+Math.asin(n*h/this.a)/Math.sin(r))}return e.x=t,e.y=r,e}var UJe=["Polyconic","poly"];const GJe={init:$Je,forward:WJe,inverse:HJe,names:UJe};function VJe(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function YJe(e){var t,r=e.x,n=e.y,i=n-this.lat0,o=r-this.long0,a=i/L1*1e-5,s=o,l=1,c=0;for(t=1;t<=10;t++)l=l*a,c=c+this.A[t]*l;var d=c,h=s,u=1,g=0,f,p,x=0,S=0;for(t=1;t<=6;t++)f=u*d-g*h,p=g*d+u*h,u=f,g=p,x=x+this.B_re[t]*u-this.B_im[t]*g,S=S+this.B_im[t]*u+this.B_re[t]*g;return e.x=S*this.a+this.x0,e.y=x*this.a+this.y0,e}function qJe(e){var t,r=e.x,n=e.y,i=r-this.x0,o=n-this.y0,a=o/this.a,s=i/this.a,l=1,c=0,d,h,u=0,g=0;for(t=1;t<=6;t++)d=l*a-c*s,h=c*a+l*s,l=d,c=h,u=u+this.C_re[t]*l-this.C_im[t]*c,g=g+this.C_im[t]*l+this.C_re[t]*c;for(var f=0;f<this.iterations;f++){var p=u,x=g,S,j,U=a,B=s;for(t=2;t<=6;t++)S=p*u-x*g,j=x*u+p*g,p=S,x=j,U=U+(t-1)*(this.B_re[t]*p-this.B_im[t]*x),B=B+(t-1)*(this.B_im[t]*p+this.B_re[t]*x);p=1,x=0;var R=this.B_re[1],E=this.B_im[1];for(t=2;t<=6;t++)S=p*u-x*g,j=x*u+p*g,p=S,x=j,R=R+t*(this.B_re[t]*p-this.B_im[t]*x),E=E+t*(this.B_im[t]*p+this.B_re[t]*x);var N=R*R+E*E;u=(U*R+B*E)/N,g=(B*R-U*E)/N}var M=u,$=g,T=1,C=0;for(t=1;t<=9;t++)T=T*M,C=C+this.D[t]*T;var y=this.lat0+C*L1*1e5,D=this.long0+$;return e.x=D,e.y=y,e}var ZJe=["New_Zealand_Map_Grid","nzmg"];const XJe={init:VJe,forward:YJe,inverse:qJe,names:ZJe};function KJe(){}function QJe(e){var t=e.x,r=e.y,n=Ft(t-this.long0),i=this.x0+this.a*n,o=this.y0+this.a*Math.log(Math.tan(Math.PI/4+r/2.5))*1.25;return e.x=i,e.y=o,e}function JJe(e){e.x-=this.x0,e.y-=this.y0;var t=Ft(this.long0+e.x/this.a),r=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=r,e}var eet=["Miller_Cylindrical","mill"];const tet={init:KJe,forward:QJe,inverse:JJe,names:eet};var ret=20;function net(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=fne(this.es)}function iet(e){var t,r,n=e.x,i=e.y;if(n=Ft(n-this.long0),this.sphere){if(!this.m)i=this.n!==1?Math.asin(this.n*Math.sin(i)):i;else for(var o=this.n*Math.sin(i),a=ret;a;--a){var s=(this.m*i+Math.sin(i)-o)/(this.m+Math.cos(i));if(i-=s,Math.abs(s)<Et)break}t=this.a*this.C_x*n*(this.m+Math.cos(i)),r=this.a*this.C_y*i}else{var l=Math.sin(i),c=Math.cos(i);r=this.a*$M(i,l,c,this.en),t=this.a*n*c/Math.sqrt(1-this.es*l*l)}return e.x=t,e.y=r,e}function oet(e){var t,r,n,i;return e.x-=this.x0,n=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,n=n/(this.C_x*(this.m+Math.cos(t))),this.m?t=gh((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=gh(Math.sin(t)/this.n)),n=Ft(n+this.long0),t=l0(t)):(t=gne(e.y/this.a,this.es,this.en),i=Math.abs(t),i<vt?(i=Math.sin(t),r=this.long0+e.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)),n=Ft(r)):i-Et<vt&&(n=this.long0)),e.x=n,e.y=t,e}var aet=["Sinusoidal","sinu"];const set={init:net,forward:iet,inverse:oet,names:aet};function cet(){}function uet(e){for(var t=e.x,r=e.y,n=Ft(t-this.long0),i=r,o=Math.PI*Math.sin(r);;){var a=-(i+Math.sin(i)-o)/(1+Math.cos(i));if(i+=a,Math.abs(a)<Et)break}i/=2,Math.PI/2-Math.abs(r)<Et&&(n=0);var s=.900316316158*this.a*n*Math.cos(i)+this.x0,l=1.4142135623731*this.a*Math.sin(i)+this.y0;return e.x=s,e.y=l,e}function det(e){var t,r;e.x-=this.x0,e.y-=this.y0,r=e.y/(1.4142135623731*this.a),Math.abs(r)>.999999999999&&(r=.999999999999),t=Math.asin(r);var n=Ft(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));n<-Math.PI&&(n=-Math.PI),n>Math.PI&&(n=Math.PI),r=(2*t+Math.sin(2*t))/Math.PI,Math.abs(r)>1&&(r=1);var i=Math.asin(r);return e.x=n,e.y=i,e}var het=["Mollweide","moll"];const pet={init:cet,forward:uet,inverse:det,names:het};function fet(){Math.abs(this.lat1+this.lat2)<Et||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=B1(this.es),this.e1=z1(this.es),this.e2=$1(this.es),this.e3=W1(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Bc(this.e,this.sinphi,this.cosphi),this.ml1=la(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Et?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Bc(this.e,this.sinphi,this.cosphi),this.ml2=la(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=la(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function get(e){var t=e.x,r=e.y,n;if(this.sphere)n=this.a*(this.g-r);else{var i=la(this.e0,this.e1,this.e2,this.e3,r);n=this.a*(this.g-i)}var o=this.ns*Ft(t-this.long0),a=this.x0+n*Math.sin(o),s=this.y0+this.rh-n*Math.cos(o);return e.x=a,e.y=s,e}function met(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,r,n,i;this.ns>=0?(r=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(r=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var o=0;if(r!==0&&(o=Math.atan2(t*e.x,t*e.y)),this.sphere)return i=Ft(this.long0+o/this.ns),n=l0(this.g-r/this.a),e.x=i,e.y=n,e;var a=this.g-r/this.a;return n=UM(a,this.e0,this.e1,this.e2,this.e3),i=Ft(this.long0+o/this.ns),e.x=i,e.y=n,e}var vet=["Equidistant_Conic","eqdc"];const yet={init:fet,forward:get,inverse:met,names:vet};function bet(){this.R=this.a}function xet(e){var t=e.x,r=e.y,n=Ft(t-this.long0),i,o;Math.abs(r)<=Et&&(i=this.x0+this.R*n,o=this.y0);var a=gh(2*Math.abs(r/Math.PI));(Math.abs(n)<=Et||Math.abs(Math.abs(r)-vt)<=Et)&&(i=this.x0,r>=0?o=this.y0+Math.PI*this.R*Math.tan(.5*a):o=this.y0+Math.PI*this.R*-Math.tan(.5*a));var s=.5*Math.abs(Math.PI/n-n/Math.PI),l=s*s,c=Math.sin(a),d=Math.cos(a),h=d/(c+d-1),u=h*h,g=h*(2/c-1),f=g*g,p=Math.PI*this.R*(s*(h-f)+Math.sqrt(l*(h-f)*(h-f)-(f+l)*(u-f)))/(f+l);n<0&&(p=-p),i=this.x0+p;var x=l+h;return p=Math.PI*this.R*(g*x-s*Math.sqrt((f+l)*(l+1)-x*x))/(f+l),r>=0?o=this.y0+p:o=this.y0-p,e.x=i,e.y=o,e}function wet(e){var t,r,n,i,o,a,s,l,c,d,h,u,g;return e.x-=this.x0,e.y-=this.y0,h=Math.PI*this.R,n=e.x/h,i=e.y/h,o=n*n+i*i,a=-Math.abs(i)*(1+o),s=a-2*i*i+n*n,l=-2*a+1+2*i*i+o*o,g=i*i/l+(2*s*s*s/l/l/l-9*a*s/l/l)/27,c=(a-s*s/3/l)/l,d=2*Math.sqrt(-c/3),h=3*g/c/d,Math.abs(h)>1&&(h>=0?h=1:h=-1),u=Math.acos(h)/3,e.y>=0?r=(-d*Math.cos(u+Math.PI/3)-s/3/l)*Math.PI:r=-(-d*Math.cos(u+Math.PI/3)-s/3/l)*Math.PI,Math.abs(n)<Et?t=this.long0:t=Ft(this.long0+Math.PI*(o-1+Math.sqrt(1+2*(n*n-i*i)+o*o))/2/n),e.x=t,e.y=r,e}var Cet=["Van_der_Grinten_I","VanDerGrinten","vandg"];const _et={init:bet,forward:xet,inverse:wet,names:Cet};function ket(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function Met(e){var t=e.x,r=e.y,n=Math.sin(e.y),i=Math.cos(e.y),o=Ft(t-this.long0),a,s,l,c,d,h,u,g,f,p,x,S,j,U,B,R,E,N,M,$,T,C,y;return this.sphere?Math.abs(this.sin_p12-1)<=Et?(e.x=this.x0+this.a*(vt-r)*Math.sin(o),e.y=this.y0-this.a*(vt-r)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=Et?(e.x=this.x0+this.a*(vt+r)*Math.sin(o),e.y=this.y0+this.a*(vt+r)*Math.cos(o),e):(N=this.sin_p12*n+this.cos_p12*i*Math.cos(o),R=Math.acos(N),E=R?R/Math.sin(R):1,e.x=this.x0+this.a*E*i*Math.sin(o),e.y=this.y0+this.a*E*(this.cos_p12*n-this.sin_p12*i*Math.cos(o)),e):(a=B1(this.es),s=z1(this.es),l=$1(this.es),c=W1(this.es),Math.abs(this.sin_p12-1)<=Et?(d=this.a*la(a,s,l,c,vt),h=this.a*la(a,s,l,c,r),e.x=this.x0+(d-h)*Math.sin(o),e.y=this.y0-(d-h)*Math.cos(o),e):Math.abs(this.sin_p12+1)<=Et?(d=this.a*la(a,s,l,c,vt),h=this.a*la(a,s,l,c,r),e.x=this.x0+(d+h)*Math.sin(o),e.y=this.y0+(d+h)*Math.cos(o),e):(u=n/i,g=s0(this.a,this.e,this.sin_p12),f=s0(this.a,this.e,n),p=Math.atan((1-this.es)*u+this.es*g*this.sin_p12/(f*i)),x=Math.atan2(Math.sin(o),this.cos_p12*Math.tan(p)-this.sin_p12*Math.cos(o)),x===0?M=Math.asin(this.cos_p12*Math.sin(p)-this.sin_p12*Math.cos(p)):Math.abs(Math.abs(x)-Math.PI)<=Et?M=-Math.asin(this.cos_p12*Math.sin(p)-this.sin_p12*Math.cos(p)):M=Math.asin(Math.sin(o)*Math.cos(p)/Math.sin(x)),S=this.e*this.sin_p12/Math.sqrt(1-this.es),j=this.e*this.cos_p12*Math.cos(x)/Math.sqrt(1-this.es),U=S*j,B=j*j,$=M*M,T=$*M,C=T*M,y=C*M,R=g*M*(1-$*B*(1-B)/6+T/8*U*(1-2*B)+C/120*(B*(4-7*B)-3*S*S*(1-7*B))-y/48*U),e.x=this.x0+R*Math.sin(x),e.y=this.y0+R*Math.cos(x),e))}function Tet(e){e.x-=this.x0,e.y-=this.y0;var t,r,n,i,o,a,s,l,c,d,h,u,g,f,p,x,S,j,U,B,R,E,N,M;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*vt*this.a?void 0:(r=t/this.a,n=Math.sin(r),i=Math.cos(r),o=this.long0,Math.abs(t)<=Et?a=this.lat0:(a=gh(i*this.sin_p12+e.y*n*this.cos_p12/t),s=Math.abs(this.lat0)-vt,Math.abs(s)<=Et?this.lat0>=0?o=Ft(this.long0+Math.atan2(e.x,-e.y)):o=Ft(this.long0-Math.atan2(-e.x,e.y)):o=Ft(this.long0+Math.atan2(e.x*n,t*this.cos_p12*i-e.y*this.sin_p12*n))),e.x=o,e.y=a,e)):(l=B1(this.es),c=z1(this.es),d=$1(this.es),h=W1(this.es),Math.abs(this.sin_p12-1)<=Et?(u=this.a*la(l,c,d,h,vt),t=Math.sqrt(e.x*e.x+e.y*e.y),g=u-t,a=UM(g/this.a,l,c,d,h),o=Ft(this.long0+Math.atan2(e.x,-1*e.y)),e.x=o,e.y=a,e):Math.abs(this.sin_p12+1)<=Et?(u=this.a*la(l,c,d,h,vt),t=Math.sqrt(e.x*e.x+e.y*e.y),g=t-u,a=UM(g/this.a,l,c,d,h),o=Ft(this.long0+Math.atan2(e.x,e.y)),e.x=o,e.y=a,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),x=Math.atan2(e.x,e.y),f=s0(this.a,this.e,this.sin_p12),S=Math.cos(x),j=this.e*this.cos_p12*S,U=-j*j/(1-this.es),B=3*this.es*(1-U)*this.sin_p12*this.cos_p12*S/(1-this.es),R=t/f,E=R-U*(1+U)*Math.pow(R,3)/6-B*(1+3*U)*Math.pow(R,4)/24,N=1-U*E*E/2-R*E*E*E/6,p=Math.asin(this.sin_p12*Math.cos(E)+this.cos_p12*Math.sin(E)*S),o=Ft(this.long0+Math.asin(Math.sin(x)*Math.sin(E)/Math.cos(p))),M=Math.sin(p),a=Math.atan2((M-this.es*N*this.sin_p12)*Math.tan(p),M*(1-this.es)),e.x=o,e.y=a,e))}var Aet=["Azimuthal_Equidistant","aeqd"];const Eet={init:ket,forward:Met,inverse:Tet,names:Aet};function Pet(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Det(e){var t,r,n,i,o,a,s,l,c=e.x,d=e.y;return n=Ft(c-this.long0),t=Math.sin(d),r=Math.cos(d),i=Math.cos(n),a=this.sin_p14*t+this.cos_p14*r*i,o=1,(a>0||Math.abs(a)<=Et)&&(s=this.a*o*r*Math.sin(n),l=this.y0+this.a*o*(this.cos_p14*t-this.sin_p14*r*i)),e.x=s,e.y=l,e}function Let(e){var t,r,n,i,o,a,s;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),r=gh(t/this.a),n=Math.sin(r),i=Math.cos(r),a=this.long0,Math.abs(t)<=Et?(s=this.lat0,e.x=a,e.y=s,e):(s=gh(i*this.sin_p14+e.y*n*this.cos_p14/t),o=Math.abs(this.lat0)-vt,Math.abs(o)<=Et?(this.lat0>=0?a=Ft(this.long0+Math.atan2(e.x,-e.y)):a=Ft(this.long0-Math.atan2(-e.x,e.y)),e.x=a,e.y=s,e):(a=Ft(this.long0+Math.atan2(e.x*n,t*this.cos_p14*i-e.y*this.sin_p14*n)),e.x=a,e.y=s,e))}var Oet=["ortho"];const Iet={init:Pet,forward:Det,inverse:Let,names:Oet};var ui={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},nn={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Net(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=vt-rn/2?this.face=ui.TOP:this.lat0<=-(vt-rn/2)?this.face=ui.BOTTOM:Math.abs(this.long0)<=rn?this.face=ui.FRONT:Math.abs(this.long0)<=vt+rn?this.face=this.long0>0?ui.RIGHT:ui.LEFT:this.face=ui.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Ret(e){var t={x:0,y:0},r,n,i,o,a,s,l={value:0};if(e.x-=this.long0,this.es!==0?r=Math.atan(this.one_minus_f_squared*Math.tan(e.y)):r=e.y,n=e.x,this.face===ui.TOP)o=vt-r,n>=rn&&n<=vt+rn?(l.value=nn.AREA_0,i=n-vt):n>vt+rn||n<=-(vt+rn)?(l.value=nn.AREA_1,i=n>0?n-Di:n+Di):n>-(vt+rn)&&n<=-rn?(l.value=nn.AREA_2,i=n+vt):(l.value=nn.AREA_3,i=n);else if(this.face===ui.BOTTOM)o=vt+r,n>=rn&&n<=vt+rn?(l.value=nn.AREA_0,i=-n+vt):n<rn&&n>=-rn?(l.value=nn.AREA_1,i=-n):n<-rn&&n>=-(vt+rn)?(l.value=nn.AREA_2,i=-n-vt):(l.value=nn.AREA_3,i=n>0?-n+Di:-n-Di);else{var c,d,h,u,g,f,p;this.face===ui.RIGHT?n=c0(n,+vt):this.face===ui.BACK?n=c0(n,+Di):this.face===ui.LEFT&&(n=c0(n,-vt)),u=Math.sin(r),g=Math.cos(r),f=Math.sin(n),p=Math.cos(n),c=g*p,d=g*f,h=u,this.face===ui.FRONT?(o=Math.acos(c),i=GM(o,h,d,l)):this.face===ui.RIGHT?(o=Math.acos(d),i=GM(o,h,-c,l)):this.face===ui.BACK?(o=Math.acos(-c),i=GM(o,h,-d,l)):this.face===ui.LEFT?(o=Math.acos(-d),i=GM(o,h,c,l)):(o=i=0,l.value=nn.AREA_0)}return s=Math.atan(12/Di*(i+Math.acos(Math.sin(i)*Math.cos(rn))-vt)),a=Math.sqrt((1-Math.cos(o))/(Math.cos(s)*Math.cos(s))/(1-Math.cos(Math.atan(1/Math.cos(i))))),l.value===nn.AREA_1?s+=vt:l.value===nn.AREA_2?s+=Di:l.value===nn.AREA_3&&(s+=1.5*Di),t.x=a*Math.cos(s),t.y=a*Math.sin(s),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function Fet(e){var t={lam:0,phi:0},r,n,i,o,a,s,l,c,d,h={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,n=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),r=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?h.value=nn.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(h.value=nn.AREA_1,r-=vt):e.x<0&&-e.x>=Math.abs(e.y)?(h.value=nn.AREA_2,r=r<0?r+Di:r-Di):(h.value=nn.AREA_3,r+=vt),d=Di/12*Math.tan(r),a=Math.sin(d)/(Math.cos(d)-1/Math.sqrt(2)),s=Math.atan(a),i=Math.cos(r),o=Math.tan(n),l=1-i*i*o*o*(1-Math.cos(Math.atan(1/Math.cos(s)))),l<-1?l=-1:l>1&&(l=1),this.face===ui.TOP)c=Math.acos(l),t.phi=vt-c,h.value===nn.AREA_0?t.lam=s+vt:h.value===nn.AREA_1?t.lam=s<0?s+Di:s-Di:h.value===nn.AREA_2?t.lam=s-vt:t.lam=s;else if(this.face===ui.BOTTOM)c=Math.acos(l),t.phi=c-vt,h.value===nn.AREA_0?t.lam=-s+vt:h.value===nn.AREA_1?t.lam=-s:h.value===nn.AREA_2?t.lam=-s-vt:t.lam=s<0?-s-Di:-s+Di;else{var u,g,f;u=l,d=u*u,d>=1?f=0:f=Math.sqrt(1-d)*Math.sin(s),d+=f*f,d>=1?g=0:g=Math.sqrt(1-d),h.value===nn.AREA_1?(d=g,g=-f,f=d):h.value===nn.AREA_2?(g=-g,f=-f):h.value===nn.AREA_3&&(d=g,g=f,f=-d),this.face===ui.RIGHT?(d=u,u=-g,g=d):this.face===ui.BACK?(u=-u,g=-g):this.face===ui.LEFT&&(d=u,u=g,g=-d),t.phi=Math.acos(-f)-vt,t.lam=Math.atan2(g,u),this.face===ui.RIGHT?t.lam=c0(t.lam,-vt):this.face===ui.BACK?t.lam=c0(t.lam,-Di):this.face===ui.LEFT&&(t.lam=c0(t.lam,+vt))}if(this.es!==0){var p,x,S;p=t.phi<0?1:0,x=Math.tan(t.phi),S=this.b/Math.sqrt(x*x+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-S*S)/(this.one_minus_f*S)),p&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function GM(e,t,r,n){var i;return e<Et?(n.value=nn.AREA_0,i=0):(i=Math.atan2(t,r),Math.abs(i)<=rn?n.value=nn.AREA_0:i>rn&&i<=vt+rn?(n.value=nn.AREA_1,i-=vt):i>vt+rn||i<=-(vt+rn)?(n.value=nn.AREA_2,i=i>=0?i-Di:i+Di):(n.value=nn.AREA_3,i+=vt)),i}function c0(e,t){var r=e+t;return r<-Di?r+=O1:r>+Di&&(r-=O1),r}var jet=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const Bet={init:Net,forward:Ret,inverse:Fet,names:jet};var l6=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],H1=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],bne=.8487,xne=1.3523,wne=Fc/5,zet=1/wne,u0=18,VM=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},$et=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function Wet(e,t,r,n){for(var i=t;n;--n){var o=e(i);if(i-=o,Math.abs(o)<r)break}return i}function Het(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function Uet(e){var t=Ft(e.x-this.long0),r=Math.abs(e.y),n=Math.floor(r*wne);n<0?n=0:n>=u0&&(n=u0-1),r=Fc*(r-zet*n);var i={x:VM(l6[n],r)*t,y:VM(H1[n],r)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*bne+this.x0,i.y=i.y*this.a*xne+this.y0,i}function Get(e){var t={x:(e.x-this.x0)/(this.a*bne),y:Math.abs(e.y-this.y0)/(this.a*xne)};if(t.y>=1)t.x/=l6[u0][0],t.y=e.y<0?-vt:vt;else{var r=Math.floor(t.y*u0);for(r<0?r=0:r>=u0&&(r=u0-1);;)if(H1[r][0]>t.y)--r;else if(H1[r+1][0]<=t.y)++r;else break;var n=H1[r],i=5*(t.y-n[0])/(H1[r+1][0]-n[0]);i=Wet(function(o){return(VM(n,o)-t.y)/$et(n,o)},i,Et,100),t.x/=VM(l6[r],i),t.y=(5*r+i)*To,e.y<0&&(t.y=-t.y)}return t.x=Ft(t.x+this.long0),t}var Vet=["Robinson","robin"];const Yet={init:Het,forward:Uet,inverse:Get,names:Vet};function qet(){this.name="geocent"}function Zet(e){var t=qre(e,this.es,this.a);return t}function Xet(e){var t=Zre(e,this.es,this.a,this.b);return t}var Ket=["Geocentric","geocentric","geocent","Geocent"];const Qet={init:qet,forward:Zet,inverse:Xet,names:Ket};var Zo={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},U1={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Jet(){if(Object.keys(U1).forEach(function(r){if(typeof this[r]=="undefined")this[r]=U1[r].def;else{if(U1[r].num&&isNaN(this[r]))throw new Error("Invalid parameter value, must be numeric "+r+" = "+this[r]);U1[r].num&&(this[r]=parseFloat(this[r]))}U1[r].degrees&&(this[r]=this[r]*To)}.bind(this)),Math.abs(Math.abs(this.lat0)-vt)<Et?this.mode=this.lat0<0?Zo.S_POLE:Zo.N_POLE:Math.abs(this.lat0)<Et?this.mode=Zo.EQUIT:(this.mode=Zo.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function ett(e){e.x-=this.long0;var t=Math.sin(e.y),r=Math.cos(e.y),n=Math.cos(e.x),i,o;switch(this.mode){case Zo.OBLIQ:o=this.sinph0*t+this.cosph0*r*n;break;case Zo.EQUIT:o=r*n;break;case Zo.S_POLE:o=-t;break;case Zo.N_POLE:o=t;break}switch(o=this.pn1/(this.p-o),i=o*r*Math.sin(e.x),this.mode){case Zo.OBLIQ:o*=this.cosph0*t-this.sinph0*r*n;break;case Zo.EQUIT:o*=t;break;case Zo.N_POLE:o*=-(r*n);break;case Zo.S_POLE:o*=r*n;break}var a,s;return a=o*this.cg+i*this.sg,s=1/(a*this.sw*this.h1+this.cw),i=(i*this.cg-o*this.sg)*this.cw*s,o=a*s,e.x=i*this.a,e.y=o*this.a,e}function ttt(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},r,n,i;i=1/(this.pn1-e.y*this.sw),r=this.pn1*e.x*i,n=this.pn1*e.y*this.cw*i,e.x=r*this.cg+n*this.sg,e.y=n*this.cg-r*this.sg;var o=sl(e.x,e.y);if(Math.abs(o)<Et)t.x=0,t.y=e.y;else{var a,s;switch(s=1-o*o*this.pfact,s=(this.p-Math.sqrt(s))/(this.pn1/o+o/this.pn1),a=Math.sqrt(1-s*s),this.mode){case Zo.OBLIQ:t.y=Math.asin(a*this.sinph0+e.y*s*this.cosph0/o),e.y=(a-this.sinph0*Math.sin(t.y))*o,e.x*=s*this.cosph0;break;case Zo.EQUIT:t.y=Math.asin(e.y*s/o),e.y=a*o,e.x*=s;break;case Zo.N_POLE:t.y=Math.asin(a),e.y=-e.y;break;case Zo.S_POLE:t.y=-Math.asin(a);break}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var rtt=["Tilted_Perspective","tpers"];const ntt={init:Jet,forward:ett,inverse:ttt,names:rtt};function itt(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function ott(e){var t=e.x,r=e.y,n,i,o,a;if(t=t-this.long0,this.shape==="ellipse"){r=Math.atan(this.radius_p2*Math.tan(r));var s=this.radius_p/sl(this.radius_p*Math.cos(r),Math.sin(r));if(i=s*Math.cos(t)*Math.cos(r),o=s*Math.sin(t)*Math.cos(r),a=s*Math.sin(r),(this.radius_g-i)*i-o*o-a*a*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;n=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(o/sl(a,n)),e.y=this.radius_g_1*Math.atan(a/n)):(e.x=this.radius_g_1*Math.atan(o/n),e.y=this.radius_g_1*Math.atan(a/sl(o,n)))}else this.shape==="sphere"&&(n=Math.cos(r),i=Math.cos(t)*n,o=Math.sin(t)*n,a=Math.sin(r),n=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(o/sl(a,n)),e.y=this.radius_g_1*Math.atan(a/n)):(e.x=this.radius_g_1*Math.atan(o/n),e.y=this.radius_g_1*Math.atan(a/sl(o,n))));return e.x=e.x*this.a,e.y=e.y*this.a,e}function att(e){var t=-1,r=0,n=0,i,o,a,s;if(e.x=e.x/this.a,e.y=e.y/this.a,this.shape==="ellipse"){this.flip_axis?(n=Math.tan(e.y/this.radius_g_1),r=Math.tan(e.x/this.radius_g_1)*sl(1,n)):(r=Math.tan(e.x/this.radius_g_1),n=Math.tan(e.y/this.radius_g_1)*sl(1,r));var l=n/this.radius_p;if(i=r*r+l*l+t*t,o=2*this.radius_g*t,a=o*o-4*i*this.C,a<0)return e.x=Number.NaN,e.y=Number.NaN,e;s=(-o-Math.sqrt(a))/(2*i),t=this.radius_g+s*t,r*=s,n*=s,e.x=Math.atan2(r,t),e.y=Math.atan(n*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape==="sphere"){if(this.flip_axis?(n=Math.tan(e.y/this.radius_g_1),r=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+n*n)):(r=Math.tan(e.x/this.radius_g_1),n=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+r*r)),i=r*r+n*n+t*t,o=2*this.radius_g*t,a=o*o-4*i*this.C,a<0)return e.x=Number.NaN,e.y=Number.NaN,e;s=(-o-Math.sqrt(a))/(2*i),t=this.radius_g+s*t,r*=s,n*=s,e.x=Math.atan2(r,t),e.y=Math.atan(n*Math.cos(e.x)/t)}return e.x=e.x+this.long0,e}var stt=["Geostationary Satellite View","Geostationary_Satellite","geos"];const ltt={init:itt,forward:ott,inverse:att,names:stt};var G1=1.340264,V1=-.081106,Y1=893e-6,q1=.003796,YM=Math.sqrt(3)/2;function ctt(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function utt(e){var t=Ft(e.x-this.long0),r=e.y,n=Math.asin(YM*Math.sin(r)),i=n*n,o=i*i*i;return e.x=t*Math.cos(n)/(YM*(G1+3*V1*i+o*(7*Y1+9*q1*i))),e.y=n*(G1+V1*i+o*(Y1+q1*i)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function dtt(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t=1e-9,r=12,n=e.y,i,o,a,s,l,c;for(c=0;c<r&&(i=n*n,o=i*i*i,a=n*(G1+V1*i+o*(Y1+q1*i))-e.y,s=G1+3*V1*i+o*(7*Y1+9*q1*i),n-=l=a/s,!(Math.abs(l)<t));++c);return i=n*n,o=i*i*i,e.x=YM*e.x*(G1+3*V1*i+o*(7*Y1+9*q1*i))/Math.cos(n),e.y=Math.asin(Math.sin(n)/YM),e.x=Ft(e.x+this.long0),e}var htt=["eqearth","Equal Earth","Equal_Earth"];const ptt={init:ctt,forward:utt,inverse:dtt,names:htt};function ftt(e){e.Proj.projections.add(WM),e.Proj.projections.add(HM),e.Proj.projections.add(pQe),e.Proj.projections.add(_Qe),e.Proj.projections.add(EQe),e.Proj.projections.add(IQe),e.Proj.projections.add(zQe),e.Proj.projections.add(GQe),e.Proj.projections.add(XQe),e.Proj.projections.add(tJe),e.Proj.projections.add(yJe),e.Proj.projections.add(SJe),e.Proj.projections.add(EJe),e.Proj.projections.add(NJe),e.Proj.projections.add(zJe),e.Proj.projections.add(GJe),e.Proj.projections.add(XJe),e.Proj.projections.add(tet),e.Proj.projections.add(set),e.Proj.projections.add(pet),e.Proj.projections.add(yet),e.Proj.projections.add(_et),e.Proj.projections.add(Eet),e.Proj.projections.add(Iet),e.Proj.projections.add(Bet),e.Proj.projections.add(Yet),e.Proj.projections.add(Qet),e.Proj.projections.add(ntt),e.Proj.projections.add(ltt),e.Proj.projections.add(ptt)}_s.defaultDatum="WGS84",_s.Proj=zc,_s.WGS84=new _s.Proj("WGS84"),_s.Point=o0,_s.toPoint=Jre,_s.defs=sa,_s.nadgrid=gKe,_s.transform=zM,_s.mgrs=DKe,_s.version="__VERSION__",ftt(_s);const gtt=D9(Object.freeze(Object.defineProperty({__proto__:null,default:_s},Symbol.toStringTag,{value:"Module"})));(function(e){(function(t){var r,n;r=Ire,n=gtt,e.exports=t(r,n)})(function(t,r){return r.__esModule&&r.default&&(r=r.default),t.Proj={},t.Proj._isProj4Obj=function(n){return typeof n.inverse!="undefined"&&typeof n.forward!="undefined"},t.Proj.Projection=t.Class.extend({initialize:function(n,i,o){var a=t.Proj._isProj4Obj(n);this._proj=a?n:this._projFromCodeDef(n,i),this.bounds=a?i:o},project:function(n){var i=this._proj.forward([n.lng,n.lat]);return new t.Point(i[0],i[1])},unproject:function(n,i){var o=this._proj.inverse([n.x,n.y]);return new t.LatLng(o[1],o[0],i)},_projFromCodeDef:function(n,i){if(i)r.defs(n,i);else if(r.defs[n]===void 0){var o=n.split(":");if(o.length>3&&(n=o[o.length-3]+":"+o[o.length-1]),r.defs[n]===void 0)throw"No projection definition for code "+n}return r(n)}}),t.Proj.CRS=t.Class.extend({includes:t.CRS,options:{transformation:new t.Transformation(1,0,-1,0)},initialize:function(n,i,o){var a,s,l,c;if(t.Proj._isProj4Obj(n)?(s=n,a=s.srsCode,c=i||{},this.projection=new t.Proj.Projection(s,c.bounds)):(a=n,l=i,c=o||{},this.projection=new t.Proj.Projection(a,l,c.bounds)),t.Util.setOptions(this,c),this.code=a,this.transformation=this.options.transformation,this.options.origin&&(this.transformation=new t.Transformation(1,-this.options.origin[0],-1,this.options.origin[1])),this.options.scales)this._scales=this.options.scales;else if(this.options.resolutions){this._scales=[];for(var d=this.options.resolutions.length-1;d>=0;d--)this.options.resolutions[d]&&(this._scales[d]=1/this.options.resolutions[d])}this.infinite=!this.options.bounds},scale:function(n){var i=Math.floor(n),o,a,s,l;return n===i?this._scales[n]:(o=this._scales[i],a=this._scales[i+1],s=a-o,l=n-i,o+s*l)},zoom:function(n){var i=this._closestElement(this._scales,n),o=this._scales.indexOf(i),a,s,l;return n===i?o:i===void 0?-1/0:(s=o+1,a=this._scales[s],a===void 0?1/0:(l=a-i,(n-i)/l+o))},distance:t.CRS.Earth.distance,R:t.CRS.Earth.R,_closestElement:function(n,i){for(var o,a=n.length;a--;)n[a]<=i&&(o===void 0||o<n[a])&&(o=n[a]);return o}}),t.Proj.GeoJSON=t.GeoJSON.extend({initialize:function(n,i){this._callLevel=0,t.GeoJSON.prototype.initialize.call(this,n,i)},addData:function(n){var i;n&&(n.crs&&n.crs.type==="name"?i=new t.Proj.CRS(n.crs.properties.name):n.crs&&n.crs.type&&(i=new t.Proj.CRS(n.crs.type+":"+n.crs.properties.code)),i!==void 0&&(this.options.coordsToLatLng=function(o){var a=t.point(o[0],o[1]);return i.projection.unproject(a)})),this._callLevel++;try{t.GeoJSON.prototype.addData.call(this,n)}finally{this._callLevel--,this._callLevel===0&&delete this.options.coordsToLatLng}}}),t.Proj.geoJson=function(n,i){return new t.Proj.GeoJSON(n,i)},t.Proj.ImageOverlay=t.ImageOverlay.extend({initialize:function(n,i,o){t.ImageOverlay.prototype.initialize.call(this,n,null,o),this._projectedBounds=i},_animateZoom:function(n){var i=this._map.getZoomScale(n.zoom),o=t.point(this._projectedBounds.min.x,this._projectedBounds.max.y),a=this._projectedToNewLayerPoint(o,n.zoom,n.center);t.DomUtil.setTransform(this._image,a,i)},_reset:function(){var n=this._map.getZoom(),i=this._map.getPixelOrigin(),o=t.bounds(this._transform(this._projectedBounds.min,n)._subtract(i),this._transform(this._projectedBounds.max,n)._subtract(i)),a=o.getSize();t.DomUtil.setPosition(this._image,o.min),this._image.style.width=a.x+"px",this._image.style.height=a.y+"px"},_projectedToNewLayerPoint:function(n,i,o){var a=this._map.getSize()._divideBy(2),s=this._map.project(o,i)._subtract(a)._round(),l=s.add(this._map._getMapPanePos());return this._transform(n,i)._subtract(l)},_transform:function(n,i){var o=this._map.options.crs,a=o.transformation,s=o.scale(i);return a.transform(n,s)}}),t.Proj.imageOverlay=function(n,i,o){return new t.Proj.ImageOverlay(n,i,o)},t.Proj})})(PXe);const mtt=[{officialName:"Afghanistan",allNames:["af","afġānistān","afghanistan","afg"],id:"AFG"},{id:"ALA",officialName:"Åland Islands",allNames:["ax","ala","åland islands","aland islands"]},{officialName:"Albania",allNames:["al","shqipëri","shqipëria","shqipnia","albania","alb"],id:"ALB"},{officialName:"Algeria",allNames:["dz","dzayer","algérie","algeria","dza"],id:"DZA"},{officialName:"American Samoa",allNames:["as","amerika sāmoa","amelika sāmoa","sāmoa amelika","american samoa","asm"],id:"ASM"},{id:"AND",officialName:"Andorra",allNames:["ad","and","andorra"]},{officialName:"Angola",allNames:["ao","república de angola","ʁɛpublika de an'ɡɔla","angola","ago"],id:"AGO"},{officialName:"Anguilla",allNames:["ai","anguilla","aia"],id:"AIA"},{id:"ATA",officialName:"Antarctica",allNames:["aq","ata","antarctica"]},{officialName:"Antigua and Barbuda",allNames:["ag","antigua and barbuda","atg"],id:"ATG"},{officialName:"Argentina",allNames:["ar","argentine republic","república argentina","argentina","arg"],id:"ARG"},{officialName:"Armenia",allNames:["am","hayastan","republic of armenia","հայաստանի հանրապետություն","armenia","arm"],id:"ARM"},{officialName:"Aruba",allNames:["aw","aruba","abw"],id:"ABW"},{officialName:"Australia",allNames:["au","australia","aus"],id:"AUS"},{officialName:"Austria",allNames:["at","österreich","osterreich","oesterreich","austria","aut"],id:"AUT"},{officialName:"Azerbaijan",allNames:["az","republic of azerbaijan","azərbaycan respublikası","azerbaijan","aze","azerbaijan republic"],id:"AZE"},{officialName:"Bahrain",allNames:["bh","kingdom of bahrain","mamlakat al-baḥrayn","bahrain","bhr"],id:"BHR"},{officialName:"Bangladesh",allNames:["bd","people's republic of bangladesh","gônôprôjatôntri bangladesh","bangladesh","bgd"],id:"BGD"},{officialName:"Barbados",allNames:["bb","barbados","brb"],id:"BRB"},{officialName:"Belarus",allNames:["by","bielaruś","republic of belarus","белоруссия","республика беларусь","belorussiya","respublika belarus’","belarus","blr"],id:"BLR"},{officialName:"Belgium",allNames:["be","belgië","belgie","belgien","belgique","kingdom of belgium","koninkrijk belgië","royaume de belgique","königreich belgien","belgium","bel"],id:"BEL"},{officialName:"Belize",allNames:["bz","belize","blz"],id:"BLZ"},{officialName:"Benin",allNames:["bj","republic of benin","république du bénin","benin","ben"],id:"BEN"},{officialName:"Bermuda",allNames:["bm","the islands ofbermuda","the bermudas","somers isles","bermuda","bmu"],id:"BMU"},{officialName:"Bhutan",allNames:["bt","kingdom of bhutan","bhutan","btn"],id:"BTN"},{officialName:"Bolivia",allNames:["bo","buliwya","wuliwya","plurinational state of bolivia","estado plurinacional de bolivia","buliwya mamallaqta","wuliwya suyu","tetã volívia","bolivia","bol","plurinational state of"],id:"BOL"},{id:"BES",officialName:"Bonaire",allNames:["bq","bes","bonaire","sint eustatius and saba","caribbean netherlands"]},{officialName:"Bosnia and Herzegovina",allNames:["ba","bosnia-herzegovina","босна и херцеговина","bosnia and herzegovina","bih"],id:"BIH"},{officialName:"Botswana",allNames:["bw","republic of botswana","lefatshe la botswana","botswana","bwa"],id:"BWA"},{id:"BVT",officialName:"Bouvet Island",allNames:["bv","bvt","bouvet island"]},{officialName:"Brazil",allNames:["br","brasil","federative republic of brazil","república federativa do brasil","brazil","bra"],id:"BRA"},{officialName:"British Indian Ocean Territory",allNames:["io","british indian ocean territory","iot"],id:"IOT"},{officialName:"Brunei",allNames:["bn","nation of brunei","the abode of peace","brunei","brn","brunei darussalam"],id:"BRN"},{officialName:"Bulgaria",allNames:["bg","republic of bulgaria","република българия","bulgaria","bgr"],id:"BGR"},{officialName:"Burkina Faso",allNames:["bf","burkina faso","bfa"],id:"BFA"},{officialName:"Burundi",allNames:["bi","republic of burundi","republika y'uburundi","république du burundi","burundi","bdi"],id:"BDI"},{officialName:"Cambodia",allNames:["kh","kingdom of cambodia","cambodia","khm"],id:"KHM"},{officialName:"Cameroon",allNames:["cm","republic of cameroon","république du cameroun","cameroon","cmr"],id:"CMR"},{officialName:"Canada",allNames:["ca","canada","can"],id:"CAN"},{officialName:"Cape Verde",allNames:["cv","republic of cabo verde","república de cabo verde","cape verde","cpv"],id:"CPV"},{officialName:"Cayman Islands",allNames:["ky","cayman islands","cym"],id:"CYM"},{officialName:"Central African Republic",allNames:["cf","central african republic","république centrafricaine","central african republic","caf"],id:"CAF"},{officialName:"Chad",allNames:["td","tchad","republic of chad","république du tchad","chad","tcd"],id:"TCD"},{officialName:"Chile",allNames:["cl","republic of chile","república de chile","chile","chl"],id:"CHL"},{officialName:"China",allNames:["cn","zhōngguó","zhongguo","zhonghua","people's republic of china","中华人民共和国","zhōnghuá rénmín gònghéguó","china","chn"],id:"CHN"},{officialName:"Christmas Island",allNames:["cx","territory of christmas island","christmas island","cxr"],id:"CXR"},{officialName:"Cocos (Keeling) Islands",allNames:["cc","territoryof the cocos (keeling) islands","keeling islands","cocos (keeling) islands","cck","cocos islands","cocos [keeling] islands"],id:"CCK"},{officialName:"Colombia",allNames:["co","republic of colombia","república de colombia","colombia","col"],id:"COL"},{officialName:"Comoros",allNames:["km","union of the comoros","union des comores","udzima wa komori","al-ittiḥād al-qumurī","comoros","com"],id:"COM"},{officialName:"Cook Islands",allNames:["ck","kūki 'āirani","cook islands","cok"],id:"COK"},{officialName:"Costa Rica",allNames:["cr","republic of costa rica","república de costa rica","costa rica","cri"],id:"CRI"},{officialName:"Croatia",allNames:["hr","hrvatska","republic of croatia","republika hrvatska","croatia","hrv","croatia, republic of","croatia democratic republic of the"],id:"HRV"},{officialName:"Cuba",allNames:["cu","republic of cuba","república de cuba","cuba","cub"],id:"CUB"},{id:"CUW",officialName:"Curaçao",allNames:["cw","cuw","curaçao","curacao"]},{officialName:"Cyprus",allNames:["cy","kýpros","kıbrıs","republic of cyprus","κυπριακή δημοκρατία","kıbrıs cumhuriyeti","cyprus","cyp"],id:"CYP"},{officialName:"Czech Republic",allNames:["cz","česká republika","česko","czech republic","cze"],id:"CZE"},{officialName:"Democratic Republic of the Congo",allNames:["cd","dr congo","congo-kinshasa","drc","democratic republic of the congo","cod","congo (kinshasa)","the democratic republic of the congo","congo, the democratic republic of the","congo [drc]","congo, dem. rep."],id:"COD"},{officialName:"Denmark",allNames:["dk","danmark","kingdom of denmark","kongeriget danmark","denmark","dnk"],id:"DNK"},{officialName:"Djibouti",allNames:["dj","jabuuti","gabuuti","republic of djibouti","république de djibouti","gabuutih ummuuno","jamhuuriyadda jabuuti","djibouti","dji"],id:"DJI"},{officialName:"Dominica",allNames:["dm","dominique","wai‘tu kubuli","commonwealth of dominica","dominica","dma"],id:"DMA"},{officialName:"Dominican Republic",allNames:["do","dominican republic","dom"],id:"DOM"},{officialName:"East Timor",allNames:["tl","east timor","democratic republic of timor-leste","república democrática de timor-leste","repúblika demokrátika timór-leste","east timor","tls","timor-leste"],id:"TLS"},{officialName:"Ecuador",allNames:["ec","republic of ecuador","república del ecuador","ecuador","ecu"],id:"ECU"},{officialName:"Egypt",allNames:["eg","arab republic of egypt","egypt","egy"],id:"EGY"},{officialName:"El Salvador",allNames:["sv","republic of el salvador","república de el salvador","el salvador","slv"],id:"SLV"},{officialName:"Equatorial Guinea",allNames:["gq","republic of equatorial guinea","república de guinea ecuatorial","république de guinée équatoriale","república da guiné equatorial","equatorial guinea","gnq"],id:"GNQ"},{officialName:"Eritrea",allNames:["er","state of eritrea","ሃገረ ኤርትራ","dawlatiritriyá","ʾertrā","iritriyā","eritrea","eri"],id:"ERI"},{officialName:"Estonia",allNames:["ee","eesti","republic of estonia","eesti vabariik","estonia","est"],id:"EST"},{officialName:"Ethiopia",allNames:["et","ʾītyōṗṗyā","federal democratic republic of ethiopia","የኢትዮጵያ ፌዴራላዊ ዲሞክራሲያዊ ሪፐብሊክ","ethiopia","eth"],id:"ETH"},{officialName:"Falkland Islands",allNames:["fk","islas malvinas","falkland islands","flk","falkland islands (malvinas)","falkland islands (islas malvinas)","falkland islands [malvinas]","falkland islands [islas malvinas]"],id:"FLK"},{officialName:"Faroe Islands",allNames:["fo","føroyar","færøerne","faroe islands","fro"],id:"FRO"},{officialName:"Federated States of Micronesia",allNames:["fm","federated states of micronesia","federated states of micronesia","fsm","micronesia","federated states of"],id:"FSM"},{officialName:"Fiji",allNames:["fj","viti","republic of fiji","matanitu ko viti","fijī gaṇarājya","fiji","fji"],id:"FJI"},{officialName:"Finland",allNames:["fi","suomi","republic of finland","suomen tasavalta","republiken finland","finland","fin"],id:"FIN"},{officialName:"France",allNames:["fr","french republic","république française","france","fra"],id:"FRA"},{officialName:"French Guiana",allNames:["gf","guiana","guyane","french guiana","guf"],id:"GUF"},{officialName:"French Polynesia",allNames:["pf","polynésie française","french polynesia","pōrīnetia farāni","french polynesia","pyf"],id:"PYF"},{officialName:"French Southern and Antarctic Lands",allNames:["tf","french southern andantarctic lands","atf","french southern territories"],id:"ATF"},{officialName:"Gabon",allNames:["ga","gabonese republic","république gabonaise","gabon","gab","gabon republic"],id:"GAB"},{officialName:"Georgia",allNames:["ge","sakartvelo","georgia","geo"],id:"GEO"},{officialName:"Germany",allNames:["de","federal republic of germany","bundesrepublik deutschland","germany","deu"],id:"DEU"},{officialName:"Ghana",allNames:["gh","ghana","gha"],id:"GHA"},{officialName:"Gibraltar",allNames:["gi","gibraltar","gib"],id:"GIB"},{officialName:"Greece",allNames:["gr","elláda","hellenic republic","ελληνική δημοκρατία","greece","grc"],id:"GRC"},{officialName:"Greenland",allNames:["gl","grønland","greenland","grl"],id:"GRL"},{officialName:"Grenada",allNames:["gd","grenada","grd"],id:"GRD"},{officialName:"Guadeloupe",allNames:["gp","gwadloup","guadeloupe","glp"],id:"GLP"},{officialName:"Guam",allNames:["gu","guåhån","guam","gum"],id:"GUM"},{officialName:"Guatemala",allNames:["gt","guatemala","gtm"],id:"GTM"},{officialName:"Guernsey",allNames:["gg","bailiwick of guernsey","bailliage de guernesey","guernsey","ggy"],id:"GGY"},{officialName:"Guinea",allNames:["gn","republic of guinea","république de guinée","guinea","gin"],id:"GIN"},{officialName:"Guinea-Bissau",allNames:["gw","republic of guinea-bissau","república da guiné-bissau","guinea-bissau","gnb"],id:"GNB"},{officialName:"Guyana",allNames:["gy","co-operative republic of guyana","guyana","guy"],id:"GUY"},{officialName:"Haiti",allNames:["ht","republic of haiti","république d'haïti","repiblik ayiti","haiti","hti"],id:"HTI"},{officialName:"Heard Island and McDonald Islands",allNames:["hm","heard island and mcdonald islands","hmd","heard and mcdonald islands"],id:"HMD"},{officialName:"Honduras",allNames:["hn","republic of honduras","república de honduras","honduras","hnd"],id:"HND"},{officialName:"Hong Kong",allNames:["hk","香港","hongkong","hkg","hong kong","hong kong, china"],id:"HKG"},{officialName:"Hungary",allNames:["hu","hungary","hun"],id:"HUN"},{officialName:"Iceland",allNames:["is","island","republic of iceland","lýðveldið ísland","iceland","isl"],id:"ISL"},{officialName:"India",allNames:["in","bhārat","republic of india","bharat ganrajya","india","ind"],id:"IND"},{officialName:"Indonesia",allNames:["id","republic of indonesia","republik indonesia","indonesia","idn"],id:"IDN"},{officialName:"Iran",allNames:["ir","islamic republic of iran","jomhuri-ye eslāmi-ye irān","iran","irn","islamic republic of"],id:"IRN"},{officialName:"Iraq",allNames:["iq","republic of iraq","jumhūriyyat al-‘irāq","iraq","irq"],id:"IRQ"},{officialName:"Ireland",allNames:["ie","éire","republic of ireland","poblacht na héireann","ireland","irl"],id:"IRL"},{officialName:"Isle of Man",allNames:["im","ellan vannin","mann","mannin","isle of man","imn"],id:"IMN"},{officialName:"Israel",allNames:["il","state of israel","medīnat yisrā'el","israel","isr"],id:"ISR"},{officialName:"Italy",allNames:["it","italian republic","repubblica italiana","italy","ita"],id:"ITA"},{officialName:"Ivory Coast",allNames:["ci","ivory coast","republic of côte d'ivoire","république de côte d'ivoire","ivory coast","civ","côte d'ivoire","cote d'ivoire","cote divoire","cã´te d'ivoire","cote d'lvoire"],id:"CIV"},{officialName:"Jamaica",allNames:["jm","jamaica","jam"],id:"JAM"},{officialName:"Japan",allNames:["jp","nippon","nihon","japan","jpn"],id:"JPN"},{officialName:"Jersey",allNames:["je","bailiwick of jersey","bailliage de jersey","bailliage dé jèrri","jersey","jey"],id:"JEY"},{officialName:"Jordan",allNames:["jo","hashemite kingdomof jordan","al-mamlakah al-urdunīyah al-hāshimīyah","jordan","jor"],id:"JOR"},{officialName:"Kazakhstan",allNames:["kz","qazaqstan","казахстан","republic of kazakhstan","қазақстан республикасы","qazaqstan respublïkası","республика казахстан","respublika kazakhstan","kazakhstan","kaz"],id:"KAZ"},{officialName:"Kenya",allNames:["ke","republic of kenya","jamhuri ya kenya","kenya","ken"],id:"KEN"},{officialName:"Kiribati",allNames:["ki","republic of kiribati","ribaberiki kiribati","kiribati","kir"],id:"KIR"},{officialName:"Kuwait",allNames:["kw","state of kuwait","dawlat al-kuwait","kuwait","kwt"],id:"KWT"},{officialName:"Kyrgyzstan",allNames:["kg","киргизия","kyrgyz republic","кыргыз республикасы","kyrgyz respublikasy","kyrgyzstan","kgz"],id:"KGZ"},{officialName:"Laos",allNames:["la","lao","lao people's democratic republic","sathalanalat paxathipatai paxaxon lao","laos","lao"],id:"LAO"},{officialName:"Latvia",allNames:["lv","republic of latvia","latvijas republika","latvia","lva"],id:"LVA"},{officialName:"Lebanon",allNames:["lb","lebanese republic","al-jumhūrīyah al-libnānīyah","lebanon","lbn"],id:"LBN"},{officialName:"Lesotho",allNames:["ls","kingdom of lesotho","muso oa lesotho","lesotho","lso"],id:"LSO"},{officialName:"Liberia",allNames:["lr","republic of liberia","liberia","lbr"],id:"LBR"},{officialName:"Libya",allNames:["ly","state of libya","dawlat libya","libya","lby"],id:"LBY"},{officialName:"Liechtenstein",allNames:["li","principality of liechtenstein","fürstentum liechtenstein","liechtenstein","lie"],id:"LIE"},{officialName:"Lithuania",allNames:["lt","republic of lithuania","lietuvos respublika","lithuania","ltu"],id:"LTU"},{officialName:"Luxembourg",allNames:["lu","grand duchy of luxembourg","grand-duché de luxembourg","großherzogtum luxemburg","groussherzogtum lëtzebuerg","luxembourg","lux"],id:"LUX"},{officialName:"Macau",allNames:["mo","澳门","macao special administrative region of the people's republic of china","中華人民共和國澳門特別行政區","região administrativa especial de macau da república popular da china","macau","mac","macao","macao, china","macau, china"],id:"MAC"},{officialName:"Madagascar",allNames:["mg","republic of madagascar","repoblikan'i madagasikara","république de madagascar","madagascar","mdg"],id:"MDG"},{officialName:"Malawi",allNames:["mw","republic of malawi","malawi","mwi"],id:"MWI"},{officialName:"Malaysia",allNames:["my","malaysia","mys"],id:"MYS"},{officialName:"Maldives",allNames:["mv","maldive islands","republic of the maldives","dhivehi raajjeyge jumhooriyya","maldives","mdv"],id:"MDV"},{officialName:"Mali",allNames:["ml","republic of mali","république du mali","mali","mli"],id:"MLI"},{officialName:"Malta",allNames:["mt","republic of malta","repubblika ta' malta","malta","mlt"],id:"MLT"},{officialName:"Marshall Islands",allNames:["mh","republic of the marshall islands","aolepān aorōkin m̧ajeļ","marshall islands","mhl"],id:"MHL"},{officialName:"Martinique",allNames:["mq","martinique","mtq"],id:"MTQ"},{officialName:"Mauritania",allNames:["mr","islamic republic of mauritania","al-jumhūriyyah al-ʾislāmiyyah al-mūrītāniyyah","mauritania","mrt"],id:"MRT"},{officialName:"Mauritius",allNames:["mu","republic of mauritius","république de maurice","mauritius","mus"],id:"MUS"},{officialName:"Mayotte",allNames:["yt","department of mayotte","département de mayotte","mayotte","myt"],id:"MYT"},{officialName:"Mexico",allNames:["mx","mexicanos","united mexican states","estados unidos mexicanos","mexico","mex"],id:"MEX"},{officialName:"Moldova",allNames:["md","republic of moldova","republica moldova","moldova","mda","republic of"],id:"MDA"},{officialName:"Monaco",allNames:["mc","principality of monaco","principauté de monaco","monaco","mco"],id:"MCO"},{officialName:"Mongolia",allNames:["mn","mongolia","mng"],id:"MNG"},{id:"MNE",officialName:"Montenegro",allNames:["me","mne","montenegro"]},{officialName:"Montserrat",allNames:["ms","montserrat","msr"],id:"MSR"},{officialName:"Morocco",allNames:["ma","kingdom of morocco","al-mamlakah al-maġribiyah","morocco","mar","morroco"],id:"MAR"},{officialName:"Mozambique",allNames:["mz","republic of mozambique","república de moçambique","mozambique","moz"],id:"MOZ"},{id:"MMR",officialName:"Myanmar",allNames:["mm","mmr","myanmar","myanmar (burma)","myanmar [burma]","burma"]},{officialName:"Namibia",allNames:["na","namibië","republic of namibia","namibia","nam"],id:"NAM"},{officialName:"Nauru",allNames:["nr","naoero","pleasant island","republic of nauru","ripublik naoero","nauru","nru"],id:"NRU"},{officialName:"Nepal",allNames:["np","federal democratic republic of nepal","loktāntrik ganatantra nepāl","nepal","npl"],id:"NPL"},{officialName:"Netherlands",allNames:["nl","holland","nederland","netherlands","nld","the netherlands"],id:"NLD"},{officialName:"New Caledonia",allNames:["nc","new caledonia","ncl"],id:"NCL"},{officialName:"New Zealand",allNames:["nz","aotearoa","new zealand","nzl"],id:"NZL"},{officialName:"Nicaragua",allNames:["ni","republic of nicaragua","república de nicaragua","nicaragua","nic"],id:"NIC"},{officialName:"Niger",allNames:["ne","nijar","republic of niger","république du niger","niger","ner"],id:"NER"},{officialName:"Nigeria",allNames:["ng","nijeriya","naíjíríà","federal republic of nigeria","nigeria","nga"],id:"NGA"},{officialName:"Niue",allNames:["nu","niue","niu"],id:"NIU"},{officialName:"Norfolk Island",allNames:["nf","territory of norfolk island","teratri of norf'k ailen","norfolk island","nfk"],id:"NFK"},{officialName:"North Korea",allNames:["kp","democratic people's republic of korea","조선민주주의인민공화국","chosŏn minjujuŭi inmin konghwaguk","north korea","prk","korea, democratic people's republic of","korea, north"],id:"PRK"},{officialName:"Northern Mariana Islands",allNames:["mp","commonwealth of the northern mariana islands","sankattan siha na islas mariånas","northern mariana islands","mnp"],id:"MNP"},{officialName:"Norway",allNames:["no","norge","noreg","kingdom of norway","kongeriket norge","kongeriket noreg","norway","nor"],id:"NOR"},{officialName:"Oman",allNames:["om","sultanate of oman","salṭanat ʻumān","oman","omn"],id:"OMN"},{officialName:"Pakistan",allNames:["pk","pākistān","islamic republic of pakistan","islāmī jumhūriya'eh pākistān","pakistan","pak"],id:"PAK"},{officialName:"Palau",allNames:["pw","republic of palau","beluuer a belau","palau","plw"],id:"PLW"},{id:"PSE",officialName:"Palestinian Authority",allNames:["ps","pse","palestinian authority","palestinian territory"]},{officialName:"Panama",allNames:["pa","republic of panama","república de panamá","panama","pan"],id:"PAN"},{officialName:"Papua New Guinea",allNames:["pg","independent state of papua new guinea","independen stet bilong papua niugini","papua new guinea","png"],id:"PNG"},{officialName:"Paraguay",allNames:["py","republic of paraguay","república del paraguay","tetã paraguái","paraguay","pry"],id:"PRY"},{officialName:"Peru",allNames:["pe","republic of peru","república del perú","peru","per"],id:"PER"},{officialName:"Philippines",allNames:["ph","republic of the philippines","repúblika ng pilipinas","philippines","phl"],id:"PHL"},{officialName:"Pitcairn Islands",allNames:["pn","pitcairn henderson ducie and oeno islands","pitcairn islands","pcn","pitcairn"],id:"PCN"},{officialName:"Poland",allNames:["pl","republic of poland","rzeczpospolita polska","poland","pol"],id:"POL"},{officialName:"Portugal",allNames:["pt","portuguesa","portuguese republic","república portuguesa","portugal","prt"],id:"PRT"},{officialName:"Puerto Rico",allNames:["pr","commonwealth of puerto rico","estado libre asociado de puerto rico","puerto rico","pri"],id:"PRI"},{officialName:"Qatar",allNames:["qa","state of qatar","dawlat qaṭar","qatar","qat"],id:"QAT"},{officialName:"Republic of Macedonia",allNames:["mk","republic of macedonia","република македонија","republic of macedonia","mkd","macedonia","macedonia (fyrom)","macedonia [fyrom]","the former yugoslav republic of","the former yugoslav republic of macedonia"],id:"MKD"},{officialName:"Republic of the Congo",allNames:["cg","congo-brazzaville","republic of the congo","cog","congo (brazzaville)","congo [republic]","congo","congo, rep."],id:"COG"},{officialName:"Réunion",allNames:["re","reunion","réunion","reu","rã©union"],id:"REU"},{officialName:"Romania",allNames:["ro","rumania","roumania","românia","romania","rou"],id:"ROU"},{officialName:"Russia",allNames:["ru","rossiya","russian federation","российская федерация","rossiyskaya federatsiya","russia","rus"],id:"RUS"},{officialName:"Rwanda",allNames:["rw","republic of rwanda","repubulika y'u rwanda","république du rwanda","rwanda","rwa"],id:"RWA"},{id:"BLM",officialName:"Saint Barthélemy",allNames:["bl","blm","saint barthélemy","saint barthelemy","st barthelemy"]},{officialName:"Saint Helena",allNames:["sh","saint helena","shn","st helena","ascension and tristan da cunha"],id:"SHN"},{officialName:"Saint Kitts and Nevis",allNames:["kn","federation of saint christopher and nevis","saint kitts and nevis","kna","st kitts and nevis","saint kitts-nevis","st kitts-nevis"],id:"KNA"},{officialName:"Saint Lucia",allNames:["lc","saint lucia","lca","st lucia"],id:"LCA"},{officialName:"Saint Pierre and Miquelon",allNames:["pm","collectivité territoriale de saint-pierre-et-miquelon","saint pierre andmiquelon","spm","st pierre and miquelon","saint pierre and miquelon","st. pierre and miquelon"],id:"SPM"},{officialName:"Saint Vincent and the Grenadines",allNames:["vc","saint vincent and the grenadines","vct","st vincent and the grenadines"],id:"VCT"},{officialName:"Samoa",allNames:["ws","independent state of samoa","malo saʻoloto tutoʻatasi o sāmoa","samoa","wsm","western samoa"],id:"WSM"},{officialName:"San Marino",allNames:["sm","republic of san marino","repubblica di san marino","san marino","smr"],id:"SMR"},{officialName:"São Tomé and Príncipe",allNames:["st","democratic republic of são tomé and príncipe","república democrática de são tomé e príncipe","são tomé and príncipe","stp","sao tome and principe","sã£o tomã© and prãncipe"],id:"STP"},{officialName:"Saudi Arabia",allNames:["sa","kingdom of saudi arabia","al-mamlakah al-‘arabiyyah as-su‘ūdiyyah","saudi arabia","sau"],id:"SAU"},{officialName:"Senegal",allNames:["sn","republic of senegal","république du sénégal","senegal","sen"],id:"SEN"},{id:"SRB",officialName:"Serbia",allNames:["rs","srb","serbia"]},{officialName:"Seychelles",allNames:["sc","republic of seychelles","repiblik sesel","république des seychelles","seychelles","syc"],id:"SYC"},{officialName:"Sierra Leone",allNames:["sl","republic of sierra leone","sierra leone","sle"],id:"SLE"},{officialName:"Singapore",allNames:["sg","singapura","republik singapura","新加坡共和国","singapore","sgp"],id:"SGP"},{officialName:"Slovakia",allNames:["sk","slovak republic","slovenská republika","slovakia","svk","slovakia (slovak republic)"],id:"SVK"},{officialName:"Slovenia",allNames:["si","republic of slovenia","republika slovenija","slovenia","svn"],id:"SVN"},{officialName:"Solomon Islands",allNames:["sb","solomon islands","slb"],id:"SLB"},{officialName:"Somalia",allNames:["so","aṣ-ṣūmāl","federal republic of somalia","jamhuuriyadda federaalka soomaaliya","jumhūriyyat aṣ-ṣūmāl al-fiderāliyya","somalia","som"],id:"SOM"},{officialName:"South Africa",allNames:["za","rsa","suid-afrika","republic of south africa","south africa","zaf"],id:"ZAF"},{officialName:"South Georgia",allNames:["gs","south georgia and the south sandwich islands","south georgia","sgs"],id:"SGS"},{officialName:"South Korea",allNames:["kr","republic of korea","south korea","kor","korea, republic of","korea, south"],id:"KOR"},{officialName:"South Sudan",allNames:["ss","south sudan","ssd"],id:"SSD"},{officialName:"Spain",allNames:["es","kingdom of spain","reino deespaña","spain","esp"],id:"ESP"},{officialName:"Sri Lanka",allNames:["lk","ilaṅkai","democraticsocialist republic of sri lanka","sri lanka","lka"],id:"LKA"},{id:"SXM",officialName:"St Maarten",allNames:["sx","sxm","st maarten","sint maarten","sint maarten (dutch part)","saint-martin (pays-bas)"]},{id:"MAF",officialName:"St Martin (French part)",allNames:["mf","maf","st martin (french part)","saint martin (french part)","saint-martin (france)"]},{officialName:"Sudan",allNames:["sd","republic of the sudan","jumhūrīyat as-sūdān","sudan","sdn"],id:"SDN"},{officialName:"Suriname",allNames:["sr","sarnam","sranangron","republic of suriname","republiek suriname","suriname","sur"],id:"SUR"},{officialName:"Svalbard and Jan Mayen",allNames:["sj","svalbard and jan mayen islands","svalbard and jan mayen","sjm"],id:"SJM"},{officialName:"Swaziland",allNames:["sz","weswatini","swatini","ngwane","kingdom of swaziland","umbuso waseswatini","swaziland","swz"],id:"SWZ"},{officialName:"Sweden",allNames:["se","kingdom of sweden","konungariket sverige","sweden","swe"],id:"SWE"},{officialName:"Switzerland",allNames:["ch","swiss confederation","schweiz","suisse","svizzera","svizra","switzerland","che"],id:"CHE"},{officialName:"Syria",allNames:["sy","syrian arab republic","al-jumhūrīyah al-ʻarabīyah as-sūrīyah","syria","syr"],id:"SYR"},{officialName:"Taiwan",allNames:["tw","táiwān","republic of china","中華民國","zhōnghuá mínguó","taiwan","twn","taiwan, province of china"],id:"TWN"},{officialName:"Tajikistan",allNames:["tj","toçikiston","republic of tajikistan","ҷумҳурии тоҷикистон","çumhuriyi toçikiston","tajikistan","tjk"],id:"TJK"},{officialName:"Tanzania",allNames:["tz","united republic of tanzania","jamhuri ya muungano wa tanzania","tanzania","tza","united republic of"],id:"TZA"},{officialName:"Thailand",allNames:["th","prathet","thai","kingdom of thailand","ราชอาณาจักรไทย","ratcha anachak thai","thailand","tha"],id:"THA"},{officialName:"The Bahamas",allNames:["bs","commonwealth of the bahamas","the bahamas","bhs","bahamas"],id:"BHS"},{officialName:"The Gambia",allNames:["gm","republic of the gambia","the gambia","gmb","gambia"],id:"GMB"},{officialName:"Togo",allNames:["tg","togolese","togolese republic","république togolaise","togo","tgo"],id:"TGO"},{officialName:"Tokelau",allNames:["tk","tokelau","tkl"],id:"TKL"},{officialName:"Tonga",allNames:["to","tonga","ton"],id:"TON"},{officialName:"Trinidad and Tobago",allNames:["tt","republic of trinidad and tobago","trinidad and tobago","tto"],id:"TTO"},{officialName:"Tunisia",allNames:["tn","republic of tunisia","al-jumhūriyyah at-tūnisiyyah","tunisia","tun"],id:"TUN"},{officialName:"Turkey",allNames:["tr","turkiye","republic of turkey","türkiye cumhuriyeti","turkey","tur"],id:"TUR"},{officialName:"Turkmenistan",allNames:["tm","turkmenistan","tkm"],id:"TKM"},{id:"TCA",officialName:"Turks and Caicos Islands",allNames:["tc","tca","turks and caicos islands"]},{officialName:"Tuvalu",allNames:["tv","tuvalu","tuv"],id:"TUV"},{officialName:"Uganda",allNames:["ug","republic of uganda","jamhuri ya uganda","uganda","uga"],id:"UGA"},{officialName:"Ukraine",allNames:["ua","ukrayina","ukraine","ukr"],id:"UKR"},{officialName:"United Arab Emirates",allNames:["ae","uae","united arab emirates","are"],id:"ARE"},{officialName:"United Kingdom",allNames:["gb","uk","great britain","united kingdom","gbr","britain","england"],id:"GBR"},{officialName:"United States",allNames:["us","usa","united states of america","united states","usa"],id:"USA"},{id:"UMI",officialName:"United States Minor Outlying Islands",allNames:["um","umi","united states minor outlying islands"]},{officialName:"Uruguay",allNames:["uy","oriental republic of uruguay","república oriental del uruguay","uruguay","ury"],id:"URY"},{officialName:"Uzbekistan",allNames:["uz","republic of uzbekistan","o‘zbekiston respublikasi","ўзбекистон республикаси","uzbekistan","uzb"],id:"UZB"},{officialName:"Vanuatu",allNames:["vu","republic of vanuatu","ripablik blong vanuatu","république de vanuatu","vanuatu","vut"],id:"VUT"},{id:"VAT",officialName:"Vatican",allNames:["va","vat","vatican","vatican city","vatican city state","holy see (vatican city state)","holy see [vatican city state]"]},{officialName:"Venezuela",allNames:["ve","bolivarian republic of venezuela","república bolivariana de venezuela","venezuela","ven","bolivarian republic of"],id:"VEN"},{officialName:"Vietnam",allNames:["vn","socialist republic of vietnam","cộng hòa xã hội chủ nghĩa việt nam","vietnam","vnm","viet nam"],id:"VNM"},{id:"VGB",officialName:"Virgin Islands",allNames:["vg","vgb","virgin islands","british","british virgin islands","virgin islands (british)"]},{id:"VIR",officialName:"Virgin Islands",allNames:["vi","vir","virgin islands","u.s.","us virgin islands","u.s. virgin islands","virgin islands (u.s.)"]},{officialName:"Wallis and Futuna",allNames:["wf","territory of the wallis and futuna islands","territoire des îles wallis et futuna","wallis and futuna","wlf","wallis and futuna islands"],id:"WLF"},{officialName:"Western Sahara",allNames:["eh","taneẓroft tutrimt","western sahara","esh"],id:"ESH"},{officialName:"Yemen",allNames:["ye","yemeni republic","al-jumhūriyyah al-yamaniyyah","yemen","yem"],id:"YEM"},{officialName:"Zambia",allNames:["zm","republic of zambia","zambia","zmb"],id:"ZMB"},{officialName:"Zimbabwe",allNames:["zw","republic of zimbabwe","zimbabwe","zwe"],id:"ZWE"}],vtt="#d6d9dc",ytt="#FBFAFA";function btt(e,t,r){return e.reduce((i,o)=>{const a=o.id;let s;if(r==="world"){const l=mtt.find(c=>c.id===a);l?s=t.find(c=>l.allNames.includes(c.geoName.trim().toLowerCase())):s=t.find(c=>c.geoName.trim().toLowerCase()===o.properties.name.trim().toLowerCase())}else s=t.find(l=>l.geoName.trim().toLowerCase()===o.properties.name.trim().toLowerCase());return i[a]={geoDataElement:s,style:{color:vtt,weight:1,opacity:1,fillColor:s&&s.color||ytt,fillOpacity:1},displayName:(s==null?void 0:s.geoName)||o.properties.name},i},{})}const xtt="sdkComponentInit",Cne=ce.createContext(!1),wtt=({skipNested:e=!0,children:t})=>pe(Cne.Provider,{value:e,children:t}),Ctt=(e,t)=>{const{tracking:r,app:n}=hr(),{trackEvent:i}=F3(),o=ce.useContext(Cne),a=ce.useRef(!1);ce.useEffect(()=>{if(!r||!n)return;if(!a.current&&!o){const l={packageName:r.packageName,packageVersion:"2.4.1",componentName:e,attributesUsed:Object.entries(t).filter(([,c])=>!!c).map(([c])=>c).join(", ")};i(xtt,l,!r.enabled).finally(()=>a.current=!0)}},[e,t,r,o,i,n])};var _tt="[object Boolean]";function _ne(e){return e===!0||e===!1||Jo(e)&&Al(e)==_tt}const Yz=class Yz extends ce.Component{constructor(t){super(t),this.postponedErrors=[],this.handler=t.handler,this.componentName=t.componentName}componentDidMount(){var t;this.context.isInitialized&&(this.httpClient=(t=this.context.app)==null?void 0:t.httpClient)}componentDidCatch(t){throw this.context.tracking.enabled&&(this.httpClient?this.sendErrorTracking(t):this.postponedErrors.push(t)),t}sendErrorTracking(t){try{this.handler({packageName:"sdk-ui",packageVersion:"2.4.1",component:this.componentName,error:t})}catch(r){console.log("Failed to send tracking error event: ",r)}}render(){return this.httpClient&&this.postponedErrors.length>0&&this.postponedErrors.forEach(t=>this.sendErrorTracking(t)),this.postponedErrors=[],this.props.children}};Yz.contextType=FC;let c6=Yz;const Stt=({componentName:e,config:t})=>{const{skip:r,transparent:n}=t||{};return i=>function(a){const{trackError:s}=F3();return _ne(r)&&r||yu(r)&&r(a)?pe(i,ue({},a)):(Ctt(e,a),pe(wtt,{skipNested:!n,children:pe(c6,{componentName:e,handler:s,children:pe(i,ue({},a))})}))}},u6={container:"_container_1wquj_1",card:"_card_1wquj_11",text:"_text_1wquj_19"};function Sne({color:e="#FFCB05"}){return pe("svg",{width:"53px",height:"53px",viewBox:"0 0 53 53",children:pe("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:Ve("g",{children:[pe("polygon",{points:"26.4996 -0.000100000005 -0.000400000001 26.5009 26.4996 52.9999 53.0006 26.5009",fill:e}),pe("path",{d:"M24.5,39.054 L24.5,35.054 L28.5,35.054 L28.5,39.054 L24.5,39.054 Z M28.5,31.0536 L24.5,31.0536 L23.5,13.0536 L29.5,13.0536 L28.5,31.0536 Z",fill:"#FFFFFF"})]})})})}const d6="#F2F2F2",h6=4,p6="#D5D5D5",d0=1,kne="#DADADA",f6=15,ktt={chart:{backgroundColor:"#FFFFFF",textColor:"#000000",secondaryTextColor:"#E4E4E4",animation:{init:{duration:"auto"},redraw:{duration:"auto"}}},typography:{fontFamily:'"Open Sans","Roboto","Helvetica","Arial",sans-serif',primaryTextColor:"#5B6372",secondaryTextColor:"#9EA2AB"},palette:{variantColors:["#00cee6","#9b9bd7","#6eda55","#fc7570","#fbb755","#218a8c"]},general:{backgroundColor:"#ffffff",brandColor:"#ffcb05",primaryButtonTextColor:"#3a4356",primaryButtonHoverColor:"#f2b900",popover:{cornerRadius:0,shadow:"0 -1px 5px 1px rgba(58, 67, 86, .2)",header:{backgroundColor:"#F4F4F8",textColor:"#5B6372"},footer:{backgroundColor:"#FFFFFF",textColor:"#5B6372"},content:{backgroundColor:"#FFFFFF",textColor:"#5B6372",clickableList:{item:{textColor:"#5B6372",backgroundColor:"#FFFFFF",hover:{textColor:"#000000",backgroundColor:"#F4F4F8"}}}},input:{backgroundColor:"#F4F4F8",textColor:"#5B6372",borderColor:{default:"transparent",focus:"#5B6372",hover:"transparent"},cornerRadius:4,dropdownList:{backgroundColor:"#FFFFFF",textColor:"#5B6372",borderColor:"#9EA2AB",cornerRadius:4,shadow:"0 -1px 5px 1px rgba(58, 67, 86, .2)",item:{backgroundColor:{default:"#FFFFFF",focus:"#FFFFFF",hover:"#F4F4F8"},textColor:"#5B6372"}},datepicker:{backgroundColor:"#FFFFFF",textColor:"#5B6372",cornerRadius:4,shadow:"0 -1px 5px 1px rgba(58, 67, 86, .2)",item:{backgroundColor:{default:"#FFFFFF",focus:"#FFFFFF",hover:"#F4F4F8"},textColor:{default:"#5B6372",focus:"#5B6372",hover:"#5B6372"}}}}},buttons:{cancel:{backgroundColor:{default:"#EDEEF1",focus:"#D0D3DB",hover:"#D0D3DB"},textColor:"#3A4356"}}},widget:{spaceAround:"None",cornerRadius:"None",shadow:"None",border:!1,borderColor:"#9EA2AB",header:{titleTextColor:"#5B6372",titleFontSize:f6,titleAlignment:"Left",dividerLine:!1,dividerLineColor:"#5B6372",backgroundColor:"#FFFFFF"}},dashboard:{backgroundColor:"#FFFFFF",dividerLineWidth:h6,dividerLineColor:d6,borderColor:p6,borderWidth:d0,toolbar:{primaryTextColor:"#5B6372",secondaryTextColor:"#9EA2AB",backgroundColor:"#FFFFFF"}},filter:{panel:{titleColor:"#5B6372",backgroundColor:"#F6F6F6",borderColor:kne,borderWidth:d0}},aiChat:{backgroundColor:"rgba(244, 244, 248, 1)",primaryTextColor:"rgba(38, 46, 61, 0.8)",secondaryTextColor:"rgba(38, 46, 61, 0.55)",primaryFontSize:["13px","18px"],body:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"16px",paddingBottom:"1px",gapBetweenMessages:"16px"},footer:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"12px",paddingBottom:"16px"},userMessages:{backgroundColor:"rgba(255, 255, 255, 1)"},systemMessages:{backgroundColor:"rgba(255, 255, 255, 1)"},input:{backgroundColor:"rgba(255, 255, 255, 1)",focus:{outlineColor:"rgba(38, 46, 61, 0.5)"}},header:{textColor:"rgba(38, 46, 61, 0.8)",backgroundColor:"rgba(255, 255, 255, 1)"},dropup:{backgroundColor:"rgba(255, 255, 255, 1)",boxShadow:"0px 1px 2px rgba(9, 9, 10, 0.1), 0px 2px 4px rgba(9, 9, 10, 0.1)",borderRadius:"4px",headers:{textColor:"rgba(38, 46, 61, 0.8)",hover:{backgroundColor:"rgba(244, 244, 248, 1)"}},items:{textColor:"rgba(38, 46, 61, 0.8)",hover:{backgroundColor:"rgba(244, 244, 248, 1)"}}},border:"1px solid #c6c9ce",borderRadius:"30px",suggestions:{textColor:"rgba(38, 46, 61, 1)",backgroundColor:"rgba(244, 244, 248, 1)",border:"1px solid",borderRadius:"16px",borderGradient:["rgba(75, 153, 233, 1)","rgba(102, 57, 191, 1)"],hover:{textColor:"rgba(38, 46, 61, 1)",backgroundColor:"rgba(12, 14, 18, 0.07)"},loadingGradient:["rgba(194, 196, 203, 1)","rgba(236, 236, 239, 1)"],gap:"8px"},clickableMessages:{textColor:"rgba(38, 46, 61, 1)",backgroundColor:"rgba(244, 244, 248, 1)",border:"1px solid",borderGradient:["rgba(75, 153, 233, 1)","rgba(102, 57, 191, 1)"],hover:{textColor:"rgba(38, 46, 61, 1)",backgroundColor:"rgba(12, 14, 18, 0.07)"}},dataTopics:{backgroundColor:"rgba(255, 255, 255, 1)",items:{textColor:"rgba(38, 46, 61, 1)",backgroundColor:"rgba(244, 244, 248, 1)"}},icons:{color:"rgba(38, 46, 61, 0.67)",feedbackIcons:{hoverColor:"rgba(12, 14, 18, 0.07)"}},tooltips:{backgroundColor:"rgba(255, 255, 255, 1)",textColor:"rgba(38, 46, 61, 0.8)",boxShadow:"0px 4px 12px 0px rgba(9, 9, 10, 0.20), 0px 1px 4px 0px rgba(9, 9, 10, 0.10)"}}},Mtt={chart:{backgroundColor:"#313138",textColor:"#FFFFFF",secondaryTextColor:"#C5C8CF",animation:{init:{duration:"auto"},redraw:{duration:"auto"}}},typography:{fontFamily:'"Open Sans","Roboto","Helvetica","Arial",sans-serif',primaryTextColor:"#FFFFFF",secondaryTextColor:"#C5C8CF"},palette:{variantColors:["#00cee6","#9b9bd7","#6eda55","#fc7570","#fbb755","#218a8c"]},general:{backgroundColor:"#16161C",brandColor:"#FFCB05",primaryButtonTextColor:"#3A4356",primaryButtonHoverColor:"#F2B900",popover:{cornerRadius:0,shadow:"0 -1px 5px 1px rgba(58, 67, 86, .2)",header:{backgroundColor:"#313138",textColor:"#FFFFFF"},footer:{backgroundColor:"#16161C",textColor:"#FFFFFF"},content:{backgroundColor:"#16161C",textColor:"#FFFFFF",clickableList:{item:{textColor:"#FFFFFF",backgroundColor:"#16161C",hover:{textColor:"#FFFFFF",backgroundColor:"#3C3C42"}}}},input:{cornerRadius:4,backgroundColor:"#3C3C42",textColor:"#FFFFFF",borderColor:{default:"transparent",focus:"#FFFFFF",hover:"transparent"},dropdownList:{backgroundColor:"#16161C",textColor:"#FFFFFF",borderColor:"#9EA2AB",cornerRadius:4,shadow:"0 -1px 5px 1px rgba(58, 67, 86, .2)",item:{backgroundColor:{default:"#16161C",focus:"#16161C",hover:"#3C3C42"},textColor:"#FFFFFF"}},datepicker:{backgroundColor:"#FFFFFF",textColor:"#5B6372",cornerRadius:4,shadow:"0 -1px 5px 1px rgba(58, 67, 86, .2)",item:{backgroundColor:{default:"#FFFFFF",focus:"#FFFFFF",hover:"#F4F4F8"},textColor:{default:"#5B6372",focus:"#5B6372",hover:"#5B6372"}}}}},buttons:{cancel:{backgroundColor:{default:"#EDEEF1",focus:"#D0D3DB",hover:"#D0D3DB"},textColor:"#3A4356"}}},widget:{spaceAround:"None",cornerRadius:"None",shadow:"None",border:!1,borderColor:"#C5C8CF",header:{titleTextColor:"#FFFFFF",titleAlignment:"Left",titleFontSize:f6,dividerLine:!1,dividerLineColor:"#FFFFFF",backgroundColor:"#313138"}},dashboard:{backgroundColor:"#313138",dividerLineWidth:h6,dividerLineColor:d6,borderColor:p6,borderWidth:d0,toolbar:{primaryTextColor:"#FFFFFF",secondaryTextColor:"#C5C8CF",backgroundColor:"#313138"}},filter:{panel:{titleColor:"#FFFFFF",backgroundColor:"#313138",borderColor:"#DADADA",borderWidth:d0}},aiChat:{backgroundColor:"rgba(23, 28, 38, 1)",primaryTextColor:"rgba(242, 247, 255, 0.9)",secondaryTextColor:"rgba(242, 247, 255, 0.4)",primaryFontSize:["13px","18px"],body:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"16px",paddingBottom:"1px",gapBetweenMessages:"16px"},footer:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"12px",paddingBottom:"16px"},userMessages:{backgroundColor:"rgba(31, 92, 153, 1)"},systemMessages:{backgroundColor:"rgba(46, 55, 77, 1)"},input:{backgroundColor:"rgba(242, 247, 255, 0.1)",focus:{outlineColor:"rgba(242, 247, 255, 0.5)"}},header:{backgroundColor:"#313138",textColor:"rgba(242, 247, 255, 0.9)"},dropup:{backgroundColor:"rgba(38, 46, 64, 1)",boxShadow:"0px 1px 4px 0px #020203, 0px 2px 12px 2px rgba(2, 2, 3, 0.25)",borderRadius:"8px",headers:{textColor:"rgba(242, 247, 255, 0.6)",hover:{backgroundColor:"rgba(242, 247, 255, 0.1)"}},items:{textColor:"rgba(242, 247, 255, 0.9)",hover:{backgroundColor:"rgba(242, 247, 255, 0.1)"}}},border:!1,borderRadius:"30px",suggestions:{textColor:"rgba(88, 192, 244, 1)",backgroundColor:"rgba(23, 28, 38, 1)",border:"1px solid",borderRadius:"16px",borderGradient:["rgba(75, 153, 233, 1)","rgba(102, 57, 191, 1)"],hover:{textColor:"rgba(88, 192, 244, 1)",backgroundColor:"rgba(242, 247, 255, 0.1)"},loadingGradient:["rgba(242, 247, 255, 0.1)","rgba(242, 247, 255, 0.3)"],gap:"8px"},clickableMessages:{textColor:"rgba(88, 192, 244, 1)",backgroundColor:"rgba(23, 28, 38, 1)",border:"1px solid",borderGradient:["rgba(75, 153, 233, 1)","rgba(102, 57, 191, 1)"],hover:{textColor:"rgba(88, 192, 244, 1)",backgroundColor:"rgba(242, 247, 255, 0.1)"}},dataTopics:{backgroundColor:"rgba(23, 28, 38, 1)",items:{textColor:"rgba(242, 247, 255, 0.9)",backgroundColor:"rgba(46, 55, 77, 1)"}},icons:{color:"rgba(242, 247, 255, 0.5)",feedbackIcons:{hoverColor:"rgba(242, 247, 255, 0.1)"}},tooltips:{textColor:"rgba(242, 247, 255, 0.9)",backgroundColor:"rgba(46, 55, 77, 1)",boxShadow:"0px 1px 8px 0px #020203, 0px 4px 24px 4px rgba(2, 2, 3, 0.25)"}}},Z1=(e=!1)=>ki(e?Mtt:ktt),g6=ce.createContext({themeSettings:Z1()}),pt=()=>ce.useContext(g6),Mne=({error:e=new ft("errors.componentRenderError")})=>{var u,g,f,p,x,S;const{themeSettings:t}=pt(),{app:r}=hr(),{t:n}=At(),[i,o]=ce.useState(!1),a=()=>{o(!0)},s=()=>{o(!1)},l=pe("div",{className:"csdk-flex csdk-justify-center csdk-mb-[10px]",children:pe(Sne,{color:(u=t==null?void 0:t.general)==null?void 0:u.brandColor})}),c=e instanceof Xv?n(e.key,ue({},e.interpolationOptions)):n(e instanceof Error?e.message:e),d=n("errorBoxText",{errorMessage:c,interpolation:{escapeValue:!1}}),h=(f=(g=r==null?void 0:r.settings)==null?void 0:g.errorBoundaryConfig)==null?void 0:f.alwaysShowErrorText;return pe("div",{onMouseEnter:h?void 0:a,onMouseLeave:h?void 0:s,className:u6.container,"aria-label":"error-box",children:Ve("div",{className:u6.card,style:{backgroundColor:((p=t==null?void 0:t.general)==null?void 0:p.backgroundColor)||"rgba(255,255,255,0.5)"},children:[l,(h||i)&&pe("div",{className:u6.text,style:{color:((x=t==null?void 0:t.typography)==null?void 0:x.primaryTextColor)||no,fontFamily:((S=t==null?void 0:t.typography)==null?void 0:S.fontFamily)||"inherit"},children:d})]})})};let qM=class extends ce.Component{constructor(t){super(t),this.showErrorBox=!0,this.onError=t.onError,this.isContainerComponent=t.isContainerComponent||!1,this.state={error:null,customErrorUI:null}}static getDerivedStateFromError(t){return{error:t,customErrorUI:null}}componentDidCatch(t){const r=t instanceof Error?t:new Error(t);if(this.onError){const n=this.onError(r);if(n!==void 0&&ce.isValidElement(n)){this.setState({error:t,customErrorUI:n});return}}this.setState({error:t})}componentDidUpdate(t,r){if(r.error!==null&&Ttt(t.resetKeys,this.props.resetKeys)&&this.setState({error:null,customErrorUI:null}),this.props.error&&!t.error&&!r.error&&!this.state.error&&this.onError){const n=this.props.error instanceof Error?this.props.error:new Error(String(this.props.error)),i=this.onError(n);i!==void 0&&ce.isValidElement(i)&&this.setState({customErrorUI:i})}}render(){const{error:t,customErrorUI:r}=this.state,{shouldRenderChildrenWithProvidedError:n,showErrorBox:i,error:o,children:a}=this.props,s=t||o;return!s||o&&!t&&n?a:i?r||pe(Mne,{error:s}):null}};function Ttt(e=[],t=[]){return e.length!==t.length||e.some((r,n)=>!Fo(r,t[n]))}const m6=({componentName:e})=>t=>function(n){const i=hr(),o=a=>{var s,l;return(l=(s=i.errorBoundary).onError)==null?void 0:l.call(s,a,{componentName:e,componentProps:n})};return pe(qM,{resetKeys:Object.values(n),showErrorBox:i.errorBoundary.showErrorBox,onError:o,isContainerComponent:!!(n!=null&&n.children),children:pe(t,ue({},n))})};function Tne(){var e,t;return(t=(e=document.head.querySelector('meta[property="csp-nonce"]'))==null?void 0:e.getAttribute("content"))!=null?t:void 0}const Att=()=>{const e=Tne();return e?bC({key:"css",nonce:e}):null},v6=({children:e})=>{const t=ce.useMemo(()=>Att(),[]);return t?pe(x3,{value:t,children:e}):pe(Kt,{children:e})},Ane=Tne(),ZM=({color:e})=>{const t={backgroundColor:e||"#333333",float:"left",width:"10px",height:"10px",marginRight:"7px",WebkitAnimation:"loading-dots-animation 1.8s infinite ease-in-out",animation:"loading-dots-animation 1.8s infinite ease-in-out",borderRadius:"50%",opacity:.75},r=xe(ue({},t),{WebkitAnimationDelay:"-0.32s",animationDelay:"-0.32s"}),n=xe(ue({},t),{WebkitAnimationDelay:"-0.16s",animationDelay:"-0.16s"}),i=xe(ue({},t),{marginRight:"unset"}),o={"0%, 80%, 100%":{WebkitTransform:"scale(0) rotate(0deg)",transform:"scale(0) rotate(0deg)"},"40%":{WebkitTransform:"scale(1) rotate(0.02deg)",transform:"scale(1) rotate(0.02deg)"}};return Ve("div",{children:[pe("style",xe(ue({},Ane&&{nonce:Ane}),{children:`
|
|
1165
1165
|
@keyframes loading-dots-animation {
|
|
1166
1166
|
${Object.entries(o).map(([a,s])=>`${a} { ${Object.entries(s).map(([l,c])=>`${l}: ${c};`).join("")} }`).join("")}
|
|
1167
1167
|
}
|
|
@@ -1546,7 +1546,7 @@ https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStat
|
|
|
1546
1546
|
`),CVt=({anchorEl:e,isOpen:t,onClose:r,dataSources:n,initialDataSource:i,onFilterCreated:o,disabledAttributes:a})=>{const{t:s}=At(),l=ce.useCallback(d=>{const h=SVt(d);o(h)},[o]),{themeSettings:c}=pt();return pe(sf,{position:{anchorEl:e,anchorOrigin:{vertical:"top",horizontal:"left"},contentOrigin:{vertical:"top",horizontal:"right"}},open:t,onClose:r,children:Ve(wVt,{theme:c,"data-testid":"add-filter-popover",children:[pe(uVt,{title:s("dataBrowser.addFilter"),flowPath:[{title:s("dataBrowser.selectField"),isCurrentStep:!0},{title:s("dataBrowser.configureFilter"),isCurrentStep:!1}],onClose:r}),n.length>0?pe(aVt,{dataSources:n,initialDataSource:i,onAttributeClick:l,disabledAttributes:a}):pe(kVt,{})]})})};function _Vt(e){return e.type===It.DateDimension}const SVt=e=>{const t=_Vt(e)?e.Years:e;return Hi(t,[])},kVt=()=>{throw new ft("errors.addFilterPopover.noDataSources")},CP=xnt({createStyledComponent:zt("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>an({props:e,name:"MuiStack"})}),Pme="#3a4356",Fw=e=>{const{themeSettings:t}=pt(),r=t.general.buttons,c=e,{children:n,type:i="primary",disabled:o,onClick:a,title:s}=c,l=ut(c,["children","type","disabled","onClick","title"]);return pe(Of,xe(ue({variant:"contained",sx:{backgroundColor:i==="primary"?t.general.brandColor:ti(r.cancel.backgroundColor,kn.DEFAULT),color:i==="primary"?Pme:r.cancel.textColor,width:"74px",height:"28px",lineHeight:"18px",borderRadius:"4px",fontWeight:400,fontSize:"13px",textTransform:"none",boxShadow:"none","&:hover":{backgroundColor:i==="primary"?Vi(t.general.brandColor,.1):ti(r.cancel.backgroundColor,kn.HOVER),boxShadow:"none"},"&:focus":{backgroundColor:i==="primary"?Vi(t.general.brandColor,.1):ti(r.cancel.backgroundColor,kn.FOCUS)},"&[disabled]":{backgroundColor:i==="primary"?t.general.brandColor:ti(r.cancel.backgroundColor,kn.DEFAULT),color:i==="primary"?Pme:r.cancel.textColor,opacity:.4}},onClick:a,disabled:o,title:s},l),{children:n}))},MVt=tf(ke.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"RadioButtonUnchecked"),TVt=tf(ke.jsx("path",{d:"M8.465 8.465C9.37 7.56 10.62 7 12 7C14.76 7 17 9.24 17 12C17 13.38 16.44 14.63 15.535 15.535C14.63 16.44 13.38 17 12 17C9.24 17 7 14.76 7 12C7 10.62 7.56 9.37 8.465 8.465Z"}),"RadioButtonChecked"),AVt=zt("span",{shouldForwardProp:yh})({position:"relative",display:"flex"}),EVt=zt(MVt)({transform:"scale(1)"}),PVt=zt(TVt)(dn(({theme:e})=>({left:0,position:"absolute",transform:"scale(0)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeIn,duration:e.transitions.duration.shortest}),variants:[{props:{checked:!0},style:{transform:"scale(1)",transition:e.transitions.create("transform",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.shortest})}}]})));function Dme(e){const{checked:t=!1,classes:r={},fontSize:n}=e,i=xe(ue({},e),{checked:t});return ke.jsxs(AVt,{className:r.root,ownerState:i,children:[ke.jsx(EVt,{fontSize:n,className:r.background,ownerState:i}),ke.jsx(PVt,{fontSize:n,className:r.dot,ownerState:i})]})}const DVt=Ce.createContext(void 0);function LVt(){return Ce.useContext(DVt)}function OVt(e){return Zr("MuiRadio",e)}const Lme=Xr("MuiRadio",["root","checked","disabled","colorPrimary","colorSecondary","sizeSmall"]),IVt=e=>{const{classes:t,color:r,size:n}=e,i={root:["root",`color${qt(r)}`,n!=="medium"&&`size${qt(n)}`]};return ue(ue({},t),on(i,OVt,t))},NVt=zt(vfe,{shouldForwardProp:e=>yh(e)||e==="classes",name:"MuiRadio",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.size!=="medium"&&t[`size${qt(r.size)}`],t[`color${qt(r.color)}`]]}})(dn(({theme:e})=>({color:(e.vars||e).palette.text.secondary,[`&.${Lme.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{color:"default",disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:Kr(e.palette.action.active,e.palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Hc()).map(([t])=>({props:{color:t,disabled:!1,disableRipple:!1},style:{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette[t].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Kr(e.palette[t].main,e.palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Hc()).map(([t])=>({props:{color:t,disabled:!1},style:{[`&.${Lme.checked}`]:{color:(e.vars||e).palette[t].main}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]})));function RVt(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}const FVt=ke.jsx(Dme,{checked:!0}),jVt=ke.jsx(Dme,{}),BVt=Ce.forwardRef(function(t,r){var k,F,V;const n=an({props:t,name:"MuiRadio"}),D=n,{checked:i,checkedIcon:o=FVt,color:a="primary",icon:s=jVt,name:l,onChange:c,size:d="medium",className:h,disabled:u,disableRipple:g=!1,slots:f={},slotProps:p={},inputProps:x}=D,S=ut(D,["checked","checkedIcon","color","icon","name","onChange","size","className","disabled","disableRipple","slots","slotProps","inputProps"]),j=mfe();let U=u;j&&typeof U=="undefined"&&(U=j.disabled),U!=null||(U=!1);const B=xe(ue({},n),{disabled:U,disableRipple:g,color:a,size:d}),R=IVt(B),E=LVt();let N=i;const M=A6(c,E&&E.onChange);let $=l;E&&(typeof N=="undefined"&&(N=RVt(E.value,n.value)),typeof $=="undefined"&&($=E.name));const T=(k=p.input)!=null?k:x,[C,y]=Qr("root",{ref:r,elementType:NVt,className:jt(R.root,h),shouldForwardComponentProp:!0,externalForwardedProps:ue({slots:f,slotProps:p},S),getSlotProps:q=>xe(ue({},q),{onChange:(z,...P)=>{var W;(W=q.onChange)==null||W.call(q,z,...P),M(z,...P)}}),ownerState:B,additionalProps:{type:"radio",icon:Ce.cloneElement(s,{fontSize:(F=s.props.fontSize)!=null?F:d}),checkedIcon:Ce.cloneElement(o,{fontSize:(V=o.props.fontSize)!=null?V:d}),disabled:U,name:$,checked:N,slots:f,slotProps:{input:typeof T=="function"?T(B):T}}});return ke.jsx(C,xe(ue({},y),{classes:R}))}),zVt=e=>{const{checked:t,value:r,disabled:n,onChange:i}=e;return pe(BVt,{sx:{width:"28px",height:"28px",padding:"8px",marginRight:"4px",boxSizing:"border-box",color:"inherit","&.Mui-checked":{color:"inherit"},"& .MuiSvgIcon-root":{fontSize:16},"&:hover":{backgroundColor:"rgba(91, 99, 114, .1)"},"&.Mui-disabled":{color:"inherit",opacity:.5}},size:"small",checked:t,onChange:(o,a)=>i==null?void 0:i(a),value:r,inputProps:ue({},e["aria-label"]&&{"aria-label":e["aria-label"]}),disabled:n})},$Vt=Ye("div",{target:"e1hqpqsa0",label:"Section"})("display:flex;flex-direction:row;align-items:center;margin-bottom:24px;"),du=o=>{var a=o,{selected:e,children:t,onSelect:r,disabled:n}=a,i=ut(a,["selected","children","onSelect","disabled"]);const s=()=>{r(!0)};return Ve($Vt,xe(ue({},i),{children:[pe(zVt,{disabled:n,checked:e,onChange:r,"aria-label":"Select button"}),pe(Kt,{children:typeof t=="function"?t(s):t})]}))},lz=({filter:e,selected:t,onChange:r})=>{const{t:n}=At(),i=ce.useCallback(()=>{const o=Hi(e.attribute,[],e==null?void 0:e.config);r(o)},[r,e]);return pe(du,{selected:t,onSelect:i,"aria-label":"Include all section",children:o=>pe("span",{style:{cursor:"pointer"},onClick:o,children:n("filterEditor.labels.includeAll")})})},WVt=Ye("span",{target:"e15m0m750",label:"InputContainer"})("display:inline-flex;position:relative;"),HVt=Ye("span",{target:"e15m0m751",label:"InputErrorLabel"})("position:absolute;bottom:-19px;left:0;color:",Zte,";font-size:11px;white-space:nowrap;"),UVt=Ye("input",{target:"e15m0m752",label:"BaseInput"})("box-sizing:border-box;border-radius:4px;outline:none;background:",({theme:e})=>e.general.popover.input.backgroundColor,";color:",({theme:e})=>e.general.popover.input.textColor,`;line-height:28px;height:28px;border:none;text-indent:8px;font-family:inherit;padding-right:8px;border:1px solid
|
|
1547
1547
|
`,({theme:e})=>ti(e.general.popover.input.borderColor,kn.DEFAULT),`;&:hover{border:1px solid
|
|
1548
1548
|
`,({theme:e})=>ti(e.general.popover.input.borderColor,kn.HOVER),`;}&:focus{border:1px solid
|
|
1549
|
-
`,({theme:e})=>ti(e.general.popover.input.borderColor,kn.FOCUS),";}&::placeholder{color:inherit;opacity:0.5;}");function Qf(e){const{themeSettings:t}=pt(),s=e,{error:r,wrapperStyle:n,inputRef:i}=s,o=ut(s,["error","wrapperStyle","inputRef"]),a=ce.useRef(null);return ce.useEffect(()=>{a.current&&(i==null||i(a.current))},[i]),Ve(WVt,{style:n,children:[pe(UVt,xe(ue({theme:t,ref:a},o),{style:ue(ue(ue({},o.style),r&&{borderColor:Zte}),o.type==="number"&&{paddingRight:"0"})})),r&&pe(HVt,{children:r})]})}const GVt=e=>{var d;const c=e,{placeholder:t,onChange:r,value:n,inputRef:i,inputStyle:o,style:a,className:s}=c,l=ut(c,["placeholder","onChange","value","inputRef","inputStyle","style","className"]);return Ve("div",{className:s,style:a,children:[pe("span",{style:{position:"absolute",top:"3px",left:"6px",zIndex:2},children:pe(gfe,{"aria-label":"search-icon",color:(d=a==null?void 0:a.color)!=null?d:"#5B6372",opacity:"40%"})}),pe(Qf,ue({inputRef:i,placeholder:t,onChange:r,value:n,wrapperStyle:{width:"100%"},style:ue({paddingLeft:"28px",paddingRight:"16px",width:"100%"},o)},l))]})},_P=Ye("div",{target:"e1f8s22f0",label:"SelectField"})("width:100%;box-sizing:border-box;display:inline-flex;flex-direction:row;align-items:center;cursor:pointer;background:",({theme:e})=>e.general.popover.input.backgroundColor,";color:",({theme:e})=>e.general.popover.input.textColor,";height:28px;border-radius:4px;padding-left:12px;border:1px solid ",({focus:e})=>e?no:"transparent",";border-radius:",({theme:e})=>e.general.popover.input.cornerRadius,";"),Ome=Ye("div",{target:"e1f8s22f1",label:"SelectItemContainer"})("box-sizing:border-box;display:flex;flex-direction:row;align-items:center;cursor:pointer;height:28px;padding-left:14px;padding-right:14px;color:",({theme:e})=>ti(e.general.popover.input.dropdownList.item.textColor,kn.DEFAULT),";transition:color 0.2s ease;background-color:",({theme:e})=>ti(e.general.popover.input.dropdownList.item.backgroundColor,kn.DEFAULT),";&:hover{background-color:",({theme:e})=>ti(e.general.popover.input.dropdownList.item.backgroundColor,kn.HOVER),";}"),jw=Ye("span",{target:"e1f8s22f2",label:"SelectLabel"})("display:inline-block;flex-grow:1;font-size:13px;font-family:inherit;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:",({theme:e})=>e.general.popover.input.textColor,";"),Ime=Ye(jw,{target:"e1f8s22f3",label:"DropdownSelectLabel"})("color:",({theme:e})=>e.general.popover.input.dropdownList.textColor,";"),Nme=Ye("span",{target:"e1f8s22f4",label:"SelectIconContainer"})("margin-right:10px;margin-left:-4px;display:inline-flex;");function Rme(e){const{value:t,displayValue:r,icon:n,selected:i,onSelect:o,style:a}=e,{themeSettings:s}=pt();return Ve(Ome,{theme:s,style:{paddingRight:"6px"},onClick:()=>o==null?void 0:o(t),children:[n&&pe(Nme,{children:n}),pe(Ime,{theme:s,style:{paddingRight:i?0:"24px"},children:r!=null?r:`${t}`}),i&&pe(Ozt,{"aria-label":"check-icon",color:(a==null?void 0:a.color)||no})]})}const SP=({children:e,open:t,anchorEl:r,style:n,preventClickPropagation:i=!1})=>pe(yf,{anchorEl:r,open:t,style:n,slotProps:{root:{style:{zIndex:1301,display:"flex",boxShadow:"-1px -1px 10px rgba(0, 0, 0, 0.2)",borderRadius:4,overflow:"hidden"}}},children:pe("div",{onClick:a=>{i&&a.stopPropagation()},children:e})}),VVt=Ye("div",{target:"eze2kei0",label:"SelectContainer"})("box-sizing:border-box;display:inline-flex;"),YVt=Ye("div",{target:"eze2kei1",label:"Content"})("background:",({theme:e})=>e.general.popover.input.dropdownList.backgroundColor,";");function gd(e){var f,p,x,S;const g=e,{value:t,items:r,style:n,className:i,onChange:o}=g,a=ut(g,["value","items","style","className","onChange"]),{themeSettings:s}=pt(),[l,c]=ce.useState(!1),d=ce.useRef(null),h=r.find(j=>j.value===t),u=ce.useCallback(j=>{j!==t&&(o==null||o(j)),c(!1)},[t,o]);return pe(xw,{onClickAway:()=>c(!1),children:Ve(VVt,{className:i,style:n,children:[Ve(_P,xe(ue({theme:s,ref:d,focus:l,onClick:()=>c(j=>!j)},a),{children:[(h==null?void 0:h.icon)&&pe(Nme,{children:h==null?void 0:h.icon}),pe(jw,{theme:s,"aria-label":"Value",children:pe(Kt,{children:(f=h==null?void 0:h.displayValue)!=null?f:h==null?void 0:h.value})}),pe(ME,{"aria-label":"Select icon",fill:s.general.popover.input.textColor||no,style:{minWidth:"24px",transform:`rotate(${l?180:0}deg)`}})]})),pe(SP,{open:l,anchorEl:d.current,preventClickPropagation:!0,children:pe(YVt,{theme:s,style:{minWidth:(p=d.current)==null?void 0:p.clientWidth,maxWidth:((x=d.current)==null?void 0:x.clientWidth)&&((S=d.current)==null?void 0:S.clientWidth)*2},"aria-label":"Single-select content",children:r.map((j,U)=>pe(Rme,xe(ue({},j),{selected:j.value===t,onSelect:u}),U))})})]})})}const qVt=3;function Fme(e,t){if(t.length!==0)return t.length>qVt?`${t.length} selected`:e.filter(r=>t.includes(r.value)).map(({value:r,displayValue:n})=>n!=null?n:r).join(", ")}function ZVt(e){const{themeSettings:t}=pt(),{value:r,displayValue:n,selected:i,onSelect:o}=e;return Ve(Ome,{theme:t,style:{height:"36px",paddingLeft:"8px"},onClick:()=>o==null?void 0:o(r),children:[pe(kE,{checked:i,readOnly:!0,style:{width:"13px",height:"13px",marginRight:"12px"},labelProps:{onClick:a=>a.preventDefault()}}),pe(Ime,{theme:t,children:n!=null?n:`${r}`})]})}var XVt="Expected a function";function KVt(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(XVt);return po(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),uw(e,t,{leading:n,maxWait:t,trailing:i})}const QVt=300,JVt=Ye("div",{target:"epdneiy0",label:"Wrapper"})("max-height:100%;overflow:auto;"),jme=e=>{const{onScroll:t,style:r,children:n}=e,i=ce.useRef(null),o=ce.useRef(0),a=ce.useMemo(()=>t?KVt(t,QVt):void 0,[t]),s=ce.useCallback(l=>{const c=l.target,d=c.scrollTop/(c.scrollHeight-c.clientHeight),h=c.scrollTop>o.current?"down":"up";o.current=c.scrollTop,a==null||a({top:d,direction:h})},[a]);return ce.useEffect(()=>{const l=i.current;return l==null||l.addEventListener("scroll",s),()=>{l==null||l.removeEventListener("scroll",s)}},[s]),pe(JVt,{ref:i,style:r,children:n})},eYt=Ye("div",{target:"e5q6nvf0",label:"Container"})("display:flex;justify-content:center;padding:10px 0;"),Bme=()=>pe(eYt,{children:pe(ZM,{color:"grey"})}),tYt=Ye("div",{target:"e1wwpiq10",label:"Content"})("max-height:294px;color:",({theme:e})=>e.general.popover.input.dropdownList.textColor,";background-color:",({theme:e})=>e.general.popover.input.dropdownList.backgroundColor,";border-radius:",({theme:e})=>e.general.popover.input.dropdownList.cornerRadius,";box-shadow:",({theme:e})=>e.general.popover.input.dropdownList.shadow,";"),zme=Ye(GVt,{target:"e1wwpiq11",label:"StyledSearchInput"})("position:absolute;left:0;top:0;width:100%;color:",({theme:e})=>e.general.popover.input.textColor,";background-color:",({theme:e})=>e.general.popover.input.backgroundColor,";border-radius:",({theme:e})=>e.general.popover.input.cornerRadius,";svg path{fill:",({theme:e})=>e.general.popover.input.textColor,";}");function cz(e){var j,U,B;const{value:t,items:r,placeholder:n,onChange:i,onListScroll:o,showListLoader:a,showSearch:s=!0,onSearchUpdate:l,width:c}=e,{t:d}=At(),{themeSettings:h}=pt(),[u,g]=ce.useState(!1),f=ce.useRef(null),p=ce.useCallback(R=>{i==null||i(R)},[i]),x=ce.useCallback(()=>{g(!1),l==null||l("")},[l]),S=ce.useCallback(()=>{u?x():g(!0)},[u,x]);return pe(xw,{onClickAway:x,children:Ve("div",{style:{width:c},children:[Ve("div",{style:{position:"relative"},children:[Ve(_P,{ref:f,focus:u,onClick:S,theme:h,"aria-label":"Searchable single-select",children:[pe(jw,{theme:h,style:{opacity:t?"100%":"50%"},"aria-label":"Value",children:`${Fme(r,[t])||n}`}),pe(ME,{"aria-label":"select-icon",fill:h.general.popover.input.textColor||no,style:{minWidth:"24px",transform:`rotate(${u?180:0}deg)`}})]}),s&&u&&pe(zme,{inputRef:R=>R==null?void 0:R.focus(),theme:h,placeholder:d("filterEditor.placeholders.enterValue"),onChange:R=>{l==null||l(R.target.value)},"aria-label":"Value input"})]}),pe(SP,{open:u,anchorEl:f.current,preventClickPropagation:!0,children:pe(jme,{onScroll:o,children:Ve(tYt,{theme:h,style:{minWidth:(j=f.current)==null?void 0:j.clientWidth,maxWidth:((U=f.current)==null?void 0:U.clientWidth)&&((B=f.current)==null?void 0:B.clientWidth)*2},"aria-label":"Searchable single-select content",children:[r.map((R,E)=>pe(Rme,xe(ue({},R),{selected:t===R.value,onSelect:p}),E)),a&&pe(Bme,{})]})})})]})})}const rYt=Ye("div",{target:"e16s4p3r0",label:"Content"})("max-height:320px;color:",({theme:e})=>e.general.popover.input.dropdownList.textColor,";background-color:",({theme:e})=>e.general.popover.input.dropdownList.backgroundColor,";border-radius:",({theme:e})=>e.general.popover.input.dropdownList.cornerRadius,";box-shadow:",({theme:e})=>e.general.popover.input.dropdownList.shadow,";"),nYt=Ye("div",{target:"e16s4p3r1",label:"ContentToolbar"})("display:flex;flex-direction:row;justify-content:end;align-items:center;border-bottom:1px solid #e7e8ea;margin:0 10px 0 10px;height:32px;"),$me=Ye("button",{target:"e16s4p3r2",label:"ContentToolbarButton"})("font-family:'Open Sans',sans-serif;border:none;background:none;color:#1eaff3;padding:0;font-size:11px;&:disabled{opacity:0.4;}"),iYt=Ye("div",{target:"e16s4p3r3",label:"ContentList"})();function uz(e){var B,R,E,N;const{items:t,placeholder:r,onChange:n,onListScroll:i,showListLoader:o=!1,showSearch:a=!0,onSearchUpdate:s,width:l}=e,{t:c}=At(),{themeSettings:d}=pt(),[h,u]=ce.useState(!1),g=ce.useRef(null),f=ce.useMemo(()=>e.values||[],[e.values]),p=ce.useCallback(M=>{f.includes(M)?n==null||n(f.filter(T=>T!==M)):n==null||n([...f,M])},[f,n]),x=ce.useCallback(()=>{n==null||n(t.map(({value:M})=>M))},[t,n]),S=ce.useCallback(()=>{n==null||n([])},[n]),j=ce.useCallback(()=>{u(!1),s==null||s("")},[s]),U=ce.useCallback(()=>{h?j():u(!0)},[h,j]);return pe(xw,{onClickAway:j,children:Ve("div",{style:{width:l},children:[Ve("div",{style:{position:"relative"},children:[Ve(_P,{ref:g,focus:h,onClick:U,theme:d,"aria-label":"Searchable multi-select",children:[pe(jw,{theme:d,style:{opacity:f.length?"100%":"50%"},"aria-label":"Value",children:(B=Fme(t,f))!=null?B:r}),pe(ME,{fill:d.general.popover.input.textColor||no,"aria-label":"Open icon",style:{minWidth:"24px",transform:`rotate(${h?180:0}deg)`}})]}),a&&h&&pe(zme,{inputRef:M=>M==null?void 0:M.focus(),theme:d,placeholder:c("filterEditor.placeholders.enterValue"),onChange:M=>{s==null||s(M.target.value)},"aria-label":"Value input"})]}),pe(SP,{open:h,anchorEl:g.current,style:{maxHeight:300},preventClickPropagation:!0,children:pe(jme,{onScroll:i,children:Ve(rYt,{theme:d,style:{minWidth:(R=g.current)==null?void 0:R.clientWidth,maxWidth:((E=g.current)==null?void 0:E.clientWidth)&&((N=g.current)==null?void 0:N.clientWidth)*2},"aria-label":"Searchable multi-select content",children:[Ve(nYt,{children:[pe($me,{style:{marginRight:"8px"},disabled:t.length===f.length,onClick:x,children:c("filterEditor.buttons.selectAll")}),pe($me,{disabled:!f.length,onClick:S,children:c("filterEditor.buttons.clearAll")})]}),Ve(iYt,{"aria-label":"List",children:[t.map((M,$)=>pe(ZVt,xe(ue({},M),{selected:!!(f!=null&&f.includes(M.value)),onSelect:p}),$)),o&&pe(Bme,{})]})]})})})]})})}const Wme=ce.createContext({defaultDataSource:null,parentFilters:[],membersOnlyMode:!1}),md=()=>ce.useContext(Wme),oYt=({value:e,children:t})=>{const[r,n]=ce.useState(e.defaultDataSource),i=ce.useMemo(()=>{var a;return(a=e.parentFilters)!=null?a:[]},[e.parentFilters]),o=ce.useMemo(()=>{var a;return(a=e.membersOnlyMode)!=null?a:[]},[e.membersOnlyMode]);return ce.useEffect(()=>{r!==e.defaultDataSource&&n(e.defaultDataSource)},[r,e.defaultDataSource]),pe(Wme.Provider,{value:{defaultDataSource:r,parentFilters:i,membersOnlyMode:o},children:t})},Hme=50,aYt=300,sYt=.75,dz=({attribute:e,multiSelect:t=!0,onChange:r,selectedMembers:n,showSearch:i=!0,width:o="100%"})=>{const{t:a}=At(),{defaultDataSource:s,parentFilters:l}=md(),[c,d]=ce.useState(""),h=ce.useMemo(()=>uw(d,aYt),[d]),[u,g]=ce.useState(n),{data:f,isLoading:p,loadMore:x}=Tfe(ue({parentFilters:ce.useMemo(()=>[...l,OD(e,c)],[e,c,l]),filter:ce.useMemo(()=>Hi(e,[]),[e]),count:Hme},s&&{defaultDataSource:s})),S=ce.useMemo(()=>{const B=(f==null?void 0:f.allMembers.map(R=>({value:R.key})))||[];return[...u.map(R=>({value:R})).filter(R=>R.value.toLowerCase().includes(c.toLowerCase())),...B.filter(R=>!u.includes(R.value))]},[u,f,c]),j=ce.useCallback(({top:B,direction:R})=>{!p&&B>sYt&&R==="down"&&x(Hme)},[x,p]),U=ce.useRef(e);return ce.useEffect(()=>{U.current!==e&&(U.current=e,g(n))},[e,n]),t?pe(uz,{width:o,values:n,placeholder:a("filterEditor.placeholders.selectFromList"),items:S,onChange:r,onListScroll:j,showListLoader:p,showSearch:i,onSearchUpdate:h}):pe(cz,{width:o,value:n[0],placeholder:a("filterEditor.placeholders.selectFromList"),items:S,onChange:B=>r([B]),onListScroll:j,showListLoader:p,showSearch:i,onSearchUpdate:h})};function lYt(e){return uu[e]}function hz(e,t,r){var n;return t.length||(n=r==null?void 0:r.deactivatedMembers)!=null&&n.length?Hi(e,t,xe(ue({},r),{excludeMembers:!0})):null}function kP(e,t){var r;return go(e)&&((r=e==null?void 0:e.config)!=null&&r.deactivatedMembers)?t.filter(n=>{var i;return!((i=e.config)!=null&&i.deactivatedMembers.includes(n))}):t}function Bw(e){return go(e)?[...e.members,...e.config.deactivatedMembers]:[]}function zw(e,t){var r,n,i;return go(e)&&((r=e==null?void 0:e.config)!=null&&r.deactivatedMembers)?xe(ue({},e.config),{deactivatedMembers:(i=(n=e.config)==null?void 0:n.deactivatedMembers)==null?void 0:i.filter(o=>t.includes(o))}):e.config}const cYt={[Ze.Years]:"attribute.datetimeName.years",[Ze.Quarters]:"attribute.datetimeName.quarters",[Ze.Months]:"attribute.datetimeName.months",[Ze.Weeks]:"attribute.datetimeName.weeks",[Ze.Days]:"attribute.datetimeName.days",[Ze.AggHours]:"attribute.datetimeName.hours",[Ze.AggMinutesRoundTo15]:"attribute.datetimeName.minutes"};function uYt(e,t,r){return r?e(cYt[r],{columnName:t}):t}function Yh(e){return!wy(e)&&!AD(e)}function pz(e){return go(e)&&!e.members.length&&!e.config.deactivatedMembers.length}function Jf(e){return go(e)&&!e.config.excludeMembers}function eg(e){return go(e)&&e.config.excludeMembers}function MP(e){return eg(e)||PD(e)||ED(e)||DD(e)||wy(e)}function TP(e){return ED(e)&&e.operatorA===Tn.From&&e.operatorB===Tn.To}function Ume(e){return m_(e)&&!!e.anchor}function Gme(e){return m_(e)&&!e.anchor}function qh(e,t,r){const n=uYt(r,x_(e),t);return new Gr(n,e.expression,t,Gr.getDefaultFormatForGranularity(t),void 0,void 0,e.dataSource)}function Vme(e){const t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${n}T00:00:00`}function dYt(e,t,r){var n;return t.length||(n=r==null?void 0:r.deactivatedMembers)!=null&&n.length?Hi(e,t,xe(ue({},r),{excludeMembers:!1})):null}const Yme=e=>{const{filter:t,selected:r,multiSelectEnabled:n,onChange:i}=e,[o,a]=ce.useState(Jf(t)?Bw(t):[]),s=hl(n),l=typeof s!="undefined"&&s!==n,c=ce.useCallback(({selectedMembers:u,multiSelectEnabled:g})=>{const f=zw(t,u),p=kP(t,u),x=dYt(t.attribute,p,xe(ue({},f),{enableMultiSelection:g}));i(x)},[t,i]);ce.useEffect(()=>{if(l&&r){let u=o;n||(o.length>1&&(u=[o.sort()[0]]),a(u)),c({selectedMembers:u,multiSelectEnabled:n})}},[l,n,o,r,c]);const d=ce.useCallback(()=>{c({selectedMembers:o,multiSelectEnabled:n})},[o,n,c]),h=ce.useCallback(u=>{const g=Array.isArray(u)?u:[u];a(g),c({selectedMembers:g,multiSelectEnabled:n})},[n,c]);return pe(du,{selected:r,onSelect:d,"aria-label":"Members section",children:()=>pe(dz,{width:320,attribute:t.attribute,multiSelect:n,selectedMembers:o,onChange:h})})},jr={EXCLUDE:"exclude",CONTAINS:Er.CONTAINS,NOT_CONTAIN:Er.NOT_CONTAIN,STARTS_WITH:Er.STARTS_WITH,NOT_STARTS_WITH:Er.NOT_STARTS_WITH,ENDS_WITH:Er.ENDS_WITH,NOT_ENDS_WITH:Er.NOT_ENDS_WITH,EQUALS:Er.EQUALS_TEXT,NOT_EQUALS:Er.NOT_EQUALS_TEXT,IS_EMPTY:"isEmpty",IS_NOT_EMPTY:"isNotEmpty"},hYt=[{value:jr.EXCLUDE,displayValue:"filterEditor.conditions.exclude"}],qme=[{value:jr.EXCLUDE,displayValue:"filterEditor.conditions.exclude"},{value:jr.CONTAINS,displayValue:"filterEditor.conditions.contains"},{value:jr.NOT_CONTAIN,displayValue:"filterEditor.conditions.notContain"},{value:jr.STARTS_WITH,displayValue:"filterEditor.conditions.startsWith"},{value:jr.NOT_STARTS_WITH,displayValue:"filterEditor.conditions.notStartsWith"},{value:jr.ENDS_WITH,displayValue:"filterEditor.conditions.endsWith"},{value:jr.NOT_ENDS_WITH,displayValue:"filterEditor.conditions.notEndsWith"},{value:jr.EQUALS,displayValue:"filterEditor.conditions.equals"},{value:jr.NOT_EQUALS,displayValue:"filterEditor.conditions.notEquals"},{value:jr.IS_EMPTY,displayValue:"filterEditor.conditions.isEmpty"},{value:jr.IS_NOT_EMPTY,displayValue:"filterEditor.conditions.isNotEmpty"}],pYt=e=>{if(!MP(e)||!Yh(e))return qme[0].value;if(eg(e))return jr.EXCLUDE;const t=tz(e),r=Zme(e);return t===jr.EQUALS&&r===""?jr.IS_EMPTY:t===jr.NOT_EQUALS&&r===""?jr.IS_NOT_EMPTY:t},Zme=e=>MP(e)&&rz(e)[0]||"",fYt=e=>e===jr.IS_EMPTY?uu[jr.EQUALS]:e===jr.IS_NOT_EMPTY?uu[jr.NOT_EQUALS]:uu[e];function gYt(e,t){const{attribute:r}=e,{condition:n,value:i,selectedMembers:o,multiSelectEnabled:a}=t;if(n===jr.EXCLUDE){const l=zw(e,o),c=kP(e,o);return hz(r,c,xe(ue({},l),{enableMultiSelection:a}))}return fYt(n).fn(r,i,e.config)}const mYt=({filter:e,selected:t,multiSelectEnabled:r,onChange:n})=>{const{t:i}=At(),{membersOnlyMode:o}=md(),[a,s]=ce.useState(pYt(e)),[l,c]=ce.useState(Zme(e)),[d,h]=ce.useState(eg(e)?Bw(e):[]),u=hl(r),g=typeof u!="undefined"&&u!==r,f=o?hYt:qme,p=ce.useMemo(()=>f.map(E=>xe(ue({},E),{displayValue:i(E.displayValue)})),[i,f]),x=ce.useMemo(()=>[jr.CONTAINS,jr.ENDS_WITH,jr.EQUALS,jr.NOT_CONTAIN,jr.NOT_ENDS_WITH,jr.NOT_EQUALS,jr.NOT_STARTS_WITH,jr.STARTS_WITH].includes(a),[a]),S=ce.useCallback(E=>{const N=gYt(e,E);n(N)},[e,n]);ce.useEffect(()=>{if(g&&t){let E=d;r||(d.length>1&&(E=[d.sort()[0]]),h(E)),S({condition:a,value:l,selectedMembers:E,multiSelectEnabled:r})}},[a,l,d,r,g,t,S]);const j=ce.useCallback(()=>{S({condition:a,value:l,selectedMembers:d,multiSelectEnabled:r})},[a,l,d,r,S]),U=ce.useCallback(E=>{const N=Array.isArray(E)?E:[E];h(N),S({condition:a,value:l,selectedMembers:N,multiSelectEnabled:r})},[a,l,r,S]),B=ce.useCallback(E=>{let N=l;s(E),(E===jr.IS_EMPTY||E===jr.IS_NOT_EMPTY)&&(c(""),N=""),S({condition:E,value:N,selectedMembers:d,multiSelectEnabled:r})},[l,d,r,S]),R=ce.useCallback(E=>{const N=E.target.value;c(N),S({condition:a,value:N,selectedMembers:d,multiSelectEnabled:r})},[a,d,r,S]);return Ve(du,{selected:t,onSelect:j,"aria-label":"Text condition section",children:[pe(gd,{style:{width:"168px",marginRight:"8px"},value:a,items:p,onChange:B,"aria-label":"Condition select"}),x&&pe(Qf,{style:{width:"300px"},placeholder:i("filterEditor.placeholders.enterEntry"),value:l,onChange:R,"aria-label":"Value input"}),a===jr.EXCLUDE&&pe(dz,{width:300,attribute:e.attribute,multiSelect:r,selectedMembers:d,onChange:U})]})},vYt=Ye("div",{target:"e1e9clqi0",label:"Container"})("display:flex;align-items:center;"),yYt=Ye("span",{target:"e1e9clqi1",label:"Label"})("padding-right:5px;font-family:'Open Sans';color:",({theme:e})=>e.general.popover.content.textColor,";"),fz=({enabled:e,onChange:t})=>{const{t:r}=At(),{themeSettings:n}=pt();return Ve(vYt,{children:[pe(yYt,{theme:n,id:"multiselect-switch-label",children:r("filterEditor.labels.allowMultiSelection")}),pe(yfe,{checked:e,size:"small",inputProps:{role:"switch",name:"multiselect-switch","aria-labelledby":"multiselect-switch-label"},onChange:()=>t==null?void 0:t(!e),theme:n})]})},gz=Ye("div",{target:"e1kj77qg0",label:"FilterEditorContainer"})("display:flex;flex-direction:column;padding:20px 16px 16px 40px;justify-content:space-around;align-items:stretch;font-size:13px;color:",({theme:e})=>e.general.popover.content.textColor,";"),mz=({selected:e})=>{const{t}=At();return pe(du,{disabled:!0,selected:e,onSelect:()=>{},"aria-label":"Not supported section",children:()=>pe("span",{children:t("unsupportedFilter",{filter:""})})})},bYt=e=>e?Yh(e)?pz(e)?"all":Jf(e)?"members":"text-condition":"not-supported":null,xYt=({filter:e,onChange:t,showMultiselectToggle:r=!0})=>{const{themeSettings:n}=pt(),[i,o]=ce.useState(e!=null?e:null),[a,s]=ce.useState(bYt(i)),[l,c]=ce.useState("enableMultiSelection"in e.config?e.config.enableMultiSelection:!0);ce.useEffect(()=>{t==null||t(i)},[i,t]);const d=ce.useCallback(g=>{o(g),s("all")},[]),h=ce.useCallback(g=>{o(g),s("members")},[]),u=ce.useCallback(g=>{o(g),s("text-condition")},[]);return Ve(gz,{theme:n,"aria-label":"Filter editor textual",children:[!Yh(e)&&pe(mz,{selected:a==="not-supported"}),Ve(CP,{direction:"row",spacing:2,sx:{justifyContent:"space-between",alignItems:"center",marginBottom:"42px"},children:[pe(lz,{filter:e,selected:a==="all",onChange:d}),r&&pe(fz,{enabled:l,onChange:c})]}),pe(Yme,{filter:e,selected:a==="members",multiSelectEnabled:l,onChange:h}),pe(mYt,{filter:e,selected:a==="text-condition",multiSelectEnabled:l,onChange:u})]})};function $w(e){return/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/.test(e)}const vz=(e,t)=>{const r=ce.useRef(!1);return ce.useEffect(()=>{e!==t&&(r.current=!0)},[e,t]),r.current},Xme="136px";function Kme(e,t,r){if(!$w(e))return r("filterEditor.validationErrors.invalidNumber");if($w(t)&&parseFloat(e)>parseFloat(t))return r("filterEditor.validationErrors.invalidNumericRange")}function Qme(e,t){if(!$w(e))return t("filterEditor.validationErrors.invalidNumber")}const wYt=e=>{const{filter:t,selected:r,defaultFrom:n,defaultTo:i,onChange:o}=e,{t:a}=At(),[s,l]=ce.useState(TP(t)?t.valueA.toString():""),[c,d]=ce.useState(TP(t)?t.valueB.toString():""),h=vz(s,""),u=vz(c,"");ce.useEffect(()=>{Kl(n)&&l(S=>S===""?n.toString():S)},[n]),ce.useEffect(()=>{Kl(i)&&d(S=>S===""?i.toString():S)},[i]);const g=ce.useCallback((S,j)=>{const B=!Kme(S,j,a)&&!Qme(j,a)?Ag(t.attribute,parseFloat(S),parseFloat(j),t.config):null;o(B)},[t,a,o]),f=ce.useCallback(()=>{g(s,c)},[s,c,g]),p=ce.useCallback(S=>{const j=S.target.value;l(j),g(j,c)},[c,g]),x=ce.useCallback(S=>{const j=S.target.value;d(j),g(s,j)},[s,g]);return Ve(du,{selected:r,onSelect:f,"aria-label":"Numeric range section",children:[pe("span",{id:"numeric-range-from",style:{margin:"0 8px 0 0"},children:a("filterEditor.labels.from")}),pe(Qf,{style:{width:Xme},placeholder:a("filterEditor.placeholders.enterValue"),value:s,onChange:p,"aria-labelledby":"numeric-range-from",error:h&&Kme(s,c,a)}),pe("span",{id:"numeric-range-to",style:{margin:"0 8px 0 8px"},children:a("filterEditor.labels.to")}),pe(Qf,{style:{width:Xme},placeholder:a("filterEditor.placeholders.enterValue"),value:c,onChange:x,"aria-labelledby":"numeric-range-to",error:u&&Qme(c,a)})]})},CYt=e=>{const[t,r,n]=(e==null?void 0:e.rows[0])||[];return ue(ue({count:t==null?void 0:t.data},r&&{min:r.data}),n&&{max:n.data})},Jme=e=>{const{attribute:t,enabled:r,defaultDataSource:n,filters:i}=e,{data:o,isLoading:a,isError:s,isSuccess:l,error:c}=_E({dataSource:t.dataSource&&ky(t.dataSource)||n,measures:Sy(t.type)?[u_(t)]:[u_(t),bD(t),c_(t)],enabled:r,filters:i});return{isLoading:a,isError:s,isSuccess:l,error:c,data:o?CYt(o):void 0}},Lo={EXCLUDE:"exclude",EQUALS:Er.EQUALS_NUMERIC,NOT_EQUALS:Er.NOT_EQUALS_NUMERIC,LESS_THAN:Er.LESS_THAN,LESS_THAN_OR_EQUAL:Er.LESS_THAN_OR_EQUAL,GREATER_THAN:Er.GREATER_THAN,GREATER_THAN_OR_EQUAL:Er.GREATER_THAN_OR_EQUAL};function _Yt(e,t){if(!$w(e))return t("filterEditor.validationErrors.invalidNumber")}function SYt(e,t){return!MP(e)||TP(e)||!Yh(e)?t:eg(e)?Lo.EXCLUDE:tz(e)}function kYt(e){var r;return MP(e)?`${(r=rz(e)[0])!=null?r:""}`:""}function MYt(e,t){const{attribute:r}=e,{condition:n,value:i,selectedMembers:o,multiSelectEnabled:a}=t;if(n===Lo.EXCLUDE){const l=zw(e,o),c=kP(e,o);return hz(r,c,xe(ue({},l),{enableMultiSelection:a}))}return $w(i)?lYt(n).fn(r,parseFloat(i),e.config):null}const TYt=[{value:Lo.EXCLUDE,displayValue:"filterEditor.conditions.exclude"}],e0e=[{value:Lo.EXCLUDE,displayValue:"filterEditor.conditions.exclude"},{value:Lo.EQUALS,displayValue:"filterEditor.conditions.equals",icon:pe(Izt,{})},{value:Lo.NOT_EQUALS,displayValue:"filterEditor.conditions.notEquals",icon:pe(Nzt,{})},{value:Lo.LESS_THAN,displayValue:"filterEditor.conditions.lessThan",icon:pe(Rzt,{})},{value:Lo.LESS_THAN_OR_EQUAL,displayValue:"filterEditor.conditions.lessThanOrEqual",icon:pe(Fzt,{})},{value:Lo.GREATER_THAN,displayValue:"filterEditor.conditions.greaterThan",icon:pe(jzt,{})},{value:Lo.GREATER_THAN_OR_EQUAL,displayValue:"filterEditor.conditions.greaterThanOrEqual",icon:pe(Bzt,{})}],AYt=({filter:e,selected:t,multiSelectEnabled:r,onChange:n})=>{const{t:i}=At(),{membersOnlyMode:o}=md(),[a,s]=ce.useState(SYt(e,e0e[0].value)),[l,c]=ce.useState(kYt(e)),[d,h]=ce.useState(eg(e)?Bw(e):[]),u=vz(l,""),g=hl(r),f=typeof g!="undefined"&&g!==r,p=o?TYt:e0e,x=ce.useMemo(()=>p.map(N=>xe(ue({},N),{displayValue:i(N.displayValue)})),[i,p]),S=ce.useMemo(()=>[Lo.EQUALS,Lo.NOT_EQUALS,Lo.LESS_THAN,Lo.LESS_THAN_OR_EQUAL,Lo.GREATER_THAN,Lo.GREATER_THAN_OR_EQUAL].includes(a),[a]),j=ce.useCallback(N=>{const M=MYt(e,N);n(M)},[e,n]);ce.useEffect(()=>{if(f&&t){let N=d;r||(d.length>1&&(N=[d.sort()[0]]),h(N)),j({condition:a,value:l,selectedMembers:N,multiSelectEnabled:r})}},[a,l,d,r,f,t,j]);const U=ce.useCallback(()=>{j({condition:a,value:l,selectedMembers:d,multiSelectEnabled:r})},[a,l,d,r,j]),B=ce.useCallback(N=>{const M=Array.isArray(N)?N:[N];h(M),j({condition:a,value:l,selectedMembers:M,multiSelectEnabled:r})},[a,l,r,j]),R=ce.useCallback(N=>{s(N),j({condition:N,value:l,selectedMembers:d,multiSelectEnabled:r})},[l,d,r,j]),E=ce.useCallback(N=>{const M=N.target.value;c(M),j({condition:a,value:M,selectedMembers:d,multiSelectEnabled:r})},[a,d,r,j]);return Ve(du,{selected:t,onSelect:U,"aria-label":"Numeric condition section",children:[pe(gd,{style:{width:"210px",marginRight:"8px"},value:a,items:x,onChange:R,"aria-label":"Condition select"}),S&&pe(Qf,{style:{width:"136px"},placeholder:i("filterEditor.placeholders.enterEntry"),value:l,onChange:E,error:u&&_Yt(l,i),"aria-label":"Value input"}),a===Lo.EXCLUDE&&pe(dz,{width:240,attribute:e.attribute,multiSelect:r,selectedMembers:d,onChange:B})]})},EYt=e=>e?Yh(e)?pz(e)?"all":Jf(e)?"members":TP(e)?"range":"condition":"not-supported":null,PYt=({filter:e,onChange:t,showMultiselectToggle:r=!0})=>{const{membersOnlyMode:n}=md(),{themeSettings:i}=pt(),{defaultDataSource:o}=md(),[a,s]=ce.useState(e!=null?e:null),[l,c]=ce.useState(EYt(a)),[d,h]=ce.useState("enableMultiSelection"in e.config?e.config.enableMultiSelection:!0),{data:u}=Jme(ue({attribute:e.attribute,enabled:!!e},o&&{defaultDataSource:o}));ce.useEffect(()=>{t==null||t(a)},[a,t]);const g=ce.useCallback(S=>{s(S),c("all")},[]),f=ce.useCallback(S=>{s(S),c("members")},[]),p=ce.useCallback(S=>{s(S),c("range")},[]),x=ce.useCallback(S=>{s(S),c("condition")},[]);return Ve(gz,{theme:i,"aria-label":"Filter editor numerical",children:[!Yh(e)&&pe(mz,{selected:l==="not-supported"}),Ve(CP,{direction:"row",spacing:2,sx:{justifyContent:"space-between",alignItems:"center",marginBottom:"42px"},children:[pe(lz,{filter:e,selected:l==="all",onChange:g}),r&&pe(fz,{enabled:d,onChange:h})]}),pe(Yme,{filter:e,selected:l==="members",multiSelectEnabled:d,onChange:f}),!n&&pe(wYt,{filter:e,selected:l==="range",defaultFrom:u==null?void 0:u.min,defaultTo:u==null?void 0:u.max,onChange:p}),pe(AYt,{filter:e,selected:l==="condition",multiSelectEnabled:d,onChange:x})]})},AP=()=>{const{app:e}=hr();return ce.useCallback((t,r)=>{const n=(i,o)=>Ch(i,o,e==null?void 0:e.settings.locale,e==null?void 0:e.settings.dateConfig);return X6(toe(t)?t.toISOString():t,n,r)},[e])},EP=50,t0e=.75;var Ni=function(e){return e.SINGLE_SELECT="single-select",e.MULTI_SELECT="multi-select",e.RANGE_FROM_SELECT="range-from-select",e.RANGE_TO_SELECT="range-to-select",e}({});const DYt=1;function LYt(e,t){if(e.length!==0)return e.length>DYt?`${e.length} Dates selected`:e.map(r=>t(r,UT(Ze.Days))).join(", ")}function OYt(e){switch(e){case Ni.SINGLE_SELECT:return"pointSelector";case Ni.MULTI_SELECT:return"multiPointsSelector";case Ni.RANGE_FROM_SELECT:return"fromSelector";case Ni.RANGE_TO_SELECT:return"toSelector"}}function Ww(e){var E;const R=e,{value:t,type:r,limits:n,placeholder:i,onChange:o,width:a}=R,s=ut(R,["value","type","limits","placeholder","onChange","width"]),l=AP(),{themeSettings:c}=pt(),[d,h]=ce.useState(!1),u=ce.useRef(null),g=ce.useCallback(N=>{r===Ni.SINGLE_SELECT&&(o==null||o(N.toDate()))},[r,o]),f=ce.useCallback(N=>{r===Ni.MULTI_SELECT&&(o==null||o(N.map(M=>M.toDate())))},[r,o]),p=ce.useCallback(N=>{(r===Ni.RANGE_FROM_SELECT||r===Ni.RANGE_TO_SELECT)&&(o==null||o({from:N.from.toDate(),to:N.to.toDate()}))},[r,o]),x=ce.useMemo(()=>{if(r===Ni.SINGLE_SELECT&&t)return Un(t)},[r,t]),S=ce.useMemo(()=>{if(r===Ni.MULTI_SELECT&&(t!=null&&t.length))return t.map(N=>Un(N))},[r,t]),j=ce.useMemo(()=>{if(r===Ni.RANGE_FROM_SELECT||r===Ni.RANGE_TO_SELECT)return ue(ue({},(t==null?void 0:t.from)&&{from:Un(t.from)}),(t==null?void 0:t.to)&&{to:Un(t.to)})},[r,t]),U=ce.useMemo(()=>((r===Ni.SINGLE_SELECT?[t]:r===Ni.RANGE_FROM_SELECT?[t==null?void 0:t.from]:r===Ni.RANGE_TO_SELECT?[t==null?void 0:t.to]:r===Ni.MULTI_SELECT?t:[])||[]).filter(M=>!!M),[r,t]),B=ce.useMemo(()=>n?{minDate:n.minDate?Un(n.minDate):void 0,maxDate:n.maxDate?Un(n.maxDate):void 0}:void 0,[n]);return pe(xw,{onClickAway:()=>h(!1),children:Ve("div",{style:{width:a},children:[Ve(_P,xe(ue({ref:u,focus:d,onClick:()=>h(N=>!N),theme:c},s),{children:[pe(jw,{theme:c,style:{opacity:U.length?"100%":"50%"},"aria-label":"Value",children:pe(Kt,{children:(E=LYt(U,l))!=null?E:i})}),pe(xfe,{iconColor:c.general.popover.input.textColor,"aria-label":"Calendar icon",style:{marginRight:"3px"}})]})),pe(SP,{open:d,anchorEl:u.current,preventClickPropagation:!0,children:pe(KB,{selectorMode:OYt(r),limit:B,selectedDate:x,selectedDates:S,selectedDateRange:j,onDateChanged:g,onDatesChanged:f,onDateRangeChanged:p})})]})})}const yz=[{value:Ze.Years,displayValue:"filterEditor.datetimeLevels.year"},{value:Ze.Quarters,displayValue:"filterEditor.datetimeLevels.quarter"},{value:Ze.Months,displayValue:"filterEditor.datetimeLevels.month"},{value:Ze.Weeks,displayValue:"filterEditor.datetimeLevels.week"},{value:Ze.Days,displayValue:"filterEditor.datetimeLevels.day"}],IYt=[{value:Ze.AggHours,displayValue:"filterEditor.datetimeLevels.aggrigatedHour"},{value:Ze.AggMinutesRoundTo15,displayValue:"filterEditor.datetimeLevels.aggrigatedMinutesRoundTo15"}],r0e=[...yz,...IYt];function NYt(e,t,r){var n;return t.length||(n=r==null?void 0:r.deactivatedMembers)!=null&&n.length?Hi(e,t,xe(ue({},r),{excludeMembers:!1})):null}const RYt=e=>{const{filter:t,selected:r,multiSelectEnabled:n,limits:i,onChange:o}=e,{t:a}=At(),{defaultDataSource:s}=md(),l=Jf(t),[c,d]=ce.useState(l?t.attribute:qh(t.attribute,Ze.Years,a)),h=ce.useMemo(()=>l?Bw(t):[],[l,t]),[u,g]=ce.useState(h),f=hl(n),p=AP(),x=c.granularity===Ze.Days,S=ce.useMemo(()=>Hi(c.sort(Br.Descending),[]),[c]),{data:j,isLoading:U,loadMore:B}=AE(ue({filter:S,count:EP},s&&{defaultDataSource:s})),R=ce.useCallback(({top:V,direction:q})=>{!U&&V>t0e&&q==="down"&&B(EP)},[B,U]),E=ce.useMemo(()=>{let V=((j==null?void 0:j.allMembers)||[]).map(({key:q,title:z})=>({value:q,displayValue:z}));if(Jf(t)&&Va(t.attribute,c)&&h.length){const q=n?h:[h[0]];V=[...q.map(z=>({value:z,displayValue:p(z,UT(c.granularity))})),...V.filter(z=>!q.includes(z.value))]}return V},[n,j,t,c,p,h]),N=typeof f!="undefined"&&f!==n,M=ce.useMemo(()=>r0e.map(V=>({value:V.value,displayValue:a(V.displayValue)})),[a]),$=ce.useCallback(({selectedMembers:V,multiSelectEnabled:q,attribute:z})=>{const P=zw(t,V),W=kP(t,V),_=NYt(z,W,xe(ue({},P),{enableMultiSelection:q}));o(_)},[t,o]);ce.useEffect(()=>{if(N&&r){let V=u;n||(u.length>1&&(V=[u.sort()[0]]),g(V)),$({selectedMembers:V,multiSelectEnabled:n,attribute:c})}},[N,n,u,c,r,$]);const T=ce.useCallback(()=>{$({selectedMembers:u,multiSelectEnabled:n,attribute:c})},[u,n,c,$]),C=ce.useCallback(V=>{const q=Array.isArray(V)?V:[V];g(q),$({selectedMembers:q,multiSelectEnabled:n,attribute:c})},[n,c,$]),y=ce.useCallback(V=>{const q=V.map(z=>Vme(z));C(q)},[C]),D=ce.useCallback(V=>{const q=qh(c,V,a);d(q),g([]),$({selectedMembers:[],multiSelectEnabled:n,attribute:q})},[n,c,$,a]),k=ce.useMemo(()=>x?u.map(V=>new Date(V)):void 0,[u,x]),F=ce.useMemo(()=>i?{minDate:i.minDate?new Date(i.minDate):void 0,maxDate:i.maxDate?new Date(i.maxDate):void 0}:void 0,[i]);return pe(du,{selected:r,onSelect:T,"aria-label":"Members section",children:()=>Ve(Kt,{children:[pe(gd,{style:{width:"168px",marginRight:"8px"},value:c.granularity,items:M,onChange:D,"aria-label":"Condition select"}),Ve(Kt,{children:[n&&!x&&pe(uz,{width:150,values:u,placeholder:a("filterEditor.placeholders.selectFromList"),items:E,onChange:C,onListScroll:R,showListLoader:U,showSearch:!1}),!n&&!x&&pe(cz,{width:150,value:u[0],placeholder:a("filterEditor.placeholders.selectFromList"),items:E,onChange:C,onListScroll:R,showListLoader:U,showSearch:!1}),x&&pe(Ww,{width:152,type:Ni.MULTI_SELECT,value:k,limits:F,onChange:y,placeholder:a("filterEditor.placeholders.select")})]})]})})},n0e="yyyy-MM-dd",FYt=e=>{const{filter:t,selected:r,limits:n,onChange:i}=e,{t:o}=At(),a=AP(),[s,l]=ce.useState(Tg(t)&&t.valueA?new Date(t.valueA):void 0),[c,d]=ce.useState(Tg(t)&&t.valueB?new Date(t.valueB):void 0),h=ce.useMemo(()=>({from:s,to:c}),[s,c]),u=ce.useMemo(()=>n?{minDate:n.minDate?new Date(n.minDate):void 0,maxDate:n.maxDate?new Date(n.maxDate):void 0}:void 0,[n]),g=ce.useCallback((x,S)=>{const U=x&&S?RD(t.attribute,a(x,n0e),a(S,n0e),t.config):null;i(U)},[t,a,i]),f=ce.useCallback(()=>{g(s,c)},[s,c,g]),p=ce.useCallback(({from:x,to:S})=>{l(x),d(S),g(x,S)},[g]);return Ve(du,{selected:r,onSelect:f,"aria-label":"Datetime range section",children:[pe("span",{id:"datetime-range-from",style:{margin:"0 8px 0 0"},children:o("filterEditor.labels.from")}),pe(Ww,{width:152,type:Ni.RANGE_FROM_SELECT,value:h,limits:u,"aria-labelledby":"datetime-range-from",onChange:p,placeholder:o("filterEditor.placeholders.select")}),pe("span",{id:"datetime-range-to",style:{margin:"0 8px 0 8px"},children:o("filterEditor.labels.to")}),pe(Ww,{width:152,type:Ni.RANGE_TO_SELECT,value:h,limits:u,"aria-labelledby":"datetime-range-to",onChange:p,placeholder:o("filterEditor.placeholders.select")})]})};function jYt(e,t){const{selectedMembers:r,multiSelectEnabled:n,attribute:i}=t,o=zw(e,r);return r!=null&&r.length?hz(i,r,xe(ue({},o),{enableMultiSelection:n})):null}function BYt(e,t){const r={selectedMembers:[],attribute:qh(e.attribute,Ze.Years,t)};return eg(e)?xe(ue({},r),{selectedMembers:Bw(e),attribute:e.attribute}):r}const zYt=({filter:e,multiSelectEnabled:t,limits:r,onChange:n})=>{const{t:i}=At(),{defaultDataSource:o,parentFilters:a}=md(),s=ce.useMemo(()=>BYt(e,i),[e,i]),[l,c]=ce.useState(s.attribute),d=s.selectedMembers,[h,u]=ce.useState(d),g=hl(t),f=AP(),p=l.granularity===Ze.Days,x=ce.useMemo(()=>Hi(l.sort(Br.Descending),[]),[l]),{data:S,isLoading:j,loadMore:U}=AE(ue({filter:x,parentFilters:a,count:EP,enabled:!p},o&&{defaultDataSource:o})),B=ce.useCallback(({top:k,direction:F})=>{!j&&k>t0e&&F==="down"&&U(EP)},[U,j]),R=ce.useMemo(()=>{let k=((S==null?void 0:S.allMembers)||[]).map(({key:F,title:V})=>({value:F,displayValue:V}));if(Jf(e)&&Va(e.attribute,l)&&d.length){const F=t?d:[d[0]];k=[...F.map(V=>({value:V,displayValue:f(V,UT(l.granularity))})),...k.filter(V=>!F.includes(V.value))]}return k},[t,S,e,l,f,d]),E=typeof g!="undefined"&&g!==t,N=ce.useMemo(()=>r0e.map(k=>({value:k.value,displayValue:i(k.displayValue)})),[i]),M=ce.useCallback(k=>{const F=jYt(e,k);n(F)},[e,n]);ce.useEffect(()=>{if(E){let k=h;t||(h.length>1&&(k=[h.sort()[0]]),u(k)),M({selectedMembers:k,multiSelectEnabled:t,attribute:l})}},[h,t,E,l,M]);const $=ce.useCallback(k=>{const F=Array.isArray(k)?k:[k];u(F),M({selectedMembers:F,multiSelectEnabled:t,attribute:l})},[t,l,M]),T=ce.useCallback(k=>{const F=k.map(V=>Vme(V));$(F)},[$]),C=ce.useCallback(k=>{const F=qh(l,k,i);c(F),u([]),M({selectedMembers:[],multiSelectEnabled:t,attribute:F})},[t,l,M,i]),y=ce.useMemo(()=>p?h.map(k=>new Date(k)):void 0,[h,p]),D=ce.useMemo(()=>r?{minDate:r.minDate?new Date(r.minDate):void 0,maxDate:r.maxDate?new Date(r.maxDate):void 0}:void 0,[r]);return Ve(Kt,{children:[pe(gd,{style:{width:"176px",marginRight:"8px"},value:l.granularity,items:N,onChange:C,"aria-label":"Condition select"}),Ve(Kt,{children:[t&&!p&&pe(uz,{width:152,values:h,placeholder:i("filterEditor.placeholders.selectFromList"),items:R,onChange:$,onListScroll:B,showListLoader:j,showSearch:!1}),!t&&!p&&pe(cz,{width:152,value:h[0],placeholder:i("filterEditor.placeholders.selectFromList"),items:R,onChange:$,onListScroll:B,showListLoader:j,showSearch:!1}),p&&pe(Ww,{width:152,type:Ni.MULTI_SELECT,value:y,limits:D,onChange:T,placeholder:i("filterEditor.placeholders.select")})]})]})},$Yt={errorPrefix:"[request-error]",errors:{networkError:"Network error. Check browser console for further details.",authFailed:"Failed to authenticate.",ssoNotEnabled:"SSO is not enabled on target instance, please choose another authentication method.",ssoNoLoginUrl:"Can not fetch login URL on target instance. Check SSO settings.",passwordAuthFailed:"$t(errorPrefix) Username and password authentication was not successful. Check credentials.",tokenAuthFailed:"$t(errorPrefix) Token authentication was not successful. Check credentials.",responseError_onlyStatus:"$t(errorPrefix) Status: {{status}}",responseError_withStatusText:"$t(errorPrefix) Status: {{status}} - {{statusText}}"}},WYt={errorPrefix:"[request-error]",errors:{networkError:"Помилка мережі. Можливо ви забули додати свій домен до «CORS Allowed Origins» в панелі адміністратора Sisense -> Security Settings.",authFailed:"Автентифікація не вдалася.",ssoNotEnabled:"SSO не ввімкнено на цьому сервері, будь ласка, виберіть інший метод аутентифікації",ssoNoLoginUrl:"Неможливо отримати loginUrl з сервера. Перевірте налаштування SSO.",passwordAuthFailed:"$t(errorPrefix) Помилка автентифікації за допомогою імені користувача та пароля. Перевірте дані для входу.",tokenAuthFailed:"$t(errorPrefix) Помилка автентифікації за допомогою токена. Перевірте дані для входу.",responseError_onlyStatus:"$t(errorPrefix) Статус: {{status}}",responseError_withStatusText:"$t(errorPrefix) Статус: {{status}} - {{statusText}}"}},i0e="sdkRestClient",HYt={en:$Yt,uk:WYt};function UYt(){return VC({resource:HYt,language:"en",namespace:i0e})}const{i18nextInstance:GYt}=UYt();class Hw{constructor(t){this._valid=!0,this._authenticating=!1,this._tried=!1,this._result=new Promise(r=>{this._resolve=r}),this.type=t}isValid(){return this._valid}invalidate(){this._valid=!1}authenticate(){return this._result}isAuthenticating(){return this._authenticating}authenticated(){return this._result}applyHeader(t){}}const PP=(e,t)=>{for(const[r,n]of Object.entries(t))Array.isArray(e)?e.push([r,n]):typeof e.set=="function"?e.set(r,n):e[r]=n},o0e=(e,t)=>{if(!e||typeof e!="string")return e;const r=new URL(e);for(const[n,i]of Object.entries(t))r.searchParams.append(n,i);return r.toString()},a0e=(e,t)=>{if(!e||typeof e!="string")return e;const r=new URL(e),n=t.startsWith("/")?t.slice(1):t;return r.pathname+=n,r.toString()},VYt=(e,t)=>e===null||t===null;class YYt extends Hw{constructor(t,r){super("bearer"),this.bearer=r,this._resolve(!0)}applyHeader(t){const r="Bearer "+this.bearer;PP(t,{Authorization:r})}authenticate(){return this._result}authenticated(){return this._result}}function qYt(e){return e.type==="bearer"}class ZYt extends Hw{constructor(){super("fusion")}authenticate(){var t,r,n,i,o;const a=!!(!((r=(t=window.prism)===null||t===void 0?void 0:t.user)===null||r===void 0)&&r._id);this._resolve(a);const s=(o=(i=(n=window.document)===null||n===void 0?void 0:n.cookie)===null||i===void 0?void 0:i.match(/(?:^|;\s*)XSRF-TOKEN=([^;]+)/))===null||o===void 0?void 0:o[1];return s&&(this.antiCsrfToken=s),this._result}applyHeader(t){this.antiCsrfToken&&PP(t,{"X-Xsrf-Token":this.antiCsrfToken})}}class Zh extends Xv{constructor(t,r){super(i0e,{key:t,interpolationOptions:r},GYt.t)}get status(){return this.interpolationOptions.status}}var bz=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(h){a(h)}}function l(d){try{c(n.throw(d))}catch(h){a(h)}}function c(d){d.done?o(d.value):i(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})};class XYt extends Hw{constructor(t,r=!1){super("sso"),this.url=mu(t,!0),this._enableSilentPreAuth=r}authenticate(t=!0){var r;return bz(this,void 0,void 0,function*(){try{this._authenticating=!0;const{isAuthenticated:n,loginUrl:i}=yield this.checkAuthentication();if(n)return this._resolve(!0),yield this._result;const o=o0e(i,{return_to:window.location.href});if(this._enableSilentPreAuth&&t){yield this.authenticateSilent(o);const{isAuthenticated:a}=yield this.checkAuthentication();if(a)return this._resolve(!0),yield this._result}(r=window==null?void 0:window.location)===null||r===void 0||r.replace(o)}finally{this._resolve(!1),this._authenticating=!1}return this._result})}authenticateSilent(t){return bz(this,void 0,void 0,function*(){const r=document.createElement("iframe");r.style.display="none",document.body.appendChild(r),r.src=t,yield new Promise(n=>{r.onload=()=>{n(!0)}}),document.body.removeChild(r)})}checkAuthentication(){var t,r,n;return bz(this,void 0,void 0,function*(){const i=a0e(mu(this.url),"api/auth/isauth"),o=yield fetch(i,{headers:{Internal:"true"},credentials:"include"}).catch(DP);if(o.status===200&&!(!((r=(t=o.headers)===null||t===void 0?void 0:t.get("Content-Type"))===null||r===void 0)&&r.includes("application/json")))throw new Zh("errors.authFailed");const a=yield o.json();if(!a.isAuthenticated){if(!a.ssoEnabled)throw new Zh("errors.ssoNotEnabled");if(!a.loginUrl)throw new Zh("errors.ssoNoLoginUrl")}const s=a.loginUrl&&((n=a.loginUrl)===null||n===void 0?void 0:n.search(/^\/api\/v\d+\/[^/]+\/login$/))!==-1?a0e(this.url,a.loginUrl):a.loginUrl||"";return{isAuthenticated:a.isAuthenticated,loginUrl:s}})}}function s0e(e){return e.type==="sso"}var KYt=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(h){a(h)}}function l(d){try{c(n.throw(d))}catch(h){a(h)}}function c(d){d.done?o(d.value):i(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})};class QYt extends Hw{constructor(t,r){super("wat"),this.url=`${mu(t)}api/v1/wat/sessionToken`,this.body=`{"webAccessToken": "${r}"}`}authenticate(){return KYt(this,void 0,void 0,function*(){if(this._tried)return this._result;this._tried=!0;try{this._authenticating=!0;const t=yield fetch(this.url,{method:"POST",headers:{accept:"application/json","Content-Type":"application/json"},body:this.body}).catch(DP);if(t.ok){const r=yield t.json();this._initialiser=r.initialiser,this._webSessionToken=r.webSessionToken,this._resolve(!0)}}catch(t){throw new Zh("errors.tokenAuthFailed")}finally{this._resolve(!1),this._authenticating=!1}return this._result})}applyHeader(t){if(this._webSessionToken&&this._initialiser){const r=this._webSessionToken,n=this._initialiser;PP(t,{Authorization:r,Initialiser:n})}}}function l0e(e){return e.type==="wat"}var c0e=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(h){a(h)}}function l(d){try{c(n.throw(d))}catch(h){a(h)}}function c(d){d.done?o(d.value):i(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})};function JYt(e){var t,r,n;return c0e(this,void 0,void 0,function*(){if(!e.ok){const i=(t=e.headers)===null||t===void 0?void 0:t.get("Content-Type"),o=i&&i.includes("application/json")?yield e.json().catch(()=>({})):{};throw new Zh("errors.responseError",{status:e.status.toString(),statusText:e.statusText,errorCode:(r=o.error)===null||r===void 0?void 0:r.code,errorMessage:(n=o.error)===null||n===void 0?void 0:n.message,context:e.statusText?"withStatusText":"onlyStatus"})}return e})}function eqt(e,t){if(t.invalidate(),aqt(t))throw new Zh("errors.passwordAuthFailed");if(qYt(t)||l0e(t))throw new Zh("errors.tokenAuthFailed");return s0e(t)&&!t.isAuthenticating()&&t.authenticate(),e}function tqt(e){return e.message==="Failed to fetch"&&e.name==="TypeError"}function rqt(){return console.warn("Network error. Verify server is accessible and your domain is added to 'CORS Allowed Origins' in Sisense Admin Panel -> Security Settings."),Promise.reject(new Zh("errors.networkError"))}const nqt=e=>t=>c0e(void 0,void 0,void 0,function*(){return t.status===401?eqt(t,e):t.ok?t:JYt(t)}),DP=e=>tqt(e)?rqt():Promise.reject(e);var iqt=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(h){a(h)}}function l(d){try{c(n.throw(d))}catch(h){a(h)}}function c(d){d.done?o(d.value):i(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})};class oqt extends Hw{constructor(t,r,n){super("password"),this._authheader="",this.url=`${mu(t)}api/v1/authentication/login`;const i=encodeURIComponent(r),o=encodeURIComponent(n);this.body=`username=${i}&password=${o}`}authenticate(){return iqt(this,void 0,void 0,function*(){if(this._tried)return this._result;this._tried=!0;try{this._authenticating=!0;const t=yield fetch(this.url,{method:"POST",headers:{accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:this.body}).catch(DP);if(t.ok){const r=yield t.json();this._authheader=r.access_token}}finally{this._resolve(!!this._authheader),this._authenticating=!1}return this._result})}applyHeader(t){const r="Bearer "+this._authheader;PP(t,{Authorization:r})}}function aqt(e){return e.type==="password"}function sqt({url:e,username:t,password:r,token:n,wat:i,ssoEnabled:o=!1,enableSilentPreAuth:a=!1,useFusionAuth:s=!1}){const l=mu(e);return o?new XYt(mu(e,!0),a):t&&r?new oqt(l,t,r):n?new YYt(l,n):i?new QYt(l,i):s?new ZYt:null}var lqt=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(h){a(h)}}function l(d){try{c(n.throw(d))}catch(h){a(h)}}function c(d){d.done?o(d.value):i(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})};class cqt{constructor(t,r,n){this.url=mu(t),this.auth=r,this.env=n}login(){return this.auth.authenticate()}call(t,r,n){return lqt(this,void 0,void 0,function*(){this.auth.isAuthenticating()&&(yield this.auth.authenticated()),r.headers=r.headers||{},s0e(this.auth)&&(r.credentials="include"),this.auth.applyHeader(r.headers);const i=n!=null&&n.skipTrackingParam?t:o0e(t,{trc:this.env}),o=yield fetch(i,r).then(nqt(this.auth)).catch(DP);if(!(o.status===204||o.status===304))return n!=null&&n.returnBlob?o.blob():o.json().catch(a=>{var s,l;if(!(!((l=(s=a==null?void 0:a.message)===null||s===void 0?void 0:s.includes)===null||l===void 0)&&l.call(s,"Unexpected end of JSON input")))throw a})})}post(t,r,n={},i,o){const a=Object.assign({method:"POST",body:o!=null&&o.nonJSONBody?r:JSON.stringify(r),headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json;charset=UTF-8"},signal:i},n);return this.call(this.url+t,a,o)}patch(t,r,n={},i,o){const a=Object.assign({method:"PATCH",body:o!=null&&o.nonJSONBody?r:JSON.stringify(r),headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json;charset=UTF-8"},signal:i},n);return this.call(this.url+t,a,o)}get(t,r={},n){return this.call(this.url+t,Object.assign(Object.assign({},r),{method:"GET"}),n)}delete(t,r={},n){return this.call(this.url+t,Object.assign(Object.assign({},r),{method:"DELETE"}),n)}}const uqt={enabled:!0,delay:500},dqt={locale:HT(),dateConfig:YR,loadingIndicatorConfig:uqt,translationConfig:{language:"en",customTranslations:[]},queryCacheConfig:{enabled:!1},queryLimit:Oqe,tabberConfig:{enabled:!0},accessibilityConfig:{enabled:!1},errorBoundaryConfig:{alwaysShowErrorText:!1},trackingConfig:{enabled:!0},jumpToDashboardConfig:{enabled:!1}};function hqt(e,t,r){return Jt(this,null,function*(){var i;const n=yield fqt(t,r);return yn.withOptions({mergeArrays:!1},dqt,{locale:HT((i=e==null?void 0:e.translationConfig)==null?void 0:i.language)},n,e)})}function pqt(e){const t={};return e.forEach(r=>{t[r.key]=r}),t}function fqt(e,t=!1){return Jt(this,null,function*(){var o,a;const r=yield e.get("api/globals");if(!r)throw new ft("errors.serverSettingsNotLoaded");const n=t?{colors:Z1().palette.variantColors}:yield qie(Vie(r.designSettings),e);return{serverThemeSettings:Gie(r.designSettings,n,e.url),serverLanguage:r.language,serverVersion:r.version,serverFeatures:pqt(r.features),user:{tenant:{name:((a=(o=r.user)==null?void 0:o.tenant)==null?void 0:a.name)||qte}}}})}function gqt(e,t){return t===qte?e:e.replace(`/${t}`,"")}function mqt(){window.addEventListener("unhandledrejection",e=>{e.reason instanceof Error?console.error(e.reason.message):console.error(e.reason)})}const u0e=l=>Jt(this,[l],function*({defaultDataSource:e,url:t,token:r,wat:n,ssoEnabled:i,appConfig:o,enableSilentPreAuth:a,useFusionAuth:s}){if(t===void 0)throw new ft("errors.sisenseContextNoAuthentication");const c=mu(t),d=mu(t,!0),h=sqt({url:d,token:r,wat:n,ssoEnabled:i,enableSilentPreAuth:a,useFusionAuth:s});if(!h)throw new ft("errors.sisenseContextNoAuthentication");mqt();const u=new cqt(c,h,"sdk-ui-2.4.0"),g=yield u.login(),f=l0e(h)||!g,p=yield hqt(o||{},u,f),x=new MX(gqt(c,p.user.tenant.name),h),S=new $7e(u,x);return{httpClient:u,pivotClient:x,queryClient:S,settings:p,defaultDataSource:e,queryCache:{clear:_re}}}),tg=(e,t)=>ce.useMemo(()=>yn.withOptions({mergeArrays:!1},t,e||{}),[e,t]),d0e={filtersPanel:{visible:!0,collapsedInitially:!1,persistCollapsedStateToLocalStorage:!1,actions:{addFilter:{enabled:!1,multiSelect:{visible:!0}},editFilter:{enabled:!1,multiSelect:{visible:!0}},deleteFilter:{enabled:!1}}},toolbar:{visible:!0},widgetsPanel:{responsive:!1,editMode:{enabled:!1,showDragHandleIcon:!0,applyChangesAsBatch:{enabled:!0,historyLimit:20}}}},xz=xe(ue({},d0e),{persist:!1,sharedMode:!1}),vqt=Cr({componentName:"DashboardById"})(({dashboardOid:e,config:t})=>{const r=tg(t,xz),{dashboard:n,isLoading:i,isError:o,error:a,dispatchChanges:s}=Mve({dashboardOid:e,includeWidgets:!0,includeFilters:!0,persist:r.persist,sharedMode:r.sharedMode}),l=ce.useCallback(h=>{const u=EJt(h);u&&s(u)},[s]);if(o&&a)throw new ft("errors.dashboardLoadFailed",{error:a.message});const c=ce.useMemo(()=>n&&vE(n),[n]),d=tg(t,tg(c==null?void 0:c.config,xz));return pe(Qu,{isVisible:i,children:c&&pe(Hz,xe(ue({},c),{onChange:l,config:d}))})}),yqt=Ye("button",{target:"e14rhw2k0",label:"ClearSelectionButton"})("color:",({theme:e})=>{var t;return(t=e.chart)==null?void 0:t.textColor},";background:none;font-size:13px;border:none;height:26px;padding:0 6px 0 2px;margin:0 4px 0 4px;border-radius:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:hover{background-color:rgba(247,247,247,1);}"),bqt=Ye("span",{target:"e14rhw2k1",label:"ClearSelectionText"})("color:",({theme:e})=>{var t;return(t=e.chart)==null?void 0:t.textColor},";display:inline-block;padding-top:3px;white-space:nowrap;"),xqt=({onClick:e})=>{var n;const{themeSettings:t}=pt(),{t:r}=At();return Ve(yqt,{onClick:e,theme:t,children:[pe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",children:pe("path",{fill:(n=t.chart)==null?void 0:n.textColor,d:"M7.187 7l9.774 10.279A1 1 0 0 0 17 17V8a1 1 0 0 0-1-1H7.187zm9.018 10.979L6.206 7.463l.487-.415A1 1 0 0 0 6 8v9a1 1 0 0 0 1 1h9c.07 0 .139-.007.205-.021zM7 6h9a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z"})}),pe(bqt,{theme:t,children:r("commonFilter.clearSelectionButton")})]})};function wqt(e){const t={};return{flatFilters:e.reduce((n,i)=>(Qi(i)?(t[i.config.guid]||(t[i.config.guid]=[]),i.filters.forEach(o=>{t[i.config.guid].push(o),n.push(o)})):n.push(i),n),[]),cascadingToPureFiltersMap:t}}function h0e(e,t,r){const n=t.filter(Qi);return _qt(e,n).map(o=>{if(Cqt(o)){const a=n.find(l=>l.config.guid===o.groupId);if(!a)throw new ft("errors.cascadingFilterOriginalNotFound");const s=r==null?void 0:r.shouldResetFiltersDeeperThanModified;return Sqt(o,a,{shouldResetFiltersDeeperThanModified:s})}return o})}function Cqt(e){return"groupId"in e}function _qt(e,t){const r=[];return e.forEach(n=>{const i=t.find(o=>o.filters.some(a=>Ey(a)===Ey(n)));if(i){const o=i.config.guid,a=r.find(s=>"groupId"in s&&s.groupId===o);a?a.filters.push(n):r.push({groupId:o,filters:[n],previousFilters:i.filters})}else r.push(n)}),r}function Sqt(e,t,r){const n=r!=null&&r.shouldResetFiltersDeeperThanModified?Tqt(e.filters,e.previousFilters):e.filters,i=kqt(n,t.config.disabled);return jD(n,{guid:t.config.guid,disabled:i})}function kqt(e,t){return e.some(n=>n.config.disabled!==t)?!t:t}function Mqt(e,t,r){const{flatFilters:n,cascadingToPureFiltersMap:i}=wqt(e);return{pureFilters:n,updateFilters:a=>{const s=h0e(a,e,{shouldResetFiltersDeeperThanModified:!0});t(s)},pureFiltersIgnoringRules:Aqt(r,i)}}function Tqt(e,t){const r=e.reduce((n,i,o)=>{const a=t.find(s=>N8(s,i));return a&&!Ihe(i,a)?o:n},-1);return r===-1?e:e.map((n,i)=>i>r?fE(n):n)}function Aqt(e,t){var r;return{all:e.all,ids:((r=e.ids)==null?void 0:r.reduce((n,i)=>{const o=t[i];return o?n.concat(o.map(a=>a.config.guid)):n.concat(i)},[]))||[]}}const p0e={applyMode:cw.HIGHLIGHT,shouldAffectFilters:!0,ignoreFilters:{all:!1,ids:[]},forceApplyBackgroundFilters:!0};function Eqt(e,t){return e==="table"?{applyMode:cw.FILTER,shouldAffectFilters:!1,ignoreFilters:yn(p0e.ignoreFilters,t.ignoreFilters||{})}:yn(p0e,t)}function Pqt(e,t,r,n,i,o,a){const s={},l=Eqt(r,i),{pureFilters:c,updateFilters:d,pureFiltersIgnoringRules:h}=Mqt(e,t,l.ignoreFilters||{}),u=c.filter(U=>!U.config.disabled),g=iFt(u,h),f=R8(r,n),p=l.shouldAffectFilters&&f.length,[x,S]=Lqt(g,f,l.applyMode),j=l.forceApplyBackgroundFilters?Ui(Dqt(c),x):x;if(s.filters=j,s.highlights=S,s.onDataPointsSelected=(U,B)=>{const R=[];if(p){const E=Rhe(r,n,U);E&&R.push(E);const N=gE(r,n,U),{filters:M,isSelection:$}=F8(N,c,!0),T=o($?"commonFilter.selectMenuItem":"commonFilter.unselectMenuItem"),C=Fhe(T,()=>{d(Ui(c,M))});R.push(C)}R.length&&(a==null||a({id:lw.WIDGET_POINTS_CROSSFILTERING,position:{left:B.clientX,top:B.clientY},itemSections:R}))},s.onDataPointContextMenu=(U,B)=>{const R=[];if(p){const E=Rhe(r,n,[U]);E&&R.push(E);const N=gE(r,n,[U]),{filters:M,isSelection:$}=F8(N,c,!0),T=o($?"commonFilter.selectMenuItem":"commonFilter.unselectMenuItem"),C=Fhe(T,()=>{d(Ui(c,M))});R.push(C)}R.length&&(a==null||a({id:lw.WIDGET_POINTS_CROSSFILTERING,position:{left:B.clientX,top:B.clientY},itemSections:R}))},p){s.onDataPointClick=E=>{const N=gE(r,n,[E]),{filters:M}=F8(N,c);d(Ui(c,M))};const U=u.filter(E=>f==null?void 0:f.some(N=>go(E)&&Va(E.attribute,N)&&!I8(E)&&!E.config.locked)),B=!!U.length,R=()=>{const E=U.map(fE);d(Ui(c,E))};B&&(s.renderToolbar=(E,N)=>{const M=f.map(({expression:$})=>$).join(";");return Ve("div",{style:{display:"flex"},children:[pe(xqt,{onClick:R}),N]},M)})}return s}function Dqt(e){return e.map(t=>{var r;return(r=t.config)==null?void 0:r.backgroundFilter}).filter(t=>!!t)}function Lqt(e,t,r){if(r===cw.HIGHLIGHT){const[n,i]=sw(e,a=>t.every(s=>!Va(s,a.attribute))),o=i.filter(a=>!I8(a));return[n,o]}return[e,[]]}function Oqt(e,t){return R8(e,t)[0]}function Iqt(e){return[...ok,...ak,...sk,...lk,...ck].includes(e)}function Nqt(e,t){return R8(e,t).length===1}function Rqt(e,t){return Nqt(e,t)&&Iqt(e)}function f0e(e,t,r){const n=i=>!!i&&!Va(r,Ks(i));if(Hl(e)||qd(e)||Zd(e)||Bm(e)){const i=t.category[0];if(n(i))return xe(ue({},t),{category:[r]})}else if(Ul(e)){const i=t,o=["x","y","breakByPoint","breakByColor"];for(const a of o){const s=i[a];if(s&&!qr(s)&&n(s))return xe(ue({},i),{[a]:r})}}return t}function g0e(e,t,r){return e.map(n=>{const i=["x","y","breakByPoint","breakByColor"],o=[...i,"size"].some(s=>s in n),a=i.find(s=>r[s]&&!qr(r[s]));if(o){const s=t,l=s.type==="mouseup";l&&console.warn("No drilldown support for multi-selection in scatter chart");const c=l?n[a]:s.point.options.custom[bpe(`{masked ${a}`)];return{categoryValue:c,categoryDisplayValue:c}}return n})}function Fqt(e,t){const[r,n]=ru(ce.useMemo(()=>Ll(e),[e]),{onLocalStateChange:ce.useCallback(u=>{const{filters:g,relations:f}=u;t&&t(os(g,f))},[t])}),{filters:i,relations:o}=r,a=ce.useMemo(()=>os(i,o),[i,o]),s=ce.useCallback(u=>{if(wu(u)){const{filters:g,relations:f}=Ll(u);n({filters:g||[],relations:f||null})}else n({filters:u,relations:null})},[n]),l=ce.useCallback(u=>{const g=Ui(i,[u]);n({filters:g,relations:Ol(i,o,g)})},[i,o,n]),c=ce.useCallback(u=>{n({filters:u,relations:Ol(i,o,u)})},[i,o,n]),d=ce.useMemo(()=>i.some(u=>Qi(u)),[i]),h=ce.useCallback(u=>{if(!o)return u;const g=d?h0e(u,i):u,f=Ol(i,o,g);return os(g,f)},[d,i,o]);return{regularFilters:i,addFilter:l,filtersOrFilterRelations:a,setFiltersOrFilterRelations:s,setFilters:c,applyRelationsToOtherFilters:h}}const m0e=({initialFilters:e=[],openMenu:t,onBeforeMenuOpen:r,onFiltersChange:n}={})=>{const{t:i}=At(),{filtersOrFilterRelations:o,regularFilters:a,addFilter:s,setFiltersOrFilterRelations:l,setFilters:c,applyRelationsToOtherFilters:d}=Fqt(e,n),h=ce.useCallback((u,g={})=>{var B,R;if(Jb(u))return u;const f=nHe(u),p=u,x=ki(u),j="drilldownOptions"in u&&((R=(B=u.drilldownOptions)==null?void 0:B.drilldownSelections)==null?void 0:R.length)?f0e(u.chartType,u.dataOptions,fD(u.drilldownOptions.drilldownSelections).nextDimension):u.dataOptions,U=Pqt(a,c,f,j,g,i,t);return x.highlights=Ui(U.highlights,p.highlights),x.onBeforeMenuOpen=r,U.onDataPointClick&&wQ(x,U.onDataPointClick),x.filters=d(Ui(U.filters,k_(p.filters))),U.onDataPointClick&&wQ(x,U.onDataPointClick),U.onDataPointsSelected&&iHe(x,U.onDataPointsSelected),U.onDataPointContextMenu&&CQ(x,U.onDataPointContextMenu),U.renderToolbar&&oHe(x,U.renderToolbar),x},[a,c,i,t,r,d]);return{filters:o,setFilters:l,addFilter:s,connectToWidgetProps:h}};var jqt=W$(function(e,t,r,n){dD(e,t,r,n)});const Bqt=(e,t)=>jqt(ki(e),t,(r,n)=>{if(Array.isArray(n))return n});function zqt(e){const{target:t,onChange:r}=e,n=Array.isArray(t),i=ce.useMemo(()=>n?t:[t],[n,t]),o=ce.useCallback((a,s)=>{i[s]&&"onChange"in i[s]&&i[s].onChange(a),r(a,n?s:void 0)},[i,n,r]);return ce.useMemo(()=>{const a=i.map((s,l)=>xe(ue({},s),{onChange:c=>o(c,l)}));return n?a:a[0]},[n,i,o])}const $qt=({combineMenus:e})=>{const t=ce.useRef([]),r=aw(),n=ce.useCallback(()=>{const o=t.current.length===1?t.current[0]:e(t.current);r.openMenu(xe(ue({},o),{onClose:()=>{t.current=[]}}))},[r,e]);return{openMenu:ce.useCallback(o=>{t.current.push(o),n()},[n])}},Wqt=({layout:e,layoutManagers:t})=>{const[r,n]=ce.useState(null);return{layout:r||Kd(...t.map(i=>i.manageLayout))(e),setLayout:n}},Hqt=e=>e.customWidgetType==="WidgetsTabber";function Uqt(e,t,r){var n;for(const i of Object.keys(t)){const o=t[i],a=o.tabs[r[i]];if(o.tabs.some(l=>l.displayWidgetIds.includes(e))&&!((n=a==null?void 0:a.displayWidgetIds)!=null&&n.includes(e)))return!1}return!0}const v0e=e=>Object.keys(e).reduce((t,r)=>(t[r]=e[r].activeTab,t),{}),Gqt=({widgets:e,config:t={}})=>{const r=ce.useMemo(()=>v0e(t),[t]),[n,i]=ce.useState(r);ce.useEffect(()=>{const s=v0e(t);i(l=>Object.keys(s).some(d=>l[d]!==s[d])?s:l)},[t]);const o=e.map(s=>Hqt(s)?xe(ue({},s),{onTabSelected:l=>{i(c=>xe(ue({},c),{[s.id]:l}))},selectedTab:n[s.id]||0}):s);return{layoutManager:{manageLayout:ce.useCallback(s=>xe(ue({},s),{columns:s.columns.map(l=>xe(ue({},l),{rows:l.rows.map(c=>{const d=c.cells.filter(h=>Uqt(h.widgetId,t,n));return d.length===c.cells.length||d.length===c.cells.length?c:{cells:d.map(h=>xe(ue({},h),{widthPercentage:100/d.length}))}}).filter(c=>c.cells.length>0)}))}),[t,n]),name:"TabberWidget"},widgets:o}},Vqt=({dashboardOid:e,filters:t,mergeTargetDashboardFilters:r,displayToolbarRow:n,displayFilterPane:i})=>{const{dashboard:o,isLoading:a,isError:s,error:l}=kve({dashboardOid:e,includeWidgets:!0,includeFilters:!0,persist:!1}),c=ce.useMemo(()=>{const g=o&&vE(o);if(g&&t)if(r){const f=g.filters||[],p=Array.isArray(t)&&Array.isArray(f)?Ui(f,t):t;return xe(ue({},g),{filters:p})}else return xe(ue({},g),{filters:t});return g},[o,t,r]),d=tg(c==null?void 0:c.config,xz),h=tg(void 0,d),u=ce.useMemo(()=>xe(ue({},h),{toolbar:xe(ue({},h.toolbar),{visible:n}),filtersPanel:xe(ue({},h.filtersPanel),{visible:i})}),[h,n,i]);if(s&&l)throw new ft("errors.dashboardLoadFailed",{error:l.message});return pe(Qu,{isVisible:a,children:c&&pe(Hz,xe(ue({},c),{config:u}))})},Yqt=(e,t,r)=>{const n=[];try{if(Na(t)&&t.dataOptions){const i=t.dataOptions,o=a=>{var s;if((s=a==null?void 0:a.column)!=null&&s.context){const l=a.column.context;if(typeof l=="object"&&l!==null)for(const c in l)l[c]&&typeof l[c].filterType!="undefined"&&n.push(l[c])}};"value"in i&&Array.isArray(i.value)&&i.value.forEach(a=>o(a))}return qqt(n,r.sendFormulaFiltersDuplicate)}catch(i){return console.warn("Error extracting formula context filters:",i),[]}},qqt=(e,t)=>{if(e.length===0)return e;const r=new Map;e.forEach(i=>{const o=i.attribute.expression;r.has(o)||r.set(o,[]),r.get(o).push(i)});const n=[];return r.forEach((i,o)=>{if(i.length===1)n.push(i[0]);else if(t!=="none")if(typeof t=="number")if(t>=1&&t<=i.length){const a=i[t-1];n.push(a)}else console.warn(`Dimension ${o}: invalid sendFormulaFiltersDuplicate number ${t}, treating as "none"`);else{const a=i[0];n.push(a)}}),n},Zqt=e=>{var i,o;const t=[],r=((i=e.entries)==null?void 0:i.category)||[];for(const a of r)if(a.attribute&&a.value!==void 0&&a.value!==null){const s=Hi(a.attribute,[String(a.value)]);t.push(s)}const n=((o=e.entries)==null?void 0:o.breakBy)||[];for(const a of n)if(a.attribute&&a.value!==void 0&&a.value!==null){const s=Hi(a.attribute,[String(a.value)]);t.push(s)}return t},wz=(e,t)=>t?t.length===0?[]:e.reduce((r,n)=>{if(Qi(n)){const i=n.filters.filter(o=>{const a=o.attribute.expression;return t.includes(a)});if(i.length===0)return r;if(i.length===1)r.push(i[0]);else{const o=jD(i,{guid:n.config.guid,disabled:n.config.disabled,locked:n.config.locked});r.push(o)}}else{const i=n.attribute.expression;t.includes(i)&&r.push(n)}return r},[]):e,Cz=(e,t,r,n,i,o,a)=>{const s=Zqt(n),l=wz(Yqt(n,r,e),e.includeWidgetFilterDims),c=wz(i,e.includeDashFilterDims),d=wz(o,e.includeWidgetFilterDims),h=Ui(Ui(Ui(s,c),d),l);return()=>Jt(this,null,function*(){const u=ce.createElement(Vqt,{key:`jtd-${t.id}`,dashboardOid:t.id,filters:h,mergeTargetDashboardFilters:e.mergeTargetDashboardFilters||!1,displayToolbarRow:e.displayToolbarRow||!1,displayFilterPane:e.displayFilterPane||!1});yield a({title:t.caption,width:e.modalWindowWidth,height:e.modalWindowHeight,measurement:e.modalWindowMeasurement,allowResize:e.modalWindowResize,content:u})})},y0e=(e,t,r,n,i,o,a)=>{if(!e)return null;const s=e.drillTargets.length>1,l=e.drillToDashboardRightMenuCaption||a("jumpToDashboard.defaultCaption");if(s)return{caption:l,subItems:[{items:e.drillTargets.map(d=>({caption:d.caption,onClick:Cz(e,d,r,t,n,i,o)}))}]};const c=e.drillTargets[0];return{caption:`${l} ${c.caption}`,onClick:Cz(e,c,r,t,n,i,o)}},Xqt=({widgetOptions:e,dashboardFilters:t=[],widgetFilters:r=new Map,openMenu:n})=>{var c;const i=jT(),o=At().t,{app:a}=hr(),s=ce.useMemo(()=>{var d;return(d=i==null?void 0:i.openModal)!=null?d:()=>Jt(this,null,function*(){return""})},[i==null?void 0:i.openModal]);return{connectToWidgetProps:ce.useCallback(d=>{var g,f;if(!((g=a==null?void 0:a.settings.jumpToDashboardConfig)!=null&&g.enabled))return d;const h=(f=e[d.id])==null?void 0:f.jtdConfig;if(!h||!h.enabled)return d;const u=r.get(d.id)||[];if(h.navigateType===Nf.CLICK){if(Na(d)||Jb(d)){const p=d.onDataPointClick;d.onDataPointClick=Gl([p,(x,S)=>{if(h.drillTargets.length===1){const j=h.drillTargets[0];Cz(h,j,d,x,t,u,s)()}else{const j=y0e(h,x,d,t,u,s,o);if(!j)return;const U=[{items:[j]}];n==null||n({id:"jump-to-dashboard-menu",position:{left:S.clientX,top:S.clientY},itemSections:U})}}])}}else if(h.navigateType===Nf.RIGHT_CLICK&&Na(d))return CQ(d,(x,S)=>{const j=y0e(h,x,d,t,u,s,o);if(!j)return;const U=[{items:[j]}];n==null||n({id:"jump-to-dashboard-menu",position:{left:S.clientX,top:S.clientY},itemSections:U})}),d;return d},[e,n,s,t,r,o,(c=a==null?void 0:a.settings.jumpToDashboardConfig)==null?void 0:c.enabled])}},Kqt=e=>e.id===lw.WIDGET_POINTS_CROSSFILTERING;function b0e(e){return e.id===lw.WIDGET_POINTS_DRILLDOWN}function Qqt(e){var a;if(e.length===1)return e[0];const t=e.find(s=>Kqt(s)),r=e.find(s=>b0e(s)),n=e.find(s=>Jqt(s)),i=(a=t==null?void 0:t.itemSections[0])!=null?a:r==null?void 0:r.itemSections[0],o={position:e[0].position,onClose:Gl(e.map(({onClose:s})=>s)),itemSections:i?[i]:[]};if(t){const s=t.itemSections.filter(({id:l})=>l!==iv.CROSSFILTERING_CHART_POINTS_SELECTION);o.itemSections.push(...s)}if(r){const s=r.itemSections.filter(({id:l})=>l!==iv.DRILLDOWN_CHART_POINTS_SELECTION);o.itemSections.push(...s)}return n&&o.itemSections.push(...n.itemSections),o}function Jqt(e){return e.id==="jump-to-dashboard-menu"}function LP(e,{onFiltersChange:t}={}){var R;const{filters:r,widgets:n,widgetsOptions:i}=e,[o]=ru(n),[a,s]=ru(o),{openMenu:l}=$qt({combineMenus:Qqt}),c=ce.useCallback(E=>b0e(E)?(l(E),null):E,[l]),{filters:d,setFilters:h,connectToWidgetProps:u}=m0e({initialFilters:r,openMenu:l,onFiltersChange:t,onBeforeMenuOpen:c}),{connectToWidgetProps:g}=Xqt({widgetOptions:i||{},dashboardFilters:Array.isArray(r)?r:[],widgetFilters:n.reduce((E,N)=>(E.set(N.id,N.filters||[]),E),new Map),openMenu:l}),f=zqt({target:a,onChange:ce.useCallback((E,N)=>{s(M=>{const $=ki(M);return $[N]=Bqt(M[N],E),$})},[s])}),p=ce.useMemo(()=>f.map(E=>{var N;return ue({},g(u(E,(N=i==null?void 0:i[E.id])==null?void 0:N.filtersOptions)))}),[f,i,u,g]),{layoutManager:x,widgets:S}=Gqt({widgets:p,config:e.tabbersOptions}),{layout:j,setLayout:U}=Wqt({layout:((R=e.layoutOptions)==null?void 0:R.widgetsPanel)||Hpe(p),layoutManagers:[x]}),B=ce.useMemo(()=>xe(ue({},e.layoutOptions),{widgetsPanel:j}),[j,e.layoutOptions]);return{dashboard:xe(ue({},e),{filters:d,widgets:S,layoutOptions:B}),setFilters:h,setWidgetsLayout:U}}const eZt=Xi("useComposedDashboard")(LP),_z=({styleOptions:e})=>{const{themeSettings:t}=pt();return{themeSettings:ce.useMemo(()=>{const o=e!=null?e:{},{palette:n}=o,i=ut(o,["palette"]);return xe(ue({},n&&{palette:n}),{dashboard:ue(ue({},t.dashboard),i)})},[e,t.dashboard])}},tZt=Xi("useDashboardTheme")(_z);var rZt="Expected a function";function nZt(e){if(typeof e!="function")throw new TypeError(rZt);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function iZt(e,t){if(e==null)return{};var r=py(K3(e),function(n){return[n]});return t=ip(t),Pae(e,r,function(n,i){return t(n,i[0])})}function oZt(e,t){return iZt(e,nZt(ip(t)))}const aZt=Cr({componentName:"WidgetById",customContextErrorMessageKey:"errors.widgetByIdNoSisenseContext"})(e=>{const U=e,{widgetOid:t,dashboardOid:r,includeDashboardFilters:n=!1,filters:i,highlights:o,filtersMergeStrategy:a,drilldownOptions:s,styleOptions:l}=U,c=ut(U,["widgetOid","dashboardOid","includeDashboardFilters","filters","highlights","filtersMergeStrategy","drilldownOptions","styleOptions"]),{dashboard:d,isLoading:h,error:u}=z8({dashboardOid:r,includeWidgets:!0,includeFilters:n});if(u)throw new ft("errors.widgetLoadFailed",{error:u.message});if(d&&!d.widgets.some(B=>B.oid===t))throw new ft("errors.widgetWithOidNotFoundInDashboard",{widgetOid:t,dashboardOid:r});const g=ce.useMemo(()=>{if(d)return Kd(sZt(t),lZt)(d)},[d,t]),f=ce.useMemo(()=>g?vE(g):void 0,[g]),{dashboard:p}=LP(f||{widgets:[]}),{themeSettings:x}=_z(f?p:{}),S=p==null?void 0:p.widgets.find(B=>B.id===t),j=ce.useMemo(()=>{if(S)return Kd(cZt(i,a),uZt(o,a),dZt(s),hZt(l),pZt(c))(S)},[S,i,a,o,s,l,c]);return pe(lf,{theme:x,children:pe(Qu,{isVisible:h,children:j&&pe(yw,ue({},j))})})});function sZt(e){return t=>{const r=t.widgets.find(n=>n.oid===e);return r?xe(ue({},t),{widgets:[r],widgetsOptions:{[r.oid]:t.widgetsOptions[r.oid]}}):t}}function lZt(e){const t=Object.entries(e.widgetsOptions).map(([r,n])=>[r,xe(ue({},n),{filtersOptions:xe(ue({},n.filtersOptions),{shouldAffectFilters:!1})})]);return xe(ue({},e),{widgetsOptions:Object.fromEntries(t)})}function cZt(e,t){return r=>{if(!e||!("filters"in r))return r;const n=mE(r.filters||[],e,t);return xe(ue({},r),{filters:n})}}function uZt(e,t){return r=>{if(!e||!("highlights"in r))return r;const n=k_(mE(r.highlights,e,t));return xe(ue({},r),{highlights:n})}}function dZt(e){return t=>!e||!("drilldownOptions"in t)?t:xe(ue({},t),{drilldownOptions:ue(ue({},t.drilldownOptions),e)})}function hZt(e){return t=>!e||!("styleOptions"in t)?t:xe(ue({},t),{styleOptions:ue(ue({},t.styleOptions),e)})}function pZt(e){return t=>{const r=oZt(e,xh);return ue(ue({},t),r)}}const fZt=Cr({componentName:"ExecuteQuery"})(({dataSource:e,dimensions:t,measures:r,filters:n,highlights:i,count:o,offset:a,ungroup:s,children:l,onDataChanged:c,onBeforeQuery:d})=>{const h=_E({dataSource:e,dimensions:t,measures:r,filters:n,highlights:i,count:o,offset:a,ungroup:s,onBeforeQuery:d}),u=h.data,g=hl(u);return u&&g!==u&&(c==null||c(u)),pe(Kt,{children:h&&(l==null?void 0:l(h))})});function x0e(e,t){return Ya(e,t)}const gZt=Xi("useExecuteCsvQuery")(w0e);function w0e(e){const t=lfe(e),r=nd(e,t),[n,i]=ce.useReducer(x0e,{isLoading:!0,isError:!1,isSuccess:!1,status:"loading",error:void 0,data:void 0}),{isInitialized:o,app:a}=hr();return ce.useEffect(()=>{if(o||i({type:"error",error:new ft("errors.executeQueryNoSisenseContext")}),r(a)){i({type:"loading"});const{dataSource:s,dimensions:l,measures:c,filters:d,highlights:h,count:u,offset:g,config:f,onBeforeQuery:p}=e,{filters:x,relations:S}=is(d);eXe({dataSource:s,dimensions:l,measures:c,filters:x,filterRelations:S,highlights:h,count:u,offset:g},a,{onBeforeQuery:p}).then(j=>f!=null&&f.asDataStream?(i({type:"success",data:j}),null):j.text()).then(j=>j&&i({type:"success",data:j})).catch(j=>{i({type:"error",error:j})})}},[a,o,e,r]),n.data&&t?x0e(n,{type:"loading"}):n}function mZt(e,t){const{filters:r,highlights:n}=C0e(e,t),i=Mpe(t.metadata.panels);return{filters:Ui(r,i),highlights:n}}function C0e(e,t){const r=t.metadata.ignore,{filters:n,highlights:i}=bZt(vZt(e.filters||[],r),yZt(e.filters||[]),t);return{filters:n.map(o=>lp(o.jaql,o.instanceid)),highlights:i.map(o=>lp(o.jaql))}}function _0e(e){const t=[];for(const r of e)if(r.isCascading){const n=r,{disabled:i}=n,o=n.levels.map(a=>({jaql:a,disabled:i}));t.push(...o)}else t.push(r);return t}function vZt(e,t){return _0e(e).filter(({instanceid:r="",disabled:n})=>!(t!=null&&t.all)&&!n&&!(t!=null&&t.ids.includes(r))).map(({jaql:r,instanceid:n})=>{const{filter:i,turnOffMembersFilter:o}=V8(r);return{instanceid:n,jaql:xe(ue({},r),{filter:ue(ue({},i),o&&{filter:o})})}})}function yZt(e){const t=[];return _0e(e).forEach(({jaql:r})=>{const{backgroundFilter:n}=V8(r);n&&t.push({jaql:ue(xe(ue({},r),{filter:n}),r.datatype==="datetime"&&{level:n.level})})}),t}function bZt(e,t,r){var a;const n=((a=r.options)==null?void 0:a.dashboardFiltersMode)===_Ft.SELECT;let i=[];const o=[];return e.forEach(s=>{n&&xZt(s,r)?o.push(s):i.push(s)}),i=[...i,...t],{filters:i,highlights:o}}function xZt(e,t){return wZt(t).includes(e.jaql.dim)&&!e.jaql.filter.all}function wZt(e){const t=CZt(e.type),r=[];for(const n of t){const o=Gi(e.metadata.panels,n).map(a=>a.jaql.dim);r.push(...o)}return r}function CZt(e){switch(e){case"chart/line":case"chart/area":return["x-axis"];case"chart/bar":case"chart/column":case"chart/polar":case"chart/pie":case"treemap":return["categories"];case"chart/scatter":return["x-axis","y-axis","point"];case"chart/boxplot":return["category"];case"map/scatter":return["geo"];case"pivot2":return["rows","columns"];default:return[]}}function S0e(e){const{filters:t}=e,{filters:r,relations:n}=is(t);return xe(ue({},e),{filters:r||[],filterRelations:n})}const _Zt=Xi("useExecuteQueryByWidgetId")(k0e);function k0e(e){const t=kZt(e),r=nd(e,t),{isInitialized:n,app:i}=hr(),o=ce.useRef(void 0),a=ce.useRef(void 0),[s,l]=ce.useReducer(wE,{isLoading:!0,isError:!1,isSuccess:!1,status:"loading",error:void 0,data:void 0});return ce.useEffect(()=>{if(n||l({type:"error",error:new ft("errors.executeQueryNoSisenseContext")}),r(i)){const{widgetOid:c,dashboardOid:d,filters:h,highlights:u,filtersMergeStrategy:g,count:f,offset:p,includeDashboardFilters:x,onBeforeQuery:S}=e;l({type:"loading"}),M0e({widgetOid:c,dashboardOid:d,filters:h,highlights:u,filtersMergeStrategy:g,app:i,count:f,offset:p,includeDashboardFilters:x,onBeforeQuery:S}).then(({data:j,query:U,pivotQuery:B})=>{o.current=U,a.current=B,l({type:"success",data:j})}).catch(j=>{l({type:"error",error:j})})}},[e,i,n,r]),xe(ue({},s),{query:o.current,pivotQuery:a.current})}const SZt=["widgetOid","dashboardOid","count","offset","filtersMergeStrategy","includeDashboardFilters","onBeforeQuery"];function kZt(e){return Ga(e,SZt,(t,r)=>{const n=If(r.filters,t.filters),i=If(r.highlights,t.highlights);return n||i})}function M0e(d){return Jt(this,arguments,function*({widgetOid:e,dashboardOid:t,filters:r,highlights:n,filtersMergeStrategy:i,count:o,offset:a,includeDashboardFilters:s,app:l,onBeforeQuery:c}){const h=new cf(l.httpClient),{widget:u,dashboard:g}=yield Uhe({widgetOid:e,dashboardOid:t,includeDashboard:s,api:h});if(!u)throw new ft("errors.widgetWithOidNotFound",{widgetOid:e});const f=dw(u),p=(x,S)=>{var T;const{dataSource:j,filters:U,highlights:B}=x,{filters:R}=is(U);let E=R,N=B;if(s&&g){const{filters:C,highlights:y}=C0e(g,u);E=Ui(C,R),N=Ui(y,B)}E=mE(E,r,i),N=mE(N,n,i);const M=(T=g==null?void 0:g.filterRelations)!=null&&T.length?Fke(g.filterRelations[0].filterRelations):void 0,$={dataSource:j,filters:E,filterRelations:M,highlights:N,count:o,offset:a};if(S){const{rows:C,columns:y,values:D,grandTotals:k}=x;return xe(ue({},$),{rows:C,columns:y,values:D,grandTotals:k})}else{const{dimensions:C,measures:y}=x;return xe(ue({},$),{dimensions:C,measures:y})}};if(Qd(f.widgetType)){const x=Ape(f),S=p(x,!0),j=S0e(S);return{data:(yield U4(j,l,{onBeforeQuery:c})).table,query:void 0,pivotQuery:S}}else{const x=Tpe(f),S=p(x,!1),j=S0e(S);return{data:yield Ic(j,l,{onBeforeQuery:c}),query:S,pivotQuery:void 0}}})}const MZt=Cr({componentName:"ExecuteQueryByWidgetId"})(({widgetOid:e,dashboardOid:t,children:r,onDataChanged:n,filters:i,highlights:o,count:a,offset:s,filtersMergeStrategy:l,onBeforeQuery:c,includeDashboardFilters:d})=>{const h=k0e({widgetOid:e,dashboardOid:t,filters:i,highlights:o,count:a,offset:s,filtersMergeStrategy:l,onBeforeQuery:c,includeDashboardFilters:d}),{data:u,query:g}=h,[f,p]=ce.useState(u);return f!==u&&(p(u),u&&g&&(n==null||n(u,g))),pe(Kt,{children:h&&(r==null?void 0:r(h))})});function TZt(){const e=hr().app;return e==null?void 0:e.queryCache}const AZt=new P3({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnMount:!1}}}),T0e=({children:e})=>pe(I3,{client:AZt,children:e}),EZt=({defaultDataSource:e,url:t,token:r,wat:n,ssoEnabled:i,children:o,appConfig:a,showRuntimeErrors:s=!0,enableSilentPreAuth:l=!1,useFusionAuth:c=!1,onError:d})=>{var j,U,B;const h={enabled:(U=(j=a==null?void 0:a.trackingConfig)==null?void 0:j.enabled)!=null?U:!0,onTrackingEvent:(B=a==null?void 0:a.trackingConfig)==null?void 0:B.onTrackingEvent,packageName:"sdk-ui"},[u,g]=ce.useState(),[f,p]=ce.useState();ce.useEffect(()=>{let R=!1;if(VYt(r,n)){console.debug("Waiting for the auth token to be set");return}return u0e({defaultDataSource:e,url:t,token:r,wat:n,ssoEnabled:i,appConfig:a,enableSilentPreAuth:l,useFusionAuth:c}).then(E=>{R||g(E)}).catch(E=>{d==null||d(E),console.error(E),p(E)}),()=>{R=!0}},[e,t,r,n,i,a,l,c,d]);const x=(u==null?void 0:u.settings.translationConfig.language)||(u==null?void 0:u.settings.serverLanguage),S=u==null?void 0:u.settings.translationConfig.customTranslations;return pe(v6,{children:pe(KM,{userLanguage:x,customTranslations:S,children:pe(qM,{showErrorBox:s,error:f,onError:d,isContainerComponent:!0,shouldRenderChildrenWithProvidedError:!!(f&&!s),children:pe(FC.Provider,{value:{isInitialized:!0,app:u,tracking:h,errorBoundary:{showErrorBox:s,onError:d}},children:pe(lf,{skipTracking:!0,theme:u==null?void 0:u.settings.serverThemeSettings,children:pe(T0e,{children:pe(VBt,{children:pe(FT,{children:o})})})})})})})})},PZt=Cr({componentName:"DrilldownWidget",trackingConfig:{transparent:!0},shouldSkipSisenseContextWaiting:!0,shouldHaveOwnMenuRoot:!0})(e=>{var F;const{t}=At(),{drilldownPaths:r=[],initialDimension:n,drilldownSelections:i,config:o,onChange:a,children:s}=e,{openMenu:l}=aw(),[c,d]=ce.useState([]),[h,u]=ce.useState(null),g=Ga(h),f=o==null?void 0:o.contextMenuComponent,p=(F=o==null?void 0:o.breadcrumbsComponent)!=null?F:O8,x=ce.useCallback(V=>a==null?void 0:a({drilldownSelections:V}),[a]),{selectDrilldown:S,sliceDrilldownSelections:j,clearDrilldownSelections:U,availableDrilldownPaths:B,drilldownFilters:R,drilldownFiltersDisplayValues:E,drilldownDimension:N}=The({drilldownPaths:r,initialDimension:n,drilldownSelections:i,onDrilldownSelectionsChange:x}),M=ce.useMemo(()=>N&&pe(p,{filtersDisplayValues:E,currentDimension:N,clearDrilldownSelections:U,sliceDrilldownSelections:j}),[p,U,N,E,j]),$=ce.useCallback(V=>{u(V)},[]),T=ce.useCallback(()=>{d([]),u(null)},[d]),C=ce.useCallback((V,q)=>{S(c,V,q)},[S,c]),y=ce.useCallback(V=>{d(V)},[d]),D=ce.useMemo(()=>[j8(c,N),B8(B,N,C,t)],[N,B,c,C,t]);ce.useEffect(()=>{h&&g&&!f&&l({position:h,itemSections:D})},[h,g,D,l,f]);const k=ce.useMemo(()=>s({drilldownFilters:R,drilldownDimension:N,onDataPointsSelected:y,onContextMenu:$,breadcrumbsComponent:o!=null&&o.isBreadcrumbsDetached?M:void 0}),[s,R,N,y,$,o,M]);return Ve("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[f&&pe(f,{position:h,itemSections:D,closeContextMenu:T}),N&&!(o!=null&&o.isBreadcrumbsDetached)&&M,pe("div",{style:{flexGrow:1,minWidth:0,minHeight:0},children:k})]})});function DZt(e){return LZt(e.dataSet)}function LZt(e){return!!e&&typeof e!="string"&&"rows"in e&&"columns"in e}const A0e=Cr({componentName:"Table",shouldSkipSisenseContextWaiting:DZt})(e=>pe(bhe,ue({},e))),OZt=Cr({componentName:"TableWidget"})(e=>{var h;const[t,r]=ce.useState(0),{app:n}=hr(),{styleOptions:i,dataSource:o=n==null?void 0:n.defaultDataSource,dataOptions:a}=e,s=fA("table",{hasHeader:!((h=i==null?void 0:i.header)!=null&&h.hidden)}),u=e.styleOptions||{},{width:l,height:c}=u,d=ut(u,["width","height"]);return a?pe(wf,{defaultSize:s,size:{width:l,height:c},children:pe(hE,xe(ue({},e),{dataSetName:o&&gc(o),onRefresh:()=>r(t+1),children:pe(A0e,{dataSet:e.dataSource,dataOptions:e.dataOptions,styleOptions:d,filters:e.filters,refreshCounter:t})}))}):null}),IZt=Cr({componentName:"LineChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"line"}))),NZt=Cr({componentName:"ColumnChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"column"}))),RZt=Cr({componentName:"AreaChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"area"}))),FZt=Cr({componentName:"PieChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"pie"}))),jZt=Cr({componentName:"BarChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"bar"}))),BZt=Cr({componentName:"FunnelChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"funnel"}))),zZt=Cr({componentName:"PolarChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"polar"}))),$Zt=Cr({componentName:"ScatterChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"scatter"}))),WZt=Cr({componentName:"IndicatorChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"indicator"}))),HZt=Cr({componentName:"TreemapChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"treemap"}))),UZt=Cr({componentName:"SunburstChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"sunburst"}))),GZt=Cr({componentName:"BoxplotChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"boxplot"}))),VZt=Cr({componentName:"ScattermapChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"scattermap"}))),YZt=Cr({componentName:"AreamapChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"areamap"}))),qZt=Cr({componentName:"AreaRangeChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"arearange"}))),ZZt=({context:e,error:t,children:r})=>{var o,a,s,l;if(!e)return pe(v6,{children:pe(qM,{showErrorBox:!1,error:t,children:pe(KM,{children:pe(lf,{children:r})})})});const n=((o=e==null?void 0:e.app)==null?void 0:o.settings.translationConfig.language)||((a=e==null?void 0:e.app)==null?void 0:a.settings.serverLanguage),i=(s=e.app)==null?void 0:s.settings.translationConfig.customTranslations;return pe(v6,{children:pe(KM,{userLanguage:n,customTranslations:i,children:pe(qM,{showErrorBox:e==null?void 0:e.errorBoundary.showErrorBox,error:t,children:e&&pe(FC.Provider,{value:e,children:pe(lf,{skipTracking:!0,theme:(l=e.app)==null?void 0:l.settings.serverThemeSettings,children:pe(T0e,{children:pe(FT,{children:r})})})})})})})},XZt=Cr({componentName:"CustomThemeProvider",trackingConfig:{skip:e=>{var t;return!!((t=e.context)!=null&&t.skipTracking)},transparent:!0},shouldSkipSisenseContextWaiting:!0})(e=>{const{context:t,error:r,children:n}=e;if(r)throw r;const{themeSettings:i}=t;return pe(Kt,{children:i&&pe(g6.Provider,{value:{themeSettings:i},children:n})})}),Mv=(e,t)=>xe(ue({},e),{filters:t}),KZt=Object.freeze(Object.defineProperty({__proto__:null,addFilter:(e,t)=>Mv(e,jke(t)(e.filters)),addFilters:(e,t)=>Mv(e,Bke(t)(e.filters)),removeFilter:(e,t)=>Mv(e,zke(t)(e.filters)),removeFilters:(e,t)=>Mv(e,$ke(t)(e.filters)),replaceFilter:(e,t,r)=>Mv(e,Wke(t,r)(e.filters)),replaceFilters:Mv},Symbol.toStringTag,{value:"Module"})),QZt=e=>{var t;return((t=e==null?void 0:e.chart)==null?void 0:t.type)!==void 0},JZt=e=>(e==null?void 0:e.value)!==void 0&&(e==null?void 0:e.secondary)!==void 0;function E0e(e,t){return Jt(this,null,function*(){try{const r=yield t.httpClient.get(`api/v1/formulas/${e}?flat=true`,void 0,{skipTrackingParam:!0});return r?My(r):null}catch(r){throw new ft("errors.sharedFormula.failedToFetch")}})}function P0e(e,t,r){return Jt(this,null,function*(){try{const n=yield r.httpClient.get(`api/v1/formulas?datasource=${gc(t)}&flat=true`,void 0,{skipTrackingParam:!0}),i=n==null?void 0:n.find(o=>o.title===e);return i?My(i):null}catch(n){throw new ft("errors.sharedFormula.failedToFetch")}})}const eXt=Xi("useGetSharedFormula")(D0e);function D0e(e){const{name:t,dataSource:r,oid:n}=e;if(!(n||t&&r))throw new ft("errors.sharedFormula.identifierExpected");const i=Ga(e,["oid","name","dataSource"]),o=nd(e,i),[a,s]=ce.useReducer(Ya,{isLoading:!0,isError:!1,isSuccess:!1,status:"loading",error:void 0,data:void 0}),{isInitialized:l,app:c}=hr();return ce.useEffect(()=>{if(l||s({type:"error",error:new ft("errors.sisenseContextNotFound")}),o(c)){s({type:"loading"});let d=Promise.resolve(null);n?d=E0e(n,c):t&&r&&(d=P0e(t,r,c)),d.then(h=>{s({type:"success",data:h})}).catch(h=>{s({type:"error",error:h})})}},[c,l,t,r,n,o]),a.data&&i?Sz(Ya(a,{type:"loading"})):Sz(a)}function Sz(e){const n=e,{data:t}=n,r=ut(n,["data"]);return xe(ue({},r),{formula:t})}const tXt=Xi("useFetch")((e,t,r)=>{var a;const{app:n}=hr(),i=n==null?void 0:n.httpClient,o=(a=r==null?void 0:r.enabled)!=null?a:!0;return _d({queryKey:["fetch",e,t,r==null?void 0:r.requestConfig],queryFn:()=>Jt(this,null,function*(){if(!i)throw new ft("errors.httpClientNotFound");return i.call(i.url+e,t!=null?t:{},xe(ue({},r==null?void 0:r.requestConfig),{skipTrackingParam:!0}))}),enabled:o&&!!i})}),rXt=({dimensions:e,collapseAll:t})=>{const[r,n]=ce.useState(""),[i,o]=ce.useState(!!t),{themeSettings:a}=pt(),s=ce.useMemo(()=>{const l=(c,d)=>c.toLowerCase().includes(d.toLowerCase());return r&&r.trim()!==""?e.map(c=>{if(l(c.name,r))return c;const d=c.attributes.filter(u=>l(u.name,r)),h=c.dimensions.filter(u=>l(u.name,r));return new Td(c.name,c.expression,d,h,c.type,c.description,void 0,c==null?void 0:c.dataSource)}).filter(({name:c,attributes:d,dimensions:h})=>d.length>0||h.length>0||l(c,r)):e},[e,r]);return Ve(Eme,{theme:a,children:[pe(Ame,{onChange:l=>{n(l),l.trim()!==""&&o(!1)}}),pe(kme,{dimensions:s!=null?s:[],collapseAll:i})]})},nXt=Ye(Qf,{target:"e3etd9l0",label:"CountInput"})("width:64px;margin-right:8px;background-color:",({theme:e})=>e.general.popover.input.backgroundColor,";color:",({theme:e})=>e.general.popover.input.textColor,";"),iXt=Ye(gd,{target:"e3etd9l1",label:"GranularitySelect"})("width:112px;margin-right:8px;"),oXt=Ye(gd,{target:"e3etd9l2",label:"PositionSelect"})("width:112px;margin-right:8px;"),aXt=[{value:"before",displayValue:"filterEditor.datetimePositions.before"},{value:"after",displayValue:"filterEditor.datetimePositions.after"}];function sXt(e,t){const{config:r}=e,{position:n,count:i,baseDate:o,attribute:a}=t;if(!o)return null;switch(n){case"before":return Cy(a,0,i,o,r);case"after":return FD(a,0,i,o,r)}}function lXt(e,t){const r={count:1,position:"before",baseDate:void 0,attribute:qh(e.attribute,Ze.Years,t)};return Ume(e)?xe(ue({},r),{count:e.count,position:e.operator===zs.Last?"before":"after",baseDate:new Date(e.anchor),attribute:e.attribute}):r}const cXt=({filter:e,limits:t,onChange:r})=>{const{themeSettings:n}=pt(),{t:i}=At(),o=lXt(e,i),[a,s]=ce.useState(o.count),[l,c]=ce.useState(o.position),[d,h]=ce.useState(o.baseDate),[u,g]=ce.useState(o.attribute),f=ce.useMemo(()=>yz.map(E=>xe(ue({},E),{displayValue:i(E.displayValue)})),[i]),p=ce.useMemo(()=>aXt.map(E=>xe(ue({},E),{displayValue:i(E.displayValue)})),[i]),x=ce.useCallback(E=>{const N=sXt(e,E);r(N)},[e,r]),S=ce.useCallback(E=>{const M=E.target.value;let $=a;M===""?$=1:/^\d+$/.test(M)&&($=parseInt(M)||1),s($),x({count:$,position:l,baseDate:d,attribute:u})},[a,l,d,u,x]),j=ce.useCallback(E=>{const N=qh(u,E,i);g(N),x({count:a,position:l,baseDate:d,attribute:N})},[a,l,d,u,x,i]),U=ce.useCallback(E=>{c(E),x({count:a,position:E,baseDate:d,attribute:u})},[a,d,u,x]),B=ce.useCallback(E=>{h(E),x({count:a,position:l,baseDate:E,attribute:u})},[a,l,u,x]),R=ce.useMemo(()=>t?{minDate:t.minDate?new Date(t.minDate):void 0,maxDate:t.maxDate?new Date(t.maxDate):void 0}:void 0,[t]);return Ve(Kt,{children:[pe(nXt,{theme:n,type:"number",value:a,onChange:S}),pe(iXt,{value:u.granularity,items:f,onChange:j,"aria-label":"Granularity select"}),pe(oXt,{value:l,items:p,onChange:U,"aria-label":"Position select"}),pe(Ww,{width:152,type:Ni.SINGLE_SELECT,value:d,limits:R,onChange:B,placeholder:i("filterEditor.placeholders.select")})]})},uXt=Ye(gd,{target:"e1sgsfrt0",label:"ConditionSelect"})("width:128px;margin-right:8px;"),dXt=[{value:"exclude",displayValue:"filterEditor.conditions.exclude"}],hXt=[{value:"exclude",displayValue:"filterEditor.conditions.exclude"},{value:"isWithin",displayValue:"filterEditor.conditions.isWithin"}];function pXt(e){const t={condition:"exclude",editedFilter:null};return eg(e)?xe(ue({},t),{condition:"exclude",editedFilter:e}):Ume(e)?xe(ue({},t),{condition:"isWithin",editedFilter:e}):t}const fXt=({filter:e,selected:t,multiSelectEnabled:r,limits:n,onChange:i})=>{const{t:o}=At(),{membersOnlyMode:a}=md(),s=pXt(e),[l,c]=ce.useState(s.condition),[d,h]=ce.useState(s.editedFilter),u=a?dXt:hXt,g=ce.useMemo(()=>u.map(S=>xe(ue({},S),{displayValue:o(S.displayValue)})),[o,u]),f=ce.useCallback(()=>{i(d)},[d,i]),p=ce.useCallback(S=>{c(S),i(d)},[d,i]),x=ce.useCallback(S=>{h(S),i(S)},[i]);return Ve(du,{selected:t,onSelect:f,"aria-label":"Datetime condition section",children:[pe(uXt,{value:l,items:g,onChange:p,"aria-label":"Condition select"}),l==="exclude"&&pe(zYt,{filter:e,multiSelectEnabled:r,limits:n,onChange:x}),l==="isWithin"&&pe(cXt,{filter:e,limits:n,onChange:x})]})},gXt=Ye(kE,{target:"eramdst0",label:"IncludeCurrentCheckbox"})("margin-top:0;margin-bottom:0;input{width:13px;height:13px;}span{border-left:none;padding-left:0;}"),mXt=Ye(gd,{target:"eramdst1",label:"TypeSelect"})("width:88px;margin-right:8px;"),vXt=Ye(Qf,{target:"eramdst2",label:"CountInput"})("width:64px;margin-right:8px;background-color:",({theme:e})=>e.general.popover.input.backgroundColor,";color:",({theme:e})=>e.general.popover.input.textColor,";"),yXt=Ye(gd,{target:"eramdst3",label:"GranularitySelect"})("width:112px;margin-right:8px;"),bXt=[{value:"last",displayValue:"filterEditor.relativeTypes.last"},{value:"this",displayValue:"filterEditor.relativeTypes.this"},{value:"next",displayValue:"filterEditor.relativeTypes.next"}];function xXt(e,t){if(!Gme(e))return{type:"last",attribute:qh(e.attribute,Ze.Months,t),count:1,includeCurrent:!1};const r=e.operator===zs.Last&&e.count===1&&e.offset===0,n=e.offset===0&&!r;return{type:r?"this":e.operator,attribute:e.attribute,count:e.count,includeCurrent:n}}function wXt(e,t){const{type:r,attribute:n,count:i,includeCurrent:o}=e,a=o?0:1;switch(r){case"last":return Cy(n,a,i,void 0,t);case"this":return Cy(n,0,1,void 0,t);case"next":return i2e(n,a,i,void 0,t)}}const CXt=e=>{const{themeSettings:t}=pt(),{filter:r,selected:n,onChange:i}=e,{t:o}=At(),a=xXt(r,o),[s,l]=ce.useState(a.attribute),[c,d]=ce.useState(a.type),[h,u]=ce.useState(a.count),[g,f]=ce.useState(a.includeCurrent),p=ce.useMemo(()=>yz.map(N=>({value:N.value,displayValue:o(N.displayValue)})),[o]),x=ce.useMemo(()=>bXt.map(N=>({value:N.value,displayValue:o(N.displayValue)})),[o]),S=ce.useCallback(N=>{const M=wXt(N,r.config);i(M)},[r,i]),j=ce.useCallback(()=>{S({type:c,count:h,includeCurrent:g,attribute:s})},[c,h,g,s,S]),U=ce.useCallback(N=>{d(N),S({type:N,count:h,includeCurrent:g,attribute:s})},[h,g,s,S]),B=ce.useCallback(N=>{const M=qh(s,N,o);l(M),S({type:c,count:h,includeCurrent:g,attribute:M})},[c,h,g,s,S,o]),R=ce.useCallback(N=>{const $=N.target.value;let T=h;$===""?T=1:/^\d+$/.test($)&&(T=parseInt($)||1),u(T),S({type:c,count:T,includeCurrent:g,attribute:s})},[c,h,g,s,S]),E=ce.useCallback(()=>{const N=!g;f(N),S({type:c,count:h,includeCurrent:N,attribute:s})},[c,h,g,s,S]);return pe(du,{selected:n,onSelect:j,"aria-label":"Datetime relative section",children:()=>Ve(Kt,{children:[pe(mXt,{value:c,items:x,onChange:U,"aria-label":"Type"}),c!=="this"&&pe(vXt,{theme:t,type:"number",value:h,onChange:R,"aria-label":"Count"}),pe(yXt,{value:s.granularity,items:p,onChange:B,primaryBackgroundColor:t.filter.panel.backgroundColor,primaryColor:t.typography.primaryTextColor,"aria-label":"Granularity"}),c!=="this"&&pe(gXt,{label:"Including current",checked:g,onChange:E})]})})},_Xt=e=>e?Yh(e)?pz(e)?"all":Jf(e)?"members":Gme(e)?"relative":Tg(e)?"range":"condition":"not-supported":null,SXt=({filter:e,onChange:t,showMultiselectToggle:r=!0})=>{const{themeSettings:n}=pt(),{defaultDataSource:i,parentFilters:o,membersOnlyMode:a}=md(),[s,l]=ce.useState(e!=null?e:null),[c,d]=ce.useState(_Xt(s)),[h,u]=ce.useState("enableMultiSelection"in e.config?e.config.enableMultiSelection:!0),{data:g}=Jme(ue({attribute:ce.useMemo(()=>e.attribute.setGranularity(Ze.Days),[e]),filters:o,enabled:!!e},i&&{defaultDataSource:i})),f=ce.useMemo(()=>({maxDate:g==null?void 0:g.max,minDate:g==null?void 0:g.min}),[g]);ce.useEffect(()=>{t==null||t(s)},[s,t]);const p=ce.useCallback(B=>{l(B),d("all")},[]),x=ce.useCallback(B=>{l(B),d("members")},[]),S=ce.useCallback(B=>{l(B),d("relative")},[]),j=ce.useCallback(B=>{l(B),d("range")},[]),U=ce.useCallback(B=>{l(B),d("condition")},[]);return Ve(gz,{theme:n,"aria-label":"Filter editor datetime",children:[!Yh(e)&&pe(mz,{selected:c==="not-supported"}),Ve(CP,{direction:"row",spacing:2,sx:{justifyContent:"space-between",alignItems:"center",marginBottom:"42px"},children:[pe(lz,{filter:e,selected:c==="all",onChange:p}),r&&pe(fz,{enabled:h,onChange:u})]}),pe(RYt,{filter:e,selected:c==="members",multiSelectEnabled:h,limits:f,onChange:x}),!a&&Ve(Kt,{children:[pe(CXt,{filter:e,selected:c==="relative",onChange:S}),pe(FYt,{filter:e,selected:c==="range",limits:f,onChange:j})]}),pe(fXt,{filter:e,selected:c==="condition",multiSelectEnabled:h,limits:f,onChange:U})]})},kXt=({filter:e,parentFilters:t,config:r,onChange:n,defaultDataSource:i})=>{var s,l;const o=(s=r==null?void 0:r.multiSelect)==null?void 0:s.visible,a=ce.useMemo(()=>t!=null?t:[],[t]);return Ve(oYt,{value:{defaultDataSource:i!=null?i:null,parentFilters:a,membersOnlyMode:(l=r==null?void 0:r.membersOnlyMode)!=null?l:!1},children:[Sy(e.attribute.type)&&pe(xYt,{filter:e,onChange:n,showMultiselectToggle:o}),qn(e.attribute.type)&&pe(PYt,{filter:e,onChange:n,showMultiselectToggle:o}),mo(e.attribute.type)&&pe(SXt,{filter:e,onChange:n,showMultiselectToggle:o})]})},MXt=Ye("div",{target:"eyykaaj0",label:"ModalHeader"})("background-color:",({theme:e})=>e.general.popover.header.backgroundColor,";color:",({theme:e})=>e.general.popover.header.textColor,";display:flex;height:42px;align-items:center;border-radius:4px;padding:12px;box-sizing:border-box;"),TXt=Ye("span",{target:"eyykaaj1",label:"ModalHeaderTitle"})("height:24px;font-size:15px;font-weight:700;padding-left:16px;line-height:24px;color:inherit;"),AXt=Ye("span",{target:"eyykaaj2",label:"ModalHeaderInfo"})("display:flex;align-items:center;font-size:13px;box-sizing:border-box;color:inherit;column-gap:5px;background-color:",({theme:e})=>e.general.popover.header.backgroundColor,";"),EXt=Ye("span",{target:"eyykaaj3",label:"ModalHeaderVerticalDivider"})("display:inline-block;width:1px;height:24px;background:#3a4356;margin:0 16px;box-sizing:border-box;"),PXt=Ye("div",{target:"eyykaaj4",label:"ModalFooter"})("display:flex;height:61px;align-items:center;padding:12px;box-sizing:border-box;padding:0 16px;border-top:1px solid #e7e8ea;background-color:",({theme:e})=>e.general.popover.footer.backgroundColor,";color:",({theme:e})=>e.general.popover.footer.textColor,";"),DXt=Ye("div",{target:"eyykaaj5",label:"Container"})("background-color:",({theme:e})=>e.general.popover.content.backgroundColor,";border-radius:",({theme:e})=>e.general.popover.cornerRadius,";box-shadow:",({theme:e})=>e.general.popover.shadow,";color:",({theme:e})=>e.general.popover.content.textColor,";font-family:",({theme:e})=>e.typography.fontFamily,";width:700px;"),L0e=({filter:e,parentFilters:t,position:r,onChange:n,onClose:i,defaultDataSource:o,config:a})=>{var g;const{t:s}=At(),{themeSettings:l}=pt(),c=l.general.popover,[d,h]=ce.useState(e!=null?e:null),u=!!(e&&r);return u?pe(sf,{open:u,position:{anchorEl:r.anchorEl,anchorOrigin:{vertical:"top",horizontal:"left"},contentOrigin:{vertical:"top",horizontal:"right"}},onClose:i,"aria-label":"Filter editor popover",children:Ve(DXt,{theme:l,children:[Ve(MXt,{theme:l,children:[pe(TXt,{"data-testid":"filter-editor-popover-header-attribute",children:e==null?void 0:e.attribute.name}),pe(EXt,{}),Ve(AXt,{theme:l,children:[pe(Lzt,{"aria-label":"cube-icon",color:c.header.textColor}),pe("span",{"data-testid":"filter-editor-popover-header-datasource",children:(g=e==null?void 0:e.attribute.dataSource)==null?void 0:g.title})]})]}),pe(kXt,{filter:e,parentFilters:t,onChange:f=>h(f),defaultDataSource:o,config:a}),pe(PXt,{theme:l,children:Ve(CP,{direction:"row",spacing:"10px",sx:{width:"100%",justifyContent:"flex-end",alignItems:"center"},children:[pe(Fw,{onClick:()=>d&&(n==null?void 0:n(d)),disabled:!d,children:s("filterEditor.buttons.apply")}),pe(Fw,{type:"secondary",onClick:i,children:s("filterEditor.buttons.cancel")})]})})]})}):null},LXt=({dataSources:e,onFilterCreated:t,defaultDataSource:r,config:n,disabledAttributes:i})=>{const[o,a]=ce.useState(null),[s,l]=ce.useState(null),[c,d]=ce.useState(!1);return{NewFilterCreator:ce.useCallback(()=>n!=null&&n.enabled&&o?Ve(Kt,{children:[pe(CVt,{anchorEl:o,isOpen:c,dataSources:e,initialDataSource:e[0],disabledAttributes:i,onFilterCreated:h=>{l(h),d(!1)},onClose:()=>{d(!1),l(null)}}),pe(L0e,{filter:s,position:{anchorEl:o},onChange:h=>{t(h),l(null)},onClose:()=>{l(null)},config:n,defaultDataSource:r})]}):null,[n,o,c,e,i,s,r,t]),startFilterCreation:ce.useCallback(h=>{a(h),d(!0)},[])}};var OXt=4;function IXt(e){return wg(e,OXt)}const NXt=({config:e,defaultDataSource:t,onFilterChanged:r})=>{const[n,i]=ce.useState(null),[o,a]=ce.useState(null),[s,l]=ce.useState(null),c=ce.useMemo(()=>FXt(o,s),[o,s]),d=ce.useMemo(()=>o&&jXt(o)?xe(ue({},e),{membersOnlyMode:!0}):e,[e,o]),h=ce.useCallback(u=>{let g=u;o&&Qi(o)&&(g=jD(o.filters.map((f,p)=>p===s?u:go(f)&&p>s?Object.assign(IXt(f),{members:[]}):f),o==null?void 0:o.config)),r(g),l(null),a(null)},[o,s,r]);return{ExistingFilterEditor:ce.useCallback(()=>e!=null&&e.enabled&&n?pe(L0e,{filter:o&&Qi(o)&&s!==null?o.filters[s]:o,position:{anchorEl:n},parentFilters:c,onChange:h,onClose:()=>{a(null),i(null),l(null)},config:d,defaultDataSource:t}):null,[n,o,e,h,t,s,d,c]),startEditingFilter:ce.useCallback((u,g,f)=>{i(u),l(f!=null?f:null),a(g)},[])}};function RXt(e){return Sy(e.attribute.type)||qn(e.attribute.type)||mo(e.attribute.type)||Qi(e)}function FXt(e,t){const r=[];if(!e||Qi(e)&&t===null)return r;Qi(e)&&r.push(...e.filters.slice(0,t));const n=Qi(e)?e.filters[t]:e;return go(n)&&n.config.backgroundFilter&&r.push(n.config.backgroundFilter),r}function jXt(e){return Qi(e)||go(e)&&!!e.config.backgroundFilter}const BXt={actions:{addFilter:{enabled:!1,multiSelect:{visible:!0}},editFilter:{enabled:!1,multiSelect:{visible:!0}},deleteFilter:{enabled:!1}}},zXt=Ye("div",{target:"e1af82np0",label:"PanelWrapper"})("background-color:",({theme:e})=>e.filter.panel.backgroundColor,";font-family:",({theme:e})=>e.typography.fontFamily,";border:",({theme:e})=>Fh(e.filter.panel.borderColor,e.filter.panel.borderWidth),";width:fit-content;min-width:238px;max-height:100%;overflow:hidden;"),$Xt=Ye("div",{target:"e1af82np1",label:"PanelBody"})("background-color:transparent;max-height:calc(100% - ",hfe,"px);overflow-y:auto;"),WXt=Ye("div",{target:"e1af82np2",label:"PanelBodyInner"})("padding:0px 12px 12px;"),O0e=Cr({componentName:"FiltersPanel"})(({filters:e,onFiltersChange:t,defaultDataSource:r,dataSources:n,config:i})=>{var j,U,B,R;const o=ce.useRef(null),a=ce.useRef([]),{themeSettings:s}=pt(),{filters:l,relations:c}=Ll(e),d=tg(i,BXt),h=ce.useCallback(E=>{if(!l)return;const N=l.map($=>$.config.guid===E.config.guid?E:$),M=Ol(l,c,N);t(os(N,M))},[l,c,t]),u=ce.useCallback(E=>{if(!l)return;const N=Ui(l,[E]),M=Ol(l,c,N);t(os(N,M))},[l,c,t]),g=ce.useCallback(E=>{if(!l)return;const N=l.filter($=>$.config.guid!==E.config.guid),M=Ol(l,c,N);t(os(N,M))},[l,t,c]),{ExistingFilterEditor:f,startEditingFilter:p}=NXt({onFilterChanged:h,defaultDataSource:r,config:(j=d==null?void 0:d.actions)==null?void 0:j.editFilter}),{NewFilterCreator:x,startFilterCreation:S}=LXt({dataSources:n||(r?[r]:[]),onFilterCreated:u,defaultDataSource:r,config:(U=d==null?void 0:d.actions)==null?void 0:U.addFilter,disabledAttributes:l.flatMap(E=>Qi(E)?E.filters.map(N=>N.attribute):[E.attribute])});return Ve(zXt,{theme:s,ref:o,children:[pe(GUt,{onAddFilterButtonClick:ce.useCallback(()=>S(o.current),[S]),shouldShowAddFilterButton:(R=(B=d==null?void 0:d.actions)==null?void 0:B.addFilter)==null?void 0:R.enabled}),pe($Xt,{children:Ve(WXt,{children:[c&&pe(FUt,{relations:c,filters:l}),l==null?void 0:l.map((E,N)=>{var M,$,T,C;return pe("div",{className:"csdk-mt-[6px]",ref:y=>{a.current[N]=y},children:pe(vme,{onDelete:($=(M=d==null?void 0:d.actions)==null?void 0:M.deleteFilter)!=null&&$.enabled?()=>g(E):void 0,filter:E,onChange:y=>h(y),defaultDataSource:r,onEdit:(C=(T=d==null?void 0:d.actions)==null?void 0:T.editFilter)!=null&&C.enabled&&RXt(E)?y=>p(a.current[N],E,y):void 0},E.config.guid)},E.config.guid)}),pe(f,{}),pe(x,{})]})})]})}),HXt=Ye("div",{target:"e8sc0hf0",label:"ArrowWrapper"})("background-color:#b6b6b6;width:8px;height:40px;display:flex;justify-content:center;align-items:center;position:absolute;top:calc(50% - 20px);left:0;opacity:0.4;cursor:pointer;",({reversed:e})=>e?"transform: scaleX(-1);":""," &:before{content:'';position:absolute;left:8px;top:0;border-left-width:0;border-left-style:solid;border-left-color:#b6b6b6;transition:border-left-width 100ms ease;border-top:20px solid transparent;border-bottom:20px solid transparent;}svg{margin-left:1px;}&:hover{opacity:1;&:before{border-left-width:10px;}}"),UXt=Ye("div",{target:"e8sc0hf1",label:"Wrapper"})("position:relative;&:hover .arrow-wrapper{opacity:1;}"),GXt=Ye("div",{target:"e8sc0hf2",label:"ContentWrapper"})("width:",({collapsed:e})=>e?"8px":"auto",";overflow:hidden;height:100%;"),VXt=({collapsed:e=!1,onCollapsedChange:t,children:r})=>(ce.useEffect(()=>{window.dispatchEvent(new Event("resize"))},[e]),Ve(UXt,{children:[pe(HXt,{className:"arrow-wrapper",reversed:e,onClick:()=>t==null?void 0:t(!e),children:pe("svg",{fill:"#fff",height:"8px",width:"8px",viewBox:"0 0 330 330",children:pe("path",{d:"M250.606,154.389l-150-149.996c-5.857-5.858-15.355-5.858-21.213,0.001 c-5.857,5.858-5.857,15.355,0.001,21.213l139.393,139.39L79.393,304.394c-5.857,5.858-5.857,15.355,0.001,21.213 C82.322,328.536,86.161,330,90,330s7.678-1.464,10.607-4.394l149.999-150.004c2.814-2.813,4.394-6.628,4.394-10.606 C255,161.018,253.42,157.202,250.606,154.389z"})})}),pe(GXt,{collapsed:e,children:r})]})),I0e="csdk_dashboard_filters_panel_collapsed",YXt=(e=!1,t=!1)=>{const r=localStorage.getItem(I0e),n=r?r==="true":void 0,i=t&&n!=null?n:e,[o,a]=ce.useState(i),s=ce.useCallback(l=>{t&&localStorage.setItem(I0e,l?"true":"false"),a(l)},[t]);return[o,s]},OP=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";function Tv(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function kz(e){return"nodeType"in e}function qa(e){var t,r;return e?Tv(e)?e:kz(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Mz(e){const{Document:t}=qa(e);return e instanceof t}function Uw(e){return Tv(e)?!1:e instanceof qa(e).HTMLElement}function N0e(e){return e instanceof qa(e).SVGElement}function Av(e){return e?Tv(e)?e.document:kz(e)?Mz(e)?e:Uw(e)||N0e(e)?e.ownerDocument:document:document:document}const Xh=OP?ce.useLayoutEffect:ce.useEffect;function Tz(e){const t=ce.useRef(e);return Xh(()=>{t.current=e}),ce.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.current==null?void 0:t.current(...n)},[])}function qXt(){const e=ce.useRef(null),t=ce.useCallback((n,i)=>{e.current=setInterval(n,i)},[]),r=ce.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Gw(e,t){t===void 0&&(t=[e]);const r=ce.useRef(e);return Xh(()=>{r.current!==e&&(r.current=e)},t),r}function Vw(e,t){const r=ce.useRef();return ce.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function IP(e){const t=Tz(e),r=ce.useRef(null),n=ce.useCallback(i=>{i!==r.current&&(t==null||t(i,r.current)),r.current=i},[]);return[r,n]}function Az(e){const t=ce.useRef();return ce.useEffect(()=>{t.current=e},[e]),t.current}let Ez={};function NP(e,t){return ce.useMemo(()=>{if(t)return t;const r=Ez[e]==null?0:Ez[e]+1;return Ez[e]=r,e+"-"+r},[e,t])}function R0e(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.reduce((o,a)=>{const s=Object.entries(a);for(const[l,c]of s){const d=o[l];d!=null&&(o[l]=d+e*c)}return o},ue({},t))}}const Ev=R0e(1),RP=R0e(-1);function ZXt(e){return"clientX"in e&&"clientY"in e}function F0e(e){if(!e)return!1;const{KeyboardEvent:t}=qa(e.target);return t&&e instanceof t}function XXt(e){if(!e)return!1;const{TouchEvent:t}=qa(e.target);return t&&e instanceof t}function Pz(e){if(XXt(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return ZXt(e)?{x:e.clientX,y:e.clientY}:null}const Dz=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Dz.Translate.toString(e),Dz.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),j0e="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function KXt(e){return e.matches(j0e)?e:e.querySelector(j0e)}const QXt={display:"none"};function JXt(e){let{id:t,value:r}=e;return ce.createElement("div",{id:t,style:QXt},r)}function eKt(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ce.createElement("div",{id:t,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function tKt(){const[e,t]=ce.useState("");return{announce:ce.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const B0e=ce.createContext(null);function rKt(e){const t=ce.useContext(B0e);ce.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function nKt(){const[e]=ce.useState(()=>new Set),t=ce.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[ce.useCallback(n=>{let{type:i,event:o}=n;e.forEach(a=>{var s;return(s=a[i])==null?void 0:s.call(a,o)})},[e]),t]}const iKt={draggable:`
|
|
1549
|
+
`,({theme:e})=>ti(e.general.popover.input.borderColor,kn.FOCUS),";}&::placeholder{color:inherit;opacity:0.5;}");function Qf(e){const{themeSettings:t}=pt(),s=e,{error:r,wrapperStyle:n,inputRef:i}=s,o=ut(s,["error","wrapperStyle","inputRef"]),a=ce.useRef(null);return ce.useEffect(()=>{a.current&&(i==null||i(a.current))},[i]),Ve(WVt,{style:n,children:[pe(UVt,xe(ue({theme:t,ref:a},o),{style:ue(ue(ue({},o.style),r&&{borderColor:Zte}),o.type==="number"&&{paddingRight:"0"})})),r&&pe(HVt,{children:r})]})}const GVt=e=>{var d;const c=e,{placeholder:t,onChange:r,value:n,inputRef:i,inputStyle:o,style:a,className:s}=c,l=ut(c,["placeholder","onChange","value","inputRef","inputStyle","style","className"]);return Ve("div",{className:s,style:a,children:[pe("span",{style:{position:"absolute",top:"3px",left:"6px",zIndex:2},children:pe(gfe,{"aria-label":"search-icon",color:(d=a==null?void 0:a.color)!=null?d:"#5B6372",opacity:"40%"})}),pe(Qf,ue({inputRef:i,placeholder:t,onChange:r,value:n,wrapperStyle:{width:"100%"},style:ue({paddingLeft:"28px",paddingRight:"16px",width:"100%"},o)},l))]})},_P=Ye("div",{target:"e1f8s22f0",label:"SelectField"})("width:100%;box-sizing:border-box;display:inline-flex;flex-direction:row;align-items:center;cursor:pointer;background:",({theme:e})=>e.general.popover.input.backgroundColor,";color:",({theme:e})=>e.general.popover.input.textColor,";height:28px;border-radius:4px;padding-left:12px;border:1px solid ",({focus:e})=>e?no:"transparent",";border-radius:",({theme:e})=>e.general.popover.input.cornerRadius,";"),Ome=Ye("div",{target:"e1f8s22f1",label:"SelectItemContainer"})("box-sizing:border-box;display:flex;flex-direction:row;align-items:center;cursor:pointer;height:28px;padding-left:14px;padding-right:14px;color:",({theme:e})=>ti(e.general.popover.input.dropdownList.item.textColor,kn.DEFAULT),";transition:color 0.2s ease;background-color:",({theme:e})=>ti(e.general.popover.input.dropdownList.item.backgroundColor,kn.DEFAULT),";&:hover{background-color:",({theme:e})=>ti(e.general.popover.input.dropdownList.item.backgroundColor,kn.HOVER),";}"),jw=Ye("span",{target:"e1f8s22f2",label:"SelectLabel"})("display:inline-block;flex-grow:1;font-size:13px;font-family:inherit;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:",({theme:e})=>e.general.popover.input.textColor,";"),Ime=Ye(jw,{target:"e1f8s22f3",label:"DropdownSelectLabel"})("color:",({theme:e})=>e.general.popover.input.dropdownList.textColor,";"),Nme=Ye("span",{target:"e1f8s22f4",label:"SelectIconContainer"})("margin-right:10px;margin-left:-4px;display:inline-flex;");function Rme(e){const{value:t,displayValue:r,icon:n,selected:i,onSelect:o,style:a}=e,{themeSettings:s}=pt();return Ve(Ome,{theme:s,style:{paddingRight:"6px"},onClick:()=>o==null?void 0:o(t),children:[n&&pe(Nme,{children:n}),pe(Ime,{theme:s,style:{paddingRight:i?0:"24px"},children:r!=null?r:`${t}`}),i&&pe(Ozt,{"aria-label":"check-icon",color:(a==null?void 0:a.color)||no})]})}const SP=({children:e,open:t,anchorEl:r,style:n,preventClickPropagation:i=!1})=>pe(yf,{anchorEl:r,open:t,style:n,slotProps:{root:{style:{zIndex:1301,display:"flex",boxShadow:"-1px -1px 10px rgba(0, 0, 0, 0.2)",borderRadius:4,overflow:"hidden"}}},children:pe("div",{onClick:a=>{i&&a.stopPropagation()},children:e})}),VVt=Ye("div",{target:"eze2kei0",label:"SelectContainer"})("box-sizing:border-box;display:inline-flex;"),YVt=Ye("div",{target:"eze2kei1",label:"Content"})("background:",({theme:e})=>e.general.popover.input.dropdownList.backgroundColor,";");function gd(e){var f,p,x,S;const g=e,{value:t,items:r,style:n,className:i,onChange:o}=g,a=ut(g,["value","items","style","className","onChange"]),{themeSettings:s}=pt(),[l,c]=ce.useState(!1),d=ce.useRef(null),h=r.find(j=>j.value===t),u=ce.useCallback(j=>{j!==t&&(o==null||o(j)),c(!1)},[t,o]);return pe(xw,{onClickAway:()=>c(!1),children:Ve(VVt,{className:i,style:n,children:[Ve(_P,xe(ue({theme:s,ref:d,focus:l,onClick:()=>c(j=>!j)},a),{children:[(h==null?void 0:h.icon)&&pe(Nme,{children:h==null?void 0:h.icon}),pe(jw,{theme:s,"aria-label":"Value",children:pe(Kt,{children:(f=h==null?void 0:h.displayValue)!=null?f:h==null?void 0:h.value})}),pe(ME,{"aria-label":"Select icon",fill:s.general.popover.input.textColor||no,style:{minWidth:"24px",transform:`rotate(${l?180:0}deg)`}})]})),pe(SP,{open:l,anchorEl:d.current,preventClickPropagation:!0,children:pe(YVt,{theme:s,style:{minWidth:(p=d.current)==null?void 0:p.clientWidth,maxWidth:((x=d.current)==null?void 0:x.clientWidth)&&((S=d.current)==null?void 0:S.clientWidth)*2},"aria-label":"Single-select content",children:r.map((j,U)=>pe(Rme,xe(ue({},j),{selected:j.value===t,onSelect:u}),U))})})]})})}const qVt=3;function Fme(e,t){if(t.length!==0)return t.length>qVt?`${t.length} selected`:e.filter(r=>t.includes(r.value)).map(({value:r,displayValue:n})=>n!=null?n:r).join(", ")}function ZVt(e){const{themeSettings:t}=pt(),{value:r,displayValue:n,selected:i,onSelect:o}=e;return Ve(Ome,{theme:t,style:{height:"36px",paddingLeft:"8px"},onClick:()=>o==null?void 0:o(r),children:[pe(kE,{checked:i,readOnly:!0,style:{width:"13px",height:"13px",marginRight:"12px"},labelProps:{onClick:a=>a.preventDefault()}}),pe(Ime,{theme:t,children:n!=null?n:`${r}`})]})}var XVt="Expected a function";function KVt(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(XVt);return po(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),uw(e,t,{leading:n,maxWait:t,trailing:i})}const QVt=300,JVt=Ye("div",{target:"epdneiy0",label:"Wrapper"})("max-height:100%;overflow:auto;"),jme=e=>{const{onScroll:t,style:r,children:n}=e,i=ce.useRef(null),o=ce.useRef(0),a=ce.useMemo(()=>t?KVt(t,QVt):void 0,[t]),s=ce.useCallback(l=>{const c=l.target,d=c.scrollTop/(c.scrollHeight-c.clientHeight),h=c.scrollTop>o.current?"down":"up";o.current=c.scrollTop,a==null||a({top:d,direction:h})},[a]);return ce.useEffect(()=>{const l=i.current;return l==null||l.addEventListener("scroll",s),()=>{l==null||l.removeEventListener("scroll",s)}},[s]),pe(JVt,{ref:i,style:r,children:n})},eYt=Ye("div",{target:"e5q6nvf0",label:"Container"})("display:flex;justify-content:center;padding:10px 0;"),Bme=()=>pe(eYt,{children:pe(ZM,{color:"grey"})}),tYt=Ye("div",{target:"e1wwpiq10",label:"Content"})("max-height:294px;color:",({theme:e})=>e.general.popover.input.dropdownList.textColor,";background-color:",({theme:e})=>e.general.popover.input.dropdownList.backgroundColor,";border-radius:",({theme:e})=>e.general.popover.input.dropdownList.cornerRadius,";box-shadow:",({theme:e})=>e.general.popover.input.dropdownList.shadow,";"),zme=Ye(GVt,{target:"e1wwpiq11",label:"StyledSearchInput"})("position:absolute;left:0;top:0;width:100%;color:",({theme:e})=>e.general.popover.input.textColor,";background-color:",({theme:e})=>e.general.popover.input.backgroundColor,";border-radius:",({theme:e})=>e.general.popover.input.cornerRadius,";svg path{fill:",({theme:e})=>e.general.popover.input.textColor,";}");function cz(e){var j,U,B;const{value:t,items:r,placeholder:n,onChange:i,onListScroll:o,showListLoader:a,showSearch:s=!0,onSearchUpdate:l,width:c}=e,{t:d}=At(),{themeSettings:h}=pt(),[u,g]=ce.useState(!1),f=ce.useRef(null),p=ce.useCallback(R=>{i==null||i(R)},[i]),x=ce.useCallback(()=>{g(!1),l==null||l("")},[l]),S=ce.useCallback(()=>{u?x():g(!0)},[u,x]);return pe(xw,{onClickAway:x,children:Ve("div",{style:{width:c},children:[Ve("div",{style:{position:"relative"},children:[Ve(_P,{ref:f,focus:u,onClick:S,theme:h,"aria-label":"Searchable single-select",children:[pe(jw,{theme:h,style:{opacity:t?"100%":"50%"},"aria-label":"Value",children:`${Fme(r,[t])||n}`}),pe(ME,{"aria-label":"select-icon",fill:h.general.popover.input.textColor||no,style:{minWidth:"24px",transform:`rotate(${u?180:0}deg)`}})]}),s&&u&&pe(zme,{inputRef:R=>R==null?void 0:R.focus(),theme:h,placeholder:d("filterEditor.placeholders.enterValue"),onChange:R=>{l==null||l(R.target.value)},"aria-label":"Value input"})]}),pe(SP,{open:u,anchorEl:f.current,preventClickPropagation:!0,children:pe(jme,{onScroll:o,children:Ve(tYt,{theme:h,style:{minWidth:(j=f.current)==null?void 0:j.clientWidth,maxWidth:((U=f.current)==null?void 0:U.clientWidth)&&((B=f.current)==null?void 0:B.clientWidth)*2},"aria-label":"Searchable single-select content",children:[r.map((R,E)=>pe(Rme,xe(ue({},R),{selected:t===R.value,onSelect:p}),E)),a&&pe(Bme,{})]})})})]})})}const rYt=Ye("div",{target:"e16s4p3r0",label:"Content"})("max-height:320px;color:",({theme:e})=>e.general.popover.input.dropdownList.textColor,";background-color:",({theme:e})=>e.general.popover.input.dropdownList.backgroundColor,";border-radius:",({theme:e})=>e.general.popover.input.dropdownList.cornerRadius,";box-shadow:",({theme:e})=>e.general.popover.input.dropdownList.shadow,";"),nYt=Ye("div",{target:"e16s4p3r1",label:"ContentToolbar"})("display:flex;flex-direction:row;justify-content:end;align-items:center;border-bottom:1px solid #e7e8ea;margin:0 10px 0 10px;height:32px;"),$me=Ye("button",{target:"e16s4p3r2",label:"ContentToolbarButton"})("font-family:'Open Sans',sans-serif;border:none;background:none;color:#1eaff3;padding:0;font-size:11px;&:disabled{opacity:0.4;}"),iYt=Ye("div",{target:"e16s4p3r3",label:"ContentList"})();function uz(e){var B,R,E,N;const{items:t,placeholder:r,onChange:n,onListScroll:i,showListLoader:o=!1,showSearch:a=!0,onSearchUpdate:s,width:l}=e,{t:c}=At(),{themeSettings:d}=pt(),[h,u]=ce.useState(!1),g=ce.useRef(null),f=ce.useMemo(()=>e.values||[],[e.values]),p=ce.useCallback(M=>{f.includes(M)?n==null||n(f.filter(T=>T!==M)):n==null||n([...f,M])},[f,n]),x=ce.useCallback(()=>{n==null||n(t.map(({value:M})=>M))},[t,n]),S=ce.useCallback(()=>{n==null||n([])},[n]),j=ce.useCallback(()=>{u(!1),s==null||s("")},[s]),U=ce.useCallback(()=>{h?j():u(!0)},[h,j]);return pe(xw,{onClickAway:j,children:Ve("div",{style:{width:l},children:[Ve("div",{style:{position:"relative"},children:[Ve(_P,{ref:g,focus:h,onClick:U,theme:d,"aria-label":"Searchable multi-select",children:[pe(jw,{theme:d,style:{opacity:f.length?"100%":"50%"},"aria-label":"Value",children:(B=Fme(t,f))!=null?B:r}),pe(ME,{fill:d.general.popover.input.textColor||no,"aria-label":"Open icon",style:{minWidth:"24px",transform:`rotate(${h?180:0}deg)`}})]}),a&&h&&pe(zme,{inputRef:M=>M==null?void 0:M.focus(),theme:d,placeholder:c("filterEditor.placeholders.enterValue"),onChange:M=>{s==null||s(M.target.value)},"aria-label":"Value input"})]}),pe(SP,{open:h,anchorEl:g.current,style:{maxHeight:300},preventClickPropagation:!0,children:pe(jme,{onScroll:i,children:Ve(rYt,{theme:d,style:{minWidth:(R=g.current)==null?void 0:R.clientWidth,maxWidth:((E=g.current)==null?void 0:E.clientWidth)&&((N=g.current)==null?void 0:N.clientWidth)*2},"aria-label":"Searchable multi-select content",children:[Ve(nYt,{children:[pe($me,{style:{marginRight:"8px"},disabled:t.length===f.length,onClick:x,children:c("filterEditor.buttons.selectAll")}),pe($me,{disabled:!f.length,onClick:S,children:c("filterEditor.buttons.clearAll")})]}),Ve(iYt,{"aria-label":"List",children:[t.map((M,$)=>pe(ZVt,xe(ue({},M),{selected:!!(f!=null&&f.includes(M.value)),onSelect:p}),$)),o&&pe(Bme,{})]})]})})})]})})}const Wme=ce.createContext({defaultDataSource:null,parentFilters:[],membersOnlyMode:!1}),md=()=>ce.useContext(Wme),oYt=({value:e,children:t})=>{const[r,n]=ce.useState(e.defaultDataSource),i=ce.useMemo(()=>{var a;return(a=e.parentFilters)!=null?a:[]},[e.parentFilters]),o=ce.useMemo(()=>{var a;return(a=e.membersOnlyMode)!=null?a:[]},[e.membersOnlyMode]);return ce.useEffect(()=>{r!==e.defaultDataSource&&n(e.defaultDataSource)},[r,e.defaultDataSource]),pe(Wme.Provider,{value:{defaultDataSource:r,parentFilters:i,membersOnlyMode:o},children:t})},Hme=50,aYt=300,sYt=.75,dz=({attribute:e,multiSelect:t=!0,onChange:r,selectedMembers:n,showSearch:i=!0,width:o="100%"})=>{const{t:a}=At(),{defaultDataSource:s,parentFilters:l}=md(),[c,d]=ce.useState(""),h=ce.useMemo(()=>uw(d,aYt),[d]),[u,g]=ce.useState(n),{data:f,isLoading:p,loadMore:x}=Tfe(ue({parentFilters:ce.useMemo(()=>[...l,OD(e,c)],[e,c,l]),filter:ce.useMemo(()=>Hi(e,[]),[e]),count:Hme},s&&{defaultDataSource:s})),S=ce.useMemo(()=>{const B=(f==null?void 0:f.allMembers.map(R=>({value:R.key})))||[];return[...u.map(R=>({value:R})).filter(R=>R.value.toLowerCase().includes(c.toLowerCase())),...B.filter(R=>!u.includes(R.value))]},[u,f,c]),j=ce.useCallback(({top:B,direction:R})=>{!p&&B>sYt&&R==="down"&&x(Hme)},[x,p]),U=ce.useRef(e);return ce.useEffect(()=>{U.current!==e&&(U.current=e,g(n))},[e,n]),t?pe(uz,{width:o,values:n,placeholder:a("filterEditor.placeholders.selectFromList"),items:S,onChange:r,onListScroll:j,showListLoader:p,showSearch:i,onSearchUpdate:h}):pe(cz,{width:o,value:n[0],placeholder:a("filterEditor.placeholders.selectFromList"),items:S,onChange:B=>r([B]),onListScroll:j,showListLoader:p,showSearch:i,onSearchUpdate:h})};function lYt(e){return uu[e]}function hz(e,t,r){var n;return t.length||(n=r==null?void 0:r.deactivatedMembers)!=null&&n.length?Hi(e,t,xe(ue({},r),{excludeMembers:!0})):null}function kP(e,t){var r;return go(e)&&((r=e==null?void 0:e.config)!=null&&r.deactivatedMembers)?t.filter(n=>{var i;return!((i=e.config)!=null&&i.deactivatedMembers.includes(n))}):t}function Bw(e){return go(e)?[...e.members,...e.config.deactivatedMembers]:[]}function zw(e,t){var r,n,i;return go(e)&&((r=e==null?void 0:e.config)!=null&&r.deactivatedMembers)?xe(ue({},e.config),{deactivatedMembers:(i=(n=e.config)==null?void 0:n.deactivatedMembers)==null?void 0:i.filter(o=>t.includes(o))}):e.config}const cYt={[Ze.Years]:"attribute.datetimeName.years",[Ze.Quarters]:"attribute.datetimeName.quarters",[Ze.Months]:"attribute.datetimeName.months",[Ze.Weeks]:"attribute.datetimeName.weeks",[Ze.Days]:"attribute.datetimeName.days",[Ze.AggHours]:"attribute.datetimeName.hours",[Ze.AggMinutesRoundTo15]:"attribute.datetimeName.minutes"};function uYt(e,t,r){return r?e(cYt[r],{columnName:t}):t}function Yh(e){return!wy(e)&&!AD(e)}function pz(e){return go(e)&&!e.members.length&&!e.config.deactivatedMembers.length}function Jf(e){return go(e)&&!e.config.excludeMembers}function eg(e){return go(e)&&e.config.excludeMembers}function MP(e){return eg(e)||PD(e)||ED(e)||DD(e)||wy(e)}function TP(e){return ED(e)&&e.operatorA===Tn.From&&e.operatorB===Tn.To}function Ume(e){return m_(e)&&!!e.anchor}function Gme(e){return m_(e)&&!e.anchor}function qh(e,t,r){const n=uYt(r,x_(e),t);return new Gr(n,e.expression,t,Gr.getDefaultFormatForGranularity(t),void 0,void 0,e.dataSource)}function Vme(e){const t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${n}T00:00:00`}function dYt(e,t,r){var n;return t.length||(n=r==null?void 0:r.deactivatedMembers)!=null&&n.length?Hi(e,t,xe(ue({},r),{excludeMembers:!1})):null}const Yme=e=>{const{filter:t,selected:r,multiSelectEnabled:n,onChange:i}=e,[o,a]=ce.useState(Jf(t)?Bw(t):[]),s=hl(n),l=typeof s!="undefined"&&s!==n,c=ce.useCallback(({selectedMembers:u,multiSelectEnabled:g})=>{const f=zw(t,u),p=kP(t,u),x=dYt(t.attribute,p,xe(ue({},f),{enableMultiSelection:g}));i(x)},[t,i]);ce.useEffect(()=>{if(l&&r){let u=o;n||(o.length>1&&(u=[o.sort()[0]]),a(u)),c({selectedMembers:u,multiSelectEnabled:n})}},[l,n,o,r,c]);const d=ce.useCallback(()=>{c({selectedMembers:o,multiSelectEnabled:n})},[o,n,c]),h=ce.useCallback(u=>{const g=Array.isArray(u)?u:[u];a(g),c({selectedMembers:g,multiSelectEnabled:n})},[n,c]);return pe(du,{selected:r,onSelect:d,"aria-label":"Members section",children:()=>pe(dz,{width:320,attribute:t.attribute,multiSelect:n,selectedMembers:o,onChange:h})})},jr={EXCLUDE:"exclude",CONTAINS:Er.CONTAINS,NOT_CONTAIN:Er.NOT_CONTAIN,STARTS_WITH:Er.STARTS_WITH,NOT_STARTS_WITH:Er.NOT_STARTS_WITH,ENDS_WITH:Er.ENDS_WITH,NOT_ENDS_WITH:Er.NOT_ENDS_WITH,EQUALS:Er.EQUALS_TEXT,NOT_EQUALS:Er.NOT_EQUALS_TEXT,IS_EMPTY:"isEmpty",IS_NOT_EMPTY:"isNotEmpty"},hYt=[{value:jr.EXCLUDE,displayValue:"filterEditor.conditions.exclude"}],qme=[{value:jr.EXCLUDE,displayValue:"filterEditor.conditions.exclude"},{value:jr.CONTAINS,displayValue:"filterEditor.conditions.contains"},{value:jr.NOT_CONTAIN,displayValue:"filterEditor.conditions.notContain"},{value:jr.STARTS_WITH,displayValue:"filterEditor.conditions.startsWith"},{value:jr.NOT_STARTS_WITH,displayValue:"filterEditor.conditions.notStartsWith"},{value:jr.ENDS_WITH,displayValue:"filterEditor.conditions.endsWith"},{value:jr.NOT_ENDS_WITH,displayValue:"filterEditor.conditions.notEndsWith"},{value:jr.EQUALS,displayValue:"filterEditor.conditions.equals"},{value:jr.NOT_EQUALS,displayValue:"filterEditor.conditions.notEquals"},{value:jr.IS_EMPTY,displayValue:"filterEditor.conditions.isEmpty"},{value:jr.IS_NOT_EMPTY,displayValue:"filterEditor.conditions.isNotEmpty"}],pYt=e=>{if(!MP(e)||!Yh(e))return qme[0].value;if(eg(e))return jr.EXCLUDE;const t=tz(e),r=Zme(e);return t===jr.EQUALS&&r===""?jr.IS_EMPTY:t===jr.NOT_EQUALS&&r===""?jr.IS_NOT_EMPTY:t},Zme=e=>MP(e)&&rz(e)[0]||"",fYt=e=>e===jr.IS_EMPTY?uu[jr.EQUALS]:e===jr.IS_NOT_EMPTY?uu[jr.NOT_EQUALS]:uu[e];function gYt(e,t){const{attribute:r}=e,{condition:n,value:i,selectedMembers:o,multiSelectEnabled:a}=t;if(n===jr.EXCLUDE){const l=zw(e,o),c=kP(e,o);return hz(r,c,xe(ue({},l),{enableMultiSelection:a}))}return fYt(n).fn(r,i,e.config)}const mYt=({filter:e,selected:t,multiSelectEnabled:r,onChange:n})=>{const{t:i}=At(),{membersOnlyMode:o}=md(),[a,s]=ce.useState(pYt(e)),[l,c]=ce.useState(Zme(e)),[d,h]=ce.useState(eg(e)?Bw(e):[]),u=hl(r),g=typeof u!="undefined"&&u!==r,f=o?hYt:qme,p=ce.useMemo(()=>f.map(E=>xe(ue({},E),{displayValue:i(E.displayValue)})),[i,f]),x=ce.useMemo(()=>[jr.CONTAINS,jr.ENDS_WITH,jr.EQUALS,jr.NOT_CONTAIN,jr.NOT_ENDS_WITH,jr.NOT_EQUALS,jr.NOT_STARTS_WITH,jr.STARTS_WITH].includes(a),[a]),S=ce.useCallback(E=>{const N=gYt(e,E);n(N)},[e,n]);ce.useEffect(()=>{if(g&&t){let E=d;r||(d.length>1&&(E=[d.sort()[0]]),h(E)),S({condition:a,value:l,selectedMembers:E,multiSelectEnabled:r})}},[a,l,d,r,g,t,S]);const j=ce.useCallback(()=>{S({condition:a,value:l,selectedMembers:d,multiSelectEnabled:r})},[a,l,d,r,S]),U=ce.useCallback(E=>{const N=Array.isArray(E)?E:[E];h(N),S({condition:a,value:l,selectedMembers:N,multiSelectEnabled:r})},[a,l,r,S]),B=ce.useCallback(E=>{let N=l;s(E),(E===jr.IS_EMPTY||E===jr.IS_NOT_EMPTY)&&(c(""),N=""),S({condition:E,value:N,selectedMembers:d,multiSelectEnabled:r})},[l,d,r,S]),R=ce.useCallback(E=>{const N=E.target.value;c(N),S({condition:a,value:N,selectedMembers:d,multiSelectEnabled:r})},[a,d,r,S]);return Ve(du,{selected:t,onSelect:j,"aria-label":"Text condition section",children:[pe(gd,{style:{width:"168px",marginRight:"8px"},value:a,items:p,onChange:B,"aria-label":"Condition select"}),x&&pe(Qf,{style:{width:"300px"},placeholder:i("filterEditor.placeholders.enterEntry"),value:l,onChange:R,"aria-label":"Value input"}),a===jr.EXCLUDE&&pe(dz,{width:300,attribute:e.attribute,multiSelect:r,selectedMembers:d,onChange:U})]})},vYt=Ye("div",{target:"e1e9clqi0",label:"Container"})("display:flex;align-items:center;"),yYt=Ye("span",{target:"e1e9clqi1",label:"Label"})("padding-right:5px;font-family:'Open Sans';color:",({theme:e})=>e.general.popover.content.textColor,";"),fz=({enabled:e,onChange:t})=>{const{t:r}=At(),{themeSettings:n}=pt();return Ve(vYt,{children:[pe(yYt,{theme:n,id:"multiselect-switch-label",children:r("filterEditor.labels.allowMultiSelection")}),pe(yfe,{checked:e,size:"small",inputProps:{role:"switch",name:"multiselect-switch","aria-labelledby":"multiselect-switch-label"},onChange:()=>t==null?void 0:t(!e),theme:n})]})},gz=Ye("div",{target:"e1kj77qg0",label:"FilterEditorContainer"})("display:flex;flex-direction:column;padding:20px 16px 16px 40px;justify-content:space-around;align-items:stretch;font-size:13px;color:",({theme:e})=>e.general.popover.content.textColor,";"),mz=({selected:e})=>{const{t}=At();return pe(du,{disabled:!0,selected:e,onSelect:()=>{},"aria-label":"Not supported section",children:()=>pe("span",{children:t("unsupportedFilter",{filter:""})})})},bYt=e=>e?Yh(e)?pz(e)?"all":Jf(e)?"members":"text-condition":"not-supported":null,xYt=({filter:e,onChange:t,showMultiselectToggle:r=!0})=>{const{themeSettings:n}=pt(),[i,o]=ce.useState(e!=null?e:null),[a,s]=ce.useState(bYt(i)),[l,c]=ce.useState("enableMultiSelection"in e.config?e.config.enableMultiSelection:!0);ce.useEffect(()=>{t==null||t(i)},[i,t]);const d=ce.useCallback(g=>{o(g),s("all")},[]),h=ce.useCallback(g=>{o(g),s("members")},[]),u=ce.useCallback(g=>{o(g),s("text-condition")},[]);return Ve(gz,{theme:n,"aria-label":"Filter editor textual",children:[!Yh(e)&&pe(mz,{selected:a==="not-supported"}),Ve(CP,{direction:"row",spacing:2,sx:{justifyContent:"space-between",alignItems:"center",marginBottom:"42px"},children:[pe(lz,{filter:e,selected:a==="all",onChange:d}),r&&pe(fz,{enabled:l,onChange:c})]}),pe(Yme,{filter:e,selected:a==="members",multiSelectEnabled:l,onChange:h}),pe(mYt,{filter:e,selected:a==="text-condition",multiSelectEnabled:l,onChange:u})]})};function $w(e){return/^[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?$/.test(e)}const vz=(e,t)=>{const r=ce.useRef(!1);return ce.useEffect(()=>{e!==t&&(r.current=!0)},[e,t]),r.current},Xme="136px";function Kme(e,t,r){if(!$w(e))return r("filterEditor.validationErrors.invalidNumber");if($w(t)&&parseFloat(e)>parseFloat(t))return r("filterEditor.validationErrors.invalidNumericRange")}function Qme(e,t){if(!$w(e))return t("filterEditor.validationErrors.invalidNumber")}const wYt=e=>{const{filter:t,selected:r,defaultFrom:n,defaultTo:i,onChange:o}=e,{t:a}=At(),[s,l]=ce.useState(TP(t)?t.valueA.toString():""),[c,d]=ce.useState(TP(t)?t.valueB.toString():""),h=vz(s,""),u=vz(c,"");ce.useEffect(()=>{Kl(n)&&l(S=>S===""?n.toString():S)},[n]),ce.useEffect(()=>{Kl(i)&&d(S=>S===""?i.toString():S)},[i]);const g=ce.useCallback((S,j)=>{const B=!Kme(S,j,a)&&!Qme(j,a)?Ag(t.attribute,parseFloat(S),parseFloat(j),t.config):null;o(B)},[t,a,o]),f=ce.useCallback(()=>{g(s,c)},[s,c,g]),p=ce.useCallback(S=>{const j=S.target.value;l(j),g(j,c)},[c,g]),x=ce.useCallback(S=>{const j=S.target.value;d(j),g(s,j)},[s,g]);return Ve(du,{selected:r,onSelect:f,"aria-label":"Numeric range section",children:[pe("span",{id:"numeric-range-from",style:{margin:"0 8px 0 0"},children:a("filterEditor.labels.from")}),pe(Qf,{style:{width:Xme},placeholder:a("filterEditor.placeholders.enterValue"),value:s,onChange:p,"aria-labelledby":"numeric-range-from",error:h&&Kme(s,c,a)}),pe("span",{id:"numeric-range-to",style:{margin:"0 8px 0 8px"},children:a("filterEditor.labels.to")}),pe(Qf,{style:{width:Xme},placeholder:a("filterEditor.placeholders.enterValue"),value:c,onChange:x,"aria-labelledby":"numeric-range-to",error:u&&Qme(c,a)})]})},CYt=e=>{const[t,r,n]=(e==null?void 0:e.rows[0])||[];return ue(ue({count:t==null?void 0:t.data},r&&{min:r.data}),n&&{max:n.data})},Jme=e=>{const{attribute:t,enabled:r,defaultDataSource:n,filters:i}=e,{data:o,isLoading:a,isError:s,isSuccess:l,error:c}=_E({dataSource:t.dataSource&&ky(t.dataSource)||n,measures:Sy(t.type)?[u_(t)]:[u_(t),bD(t),c_(t)],enabled:r,filters:i});return{isLoading:a,isError:s,isSuccess:l,error:c,data:o?CYt(o):void 0}},Lo={EXCLUDE:"exclude",EQUALS:Er.EQUALS_NUMERIC,NOT_EQUALS:Er.NOT_EQUALS_NUMERIC,LESS_THAN:Er.LESS_THAN,LESS_THAN_OR_EQUAL:Er.LESS_THAN_OR_EQUAL,GREATER_THAN:Er.GREATER_THAN,GREATER_THAN_OR_EQUAL:Er.GREATER_THAN_OR_EQUAL};function _Yt(e,t){if(!$w(e))return t("filterEditor.validationErrors.invalidNumber")}function SYt(e,t){return!MP(e)||TP(e)||!Yh(e)?t:eg(e)?Lo.EXCLUDE:tz(e)}function kYt(e){var r;return MP(e)?`${(r=rz(e)[0])!=null?r:""}`:""}function MYt(e,t){const{attribute:r}=e,{condition:n,value:i,selectedMembers:o,multiSelectEnabled:a}=t;if(n===Lo.EXCLUDE){const l=zw(e,o),c=kP(e,o);return hz(r,c,xe(ue({},l),{enableMultiSelection:a}))}return $w(i)?lYt(n).fn(r,parseFloat(i),e.config):null}const TYt=[{value:Lo.EXCLUDE,displayValue:"filterEditor.conditions.exclude"}],e0e=[{value:Lo.EXCLUDE,displayValue:"filterEditor.conditions.exclude"},{value:Lo.EQUALS,displayValue:"filterEditor.conditions.equals",icon:pe(Izt,{})},{value:Lo.NOT_EQUALS,displayValue:"filterEditor.conditions.notEquals",icon:pe(Nzt,{})},{value:Lo.LESS_THAN,displayValue:"filterEditor.conditions.lessThan",icon:pe(Rzt,{})},{value:Lo.LESS_THAN_OR_EQUAL,displayValue:"filterEditor.conditions.lessThanOrEqual",icon:pe(Fzt,{})},{value:Lo.GREATER_THAN,displayValue:"filterEditor.conditions.greaterThan",icon:pe(jzt,{})},{value:Lo.GREATER_THAN_OR_EQUAL,displayValue:"filterEditor.conditions.greaterThanOrEqual",icon:pe(Bzt,{})}],AYt=({filter:e,selected:t,multiSelectEnabled:r,onChange:n})=>{const{t:i}=At(),{membersOnlyMode:o}=md(),[a,s]=ce.useState(SYt(e,e0e[0].value)),[l,c]=ce.useState(kYt(e)),[d,h]=ce.useState(eg(e)?Bw(e):[]),u=vz(l,""),g=hl(r),f=typeof g!="undefined"&&g!==r,p=o?TYt:e0e,x=ce.useMemo(()=>p.map(N=>xe(ue({},N),{displayValue:i(N.displayValue)})),[i,p]),S=ce.useMemo(()=>[Lo.EQUALS,Lo.NOT_EQUALS,Lo.LESS_THAN,Lo.LESS_THAN_OR_EQUAL,Lo.GREATER_THAN,Lo.GREATER_THAN_OR_EQUAL].includes(a),[a]),j=ce.useCallback(N=>{const M=MYt(e,N);n(M)},[e,n]);ce.useEffect(()=>{if(f&&t){let N=d;r||(d.length>1&&(N=[d.sort()[0]]),h(N)),j({condition:a,value:l,selectedMembers:N,multiSelectEnabled:r})}},[a,l,d,r,f,t,j]);const U=ce.useCallback(()=>{j({condition:a,value:l,selectedMembers:d,multiSelectEnabled:r})},[a,l,d,r,j]),B=ce.useCallback(N=>{const M=Array.isArray(N)?N:[N];h(M),j({condition:a,value:l,selectedMembers:M,multiSelectEnabled:r})},[a,l,r,j]),R=ce.useCallback(N=>{s(N),j({condition:N,value:l,selectedMembers:d,multiSelectEnabled:r})},[l,d,r,j]),E=ce.useCallback(N=>{const M=N.target.value;c(M),j({condition:a,value:M,selectedMembers:d,multiSelectEnabled:r})},[a,d,r,j]);return Ve(du,{selected:t,onSelect:U,"aria-label":"Numeric condition section",children:[pe(gd,{style:{width:"210px",marginRight:"8px"},value:a,items:x,onChange:R,"aria-label":"Condition select"}),S&&pe(Qf,{style:{width:"136px"},placeholder:i("filterEditor.placeholders.enterEntry"),value:l,onChange:E,error:u&&_Yt(l,i),"aria-label":"Value input"}),a===Lo.EXCLUDE&&pe(dz,{width:240,attribute:e.attribute,multiSelect:r,selectedMembers:d,onChange:B})]})},EYt=e=>e?Yh(e)?pz(e)?"all":Jf(e)?"members":TP(e)?"range":"condition":"not-supported":null,PYt=({filter:e,onChange:t,showMultiselectToggle:r=!0})=>{const{membersOnlyMode:n}=md(),{themeSettings:i}=pt(),{defaultDataSource:o}=md(),[a,s]=ce.useState(e!=null?e:null),[l,c]=ce.useState(EYt(a)),[d,h]=ce.useState("enableMultiSelection"in e.config?e.config.enableMultiSelection:!0),{data:u}=Jme(ue({attribute:e.attribute,enabled:!!e},o&&{defaultDataSource:o}));ce.useEffect(()=>{t==null||t(a)},[a,t]);const g=ce.useCallback(S=>{s(S),c("all")},[]),f=ce.useCallback(S=>{s(S),c("members")},[]),p=ce.useCallback(S=>{s(S),c("range")},[]),x=ce.useCallback(S=>{s(S),c("condition")},[]);return Ve(gz,{theme:i,"aria-label":"Filter editor numerical",children:[!Yh(e)&&pe(mz,{selected:l==="not-supported"}),Ve(CP,{direction:"row",spacing:2,sx:{justifyContent:"space-between",alignItems:"center",marginBottom:"42px"},children:[pe(lz,{filter:e,selected:l==="all",onChange:g}),r&&pe(fz,{enabled:d,onChange:h})]}),pe(Yme,{filter:e,selected:l==="members",multiSelectEnabled:d,onChange:f}),!n&&pe(wYt,{filter:e,selected:l==="range",defaultFrom:u==null?void 0:u.min,defaultTo:u==null?void 0:u.max,onChange:p}),pe(AYt,{filter:e,selected:l==="condition",multiSelectEnabled:d,onChange:x})]})},AP=()=>{const{app:e}=hr();return ce.useCallback((t,r)=>{const n=(i,o)=>Ch(i,o,e==null?void 0:e.settings.locale,e==null?void 0:e.settings.dateConfig);return X6(toe(t)?t.toISOString():t,n,r)},[e])},EP=50,t0e=.75;var Ni=function(e){return e.SINGLE_SELECT="single-select",e.MULTI_SELECT="multi-select",e.RANGE_FROM_SELECT="range-from-select",e.RANGE_TO_SELECT="range-to-select",e}({});const DYt=1;function LYt(e,t){if(e.length!==0)return e.length>DYt?`${e.length} Dates selected`:e.map(r=>t(r,UT(Ze.Days))).join(", ")}function OYt(e){switch(e){case Ni.SINGLE_SELECT:return"pointSelector";case Ni.MULTI_SELECT:return"multiPointsSelector";case Ni.RANGE_FROM_SELECT:return"fromSelector";case Ni.RANGE_TO_SELECT:return"toSelector"}}function Ww(e){var E;const R=e,{value:t,type:r,limits:n,placeholder:i,onChange:o,width:a}=R,s=ut(R,["value","type","limits","placeholder","onChange","width"]),l=AP(),{themeSettings:c}=pt(),[d,h]=ce.useState(!1),u=ce.useRef(null),g=ce.useCallback(N=>{r===Ni.SINGLE_SELECT&&(o==null||o(N.toDate()))},[r,o]),f=ce.useCallback(N=>{r===Ni.MULTI_SELECT&&(o==null||o(N.map(M=>M.toDate())))},[r,o]),p=ce.useCallback(N=>{(r===Ni.RANGE_FROM_SELECT||r===Ni.RANGE_TO_SELECT)&&(o==null||o({from:N.from.toDate(),to:N.to.toDate()}))},[r,o]),x=ce.useMemo(()=>{if(r===Ni.SINGLE_SELECT&&t)return Un(t)},[r,t]),S=ce.useMemo(()=>{if(r===Ni.MULTI_SELECT&&(t!=null&&t.length))return t.map(N=>Un(N))},[r,t]),j=ce.useMemo(()=>{if(r===Ni.RANGE_FROM_SELECT||r===Ni.RANGE_TO_SELECT)return ue(ue({},(t==null?void 0:t.from)&&{from:Un(t.from)}),(t==null?void 0:t.to)&&{to:Un(t.to)})},[r,t]),U=ce.useMemo(()=>((r===Ni.SINGLE_SELECT?[t]:r===Ni.RANGE_FROM_SELECT?[t==null?void 0:t.from]:r===Ni.RANGE_TO_SELECT?[t==null?void 0:t.to]:r===Ni.MULTI_SELECT?t:[])||[]).filter(M=>!!M),[r,t]),B=ce.useMemo(()=>n?{minDate:n.minDate?Un(n.minDate):void 0,maxDate:n.maxDate?Un(n.maxDate):void 0}:void 0,[n]);return pe(xw,{onClickAway:()=>h(!1),children:Ve("div",{style:{width:a},children:[Ve(_P,xe(ue({ref:u,focus:d,onClick:()=>h(N=>!N),theme:c},s),{children:[pe(jw,{theme:c,style:{opacity:U.length?"100%":"50%"},"aria-label":"Value",children:pe(Kt,{children:(E=LYt(U,l))!=null?E:i})}),pe(xfe,{iconColor:c.general.popover.input.textColor,"aria-label":"Calendar icon",style:{marginRight:"3px"}})]})),pe(SP,{open:d,anchorEl:u.current,preventClickPropagation:!0,children:pe(KB,{selectorMode:OYt(r),limit:B,selectedDate:x,selectedDates:S,selectedDateRange:j,onDateChanged:g,onDatesChanged:f,onDateRangeChanged:p})})]})})}const yz=[{value:Ze.Years,displayValue:"filterEditor.datetimeLevels.year"},{value:Ze.Quarters,displayValue:"filterEditor.datetimeLevels.quarter"},{value:Ze.Months,displayValue:"filterEditor.datetimeLevels.month"},{value:Ze.Weeks,displayValue:"filterEditor.datetimeLevels.week"},{value:Ze.Days,displayValue:"filterEditor.datetimeLevels.day"}],IYt=[{value:Ze.AggHours,displayValue:"filterEditor.datetimeLevels.aggrigatedHour"},{value:Ze.AggMinutesRoundTo15,displayValue:"filterEditor.datetimeLevels.aggrigatedMinutesRoundTo15"}],r0e=[...yz,...IYt];function NYt(e,t,r){var n;return t.length||(n=r==null?void 0:r.deactivatedMembers)!=null&&n.length?Hi(e,t,xe(ue({},r),{excludeMembers:!1})):null}const RYt=e=>{const{filter:t,selected:r,multiSelectEnabled:n,limits:i,onChange:o}=e,{t:a}=At(),{defaultDataSource:s}=md(),l=Jf(t),[c,d]=ce.useState(l?t.attribute:qh(t.attribute,Ze.Years,a)),h=ce.useMemo(()=>l?Bw(t):[],[l,t]),[u,g]=ce.useState(h),f=hl(n),p=AP(),x=c.granularity===Ze.Days,S=ce.useMemo(()=>Hi(c.sort(Br.Descending),[]),[c]),{data:j,isLoading:U,loadMore:B}=AE(ue({filter:S,count:EP},s&&{defaultDataSource:s})),R=ce.useCallback(({top:V,direction:q})=>{!U&&V>t0e&&q==="down"&&B(EP)},[B,U]),E=ce.useMemo(()=>{let V=((j==null?void 0:j.allMembers)||[]).map(({key:q,title:z})=>({value:q,displayValue:z}));if(Jf(t)&&Va(t.attribute,c)&&h.length){const q=n?h:[h[0]];V=[...q.map(z=>({value:z,displayValue:p(z,UT(c.granularity))})),...V.filter(z=>!q.includes(z.value))]}return V},[n,j,t,c,p,h]),N=typeof f!="undefined"&&f!==n,M=ce.useMemo(()=>r0e.map(V=>({value:V.value,displayValue:a(V.displayValue)})),[a]),$=ce.useCallback(({selectedMembers:V,multiSelectEnabled:q,attribute:z})=>{const P=zw(t,V),W=kP(t,V),_=NYt(z,W,xe(ue({},P),{enableMultiSelection:q}));o(_)},[t,o]);ce.useEffect(()=>{if(N&&r){let V=u;n||(u.length>1&&(V=[u.sort()[0]]),g(V)),$({selectedMembers:V,multiSelectEnabled:n,attribute:c})}},[N,n,u,c,r,$]);const T=ce.useCallback(()=>{$({selectedMembers:u,multiSelectEnabled:n,attribute:c})},[u,n,c,$]),C=ce.useCallback(V=>{const q=Array.isArray(V)?V:[V];g(q),$({selectedMembers:q,multiSelectEnabled:n,attribute:c})},[n,c,$]),y=ce.useCallback(V=>{const q=V.map(z=>Vme(z));C(q)},[C]),D=ce.useCallback(V=>{const q=qh(c,V,a);d(q),g([]),$({selectedMembers:[],multiSelectEnabled:n,attribute:q})},[n,c,$,a]),k=ce.useMemo(()=>x?u.map(V=>new Date(V)):void 0,[u,x]),F=ce.useMemo(()=>i?{minDate:i.minDate?new Date(i.minDate):void 0,maxDate:i.maxDate?new Date(i.maxDate):void 0}:void 0,[i]);return pe(du,{selected:r,onSelect:T,"aria-label":"Members section",children:()=>Ve(Kt,{children:[pe(gd,{style:{width:"168px",marginRight:"8px"},value:c.granularity,items:M,onChange:D,"aria-label":"Condition select"}),Ve(Kt,{children:[n&&!x&&pe(uz,{width:150,values:u,placeholder:a("filterEditor.placeholders.selectFromList"),items:E,onChange:C,onListScroll:R,showListLoader:U,showSearch:!1}),!n&&!x&&pe(cz,{width:150,value:u[0],placeholder:a("filterEditor.placeholders.selectFromList"),items:E,onChange:C,onListScroll:R,showListLoader:U,showSearch:!1}),x&&pe(Ww,{width:152,type:Ni.MULTI_SELECT,value:k,limits:F,onChange:y,placeholder:a("filterEditor.placeholders.select")})]})]})})},n0e="yyyy-MM-dd",FYt=e=>{const{filter:t,selected:r,limits:n,onChange:i}=e,{t:o}=At(),a=AP(),[s,l]=ce.useState(Tg(t)&&t.valueA?new Date(t.valueA):void 0),[c,d]=ce.useState(Tg(t)&&t.valueB?new Date(t.valueB):void 0),h=ce.useMemo(()=>({from:s,to:c}),[s,c]),u=ce.useMemo(()=>n?{minDate:n.minDate?new Date(n.minDate):void 0,maxDate:n.maxDate?new Date(n.maxDate):void 0}:void 0,[n]),g=ce.useCallback((x,S)=>{const U=x&&S?RD(t.attribute,a(x,n0e),a(S,n0e),t.config):null;i(U)},[t,a,i]),f=ce.useCallback(()=>{g(s,c)},[s,c,g]),p=ce.useCallback(({from:x,to:S})=>{l(x),d(S),g(x,S)},[g]);return Ve(du,{selected:r,onSelect:f,"aria-label":"Datetime range section",children:[pe("span",{id:"datetime-range-from",style:{margin:"0 8px 0 0"},children:o("filterEditor.labels.from")}),pe(Ww,{width:152,type:Ni.RANGE_FROM_SELECT,value:h,limits:u,"aria-labelledby":"datetime-range-from",onChange:p,placeholder:o("filterEditor.placeholders.select")}),pe("span",{id:"datetime-range-to",style:{margin:"0 8px 0 8px"},children:o("filterEditor.labels.to")}),pe(Ww,{width:152,type:Ni.RANGE_TO_SELECT,value:h,limits:u,"aria-labelledby":"datetime-range-to",onChange:p,placeholder:o("filterEditor.placeholders.select")})]})};function jYt(e,t){const{selectedMembers:r,multiSelectEnabled:n,attribute:i}=t,o=zw(e,r);return r!=null&&r.length?hz(i,r,xe(ue({},o),{enableMultiSelection:n})):null}function BYt(e,t){const r={selectedMembers:[],attribute:qh(e.attribute,Ze.Years,t)};return eg(e)?xe(ue({},r),{selectedMembers:Bw(e),attribute:e.attribute}):r}const zYt=({filter:e,multiSelectEnabled:t,limits:r,onChange:n})=>{const{t:i}=At(),{defaultDataSource:o,parentFilters:a}=md(),s=ce.useMemo(()=>BYt(e,i),[e,i]),[l,c]=ce.useState(s.attribute),d=s.selectedMembers,[h,u]=ce.useState(d),g=hl(t),f=AP(),p=l.granularity===Ze.Days,x=ce.useMemo(()=>Hi(l.sort(Br.Descending),[]),[l]),{data:S,isLoading:j,loadMore:U}=AE(ue({filter:x,parentFilters:a,count:EP,enabled:!p},o&&{defaultDataSource:o})),B=ce.useCallback(({top:k,direction:F})=>{!j&&k>t0e&&F==="down"&&U(EP)},[U,j]),R=ce.useMemo(()=>{let k=((S==null?void 0:S.allMembers)||[]).map(({key:F,title:V})=>({value:F,displayValue:V}));if(Jf(e)&&Va(e.attribute,l)&&d.length){const F=t?d:[d[0]];k=[...F.map(V=>({value:V,displayValue:f(V,UT(l.granularity))})),...k.filter(V=>!F.includes(V.value))]}return k},[t,S,e,l,f,d]),E=typeof g!="undefined"&&g!==t,N=ce.useMemo(()=>r0e.map(k=>({value:k.value,displayValue:i(k.displayValue)})),[i]),M=ce.useCallback(k=>{const F=jYt(e,k);n(F)},[e,n]);ce.useEffect(()=>{if(E){let k=h;t||(h.length>1&&(k=[h.sort()[0]]),u(k)),M({selectedMembers:k,multiSelectEnabled:t,attribute:l})}},[h,t,E,l,M]);const $=ce.useCallback(k=>{const F=Array.isArray(k)?k:[k];u(F),M({selectedMembers:F,multiSelectEnabled:t,attribute:l})},[t,l,M]),T=ce.useCallback(k=>{const F=k.map(V=>Vme(V));$(F)},[$]),C=ce.useCallback(k=>{const F=qh(l,k,i);c(F),u([]),M({selectedMembers:[],multiSelectEnabled:t,attribute:F})},[t,l,M,i]),y=ce.useMemo(()=>p?h.map(k=>new Date(k)):void 0,[h,p]),D=ce.useMemo(()=>r?{minDate:r.minDate?new Date(r.minDate):void 0,maxDate:r.maxDate?new Date(r.maxDate):void 0}:void 0,[r]);return Ve(Kt,{children:[pe(gd,{style:{width:"176px",marginRight:"8px"},value:l.granularity,items:N,onChange:C,"aria-label":"Condition select"}),Ve(Kt,{children:[t&&!p&&pe(uz,{width:152,values:h,placeholder:i("filterEditor.placeholders.selectFromList"),items:R,onChange:$,onListScroll:B,showListLoader:j,showSearch:!1}),!t&&!p&&pe(cz,{width:152,value:h[0],placeholder:i("filterEditor.placeholders.selectFromList"),items:R,onChange:$,onListScroll:B,showListLoader:j,showSearch:!1}),p&&pe(Ww,{width:152,type:Ni.MULTI_SELECT,value:y,limits:D,onChange:T,placeholder:i("filterEditor.placeholders.select")})]})]})},$Yt={errorPrefix:"[request-error]",errors:{networkError:"Network error. Check browser console for further details.",authFailed:"Failed to authenticate.",ssoNotEnabled:"SSO is not enabled on target instance, please choose another authentication method.",ssoNoLoginUrl:"Can not fetch login URL on target instance. Check SSO settings.",passwordAuthFailed:"$t(errorPrefix) Username and password authentication was not successful. Check credentials.",tokenAuthFailed:"$t(errorPrefix) Token authentication was not successful. Check credentials.",responseError_onlyStatus:"$t(errorPrefix) Status: {{status}}",responseError_withStatusText:"$t(errorPrefix) Status: {{status}} - {{statusText}}"}},WYt={errorPrefix:"[request-error]",errors:{networkError:"Помилка мережі. Можливо ви забули додати свій домен до «CORS Allowed Origins» в панелі адміністратора Sisense -> Security Settings.",authFailed:"Автентифікація не вдалася.",ssoNotEnabled:"SSO не ввімкнено на цьому сервері, будь ласка, виберіть інший метод аутентифікації",ssoNoLoginUrl:"Неможливо отримати loginUrl з сервера. Перевірте налаштування SSO.",passwordAuthFailed:"$t(errorPrefix) Помилка автентифікації за допомогою імені користувача та пароля. Перевірте дані для входу.",tokenAuthFailed:"$t(errorPrefix) Помилка автентифікації за допомогою токена. Перевірте дані для входу.",responseError_onlyStatus:"$t(errorPrefix) Статус: {{status}}",responseError_withStatusText:"$t(errorPrefix) Статус: {{status}} - {{statusText}}"}},i0e="sdkRestClient",HYt={en:$Yt,uk:WYt};function UYt(){return VC({resource:HYt,language:"en",namespace:i0e})}const{i18nextInstance:GYt}=UYt();class Hw{constructor(t){this._valid=!0,this._authenticating=!1,this._tried=!1,this._result=new Promise(r=>{this._resolve=r}),this.type=t}isValid(){return this._valid}invalidate(){this._valid=!1}authenticate(){return this._result}isAuthenticating(){return this._authenticating}authenticated(){return this._result}applyHeader(t){}}const PP=(e,t)=>{for(const[r,n]of Object.entries(t))Array.isArray(e)?e.push([r,n]):typeof e.set=="function"?e.set(r,n):e[r]=n},o0e=(e,t)=>{if(!e||typeof e!="string")return e;const r=new URL(e);for(const[n,i]of Object.entries(t))r.searchParams.append(n,i);return r.toString()},a0e=(e,t)=>{if(!e||typeof e!="string")return e;const r=new URL(e),n=t.startsWith("/")?t.slice(1):t;return r.pathname+=n,r.toString()},VYt=(e,t)=>e===null||t===null;class YYt extends Hw{constructor(t,r){super("bearer"),this.bearer=r,this._resolve(!0)}applyHeader(t){const r="Bearer "+this.bearer;PP(t,{Authorization:r})}authenticate(){return this._result}authenticated(){return this._result}}function qYt(e){return e.type==="bearer"}class ZYt extends Hw{constructor(){super("fusion")}authenticate(){var t,r,n,i,o;const a=!!(!((r=(t=window.prism)===null||t===void 0?void 0:t.user)===null||r===void 0)&&r._id);this._resolve(a);const s=(o=(i=(n=window.document)===null||n===void 0?void 0:n.cookie)===null||i===void 0?void 0:i.match(/(?:^|;\s*)XSRF-TOKEN=([^;]+)/))===null||o===void 0?void 0:o[1];return s&&(this.antiCsrfToken=s),this._result}applyHeader(t){this.antiCsrfToken&&PP(t,{"X-Xsrf-Token":this.antiCsrfToken})}}class Zh extends Xv{constructor(t,r){super(i0e,{key:t,interpolationOptions:r},GYt.t)}get status(){return this.interpolationOptions.status}}var bz=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(h){a(h)}}function l(d){try{c(n.throw(d))}catch(h){a(h)}}function c(d){d.done?o(d.value):i(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})};class XYt extends Hw{constructor(t,r=!1){super("sso"),this.url=mu(t,!0),this._enableSilentPreAuth=r}authenticate(t=!0){var r;return bz(this,void 0,void 0,function*(){try{this._authenticating=!0;const{isAuthenticated:n,loginUrl:i}=yield this.checkAuthentication();if(n)return this._resolve(!0),yield this._result;const o=o0e(i,{return_to:window.location.href});if(this._enableSilentPreAuth&&t){yield this.authenticateSilent(o);const{isAuthenticated:a}=yield this.checkAuthentication();if(a)return this._resolve(!0),yield this._result}(r=window==null?void 0:window.location)===null||r===void 0||r.replace(o)}finally{this._resolve(!1),this._authenticating=!1}return this._result})}authenticateSilent(t){return bz(this,void 0,void 0,function*(){const r=document.createElement("iframe");r.style.display="none",document.body.appendChild(r),r.src=t,yield new Promise(n=>{r.onload=()=>{n(!0)}}),document.body.removeChild(r)})}checkAuthentication(){var t,r,n;return bz(this,void 0,void 0,function*(){const i=a0e(mu(this.url),"api/auth/isauth"),o=yield fetch(i,{headers:{Internal:"true"},credentials:"include"}).catch(DP);if(o.status===200&&!(!((r=(t=o.headers)===null||t===void 0?void 0:t.get("Content-Type"))===null||r===void 0)&&r.includes("application/json")))throw new Zh("errors.authFailed");const a=yield o.json();if(!a.isAuthenticated){if(!a.ssoEnabled)throw new Zh("errors.ssoNotEnabled");if(!a.loginUrl)throw new Zh("errors.ssoNoLoginUrl")}const s=a.loginUrl&&((n=a.loginUrl)===null||n===void 0?void 0:n.search(/^(\/[^/]+)*?\/api\/v\d+\/\w+\/login[/]?$/))!==-1?a0e(this.url,a.loginUrl):a.loginUrl||"";return{isAuthenticated:a.isAuthenticated,loginUrl:s}})}}function s0e(e){return e.type==="sso"}var KYt=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(h){a(h)}}function l(d){try{c(n.throw(d))}catch(h){a(h)}}function c(d){d.done?o(d.value):i(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})};class QYt extends Hw{constructor(t,r){super("wat"),this.url=`${mu(t)}api/v1/wat/sessionToken`,this.body=`{"webAccessToken": "${r}"}`}authenticate(){return KYt(this,void 0,void 0,function*(){if(this._tried)return this._result;this._tried=!0;try{this._authenticating=!0;const t=yield fetch(this.url,{method:"POST",headers:{accept:"application/json","Content-Type":"application/json"},body:this.body}).catch(DP);if(t.ok){const r=yield t.json();this._initialiser=r.initialiser,this._webSessionToken=r.webSessionToken,this._resolve(!0)}}catch(t){throw new Zh("errors.tokenAuthFailed")}finally{this._resolve(!1),this._authenticating=!1}return this._result})}applyHeader(t){if(this._webSessionToken&&this._initialiser){const r=this._webSessionToken,n=this._initialiser;PP(t,{Authorization:r,Initialiser:n})}}}function l0e(e){return e.type==="wat"}var c0e=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(h){a(h)}}function l(d){try{c(n.throw(d))}catch(h){a(h)}}function c(d){d.done?o(d.value):i(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})};function JYt(e){var t,r,n;return c0e(this,void 0,void 0,function*(){if(!e.ok){const i=(t=e.headers)===null||t===void 0?void 0:t.get("Content-Type"),o=i&&i.includes("application/json")?yield e.json().catch(()=>({})):{};throw new Zh("errors.responseError",{status:e.status.toString(),statusText:e.statusText,errorCode:(r=o.error)===null||r===void 0?void 0:r.code,errorMessage:(n=o.error)===null||n===void 0?void 0:n.message,context:e.statusText?"withStatusText":"onlyStatus"})}return e})}function eqt(e,t){if(t.invalidate(),aqt(t))throw new Zh("errors.passwordAuthFailed");if(qYt(t)||l0e(t))throw new Zh("errors.tokenAuthFailed");return s0e(t)&&!t.isAuthenticating()&&t.authenticate(),e}function tqt(e){return e.message==="Failed to fetch"&&e.name==="TypeError"}function rqt(){return console.warn("Network error. Verify server is accessible and your domain is added to 'CORS Allowed Origins' in Sisense Admin Panel -> Security Settings."),Promise.reject(new Zh("errors.networkError"))}const nqt=e=>t=>c0e(void 0,void 0,void 0,function*(){return t.status===401?eqt(t,e):t.ok?t:JYt(t)}),DP=e=>tqt(e)?rqt():Promise.reject(e);var iqt=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(h){a(h)}}function l(d){try{c(n.throw(d))}catch(h){a(h)}}function c(d){d.done?o(d.value):i(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})};class oqt extends Hw{constructor(t,r,n){super("password"),this._authheader="",this.url=`${mu(t)}api/v1/authentication/login`;const i=encodeURIComponent(r),o=encodeURIComponent(n);this.body=`username=${i}&password=${o}`}authenticate(){return iqt(this,void 0,void 0,function*(){if(this._tried)return this._result;this._tried=!0;try{this._authenticating=!0;const t=yield fetch(this.url,{method:"POST",headers:{accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:this.body}).catch(DP);if(t.ok){const r=yield t.json();this._authheader=r.access_token}}finally{this._resolve(!!this._authheader),this._authenticating=!1}return this._result})}applyHeader(t){const r="Bearer "+this._authheader;PP(t,{Authorization:r})}}function aqt(e){return e.type==="password"}function sqt({url:e,username:t,password:r,token:n,wat:i,ssoEnabled:o=!1,enableSilentPreAuth:a=!1,useFusionAuth:s=!1}){const l=mu(e);return o?new XYt(mu(e,!0),a):t&&r?new oqt(l,t,r):n?new YYt(l,n):i?new QYt(l,i):s?new ZYt:null}var lqt=function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(h){a(h)}}function l(d){try{c(n.throw(d))}catch(h){a(h)}}function c(d){d.done?o(d.value):i(d.value).then(s,l)}c((n=n.apply(e,t||[])).next())})};class cqt{constructor(t,r,n){this.url=mu(t),this.auth=r,this.env=n}login(){return this.auth.authenticate()}call(t,r,n){return lqt(this,void 0,void 0,function*(){this.auth.isAuthenticating()&&(yield this.auth.authenticated()),r.headers=r.headers||{},s0e(this.auth)&&(r.credentials="include"),this.auth.applyHeader(r.headers);const i=n!=null&&n.skipTrackingParam?t:o0e(t,{trc:this.env}),o=yield fetch(i,r).then(nqt(this.auth)).catch(DP);if(!(o.status===204||o.status===304))return n!=null&&n.returnBlob?o.blob():o.json().catch(a=>{var s,l;if(!(!((l=(s=a==null?void 0:a.message)===null||s===void 0?void 0:s.includes)===null||l===void 0)&&l.call(s,"Unexpected end of JSON input")))throw a})})}post(t,r,n={},i,o){const a=Object.assign({method:"POST",body:o!=null&&o.nonJSONBody?r:JSON.stringify(r),headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json;charset=UTF-8"},signal:i},n);return this.call(this.url+t,a,o)}patch(t,r,n={},i,o){const a=Object.assign({method:"PATCH",body:o!=null&&o.nonJSONBody?r:JSON.stringify(r),headers:{Accept:"application/json, text/plain, */*","Content-Type":"application/json;charset=UTF-8"},signal:i},n);return this.call(this.url+t,a,o)}get(t,r={},n){return this.call(this.url+t,Object.assign(Object.assign({},r),{method:"GET"}),n)}delete(t,r={},n){return this.call(this.url+t,Object.assign(Object.assign({},r),{method:"DELETE"}),n)}}const uqt={enabled:!0,delay:500},dqt={locale:HT(),dateConfig:YR,loadingIndicatorConfig:uqt,translationConfig:{language:"en",customTranslations:[]},queryCacheConfig:{enabled:!1},queryLimit:Oqe,tabberConfig:{enabled:!0},accessibilityConfig:{enabled:!1},errorBoundaryConfig:{alwaysShowErrorText:!1},trackingConfig:{enabled:!0},jumpToDashboardConfig:{enabled:!1}};function hqt(e,t,r){return Jt(this,null,function*(){var i;const n=yield fqt(t,r);return yn.withOptions({mergeArrays:!1},dqt,{locale:HT((i=e==null?void 0:e.translationConfig)==null?void 0:i.language)},n,e)})}function pqt(e){const t={};return e.forEach(r=>{t[r.key]=r}),t}function fqt(e,t=!1){return Jt(this,null,function*(){var o,a;const r=yield e.get("api/globals");if(!r)throw new ft("errors.serverSettingsNotLoaded");const n=t?{colors:Z1().palette.variantColors}:yield qie(Vie(r.designSettings),e);return{serverThemeSettings:Gie(r.designSettings,n,e.url),serverLanguage:r.language,serverVersion:r.version,serverFeatures:pqt(r.features),user:{tenant:{name:((a=(o=r.user)==null?void 0:o.tenant)==null?void 0:a.name)||qte}}}})}function gqt(e,t){return t===qte?e:e.replace(`/${t}`,"")}function mqt(){window.addEventListener("unhandledrejection",e=>{e.reason instanceof Error?console.error(e.reason.message):console.error(e.reason)})}const u0e=l=>Jt(this,[l],function*({defaultDataSource:e,url:t,token:r,wat:n,ssoEnabled:i,appConfig:o,enableSilentPreAuth:a,useFusionAuth:s}){if(t===void 0)throw new ft("errors.sisenseContextNoAuthentication");const c=mu(t),d=mu(t,!0),h=sqt({url:d,token:r,wat:n,ssoEnabled:i,enableSilentPreAuth:a,useFusionAuth:s});if(!h)throw new ft("errors.sisenseContextNoAuthentication");mqt();const u=new cqt(c,h,"sdk-ui-2.4.1"),g=yield u.login(),f=l0e(h)||!g,p=yield hqt(o||{},u,f),x=new MX(gqt(c,p.user.tenant.name),h),S=new $7e(u,x);return{httpClient:u,pivotClient:x,queryClient:S,settings:p,defaultDataSource:e,queryCache:{clear:_re}}}),tg=(e,t)=>ce.useMemo(()=>yn.withOptions({mergeArrays:!1},t,e||{}),[e,t]),d0e={filtersPanel:{visible:!0,collapsedInitially:!1,persistCollapsedStateToLocalStorage:!1,actions:{addFilter:{enabled:!1,multiSelect:{visible:!0}},editFilter:{enabled:!1,multiSelect:{visible:!0}},deleteFilter:{enabled:!1}}},toolbar:{visible:!0},widgetsPanel:{responsive:!1,editMode:{enabled:!1,showDragHandleIcon:!0,applyChangesAsBatch:{enabled:!0,historyLimit:20}}}},xz=xe(ue({},d0e),{persist:!1,sharedMode:!1}),vqt=Cr({componentName:"DashboardById"})(({dashboardOid:e,config:t})=>{const r=tg(t,xz),{dashboard:n,isLoading:i,isError:o,error:a,dispatchChanges:s}=Mve({dashboardOid:e,includeWidgets:!0,includeFilters:!0,persist:r.persist,sharedMode:r.sharedMode}),l=ce.useCallback(h=>{const u=EJt(h);u&&s(u)},[s]);if(o&&a)throw new ft("errors.dashboardLoadFailed",{error:a.message});const c=ce.useMemo(()=>n&&vE(n),[n]),d=tg(t,tg(c==null?void 0:c.config,xz));return pe(Qu,{isVisible:i,children:c&&pe(Hz,xe(ue({},c),{onChange:l,config:d}))})}),yqt=Ye("button",{target:"e14rhw2k0",label:"ClearSelectionButton"})("color:",({theme:e})=>{var t;return(t=e.chart)==null?void 0:t.textColor},";background:none;font-size:13px;border:none;height:26px;padding:0 6px 0 2px;margin:0 4px 0 4px;border-radius:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;&:hover{background-color:rgba(247,247,247,1);}"),bqt=Ye("span",{target:"e14rhw2k1",label:"ClearSelectionText"})("color:",({theme:e})=>{var t;return(t=e.chart)==null?void 0:t.textColor},";display:inline-block;padding-top:3px;white-space:nowrap;"),xqt=({onClick:e})=>{var n;const{themeSettings:t}=pt(),{t:r}=At();return Ve(yqt,{onClick:e,theme:t,children:[pe("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",children:pe("path",{fill:(n=t.chart)==null?void 0:n.textColor,d:"M7.187 7l9.774 10.279A1 1 0 0 0 17 17V8a1 1 0 0 0-1-1H7.187zm9.018 10.979L6.206 7.463l.487-.415A1 1 0 0 0 6 8v9a1 1 0 0 0 1 1h9c.07 0 .139-.007.205-.021zM7 6h9a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z"})}),pe(bqt,{theme:t,children:r("commonFilter.clearSelectionButton")})]})};function wqt(e){const t={};return{flatFilters:e.reduce((n,i)=>(Qi(i)?(t[i.config.guid]||(t[i.config.guid]=[]),i.filters.forEach(o=>{t[i.config.guid].push(o),n.push(o)})):n.push(i),n),[]),cascadingToPureFiltersMap:t}}function h0e(e,t,r){const n=t.filter(Qi);return _qt(e,n).map(o=>{if(Cqt(o)){const a=n.find(l=>l.config.guid===o.groupId);if(!a)throw new ft("errors.cascadingFilterOriginalNotFound");const s=r==null?void 0:r.shouldResetFiltersDeeperThanModified;return Sqt(o,a,{shouldResetFiltersDeeperThanModified:s})}return o})}function Cqt(e){return"groupId"in e}function _qt(e,t){const r=[];return e.forEach(n=>{const i=t.find(o=>o.filters.some(a=>Ey(a)===Ey(n)));if(i){const o=i.config.guid,a=r.find(s=>"groupId"in s&&s.groupId===o);a?a.filters.push(n):r.push({groupId:o,filters:[n],previousFilters:i.filters})}else r.push(n)}),r}function Sqt(e,t,r){const n=r!=null&&r.shouldResetFiltersDeeperThanModified?Tqt(e.filters,e.previousFilters):e.filters,i=kqt(n,t.config.disabled);return jD(n,{guid:t.config.guid,disabled:i})}function kqt(e,t){return e.some(n=>n.config.disabled!==t)?!t:t}function Mqt(e,t,r){const{flatFilters:n,cascadingToPureFiltersMap:i}=wqt(e);return{pureFilters:n,updateFilters:a=>{const s=h0e(a,e,{shouldResetFiltersDeeperThanModified:!0});t(s)},pureFiltersIgnoringRules:Aqt(r,i)}}function Tqt(e,t){const r=e.reduce((n,i,o)=>{const a=t.find(s=>N8(s,i));return a&&!Ihe(i,a)?o:n},-1);return r===-1?e:e.map((n,i)=>i>r?fE(n):n)}function Aqt(e,t){var r;return{all:e.all,ids:((r=e.ids)==null?void 0:r.reduce((n,i)=>{const o=t[i];return o?n.concat(o.map(a=>a.config.guid)):n.concat(i)},[]))||[]}}const p0e={applyMode:cw.HIGHLIGHT,shouldAffectFilters:!0,ignoreFilters:{all:!1,ids:[]},forceApplyBackgroundFilters:!0};function Eqt(e,t){return e==="table"?{applyMode:cw.FILTER,shouldAffectFilters:!1,ignoreFilters:yn(p0e.ignoreFilters,t.ignoreFilters||{})}:yn(p0e,t)}function Pqt(e,t,r,n,i,o,a){const s={},l=Eqt(r,i),{pureFilters:c,updateFilters:d,pureFiltersIgnoringRules:h}=Mqt(e,t,l.ignoreFilters||{}),u=c.filter(U=>!U.config.disabled),g=iFt(u,h),f=R8(r,n),p=l.shouldAffectFilters&&f.length,[x,S]=Lqt(g,f,l.applyMode),j=l.forceApplyBackgroundFilters?Ui(Dqt(c),x):x;if(s.filters=j,s.highlights=S,s.onDataPointsSelected=(U,B)=>{const R=[];if(p){const E=Rhe(r,n,U);E&&R.push(E);const N=gE(r,n,U),{filters:M,isSelection:$}=F8(N,c,!0),T=o($?"commonFilter.selectMenuItem":"commonFilter.unselectMenuItem"),C=Fhe(T,()=>{d(Ui(c,M))});R.push(C)}R.length&&(a==null||a({id:lw.WIDGET_POINTS_CROSSFILTERING,position:{left:B.clientX,top:B.clientY},itemSections:R}))},s.onDataPointContextMenu=(U,B)=>{const R=[];if(p){const E=Rhe(r,n,[U]);E&&R.push(E);const N=gE(r,n,[U]),{filters:M,isSelection:$}=F8(N,c,!0),T=o($?"commonFilter.selectMenuItem":"commonFilter.unselectMenuItem"),C=Fhe(T,()=>{d(Ui(c,M))});R.push(C)}R.length&&(a==null||a({id:lw.WIDGET_POINTS_CROSSFILTERING,position:{left:B.clientX,top:B.clientY},itemSections:R}))},p){s.onDataPointClick=E=>{const N=gE(r,n,[E]),{filters:M}=F8(N,c);d(Ui(c,M))};const U=u.filter(E=>f==null?void 0:f.some(N=>go(E)&&Va(E.attribute,N)&&!I8(E)&&!E.config.locked)),B=!!U.length,R=()=>{const E=U.map(fE);d(Ui(c,E))};B&&(s.renderToolbar=(E,N)=>{const M=f.map(({expression:$})=>$).join(";");return Ve("div",{style:{display:"flex"},children:[pe(xqt,{onClick:R}),N]},M)})}return s}function Dqt(e){return e.map(t=>{var r;return(r=t.config)==null?void 0:r.backgroundFilter}).filter(t=>!!t)}function Lqt(e,t,r){if(r===cw.HIGHLIGHT){const[n,i]=sw(e,a=>t.every(s=>!Va(s,a.attribute))),o=i.filter(a=>!I8(a));return[n,o]}return[e,[]]}function Oqt(e,t){return R8(e,t)[0]}function Iqt(e){return[...ok,...ak,...sk,...lk,...ck].includes(e)}function Nqt(e,t){return R8(e,t).length===1}function Rqt(e,t){return Nqt(e,t)&&Iqt(e)}function f0e(e,t,r){const n=i=>!!i&&!Va(r,Ks(i));if(Hl(e)||qd(e)||Zd(e)||Bm(e)){const i=t.category[0];if(n(i))return xe(ue({},t),{category:[r]})}else if(Ul(e)){const i=t,o=["x","y","breakByPoint","breakByColor"];for(const a of o){const s=i[a];if(s&&!qr(s)&&n(s))return xe(ue({},i),{[a]:r})}}return t}function g0e(e,t,r){return e.map(n=>{const i=["x","y","breakByPoint","breakByColor"],o=[...i,"size"].some(s=>s in n),a=i.find(s=>r[s]&&!qr(r[s]));if(o){const s=t,l=s.type==="mouseup";l&&console.warn("No drilldown support for multi-selection in scatter chart");const c=l?n[a]:s.point.options.custom[bpe(`{masked ${a}`)];return{categoryValue:c,categoryDisplayValue:c}}return n})}function Fqt(e,t){const[r,n]=ru(ce.useMemo(()=>Ll(e),[e]),{onLocalStateChange:ce.useCallback(u=>{const{filters:g,relations:f}=u;t&&t(os(g,f))},[t])}),{filters:i,relations:o}=r,a=ce.useMemo(()=>os(i,o),[i,o]),s=ce.useCallback(u=>{if(wu(u)){const{filters:g,relations:f}=Ll(u);n({filters:g||[],relations:f||null})}else n({filters:u,relations:null})},[n]),l=ce.useCallback(u=>{const g=Ui(i,[u]);n({filters:g,relations:Ol(i,o,g)})},[i,o,n]),c=ce.useCallback(u=>{n({filters:u,relations:Ol(i,o,u)})},[i,o,n]),d=ce.useMemo(()=>i.some(u=>Qi(u)),[i]),h=ce.useCallback(u=>{if(!o)return u;const g=d?h0e(u,i):u,f=Ol(i,o,g);return os(g,f)},[d,i,o]);return{regularFilters:i,addFilter:l,filtersOrFilterRelations:a,setFiltersOrFilterRelations:s,setFilters:c,applyRelationsToOtherFilters:h}}const m0e=({initialFilters:e=[],openMenu:t,onBeforeMenuOpen:r,onFiltersChange:n}={})=>{const{t:i}=At(),{filtersOrFilterRelations:o,regularFilters:a,addFilter:s,setFiltersOrFilterRelations:l,setFilters:c,applyRelationsToOtherFilters:d}=Fqt(e,n),h=ce.useCallback((u,g={})=>{var B,R;if(Jb(u))return u;const f=nHe(u),p=u,x=ki(u),j="drilldownOptions"in u&&((R=(B=u.drilldownOptions)==null?void 0:B.drilldownSelections)==null?void 0:R.length)?f0e(u.chartType,u.dataOptions,fD(u.drilldownOptions.drilldownSelections).nextDimension):u.dataOptions,U=Pqt(a,c,f,j,g,i,t);return x.highlights=Ui(U.highlights,p.highlights),x.onBeforeMenuOpen=r,U.onDataPointClick&&wQ(x,U.onDataPointClick),x.filters=d(Ui(U.filters,k_(p.filters))),U.onDataPointClick&&wQ(x,U.onDataPointClick),U.onDataPointsSelected&&iHe(x,U.onDataPointsSelected),U.onDataPointContextMenu&&CQ(x,U.onDataPointContextMenu),U.renderToolbar&&oHe(x,U.renderToolbar),x},[a,c,i,t,r,d]);return{filters:o,setFilters:l,addFilter:s,connectToWidgetProps:h}};var jqt=W$(function(e,t,r,n){dD(e,t,r,n)});const Bqt=(e,t)=>jqt(ki(e),t,(r,n)=>{if(Array.isArray(n))return n});function zqt(e){const{target:t,onChange:r}=e,n=Array.isArray(t),i=ce.useMemo(()=>n?t:[t],[n,t]),o=ce.useCallback((a,s)=>{i[s]&&"onChange"in i[s]&&i[s].onChange(a),r(a,n?s:void 0)},[i,n,r]);return ce.useMemo(()=>{const a=i.map((s,l)=>xe(ue({},s),{onChange:c=>o(c,l)}));return n?a:a[0]},[n,i,o])}const $qt=({combineMenus:e})=>{const t=ce.useRef([]),r=aw(),n=ce.useCallback(()=>{const o=t.current.length===1?t.current[0]:e(t.current);r.openMenu(xe(ue({},o),{onClose:()=>{t.current=[]}}))},[r,e]);return{openMenu:ce.useCallback(o=>{t.current.push(o),n()},[n])}},Wqt=({layout:e,layoutManagers:t})=>{const[r,n]=ce.useState(null);return{layout:r||Kd(...t.map(i=>i.manageLayout))(e),setLayout:n}},Hqt=e=>e.customWidgetType==="WidgetsTabber";function Uqt(e,t,r){var n;for(const i of Object.keys(t)){const o=t[i],a=o.tabs[r[i]];if(o.tabs.some(l=>l.displayWidgetIds.includes(e))&&!((n=a==null?void 0:a.displayWidgetIds)!=null&&n.includes(e)))return!1}return!0}const v0e=e=>Object.keys(e).reduce((t,r)=>(t[r]=e[r].activeTab,t),{}),Gqt=({widgets:e,config:t={}})=>{const r=ce.useMemo(()=>v0e(t),[t]),[n,i]=ce.useState(r);ce.useEffect(()=>{const s=v0e(t);i(l=>Object.keys(s).some(d=>l[d]!==s[d])?s:l)},[t]);const o=e.map(s=>Hqt(s)?xe(ue({},s),{onTabSelected:l=>{i(c=>xe(ue({},c),{[s.id]:l}))},selectedTab:n[s.id]||0}):s);return{layoutManager:{manageLayout:ce.useCallback(s=>xe(ue({},s),{columns:s.columns.map(l=>xe(ue({},l),{rows:l.rows.map(c=>{const d=c.cells.filter(h=>Uqt(h.widgetId,t,n));return d.length===c.cells.length||d.length===c.cells.length?c:{cells:d.map(h=>xe(ue({},h),{widthPercentage:100/d.length}))}}).filter(c=>c.cells.length>0)}))}),[t,n]),name:"TabberWidget"},widgets:o}},Vqt=({dashboardOid:e,filters:t,mergeTargetDashboardFilters:r,displayToolbarRow:n,displayFilterPane:i})=>{const{dashboard:o,isLoading:a,isError:s,error:l}=kve({dashboardOid:e,includeWidgets:!0,includeFilters:!0,persist:!1}),c=ce.useMemo(()=>{const g=o&&vE(o);if(g&&t)if(r){const f=g.filters||[],p=Array.isArray(t)&&Array.isArray(f)?Ui(f,t):t;return xe(ue({},g),{filters:p})}else return xe(ue({},g),{filters:t});return g},[o,t,r]),d=tg(c==null?void 0:c.config,xz),h=tg(void 0,d),u=ce.useMemo(()=>xe(ue({},h),{toolbar:xe(ue({},h.toolbar),{visible:n}),filtersPanel:xe(ue({},h.filtersPanel),{visible:i})}),[h,n,i]);if(s&&l)throw new ft("errors.dashboardLoadFailed",{error:l.message});return pe(Qu,{isVisible:a,children:c&&pe(Hz,xe(ue({},c),{config:u}))})},Yqt=(e,t,r)=>{const n=[];try{if(Na(t)&&t.dataOptions){const i=t.dataOptions,o=a=>{var s;if((s=a==null?void 0:a.column)!=null&&s.context){const l=a.column.context;if(typeof l=="object"&&l!==null)for(const c in l)l[c]&&typeof l[c].filterType!="undefined"&&n.push(l[c])}};"value"in i&&Array.isArray(i.value)&&i.value.forEach(a=>o(a))}return qqt(n,r.sendFormulaFiltersDuplicate)}catch(i){return console.warn("Error extracting formula context filters:",i),[]}},qqt=(e,t)=>{if(e.length===0)return e;const r=new Map;e.forEach(i=>{const o=i.attribute.expression;r.has(o)||r.set(o,[]),r.get(o).push(i)});const n=[];return r.forEach((i,o)=>{if(i.length===1)n.push(i[0]);else if(t!=="none")if(typeof t=="number")if(t>=1&&t<=i.length){const a=i[t-1];n.push(a)}else console.warn(`Dimension ${o}: invalid sendFormulaFiltersDuplicate number ${t}, treating as "none"`);else{const a=i[0];n.push(a)}}),n},Zqt=e=>{var i,o;const t=[],r=((i=e.entries)==null?void 0:i.category)||[];for(const a of r)if(a.attribute&&a.value!==void 0&&a.value!==null){const s=Hi(a.attribute,[String(a.value)]);t.push(s)}const n=((o=e.entries)==null?void 0:o.breakBy)||[];for(const a of n)if(a.attribute&&a.value!==void 0&&a.value!==null){const s=Hi(a.attribute,[String(a.value)]);t.push(s)}return t},wz=(e,t)=>t?t.length===0?[]:e.reduce((r,n)=>{if(Qi(n)){const i=n.filters.filter(o=>{const a=o.attribute.expression;return t.includes(a)});if(i.length===0)return r;if(i.length===1)r.push(i[0]);else{const o=jD(i,{guid:n.config.guid,disabled:n.config.disabled,locked:n.config.locked});r.push(o)}}else{const i=n.attribute.expression;t.includes(i)&&r.push(n)}return r},[]):e,Cz=(e,t,r,n,i,o,a)=>{const s=Zqt(n),l=wz(Yqt(n,r,e),e.includeWidgetFilterDims),c=wz(i,e.includeDashFilterDims),d=wz(o,e.includeWidgetFilterDims),h=Ui(Ui(Ui(s,c),d),l);return()=>Jt(this,null,function*(){const u=ce.createElement(Vqt,{key:`jtd-${t.id}`,dashboardOid:t.id,filters:h,mergeTargetDashboardFilters:e.mergeTargetDashboardFilters||!1,displayToolbarRow:e.displayToolbarRow||!1,displayFilterPane:e.displayFilterPane||!1});yield a({title:t.caption,width:e.modalWindowWidth,height:e.modalWindowHeight,measurement:e.modalWindowMeasurement,allowResize:e.modalWindowResize,content:u})})},y0e=(e,t,r,n,i,o,a)=>{if(!e)return null;const s=e.drillTargets.length>1,l=e.drillToDashboardRightMenuCaption||a("jumpToDashboard.defaultCaption");if(s)return{caption:l,subItems:[{items:e.drillTargets.map(d=>({caption:d.caption,onClick:Cz(e,d,r,t,n,i,o)}))}]};const c=e.drillTargets[0];return{caption:`${l} ${c.caption}`,onClick:Cz(e,c,r,t,n,i,o)}},Xqt=({widgetOptions:e,dashboardFilters:t=[],widgetFilters:r=new Map,openMenu:n})=>{var c;const i=jT(),o=At().t,{app:a}=hr(),s=ce.useMemo(()=>{var d;return(d=i==null?void 0:i.openModal)!=null?d:()=>Jt(this,null,function*(){return""})},[i==null?void 0:i.openModal]);return{connectToWidgetProps:ce.useCallback(d=>{var g,f;if(!((g=a==null?void 0:a.settings.jumpToDashboardConfig)!=null&&g.enabled))return d;const h=(f=e[d.id])==null?void 0:f.jtdConfig;if(!h||!h.enabled)return d;const u=r.get(d.id)||[];if(h.navigateType===Nf.CLICK){if(Na(d)||Jb(d)){const p=d.onDataPointClick;d.onDataPointClick=Gl([p,(x,S)=>{if(h.drillTargets.length===1){const j=h.drillTargets[0];Cz(h,j,d,x,t,u,s)()}else{const j=y0e(h,x,d,t,u,s,o);if(!j)return;const U=[{items:[j]}];n==null||n({id:"jump-to-dashboard-menu",position:{left:S.clientX,top:S.clientY},itemSections:U})}}])}}else if(h.navigateType===Nf.RIGHT_CLICK&&Na(d))return CQ(d,(x,S)=>{const j=y0e(h,x,d,t,u,s,o);if(!j)return;const U=[{items:[j]}];n==null||n({id:"jump-to-dashboard-menu",position:{left:S.clientX,top:S.clientY},itemSections:U})}),d;return d},[e,n,s,t,r,o,(c=a==null?void 0:a.settings.jumpToDashboardConfig)==null?void 0:c.enabled])}},Kqt=e=>e.id===lw.WIDGET_POINTS_CROSSFILTERING;function b0e(e){return e.id===lw.WIDGET_POINTS_DRILLDOWN}function Qqt(e){var a;if(e.length===1)return e[0];const t=e.find(s=>Kqt(s)),r=e.find(s=>b0e(s)),n=e.find(s=>Jqt(s)),i=(a=t==null?void 0:t.itemSections[0])!=null?a:r==null?void 0:r.itemSections[0],o={position:e[0].position,onClose:Gl(e.map(({onClose:s})=>s)),itemSections:i?[i]:[]};if(t){const s=t.itemSections.filter(({id:l})=>l!==iv.CROSSFILTERING_CHART_POINTS_SELECTION);o.itemSections.push(...s)}if(r){const s=r.itemSections.filter(({id:l})=>l!==iv.DRILLDOWN_CHART_POINTS_SELECTION);o.itemSections.push(...s)}return n&&o.itemSections.push(...n.itemSections),o}function Jqt(e){return e.id==="jump-to-dashboard-menu"}function LP(e,{onFiltersChange:t}={}){var R;const{filters:r,widgets:n,widgetsOptions:i}=e,[o]=ru(n),[a,s]=ru(o),{openMenu:l}=$qt({combineMenus:Qqt}),c=ce.useCallback(E=>b0e(E)?(l(E),null):E,[l]),{filters:d,setFilters:h,connectToWidgetProps:u}=m0e({initialFilters:r,openMenu:l,onFiltersChange:t,onBeforeMenuOpen:c}),{connectToWidgetProps:g}=Xqt({widgetOptions:i||{},dashboardFilters:Array.isArray(r)?r:[],widgetFilters:n.reduce((E,N)=>(E.set(N.id,N.filters||[]),E),new Map),openMenu:l}),f=zqt({target:a,onChange:ce.useCallback((E,N)=>{s(M=>{const $=ki(M);return $[N]=Bqt(M[N],E),$})},[s])}),p=ce.useMemo(()=>f.map(E=>{var N;return ue({},g(u(E,(N=i==null?void 0:i[E.id])==null?void 0:N.filtersOptions)))}),[f,i,u,g]),{layoutManager:x,widgets:S}=Gqt({widgets:p,config:e.tabbersOptions}),{layout:j,setLayout:U}=Wqt({layout:((R=e.layoutOptions)==null?void 0:R.widgetsPanel)||Hpe(p),layoutManagers:[x]}),B=ce.useMemo(()=>xe(ue({},e.layoutOptions),{widgetsPanel:j}),[j,e.layoutOptions]);return{dashboard:xe(ue({},e),{filters:d,widgets:S,layoutOptions:B}),setFilters:h,setWidgetsLayout:U}}const eZt=Xi("useComposedDashboard")(LP),_z=({styleOptions:e})=>{const{themeSettings:t}=pt();return{themeSettings:ce.useMemo(()=>{const o=e!=null?e:{},{palette:n}=o,i=ut(o,["palette"]);return xe(ue({},n&&{palette:n}),{dashboard:ue(ue({},t.dashboard),i)})},[e,t.dashboard])}},tZt=Xi("useDashboardTheme")(_z);var rZt="Expected a function";function nZt(e){if(typeof e!="function")throw new TypeError(rZt);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function iZt(e,t){if(e==null)return{};var r=py(K3(e),function(n){return[n]});return t=ip(t),Pae(e,r,function(n,i){return t(n,i[0])})}function oZt(e,t){return iZt(e,nZt(ip(t)))}const aZt=Cr({componentName:"WidgetById",customContextErrorMessageKey:"errors.widgetByIdNoSisenseContext"})(e=>{const U=e,{widgetOid:t,dashboardOid:r,includeDashboardFilters:n=!1,filters:i,highlights:o,filtersMergeStrategy:a,drilldownOptions:s,styleOptions:l}=U,c=ut(U,["widgetOid","dashboardOid","includeDashboardFilters","filters","highlights","filtersMergeStrategy","drilldownOptions","styleOptions"]),{dashboard:d,isLoading:h,error:u}=z8({dashboardOid:r,includeWidgets:!0,includeFilters:n});if(u)throw new ft("errors.widgetLoadFailed",{error:u.message});if(d&&!d.widgets.some(B=>B.oid===t))throw new ft("errors.widgetWithOidNotFoundInDashboard",{widgetOid:t,dashboardOid:r});const g=ce.useMemo(()=>{if(d)return Kd(sZt(t),lZt)(d)},[d,t]),f=ce.useMemo(()=>g?vE(g):void 0,[g]),{dashboard:p}=LP(f||{widgets:[]}),{themeSettings:x}=_z(f?p:{}),S=p==null?void 0:p.widgets.find(B=>B.id===t),j=ce.useMemo(()=>{if(S)return Kd(cZt(i,a),uZt(o,a),dZt(s),hZt(l),pZt(c))(S)},[S,i,a,o,s,l,c]);return pe(lf,{theme:x,children:pe(Qu,{isVisible:h,children:j&&pe(yw,ue({},j))})})});function sZt(e){return t=>{const r=t.widgets.find(n=>n.oid===e);return r?xe(ue({},t),{widgets:[r],widgetsOptions:{[r.oid]:t.widgetsOptions[r.oid]}}):t}}function lZt(e){const t=Object.entries(e.widgetsOptions).map(([r,n])=>[r,xe(ue({},n),{filtersOptions:xe(ue({},n.filtersOptions),{shouldAffectFilters:!1})})]);return xe(ue({},e),{widgetsOptions:Object.fromEntries(t)})}function cZt(e,t){return r=>{if(!e||!("filters"in r))return r;const n=mE(r.filters||[],e,t);return xe(ue({},r),{filters:n})}}function uZt(e,t){return r=>{if(!e||!("highlights"in r))return r;const n=k_(mE(r.highlights,e,t));return xe(ue({},r),{highlights:n})}}function dZt(e){return t=>!e||!("drilldownOptions"in t)?t:xe(ue({},t),{drilldownOptions:ue(ue({},t.drilldownOptions),e)})}function hZt(e){return t=>!e||!("styleOptions"in t)?t:xe(ue({},t),{styleOptions:ue(ue({},t.styleOptions),e)})}function pZt(e){return t=>{const r=oZt(e,xh);return ue(ue({},t),r)}}const fZt=Cr({componentName:"ExecuteQuery"})(({dataSource:e,dimensions:t,measures:r,filters:n,highlights:i,count:o,offset:a,ungroup:s,children:l,onDataChanged:c,onBeforeQuery:d})=>{const h=_E({dataSource:e,dimensions:t,measures:r,filters:n,highlights:i,count:o,offset:a,ungroup:s,onBeforeQuery:d}),u=h.data,g=hl(u);return u&&g!==u&&(c==null||c(u)),pe(Kt,{children:h&&(l==null?void 0:l(h))})});function x0e(e,t){return Ya(e,t)}const gZt=Xi("useExecuteCsvQuery")(w0e);function w0e(e){const t=lfe(e),r=nd(e,t),[n,i]=ce.useReducer(x0e,{isLoading:!0,isError:!1,isSuccess:!1,status:"loading",error:void 0,data:void 0}),{isInitialized:o,app:a}=hr();return ce.useEffect(()=>{if(o||i({type:"error",error:new ft("errors.executeQueryNoSisenseContext")}),r(a)){i({type:"loading"});const{dataSource:s,dimensions:l,measures:c,filters:d,highlights:h,count:u,offset:g,config:f,onBeforeQuery:p}=e,{filters:x,relations:S}=is(d);eXe({dataSource:s,dimensions:l,measures:c,filters:x,filterRelations:S,highlights:h,count:u,offset:g},a,{onBeforeQuery:p}).then(j=>f!=null&&f.asDataStream?(i({type:"success",data:j}),null):j.text()).then(j=>j&&i({type:"success",data:j})).catch(j=>{i({type:"error",error:j})})}},[a,o,e,r]),n.data&&t?x0e(n,{type:"loading"}):n}function mZt(e,t){const{filters:r,highlights:n}=C0e(e,t),i=Mpe(t.metadata.panels);return{filters:Ui(r,i),highlights:n}}function C0e(e,t){const r=t.metadata.ignore,{filters:n,highlights:i}=bZt(vZt(e.filters||[],r),yZt(e.filters||[]),t);return{filters:n.map(o=>lp(o.jaql,o.instanceid)),highlights:i.map(o=>lp(o.jaql))}}function _0e(e){const t=[];for(const r of e)if(r.isCascading){const n=r,{disabled:i}=n,o=n.levels.map(a=>({jaql:a,disabled:i}));t.push(...o)}else t.push(r);return t}function vZt(e,t){return _0e(e).filter(({instanceid:r="",disabled:n})=>!(t!=null&&t.all)&&!n&&!(t!=null&&t.ids.includes(r))).map(({jaql:r,instanceid:n})=>{const{filter:i,turnOffMembersFilter:o}=V8(r);return{instanceid:n,jaql:xe(ue({},r),{filter:ue(ue({},i),o&&{filter:o})})}})}function yZt(e){const t=[];return _0e(e).forEach(({jaql:r})=>{const{backgroundFilter:n}=V8(r);n&&t.push({jaql:ue(xe(ue({},r),{filter:n}),r.datatype==="datetime"&&{level:n.level})})}),t}function bZt(e,t,r){var a;const n=((a=r.options)==null?void 0:a.dashboardFiltersMode)===_Ft.SELECT;let i=[];const o=[];return e.forEach(s=>{n&&xZt(s,r)?o.push(s):i.push(s)}),i=[...i,...t],{filters:i,highlights:o}}function xZt(e,t){return wZt(t).includes(e.jaql.dim)&&!e.jaql.filter.all}function wZt(e){const t=CZt(e.type),r=[];for(const n of t){const o=Gi(e.metadata.panels,n).map(a=>a.jaql.dim);r.push(...o)}return r}function CZt(e){switch(e){case"chart/line":case"chart/area":return["x-axis"];case"chart/bar":case"chart/column":case"chart/polar":case"chart/pie":case"treemap":return["categories"];case"chart/scatter":return["x-axis","y-axis","point"];case"chart/boxplot":return["category"];case"map/scatter":return["geo"];case"pivot2":return["rows","columns"];default:return[]}}function S0e(e){const{filters:t}=e,{filters:r,relations:n}=is(t);return xe(ue({},e),{filters:r||[],filterRelations:n})}const _Zt=Xi("useExecuteQueryByWidgetId")(k0e);function k0e(e){const t=kZt(e),r=nd(e,t),{isInitialized:n,app:i}=hr(),o=ce.useRef(void 0),a=ce.useRef(void 0),[s,l]=ce.useReducer(wE,{isLoading:!0,isError:!1,isSuccess:!1,status:"loading",error:void 0,data:void 0});return ce.useEffect(()=>{if(n||l({type:"error",error:new ft("errors.executeQueryNoSisenseContext")}),r(i)){const{widgetOid:c,dashboardOid:d,filters:h,highlights:u,filtersMergeStrategy:g,count:f,offset:p,includeDashboardFilters:x,onBeforeQuery:S}=e;l({type:"loading"}),M0e({widgetOid:c,dashboardOid:d,filters:h,highlights:u,filtersMergeStrategy:g,app:i,count:f,offset:p,includeDashboardFilters:x,onBeforeQuery:S}).then(({data:j,query:U,pivotQuery:B})=>{o.current=U,a.current=B,l({type:"success",data:j})}).catch(j=>{l({type:"error",error:j})})}},[e,i,n,r]),xe(ue({},s),{query:o.current,pivotQuery:a.current})}const SZt=["widgetOid","dashboardOid","count","offset","filtersMergeStrategy","includeDashboardFilters","onBeforeQuery"];function kZt(e){return Ga(e,SZt,(t,r)=>{const n=If(r.filters,t.filters),i=If(r.highlights,t.highlights);return n||i})}function M0e(d){return Jt(this,arguments,function*({widgetOid:e,dashboardOid:t,filters:r,highlights:n,filtersMergeStrategy:i,count:o,offset:a,includeDashboardFilters:s,app:l,onBeforeQuery:c}){const h=new cf(l.httpClient),{widget:u,dashboard:g}=yield Uhe({widgetOid:e,dashboardOid:t,includeDashboard:s,api:h});if(!u)throw new ft("errors.widgetWithOidNotFound",{widgetOid:e});const f=dw(u),p=(x,S)=>{var T;const{dataSource:j,filters:U,highlights:B}=x,{filters:R}=is(U);let E=R,N=B;if(s&&g){const{filters:C,highlights:y}=C0e(g,u);E=Ui(C,R),N=Ui(y,B)}E=mE(E,r,i),N=mE(N,n,i);const M=(T=g==null?void 0:g.filterRelations)!=null&&T.length?Fke(g.filterRelations[0].filterRelations):void 0,$={dataSource:j,filters:E,filterRelations:M,highlights:N,count:o,offset:a};if(S){const{rows:C,columns:y,values:D,grandTotals:k}=x;return xe(ue({},$),{rows:C,columns:y,values:D,grandTotals:k})}else{const{dimensions:C,measures:y}=x;return xe(ue({},$),{dimensions:C,measures:y})}};if(Qd(f.widgetType)){const x=Ape(f),S=p(x,!0),j=S0e(S);return{data:(yield U4(j,l,{onBeforeQuery:c})).table,query:void 0,pivotQuery:S}}else{const x=Tpe(f),S=p(x,!1),j=S0e(S);return{data:yield Ic(j,l,{onBeforeQuery:c}),query:S,pivotQuery:void 0}}})}const MZt=Cr({componentName:"ExecuteQueryByWidgetId"})(({widgetOid:e,dashboardOid:t,children:r,onDataChanged:n,filters:i,highlights:o,count:a,offset:s,filtersMergeStrategy:l,onBeforeQuery:c,includeDashboardFilters:d})=>{const h=k0e({widgetOid:e,dashboardOid:t,filters:i,highlights:o,count:a,offset:s,filtersMergeStrategy:l,onBeforeQuery:c,includeDashboardFilters:d}),{data:u,query:g}=h,[f,p]=ce.useState(u);return f!==u&&(p(u),u&&g&&(n==null||n(u,g))),pe(Kt,{children:h&&(r==null?void 0:r(h))})});function TZt(){const e=hr().app;return e==null?void 0:e.queryCache}const AZt=new P3({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnMount:!1}}}),T0e=({children:e})=>pe(I3,{client:AZt,children:e}),EZt=({defaultDataSource:e,url:t,token:r,wat:n,ssoEnabled:i,children:o,appConfig:a,showRuntimeErrors:s=!0,enableSilentPreAuth:l=!1,useFusionAuth:c=!1,onError:d})=>{var j,U,B;const h={enabled:(U=(j=a==null?void 0:a.trackingConfig)==null?void 0:j.enabled)!=null?U:!0,onTrackingEvent:(B=a==null?void 0:a.trackingConfig)==null?void 0:B.onTrackingEvent,packageName:"sdk-ui"},[u,g]=ce.useState(),[f,p]=ce.useState();ce.useEffect(()=>{let R=!1;if(VYt(r,n)){console.debug("Waiting for the auth token to be set");return}return u0e({defaultDataSource:e,url:t,token:r,wat:n,ssoEnabled:i,appConfig:a,enableSilentPreAuth:l,useFusionAuth:c}).then(E=>{R||g(E)}).catch(E=>{d==null||d(E),console.error(E),p(E)}),()=>{R=!0}},[e,t,r,n,i,a,l,c,d]);const x=(u==null?void 0:u.settings.translationConfig.language)||(u==null?void 0:u.settings.serverLanguage),S=u==null?void 0:u.settings.translationConfig.customTranslations;return pe(v6,{children:pe(KM,{userLanguage:x,customTranslations:S,children:pe(qM,{showErrorBox:s,error:f,onError:d,isContainerComponent:!0,shouldRenderChildrenWithProvidedError:!!(f&&!s),children:pe(FC.Provider,{value:{isInitialized:!0,app:u,tracking:h,errorBoundary:{showErrorBox:s,onError:d}},children:pe(lf,{skipTracking:!0,theme:u==null?void 0:u.settings.serverThemeSettings,children:pe(T0e,{children:pe(VBt,{children:pe(FT,{children:o})})})})})})})})},PZt=Cr({componentName:"DrilldownWidget",trackingConfig:{transparent:!0},shouldSkipSisenseContextWaiting:!0,shouldHaveOwnMenuRoot:!0})(e=>{var F;const{t}=At(),{drilldownPaths:r=[],initialDimension:n,drilldownSelections:i,config:o,onChange:a,children:s}=e,{openMenu:l}=aw(),[c,d]=ce.useState([]),[h,u]=ce.useState(null),g=Ga(h),f=o==null?void 0:o.contextMenuComponent,p=(F=o==null?void 0:o.breadcrumbsComponent)!=null?F:O8,x=ce.useCallback(V=>a==null?void 0:a({drilldownSelections:V}),[a]),{selectDrilldown:S,sliceDrilldownSelections:j,clearDrilldownSelections:U,availableDrilldownPaths:B,drilldownFilters:R,drilldownFiltersDisplayValues:E,drilldownDimension:N}=The({drilldownPaths:r,initialDimension:n,drilldownSelections:i,onDrilldownSelectionsChange:x}),M=ce.useMemo(()=>N&&pe(p,{filtersDisplayValues:E,currentDimension:N,clearDrilldownSelections:U,sliceDrilldownSelections:j}),[p,U,N,E,j]),$=ce.useCallback(V=>{u(V)},[]),T=ce.useCallback(()=>{d([]),u(null)},[d]),C=ce.useCallback((V,q)=>{S(c,V,q)},[S,c]),y=ce.useCallback(V=>{d(V)},[d]),D=ce.useMemo(()=>[j8(c,N),B8(B,N,C,t)],[N,B,c,C,t]);ce.useEffect(()=>{h&&g&&!f&&l({position:h,itemSections:D})},[h,g,D,l,f]);const k=ce.useMemo(()=>s({drilldownFilters:R,drilldownDimension:N,onDataPointsSelected:y,onContextMenu:$,breadcrumbsComponent:o!=null&&o.isBreadcrumbsDetached?M:void 0}),[s,R,N,y,$,o,M]);return Ve("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[f&&pe(f,{position:h,itemSections:D,closeContextMenu:T}),N&&!(o!=null&&o.isBreadcrumbsDetached)&&M,pe("div",{style:{flexGrow:1,minWidth:0,minHeight:0},children:k})]})});function DZt(e){return LZt(e.dataSet)}function LZt(e){return!!e&&typeof e!="string"&&"rows"in e&&"columns"in e}const A0e=Cr({componentName:"Table",shouldSkipSisenseContextWaiting:DZt})(e=>pe(bhe,ue({},e))),OZt=Cr({componentName:"TableWidget"})(e=>{var h;const[t,r]=ce.useState(0),{app:n}=hr(),{styleOptions:i,dataSource:o=n==null?void 0:n.defaultDataSource,dataOptions:a}=e,s=fA("table",{hasHeader:!((h=i==null?void 0:i.header)!=null&&h.hidden)}),u=e.styleOptions||{},{width:l,height:c}=u,d=ut(u,["width","height"]);return a?pe(wf,{defaultSize:s,size:{width:l,height:c},children:pe(hE,xe(ue({},e),{dataSetName:o&&gc(o),onRefresh:()=>r(t+1),children:pe(A0e,{dataSet:e.dataSource,dataOptions:e.dataOptions,styleOptions:d,filters:e.filters,refreshCounter:t})}))}):null}),IZt=Cr({componentName:"LineChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"line"}))),NZt=Cr({componentName:"ColumnChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"column"}))),RZt=Cr({componentName:"AreaChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"area"}))),FZt=Cr({componentName:"PieChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"pie"}))),jZt=Cr({componentName:"BarChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"bar"}))),BZt=Cr({componentName:"FunnelChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"funnel"}))),zZt=Cr({componentName:"PolarChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"polar"}))),$Zt=Cr({componentName:"ScatterChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"scatter"}))),WZt=Cr({componentName:"IndicatorChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"indicator"}))),HZt=Cr({componentName:"TreemapChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"treemap"}))),UZt=Cr({componentName:"SunburstChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"sunburst"}))),GZt=Cr({componentName:"BoxplotChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"boxplot"}))),VZt=Cr({componentName:"ScattermapChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"scattermap"}))),YZt=Cr({componentName:"AreamapChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"areamap"}))),qZt=Cr({componentName:"AreaRangeChart",shouldSkipSisenseContextWaiting:Ko})(e=>pe(Do,xe(ue({},e),{chartType:"arearange"}))),ZZt=({context:e,error:t,children:r})=>{var o,a,s,l;if(!e)return pe(v6,{children:pe(qM,{showErrorBox:!1,error:t,children:pe(KM,{children:pe(lf,{children:r})})})});const n=((o=e==null?void 0:e.app)==null?void 0:o.settings.translationConfig.language)||((a=e==null?void 0:e.app)==null?void 0:a.settings.serverLanguage),i=(s=e.app)==null?void 0:s.settings.translationConfig.customTranslations;return pe(v6,{children:pe(KM,{userLanguage:n,customTranslations:i,children:pe(qM,{showErrorBox:e==null?void 0:e.errorBoundary.showErrorBox,error:t,children:e&&pe(FC.Provider,{value:e,children:pe(lf,{skipTracking:!0,theme:(l=e.app)==null?void 0:l.settings.serverThemeSettings,children:pe(T0e,{children:pe(FT,{children:r})})})})})})})},XZt=Cr({componentName:"CustomThemeProvider",trackingConfig:{skip:e=>{var t;return!!((t=e.context)!=null&&t.skipTracking)},transparent:!0},shouldSkipSisenseContextWaiting:!0})(e=>{const{context:t,error:r,children:n}=e;if(r)throw r;const{themeSettings:i}=t;return pe(Kt,{children:i&&pe(g6.Provider,{value:{themeSettings:i},children:n})})}),Mv=(e,t)=>xe(ue({},e),{filters:t}),KZt=Object.freeze(Object.defineProperty({__proto__:null,addFilter:(e,t)=>Mv(e,jke(t)(e.filters)),addFilters:(e,t)=>Mv(e,Bke(t)(e.filters)),removeFilter:(e,t)=>Mv(e,zke(t)(e.filters)),removeFilters:(e,t)=>Mv(e,$ke(t)(e.filters)),replaceFilter:(e,t,r)=>Mv(e,Wke(t,r)(e.filters)),replaceFilters:Mv},Symbol.toStringTag,{value:"Module"})),QZt=e=>{var t;return((t=e==null?void 0:e.chart)==null?void 0:t.type)!==void 0},JZt=e=>(e==null?void 0:e.value)!==void 0&&(e==null?void 0:e.secondary)!==void 0;function E0e(e,t){return Jt(this,null,function*(){try{const r=yield t.httpClient.get(`api/v1/formulas/${e}?flat=true`,void 0,{skipTrackingParam:!0});return r?My(r):null}catch(r){throw new ft("errors.sharedFormula.failedToFetch")}})}function P0e(e,t,r){return Jt(this,null,function*(){try{const n=yield r.httpClient.get(`api/v1/formulas?datasource=${gc(t)}&flat=true`,void 0,{skipTrackingParam:!0}),i=n==null?void 0:n.find(o=>o.title===e);return i?My(i):null}catch(n){throw new ft("errors.sharedFormula.failedToFetch")}})}const eXt=Xi("useGetSharedFormula")(D0e);function D0e(e){const{name:t,dataSource:r,oid:n}=e;if(!(n||t&&r))throw new ft("errors.sharedFormula.identifierExpected");const i=Ga(e,["oid","name","dataSource"]),o=nd(e,i),[a,s]=ce.useReducer(Ya,{isLoading:!0,isError:!1,isSuccess:!1,status:"loading",error:void 0,data:void 0}),{isInitialized:l,app:c}=hr();return ce.useEffect(()=>{if(l||s({type:"error",error:new ft("errors.sisenseContextNotFound")}),o(c)){s({type:"loading"});let d=Promise.resolve(null);n?d=E0e(n,c):t&&r&&(d=P0e(t,r,c)),d.then(h=>{s({type:"success",data:h})}).catch(h=>{s({type:"error",error:h})})}},[c,l,t,r,n,o]),a.data&&i?Sz(Ya(a,{type:"loading"})):Sz(a)}function Sz(e){const n=e,{data:t}=n,r=ut(n,["data"]);return xe(ue({},r),{formula:t})}const tXt=Xi("useFetch")((e,t,r)=>{var a;const{app:n}=hr(),i=n==null?void 0:n.httpClient,o=(a=r==null?void 0:r.enabled)!=null?a:!0;return _d({queryKey:["fetch",e,t,r==null?void 0:r.requestConfig],queryFn:()=>Jt(this,null,function*(){if(!i)throw new ft("errors.httpClientNotFound");return i.call(i.url+e,t!=null?t:{},xe(ue({},r==null?void 0:r.requestConfig),{skipTrackingParam:!0}))}),enabled:o&&!!i})}),rXt=({dimensions:e,collapseAll:t})=>{const[r,n]=ce.useState(""),[i,o]=ce.useState(!!t),{themeSettings:a}=pt(),s=ce.useMemo(()=>{const l=(c,d)=>c.toLowerCase().includes(d.toLowerCase());return r&&r.trim()!==""?e.map(c=>{if(l(c.name,r))return c;const d=c.attributes.filter(u=>l(u.name,r)),h=c.dimensions.filter(u=>l(u.name,r));return new Td(c.name,c.expression,d,h,c.type,c.description,void 0,c==null?void 0:c.dataSource)}).filter(({name:c,attributes:d,dimensions:h})=>d.length>0||h.length>0||l(c,r)):e},[e,r]);return Ve(Eme,{theme:a,children:[pe(Ame,{onChange:l=>{n(l),l.trim()!==""&&o(!1)}}),pe(kme,{dimensions:s!=null?s:[],collapseAll:i})]})},nXt=Ye(Qf,{target:"e3etd9l0",label:"CountInput"})("width:64px;margin-right:8px;background-color:",({theme:e})=>e.general.popover.input.backgroundColor,";color:",({theme:e})=>e.general.popover.input.textColor,";"),iXt=Ye(gd,{target:"e3etd9l1",label:"GranularitySelect"})("width:112px;margin-right:8px;"),oXt=Ye(gd,{target:"e3etd9l2",label:"PositionSelect"})("width:112px;margin-right:8px;"),aXt=[{value:"before",displayValue:"filterEditor.datetimePositions.before"},{value:"after",displayValue:"filterEditor.datetimePositions.after"}];function sXt(e,t){const{config:r}=e,{position:n,count:i,baseDate:o,attribute:a}=t;if(!o)return null;switch(n){case"before":return Cy(a,0,i,o,r);case"after":return FD(a,0,i,o,r)}}function lXt(e,t){const r={count:1,position:"before",baseDate:void 0,attribute:qh(e.attribute,Ze.Years,t)};return Ume(e)?xe(ue({},r),{count:e.count,position:e.operator===zs.Last?"before":"after",baseDate:new Date(e.anchor),attribute:e.attribute}):r}const cXt=({filter:e,limits:t,onChange:r})=>{const{themeSettings:n}=pt(),{t:i}=At(),o=lXt(e,i),[a,s]=ce.useState(o.count),[l,c]=ce.useState(o.position),[d,h]=ce.useState(o.baseDate),[u,g]=ce.useState(o.attribute),f=ce.useMemo(()=>yz.map(E=>xe(ue({},E),{displayValue:i(E.displayValue)})),[i]),p=ce.useMemo(()=>aXt.map(E=>xe(ue({},E),{displayValue:i(E.displayValue)})),[i]),x=ce.useCallback(E=>{const N=sXt(e,E);r(N)},[e,r]),S=ce.useCallback(E=>{const M=E.target.value;let $=a;M===""?$=1:/^\d+$/.test(M)&&($=parseInt(M)||1),s($),x({count:$,position:l,baseDate:d,attribute:u})},[a,l,d,u,x]),j=ce.useCallback(E=>{const N=qh(u,E,i);g(N),x({count:a,position:l,baseDate:d,attribute:N})},[a,l,d,u,x,i]),U=ce.useCallback(E=>{c(E),x({count:a,position:E,baseDate:d,attribute:u})},[a,d,u,x]),B=ce.useCallback(E=>{h(E),x({count:a,position:l,baseDate:E,attribute:u})},[a,l,u,x]),R=ce.useMemo(()=>t?{minDate:t.minDate?new Date(t.minDate):void 0,maxDate:t.maxDate?new Date(t.maxDate):void 0}:void 0,[t]);return Ve(Kt,{children:[pe(nXt,{theme:n,type:"number",value:a,onChange:S}),pe(iXt,{value:u.granularity,items:f,onChange:j,"aria-label":"Granularity select"}),pe(oXt,{value:l,items:p,onChange:U,"aria-label":"Position select"}),pe(Ww,{width:152,type:Ni.SINGLE_SELECT,value:d,limits:R,onChange:B,placeholder:i("filterEditor.placeholders.select")})]})},uXt=Ye(gd,{target:"e1sgsfrt0",label:"ConditionSelect"})("width:128px;margin-right:8px;"),dXt=[{value:"exclude",displayValue:"filterEditor.conditions.exclude"}],hXt=[{value:"exclude",displayValue:"filterEditor.conditions.exclude"},{value:"isWithin",displayValue:"filterEditor.conditions.isWithin"}];function pXt(e){const t={condition:"exclude",editedFilter:null};return eg(e)?xe(ue({},t),{condition:"exclude",editedFilter:e}):Ume(e)?xe(ue({},t),{condition:"isWithin",editedFilter:e}):t}const fXt=({filter:e,selected:t,multiSelectEnabled:r,limits:n,onChange:i})=>{const{t:o}=At(),{membersOnlyMode:a}=md(),s=pXt(e),[l,c]=ce.useState(s.condition),[d,h]=ce.useState(s.editedFilter),u=a?dXt:hXt,g=ce.useMemo(()=>u.map(S=>xe(ue({},S),{displayValue:o(S.displayValue)})),[o,u]),f=ce.useCallback(()=>{i(d)},[d,i]),p=ce.useCallback(S=>{c(S),i(d)},[d,i]),x=ce.useCallback(S=>{h(S),i(S)},[i]);return Ve(du,{selected:t,onSelect:f,"aria-label":"Datetime condition section",children:[pe(uXt,{value:l,items:g,onChange:p,"aria-label":"Condition select"}),l==="exclude"&&pe(zYt,{filter:e,multiSelectEnabled:r,limits:n,onChange:x}),l==="isWithin"&&pe(cXt,{filter:e,limits:n,onChange:x})]})},gXt=Ye(kE,{target:"eramdst0",label:"IncludeCurrentCheckbox"})("margin-top:0;margin-bottom:0;input{width:13px;height:13px;}span{border-left:none;padding-left:0;}"),mXt=Ye(gd,{target:"eramdst1",label:"TypeSelect"})("width:88px;margin-right:8px;"),vXt=Ye(Qf,{target:"eramdst2",label:"CountInput"})("width:64px;margin-right:8px;background-color:",({theme:e})=>e.general.popover.input.backgroundColor,";color:",({theme:e})=>e.general.popover.input.textColor,";"),yXt=Ye(gd,{target:"eramdst3",label:"GranularitySelect"})("width:112px;margin-right:8px;"),bXt=[{value:"last",displayValue:"filterEditor.relativeTypes.last"},{value:"this",displayValue:"filterEditor.relativeTypes.this"},{value:"next",displayValue:"filterEditor.relativeTypes.next"}];function xXt(e,t){if(!Gme(e))return{type:"last",attribute:qh(e.attribute,Ze.Months,t),count:1,includeCurrent:!1};const r=e.operator===zs.Last&&e.count===1&&e.offset===0,n=e.offset===0&&!r;return{type:r?"this":e.operator,attribute:e.attribute,count:e.count,includeCurrent:n}}function wXt(e,t){const{type:r,attribute:n,count:i,includeCurrent:o}=e,a=o?0:1;switch(r){case"last":return Cy(n,a,i,void 0,t);case"this":return Cy(n,0,1,void 0,t);case"next":return i2e(n,a,i,void 0,t)}}const CXt=e=>{const{themeSettings:t}=pt(),{filter:r,selected:n,onChange:i}=e,{t:o}=At(),a=xXt(r,o),[s,l]=ce.useState(a.attribute),[c,d]=ce.useState(a.type),[h,u]=ce.useState(a.count),[g,f]=ce.useState(a.includeCurrent),p=ce.useMemo(()=>yz.map(N=>({value:N.value,displayValue:o(N.displayValue)})),[o]),x=ce.useMemo(()=>bXt.map(N=>({value:N.value,displayValue:o(N.displayValue)})),[o]),S=ce.useCallback(N=>{const M=wXt(N,r.config);i(M)},[r,i]),j=ce.useCallback(()=>{S({type:c,count:h,includeCurrent:g,attribute:s})},[c,h,g,s,S]),U=ce.useCallback(N=>{d(N),S({type:N,count:h,includeCurrent:g,attribute:s})},[h,g,s,S]),B=ce.useCallback(N=>{const M=qh(s,N,o);l(M),S({type:c,count:h,includeCurrent:g,attribute:M})},[c,h,g,s,S,o]),R=ce.useCallback(N=>{const $=N.target.value;let T=h;$===""?T=1:/^\d+$/.test($)&&(T=parseInt($)||1),u(T),S({type:c,count:T,includeCurrent:g,attribute:s})},[c,h,g,s,S]),E=ce.useCallback(()=>{const N=!g;f(N),S({type:c,count:h,includeCurrent:N,attribute:s})},[c,h,g,s,S]);return pe(du,{selected:n,onSelect:j,"aria-label":"Datetime relative section",children:()=>Ve(Kt,{children:[pe(mXt,{value:c,items:x,onChange:U,"aria-label":"Type"}),c!=="this"&&pe(vXt,{theme:t,type:"number",value:h,onChange:R,"aria-label":"Count"}),pe(yXt,{value:s.granularity,items:p,onChange:B,primaryBackgroundColor:t.filter.panel.backgroundColor,primaryColor:t.typography.primaryTextColor,"aria-label":"Granularity"}),c!=="this"&&pe(gXt,{label:"Including current",checked:g,onChange:E})]})})},_Xt=e=>e?Yh(e)?pz(e)?"all":Jf(e)?"members":Gme(e)?"relative":Tg(e)?"range":"condition":"not-supported":null,SXt=({filter:e,onChange:t,showMultiselectToggle:r=!0})=>{const{themeSettings:n}=pt(),{defaultDataSource:i,parentFilters:o,membersOnlyMode:a}=md(),[s,l]=ce.useState(e!=null?e:null),[c,d]=ce.useState(_Xt(s)),[h,u]=ce.useState("enableMultiSelection"in e.config?e.config.enableMultiSelection:!0),{data:g}=Jme(ue({attribute:ce.useMemo(()=>e.attribute.setGranularity(Ze.Days),[e]),filters:o,enabled:!!e},i&&{defaultDataSource:i})),f=ce.useMemo(()=>({maxDate:g==null?void 0:g.max,minDate:g==null?void 0:g.min}),[g]);ce.useEffect(()=>{t==null||t(s)},[s,t]);const p=ce.useCallback(B=>{l(B),d("all")},[]),x=ce.useCallback(B=>{l(B),d("members")},[]),S=ce.useCallback(B=>{l(B),d("relative")},[]),j=ce.useCallback(B=>{l(B),d("range")},[]),U=ce.useCallback(B=>{l(B),d("condition")},[]);return Ve(gz,{theme:n,"aria-label":"Filter editor datetime",children:[!Yh(e)&&pe(mz,{selected:c==="not-supported"}),Ve(CP,{direction:"row",spacing:2,sx:{justifyContent:"space-between",alignItems:"center",marginBottom:"42px"},children:[pe(lz,{filter:e,selected:c==="all",onChange:p}),r&&pe(fz,{enabled:h,onChange:u})]}),pe(RYt,{filter:e,selected:c==="members",multiSelectEnabled:h,limits:f,onChange:x}),!a&&Ve(Kt,{children:[pe(CXt,{filter:e,selected:c==="relative",onChange:S}),pe(FYt,{filter:e,selected:c==="range",limits:f,onChange:j})]}),pe(fXt,{filter:e,selected:c==="condition",multiSelectEnabled:h,limits:f,onChange:U})]})},kXt=({filter:e,parentFilters:t,config:r,onChange:n,defaultDataSource:i})=>{var s,l;const o=(s=r==null?void 0:r.multiSelect)==null?void 0:s.visible,a=ce.useMemo(()=>t!=null?t:[],[t]);return Ve(oYt,{value:{defaultDataSource:i!=null?i:null,parentFilters:a,membersOnlyMode:(l=r==null?void 0:r.membersOnlyMode)!=null?l:!1},children:[Sy(e.attribute.type)&&pe(xYt,{filter:e,onChange:n,showMultiselectToggle:o}),qn(e.attribute.type)&&pe(PYt,{filter:e,onChange:n,showMultiselectToggle:o}),mo(e.attribute.type)&&pe(SXt,{filter:e,onChange:n,showMultiselectToggle:o})]})},MXt=Ye("div",{target:"eyykaaj0",label:"ModalHeader"})("background-color:",({theme:e})=>e.general.popover.header.backgroundColor,";color:",({theme:e})=>e.general.popover.header.textColor,";display:flex;height:42px;align-items:center;border-radius:4px;padding:12px;box-sizing:border-box;"),TXt=Ye("span",{target:"eyykaaj1",label:"ModalHeaderTitle"})("height:24px;font-size:15px;font-weight:700;padding-left:16px;line-height:24px;color:inherit;"),AXt=Ye("span",{target:"eyykaaj2",label:"ModalHeaderInfo"})("display:flex;align-items:center;font-size:13px;box-sizing:border-box;color:inherit;column-gap:5px;background-color:",({theme:e})=>e.general.popover.header.backgroundColor,";"),EXt=Ye("span",{target:"eyykaaj3",label:"ModalHeaderVerticalDivider"})("display:inline-block;width:1px;height:24px;background:#3a4356;margin:0 16px;box-sizing:border-box;"),PXt=Ye("div",{target:"eyykaaj4",label:"ModalFooter"})("display:flex;height:61px;align-items:center;padding:12px;box-sizing:border-box;padding:0 16px;border-top:1px solid #e7e8ea;background-color:",({theme:e})=>e.general.popover.footer.backgroundColor,";color:",({theme:e})=>e.general.popover.footer.textColor,";"),DXt=Ye("div",{target:"eyykaaj5",label:"Container"})("background-color:",({theme:e})=>e.general.popover.content.backgroundColor,";border-radius:",({theme:e})=>e.general.popover.cornerRadius,";box-shadow:",({theme:e})=>e.general.popover.shadow,";color:",({theme:e})=>e.general.popover.content.textColor,";font-family:",({theme:e})=>e.typography.fontFamily,";width:700px;"),L0e=({filter:e,parentFilters:t,position:r,onChange:n,onClose:i,defaultDataSource:o,config:a})=>{var g;const{t:s}=At(),{themeSettings:l}=pt(),c=l.general.popover,[d,h]=ce.useState(e!=null?e:null),u=!!(e&&r);return u?pe(sf,{open:u,position:{anchorEl:r.anchorEl,anchorOrigin:{vertical:"top",horizontal:"left"},contentOrigin:{vertical:"top",horizontal:"right"}},onClose:i,"aria-label":"Filter editor popover",children:Ve(DXt,{theme:l,children:[Ve(MXt,{theme:l,children:[pe(TXt,{"data-testid":"filter-editor-popover-header-attribute",children:e==null?void 0:e.attribute.name}),pe(EXt,{}),Ve(AXt,{theme:l,children:[pe(Lzt,{"aria-label":"cube-icon",color:c.header.textColor}),pe("span",{"data-testid":"filter-editor-popover-header-datasource",children:(g=e==null?void 0:e.attribute.dataSource)==null?void 0:g.title})]})]}),pe(kXt,{filter:e,parentFilters:t,onChange:f=>h(f),defaultDataSource:o,config:a}),pe(PXt,{theme:l,children:Ve(CP,{direction:"row",spacing:"10px",sx:{width:"100%",justifyContent:"flex-end",alignItems:"center"},children:[pe(Fw,{onClick:()=>d&&(n==null?void 0:n(d)),disabled:!d,children:s("filterEditor.buttons.apply")}),pe(Fw,{type:"secondary",onClick:i,children:s("filterEditor.buttons.cancel")})]})})]})}):null},LXt=({dataSources:e,onFilterCreated:t,defaultDataSource:r,config:n,disabledAttributes:i})=>{const[o,a]=ce.useState(null),[s,l]=ce.useState(null),[c,d]=ce.useState(!1);return{NewFilterCreator:ce.useCallback(()=>n!=null&&n.enabled&&o?Ve(Kt,{children:[pe(CVt,{anchorEl:o,isOpen:c,dataSources:e,initialDataSource:e[0],disabledAttributes:i,onFilterCreated:h=>{l(h),d(!1)},onClose:()=>{d(!1),l(null)}}),pe(L0e,{filter:s,position:{anchorEl:o},onChange:h=>{t(h),l(null)},onClose:()=>{l(null)},config:n,defaultDataSource:r})]}):null,[n,o,c,e,i,s,r,t]),startFilterCreation:ce.useCallback(h=>{a(h),d(!0)},[])}};var OXt=4;function IXt(e){return wg(e,OXt)}const NXt=({config:e,defaultDataSource:t,onFilterChanged:r})=>{const[n,i]=ce.useState(null),[o,a]=ce.useState(null),[s,l]=ce.useState(null),c=ce.useMemo(()=>FXt(o,s),[o,s]),d=ce.useMemo(()=>o&&jXt(o)?xe(ue({},e),{membersOnlyMode:!0}):e,[e,o]),h=ce.useCallback(u=>{let g=u;o&&Qi(o)&&(g=jD(o.filters.map((f,p)=>p===s?u:go(f)&&p>s?Object.assign(IXt(f),{members:[]}):f),o==null?void 0:o.config)),r(g),l(null),a(null)},[o,s,r]);return{ExistingFilterEditor:ce.useCallback(()=>e!=null&&e.enabled&&n?pe(L0e,{filter:o&&Qi(o)&&s!==null?o.filters[s]:o,position:{anchorEl:n},parentFilters:c,onChange:h,onClose:()=>{a(null),i(null),l(null)},config:d,defaultDataSource:t}):null,[n,o,e,h,t,s,d,c]),startEditingFilter:ce.useCallback((u,g,f)=>{i(u),l(f!=null?f:null),a(g)},[])}};function RXt(e){return Sy(e.attribute.type)||qn(e.attribute.type)||mo(e.attribute.type)||Qi(e)}function FXt(e,t){const r=[];if(!e||Qi(e)&&t===null)return r;Qi(e)&&r.push(...e.filters.slice(0,t));const n=Qi(e)?e.filters[t]:e;return go(n)&&n.config.backgroundFilter&&r.push(n.config.backgroundFilter),r}function jXt(e){return Qi(e)||go(e)&&!!e.config.backgroundFilter}const BXt={actions:{addFilter:{enabled:!1,multiSelect:{visible:!0}},editFilter:{enabled:!1,multiSelect:{visible:!0}},deleteFilter:{enabled:!1}}},zXt=Ye("div",{target:"e1af82np0",label:"PanelWrapper"})("background-color:",({theme:e})=>e.filter.panel.backgroundColor,";font-family:",({theme:e})=>e.typography.fontFamily,";border:",({theme:e})=>Fh(e.filter.panel.borderColor,e.filter.panel.borderWidth),";width:fit-content;min-width:238px;max-height:100%;overflow:hidden;"),$Xt=Ye("div",{target:"e1af82np1",label:"PanelBody"})("background-color:transparent;max-height:calc(100% - ",hfe,"px);overflow-y:auto;"),WXt=Ye("div",{target:"e1af82np2",label:"PanelBodyInner"})("padding:0px 12px 12px;"),O0e=Cr({componentName:"FiltersPanel"})(({filters:e,onFiltersChange:t,defaultDataSource:r,dataSources:n,config:i})=>{var j,U,B,R;const o=ce.useRef(null),a=ce.useRef([]),{themeSettings:s}=pt(),{filters:l,relations:c}=Ll(e),d=tg(i,BXt),h=ce.useCallback(E=>{if(!l)return;const N=l.map($=>$.config.guid===E.config.guid?E:$),M=Ol(l,c,N);t(os(N,M))},[l,c,t]),u=ce.useCallback(E=>{if(!l)return;const N=Ui(l,[E]),M=Ol(l,c,N);t(os(N,M))},[l,c,t]),g=ce.useCallback(E=>{if(!l)return;const N=l.filter($=>$.config.guid!==E.config.guid),M=Ol(l,c,N);t(os(N,M))},[l,t,c]),{ExistingFilterEditor:f,startEditingFilter:p}=NXt({onFilterChanged:h,defaultDataSource:r,config:(j=d==null?void 0:d.actions)==null?void 0:j.editFilter}),{NewFilterCreator:x,startFilterCreation:S}=LXt({dataSources:n||(r?[r]:[]),onFilterCreated:u,defaultDataSource:r,config:(U=d==null?void 0:d.actions)==null?void 0:U.addFilter,disabledAttributes:l.flatMap(E=>Qi(E)?E.filters.map(N=>N.attribute):[E.attribute])});return Ve(zXt,{theme:s,ref:o,children:[pe(GUt,{onAddFilterButtonClick:ce.useCallback(()=>S(o.current),[S]),shouldShowAddFilterButton:(R=(B=d==null?void 0:d.actions)==null?void 0:B.addFilter)==null?void 0:R.enabled}),pe($Xt,{children:Ve(WXt,{children:[c&&pe(FUt,{relations:c,filters:l}),l==null?void 0:l.map((E,N)=>{var M,$,T,C;return pe("div",{className:"csdk-mt-[6px]",ref:y=>{a.current[N]=y},children:pe(vme,{onDelete:($=(M=d==null?void 0:d.actions)==null?void 0:M.deleteFilter)!=null&&$.enabled?()=>g(E):void 0,filter:E,onChange:y=>h(y),defaultDataSource:r,onEdit:(C=(T=d==null?void 0:d.actions)==null?void 0:T.editFilter)!=null&&C.enabled&&RXt(E)?y=>p(a.current[N],E,y):void 0},E.config.guid)},E.config.guid)}),pe(f,{}),pe(x,{})]})})]})}),HXt=Ye("div",{target:"e8sc0hf0",label:"ArrowWrapper"})("background-color:#b6b6b6;width:8px;height:40px;display:flex;justify-content:center;align-items:center;position:absolute;top:calc(50% - 20px);left:0;opacity:0.4;cursor:pointer;",({reversed:e})=>e?"transform: scaleX(-1);":""," &:before{content:'';position:absolute;left:8px;top:0;border-left-width:0;border-left-style:solid;border-left-color:#b6b6b6;transition:border-left-width 100ms ease;border-top:20px solid transparent;border-bottom:20px solid transparent;}svg{margin-left:1px;}&:hover{opacity:1;&:before{border-left-width:10px;}}"),UXt=Ye("div",{target:"e8sc0hf1",label:"Wrapper"})("position:relative;&:hover .arrow-wrapper{opacity:1;}"),GXt=Ye("div",{target:"e8sc0hf2",label:"ContentWrapper"})("width:",({collapsed:e})=>e?"8px":"auto",";overflow:hidden;height:100%;"),VXt=({collapsed:e=!1,onCollapsedChange:t,children:r})=>(ce.useEffect(()=>{window.dispatchEvent(new Event("resize"))},[e]),Ve(UXt,{children:[pe(HXt,{className:"arrow-wrapper",reversed:e,onClick:()=>t==null?void 0:t(!e),children:pe("svg",{fill:"#fff",height:"8px",width:"8px",viewBox:"0 0 330 330",children:pe("path",{d:"M250.606,154.389l-150-149.996c-5.857-5.858-15.355-5.858-21.213,0.001 c-5.857,5.858-5.857,15.355,0.001,21.213l139.393,139.39L79.393,304.394c-5.857,5.858-5.857,15.355,0.001,21.213 C82.322,328.536,86.161,330,90,330s7.678-1.464,10.607-4.394l149.999-150.004c2.814-2.813,4.394-6.628,4.394-10.606 C255,161.018,253.42,157.202,250.606,154.389z"})})}),pe(GXt,{collapsed:e,children:r})]})),I0e="csdk_dashboard_filters_panel_collapsed",YXt=(e=!1,t=!1)=>{const r=localStorage.getItem(I0e),n=r?r==="true":void 0,i=t&&n!=null?n:e,[o,a]=ce.useState(i),s=ce.useCallback(l=>{t&&localStorage.setItem(I0e,l?"true":"false"),a(l)},[t]);return[o,s]},OP=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";function Tv(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function kz(e){return"nodeType"in e}function qa(e){var t,r;return e?Tv(e)?e:kz(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Mz(e){const{Document:t}=qa(e);return e instanceof t}function Uw(e){return Tv(e)?!1:e instanceof qa(e).HTMLElement}function N0e(e){return e instanceof qa(e).SVGElement}function Av(e){return e?Tv(e)?e.document:kz(e)?Mz(e)?e:Uw(e)||N0e(e)?e.ownerDocument:document:document:document}const Xh=OP?ce.useLayoutEffect:ce.useEffect;function Tz(e){const t=ce.useRef(e);return Xh(()=>{t.current=e}),ce.useCallback(function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.current==null?void 0:t.current(...n)},[])}function qXt(){const e=ce.useRef(null),t=ce.useCallback((n,i)=>{e.current=setInterval(n,i)},[]),r=ce.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function Gw(e,t){t===void 0&&(t=[e]);const r=ce.useRef(e);return Xh(()=>{r.current!==e&&(r.current=e)},t),r}function Vw(e,t){const r=ce.useRef();return ce.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function IP(e){const t=Tz(e),r=ce.useRef(null),n=ce.useCallback(i=>{i!==r.current&&(t==null||t(i,r.current)),r.current=i},[]);return[r,n]}function Az(e){const t=ce.useRef();return ce.useEffect(()=>{t.current=e},[e]),t.current}let Ez={};function NP(e,t){return ce.useMemo(()=>{if(t)return t;const r=Ez[e]==null?0:Ez[e]+1;return Ez[e]=r,e+"-"+r},[e,t])}function R0e(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.reduce((o,a)=>{const s=Object.entries(a);for(const[l,c]of s){const d=o[l];d!=null&&(o[l]=d+e*c)}return o},ue({},t))}}const Ev=R0e(1),RP=R0e(-1);function ZXt(e){return"clientX"in e&&"clientY"in e}function F0e(e){if(!e)return!1;const{KeyboardEvent:t}=qa(e.target);return t&&e instanceof t}function XXt(e){if(!e)return!1;const{TouchEvent:t}=qa(e.target);return t&&e instanceof t}function Pz(e){if(XXt(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return ZXt(e)?{x:e.clientX,y:e.clientY}:null}const Dz=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[Dz.Translate.toString(e),Dz.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),j0e="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function KXt(e){return e.matches(j0e)?e:e.querySelector(j0e)}const QXt={display:"none"};function JXt(e){let{id:t,value:r}=e;return ce.createElement("div",{id:t,style:QXt},r)}function eKt(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ce.createElement("div",{id:t,style:i,role:"status","aria-live":n,"aria-atomic":!0},r)}function tKt(){const[e,t]=ce.useState("");return{announce:ce.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const B0e=ce.createContext(null);function rKt(e){const t=ce.useContext(B0e);ce.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function nKt(){const[e]=ce.useState(()=>new Set),t=ce.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[ce.useCallback(n=>{let{type:i,event:o}=n;e.forEach(a=>{var s;return(s=a[i])==null?void 0:s.call(a,o)})},[e]),t]}const iKt={draggable:`
|
|
1550
1550
|
To pick up a draggable item, press the space bar.
|
|
1551
1551
|
While dragging, use the arrow keys to move the item.
|
|
1552
1552
|
Press space again to drop the item in its new position, or press escape to cancel.
|