@coreui/data-grid 0.1.0-rc.0

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.
Files changed (101) hide show
  1. package/LICENSE +3 -0
  2. package/README.md +37 -0
  3. package/dist/css/data-grid.css +444 -0
  4. package/dist/css/data-grid.css.map +1 -0
  5. package/dist/css/data-grid.min.css +5 -0
  6. package/dist/css/data-grid.min.css.map +1 -0
  7. package/dist/js/csv.cjs +68 -0
  8. package/dist/js/csv.cjs.map +1 -0
  9. package/dist/js/csv.mjs +63 -0
  10. package/dist/js/csv.mjs.map +1 -0
  11. package/dist/js/data-grid.esm.js +9618 -0
  12. package/dist/js/data-grid.esm.js.map +1 -0
  13. package/dist/js/data-grid.esm.min.js +8 -0
  14. package/dist/js/data-grid.esm.min.js.map +1 -0
  15. package/dist/js/data-grid.js +9635 -0
  16. package/dist/js/data-grid.js.map +1 -0
  17. package/dist/js/data-grid.min.js +8 -0
  18. package/dist/js/data-grid.min.js.map +1 -0
  19. package/dist/js/data-grid.mjs +9618 -0
  20. package/dist/js/data-grid.mjs.map +1 -0
  21. package/dist/js/filters.cjs +143 -0
  22. package/dist/js/filters.cjs.map +1 -0
  23. package/dist/js/filters.mjs +137 -0
  24. package/dist/js/filters.mjs.map +1 -0
  25. package/dist/js/labels.cjs +76 -0
  26. package/dist/js/labels.cjs.map +1 -0
  27. package/dist/js/labels.mjs +71 -0
  28. package/dist/js/labels.mjs.map +1 -0
  29. package/dist/types/base-component.d.ts +19 -0
  30. package/dist/types/data-grid.d.ts +128 -0
  31. package/dist/types/dom/event-handler.d.ts +11 -0
  32. package/dist/types/dom/manipulator.d.ts +9 -0
  33. package/dist/types/engine/active-cell.d.ts +32 -0
  34. package/dist/types/engine/data-source.d.ts +19 -0
  35. package/dist/types/engine/scheduler.d.ts +11 -0
  36. package/dist/types/engine/table.d.ts +9 -0
  37. package/dist/types/engine/virtualizer.d.ts +21 -0
  38. package/dist/types/filters.d.mts +1 -0
  39. package/dist/types/filters.d.ts +13 -0
  40. package/dist/types/icons.d.ts +21 -0
  41. package/dist/types/index.d.mts +1 -0
  42. package/dist/types/index.d.ts +12 -0
  43. package/dist/types/labels.d.mts +1 -0
  44. package/dist/types/labels.d.ts +9 -0
  45. package/dist/types/types.d.ts +262 -0
  46. package/dist/types/ui/body.d.ts +34 -0
  47. package/dist/types/ui/column-chooser.d.ts +27 -0
  48. package/dist/types/ui/editor.d.ts +8 -0
  49. package/dist/types/ui/filter-menu.d.ts +21 -0
  50. package/dist/types/ui/header.d.ts +50 -0
  51. package/dist/types/ui/loading.d.ts +12 -0
  52. package/dist/types/ui/menu.d.ts +17 -0
  53. package/dist/types/ui/pagination.d.ts +17 -0
  54. package/dist/types/ui/pinning.d.ts +17 -0
  55. package/dist/types/ui/toolbar.d.ts +34 -0
  56. package/dist/types/ui/tooltip.d.ts +10 -0
  57. package/dist/types/util/config.d.ts +11 -0
  58. package/dist/types/util/csv.d.mts +1 -0
  59. package/dist/types/util/csv.d.ts +19 -0
  60. package/dist/types/util/debounce.d.ts +7 -0
  61. package/dist/types/util/index.d.ts +10 -0
  62. package/dist/types/util/sanitizer.d.ts +11 -0
  63. package/package.json +147 -0
  64. package/scss/data-grid.scss +559 -0
  65. package/src/base-component.d.ts +19 -0
  66. package/src/base-component.js +90 -0
  67. package/src/data-grid.ts +2208 -0
  68. package/src/dom/data.js +59 -0
  69. package/src/dom/event-handler.d.ts +11 -0
  70. package/src/dom/event-handler.js +331 -0
  71. package/src/dom/manipulator.d.ts +9 -0
  72. package/src/dom/manipulator.js +75 -0
  73. package/src/engine/active-cell.ts +195 -0
  74. package/src/engine/data-source.ts +63 -0
  75. package/src/engine/scheduler.ts +42 -0
  76. package/src/engine/table.ts +122 -0
  77. package/src/engine/virtualizer.ts +57 -0
  78. package/src/filters.ts +176 -0
  79. package/src/icons.ts +60 -0
  80. package/src/index.ts +56 -0
  81. package/src/labels.ts +70 -0
  82. package/src/types.ts +334 -0
  83. package/src/ui/body.ts +348 -0
  84. package/src/ui/column-chooser.ts +183 -0
  85. package/src/ui/editor.ts +98 -0
  86. package/src/ui/filter-menu.ts +398 -0
  87. package/src/ui/header.ts +441 -0
  88. package/src/ui/loading.ts +39 -0
  89. package/src/ui/menu.ts +218 -0
  90. package/src/ui/pagination.ts +150 -0
  91. package/src/ui/pinning.ts +53 -0
  92. package/src/ui/toolbar.ts +144 -0
  93. package/src/ui/tooltip.ts +113 -0
  94. package/src/util/config.d.ts +11 -0
  95. package/src/util/config.js +69 -0
  96. package/src/util/csv.ts +85 -0
  97. package/src/util/debounce.ts +18 -0
  98. package/src/util/index.d.ts +10 -0
  99. package/src/util/index.js +310 -0
  100. package/src/util/sanitizer.d.ts +11 -0
  101. package/src/util/sanitizer.js +162 -0
@@ -0,0 +1,8 @@
1
+ /*!
2
+ * CoreUI PRO data-grid v0.1.0-rc.0 (https://coreui.io)
3
+ * Copyright 2026 The CoreUI Team (https://github.com/orgs/coreui/people)
4
+ * License (https://coreui.io/pro/license/)
5
+ * Bundles @tanstack/table-core and @tanstack/virtual-core, MIT (https://github.com/TanStack/table/blob/main/LICENSE)
6
+ */
7
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).coreui=e.coreui||{})}(this,function(e){"use strict";const t=new Map,n={set(e,n,o){t.has(e)||t.set(e,new Map);const l=t.get(e);l.has(n)||0===l.size?l.set(n,o):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(l.keys())[0]}.`)},get:(e,n)=>t.has(e)&&t.get(e).get(n)||null,remove(e,n){if(!t.has(e))return;const o=t.get(e);o.delete(n),0===o.size&&t.delete(e)}},o="transitionend",l=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),i=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),s=e=>{return i(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(((t=e)&&window.CSS&&window.CSS.escape&&(t=t.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),t)):null;var t},r=()=>window.jQuery&&!document.body.hasAttribute("data-coreui-no-jquery")?window.jQuery:null,a=[],u=(e,t=[],n=e)=>"function"==typeof e?e.call(...t):n,d=/[^.]*(?=\..*)\.|.*/,c=/\..*/,g=/::\d+$/,h={};let m=1;const f={mouseenter:"mouseover",mouseleave:"mouseout"},p=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","drag","dragstart","dragend","dragenter","dragleave","dragover","drop","gesturestart","gesturechange","gestureend","focus","blur","change","input","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function v(e,t){return t&&`${t}::${m++}`||e.uidEvent||m++}function b(e){const t=v(e);return e.uidEvent=t,h[t]=h[t]||{},h[t]}function _(e,t,n=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===n)}function w(e,t,n){const o="string"==typeof t,l=o?n:t||n;let i=E(e);return p.has(i)||(i=e),[o,l,i]}function S(e,t,n,o,l){if("string"!=typeof t||!e)return;let[i,s,r]=w(t,n,o);if(t in f){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};s=e(s)}const a=b(e),u=a[r]||(a[r]={}),c=_(u,s,i?n:null);if(c)return void(c.oneOff=c.oneOff&&l);const g=v(s,t.replace(d,"")),h=i?function(e,t,n){return function o(l){const i=e.querySelectorAll(t);for(let{target:s}=l;s&&s!==this;s=s.parentNode)for(const r of i)if(r===s)return I(l,{delegateTarget:s}),o.oneOff&&x.off(e,l.type,t,n),n.apply(s,[l])}}(e,n,s):function(e,t){return function n(o){return I(o,{delegateTarget:e}),n.oneOff&&x.off(e,o.type,t),t.apply(e,[o])}}(e,s);h.delegationSelector=i?n:null,h.callable=s,h.oneOff=l,h.uidEvent=g,u[g]=h,e.addEventListener(r,h,i)}function C(e,t,n,o,l){const i=_(t[n],o,l);i&&(e.removeEventListener(n,i,Boolean(l)),delete t[n][i.uidEvent])}function y(e,t,n,o){const l=t[n]||{};for(const[i,s]of Object.entries(l))i.includes(o)&&C(e,t,n,s.callable,s.delegationSelector)}function E(e){return e=e.replace(c,""),f[e]||e}const x={on(e,t,n,o){S(e,t,n,o,!1)},one(e,t,n,o){S(e,t,n,o,!0)},off(e,t,n,o){if("string"!=typeof t||!e)return;const[l,i,s]=w(t,n,o),r=s!==t,a=b(e),u=a[s]||{},d=t.startsWith(".");if(void 0===i){if(d)for(const n of Object.keys(a))y(e,a,n,t.slice(1));for(const[n,o]of Object.entries(u)){const l=n.replace(g,"");r&&!t.includes(l)||C(e,a,s,o.callable,o.delegationSelector)}}else{if(!Object.keys(u).length)return;C(e,a,s,i,l?n:null)}},trigger(e,t,n){if("string"!=typeof t||!e)return null;const o=r();let l=null,i=!0,s=!0,a=!1;t!==E(t)&&o&&(l=o.Event(t,n),o(e).trigger(l),i=!l.isPropagationStopped(),s=!l.isImmediatePropagationStopped(),a=l.isDefaultPrevented());const u=I(new Event(t,{bubbles:i,cancelable:!0}),n);return a&&u.preventDefault(),s&&e.dispatchEvent(u),u.defaultPrevented&&l&&l.preventDefault(),u}};function I(e,t={}){for(const[n,o]of Object.entries(t))try{e[n]=o}catch{Object.defineProperty(e,n,{configurable:!0,get:()=>o})}return e}function R(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function F(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const M={setDataAttribute(e,t,n){e.setAttribute(`data-coreui-${F(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-coreui-${F(t)}`)},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter(e=>e.startsWith("coreui")&&!e.startsWith("coreuiConfig"));for(const o of n){let n=o.replace(/^coreui/,"");n=n.charAt(0).toLowerCase()+n.slice(1),t[n]=R(e.dataset[o])}return t},getDataAttribute:(e,t)=>R(e.getAttribute(`data-coreui-${F(t)}`))};class A{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=i(t)?M.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...i(t)?M.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[n,o]of Object.entries(t)){const t=e[n],s=i(t)?"element":l(t);if(!new RegExp(o).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${s}" but expected type "${o}".`)}}}class L extends A{constructor(e,t){super(),(e=s(e))&&(this._element=e,this._config=this._getConfig(t),n.set(this._element,this.constructor.DATA_KEY,this))}dispose(){n.remove(this._element,this.constructor.DATA_KEY),x.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){((e,t,n=!0)=>{if(!n)return void u(e);const l=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const o=Number.parseFloat(t),l=Number.parseFloat(n);return o||l?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let i=!1;const s=({target:n})=>{n===t&&(i=!0,t.removeEventListener(o,s),u(e))};t.addEventListener(o,s),setTimeout(()=>{i||t.dispatchEvent(new Event(o))},l)})(e,t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return n.get(s(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"0.1.0"}static get DATA_KEY(){return`coreui.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}function z(e,t){return"function"==typeof e?e(t):e}function V(e,t){return n=>{t.setState(t=>({...t,[e]:z(n,t[e])}))}}function P(e){return e instanceof Function}function O(e,t,n){let o,l=[];return i=>{let s;n.key&&n.debug&&(s=Date.now());const r=e(i);if(r.length===l.length&&!r.some((e,t)=>l[t]!==e))return o;let a;if(l=r,n.key&&n.debug&&(a=Date.now()),o=t(...r),null==n||null==n.onChange||n.onChange(o),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-s))/100,t=Math.round(100*(Date.now()-a))/100,o=t/16,l=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${l(t,5)} /${l(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*o,120))}deg 100% 31%);`,null==n?void 0:n.key)}return o}}function k(e,t,n,o){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:o}}const T="debugHeaders";function D(e,t,n){var o;let l={id:null!=(o=n.id)?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(l),e},getContext:()=>({table:e,header:l,column:t})};return e._features.forEach(t=>{null==t.createHeader||t.createHeader(l,e)}),l}const B={createTable:e=>{e.getHeaderGroups=O(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,l)=>{var i,s;const r=null!=(i=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?i:[],a=null!=(s=null==l?void 0:l.map(e=>n.find(t=>t.id===e)).filter(Boolean))?s:[];return H(t,[...r,...n.filter(e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id))),...a],e)},k(e.options,T)),e.getCenterHeaderGroups=O(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,l)=>H(t,n=n.filter(e=>!(null!=o&&o.includes(e.id)||null!=l&&l.includes(e.id))),e,"center"),k(e.options,T)),e.getLeftHeaderGroups=O(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var l;return H(t,null!=(l=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?l:[],e,"left")},k(e.options,T)),e.getRightHeaderGroups=O(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var l;return H(t,null!=(l=null==o?void 0:o.map(e=>n.find(t=>t.id===e)).filter(Boolean))?l:[],e,"right")},k(e.options,T)),e.getFooterGroups=O(()=>[e.getHeaderGroups()],e=>[...e].reverse(),k(e.options,T)),e.getLeftFooterGroups=O(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),k(e.options,T)),e.getCenterFooterGroups=O(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),k(e.options,T)),e.getRightFooterGroups=O(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),k(e.options,T)),e.getFlatHeaders=O(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),k(e.options,T)),e.getLeftFlatHeaders=O(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),k(e.options,T)),e.getCenterFlatHeaders=O(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),k(e.options,T)),e.getRightFlatHeaders=O(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),k(e.options,T)),e.getCenterLeafHeaders=O(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),k(e.options,T)),e.getLeftLeafHeaders=O(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),k(e.options,T)),e.getRightLeafHeaders=O(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}),k(e.options,T)),e.getLeafHeaders=O(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>{var o,l,i,s,r,a;return[...null!=(o=null==(l=e[0])?void 0:l.headers)?o:[],...null!=(i=null==(s=t[0])?void 0:s.headers)?i:[],...null!=(r=null==(a=n[0])?void 0:a.headers)?r:[]].map(e=>e.getLeafHeaders()).flat()},k(e.options,T))}};function H(e,t,n,o){var l,i;let s=0;const r=function(e,t){void 0===t&&(t=1),s=Math.max(s,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;null!=(n=e.columns)&&n.length&&r(e.columns,t+1)},0)};r(e);let a=[];const u=(e,t)=>{const l={depth:t,id:[o,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach(e=>{const s=[...i].reverse()[0];let r,a=!1;if(e.column.depth===l.depth&&e.column.parent?r=e.column.parent:(r=e.column,a=!0),s&&(null==s?void 0:s.column)===r)s.subHeaders.push(e);else{const l=D(n,r,{id:[o,t,r.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:a,placeholderId:a?`${i.filter(e=>e.column===r).length}`:void 0,depth:t,index:i.length});l.subHeaders.push(e),i.push(l)}l.headers.push(e),e.headerGroup=l}),a.push(l),t>0&&u(i,t-1)},d=t.map((e,t)=>D(n,e,{depth:s,index:t}));u(d,s-1),a.reverse();const c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,o=[0];return e.subHeaders&&e.subHeaders.length?(o=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:l}=e;t+=n,o.push(l)})):t=1,n+=Math.min(...o),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(null!=(l=null==(i=a[0])?void 0:i.headers)?l:[]),a}const j=(e,t,n,o,l,i,s)=>{let r={id:t,index:o,original:n,depth:l,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(r._valuesCache.hasOwnProperty(t))return r._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(r._valuesCache[t]=n.accessorFn(r.original,o),r._valuesCache[t]):void 0},getUniqueValues:t=>{if(r._uniqueValuesCache.hasOwnProperty(t))return r._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(r._uniqueValuesCache[t]=n.columnDef.getUniqueValues(r.original,o),r._uniqueValuesCache[t]):(r._uniqueValuesCache[t]=[r.getValue(t)],r._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=r.getValue(t))?n:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>function(e){const t=[],n=e=>{e.forEach(e=>{t.push(e);const o=e.subRows;null!=o&&o.length&&n(o)})};return n(e),t}(r.subRows),getParentRow:()=>r.parentId?e.getRow(r.parentId,!0):void 0,getParentRows:()=>{let e=[],t=r;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:O(()=>[e.getAllLeafColumns()],t=>t.map(t=>function(e,t,n,o){const l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:()=>{var t;return null!=(t=l.getValue())?t:e.options.renderFallbackValue},getContext:O(()=>[e,n,t,l],(e,t,n,o)=>({table:e,column:t,row:n,cell:o,getValue:o.getValue,renderValue:o.renderValue}),k(e.options,"debugCells"))};return e._features.forEach(o=>{null==o.createCell||o.createCell(l,n,t,e)},{}),l}(e,r,t,t.id)),k(e.options,"debugRows")),_getAllCellsByColumnId:O(()=>[r.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),k(e.options,"debugRows"))};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(r,e)}return r},N={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},q=(e,t,n)=>{var o,l;const i=null==n||null==(o=n.toString())?void 0:o.toLowerCase();return Boolean(null==(l=e.getValue(t))||null==(l=l.toString())||null==(l=l.toLowerCase())?void 0:l.includes(i))};q.autoRemove=e=>Q(e);const G=(e,t,n)=>{var o;return Boolean(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.includes(n))};G.autoRemove=e=>Q(e);const $=(e,t,n)=>{var o;return(null==(o=e.getValue(t))||null==(o=o.toString())?void 0:o.toLowerCase())===(null==n?void 0:n.toLowerCase())};$.autoRemove=e=>Q(e);const K=(e,t,n)=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)};K.autoRemove=e=>Q(e);const W=(e,t,n)=>!n.some(n=>{var o;return!(null!=(o=e.getValue(t))&&o.includes(n))});W.autoRemove=e=>Q(e)||!(null!=e&&e.length);const U=(e,t,n)=>n.some(n=>{var o;return null==(o=e.getValue(t))?void 0:o.includes(n)});U.autoRemove=e=>Q(e)||!(null!=e&&e.length);const Z=(e,t,n)=>e.getValue(t)===n;Z.autoRemove=e=>Q(e);const J=(e,t,n)=>e.getValue(t)==n;J.autoRemove=e=>Q(e);const X=(e,t,n)=>{let[o,l]=n;const i=e.getValue(t);return i>=o&&i<=l};X.resolveFilterValue=e=>{let[t,n]=e,o="number"!=typeof t?parseFloat(t):t,l="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(o)?-1/0:o,s=null===n||Number.isNaN(l)?1/0:l;if(i>s){const e=i;i=s,s=e}return[i,s]},X.autoRemove=e=>Q(e)||Q(e[0])&&Q(e[1]);const Y={includesString:q,includesStringSensitive:G,equalsString:$,arrIncludes:K,arrIncludesAll:W,arrIncludesSome:U,equals:Z,weakEquals:J,inNumberRange:X};function Q(e){return null==e||""===e}const ee={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:V("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"string"==typeof o?Y.includesString:"number"==typeof o?Y.inNumberRange:"boolean"==typeof o||null!==o&&"object"==typeof o?Y.equals:Array.isArray(o)?Y.arrIncludes:Y.weakEquals},e.getFilterFn=()=>{var n,o;return P(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(o=t.options.filterFns)?void 0:o[e.columnDef.filterFn])?n:Y[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,l;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(o=t.options.enableColumnFilters)||o)&&(null==(l=t.options.enableFilters)||l)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find(t=>t.id===e.id))?void 0:n.value},e.getFilterIndex=()=>{var n,o;return null!=(n=null==(o=t.getState().columnFilters)?void 0:o.findIndex(t=>t.id===e.id))?n:-1},e.setFilterValue=n=>{t.setColumnFilters(t=>{const o=e.getFilterFn(),l=null==t?void 0:t.find(t=>t.id===e.id),i=z(n,l?l.value:void 0);var s;if(te(o,i,e))return null!=(s=null==t?void 0:t.filter(t=>t.id!==e.id))?s:[];const r={id:e.id,value:i};var a;return l?null!=(a=null==t?void 0:t.map(t=>t.id===e.id?r:t))?a:[]:null!=t&&t.length?[...t,r]:[r]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange(e=>{var o;return null==(o=z(t,e))?void 0:o.filter(e=>{const t=n.find(t=>t.id===e.id);return!t||!te(t.getFilterFn(),e.value,t)})})},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function te(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const ne={sum:(e,t,n)=>n.reduce((t,n)=>{const o=n.getValue(e);return t+("number"==typeof o?o:0)},0),min:(e,t,n)=>{let o;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(o>n||void 0===o&&n>=n)&&(o=n)}),o},max:(e,t,n)=>{let o;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(o<n||void 0===o&&n>=n)&&(o=n)}),o},extent:(e,t,n)=>{let o,l;return n.forEach(t=>{const n=t.getValue(e);null!=n&&(void 0===o?n>=n&&(o=l=n):(o>n&&(o=n),l<n&&(l=n)))}),[o,l]},mean:(e,t)=>{let n=0,o=0;if(t.forEach(t=>{let l=t.getValue(e);null!=l&&(l=+l)>=l&&(++n,o+=l)}),n)return o/n},median:(e,t)=>{if(!t.length)return;const n=t.map(t=>t.getValue(e));if(o=n,!Array.isArray(o)||!o.every(e=>"number"==typeof e))return;var o;if(1===n.length)return n[0];const l=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2!=0?i[l]:(i[l-1]+i[l])/2},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},oe={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:V("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>null!=t&&t.includes(e.id)?t.filter(t=>t!==e.id):[...null!=t?t:[],e.id])},e.getCanGroup=()=>{var n,o;return(null==(n=e.columnDef.enableGrouping)||n)&&(null==(o=t.options.enableGrouping)||o)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],o=null==n?void 0:n.getValue(e.id);return"number"==typeof o?ne.sum:"[object Date]"===Object.prototype.toString.call(o)?ne.extent:void 0},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return P(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(o=t.options.aggregationFns)?void 0:o[e.columnDef.aggregationFn])?n:ne[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const o=t.getColumn(n);return null!=o&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}},le={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:V("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=O(e=>[de(t,e)],t=>t.findIndex(t=>t.id===e.id),k(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var o;return(null==(o=de(t,n)[0])?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;const l=de(t,n);return(null==(o=l[l.length-1])?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=O(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>o=>{let l=[];if(null!=e&&e.length){const t=[...e],n=[...o];for(;n.length&&t.length;){const e=t.shift(),o=n.findIndex(t=>t.id===e);o>-1&&l.push(n.splice(o,1)[0])}l=[...l,...n]}else l=o;return function(e,t,n){if(null==t||!t.length||!n)return e;const o=e.filter(e=>!t.includes(e.id));return"remove"===n?o:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...o]}(l,t,n)},k(e.options,"debugTable"))}},ie={getInitialState:e=>({columnPinning:{left:[],right:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:V("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const o=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>{var t,l,i,s,r,a;return"right"===n?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter(e=>!(null!=o&&o.includes(e))),right:[...(null!=(s=null==e?void 0:e.right)?s:[]).filter(e=>!(null!=o&&o.includes(e))),...o]}:"left"===n?{left:[...(null!=(r=null==e?void 0:e.left)?r:[]).filter(e=>!(null!=o&&o.includes(e))),...o],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter(e=>!(null!=o&&o.includes(e)))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter(e=>!(null!=o&&o.includes(e))),right:(null!=(l=null==e?void 0:e.right)?l:[]).filter(e=>!(null!=o&&o.includes(e)))}})},e.getCanPin=()=>e.getLeafColumns().some(e=>{var n,o,l;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(o=null!=(l=t.options.enableColumnPinning)?l:t.options.enablePinning)||o)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(e=>e.id),{left:o,right:l}=t.getState().columnPinning,i=n.some(e=>null==o?void 0:o.includes(e)),s=n.some(e=>null==l?void 0:l.includes(e));return i?"left":!!s&&"right"},e.getPinnedIndex=()=>{var n,o;const l=e.getIsPinned();return l?null!=(n=null==(o=t.getState().columnPinning)||null==(o=o[l])?void 0:o.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=O(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{const o=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!o.includes(e.column.id))},k(t.options,"debugRows")),e.getLeftVisibleCells=O(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"left"})),k(t.options,"debugRows")),e.getRightVisibleCells=O(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:"right"})),k(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(o=e.initialState)?void 0:o.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const o=e.getState().columnPinning;var l,i;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(l=o.left)?void 0:l.length)||(null==(i=o.right)?void 0:i.length))},e.getLeftLeafColumns=O(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),k(e.options,"debugColumns")),e.getRightLeafColumns=O(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(null!=t?t:[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),k(e.options,"debugColumns")),e.getCenterLeafColumns=O(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{const o=[...null!=t?t:[],...null!=n?n:[]];return e.filter(e=>!o.includes(e.id))},k(e.options,"debugColumns"))}},se={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},re={getDefaultColumnDef:()=>se,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:V("columnSizing",e),onColumnSizingInfoChange:V("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,l;const i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:se.minSize,null!=(o=null!=i?i:e.columnDef.size)?o:se.size),null!=(l=e.columnDef.maxSize)?l:se.maxSize)},e.getStart=O(e=>[e,de(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),k(t.options,"debugColumns")),e.getAfter=O(e=>[e,de(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),k(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...o}=t;return o})},e.getCanResize=()=>{var n,o;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(o=t.options.enableColumnResizing)||o)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var o;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(o=e.column.getSize())?o:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const o=t.getColumn(e.column.id),l=null==o?void 0:o.getCanResize();return i=>{if(!o||!l)return;if(null==i.persist||i.persist(),ue(i)&&i.touches&&i.touches.length>1)return;const s=e.getSize(),r=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[o.id,o.getSize()]],a=ue(i)?Math.round(i.touches[0].clientX):i.clientX,u={},d=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo(e=>{var o,l;const i="rtl"===t.options.columnResizeDirection?-1:1,s=(n-(null!=(o=null==e?void 0:e.startOffset)?o:0))*i,r=Math.max(s/(null!=(l=null==e?void 0:e.startSize)?l:0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;u[t]=Math.round(100*Math.max(n+n*r,0))/100}),{...e,deltaOffset:s,deltaPercentage:r}}),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing(e=>({...e,...u})))},c=e=>d("move",e),g=e=>{d("end",e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||("undefined"!=typeof document?document:null),m={moveHandler:e=>c(e.clientX),upHandler:e=>{null==h||h.removeEventListener("mousemove",m.moveHandler),null==h||h.removeEventListener("mouseup",m.upHandler),g(e.clientX)}},f={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),c(e.touches[0].clientX),!1),upHandler:e=>{var t;null==h||h.removeEventListener("touchmove",f.moveHandler),null==h||h.removeEventListener("touchend",f.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),g(null==(t=e.touches[0])?void 0:t.clientX)}},p=!!function(){if("boolean"==typeof ae)return ae;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return ae=e,ae}()&&{passive:!1};ue(i)?(null==h||h.addEventListener("touchmove",f.moveHandler,p),null==h||h.addEventListener("touchend",f.upHandler,p)):(null==h||h.addEventListener("mousemove",m.moveHandler,p),null==h||h.addEventListener("mouseup",m.upHandler,p)),t.setColumnSizingInfo(e=>({...e,startOffset:a,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce((e,t)=>e+t.getSize(),0))?t:0}}};let ae=null;function ue(e){return"touchstart"===e.type}function de(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const ce={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:V("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const o={...n},l=e.getPreGroupedRowModel().flatRows;return t?l.forEach(e=>{e.getCanSelect()&&(o[e.id]=!0)}):l.forEach(e=>{delete o[e.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const o=void 0!==t?t:!e.getIsAllPageRowsSelected(),l={...n};return e.getRowModel().rows.forEach(t=>{ge(l,t.id,o,!0,e)}),l}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=O(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?he(e,n):{rows:[],flatRows:[],rowsById:{}},k(e.options,"debugTable")),e.getFilteredSelectedRowModel=O(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?he(e,n):{rows:[],flatRows:[],rowsById:{}},k(e.options,"debugTable")),e.getGroupedSelectedRowModel=O(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?he(e,n):{rows:[],flatRows:[],rowsById:{}},k(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let o=Boolean(t.length&&Object.keys(n).length);return o&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState();let o=!!t.length;return o&&t.some(e=>!n[e.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{const l=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=void 0!==n?n:!l,e.getCanSelect()&&l===n)return i;const r={...i};return ge(r,e.id,n,null==(s=null==o?void 0:o.selectChildren)||s,t),r})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return me(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===fe(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===fe(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var o;t&&e.toggleSelected(null==(o=n.target)?void 0:o.checked)}}}},ge=(e,t,n,o,l)=>{var i;const s=l.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),s.getCanSelect()&&(e[t]=!0)):delete e[t],o&&null!=(i=s.subRows)&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(t=>ge(e,t.id,n,o,l))};function he(e,t){const n=e.getState().rowSelection,o=[],l={},i=function(e,t){return e.map(e=>{var t;const s=me(e,n);if(s&&(o.push(e),l[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),s)return e}).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:l}}function me(e,t){var n;return null!=(n=t[e.id])&&n}function fe(e,t,n){var o;if(null==(o=e.subRows)||!o.length)return!1;let l=!0,i=!1;return e.subRows.forEach(e=>{if((!i||l)&&(e.getCanSelect()&&(me(e,t)?i=!0:l=!1),e.subRows&&e.subRows.length)){const n=fe(e,t);"all"===n?i=!0:"some"===n?(i=!0,l=!1):l=!1}}),l?"all":!!i&&"some"}const pe=/([0-9]+)/gm;function ve(e,t){return e===t?0:e>t?1:-1}function be(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function _e(e,t){const n=e.split(pe).filter(Boolean),o=t.split(pe).filter(Boolean);for(;n.length&&o.length;){const e=n.shift(),t=o.shift(),l=parseInt(e,10),i=parseInt(t,10),s=[l,i].sort();if(isNaN(s[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(s[1]))return isNaN(l)?-1:1;if(l>i)return 1;if(i>l)return-1}}return n.length-o.length}const we={alphanumeric:(e,t,n)=>_e(be(e.getValue(n)).toLowerCase(),be(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>_e(be(e.getValue(n)),be(t.getValue(n))),text:(e,t,n)=>ve(be(e.getValue(n)).toLowerCase(),be(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>ve(be(e.getValue(n)),be(t.getValue(n))),datetime:(e,t,n)=>{const o=e.getValue(n),l=t.getValue(n);return o>l?1:o<l?-1:0},basic:(e,t,n)=>ve(e.getValue(n),t.getValue(n))},Se=[B,{getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:V("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;const l=e.columns;return null==(n=l.length?l.some(e=>e.getIsVisible()):null==(o=t.getState().columnVisibility)?void 0:o[e.id])||n},e.getCanHide=()=>{var n,o;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(o=t.options.enableHiding)||o)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=O(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),k(t.options,"debugRows")),e.getVisibleCells=O(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],k(t.options,"debugRows"))},createTable:e=>{const t=(t,n)=>O(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join("_")],e=>e.filter(e=>null==e.getIsVisible?void 0:e.getIsVisible()),k(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t(0,()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t(0,()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t(0,()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t(0,()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(null!=e.getIsVisible&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>null==e.getIsVisible?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},le,ie,N,ee,{createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},{getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:V("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const o=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof o||"number"==typeof o}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,l,i;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(o=t.options.enableGlobalFilter)||o)&&(null==(l=t.options.enableFilters)||l)&&(null==(i=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||i)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Y.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return P(o)?o:"auto"===o?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[o])?t:Y[o]},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:V("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return we.datetime;if("string"==typeof n&&(o=!0,n.split(pe).length>1))return we.alphanumeric}return o?we.text:we.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return P(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(o=t.options.sortingFns)?void 0:o[e.columnDef.sortingFn])?n:we[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{const l=e.getNextSortingOrder(),i=null!=n;t.setSorting(s=>{const r=null==s?void 0:s.find(t=>t.id===e.id),a=null==s?void 0:s.findIndex(t=>t.id===e.id);let u,d=[],c=i?n:"desc"===l;var g;return u=null!=s&&s.length&&e.getCanMultiSort()&&o?r?"toggle":"add":null!=s&&s.length&&a!==s.length-1?"replace":r?"toggle":"replace","toggle"===u&&(i||l||(u="remove")),"add"===u?(d=[...s,{id:e.id,desc:c}],d.splice(0,d.length-(null!=(g=t.options.maxMultiSortColCount)?g:Number.MAX_SAFE_INTEGER))):d="toggle"===u?s.map(t=>t.id===e.id?{...t,desc:c}:t):"remove"===u?s.filter(t=>t.id!==e.id):[{id:e.id,desc:c}],d})},e.getFirstSortDir=()=>{var n,o;return(null!=(n=null!=(o=e.columnDef.sortDescFirst)?o:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var o,l;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?!!(s===i||null!=(o=t.options.enableSortingRemoval)&&!o||n&&null!=(l=t.options.enableMultiRemove)&&!l)&&("desc"===s?"asc":"desc"):i},e.getCanSort=()=>{var n,o;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(o=t.options.enableSorting)||o)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return null!=(n=null!=(o=e.columnDef.enableMultiSort)?o:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const o=null==(n=t.getState().sorting)?void 0:n.find(t=>t.id===e.id);return!!o&&(o.desc?"desc":"asc")},e.getSortIndex=()=>{var n,o;return null!=(n=null==(o=t.getState().sorting)?void 0:o.findIndex(t=>t.id===e.id))?n:-1},e.clearSorting=()=>{t.setSorting(t=>null!=t&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return o=>{n&&(null==o.persist||o.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(o))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:null!=(n=null==(o=e.initialState)?void 0:o.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},oe,{getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:V("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,l;if(t){if(null!=(o=null!=(l=e.options.autoResetAll)?l:e.options.autoResetExpanded)?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}}else e._queue(()=>{t=!0})},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,o;e.setExpanded(t?{}:null!=(n=null==(o=e.initialState)?void 0:o.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some(e=>!e.getIsExpanded())},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{const n=e.split(".");t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var l;const i=!0===o||!(null==o||!o[e.id]);let s={};if(!0===o?Object.keys(t.getRowModel().rowsById).forEach(e=>{s[e]=!0}):s=o,n=null!=(l=n)?l:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:t,...n}=s;return n}return o})},e.getIsExpanded=()=>{var n;const o=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===o||(null==o?void 0:o[e.id]))},e.getCanExpand=()=>{var n,o,l;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(o=t.options.enableExpanding)||o)&&!(null==(l=e.subRows)||!l.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},{getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:V("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,l;if(t){if(null!=(o=null!=(l=e.options.autoResetAll)?l:e.options.autoResetPageIndex)?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}}else e._queue(()=>{t=!0})},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange(e=>z(t,e)),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination(n=>{let o=z(t,n.pageIndex);const l=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,l)),{...n,pageIndex:o}})},e.resetPageIndex=t=>{var n,o;e.setPageIndex(t?0:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageIndex)?n:0)},e.resetPageSize=t=>{var n,o;e.setPageSize(t?10:null!=(n=null==(o=e.initialState)||null==(o=o.pagination)?void 0:o.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination(e=>{const n=Math.max(1,z(t,e.pageSize)),o=e.pageSize*e.pageIndex,l=Math.floor(o/n);return{...e,pageIndex:l,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{var o;let l=z(t,null!=(o=e.options.pageCount)?o:-1);return"number"==typeof l&&(l=Math.max(-1,l)),{...n,pageCount:l}}),e.getPageOptions=O(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map((e,t)=>t)),t},k(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},{getInitialState:e=>({rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onRowPinningChange:V("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,l)=>{const i=o?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],s=l?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],r=new Set([...s,e.id,...i]);t.setRowPinning(e=>{var t,o,l,i,s,a;return"bottom"===n?{top:(null!=(l=null==e?void 0:e.top)?l:[]).filter(e=>!(null!=r&&r.has(e))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter(e=>!(null!=r&&r.has(e))),...Array.from(r)]}:"top"===n?{top:[...(null!=(s=null==e?void 0:e.top)?s:[]).filter(e=>!(null!=r&&r.has(e))),...Array.from(r)],bottom:(null!=(a=null==e?void 0:e.bottom)?a:[]).filter(e=>!(null!=r&&r.has(e)))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter(e=>!(null!=r&&r.has(e))),bottom:(null!=(o=null==e?void 0:e.bottom)?o:[]).filter(e=>!(null!=r&&r.has(e)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:o,enablePinning:l}=t.options;return"function"==typeof o?o(e):null==(n=null!=o?o:l)||n},e.getIsPinned=()=>{const n=[e.id],{top:o,bottom:l}=t.getState().rowPinning,i=n.some(e=>null==o?void 0:o.includes(e)),s=n.some(e=>null==l?void 0:l.includes(e));return i?"top":!!s&&"bottom"},e.getPinnedIndex=()=>{var n,o;const l=e.getIsPinned();if(!l)return-1;const i=null==(n="top"===l?t.getTopRows():t.getBottomRows())?void 0:n.map(e=>{let{id:t}=e;return t});return null!=(o=null==i?void 0:i.indexOf(e.id))?o:-1}},createTable:e=>{e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(o=e.initialState)?void 0:o.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const o=e.getState().rowPinning;var l,i;return t?Boolean(null==(n=o[t])?void 0:n.length):Boolean((null==(l=o.top)?void 0:l.length)||(null==(i=o.bottom)?void 0:i.length))},e._getPinnedRows=(t,n,o)=>{var l;return(null==(l=e.options.keepPinnedRows)||l?(null!=n?n:[]).map(t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(null!=n?n:[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:o}))},e.getTopRows=O(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),k(e.options,"debugRows")),e.getBottomRows=O(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),k(e.options,"debugRows")),e.getCenterRows=O(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{const o=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter(e=>!o.has(e.id))},k(e.options,"debugRows"))}},ce,re];function Ce(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var o;const l=[],i={},s=null!=(o=n.options.maxLeafRowFilterDepth)?o:100,r=function(e,o){void 0===o&&(o=0);const a=[];for(let d=0;d<e.length;d++){var u;let c=e[d];const g=j(n,c.id,c.original,c.index,c.depth,0,c.parentId);if(g.columnFilters=c.columnFilters,null!=(u=c.subRows)&&u.length&&o<s){if(g.subRows=r(c.subRows,o+1),c=g,t(c)&&!g.subRows.length){a.push(c),i[c.id]=c,l.push(c);continue}if(t(c)||g.subRows.length){a.push(c),i[c.id]=c,l.push(c);continue}}else c=g,t(c)&&(a.push(c),i[c.id]=c,l.push(c))}return a};return{rows:r(e),flatRows:l,rowsById:i}}(e,t,n):function(e,t,n){var o;const l=[],i={},s=null!=(o=n.options.maxLeafRowFilterDepth)?o:100,r=function(e,o){void 0===o&&(o=0);const a=[];for(let d=0;d<e.length;d++){let c=e[d];if(t(c)){var u;if(null!=(u=c.subRows)&&u.length&&o<s){const e=j(n,c.id,c.original,c.index,c.depth,0,c.parentId);e.subRows=r(c.subRows,o+1),c=e}a.push(c),l.push(c),i[c.id]=c}}return a};return{rows:r(e),flatRows:l,rowsById:i}}(e,t,n)}const ye={text:["contains","notContains","equals","notEquals","startsWith","endsWith","blank","notBlank"],number:["equals","notEquals","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","between","blank","notBlank"],date:["equals","notEquals","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","between","blank","notBlank"]},Ee=new Set(["blank","notBlank"]),xe=e=>null==e||""===String(e).trim(),Ie=(e,t)=>{if("date"===t){const t=e instanceof Date?e.getTime():new Date(String(e)).getTime();return Number.isNaN(t)?null:t}const n="number"==typeof e?e:Number(e);return Number.isFinite(n)?n:null},Re=(e,t,n="text")=>{if("string"==typeof t)return String(null!=e?e:"").toLowerCase().includes(t.toLowerCase());if("conditions"in t){const o=t.conditions.map(t=>((e,t,n)=>{const{operator:o}=t;if("blank"===o)return xe(e);if("notBlank"===o)return!xe(e);if(xe(t.value))return!0;if("number"===n||"date"===n){const l=Ie(e,n),i=Ie(t.value,n);if(null===l||null===i)return!1;switch(o){case"equals":return l===i;case"notEquals":return l!==i;case"greaterThan":return l>i;case"greaterThanOrEqual":return l>=i;case"lessThan":return l<i;case"lessThanOrEqual":return l<=i;case"between":{const e=Ie(t.value2,n);return null===e?l>=i:l>=i&&l<=e}default:return!1}}const l=String(null!=e?e:"").toLowerCase(),i=String(t.value).toLowerCase();switch(o){case"contains":return l.includes(i);case"notContains":return!l.includes(i);case"equals":return l===i;case"notEquals":return l!==i;case"startsWith":return l.startsWith(i);case"endsWith":return l.endsWith(i);default:return!1}})(e,t,n));return"or"===t.join?o.some(Boolean):o.every(Boolean)}return t.value.some(t=>String(t)===String(e))},Fe=e=>{var t,n,o,l;const{toolbar:i}=e,s=Boolean(e.columnVisibility);if(!0===i)return{columns:s,export:!0,exportOptions:{},history:e.history,search:!0};if("object"==typeof i){const r=null!==(t=i.export)&&void 0!==t&&t;return{columns:null!==(n=i.columns)&&void 0!==n&&n&&s,export:Boolean(r),exportOptions:"object"==typeof r?r:{},history:null!==(o=i.history)&&void 0!==o&&o&&e.history,search:null!==(l=i.search)&&void 0!==l&&l||Boolean(e.globalFilter)}}return{columns:!1,export:!1,exportOptions:{},history:!1,search:Boolean(e.globalFilter)}},Me=e=>Fe(e).search,Ae=(e,t,n)=>{const o=document.createElement("button");o.type="button",o.classList.add("btn","btn-ghost","btn-sm"),o.innerHTML=e,o.setAttribute(n,""),o.setAttribute("data-coreui-tooltip",t);const l=document.createElement("span");return l.classList.add("visually-hidden"),l.textContent=t,o.append(l),o},Le=e=>{const{filterFn:t}=e;return t?(e,n,o)=>t(e.getValue(n),o,e.original):(t,n,o)=>Re(t.getValue(n),o,e.filterType)};function ze(e,t,n){let o,l=n.initialDeps??[],i=!0;function s(){const s=e();return s.length!==l.length||s.some((e,t)=>l[t]!==e)?(l=s,o=t(...s),!(null==n?void 0:n.onChange)||i&&n.skipInitialOnChange||n.onChange(o),i=!1,o):o}return s.updateDeps=e=>{l=e},s}function Ve(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const Pe=(e,t,n)=>{let o;return function(...l){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,l),n)}};let Oe;const ke=()=>{if(void 0!==Oe)return Oe;if("undefined"==typeof navigator)return Oe=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Oe=!0;const e=navigator.maxTouchPoints;return Oe="MacIntel"===navigator.platform&&void 0!==e&&e>0},Te=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},De=e=>e,Be=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,o=new Array(n);for(let e=0;e<n;e++)o[e]=t+e;return o},He=(e,t)=>{const n=e.scrollElement;if(!n)return;const o=e.targetWindow;if(!o)return;const l=e=>{const{width:n,height:o}=e;t({width:Math.round(n),height:Math.round(o)})};if(l(Te(n)),!o.ResizeObserver)return()=>{};const i=new o.ResizeObserver(t=>{const o=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void l({width:t.inlineSize,height:t.blockSize})}l(Te(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},je={passive:!0},Ne="undefined"==typeof window||"onscrollend"in window,qe=(e,t)=>((e,t,n)=>{const o=e.scrollElement;if(!o)return;const l=e.targetWindow;if(!l)return;const i=e.options.useScrollendEvent&&Ne;let s=0;const r=i?null:Pe(l,()=>t(s,!1),e.options.isScrollingResetDelay),a=e=>()=>{s=n(o),null==r||r(),t(s,e)},u=a(!0),d=a(!1);return o.addEventListener("scroll",u,je),i&&o.addEventListener("scrollend",d,je),()=>{o.removeEventListener("scroll",u),i&&o.removeEventListener("scrollend",d)}})(e,t,t=>{const{horizontal:n,isRtl:o}=e.options;return n?t.scrollLeft*(o?-1:1):t.scrollTop}),Ge=(e,t,n)=>{if(n.options.useCachedMeasurements){const t=n.indexFromElement(e),o=n.options.getItemKey(t);return n.itemSizeCache.get(o)??n.options.estimateSize(t)}if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const t=n.indexFromElement(e),o=n.options.getItemKey(t),l=n.itemSizeCache.get(o);if(void 0!==l)return l}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},$e=(e,{adjustments:t=0,behavior:n},o)=>{var l,i;null==(i=null==(l=o.scrollElement)?void 0:l.scrollTo)||i.call(l,{[o.options.horizontal?"left":"top"]:e+t,behavior:n})};class Ke{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e,t,n;return(null==(n=null==(t=null==(e=this.targetWindow)?void 0:e.performance)?void 0:t.now)?void 0:n.call(t))??Date.now()},this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{const t=()=>{const t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(const[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var n;null==(n=t())||n.disconnect(),e=null},observe:e=>{var n;return null==(n=t())?void 0:n.observe(e,{box:"border-box"})},unobserve:e=>{var n;return null==(n=t())?void 0:n.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{var t,n;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:De,rangeExtractor:Be,onChange:()=>{},measureElement:Ge,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const t in e){const n=e[t];void 0!==n&&(o[t]=n)}const l=this.options;let i=null,s=null,r=!1;if(void 0!==l&&l.enabled&&o.enabled&&"end"===o.anchorTo&&null!==this.scrollElement){const e=l.count,a=o.count,u=this.getMeasurements(),d=e>0?(null==(t=u[0])?void 0:t.key)??l.getItemKey(0):null,c=e>0?(null==(n=u[e-1])?void 0:n.key)??l.getItemKey(e-1):null;if(a!==e||e>0&&a>0&&(o.getItemKey(0)!==d||o.getItemKey(a-1)!==c)){r=!0;const t=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??u[0]:null;t&&(i=[t.key,this.getScrollOffset()-t.start]);const n=!0===o.followOnAppend?"auto":o.followOnAppend||null;n&&a>e&&this.isAtEnd(l.scrollEndThreshold)&&(0===e||o.getItemKey(a-1)!==c)&&(s=n)}}this.options=o,r&&(this.pendingMin=0,this.itemSizeCacheVersion++);let a=!1,u=0;if(i&&null!==this.scrollOffset){const[e,t]=i,n=this.getMeasurements(),{count:o,getItemKey:l}=this.options;let s=0;for(;s<o&&l(s)!==e;)s++;if(s<o){const e=n[s];if(e){const n=e.start+t;n!==this.scrollOffset&&(u=n-this.scrollOffset,this.scrollOffset=n,a=!0)}}}(a||s)&&(this.pendingScrollAnchor=[a?i[0]:null,a?i[1]:0,s,u])},this.notify=e=>{var t,n;null==(n=(t=this.options).onChange)||n.call(t,this,e)},this.maybeNotify=ze(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),null!=this.rafId&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();if(this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{if(t&&null===this._intendedScrollOffset&&e===this.scrollOffset)return;null!==this._intendedScrollOffset&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const n=this.getScrollOffset();this.scrollDirection=t?n===e?this.scrollDirection:n<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,null!==this._iosTouchEndTimerId&&null!=this.targetWindow&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,ke()&&null!=this.targetWindow&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener("touchstart",t,je),e.addEventListener("touchend",n,je),this.unsubs.push(()=>{e.removeEventListener("touchstart",t),e.removeEventListener("touchend",n),null!==this._iosTouchEndTimerId&&null!=this.targetWindow&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const n=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,n&&this.scrollElement&&this.options.enabled){const[e,t,o,l]=n;null===e||o||(ke()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?0!==l&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),o&&this.scrollToEnd({behavior:o})}},this._flushIosDeferredIfReady=()=>{if(0===this._iosDeferredAdjustment)return;if(this.isScrolling)return;if(this._iosTouching)return;if(this._iosJustTouchEnded)return;const e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;const n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=ze(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,o,l,i,s,r)=>(void 0!==this.prevLanes&&this.prevLanes!==i&&(this.lanesChangedFlag=!0),this.prevLanes=i,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:o,enabled:l,lanes:i,laneAssignmentMode:s,gap:r}),{key:!1}),this.getMeasurements=ze(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:o,enabled:l,lanes:i,laneAssignmentMode:s,gap:r},a)=>{const u=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));const d=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),1===i){const l=2*e;let i,s=this._flatMeasurements;if(!s||s.length<l){const e=new Float64Array(l);s&&d>0&&e.set(s.subarray(0,2*d)),s=e,this._flatMeasurements=s}if(0===d)i=t+n;else{const e=d-1;i=s[2*e]+s[2*e+1]+r}for(let t=d;t<e;t++){const e=o(t),n=u.get(e),l="number"==typeof n?n:this.options.estimateSize(t);s[2*t]=i,s[2*t+1]=l,i+=l+r}const a=function(e,t,n){const o=new Array(e);return new Proxy(o,{get(o,l,i){if("string"==typeof l){const i=l.charCodeAt(0);if(i>=48&&i<=57){const i=+l;if(Number.isInteger(i)&&i>=0&&i<e){let e=o[i];if(!e){const l=t[2*i];e=o[i]={index:i,key:n(i),start:l,size:t[2*i+1],end:l+t[2*i+1],lane:0}}return e}}if("length"===l)return e}return Reflect.get(o,l,i)}})}(e,s,o);return this.measurementsCache=a,a}const c=this.measurementsCache.slice(0,d),g=new Array(i).fill(void 0),h=new Float64Array(i);let m=0;for(let e=0;e<d;e++){const t=c[e];t&&(void 0===g[t.lane]&&m++,g[t.lane]=e,h[t.lane]=t.end)}for(let l=d;l<e;l++){const e=o(l),a=this.laneAssignments.get(l);let d,f;const p="estimate"===s||u.has(e);if(void 0!==a&&this.options.lanes>1){d=a;const e=g[d],o=void 0!==e?c[e]:void 0;f=o?o.end+r:t+n}else if(m===i){let e=0,t=h[0],n=g[0];for(let o=1;o<i;o++){const l=h[o];(l<t||l===t&&g[o]<n)&&(e=o,t=l,n=g[o])}d=e,f=t+r,p&&this.laneAssignments.set(l,d)}else d=l%this.options.lanes,f=t+n,p&&this.laneAssignments.set(l,d);const v=u.get(e),b="number"==typeof v?v:this.options.estimateSize(l),_=f+b;c[l]={index:l,start:f,size:b,end:_,key:e,lane:d},void 0===g[d]&&m++,g[d]=l,h[d]=_}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ze(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,o)=>0===e.length||0===t?(this.range=null,null):(this.range=function(e,t,n,o,l){const i=e.length-1;if(e.length<=o)return{startIndex:0,endIndex:i};if(1===o&&null!==l){const e=function(e,t,n){let o=0;for(;o<=t;){const l=(o+t)/2|0,i=e[2*l];if(i<n)o=l+1;else{if(!(i>n))return l;t=l-1}}return o>0?o-1:0}(l,i,n);let o=e;const s=n+t;for(;o<i&&l[2*o]+l[2*o+1]<s;)o++;return{startIndex:e,endIndex:o}}let s=We(0,i,t=>e[t].start,n),r=s;if(1===o)for(;r<i&&e[r].end<n+t;)r++;else if(o>1){const l=Array(o).fill(0);for(;r<i&&l.some(e=>e<n+t);){const t=e[r];l[t.lane]=t.end,r++}const a=Array(o).fill(n+t);for(;s>=0&&a.some(e=>e>=n);){const t=e[s];a[t.lane]=t.start,s--}s=Math.max(0,s-s%o),r=Math.min(i,r+(o-1-r%o))}return{startIndex:s,endIndex:r}}(e,t,n,o,1===o&&null!=this._flatMeasurements?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ze(()=>{let e=null,t=null;const n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,o,l)=>null===o||null===l?[]:e({startIndex:o,endIndex:l,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{var t;if(!this.scrollState||"smooth"!==this.scrollState.behavior)return!0;const n=this.scrollState.index??(null==(t=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))?void 0:t.index);if(void 0!==n&&this.range){const t=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),o=Math.max(0,n-t),l=Math.min(this.options.count-1,n+t);return e>=o&&e<=l}return!0},this.measureElement=e=>{if(!e)return void this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});const t=this.indexFromElement(e),n=this.options.getItemKey(t),o=this.elementsCache.get(n);o!==e&&(o&&this.observer.unobserve(o),this.observer.observe(e),this.elementsCache.set(n,e)),this.isScrolling&&!this.scrollState||!this.shouldMeasureDuringScroll(t)||this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var n,o;if(e<0||e>=this.options.count)return;let l,i,s;const r=this._flatMeasurements;if(1===this.options.lanes&&null!==r)s=this.options.getItemKey(e),i=r[2*e],l=r[2*e+1];else{const t=this.measurementsCache[e];if(!t)return;s=t.key,i=t.start,l=t.size}const a=t-(this.itemSizeCache.get(s)??l);if(0!==a){const r="end"===this.options.anchorTo&&"smooth"!==(null==(n=this.scrollState)?void 0:n.behavior)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,u=r?this.getTotalSize():0,d="smooth"!==(null==(o=this.scrollState)?void 0:o.behavior)&&(void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:s,start:i,size:l,end:i+l,lane:0},a,this):i<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(s)||"backward"!==this.scrollDirection));(null===this.pendingMin||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(s,t),this.itemSizeCacheVersion++,r?this.applyScrollAdjustment(this.getTotalSize()-u):d&&this.applyScrollAdjustment(a),this.notify(!1)}},this.getVirtualItems=ze(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const n=[];for(let o=0,l=e.length;o<l;o++){const l=t[e[o]];n.push(l)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0===t.length)return;const n=this._flatMeasurements,o=1===this.options.lanes&&null!=n,l=We(0,t.length-1,o?e=>n[2*e]:e=>Ve(t[e]).start,e);return Ve(t[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),l=this.getScrollOffset();"auto"===t&&(t=e>=l+o?"end":"start"),"center"===t?e+=(n-o)/2:"end"===t&&(e-=o);const i=this.getMaxScrollOffset();return Math.max(Math.min(i,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const n=this.getSize(),o=this.getScrollOffset(),l=this.measurementsCache[e];if(!l)return;if("auto"===t)if(l.end>=o+n-this.options.scrollPaddingEnd)t="end";else{if(!(l.start<=o+this.options.scrollPaddingStart))return[o,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];const i="end"===t?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,t,l.size),t]},this.scrollToOffset=(e,{align:t="start",behavior:n="auto"}={})=>{const o=this.getOffsetForAlignment(e,t),l=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:l,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t="auto",behavior:n="auto"}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));const o=this.getOffsetForIndex(e,t);if(!o)return;const[l,i]=o,s=this.now();this.scrollState={index:e,align:i,behavior:n,startedAt:s,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t="auto"}={})=>{const n=this.getScrollOffset()+e,o=this.now();this.scrollState={index:null,align:"start",behavior:t,startedAt:o,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:e="auto"}={})=>{this.options.count>0?this.scrollToIndex(this.options.count-1,{align:"end",behavior:e}):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let n;if(0===t.length)n=this.options.paddingStart;else if(1===this.options.lanes){const o=t.length-1,l=this._flatMeasurements;n=null!=l?l[2*o]+l[2*o+1]:(null==(e=t[o])?void 0:e.end)??0}else{const e=Array(this.options.lanes).fill(null);let o=t.length-1;for(;o>=0&&e.some(e=>null===e);){const n=t[o];null===e[n.lane]&&(e[n.lane]=n.end),o--}n=Math.max(...e.filter(e=>null!==e))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const e=[];if(0===this.itemSizeCache.size)return e;const t=this.getMeasurements();for(const n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}applyScrollAdjustment(e,t){0!==e&&(ke()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=e:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=e,behavior:t}),null!==this.scrollOffset&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){this.targetWindow?null==this.rafId&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})):this.scrollState=null}reconcileScroll(){if(!this.scrollState)return;if(!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3)return void(this.scrollState=null);const e=null!=this.scrollState.index?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&(o=t,l=this.getScrollOffset(),Math.abs(o-l)<1.01)){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1)return this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:"auto"}),void(this.scrollState=null)}else if(this.scrollState.stableFrames=0,n){const e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),o="smooth"===this.scrollState.behavior&&n>e;this.scrollState.lastTargetOffset=t,o||(this.scrollState.behavior="auto"),this._scrollToOffset(t,{adjustments:void 0,behavior:o?"smooth":"auto"})}var o,l;this.scheduleScrollReconcile()}}const We=(e,t,n,o)=>{for(;e<=t;){const l=(e+t)/2|0,i=n(l);if(i<o)e=l+1;else{if(!(i>o))return l;t=l-1}}return e>0?e-1:0},Ue="m477.8 140.2-106-106a62.132 62.132 0 0 0-93.617 81.24l-4.913 5.533-97.654 42.9-42.611-23.026a24.04 24.04 0 0 0-28.86 4.638L62.6 189.487a23.88 23.88 0 0 0 .479 33.449l101.68 101.679L16 473.373V496h22.627l148.758-148.758L288.6 448.457a23.93 23.93 0 0 0 33.275.642l44.425-41.128a23.98 23.98 0 0 0 4.773-29.092l-23.344-42.858 42.131-90.515 8.6-10.318A62.134 62.134 0 0 0 477.8 140.2m-22.628 65.231a30.125 30.125 0 0 1-42.6 0l-16.885-16.886-33.08 39.678-50.7 108.933 28.087 51.566-34.209 31.669L91.2 205.806l32-33.89 50.969 27.543 118.386-52.008 29.177-32.863-15.158-15.161a30.126 30.126 0 0 1 42.6-42.6l106 106a30.126 30.126 0 0 1 0 42.6Z",Ze='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false">',Je=`${Ze}<path fill="currentColor" d="${Ue}"/></svg>`,Xe=`${Ze}<g transform="translate(512 0) scale(-1 1)"><path fill="currentColor" d="${Ue}"/></g></svg>`,Ye={addCondition:"Add condition",applyFilter:"Apply",clearFilter:"Clear filter",clearSort:"Unsort",columnMenu:"Column options for {column}",filterAction:"Filter…",filterColumn:"Filter {column}",firstPage:"First page",globalFilterLabel:"Search",globalFilterPlaceholder:"Search",hideColumn:"Hide column",itemsInfo:"{first}–{last} of {total}",joinAnd:"AND",joinOr:"OR",lastPage:"Last page",loadError:"Failed to load data",loading:"Loading…",moveLeft:"Move left",moveRight:"Move right",nextPage:"Next page",operatorBetween:"Between",operatorBlank:"Blank",operatorContains:"Contains",operatorEndsWith:"Ends with",operatorEquals:"Equals",operatorGreaterThan:"Greater than",operatorGreaterThanOrEqual:"Greater than or equal",operatorLessThan:"Less than",operatorLessThanOrEqual:"Less than or equal",operatorNotBlank:"Not blank",operatorNotContains:"Does not contain",operatorNotEquals:"Not equals",operatorStartsWith:"Starts with",pageSizeLabel:"Rows per page",paginationLabel:"Pagination",pinLeft:"Pin left",pinRight:"Pin right",previousPage:"Previous page",redoneAnnouncement:"Change redone",resetColumns:"Reset",resultsAnnouncement:"{count} results",searchValues:"Search values",selectAllRows:"Select all rows",selectAllValues:"Select all",selectRow:"Select row",showAllColumns:"Show all",sortAscending:"Sort ascending",sortDescending:"Sort descending",toolbarColumns:"Columns",toolbarExport:"Export",toolbarRedo:"Redo",toolbarUndo:"Undo",undoneAnnouncement:"Change undone",unpin:"Unpin"},Qe=(e,t)=>e.replace(/\{(\w+)\}/g,(e,n)=>n in t?String(t[n]):e),et="data-grid-cell-pinned-left",tt="data-grid-cell-pinned-right",nt="data-grid-cell-pinned-left-last",ot="data-grid-cell-pinned-right-first",lt=(e,t)=>{e.classList.remove(et,tt,nt,ot),e.style.left="",e.style.right="",t&&("left"===t.side?(e.classList.add(et),t.edge&&e.classList.add(nt),e.style.left=t.afterSelect?`calc(var(--cui-data-grid-select-cell-width) + ${t.offset}px)`:`${t.offset}px`):(e.classList.add(tt),t.edge&&e.classList.add(ot),e.style.right=`${t.offset}px`))},it=(e,t,n)=>{"string"!=typeof t?1===e.childNodes.length&&e.firstChild===t||e.replaceChildren(t):e.innerHTML=n(t)},st="data-grid-cell-editor",rt=e=>e?e.desc?"descending":"ascending":"neutral",at=(e,t)=>"ascending"===e?t.sortAscending:"descending"===e?t.sortDescending:t.sortNeutral,ut=()=>{const e=document.createElement("span");return e.classList.add("data-grid-resizer"),e.setAttribute("aria-hidden","true"),e.dataset.coreuiResizer="",e},dt=e=>{const t=document.createElement("thead");t.classList.add("data-grid-header");const n=new Map,o=new Map,l=new Map,i=new Map,s=[],r=new Map(e.columns.map(e=>[e.key,!1!==e.movable])),{row:a,selectAllInput:u,selectCell:d}=((e,t,n,o)=>{var l,i,s,r;const a=document.createElement("tr");let u=null,d=null;if(e.cellNavigation&&a.setAttribute("role","row"),e.selection){const{cell:t,input:n}=(e=>{const t=document.createElement("th");if(t.classList.add("data-grid-select-cell"),t.setAttribute("scope","col"),!e.selectAll)return{cell:t,input:null};const n=document.createElement("input");return n.type="checkbox",n.classList.add("form-check-input"),n.setAttribute("aria-label",e.labels.selectAllRows),n.dataset.coreuiSelectAll="",t.append(n),{cell:t,input:n}})(e);u=n,d=t,e.cellNavigation&&(t.setAttribute("role","columnheader"),n&&(n.tabIndex=-1)),a.append(t)}for(const u of e.columns){const d=document.createElement("th");d.setAttribute("scope","col"),d.dataset.coreuiColumn=u.key,e.cellNavigation&&(d.setAttribute("role","columnheader"),d.tabIndex=-1),u.style&&Object.assign(d.style,u.style),void 0!==u.width&&(d.style.width=`${u.width}px`);const c=document.createElement("div");if(c.classList.add("data-grid-header-cell"),e.isSortable(u)){d.classList.add("data-grid-sortable");const t=document.createElement("button");t.type="button",t.classList.add("data-grid-sort-button"),t.append(null!==(l=u.label)&&void 0!==l?l:u.key);const n=document.createElement("span");n.classList.add("data-grid-sort-icon"),n.setAttribute("aria-hidden","true"),n.innerHTML=e.icons.sortNeutral,n.dataset.coreuiSort="neutral",t.append(n),o.set(u.key,n),c.append(t)}else{const e=document.createElement("span");e.classList.add("data-grid-header-label"),e.textContent=null!==(i=u.label)&&void 0!==i?i:u.key,c.append(e)}if(e.hasFilterMenu(u)){const t=document.createElement("button");t.type="button",t.classList.add("btn","btn-ghost","btn-sm","data-grid-filter-button"),t.innerHTML=e.icons.filter,t.dataset.coreuiFilter=u.key,t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded","false");const n=Qe(e.labels.filterColumn,{column:null!==(s=u.label)&&void 0!==s?s:u.key});t.setAttribute("aria-label",n),t.setAttribute("data-coreui-tooltip",n),c.append(t)}if(e.hasMenu(u)){const t=document.createElement("button");t.type="button",t.classList.add("btn","btn-ghost","btn-sm","data-grid-menu-button"),t.innerHTML=e.icons.columnMenu,t.dataset.coreuiMenu=u.key,t.setAttribute("aria-haspopup","menu"),t.setAttribute("aria-expanded","false");const n=Qe(e.labels.columnMenu,{column:null!==(r=u.label)&&void 0!==r?r:u.key});t.setAttribute("aria-label",n),t.setAttribute("data-coreui-tooltip",n),c.append(t)}if(d.append(c),e.cellNavigation)for(const e of c.querySelectorAll("button"))e.tabIndex=-1;if(e.resizable&&e.isResizable(u)){const e=ut();n.set(u.key,e),d.append(e)}t.set(u.key,d),a.append(d)}return{row:a,selectAllInput:u,selectCell:d}})(e,n,o,l);t.append(a);let c=null,g=null;if(e.filterRow){const n=((e,t,n)=>{const o=document.createElement("tr");o.classList.add("data-grid-filter-row"),e.cellNavigation&&o.setAttribute("role","row");let l=null;e.selection&&(l=document.createElement("th"),o.append(l));for(const l of e.columns){const i=document.createElement("th"),s=e.table.getColumn(l.key);if(e.isFilterable(l)&&l.filter&&s){const t=l.filter({column:s,table:e.table,labels:e.labels});n.push(t),i.append(t.element)}t.set(l.key,i),o.append(i)}return{row:o,selectCell:l}})(e,i,s);g=n.selectCell,c=n.row,t.append(n.row)}let h=null;return{element:t,rowCount:e.filterRow?2:1,update(t){var m,f,p,v,b,_;const w=t.order.join("|");w!==h&&(h=w,(t=>{const o=new Set(t),l=(n,l,i)=>{const s=i?[i]:[];for(const e of t){const t=l.get(e);t&&s.push(t)}if(n.append(...s),e.cellNavigation)for(const[e,t]of s.entries())t.setAttribute("aria-colindex",String(e+1));for(const[e,t]of l)o.has(e)||t.remove()};l(a,n,d),c&&l(c,i,g)})(t.order));for(const[o,i]of n){const n=t.sorting.find(e=>e.id===o),s=rt(n);"neutral"===s?i.removeAttribute("aria-sort"):i.setAttribute("aria-sort",s);const r=l.get(o);r&&r.dataset.coreuiSort!==s&&(r.dataset.coreuiSort=s,r.innerHTML=at(s,e.icons)),t.sizes&&void 0!==t.sizes[o]&&(i.style.width=`${t.sizes[o]}px`),t.pinning&&lt(i,null!==(m=t.pinning.columns[o])&&void 0!==m?m:null)}if(e.draggable){const e=e=>{var n,o,l;return null!==(l=null===(o=null===(n=t.pinning)||void 0===n?void 0:n.columns[e])||void 0===o?void 0:o.side)&&void 0!==l?l:"center"},o=new Map;for(const n of t.order)if(r.get(n)){const t=e(n);o.set(t,(null!==(f=o.get(t))&&void 0!==f?f:0)+1)}for(const[t,l]of n){const n=Boolean(r.get(t))&&(null!==(p=o.get(e(t)))&&void 0!==p?p:0)>1;l.draggable=n,n?l.dataset.coreuiDraggable="":delete l.dataset.coreuiDraggable}}for(const[e,n]of o)n.classList.toggle("data-grid-resizer-active",t.resizingColumn===e);if(t.filteredColumns)for(const[e,o]of n)null===(v=o.querySelector("[data-coreui-filter]"))||void 0===v||v.classList.toggle("data-grid-filter-button-filtered",t.filteredColumns.includes(e));if(t.pinning){for(const[e,n]of i)lt(n,null!==(b=t.pinning.columns[e])&&void 0!==b?b:null);d&&lt(d,t.pinning.select),g&&lt(g,t.pinning.select)}u&&t.selectAll&&(u.checked=t.selectAll.checked,u.indeterminate=t.selectAll.indeterminate);for(const e of s)null===(_=e.update)||void 0===_||_.call(e)},dispose(){var e;for(const t of s)null===(e=t.dispose)||void 0===e||e.call(t)}}},ct={contains:"operatorContains",notContains:"operatorNotContains",equals:"operatorEquals",notEquals:"operatorNotEquals",startsWith:"operatorStartsWith",endsWith:"operatorEndsWith",blank:"operatorBlank",notBlank:"operatorNotBlank",greaterThan:"operatorGreaterThan",greaterThanOrEqual:"operatorGreaterThanOrEqual",lessThan:"operatorLessThan",lessThanOrEqual:"operatorLessThanOrEqual",between:"operatorBetween"};let gt=0;const ht=e=>"number"===e?"number":"date"===e?"date":"text",mt=e=>{const t=document.createElement("div");t.classList.add("data-grid-filter-menu"),t.setAttribute("role","dialog"),t.id="data-grid-filter-menu-"+ ++gt;let n=null;const o=(e=!1)=>{n&&(n.setAttribute("aria-expanded","false"),n.removeAttribute("aria-controls"),e&&n.focus(),n=null,t.remove(),document.removeEventListener("pointerdown",l,!0),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i))},l=e=>{const l=e.target;t.contains(l)||(null==n?void 0:n.contains(l))||o()},i=e=>{(null==e?void 0:e.target)instanceof Node&&t.contains(e.target)||o()},s=e=>{"Escape"===e.key&&(e.stopPropagation(),o(!0))};t.addEventListener("keydown",s);const r=(t,n)=>{var o;const l=document.createElement("div");l.classList.add("data-grid-filter-menu-condition");const i=document.createElement("select");i.classList.add("form-select","form-select-sm"),i.setAttribute("aria-label",e.labels.filterAction);for(const n of ye[t]){const t=document.createElement("option");t.value=n,t.textContent=e.labels[ct[n]],i.append(t)}i.value=null!==(o=null==n?void 0:n.operator)&&void 0!==o?o:ye[t][0];const s=document.createElement("input");s.type=ht(t),s.classList.add("form-control","form-control-sm"),s.dataset.coreuiFilterValue="",s.value=void 0===(null==n?void 0:n.value)?"":String(n.value);const r=document.createElement("input");r.type=ht(t),r.classList.add("form-control","form-control-sm"),r.dataset.coreuiFilterValue2="",r.value=void 0===(null==n?void 0:n.value2)?"":String(n.value2);const a=()=>{const e=i.value;s.hidden=Ee.has(e),r.hidden="between"!==e};return i.addEventListener("change",a),l.append(i,s,r),a(),l},a=(t,n)=>{const l=document.createElement("div");l.classList.add("data-grid-filter-menu-footer");const i=document.createElement("button");i.type="button",i.classList.add("btn","btn-primary","btn-sm"),i.textContent=e.labels.applyFilter,i.addEventListener("click",t);const s=document.createElement("button");return s.type="button",s.classList.add("btn","btn-outline-secondary","btn-sm"),s.textContent=e.labels.clearFilter,s.addEventListener("click",()=>{e.applyFilter(n),o(!0)}),l.append(i,s),l},u=(s,u)=>{var d,c,g;o();const h=e.getColumn(u);if(!h)return;t.setAttribute("aria-label",Qe(e.labels.filterColumn,{column:null!==(d=h.label)&&void 0!==d?d:h.key}));const m=null!==(c=h.filterType)&&void 0!==c?c:"text";t.replaceChildren("select"===m?(t=>{const n=e.getFacetedValues(t),l=e.getFilterValue(t),i=l&&"string"!=typeof l&&"operator"in l?new Set(l.value.map(String)):null,s=document.createElement("div"),r=document.createElement("div");r.classList.add("data-grid-filter-menu-values");const u=[],d=(e,t)=>{const n=document.createElement("label");n.classList.add("form-check");const o=document.createElement("input");o.type="checkbox",o.classList.add("form-check-input"),o.checked=t;const l=document.createElement("span");return l.classList.add("form-check-label"),l.textContent=e,n.append(o,l),r.append(n),o},c=d(e.labels.selectAllValues,null===i);c.dataset.coreuiSelectAllValues="";for(const e of n){const t=d(String(e),null===i||i.has(String(e)));t.dataset.coreuiFilterOption=String(e),u.push(t)}const g=()=>{c.checked=u.every(e=>e.checked)};if(c.addEventListener("change",()=>{for(const e of u)e.checked=c.checked}),r.addEventListener("change",e=>{e.target!==c&&g()}),g(),n.length>10){const t=document.createElement("input");t.type="text",t.classList.add("form-control","form-control-sm"),t.setAttribute("aria-label",e.labels.searchValues),t.placeholder=e.labels.searchValues,t.addEventListener("input",()=>{const e=t.value.toLowerCase();for(const t of u)t.closest("label").hidden=!t.dataset.coreuiFilterOption.toLowerCase().includes(e)}),s.append(t)}return s.append(r),s.append(a(()=>{const n=u.filter(e=>e.checked);e.applyFilter(t,n.length===u.length?void 0:{operator:"in",value:n.map(e=>e.dataset.coreuiFilterOption)}),o(!0)},t)),s})(u):((n,l)=>{var i;const s=e.getFilterValue(n),u=s&&"string"!=typeof s&&"conditions"in s?s.conditions:[],d=s&&"string"!=typeof s&&"conditions"in s?s.join:"and",c=[r(l,null!==(i=u[0])&&void 0!==i?i:null)],g=document.createElement("div");g.append(c[0]);const h=document.createElement("div");h.classList.add("data-grid-filter-menu-join");const m=`${t.id}-join`;for(const t of["and","or"]){const n=document.createElement("label"),o=document.createElement("input");o.type="radio",o.classList.add("form-check-input"),o.name=m,o.value=t,o.checked=d===t,n.append(o,` ${"and"===t?e.labels.joinAnd:e.labels.joinOr}`),h.append(n)}const f=document.createElement("button");f.type="button",f.classList.add("btn","btn-link","btn-sm"),f.textContent=e.labels.addCondition;const p=()=>{var e;c.length>=2||(c.push(r(l,null!==(e=u[1])&&void 0!==e?e:null)),f.before(h,c[1]),f.hidden=!0)};return f.addEventListener("click",p),g.append(f),u.length>1&&p(),g.append(a(()=>{var t,l;const i=c.map(e=>(e=>{const t=e.querySelector("select").value,{value:n}=e.querySelector("[data-coreui-filter-value]"),o=e.querySelector("[data-coreui-filter-value2]").value;return Ee.has(t)?{operator:t}:""===n.trim()?null:{operator:t,value:n,..."between"===t&&""!==o.trim()&&{value2:o}}})(e)).filter(e=>null!==e),s=null!==(l=null===(t=h.querySelector("input:checked"))||void 0===t?void 0:t.value)&&void 0!==l?l:"and";e.applyFilter(n,0===i.length?void 0:{conditions:i,join:s}),o(!0)},n)),g})(u,m)),n=s,s.setAttribute("aria-expanded","true"),s.setAttribute("aria-controls",t.id),e.root.append(t);const f=e.root.getBoundingClientRect(),p=s.getBoundingClientRect();t.style.top=p.bottom-f.top+"px",t.style.left=`${Math.max(p.right-f.left-t.offsetWidth,0)}px`,document.addEventListener("pointerdown",l,!0),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),null===(g=t.querySelector("select, input"))||void 0===g||g.focus()};return{toggle(e,t){n!==e?(o(),u(e,t)):o(!0)},close(){o()},dispose(){o(),t.removeEventListener("keydown",s)}}},ft="data-grid-menu-item";let pt=0;const vt=(e,t,n={})=>{const o=document.createElement("li");o.classList.add("page-item"),n.active&&(o.classList.add("active"),o.setAttribute("aria-current","page")),n.disabled&&o.classList.add("disabled");const l=document.createElement("button");return l.type="button",l.classList.add("page-link"),l.textContent=e,l.disabled=Boolean(n.disabled),l.dataset.coreuiPage=t,n.ariaLabel&&l.setAttribute("aria-label",n.ariaLabel),o.append(l),o};let bt=0;const _t="data-coreui-tooltip",wt=`[${_t}]`,St=(e,t={})=>{var n;const o=null!==(n=t.delimiter)&&void 0!==n?n:",",l=[...e.getLeftVisibleLeafColumns(),...e.getCenterVisibleLeafColumns(),...e.getRightVisibleLeafColumns()],i=e=>{return((e,t)=>/["\r\n]/.test(e)||e.includes(t)?`"${e.replace(/"/g,'""')}"`:e)(t.sanitize?/^[=+\-@\t\r]/.test(n=e)?`'${n}`:n:e,o);var n},s=e=>e.map(i).join(o),r=s(l.map(e=>{var t,n;return String(null!==(n=null===(t=e.columnDef.meta)||void 0===t?void 0:t.label)&&void 0!==n?n:e.id)})),a=((e,t)=>"all"===t?e.getCoreRowModel().rows:"selected"===t?e.getSelectedRowModel().rows:e.getSortedRowModel().rows)(e,t.scope).map(e=>s(l.map(t=>{var n;const o=e.getValue(t.id),l=t.columnDef.meta;return(null==l?void 0:l.formatter)?String(null!==(n=l.formatter(o,e.original))&&void 0!==n?n:""):String(null!=o?o:"")}))),u=[r,...a].join("\r\n");return t.bom?`\ufeff${u}`:u},Ct=(e,t={})=>{var n;const o=new Blob([St(e,t)],{type:"text/csv;charset=utf-8;"}),l=URL.createObjectURL(o),i=document.createElement("a");i.href=l,i.download=null!==(n=t.filename)&&void 0!==n?n:"export.csv",i.style.display="none",document.body.append(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(l))},yt=(e,t)=>{let n;return(...o)=>{clearTimeout(n),n=setTimeout(()=>e(...o),t)}},Et={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},xt={...Et,svg:["xmlns","version","baseprofile","width","height","viewbox","preserveaspectratio","aria-hidden","role","focusable","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin"],g:["id","class","transform","style"],path:["id","class","d","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","stroke-opacity"],circle:["id","class","cx","cy","r","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],rect:["id","class","x","y","width","height","rx","ry","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],ellipse:["id","class","cx","cy","rx","ry","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],line:["id","class","x1","y1","x2","y2","stroke","stroke-width","stroke-linecap","stroke-opacity"],polygon:["id","class","points","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],polyline:["id","class","points","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],text:["id","class","x","y","dx","dy","text-anchor","font-family","font-size","font-weight","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],tspan:["id","class","x","y","dx","dy","text-anchor","font-family","font-size","font-weight","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],defs:[],symbol:["id","class","viewbox","preserveaspectratio"],use:["id","class","x","y","width","height","href"],image:["id","class","x","y","width","height","href","preserveaspectratio","xlink:href"],pattern:["id","class","x","y","width","height","patternunits","patterncontentunits","patterntransform","preserveaspectratio"],lineargradient:["id","class","gradientunits","x1","y1","x2","y2","spreadmethod","gradienttransform"],radialgradient:["id","class","gradientunits","cx","cy","r","fx","fy","spreadmethod","gradienttransform"],mask:["id","class","x","y","width","height","maskunits","maskcontentunits","masktransform"],clippath:["id","class","clippathunits"],marker:["id","class","markerunits","markerwidth","markerheight","orient","preserveaspectratio","viewbox","refx","refy"],title:[],desc:[]},It=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Rt=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Ft=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?!It.has(n)||Boolean(Rt.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(n))};function Mt(e,t,n){if(!e.length)return e;if(n&&"function"==typeof n)return n(e);const o=(new window.DOMParser).parseFromString(e,"text/html"),l=[].concat(...o.body.querySelectorAll("*"));for(const e of l){const n=e.nodeName.toLowerCase();if(!Object.keys(t).includes(n)){e.remove();continue}const o=[].concat(...e.attributes),l=[].concat(t["*"]||[],t[n]||[]);for(const t of o)Ft(t,l)||e.removeAttribute(t.nodeName)}return o.body.innerHTML}const At=".coreui.data-grid",Lt=`change${At}`,zt=`click${At}`,Vt=`dataError${At}`,Pt=`dataLoad${At}`,Ot=`dblclick${At}`,kt=`editCancel${At}`,Tt=`editCommit${At}`,Dt=`editStart${At}`,Bt=`filterChange${At}`,Ht=`input${At}`,jt=`orderChange${At}`,Nt=`paginationChange${At}`,qt=`pinningChange${At}`,Gt=`selectionChange${At}`,$t=`sizingChange${At}`,Kt=`sortingChange${At}`,Wt=`visibilityChange${At}`,Ut=`focusin${At}`,Zt=`focusout${At}`,Jt=`keydown${At}`,Xt=`dragend${At}`,Yt=`dragleave${At}`,Qt=`dragover${At}`,en=`dragstart${At}`,tn=`drop${At}`,nn=`mousedown${At}`,on=`pointerdown${At}`,ln=`touchstart${At}`,sn="data-grid",rn="data-grid-dragging",an="data-grid-drop-target",un="th[data-coreui-draggable]",dn="input[data-coreui-global-filter]",cn="[data-coreui-resizer]",gn="button[data-coreui-toolbar-redo]",hn="button[data-coreui-toolbar-undo]",mn=[5,10,20,50];let fn=0;const pn="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]",vn=(e,t)=>{const n=t?0:-1;e.tabIndex!==n&&(e.tabIndex=n)},bn={cellNavigation:!1,columnFilters:!1,columnMenu:!1,columnMenuIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M204 148a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26M204 264a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26M204 380a52 52 0 1 0 104 0 52 52 0 1 0-104 0m78 0a26 26 0 1 1-26-26 26.03 26.03 0 0 1 26 26"/></svg>',columnOrder:!1,columnPinning:!1,columnSizing:!1,columnVisibility:!1,columns:[],dataProvider:null,editing:!1,empty:"No items found",filterIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M96 197.333h320v32H96zm72 101.334h176v32H168zM216 400h80v32h-80zM48 96h416v32H48z"/></svg>',globalFilter:!1,hideColumnIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="m397.222 131.1-.218-.223c-63.173-63.17-158.534-75.015-233.776-35.531l23.938 23.939c61.571-27.691 136.573-16.327 187.105 34.115L464 246.683v3.107l-71.744 74.585 22.63 22.63L496 262.683V233.79Z"/><path fill="currentColor" d="M352.8 284.33a103.307 103.307 0 0 0-132.893-132.892L246.1 177.63a71.228 71.228 0 0 1 80.507 80.508Zm17.1 62.938-33.831-33.831c.088-.108.179-.212.266-.32l-22.805-22.806q-.126.168-.253.334l-99.681-99.681.334-.253-22.81-22.805c-.108.087-.213.179-.321.266L38.627 16H16v22.627l95.689 95.689L16 233.79v28.893l98.778 102.689.218.222A199.73 199.73 0 0 0 367.372 390l106 106H496v-22.627L392.537 369.911Zm-177.157-131.9 96.128 96.132a71.28 71.28 0 0 1-96.133-96.133Zm-55.014 127.705L48 249.79v-3.107l86.319-89.737 35.065 35.064a103.248 103.248 0 0 0 142.842 142.843l32.007 32.007c-64.51 40.015-150.522 32.095-206.504-23.787"/></svg>',history:!1,itemKey:null,items:[],labels:{},moveLeftIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M254.625 56h-38.632L16 256.2 216 456h38.623V336h144V176h-144Zm112 152v96h-144v113.384l-161.37-161.21 161.37-161.535V208Zm96-152h32v400h-32z"/></svg>',moveRightIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M296.007 56h-38.632v120h-144v160h144v120H296l200-199.8Zm-6.632 361.384V304h-144v-96h144V94.639l161.37 161.535ZM17.375 56h32v400h-32z"/></svg>',overscan:10,pagination:!1,pinLeftIcon:Je,pinRightIcon:Xe,rowHeight:44,rowSelection:!1,sanitize:!0,sanitizeFn:null,slots:{},sortAscendingIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M390.624 150.625 256 16 121.376 150.625l22.628 22.627 95.997-95.998v417.982h32V77.257l95.995 95.995z"/></svg>',sortDescendingIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="m367.997 338.75-95.998 95.997V17.503h-32v417.242l-95.996-95.995-22.627 22.627L256 496l134.624-134.623z"/></svg>',sortNeutralIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M384 433.373V160h-32v274.51l-69.823-69.823-22.627 22.626 107.882 107.883 107.881-107.883-22.626-22.626zM159.432 17.372 51.55 125.255l22.627 22.627L144 78.059V352h32V79.195l68.687 68.687 22.626-22.627z"/></svg>',sorterVisibility:!1,sorting:!0,stateKey:null,toolbar:!1,toolbarColumnsIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M16 64v384h480V64Zm304 32v320H192V96ZM48 96h112v320H48Zm416 320H352V96h112Z"/></svg>',toolbarExportIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M16 464h480v32H16zm379.313-164.687-22.626-22.626L280 369.373V16h-32v353.373l-92.687-92.686-22.626 22.626L264 430.627z"/></svg>',toolbarRedoIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M361.376 495.163 226.753 360.54l22.627-22.627 111.996 111.996 111.997-111.996L496 360.54z"/><path fill="currentColor" d="M377.377 472.52h-32V196.426C345.377 114.584 278.794 48 196.952 48c-83.229 0-148.426 63.106-148.426 143.667h-32c0-48.024 18.85-92.569 53.079-125.429C103.35 33.842 148.576 16 196.952 16c99.487 0 180.425 80.938 180.425 180.426Z"/></svg>',toolbarUndoIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="M495.473 197.262c0-73.061-43.651-136.118-106.242-164.462q-2-.9-4.021-1.762-4.046-1.715-8.19-3.235-2.071-.761-4.167-1.47-4.19-1.422-8.468-2.64a180.95 180.95 0 0 0-98.675 0q-4.278 1.218-8.469 2.64-2.094.71-4.166 1.47-4.143 1.519-8.19 3.235-2.023.857-4.021 1.762c-62.592 28.344-106.242 91.4-106.242 164.462v237.483L38.627 338.75 16 361.377 150.623 496l134.623-134.623-22.627-22.627-96 96V197.263c0-72.891 52.814-133.678 122.186-146.1a149.4 149.4 0 0 1 52.479 0c69.371 12.426 122.186 73.213 122.186 146.1h32Z"/></svg>',unpinIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 512 512" aria-hidden="true" focusable="false"><path fill="currentColor" d="m427.314 107.313-22.628-22.626L256 233.373 107.314 84.687l-22.628 22.626L233.373 256 84.686 404.687l22.628 22.626L256 278.627l148.686 148.686 22.628-22.626L278.627 256z"/></svg>',virtualization:!0},_n={cellNavigation:"boolean",columnFilters:"boolean",columnMenu:"(boolean|function)",columnMenuIcon:"string",columnOrder:"(boolean|array)",columnPinning:"(boolean|object)",columnSizing:"(boolean|object)",columnVisibility:"(boolean|object)",columns:"array",dataProvider:"(function|null)",editing:"boolean",empty:"(string|function)",filterIcon:"string",globalFilter:"boolean",hideColumnIcon:"string",history:"boolean",itemKey:"(function|null)",items:"array",labels:"object",moveLeftIcon:"string",moveRightIcon:"string",overscan:"number",pagination:"(boolean|object)",pinLeftIcon:"string",pinRightIcon:"string",rowHeight:"number",rowSelection:"(boolean|object)",sanitize:"boolean",sanitizeFn:"(function|null)",slots:"object",sortAscendingIcon:"string",sortDescendingIcon:"string",sortNeutralIcon:"string",sorterVisibility:"(string|boolean)",sorting:"(boolean|object)",stateKey:"(string|null)",toolbar:"(boolean|object)",toolbarColumnsIcon:"string",toolbarExportIcon:"string",toolbarRedoIcon:"string",toolbarUndoIcon:"string",unpinIcon:"string",virtualization:"boolean"};class wn extends L{constructor(e,t){super(e,t),this._virtualizer=null,this._toolbar=null,this._paginations=[],this._emptySlot=null,this._dataSource=null,this._loading=null,this._loadFailed=!1,this._dataVersion=0,this._liveRegion=null,this._selectionAnchorIndex=null,this._activeCell=null,this._containsFocus=!1,this._editingCell=null,this._undoStack=[],this._redoStack=[],this._persistState=null,this._editor=null,this._editorPointerdownHandler=null,this._editorPopup=null,this._editorErrorElement=null,this._editorFocusPending=!1,this._columnsByKey=new Map,this._dragColumn=null,this._menu=null,this._tooltip=null,this._filterMenu=null,this._columnChooser=null,this._toolbarConfig=null,this._element&&(this._labels={...Ye,...this._config.labels},this._scheduler=(e=>{let t=!1,n=!1;const o=()=>{t=!1,n||e()};return{schedule(){t||n||(t=!0,"function"!=typeof window.requestAnimationFrame?setTimeout(o,16):window.requestAnimationFrame(o))},dispose(){n=!0}}})(()=>this._update()),this._table=this._createTable(),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("visually-hidden"),this._liveRegion.setAttribute("aria-live","polite"),this._element.append(this._liveRegion),this._render(),this._addEventListeners(),this._tooltip=(e=>{const t=document.createElement("div");t.className="data-grid-tooltip",t.setAttribute("role","tooltip"),t.setAttribute("aria-hidden","true"),t.hidden=!0,e.append(t);let n,o=null;const l=e=>{const t=e instanceof Element?e.closest(wt):null;return t instanceof HTMLElement&&t.getAttribute(_t)?t:null},i=e=>{o=e,t.textContent=e.getAttribute(_t),t.style.visibility="hidden",t.hidden=!1,(()=>{if(!o)return;const e=o.getBoundingClientRect(),n=t.offsetWidth,l=t.offsetHeight,i=e.top-l-6,s=i>=0?i:e.bottom+6,r=Math.max(4,Math.min(e.left+(e.width-n)/2,window.innerWidth-n-4));t.style.top=`${s}px`,t.style.left=`${r}px`,t.style.visibility="visible"})()},s=()=>{clearTimeout(n),o=null,t.hidden=!0},r=e=>{const t=l(e.target);t&&t!==o&&(clearTimeout(n),n=setTimeout(()=>i(t),200))},a=e=>{o&&e.relatedTarget instanceof Node&&o.contains(e.relatedTarget)||s()},u=e=>{const t=l(e.target);t&&i(t)};return e.addEventListener("pointerover",r),e.addEventListener("pointerout",a),e.addEventListener("pointerdown",s),e.addEventListener("focusin",u),e.addEventListener("focusout",s),window.addEventListener("scroll",s,!0),{dispose(){clearTimeout(n),e.removeEventListener("pointerover",r),e.removeEventListener("pointerout",a),e.removeEventListener("pointerdown",s),e.removeEventListener("focusin",u),e.removeEventListener("focusout",s),window.removeEventListener("scroll",s,!0),t.remove()}}})(this._element),this._restorePersistedState(),this._initDataSource())}get table(){return this._table}static get Default(){return bn}static get DefaultType(){return _n}static get NAME(){return"data-grid"}static getInstance(e){return super.getInstance(e)}static getOrCreateInstance(e,t){return super.getOrCreateInstance(e,t)}getSelectedItems(){return this._table.getSelectedRowModel().rows.map(e=>e.original)}getCsv(e){return St(this._table,e)}downloadCsv(e){Ct(this._table,e)}getState(){var e;const t=this._table.getState();return{columnFilters:t.columnFilters,columnOrder:t.columnOrder,columnPinning:t.columnPinning,columnSizing:t.columnSizing,columnVisibility:t.columnVisibility,globalFilter:null!==(e=t.globalFilter)&&void 0!==e?e:"",pagination:t.pagination,rowSelection:t.rowSelection,sorting:t.sorting}}restoreState(e){if(this._table.setState(t=>({...t,...e})),void 0!==e.globalFilter){const t=this._element.querySelector(dn);t&&(t.value=e.globalFilter)}this._scheduler.schedule()}undo(){this._applyHistoryEntry(this._undoStack,this._redoStack,!0)}redo(){this._applyHistoryEntry(this._redoStack,this._undoStack,!1)}_applyHistoryEntry(e,t,n){const o=e.pop();if(!o)return;const l=this._table.getCoreRowModel().rowsById[o.rowId];l?(t.push(o),x.trigger(this._element,Tt,{item:l.original,columnId:o.columnId,value:n?o.previousValue:o.value,previousValue:n?o.value:o.previousValue}),this._announce(n?this._labels.undoneAnnouncement:this._labels.redoneAnnouncement),this._updateHistoryButtons()):this._updateHistoryButtons()}setItems(e){this._config.dataProvider||(this._stopEditing({commit:!1}),this._config.items=e,this._dataVersion++,this._table.setOptions(t=>({...t,data:e})),this._scheduler.schedule())}update(e){this._config=this._getConfig({...this._config,...e}),this._labels={...Ye,...this._config.labels},this._teardownUi(),this._selectionAnchorIndex=null,this._loadFailed=!1,this._dataVersion++,this._table=this._createTable(),this._render(),this._initDataSource()}dispose(){var e;this._teardownUi(),this._scheduler.dispose(),null===(e=this._tooltip)||void 0===e||e.dispose(),this._tooltip=null,this._liveRegion&&this._liveRegion.remove(),this._element.classList.remove(sn),this._element.removeAttribute("data-coreui-sorter-visibility"),super.dispose()}_configAfterMerge(e){return e.editing&&(e.cellNavigation=!0),e}_createTable(){return((e,t)=>{var n,o;const l="object"==typeof e.sorting?e.sorting:{},i="object"==typeof e.columnSizing?e.columnSizing:{},s="object"==typeof e.pagination?e.pagination:{},r=Boolean(e.dataProvider),a=Boolean(e.columnSizing),u=Boolean(e.columnPinning),d=a||u,c=Boolean(e.pagination)||r,g={...c&&{pagination:{pageIndex:0,pageSize:null!==(n=s.pageSize)&&void 0!==n?n:10}},..."object"==typeof e.columnPinning&&{columnPinning:e.columnPinning},...Array.isArray(e.columnOrder)&&{columnOrder:e.columnOrder},..."object"==typeof e.columnVisibility&&{columnVisibility:e.columnVisibility}},h=function(e){var t,n;const o=[...Se,...null!=(t=e._features)?t:[]];let l={_features:o};const i=l._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(l)),{});let s={...null!=(n=e.initialState)?n:{}};l._features.forEach(e=>{var t;s=null!=(t=null==e.getInitialState?void 0:e.getInitialState(s))?t:s});const r=[];let a=!1;const u={_features:o,options:{...i,...e},initialState:s,_queue:e=>{r.push(e),a||(a=!0,Promise.resolve().then(()=>{for(;r.length;)r.shift()();a=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{l.setState(l.initialState)},setOptions:e=>{const t=z(e,l.options);l.options=(e=>l.options.mergeOptions?l.options.mergeOptions(i,e):{...i,...e})(t)},getState:()=>l.options.state,setState:e=>{null==l.options.onStateChange||l.options.onStateChange(e)},_getRowId:(e,t,n)=>{var o;return null!=(o=null==l.options.getRowId?void 0:l.options.getRowId(e,t,n))?o:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(e,t)=>{let n=(t?l.getPrePaginationRowModel():l.getRowModel()).rowsById[e];if(!n&&(n=l.getCoreRowModel().rowsById[e],!n))throw new Error;return n},_getDefaultColumnDef:O(()=>[l.options.defaultColumn],e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...l._features.reduce((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef()),{}),...e}},k(e,"debugColumns")),_getColumnDefs:()=>l.options.columns,getAllColumns:O(()=>[l._getColumnDefs()],e=>{const t=function(e,n,o){return void 0===o&&(o=0),e.map(e=>{const i=function(e,t,n,o){var l,i;const s={...e._getDefaultColumnDef(),...t},r=s.accessorKey;let a,u=null!=(l=null!=(i=s.id)?i:r?"function"==typeof String.prototype.replaceAll?r.replaceAll(".","_"):r.replace(/\./g,"_"):void 0)?l:"string"==typeof s.header?s.header:void 0;if(s.accessorFn?a=s.accessorFn:r&&(a=r.includes(".")?e=>{let t=e;for(const e of r.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[s.accessorKey]),!u)throw new Error;let d={id:`${String(u)}`,accessorFn:a,parent:o,depth:n,columnDef:s,columns:[],getFlatColumns:O(()=>[!0],()=>{var e;return[d,...null==(e=d.columns)?void 0:e.flatMap(e=>e.getFlatColumns())]},k(e.options,"debugColumns")),getLeafColumns:O(()=>[e._getOrderColumnsFn()],e=>{var t;if(null!=(t=d.columns)&&t.length){let t=d.columns.flatMap(e=>e.getLeafColumns());return e(t)}return[d]},k(e.options,"debugColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(d,e);return d}(l,e,o,n),s=e;return i.columns=s.columns?t(s.columns,i,o+1):[],i})};return t(e)},k(e,"debugColumns")),getAllFlatColumns:O(()=>[l.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),k(e,"debugColumns")),_getAllFlatColumnsById:O(()=>[l.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),k(e,"debugColumns")),getAllLeafColumns:O(()=>[l.getAllColumns(),l._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),k(e,"debugColumns")),getColumn:e=>l._getAllFlatColumnsById()[e]};Object.assign(l,u);for(let e=0;e<l._features.length;e++){const t=l._features[e];null==t||null==t.createTable||t.createTable(l)}return l}({columns:e.columns.map(e=>{var t;const n=null!==(t=e.width)&&void 0!==t?t:null;return{accessorKey:e.key,enableColumnFilter:!1!==e.filterable,enableHiding:!1!==e.hideable,enableResizing:!1!==e.resizable,enableSorting:!1!==e.sortable,filterFn:Le(e),id:e.key,meta:{label:e.label,formatter:e.formatter},...d&&null!==n&&{size:n}}}),columnResizeMode:null!==(o=i.mode)&&void 0!==o?o:"onChange",data:r?[]:e.items,enableColumnFilters:Boolean(e.columnFilters),enableColumnPinning:u,enableColumnResizing:a,enableGlobalFilter:Me(e),enableHiding:Boolean(e.columnVisibility),enableMultiSort:!1!==l.multiple,enableRowSelection:Boolean(e.rowSelection),enableSorting:Boolean(e.sorting),enableSortingRemoval:Boolean(l.resetable),getCoreRowModel:e=>O(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},o=function(t,l,i){void 0===l&&(l=0);const s=[];for(let a=0;a<t.length;a++){const u=j(e,e._getRowId(t[a],a,i),t[a],a,l,0,null==i?void 0:i.id);var r;n.flatRows.push(u),n.rowsById[u.id]=u,s.push(u),e.options.getSubRows&&(u.originalSubRows=e.options.getSubRows(t[a],a),null!=(r=u.originalSubRows)&&r.length&&(u.subRows=o(u.originalSubRows,l+1,u)))}return s};return n.rows=o(t),n},k(e.options,"debugTable",0,()=>e._autoResetPageIndex())),getFacetedRowModel:(e,t)=>O(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,o,l)=>{if(!n.rows.length||(null==o||!o.length)&&!l)return n;const i=[...o.map(e=>e.id).filter(e=>e!==t),l?"__global__":void 0].filter(Boolean);return Ce(n.rows,e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0},e)},k(e.options,"debugTable")),getFacetedUniqueValues:(e,t)=>O(()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]},e=>{if(!e)return new Map;let n=new Map;for(let l=0;l<e.flatRows.length;l++){const i=e.flatRows[l].getUniqueValues(t);for(let e=0;e<i.length;e++){const t=i[e];var o;n.has(t)?n.set(t,(null!=(o=n.get(t))?o:0)+1):n.set(t,1)}}return n},k(e.options,"debugTable")),getFilteredRowModel:e=>O(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||(null==n||!n.length)&&!o){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const l=[],i=[];(null!=n?n:[]).forEach(t=>{var n;const o=e.getColumn(t.id);if(!o)return;const i=o.getFilterFn();i&&l.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})});const s=(null!=n?n:[]).map(e=>e.id),r=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter(e=>e.getCanGlobalFilter());let u,d;o&&r&&a.length&&(s.push("__global__"),a.forEach(e=>{var t;i.push({id:e.id,filterFn:r,resolvedValue:null!=(t=null==r.resolveFilterValue?void 0:r.resolveFilterValue(o))?t:o})}));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},l.length)for(let e=0;e<l.length;e++){u=l[e];const t=u.id;n.columnFilters[t]=u.filterFn(n,t,u.resolvedValue,e=>{n.columnFiltersMeta[t]=e})}if(i.length){for(let e=0;e<i.length;e++){d=i[e];const t=d.id;if(d.filterFn(n,t,d.resolvedValue,e=>{n.columnFiltersMeta[t]=e})){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return Ce(t.rows,e=>{for(let t=0;t<s.length;t++)if(!1===e.columnFilters[s[t]])return!1;return!0},e)},k(e.options,"debugTable",0,()=>e._autoResetPageIndex())),getSortedRowModel:e=>O(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const o=e.getState().sorting,l=[],i=o.filter(t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()}),s={};i.forEach(t=>{const n=e.getColumn(t.id);n&&(s[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});const r=e=>{const t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let o=0;o<i.length;o+=1){var n;const l=i[o],r=s[l.id],a=r.sortUndefined,u=null!=(n=null==l?void 0:l.desc)&&n;let d=0;if(a){const n=void 0===e.getValue(l.id),o=void 0===t.getValue(l.id);if(n||o){if("first"===a)return n?-1:1;if("last"===a)return n?1:-1;d=n&&o?0:n?a:-a}}if(0===d&&(d=r.sortingFn(e,t,l.id)),0!==d)return u&&(d*=-1),r.invertSorting&&(d*=-1),d}return e.index-t.index}),t.forEach(e=>{var t;l.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=r(e.subRows))}),t};return{rows:r(n.rows),flatRows:l,rowsById:n.rowsById}},k(e.options,"debugTable",0,()=>e._autoResetPageIndex())),globalFilterFn:"includesString",...r&&{manualFiltering:!0,manualPagination:!0,manualSorting:!0,rowCount:0},...c&&{getPaginationRowModel:e=>O(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{if(!n.rows.length)return n;const{pageSize:o,pageIndex:l}=t;let{rows:i,flatRows:s,rowsById:r}=n;const a=o*l,u=a+o;let d;i=i.slice(a,u),d=e.options.paginateExpandedRows?{rows:i,flatRows:s,rowsById:r}:function(e){const t=[],n=e=>{var o;t.push(e),null!=(o=e.subRows)&&o.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}({rows:i,flatRows:s,rowsById:r}),d.flatRows=[];const c=e=>{d.flatRows.push(e),e.subRows.length&&e.subRows.forEach(c)};return d.rows.forEach(c),d},k(e.options,"debugTable"))},...e.itemKey&&{getRowId:e.itemKey},initialState:g,onStateChange(){},renderFallbackValue:null,state:{}});let m=h.initialState;return h.setOptions(e=>({...e,state:m,onStateChange(e){const n=m;m="function"==typeof e?e(m):e,h.setOptions(e=>({...e,state:m})),t(n,m)}})),h})(this._config,(e,t)=>{this._notifyStateChange(e,t),this._scheduler.schedule()})}_teardownUi(){var e,t,n,o,l,i;this._stopEditing({commit:!1}),this._dataSource&&(this._dataSource.dispose(),this._dataSource=null),null===(e=this._header)||void 0===e||e.dispose(),this._menu&&(this._menu.dispose(),this._menu=null),this._filterMenu&&(this._filterMenu.dispose(),this._filterMenu=null),this._columnChooser&&(this._columnChooser.dispose(),this._columnChooser=null),this._loading&&(this._loading.element.remove(),this._loading=null),this._virtualizer&&(this._virtualizer.destroy(),this._virtualizer=null),this._toolbar&&(null===(n=(t=this._toolbar).dispose)||void 0===n||n.call(t),this._toolbar.element.remove(),this._toolbar=null);for(const e of this._paginations)null===(o=e.dispose)||void 0===o||o.call(e),e.element.remove();this._paginations=[],this._emptySlot&&(null===(i=(l=this._emptySlot).dispose)||void 0===i||i.call(l),this._emptySlot=null),this._viewportElement&&this._viewportElement.remove()}_slotContext(){return{table:this._table,labels:this._labels}}_isColumnSortable(e){return Boolean(this._config.sorting)&&!1!==e.sortable}_isColumnFilterable(e){return this._config.columnFilters&&!1!==e.filterable}_isColumnResizable(e){return Boolean(this._config.columnSizing)&&!1!==e.resizable}_sanitizeIcon(e){return this._config.sanitize?Mt(e,xt,this._config.sanitizeFn):e}_hasColumnMenu(e){return!!this._config.columnMenu&&("function"==typeof this._config.columnMenu?this._getMenuActions(e.key).length>0:this._isColumnSortable(e)||Boolean(this._config.columnPinning)||Boolean(this._config.columnVisibility)&&!1!==e.hideable||Boolean(this._config.columnOrder)&&!1!==e.movable)}_renderToolbar(){const e=Fe(this._config);if(this._toolbarConfig=e,this._config.slots.toolbar)return this._toolbar=this._config.slots.toolbar(this._slotContext()),void this._element.append(this._toolbar.element);(e.columns||e.export||e.search||e.history)&&(this._toolbar=(e=>{const t=document.createElement("div");if(t.classList.add("data-grid-toolbar"),e.columns||e.export||e.history){const n=document.createElement("div");if(n.classList.add("data-grid-toolbar-actions"),e.columns&&n.append(Ae(e.icons.columns,e.labels.toolbarColumns,"data-coreui-toolbar-columns")),e.export&&n.append(Ae(e.icons.export,e.labels.toolbarExport,"data-coreui-toolbar-export")),e.history){const t=Ae(e.icons.undo,e.labels.toolbarUndo,"data-coreui-toolbar-undo"),o=Ae(e.icons.redo,e.labels.toolbarRedo,"data-coreui-toolbar-redo");t.disabled=!0,o.disabled=!0,n.append(t,o)}t.append(n)}if(e.search){const n=document.createElement("div");n.classList.add("data-grid-toolbar-search");const o=document.createElement("input");o.type="search",o.classList.add("form-control","form-control-sm"),o.placeholder=e.labels.globalFilterPlaceholder,o.setAttribute("aria-label",e.labels.globalFilterLabel),o.dataset.coreuiGlobalFilter="",n.append(o),t.append(n)}return{element:t}})({columns:e.columns,export:e.export,icons:{columns:this._sanitizeIcon(this._config.toolbarColumnsIcon),export:this._sanitizeIcon(this._config.toolbarExportIcon),redo:this._sanitizeIcon(this._config.toolbarRedoIcon),undo:this._sanitizeIcon(this._config.toolbarUndoIcon)},history:e.history,labels:this._labels,search:e.search}),this._element.append(this._toolbar.element),e.columns&&(this._columnChooser=(e=>{const t=document.createElement("div");t.classList.add("data-grid-column-chooser"),t.setAttribute("role","dialog"),t.setAttribute("aria-label",e.labels.toolbarColumns),t.id="data-grid-column-chooser-"+ ++bt;let n=null;const o=(e=!1)=>{n&&(n.setAttribute("aria-expanded","false"),n.removeAttribute("aria-controls"),e&&n.focus(),n=null,t.remove(),document.removeEventListener("pointerdown",l,!0),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i))},l=e=>{const l=e.target;t.contains(l)||(null==n?void 0:n.contains(l))||o()},i=e=>{(null==e?void 0:e.target)instanceof Node&&t.contains(e.target)||o()},s=e=>{"Escape"===e.key&&(e.stopPropagation(),o(!0))};t.addEventListener("keydown",s);const r=()=>{const n=document.createElement("div");for(const t of e.getColumns()){const o=document.createElement("label");o.classList.add("form-check","data-grid-column-chooser-option");const l=document.createElement("input");l.type="checkbox",l.classList.add("form-check-input"),l.checked=t.visible,l.dataset.coreuiColumnChooserOption=t.id,t.canHide||(l.disabled=!0,l.setAttribute("aria-disabled","true")),l.addEventListener("change",()=>{e.toggleVisibility(t.id,l.checked)});const i=document.createElement("span");i.classList.add("form-check-label"),i.textContent=t.label,o.append(l,i),n.append(o)}const o=document.createElement("div");o.classList.add("data-grid-column-chooser-footer");const l=document.createElement("button");l.type="button",l.classList.add("btn","btn-link","btn-sm"),l.textContent=e.labels.showAllColumns,l.dataset.coreuiColumnChooserShowAll="",l.addEventListener("click",()=>{e.showAll(),t.replaceChildren(r())});const i=document.createElement("button");i.type="button",i.classList.add("btn","btn-link","btn-sm"),i.textContent=e.labels.resetColumns,i.dataset.coreuiColumnChooserReset="",i.addEventListener("click",()=>{e.reset(),t.replaceChildren(r())}),o.append(l,i);const s=document.createDocumentFragment();return s.append(n,o),s};return{toggle(s){n!==s?(o(),(s=>{var a;o(),t.replaceChildren(r()),n=s,s.setAttribute("aria-expanded","true"),s.setAttribute("aria-controls",t.id),e.root.append(t);const u=e.root.getBoundingClientRect(),d=s.getBoundingClientRect();t.style.top=d.bottom-u.top+"px",t.style.left=`${Math.max(d.left-u.left,0)}px`,document.addEventListener("pointerdown",l,!0),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),null===(a=t.querySelector("input:not(:disabled)"))||void 0===a||a.focus()})(s)):o(!0)},close(){o()},dispose(){o(),t.removeEventListener("keydown",s)}}})({root:this._element,labels:this._labels,getColumns:()=>this._chooserColumns(),toggleVisibility:(e,t)=>{var n;null===(n=this._table.getColumn(e))||void 0===n||n.toggleVisibility(t)},showAll:()=>this._table.toggleAllColumnsVisible(!0),reset:()=>{var e;return this._table.setColumnVisibility(null!==(e=this._table.initialState.columnVisibility)&&void 0!==e?e:{})}})))}_render(){var e;this._columnsByKey=new Map(this._config.columns.map(e=>[e.key,e])),this._activeCell=this._config.cellNavigation?(e=>{let t=null,n=!1;return{get:()=>t,set(o,l={}){const i=!t||t.rowIndex!==o.rowIndex||t.columnId!==o.columnId;t=o,l.focus&&(n=!0),(i||l.focus)&&e()},clamp(n){const o=((e,t)=>{if(!e)return null;const n=((e,t)=>t.includes(e)?e:t.length>0?t[0]:null)(e.columnId,t.columnIds);if(null===n)return null;const o=t.rowCount-1,l=e.rowIndex<0?-1:Math.max(0,Math.min(e.rowIndex,Math.max(o,0)));return l>=0&&o<0?{rowIndex:-1,columnId:n}:{rowIndex:l,columnId:n}})(t,n),l=Boolean(t)!==Boolean(o)||t&&o&&(t.rowIndex!==o.rowIndex||t.columnId!==o.columnId);t=o,l&&e()},reset(){t&&(t=null,n=!1,e())},consumeFocusRequest:()=>!!n&&(n=!1,!0)}})(()=>this._scheduler.schedule()):null,this._element.classList.add(sn),this._element.classList.toggle("data-grid-resizable",Boolean(this._config.columnSizing)),this._element.classList.toggle("data-grid-pinned",Boolean(this._config.columnPinning)),this._config.sorterVisibility?this._element.setAttribute("data-coreui-sorter-visibility",this._config.sorterVisibility):this._element.removeAttribute("data-coreui-sorter-visibility");const{slots:t}=this._config;this._renderToolbar(),t.empty&&(this._emptySlot=t.empty(this._slotContext()));const n=Boolean(this._config.rowSelection),o="object"==typeof this._config.rowSelection?this._config.rowSelection:{},l=Boolean(this._config.pagination)||Boolean(this._config.dataProvider),i="object"==typeof this._config.pagination?this._config.pagination:{};if(this._config.columnMenu&&(this._menu=(e=>{const t=document.createElement("div");t.classList.add("data-grid-menu"),t.setAttribute("role","menu"),t.id="data-grid-menu-"+ ++pt;let n=null;const o=()=>[...t.querySelectorAll(`.${ft}`)],l=(e=!1)=>{n&&(n.setAttribute("aria-expanded","false"),n.removeAttribute("aria-controls"),e&&n.focus(),n=null,t.remove(),document.removeEventListener("pointerdown",i,!0),window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s))},i=e=>{const o=e.target;t.contains(o)||(null==n?void 0:n.contains(o))||l()},s=e=>{(null==e?void 0:e.target)instanceof Node&&t.contains(e.target)||l()},r=e=>{var t,n,i,s;const r=o(),a=r.indexOf(document.activeElement);switch(e.key){case"Escape":e.stopPropagation(),l(!0);break;case"Tab":l();break;case"ArrowDown":e.preventDefault(),null===(t=r[(a+1)%r.length])||void 0===t||t.focus();break;case"ArrowUp":e.preventDefault(),null===(n=r[(a-1+r.length)%r.length])||void 0===n||n.focus();break;case"Home":e.preventDefault(),null===(i=r[0])||void 0===i||i.focus();break;case"End":e.preventDefault(),null===(s=r[r.length-1])||void 0===s||s.focus()}};return t.addEventListener("keydown",r),{toggle(r,a){n!==r?(l(),((r,a)=>{var u;const d=e.getActions(a);if(0===d.length)return;const c=[];for(const[t,o]of d.entries()){if(t>0&&o.group!==d[t-1].group){const e=document.createElement("div");e.classList.add("data-grid-menu-divider"),e.setAttribute("role","separator"),c.push(e)}const i=document.createElement("button");if(i.type="button",i.classList.add(ft),i.setAttribute("role","menuitem"),o.icon){const e=document.createElement("span");e.classList.add("data-grid-menu-item-icon"),e.setAttribute("aria-hidden","true"),e.innerHTML=o.icon,i.append(e)}i.append(o.label),o.disabled&&i.setAttribute("aria-disabled","true"),i.addEventListener("click",()=>{if(o.disabled)return;const t=n;l(),o.run(),requestAnimationFrame(()=>{var n;const o=document.activeElement;o&&o!==document.body&&e.root.contains(o)||((null==t?void 0:t.isConnected)?t.focus():null===(n=e.root.querySelector("[data-coreui-menu]"))||void 0===n||n.focus())})}),c.push(i)}t.replaceChildren(...c),n=r,r.setAttribute("aria-expanded","true"),r.setAttribute("aria-controls",t.id),e.root.append(t);const g=e.root.getBoundingClientRect(),h=r.getBoundingClientRect();t.style.top=h.bottom-g.top+"px",t.style.left=`${Math.max(h.right-g.left-t.offsetWidth,0)}px`,document.addEventListener("pointerdown",i,!0),window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),null===(u=o()[0])||void 0===u||u.focus()})(r,a)):l(!0)},close(){l()},dispose(){l(),t.removeEventListener("keydown",r)}}})({root:this._element,getActions:e=>this._getMenuActions(e)})),this._config.columnFilters&&(this._filterMenu=mt({root:this._element,labels:this._labels,getColumn:e=>{var t;return null!==(t=this._columnsByKey.get(e))&&void 0!==t?t:null},getFacetedValues:e=>{var t,n;return[...null!==(n=null===(t=this._table.getColumn(e))||void 0===t?void 0:t.getFacetedUniqueValues().keys())&&void 0!==n?n:[]]},getFilterValue:e=>{var t;return null===(t=this._table.getColumn(e))||void 0===t?void 0:t.getFilterValue()},applyFilter:(e,t)=>{var n;null===(n=this._table.getColumn(e))||void 0===n||n.setFilterValue(t)}})),this._header=dt({cellNavigation:this._config.cellNavigation,columns:this._config.columns,draggable:Boolean(this._config.columnOrder),filterRow:this._config.columnFilters&&this._config.columns.some(e=>e.filter&&this._isColumnFilterable(e)),hasMenu:e=>this._hasColumnMenu(e),hasFilterMenu:e=>Boolean(this._filterMenu)&&this._isColumnFilterable(e)&&!e.filter,icons:{columnMenu:this._sanitizeIcon(this._config.columnMenuIcon),filter:this._sanitizeIcon(this._config.filterIcon),sortAscending:this._sanitizeIcon(this._config.sortAscendingIcon),sortDescending:this._sanitizeIcon(this._config.sortDescendingIcon),sortNeutral:this._sanitizeIcon(this._config.sortNeutralIcon)},isFilterable:e=>this._isColumnFilterable(e),isResizable:e=>this._isColumnResizable(e),isSortable:e=>this._isColumnSortable(e),labels:this._labels,resizable:Boolean(this._config.columnSizing),selection:n,selectAll:n&&!1!==o.selectAll,table:this._table}),this._body=(e=>{const t=document.createElement("tbody");let n=e.getVisibleColumns(),o=n.map(e=>e.key).join("|"),l=n.length+(e.selection?1:0);const i=t=>{t.replaceChildren(),e.cellNavigation&&t.setAttribute("role","row");const l=e.selection?1:0;if(e.selection){const n=document.createElement("td");n.classList.add("data-grid-select-cell");const o=document.createElement("input");o.type="checkbox",o.classList.add("form-check-input"),o.setAttribute("aria-label",e.labels.selectRow),o.dataset.coreuiRowSelect="",e.cellNavigation&&(n.setAttribute("role","gridcell"),n.setAttribute("aria-colindex","1"),o.tabIndex=-1),n.append(o),t.append(n)}for(const[o,i]of n.entries()){const n=document.createElement("td");e.cellNavigation&&(n.setAttribute("role","gridcell"),n.setAttribute("aria-colindex",String(l+o+1)),n.dataset.coreuiColumn=i.key,n.tabIndex=-1),t.append(n)}t.dataset.coreuiLayout=o},s=()=>{const e=document.createElement("tr");return i(e),e},r=(t,l,s)=>{var r;if(t.dataset.coreuiLayout!==o&&(i(t),delete t.dataset.coreuiRow),e.selection){const e=t.firstElementChild.firstElementChild,n=l.getIsSelected();e.checked=n,t.classList.toggle("table-active",n),t.setAttribute("aria-selected",String(n))}const a=`${e.getDataVersion()}:${l.id}`;if(t.dataset.coreuiRow===a&&t.dataset.coreuiIndex===String(s)||(((t,o,l)=>{const i=e.selection?1:0,s=e.getEditingCell();for(const[r,a]of n.entries()){const n=t.children[r+i];if(s&&s.rowId===o.id&&s.columnId===a.key){const t=e.getEditorElement();if(t){n.replaceChildren(t);continue}}if(a.render){if(it(n,a.render(o.original,l),e.sanitizeContent),e.cellNavigation)for(const e of n.querySelectorAll("a[href], button, input, select, textarea, [tabindex]"))e.tabIndex=-1;continue}const u=o.getValue(a.key);n.textContent=a.formatter?a.formatter(u,o.original):String(null!=u?u:"")}})(t,l,s),t.dataset.coreuiRow=a),t.dataset.coreuiIndex=String(s),t.setAttribute("aria-rowindex",String(e.headerRowCount+e.getRowIndexOffset()+s+1)),t.classList.toggle("data-grid-row-odd",s%2==1),f){const o=f,l=e.selection?1:0;e.selection&&lt(t.children[0],o.select);for(const[e,i]of n.entries())lt(t.children[e+l],null!==(r=o.columns[i.key])&&void 0!==r?r:null)}},a=()=>{const e=document.createElement("tr");e.classList.add("data-grid-spacer"),e.setAttribute("aria-hidden","true");const t=document.createElement("td");return t.colSpan=Math.max(l,1),e.append(t),e},u=(e,t)=>{e.style.height=`${t}px`,e.firstElementChild.style.height=`${t}px`,e.style.display=t>0?"":"none"},d=a(),c=a();let g=!1,h=null,m=[],f=null;const p=[];let v=null;return{element:t,update(){const i=e.getRows();f=e.getPinning();const a=e.getEditingCell(),b=a?`${a.rowId}:${a.columnId}`:null;if(b!==v){v=b;for(const e of m)delete e.dataset.coreuiRow}const _=e.getVisibleColumns(),w=_.map(e=>e.key).join("|");if(w!==o&&(n=_,o=w,l=n.length+(e.selection?1:0),d.firstElementChild.colSpan=Math.max(l,1),c.firstElementChild.colSpan=Math.max(l,1)),0===i.length)return void(()=>{g=!1,p.push(...m),m=[],h||(h=document.createElement("tr"),h.classList.add("data-grid-empty"),h.append(document.createElement("td")));const n=h.firstElementChild;n.colSpan=Math.max(l,1),it(n,e.renderEmpty(),e.sanitizeContent),t.replaceChildren(h)})();const S=e.getVirtualizer();S?((e,n)=>{var o;g||(t.replaceChildren(d,c),g=!0,m=[]);const l=n.getVirtualItems(),i=n.getTotalSize(),a=l.length>0?l[0].start:0,h=l.length>0?i-l[l.length-1].end:i;for(u(d,a),u(c,h);m.length>l.length;){const e=m.pop();e.remove(),p.push(e)}for(;m.length<l.length;){const e=null!==(o=p.pop())&&void 0!==o?o:s();c.before(e),m.push(e)}for(const[t,n]of l.entries())r(m[t],e[n.index],n.index)})(i,S):(e=>{var n;for(h&&h.remove();m.length>e.length;){const e=m.pop();e.remove(),p.push(e)}for(;m.length<e.length;){const e=null!==(n=p.pop())&&void 0!==n?n:s();t.append(e),m.push(e)}for(const[t,n]of e.entries())r(m[t],n,t)})(i)}}})({cellNavigation:this._config.cellNavigation,getDataVersion:()=>this._dataVersion,getEditingCell:()=>this._editingCell?{rowId:this._editingCell.rowId,columnId:this._editingCell.columnId}:null,getEditorElement:()=>this._editor&&!this._editor.popup?this._editor.element:null,getPinning:()=>this._config.columnPinning?this._getPinning():null,getRowIndexOffset:()=>{if(!this._config.pagination&&!this._config.dataProvider)return 0;const{pageIndex:e,pageSize:t}=this._table.getState().pagination;return e*t},getRows:()=>this._table.getRowModel().rows,getVisibleColumns:()=>this._visibleColumns(),getVirtualizer:()=>{var e,t;return null!==(t=null===(e=this._virtualizer)||void 0===e?void 0:e.instance)&&void 0!==t?t:null},headerRowCount:this._header.rowCount,labels:this._labels,renderEmpty:()=>this._emptySlot?this._emptySlot.element:this._loadFailed?this._labels.loadError:"function"==typeof this._config.empty?this._config.empty():this._config.empty,sanitizeContent:e=>this._config.sanitize?Mt(e,Et,this._config.sanitizeFn):e,selection:n}),this._tableElement=document.createElement("table"),this._tableElement.classList.add("table"),this._config.cellNavigation&&this._tableElement.setAttribute("role","grid"),this._tableElement.append(this._header.element,this._body.element),this._viewportElement=document.createElement("div"),this._viewportElement.classList.add("data-grid-viewport"),this._config.cellNavigation&&(this._viewportElement.tabIndex=-1),this._viewportElement.append(this._tableElement),this._config.dataProvider&&(this._loading=(e=>{const t=document.createElement("div");t.classList.add("data-grid-loading"),t.hidden=!0;const n=document.createElement("div");n.classList.add("spinner-border"),n.setAttribute("role","status");const o=document.createElement("span");return o.classList.add("visually-hidden"),o.textContent=e.loading,n.append(o),t.append(n),{element:t,setVisible(e){t.hidden=!e}}})(this._labels),this._viewportElement.append(this._loading.element)),this._element.append(this._viewportElement),l){const n=null!==(e=i.position)&&void 0!==e?e:"bottom",o=t.pagination,l=()=>{var e,t;if(o){const e=o(this._slotContext());return{element:e.element,refresh:()=>{var t;return null===(t=e.update)||void 0===t?void 0:t.call(e)},dispose:()=>{var t;return null===(t=e.dispose)||void 0===t?void 0:t.call(e)}}}const n=(e=>{const t=document.createElement("div");t.classList.add("data-grid-pagination");const n=document.createElement("nav");n.setAttribute("aria-label",e.labels.paginationLabel);const o=document.createElement("ul");o.classList.add("pagination","pagination-sm"),n.append(o);const l=!1===e.info?null:document.createElement("span");l&&l.classList.add("data-grid-pagination-info");const i=document.createElement("select");i.classList.add("form-select","form-select-sm"),i.setAttribute("aria-label",e.labels.pageSizeLabel),i.dataset.coreuiPageSize="";for(const t of e.pageSizeOptions){const e=document.createElement("option");e.value=String(t),e.textContent=String(t),i.append(e)}return t.append(n,...l?[l]:[],i),{element:t,update(t){var n;const s=Math.max(t.pageCount-1,0),r=Math.max(Math.min(t.pageIndex-Math.floor(2.5),t.pageCount-5),0),a=0===t.pageCount?-1:Math.min(r+5-1,s),u=[vt("«","first",{ariaLabel:e.labels.firstPage,disabled:0===t.pageIndex}),vt("‹","prev",{ariaLabel:e.labels.previousPage,disabled:0===t.pageIndex})];for(let e=r;e<=a;e++)u.push(vt(String(e+1),String(e),{active:e===t.pageIndex}));if(u.push(vt("›","next",{ariaLabel:e.labels.nextPage,disabled:t.pageIndex>=s}),vt("»","last",{ariaLabel:e.labels.lastPage,disabled:t.pageIndex>=s})),o.replaceChildren(...u),l)if("function"==typeof e.info)l.textContent=e.info(t);else{const n=0===t.totalRows?0:t.pageIndex*t.pageSize+1,o=Math.min((t.pageIndex+1)*t.pageSize,t.totalRows);l.textContent=Qe(e.labels.itemsInfo,{first:n,last:o,total:t.totalRows})}if(![...i.options].some(e=>e.value===String(t.pageSize))){const e=document.createElement("option");e.value=String(t.pageSize),e.textContent=String(t.pageSize),i.insertBefore(e,null!==(n=[...i.options].find(e=>Number(e.value)>t.pageSize))&&void 0!==n?n:null)}i.value=String(t.pageSize)}}})({info:null===(e=i.info)||void 0===e||e,labels:this._labels,pageSizeOptions:null!==(t=i.pageSizeOptions)&&void 0!==t?t:mn});return{element:n.element,refresh:()=>n.update(this._paginationState()),dispose:void 0}};if("top"===n||"both"===n){const e=l();o||e.element.classList.add("data-grid-pagination-top"),this._viewportElement.before(e.element),this._paginations.push(e)}if("bottom"===n||"both"===n){const e=l();this._element.append(e.element),this._paginations.push(e)}}else this._config.virtualization&&(this._virtualizer=(e=>{const t=new Ke({count:e.count,estimateSize:()=>e.rowHeight,getScrollElement:e.getScrollElement,observeElementOffset:qe,observeElementRect:He,onChange:e.onChange,overscan:e.overscan,scrollToFn:$e}),n=t._didMount();return t._willUpdate(),{instance:t,setCount(e){e!==t.options.count&&t.setOptions({...t.options,count:e})},destroy(){n()}}})({count:this._table.getRowModel().rows.length,getScrollElement:()=>this._viewportElement,onChange:()=>this._scheduler.schedule(),overscan:this._config.overscan,rowHeight:this._config.rowHeight}));this._update()}_addEventListeners(){x.on(this._element,Jt,e=>{this._onCellNavigationKeydown(e)}),x.on(this._element,Ut,e=>{this._containsFocus=!0,this._onCellFocusIn(e)}),x.on(this._element,Zt,e=>{const t=e.relatedTarget;t&&this._element.contains(t)||(this._containsFocus=!1)}),x.on(this._element,Ot,e=>{var t;if(!this._config.editing)return;const n=this._navigableCellFromTarget(e.target);n&&n.cell.rowIndex>=0&&(null===(t=this._activeCell)||void 0===t||t.set(n.cell),this._startEditing(n.cell))}),x.on(this._element,zt,".data-grid-sort-button",e=>{this._toggleColumnSorting(e)});const e=yt((e,t)=>{var n;this._table&&(null===(n=this._table.getColumn(e))||void 0===n||n.setFilterValue(""===t?void 0:t))},250);x.on(this._element,Ht,"input[data-coreui-column-filter]",t=>{var n;const o=null!==(n=t.delegateTarget)&&void 0!==n?n:t.target;e(o.dataset.coreuiColumnFilter,o.value)});const t=yt(e=>{this._table&&this._table.setGlobalFilter(""===e?void 0:e)},250);x.on(this._element,Ht,dn,e=>{var n;const o=null!==(n=e.delegateTarget)&&void 0!==n?n:e.target;t(o.value)}),x.on(this._element,zt,"button[data-coreui-menu]",e=>{var t,n;const o=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target;null===(n=this._menu)||void 0===n||n.toggle(o,o.dataset.coreuiMenu)}),x.on(this._element,zt,"button[data-coreui-filter]",e=>{var t,n;const o=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target;null===(n=this._filterMenu)||void 0===n||n.toggle(o,o.dataset.coreuiFilter)}),x.on(this._element,zt,"button[data-coreui-toolbar-columns]",e=>{var t,n;const o=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target;null===(n=this._columnChooser)||void 0===n||n.toggle(o)}),x.on(this._element,zt,"button[data-coreui-toolbar-export]",()=>{var e;this.downloadCsv({scope:"filtered",...null===(e=this._toolbarConfig)||void 0===e?void 0:e.exportOptions})}),x.on(this._element,zt,hn,()=>{this.undo()}),x.on(this._element,zt,gn,()=>{this.redo()}),x.on(this._element,en,un,e=>{this._onColumnDragStart(e)}),x.on(this._element,Qt,un,e=>{var t;if(!this._dragColumn)return;const n=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target,o=n.dataset.coreuiColumn,l=this._table.getColumn(this._dragColumn),i=o?this._table.getColumn(o):void 0;l&&i&&o!==this._dragColumn&&l.getIsPinned()===i.getIsPinned()&&(e.preventDefault(),n.classList.add(an))}),x.on(this._element,Yt,un,e=>{var t;(null!==(t=e.delegateTarget)&&void 0!==t?t:e.target).classList.remove(an)}),x.on(this._element,tn,un,e=>{this._onColumnDrop(e)}),x.on(this._element,Xt,un,()=>{this._endColumnDrag()}),x.on(this._element,nn,cn,e=>{this._startColumnResize(e)}),x.on(this._element,ln,cn,e=>{this._startColumnResize(e)}),x.on(this._element,zt,"input[data-coreui-row-select]",e=>{this._toggleRowSelection(e)}),x.on(this._element,Lt,"input[data-coreui-select-all]",e=>{var t;const n=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target;this._table.toggleAllRowsSelected(n.checked)}),x.on(this._element,zt,"button[data-coreui-page]",e=>{var t;const n=(null!==(t=e.delegateTarget)&&void 0!==t?t:e.target).dataset.coreuiPage;"first"!==n?"prev"!==n?"next"!==n?"last"!==n?this._table.setPageIndex(Number(n)):this._table.lastPage():this._table.nextPage():this._table.previousPage():this._table.firstPage()}),x.on(this._element,Lt,"select[data-coreui-page-size]",e=>{var t;const n=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target;this._table.setPageSize(Number(n.value))})}_toggleColumnSorting(e){var t,n,o;const l=null===(n=(null!==(t=e.delegateTarget)&&void 0!==t?t:e.target).closest("th"))||void 0===n?void 0:n.dataset.coreuiColumn;if(!l)return;const i=this._table.getColumn(l);null===(o=null==i?void 0:i.getToggleSortingHandler())||void 0===o||o(e)}_navigableCellFromTarget(e){const t=e.closest("td, th");if(!t||!this._tableElement.contains(t))return null;const n=t.dataset.coreuiColumn;if(!n)return null;const o=t.closest("tr");if(o.parentElement===this._body.element){const e=o.dataset.coreuiIndex;return void 0===e?null:{cellElement:t,cell:{rowIndex:Number(e),columnId:n}}}return o===this._header.element.firstElementChild?{cellElement:t,cell:{rowIndex:-1,columnId:n}}:null}_onCellFocusIn(e){if(!this._activeCell)return;const t=this._navigableCellFromTarget(e.target);t&&this._activeCell.set(t.cell)}_onCellNavigationKeydown(e){var t,n;if(!this._activeCell)return;const o=e.target;if(this._config.history&&(e.ctrlKey||e.metaKey)&&!this._editingCell&&!o.matches("input, textarea, select")){const t=e.key.toLowerCase();if("z"===t&&!e.shiftKey)return e.preventDefault(),void this.undo();if("z"===t&&e.shiftKey||"y"===t)return e.preventDefault(),void this.redo()}if(this._editingCell&&this._editScopeContains(o))return"Enter"===e.key?void(e.defaultPrevented||(e.preventDefault(),this._stopEditing({commit:!0}))):"Escape"===e.key?void(e.defaultPrevented||this._cancelEdit()):"Tab"===e.key?(e.preventDefault(),void this._moveEditing(e.shiftKey?-1:1)):void 0;if(o===this._viewportElement){const t=this._activeCell.get();return void(t&&"Tab"!==e.key&&(e.preventDefault(),this._setActiveCell(t)))}const l=this._navigableCellFromTarget(o);if(!l)return;if(o!==l.cellElement)return void("Escape"===e.key&&l.cellElement.focus({preventScroll:!0}));if("Enter"===e.key||"F2"===e.key){e.preventDefault();const o=this._columnsByKey.get(l.cell.columnId);return-1===l.cell.rowIndex?void("Enter"===e.key&&o&&this._isColumnSortable(o)&&(null===(n=null===(t=this._table.getColumn(l.cell.columnId))||void 0===t?void 0:t.getToggleSortingHandler())||void 0===n||n(e))):o&&this._isColumnEditable(o)?void this._startEditing(l.cell):void("Enter"===e.key&&this._descendIntoCell(l.cellElement))}if(" "===e.key){if(this._config.rowSelection&&l.cell.rowIndex>=0){e.preventDefault();const t=this._table.getRowModel().rows[l.cell.rowIndex];null==t||t.toggleSelected(),this._selectionAnchorIndex=l.cell.rowIndex}return}const i=((e,t,n,o)=>{const{columnIds:l,rowCount:i,pageStep:s,paginated:r}=o,a=l.indexOf(n.columnId);if(-1===a||0===l.length)return null;const u=i-1,d=l.length-1,c=(e,t)=>({cell:{rowIndex:e,columnId:l[t]}});switch(e){case"ArrowLeft":return c(n.rowIndex,Math.max(a-1,0));case"ArrowRight":return c(n.rowIndex,Math.min(a+1,d));case"ArrowUp":return c(Math.max(n.rowIndex-1,-1),a);case"ArrowDown":return c(Math.min(n.rowIndex+1,u),a);case"Home":return c(t?i>0?0:-1:n.rowIndex,0);case"End":return c(t?i>0?u:-1:n.rowIndex,d);case"PageUp":return r&&0===n.rowIndex?{...c(0,a),pageDelta:-1}:c(Math.max(n.rowIndex-s,0),a);case"PageDown":return r&&n.rowIndex===u?{...c(u,a),pageDelta:1}:c(Math.min(n.rowIndex+s,u),a);default:return null}})(e.key,e.ctrlKey||e.metaKey,l.cell,this._activeCellContext());i&&(e.preventDefault(),1===i.pageDelta&&this._table.getCanNextPage()?this._table.nextPage():-1===i.pageDelta&&this._table.getCanPreviousPage()&&this._table.previousPage(),this._setActiveCell(i.cell))}_descendIntoCell(e){var t;null===(t=e.querySelector(pn))||void 0===t||t.focus({preventScroll:!0})}_isColumnEditable(e){return!!this._config.editing&&(Boolean(e.editor)||!0===e.editable||"object"==typeof e.editable)}_startEditing(e){const t=this._columnsByKey.get(e.columnId);if(!t||!this._isColumnEditable(t))return;this._stopEditing({commit:!0,force:!0});const n=this._table.getRowModel().rows[e.rowIndex];if(!n)return;const o=n.getValue(e.columnId),l={item:n.original,column:t,value:o,commit:e=>this._commitEdit(e),cancel:()=>this._cancelEdit(),labels:this._labels},i="object"==typeof t.editable?t.editable:{},s=t.editor?t.editor(l):((e,t)=>"number"===e.type?((e,t)=>{const n=document.createElement("input");return n.type="number",n.classList.add("form-control","form-control-sm",st),void 0!==t.min&&(n.min=String(t.min)),void 0!==t.max&&(n.max=String(t.max)),void 0!==t.step&&(n.step=String(t.step)),n.value=void 0===e.value||null===e.value?"":String(e.value),{element:n,focus(){n.focus(),n.select()},getValue:()=>""===n.value?void 0:Number(n.value)}})(t,e):"select"===e.type?((e,t)=>{var n;const o=document.createElement("select");o.classList.add("form-select","form-select-sm",st);const l=[];for(const i of null!==(n=t.options)&&void 0!==n?n:[]){const t=document.createElement("option"),n="object"==typeof i&&null!==i?i.value:i;t.textContent="object"==typeof i&&null!==i?i.label:String(i),t.value=String(l.length),n===e.value&&(t.selected=!0),l.push(n),o.append(t)}return{element:o,focus:()=>o.focus(),getValue:()=>l[Number(o.value)]}})(t,e):(e=>{var t;const n=document.createElement("input");return n.type="text",n.classList.add("form-control","form-control-sm",st),n.value=String(null!==(t=e.value)&&void 0!==t?t:""),{element:n,focus(){n.focus(),n.select()},getValue:()=>n.value}})(t))(i,l);this._editingCell={rowId:n.id,columnId:e.columnId,rowIndex:e.rowIndex,item:n.original,previousValue:o},this._editor=s,this._editorFocusPending=!0,x.trigger(this._element,Dt,{item:n.original,columnId:e.columnId}),s.popup&&this._mountEditorPopup(e),this._editorPointerdownHandler=e=>{this._editScopeContains(e.target)||this._stopEditing({commit:!0})},x.on(document,on,this._editorPointerdownHandler),x.on(s.element,Zt,e=>{const t=e.relatedTarget;t&&!this._editScopeContains(t)&&this._stopEditing({commit:!0})}),this._scheduler.schedule()}_editScopeContains(e){var t,n,o;if(!e||!this._editingCell||!this._editor)return!1;if((null===(n=(t=this._editor).contains)||void 0===n?void 0:n.call(t,e))||this._editor.element.contains(e)||(null===(o=this._editorPopup)||void 0===o?void 0:o.contains(e)))return!0;const l=this._cellElementFor({rowIndex:this._editingCell.rowIndex,columnId:this._editingCell.columnId});return Boolean(null==l?void 0:l.contains(e))}_mountEditorPopup(e){const t=this._cellElementFor(e),n=document.createElement("div");if(n.classList.add("data-grid-editor-popup"),t){const e=this._element.getBoundingClientRect(),o=t.getBoundingClientRect();n.style.top=o.top-e.top+"px",n.style.left=o.left-e.left+"px",n.style.minWidth=`${o.width}px`}n.append(this._editor.element),this._element.append(n),this._editorPopup=n}_commitEdit(e){var t,n;const o=this._editingCell;if(!o)return;const l=null===(t=this._columnsByKey.get(o.columnId))||void 0===t?void 0:t.editValidate;if(l){const t=l(e,o.item);if(!0!==t)return void this._showEditorInvalid("string"==typeof t?t:"")}this._teardownEditor(),this._config.history&&(this._undoStack.push({rowId:o.rowId,columnId:o.columnId,value:e,previousValue:o.previousValue}),this._undoStack.length>100&&this._undoStack.shift(),this._redoStack=[],this._updateHistoryButtons()),x.trigger(this._element,Tt,{item:o.item,columnId:o.columnId,value:e,previousValue:o.previousValue}),null===(n=this._activeCell)||void 0===n||n.set({rowIndex:o.rowIndex,columnId:o.columnId},{focus:!0})}_cancelEdit(){var e;const t=this._editingCell;t&&(this._teardownEditor(),x.trigger(this._element,kt,{item:t.item,columnId:t.columnId}),null===(e=this._activeCell)||void 0===e||e.set({rowIndex:t.rowIndex,columnId:t.columnId},{focus:!0}))}_stopEditing(e){var t;if(this._editingCell)return e.commit&&(null===(t=this._editor)||void 0===t?void 0:t.getValue)?(this._commitEdit(this._editor.getValue()),void(this._editingCell&&e.force&&this._cancelEdit())):void this._cancelEdit()}_showEditorInvalid(e){const t=this._editor;if(!t)return;const n=t.element.matches("input, select, textarea")?t.element:t.element.querySelector("input, select, textarea");n&&(this._editorErrorElement||(this._editorErrorElement=document.createElement("div"),this._editorErrorElement.classList.add("visually-hidden"),this._editorErrorElement.id="data-grid-editor-error-"+ ++fn,this._element.append(this._editorErrorElement)),this._editorErrorElement.textContent=e,n.classList.add("is-invalid"),n.setAttribute("aria-invalid","true"),n.setAttribute("aria-errormessage",this._editorErrorElement.id))}_moveEditing(e){var t;const n=this._editingCell;if(!n)return;const o=this._visibleColumns();let l=null;for(let t=o.findIndex(e=>e.key===n.columnId)+e;t>=0&&t<o.length;t+=e)if(this._isColumnEditable(o[t])){l=o[t];break}if(this._stopEditing({commit:!0}),!this._editingCell&&l){const e={rowIndex:n.rowIndex,columnId:l.key};null===(t=this._activeCell)||void 0===t||t.set(e,{focus:!0}),this._startEditing(e)}}_teardownEditor(){var e,t;this._editorPointerdownHandler&&(x.off(document,on,this._editorPointerdownHandler),this._editorPointerdownHandler=null),this._editor&&(x.off(this._editor.element,Zt),null===(t=(e=this._editor).dispose)||void 0===t||t.call(e)),this._editorPopup&&(this._editorPopup.remove(),this._editorPopup=null),this._editorErrorElement&&(this._editorErrorElement.remove(),this._editorErrorElement=null),this._editor=null,this._editingCell=null,this._editorFocusPending=!1,this._scheduler.schedule()}_setActiveCell(e){var t;null===(t=this._activeCell)||void 0===t||t.set(e,{focus:!0}),this._virtualizer&&e.rowIndex>=0&&this._virtualizer.instance.scrollToIndex(e.rowIndex)}_activeCellContext(){var e,t;const n=this._table.getRowModel().rows.length,o=Boolean(this._config.pagination)||Boolean(this._config.dataProvider),l=Math.floor((null!==(t=null===(e=this._viewportElement)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0)/this._config.rowHeight);return{columnIds:this._visibleLeafColumns().map(e=>e.id),rowCount:n,pageStep:o?this._table.getState().pagination.pageSize:Math.max(1,l||n),paginated:o}}_cellElementFor(e){var t;if(-1===e.rowIndex)return this._header.element.querySelector(`tr:first-child th[data-coreui-column="${e.columnId}"]`);const n=this._body.element.querySelector(`tr[data-coreui-index="${e.rowIndex}"]`);return null!==(t=null==n?void 0:n.querySelector(`td[data-coreui-column="${e.columnId}"]`))&&void 0!==t?t:null}_applyCellNavigation(){if(!this._activeCell)return;const e=this._activeCellContext();this._activeCell.clamp(e),this._tableElement.setAttribute("aria-colcount",String(e.columnIds.length+(this._config.rowSelection?1:0)));const t=this._activeCell.get(),n=null!=t?t:e.columnIds.length>0?{rowIndex:e.rowCount>0?0:-1,columnId:e.columnIds[0]}:null;for(const e of this._header.element.querySelectorAll("tr:first-child th[data-coreui-column]"))vn(e,null!==n&&-1===n.rowIndex&&e.dataset.coreuiColumn===n.columnId);for(const e of this._body.element.querySelectorAll("tr[data-coreui-index]")){const t=null!==n&&e.dataset.coreuiIndex===String(n.rowIndex);for(const o of e.querySelectorAll("td[data-coreui-column]"))vn(o,t&&o.dataset.coreuiColumn===n.columnId)}if(!t)return;const o=this._cellElementFor(t);o?this._activeCell.consumeFocusRequest()&&o.focus({preventScroll:!0}):this._containsFocus&&!this._element.contains(document.activeElement)&&this._viewportElement.focus({preventScroll:!0})}_getMenuActions(e){const t=this._table.getColumn(e),n=this._columnsByKey.get(e);if(!t||!n)return[];const o=[];if(this._isColumnSortable(n)){const e=t.getIsSorted();o.push({key:"sort-asc",label:this._labels.sortAscending,disabled:"asc"===e,group:"sorting",icon:this._sanitizeIcon(this._config.sortAscendingIcon),run:()=>t.toggleSorting(!1)},{key:"sort-desc",label:this._labels.sortDescending,disabled:"desc"===e,group:"sorting",icon:this._sanitizeIcon(this._config.sortDescendingIcon),run:()=>t.toggleSorting(!0)}),e&&o.push({key:"clear-sort",label:this._labels.clearSort,group:"sorting",icon:this._sanitizeIcon(this._config.sortNeutralIcon),run:()=>t.clearSorting()})}if(this._config.columnPinning){const e=t.getIsPinned();"left"!==e&&o.push({key:"pin-left",label:this._labels.pinLeft,group:"pinning",icon:this._sanitizeIcon(this._config.pinLeftIcon),run:()=>t.pin("left")}),"right"!==e&&o.push({key:"pin-right",label:this._labels.pinRight,group:"pinning",icon:this._sanitizeIcon(this._config.pinRightIcon),run:()=>t.pin("right")}),e&&o.push({key:"unpin",label:this._labels.unpin,group:"pinning",icon:this._sanitizeIcon(this._config.unpinIcon),run:()=>t.pin(!1)})}if(this._config.columnOrder&&!1!==n.movable){const n=this._visibleLeafColumns().filter(e=>e.getIsPinned()===t.getIsPinned()),l=n.findIndex(t=>t.id===e);o.push({key:"move-left",label:this._labels.moveLeft,disabled:l<=0,group:"ordering",icon:this._sanitizeIcon(this._config.moveLeftIcon),run:()=>this._moveColumn(e,-1)},{key:"move-right",label:this._labels.moveRight,disabled:l===n.length-1,group:"ordering",icon:this._sanitizeIcon(this._config.moveRightIcon),run:()=>this._moveColumn(e,1)})}this._config.columnVisibility&&t.getCanHide()&&o.push({key:"hide",label:this._labels.hideColumn,group:"visibility",icon:this._sanitizeIcon(this._config.hideColumnIcon),run:()=>t.toggleVisibility(!1)});const l="function"==typeof this._config.columnMenu?this._config.columnMenu:null;return(l?l({column:n,defaultActions:o}):o).map(e=>e.icon?{...e,icon:this._sanitizeIcon(e.icon)}:e)}_orderedLeafIds(){const e=this._table.getAllLeafColumns().map(e=>e.id),t=this._table.getState().columnOrder;if(0===t.length)return e;const n=new Set(e),o=t.filter(e=>n.has(e)),l=new Set(o);return[...o,...e.filter(e=>!l.has(e))]}_moveColumn(e,t){const n=this._table.getColumn(e);if(!n)return;const o=n.getIsPinned(),l=this._orderedLeafIds(),i=this._visibleLeafColumns().filter(e=>e.getIsPinned()===o).map(e=>e.id),s=i[i.indexOf(e)+t];if(!s)return;const r=l.indexOf(e),a=l.indexOf(s);l[r]=s,l[a]=e,this._table.setColumnOrder(l)}_onColumnDragStart(e){var t,n,o,l,i;if(null===(n=(t=e.target).closest)||void 0===n?void 0:n.call(t,cn))return void e.preventDefault();const s=null!==(o=e.delegateTarget)&&void 0!==o?o:e.target;this._dragColumn=null!==(l=s.dataset.coreuiColumn)&&void 0!==l?l:null,s.classList.add(rn);const{dataTransfer:r}=e;r&&(r.effectAllowed="move",r.setData("text/plain",null!==(i=this._dragColumn)&&void 0!==i?i:""))}_onColumnDrop(e){var t;e.preventDefault();const n=(null!==(t=e.delegateTarget)&&void 0!==t?t:e.target).dataset.coreuiColumn,o=this._dragColumn;if(this._endColumnDrag(),!o||!n||o===n)return;const l=this._table.getColumn(o),i=this._table.getColumn(n);if(!l||!i||l.getIsPinned()!==i.getIsPinned())return;const s=this._orderedLeafIds(),r=s.indexOf(o),a=s.indexOf(n);-1!==r&&-1!==a&&(s.splice(r,1),s.splice(a,0,o),this._table.setColumnOrder(s))}_endColumnDrag(){this._dragColumn=null;for(const e of this._element.querySelectorAll(`.${rn}, .${an}`))e.classList.remove(rn,an)}_startColumnResize(e){var t,n,o;const l=null===(n=(null!==(t=e.delegateTarget)&&void 0!==t?t:e.target).closest("th"))||void 0===n?void 0:n.dataset.coreuiColumn;if(!l)return;"mousedown"===e.type&&e.preventDefault();const i=null===(o=this._table.getHeaderGroups()[0])||void 0===o?void 0:o.headers.find(e=>e.column.id===l);null==i||i.getResizeHandler()(e)}_toggleRowSelection(e){var t,n;const o=null!==(t=e.delegateTarget)&&void 0!==t?t:e.target,l=o.closest("tr");if(!l)return;const i=Number(l.dataset.coreuiIndex),{rows:s}=this._table.getRowModel(),r=o.checked;if(e.shiftKey&&null!==this._selectionAnchorIndex){const e=Math.min(this._selectionAnchorIndex,i),t=Math.max(this._selectionAnchorIndex,i);this._table.setRowSelection(n=>{const o={...n};for(const n of s.slice(e,t+1))r?o[n.id]=!0:delete o[n.id];return o})}else null===(n=s[i])||void 0===n||n.toggleSelected(r);this._selectionAnchorIndex=i}_initDataSource(){const{dataProvider:e}=this._config;e&&(this._dataSource=(e=>{let t,n=0;return{load(){clearTimeout(t);const o=++n;t=setTimeout(async()=>{e.onLoadingChange(!0);try{const t=await e.provider(e.getRequest());if(o!==n)return;e.onLoad(t)}catch(t){if(o!==n)return;e.onError(t)}finally{o===n&&e.onLoadingChange(!1)}},100)},dispose(){clearTimeout(t),n++}}})({provider:t=>e(t),getRequest:()=>{var e;const t=this._table.getState();return{columnFilters:t.columnFilters,globalFilter:null!==(e=t.globalFilter)&&void 0!==e?e:"",pagination:t.pagination,sorting:t.sorting}},onLoad:e=>{this._stopEditing({commit:!1}),this._loadFailed=!1,this._dataVersion++,this._table.setOptions(t=>({...t,data:e.items,rowCount:e.totalRows})),x.trigger(this._element,Pt,{items:e.items,totalRows:e.totalRows}),this._announceResults(e.totalRows),this._scheduler.schedule()},onError:e=>{this._stopEditing({commit:!1}),this._loadFailed=!0,this._dataVersion++,this._table.setOptions(e=>({...e,data:[],rowCount:0})),x.trigger(this._element,Vt,{error:e}),this._scheduler.schedule()},onLoadingChange:e=>{this._loading&&this._loading.setVisible(e),this._viewportElement.setAttribute("aria-busy",String(e))}}),this._dataSource.load())}_visibleLeafColumns(){return[...this._table.getLeftVisibleLeafColumns(),...this._table.getCenterVisibleLeafColumns(),...this._table.getRightVisibleLeafColumns()]}_chooserColumns(){var e;const t=[];for(const n of this._orderedLeafIds()){const o=this._table.getColumn(n),l=this._columnsByKey.get(n);o&&l&&t.push({id:n,label:null!==(e=l.label)&&void 0!==e?e:l.key,canHide:o.getCanHide(),visible:o.getIsVisible()})}return t}_visibleColumns(){const e=[];for(const t of this._visibleLeafColumns()){const n=this._columnsByKey.get(t.id);n&&e.push(n)}return e}_getColumnSizes(){var e,t;const n={};for(const o of null!==(t=null===(e=this._table.getHeaderGroups()[0])||void 0===e?void 0:e.headers)&&void 0!==t?t:[])n[o.column.id]=o.getSize();return n}_getFilteredColumns(){return this._table.getState().columnFilters.map(e=>e.id)}_getPinning(){const e=this._table.getLeftLeafColumns().filter(e=>e.getIsVisible()),t=this._table.getRightLeafColumns().filter(e=>e.getIsVisible()),n=Boolean(this._config.rowSelection)&&e.length>0,o={};for(const[t,l]of e.entries())o[l.id]={side:"left",offset:l.getStart("left"),edge:t===e.length-1,afterSelect:n};for(const[e,n]of t.entries())o[n.id]={side:"right",offset:n.getAfter("right"),edge:0===e,afterSelect:!1};return{columns:o,select:n?{side:"left",offset:0,edge:!1,afterSelect:!1}:null}}_storageKey(){return this._config.stateKey?`coreui-data-grid:${this._config.stateKey}`:null}_restorePersistedState(){const e=this._storageKey();if(!e)return;let t=null;try{const n=window.localStorage.getItem(e);t=n?JSON.parse(n):null}catch(e){return}t&&this.restoreState(t)}_updateHistoryButtons(){const e=this._element.querySelector(hn);e&&(e.disabled=0===this._undoStack.length);const t=this._element.querySelector(gn);t&&(t.disabled=0===this._redoStack.length)}_announceResults(e){this._announce(Qe(this._labels.resultsAnnouncement,{count:e}))}_announce(e){this._liveRegion&&(this._liveRegion.textContent=e)}_getTotalRows(){var e;return this._config.dataProvider?null!==(e=this._table.options.rowCount)&&void 0!==e?e:0:this._table.getFilteredRowModel().rows.length}_notifyStateChange(e,t){var n,o;if(!this._element)return;this._config.stateKey&&(this._persistState||(this._persistState=yt(()=>{const e=this._storageKey();if(e)try{window.localStorage.setItem(e,JSON.stringify(this.getState()))}catch(e){}},250)),this._persistState()),e.sorting===t.sorting&&e.columnFilters===t.columnFilters&&e.globalFilter===t.globalFilter&&e.pagination.pageIndex===t.pagination.pageIndex&&e.pagination.pageSize===t.pagination.pageSize||(this._stopEditing({commit:!0,force:!0}),this._selectionAnchorIndex=null,null===(n=this._activeCell)||void 0===n||n.reset()),e.sorting!==t.sorting&&x.trigger(this._element,Kt,{sorting:t.sorting});const l=e.columnFilters!==t.columnFilters||e.globalFilter!==t.globalFilter;if(l&&(x.trigger(this._element,Bt,{columnFilters:t.columnFilters,globalFilter:null!==(o=t.globalFilter)&&void 0!==o?o:""}),this._config.dataProvider||this._announceResults(this._table.getFilteredRowModel().rows.length)),e.rowSelection!==t.rowSelection&&x.trigger(this._element,Gt,{rowSelection:t.rowSelection,selectedItems:this.getSelectedItems()}),e.pagination!==t.pagination&&x.trigger(this._element,Nt,{pagination:t.pagination}),e.columnSizing!==t.columnSizing&&x.trigger(this._element,$t,{columnSizing:t.columnSizing}),e.columnPinning!==t.columnPinning&&x.trigger(this._element,qt,{columnPinning:t.columnPinning}),e.columnOrder!==t.columnOrder&&x.trigger(this._element,jt,{columnOrder:t.columnOrder}),e.columnVisibility!==t.columnVisibility&&x.trigger(this._element,Wt,{columnVisibility:t.columnVisibility}),this._dataSource){const n=l||e.sorting!==t.sorting;if(n&&0!==t.pagination.pageIndex)return void this._table.setPageIndex(0);(n||e.pagination!==t.pagination)&&this._dataSource.load()}}_update(){var e,t,n,o,l,i;if(this._virtualizer&&(this._virtualizer.setCount(this._table.getRowModel().rows.length),this._virtualizer.instance._willUpdate()),this._editingCell&&this._virtualizer){const{rowIndex:e}=this._editingCell;this._virtualizer.instance.getVirtualItems().some(t=>t.index===e)||this._stopEditing({commit:!0,force:!0})}this._tableElement.setAttribute("aria-rowcount",String(this._header.rowCount+this._getTotalRows())),this._header.update({filteredColumns:this._config.columnFilters?this._getFilteredColumns():null,order:this._visibleLeafColumns().map(e=>e.id),pinning:this._config.columnPinning?this._getPinning():null,resizingColumn:!!this._config.columnSizing&&this._table.getState().columnSizingInfo.isResizingColumn,sizes:this._config.columnSizing||this._config.columnPinning?this._getColumnSizes():null,sorting:this._table.getState().sorting,selectAll:this._config.rowSelection?{checked:this._table.getIsAllRowsSelected(),indeterminate:this._table.getIsSomeRowsSelected()}:null}),this._body.update(),this._applyCellNavigation(),this._editorFocusPending&&(null===(e=this._editor)||void 0===e?void 0:e.element.isConnected)&&(this._editorFocusPending=!1,this._editor.focus?this._editor.focus():(null!==(t=this._editor.element.querySelector(pn))&&void 0!==t?t:this._editor.element).focus({preventScroll:!0})),null===(o=null===(n=this._toolbar)||void 0===n?void 0:n.update)||void 0===o||o.call(n),null===(i=null===(l=this._emptySlot)||void 0===l?void 0:l.update)||void 0===i||i.call(l);for(const e of this._paginations)e.refresh()}_paginationState(){const{pagination:e}=this._table.getState();return{pageCount:this._table.getPageCount(),pageIndex:e.pageIndex,pageSize:e.pageSize,totalRows:this._getTotalRows()}}static jQueryInterface(e){return this.each(function(){const t=wn.getOrCreateInstance(this,"string"==typeof e?void 0:e);if("string"!=typeof e)return;const n=t;if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);n[e]()})}}var Sn,Cn;Sn=wn,Cn=()=>{const e=r();if(e){const t=Sn.NAME,n=e.fn[t];e.fn[t]=Sn.jQueryInterface,e.fn[t].Constructor=Sn,e.fn[t].noConflict=()=>(e.fn[t]=n,Sn.jQueryInterface)}},"loading"===document.readyState?(a.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of a)e()}),a.push(Cn)):Cn(),e.DEFAULT_LABELS=Ye,e.DataGrid=wn,e.FILTER_OPERATORS=ye,e.VALUELESS_OPERATORS=Ee,e.downloadCsv=Ct,e.evaluateColumnFilter=Re,e.exportCsv=St,e.interpolate=Qe,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
8
+ //# sourceMappingURL=data-grid.min.js.map