import{$a as G,Ab as h,Ah as Y,Bb as g,Cb as U,Eh as V,Fh as Z,Hb as S,Ia as F,Jh as y,Lb as k,Lh as $,Ma as s,Pa as w,Va as R,Wa as p,Wb as A,Xa as H,Xb as J,Ya as P,Za as m,af as M,bf as Q,dc as I,dg as d,ec as K,fg as X,yh as E}from"./chunk-UJH7VVYJ.js";import{e as x}from"./chunk-4KQZYG2V.js";var L,C=x(()=>{L={scrollBarMeasureElement:"dx-pivotgrid-scrollbar-measure-element"}});function ee(e){return M.sendRequest(e)}function _(e){return function r(a,t,n,o,l,c){o=o||[],a=a||[];var u,v;l=l||0;function i(b,q,z){g(r(a,t,n,o,q,z)).done(b.resolve)}for(u=l;u<a.length;u+=1){if(e&&u>l&&u%1e4===0&&new Date-W>=300)return W=new Date,v=new h,i(v,u,!1),v;var f=a[u];if(!c){if(o.unshift(f),n&&t(o,u)===!1)return;if(f.children){var D=r(f.children,t,n,o);if(e&&D)return v=new h,D.done(i(v,u,!0)),v}}if(c=!1,!n&&t(o,u)===!1)return;o.shift(),a[u]!==f&&(u-=1)}}}function ae(e,r){if(e&&s(r))for(var a=0;a<e.length;a+=1){var t=e[a];if(t.name===r||t.caption===r||t.dataField===r||t.index===r)return a}return-1}function oe(e,r){var a=e===e&&y.format(e,r.format),t={value:e,valueText:a||""};return r.customizeText?r.customizeText.call(r,t):t.valueText}function ne(e){return function(r,a){var t=0,n=e(r),o=e(a),l=s(n),c=s(o);return l&&c&&(n>o?t=1:n<o&&(t=-1)),l&&!c&&(t=1),!l&&c&&(t=-1),t}}function ue(e){for(var r=[],a=e.length-1;a>=0;a-=1)r.push(e[a].key||e[a].value);return r}function j(e,r,a,t){a=a||0,t=t||"children",e.length&&r(e,a);for(var n=0;n<e.length;n+=1){var o=e[n];o[t]&&o[t].length&&j(o[t],r,a+1,t)}}function le(e,r){for(var a=[],t=0;t<e.length;t+=1)a.push(Math.max(e[t]||0,r[t]||0));return a}function ce(e,r){var a=e[r],t=0,n=(r==="columns"?e.columnExpandedPaths:e.rowExpandedPaths)||[];for(e.headerName===r?t=e.path.length:e.headerName&&e.headerName!==r&&e.oppositePath?t=e.oppositePath.length:m(n,(o,l)=>{t=Math.max(t,l.length)});a[t+1]&&a[t].expanded;)t+=1;return t}function fe(e){return P(["year","quarter","month"],(r,a)=>p({},e,{groupInterval:r,groupIndex:a}))}function B(e,r,a,t){var n=[];return Object.keys(r||[]).forEach(o=>{if(!(o&&o.startsWith("__"))){for(var l=1,c=a.length?"".concat(a,".").concat(o):o,u=t[c],v=S(c),i=r[o],f;!s(i)&&e[l];)i=v(e[l]),l+=1;!u&&s(i)&&(u=F(i)),f=[{dataField:c,dataType:u,groupName:u==="date"?o:void 0,groupInterval:void 0,displayFolder:a}],u==="date"?f=f.concat(fe(f[0])):u==="object"&&(f=B(e,i,c,t)),n.push.apply(n,f)}}),n}function ve(e,r){var a=N(r);return B(e,e[0],"",a)}function N(e){var r={};return m(e,(a,t)=>{r[t.dataField]=r[t.dataField]||t.dataType}),r}function se(e){if(e.dataType==="date")e.format||T(e,"format",ie[e.groupInterval]);else if(e.dataType==="number"){var r=w(e.groupInterval)&&e.groupInterval>0&&e.groupInterval;r&&!e.customizeText&&T(e,"customizeText",a=>{var t=a.value+r,n=y.format(t,e.format);return a.valueText&&n?"".concat(a.valueText," - ").concat(n):""})}}function he(e,r){var a=[];r=r||[];for(var t=0;t<r.length;t+=1)a.push(p({},e[t],{groupIndex:null,groupName:null,filterType:"include",filterValues:[r[t]]}));return a}function pe(e){return e.charAt(0).toUpperCase()+e.slice(1)}var T,W,re,te,ie,de,O,me,Ce,ge=x(()=>{J();Q();K();k();U();H();G();R();Y();Z();$();X();C();T=function(e,r,a,t){var n=e._initProperties=e._initProperties||{},o=t?a:e[r],l=!Object.prototype.hasOwnProperty.call(n,r)||t;l&&r!=="_initProperties"&&(n[r]=o),e[r]=a};W=new Date;re=_(!1),te=_(!0);ie={month:e=>d.getMonthNames()[e-1],quarter:e=>d.format(new Date(2e3,3*e-1),"quarter"),dayOfWeek:e=>d.getDayNames()[e]};de={createDrillDownDataSource(e,r){var a=this.getDrillDownItems(e,r);function t(o){return function(l){var c;return c=new h,g(a).done(u=>{var v=new E(u);v[o](l).done(c.resolve).fail(c.reject)}).fail(c.reject),c}}var n=new V({load:t("load"),totalCount:t("totalCount"),key:this.key()});return n}};O=e=>e.offsetWidth-e.clientWidth,me=I(()=>{var e=A.getDocument();e.body.insertAdjacentHTML("beforeend",'<div class="'.concat(L.scrollBarMeasureElement,'"></div>'));var r=e.body.lastElementChild,a=O(r);return r&&e.body.removeChild(r),a}),Ce={setFieldProperty:T,sendRequest:ee,foreachTree:re,foreachTreeAsync:te,findField:ae,formatValue:oe,getCompareFunction:ne,createPath:ue,foreachDataLevel:j,mergeArraysByMaxValue:le,getExpandedLevel:ce,discoverObjectFields:ve,getFieldsDataType:N,setDefaultFieldValueFormatting:se,getFiltersByPath:he,storeDrillDownMixin:de,capitalizeFirstLetter:pe,getScrollbarWidth:O,calculateScrollbarWidth:me}});export{T as a,re as b,te as c,ae as d,oe as e,ne as f,ue as g,j as h,le as i,ce as j,ve as k,N as l,se as m,he as n,de as o,pe as p,me as q,Ce as r,ge as s};
