monobill-mintui 0.6.669 → 0.6.670
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/checkbox.css +1 -1
- package/dist/choice.css +1 -1
- package/dist/components/resource-table/ResourceTable.d.ts.map +1 -1
- package/dist/components/resource-table/browser.js +15 -15
- package/dist/components/resource-table/index.cjs +1 -1
- package/dist/components/resource-table/index.js +15 -15
- package/dist/date-picker.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.css +5 -5
- package/dist/index.js +15 -15
- package/dist/select.css +1 -1
- package/dist/switch.css +1 -1
- package/package.json +1 -1
package/dist/checkbox.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* mint-ui component style: checkbox */
|
|
2
2
|
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
3
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing,.25rem) * 0)}.end{inset-inline-end:var(--spacing,.25rem)}.z-10{z-index:10}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing,.25rem) * 0)}.m-auto{margin:auto}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.hidden{display:none}.inline-flex{display:inline-flex}.h-3\.5{height:calc(var(--spacing,.25rem) * 3.5)}.h-4{height:calc(var(--spacing,.25rem) * 4)}.h-5{height:calc(var(--spacing,.25rem) * 5)}.h-full{height:100%}.w-3\.5{width:calc(var(--spacing,.25rem) * 3.5)}.w-5{width:calc(var(--spacing,.25rem) * 5)}.w-24{width:calc(var(--spacing,.25rem) * 24)}.w-full{width:100%}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse,pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing,.25rem) * .5)}.gap-2{gap:calc(var(--spacing,.25rem) * 2)}.rounded{border-radius:.25rem}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-gray-300{border-color:var(--color-gray-300,oklch(87.2% .01 258.338))}.border-neutral-800{border-color:var(--color-neutral-800,oklch(26.9% 0 0))}.border-red-300{border-color:var(--color-red-300,oklch(80.8% .114 19.571))}.bg-gray-200{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}.bg-neutral-800{background-color:var(--color-neutral-800,oklch(26.9% 0 0))}.bg-white{background-color:var(--color-white,#fff)}.p-0{padding:calc(var(--spacing,.25rem) * 0)}.align-baseline{vertical-align:baseline}.text-sm{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-xs{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1 / .75)))}.font-medium{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.text-gray-500{color:var(--color-gray-500,oklch(55.1% .027 264.364))}.text-gray-900{color:var(--color-gray-900,oklch(21% .034 264.665))}.text-red-600{color:var(--color-red-600,oklch(57.7% .245 27.325))}.text-white{color:var(--color-white,#fff)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-gray-400{--tw-ring-color:var(--color-gray-400,oklch(70.7% .022 261.325))}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}.ease-out{--tw-ease:var(--ease-out,cubic-bezier(0, 0, .2, 1));transition-timing-function:var(--ease-out,cubic-bezier(0, 0, .2, 1))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-gray-400:focus-visible{--tw-ring-color:var(--color-gray-400,oklch(70.7% .022 261.325))}.focus-visible\:ring-red-400:focus-visible{--tw-ring-color:var(--color-red-400,oklch(70.4% .191 22.216))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.dark\:border-gray-500:where(.dark,.dark *){border-color:var(--color-gray-500,oklch(55.1% .027 264.364))}.dark\:border-neutral-600:where(.dark,.dark *){border-color:var(--color-neutral-600,oklch(43.9% 0 0))}.dark\:border-red-300:where(.dark,.dark *){border-color:var(--color-red-300,oklch(80.8% .114 19.571))}.dark\:bg-mint-elevated:where(.dark,.dark *){background-color:var(--mint-color-surface-raised)}.dark\:bg-mint-hover:where(.dark,.dark *){background-color:var(--mint-color-surface-hover)}.dark\:bg-neutral-600:where(.dark,.dark *){background-color:var(--color-neutral-600,oklch(43.9% 0 0))}.dark\:text-gray-100:where(.dark,.dark *){color:var(--color-gray-100,oklch(96.7% .003 264.542))}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400,oklch(70.7% .022 261.325))}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400,oklch(70.4% .191 22.216))}.dark\:ring-gray-500:where(.dark,.dark *),.dark\:focus-visible\:ring-gray-500:where(.dark,.dark *):focus-visible{--tw-ring-color:var(--color-gray-500,oklch(55.1% .027 264.364))}.dark\:focus-visible\:ring-red-500:where(.dark,.dark *):focus-visible{--tw-ring-color:var(--color-red-500,oklch(63.7% .237 25.331))}}mint-checkbox{align-items:flex-start;gap:.65rem;display:inline-flex}.mint-checkbox-wrapper{border:1.5px solid var(--mint-color-border-strong,#b9c5bc);background:var(--mint-color-surface,#fff);cursor:pointer;border-radius:.3rem;flex:none;justify-content:center;align-items:center;width:1.25rem;height:1.25rem;display:inline-flex;position:relative}.mint-checkbox-wrapper:has(input:checked){border-color:var(--mint-color-primary,#315943);background:var(--mint-color-primary,#315943)}.mint-checkbox-wrapper input{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-checkbox-label-container{flex-direction:column;flex:1;gap:.2rem;display:flex}.mint-checkbox-label{cursor:pointer;font-size:.875rem;font-weight:500;line-height:1.25rem}.mint-checkbox-info{color:var(--mint-color-text-secondary,#66736a);font-size:.75rem;line-height:1rem}.mint-input-overlay{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-checkbox-check{width:.875rem;height:.875rem;color:var(--mint-color-on-primary,#fff);pointer-events:none;margin:auto;position:absolute;inset:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
|
3
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing,.25rem) * 0)}.end{inset-inline-end:var(--spacing,.25rem)}.z-10{z-index:10}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing,.25rem) * 0)}.m-auto{margin:auto}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.hidden{display:none}.inline-flex{display:inline-flex}.h-3\.5{height:calc(var(--spacing,.25rem) * 3.5)}.h-4{height:calc(var(--spacing,.25rem) * 4)}.h-5{height:calc(var(--spacing,.25rem) * 5)}.h-full{height:100%}.w-3\.5{width:calc(var(--spacing,.25rem) * 3.5)}.w-5{width:calc(var(--spacing,.25rem) * 5)}.w-24{width:calc(var(--spacing,.25rem) * 24)}.w-full{width:100%}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse,pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing,.25rem) * .5)}.gap-2{gap:calc(var(--spacing,.25rem) * 2)}.rounded{border-radius:.25rem}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-gray-300{border-color:var(--color-gray-300,oklch(87.2% .01 258.338))}.border-neutral-800{border-color:var(--color-neutral-800,oklch(26.9% 0 0))}.border-red-300{border-color:var(--color-red-300,oklch(80.8% .114 19.571))}.bg-gray-200{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}.bg-neutral-800{background-color:var(--color-neutral-800,oklch(26.9% 0 0))}.bg-white{background-color:var(--color-white,#fff)}.p-0{padding:calc(var(--spacing,.25rem) * 0)}.align-baseline{vertical-align:baseline}.text-sm{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-xs{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1 / .75)))}.font-medium{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.text-gray-500{color:var(--color-gray-500,oklch(55.1% .027 264.364))}.text-gray-900{color:var(--color-gray-900,oklch(21% .034 264.665))}.text-red-600{color:var(--color-red-600,oklch(57.7% .245 27.325))}.text-white{color:var(--color-white,#fff)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-gray-400{--tw-ring-color:var(--color-gray-400,oklch(70.7% .022 261.325))}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}.ease-out{--tw-ease:var(--ease-out,cubic-bezier(0, 0, .2, 1));transition-timing-function:var(--ease-out,cubic-bezier(0, 0, .2, 1))}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\:ring-gray-400:focus-visible{--tw-ring-color:var(--color-gray-400,oklch(70.7% .022 261.325))}.focus-visible\:ring-red-400:focus-visible{--tw-ring-color:var(--color-red-400,oklch(70.4% .191 22.216))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.dark\:border-gray-500:where(.dark,.dark *){border-color:var(--color-gray-500,oklch(55.1% .027 264.364))}.dark\:border-neutral-600:where(.dark,.dark *){border-color:var(--color-neutral-600,oklch(43.9% 0 0))}.dark\:border-red-300:where(.dark,.dark *){border-color:var(--color-red-300,oklch(80.8% .114 19.571))}.dark\:bg-mint-elevated:where(.dark,.dark *){background-color:var(--mint-color-surface-raised)}.dark\:bg-mint-hover:where(.dark,.dark *){background-color:var(--mint-color-surface-hover)}.dark\:bg-neutral-600:where(.dark,.dark *){background-color:var(--color-neutral-600,oklch(43.9% 0 0))}.dark\:text-gray-100:where(.dark,.dark *){color:var(--color-gray-100,oklch(96.7% .003 264.542))}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400,oklch(70.7% .022 261.325))}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400,oklch(70.4% .191 22.216))}.dark\:ring-gray-500:where(.dark,.dark *),.dark\:focus-visible\:ring-gray-500:where(.dark,.dark *):focus-visible{--tw-ring-color:var(--color-gray-500,oklch(55.1% .027 264.364))}.dark\:focus-visible\:ring-red-500:where(.dark,.dark *):focus-visible{--tw-ring-color:var(--color-red-500,oklch(63.7% .237 25.331))}}mint-checkbox{align-items:flex-start;gap:.65rem;display:inline-flex}.mint-checkbox-wrapper{border:1.5px solid var(--mint-color-border-strong,#b9c5bc);background:var(--mint-color-surface,#fff);cursor:pointer;border-radius:.3rem;flex:none;justify-content:center;align-items:center;width:1.25rem;height:1.25rem;display:inline-flex;position:relative}.mint-checkbox-wrapper:has(input:checked){border-color:var(--mint-color-primary,#315943);background:var(--mint-color-primary,#315943)}.mint-checkbox-wrapper input{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-checkbox-label-container{flex-direction:column;flex:1;gap:.2rem;display:flex}.mint-checkbox-label{cursor:pointer;font-size:.875rem;font-weight:500;line-height:1.25rem}.mint-checkbox-info{color:var(--mint-color-text-secondary,#66736a);font-size:.75rem;line-height:1rem}.mint-input-overlay{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-checkbox-check{width:.875rem;height:.875rem;color:var(--mint-color-on-primary,#fff);pointer-events:none;margin:auto;position:absolute;inset:0}mint-checkbox{align-items:center;min-height:2.5rem}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
package/dist/choice.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/* mint-ui component style: choice */
|
|
2
2
|
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
|
3
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing,.25rem) * 0)}.end{inset-inline-end:var(--spacing,.25rem)}.z-10{z-index:10}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing,.25rem) * 0)}.mt-0\.5{margin-top:calc(var(--spacing,.25rem) * .5)}.mt-1{margin-top:calc(var(--spacing,.25rem) * 1)}.mb-2{margin-bottom:calc(var(--spacing,.25rem) * 2)}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.hidden{display:none}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing,.25rem) * 2)}.h-4{height:calc(var(--spacing,.25rem) * 4)}.h-5{height:calc(var(--spacing,.25rem) * 5)}.h-\[1rem\]{height:1rem}.w-2{width:calc(var(--spacing,.25rem) * 2)}.w-5{width:calc(var(--spacing,.25rem) * 5)}.w-20{width:calc(var(--spacing,.25rem) * 20)}.w-\[1rem\]{width:1rem}.w-full{width:100%}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse,pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing,.25rem) * .5)}.gap-2{gap:calc(var(--spacing,.25rem) * 2)}.gap-3{gap:calc(var(--spacing,.25rem) * 3)}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-gray-300{border-color:var(--color-gray-300,oklch(87.2% .01 258.338))}.border-slate-800{border-color:var(--color-slate-800,oklch(27.9% .041 260.031))}.bg-gray-200{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}.bg-slate-800{background-color:var(--color-slate-800,oklch(27.9% .041 260.031))}.bg-white{background-color:var(--color-white,#fff)}.p-0{padding:calc(var(--spacing,.25rem) * 0)}.text-sm{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-xs{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1 / .75)))}.font-medium{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.text-gray-500{color:var(--color-gray-500,oklch(55.1% .027 264.364))}.text-gray-900{color:var(--color-gray-900,oklch(21% .034 264.665))}.text-red-600{color:var(--color-red-600,oklch(57.7% .245 27.325))}.opacity-40{opacity:.4}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-gray-400{--tw-ring-color:var(--color-gray-400,oklch(70.7% .022 261.325))}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}.ease-out{--tw-ease:var(--ease-out,cubic-bezier(0, 0, .2, 1));transition-timing-function:var(--ease-out,cubic-bezier(0, 0, .2, 1))}.select-none{-webkit-user-select:none;user-select:none}.dark\:border-gray-500:where(.dark,.dark *){border-color:var(--color-gray-500,oklch(55.1% .027 264.364))}.dark\:border-slate-600:where(.dark,.dark *){border-color:var(--color-slate-600,oklch(44.6% .043 257.281))}.dark\:bg-mint-elevated:where(.dark,.dark *){background-color:var(--mint-color-surface-raised)}.dark\:bg-mint-hover:where(.dark,.dark *){background-color:var(--mint-color-surface-hover)}.dark\:bg-slate-600:where(.dark,.dark *){background-color:var(--color-slate-600,oklch(44.6% .043 257.281))}.dark\:text-gray-100:where(.dark,.dark *){color:var(--color-gray-100,oklch(96.7% .003 264.542))}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400,oklch(70.7% .022 261.325))}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400,oklch(70.4% .191 22.216))}.dark\:ring-gray-500:where(.dark,.dark *){--tw-ring-color:var(--color-gray-500,oklch(55.1% .027 264.364))}}mint-choice{align-items:flex-start;gap:.65rem;display:inline-flex}.mint-choice-wrapper{border:1.5px solid var(--mint-color-border-strong,#b9c5bc);background:var(--mint-color-surface,#fff);cursor:pointer;border-radius:50%;flex:none;justify-content:center;align-items:center;width:1.25rem;height:1.25rem;display:inline-flex;position:relative}.mint-choice-wrapper:has(input:checked){border-color:var(--mint-color-primary,#315943);background:var(--mint-color-primary,#315943)}.mint-choice-wrapper input{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-choice-label-container{flex-direction:column;flex:1;gap:.2rem;display:flex}.mint-choice-label{cursor:pointer;font-size:.875rem;font-weight:500;line-height:1.25rem}.mint-choice-info{color:var(--mint-color-text-secondary,#66736a);font-size:.75rem;line-height:1rem}.mint-input-overlay{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-choice-indicator{background:var(--mint-color-surface,#fff);pointer-events:none;border-radius:50%;width:.625rem;height:.625rem;margin:auto;position:absolute;inset:0}mint-choice.mint-choice-group{flex-direction:column;align-items:stretch;gap:.5rem;width:100%;display:flex}.mint-choice-group-label{color:var(--mint-color-text,#28372e);font-size:.875rem;font-weight:500;line-height:1.25rem}.mint-choice-options{flex-direction:column;gap:.65rem;display:flex}.mint-choice-option{display:block}.mint-choice-option-control{cursor:pointer;color:var(--mint-color-text,#28372e);align-items:center;gap:.55rem;display:inline-flex}.mint-choice-option-input{width:1.1rem;height:1.1rem;accent-color:var(--mint-color-primary,#315943);margin:0}.mint-choice-option:has(input:disabled) .mint-choice-option-control{cursor:not-allowed;opacity:.55}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
|
3
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-ease:initial}}}@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing,.25rem) * 0)}.end{inset-inline-end:var(--spacing,.25rem)}.z-10{z-index:10}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing,.25rem) * 0)}.mt-0\.5{margin-top:calc(var(--spacing,.25rem) * .5)}.mt-1{margin-top:calc(var(--spacing,.25rem) * 1)}.mb-2{margin-bottom:calc(var(--spacing,.25rem) * 2)}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.hidden{display:none}.inline-flex{display:inline-flex}.h-2{height:calc(var(--spacing,.25rem) * 2)}.h-4{height:calc(var(--spacing,.25rem) * 4)}.h-5{height:calc(var(--spacing,.25rem) * 5)}.h-\[1rem\]{height:1rem}.w-2{width:calc(var(--spacing,.25rem) * 2)}.w-5{width:calc(var(--spacing,.25rem) * 5)}.w-20{width:calc(var(--spacing,.25rem) * 20)}.w-\[1rem\]{width:1rem}.w-full{width:100%}.flex-shrink-0{flex-shrink:0}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse,pulse 2s cubic-bezier(.4, 0, .6, 1) infinite)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing,.25rem) * .5)}.gap-2{gap:calc(var(--spacing,.25rem) * 2)}.gap-3{gap:calc(var(--spacing,.25rem) * 3)}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-gray-300{border-color:var(--color-gray-300,oklch(87.2% .01 258.338))}.border-slate-800{border-color:var(--color-slate-800,oklch(27.9% .041 260.031))}.bg-gray-200{background-color:var(--color-gray-200,oklch(92.8% .006 264.531))}.bg-slate-800{background-color:var(--color-slate-800,oklch(27.9% .041 260.031))}.bg-white{background-color:var(--color-white,#fff)}.p-0{padding:calc(var(--spacing,.25rem) * 0)}.text-sm{font-size:var(--text-sm,.875rem);line-height:var(--tw-leading,var(--text-sm--line-height,calc(1.25 / .875)))}.text-xs{font-size:var(--text-xs,.75rem);line-height:var(--tw-leading,var(--text-xs--line-height,calc(1 / .75)))}.font-medium{--tw-font-weight:var(--font-weight-medium,500);font-weight:var(--font-weight-medium,500)}.text-gray-500{color:var(--color-gray-500,oklch(55.1% .027 264.364))}.text-gray-900{color:var(--color-gray-900,oklch(21% .034 264.665))}.text-red-600{color:var(--color-red-600,oklch(57.7% .245 27.325))}.opacity-40{opacity:.4}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-gray-400{--tw-ring-color:var(--color-gray-400,oklch(70.7% .022 261.325))}.ring-offset-1{--tw-ring-offset-width:1px;--tw-ring-offset-shadow:var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function,cubic-bezier(.4, 0, .2, 1)));transition-duration:var(--tw-duration,var(--default-transition-duration,.15s))}.ease-out{--tw-ease:var(--ease-out,cubic-bezier(0, 0, .2, 1));transition-timing-function:var(--ease-out,cubic-bezier(0, 0, .2, 1))}.select-none{-webkit-user-select:none;user-select:none}.dark\:border-gray-500:where(.dark,.dark *){border-color:var(--color-gray-500,oklch(55.1% .027 264.364))}.dark\:border-slate-600:where(.dark,.dark *){border-color:var(--color-slate-600,oklch(44.6% .043 257.281))}.dark\:bg-mint-elevated:where(.dark,.dark *){background-color:var(--mint-color-surface-raised)}.dark\:bg-mint-hover:where(.dark,.dark *){background-color:var(--mint-color-surface-hover)}.dark\:bg-slate-600:where(.dark,.dark *){background-color:var(--color-slate-600,oklch(44.6% .043 257.281))}.dark\:text-gray-100:where(.dark,.dark *){color:var(--color-gray-100,oklch(96.7% .003 264.542))}.dark\:text-gray-400:where(.dark,.dark *){color:var(--color-gray-400,oklch(70.7% .022 261.325))}.dark\:text-red-400:where(.dark,.dark *){color:var(--color-red-400,oklch(70.4% .191 22.216))}.dark\:ring-gray-500:where(.dark,.dark *){--tw-ring-color:var(--color-gray-500,oklch(55.1% .027 264.364))}}mint-choice{align-items:flex-start;gap:.65rem;display:inline-flex}.mint-choice-wrapper{border:1.5px solid var(--mint-color-border-strong,#b9c5bc);background:var(--mint-color-surface,#fff);cursor:pointer;border-radius:50%;flex:none;justify-content:center;align-items:center;width:1.25rem;height:1.25rem;display:inline-flex;position:relative}.mint-choice-wrapper:has(input:checked){border-color:var(--mint-color-primary,#315943);background:var(--mint-color-primary,#315943)}.mint-choice-wrapper input{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-choice-label-container{flex-direction:column;flex:1;gap:.2rem;display:flex}.mint-choice-label{cursor:pointer;font-size:.875rem;font-weight:500;line-height:1.25rem}.mint-choice-info{color:var(--mint-color-text-secondary,#66736a);font-size:.75rem;line-height:1rem}.mint-input-overlay{opacity:0;cursor:pointer;z-index:2;width:100%;height:100%;margin:0;position:absolute;inset:0}.mint-choice-indicator{background:var(--mint-color-surface,#fff);pointer-events:none;border-radius:50%;width:.625rem;height:.625rem;margin:auto;position:absolute;inset:0}mint-choice.mint-choice-group{flex-direction:column;align-items:stretch;gap:.5rem;width:100%;display:flex}.mint-choice-group-label{color:var(--mint-color-text,#28372e);font-size:.875rem;font-weight:500;line-height:1.25rem}.mint-choice-options{flex-direction:column;gap:.65rem;display:flex}.mint-choice-option{display:block}.mint-choice-option-control{cursor:pointer;color:var(--mint-color-text,#28372e);align-items:center;gap:.55rem;display:inline-flex}.mint-choice-option-input{width:1.1rem;height:1.1rem;accent-color:var(--mint-color-primary,#315943);margin:0}.mint-choice-option:has(input:disabled) .mint-choice-option-control{cursor:not-allowed;opacity:.55}mint-choice:not(.mint-choice-group){align-items:center;min-height:2.5rem}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceTable.d.ts","sourceRoot":"","sources":["../../../src/components/resource-table/ResourceTable.ts"],"names":[],"mappings":"AAIA,OAAO,gBAAgB,CAAA;AACvB,OAAO,gBAAgB,CAAA;AACvB,OAAO,iBAAiB,CAAA;AACxB,OAAO,kBAAkB,CAAA;AACzB,OAAO,eAAe,CAAA;AACtB,OAAO,2BAA2B,CAAA;AAClC,OAAO,0BAA0B,CAAA;AACjC,OAAO,2BAA2B,CAAA;AA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AA8B;IAqCtC,OAAO,CAAC,0BAA0B;IASlC,OAAO,CAAC,kBAAkB;IAsI1B,OAAO,CAAC,oBAAoB;IA+B5B,OAAO,CAAC,4BAA4B;YAqBtB,sBAAsB;IAqDpC,OAAO,CAAC,wBAAwB;IAMhC,4FAA4F;IAC5F,OAAO,CAAC,8BAA8B;IAetC,OAAO,CAAC,6BAA6B;IAyBrC,OAAO,CAAC,WAAW;IAyEnB,OAAO,CAAC,aAAa;IAYrB,OAAO,CAAC,gBAAgB;IAqExB,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,cAAc;IA2CtB,OAAO,CAAC,iBAAiB;IA4CzB,OAAO,CAAC,gBAAgB;IAiIxB,OAAO,CAAC,iBAAiB;IA8IzB,OAAO,CAAC,SAAS;IA0BjB,kFAAkF;IAClF,OAAO,CAAC,kCAAkC;IAgC1C,OAAO,CAAC,4BAA4B;IAYpC,OAAO,CAAC,kBAAkB;IAqB1B,OAAO,CAAC,mBAAmB;IAuB3B,OAAO,CAAC,YAAY;IAmCpB,OAAO,CAAC,SAAS;IAoBjB,OAAO,CAAC,WAAW;IA8BnB,mGAAmG;IACnG,OAAO,CAAC,sBAAsB;IAW9B;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IA+CxB,MAAM,IAAI,IAAI;IAyRd,OAAO,CAAC,sBAAsB;IA+C9B,OAAO,CAAC,0BAA0B;IA+BlC,OAAO,CAAC,0BAA0B;IA8BlC,OAAO,CAAC,qBAAqB;IA8E7B,OAAO,CAAC,WAAW;IAMnB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAYvB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAmBxB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;CAWzB;AAMD,eAAe,iBAAiB,CAAA"}
|
|
@@ -284,17 +284,17 @@ var n = {
|
|
|
284
284
|
columns: this._columns.join(",")
|
|
285
285
|
}), t = {};
|
|
286
286
|
this._configuration.headers && (t.headers = this._configuration.headers);
|
|
287
|
-
let n = await fetch(`${i}
|
|
288
|
-
if (!
|
|
289
|
-
let
|
|
290
|
-
this._configuration.predefinedData ? (
|
|
291
|
-
let
|
|
292
|
-
|
|
293
|
-
let
|
|
287
|
+
let n = i.includes("?") ? "&" : "?", r = await fetch(`${i}${n}${e.toString()}`, t);
|
|
288
|
+
if (!r.ok) throw Error(`HTTP error! status: ${r.status}`);
|
|
289
|
+
let s = await r.json(), c = s.content?.rows || [], l = s.content?.total || 0, u = c;
|
|
290
|
+
this._configuration.predefinedData ? (u = [...this._configuration.predefinedData, ...c], this._totalRows = l + this._configuration.predefinedData.length) : this._totalRows = l, this._rows = u;
|
|
291
|
+
let d = Math.floor(o / a) + 1;
|
|
292
|
+
s.content?.current_page !== void 0 && s.content.current_page === d ? this._currentPage = s.content.current_page : this._currentPage = d, this._offset = (this._currentPage - 1) * a, this._lastPage = s.content?.last_page || 1, this._fetching = !1, this._loaded = !0, this._loading = !1, this._fetchError = null, this._searching = !1;
|
|
293
|
+
let f = this._sorting;
|
|
294
294
|
this._sorting = !1, this._sortingColumnData = null, this.dispatchEvent(new CustomEvent("loaded", { detail: { rows: this._rows } })), this._updateSearchIcon();
|
|
295
|
-
let
|
|
295
|
+
let p = `tbody[data-mint-rt-tbody="${this._tableId}"]`, m = !!this.querySelector(p);
|
|
296
296
|
if (this._virtualScrollActive() && this._type === "ajax") {
|
|
297
|
-
|
|
297
|
+
m || this.render(), c.forEach((e, t) => {
|
|
298
298
|
this._virtualRowCache.set(o + t, e);
|
|
299
299
|
}), this._virtualInvalidate(), o === 0 ? queueMicrotask(() => this._scrollVirtualTableTopIntoView()) : this._scheduleVirtualWindowSync();
|
|
300
300
|
let e = this._loadingPage;
|
|
@@ -305,7 +305,7 @@ var n = {
|
|
|
305
305
|
});
|
|
306
306
|
}, 0);
|
|
307
307
|
} else if (this.querySelector(`#${this._tableId}`)?.closest("table")?.querySelector("tbody")) {
|
|
308
|
-
if (
|
|
308
|
+
if (f) {
|
|
309
309
|
let e = this._loading, t = this._fetching;
|
|
310
310
|
this._loading = !1, this._fetching = !1, this._updateTableBody(), this._loading = e, this._fetching = t;
|
|
311
311
|
} else this._updateTableBody();
|
|
@@ -317,7 +317,7 @@ var n = {
|
|
|
317
317
|
});
|
|
318
318
|
}, 0);
|
|
319
319
|
} else this.render();
|
|
320
|
-
|
|
320
|
+
f && this._updateSortIcons();
|
|
321
321
|
} catch (e) {
|
|
322
322
|
this._fetching = !1, this._loading = !1, this._loadingPage = null, this._loaded = !0, this._searching = !1, this._fetchError = e instanceof Error ? e.message : "Failed to fetch data", console.error("mint-resource-table: Error fetching data", e), this._sorting && (this._sorting = !1, this._sortingColumnData = null, this._updateSortIcons()), this._updateSearchIcon(), this.querySelector(`#${this._tableId}`)?.closest("table")?.querySelector("tbody") ? (this._updateTableBody(), this._loadingPage = null, this._updatePagination()) : this.render();
|
|
323
323
|
}
|
|
@@ -851,11 +851,11 @@ var n = {
|
|
|
851
851
|
columns: this._columns.join(",")
|
|
852
852
|
}), t = {};
|
|
853
853
|
this._configuration.headers && (t.headers = this._configuration.headers);
|
|
854
|
-
let o = await fetch(`${n}
|
|
855
|
-
if (!
|
|
856
|
-
let
|
|
854
|
+
let o = n.includes("?") ? "&" : "?", s = await fetch(`${n}${o}${e.toString()}`, t);
|
|
855
|
+
if (!s.ok) throw Error(`HTTP error! status: ${s.status}`);
|
|
856
|
+
let c = await s.json();
|
|
857
857
|
if (r !== this._virtualFetchGeneration) return;
|
|
858
|
-
(
|
|
858
|
+
(c.content?.rows || []).forEach((e, t) => {
|
|
859
859
|
let n = i + t;
|
|
860
860
|
n < this._totalRows && this._virtualRowCache.set(n, e);
|
|
861
861
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
require(`../chunks/icon-CGXHKbMq.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-Cfhjb8tV.js`),require(`../chunks/spinner-DfPbEa2d.js`),require(`../chunks/button-9OkdUt6p.js`),require(`../chunks/input-CNG7PaSY.js`),require(`../chunks/caret-down-BfBLwx6q.js`),require(`../chunks/popover-wGdggZ-a.js`);const t=require(`../chunks/ScrollFade-DT2Br2g7.js`);require(`../chunks/search-Ce29Aglb.js`),require(`../chunks/table-vjF3q3J5.js`);var n={"-mr-1":`rtu-8956a4275`,"-translate-y-1/2":`rtu-36b381be4`,"[&>*]:m-0":`rtu-7b41b3d11`,"[&>*]:max-w-full":`rtu-ba23a8c34`,"[&>*]:min-h-0":`rtu-860618883`,"[&>*]:min-w-0":`rtu-85a48d872`,"[&>*]:p-0":`rtu-299511c44`,"[&>*]:w-full":`rtu-d26168286`,"[&>span]:flex":`rtu-684665eca`,"[&>span]:h-full":`rtu-e4b40d71e`,"[&>span]:items-stretch":`rtu-d7d251fc2`,"[&>span]:justify-stretch":`rtu-86ed0d205`,"[&>span]:min-h-0":`rtu-f145dfde7`,"[&>span]:min-w-0":`rtu-0a6cfb970`,"[&>span]:w-full":`rtu-85ca68177`,"[&_img]:!block":`rtu-83fb557c2`,"[&_img]:!border-0":`rtu-2288f2d07`,"[&_img]:!box-border":`rtu-9253a17e4`,"[&_img]:!h-full":`rtu-07505e4a3`,"[&_img]:!m-0":`rtu-52565be3c`,"[&_img]:!max-h-full":`rtu-9b7f93d32`,"[&_img]:!max-w-full":`rtu-690df1880`,"[&_img]:!min-h-0":`rtu-a6c91024c`,"[&_img]:!min-w-0":`rtu-249d05caa`,"[&_img]:!object-center":`rtu-c24cf3532`,"[&_img]:!object-cover":`rtu-5c4ff5239`,"[&_img]:!p-0":`rtu-45a528345`,"[&_img]:!rounded-none":`rtu-6b1008ffa`,"[&_img]:!w-full":`rtu-ce262d06f`,"[-webkit-overflow-scrolling:touch]":`rtu-66a5833b4`,absolute:`rtu-da4dbfbc4`,"align-baseline":`rtu-8d378d3b6`,"animate-pulse":`rtu-d59b97947`,"animate-spin":`rtu-afbdd13a3`,"bg-gray-100":`rtu-d260f3e1b`,"bg-gray-200":`rtu-fcf159058`,"bg-white":`rtu-5e10cdb8f`,block:`rtu-0214b4b35`,border:`rtu-ca6bcd4b6`,"border-0":`rtu-119b2aa0b`,"border-2":`rtu-65935df57`,"border-b":`rtu-65fdbade2`,"border-collapse":`rtu-4583f90cd`,"border-gray-200":`rtu-534158080`,"border-gray-300":`rtu-5ab1f191a`,"border-t":`rtu-b950dda29`,"border-t-gray-700":`rtu-2f99a0daf`,"box-border":`rtu-7906320e4`,"cursor-pointer":`rtu-345168367`,"dark:bg-mint-canvas":`rtu-91530d570`,"dark:bg-mint-hover":`rtu-f3646e34b`,"dark:bg-mint-nav":`rtu-ef1a5fba7`,"dark:bg-white/15":`rtu-2a035a254`,"dark:border-gray-600":`rtu-17b5ca3ec`,"dark:border-mint-divider":`rtu-785e12750`,"dark:border-t-gray-200":`rtu-d1e9bc81b`,"dark:hover:bg-gray-800":`rtu-c211aa745`,"dark:hover:bg-mint-elevated":`rtu-e02bea78e`,"dark:text-gray-400":`rtu-cd05fca6d`,"dark:text-gray-500":`rtu-cae7d218d`,"dark:text-gray-600":`rtu-916f092fc`,"dark:text-red-400":`rtu-150dc4530`,"dark:text-white":`rtu-889e4e871`,fixed:`rtu-7bc555991`,flex:`rtu-60fbb7713`,"flex-1":`rtu-36e579c0b`,"flex-col":`rtu-8dddea077`,"flex-nowrap":`rtu-51ecff099`,"font-normal":`rtu-8ecebc9f8`,"font-semibold":`rtu-e83a7042b`,"gap-0.5":`rtu-a3899220f`,"gap-1":`rtu-44ee8ba0a`,"gap-2":`rtu-77a2a20e9`,"gap-3":`rtu-1004c0c39`,"h-3":`rtu-6a60c09e6`,"h-4":`rtu-11e59c6d5`,"h-full":`rtu-668b21aa5`,hidden:`rtu-99d72c7fc`,"hover:bg-gray-50":`rtu-6c0fe2c8e`,"inline-block":`rtu-bb0c4bfc5`,"inline-flex":`rtu-52083e7da`,"items-center":`rtu-3960ffc24`,"items-start":`rtu-60541e1e2`,"items-stretch":`rtu-a13d486c1`,"justify-between":`rtu-8ef2268ef`,"justify-center":`rtu-86843cf1e`,"justify-end":`rtu-77c08e015`,"leading-snug":`rtu-e25ca6535`,"left-3":`rtu-22e59b722`,"list-none":`rtu-b20d79b23`,"m-0":`rtu-74f9876a6`,"max-w-[95%]":`rtu-80fa57ccf`,"max-w-none":`rtu-2191c1456`,"max-w-xs":`rtu-3acf64d53`,"mb-3":`rtu-1bb883263`,"md:block":`rtu-9d60be3a6`,"md:border-t-0":`rtu-f6099fc6b`,"md:hidden":`rtu-e477a6af4`,"md:justify-end":`rtu-70ce0294b`,"md:mt-4":`rtu-ef9aeb563`,"md:pt-0":`rtu-30dec114f`,"md:py-0":`rtu-3957f1b8e`,"min-h-0":`rtu-fb7302e53`,"min-w-0":`rtu-7e0b7cdf1`,"min-w-[11rem]":`rtu-46b2fd2eb`,"ml-2":`rtu-c68af9986`,"mr-0":`rtu-719fceda9`,"mr-2":`rtu-d2347e849`,"mx-auto":`rtu-0e12dc7de`,"overflow-hidden":`rtu-2cd02d11d`,"overflow-x-auto":`rtu-1384f66f4`,"overflow-x-hidden":`rtu-e271e6ae1`,"overflow-y-auto":`rtu-92bf82f49`,"overflow-y-hidden":`rtu-b70fd23f6`,"overscroll-x-contain":`rtu-63ccdaaca`,"p-0":`rtu-8a539c7fe`,"p-1":`rtu-eb6a3cef9`,"p-3.5":`rtu-56796a90b`,"p-4":`rtu-8e63407b5`,"pb-3.5":`rtu-2d1f72154`,"pl-0":`rtu-d569803f7`,"pointer-events-none":`rtu-a4326536b`,"pr-4":`rtu-ba64a7c03`,"pt-3":`rtu-ce335a8e4`,"px-1":`rtu-d8e0e382c`,"px-2":`rtu-d5eab218a`,"px-3.5":`rtu-e0d9cc7f0`,"px-4":`rtu-f0faeb26d`,"py-0.5":`rtu-465609a24`,"py-2":`rtu-03b4dd7f1`,"py-3":`rtu-1b2d54a3f`,"py-3.5":`rtu-69e76918f`,"py-8":`rtu-a1f611f02`,rounded:`rtu-07389a777`,"rounded-full":`rtu-ac204c108`,"rounded-md":`rtu-421ac2be5`,"rounded-t-none":`rtu-79ee0e356`,"shrink-0":`rtu-012fbd121`,sticky:`rtu-3e0fd166d`,table:`rtu-c3ee137d4`,"table-fixed":`rtu-604d60250`,"text-base":`rtu-4ee734926`,"text-center":`rtu-ca6bf6303`,"text-gray-300":`rtu-5ed47f375`,"text-gray-400":`rtu-a572cdde6`,"text-gray-500":`rtu-5a630e0cf`,"text-gray-900":`rtu-ba48f7479`,"text-left":`rtu-2eba0d65d`,"text-red-500":`rtu-e3f51cc69`,"text-right":`rtu-308fc069e`,"text-sm":`rtu-fc7473ca0`,"text-xs":`rtu-359090c2d`,"top-0":`rtu-2167406b2`,"top-1/2":`rtu-d694ba66e`,truncate:`rtu-f283ea9be`,"w-4":`rtu-dc7972ebf`,"w-40":`rtu-84789e8a2`,"w-full":`rtu-6da6a3c3f`,"w-max":`rtu-2f935d2ee`,"z-10":`rtu-236812d64`,"z-20":`rtu-145745bf5`,"z-30":`rtu-0f2fff0ae`},r=class extends HTMLElement{static get observedAttributes(){return[`configuration`,`loading`,`virtual-scroll`,`virtual-scroll-root`,`virtual-row-height`,`virtual-max-height`,`fixed-header`,`fixed-controls`]}_isExternalLoading(){let e=this.getAttribute(`loading`);return e!==null&&e!==`false`}constructor(){super(),this._configuration=null,this._rows=[],this._search=``,this._currentPage=1,this._perPage=15,this._totalRows=0,this._lastPage=0,this._offset=0,this._loaded=!1,this._fetching=!1,this._loading=!1,this._loadingPage=null,this._fetchError=null,this._searching=!1,this._sorting=!1,this._sortingColumnData=null,this._type=`provided`,this._searchTimeoutId=null,this._sortTimeoutId=null,this._searchColumns=[],this._exportColumns={},this._columns=[],this._tableId=``,this._searchInput=null,this._tableContainer=null,this._paginationContainer=null,this._skeletonContainer=null,this._inMintCard=!1,this._virtualBodyScrollEl=null,this._disposeVirtualBodyFade=null,this._virtualScrollHandler=null,this._virtualWindowRaf=null,this._virtualLastRangeStart=-1,this._virtualLastRangeEnd=-1,this._virtualLastRangeCacheSig=``,this._virtualResizeObserver=null,this._virtualWindowResizeHandler=null,this._virtualRowCache=new Map,this._virtualRangeFetching=!1,this._mobileListMql=null,this._boundMobileListMqlListener=null,this._virtualFetchGeneration=0,this._virtualAjaxPrefetchTimer=null,this._fixedChromeResizeObserver=null,this._utilityClassObserver=null}get inMintCard(){return this._inMintCard}get configuration(){return this._configuration}set configuration(e){e&&typeof e==`object`&&!Array.isArray(e)?(this._configuration=e,this._tableId=this._configuration.id||this._tableId||`mint-resource-table-${Date.now()}`,this._perPage=this._configuration.perPage||15,this._type=typeof this._configuration.data==`string`?`ajax`:`provided`,this._loaded=!1,this._currentPage=1,this._offset=0,this._loadPageFromUrl(),this._type===`provided`&&Array.isArray(this._configuration.data)&&(this._rows=[...this._configuration.data],this._totalRows=this._configuration.data.length),this._initializeColumns(),this.isConnected&&this.render()):e==null?this._configuration=null:this._parseConfiguration()}connectedCallback(){this.classList.add(`box-border`,`m-0`,`p-0`,`border-0`,`align-baseline`,`block`,`w-full`),this._utilityClassObserver=new MutationObserver(()=>this._replaceUtilityClasses()),this._utilityClassObserver.observe(this,{attributes:!0,attributeFilter:[`class`],childList:!0,subtree:!0}),this._inMintCard=this.closest(`mint-card`)!==null,this._configuration||this._parseConfiguration(),this._initializeColumns(),this._loadPageFromUrl(),this._attachRowClickHandler(),this.render()}disconnectedCallback(){this._searchTimeoutId&&clearTimeout(this._searchTimeoutId),this._detachVirtualScroll(),this._detachFixedChromeResize(),this._detachMobileListMql(),this._utilityClassObserver?.disconnect(),this._utilityClassObserver=null,this._rowClickHandler&&=(this.removeEventListener(`click`,this._rowClickHandler,!0),null),this._scrollHandler&&=(window.removeEventListener(`scroll`,this._scrollHandler),null)}attributeChangedCallback(e,t,n){e===`configuration`&&t!==n?(!this._configuration||typeof n==`string`)&&(this._parseConfiguration(),this.render()):t!==n&&(e===`loading`||e===`virtual-scroll`||e===`virtual-scroll-root`||e===`virtual-row-height`||e===`virtual-max-height`||e===`fixed-header`||e===`fixed-controls`)&&this._configuration&&this.isConnected&&this.render()}refresh(){this._configuration&&(this._type===`ajax`?this._fetchData(void 0,!0,this._perPage,this._offset):(Array.isArray(this._configuration.data)&&(this._rows=[...this._configuration.data],this._totalRows=this._rows.length),this.render()))}setData(e){if(this._configuration){if(this._configuration.data=e,this._type=typeof e==`string`?`ajax`:`provided`,this._currentPage=1,this._offset=0,this._updatePageInUrl(1),this._fetchError=null,this._searching=!1,this._loadingPage=null,this._sortTimeoutId&&=(clearTimeout(this._sortTimeoutId),null),this._searchTimeoutId&&=(clearTimeout(this._searchTimeoutId),null),this._virtualScrollActive()&&(this._virtualRowCache.clear(),this._virtualInvalidate()),this._type===`ajax`){this._rows=[],this._totalRows=0,this._lastPage=0,this._loaded=!1,this._fetching=!1,this._loading=!1,this._fetchData(void 0,!0,this._perPage,0);return}this._rows=Array.isArray(e)?[...e]:[],this._totalRows=this._rows.length,this._lastPage=Math.max(1,Math.ceil(this._totalRows/this._perPage)),this._loaded=!0,this._fetching=!1,this._loading=!1,this.render()}}_parseConfiguration(){let e=this.getAttribute(`configuration`);if(!e){console.error(`mint-resource-table: configuration attribute is required`);return}try{this._configuration=JSON.parse(e),this._tableId=this._configuration.id||this._tableId||`mint-resource-table-${Date.now()}`,this._perPage=this._configuration.perPage||15,this._type=typeof this._configuration.data==`string`?`ajax`:`provided`,this._loaded=!1,this._currentPage=this._getPageFromUrl()||1,this._offset=(this._currentPage-1)*this._perPage,this._type===`provided`&&Array.isArray(this._configuration.data)&&(this._rows=[...this._configuration.data],this._totalRows=this._configuration.data.length),this._initializeColumns()}catch(e){console.error(`mint-resource-table: Invalid configuration JSON`,e)}}_initializeColumns(){this._configuration&&(this._searchColumns=[],this._exportColumns={},this._columns=[],this._configuration.columns.forEach(e=>{e.searchable&&e.data&&this._searchColumns.push(e.data),e.export&&e.data&&(this._exportColumns[e.data]=e.label),e.data&&this._columns.push(e.data)}),this._configuration.sortBy||(this._configuration.sortBy=`id`),this._configuration.sort||(this._configuration.sort=`asc`))}async _fetchData(e,t=!0,n,r){if(!this._configuration)return;let i=e||(typeof this._configuration.data==`string`?this._configuration.data:null);if(!i||this._fetching||this._loading)return;t&&(this._fetching=!0,this._loaded?this._updatePagination():this.render()),this._loading=!0;let a=n||this._perPage,o=r===void 0?this._offset:r;this._virtualScrollActive()&&this._type===`ajax`&&o===0&&(this._virtualFetchGeneration++,this._virtualRowCache.clear(),this._virtualInvalidate());try{let e=new URLSearchParams({perPage:a.toString(),offset:o.toString(),search:this._search,sortBy:this._configuration.sortBy||`id`,sort:this._configuration.sort||`asc`,searchColumns:this._searchColumns.join(`,`),columns:this._columns.join(`,`)}),t={};this._configuration.headers&&(t.headers=this._configuration.headers);let n=await fetch(`${i}?${e.toString()}`,t);if(!n.ok)throw Error(`HTTP error! status: ${n.status}`);let r=await n.json(),s=r.content?.rows||[],c=r.content?.total||0,l=s;this._configuration.predefinedData?(l=[...this._configuration.predefinedData,...s],this._totalRows=c+this._configuration.predefinedData.length):this._totalRows=c,this._rows=l;let u=Math.floor(o/a)+1;r.content?.current_page!==void 0&&r.content.current_page===u?this._currentPage=r.content.current_page:this._currentPage=u,this._offset=(this._currentPage-1)*a,this._lastPage=r.content?.last_page||1,this._fetching=!1,this._loaded=!0,this._loading=!1,this._fetchError=null,this._searching=!1;let d=this._sorting;this._sorting=!1,this._sortingColumnData=null,this.dispatchEvent(new CustomEvent(`loaded`,{detail:{rows:this._rows}})),this._updateSearchIcon();let f=`tbody[data-mint-rt-tbody="${this._tableId}"]`,p=!!this.querySelector(f);if(this._virtualScrollActive()&&this._type===`ajax`){p||this.render(),s.forEach((e,t)=>{this._virtualRowCache.set(o+t,e)}),this._virtualInvalidate(),o===0?queueMicrotask(()=>this._scrollVirtualTableTopIntoView()):this._scheduleVirtualWindowSync();let e=this._loadingPage;this._loadingPage=null,this._updatePagination(),e!==null&&this._schedulePaginatedFirstRowIntoView(),setTimeout(()=>{let e=this._paginationMountedRoot();e&&e.querySelectorAll(`mint-button[data-action="page"]`).forEach(e=>{`render`in e&&typeof e.render==`function`&&e.render()})},0)}else if(this.querySelector(`#${this._tableId}`)?.closest(`table`)?.querySelector(`tbody`)){if(d){let e=this._loading,t=this._fetching;this._loading=!1,this._fetching=!1,this._updateTableBody(),this._loading=e,this._fetching=t}else this._updateTableBody();let e=this._loadingPage;this._loadingPage=null,this._updatePagination(),e!==null&&this._schedulePaginatedFirstRowIntoView(),setTimeout(()=>{let e=this._paginationMountedRoot();e&&e.querySelectorAll(`mint-button[data-action="page"]`).forEach(e=>{`render`in e&&typeof e.render==`function`&&e.render()})},0)}else this.render();d&&this._updateSortIcons()}catch(e){this._fetching=!1,this._loading=!1,this._loadingPage=null,this._loaded=!0,this._searching=!1,this._fetchError=e instanceof Error?e.message:`Failed to fetch data`,console.error(`mint-resource-table: Error fetching data`,e),this._sorting&&(this._sorting=!1,this._sortingColumnData=null,this._updateSortIcons()),this._updateSearchIcon(),this.querySelector(`#${this._tableId}`)?.closest(`table`)?.querySelector(`tbody`)?(this._updateTableBody(),this._loadingPage=null,this._updatePagination()):this.render()}}_getRows(){if(!this._configuration)return[];if(this._type===`ajax`)return this._rows;let e=[...this._rows],t=this._configuration.sortBy||`id`,n=this._configuration.sort||`asc`;if(this._search){let t=this._search.toLowerCase().trim().split(/\s+/);e=e.filter(e=>{let n=Object.values(e).map(e=>String(e).toLowerCase()).join(` `);return t.every(e=>n.includes(e))})}if(e.sort((e,r)=>{let i=e[t],a=r[t];if(i==null&&a==null)return 0;if(i==null)return 1;if(a==null)return-1;let o=typeof i==`number`?i:typeof i==`string`&&!isNaN(Number(i))&&i.trim()!==``?Number(i):null,s=typeof a==`number`?a:typeof a==`string`&&!isNaN(Number(a))&&a.trim()!==``?Number(a):null;if(o!==null&&s!==null){let e=o-s;return n===`asc`?e:-e}let c=i instanceof Date?i:typeof i==`string`?new Date(i):null,l=a instanceof Date?a:typeof a==`string`?new Date(a):null;if(c&&l&&!isNaN(c.getTime())&&!isNaN(l.getTime())){let e=c.getTime()-l.getTime();return n===`asc`?e:-e}let u=String(i).localeCompare(String(a),void 0,{numeric:!0,sensitivity:`base`});return n===`asc`?u:-u}),this._perPage){let t=Math.ceil(e.length/this._perPage);this._lastPage=t,e.forEach((e,t)=>{e.page=Math.ceil((t+1)/this._perPage)}),this._currentPage>t&&t>0&&(this._currentPage=t)}return e.filter(e=>!this._perPage||e.page===this._currentPage)}_getAllFilteredRowsSorted(){if(!this._configuration||this._type!==`provided`)return[];let e=[...this._rows],t=this._configuration.sortBy||`id`,n=this._configuration.sort||`asc`;if(this._search){let t=this._search.toLowerCase().trim().split(/\s+/);e=e.filter(e=>{let n=Object.values(e).map(e=>String(e).toLowerCase()).join(` `);return t.every(e=>n.includes(e))})}return e.sort((e,r)=>{let i=e[t],a=r[t];if(i==null&&a==null)return 0;if(i==null)return 1;if(a==null)return-1;let o=typeof i==`number`?i:typeof i==`string`&&!isNaN(Number(i))&&i.trim()!==``?Number(i):null,s=typeof a==`number`?a:typeof a==`string`&&!isNaN(Number(a))&&a.trim()!==``?Number(a):null;if(o!==null&&s!==null){let e=o-s;return n===`asc`?e:-e}let c=i instanceof Date?i:typeof i==`string`?new Date(i):null,l=a instanceof Date?a:typeof a==`string`?new Date(a):null;if(c&&l&&!isNaN(c.getTime())&&!isNaN(l.getTime())){let e=c.getTime()-l.getTime();return n===`asc`?e:-e}let u=String(i).localeCompare(String(a),void 0,{numeric:!0,sensitivity:`base`});return n===`asc`?u:-u}),e}_virtualInvalidate(){this._virtualLastRangeStart=-1,this._virtualLastRangeEnd=-1,this._virtualLastRangeCacheSig=``}_getRowDataForEventIndex(e){if(this._configuration){if(!this._virtualScrollActive())return this._getRows()[e];if(this._type===`provided`)return this._getAllFilteredRowsSorted()[e];if(this._type===`ajax`)return this._virtualRowCache.get(e)}}getRowByIndex(e){return this._getRowDataForEventIndex(e)}_virtualScrollActive(){return this._configuration?(this.getAttribute(`virtual-scroll`)||``).toLowerCase().trim()===`true`:!1}_virtualScrollRoot(){let e=(this.getAttribute(`virtual-scroll-root`)||``).toLowerCase().trim();return e===`table-body`||e===`body`||this._configuration?.virtualScrollRoot===`table-body`?`table-body`:`document`}_virtualBodyScrollDisablesDocumentFixedChrome(){return this._virtualScrollActive()&&this._virtualScrollRoot()===`table-body`}_fixedHeader(){if(this._virtualBodyScrollDisablesDocumentFixedChrome()||!this.hasAttribute(`fixed-header`))return!1;let e=(this.getAttribute(`fixed-header`)||``).toLowerCase().trim();return e!==`false`&&e!==`0`}_fixedControls(){if(this._virtualBodyScrollDisablesDocumentFixedChrome()||!this.hasAttribute(`fixed-controls`))return!1;let e=(this.getAttribute(`fixed-controls`)||``).toLowerCase().trim();return e!==`false`&&e!==`0`}_virtualRowHeightPx(){let e=parseInt(this.getAttribute(`virtual-row-height`)||``,10);if(!isNaN(e)&&e>0)return e;let t=this._configuration?.virtualRowHeight;return typeof t==`number`&&t>0?t:48}_virtualRowHeightPxForSync(e){let t=this._virtualRowHeightPx();if(!this._configuration)return t;if(e){let e=this._mobileThumbnailColumn();if(e){let n=this._thumbnailMobilePx(e);return Math.max(t,n+36)}return Math.max(t,64)}let n=this._mobileThumbnailColumn();if(n){let e=this._thumbnailDesktopPx(n);return Math.max(t,e+28)}return t}_virtualMaxHeightCss(){let e=this.getAttribute(`virtual-max-height`);if(e&&e.trim())return e.trim();let t=this._configuration?.virtualMaxHeight;return t&&String(t).trim()?String(t).trim():`min(70dvh, 28rem)`}_virtualColspan(){return this._configuration?Math.max(1,this._configuration.columns.filter(e=>!e.hidden).length):1}_ensureMobileListMql(){typeof window>`u`||!window.matchMedia||this._mobileListMql||(this._mobileListMql=window.matchMedia(`(max-width: 767px)`),this._boundMobileListMqlListener=()=>{this._configuration&&this.isConnected&&this.render()},this._mobileListMql.addEventListener(`change`,this._boundMobileListMqlListener))}_detachMobileListMql(){this._mobileListMql&&this._boundMobileListMqlListener&&this._mobileListMql.removeEventListener(`change`,this._boundMobileListMqlListener),this._mobileListMql=null,this._boundMobileListMqlListener=null}_useMobileListLayout(){return!!this._mobileListMql?.matches}_paginationHostPlaceholderHtml(){if(!this._configuration?.perPage||this._virtualScrollActive())return``;let e=this._lastPage||Math.ceil(this._rows.length/this._perPage);if((this._lastPage>0?this._lastPage:e)<=1)return``;let t=[`mint-rt-pagination-host`,`w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain`,`flex justify-center [-webkit-overflow-scrolling:touch] md:justify-end`,this._inMintCard?`border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider md:border-t-0 md:pt-0`:`border-t border-gray-200 px-2 py-3 dark:border-mint-divider md:border-t-0 md:py-0 md:mt-4`].join(` `);return`<div id="mint-rt-pagination-host-${this._tableId}" data-mint-rt-pagination-wrap="" class="${t}"></div>`}_getPaginationHostEl(){return this.querySelector(`#mint-rt-pagination-host-${this._tableId}`)}_paginationMountedRoot(){return this._getPaginationHostEl()||this.querySelector(`nav[data-mint-rt-pagination-nav]`)?.parentElement||this.querySelector(`nav`)?.closest(`.flex.justify-end`)}_paginationPageButtonLi(e){let t=this._currentPage===e,n=this._loadingPage===e;return`<li class="shrink-0"><mint-button variant="solid" size="sm"${t?` active="true"`:``}${this._loading||this._fetching?` disabled="true"`:``}${n?` loading="true"`:``} data-action="page" data-page="${e}">${n?``:`${e}`}</mint-button></li>`}_paginationHtmlCompactMiddle(e){let t=``,n=this._currentPage;if(e<=5){for(let n=1;n<=e;n++)t+=this._paginationPageButtonLi(n);return t}let r=[...new Set([1,e,n-1,n,n+1].map(t=>Math.min(e,Math.max(1,t))))].sort((e,t)=>e-t),i=0;for(let e of r)i>0&&e-i>1&&(t+=`<li class="shrink-0"><span class="px-1 text-gray-500 dark:text-gray-400" aria-hidden="true">…</span></li>`),t+=this._paginationPageButtonLi(e),i=e;return t}_paginationHtmlDesktopMiddle(e){let t=``,n=e>=10,r=Math.max(1,this._currentPage-1),i=Math.min(e,this._currentPage+1);if(n){for(let e=1;e<=3;e++)t+=this._paginationPageButtonLi(e);let n=i<=3,a=r>=e-2;if(!n&&!a){r>4&&(t+=`<li class="shrink-0"><span class="px-2">...</span></li>`);for(let e=r;e<=i;e++)e<=3||(t+=this._paginationPageButtonLi(e));i<e-3&&(t+=`<li class="shrink-0"><span class="px-2">...</span></li>`)}else (n&&!a||!n&&a&&e-2>4)&&(t+=`<li class="shrink-0"><span class="px-2">...</span></li>`);for(let o=e-2;o<=e;o++)o<=3||!n&&!a&&o>=r&&o<=i||(t+=this._paginationPageButtonLi(o))}else for(let n=1;n<=e;n++)t+=this._paginationPageButtonLi(n);return t}_buildPaginationNavMarkup(e){let t=this._currentPage===1||this._loading||this._fetching,n=`<nav data-mint-rt-pagination-nav="" class="w-max max-w-none shrink-0" aria-label="Pagination">`;n+=`<ul class="flex flex-nowrap items-center gap-1">`,n+=`<li class="shrink-0"><mint-button variant="solid" size="sm" icon="caret-left" ${t?`disabled="true"`:``} data-action="page-prev"></mint-button></li>`,n+=this._useMobileListLayout()?this._paginationHtmlCompactMiddle(e):this._paginationHtmlDesktopMiddle(e);let r=this._currentPage>=e||this._loading||this._fetching;return n+=`<li class="shrink-0"><mint-button variant="solid" size="sm" icon="caret-right" ${r?`disabled="true"`:``} data-action="page-next"></mint-button></li>`,n+=`</ul></nav>`,n}_hasSortableColumns(){return!!this._configuration?.columns.some(e=>!e.hidden&&e.sortable&&e.data)}_getMobileSortTriggerIconName(){return`sort-arrows`}_mobileSortPopoverAffordanceInnerHtml(e){return e===`spinner`?`<span class="inline-block h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700 dark:border-gray-600 dark:border-t-gray-200" aria-hidden="true"></span>`:e===`caret-up`||e===`caret-down`?`<svg class="mint-resource-table-mobile-sort-caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${e===`caret-up`?`m6 15 6-6 6 6`:`m6 9 6 6 6-6`}"></path></svg>`:``}_getMobileSortClass(e){return this._getSortClass(e)}_buildMobileSortPopoverInnerHtml(){if(!this._configuration)return``;let e=`<div class="flex w-full min-w-[11rem] flex-col gap-0.5 p-1">`;return this._configuration.columns.forEach((t,n)=>{if(t.hidden||!t.sortable||!t.data)return;let r=t.raw?t.label:this._escapeHtml(t.label),i=this._getMobileSortClass(t),a=this._mobileSortPopoverAffordanceInnerHtml(i),o=` type="button" variant="ghost" tone="neutral" full-width="true" align="left" data-action="mobile-sort" data-column-key="${n}"`;e+=`<mint-button${o}>`,e+=`<span class="flex w-full min-w-0 flex-1 items-center justify-between gap-2">`,e+=`<span class="min-w-0 flex-1 truncate text-left text-base font-normal">${r}</span>`,e+=`<span class="inline-flex shrink-0 items-center justify-end" data-mint-rt-mobile-sort-affordance="">${a}</span>`,e+=`</span></mint-button>`}),e+=`</div>`,e}_syncMobileSortPopoverIcons(){if(!this._configuration)return;let e=this.querySelector(`#mint-rt-mobile-sort-popover-${this._tableId}`);e&&this._configuration.columns.forEach((t,n)=>{if(t.hidden||!t.sortable||!t.data)return;let r=e.querySelector(`[data-action="mobile-sort"][data-column-key="${n}"]`);if(!r||r.tagName!==`MINT-BUTTON`)return;let i=r.querySelector(`[data-mint-rt-mobile-sort-affordance]`);if(!i)return;let a=this._getMobileSortClass(t);i.innerHTML=this._mobileSortPopoverAffordanceInnerHtml(a),i.querySelectorAll(`mint-icon`).forEach(e=>{let t=e;typeof t.render==`function`&&t.render()})})}_closeMobileSortPopover(){let e=this.querySelector(`#mint-rt-mobile-sort-popover-${this._tableId}`);e&&typeof e.close==`function`?e.close():e&&e.removeAttribute(`open`)}_buildMobileSortToolbarHtml(){if(!this._hasSortableColumns())return``;let e=`mint-rt-mobile-sort-btn-${this._tableId}`,t=`mint-rt-mobile-sort-popover-${this._tableId}`,n=this._sorting?` loading="true"`:``,r=` icon="${this._escapeHtml(this._getMobileSortTriggerIconName())}"`,i=`<div class="flex shrink-0 items-center md:hidden">`;return i+=`<mint-button id="${e}" data-mint-rt-toolbar="mobile-sort" variant="solid" tone="neutral" size="sm"${n}${r}></mint-button>`,i+=`<mint-popover id="${t}" trigger-id="${e}" direction="down" padding="0">`,i+=this._buildMobileSortPopoverInnerHtml(),i+=`</mint-popover></div>`,i}_stripHtml(e){if(!e)return``;let t=document.createElement(`div`);return t.innerHTML=e,(t.textContent||t.innerText||``).replace(/\s+/g,` `).trim()}_visibleDataColumns(){return this._configuration?this._configuration.columns.filter(e=>!e.hidden):[]}_mobileThumbnailColumn(){return this._visibleDataColumns().find(e=>e.thumbnail)||null}_thumbnailDesktopPx(e){let t=typeof e.thumbnailDesktopPx==`number`&&e.thumbnailDesktopPx>0?e.thumbnailDesktopPx:void 0,n=this._configuration,r=n&&typeof n.thumbnailDesktopPx==`number`&&n.thumbnailDesktopPx>0?n.thumbnailDesktopPx:void 0;return Math.round(t??r??40)}_thumbnailMobilePx(e){let t=typeof e.thumbnailMobilePx==`number`&&e.thumbnailMobilePx>0?e.thumbnailMobilePx:void 0,n=this._configuration,r=n&&typeof n.thumbnailMobilePx==`number`&&n.thumbnailMobilePx>0?n.thumbnailMobilePx:void 0;return Math.round(t??r??56)}_wrapThumbnailDesktopBox(e,t){let n=this._thumbnailDesktopPx(t),r=`width:${n}px;height:${n}px;min-width:${n}px;min-height:${n}px`;return`<div class="${t.align===`center`?`mx-auto`:``} flex shrink-0 items-stretch overflow-hidden rounded-md border border-gray-200 bg-gray-100 p-0 dark:border-mint-divider dark:bg-mint-hover [&>*]:m-0 [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:w-full [&>*]:max-w-full [&>*]:p-0 [&>span]:flex [&>span]:h-full [&>span]:w-full [&>span]:min-h-0 [&>span]:min-w-0 [&>span]:items-stretch [&>span]:justify-stretch [&_img]:!m-0 [&_img]:!box-border [&_img]:!block [&_img]:!h-full [&_img]:!w-full [&_img]:!min-h-0 [&_img]:!min-w-0 [&_img]:!max-h-full [&_img]:!max-w-full [&_img]:!border-0 [&_img]:!p-0 [&_img]:!rounded-none [&_img]:!object-cover [&_img]:!object-center" style="${r}">${e}</div>`}_mobilePrimaryColumn(){let e=this._visibleDataColumns();return e.find(e=>e.primary)||e.find(e=>(e.data||typeof e.format==`function`)&&!e.thumbnail&&!e.actions)||e[0]||null}_mobileActionsDropdownColumn(){return this._visibleDataColumns().find(e=>e.actions&&e.actionStyle!==`buttons`)||null}_columnPlainSummaryText(e,t){if(!(!e.show||e.show(this,t))||e.actions||e.action)return``;try{if(e.raw){if(typeof e.format==`function`)return this._stripHtml(e.format(this,t));if(e.data)return String(t[e.data]??``)}else{if(typeof e.format==`function`)return this._stripHtml(e.format(this,t));if(e.data)return String(t[e.data]??``)}}catch{return``}return``}_buildTableCellInnerHtml(e,t,n,r=`table`){if(!this._configuration)return``;let i=n,a=``;if(!(!e.show||e.show(this,t)))return``;if(e.raw)if(e.action){if(!e.action.show||e.action.show(this,t)){let n=typeof e.action.label==`function`?e.action.label(this,t):e.action.label;a+=`<mint-button variant="solid" data-action="column-action" data-row-index="${i}" data-column-key="${this._configuration.columns.indexOf(e)}">${this._escapeHtml(String(n))}</mint-button>`}}else if(e.actions)if(e.actionStyle!==`buttons`){let n=`actions-popover-${this._tableId}-${i}`,r=`actions-button-${this._tableId}-${i}`;a+=`<mint-button id="${r}" variant="ghost" icon="ellipsis">`,a+=`</mint-button>`,a+=`<mint-popover id="${n}" trigger-id="${r}" direction="down">`,a+=`<div class="mint-resource-action-menu">`,e.actions.forEach((n,r)=>{if(!n.show||n.show(this,t)){let o=typeof n.label==`function`?n.label(this,t):n.label,s=n.icon?` icon="${this._escapeHtml(n.icon)}"`:``,c=n.variant?this._escapeHtml(n.variant):`ghost`,l=n.tone?` tone="${this._escapeHtml(n.tone)}"`:``,u=(typeof n.active==`function`?n.active(this,t):n.active)?` active="true"`:``;a+=`<mint-button variant="${c}" full-width="true" align="left" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}${u}>${this._escapeHtml(String(o??``))}</mint-button>`}}),a+=`</div>`,a+=`</mint-popover>`}else e.actions.forEach((n,r)=>{if(!n.show||n.show(this,t)){let o=n.label?typeof n.label==`function`?n.label(this,t):n.label:``,s=n.icon?` icon="${this._escapeHtml(n.icon)}"`:``,c=n.variant?` variant="${this._escapeHtml(n.variant)}"`:` variant="ghost"`,l=n.tone?` tone="${this._escapeHtml(n.tone)}"`:``,u=(typeof n.active==`function`?n.active(this,t):n.active)?` active="true"`:``;a+=`<mint-button${c} class="${n.classes||``}" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}${u}>`,o&&(a+=this._escapeHtml(String(o))),a+=`</mint-button>`}});else typeof e.format==`function`?a+=e.format(this,t):e.data&&(a+=this._escapeHtml(String(t[e.data]||``)));else if(e.action)(!e.action.show||e.action.show(this,t))&&(a+=`<mint-button variant="solid" data-action="column-action" data-row-index="${i}" data-column-key="${this._configuration.columns.indexOf(e)}">${e.action.label}</mint-button>`);else if(e.actions)if(e.actionStyle!==`buttons`){let n=`actions-popover-${this._tableId}-${i}`,r=`actions-button-${this._tableId}-${i}`;a+=`<mint-button id="${r}" variant="ghost" icon="ellipsis">`,a+=`</mint-button>`,a+=`<mint-popover id="${n}" trigger-id="${r}" direction="down">`,a+=`<div class="mint-resource-action-menu">`,e.actions.forEach((n,r)=>{if(!n.show||n.show(this,t)){let o=typeof n.label==`function`?n.label(this,t):n.label,s=n.icon?` icon="${this._escapeHtml(n.icon)}"`:``,c=n.variant?this._escapeHtml(n.variant):`ghost`,l=n.tone?` tone="${this._escapeHtml(n.tone)}"`:``,u=(typeof n.active==`function`?n.active(this,t):n.active)?` active="true"`:``;a+=`<mint-button variant="${c}" full-width="true" align="left" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}${u}>${this._escapeHtml(String(o??``))}</mint-button>`}}),a+=`</div>`,a+=`</mint-popover>`}else e.actions.forEach((n,r)=>{if(!n.show||n.show(this,t)){let o=n.label?typeof n.label==`function`?n.label(this,t):n.label:``,s=n.icon?` icon="${this._escapeHtml(n.icon)}"`:``,c=n.variant?` variant="${this._escapeHtml(n.variant)}"`:` variant="ghost"`,l=n.tone?` tone="${this._escapeHtml(n.tone)}"`:``,u=(typeof n.active==`function`?n.active(this,t):n.active)?` active="true"`:``;a+=`<mint-button${c} class="${n.classes||``}" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}${u}>`,o&&(a+=this._escapeHtml(String(o))),a+=`</mint-button>`}});else typeof e.format==`function`?a+=this._escapeHtml(e.format(this,t)):e.data&&(a+=this._escapeHtml(String(t[e.data]||``)));return r===`table`&&e.thumbnail&&a&&!e.actions&&!e.action?this._wrapThumbnailDesktopBox(a,e):a}_buildMobileListItemHtml(e,t,n=!1){if(!this._configuration)return``;let r=t,i=typeof this._configuration.onRowClick==`function`,a=this._mobileThumbnailColumn(),o=this._mobilePrimaryColumn(),s=this._mobileActionsDropdownColumn(),c=a?this._buildTableCellInnerHtml(a,e,r,`mobile`):``,l=o?this._buildTableCellInnerHtml(o,e,r,`mobile`):``,u=s?this._buildTableCellInnerHtml(s,e,r,`mobile`):``,d=[],f=this._configuration.mobileShowLabels===!0;for(let t of this._configuration.columns){if(t.hidden||a&&t===a||o&&t===o||s&&t===s)continue;let n=this._columnPlainSummaryText(t,e);if(n)if(f){let e=this._stripHtml(String(t.label||``)).trim();e?d.push(`${this._escapeHtml(e)}: ${this._escapeHtml(n)}`):d.push(this._escapeHtml(n))}else d.push(this._escapeHtml(n))}let p=d.join(`<span class="text-gray-300 dark:text-gray-600" aria-hidden="true"> · </span>`),m=[`list-none`,`mint-resource-table-mobile-row`,...n?[]:[`border-b`,`border-gray-200`,`dark:border-mint-divider`],i?`cursor-pointer`:``].filter(Boolean).join(` `),h=`<div class="flex items-center gap-3 py-3 pr-4${a?` pl-0`:` pl-4`}">`;if(a){let e=this._thumbnailMobilePx(a),t=`width:${e}px;height:${e}px;min-width:${e}px;min-height:${e}px`;h+=`<div class="flex shrink-0 items-stretch overflow-hidden rounded-md border border-gray-200 bg-gray-100 p-0 dark:border-mint-divider dark:bg-mint-hover [&>*]:m-0 [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:w-full [&>*]:max-w-full [&>*]:p-0 [&>span]:flex [&>span]:h-full [&>span]:w-full [&>span]:min-h-0 [&>span]:min-w-0 [&>span]:items-stretch [&>span]:justify-stretch [&_img]:!m-0 [&_img]:!box-border [&_img]:!block [&_img]:!h-full [&_img]:!w-full [&_img]:!min-h-0 [&_img]:!min-w-0 [&_img]:!max-h-full [&_img]:!max-w-full [&_img]:!border-0 [&_img]:!p-0 [&_img]:!rounded-none [&_img]:!object-cover [&_img]:!object-center" style="${t}">${c}</div>`}return h+=`<div class="flex min-w-0 flex-1 flex-col justify-center gap-1 mint-resource-table-mobile-content">`,h+=`<div class="flex items-start justify-between gap-2 mint-resource-table-mobile-primary-row">`,h+=`<div class="min-w-0 text-sm font-semibold leading-snug text-gray-900 dark:text-white mint-resource-table-mobile-primary">${l}</div>`,u&&(h+=`<div class="shrink-0 -mr-1 mint-resource-table-mobile-actions">${u}</div>`),h+=`</div>`,p&&(h+=`<div class="text-xs font-normal leading-snug text-gray-500 dark:text-gray-400 mint-resource-table-mobile-meta">${p}</div>`),h+=`</div></div>`,`<li data-row-index="${r}" ${i?`data-row-clickable="true" `:``}class="${m}">${h}</li>`}_buildMobileListPlaceholderLi(e,t,n=!1){let r=this._mobileThumbnailColumn(),i=r?this._thumbnailMobilePx(r):56,a=`width:${i}px;height:${i}px;min-width:${i}px;min-height:${i}px`;return`<li data-row-index="${e}" data-mint-rt-placeholder="true" class="list-none${n?``:` border-b border-gray-200 dark:border-mint-divider`} bg-white dark:bg-mint-canvas" style="box-sizing:border-box;min-height:${t}px;max-height:${t}px;height:${t}px;overflow:hidden"><div class="flex h-full min-h-0 items-center gap-3 py-3 pl-0 pr-4"><div class="shrink-0 overflow-hidden rounded-md bg-gray-200 dark:bg-white/15" style="${a}"></div><div class="flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 py-0.5"><div class="h-4 w-40 rounded bg-gray-200 dark:bg-white/15"></div><div class="h-3 w-full max-w-xs rounded bg-gray-200 dark:bg-white/15"></div></div></div></li>`}_renderColgroupHtml(){if(!this._configuration)return``;let e=this._configuration.columns.filter(e=>!e.hidden),t=[],n=0;for(let r of e){let e=r.width==null?``:String(r.width).trim();e?/^\d+(\.\d+)?$/.test(e)?(n+=parseFloat(e),t.push(`px`)):t.push(`lit`):t.push(`flex`)}let r=t.filter(e=>e===`flex`).length,i=t.includes(`lit`),a=``;r>0&&!i&&(a=n>0?`width:calc((100% - ${n}px) / ${r});min-width:0`:`width:${100/r}%;min-width:0`);let o=`<colgroup>`;return e.forEach((e,n)=>{let r=e.width==null?``:String(e.width).trim(),i=t[n],s=``;i===`px`?s=` style="width:${r}px;min-width:0"`:i===`lit`?s=` style="width:${this._escapeHtml(r)};min-width:0"`:a&&(s=` style="${a}"`),o+=`<col${s} />`}),o+=`</colgroup>`,o}_buildDataRowHtml(e,t,n=!1){if(!this._configuration)return``;let r=t,i=``,a=typeof this._configuration.onRowClick==`function`,o=a?`cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800`:``,s=a?` data-row-clickable="true"`:``,c=o?` class="${o}"`:``;return i+=`<tr data-row-index="${r}"${n?` data-mint-rt-last-row=""`:``}${s}${c}>`,this._configuration.columns.forEach(t=>{if(t.hidden)return;let n=!t.show||t.show(this,e),a=`${this._getStyle(t)}box-sizing:border-box;vertical-align:middle;`;i+=`<td style="${a}" class="${this._getClasses(t,!0)}">`,i+=n?this._buildTableCellInnerHtml(t,e,r):``,i+=`</td>`}),i+=`</tr>`,i}_getVirtualRowCount(){return!this._virtualScrollActive()||!this._configuration?0:this._type===`provided`?this._getAllFilteredRowsSorted().length:this._type===`ajax`?this._totalRows:0}_getVirtualRowAt(e){return this._type===`provided`?this._getAllFilteredRowsSorted()[e]??null:this._type===`ajax`&&this._virtualRowCache.has(e)?this._virtualRowCache.get(e):null}_buildVirtualPlaceholderRowHtml(e,t,n=!1){if(!this._configuration)return``;let r=t,i=`box-sizing:border-box;min-height:${r}px;max-height:${r}px;height:${r}px;overflow:hidden`,a=`<tr data-row-index="${e}" data-mint-rt-placeholder="true"${n?` data-mint-rt-last-row=""`:``} class="bg-white dark:bg-mint-canvas" style="${i}">`;return this._configuration.columns.forEach(e=>{if(e.hidden)return;let t=`${this._getStyle(e)}box-sizing:border-box;max-height:${r}px;height:${r}px;overflow:hidden;vertical-align:middle;line-height:0;`;if(a+=`<td style="${t}" class="${this._getClasses(e,!0)}">`,e.thumbnail){let t=this._thumbnailDesktopPx(e);a+=`<div class="rounded-md bg-gray-200 dark:bg-white/15" style="width:${t}px;height:${t}px;max-width:100%;box-sizing:border-box"></div>`}else a+=`<div class="h-4 max-w-[95%] rounded bg-gray-200 dark:bg-white/15"></div>`;a+=`</td>`}),a+=`</tr>`,a}_virtualScrollStickyOverlapPx(e){let t=0;if(this._fixedControls()){let e=this.querySelector(`#mint-rt-fixed-controls-${this._tableId}`);if(e)t+=Math.ceil(e.getBoundingClientRect().height);else{let e=getComputedStyle(this).getPropertyValue(`--mint-rt-fixed-controls-h`).trim(),n=parseFloat(e);isNaN(n)||(t+=Math.ceil(n))}}if(this._fixedHeader()&&e){let n=e.querySelector(`thead`);n&&(t+=Math.ceil(n.getBoundingClientRect().height))}return t}_scrollVirtualTableTopIntoView(){if(!(!this._virtualScrollActive()||!this.isConnected)){if(this._virtualScrollRoot()===`table-body`){let e=this._virtualBodyScrollEl?.isConnected?this._virtualBodyScrollEl:this.querySelector(`#mint-rt-vscroll-${this._tableId}`);this._useMobileListLayout()&&e&&e.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`);let t=e?.querySelector(`mint-table.table-section`)||e?.querySelector(`mint-table`),n=t?.querySelector(`#${this._tableId}`)?.closest(`table`)||t?.querySelector(`table`);this._virtualScrollStickyOverlapPx(n),e&&(e.scrollTop=0,this._virtualBodyScrollEl=e,this._virtualInvalidate(),this._scheduleVirtualWindowSync());return}this._virtualInvalidate(),this._scheduleVirtualWindowSync()}}_scheduleVirtualWindowSync(){this._virtualScrollActive()&&this._virtualWindowRaf===null&&(this._virtualWindowRaf=window.requestAnimationFrame(()=>{this._virtualWindowRaf=null,this._syncVirtualWindow()}))}_syncVirtualWindow(){if(!this._virtualScrollActive()||!this._configuration)return;let e=this._useMobileListLayout(),t=this.querySelector(`tbody[data-mint-rt-tbody="${this._tableId}"]`),n=this.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`),r=e?n:t;if(!r)return;let i=this._getVirtualRowCount(),a=this._virtualRowHeightPxForSync(e),o=this._virtualColspan();if(i===0){e?this._fetchError?r.innerHTML=`<li class="list-none px-4 py-8 text-center text-sm text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</li>`:r.innerHTML=`<li class="list-none px-4 py-8 text-center text-sm">No records found.</li>`:this._fetchError?r.innerHTML=`<tr><td colspan="${o}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>`:r.innerHTML=`<tr><td colspan="${o}" class="text-center py-8">No records found.</td></tr>`,this._virtualLastRangeStart=-1,this._virtualLastRangeEnd=-1,this._virtualLastRangeCacheSig=``;return}let s=0,c=window.innerHeight;if(this._virtualScrollRoot()===`table-body`){let e=this._virtualBodyScrollEl;if((!e||!e.isConnected)&&(e=this.querySelector(`#mint-rt-vscroll-${this._tableId}`),this._virtualBodyScrollEl=e),!e)return;s=e.scrollTop,c=e.clientHeight||400}else{let e=r.getBoundingClientRect();s=Math.max(0,-e.top)}let l=Math.min(Math.max(0,Math.floor(s/a)),Math.max(0,i-1)),u=Math.ceil(c/a)+16,d=Math.max(0,l-8),f=Math.min(i,l+u),p=``;if(this._type===`ajax`)for(let e=d;e<f;e++)p+=this._virtualRowCache.has(e)?`1`:`0`;if(d===this._virtualLastRangeStart&&f===this._virtualLastRangeEnd&&(this._type!==`ajax`||p===this._virtualLastRangeCacheSig))return;this._virtualLastRangeStart=d,this._virtualLastRangeEnd=f,this._virtualLastRangeCacheSig=p;let m=d*a,h=Math.max(0,(i-f)*a),g=``;if(e){g+=`<li aria-hidden="true" class="pointer-events-none m-0 block list-none border-0 p-0" style="height:${m}px"></li>`;for(let e=d;e<f;e++){let t=this._getVirtualRowAt(e),n=i>0&&e===i-1;t?g+=this._buildMobileListItemHtml(t,e,n):g+=this._buildMobileListPlaceholderLi(e,a,n)}g+=`<li aria-hidden="true" class="pointer-events-none m-0 block list-none border-0 p-0" style="height:${h}px"></li>`}else{g+=`<tr data-mint-rt-spacer="top" aria-hidden="true"><td colspan="${o}" style="height:${m}px;padding:0;border:0;line-height:0;font-size:0"></td></tr>`;for(let e=d;e<f;e++){let t=this._getVirtualRowAt(e),n=i>0&&e===i-1;t?g+=this._buildDataRowHtml(t,e,n):g+=this._buildVirtualPlaceholderRowHtml(e,a,n)}g+=`<tr data-mint-rt-spacer="bottom" aria-hidden="true"><td colspan="${o}" style="height:${h}px;padding:0;border:0;line-height:0;font-size:0"></td></tr>`}if(r.innerHTML=g,this.querySelectorAll(`tbody[data-mint-rt-tbody="${this._tableId}"] mint-button[data-action], ul[data-mint-rt-mobile-list="${this._tableId}"] mint-button[data-action]`).forEach(e=>{e.render&&e.render()}),this._attachTableEventListeners(),this._attachRowClickHandler(),this._type===`ajax`&&this._virtualScrollActive()&&this._scheduleVirtualAjaxPrefetch(d,f),this._virtualScrollRoot()===`table-body`&&!e){let e=this._virtualBodyScrollEl;e?.isConnected&&requestAnimationFrame(()=>{if(!e.isConnected)return;let t=Math.max(0,e.scrollHeight-e.clientHeight);e.scrollTop>t&&(e.scrollTop=t)})}}_detachVirtualScroll(){this._virtualScrollHandler&&=(window.removeEventListener(`scroll`,this._virtualScrollHandler),this._virtualBodyScrollEl?.removeEventListener(`scroll`,this._virtualScrollHandler),null),this._virtualWindowResizeHandler&&=(window.removeEventListener(`resize`,this._virtualWindowResizeHandler),null),this._virtualResizeObserver&&=(this._virtualResizeObserver.disconnect(),null),this._virtualBodyScrollEl=null,this._disposeVirtualBodyFade?.(),this._disposeVirtualBodyFade=null,this._virtualWindowRaf!==null&&(window.cancelAnimationFrame(this._virtualWindowRaf),this._virtualWindowRaf=null),this._virtualLastRangeStart=-1,this._virtualLastRangeEnd=-1,this._virtualLastRangeCacheSig=``,this._virtualAjaxPrefetchTimer!==null&&(window.clearTimeout(this._virtualAjaxPrefetchTimer),this._virtualAjaxPrefetchTimer=null),this._virtualRangeFetching=!1}_scheduleVirtualAjaxPrefetch(e,t){if(this._type!==`ajax`||!this._virtualScrollActive()||!this._configuration)return;let n=!1;for(let r=e;r<t;r++)if(!this._virtualRowCache.has(r)){n=!0;break}if(!n)return;this._virtualAjaxPrefetchTimer!==null&&window.clearTimeout(this._virtualAjaxPrefetchTimer);let r=e,i=t;this._virtualAjaxPrefetchTimer=window.setTimeout(()=>{this._virtualAjaxPrefetchTimer=null,this._fetchVirtualAjaxRange(r,i-r)},60)}async _fetchVirtualAjaxRange(e,t){if(!this._configuration||this._type!==`ajax`||!this._virtualScrollActive())return;let n=typeof this._configuration.data==`string`?this._configuration.data:null;if(!n||t<=0||this._virtualRangeFetching||e<0||e>=this._totalRows)return;this._virtualRangeFetching=!0;let r=this._virtualFetchGeneration,i=Math.min(e,Math.max(0,this._totalRows-1)),a=Math.min(150,Math.max(this._perPage,t,15),Math.max(1,this._totalRows-i));try{let e=new URLSearchParams({perPage:a.toString(),offset:i.toString(),search:this._search,sortBy:this._configuration.sortBy||`id`,sort:this._configuration.sort||`asc`,searchColumns:this._searchColumns.join(`,`),columns:this._columns.join(`,`)}),t={};this._configuration.headers&&(t.headers=this._configuration.headers);let o=await fetch(`${n}?${e.toString()}`,t);if(!o.ok)throw Error(`HTTP error! status: ${o.status}`);let s=await o.json();if(r!==this._virtualFetchGeneration)return;(s.content?.rows||[]).forEach((e,t)=>{let n=i+t;n<this._totalRows&&this._virtualRowCache.set(n,e)})}catch(e){console.error(`mint-resource-table: virtual range fetch failed`,e)}finally{this._virtualRangeFetching=!1,r===this._virtualFetchGeneration&&(this._virtualInvalidate(),this._scheduleVirtualWindowSync())}}_detachFixedChromeResize(){this._fixedChromeResizeObserver?.disconnect(),this._fixedChromeResizeObserver=null,this.style.removeProperty(`--mint-rt-fixed-controls-h`)}_syncFixedControlsChromeHeight(){if(!this._fixedHeader()||!this._fixedControls())return;this._fixedChromeResizeObserver?.disconnect(),this._fixedChromeResizeObserver=null;let e=this.querySelector(`#mint-rt-fixed-controls-${this._tableId}`);if(!e)return;let t=()=>{let t=Math.ceil(e.getBoundingClientRect().height);this.style.setProperty(`--mint-rt-fixed-controls-h`,`${t}px`)};t(),this._fixedChromeResizeObserver=new ResizeObserver(t),this._fixedChromeResizeObserver.observe(e)}_attachVirtualScrollListeners(){if(this._detachVirtualScroll(),!this._virtualScrollActive())return;let e=()=>{this._scheduleVirtualWindowSync()};this._virtualScrollHandler=e,this._virtualScrollRoot()===`table-body`?(this._virtualBodyScrollEl=this.querySelector(`#mint-rt-vscroll-${this._tableId}`),this._virtualBodyScrollEl&&(this._disposeVirtualBodyFade=t.n(this._virtualBodyScrollEl,`vertical`)),this._virtualBodyScrollEl?.addEventListener(`scroll`,e,{passive:!0}),this._virtualBodyScrollEl&&typeof ResizeObserver<`u`&&(this._virtualResizeObserver=new ResizeObserver(()=>this._scheduleVirtualWindowSync()),this._virtualResizeObserver.observe(this._virtualBodyScrollEl))):window.addEventListener(`scroll`,e,{passive:!0}),this._virtualWindowResizeHandler=()=>this._scheduleVirtualWindowSync(),window.addEventListener(`resize`,this._virtualWindowResizeHandler,{passive:!0}),this._scheduleVirtualWindowSync()}_toggleSort(e){if(!this._configuration||!e.data||!e.sortable)return;let t=e.data;if(this._sortTimeoutId!==null&&(clearTimeout(this._sortTimeoutId),this._sortTimeoutId=null),this._sorting=!0,this._sortingColumnData=t.toLowerCase(),this._updateSortIcons(),this._type===`ajax`)this._sortTimeoutId=window.setTimeout(()=>{if(this._sortTimeoutId=null,!this._configuration||!t||!e.sortable)return;let n=this._configuration.sort||`asc`;this._configuration.sortBy?.toLowerCase()===t.toLowerCase()&&(n=n===`desc`?`asc`:`desc`),this._configuration.sort=n,this._configuration.sortBy=t,this._updateSortIcons(),this._offset=0,this._currentPage=1,this._updatePageInUrl(1),this._fetching=!1,this._loading=!1,this._fetchData(void 0,!1,this._perPage,0)},10);else{let e=this._configuration.sort||`asc`;this._configuration.sortBy?.toLowerCase()===t.toLowerCase()&&(e=e===`desc`?`asc`:`desc`),this._configuration.sort=e,this._configuration.sortBy=t,this._currentPage=1,this._updatePageInUrl(1),this._sorting=!1,this._sortingColumnData=null,this._updateSortIcons(),this.render(),this._virtualScrollActive()&&queueMicrotask(()=>this._scrollVirtualTableTopIntoView())}}_getSortClass(e){return this._sorting&&this._sortingColumnData===e.data?.toLowerCase()?`spinner`:this._configuration?.sortBy?.toLowerCase()===e.data?.toLowerCase()?this._configuration?.sort?.toLowerCase()===`desc`?`caret-down`:`caret-up`:``}_updateSortIcons(){if(!this._configuration)return;this._configuration.columns.forEach((e,t)=>{if(!e.sortable||e.hidden)return;let n=this.querySelector(`th[data-column-key="${t}"]`);if(!n)return;let r=n.querySelector(`:scope > [data-mint-rt-sort-label]`);if(!r)return;let i=r.querySelector(`:scope > [data-mint-rt-sort-icon]`),a=this._getSortClass(e),o=()=>{if(!i){let e=document.createElement(`div`);e.className=`ml-2 flex items-center`,e.setAttribute(`data-mint-rt-sort-icon`,``),r.appendChild(e),i=e}return i},s=()=>{i&&=(i.remove(),null)};if(a===`spinner`){let e=o();e.firstElementChild?.tagName!==`MINT-SPINNER`&&(e.innerHTML=`<mint-spinner class="w-4 h-4"></mint-spinner>`)}else if(a===`caret-up`||a===`caret-down`){let e=o(),t=e.firstElementChild;(t?.tagName!==`MINT-ICON`||t.getAttribute(`name`)!==a)&&(e.innerHTML=`<mint-icon name="${a}" class="w-4 h-4"></mint-icon>`)}else s()}),this._syncMobileSortPopoverIcons();let e=this.querySelector(`#mint-rt-mobile-sort-btn-${this._tableId}`);e&&(e.setAttribute(`icon`,this._getMobileSortTriggerIconName()),this._sorting?e.setAttribute(`loading`,`true`):e.removeAttribute(`loading`),typeof e.render==`function`&&e.render())}_showFetchingState(){}_triggerSearch(){this._searchTimeoutId&&clearTimeout(this._searchTimeoutId),this._searching=!0,this._type===`ajax`&&this._updateSearchIcon(),this._type!==`ajax`&&(this._currentPage=1,this._updatePageInUrl(1)),this._updateTableBody(),this._type!==`ajax`&&this._updatePagination(),this._searchTimeoutId=window.setTimeout(()=>{this._type===`ajax`?(this._offset=0,this._currentPage=1,this._updatePageInUrl(1),this._fetchData(void 0,!1,this._perPage,0)):(this._searching=!1,this._virtualScrollActive()&&queueMicrotask(()=>this._scrollVirtualTableTopIntoView()))},400)}_updateSearchIcon(){let e=this.querySelector(`#search-${this._tableId}`);if(!e)return;let t=this._type===`ajax`&&(this._searching||this._fetching);setTimeout(()=>{let n=e.querySelector(`.relative`)||e.querySelector(`div`);if(!n)return;let r=n.querySelector(`mint-icon`),i=n.querySelector(`mint-spinner`);if(t){if(r&&!i){let e=document.createElement(`mint-spinner`);e.className=`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none`,r.replaceWith(e)}else if(!r&&!i){let e=document.createElement(`mint-spinner`);e.className=`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none`,n.appendChild(e)}}else if(i){e.getAttribute(`icon`)||e.setAttribute(`icon`,`search`);let t=document.createElement(`mint-icon`);t.setAttribute(`name`,`search`),t.className=`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none`,i.replaceWith(t)}},0)}_updateTableBody(){if(!this._configuration)return;let e=this.querySelector(`tbody[data-mint-rt-tbody="${this._tableId}"]`),t=this.querySelector(`#${this._tableId}`)?.closest(`table`)?.querySelector(`tbody`);if(this._virtualScrollActive()&&(this._type===`provided`||this._type===`ajax`)){if(!(e||t)){this.render();return}let n=this.querySelector(`#search-${this._tableId}`),r=document.activeElement===n||n?.querySelector(`input`)===document.activeElement,i=this._search;if((this._fetching||this._loading)&&!this._loaded&&!this._sorting)return;if(this._virtualInvalidate(),this._syncVirtualWindow(),r&&n){let e=n.querySelector(`input`)||n._element;e?(e.value=i,setTimeout(()=>{e.focus(),e.setSelectionRange(i.length,i.length)},0)):n.value!==void 0&&(n.value=i,setTimeout(()=>{n.focus()},0))}return}let n=this._getRows(),r=t;if(!r){this.render();return}let i=this.querySelector(`#search-${this._tableId}`),a=document.activeElement===i||i?.querySelector(`input`)===document.activeElement,o=this._search,s=``,c=``;if((this._fetching||this._loading)&&!this._loaded&&!this._sorting)return;n.forEach((e,t)=>{c+=this._buildMobileListItemHtml(e,t,t===n.length-1);let r=typeof this._configuration.onRowClick==`function`,i=r?`cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800`:``;s+=`<tr data-row-index="${t}" ${r?`data-row-clickable="true"`:``}${i?` class="${i}"`:``}>`,this._configuration.columns.forEach(n=>{if(n.hidden)return;let r=!n.show||n.show(this,e);s+=`<td style="${this._getStyle(n)}" class="${this._getClasses(n,!0)}">`,r&&(s+=this._buildTableCellInnerHtml(n,e,t,`table`)),s+=`</td>`}),s+=`</tr>`}),n.length===0&&(this._fetchError?(s+=`<tr><td colspan="${this._configuration.columns.filter(e=>!e.hidden).length}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>`,c+=`<li class="list-none px-4 py-8 text-center text-sm text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</li>`):(s+=`<tr><td colspan="${this._configuration.columns.filter(e=>!e.hidden).length}" class="text-center py-8">No records found.</td></tr>`,c+=`<li class="list-none px-4 py-8 text-center text-sm">No records found.</li>`)),r.innerHTML=s;let l=this.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`);if(l&&(l.innerHTML=c),this._attachTableEventListeners(),this._attachRowClickHandler(),a&&i){let e=i.querySelector(`input`)||i._element;e?(e.value=o,setTimeout(()=>{e.focus(),e.setSelectionRange(o.length,o.length)},0)):i.value!==void 0&&(i.value=o,setTimeout(()=>{i.focus()},0))}}_updatePagination(){if(!this._configuration)return;let e=this._lastPage||Math.ceil(this._rows.length/this._perPage),t=()=>{let e=this.querySelector(`mint-table`),t=e?.nextElementSibling;e&&t&&t.id!==`mint-rt-pagination-host-${this._tableId}`&&!t.classList.contains(`mint-rt-pagination-host`)&&t.querySelector?.(`[data-action="page"]`)&&t.remove()};if(!this._configuration.perPage||e<=1||this._virtualScrollActive()){this._getPaginationHostEl()?.replaceChildren(),t();return}let n=this._getPaginationHostEl();if(!n){let e=this.querySelector(`[data-mint-rt-mobile-list="${this._tableId}"]`)||this.querySelector(`mint-table`);if(!e){this.render();return}n=document.createElement(`div`),n.id=`mint-rt-pagination-host-${this._tableId}`,n.setAttribute(`data-mint-rt-pagination-wrap`,``),n.className=`mint-rt-pagination-host w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain flex justify-center [-webkit-overflow-scrolling:touch] md:justify-end `+(this._inMintCard?`border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider md:border-t-0 md:pt-0`:`border-t border-gray-200 px-2 py-3 dark:border-mint-divider md:border-t-0 md:py-0 md:mt-4`),e.insertAdjacentElement(`afterend`,n)}let r=this._buildPaginationNavMarkup(e);n.innerHTML=r,setTimeout(()=>{this._attachPaginationListeners(),n.querySelectorAll(`mint-button[data-action="page"]`).forEach(e=>{let t=e.getAttribute(`data-page`),n=t&&this._loadingPage===parseInt(t),r=e._button||e.querySelector(`button`);if(r)if(n){let e=[],t=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null),n;for(;n=t.nextNode();)e.push(n);e.forEach(e=>e.parentNode?.removeChild(e));let i=r.querySelector(`.mint-button-content`);if(i){let e=i.textContent?.trim();e&&/^\d+$/.test(e)&&i.remove()}let a=r.querySelector(`span.mr-2`);a&&a.querySelector(`mint-spinner`)&&(a.classList.remove(`mr-2`),a.classList.add(`mr-0`))}else{let e=r.textContent?.trim();if(!e||!/^\d+$/.test(e)){let e=t||``,n=r.querySelector(`mint-spinner`);r.innerHTML=``,n&&r.appendChild(n),r.appendChild(document.createTextNode(e))}}if(`render`in e&&typeof e.render==`function`&&(e.render(),n&&r)){let e=r.querySelector(`span.mr-2`);e&&e.querySelector(`mint-spinner`)&&(e.classList.remove(`mr-2`),e.classList.add(`mr-0`))}}),n.querySelectorAll(`mint-button[data-action="page-prev"], mint-button[data-action="page-next"]`).forEach(e=>{`render`in e&&typeof e.render==`function`&&e.render()}),this._loadingPage!==null&&!this._loading&&!this._fetching&&this._updatePagination()},0)}_goToPage(e){let t=this._lastPage||Math.ceil(this._rows.length/this._perPage);e>t&&(e=t),e<1&&(e=1),e!==this._currentPage&&(this._currentPage=e,this._offset=(e-1)*this._perPage,this._updatePageInUrl(e),this._type===`ajax`?(this._loadingPage=e,this._updatePagination(),this._fetchData()):(this.render(),this._schedulePaginatedFirstRowIntoView()))}_schedulePaginatedFirstRowIntoView(){requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!this.isConnected)return;let e=this._useMobileListLayout()?this.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`):null,t=this.querySelector(`#${this._tableId}`)?.closest(`table`),n=e?.querySelector(`:scope > li`)||t?.querySelector(`tbody tr[data-row-index="0"]`);if(!n)return;let r=this._virtualScrollStickyOverlapPx(t),i=this._findVerticalScrollContainer(n),a=n.getBoundingClientRect();if(i){let e=i.getBoundingClientRect();i.scrollTo({top:i.scrollTop+a.top-e.top-r-8,behavior:`smooth`})}else window.scrollTo({top:Math.max(0,window.scrollY+a.top-r-8),behavior:`smooth`})}))}_findVerticalScrollContainer(e){let t=e.parentElement;for(;t&&t!==document.body&&t!==document.documentElement;){let e=getComputedStyle(t).overflowY;if(/(auto|scroll|overlay)/.test(e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}_handleButtonClick(e){if(this._configuration)switch(e.type){case`export`:break;case`print`:window.print();break;case`csv`:this._downloadCSV();break;default:e.onClick&&e.onClick(this);break}}_toolbarButtonsHtml(e){let t=(this._configuration?.buttons||[]).map((e,t)=>({button:e,index:t})).filter(({button:t})=>(t.position||`right`)===e);return t.length?`<div class="flex shrink-0 items-center gap-2">${t.map(({button:e,index:t})=>{let n=e.icon?` icon="${this._escapeHtml(e.icon)}"`:``,r=e.tone?` tone="${this._escapeHtml(e.tone)}"`:``,i=e.icon===`plus`?`solid`:e.variant||`solid`,a=this._escapeHtml(i),o=this._escapeHtml(e.class||``),s=e.ariaLabel?` aria-label="${this._escapeHtml(e.ariaLabel)}"`:``;return`<mint-button variant="${a}" class="${o}" data-button-type="${this._escapeHtml(e.type||`custom`)}" data-button-index="${t}"${n}${r}${s}>${e.label?this._escapeHtml(e.label):``}</mint-button>`}).join(``)}</div>`:``}_downloadCSV(){if(!this._configuration)return;let e=this.querySelector(`#${this._tableId}`)||this.querySelector(`table`);if(!e)return;let t=`data:text/csv;charset=utf-8,`,n=e=>{let n=[];e.querySelectorAll(`th, td`).forEach(e=>{let t=e.getAttribute(`colspan`);if(t)for(let e=0;e<parseInt(t,10)-1;e++)n.push(``);n.push(`"`+e.textContent?.trim().replace(/"/g,`""`)+`"`)}),t+=n.join(`,`)+`
|
|
1
|
+
require(`../chunks/icon-CGXHKbMq.js`);const e=require(`../chunks/register-element-tCL_F1YI.js`);require(`../chunks/icon-Cfhjb8tV.js`),require(`../chunks/spinner-DfPbEa2d.js`),require(`../chunks/button-9OkdUt6p.js`),require(`../chunks/input-CNG7PaSY.js`),require(`../chunks/caret-down-BfBLwx6q.js`),require(`../chunks/popover-wGdggZ-a.js`);const t=require(`../chunks/ScrollFade-DT2Br2g7.js`);require(`../chunks/search-Ce29Aglb.js`),require(`../chunks/table-vjF3q3J5.js`);var n={"-mr-1":`rtu-8956a4275`,"-translate-y-1/2":`rtu-36b381be4`,"[&>*]:m-0":`rtu-7b41b3d11`,"[&>*]:max-w-full":`rtu-ba23a8c34`,"[&>*]:min-h-0":`rtu-860618883`,"[&>*]:min-w-0":`rtu-85a48d872`,"[&>*]:p-0":`rtu-299511c44`,"[&>*]:w-full":`rtu-d26168286`,"[&>span]:flex":`rtu-684665eca`,"[&>span]:h-full":`rtu-e4b40d71e`,"[&>span]:items-stretch":`rtu-d7d251fc2`,"[&>span]:justify-stretch":`rtu-86ed0d205`,"[&>span]:min-h-0":`rtu-f145dfde7`,"[&>span]:min-w-0":`rtu-0a6cfb970`,"[&>span]:w-full":`rtu-85ca68177`,"[&_img]:!block":`rtu-83fb557c2`,"[&_img]:!border-0":`rtu-2288f2d07`,"[&_img]:!box-border":`rtu-9253a17e4`,"[&_img]:!h-full":`rtu-07505e4a3`,"[&_img]:!m-0":`rtu-52565be3c`,"[&_img]:!max-h-full":`rtu-9b7f93d32`,"[&_img]:!max-w-full":`rtu-690df1880`,"[&_img]:!min-h-0":`rtu-a6c91024c`,"[&_img]:!min-w-0":`rtu-249d05caa`,"[&_img]:!object-center":`rtu-c24cf3532`,"[&_img]:!object-cover":`rtu-5c4ff5239`,"[&_img]:!p-0":`rtu-45a528345`,"[&_img]:!rounded-none":`rtu-6b1008ffa`,"[&_img]:!w-full":`rtu-ce262d06f`,"[-webkit-overflow-scrolling:touch]":`rtu-66a5833b4`,absolute:`rtu-da4dbfbc4`,"align-baseline":`rtu-8d378d3b6`,"animate-pulse":`rtu-d59b97947`,"animate-spin":`rtu-afbdd13a3`,"bg-gray-100":`rtu-d260f3e1b`,"bg-gray-200":`rtu-fcf159058`,"bg-white":`rtu-5e10cdb8f`,block:`rtu-0214b4b35`,border:`rtu-ca6bcd4b6`,"border-0":`rtu-119b2aa0b`,"border-2":`rtu-65935df57`,"border-b":`rtu-65fdbade2`,"border-collapse":`rtu-4583f90cd`,"border-gray-200":`rtu-534158080`,"border-gray-300":`rtu-5ab1f191a`,"border-t":`rtu-b950dda29`,"border-t-gray-700":`rtu-2f99a0daf`,"box-border":`rtu-7906320e4`,"cursor-pointer":`rtu-345168367`,"dark:bg-mint-canvas":`rtu-91530d570`,"dark:bg-mint-hover":`rtu-f3646e34b`,"dark:bg-mint-nav":`rtu-ef1a5fba7`,"dark:bg-white/15":`rtu-2a035a254`,"dark:border-gray-600":`rtu-17b5ca3ec`,"dark:border-mint-divider":`rtu-785e12750`,"dark:border-t-gray-200":`rtu-d1e9bc81b`,"dark:hover:bg-gray-800":`rtu-c211aa745`,"dark:hover:bg-mint-elevated":`rtu-e02bea78e`,"dark:text-gray-400":`rtu-cd05fca6d`,"dark:text-gray-500":`rtu-cae7d218d`,"dark:text-gray-600":`rtu-916f092fc`,"dark:text-red-400":`rtu-150dc4530`,"dark:text-white":`rtu-889e4e871`,fixed:`rtu-7bc555991`,flex:`rtu-60fbb7713`,"flex-1":`rtu-36e579c0b`,"flex-col":`rtu-8dddea077`,"flex-nowrap":`rtu-51ecff099`,"font-normal":`rtu-8ecebc9f8`,"font-semibold":`rtu-e83a7042b`,"gap-0.5":`rtu-a3899220f`,"gap-1":`rtu-44ee8ba0a`,"gap-2":`rtu-77a2a20e9`,"gap-3":`rtu-1004c0c39`,"h-3":`rtu-6a60c09e6`,"h-4":`rtu-11e59c6d5`,"h-full":`rtu-668b21aa5`,hidden:`rtu-99d72c7fc`,"hover:bg-gray-50":`rtu-6c0fe2c8e`,"inline-block":`rtu-bb0c4bfc5`,"inline-flex":`rtu-52083e7da`,"items-center":`rtu-3960ffc24`,"items-start":`rtu-60541e1e2`,"items-stretch":`rtu-a13d486c1`,"justify-between":`rtu-8ef2268ef`,"justify-center":`rtu-86843cf1e`,"justify-end":`rtu-77c08e015`,"leading-snug":`rtu-e25ca6535`,"left-3":`rtu-22e59b722`,"list-none":`rtu-b20d79b23`,"m-0":`rtu-74f9876a6`,"max-w-[95%]":`rtu-80fa57ccf`,"max-w-none":`rtu-2191c1456`,"max-w-xs":`rtu-3acf64d53`,"mb-3":`rtu-1bb883263`,"md:block":`rtu-9d60be3a6`,"md:border-t-0":`rtu-f6099fc6b`,"md:hidden":`rtu-e477a6af4`,"md:justify-end":`rtu-70ce0294b`,"md:mt-4":`rtu-ef9aeb563`,"md:pt-0":`rtu-30dec114f`,"md:py-0":`rtu-3957f1b8e`,"min-h-0":`rtu-fb7302e53`,"min-w-0":`rtu-7e0b7cdf1`,"min-w-[11rem]":`rtu-46b2fd2eb`,"ml-2":`rtu-c68af9986`,"mr-0":`rtu-719fceda9`,"mr-2":`rtu-d2347e849`,"mx-auto":`rtu-0e12dc7de`,"overflow-hidden":`rtu-2cd02d11d`,"overflow-x-auto":`rtu-1384f66f4`,"overflow-x-hidden":`rtu-e271e6ae1`,"overflow-y-auto":`rtu-92bf82f49`,"overflow-y-hidden":`rtu-b70fd23f6`,"overscroll-x-contain":`rtu-63ccdaaca`,"p-0":`rtu-8a539c7fe`,"p-1":`rtu-eb6a3cef9`,"p-3.5":`rtu-56796a90b`,"p-4":`rtu-8e63407b5`,"pb-3.5":`rtu-2d1f72154`,"pl-0":`rtu-d569803f7`,"pointer-events-none":`rtu-a4326536b`,"pr-4":`rtu-ba64a7c03`,"pt-3":`rtu-ce335a8e4`,"px-1":`rtu-d8e0e382c`,"px-2":`rtu-d5eab218a`,"px-3.5":`rtu-e0d9cc7f0`,"px-4":`rtu-f0faeb26d`,"py-0.5":`rtu-465609a24`,"py-2":`rtu-03b4dd7f1`,"py-3":`rtu-1b2d54a3f`,"py-3.5":`rtu-69e76918f`,"py-8":`rtu-a1f611f02`,rounded:`rtu-07389a777`,"rounded-full":`rtu-ac204c108`,"rounded-md":`rtu-421ac2be5`,"rounded-t-none":`rtu-79ee0e356`,"shrink-0":`rtu-012fbd121`,sticky:`rtu-3e0fd166d`,table:`rtu-c3ee137d4`,"table-fixed":`rtu-604d60250`,"text-base":`rtu-4ee734926`,"text-center":`rtu-ca6bf6303`,"text-gray-300":`rtu-5ed47f375`,"text-gray-400":`rtu-a572cdde6`,"text-gray-500":`rtu-5a630e0cf`,"text-gray-900":`rtu-ba48f7479`,"text-left":`rtu-2eba0d65d`,"text-red-500":`rtu-e3f51cc69`,"text-right":`rtu-308fc069e`,"text-sm":`rtu-fc7473ca0`,"text-xs":`rtu-359090c2d`,"top-0":`rtu-2167406b2`,"top-1/2":`rtu-d694ba66e`,truncate:`rtu-f283ea9be`,"w-4":`rtu-dc7972ebf`,"w-40":`rtu-84789e8a2`,"w-full":`rtu-6da6a3c3f`,"w-max":`rtu-2f935d2ee`,"z-10":`rtu-236812d64`,"z-20":`rtu-145745bf5`,"z-30":`rtu-0f2fff0ae`},r=class extends HTMLElement{static get observedAttributes(){return[`configuration`,`loading`,`virtual-scroll`,`virtual-scroll-root`,`virtual-row-height`,`virtual-max-height`,`fixed-header`,`fixed-controls`]}_isExternalLoading(){let e=this.getAttribute(`loading`);return e!==null&&e!==`false`}constructor(){super(),this._configuration=null,this._rows=[],this._search=``,this._currentPage=1,this._perPage=15,this._totalRows=0,this._lastPage=0,this._offset=0,this._loaded=!1,this._fetching=!1,this._loading=!1,this._loadingPage=null,this._fetchError=null,this._searching=!1,this._sorting=!1,this._sortingColumnData=null,this._type=`provided`,this._searchTimeoutId=null,this._sortTimeoutId=null,this._searchColumns=[],this._exportColumns={},this._columns=[],this._tableId=``,this._searchInput=null,this._tableContainer=null,this._paginationContainer=null,this._skeletonContainer=null,this._inMintCard=!1,this._virtualBodyScrollEl=null,this._disposeVirtualBodyFade=null,this._virtualScrollHandler=null,this._virtualWindowRaf=null,this._virtualLastRangeStart=-1,this._virtualLastRangeEnd=-1,this._virtualLastRangeCacheSig=``,this._virtualResizeObserver=null,this._virtualWindowResizeHandler=null,this._virtualRowCache=new Map,this._virtualRangeFetching=!1,this._mobileListMql=null,this._boundMobileListMqlListener=null,this._virtualFetchGeneration=0,this._virtualAjaxPrefetchTimer=null,this._fixedChromeResizeObserver=null,this._utilityClassObserver=null}get inMintCard(){return this._inMintCard}get configuration(){return this._configuration}set configuration(e){e&&typeof e==`object`&&!Array.isArray(e)?(this._configuration=e,this._tableId=this._configuration.id||this._tableId||`mint-resource-table-${Date.now()}`,this._perPage=this._configuration.perPage||15,this._type=typeof this._configuration.data==`string`?`ajax`:`provided`,this._loaded=!1,this._currentPage=1,this._offset=0,this._loadPageFromUrl(),this._type===`provided`&&Array.isArray(this._configuration.data)&&(this._rows=[...this._configuration.data],this._totalRows=this._configuration.data.length),this._initializeColumns(),this.isConnected&&this.render()):e==null?this._configuration=null:this._parseConfiguration()}connectedCallback(){this.classList.add(`box-border`,`m-0`,`p-0`,`border-0`,`align-baseline`,`block`,`w-full`),this._utilityClassObserver=new MutationObserver(()=>this._replaceUtilityClasses()),this._utilityClassObserver.observe(this,{attributes:!0,attributeFilter:[`class`],childList:!0,subtree:!0}),this._inMintCard=this.closest(`mint-card`)!==null,this._configuration||this._parseConfiguration(),this._initializeColumns(),this._loadPageFromUrl(),this._attachRowClickHandler(),this.render()}disconnectedCallback(){this._searchTimeoutId&&clearTimeout(this._searchTimeoutId),this._detachVirtualScroll(),this._detachFixedChromeResize(),this._detachMobileListMql(),this._utilityClassObserver?.disconnect(),this._utilityClassObserver=null,this._rowClickHandler&&=(this.removeEventListener(`click`,this._rowClickHandler,!0),null),this._scrollHandler&&=(window.removeEventListener(`scroll`,this._scrollHandler),null)}attributeChangedCallback(e,t,n){e===`configuration`&&t!==n?(!this._configuration||typeof n==`string`)&&(this._parseConfiguration(),this.render()):t!==n&&(e===`loading`||e===`virtual-scroll`||e===`virtual-scroll-root`||e===`virtual-row-height`||e===`virtual-max-height`||e===`fixed-header`||e===`fixed-controls`)&&this._configuration&&this.isConnected&&this.render()}refresh(){this._configuration&&(this._type===`ajax`?this._fetchData(void 0,!0,this._perPage,this._offset):(Array.isArray(this._configuration.data)&&(this._rows=[...this._configuration.data],this._totalRows=this._rows.length),this.render()))}setData(e){if(this._configuration){if(this._configuration.data=e,this._type=typeof e==`string`?`ajax`:`provided`,this._currentPage=1,this._offset=0,this._updatePageInUrl(1),this._fetchError=null,this._searching=!1,this._loadingPage=null,this._sortTimeoutId&&=(clearTimeout(this._sortTimeoutId),null),this._searchTimeoutId&&=(clearTimeout(this._searchTimeoutId),null),this._virtualScrollActive()&&(this._virtualRowCache.clear(),this._virtualInvalidate()),this._type===`ajax`){this._rows=[],this._totalRows=0,this._lastPage=0,this._loaded=!1,this._fetching=!1,this._loading=!1,this._fetchData(void 0,!0,this._perPage,0);return}this._rows=Array.isArray(e)?[...e]:[],this._totalRows=this._rows.length,this._lastPage=Math.max(1,Math.ceil(this._totalRows/this._perPage)),this._loaded=!0,this._fetching=!1,this._loading=!1,this.render()}}_parseConfiguration(){let e=this.getAttribute(`configuration`);if(!e){console.error(`mint-resource-table: configuration attribute is required`);return}try{this._configuration=JSON.parse(e),this._tableId=this._configuration.id||this._tableId||`mint-resource-table-${Date.now()}`,this._perPage=this._configuration.perPage||15,this._type=typeof this._configuration.data==`string`?`ajax`:`provided`,this._loaded=!1,this._currentPage=this._getPageFromUrl()||1,this._offset=(this._currentPage-1)*this._perPage,this._type===`provided`&&Array.isArray(this._configuration.data)&&(this._rows=[...this._configuration.data],this._totalRows=this._configuration.data.length),this._initializeColumns()}catch(e){console.error(`mint-resource-table: Invalid configuration JSON`,e)}}_initializeColumns(){this._configuration&&(this._searchColumns=[],this._exportColumns={},this._columns=[],this._configuration.columns.forEach(e=>{e.searchable&&e.data&&this._searchColumns.push(e.data),e.export&&e.data&&(this._exportColumns[e.data]=e.label),e.data&&this._columns.push(e.data)}),this._configuration.sortBy||(this._configuration.sortBy=`id`),this._configuration.sort||(this._configuration.sort=`asc`))}async _fetchData(e,t=!0,n,r){if(!this._configuration)return;let i=e||(typeof this._configuration.data==`string`?this._configuration.data:null);if(!i||this._fetching||this._loading)return;t&&(this._fetching=!0,this._loaded?this._updatePagination():this.render()),this._loading=!0;let a=n||this._perPage,o=r===void 0?this._offset:r;this._virtualScrollActive()&&this._type===`ajax`&&o===0&&(this._virtualFetchGeneration++,this._virtualRowCache.clear(),this._virtualInvalidate());try{let e=new URLSearchParams({perPage:a.toString(),offset:o.toString(),search:this._search,sortBy:this._configuration.sortBy||`id`,sort:this._configuration.sort||`asc`,searchColumns:this._searchColumns.join(`,`),columns:this._columns.join(`,`)}),t={};this._configuration.headers&&(t.headers=this._configuration.headers);let n=i.includes(`?`)?`&`:`?`,r=await fetch(`${i}${n}${e.toString()}`,t);if(!r.ok)throw Error(`HTTP error! status: ${r.status}`);let s=await r.json(),c=s.content?.rows||[],l=s.content?.total||0,u=c;this._configuration.predefinedData?(u=[...this._configuration.predefinedData,...c],this._totalRows=l+this._configuration.predefinedData.length):this._totalRows=l,this._rows=u;let d=Math.floor(o/a)+1;s.content?.current_page!==void 0&&s.content.current_page===d?this._currentPage=s.content.current_page:this._currentPage=d,this._offset=(this._currentPage-1)*a,this._lastPage=s.content?.last_page||1,this._fetching=!1,this._loaded=!0,this._loading=!1,this._fetchError=null,this._searching=!1;let f=this._sorting;this._sorting=!1,this._sortingColumnData=null,this.dispatchEvent(new CustomEvent(`loaded`,{detail:{rows:this._rows}})),this._updateSearchIcon();let p=`tbody[data-mint-rt-tbody="${this._tableId}"]`,m=!!this.querySelector(p);if(this._virtualScrollActive()&&this._type===`ajax`){m||this.render(),c.forEach((e,t)=>{this._virtualRowCache.set(o+t,e)}),this._virtualInvalidate(),o===0?queueMicrotask(()=>this._scrollVirtualTableTopIntoView()):this._scheduleVirtualWindowSync();let e=this._loadingPage;this._loadingPage=null,this._updatePagination(),e!==null&&this._schedulePaginatedFirstRowIntoView(),setTimeout(()=>{let e=this._paginationMountedRoot();e&&e.querySelectorAll(`mint-button[data-action="page"]`).forEach(e=>{`render`in e&&typeof e.render==`function`&&e.render()})},0)}else if(this.querySelector(`#${this._tableId}`)?.closest(`table`)?.querySelector(`tbody`)){if(f){let e=this._loading,t=this._fetching;this._loading=!1,this._fetching=!1,this._updateTableBody(),this._loading=e,this._fetching=t}else this._updateTableBody();let e=this._loadingPage;this._loadingPage=null,this._updatePagination(),e!==null&&this._schedulePaginatedFirstRowIntoView(),setTimeout(()=>{let e=this._paginationMountedRoot();e&&e.querySelectorAll(`mint-button[data-action="page"]`).forEach(e=>{`render`in e&&typeof e.render==`function`&&e.render()})},0)}else this.render();f&&this._updateSortIcons()}catch(e){this._fetching=!1,this._loading=!1,this._loadingPage=null,this._loaded=!0,this._searching=!1,this._fetchError=e instanceof Error?e.message:`Failed to fetch data`,console.error(`mint-resource-table: Error fetching data`,e),this._sorting&&(this._sorting=!1,this._sortingColumnData=null,this._updateSortIcons()),this._updateSearchIcon(),this.querySelector(`#${this._tableId}`)?.closest(`table`)?.querySelector(`tbody`)?(this._updateTableBody(),this._loadingPage=null,this._updatePagination()):this.render()}}_getRows(){if(!this._configuration)return[];if(this._type===`ajax`)return this._rows;let e=[...this._rows],t=this._configuration.sortBy||`id`,n=this._configuration.sort||`asc`;if(this._search){let t=this._search.toLowerCase().trim().split(/\s+/);e=e.filter(e=>{let n=Object.values(e).map(e=>String(e).toLowerCase()).join(` `);return t.every(e=>n.includes(e))})}if(e.sort((e,r)=>{let i=e[t],a=r[t];if(i==null&&a==null)return 0;if(i==null)return 1;if(a==null)return-1;let o=typeof i==`number`?i:typeof i==`string`&&!isNaN(Number(i))&&i.trim()!==``?Number(i):null,s=typeof a==`number`?a:typeof a==`string`&&!isNaN(Number(a))&&a.trim()!==``?Number(a):null;if(o!==null&&s!==null){let e=o-s;return n===`asc`?e:-e}let c=i instanceof Date?i:typeof i==`string`?new Date(i):null,l=a instanceof Date?a:typeof a==`string`?new Date(a):null;if(c&&l&&!isNaN(c.getTime())&&!isNaN(l.getTime())){let e=c.getTime()-l.getTime();return n===`asc`?e:-e}let u=String(i).localeCompare(String(a),void 0,{numeric:!0,sensitivity:`base`});return n===`asc`?u:-u}),this._perPage){let t=Math.ceil(e.length/this._perPage);this._lastPage=t,e.forEach((e,t)=>{e.page=Math.ceil((t+1)/this._perPage)}),this._currentPage>t&&t>0&&(this._currentPage=t)}return e.filter(e=>!this._perPage||e.page===this._currentPage)}_getAllFilteredRowsSorted(){if(!this._configuration||this._type!==`provided`)return[];let e=[...this._rows],t=this._configuration.sortBy||`id`,n=this._configuration.sort||`asc`;if(this._search){let t=this._search.toLowerCase().trim().split(/\s+/);e=e.filter(e=>{let n=Object.values(e).map(e=>String(e).toLowerCase()).join(` `);return t.every(e=>n.includes(e))})}return e.sort((e,r)=>{let i=e[t],a=r[t];if(i==null&&a==null)return 0;if(i==null)return 1;if(a==null)return-1;let o=typeof i==`number`?i:typeof i==`string`&&!isNaN(Number(i))&&i.trim()!==``?Number(i):null,s=typeof a==`number`?a:typeof a==`string`&&!isNaN(Number(a))&&a.trim()!==``?Number(a):null;if(o!==null&&s!==null){let e=o-s;return n===`asc`?e:-e}let c=i instanceof Date?i:typeof i==`string`?new Date(i):null,l=a instanceof Date?a:typeof a==`string`?new Date(a):null;if(c&&l&&!isNaN(c.getTime())&&!isNaN(l.getTime())){let e=c.getTime()-l.getTime();return n===`asc`?e:-e}let u=String(i).localeCompare(String(a),void 0,{numeric:!0,sensitivity:`base`});return n===`asc`?u:-u}),e}_virtualInvalidate(){this._virtualLastRangeStart=-1,this._virtualLastRangeEnd=-1,this._virtualLastRangeCacheSig=``}_getRowDataForEventIndex(e){if(this._configuration){if(!this._virtualScrollActive())return this._getRows()[e];if(this._type===`provided`)return this._getAllFilteredRowsSorted()[e];if(this._type===`ajax`)return this._virtualRowCache.get(e)}}getRowByIndex(e){return this._getRowDataForEventIndex(e)}_virtualScrollActive(){return this._configuration?(this.getAttribute(`virtual-scroll`)||``).toLowerCase().trim()===`true`:!1}_virtualScrollRoot(){let e=(this.getAttribute(`virtual-scroll-root`)||``).toLowerCase().trim();return e===`table-body`||e===`body`||this._configuration?.virtualScrollRoot===`table-body`?`table-body`:`document`}_virtualBodyScrollDisablesDocumentFixedChrome(){return this._virtualScrollActive()&&this._virtualScrollRoot()===`table-body`}_fixedHeader(){if(this._virtualBodyScrollDisablesDocumentFixedChrome()||!this.hasAttribute(`fixed-header`))return!1;let e=(this.getAttribute(`fixed-header`)||``).toLowerCase().trim();return e!==`false`&&e!==`0`}_fixedControls(){if(this._virtualBodyScrollDisablesDocumentFixedChrome()||!this.hasAttribute(`fixed-controls`))return!1;let e=(this.getAttribute(`fixed-controls`)||``).toLowerCase().trim();return e!==`false`&&e!==`0`}_virtualRowHeightPx(){let e=parseInt(this.getAttribute(`virtual-row-height`)||``,10);if(!isNaN(e)&&e>0)return e;let t=this._configuration?.virtualRowHeight;return typeof t==`number`&&t>0?t:48}_virtualRowHeightPxForSync(e){let t=this._virtualRowHeightPx();if(!this._configuration)return t;if(e){let e=this._mobileThumbnailColumn();if(e){let n=this._thumbnailMobilePx(e);return Math.max(t,n+36)}return Math.max(t,64)}let n=this._mobileThumbnailColumn();if(n){let e=this._thumbnailDesktopPx(n);return Math.max(t,e+28)}return t}_virtualMaxHeightCss(){let e=this.getAttribute(`virtual-max-height`);if(e&&e.trim())return e.trim();let t=this._configuration?.virtualMaxHeight;return t&&String(t).trim()?String(t).trim():`min(70dvh, 28rem)`}_virtualColspan(){return this._configuration?Math.max(1,this._configuration.columns.filter(e=>!e.hidden).length):1}_ensureMobileListMql(){typeof window>`u`||!window.matchMedia||this._mobileListMql||(this._mobileListMql=window.matchMedia(`(max-width: 767px)`),this._boundMobileListMqlListener=()=>{this._configuration&&this.isConnected&&this.render()},this._mobileListMql.addEventListener(`change`,this._boundMobileListMqlListener))}_detachMobileListMql(){this._mobileListMql&&this._boundMobileListMqlListener&&this._mobileListMql.removeEventListener(`change`,this._boundMobileListMqlListener),this._mobileListMql=null,this._boundMobileListMqlListener=null}_useMobileListLayout(){return!!this._mobileListMql?.matches}_paginationHostPlaceholderHtml(){if(!this._configuration?.perPage||this._virtualScrollActive())return``;let e=this._lastPage||Math.ceil(this._rows.length/this._perPage);if((this._lastPage>0?this._lastPage:e)<=1)return``;let t=[`mint-rt-pagination-host`,`w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain`,`flex justify-center [-webkit-overflow-scrolling:touch] md:justify-end`,this._inMintCard?`border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider md:border-t-0 md:pt-0`:`border-t border-gray-200 px-2 py-3 dark:border-mint-divider md:border-t-0 md:py-0 md:mt-4`].join(` `);return`<div id="mint-rt-pagination-host-${this._tableId}" data-mint-rt-pagination-wrap="" class="${t}"></div>`}_getPaginationHostEl(){return this.querySelector(`#mint-rt-pagination-host-${this._tableId}`)}_paginationMountedRoot(){return this._getPaginationHostEl()||this.querySelector(`nav[data-mint-rt-pagination-nav]`)?.parentElement||this.querySelector(`nav`)?.closest(`.flex.justify-end`)}_paginationPageButtonLi(e){let t=this._currentPage===e,n=this._loadingPage===e;return`<li class="shrink-0"><mint-button variant="solid" size="sm"${t?` active="true"`:``}${this._loading||this._fetching?` disabled="true"`:``}${n?` loading="true"`:``} data-action="page" data-page="${e}">${n?``:`${e}`}</mint-button></li>`}_paginationHtmlCompactMiddle(e){let t=``,n=this._currentPage;if(e<=5){for(let n=1;n<=e;n++)t+=this._paginationPageButtonLi(n);return t}let r=[...new Set([1,e,n-1,n,n+1].map(t=>Math.min(e,Math.max(1,t))))].sort((e,t)=>e-t),i=0;for(let e of r)i>0&&e-i>1&&(t+=`<li class="shrink-0"><span class="px-1 text-gray-500 dark:text-gray-400" aria-hidden="true">…</span></li>`),t+=this._paginationPageButtonLi(e),i=e;return t}_paginationHtmlDesktopMiddle(e){let t=``,n=e>=10,r=Math.max(1,this._currentPage-1),i=Math.min(e,this._currentPage+1);if(n){for(let e=1;e<=3;e++)t+=this._paginationPageButtonLi(e);let n=i<=3,a=r>=e-2;if(!n&&!a){r>4&&(t+=`<li class="shrink-0"><span class="px-2">...</span></li>`);for(let e=r;e<=i;e++)e<=3||(t+=this._paginationPageButtonLi(e));i<e-3&&(t+=`<li class="shrink-0"><span class="px-2">...</span></li>`)}else (n&&!a||!n&&a&&e-2>4)&&(t+=`<li class="shrink-0"><span class="px-2">...</span></li>`);for(let o=e-2;o<=e;o++)o<=3||!n&&!a&&o>=r&&o<=i||(t+=this._paginationPageButtonLi(o))}else for(let n=1;n<=e;n++)t+=this._paginationPageButtonLi(n);return t}_buildPaginationNavMarkup(e){let t=this._currentPage===1||this._loading||this._fetching,n=`<nav data-mint-rt-pagination-nav="" class="w-max max-w-none shrink-0" aria-label="Pagination">`;n+=`<ul class="flex flex-nowrap items-center gap-1">`,n+=`<li class="shrink-0"><mint-button variant="solid" size="sm" icon="caret-left" ${t?`disabled="true"`:``} data-action="page-prev"></mint-button></li>`,n+=this._useMobileListLayout()?this._paginationHtmlCompactMiddle(e):this._paginationHtmlDesktopMiddle(e);let r=this._currentPage>=e||this._loading||this._fetching;return n+=`<li class="shrink-0"><mint-button variant="solid" size="sm" icon="caret-right" ${r?`disabled="true"`:``} data-action="page-next"></mint-button></li>`,n+=`</ul></nav>`,n}_hasSortableColumns(){return!!this._configuration?.columns.some(e=>!e.hidden&&e.sortable&&e.data)}_getMobileSortTriggerIconName(){return`sort-arrows`}_mobileSortPopoverAffordanceInnerHtml(e){return e===`spinner`?`<span class="inline-block h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700 dark:border-gray-600 dark:border-t-gray-200" aria-hidden="true"></span>`:e===`caret-up`||e===`caret-down`?`<svg class="mint-resource-table-mobile-sort-caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${e===`caret-up`?`m6 15 6-6 6 6`:`m6 9 6 6 6-6`}"></path></svg>`:``}_getMobileSortClass(e){return this._getSortClass(e)}_buildMobileSortPopoverInnerHtml(){if(!this._configuration)return``;let e=`<div class="flex w-full min-w-[11rem] flex-col gap-0.5 p-1">`;return this._configuration.columns.forEach((t,n)=>{if(t.hidden||!t.sortable||!t.data)return;let r=t.raw?t.label:this._escapeHtml(t.label),i=this._getMobileSortClass(t),a=this._mobileSortPopoverAffordanceInnerHtml(i),o=` type="button" variant="ghost" tone="neutral" full-width="true" align="left" data-action="mobile-sort" data-column-key="${n}"`;e+=`<mint-button${o}>`,e+=`<span class="flex w-full min-w-0 flex-1 items-center justify-between gap-2">`,e+=`<span class="min-w-0 flex-1 truncate text-left text-base font-normal">${r}</span>`,e+=`<span class="inline-flex shrink-0 items-center justify-end" data-mint-rt-mobile-sort-affordance="">${a}</span>`,e+=`</span></mint-button>`}),e+=`</div>`,e}_syncMobileSortPopoverIcons(){if(!this._configuration)return;let e=this.querySelector(`#mint-rt-mobile-sort-popover-${this._tableId}`);e&&this._configuration.columns.forEach((t,n)=>{if(t.hidden||!t.sortable||!t.data)return;let r=e.querySelector(`[data-action="mobile-sort"][data-column-key="${n}"]`);if(!r||r.tagName!==`MINT-BUTTON`)return;let i=r.querySelector(`[data-mint-rt-mobile-sort-affordance]`);if(!i)return;let a=this._getMobileSortClass(t);i.innerHTML=this._mobileSortPopoverAffordanceInnerHtml(a),i.querySelectorAll(`mint-icon`).forEach(e=>{let t=e;typeof t.render==`function`&&t.render()})})}_closeMobileSortPopover(){let e=this.querySelector(`#mint-rt-mobile-sort-popover-${this._tableId}`);e&&typeof e.close==`function`?e.close():e&&e.removeAttribute(`open`)}_buildMobileSortToolbarHtml(){if(!this._hasSortableColumns())return``;let e=`mint-rt-mobile-sort-btn-${this._tableId}`,t=`mint-rt-mobile-sort-popover-${this._tableId}`,n=this._sorting?` loading="true"`:``,r=` icon="${this._escapeHtml(this._getMobileSortTriggerIconName())}"`,i=`<div class="flex shrink-0 items-center md:hidden">`;return i+=`<mint-button id="${e}" data-mint-rt-toolbar="mobile-sort" variant="solid" tone="neutral" size="sm"${n}${r}></mint-button>`,i+=`<mint-popover id="${t}" trigger-id="${e}" direction="down" padding="0">`,i+=this._buildMobileSortPopoverInnerHtml(),i+=`</mint-popover></div>`,i}_stripHtml(e){if(!e)return``;let t=document.createElement(`div`);return t.innerHTML=e,(t.textContent||t.innerText||``).replace(/\s+/g,` `).trim()}_visibleDataColumns(){return this._configuration?this._configuration.columns.filter(e=>!e.hidden):[]}_mobileThumbnailColumn(){return this._visibleDataColumns().find(e=>e.thumbnail)||null}_thumbnailDesktopPx(e){let t=typeof e.thumbnailDesktopPx==`number`&&e.thumbnailDesktopPx>0?e.thumbnailDesktopPx:void 0,n=this._configuration,r=n&&typeof n.thumbnailDesktopPx==`number`&&n.thumbnailDesktopPx>0?n.thumbnailDesktopPx:void 0;return Math.round(t??r??40)}_thumbnailMobilePx(e){let t=typeof e.thumbnailMobilePx==`number`&&e.thumbnailMobilePx>0?e.thumbnailMobilePx:void 0,n=this._configuration,r=n&&typeof n.thumbnailMobilePx==`number`&&n.thumbnailMobilePx>0?n.thumbnailMobilePx:void 0;return Math.round(t??r??56)}_wrapThumbnailDesktopBox(e,t){let n=this._thumbnailDesktopPx(t),r=`width:${n}px;height:${n}px;min-width:${n}px;min-height:${n}px`;return`<div class="${t.align===`center`?`mx-auto`:``} flex shrink-0 items-stretch overflow-hidden rounded-md border border-gray-200 bg-gray-100 p-0 dark:border-mint-divider dark:bg-mint-hover [&>*]:m-0 [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:w-full [&>*]:max-w-full [&>*]:p-0 [&>span]:flex [&>span]:h-full [&>span]:w-full [&>span]:min-h-0 [&>span]:min-w-0 [&>span]:items-stretch [&>span]:justify-stretch [&_img]:!m-0 [&_img]:!box-border [&_img]:!block [&_img]:!h-full [&_img]:!w-full [&_img]:!min-h-0 [&_img]:!min-w-0 [&_img]:!max-h-full [&_img]:!max-w-full [&_img]:!border-0 [&_img]:!p-0 [&_img]:!rounded-none [&_img]:!object-cover [&_img]:!object-center" style="${r}">${e}</div>`}_mobilePrimaryColumn(){let e=this._visibleDataColumns();return e.find(e=>e.primary)||e.find(e=>(e.data||typeof e.format==`function`)&&!e.thumbnail&&!e.actions)||e[0]||null}_mobileActionsDropdownColumn(){return this._visibleDataColumns().find(e=>e.actions&&e.actionStyle!==`buttons`)||null}_columnPlainSummaryText(e,t){if(!(!e.show||e.show(this,t))||e.actions||e.action)return``;try{if(e.raw){if(typeof e.format==`function`)return this._stripHtml(e.format(this,t));if(e.data)return String(t[e.data]??``)}else{if(typeof e.format==`function`)return this._stripHtml(e.format(this,t));if(e.data)return String(t[e.data]??``)}}catch{return``}return``}_buildTableCellInnerHtml(e,t,n,r=`table`){if(!this._configuration)return``;let i=n,a=``;if(!(!e.show||e.show(this,t)))return``;if(e.raw)if(e.action){if(!e.action.show||e.action.show(this,t)){let n=typeof e.action.label==`function`?e.action.label(this,t):e.action.label;a+=`<mint-button variant="solid" data-action="column-action" data-row-index="${i}" data-column-key="${this._configuration.columns.indexOf(e)}">${this._escapeHtml(String(n))}</mint-button>`}}else if(e.actions)if(e.actionStyle!==`buttons`){let n=`actions-popover-${this._tableId}-${i}`,r=`actions-button-${this._tableId}-${i}`;a+=`<mint-button id="${r}" variant="ghost" icon="ellipsis">`,a+=`</mint-button>`,a+=`<mint-popover id="${n}" trigger-id="${r}" direction="down">`,a+=`<div class="mint-resource-action-menu">`,e.actions.forEach((n,r)=>{if(!n.show||n.show(this,t)){let o=typeof n.label==`function`?n.label(this,t):n.label,s=n.icon?` icon="${this._escapeHtml(n.icon)}"`:``,c=n.variant?this._escapeHtml(n.variant):`ghost`,l=n.tone?` tone="${this._escapeHtml(n.tone)}"`:``,u=(typeof n.active==`function`?n.active(this,t):n.active)?` active="true"`:``;a+=`<mint-button variant="${c}" full-width="true" align="left" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}${u}>${this._escapeHtml(String(o??``))}</mint-button>`}}),a+=`</div>`,a+=`</mint-popover>`}else e.actions.forEach((n,r)=>{if(!n.show||n.show(this,t)){let o=n.label?typeof n.label==`function`?n.label(this,t):n.label:``,s=n.icon?` icon="${this._escapeHtml(n.icon)}"`:``,c=n.variant?` variant="${this._escapeHtml(n.variant)}"`:` variant="ghost"`,l=n.tone?` tone="${this._escapeHtml(n.tone)}"`:``,u=(typeof n.active==`function`?n.active(this,t):n.active)?` active="true"`:``;a+=`<mint-button${c} class="${n.classes||``}" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}${u}>`,o&&(a+=this._escapeHtml(String(o))),a+=`</mint-button>`}});else typeof e.format==`function`?a+=e.format(this,t):e.data&&(a+=this._escapeHtml(String(t[e.data]||``)));else if(e.action)(!e.action.show||e.action.show(this,t))&&(a+=`<mint-button variant="solid" data-action="column-action" data-row-index="${i}" data-column-key="${this._configuration.columns.indexOf(e)}">${e.action.label}</mint-button>`);else if(e.actions)if(e.actionStyle!==`buttons`){let n=`actions-popover-${this._tableId}-${i}`,r=`actions-button-${this._tableId}-${i}`;a+=`<mint-button id="${r}" variant="ghost" icon="ellipsis">`,a+=`</mint-button>`,a+=`<mint-popover id="${n}" trigger-id="${r}" direction="down">`,a+=`<div class="mint-resource-action-menu">`,e.actions.forEach((n,r)=>{if(!n.show||n.show(this,t)){let o=typeof n.label==`function`?n.label(this,t):n.label,s=n.icon?` icon="${this._escapeHtml(n.icon)}"`:``,c=n.variant?this._escapeHtml(n.variant):`ghost`,l=n.tone?` tone="${this._escapeHtml(n.tone)}"`:``,u=(typeof n.active==`function`?n.active(this,t):n.active)?` active="true"`:``;a+=`<mint-button variant="${c}" full-width="true" align="left" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}${u}>${this._escapeHtml(String(o??``))}</mint-button>`}}),a+=`</div>`,a+=`</mint-popover>`}else e.actions.forEach((n,r)=>{if(!n.show||n.show(this,t)){let o=n.label?typeof n.label==`function`?n.label(this,t):n.label:``,s=n.icon?` icon="${this._escapeHtml(n.icon)}"`:``,c=n.variant?` variant="${this._escapeHtml(n.variant)}"`:` variant="ghost"`,l=n.tone?` tone="${this._escapeHtml(n.tone)}"`:``,u=(typeof n.active==`function`?n.active(this,t):n.active)?` active="true"`:``;a+=`<mint-button${c} class="${n.classes||``}" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}${u}>`,o&&(a+=this._escapeHtml(String(o))),a+=`</mint-button>`}});else typeof e.format==`function`?a+=this._escapeHtml(e.format(this,t)):e.data&&(a+=this._escapeHtml(String(t[e.data]||``)));return r===`table`&&e.thumbnail&&a&&!e.actions&&!e.action?this._wrapThumbnailDesktopBox(a,e):a}_buildMobileListItemHtml(e,t,n=!1){if(!this._configuration)return``;let r=t,i=typeof this._configuration.onRowClick==`function`,a=this._mobileThumbnailColumn(),o=this._mobilePrimaryColumn(),s=this._mobileActionsDropdownColumn(),c=a?this._buildTableCellInnerHtml(a,e,r,`mobile`):``,l=o?this._buildTableCellInnerHtml(o,e,r,`mobile`):``,u=s?this._buildTableCellInnerHtml(s,e,r,`mobile`):``,d=[],f=this._configuration.mobileShowLabels===!0;for(let t of this._configuration.columns){if(t.hidden||a&&t===a||o&&t===o||s&&t===s)continue;let n=this._columnPlainSummaryText(t,e);if(n)if(f){let e=this._stripHtml(String(t.label||``)).trim();e?d.push(`${this._escapeHtml(e)}: ${this._escapeHtml(n)}`):d.push(this._escapeHtml(n))}else d.push(this._escapeHtml(n))}let p=d.join(`<span class="text-gray-300 dark:text-gray-600" aria-hidden="true"> · </span>`),m=[`list-none`,`mint-resource-table-mobile-row`,...n?[]:[`border-b`,`border-gray-200`,`dark:border-mint-divider`],i?`cursor-pointer`:``].filter(Boolean).join(` `),h=`<div class="flex items-center gap-3 py-3 pr-4${a?` pl-0`:` pl-4`}">`;if(a){let e=this._thumbnailMobilePx(a),t=`width:${e}px;height:${e}px;min-width:${e}px;min-height:${e}px`;h+=`<div class="flex shrink-0 items-stretch overflow-hidden rounded-md border border-gray-200 bg-gray-100 p-0 dark:border-mint-divider dark:bg-mint-hover [&>*]:m-0 [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:w-full [&>*]:max-w-full [&>*]:p-0 [&>span]:flex [&>span]:h-full [&>span]:w-full [&>span]:min-h-0 [&>span]:min-w-0 [&>span]:items-stretch [&>span]:justify-stretch [&_img]:!m-0 [&_img]:!box-border [&_img]:!block [&_img]:!h-full [&_img]:!w-full [&_img]:!min-h-0 [&_img]:!min-w-0 [&_img]:!max-h-full [&_img]:!max-w-full [&_img]:!border-0 [&_img]:!p-0 [&_img]:!rounded-none [&_img]:!object-cover [&_img]:!object-center" style="${t}">${c}</div>`}return h+=`<div class="flex min-w-0 flex-1 flex-col justify-center gap-1 mint-resource-table-mobile-content">`,h+=`<div class="flex items-start justify-between gap-2 mint-resource-table-mobile-primary-row">`,h+=`<div class="min-w-0 text-sm font-semibold leading-snug text-gray-900 dark:text-white mint-resource-table-mobile-primary">${l}</div>`,u&&(h+=`<div class="shrink-0 -mr-1 mint-resource-table-mobile-actions">${u}</div>`),h+=`</div>`,p&&(h+=`<div class="text-xs font-normal leading-snug text-gray-500 dark:text-gray-400 mint-resource-table-mobile-meta">${p}</div>`),h+=`</div></div>`,`<li data-row-index="${r}" ${i?`data-row-clickable="true" `:``}class="${m}">${h}</li>`}_buildMobileListPlaceholderLi(e,t,n=!1){let r=this._mobileThumbnailColumn(),i=r?this._thumbnailMobilePx(r):56,a=`width:${i}px;height:${i}px;min-width:${i}px;min-height:${i}px`;return`<li data-row-index="${e}" data-mint-rt-placeholder="true" class="list-none${n?``:` border-b border-gray-200 dark:border-mint-divider`} bg-white dark:bg-mint-canvas" style="box-sizing:border-box;min-height:${t}px;max-height:${t}px;height:${t}px;overflow:hidden"><div class="flex h-full min-h-0 items-center gap-3 py-3 pl-0 pr-4"><div class="shrink-0 overflow-hidden rounded-md bg-gray-200 dark:bg-white/15" style="${a}"></div><div class="flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 py-0.5"><div class="h-4 w-40 rounded bg-gray-200 dark:bg-white/15"></div><div class="h-3 w-full max-w-xs rounded bg-gray-200 dark:bg-white/15"></div></div></div></li>`}_renderColgroupHtml(){if(!this._configuration)return``;let e=this._configuration.columns.filter(e=>!e.hidden),t=[],n=0;for(let r of e){let e=r.width==null?``:String(r.width).trim();e?/^\d+(\.\d+)?$/.test(e)?(n+=parseFloat(e),t.push(`px`)):t.push(`lit`):t.push(`flex`)}let r=t.filter(e=>e===`flex`).length,i=t.includes(`lit`),a=``;r>0&&!i&&(a=n>0?`width:calc((100% - ${n}px) / ${r});min-width:0`:`width:${100/r}%;min-width:0`);let o=`<colgroup>`;return e.forEach((e,n)=>{let r=e.width==null?``:String(e.width).trim(),i=t[n],s=``;i===`px`?s=` style="width:${r}px;min-width:0"`:i===`lit`?s=` style="width:${this._escapeHtml(r)};min-width:0"`:a&&(s=` style="${a}"`),o+=`<col${s} />`}),o+=`</colgroup>`,o}_buildDataRowHtml(e,t,n=!1){if(!this._configuration)return``;let r=t,i=``,a=typeof this._configuration.onRowClick==`function`,o=a?`cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800`:``,s=a?` data-row-clickable="true"`:``,c=o?` class="${o}"`:``;return i+=`<tr data-row-index="${r}"${n?` data-mint-rt-last-row=""`:``}${s}${c}>`,this._configuration.columns.forEach(t=>{if(t.hidden)return;let n=!t.show||t.show(this,e),a=`${this._getStyle(t)}box-sizing:border-box;vertical-align:middle;`;i+=`<td style="${a}" class="${this._getClasses(t,!0)}">`,i+=n?this._buildTableCellInnerHtml(t,e,r):``,i+=`</td>`}),i+=`</tr>`,i}_getVirtualRowCount(){return!this._virtualScrollActive()||!this._configuration?0:this._type===`provided`?this._getAllFilteredRowsSorted().length:this._type===`ajax`?this._totalRows:0}_getVirtualRowAt(e){return this._type===`provided`?this._getAllFilteredRowsSorted()[e]??null:this._type===`ajax`&&this._virtualRowCache.has(e)?this._virtualRowCache.get(e):null}_buildVirtualPlaceholderRowHtml(e,t,n=!1){if(!this._configuration)return``;let r=t,i=`box-sizing:border-box;min-height:${r}px;max-height:${r}px;height:${r}px;overflow:hidden`,a=`<tr data-row-index="${e}" data-mint-rt-placeholder="true"${n?` data-mint-rt-last-row=""`:``} class="bg-white dark:bg-mint-canvas" style="${i}">`;return this._configuration.columns.forEach(e=>{if(e.hidden)return;let t=`${this._getStyle(e)}box-sizing:border-box;max-height:${r}px;height:${r}px;overflow:hidden;vertical-align:middle;line-height:0;`;if(a+=`<td style="${t}" class="${this._getClasses(e,!0)}">`,e.thumbnail){let t=this._thumbnailDesktopPx(e);a+=`<div class="rounded-md bg-gray-200 dark:bg-white/15" style="width:${t}px;height:${t}px;max-width:100%;box-sizing:border-box"></div>`}else a+=`<div class="h-4 max-w-[95%] rounded bg-gray-200 dark:bg-white/15"></div>`;a+=`</td>`}),a+=`</tr>`,a}_virtualScrollStickyOverlapPx(e){let t=0;if(this._fixedControls()){let e=this.querySelector(`#mint-rt-fixed-controls-${this._tableId}`);if(e)t+=Math.ceil(e.getBoundingClientRect().height);else{let e=getComputedStyle(this).getPropertyValue(`--mint-rt-fixed-controls-h`).trim(),n=parseFloat(e);isNaN(n)||(t+=Math.ceil(n))}}if(this._fixedHeader()&&e){let n=e.querySelector(`thead`);n&&(t+=Math.ceil(n.getBoundingClientRect().height))}return t}_scrollVirtualTableTopIntoView(){if(!(!this._virtualScrollActive()||!this.isConnected)){if(this._virtualScrollRoot()===`table-body`){let e=this._virtualBodyScrollEl?.isConnected?this._virtualBodyScrollEl:this.querySelector(`#mint-rt-vscroll-${this._tableId}`);this._useMobileListLayout()&&e&&e.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`);let t=e?.querySelector(`mint-table.table-section`)||e?.querySelector(`mint-table`),n=t?.querySelector(`#${this._tableId}`)?.closest(`table`)||t?.querySelector(`table`);this._virtualScrollStickyOverlapPx(n),e&&(e.scrollTop=0,this._virtualBodyScrollEl=e,this._virtualInvalidate(),this._scheduleVirtualWindowSync());return}this._virtualInvalidate(),this._scheduleVirtualWindowSync()}}_scheduleVirtualWindowSync(){this._virtualScrollActive()&&this._virtualWindowRaf===null&&(this._virtualWindowRaf=window.requestAnimationFrame(()=>{this._virtualWindowRaf=null,this._syncVirtualWindow()}))}_syncVirtualWindow(){if(!this._virtualScrollActive()||!this._configuration)return;let e=this._useMobileListLayout(),t=this.querySelector(`tbody[data-mint-rt-tbody="${this._tableId}"]`),n=this.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`),r=e?n:t;if(!r)return;let i=this._getVirtualRowCount(),a=this._virtualRowHeightPxForSync(e),o=this._virtualColspan();if(i===0){e?this._fetchError?r.innerHTML=`<li class="list-none px-4 py-8 text-center text-sm text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</li>`:r.innerHTML=`<li class="list-none px-4 py-8 text-center text-sm">No records found.</li>`:this._fetchError?r.innerHTML=`<tr><td colspan="${o}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>`:r.innerHTML=`<tr><td colspan="${o}" class="text-center py-8">No records found.</td></tr>`,this._virtualLastRangeStart=-1,this._virtualLastRangeEnd=-1,this._virtualLastRangeCacheSig=``;return}let s=0,c=window.innerHeight;if(this._virtualScrollRoot()===`table-body`){let e=this._virtualBodyScrollEl;if((!e||!e.isConnected)&&(e=this.querySelector(`#mint-rt-vscroll-${this._tableId}`),this._virtualBodyScrollEl=e),!e)return;s=e.scrollTop,c=e.clientHeight||400}else{let e=r.getBoundingClientRect();s=Math.max(0,-e.top)}let l=Math.min(Math.max(0,Math.floor(s/a)),Math.max(0,i-1)),u=Math.ceil(c/a)+16,d=Math.max(0,l-8),f=Math.min(i,l+u),p=``;if(this._type===`ajax`)for(let e=d;e<f;e++)p+=this._virtualRowCache.has(e)?`1`:`0`;if(d===this._virtualLastRangeStart&&f===this._virtualLastRangeEnd&&(this._type!==`ajax`||p===this._virtualLastRangeCacheSig))return;this._virtualLastRangeStart=d,this._virtualLastRangeEnd=f,this._virtualLastRangeCacheSig=p;let m=d*a,h=Math.max(0,(i-f)*a),g=``;if(e){g+=`<li aria-hidden="true" class="pointer-events-none m-0 block list-none border-0 p-0" style="height:${m}px"></li>`;for(let e=d;e<f;e++){let t=this._getVirtualRowAt(e),n=i>0&&e===i-1;t?g+=this._buildMobileListItemHtml(t,e,n):g+=this._buildMobileListPlaceholderLi(e,a,n)}g+=`<li aria-hidden="true" class="pointer-events-none m-0 block list-none border-0 p-0" style="height:${h}px"></li>`}else{g+=`<tr data-mint-rt-spacer="top" aria-hidden="true"><td colspan="${o}" style="height:${m}px;padding:0;border:0;line-height:0;font-size:0"></td></tr>`;for(let e=d;e<f;e++){let t=this._getVirtualRowAt(e),n=i>0&&e===i-1;t?g+=this._buildDataRowHtml(t,e,n):g+=this._buildVirtualPlaceholderRowHtml(e,a,n)}g+=`<tr data-mint-rt-spacer="bottom" aria-hidden="true"><td colspan="${o}" style="height:${h}px;padding:0;border:0;line-height:0;font-size:0"></td></tr>`}if(r.innerHTML=g,this.querySelectorAll(`tbody[data-mint-rt-tbody="${this._tableId}"] mint-button[data-action], ul[data-mint-rt-mobile-list="${this._tableId}"] mint-button[data-action]`).forEach(e=>{e.render&&e.render()}),this._attachTableEventListeners(),this._attachRowClickHandler(),this._type===`ajax`&&this._virtualScrollActive()&&this._scheduleVirtualAjaxPrefetch(d,f),this._virtualScrollRoot()===`table-body`&&!e){let e=this._virtualBodyScrollEl;e?.isConnected&&requestAnimationFrame(()=>{if(!e.isConnected)return;let t=Math.max(0,e.scrollHeight-e.clientHeight);e.scrollTop>t&&(e.scrollTop=t)})}}_detachVirtualScroll(){this._virtualScrollHandler&&=(window.removeEventListener(`scroll`,this._virtualScrollHandler),this._virtualBodyScrollEl?.removeEventListener(`scroll`,this._virtualScrollHandler),null),this._virtualWindowResizeHandler&&=(window.removeEventListener(`resize`,this._virtualWindowResizeHandler),null),this._virtualResizeObserver&&=(this._virtualResizeObserver.disconnect(),null),this._virtualBodyScrollEl=null,this._disposeVirtualBodyFade?.(),this._disposeVirtualBodyFade=null,this._virtualWindowRaf!==null&&(window.cancelAnimationFrame(this._virtualWindowRaf),this._virtualWindowRaf=null),this._virtualLastRangeStart=-1,this._virtualLastRangeEnd=-1,this._virtualLastRangeCacheSig=``,this._virtualAjaxPrefetchTimer!==null&&(window.clearTimeout(this._virtualAjaxPrefetchTimer),this._virtualAjaxPrefetchTimer=null),this._virtualRangeFetching=!1}_scheduleVirtualAjaxPrefetch(e,t){if(this._type!==`ajax`||!this._virtualScrollActive()||!this._configuration)return;let n=!1;for(let r=e;r<t;r++)if(!this._virtualRowCache.has(r)){n=!0;break}if(!n)return;this._virtualAjaxPrefetchTimer!==null&&window.clearTimeout(this._virtualAjaxPrefetchTimer);let r=e,i=t;this._virtualAjaxPrefetchTimer=window.setTimeout(()=>{this._virtualAjaxPrefetchTimer=null,this._fetchVirtualAjaxRange(r,i-r)},60)}async _fetchVirtualAjaxRange(e,t){if(!this._configuration||this._type!==`ajax`||!this._virtualScrollActive())return;let n=typeof this._configuration.data==`string`?this._configuration.data:null;if(!n||t<=0||this._virtualRangeFetching||e<0||e>=this._totalRows)return;this._virtualRangeFetching=!0;let r=this._virtualFetchGeneration,i=Math.min(e,Math.max(0,this._totalRows-1)),a=Math.min(150,Math.max(this._perPage,t,15),Math.max(1,this._totalRows-i));try{let e=new URLSearchParams({perPage:a.toString(),offset:i.toString(),search:this._search,sortBy:this._configuration.sortBy||`id`,sort:this._configuration.sort||`asc`,searchColumns:this._searchColumns.join(`,`),columns:this._columns.join(`,`)}),t={};this._configuration.headers&&(t.headers=this._configuration.headers);let o=n.includes(`?`)?`&`:`?`,s=await fetch(`${n}${o}${e.toString()}`,t);if(!s.ok)throw Error(`HTTP error! status: ${s.status}`);let c=await s.json();if(r!==this._virtualFetchGeneration)return;(c.content?.rows||[]).forEach((e,t)=>{let n=i+t;n<this._totalRows&&this._virtualRowCache.set(n,e)})}catch(e){console.error(`mint-resource-table: virtual range fetch failed`,e)}finally{this._virtualRangeFetching=!1,r===this._virtualFetchGeneration&&(this._virtualInvalidate(),this._scheduleVirtualWindowSync())}}_detachFixedChromeResize(){this._fixedChromeResizeObserver?.disconnect(),this._fixedChromeResizeObserver=null,this.style.removeProperty(`--mint-rt-fixed-controls-h`)}_syncFixedControlsChromeHeight(){if(!this._fixedHeader()||!this._fixedControls())return;this._fixedChromeResizeObserver?.disconnect(),this._fixedChromeResizeObserver=null;let e=this.querySelector(`#mint-rt-fixed-controls-${this._tableId}`);if(!e)return;let t=()=>{let t=Math.ceil(e.getBoundingClientRect().height);this.style.setProperty(`--mint-rt-fixed-controls-h`,`${t}px`)};t(),this._fixedChromeResizeObserver=new ResizeObserver(t),this._fixedChromeResizeObserver.observe(e)}_attachVirtualScrollListeners(){if(this._detachVirtualScroll(),!this._virtualScrollActive())return;let e=()=>{this._scheduleVirtualWindowSync()};this._virtualScrollHandler=e,this._virtualScrollRoot()===`table-body`?(this._virtualBodyScrollEl=this.querySelector(`#mint-rt-vscroll-${this._tableId}`),this._virtualBodyScrollEl&&(this._disposeVirtualBodyFade=t.n(this._virtualBodyScrollEl,`vertical`)),this._virtualBodyScrollEl?.addEventListener(`scroll`,e,{passive:!0}),this._virtualBodyScrollEl&&typeof ResizeObserver<`u`&&(this._virtualResizeObserver=new ResizeObserver(()=>this._scheduleVirtualWindowSync()),this._virtualResizeObserver.observe(this._virtualBodyScrollEl))):window.addEventListener(`scroll`,e,{passive:!0}),this._virtualWindowResizeHandler=()=>this._scheduleVirtualWindowSync(),window.addEventListener(`resize`,this._virtualWindowResizeHandler,{passive:!0}),this._scheduleVirtualWindowSync()}_toggleSort(e){if(!this._configuration||!e.data||!e.sortable)return;let t=e.data;if(this._sortTimeoutId!==null&&(clearTimeout(this._sortTimeoutId),this._sortTimeoutId=null),this._sorting=!0,this._sortingColumnData=t.toLowerCase(),this._updateSortIcons(),this._type===`ajax`)this._sortTimeoutId=window.setTimeout(()=>{if(this._sortTimeoutId=null,!this._configuration||!t||!e.sortable)return;let n=this._configuration.sort||`asc`;this._configuration.sortBy?.toLowerCase()===t.toLowerCase()&&(n=n===`desc`?`asc`:`desc`),this._configuration.sort=n,this._configuration.sortBy=t,this._updateSortIcons(),this._offset=0,this._currentPage=1,this._updatePageInUrl(1),this._fetching=!1,this._loading=!1,this._fetchData(void 0,!1,this._perPage,0)},10);else{let e=this._configuration.sort||`asc`;this._configuration.sortBy?.toLowerCase()===t.toLowerCase()&&(e=e===`desc`?`asc`:`desc`),this._configuration.sort=e,this._configuration.sortBy=t,this._currentPage=1,this._updatePageInUrl(1),this._sorting=!1,this._sortingColumnData=null,this._updateSortIcons(),this.render(),this._virtualScrollActive()&&queueMicrotask(()=>this._scrollVirtualTableTopIntoView())}}_getSortClass(e){return this._sorting&&this._sortingColumnData===e.data?.toLowerCase()?`spinner`:this._configuration?.sortBy?.toLowerCase()===e.data?.toLowerCase()?this._configuration?.sort?.toLowerCase()===`desc`?`caret-down`:`caret-up`:``}_updateSortIcons(){if(!this._configuration)return;this._configuration.columns.forEach((e,t)=>{if(!e.sortable||e.hidden)return;let n=this.querySelector(`th[data-column-key="${t}"]`);if(!n)return;let r=n.querySelector(`:scope > [data-mint-rt-sort-label]`);if(!r)return;let i=r.querySelector(`:scope > [data-mint-rt-sort-icon]`),a=this._getSortClass(e),o=()=>{if(!i){let e=document.createElement(`div`);e.className=`ml-2 flex items-center`,e.setAttribute(`data-mint-rt-sort-icon`,``),r.appendChild(e),i=e}return i},s=()=>{i&&=(i.remove(),null)};if(a===`spinner`){let e=o();e.firstElementChild?.tagName!==`MINT-SPINNER`&&(e.innerHTML=`<mint-spinner class="w-4 h-4"></mint-spinner>`)}else if(a===`caret-up`||a===`caret-down`){let e=o(),t=e.firstElementChild;(t?.tagName!==`MINT-ICON`||t.getAttribute(`name`)!==a)&&(e.innerHTML=`<mint-icon name="${a}" class="w-4 h-4"></mint-icon>`)}else s()}),this._syncMobileSortPopoverIcons();let e=this.querySelector(`#mint-rt-mobile-sort-btn-${this._tableId}`);e&&(e.setAttribute(`icon`,this._getMobileSortTriggerIconName()),this._sorting?e.setAttribute(`loading`,`true`):e.removeAttribute(`loading`),typeof e.render==`function`&&e.render())}_showFetchingState(){}_triggerSearch(){this._searchTimeoutId&&clearTimeout(this._searchTimeoutId),this._searching=!0,this._type===`ajax`&&this._updateSearchIcon(),this._type!==`ajax`&&(this._currentPage=1,this._updatePageInUrl(1)),this._updateTableBody(),this._type!==`ajax`&&this._updatePagination(),this._searchTimeoutId=window.setTimeout(()=>{this._type===`ajax`?(this._offset=0,this._currentPage=1,this._updatePageInUrl(1),this._fetchData(void 0,!1,this._perPage,0)):(this._searching=!1,this._virtualScrollActive()&&queueMicrotask(()=>this._scrollVirtualTableTopIntoView()))},400)}_updateSearchIcon(){let e=this.querySelector(`#search-${this._tableId}`);if(!e)return;let t=this._type===`ajax`&&(this._searching||this._fetching);setTimeout(()=>{let n=e.querySelector(`.relative`)||e.querySelector(`div`);if(!n)return;let r=n.querySelector(`mint-icon`),i=n.querySelector(`mint-spinner`);if(t){if(r&&!i){let e=document.createElement(`mint-spinner`);e.className=`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none`,r.replaceWith(e)}else if(!r&&!i){let e=document.createElement(`mint-spinner`);e.className=`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none`,n.appendChild(e)}}else if(i){e.getAttribute(`icon`)||e.setAttribute(`icon`,`search`);let t=document.createElement(`mint-icon`);t.setAttribute(`name`,`search`),t.className=`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none`,i.replaceWith(t)}},0)}_updateTableBody(){if(!this._configuration)return;let e=this.querySelector(`tbody[data-mint-rt-tbody="${this._tableId}"]`),t=this.querySelector(`#${this._tableId}`)?.closest(`table`)?.querySelector(`tbody`);if(this._virtualScrollActive()&&(this._type===`provided`||this._type===`ajax`)){if(!(e||t)){this.render();return}let n=this.querySelector(`#search-${this._tableId}`),r=document.activeElement===n||n?.querySelector(`input`)===document.activeElement,i=this._search;if((this._fetching||this._loading)&&!this._loaded&&!this._sorting)return;if(this._virtualInvalidate(),this._syncVirtualWindow(),r&&n){let e=n.querySelector(`input`)||n._element;e?(e.value=i,setTimeout(()=>{e.focus(),e.setSelectionRange(i.length,i.length)},0)):n.value!==void 0&&(n.value=i,setTimeout(()=>{n.focus()},0))}return}let n=this._getRows(),r=t;if(!r){this.render();return}let i=this.querySelector(`#search-${this._tableId}`),a=document.activeElement===i||i?.querySelector(`input`)===document.activeElement,o=this._search,s=``,c=``;if((this._fetching||this._loading)&&!this._loaded&&!this._sorting)return;n.forEach((e,t)=>{c+=this._buildMobileListItemHtml(e,t,t===n.length-1);let r=typeof this._configuration.onRowClick==`function`,i=r?`cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800`:``;s+=`<tr data-row-index="${t}" ${r?`data-row-clickable="true"`:``}${i?` class="${i}"`:``}>`,this._configuration.columns.forEach(n=>{if(n.hidden)return;let r=!n.show||n.show(this,e);s+=`<td style="${this._getStyle(n)}" class="${this._getClasses(n,!0)}">`,r&&(s+=this._buildTableCellInnerHtml(n,e,t,`table`)),s+=`</td>`}),s+=`</tr>`}),n.length===0&&(this._fetchError?(s+=`<tr><td colspan="${this._configuration.columns.filter(e=>!e.hidden).length}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>`,c+=`<li class="list-none px-4 py-8 text-center text-sm text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</li>`):(s+=`<tr><td colspan="${this._configuration.columns.filter(e=>!e.hidden).length}" class="text-center py-8">No records found.</td></tr>`,c+=`<li class="list-none px-4 py-8 text-center text-sm">No records found.</li>`)),r.innerHTML=s;let l=this.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`);if(l&&(l.innerHTML=c),this._attachTableEventListeners(),this._attachRowClickHandler(),a&&i){let e=i.querySelector(`input`)||i._element;e?(e.value=o,setTimeout(()=>{e.focus(),e.setSelectionRange(o.length,o.length)},0)):i.value!==void 0&&(i.value=o,setTimeout(()=>{i.focus()},0))}}_updatePagination(){if(!this._configuration)return;let e=this._lastPage||Math.ceil(this._rows.length/this._perPage),t=()=>{let e=this.querySelector(`mint-table`),t=e?.nextElementSibling;e&&t&&t.id!==`mint-rt-pagination-host-${this._tableId}`&&!t.classList.contains(`mint-rt-pagination-host`)&&t.querySelector?.(`[data-action="page"]`)&&t.remove()};if(!this._configuration.perPage||e<=1||this._virtualScrollActive()){this._getPaginationHostEl()?.replaceChildren(),t();return}let n=this._getPaginationHostEl();if(!n){let e=this.querySelector(`[data-mint-rt-mobile-list="${this._tableId}"]`)||this.querySelector(`mint-table`);if(!e){this.render();return}n=document.createElement(`div`),n.id=`mint-rt-pagination-host-${this._tableId}`,n.setAttribute(`data-mint-rt-pagination-wrap`,``),n.className=`mint-rt-pagination-host w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain flex justify-center [-webkit-overflow-scrolling:touch] md:justify-end `+(this._inMintCard?`border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider md:border-t-0 md:pt-0`:`border-t border-gray-200 px-2 py-3 dark:border-mint-divider md:border-t-0 md:py-0 md:mt-4`),e.insertAdjacentElement(`afterend`,n)}let r=this._buildPaginationNavMarkup(e);n.innerHTML=r,setTimeout(()=>{this._attachPaginationListeners(),n.querySelectorAll(`mint-button[data-action="page"]`).forEach(e=>{let t=e.getAttribute(`data-page`),n=t&&this._loadingPage===parseInt(t),r=e._button||e.querySelector(`button`);if(r)if(n){let e=[],t=document.createTreeWalker(r,NodeFilter.SHOW_TEXT,null),n;for(;n=t.nextNode();)e.push(n);e.forEach(e=>e.parentNode?.removeChild(e));let i=r.querySelector(`.mint-button-content`);if(i){let e=i.textContent?.trim();e&&/^\d+$/.test(e)&&i.remove()}let a=r.querySelector(`span.mr-2`);a&&a.querySelector(`mint-spinner`)&&(a.classList.remove(`mr-2`),a.classList.add(`mr-0`))}else{let e=r.textContent?.trim();if(!e||!/^\d+$/.test(e)){let e=t||``,n=r.querySelector(`mint-spinner`);r.innerHTML=``,n&&r.appendChild(n),r.appendChild(document.createTextNode(e))}}if(`render`in e&&typeof e.render==`function`&&(e.render(),n&&r)){let e=r.querySelector(`span.mr-2`);e&&e.querySelector(`mint-spinner`)&&(e.classList.remove(`mr-2`),e.classList.add(`mr-0`))}}),n.querySelectorAll(`mint-button[data-action="page-prev"], mint-button[data-action="page-next"]`).forEach(e=>{`render`in e&&typeof e.render==`function`&&e.render()}),this._loadingPage!==null&&!this._loading&&!this._fetching&&this._updatePagination()},0)}_goToPage(e){let t=this._lastPage||Math.ceil(this._rows.length/this._perPage);e>t&&(e=t),e<1&&(e=1),e!==this._currentPage&&(this._currentPage=e,this._offset=(e-1)*this._perPage,this._updatePageInUrl(e),this._type===`ajax`?(this._loadingPage=e,this._updatePagination(),this._fetchData()):(this.render(),this._schedulePaginatedFirstRowIntoView()))}_schedulePaginatedFirstRowIntoView(){requestAnimationFrame(()=>requestAnimationFrame(()=>{if(!this.isConnected)return;let e=this._useMobileListLayout()?this.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`):null,t=this.querySelector(`#${this._tableId}`)?.closest(`table`),n=e?.querySelector(`:scope > li`)||t?.querySelector(`tbody tr[data-row-index="0"]`);if(!n)return;let r=this._virtualScrollStickyOverlapPx(t),i=this._findVerticalScrollContainer(n),a=n.getBoundingClientRect();if(i){let e=i.getBoundingClientRect();i.scrollTo({top:i.scrollTop+a.top-e.top-r-8,behavior:`smooth`})}else window.scrollTo({top:Math.max(0,window.scrollY+a.top-r-8),behavior:`smooth`})}))}_findVerticalScrollContainer(e){let t=e.parentElement;for(;t&&t!==document.body&&t!==document.documentElement;){let e=getComputedStyle(t).overflowY;if(/(auto|scroll|overlay)/.test(e)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}_handleButtonClick(e){if(this._configuration)switch(e.type){case`export`:break;case`print`:window.print();break;case`csv`:this._downloadCSV();break;default:e.onClick&&e.onClick(this);break}}_toolbarButtonsHtml(e){let t=(this._configuration?.buttons||[]).map((e,t)=>({button:e,index:t})).filter(({button:t})=>(t.position||`right`)===e);return t.length?`<div class="flex shrink-0 items-center gap-2">${t.map(({button:e,index:t})=>{let n=e.icon?` icon="${this._escapeHtml(e.icon)}"`:``,r=e.tone?` tone="${this._escapeHtml(e.tone)}"`:``,i=e.icon===`plus`?`solid`:e.variant||`solid`,a=this._escapeHtml(i),o=this._escapeHtml(e.class||``),s=e.ariaLabel?` aria-label="${this._escapeHtml(e.ariaLabel)}"`:``;return`<mint-button variant="${a}" class="${o}" data-button-type="${this._escapeHtml(e.type||`custom`)}" data-button-index="${t}"${n}${r}${s}>${e.label?this._escapeHtml(e.label):``}</mint-button>`}).join(``)}</div>`:``}_downloadCSV(){if(!this._configuration)return;let e=this.querySelector(`#${this._tableId}`)||this.querySelector(`table`);if(!e)return;let t=`data:text/csv;charset=utf-8,`,n=e=>{let n=[];e.querySelectorAll(`th, td`).forEach(e=>{let t=e.getAttribute(`colspan`);if(t)for(let e=0;e<parseInt(t,10)-1;e++)n.push(``);n.push(`"`+e.textContent?.trim().replace(/"/g,`""`)+`"`)}),t+=n.join(`,`)+`
|
|
2
2
|
`};e.querySelectorAll(`tr`).forEach(e=>n(e));let r=encodeURI(t),i=document.createElement(`a`);i.setAttribute(`href`,r),i.setAttribute(`download`,`${this._configuration.export_name||this._tableId}.csv`),document.body.appendChild(i),i.click(),document.body.removeChild(i)}_getStyle(e){let t=``;return(e.nowrap||e.actions)&&(t+=`white-space: nowrap;`),e.offsetLeft&&(t+=`left: ${e.offsetLeft} !important;`),e.offsetRight&&(t+=`right: ${e.offsetRight} !important;`),e.width&&(t+=`min-width: ${e.width}px; max-width: ${e.width}px;`),e.minWidth&&(t+=`min-width: ${this._escapeHtml(e.minWidth)};`),t}_getClasses(e,t=!1){let n=[];return e.class&&n.push(e.class.trim()),e.align===`center`?n.push(`text-center`):e.align===`right`&&n.push(`text-right`),e.sortable&&!t&&n.push(`cursor-pointer`),e.stickLeft&&n.push(`sticky-left`),e.stickRight&&n.push(`sticky-right`),n.join(` `)}_replaceUtilityClasses(){let e=n,t=[this,...Array.from(this.querySelectorAll(`[class]`))];for(let n of t)for(let t of Array.from(n.classList)){let r=e[t];r&&n.classList.replace(t,r)}}_renderTheadHtml(e,t,n=!1,r=!1){if(!this._configuration)return``;let i=[`bg-white`,`dark:bg-mint-nav`];e&&(i.push(`sticky`,`z-30`),r?i.push(`top-[var(--mint-rt-fixed-controls-h,0px)]`):i.push(`top-0`)),t&&i.push(`border-b`,`border-gray-200`,`dark:border-mint-divider`);let a=`<thead class="${i.join(` `)}"><tr>`;return this._configuration.columns.forEach((e,t)=>{if(e.hidden)return;let r=n?``:` width="${e.width||``}"`,i=e.sortable?` data-mint-rt-sortable=""`:``;if(a+=`<th${r} style="${this._getStyle(e)}" class="${this._getClasses(e)}" data-column-key="${t}"${i}>`,e.showLabel!==!1){if(a+=`<div class="flex items-center" data-mint-rt-sort-label>`,a+=`<div class="flex-1">${e.raw?e.label:this._escapeHtml(e.label)}</div>`,e.sortable){let t=this._getSortClass(e);t===`spinner`?a+=`<div class="ml-2 flex items-center" data-mint-rt-sort-icon><mint-spinner class="w-4 h-4"></mint-spinner></div>`:(t===`caret-up`||t===`caret-down`)&&(a+=`<div class="ml-2 flex items-center" data-mint-rt-sort-icon><mint-icon name="${t}" class="w-4 h-4"></mint-icon></div>`)}a+=`</div>`}a+=`</th>`}),a+=`</tr></thead>`,a}render(){if(!this._configuration){this.innerHTML=`<div class="p-4 text-red-500">Error: Invalid configuration</div>`,this._replaceUtilityClasses();return}this._ensureMobileListMql();let e=String(this._configuration.id||``).trim();e&&(this.id=e),this._detachVirtualScroll(),this._detachFixedChromeResize(),this._virtualScrollActive()||this._virtualRowCache.clear();let t=!this._loaded||this._rows.length>0||this._search.length>0||this._searching||!!this._configuration.buttons?.length,n=this._getRows();this._lastPage||Math.ceil(this._rows.length/this._perPage);let r=this._isExternalLoading(),i=``;if(t){let e=this._fixedControls(),t=[`flex`,`items-center`,`min-w-0`,this._inMintCard?`p-3.5`:`mb-3`,e?`sticky top-0 z-20 bg-white dark:bg-mint-nav border-b border-gray-200 dark:border-mint-divider`:``].filter(Boolean).join(` `);if(i+=`<div id="mint-rt-fixed-controls-${this._tableId}" class="${t}">`,i+=`<div class="flex min-w-0 flex-1 items-center gap-2">`,i+=this._buildMobileSortToolbarHtml(),i+=this._toolbarButtonsHtml(`left`),this._configuration.showSearch!==!1){let e=`search-${this._tableId}`,t=this._escapeHtml(this._configuration.searchPlaceholder||`Search...`);i+=`<mint-input id="${e}" type="search" label="" placeholder="${t}" class="min-w-0 flex-1" icon="search" value="${this._escapeHtml(this._search)}"></mint-input>`}i+=this._toolbarButtonsHtml(`right`),i+=`</div>`,i+=`</div>`}if((this._type===`ajax`&&!this._loaded||this._type===`provided`&&r)&&!this._fetchError&&!this._sorting){let e=this._fixedHeader()?` data-mint-rt-scroll-inner=""`:``,t=this._fixedHeader()&&this._fixedControls(),n=this._fixedHeader()?t?`sticky top-[var(--mint-rt-fixed-controls-h,0px)] z-30 `:`sticky top-0 z-30 `:`sticky top-0 z-10 `;i+=`<div class="min-w-0">`,i+=`<mint-table class="table-section`+(this._inMintCard?` rounded-t-none`:``)+`"`+e+`>`,i+=`<table id="${this._tableId}">`,i+=`<thead class="`+n+`bg-white dark:bg-mint-nav border-b border-gray-200 dark:border-mint-divider"><tr>`,this._configuration.columns.forEach((e,t)=>{if(e.hidden)return;let n=e.sortable?` data-mint-rt-sortable=""`:``;if(i+=`<th width="${e.width||``}" style="${this._getStyle(e)}" class="${this._getClasses(e)}" data-column-key="${t}"${n}>`,e.showLabel!==!1){if(i+=`<div class="flex items-center" data-mint-rt-sort-label>`,i+=`<div class="flex-1">${e.raw?e.label:this._escapeHtml(e.label)}</div>`,e.sortable){let t=this._getSortClass(e);t===`spinner`?i+=`<div class="ml-2 flex items-center" data-mint-rt-sort-icon><mint-spinner class="w-4 h-4"></mint-spinner></div>`:(t===`caret-up`||t===`caret-down`)&&(i+=`<div class="ml-2 flex items-center" data-mint-rt-sort-icon><mint-icon name="${t}" class="w-4 h-4"></mint-icon></div>`)}i+=`</div>`}i+=`</th>`}),i+=`</tr></thead>`,i+=`<tbody>`;for(let e=0;e<4;e++)i+=`<tr>`,this._configuration.columns.forEach(e=>{if(!e.hidden){if(i+=`<td style="${this._getStyle(e)}" class="${this._getClasses(e,!0)}">`,e.thumbnail){let t=this._thumbnailDesktopPx(e);i+=`<div class="rounded-md bg-gray-200 dark:bg-white/15 animate-pulse" style="width:${t}px;height:${t}px;box-sizing:border-box"></div>`}else i+=`<div class="h-4 max-w-[95%] rounded bg-gray-200 dark:bg-white/15 animate-pulse"></div>`;i+=`</td>`}}),i+=`</tr>`;i+=`</tbody>`,i+=`</table>`,i+=`</mint-table>`,i+=`</div>`,i+=this._paginationHostPlaceholderHtml()}else if(n.length>0||this._search.length>0||this._searching||this._fetchError){let e=this._virtualScrollActive()&&(this._type===`provided`||this._type===`ajax`&&this._loaded&&!this._fetchError),t=e&&this._virtualScrollRoot()===`table-body`,a=this._escapeHtml(this._virtualMaxHeightCss()),o=t||this._fixedHeader(),s=this._fixedHeader()&&this._fixedControls(),c=o?` data-mint-rt-scroll-inner=""`:``,l=`table-section`+(this._inMintCard?` rounded-t-none`:``),u=`mint-resource-table-mobile-list m-0 min-h-0 w-full list-none border-collapse overflow-x-hidden ${this._inMintCard?`px-3.5 py-3.5`:`py-3`} md:hidden`,d=``;if(t){let e=this._renderColgroupHtml();i+=`<div id="mint-rt-vscroll-${this._tableId}" class="overflow-y-auto overflow-x-auto min-h-0 w-full" style="max-height: ${a}; scrollbar-gutter: stable; overscroll-behavior-x: contain; overscroll-behavior-y: none; overflow-anchor: none;">`,i+=`<div class="hidden min-h-0 min-w-0 md:block">`,i+=`<mint-table class="${l}"${c}>`,i+=`<table id="${this._tableId}" class="w-full min-w-0 table-fixed">`,i+=e,i+=this._renderTheadHtml(!0,!0,!0,s)}else i+=`<div class="hidden min-h-0 min-w-0 md:block">`,i+=`<mint-table class="${l}"${c}>`,i+=`<table id="${this._tableId}">`,e&&(i+=this._renderColgroupHtml()),i+=this._renderTheadHtml(!0,!0,!!e,s);if(i+=`<tbody`+(e?` data-mint-rt-tbody="${this._tableId}"`:``)+`>`,!this._fetching&&!this._loading&&!r&&!e&&n.forEach((e,t)=>{d+=this._buildMobileListItemHtml(e,t,t===n.length-1);let r=typeof this._configuration.onRowClick==`function`,a=r?`cursor-pointer hover:bg-gray-50 dark:hover:bg-mint-elevated`:``;i+=`<tr data-row-index="${t}" ${r?`data-row-clickable="true"`:``}${a?` class="${a}"`:``}>`,this._configuration.columns.forEach(n=>{if(n.hidden)return;let r=!n.show||n.show(this,e);i+=`<td style="${this._getStyle(n)}" class="${this._getClasses(n,!0)}">`,r&&(i+=this._buildTableCellInnerHtml(n,e,t,`table`)),i+=`</td>`}),i+=`</tr>`}),!this._fetching&&!this._loading&&!r&&n.length===0&&!e)if(this._fetchError){let e=this._configuration.columns.filter(e=>!e.hidden).length;i+=`<tr><td colspan="${e}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>`,d+=`<li class="list-none px-4 py-8 text-center text-sm text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</li>`}else{let e=this._configuration.columns.filter(e=>!e.hidden).length;i+=`<tr><td colspan="${e}" class="text-center py-8">No records found.</td></tr>`,d+=`<li class="list-none px-4 py-8 text-center text-sm">No records found.</li>`}i+=`</tbody>`,i+=`</table>`,i+=`</mint-table>`,i+=`</div>`,i+=`<ul class="${u}" data-mint-rt-mobile-list="${this._tableId}">${e?``:d}</ul>`,e||(i+=this._paginationHostPlaceholderHtml()),t&&(i+=`</div>`)}else i+=`<slot name="empty"></slot>`;this._fixedHeader()?this.setAttribute(`data-mint-rt-fixed-header`,``):this.removeAttribute(`data-mint-rt-fixed-header`),this._fixedControls()?this.setAttribute(`data-mint-rt-fixed-controls`,``):this.removeAttribute(`data-mint-rt-fixed-controls`),this.innerHTML=i,this._replaceUtilityClasses(),this._updatePagination(),this.querySelectorAll(`mint-button[data-action]`).forEach(e=>{e.render&&e.render()}),this.querySelectorAll(`mint-button[data-mint-rt-toolbar]`).forEach(e=>{e.render&&e.render()}),this.querySelectorAll(`mint-button[data-button-type]`).forEach(e=>{e.render&&e.render()}),this._attachEventListeners(),this._type===`ajax`&&!this._loaded&&!this._fetching&&!this._loading&&this._fetchData()}_attachRowClickHandler(){this._rowClickHandler&&this.removeEventListener(`click`,this._rowClickHandler,!0);let e=e=>{let t=e.target;if(t.tagName===`MINT-BUTTON`||t.tagName===`BUTTON`||t.closest(`mint-button`)||t.closest(`button`)||t.closest(`mint-popover`)||t.closest(`[data-action]`))return;let n=t.closest(`tr[data-row-clickable="true"]`)||t.closest(`li[data-row-clickable="true"]`);if(!n)return;let r=n.getAttribute(`data-row-index`);if(!r)return;let i=parseInt(r),a=this._getRowDataForEventIndex(i);!a||!this._configuration?.onRowClick||(this._configuration.onRowClick.length===1?this._configuration.onRowClick(a):this._configuration.onRowClick(this,a))};this.addEventListener(`click`,e,!0),this._rowClickHandler=e}_attachPaginationListeners(){this.querySelectorAll(`[data-action="page"]`).forEach(e=>{e.addEventListener(`click`,()=>{if(e.getAttribute(`active`)===`true`)return;let t=parseInt(e.getAttribute(`data-page`)||`1`);t!==this._currentPage&&this._goToPage(t)})}),this.querySelectorAll(`[data-action="page-prev"]`).forEach(e=>{e.addEventListener(`click`,()=>{this._goToPage(this._currentPage-1)})}),this.querySelectorAll(`[data-action="page-next"]`).forEach(e=>{e.addEventListener(`click`,()=>{this._goToPage(this._currentPage+1)})})}_attachTableEventListeners(){this.querySelectorAll(`[data-action="row-action"]`).forEach(e=>{e.addEventListener(`click`,()=>{let t=parseInt(e.getAttribute(`data-row-index`)||`0`),n=parseInt(e.getAttribute(`data-action-index`)||`0`),r=parseInt(e.getAttribute(`data-column-key`)||`0`),i=this._getRowDataForEventIndex(t),a=this._configuration?.columns[r];a&&a.actions&&a.actions[n]&&i!==void 0&&a.actions[n].onClick(this,i)})}),this.querySelectorAll(`[data-action="column-action"]`).forEach(e=>{e.addEventListener(`click`,()=>{let t=parseInt(e.getAttribute(`data-row-index`)||`0`),n=parseInt(e.getAttribute(`data-column-key`)||`0`),r=this._getRowDataForEventIndex(t),i=this._configuration?.columns[n];i&&i.action&&r!==void 0&&i.action.onClick(this,r)})})}_attachEventListeners(){let e=this.querySelector(`#search-${this._tableId}`);if(e){let t=e.querySelector(`input`)||e._element;t?t.addEventListener(`input`,e=>{this._search=e.target.value,this._triggerSearch()}):e.addEventListener(`input`,t=>{this._search=e.value||t.target.value||``,this._triggerSearch()})}this._attachTableEventListeners(),this._attachRowClickHandler(),this.querySelectorAll(`th[data-column-key]`).forEach(e=>{e.addEventListener(`click`,()=>{let t=parseInt(e.getAttribute(`data-column-key`)||`0`),n=this._configuration?.columns[t];n&&this._toggleSort(n)})}),this.querySelectorAll(`[data-action="mobile-sort"]`).forEach(e=>{e.addEventListener(`click`,t=>{t.stopPropagation();let n=parseInt(e.getAttribute(`data-column-key`)||`0`,10),r=this._configuration?.columns[n];r&&(this._closeMobileSortPopover(),this._toggleSort(r))})}),this.querySelectorAll(`mint-button[data-button-index]`).forEach(e=>{e.addEventListener(`click`,()=>{let t=Number.parseInt(e.getAttribute(`data-button-index`)||``,10),n=Number.isInteger(t)?this._configuration?.buttons?.[t]:void 0;n&&this._handleButtonClick(n)})}),this._attachPaginationListeners(),this._virtualScrollActive()&&(this._type===`provided`||this._type===`ajax`)&&this._attachVirtualScrollListeners(),this._fixedHeader()&&this._fixedControls()&&queueMicrotask(()=>{this._syncFixedControlsChromeHeight(),requestAnimationFrame(()=>this._syncFixedControlsChromeHeight())})}_escapeHtml(e){let t=document.createElement(`div`);return t.textContent=e,t.innerHTML}_getPageFromUrl(){if(!this._tableId)return null;let e=new URLSearchParams(window.location.search).get(`mui.${this._tableId}`);if(!e)return null;let t=parseInt(e,10);return isNaN(t)||t<1?null:t}_updatePageInUrl(e){if(!this._tableId)return;let t=new URL(window.location.href),n=t.searchParams;n.set(`mui.${this._tableId}`,e.toString()),e===1&&n.set(`mui.${this._tableId}`,`1`),window.history.replaceState(window.history.state,``,t.toString())}_loadPageFromUrl(){if(!this._configuration||!this._tableId)return;let e=this._getPageFromUrl();e!==null&&(this._currentPage=e,this._offset=(this._currentPage-1)*this._perPage)}};customElements.get(`mint-resource-table`)||e.t(`mint-resource-table`,r);var i=550,a=12,o={passive:!0},s=class extends HTMLElement{constructor(...e){super(...e),this._table=null,this._anchor=null,this._popover=null,this._menuRoot=null,this._baseId=``,this._touchTimer=null,this._touchStart=null,this._slotObserver=null,this._scrollCloseTargets=[],this._onScrollClose=()=>{this._closePopover()},this._onContextMenu=e=>{let t=e,n=this._rowTargetFromEventTarget(t.target);n&&(t.preventDefault(),this._openAtRowIndex(n.index,t.clientX,t.clientY))},this._onTouchStart=e=>{let t=e;if(!t.touches.length)return;let n=this._rowTargetFromEventTarget(t.target);if(!n)return;let r=t.touches[0];this._touchStart={x:r.clientX,y:r.clientY,rowIndex:n.index},this._touchTimer!==null&&(window.clearTimeout(this._touchTimer),this._touchTimer=null);let i=this._longPressMs();this._touchTimer=window.setTimeout(()=>{this._touchTimer=null,this._touchStart&&=(this._openAtRowIndex(this._touchStart.rowIndex,this._touchStart.x,this._touchStart.y),null)},i)},this._onTouchMove=e=>{if(!this._touchStart||this._touchTimer===null)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this._touchStart.x,r=t.clientY-this._touchStart.y;n*n+r*r>a*a&&(this._clearTouchTimer(),this._touchStart=null)},this._onTouchEnd=()=>{this._clearTouchTimer(),this._touchStart=null}}static get observedAttributes(){return[`for`,`long-press-ms`]}connectedCallback(){this.classList.add(`contents`),this._baseId=this.id?.trim()||`mint-rt-ctx-${Math.random().toString(36).slice(2,10)}`,this._anchor=document.createElement(`div`),this._anchor.id=`${this._baseId}-anchor`,this._anchor.setAttribute(`aria-hidden`,`true`),this._anchor.className=`pointer-events-none fixed z-0 h-px w-px overflow-hidden p-0 m-0 border-0 opacity-0`,document.body.appendChild(this._anchor),this._popover=document.createElement(`mint-popover`),this._popover.setAttribute(`data-mint-rt-ctx-internal`,``),this._popover.id=`${this._baseId}-popover`,this._popover.setAttribute(`trigger-id`,this._anchor.id),this._popover.setAttribute(`direction`,`down`),this._popover.setAttribute(`padding`,`0`),this._popover.setAttribute(`distance`,`6px`),this._menuRoot=document.createElement(`div`),this._menuRoot.className=`flex min-w-[11rem] flex-col gap-0.5 py-1`,this._popover.appendChild(this._menuRoot),this.appendChild(this._popover),this._slotObserver=new MutationObserver(()=>{this._hideMenuSlotSources()}),this._slotObserver.observe(this,{childList:!0}),queueMicrotask(()=>{this._hideMenuSlotSources(),this._bindTable()})}disconnectedCallback(){this._slotObserver?.disconnect(),this._slotObserver=null,this._unbindTable(),this._anchor?.remove(),this._anchor=null,this._popover?.remove(),this._popover=null,this._menuRoot=null}attributeChangedCallback(){this.isConnected&&this._bindTable()}_longPressMs(){let e=parseInt(this.getAttribute(`long-press-ms`)||``,10);return!Number.isNaN(e)&&e>100?e:i}_resolveTable(){let e=this.getAttribute(`for`)?.trim();if(e){let t=document.getElementById(e);return t&&t.tagName===`MINT-RESOURCE-TABLE`?t:null}let t=this.previousElementSibling;return t&&t.tagName===`MINT-RESOURCE-TABLE`?t:this.parentElement?.querySelector?.(`mint-resource-table`)??null}_hideMenuSlotSources(){for(let e of Array.from(this.children))e===this._popover||e.hasAttribute(`data-mint-rt-ctx-internal`)||e.setAttribute(`hidden`,``)}_bindTable(){this._unbindTable(),this._table=this._resolveTable(),this._table&&(this._table.addEventListener(`contextmenu`,this._onContextMenu,!0),this._table.addEventListener(`touchstart`,this._onTouchStart,{passive:!0}),this._table.addEventListener(`touchmove`,this._onTouchMove,{passive:!0}),this._table.addEventListener(`touchend`,this._onTouchEnd,{passive:!0}),this._table.addEventListener(`touchcancel`,this._onTouchEnd,{passive:!0}))}_unbindTable(){this._closePopover(),this._table&&=(this._table.removeEventListener(`contextmenu`,this._onContextMenu,!0),this._table.removeEventListener(`touchstart`,this._onTouchStart),this._table.removeEventListener(`touchmove`,this._onTouchMove),this._table.removeEventListener(`touchend`,this._onTouchEnd),this._table.removeEventListener(`touchcancel`,this._onTouchEnd),null)}_rowTargetFromEventTarget(e){if(!e||!this._table)return null;let t=e.closest?.(`tr[data-row-index], li[data-row-index]`);if(!t||!this._table.contains(t)||t.hasAttribute(`data-mint-rt-spacer`)||t.getAttribute(`data-mint-rt-placeholder`)===`true`)return null;let n=t.getAttribute(`data-row-index`);if(n==null)return null;let r=parseInt(n,10);return Number.isNaN(r)?null:{index:r}}_clearTouchTimer(){this._touchTimer!==null&&(window.clearTimeout(this._touchTimer),this._touchTimer=null)}_positionAnchor(e,t){this._anchor&&(this._anchor.style.left=`${Math.round(e)}px`,this._anchor.style.top=`${Math.round(t)}px`)}_slotTemplateElements(){return Array.from(this.children).filter(e=>e!==this._popover&&e instanceof HTMLElement&&!e.hasAttribute(`data-mint-rt-ctx-internal`))}_elementIsScrollContainer(e){let t=getComputedStyle(e);return t.overflowX===`auto`||t.overflowX===`scroll`||t.overflowY===`auto`||t.overflowY===`scroll`}_collectScrollCloseTargets(e){let t=[],n=new Set,r=e=>{!e||n.has(e)||(n.add(e),t.push(e))};r(window),e.querySelectorAll(`[id^="mint-rt-vscroll-"]`).forEach(e=>{this._elementIsScrollContainer(e)&&r(e)});let i=e.querySelector(`mint-table`);for(;i&&i!==e;)this._elementIsScrollContainer(i)&&r(i),i=i.parentElement;return this._elementIsScrollContainer(e)&&r(e),t}_detachScrollCloseListeners(){for(let e of this._scrollCloseTargets)e.removeEventListener(`scroll`,this._onScrollClose,o);this._scrollCloseTargets=[]}_attachScrollCloseListeners(e){this._detachScrollCloseListeners(),this._scrollCloseTargets=this._collectScrollCloseTargets(e);for(let e of this._scrollCloseTargets)e.addEventListener(`scroll`,this._onScrollClose,o)}_closePopover(){if(this._detachScrollCloseListeners(),!this._popover?.hasAttribute(`open`))return;let e=this._popover;typeof e.close==`function`?e.close():this._popover.removeAttribute(`open`)}_openAtRowIndex(e,t,n){this._closePopover();let r=this._resolveTable();if(!r||typeof r.getRowByIndex!=`function`||!this._popover||!this._menuRoot)return;let i=this._popover,a=this._menuRoot,o=r.getRowByIndex(e);if(o===void 0)return;let s=this._slotTemplateElements();if(!s.length)return;this._positionAnchor(t,n),a.innerHTML=``,s.forEach(t=>{if(t.hasAttribute(`data-mint-rt-ctx-if-selection`)&&!(window.getSelection?.()?.toString?.()?.trim()??``))return;let n=t.cloneNode(!0);n.removeAttribute(`hidden`),n.addEventListener(`click`,t=>{t.stopPropagation();let r=n.getAttribute(`data-context-action`)||n.querySelector?.(`[data-context-action]`)?.getAttribute(`data-context-action`)||``,i=window.getSelection?.()?.toString?.()?.trim()??``;this.dispatchEvent(new CustomEvent(`context-action`,{bubbles:!0,composed:!0,detail:{action:r,row:o,rowIndex:e,selectedText:i}})),this._closePopover()}),a.appendChild(n);let r=n;typeof r.render==`function`&&queueMicrotask(()=>r.render())}),i.removeAttribute(`open`),i.offsetHeight,i.setAttribute(`open`,`true`);let c=i;typeof c.render==`function`&&queueMicrotask(()=>c.render());let l=this._resolveTable();l&&this._attachScrollCloseListeners(l)}};customElements.get(`mint-resource-table-context-menu`)||e.t(`mint-resource-table-context-menu`,s),module.exports=r;
|