lituix 0.1.29 → 0.1.30

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/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDescriptor;var W2=Object.getOwnPropertyNames;var U2=Object.getPrototypeOf,G2=Object.prototype.hasOwnProperty;var dh=i=>{throw TypeError(i)};var nc=(i,o)=>()=>(i&&(o=i(i=0)),o);var Y2=(i,o)=>()=>(o||i((o={exports:{}}).exports,o),o.exports),X2=(i,o)=>{for(var e in o)fs(i,e,{get:o[e],enumerable:!0})},Z2=(i,o,e,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of W2(o))!G2.call(i,r)&&r!==e&&fs(i,r,{get:()=>o[r],enumerable:!(t=ch(o,r))||t.enumerable});return i};var da=(i,o,e)=>(e=i!=null?K2(U2(i)):{},Z2(o||!i||!i.__esModule?fs(e,"default",{value:i,enumerable:!0}):e,i));var a=(i,o,e,t)=>{for(var r=t>1?void 0:t?ch(o,e):o,n=i.length-1,s;n>=0;n--)(s=i[n])&&(r=(t?s(o,e,r):s(r))||r);return t&&r&&fs(o,e,r),r};var uh=(i,o,e)=>o.has(i)||dh("Cannot "+e);var ve=(i,o,e)=>(uh(i,o,"read from private field"),e?e.call(i):o.get(i)),hh=(i,o,e)=>o.has(i)?dh("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(i):o.set(i,e),ph=(i,o,e,t)=>(uh(i,o,"write to private field"),t?t.call(i,e):o.set(i,e),e);var Sa,xp=nc(()=>{Sa=class{constructor(o){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,o?.roundAverageSize===!0&&(this._roundAverageSize=!0)}set(o,e){let t=this._map.get(o)||0;this._map.set(o,e),this.totalSize+=e-t}get averageSize(){if(this._map.size>0){let o=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(o):o}return 0}getSize(o){return this._map.get(o)}clear(){this._map.clear(),this.totalSize=0}}});function Oc(i){return i==="horizontal"?"width":"height"}var Ns,wp=nc(()=>{Ns=class{_getDefaultConfig(){return{direction:"vertical"}}constructor(o,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=o,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(o){Object.assign(this,Object.assign({},this._getDefaultConfig(),o))}get config(){return{direction:this.direction}}get items(){return this._items}set items(o){this._setItems(o)}_setItems(o){o!==this._items&&(this._items=o,this._scheduleReflow())}get direction(){return this._direction}set direction(o){o=o==="horizontal"?o:"vertical",o!==this._direction&&(this._direction=o,this._sizeDim=o==="horizontal"?"width":"height",this._secondarySizeDim=o==="horizontal"?"height":"width",this._positionDim=o==="horizontal"?"left":"top",this._secondaryPositionDim=o==="horizontal"?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(o){let{_viewDim1:e,_viewDim2:t}=this;Object.assign(this._viewportSize,o),t!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(o){Object.assign(this._latestCoords,o);let e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(o=!1){(o||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(o){this._pin=o,this._triggerReflow()}get pin(){if(this._pin!==null){let{index:o,block:e}=this._pin;return{index:Math.max(0,Math.min(o,this.items.length-1)),block:e}}return null}_clampScrollPosition(o){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(o,this.totalScrollSize[Oc(this.direction)]-this._viewDim1))}unpin(){this._pin!==null&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(this.pin!==null){let o=this._scrollPosition,{index:e,block:t}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:t||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=o-this._scrollPosition}}_calculateScrollIntoViewPosition(o){let{block:e}=o,t=Math.min(this.items.length,Math.max(0,o.index)),r=this._getItemPosition(t)[this._positionDim],n=r;if(e!=="start"){let s=this._getItemSize(t)[this._sizeDim];if(e==="center")n=r-.5*this._viewDim1+.5*s;else{let d=r-this._viewDim1+s;if(e==="end")n=d;else{let h=this._scrollPosition;n=Math.abs(h-r)<Math.abs(h-d)?r:d}}}return n+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(n)}getScrollIntoViewCoordinates(o){return{[this._positionDim]:this._calculateScrollIntoViewPosition(o)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){let o=new Map;if(this._first!==-1&&this._last!==-1)for(let t=this._first;t<=this._last;t++)o.set(t,this._getItemPosition(t));let e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:o};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return this._first===-1||this._last===-1?0:this._last-this._first+1}_checkThresholds(){if(this._viewDim1===0&&this._num>0||this._pin!==null)this._scheduleReflow();else{let o=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>o||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(o){if(this._first===-1||this._last===-1)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let t=this._last;for(;t>this._first&&Math.round(this._getItemPosition(t)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)t--;(e!==this._firstVisible||t!==this._lastVisible)&&(this._firstVisible=e,this._lastVisible=t,o&&o.emit&&this._sendVisibilityChangedMessage())}}});var Mp={};X2(Mp,{FlowLayout:()=>Ls,flow:()=>wf});function _p(i){return i==="horizontal"?"marginLeft":"marginTop"}function _f(i){return i==="horizontal"?"marginRight":"marginBottom"}function Mf(i){return i==="horizontal"?"xOffset":"yOffset"}function Cf(i,o){let e=[i,o].sort();return e[1]<=0?Math.min(...e):e[0]>=0?Math.max(...e):e[0]+e[1]}var wf,Hc,Ls,Cp=nc(()=>{xp();wp();wf=i=>Object.assign({type:Ls},i);Hc=class{constructor(){this._childSizeCache=new Sa,this._marginSizeCache=new Sa,this._metricsCache=new Map}update(o,e){let t=new Set;Object.keys(o).forEach(r=>{let n=Number(r);this._metricsCache.set(n,o[n]),this._childSizeCache.set(n,o[n][Oc(e)]),t.add(n),t.add(n+1)});for(let r of t){let n=this._metricsCache.get(r)?.[_p(e)]||0,s=this._metricsCache.get(r-1)?.[_f(e)]||0;this._marginSizeCache.set(r,Cf(n,s))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(o,e){return this._metricsCache.get(o)?.[_p(e)]||0}getChildSize(o){return this._childSizeCache.getSize(o)}getMarginSize(o){return this._marginSizeCache.getSize(o)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}},Ls=class extends Ns{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new Hc,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(o){this._metricsCache.update(o,this.direction),this._scheduleReflow()}_getPhysicalItem(o){return this._newPhysicalItems.get(o)??this._physicalItems.get(o)}_getSize(o){return this._getPhysicalItem(o)&&this._metricsCache.getChildSize(o)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(o){let e=this._metricsCache;if(this._first===-1||this._last===-1)return e.averageMarginSize+o*(e.averageMarginSize+this._getAverageSize());if(o<this._first){let t=this._first-o;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(t*e.averageChildSize+(t-1)*e.averageMarginSize)}else{let t=o-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+t*(e.averageChildSize+e.averageMarginSize)}}_getPosition(o){let e=this._getPhysicalItem(o),{averageMarginSize:t}=this._metricsCache;return o===0?this._metricsCache.getMarginSize(0)??t:e?e.pos:this._estimatePosition(o)}_calculateAnchor(o,e){return o<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((o+e)/2/this._delta)))}_getAnchor(o,e){if(this._physicalItems.size===0)return this._calculateAnchor(o,e);if(this._first<0)return this._calculateAnchor(o,e);if(this._last<0)return this._calculateAnchor(o,e);let t=this._getPhysicalItem(this._first),r=this._getPhysicalItem(this._last),n=t.pos;if(r.pos+this._metricsCache.getChildSize(this._last)<o)return this._calculateAnchor(o,e);if(n>e)return this._calculateAnchor(o,e);let h=this._firstVisible-1,p=-1/0;for(;p<o;)p=this._getPhysicalItem(++h).pos+this._metricsCache.getChildSize(h);return h}_getActiveItems(){this._viewDim1===0||this.items.length===0?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;let o=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=o,this._stable=!0}_getItems(){let o=this._newPhysicalItems;this._stable=!0;let e,t;if(this.pin!==null){let{index:p}=this.pin;this._anchorIdx=p,this._anchorPos=this._getPosition(p)}if(e=this._scrollPosition-this._overhang,t=this._scrollPosition+this._viewDim1+this._overhang,t<0||e>this._scrollSize){this._clearItems();return}(this._anchorIdx===null||this._anchorPos===null)&&(this._anchorIdx=this._getAnchor(e,t),this._anchorPos=this._getPosition(this._anchorIdx));let r=this._getSize(this._anchorIdx);r===void 0&&(this._stable=!1,r=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,s=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;this._anchorIdx===0&&(this._anchorPos=n),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-s-r);let d=0;for(this._anchorPos+r+s<e&&(d=e-(this._anchorPos+r+s)),this._anchorPos-n>t&&(d=t-(this._anchorPos-n)),d&&(this._scrollPosition-=d,e-=d,t-=d,this._scrollError+=d),o.set(this._anchorIdx,{pos:this._anchorPos,size:r}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-n,this._physicalMax=this._anchorPos+r+s;this._physicalMin>e&&this._first>0;){let p=this._getSize(--this._first);p===void 0&&(this._stable=!1,p=this._getAverageSize());let f=this._metricsCache.getMarginSize(this._first);f===void 0&&(this._stable=!1,f=this._metricsCache.averageMarginSize),this._physicalMin-=p;let x=this._physicalMin;if(o.set(this._first,{pos:x,size:p}),this._physicalMin-=f,this._stable===!1&&this._estimate===!1)break}for(;this._physicalMax<t&&this._last<this.items.length-1;){let p=this._getSize(++this._last);p===void 0&&(this._stable=!1,p=this._getAverageSize());let f=this._metricsCache.getMarginSize(this._last);f===void 0&&(this._stable=!1,f=this._metricsCache.averageMarginSize);let x=this._physicalMax;if(o.set(this._last,{pos:x,size:p}),this._physicalMax+=p+f,!this._stable&&!this._estimate)break}let h=this._calculateError();h&&(this._physicalMin-=h,this._physicalMax-=h,this._anchorPos-=h,this._scrollPosition-=h,o.forEach(p=>p.pos-=h),this._scrollError+=h),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=o)}_calculateError(){return this._first===0?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){let{_first:o,_last:e}=this;super._reflow(),(this._first===-1&&this._last==-1||this._first===o&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){let{averageMarginSize:o}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(o+this._getAverageSize())+o)}get _delta(){let{averageMarginSize:o}=this._metricsCache;return this._getAverageSize()+o}_getItemPosition(o){return{[this._positionDim]:this._getPosition(o),[this._secondaryPositionDim]:0,[Mf(this.direction)]:-(this._metricsCache.getLeadingMarginValue(o,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(o){return{[this._sizeDim]:this._getSize(o)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});var _n=Y2((Lc,Bi)=>{(function(i,o){typeof Lc=="object"&&typeof Bi<"u"?Bi.exports=o():typeof define=="function"&&define.amd?define(o):(i=typeof globalThis<"u"?globalThis:i||self).interact=o()})(Lc,function(){"use strict";function i(c,l){var u=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);l&&(m=m.filter(function(g){return Object.getOwnPropertyDescriptor(c,g).enumerable})),u.push.apply(u,m)}return u}function o(c){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?i(Object(u),!0).forEach(function(m){s(c,m,u[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):i(Object(u)).forEach(function(m){Object.defineProperty(c,m,Object.getOwnPropertyDescriptor(u,m))})}return c}function e(c){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(c)}function t(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function r(c,l){for(var u=0;u<l.length;u++){var m=l[u];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,C(m.key),m)}}function n(c,l,u){return l&&r(c.prototype,l),u&&r(c,u),Object.defineProperty(c,"prototype",{writable:!1}),c}function s(c,l,u){return(l=C(l))in c?Object.defineProperty(c,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):c[l]=u,c}function d(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(l&&l.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),l&&p(c,l)}function h(c){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},h(c)}function p(c,l){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,m){return u.__proto__=m,u},p(c,l)}function f(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function x(c){var l=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var u,m=h(c);if(l){var g=h(this).constructor;u=Reflect.construct(m,arguments,g)}else u=m.apply(this,arguments);return function(v,b){if(b&&(typeof b=="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(v)}(this,u)}}function k(){return k=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(c,l,u){var m=function(v,b){for(;!Object.prototype.hasOwnProperty.call(v,b)&&(v=h(v))!==null;);return v}(c,l);if(m){var g=Object.getOwnPropertyDescriptor(m,l);return g.get?g.get.call(arguments.length<3?c:u):g.value}},k.apply(this,arguments)}function C(c){var l=function(u,m){if(typeof u!="object"||u===null)return u;var g=u[Symbol.toPrimitive];if(g!==void 0){var v=g.call(u,m||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(u)}(c,"string");return typeof l=="symbol"?l:l+""}var S=function(c){return!(!c||!c.Window)&&c instanceof c.Window},z=void 0,T=void 0;function P(c){z=c;var l=c.document.createTextNode("");l.ownerDocument!==c.document&&typeof c.wrap=="function"&&c.wrap(l)===l&&(c=c.wrap(c)),T=c}function H(c){return S(c)?c:(c.ownerDocument||c).defaultView||T.window}typeof window<"u"&&window&&P(window);var R=function(c){return!!c&&e(c)==="object"},N=function(c){return typeof c=="function"},$={window:function(c){return c===T||S(c)},docFrag:function(c){return R(c)&&c.nodeType===11},object:R,func:N,number:function(c){return typeof c=="number"},bool:function(c){return typeof c=="boolean"},string:function(c){return typeof c=="string"},element:function(c){if(!c||e(c)!=="object")return!1;var l=H(c)||T;return/object|function/.test(typeof Element>"u"?"undefined":e(Element))?c instanceof Element||c instanceof l.Element:c.nodeType===1&&typeof c.nodeName=="string"},plainObject:function(c){return R(c)&&!!c.constructor&&/function Object\b/.test(c.constructor.toString())},array:function(c){return R(c)&&c.length!==void 0&&N(c.splice)}};function Q(c){var l=c.interaction;if(l.prepared.name==="drag"){var u=l.prepared.axis;u==="x"?(l.coords.cur.page.y=l.coords.start.page.y,l.coords.cur.client.y=l.coords.start.client.y,l.coords.velocity.client.y=0,l.coords.velocity.page.y=0):u==="y"&&(l.coords.cur.page.x=l.coords.start.page.x,l.coords.cur.client.x=l.coords.start.client.x,l.coords.velocity.client.x=0,l.coords.velocity.page.x=0)}}function fe(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="drag"){var m=u.prepared.axis;if(m==="x"||m==="y"){var g=m==="x"?"y":"x";l.page[g]=u.coords.start.page[g],l.client[g]=u.coords.start.client[g],l.delta[g]=0}}}var Te={id:"actions/drag",install:function(c){var l=c.actions,u=c.Interactable,m=c.defaults;u.prototype.draggable=Te.draggable,l.map.drag=Te,l.methodDict.drag="draggable",m.actions.drag=Te.defaults},listeners:{"interactions:before-action-move":Q,"interactions:action-resume":Q,"interactions:action-move":fe,"auto-start:check":function(c){var l=c.interaction,u=c.interactable,m=c.buttons,g=u.options.drag;if(g&&g.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||m&u.options.drag.mouseButtons))return c.action={name:"drag",axis:g.lockAxis==="start"?g.startAxis:g.lockAxis},!1}},draggable:function(c){return $.object(c)?(this.options.drag.enabled=c.enabled!==!1,this.setPerAction("drag",c),this.setOnEvents("drag",c),/^(xy|x|y|start)$/.test(c.lockAxis)&&(this.options.drag.lockAxis=c.lockAxis),/^(xy|x|y)$/.test(c.startAxis)&&(this.options.drag.startAxis=c.startAxis),this):$.bool(c)?(this.options.drag.enabled=c,this):this.options.drag},beforeMove:Q,move:fe,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(c){return c.search("drag")===0}},et=Te,we={init:function(c){var l=c;we.document=l.document,we.DocumentFragment=l.DocumentFragment||ao,we.SVGElement=l.SVGElement||ao,we.SVGSVGElement=l.SVGSVGElement||ao,we.SVGElementInstance=l.SVGElementInstance||ao,we.Element=l.Element||ao,we.HTMLElement=l.HTMLElement||we.Element,we.Event=l.Event,we.Touch=l.Touch||ao,we.PointerEvent=l.PointerEvent||l.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function ao(){}var Fe=we,Zt={init:function(c){var l=Fe.Element,u=c.navigator||{};Zt.supportsTouch="ontouchstart"in c||$.func(c.DocumentTouch)&&Fe.document instanceof c.DocumentTouch,Zt.supportsPointerEvent=u.pointerEnabled!==!1&&!!Fe.PointerEvent,Zt.isIOS=/iP(hone|od|ad)/.test(u.platform),Zt.isIOS7=/iP(hone|od|ad)/.test(u.platform)&&/OS 7[^\d]/.test(u.appVersion),Zt.isIe9=/MSIE 9/.test(u.userAgent),Zt.isOperaMobile=u.appName==="Opera"&&Zt.supportsTouch&&/Presto/.test(u.userAgent),Zt.prefixedMatchesSelector="matches"in l.prototype?"matches":"webkitMatchesSelector"in l.prototype?"webkitMatchesSelector":"mozMatchesSelector"in l.prototype?"mozMatchesSelector":"oMatchesSelector"in l.prototype?"oMatchesSelector":"msMatchesSelector",Zt.pEventTypes=Zt.supportsPointerEvent?Fe.PointerEvent===c.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,Zt.wheelEvent=Fe.document&&"onmousewheel"in Fe.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},hr=Zt;function so(c,l){if(c.contains)return c.contains(l);for(;l;){if(l===c)return!0;l=l.parentNode}return!1}function sn(c,l){for(;$.element(c);){if(Po(c,l))return c;c=Yr(c)}return null}function Yr(c){var l=c.parentNode;if($.docFrag(l)){for(;(l=l.host)&&$.docFrag(l););return l}return l}function Po(c,l){return T!==z&&(l=l.replace(/\/deep\//g," ")),c[hr.prefixedMatchesSelector](l)}var L=function(c){return c.parentNode||c.host};function J(c,l){for(var u,m=[],g=c;(u=L(g))&&g!==l&&u!==g.ownerDocument;)m.unshift(g),g=u;return m}function he(c,l,u){for(;$.element(c);){if(Po(c,l))return!0;if((c=Yr(c))===u)return Po(c,l)}return!1}function Oe(c){return c.correspondingUseElement||c}function X(c){var l=c instanceof Fe.SVGElement?c.getBoundingClientRect():c.getClientRects()[0];return l&&{left:l.left,right:l.right,top:l.top,bottom:l.bottom,width:l.width||l.right-l.left,height:l.height||l.bottom-l.top}}function _e(c){var l,u=X(c);if(!hr.isIOS7&&u){var m={x:(l=(l=H(c))||T).scrollX||l.document.documentElement.scrollLeft,y:l.scrollY||l.document.documentElement.scrollTop};u.left+=m.x,u.right+=m.x,u.top+=m.y,u.bottom+=m.y}return u}function ae(c){for(var l=[];c;)l.push(c),c=Yr(c);return l}function Tr(c){return!!$.string(c)&&(Fe.document.querySelector(c),!0)}function K(c,l){for(var u in l)c[u]=l[u];return c}function si(c,l,u){return c==="parent"?Yr(u):c==="self"?l.getRect(u):sn(u,c)}function lo(c,l,u,m){var g=c;return $.string(g)?g=si(g,l,u):$.func(g)&&(g=g.apply(void 0,m)),$.element(g)&&(g=_e(g)),g}function Xr(c){return c&&{x:"x"in c?c.x:c.left,y:"y"in c?c.y:c.top}}function co(c){return!c||"x"in c&&"y"in c||((c=K({},c)).x=c.left||0,c.y=c.top||0,c.width=c.width||(c.right||0)-c.x,c.height=c.height||(c.bottom||0)-c.y),c}function li(c,l,u){c.left&&(l.left+=u.x),c.right&&(l.right+=u.x),c.top&&(l.top+=u.y),c.bottom&&(l.bottom+=u.y),l.width=l.right-l.left,l.height=l.bottom-l.top}function Bo(c,l,u){var m=u&&c.options[u];return Xr(lo(m&&m.origin||c.options.origin,c,l,[c&&l]))||{x:0,y:0}}function uo(c,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(w){return!0},m=arguments.length>3?arguments[3]:void 0;if(m=m||{},$.string(c)&&c.search(" ")!==-1&&(c=ln(c)),$.array(c))return c.forEach(function(w){return uo(w,l,u,m)}),m;if($.object(c)&&(l=c,c=""),$.func(l)&&u(c))m[c]=m[c]||[],m[c].push(l);else if($.array(l))for(var g=0,v=l;g<v.length;g++){var b=v[g];uo(c,b,u,m)}else if($.object(l))for(var y in l)uo(ln(y).map(function(w){return"".concat(c).concat(w)}),l[y],u,m);return m}function ln(c){return c.trim().split(/ +/)}var ea=function(c,l){return Math.sqrt(c*c+l*l)},P0=["webkit","moz"];function os(c,l){c.__set||(c.__set={});var u=function(g){if(P0.some(function(v){return g.indexOf(v)===0}))return 1;typeof c[g]!="function"&&g!=="__set"&&Object.defineProperty(c,g,{get:function(){return g in c.__set?c.__set[g]:c.__set[g]=l[g]},set:function(v){c.__set[g]=v},configurable:!0})};for(var m in l)u(m);return c}function is(c,l){c.page=c.page||{},c.page.x=l.page.x,c.page.y=l.page.y,c.client=c.client||{},c.client.x=l.client.x,c.client.y=l.client.y,c.timeStamp=l.timeStamp}function ku(c){c.page.x=0,c.page.y=0,c.client.x=0,c.client.y=0}function xu(c){return c instanceof Fe.Event||c instanceof Fe.Touch}function ns(c,l,u){return c=c||"page",(u=u||{}).x=l[c+"X"],u.y=l[c+"Y"],u}function wu(c,l){return l=l||{x:0,y:0},hr.isOperaMobile&&xu(c)?(ns("screen",c,l),l.x+=window.scrollX,l.y+=window.scrollY):ns("page",c,l),l}function ta(c){return $.number(c.pointerId)?c.pointerId:c.identifier}function j0(c,l,u){var m=l.length>1?_u(l):l[0];wu(m,c.page),function(g,v){v=v||{},hr.isOperaMobile&&xu(g)?ns("screen",g,v):ns("client",g,v)}(m,c.client),c.timeStamp=u}function Il(c){var l=[];return $.array(c)?(l[0]=c[0],l[1]=c[1]):c.type==="touchend"?c.touches.length===1?(l[0]=c.touches[0],l[1]=c.changedTouches[0]):c.touches.length===0&&(l[0]=c.changedTouches[0],l[1]=c.changedTouches[1]):(l[0]=c.touches[0],l[1]=c.touches[1]),l}function _u(c){for(var l={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},u=0;u<c.length;u++){var m=c[u];for(var g in l)l[g]+=m[g]}for(var v in l)l[v]/=c.length;return l}function Vl(c){if(!c.length)return null;var l=Il(c),u=Math.min(l[0].pageX,l[1].pageX),m=Math.min(l[0].pageY,l[1].pageY),g=Math.max(l[0].pageX,l[1].pageX),v=Math.max(l[0].pageY,l[1].pageY);return{x:u,y:m,left:u,top:m,right:g,bottom:v,width:g-u,height:v-m}}function Dl(c,l){var u=l+"X",m=l+"Y",g=Il(c),v=g[0][u]-g[1][u],b=g[0][m]-g[1][m];return ea(v,b)}function Fl(c,l){var u=l+"X",m=l+"Y",g=Il(c),v=g[1][u]-g[0][u],b=g[1][m]-g[0][m];return 180*Math.atan2(b,v)/Math.PI}function Mu(c){return $.string(c.pointerType)?c.pointerType:$.number(c.pointerType)?[void 0,void 0,"touch","pen","mouse"][c.pointerType]:/touch/.test(c.type||"")||c instanceof Fe.Touch?"touch":"mouse"}function Cu(c){var l=$.func(c.composedPath)?c.composedPath():c.path;return[Oe(l?l[0]:c.target),Oe(c.currentTarget)]}var as=function(){function c(l){t(this,c),this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=l}return n(c,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),c}();Object.defineProperty(as.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var zu=function(c,l){for(var u=0;u<l.length;u++){var m=l[u];c.push(m)}return c},Eu=function(c){return zu([],c)},ra=function(c,l){for(var u=0;u<c.length;u++)if(l(c[u],u,c))return u;return-1},oa=function(c,l){return c[ra(c,l)]},cn=function(c){d(u,c);var l=x(u);function u(m,g,v){var b;t(this,u),(b=l.call(this,g._interaction)).dropzone=void 0,b.dragEvent=void 0,b.relatedTarget=void 0,b.draggable=void 0,b.propagationStopped=!1,b.immediatePropagationStopped=!1;var y=v==="dragleave"?m.prev:m.cur,w=y.element,M=y.dropzone;return b.type=v,b.target=w,b.currentTarget=w,b.dropzone=M,b.dragEvent=g,b.relatedTarget=g.target,b.draggable=g.interactable,b.timeStamp=g.timeStamp,b}return n(u,[{key:"reject",value:function(){var m=this,g=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&g.cur.dropzone===this.dropzone&&g.cur.element===this.target)if(g.prev.dropzone=this.dropzone,g.prev.element=this.target,g.rejected=!0,g.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var v=g.activeDrops,b=ra(v,function(w){var M=w.dropzone,_=w.element;return M===m.dropzone&&_===m.target});g.activeDrops.splice(b,1);var y=new u(g,this.dragEvent,"dropdeactivate");y.dropzone=this.dropzone,y.target=this.target,this.dropzone.fire(y)}else this.dropzone.fire(new u(g,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),u}(as);function Su(c,l){for(var u=0,m=c.slice();u<m.length;u++){var g=m[u],v=g.dropzone,b=g.element;l.dropzone=v,l.target=b,v.fire(l),l.propagationStopped=l.immediatePropagationStopped=!1}}function Nl(c,l){for(var u=function(v,b){for(var y=[],w=0,M=v.interactables.list;w<M.length;w++){var _=M[w];if(_.options.drop.enabled){var E=_.options.drop.accept;if(!($.element(E)&&E!==b||$.string(E)&&!Po(b,E)||$.func(E)&&!E({dropzone:_,draggableElement:b})))for(var j=0,V=_.getAllElements();j<V.length;j++){var I=V[j];I!==b&&y.push({dropzone:_,element:I,rect:_.getRect(I)})}}}return y}(c,l),m=0;m<u.length;m++){var g=u[m];g.rect=g.dropzone.getRect(g.element)}return u}function $u(c,l,u){for(var m=c.dropState,g=c.interactable,v=c.element,b=[],y=0,w=m.activeDrops;y<w.length;y++){var M=w[y],_=M.dropzone,E=M.element,j=M.rect,V=_.dropCheck(l,u,g,v,E,j);b.push(V?E:null)}var I=function(D){for(var W,B,G,de=[],ke=0;ke<D.length;ke++){var te=D[ke],pe=D[W];if(te&&ke!==W)if(pe){var mr=L(te),tt=L(pe);if(mr!==te.ownerDocument)if(tt!==te.ownerDocument)if(mr!==tt){de=de.length?de:J(pe);var Fr=void 0;if(pe instanceof Fe.HTMLElement&&te instanceof Fe.SVGElement&&!(te instanceof Fe.SVGSVGElement)){if(te===tt)continue;Fr=te.ownerSVGElement}else Fr=te;for(var ho=J(Fr,pe.ownerDocument),Wo=0;ho[Wo]&&ho[Wo]===de[Wo];)Wo++;var gs=[ho[Wo-1],ho[Wo],de[Wo]];if(gs[0])for(var ca=gs[0].lastChild;ca;){if(ca===gs[1]){W=ke,de=ho;break}if(ca===gs[2])break;ca=ca.previousSibling}}else G=pe,(parseInt(H(B=te).getComputedStyle(B).zIndex,10)||0)>=(parseInt(H(G).getComputedStyle(G).zIndex,10)||0)&&(W=ke);else W=ke}else W=ke}return W}(b);return m.activeDrops[I]||null}function Ll(c,l,u){var m=c.dropState,g={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return u.type==="dragstart"&&(g.activate=new cn(m,u,"dropactivate"),g.activate.target=null,g.activate.dropzone=null),u.type==="dragend"&&(g.deactivate=new cn(m,u,"dropdeactivate"),g.deactivate.target=null,g.deactivate.dropzone=null),m.rejected||(m.cur.element!==m.prev.element&&(m.prev.dropzone&&(g.leave=new cn(m,u,"dragleave"),u.dragLeave=g.leave.target=m.prev.element,u.prevDropzone=g.leave.dropzone=m.prev.dropzone),m.cur.dropzone&&(g.enter=new cn(m,u,"dragenter"),u.dragEnter=m.cur.element,u.dropzone=m.cur.dropzone)),u.type==="dragend"&&m.cur.dropzone&&(g.drop=new cn(m,u,"drop"),u.dropzone=m.cur.dropzone,u.relatedTarget=m.cur.element),u.type==="dragmove"&&m.cur.dropzone&&(g.move=new cn(m,u,"dropmove"),u.dropzone=m.cur.dropzone)),g}function Bl(c,l){var u=c.dropState,m=u.activeDrops,g=u.cur,v=u.prev;l.leave&&v.dropzone.fire(l.leave),l.enter&&g.dropzone.fire(l.enter),l.move&&g.dropzone.fire(l.move),l.drop&&g.dropzone.fire(l.drop),l.deactivate&&Su(m,l.deactivate),u.prev.dropzone=g.dropzone,u.prev.element=g.element}function Tu(c,l){var u=c.interaction,m=c.iEvent,g=c.event;if(m.type==="dragmove"||m.type==="dragend"){var v=u.dropState;l.dynamicDrop&&(v.activeDrops=Nl(l,u.element));var b=m,y=$u(u,b,g);v.rejected=v.rejected&&!!y&&y.dropzone===v.cur.dropzone&&y.element===v.cur.element,v.cur.dropzone=y&&y.dropzone,v.cur.element=y&&y.element,v.events=Ll(u,0,b)}}var Au={id:"actions/drop",install:function(c){var l=c.actions,u=c.interactStatic,m=c.Interactable,g=c.defaults;c.usePlugin(et),m.prototype.dropzone=function(v){return function(b,y){if($.object(y)){if(b.options.drop.enabled=y.enabled!==!1,y.listeners){var w=uo(y.listeners),M=Object.keys(w).reduce(function(E,j){return E[/^(enter|leave)/.test(j)?"drag".concat(j):/^(activate|deactivate|move)/.test(j)?"drop".concat(j):j]=w[j],E},{}),_=b.options.drop.listeners;_&&b.off(_),b.on(M),b.options.drop.listeners=M}return $.func(y.ondrop)&&b.on("drop",y.ondrop),$.func(y.ondropactivate)&&b.on("dropactivate",y.ondropactivate),$.func(y.ondropdeactivate)&&b.on("dropdeactivate",y.ondropdeactivate),$.func(y.ondragenter)&&b.on("dragenter",y.ondragenter),$.func(y.ondragleave)&&b.on("dragleave",y.ondragleave),$.func(y.ondropmove)&&b.on("dropmove",y.ondropmove),/^(pointer|center)$/.test(y.overlap)?b.options.drop.overlap=y.overlap:$.number(y.overlap)&&(b.options.drop.overlap=Math.max(Math.min(1,y.overlap),0)),"accept"in y&&(b.options.drop.accept=y.accept),"checker"in y&&(b.options.drop.checker=y.checker),b}return $.bool(y)?(b.options.drop.enabled=y,b):b.options.drop}(this,v)},m.prototype.dropCheck=function(v,b,y,w,M,_){return function(E,j,V,I,D,W,B){var G=!1;if(!(B=B||E.getRect(W)))return!!E.options.drop.checker&&E.options.drop.checker(j,V,G,E,W,I,D);var de=E.options.drop.overlap;if(de==="pointer"){var ke=Bo(I,D,"drag"),te=wu(j);te.x+=ke.x,te.y+=ke.y;var pe=te.x>B.left&&te.x<B.right,mr=te.y>B.top&&te.y<B.bottom;G=pe&&mr}var tt=I.getRect(D);if(tt&&de==="center"){var Fr=tt.left+tt.width/2,ho=tt.top+tt.height/2;G=Fr>=B.left&&Fr<=B.right&&ho>=B.top&&ho<=B.bottom}return tt&&$.number(de)&&(G=Math.max(0,Math.min(B.right,tt.right)-Math.max(B.left,tt.left))*Math.max(0,Math.min(B.bottom,tt.bottom)-Math.max(B.top,tt.top))/(tt.width*tt.height)>=de),E.options.drop.checker&&(G=E.options.drop.checker(j,V,G,E,W,I,D)),G}(this,v,b,y,w,M,_)},u.dynamicDrop=function(v){return $.bool(v)?(c.dynamicDrop=v,u):c.dynamicDrop},K(l.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),l.methodDict.drop="dropzone",c.dynamicDrop=!1,g.actions.drop=Au.defaults},listeners:{"interactions:before-action-start":function(c){var l=c.interaction;l.prepared.name==="drag"&&(l.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(c,l){var u=c.interaction,m=(c.event,c.iEvent);if(u.prepared.name==="drag"){var g=u.dropState;g.activeDrops=[],g.events={},g.activeDrops=Nl(l,u.element),g.events=Ll(u,0,m),g.events.activate&&(Su(g.activeDrops,g.events.activate),l.fire("actions/drop:start",{interaction:u,dragEvent:m}))}},"interactions:action-move":Tu,"interactions:after-action-move":function(c,l){var u=c.interaction,m=c.iEvent;if(u.prepared.name==="drag"){var g=u.dropState;Bl(u,g.events),l.fire("actions/drop:move",{interaction:u,dragEvent:m}),g.events={}}},"interactions:action-end":function(c,l){if(c.interaction.prepared.name==="drag"){var u=c.interaction,m=c.iEvent;Tu(c,l),Bl(u,u.dropState.events),l.fire("actions/drop:end",{interaction:u,dragEvent:m})}},"interactions:stop":function(c){var l=c.interaction;if(l.prepared.name==="drag"){var u=l.dropState;u&&(u.activeDrops=null,u.events=null,u.cur.dropzone=null,u.cur.element=null,u.prev.dropzone=null,u.prev.element=null,u.rejected=!1)}}},getActiveDrops:Nl,getDrop:$u,getDropEvents:Ll,fireDropEvents:Bl,filterEventType:function(c){return c.search("drag")===0||c.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},O0=Au;function ql(c){var l=c.interaction,u=c.iEvent,m=c.phase;if(l.prepared.name==="gesture"){var g=l.pointers.map(function(M){return M.pointer}),v=m==="start",b=m==="end",y=l.interactable.options.deltaSource;if(u.touches=[g[0],g[1]],v)u.distance=Dl(g,y),u.box=Vl(g),u.scale=1,u.ds=0,u.angle=Fl(g,y),u.da=0,l.gesture.startDistance=u.distance,l.gesture.startAngle=u.angle;else if(b||l.pointers.length<2){var w=l.prevEvent;u.distance=w.distance,u.box=w.box,u.scale=w.scale,u.ds=0,u.angle=w.angle,u.da=0}else u.distance=Dl(g,y),u.box=Vl(g),u.scale=u.distance/l.gesture.startDistance,u.angle=Fl(g,y),u.ds=u.scale-l.gesture.scale,u.da=u.angle-l.gesture.angle;l.gesture.distance=u.distance,l.gesture.angle=u.angle,$.number(u.scale)&&u.scale!==1/0&&!isNaN(u.scale)&&(l.gesture.scale=u.scale)}}var Kl={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(c){var l=c.actions,u=c.Interactable,m=c.defaults;u.prototype.gesturable=function(g){return $.object(g)?(this.options.gesture.enabled=g.enabled!==!1,this.setPerAction("gesture",g),this.setOnEvents("gesture",g),this):$.bool(g)?(this.options.gesture.enabled=g,this):this.options.gesture},l.map.gesture=Kl,l.methodDict.gesture="gesturable",m.actions.gesture=Kl.defaults},listeners:{"interactions:action-start":ql,"interactions:action-move":ql,"interactions:action-end":ql,"interactions:new":function(c){c.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(c){if(!(c.interaction.pointers.length<2)){var l=c.interactable.options.gesture;if(l&&l.enabled)return c.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(c){return c.search("gesture")===0}},H0=Kl;function R0(c,l,u,m,g,v,b){if(!l)return!1;if(l===!0){var y=$.number(v.width)?v.width:v.right-v.left,w=$.number(v.height)?v.height:v.bottom-v.top;if(b=Math.min(b,Math.abs((c==="left"||c==="right"?y:w)/2)),y<0&&(c==="left"?c="right":c==="right"&&(c="left")),w<0&&(c==="top"?c="bottom":c==="bottom"&&(c="top")),c==="left"){var M=y>=0?v.left:v.right;return u.x<M+b}if(c==="top"){var _=w>=0?v.top:v.bottom;return u.y<_+b}if(c==="right")return u.x>(y>=0?v.right:v.left)-b;if(c==="bottom")return u.y>(w>=0?v.bottom:v.top)-b}return!!$.element(m)&&($.element(l)?l===m:he(m,l,g))}function Pu(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="resize"&&u.resizeAxes){var m=l;u.interactable.options.resize.square?(u.resizeAxes==="y"?m.delta.x=m.delta.y:m.delta.y=m.delta.x,m.axes="xy"):(m.axes=u.resizeAxes,u.resizeAxes==="x"?m.delta.y=0:u.resizeAxes==="y"&&(m.delta.x=0))}}var qo,Pi,Ko={id:"actions/resize",before:["actions/drag"],install:function(c){var l=c.actions,u=c.browser,m=c.Interactable,g=c.defaults;Ko.cursors=function(v){return v.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(u),Ko.defaultMargin=u.supportsTouch||u.supportsPointerEvent?20:10,m.prototype.resizable=function(v){return function(b,y,w){return $.object(y)?(b.options.resize.enabled=y.enabled!==!1,b.setPerAction("resize",y),b.setOnEvents("resize",y),$.string(y.axis)&&/^x$|^y$|^xy$/.test(y.axis)?b.options.resize.axis=y.axis:y.axis===null&&(b.options.resize.axis=w.defaults.actions.resize.axis),$.bool(y.preserveAspectRatio)?b.options.resize.preserveAspectRatio=y.preserveAspectRatio:$.bool(y.square)&&(b.options.resize.square=y.square),b):$.bool(y)?(b.options.resize.enabled=y,b):b.options.resize}(this,v,c)},l.map.resize=Ko,l.methodDict.resize="resizable",g.actions.resize=Ko.defaults},listeners:{"interactions:new":function(c){c.interaction.resizeAxes="xy"},"interactions:action-start":function(c){(function(l){var u=l.iEvent,m=l.interaction;if(m.prepared.name==="resize"&&m.prepared.edges){var g=u,v=m.rect;m._rects={start:K({},v),corrected:K({},v),previous:K({},v),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},g.edges=m.prepared.edges,g.rect=m._rects.corrected,g.deltaRect=m._rects.delta}})(c),Pu(c)},"interactions:action-move":function(c){(function(l){var u=l.iEvent,m=l.interaction;if(m.prepared.name==="resize"&&m.prepared.edges){var g=u,v=m.interactable.options.resize.invert,b=v==="reposition"||v==="negate",y=m.rect,w=m._rects,M=w.start,_=w.corrected,E=w.delta,j=w.previous;if(K(j,_),b){if(K(_,y),v==="reposition"){if(_.top>_.bottom){var V=_.top;_.top=_.bottom,_.bottom=V}if(_.left>_.right){var I=_.left;_.left=_.right,_.right=I}}}else _.top=Math.min(y.top,M.bottom),_.bottom=Math.max(y.bottom,M.top),_.left=Math.min(y.left,M.right),_.right=Math.max(y.right,M.left);for(var D in _.width=_.right-_.left,_.height=_.bottom-_.top,_)E[D]=_[D]-j[D];g.edges=m.prepared.edges,g.rect=_,g.deltaRect=E}})(c),Pu(c)},"interactions:action-end":function(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="resize"&&u.prepared.edges){var m=l;m.edges=u.prepared.edges,m.rect=u._rects.corrected,m.deltaRect=u._rects.delta}},"auto-start:check":function(c){var l=c.interaction,u=c.interactable,m=c.element,g=c.rect,v=c.buttons;if(g){var b=K({},l.coords.cur.page),y=u.options.resize;if(y&&y.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||v&y.mouseButtons)){if($.object(y.edges)){var w={left:!1,right:!1,top:!1,bottom:!1};for(var M in w)w[M]=R0(M,y.edges[M],b,l._latestPointer.eventTarget,m,g,y.margin||Ko.defaultMargin);w.left=w.left&&!w.right,w.top=w.top&&!w.bottom,(w.left||w.right||w.top||w.bottom)&&(c.action={name:"resize",edges:w})}else{var _=y.axis!=="y"&&b.x>g.right-Ko.defaultMargin,E=y.axis!=="x"&&b.y>g.bottom-Ko.defaultMargin;(_||E)&&(c.action={name:"resize",axes:(_?"x":"")+(E?"y":"")})}return!c.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(c){var l=c.edges,u=c.axis,m=c.name,g=Ko.cursors,v=null;if(u)v=g[m+u];else if(l){for(var b="",y=0,w=["top","bottom","left","right"];y<w.length;y++){var M=w[y];l[M]&&(b+=M)}v=g[b]}return v},filterEventType:function(c){return c.search("resize")===0},defaultMargin:null},I0=Ko,V0={id:"actions",install:function(c){c.usePlugin(H0),c.usePlugin(I0),c.usePlugin(et),c.usePlugin(O0)}},ju=0,ci={request:function(c){return qo(c)},cancel:function(c){return Pi(c)},init:function(c){if(qo=c.requestAnimationFrame,Pi=c.cancelAnimationFrame,!qo)for(var l=["ms","moz","webkit","o"],u=0;u<l.length;u++){var m=l[u];qo=c["".concat(m,"RequestAnimationFrame")],Pi=c["".concat(m,"CancelAnimationFrame")]||c["".concat(m,"CancelRequestAnimationFrame")]}qo=qo&&qo.bind(c),Pi=Pi&&Pi.bind(c),qo||(qo=function(g){var v=Date.now(),b=Math.max(0,16-(v-ju)),y=c.setTimeout(function(){g(v+b)},b);return ju=v+b,y},Pi=function(g){return clearTimeout(g)})}},re={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(c){re.isScrolling=!0,ci.cancel(re.i),c.autoScroll=re,re.interaction=c,re.prevTime=re.now(),re.i=ci.request(re.scroll)},stop:function(){re.isScrolling=!1,re.interaction&&(re.interaction.autoScroll=null),ci.cancel(re.i)},scroll:function(){var c=re.interaction,l=c.interactable,u=c.element,m=c.prepared.name,g=l.options[m].autoScroll,v=Ou(g.container,l,u),b=re.now(),y=(b-re.prevTime)/1e3,w=g.speed*y;if(w>=1){var M={x:re.x*w,y:re.y*w};if(M.x||M.y){var _=Hu(v);$.window(v)?v.scrollBy(M.x,M.y):v&&(v.scrollLeft+=M.x,v.scrollTop+=M.y);var E=Hu(v),j={x:E.x-_.x,y:E.y-_.y};(j.x||j.y)&&l.fire({type:"autoscroll",target:u,interactable:l,delta:j,interaction:c,container:v})}re.prevTime=b}re.isScrolling&&(ci.cancel(re.i),re.i=ci.request(re.scroll))},check:function(c,l){var u;return(u=c.options[l].autoScroll)==null?void 0:u.enabled},onInteractionMove:function(c){var l=c.interaction,u=c.pointer;if(l.interacting()&&re.check(l.interactable,l.prepared.name))if(l.simulation)re.x=re.y=0;else{var m,g,v,b,y=l.interactable,w=l.element,M=l.prepared.name,_=y.options[M].autoScroll,E=Ou(_.container,y,w);if($.window(E))b=u.clientX<re.margin,m=u.clientY<re.margin,g=u.clientX>E.innerWidth-re.margin,v=u.clientY>E.innerHeight-re.margin;else{var j=X(E);b=u.clientX<j.left+re.margin,m=u.clientY<j.top+re.margin,g=u.clientX>j.right-re.margin,v=u.clientY>j.bottom-re.margin}re.x=g?1:b?-1:0,re.y=v?1:m?-1:0,re.isScrolling||(re.margin=_.margin,re.speed=_.speed,re.start(l))}}};function Ou(c,l,u){return($.string(c)?si(c,l,u):c)||H(u)}function Hu(c){return $.window(c)&&(c=window.document.body),{x:c.scrollLeft,y:c.scrollTop}}var D0={id:"auto-scroll",install:function(c){var l=c.defaults,u=c.actions;c.autoScroll=re,re.now=function(){return c.now()},u.phaselessTypes.autoscroll=!0,l.perAction.autoScroll=re.defaults},listeners:{"interactions:new":function(c){c.interaction.autoScroll=null},"interactions:destroy":function(c){c.interaction.autoScroll=null,re.stop(),re.interaction&&(re.interaction=null)},"interactions:stop":re.stop,"interactions:action-move":function(c){return re.onInteractionMove(c)}}},F0=D0;function ia(c,l){var u=!1;return function(){return u||(T.console.warn(l),u=!0),c.apply(this,arguments)}}function Wl(c,l){return c.name=l.name,c.axis=l.axis,c.edges=l.edges,c}function N0(c){return $.bool(c)?(this.options.styleCursor=c,this):c===null?(delete this.options.styleCursor,this):this.options.styleCursor}function L0(c){return $.func(c)?(this.options.actionChecker=c,this):c===null?(delete this.options.actionChecker,this):this.options.actionChecker}var B0={id:"auto-start/interactableMethods",install:function(c){var l=c.Interactable;l.prototype.getAction=function(u,m,g,v){var b=function(y,w,M,_,E){var j=y.getRect(_),V=w.buttons||{0:1,1:4,3:8,4:16}[w.button],I={action:null,interactable:y,interaction:M,element:_,rect:j,buttons:V};return E.fire("auto-start:check",I),I.action}(this,m,g,v,c);return this.options.actionChecker?this.options.actionChecker(u,m,b,this,v,g):b},l.prototype.ignoreFrom=ia(function(u){return this._backCompatOption("ignoreFrom",u)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),l.prototype.allowFrom=ia(function(u){return this._backCompatOption("allowFrom",u)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),l.prototype.actionChecker=L0,l.prototype.styleCursor=N0}};function Ru(c,l,u,m,g){return l.testIgnoreAllow(l.options[c.name],u,m)&&l.options[c.name].enabled&&ss(l,u,c,g)?c:null}function q0(c,l,u,m,g,v,b){for(var y=0,w=m.length;y<w;y++){var M=m[y],_=g[y],E=M.getAction(l,u,c,_);if(E){var j=Ru(E,M,_,v,b);if(j)return{action:j,interactable:M,element:_}}}return{action:null,interactable:null,element:null}}function Iu(c,l,u,m,g){var v=[],b=[],y=m;function w(_){v.push(_),b.push(y)}for(;$.element(y);){v=[],b=[],g.interactables.forEachMatch(y,w);var M=q0(c,l,u,v,b,m,g);if(M.action&&!M.interactable.options[M.action.name].manualStart)return M;y=Yr(y)}return{action:null,interactable:null,element:null}}function Vu(c,l,u){var m=l.action,g=l.interactable,v=l.element;m=m||{name:null},c.interactable=g,c.element=v,Wl(c.prepared,m),c.rect=g&&m.name?g.getRect(v):null,Fu(c,u),u.fire("autoStart:prepared",{interaction:c})}function ss(c,l,u,m){var g=c.options,v=g[u.name].max,b=g[u.name].maxPerElement,y=m.autoStart.maxInteractions,w=0,M=0,_=0;if(!(v&&b&&y))return!1;for(var E=0,j=m.interactions.list;E<j.length;E++){var V=j[E],I=V.prepared.name;if(V.interacting()&&(++w>=y||V.interactable===c&&((M+=I===u.name?1:0)>=v||V.element===l&&(_++,I===u.name&&_>=b))))return!1}return y>0}function Du(c,l){return $.number(c)?(l.autoStart.maxInteractions=c,this):l.autoStart.maxInteractions}function Ul(c,l,u){var m=u.autoStart.cursorElement;m&&m!==c&&(m.style.cursor=""),c.ownerDocument.documentElement.style.cursor=l,c.style.cursor=l,u.autoStart.cursorElement=l?c:null}function Fu(c,l){var u=c.interactable,m=c.element,g=c.prepared;if(c.pointerType==="mouse"&&u&&u.options.styleCursor){var v="";if(g.name){var b=u.options[g.name].cursorChecker;v=$.func(b)?b(g,u,m,c._interacting):l.actions.map[g.name].getCursor(g)}Ul(c.element,v||"",l)}else l.autoStart.cursorElement&&Ul(l.autoStart.cursorElement,"",l)}var K0={id:"auto-start/base",before:["actions"],install:function(c){var l=c.interactStatic,u=c.defaults;c.usePlugin(B0),u.base.actionChecker=null,u.base.styleCursor=!0,K(u.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),l.maxInteractions=function(m){return Du(m,c)},c.autoStart={maxInteractions:1/0,withinInteractionLimit:ss,cursorElement:null}},listeners:{"interactions:down":function(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget;u.interacting()||Vu(u,Iu(u,m,g,v,l),l)},"interactions:move":function(c,l){(function(u,m){var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget;g.pointerType!=="mouse"||g.pointerIsDown||g.interacting()||Vu(g,Iu(g,v,b,y,m),m)})(c,l),function(u,m){var g=u.interaction;if(g.pointerIsDown&&!g.interacting()&&g.pointerWasMoved&&g.prepared.name){m.fire("autoStart:before-start",u);var v=g.interactable,b=g.prepared.name;b&&v&&(v.options[b].manualStart||!ss(v,g.element,g.prepared,m)?g.stop():(g.start(g.prepared,v,g.element),Fu(g,m)))}}(c,l)},"interactions:stop":function(c,l){var u=c.interaction,m=u.interactable;m&&m.options.styleCursor&&Ul(u.element,"",l)}},maxInteractions:Du,withinInteractionLimit:ss,validateAction:Ru},Gl=K0,W0={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(c,l){var u=c.interaction,m=c.eventTarget,g=c.dx,v=c.dy;if(u.prepared.name==="drag"){var b=Math.abs(g),y=Math.abs(v),w=u.interactable.options.drag,M=w.startAxis,_=b>y?"x":b<y?"y":"xy";if(u.prepared.axis=w.lockAxis==="start"?_[0]:w.lockAxis,_!=="xy"&&M!=="xy"&&M!==_){u.prepared.name=null;for(var E=m,j=function(I){if(I!==u.interactable){var D=u.interactable.options.drag;if(!D.manualStart&&I.testIgnoreAllow(D,E,m)){var W=I.getAction(u.downPointer,u.downEvent,u,E);if(W&&W.name==="drag"&&function(B,G){if(!G)return!1;var de=G.options.drag.startAxis;return B==="xy"||de==="xy"||de===B}(_,I)&&Gl.validateAction(W,I,E,m,l))return I}}};$.element(E);){var V=l.interactables.forEachMatch(E,j);if(V){u.prepared.name="drag",u.interactable=V,u.element=E;break}E=Yr(E)}}}}}};function Yl(c){var l=c.prepared&&c.prepared.name;if(!l)return null;var u=c.interactable.options;return u[l].hold||u[l].delay}var U0={id:"auto-start/hold",install:function(c){var l=c.defaults;c.usePlugin(Gl),l.perAction.hold=0,l.perAction.delay=0},listeners:{"interactions:new":function(c){c.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(c){var l=c.interaction,u=Yl(l);u>0&&(l.autoStartHoldTimer=setTimeout(function(){l.start(l.prepared,l.interactable,l.element)},u))},"interactions:move":function(c){var l=c.interaction,u=c.duplicate;l.autoStartHoldTimer&&l.pointerWasMoved&&!u&&(clearTimeout(l.autoStartHoldTimer),l.autoStartHoldTimer=null)},"autoStart:before-start":function(c){var l=c.interaction;Yl(l)>0&&(l.prepared.name=null)}},getHoldDuration:Yl},G0=U0,Y0={id:"auto-start",install:function(c){c.usePlugin(Gl),c.usePlugin(G0),c.usePlugin(W0)}},X0=function(c){return/^(always|never|auto)$/.test(c)?(this.options.preventDefault=c,this):$.bool(c)?(this.options.preventDefault=c?"always":"never",this):this.options.preventDefault};function Z0(c){var l=c.interaction,u=c.event;l.interactable&&l.interactable.checkAndPreventDefault(u)}var Nu={id:"core/interactablePreventDefault",install:function(c){var l=c.Interactable;l.prototype.preventDefault=X0,l.prototype.checkAndPreventDefault=function(u){return function(m,g,v){var b=m.options.preventDefault;if(b!=="never")if(b!=="always"){if(g.events.supportsPassive&&/^touch(start|move)$/.test(v.type)){var y=H(v.target).document,w=g.getDocOptions(y);if(!w||!w.events||w.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(v.type)||$.element(v.target)&&Po(v.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||v.preventDefault()}else v.preventDefault()}(this,c,u)},c.interactions.docEvents.push({type:"dragstart",listener:function(u){for(var m=0,g=c.interactions.list;m<g.length;m++){var v=g[m];if(v.element&&(v.element===u.target||so(v.element,u.target)))return void v.interactable.checkAndPreventDefault(u)}}})},listeners:["down","move","up","cancel"].reduce(function(c,l){return c["interactions:".concat(l)]=Z0,c},{})};function ls(c,l){if(l.phaselessTypes[c])return!0;for(var u in l.map)if(c.indexOf(u)===0&&c.substr(u.length)in l.phases)return!0;return!1}function dn(c){var l={};for(var u in c){var m=c[u];$.plainObject(m)?l[u]=dn(m):$.array(m)?l[u]=Eu(m):l[u]=m}return l}var Xl=function(){function c(l){t(this,c),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=l,this.result=cs(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return n(c,[{key:"start",value:function(l,u){var m,g,v=l.phase,b=this.interaction,y=function(M){var _=M.interactable.options[M.prepared.name],E=_.modifiers;return E&&E.length?E:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(j){var V=_[j];return V&&V.enabled&&{options:V,methods:V._methods}}).filter(function(j){return!!j})}(b);this.prepareStates(y),this.startEdges=K({},b.edges),this.edges=K({},this.startEdges),this.startOffset=(m=b.rect,g=u,m?{left:g.x-m.left,top:g.y-m.top,right:m.right-g.x,bottom:m.bottom-g.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var w=this.fillArg({phase:v,pageCoords:u,preEnd:!1});return this.result=cs(),this.startAll(w),this.result=this.setAll(w)}},{key:"fillArg",value:function(l){var u=this.interaction;return l.interaction=u,l.interactable=u.interactable,l.element=u.element,l.rect||(l.rect=u.rect),l.edges||(l.edges=this.startEdges),l.startOffset=this.startOffset,l}},{key:"startAll",value:function(l){for(var u=0,m=this.states;u<m.length;u++){var g=m[u];g.methods.start&&(l.state=g,g.methods.start(l))}}},{key:"setAll",value:function(l){var u=l.phase,m=l.preEnd,g=l.skipModifiers,v=l.rect,b=l.edges;l.coords=K({},l.pageCoords),l.rect=K({},v),l.edges=K({},b);for(var y=g?this.states.slice(g):this.states,w=cs(l.coords,l.rect),M=0;M<y.length;M++){var _,E=y[M],j=E.options,V=K({},l.coords),I=null;(_=E.methods)!=null&&_.set&&this.shouldDo(j,m,u)&&(l.state=E,I=E.methods.set(l),li(l.edges,l.rect,{x:l.coords.x-V.x,y:l.coords.y-V.y})),w.eventProps.push(I)}K(this.edges,l.edges),w.delta.x=l.coords.x-l.pageCoords.x,w.delta.y=l.coords.y-l.pageCoords.y,w.rectDelta.left=l.rect.left-v.left,w.rectDelta.right=l.rect.right-v.right,w.rectDelta.top=l.rect.top-v.top,w.rectDelta.bottom=l.rect.bottom-v.bottom;var D=this.result.coords,W=this.result.rect;if(D&&W){var B=w.rect.left!==W.left||w.rect.right!==W.right||w.rect.top!==W.top||w.rect.bottom!==W.bottom;w.changed=B||D.x!==w.coords.x||D.y!==w.coords.y}return w}},{key:"applyToInteraction",value:function(l){var u=this.interaction,m=l.phase,g=u.coords.cur,v=u.coords.start,b=this.result,y=this.startDelta,w=b.delta;m==="start"&&K(this.startDelta,b.delta);for(var M=0,_=[[v,y],[g,w]];M<_.length;M++){var E=_[M],j=E[0],V=E[1];j.page.x+=V.x,j.page.y+=V.y,j.client.x+=V.x,j.client.y+=V.y}var I=this.result.rectDelta,D=l.rect||u.rect;D.left+=I.left,D.right+=I.right,D.top+=I.top,D.bottom+=I.bottom,D.width=D.right-D.left,D.height=D.bottom-D.top}},{key:"setAndApply",value:function(l){var u=this.interaction,m=l.phase,g=l.preEnd,v=l.skipModifiers,b=this.setAll(this.fillArg({preEnd:g,phase:m,pageCoords:l.modifiedCoords||u.coords.cur.page}));if(this.result=b,!b.changed&&(!v||v<this.states.length)&&u.interacting())return!1;if(l.modifiedCoords){var y=u.coords.cur.page,w={x:l.modifiedCoords.x-y.x,y:l.modifiedCoords.y-y.y};b.coords.x+=w.x,b.coords.y+=w.y,b.delta.x+=w.x,b.delta.y+=w.y}this.applyToInteraction(l)}},{key:"beforeEnd",value:function(l){var u=l.interaction,m=l.event,g=this.states;if(g&&g.length){for(var v=!1,b=0;b<g.length;b++){var y=g[b];l.state=y;var w=y.options,M=y.methods,_=M.beforeEnd&&M.beforeEnd(l);if(_)return this.endResult=_,!1;v=v||!v&&this.shouldDo(w,!0,l.phase,!0)}v&&u.move({event:m,preEnd:!0})}}},{key:"stop",value:function(l){var u=l.interaction;if(this.states&&this.states.length){var m=K({states:this.states,interactable:u.interactable,element:u.element,rect:null},l);this.fillArg(m);for(var g=0,v=this.states;g<v.length;g++){var b=v[g];m.state=b,b.methods.stop&&b.methods.stop(m)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(l){this.states=[];for(var u=0;u<l.length;u++){var m=l[u],g=m.options,v=m.methods,b=m.name;this.states.push({options:g,methods:v,index:u,name:b})}return this.states}},{key:"restoreInteractionCoords",value:function(l){var u=l.interaction,m=u.coords,g=u.rect,v=u.modification;if(v.result){for(var b=v.startDelta,y=v.result,w=y.delta,M=y.rectDelta,_=0,E=[[m.start,b],[m.cur,w]];_<E.length;_++){var j=E[_],V=j[0],I=j[1];V.page.x-=I.x,V.page.y-=I.y,V.client.x-=I.x,V.client.y-=I.y}g.left-=M.left,g.right-=M.right,g.top-=M.top,g.bottom-=M.bottom}}},{key:"shouldDo",value:function(l,u,m,g){return!(!l||l.enabled===!1||g&&!l.endOnly||l.endOnly&&!u||m==="start"&&!l.setStart)}},{key:"copyFrom",value:function(l){this.startOffset=l.startOffset,this.startDelta=l.startDelta,this.startEdges=l.startEdges,this.edges=l.edges,this.states=l.states.map(function(u){return dn(u)}),this.result=cs(K({},l.result.coords),K({},l.result.rect))}},{key:"destroy",value:function(){for(var l in this)this[l]=null}}]),c}();function cs(c,l){return{rect:l,coords:c,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function di(c,l){var u=c.defaults,m={start:c.start,set:c.set,beforeEnd:c.beforeEnd,stop:c.stop},g=function(v){var b=v||{};for(var y in b.enabled=b.enabled!==!1,u)y in b||(b[y]=u[y]);var w={options:b,methods:m,name:l,enable:function(){return b.enabled=!0,w},disable:function(){return b.enabled=!1,w}};return w};return l&&typeof l=="string"&&(g._defaults=u,g._methods=m),g}function na(c){var l=c.iEvent,u=c.interaction.modification.result;u&&(l.modifiers=u.eventProps)}var Q0={id:"modifiers/base",before:["actions"],install:function(c){c.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(c){var l=c.interaction;l.modification=new Xl(l)},"interactions:before-action-start":function(c){var l=c.interaction,u=c.interaction.modification;u.start(c,l.coords.start.page),l.edges=u.edges,u.applyToInteraction(c)},"interactions:before-action-move":function(c){var l=c.interaction,u=l.modification,m=u.setAndApply(c);return l.edges=u.edges,m},"interactions:before-action-end":function(c){var l=c.interaction,u=l.modification,m=u.beforeEnd(c);return l.edges=u.startEdges,m},"interactions:action-start":na,"interactions:action-move":na,"interactions:action-end":na,"interactions:after-action-start":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-move":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:stop":function(c){return c.interaction.modification.stop(c)}}},Lu=Q0,Bu={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},Zl=function(c){d(u,c);var l=x(u);function u(m,g,v,b,y,w,M){var _;t(this,u),(_=l.call(this,m)).relatedTarget=null,_.screenX=void 0,_.screenY=void 0,_.button=void 0,_.buttons=void 0,_.ctrlKey=void 0,_.shiftKey=void 0,_.altKey=void 0,_.metaKey=void 0,_.page=void 0,_.client=void 0,_.delta=void 0,_.rect=void 0,_.x0=void 0,_.y0=void 0,_.t0=void 0,_.dt=void 0,_.duration=void 0,_.clientX0=void 0,_.clientY0=void 0,_.velocity=void 0,_.speed=void 0,_.swipe=void 0,_.axes=void 0,_.preEnd=void 0,y=y||m.element;var E=m.interactable,j=(E&&E.options||Bu).deltaSource,V=Bo(E,y,v),I=b==="start",D=b==="end",W=I?f(_):m.prevEvent,B=I?m.coords.start:D?{page:W.page,client:W.client,timeStamp:m.coords.cur.timeStamp}:m.coords.cur;return _.page=K({},B.page),_.client=K({},B.client),_.rect=K({},m.rect),_.timeStamp=B.timeStamp,D||(_.page.x-=V.x,_.page.y-=V.y,_.client.x-=V.x,_.client.y-=V.y),_.ctrlKey=g.ctrlKey,_.altKey=g.altKey,_.shiftKey=g.shiftKey,_.metaKey=g.metaKey,_.button=g.button,_.buttons=g.buttons,_.target=y,_.currentTarget=y,_.preEnd=w,_.type=M||v+(b||""),_.interactable=E,_.t0=I?m.pointers[m.pointers.length-1].downTime:W.t0,_.x0=m.coords.start.page.x-V.x,_.y0=m.coords.start.page.y-V.y,_.clientX0=m.coords.start.client.x-V.x,_.clientY0=m.coords.start.client.y-V.y,_.delta=I||D?{x:0,y:0}:{x:_[j].x-W[j].x,y:_[j].y-W[j].y},_.dt=m.coords.delta.timeStamp,_.duration=_.timeStamp-_.t0,_.velocity=K({},m.coords.velocity[j]),_.speed=ea(_.velocity.x,_.velocity.y),_.swipe=D||b==="inertiastart"?_.getSwipe():null,_}return n(u,[{key:"getSwipe",value:function(){var m=this._interaction;if(m.prevEvent.speed<600||this.timeStamp-m.prevEvent.timeStamp>150)return null;var g=180*Math.atan2(m.prevEvent.velocityY,m.prevEvent.velocityX)/Math.PI;g<0&&(g+=360);var v=112.5<=g&&g<247.5,b=202.5<=g&&g<337.5;return{up:b,down:!b&&22.5<=g&&g<157.5,left:v,right:!v&&(292.5<=g||g<67.5),angle:g,speed:m.prevEvent.speed,velocity:{x:m.prevEvent.velocityX,y:m.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),u}(as);Object.defineProperties(Zl.prototype,{pageX:{get:function(){return this.page.x},set:function(c){this.page.x=c}},pageY:{get:function(){return this.page.y},set:function(c){this.page.y=c}},clientX:{get:function(){return this.client.x},set:function(c){this.client.x=c}},clientY:{get:function(){return this.client.y},set:function(c){this.client.y=c}},dx:{get:function(){return this.delta.x},set:function(c){this.delta.x=c}},dy:{get:function(){return this.delta.y},set:function(c){this.delta.y=c}},velocityX:{get:function(){return this.velocity.x},set:function(c){this.velocity.x=c}},velocityY:{get:function(){return this.velocity.y},set:function(c){this.velocity.y=c}}});var J0=n(function c(l,u,m,g,v){t(this,c),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=l,this.pointer=u,this.event=m,this.downTime=g,this.downTarget=v}),e2=function(c){return c.interactable="",c.element="",c.prepared="",c.pointerIsDown="",c.pointerWasMoved="",c._proxy="",c}({}),qu=function(c){return c.start="",c.move="",c.end="",c.stop="",c.interacting="",c}({}),t2=0,r2=function(){function c(l){var u=this,m=l.pointerType,g=l.scopeFire;t(this,c),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=ia(function(_){this.move(_)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=t2++,this._scopeFire=g,this.pointerType=m;var v=this;this._proxy={};var b=function(_){Object.defineProperty(u._proxy,_,{get:function(){return v[_]}})};for(var y in e2)b(y);var w=function(_){Object.defineProperty(u._proxy,_,{value:function(){return v[_].apply(v,arguments)}})};for(var M in qu)w(M);this._scopeFire("interactions:new",{interaction:this})}return n(c,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(l,u,m){var g=this.updatePointer(l,u,m,!0),v=this.pointers[g];this._scopeFire("interactions:down",{pointer:l,event:u,eventTarget:m,pointerIndex:g,pointerInfo:v,type:"down",interaction:this})}},{key:"start",value:function(l,u,m){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(l.name==="gesture"?2:1)||!u.options[l.name].enabled)&&(Wl(this.prepared,l),this.interactable=u,this.element=m,this.rect=u.getRect(m),this.edges=this.prepared.edges?K({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(l,u,m){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(l,u,m,!1);var g,v,b=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(g=this.coords.cur.client.x-this.coords.start.client.x,v=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=ea(g,v)>this.pointerMoveTolerance);var y,w,M,_=this.getPointerIndex(l),E={pointer:l,pointerIndex:_,pointerInfo:this.pointers[_],event:u,type:"move",eventTarget:m,dx:g,dy:v,duplicate:b,interaction:this};b||(y=this.coords.velocity,w=this.coords.delta,M=Math.max(w.timeStamp/1e3,.001),y.page.x=w.page.x/M,y.page.y=w.page.y/M,y.client.x=w.client.x/M,y.client.y=w.client.y/M,y.timeStamp=M),this._scopeFire("interactions:move",E),b||this.simulation||(this.interacting()&&(E.type=null,this.move(E)),this.pointerWasMoved&&is(this.coords.prev,this.coords.cur))}},{key:"move",value:function(l){l&&l.event||ku(this.coords.delta),(l=K({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},l||{})).phase="move",this._doPhase(l)}},{key:"pointerUp",value:function(l,u,m,g){var v=this.getPointerIndex(l);v===-1&&(v=this.updatePointer(l,u,m,!1));var b=/cancel$/i.test(u.type)?"cancel":"up";this._scopeFire("interactions:".concat(b),{pointer:l,pointerIndex:v,pointerInfo:this.pointers[v],event:u,eventTarget:m,type:b,curEventTarget:g,interaction:this}),this.simulation||this.end(u),this.removePointer(l,u)}},{key:"documentBlur",value:function(l){this.end(l),this._scopeFire("interactions:blur",{event:l,type:"blur",interaction:this})}},{key:"end",value:function(l){var u;this._ending=!0,l=l||this._latestPointer.event,this.interacting()&&(u=this._doPhase({event:l,interaction:this,phase:"end"})),this._ending=!1,u===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(l){var u=ta(l);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:ra(this.pointers,function(m){return m.id===u})}},{key:"getPointerInfo",value:function(l){return this.pointers[this.getPointerIndex(l)]}},{key:"updatePointer",value:function(l,u,m,g){var v,b,y,w=ta(l),M=this.getPointerIndex(l),_=this.pointers[M];return g=g!==!1&&(g||/(down|start)$/i.test(u.type)),_?_.pointer=l:(_=new J0(w,l,u,null,null),M=this.pointers.length,this.pointers.push(_)),j0(this.coords.cur,this.pointers.map(function(E){return E.pointer}),this._now()),v=this.coords.delta,b=this.coords.prev,y=this.coords.cur,v.page.x=y.page.x-b.page.x,v.page.y=y.page.y-b.page.y,v.client.x=y.client.x-b.client.x,v.client.y=y.client.y-b.client.y,v.timeStamp=y.timeStamp-b.timeStamp,g&&(this.pointerIsDown=!0,_.downTime=this.coords.cur.timeStamp,_.downTarget=m,os(this.downPointer,l),this.interacting()||(is(this.coords.start,this.coords.cur),is(this.coords.prev,this.coords.cur),this.downEvent=u,this.pointerWasMoved=!1)),this._updateLatestPointer(l,u,m),this._scopeFire("interactions:update-pointer",{pointer:l,event:u,eventTarget:m,down:g,pointerInfo:_,pointerIndex:M,interaction:this}),M}},{key:"removePointer",value:function(l,u){var m=this.getPointerIndex(l);if(m!==-1){var g=this.pointers[m];this._scopeFire("interactions:remove-pointer",{pointer:l,event:u,eventTarget:null,pointerIndex:m,pointerInfo:g,interaction:this}),this.pointers.splice(m,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(l,u,m){this._latestPointer.pointer=l,this._latestPointer.event=u,this._latestPointer.eventTarget=m}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(l,u,m,g){return new Zl(this,l,this.prepared.name,u,this.element,m,g)}},{key:"_fireEvent",value:function(l){var u;(u=this.interactable)==null||u.fire(l),(!this.prevEvent||l.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=l)}},{key:"_doPhase",value:function(l){var u=l.event,m=l.phase,g=l.preEnd,v=l.type,b=this.rect;if(b&&m==="move"&&(li(this.edges,b,this.coords.delta[this.interactable.options.deltaSource]),b.width=b.right-b.left,b.height=b.bottom-b.top),this._scopeFire("interactions:before-action-".concat(m),l)===!1)return!1;var y=l.iEvent=this._createPreparedEvent(u,m,g,v);return this._scopeFire("interactions:action-".concat(m),l),m==="start"&&(this.prevEvent=y),this._fireEvent(y),this._scopeFire("interactions:after-action-".concat(m),l),!0}},{key:"_now",value:function(){return Date.now()}}]),c}();function Ku(c){Wu(c.interaction)}function Wu(c){if(!function(u){return!(!u.offset.pending.x&&!u.offset.pending.y)}(c))return!1;var l=c.offset.pending;return Ql(c.coords.cur,l),Ql(c.coords.delta,l),li(c.edges,c.rect,l),l.x=0,l.y=0,!0}function o2(c){var l=c.x,u=c.y;this.offset.pending.x+=l,this.offset.pending.y+=u,this.offset.total.x+=l,this.offset.total.y+=u}function Ql(c,l){var u=c.page,m=c.client,g=l.x,v=l.y;u.x+=g,u.y+=v,m.x+=g,m.y+=v}qu.offsetBy="";var i2={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(c){c.Interaction.prototype.offsetBy=o2},listeners:{"interactions:new":function(c){c.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(c){return function(l){l.pointerIsDown&&(Ql(l.coords.cur,l.offset.total),l.offset.pending.x=0,l.offset.pending.y=0)}(c.interaction)},"interactions:before-action-start":Ku,"interactions:before-action-move":Ku,"interactions:before-action-end":function(c){var l=c.interaction;if(Wu(l))return l.move({offset:!0}),l.end(),!1},"interactions:stop":function(c){var l=c.interaction;l.offset.total.x=0,l.offset.total.y=0,l.offset.pending.x=0,l.offset.pending.y=0}}},Uu=i2,n2=function(){function c(l){t(this,c),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=l}return n(c,[{key:"start",value:function(l){var u=this.interaction,m=ds(u);if(!m||!m.enabled)return!1;var g=u.coords.velocity.client,v=ea(g.x,g.y),b=this.modification||(this.modification=new Xl(u));if(b.copyFrom(u.modification),this.t0=u._now(),this.allowResume=m.allowResume,this.v0=v,this.currentOffset={x:0,y:0},this.startCoords=u.coords.cur.page,this.modifierArg=b.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-u.coords.cur.timeStamp<50&&v>m.minSpeed&&v>m.endSpeed)this.startInertia();else{if(b.result=b.setAll(this.modifierArg),!b.result.changed)return!1;this.startSmoothEnd()}return u.modification.result.rect=null,u.offsetBy(this.targetOffset),u._doPhase({interaction:u,event:l,phase:"inertiastart"}),u.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),u.modification.result.rect=null,this.active=!0,u.simulation=this,!0}},{key:"startInertia",value:function(){var l=this,u=this.interaction.coords.velocity.client,m=ds(this.interaction),g=m.resistance,v=-Math.log(m.endSpeed/this.v0)/g;this.targetOffset={x:(u.x-v)/g,y:(u.y-v)/g},this.te=v,this.lambda_v0=g/this.v0,this.one_ve_v0=1-m.endSpeed/this.v0;var b=this.modification,y=this.modifierArg;y.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},b.result=b.setAll(y),b.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+b.result.delta.x,y:this.targetOffset.y+b.result.delta.y}),this.onNextFrame(function(){return l.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var l=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return l.smoothEndTick()})}},{key:"onNextFrame",value:function(l){var u=this;this.timeout=ci.request(function(){u.active&&l()})}},{key:"inertiaTick",value:function(){var l,u,m,g,v,b,y,w=this,M=this.interaction,_=ds(M).resistance,E=(M._now()-this.t0)/1e3;if(E<this.te){var j,V=1-(Math.exp(-_*E)-this.lambda_v0)/this.one_ve_v0;this.isModified?(l=0,u=0,m=this.targetOffset.x,g=this.targetOffset.y,v=this.modifiedOffset.x,b=this.modifiedOffset.y,j={x:Gu(y=V,l,m,v),y:Gu(y,u,g,b)}):j={x:this.targetOffset.x*V,y:this.targetOffset.y*V};var I={x:j.x-this.currentOffset.x,y:j.y-this.currentOffset.y};this.currentOffset.x+=I.x,this.currentOffset.y+=I.y,M.offsetBy(I),M.move(),this.onNextFrame(function(){return w.inertiaTick()})}else M.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var l=this,u=this.interaction,m=u._now()-this.t0,g=ds(u).smoothEndDuration;if(m<g){var v={x:Yu(m,0,this.targetOffset.x,g),y:Yu(m,0,this.targetOffset.y,g)},b={x:v.x-this.currentOffset.x,y:v.y-this.currentOffset.y};this.currentOffset.x+=b.x,this.currentOffset.y+=b.y,u.offsetBy(b),u.move({skipModifiers:this.modifierCount}),this.onNextFrame(function(){return l.smoothEndTick()})}else u.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(l){var u=l.pointer,m=l.event,g=l.eventTarget,v=this.interaction;v.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),v.updatePointer(u,m,g,!0),v._doPhase({interaction:v,event:m,phase:"resume"}),is(v.coords.prev,v.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,ci.cancel(this.timeout)}}]),c}();function ds(c){var l=c.interactable,u=c.prepared;return l&&l.options&&u.name&&l.options[u.name].inertia}var a2={id:"inertia",before:["modifiers","actions"],install:function(c){var l=c.defaults;c.usePlugin(Uu),c.usePlugin(Lu),c.actions.phases.inertiastart=!0,c.actions.phases.resume=!0,l.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(c){var l=c.interaction;l.inertia=new n2(l)},"interactions:before-action-end":function(c){var l=c.interaction,u=c.event;return(!l._interacting||l.simulation||!l.inertia.start(u))&&null},"interactions:down":function(c){var l=c.interaction,u=c.eventTarget,m=l.inertia;if(m.active)for(var g=u;$.element(g);){if(g===l.element){m.resume(c);break}g=Yr(g)}},"interactions:stop":function(c){var l=c.interaction.inertia;l.active&&l.stop()},"interactions:before-action-resume":function(c){var l=c.interaction.modification;l.stop(c),l.start(c,c.interaction.coords.cur.page),l.applyToInteraction(c)},"interactions:before-action-inertiastart":function(c){return c.interaction.modification.setAndApply(c)},"interactions:action-resume":na,"interactions:action-inertiastart":na,"interactions:after-action-inertiastart":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-resume":function(c){return c.interaction.modification.restoreInteractionCoords(c)}}};function Gu(c,l,u,m){var g=1-c;return g*g*l+2*g*c*u+c*c*m}function Yu(c,l,u,m){return-u*(c/=m)*(c-2)+l}var s2=a2;function Xu(c,l){for(var u=0;u<l.length;u++){var m=l[u];if(c.immediatePropagationStopped)break;m(c)}}var Zu=function(){function c(l){t(this,c),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=K({},l||{})}return n(c,[{key:"fire",value:function(l){var u,m=this.global;(u=this.types[l.type])&&Xu(l,u),!l.propagationStopped&&m&&(u=m[l.type])&&Xu(l,u)}},{key:"on",value:function(l,u){var m=uo(l,u);for(l in m)this.types[l]=zu(this.types[l]||[],m[l])}},{key:"off",value:function(l,u){var m=uo(l,u);for(l in m){var g=this.types[l];if(g&&g.length)for(var v=0,b=m[l];v<b.length;v++){var y=b[v],w=g.indexOf(y);w!==-1&&g.splice(w,1)}}}},{key:"getRect",value:function(l){return null}}]),c}(),l2=function(){function c(l){t(this,c),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=l,os(this,l)}return n(c,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),c}();function aa(c){return $.object(c)?{capture:!!c.capture,passive:!!c.passive}:{capture:!!c,passive:!1}}function us(c,l){return c===l||(typeof c=="boolean"?!!l.capture===c&&!l.passive:!!c.capture==!!l.capture&&!!c.passive==!!l.passive)}var c2={id:"events",install:function(c){var l,u=[],m={},g=[],v={add:b,remove:y,addDelegate:function(_,E,j,V,I){var D=aa(I);if(!m[j]){m[j]=[];for(var W=0;W<g.length;W++){var B=g[W];b(B,j,w),b(B,j,M,!0)}}var G=m[j],de=oa(G,function(ke){return ke.selector===_&&ke.context===E});de||(de={selector:_,context:E,listeners:[]},G.push(de)),de.listeners.push({func:V,options:D})},removeDelegate:function(_,E,j,V,I){var D,W=aa(I),B=m[j],G=!1;if(B)for(D=B.length-1;D>=0;D--){var de=B[D];if(de.selector===_&&de.context===E){for(var ke=de.listeners,te=ke.length-1;te>=0;te--){var pe=ke[te];if(pe.func===V&&us(pe.options,W)){ke.splice(te,1),ke.length||(B.splice(D,1),y(E,j,w),y(E,j,M,!0)),G=!0;break}}if(G)break}}},delegateListener:w,delegateUseCapture:M,delegatedEvents:m,documents:g,targets:u,supportsOptions:!1,supportsPassive:!1};function b(_,E,j,V){if(_.addEventListener){var I=aa(V),D=oa(u,function(W){return W.eventTarget===_});D||(D={eventTarget:_,events:{}},u.push(D)),D.events[E]||(D.events[E]=[]),oa(D.events[E],function(W){return W.func===j&&us(W.options,I)})||(_.addEventListener(E,j,v.supportsOptions?I:I.capture),D.events[E].push({func:j,options:I}))}}function y(_,E,j,V){if(_.addEventListener&&_.removeEventListener){var I=ra(u,function(mr){return mr.eventTarget===_}),D=u[I];if(D&&D.events)if(E!=="all"){var W=!1,B=D.events[E];if(B){if(j==="all"){for(var G=B.length-1;G>=0;G--){var de=B[G];y(_,E,de.func,de.options)}return}for(var ke=aa(V),te=0;te<B.length;te++){var pe=B[te];if(pe.func===j&&us(pe.options,ke)){_.removeEventListener(E,j,v.supportsOptions?ke:ke.capture),B.splice(te,1),B.length===0&&(delete D.events[E],W=!0);break}}}W&&!Object.keys(D.events).length&&u.splice(I,1)}else for(E in D.events)D.events.hasOwnProperty(E)&&y(_,E,"all")}}function w(_,E){for(var j=aa(E),V=new l2(_),I=m[_.type],D=Cu(_)[0],W=D;$.element(W);){for(var B=0;B<I.length;B++){var G=I[B],de=G.selector,ke=G.context;if(Po(W,de)&&so(ke,D)&&so(ke,W)){var te=G.listeners;V.currentTarget=W;for(var pe=0;pe<te.length;pe++){var mr=te[pe];us(mr.options,j)&&mr.func(V)}}}W=Yr(W)}}function M(_){return w(_,!0)}return(l=c.document)==null||l.createElement("div").addEventListener("test",null,{get capture(){return v.supportsOptions=!0},get passive(){return v.supportsPassive=!0}}),c.events=v,v}},Jl={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(c){for(var l=0,u=Jl.methodOrder;l<u.length;l++){var m=u[l],g=Jl[m](c);if(g)return g}return null},simulationResume:function(c){var l=c.pointerType,u=c.eventType,m=c.eventTarget,g=c.scope;if(!/down|start/i.test(u))return null;for(var v=0,b=g.interactions.list;v<b.length;v++){var y=b[v],w=m;if(y.simulation&&y.simulation.allowResume&&y.pointerType===l)for(;w;){if(w===y.element)return y;w=Yr(w)}}return null},mouseOrPen:function(c){var l,u=c.pointerId,m=c.pointerType,g=c.eventType,v=c.scope;if(m!=="mouse"&&m!=="pen")return null;for(var b=0,y=v.interactions.list;b<y.length;b++){var w=y[b];if(w.pointerType===m){if(w.simulation&&!Qu(w,u))continue;if(w.interacting())return w;l||(l=w)}}if(l)return l;for(var M=0,_=v.interactions.list;M<_.length;M++){var E=_[M];if(!(E.pointerType!==m||/down/i.test(g)&&E.simulation))return E}return null},hasPointer:function(c){for(var l=c.pointerId,u=0,m=c.scope.interactions.list;u<m.length;u++){var g=m[u];if(Qu(g,l))return g}return null},idle:function(c){for(var l=c.pointerType,u=0,m=c.scope.interactions.list;u<m.length;u++){var g=m[u];if(g.pointers.length===1){var v=g.interactable;if(v&&(!v.options.gesture||!v.options.gesture.enabled))continue}else if(g.pointers.length>=2)continue;if(!g.interacting()&&l===g.pointerType)return g}return null}};function Qu(c,l){return c.pointers.some(function(u){return u.id===l})}var d2=Jl,ec=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Ju(c,l){return function(u){var m=l.interactions.list,g=Mu(u),v=Cu(u),b=v[0],y=v[1],w=[];if(/^touch/.test(u.type)){l.prevTouchTime=l.now();for(var M=0,_=u.changedTouches;M<_.length;M++){var E=_[M],j={pointer:E,pointerId:ta(E),pointerType:g,eventType:u.type,eventTarget:b,curEventTarget:y,scope:l},V=eh(j);w.push([j.pointer,j.eventTarget,j.curEventTarget,V])}}else{var I=!1;if(!hr.supportsPointerEvent&&/mouse/.test(u.type)){for(var D=0;D<m.length&&!I;D++)I=m[D].pointerType!=="mouse"&&m[D].pointerIsDown;I=I||l.now()-l.prevTouchTime<500||u.timeStamp===0}if(!I){var W={pointer:u,pointerId:ta(u),pointerType:g,eventType:u.type,curEventTarget:y,eventTarget:b,scope:l},B=eh(W);w.push([W.pointer,W.eventTarget,W.curEventTarget,B])}}for(var G=0;G<w.length;G++){var de=w[G],ke=de[0],te=de[1],pe=de[2];de[3][c](ke,u,te,pe)}}}function eh(c){var l=c.pointerType,u=c.scope,m={interaction:d2.search(c),searchDetails:c};return u.fire("interactions:find",m),m.interaction||u.interactions.new({pointerType:l})}function tc(c,l){var u=c.doc,m=c.scope,g=c.options,v=m.interactions.docEvents,b=m.events,y=b[l];for(var w in m.browser.isIOS&&!g.events&&(g.events={passive:!1}),b.delegatedEvents)y(u,w,b.delegateListener),y(u,w,b.delegateUseCapture,!0);for(var M=g&&g.events,_=0;_<v.length;_++){var E=v[_];y(u,E.type,E.listener,M)}}var u2={id:"core/interactions",install:function(c){for(var l={},u=0;u<ec.length;u++){var m=ec[u];l[m]=Ju(m,c)}var g,v=hr.pEventTypes;function b(){for(var y=0,w=c.interactions.list;y<w.length;y++){var M=w[y];if(M.pointerIsDown&&M.pointerType==="touch"&&!M._interacting)for(var _=function(){var V=j[E];c.documents.some(function(I){return so(I.doc,V.downTarget)})||M.removePointer(V.pointer,V.event)},E=0,j=M.pointers;E<j.length;E++)_()}}(g=Fe.PointerEvent?[{type:v.down,listener:b},{type:v.down,listener:l.pointerDown},{type:v.move,listener:l.pointerMove},{type:v.up,listener:l.pointerUp},{type:v.cancel,listener:l.pointerUp}]:[{type:"mousedown",listener:l.pointerDown},{type:"mousemove",listener:l.pointerMove},{type:"mouseup",listener:l.pointerUp},{type:"touchstart",listener:b},{type:"touchstart",listener:l.pointerDown},{type:"touchmove",listener:l.pointerMove},{type:"touchend",listener:l.pointerUp},{type:"touchcancel",listener:l.pointerUp}]).push({type:"blur",listener:function(y){for(var w=0,M=c.interactions.list;w<M.length;w++)M[w].documentBlur(y)}}),c.prevTouchTime=0,c.Interaction=function(y){d(M,y);var w=x(M);function M(){return t(this,M),w.apply(this,arguments)}return n(M,[{key:"pointerMoveTolerance",get:function(){return c.interactions.pointerMoveTolerance},set:function(_){c.interactions.pointerMoveTolerance=_}},{key:"_now",value:function(){return c.now()}}]),M}(r2),c.interactions={list:[],new:function(y){y.scopeFire=function(M,_){return c.fire(M,_)};var w=new c.Interaction(y);return c.interactions.list.push(w),w},listeners:l,docEvents:g,pointerMoveTolerance:1},c.usePlugin(Nu)},listeners:{"scope:add-document":function(c){return tc(c,"add")},"scope:remove-document":function(c){return tc(c,"remove")},"interactable:unset":function(c,l){for(var u=c.interactable,m=l.interactions.list.length-1;m>=0;m--){var g=l.interactions.list[m];g.interactable===u&&(g.stop(),l.fire("interactions:destroy",{interaction:g}),g.destroy(),l.interactions.list.length>2&&l.interactions.list.splice(m,1))}}},onDocSignal:tc,doOnInteractions:Ju,methodNames:ec},h2=u2,ui=function(c){return c[c.On=0]="On",c[c.Off=1]="Off",c}(ui||{}),p2=function(){function c(l,u,m,g){t(this,c),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new Zu,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=u.actions,this.target=l,this._context=u.context||m,this._win=H(Tr(l)?this._context:l),this._doc=this._win.document,this._scopeEvents=g,this.set(u)}return n(c,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(l,u){return $.func(u.onstart)&&this.on("".concat(l,"start"),u.onstart),$.func(u.onmove)&&this.on("".concat(l,"move"),u.onmove),$.func(u.onend)&&this.on("".concat(l,"end"),u.onend),$.func(u.oninertiastart)&&this.on("".concat(l,"inertiastart"),u.oninertiastart),this}},{key:"updatePerActionListeners",value:function(l,u,m){var g,v=this,b=(g=this._actions.map[l])==null?void 0:g.filterEventType,y=function(w){return(b==null||b(w))&&ls(w,v._actions)};($.array(u)||$.object(u))&&this._onOff(ui.Off,l,u,void 0,y),($.array(m)||$.object(m))&&this._onOff(ui.On,l,m,void 0,y)}},{key:"setPerAction",value:function(l,u){var m=this._defaults;for(var g in u){var v=g,b=this.options[l],y=u[v];v==="listeners"&&this.updatePerActionListeners(l,b.listeners,y),$.array(y)?b[v]=Eu(y):$.plainObject(y)?(b[v]=K(b[v]||{},dn(y)),$.object(m.perAction[v])&&"enabled"in m.perAction[v]&&(b[v].enabled=y.enabled!==!1)):$.bool(y)&&$.object(m.perAction[v])?b[v].enabled=y:b[v]=y}}},{key:"getRect",value:function(l){return l=l||($.element(this.target)?this.target:null),$.string(this.target)&&(l=l||this._context.querySelector(this.target)),_e(l)}},{key:"rectChecker",value:function(l){var u=this;return $.func(l)?(this.getRect=function(m){var g=K({},l.apply(u,m));return"width"in g||(g.width=g.right-g.left,g.height=g.bottom-g.top),g},this):l===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(l,u){if(Tr(u)||$.object(u)){for(var m in this.options[l]=u,this._actions.map)this.options[m][l]=u;return this}return this.options[l]}},{key:"origin",value:function(l){return this._backCompatOption("origin",l)}},{key:"deltaSource",value:function(l){return l==="page"||l==="client"?(this.options.deltaSource=l,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var l=this.target;return $.string(l)?Array.from(this._context.querySelectorAll(l)):$.func(l)&&l.getAllElements?l.getAllElements():$.element(l)?[l]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(l){return this._context===l.ownerDocument||so(this._context,l)}},{key:"testIgnoreAllow",value:function(l,u,m){return!this.testIgnore(l.ignoreFrom,u,m)&&this.testAllow(l.allowFrom,u,m)}},{key:"testAllow",value:function(l,u,m){return!l||!!$.element(m)&&($.string(l)?he(m,l,u):!!$.element(l)&&so(l,m))}},{key:"testIgnore",value:function(l,u,m){return!(!l||!$.element(m))&&($.string(l)?he(m,l,u):!!$.element(l)&&so(l,m))}},{key:"fire",value:function(l){return this.events.fire(l),this}},{key:"_onOff",value:function(l,u,m,g,v){$.object(u)&&!$.array(u)&&(g=m,m=null);var b=uo(u,m,v);for(var y in b){y==="wheel"&&(y=hr.wheelEvent);for(var w=0,M=b[y];w<M.length;w++){var _=M[w];ls(y,this._actions)?this.events[l===ui.On?"on":"off"](y,_):$.string(this.target)?this._scopeEvents[l===ui.On?"addDelegate":"removeDelegate"](this.target,this._context,y,_,g):this._scopeEvents[l===ui.On?"add":"remove"](this.target,y,_,g)}}return this}},{key:"on",value:function(l,u,m){return this._onOff(ui.On,l,u,m)}},{key:"off",value:function(l,u,m){return this._onOff(ui.Off,l,u,m)}},{key:"set",value:function(l){var u=this._defaults;for(var m in $.object(l)||(l={}),this.options=dn(u.base),this._actions.methodDict){var g=m,v=this._actions.methodDict[g];this.options[g]={},this.setPerAction(g,K(K({},u.perAction),u.actions[g])),this[v](l[g])}for(var b in l)b!=="getRect"?$.func(this[b])&&this[b](l[b]):this.rectChecker(l.getRect);return this}},{key:"unset",value:function(){if($.string(this.target))for(var l in this._scopeEvents.delegatedEvents)for(var u=this._scopeEvents.delegatedEvents[l],m=u.length-1;m>=0;m--){var g=u[m],v=g.selector,b=g.context,y=g.listeners;v===this.target&&b===this._context&&u.splice(m,1);for(var w=y.length-1;w>=0;w--)this._scopeEvents.removeDelegate(this.target,this._context,l,y[w][0],y[w][1])}else this._scopeEvents.remove(this.target,"all")}}]),c}(),m2=function(){function c(l){var u=this;t(this,c),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=l,l.addListeners({"interactable:unset":function(m){var g=m.interactable,v=g.target,b=$.string(v)?u.selectorMap[v]:v[u.scope.id],y=ra(b,function(w){return w===g});b.splice(y,1)}})}return n(c,[{key:"new",value:function(l,u){u=K(u||{},{actions:this.scope.actions});var m=new this.scope.Interactable(l,u,this.scope.document,this.scope.events);return this.scope.addDocument(m._doc),this.list.push(m),$.string(l)?(this.selectorMap[l]||(this.selectorMap[l]=[]),this.selectorMap[l].push(m)):(m.target[this.scope.id]||Object.defineProperty(l,this.scope.id,{value:[],configurable:!0}),l[this.scope.id].push(m)),this.scope.fire("interactable:new",{target:l,options:u,interactable:m,win:this.scope._win}),m}},{key:"getExisting",value:function(l,u){var m=u&&u.context||this.scope.document,g=$.string(l),v=g?this.selectorMap[l]:l[this.scope.id];if(v)return oa(v,function(b){return b._context===m&&(g||b.inContext(l))})}},{key:"forEachMatch",value:function(l,u){for(var m=0,g=this.list;m<g.length;m++){var v=g[m],b=void 0;if(($.string(v.target)?$.element(l)&&Po(l,v.target):l===v.target)&&v.inContext(l)&&(b=u(v)),b!==void 0)return b}}}]),c}(),g2=function(){function c(){var l=this;t(this,c),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=hr,this.defaults=dn(Bu),this.Eventable=Zu,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=function(m){var g=function v(b,y){var w=m.interactables.getExisting(b,y);return w||((w=m.interactables.new(b,y)).events.global=v.globalEvents),w};return g.getPointerAverage=_u,g.getTouchBBox=Vl,g.getTouchDistance=Dl,g.getTouchAngle=Fl,g.getElementRect=_e,g.getElementClientRect=X,g.matchesSelector=Po,g.closest=sn,g.globalEvents={},g.version="1.10.27",g.scope=m,g.use=function(v,b){return this.scope.usePlugin(v,b),this},g.isSet=function(v,b){return!!this.scope.interactables.get(v,b&&b.context)},g.on=ia(function(v,b,y){if($.string(v)&&v.search(" ")!==-1&&(v=v.trim().split(/ +/)),$.array(v)){for(var w=0,M=v;w<M.length;w++){var _=M[w];this.on(_,b,y)}return this}if($.object(v)){for(var E in v)this.on(E,v[E],b);return this}return ls(v,this.scope.actions)?this.globalEvents[v]?this.globalEvents[v].push(b):this.globalEvents[v]=[b]:this.scope.events.add(this.scope.document,v,b,{options:y}),this},"The interact.on() method is being deprecated"),g.off=ia(function(v,b,y){if($.string(v)&&v.search(" ")!==-1&&(v=v.trim().split(/ +/)),$.array(v)){for(var w=0,M=v;w<M.length;w++){var _=M[w];this.off(_,b,y)}return this}if($.object(v)){for(var E in v)this.off(E,v[E],b);return this}var j;return ls(v,this.scope.actions)?v in this.globalEvents&&(j=this.globalEvents[v].indexOf(b))!==-1&&this.globalEvents[v].splice(j,1):this.scope.events.remove(this.scope.document,v,b,y),this},"The interact.off() method is being deprecated"),g.debug=function(){return this.scope},g.supportsTouch=function(){return hr.supportsTouch},g.supportsPointerEvent=function(){return hr.supportsPointerEvent},g.stop=function(){for(var v=0,b=this.scope.interactions.list;v<b.length;v++)b[v].stop();return this},g.pointerMoveTolerance=function(v){return $.number(v)?(this.scope.interactions.pointerMoveTolerance=v,this):this.scope.interactions.pointerMoveTolerance},g.addDocument=function(v,b){this.scope.addDocument(v,b)},g.removeDocument=function(v){this.scope.removeDocument(v)},g}(this),this.InteractEvent=Zl,this.Interactable=void 0,this.interactables=new m2(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(m){return l.removeDocument(m.target)};var u=this;this.Interactable=function(m){d(v,m);var g=x(v);function v(){return t(this,v),g.apply(this,arguments)}return n(v,[{key:"_defaults",get:function(){return u.defaults}},{key:"set",value:function(b){return k(h(v.prototype),"set",this).call(this,b),u.fire("interactable:set",{options:b,interactable:this}),this}},{key:"unset",value:function(){k(h(v.prototype),"unset",this).call(this);var b=u.interactables.list.indexOf(this);b<0||(u.interactables.list.splice(b,1),u.fire("interactable:unset",{interactable:this}))}}]),v}(p2)}return n(c,[{key:"addListeners",value:function(l,u){this.listenerMaps.push({id:u,map:l})}},{key:"fire",value:function(l,u){for(var m=0,g=this.listenerMaps;m<g.length;m++){var v=g[m].map[l];if(v&&v(u,this,l)===!1)return!1}}},{key:"init",value:function(l){return this.isInitialized?this:function(u,m){return u.isInitialized=!0,$.window(m)&&P(m),Fe.init(m),hr.init(m),ci.init(m),u.window=m,u.document=m.document,u.usePlugin(h2),u.usePlugin(c2),u}(this,l)}},{key:"pluginIsInstalled",value:function(l){var u=l.id;return u?!!this._plugins.map[u]:this._plugins.list.indexOf(l)!==-1}},{key:"usePlugin",value:function(l,u){if(!this.isInitialized)return this;if(this.pluginIsInstalled(l))return this;if(l.id&&(this._plugins.map[l.id]=l),this._plugins.list.push(l),l.install&&l.install(this,u),l.listeners&&l.before){for(var m=0,g=this.listenerMaps.length,v=l.before.reduce(function(y,w){return y[w]=!0,y[th(w)]=!0,y},{});m<g;m++){var b=this.listenerMaps[m].id;if(b&&(v[b]||v[th(b)]))break}this.listenerMaps.splice(m,0,{id:l.id,map:l.listeners})}else l.listeners&&this.listenerMaps.push({id:l.id,map:l.listeners});return this}},{key:"addDocument",value:function(l,u){if(this.getDocIndex(l)!==-1)return!1;var m=H(l);u=u?K({},u):{},this.documents.push({doc:l,options:u}),this.events.documents.push(l),l!==this.document&&this.events.add(m,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:l,window:m,scope:this,options:u})}},{key:"removeDocument",value:function(l){var u=this.getDocIndex(l),m=H(l),g=this.documents[u].options;this.events.remove(m,"unload",this.onWindowUnload),this.documents.splice(u,1),this.events.documents.splice(u,1),this.fire("scope:remove-document",{doc:l,window:m,scope:this,options:g})}},{key:"getDocIndex",value:function(l){for(var u=0;u<this.documents.length;u++)if(this.documents[u].doc===l)return u;return-1}},{key:"getDocOptions",value:function(l){var u=this.getDocIndex(l);return u===-1?null:this.documents[u].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),c}();function th(c){return c&&c.replace(/\/.*$/,"")}var rh=new g2,pr=rh.interactStatic,f2=typeof globalThis<"u"?globalThis:window;rh.init(f2);var v2=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(c){var l=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(m){var g=m[0],v=m[1];return g in c||v in c}),u=function(m,g){for(var v=c.range,b=c.limits,y=b===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:b,w=c.offset,M=w===void 0?{x:0,y:0}:w,_={range:v,grid:c,x:null,y:null},E=0;E<l.length;E++){var j=l[E],V=j[0],I=j[1],D=Math.round((m-M.x)/c[V]),W=Math.round((g-M.y)/c[I]);_[V]=Math.max(y.left,Math.min(y.right,D*c[V]+M.x)),_[I]=Math.max(y.top,Math.min(y.bottom,W*c[I]+M.y))}return _};return u.grid=c,u.coordFields=l,u}}),b2={id:"snappers",install:function(c){var l=c.interactStatic;l.snappers=K(l.snappers||{},v2),l.createSnapGrid=l.snappers.grid}},y2=b2,k2={start:function(c){var l=c.state,u=c.rect,m=c.edges,g=c.pageCoords,v=l.options,b=v.ratio,y=v.enabled,w=l.options,M=w.equalDelta,_=w.modifiers;b==="preserve"&&(b=u.width/u.height),l.startCoords=K({},g),l.startRect=K({},u),l.ratio=b,l.equalDelta=M;var E=l.linkedEdges={top:m.top||m.left&&!m.bottom,left:m.left||m.top&&!m.right,bottom:m.bottom||m.right&&!m.top,right:m.right||m.bottom&&!m.left};if(l.xIsPrimaryAxis=!(!m.left&&!m.right),l.equalDelta){var j=(E.left?1:-1)*(E.top?1:-1);l.edgeSign={x:j,y:j}}else l.edgeSign={x:E.left?-1:1,y:E.top?-1:1};if(y!==!1&&K(m,E),_!=null&&_.length){var V=new Xl(c.interaction);V.copyFrom(c.interaction.modification),V.prepareStates(_),l.subModification=V,V.startAll(o({},c))}},set:function(c){var l=c.state,u=c.rect,m=c.coords,g=l.linkedEdges,v=K({},m),b=l.equalDelta?x2:w2;if(K(c.edges,g),b(l,l.xIsPrimaryAxis,m,u),!l.subModification)return null;var y=K({},u);li(g,y,{x:m.x-v.x,y:m.y-v.y});var w=l.subModification.setAll(o(o({},c),{},{rect:y,edges:g,pageCoords:m,prevCoords:m,prevRect:y})),M=w.delta;return w.changed&&(b(l,Math.abs(M.x)>Math.abs(M.y),w.coords,w.rect),K(m,w.coords)),w.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function x2(c,l,u){var m=c.startCoords,g=c.edgeSign;l?u.y=m.y+(u.x-m.x)*g.y:u.x=m.x+(u.y-m.y)*g.x}function w2(c,l,u,m){var g=c.startRect,v=c.startCoords,b=c.ratio,y=c.edgeSign;if(l){var w=m.width/b;u.y=v.y+(w-g.height)*y.y}else{var M=m.height*b;u.x=v.x+(M-g.width)*y.x}}var _2=di(k2,"aspectRatio"),oh=function(){};oh._defaults={};var hs=oh;function ji(c,l,u){return $.func(c)?lo(c,l.interactable,l.element,[u.x,u.y,l]):lo(c,l.interactable,l.element)}var ps={start:function(c){var l=c.rect,u=c.startOffset,m=c.state,g=c.interaction,v=c.pageCoords,b=m.options,y=b.elementRect,w=K({left:0,top:0,right:0,bottom:0},b.offset||{});if(l&&y){var M=ji(b.restriction,g,v);if(M){var _=M.right-M.left-l.width,E=M.bottom-M.top-l.height;_<0&&(w.left+=_,w.right+=_),E<0&&(w.top+=E,w.bottom+=E)}w.left+=u.left-l.width*y.left,w.top+=u.top-l.height*y.top,w.right+=u.right-l.width*(1-y.right),w.bottom+=u.bottom-l.height*(1-y.bottom)}m.offset=w},set:function(c){var l=c.coords,u=c.interaction,m=c.state,g=m.options,v=m.offset,b=ji(g.restriction,u,l);if(b){var y=function(w){return!w||"left"in w&&"top"in w||((w=K({},w)).left=w.x||0,w.top=w.y||0,w.right=w.right||w.left+w.width,w.bottom=w.bottom||w.top+w.height),w}(b);l.x=Math.max(Math.min(y.right-v.right,l.x),y.left+v.left),l.y=Math.max(Math.min(y.bottom-v.bottom,l.y),y.top+v.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},M2=di(ps,"restrict"),ih={top:1/0,left:1/0,bottom:-1/0,right:-1/0},nh={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function ah(c,l){for(var u=0,m=["top","left","bottom","right"];u<m.length;u++){var g=m[u];g in c||(c[g]=l[g])}return c}var sa={noInner:ih,noOuter:nh,start:function(c){var l,u=c.interaction,m=c.startOffset,g=c.state,v=g.options;v&&(l=Xr(ji(v.offset,u,u.coords.start.page))),l=l||{x:0,y:0},g.offset={top:l.y+m.top,left:l.x+m.left,bottom:l.y-m.bottom,right:l.x-m.right}},set:function(c){var l=c.coords,u=c.edges,m=c.interaction,g=c.state,v=g.offset,b=g.options;if(u){var y=K({},l),w=ji(b.inner,m,y)||{},M=ji(b.outer,m,y)||{};ah(w,ih),ah(M,nh),u.top?l.y=Math.min(Math.max(M.top+v.top,y.y),w.top+v.top):u.bottom&&(l.y=Math.max(Math.min(M.bottom+v.bottom,y.y),w.bottom+v.bottom)),u.left?l.x=Math.min(Math.max(M.left+v.left,y.x),w.left+v.left):u.right&&(l.x=Math.max(Math.min(M.right+v.right,y.x),w.right+v.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},C2=di(sa,"restrictEdges"),z2=K({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(c){}},ps.defaults),E2=di({start:ps.start,set:ps.set,defaults:z2},"restrictRect"),S2={width:-1/0,height:-1/0},$2={width:1/0,height:1/0},T2=di({start:function(c){return sa.start(c)},set:function(c){var l=c.interaction,u=c.state,m=c.rect,g=c.edges,v=u.options;if(g){var b=co(ji(v.min,l,c.coords))||S2,y=co(ji(v.max,l,c.coords))||$2;u.options={endOnly:v.endOnly,inner:K({},sa.noInner),outer:K({},sa.noOuter)},g.top?(u.options.inner.top=m.bottom-b.height,u.options.outer.top=m.bottom-y.height):g.bottom&&(u.options.inner.bottom=m.top+b.height,u.options.outer.bottom=m.top+y.height),g.left?(u.options.inner.left=m.right-b.width,u.options.outer.left=m.right-y.width):g.right&&(u.options.inner.right=m.left+b.width,u.options.outer.right=m.left+y.width),sa.set(c),u.options=v}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),rc={start:function(c){var l,u=c.interaction,m=c.interactable,g=c.element,v=c.rect,b=c.state,y=c.startOffset,w=b.options,M=w.offsetWithOrigin?function(j){var V=j.interaction.element,I=Xr(lo(j.state.options.origin,null,null,[V])),D=I||Bo(j.interactable,V,j.interaction.prepared.name);return D}(c):{x:0,y:0};if(w.offset==="startCoords")l={x:u.coords.start.page.x,y:u.coords.start.page.y};else{var _=lo(w.offset,m,g,[u]);(l=Xr(_)||{x:0,y:0}).x+=M.x,l.y+=M.y}var E=w.relativePoints;b.offsets=v&&E&&E.length?E.map(function(j,V){return{index:V,relativePoint:j,x:y.left-v.width*j.x+l.x,y:y.top-v.height*j.y+l.y}}):[{index:0,relativePoint:null,x:l.x,y:l.y}]},set:function(c){var l=c.interaction,u=c.coords,m=c.state,g=m.options,v=m.offsets,b=Bo(l.interactable,l.element,l.prepared.name),y=K({},u),w=[];g.offsetWithOrigin||(y.x-=b.x,y.y-=b.y);for(var M=0,_=v;M<_.length;M++)for(var E=_[M],j=y.x-E.x,V=y.y-E.y,I=0,D=g.targets.length;I<D;I++){var W=g.targets[I],B=void 0;(B=$.func(W)?W(j,V,l._proxy,E,I):W)&&w.push({x:($.number(B.x)?B.x:j)+E.x,y:($.number(B.y)?B.y:V)+E.y,range:$.number(B.range)?B.range:g.range,source:W,index:I,offset:E})}for(var G={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},de=0;de<w.length;de++){var ke=w[de],te=ke.range,pe=ke.x-y.x,mr=ke.y-y.y,tt=ea(pe,mr),Fr=tt<=te;te===1/0&&G.inRange&&G.range!==1/0&&(Fr=!1),G.target&&!(Fr?G.inRange&&te!==1/0?tt/te<G.distance/G.range:te===1/0&&G.range!==1/0||tt<G.distance:!G.inRange&&tt<G.distance)||(G.target=ke,G.distance=tt,G.range=te,G.inRange=Fr,G.delta.x=pe,G.delta.y=mr)}return G.inRange&&(u.x=G.target.x,u.y=G.target.y),m.closest=G,G},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},A2=di(rc,"snap"),ms={start:function(c){var l=c.state,u=c.edges,m=l.options;if(!u)return null;c.state={options:{targets:null,relativePoints:[{x:u.left?0:1,y:u.top?0:1}],offset:m.offset||"self",origin:{x:0,y:0},range:m.range}},l.targetFields=l.targetFields||[["width","height"],["x","y"]],rc.start(c),l.offsets=c.state.offsets,c.state=l},set:function(c){var l=c.interaction,u=c.state,m=c.coords,g=u.options,v=u.offsets,b={x:m.x-v[0].x,y:m.y-v[0].y};u.options=K({},g),u.options.targets=[];for(var y=0,w=g.targets||[];y<w.length;y++){var M=w[y],_=void 0;if(_=$.func(M)?M(b.x,b.y,l):M){for(var E=0,j=u.targetFields;E<j.length;E++){var V=j[E],I=V[0],D=V[1];if(I in _||D in _){_.x=_[I],_.y=_[D];break}}u.options.targets.push(_)}}var W=rc.set(c);return u.options=g,W},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},P2=di(ms,"snapSize"),oc={aspectRatio:_2,restrictEdges:C2,restrict:M2,restrictRect:E2,restrictSize:T2,snapEdges:di({start:function(c){var l=c.edges;return l?(c.state.targetFields=c.state.targetFields||[[l.left?"left":"right",l.top?"top":"bottom"]],ms.start(c)):null},set:ms.set,defaults:K(dn(ms.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:A2,snapSize:P2,spring:hs,avoid:hs,transform:hs,rubberband:hs},j2={id:"modifiers",install:function(c){var l=c.interactStatic;for(var u in c.usePlugin(Lu),c.usePlugin(y2),l.modifiers=oc,oc){var m=oc[u],g=m._defaults,v=m._methods;g._methods=v,c.defaults.perAction[u]=g}}},O2=j2,sh=function(c){d(u,c);var l=x(u);function u(m,g,v,b,y,w){var M;if(t(this,u),os(f(M=l.call(this,y)),v),v!==g&&os(f(M),g),M.timeStamp=w,M.originalEvent=v,M.type=m,M.pointerId=ta(g),M.pointerType=Mu(g),M.target=b,M.currentTarget=null,m==="tap"){var _=y.getPointerIndex(g);M.dt=M.timeStamp-y.pointers[_].downTime;var E=M.timeStamp-y.tapTime;M.double=!!y.prevTap&&y.prevTap.type!=="doubletap"&&y.prevTap.target===M.target&&E<500}else m==="doubletap"&&(M.dt=g.timeStamp-y.tapTime,M.double=!0);return M}return n(u,[{key:"_subtractOrigin",value:function(m){var g=m.x,v=m.y;return this.pageX-=g,this.pageY-=v,this.clientX-=g,this.clientY-=v,this}},{key:"_addOrigin",value:function(m){var g=m.x,v=m.y;return this.pageX+=g,this.pageY+=v,this.clientX+=g,this.clientY+=v,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),u}(as),la={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(c){c.pointerEvents=la,c.defaults.actions.pointerEvents=la.defaults,K(c.actions.phaselessTypes,la.types)},listeners:{"interactions:new":function(c){var l=c.interaction;l.prevTap=null,l.tapTime=0},"interactions:update-pointer":function(c){var l=c.down,u=c.pointerInfo;!l&&u.hold||(u.hold={duration:1/0,timeout:null})},"interactions:move":function(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget;c.duplicate||u.pointerIsDown&&!u.pointerWasMoved||(u.pointerIsDown&&ic(c),hi({interaction:u,pointer:m,event:g,eventTarget:v,type:"move"},l))},"interactions:down":function(c,l){(function(u,m){for(var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget,w=u.pointerIndex,M=g.pointers[w].hold,_=ae(y),E={interaction:g,pointer:v,event:b,eventTarget:y,type:"hold",targets:[],path:_,node:null},j=0;j<_.length;j++){var V=_[j];E.node=V,m.fire("pointerEvents:collect-targets",E)}if(E.targets.length){for(var I=1/0,D=0,W=E.targets;D<W.length;D++){var B=W[D].eventable.options.holdDuration;B<I&&(I=B)}M.duration=I,M.timeout=setTimeout(function(){hi({interaction:g,eventTarget:y,pointer:v,event:b,type:"hold"},m)},I)}})(c,l),hi(c,l)},"interactions:up":function(c,l){ic(c),hi(c,l),function(u,m){var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget;g.pointerWasMoved||hi({interaction:g,eventTarget:y,pointer:v,event:b,type:"tap"},m)}(c,l)},"interactions:cancel":function(c,l){ic(c),hi(c,l)}},PointerEvent:sh,fire:hi,collectEventTargets:lh,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function hi(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget,b=c.type,y=c.targets,w=y===void 0?lh(c,l):y,M=new sh(b,m,g,v,u,l.now());l.fire("pointerEvents:new",{pointerEvent:M});for(var _={interaction:u,pointer:m,event:g,eventTarget:v,targets:w,type:b,pointerEvent:M},E=0;E<w.length;E++){var j=w[E];for(var V in j.props||{})M[V]=j.props[V];var I=Bo(j.eventable,j.node);if(M._subtractOrigin(I),M.eventable=j.eventable,M.currentTarget=j.node,j.eventable.fire(M),M._addOrigin(I),M.immediatePropagationStopped||M.propagationStopped&&E+1<w.length&&w[E+1].node!==M.currentTarget)break}if(l.fire("pointerEvents:fired",_),b==="tap"){var D=M.double?hi({interaction:u,pointer:m,event:g,eventTarget:v,type:"doubletap"},l):M;u.prevTap=D,u.tapTime=D.timeStamp}return M}function lh(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget,b=c.type,y=u.getPointerIndex(m),w=u.pointers[y];if(b==="tap"&&(u.pointerWasMoved||!w||w.downTarget!==v))return[];for(var M=ae(v),_={interaction:u,pointer:m,event:g,eventTarget:v,type:b,path:M,targets:[],node:null},E=0;E<M.length;E++){var j=M[E];_.node=j,l.fire("pointerEvents:collect-targets",_)}return b==="hold"&&(_.targets=_.targets.filter(function(V){var I,D;return V.eventable.options.holdDuration===((I=u.pointers[y])==null||(D=I.hold)==null?void 0:D.duration)})),_.targets}function ic(c){var l=c.interaction,u=c.pointerIndex,m=l.pointers[u].hold;m&&m.timeout&&(clearTimeout(m.timeout),m.timeout=null)}var H2=Object.freeze({__proto__:null,default:la});function R2(c){var l=c.interaction;l.holdIntervalHandle&&(clearInterval(l.holdIntervalHandle),l.holdIntervalHandle=null)}var I2={id:"pointer-events/holdRepeat",install:function(c){c.usePlugin(la);var l=c.pointerEvents;l.defaults.holdRepeatInterval=0,l.types.holdrepeat=c.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce(function(c,l){return c["pointerEvents:".concat(l)]=R2,c},{"pointerEvents:new":function(c){var l=c.pointerEvent;l.type==="hold"&&(l.count=(l.count||0)+1)},"pointerEvents:fired":function(c,l){var u=c.interaction,m=c.pointerEvent,g=c.eventTarget,v=c.targets;if(m.type==="hold"&&v.length){var b=v[0].eventable.options.holdRepeatInterval;b<=0||(u.holdIntervalHandle=setTimeout(function(){l.pointerEvents.fire({interaction:u,eventTarget:g,type:"hold",pointer:m,event:m},l)},b))}}})},V2=I2,D2={id:"pointer-events/interactableTargets",install:function(c){var l=c.Interactable;l.prototype.pointerEvents=function(m){return K(this.events.options,m),this};var u=l.prototype._backCompatOption;l.prototype._backCompatOption=function(m,g){var v=u.call(this,m,g);return v===this&&(this.events.options[m]=g),v}},listeners:{"pointerEvents:collect-targets":function(c,l){var u=c.targets,m=c.node,g=c.type,v=c.eventTarget;l.interactables.forEachMatch(m,function(b){var y=b.events,w=y.options;y.types[g]&&y.types[g].length&&b.testIgnoreAllow(w,m,v)&&u.push({node:m,eventable:y,props:{interactable:b}})})},"interactable:new":function(c){var l=c.interactable;l.events.getRect=function(u){return l.getRect(u)}},"interactable:set":function(c,l){var u=c.interactable,m=c.options;K(u.events.options,l.pointerEvents.defaults),K(u.events.options,m.pointerEvents||{})}}},F2=D2,N2={id:"pointer-events",install:function(c){c.usePlugin(H2),c.usePlugin(V2),c.usePlugin(F2)}},L2=N2,B2={id:"reflow",install:function(c){var l=c.Interactable;c.actions.phases.reflow=!0,l.prototype.reflow=function(u){return function(m,g,v){for(var b=m.getAllElements(),y=v.window.Promise,w=y?[]:null,M=function(){var E=b[_],j=m.getRect(E);if(!j)return 1;var V,I=oa(v.interactions.list,function(B){return B.interacting()&&B.interactable===m&&B.element===E&&B.prepared.name===g.name});if(I)I.move(),w&&(V=I._reflowPromise||new y(function(B){I._reflowResolve=B}));else{var D=co(j),W=function(B){return{coords:B,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}}({page:{x:D.x,y:D.y},client:{x:D.x,y:D.y},timeStamp:v.now()});V=function(B,G,de,ke,te){var pe=B.interactions.new({pointerType:"reflow"}),mr={interaction:pe,event:te,pointer:te,eventTarget:de,phase:"reflow"};pe.interactable=G,pe.element=de,pe.prevEvent=te,pe.updatePointer(te,te,de,!0),ku(pe.coords.delta),Wl(pe.prepared,ke),pe._doPhase(mr);var tt=B.window,Fr=tt.Promise,ho=Fr?new Fr(function(Wo){pe._reflowResolve=Wo}):void 0;return pe._reflowPromise=ho,pe.start(ke,G,de),pe._interacting?(pe.move(mr),pe.end(te)):(pe.stop(),pe._reflowResolve()),pe.removePointer(te,te),ho}(v,m,E,g,W)}w&&w.push(V)},_=0;_<b.length&&!M();_++);return w&&y.all(w).then(function(){return m})}(this,u,c)}},listeners:{"interactions:stop":function(c,l){var u=c.interaction;u.pointerType==="reflow"&&(u._reflowResolve&&u._reflowResolve(),function(m,g){m.splice(m.indexOf(g),1)}(l.interactions.list,u))}}},q2=B2;if(pr.use(Nu),pr.use(Uu),pr.use(L2),pr.use(s2),pr.use(O2),pr.use(Y0),pr.use(V0),pr.use(F0),pr.use(q2),pr.default=pr,(typeof Bi>"u"?"undefined":e(Bi))==="object"&&Bi)try{Bi.exports=pr}catch{}return pr.default=pr,pr})});import{css as gg,html as ka,LitElement as fg,nothing as kc}from"lit";import{customElement as vg,property as mo,state as xc}from"lit/decorators.js";import{css as mh}from"lit";var A=mh`
1
+ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDescriptor;var W2=Object.getOwnPropertyNames;var U2=Object.getPrototypeOf,G2=Object.prototype.hasOwnProperty;var dh=i=>{throw TypeError(i)};var nc=(i,o)=>()=>(i&&(o=i(i=0)),o);var Y2=(i,o)=>()=>(o||i((o={exports:{}}).exports,o),o.exports),X2=(i,o)=>{for(var e in o)fs(i,e,{get:o[e],enumerable:!0})},Z2=(i,o,e,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of W2(o))!G2.call(i,r)&&r!==e&&fs(i,r,{get:()=>o[r],enumerable:!(t=ch(o,r))||t.enumerable});return i};var da=(i,o,e)=>(e=i!=null?K2(U2(i)):{},Z2(o||!i||!i.__esModule?fs(e,"default",{value:i,enumerable:!0}):e,i));var a=(i,o,e,t)=>{for(var r=t>1?void 0:t?ch(o,e):o,n=i.length-1,s;n>=0;n--)(s=i[n])&&(r=(t?s(o,e,r):s(r))||r);return t&&r&&fs(o,e,r),r};var uh=(i,o,e)=>o.has(i)||dh("Cannot "+e);var ve=(i,o,e)=>(uh(i,o,"read from private field"),e?e.call(i):o.get(i)),hh=(i,o,e)=>o.has(i)?dh("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(i):o.set(i,e),ph=(i,o,e,t)=>(uh(i,o,"write to private field"),t?t.call(i,e):o.set(i,e),e);var Sa,xp=nc(()=>{Sa=class{constructor(o){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,o?.roundAverageSize===!0&&(this._roundAverageSize=!0)}set(o,e){let t=this._map.get(o)||0;this._map.set(o,e),this.totalSize+=e-t}get averageSize(){if(this._map.size>0){let o=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(o):o}return 0}getSize(o){return this._map.get(o)}clear(){this._map.clear(),this.totalSize=0}}});function Oc(i){return i==="horizontal"?"width":"height"}var Ns,wp=nc(()=>{Ns=class{_getDefaultConfig(){return{direction:"vertical"}}constructor(o,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=o,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(o){Object.assign(this,Object.assign({},this._getDefaultConfig(),o))}get config(){return{direction:this.direction}}get items(){return this._items}set items(o){this._setItems(o)}_setItems(o){o!==this._items&&(this._items=o,this._scheduleReflow())}get direction(){return this._direction}set direction(o){o=o==="horizontal"?o:"vertical",o!==this._direction&&(this._direction=o,this._sizeDim=o==="horizontal"?"width":"height",this._secondarySizeDim=o==="horizontal"?"height":"width",this._positionDim=o==="horizontal"?"left":"top",this._secondaryPositionDim=o==="horizontal"?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(o){let{_viewDim1:e,_viewDim2:t}=this;Object.assign(this._viewportSize,o),t!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(o){Object.assign(this._latestCoords,o);let e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(o=!1){(o||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(o){this._pin=o,this._triggerReflow()}get pin(){if(this._pin!==null){let{index:o,block:e}=this._pin;return{index:Math.max(0,Math.min(o,this.items.length-1)),block:e}}return null}_clampScrollPosition(o){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(o,this.totalScrollSize[Oc(this.direction)]-this._viewDim1))}unpin(){this._pin!==null&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(this.pin!==null){let o=this._scrollPosition,{index:e,block:t}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:t||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=o-this._scrollPosition}}_calculateScrollIntoViewPosition(o){let{block:e}=o,t=Math.min(this.items.length,Math.max(0,o.index)),r=this._getItemPosition(t)[this._positionDim],n=r;if(e!=="start"){let s=this._getItemSize(t)[this._sizeDim];if(e==="center")n=r-.5*this._viewDim1+.5*s;else{let d=r-this._viewDim1+s;if(e==="end")n=d;else{let h=this._scrollPosition;n=Math.abs(h-r)<Math.abs(h-d)?r:d}}}return n+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(n)}getScrollIntoViewCoordinates(o){return{[this._positionDim]:this._calculateScrollIntoViewPosition(o)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){let o=new Map;if(this._first!==-1&&this._last!==-1)for(let t=this._first;t<=this._last;t++)o.set(t,this._getItemPosition(t));let e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:o};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return this._first===-1||this._last===-1?0:this._last-this._first+1}_checkThresholds(){if(this._viewDim1===0&&this._num>0||this._pin!==null)this._scheduleReflow();else{let o=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>o||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(o){if(this._first===-1||this._last===-1)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let t=this._last;for(;t>this._first&&Math.round(this._getItemPosition(t)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)t--;(e!==this._firstVisible||t!==this._lastVisible)&&(this._firstVisible=e,this._lastVisible=t,o&&o.emit&&this._sendVisibilityChangedMessage())}}});var Mp={};X2(Mp,{FlowLayout:()=>Ls,flow:()=>wf});function _p(i){return i==="horizontal"?"marginLeft":"marginTop"}function _f(i){return i==="horizontal"?"marginRight":"marginBottom"}function Mf(i){return i==="horizontal"?"xOffset":"yOffset"}function Cf(i,o){let e=[i,o].sort();return e[1]<=0?Math.min(...e):e[0]>=0?Math.max(...e):e[0]+e[1]}var wf,Hc,Ls,Cp=nc(()=>{xp();wp();wf=i=>Object.assign({type:Ls},i);Hc=class{constructor(){this._childSizeCache=new Sa,this._marginSizeCache=new Sa,this._metricsCache=new Map}update(o,e){let t=new Set;Object.keys(o).forEach(r=>{let n=Number(r);this._metricsCache.set(n,o[n]),this._childSizeCache.set(n,o[n][Oc(e)]),t.add(n),t.add(n+1)});for(let r of t){let n=this._metricsCache.get(r)?.[_p(e)]||0,s=this._metricsCache.get(r-1)?.[_f(e)]||0;this._marginSizeCache.set(r,Cf(n,s))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(o,e){return this._metricsCache.get(o)?.[_p(e)]||0}getChildSize(o){return this._childSizeCache.getSize(o)}getMarginSize(o){return this._marginSizeCache.getSize(o)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}},Ls=class extends Ns{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new Hc,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(o){this._metricsCache.update(o,this.direction),this._scheduleReflow()}_getPhysicalItem(o){return this._newPhysicalItems.get(o)??this._physicalItems.get(o)}_getSize(o){return this._getPhysicalItem(o)&&this._metricsCache.getChildSize(o)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(o){let e=this._metricsCache;if(this._first===-1||this._last===-1)return e.averageMarginSize+o*(e.averageMarginSize+this._getAverageSize());if(o<this._first){let t=this._first-o;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(t*e.averageChildSize+(t-1)*e.averageMarginSize)}else{let t=o-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+t*(e.averageChildSize+e.averageMarginSize)}}_getPosition(o){let e=this._getPhysicalItem(o),{averageMarginSize:t}=this._metricsCache;return o===0?this._metricsCache.getMarginSize(0)??t:e?e.pos:this._estimatePosition(o)}_calculateAnchor(o,e){return o<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((o+e)/2/this._delta)))}_getAnchor(o,e){if(this._physicalItems.size===0)return this._calculateAnchor(o,e);if(this._first<0)return this._calculateAnchor(o,e);if(this._last<0)return this._calculateAnchor(o,e);let t=this._getPhysicalItem(this._first),r=this._getPhysicalItem(this._last),n=t.pos;if(r.pos+this._metricsCache.getChildSize(this._last)<o)return this._calculateAnchor(o,e);if(n>e)return this._calculateAnchor(o,e);let h=this._firstVisible-1,p=-1/0;for(;p<o;)p=this._getPhysicalItem(++h).pos+this._metricsCache.getChildSize(h);return h}_getActiveItems(){this._viewDim1===0||this.items.length===0?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;let o=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=o,this._stable=!0}_getItems(){let o=this._newPhysicalItems;this._stable=!0;let e,t;if(this.pin!==null){let{index:p}=this.pin;this._anchorIdx=p,this._anchorPos=this._getPosition(p)}if(e=this._scrollPosition-this._overhang,t=this._scrollPosition+this._viewDim1+this._overhang,t<0||e>this._scrollSize){this._clearItems();return}(this._anchorIdx===null||this._anchorPos===null)&&(this._anchorIdx=this._getAnchor(e,t),this._anchorPos=this._getPosition(this._anchorIdx));let r=this._getSize(this._anchorIdx);r===void 0&&(this._stable=!1,r=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,s=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;this._anchorIdx===0&&(this._anchorPos=n),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-s-r);let d=0;for(this._anchorPos+r+s<e&&(d=e-(this._anchorPos+r+s)),this._anchorPos-n>t&&(d=t-(this._anchorPos-n)),d&&(this._scrollPosition-=d,e-=d,t-=d,this._scrollError+=d),o.set(this._anchorIdx,{pos:this._anchorPos,size:r}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-n,this._physicalMax=this._anchorPos+r+s;this._physicalMin>e&&this._first>0;){let p=this._getSize(--this._first);p===void 0&&(this._stable=!1,p=this._getAverageSize());let f=this._metricsCache.getMarginSize(this._first);f===void 0&&(this._stable=!1,f=this._metricsCache.averageMarginSize),this._physicalMin-=p;let x=this._physicalMin;if(o.set(this._first,{pos:x,size:p}),this._physicalMin-=f,this._stable===!1&&this._estimate===!1)break}for(;this._physicalMax<t&&this._last<this.items.length-1;){let p=this._getSize(++this._last);p===void 0&&(this._stable=!1,p=this._getAverageSize());let f=this._metricsCache.getMarginSize(this._last);f===void 0&&(this._stable=!1,f=this._metricsCache.averageMarginSize);let x=this._physicalMax;if(o.set(this._last,{pos:x,size:p}),this._physicalMax+=p+f,!this._stable&&!this._estimate)break}let h=this._calculateError();h&&(this._physicalMin-=h,this._physicalMax-=h,this._anchorPos-=h,this._scrollPosition-=h,o.forEach(p=>p.pos-=h),this._scrollError+=h),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=o)}_calculateError(){return this._first===0?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){let{_first:o,_last:e}=this;super._reflow(),(this._first===-1&&this._last==-1||this._first===o&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){let{averageMarginSize:o}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(o+this._getAverageSize())+o)}get _delta(){let{averageMarginSize:o}=this._metricsCache;return this._getAverageSize()+o}_getItemPosition(o){return{[this._positionDim]:this._getPosition(o),[this._secondaryPositionDim]:0,[Mf(this.direction)]:-(this._metricsCache.getLeadingMarginValue(o,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(o){return{[this._sizeDim]:this._getSize(o)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});var _n=Y2((Lc,Bi)=>{(function(i,o){typeof Lc=="object"&&typeof Bi<"u"?Bi.exports=o():typeof define=="function"&&define.amd?define(o):(i=typeof globalThis<"u"?globalThis:i||self).interact=o()})(Lc,function(){"use strict";function i(c,l){var u=Object.keys(c);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(c);l&&(m=m.filter(function(g){return Object.getOwnPropertyDescriptor(c,g).enumerable})),u.push.apply(u,m)}return u}function o(c){for(var l=1;l<arguments.length;l++){var u=arguments[l]!=null?arguments[l]:{};l%2?i(Object(u),!0).forEach(function(m){s(c,m,u[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(u)):i(Object(u)).forEach(function(m){Object.defineProperty(c,m,Object.getOwnPropertyDescriptor(u,m))})}return c}function e(c){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},e(c)}function t(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function r(c,l){for(var u=0;u<l.length;u++){var m=l[u];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,C(m.key),m)}}function n(c,l,u){return l&&r(c.prototype,l),u&&r(c,u),Object.defineProperty(c,"prototype",{writable:!1}),c}function s(c,l,u){return(l=C(l))in c?Object.defineProperty(c,l,{value:u,enumerable:!0,configurable:!0,writable:!0}):c[l]=u,c}function d(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(l&&l.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),l&&p(c,l)}function h(c){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(l){return l.__proto__||Object.getPrototypeOf(l)},h(c)}function p(c,l){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,m){return u.__proto__=m,u},p(c,l)}function f(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function x(c){var l=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var u,m=h(c);if(l){var g=h(this).constructor;u=Reflect.construct(m,arguments,g)}else u=m.apply(this,arguments);return function(v,b){if(b&&(typeof b=="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(v)}(this,u)}}function k(){return k=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(c,l,u){var m=function(v,b){for(;!Object.prototype.hasOwnProperty.call(v,b)&&(v=h(v))!==null;);return v}(c,l);if(m){var g=Object.getOwnPropertyDescriptor(m,l);return g.get?g.get.call(arguments.length<3?c:u):g.value}},k.apply(this,arguments)}function C(c){var l=function(u,m){if(typeof u!="object"||u===null)return u;var g=u[Symbol.toPrimitive];if(g!==void 0){var v=g.call(u,m||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(m==="string"?String:Number)(u)}(c,"string");return typeof l=="symbol"?l:l+""}var S=function(c){return!(!c||!c.Window)&&c instanceof c.Window},z=void 0,T=void 0;function P(c){z=c;var l=c.document.createTextNode("");l.ownerDocument!==c.document&&typeof c.wrap=="function"&&c.wrap(l)===l&&(c=c.wrap(c)),T=c}function H(c){return S(c)?c:(c.ownerDocument||c).defaultView||T.window}typeof window<"u"&&window&&P(window);var R=function(c){return!!c&&e(c)==="object"},N=function(c){return typeof c=="function"},$={window:function(c){return c===T||S(c)},docFrag:function(c){return R(c)&&c.nodeType===11},object:R,func:N,number:function(c){return typeof c=="number"},bool:function(c){return typeof c=="boolean"},string:function(c){return typeof c=="string"},element:function(c){if(!c||e(c)!=="object")return!1;var l=H(c)||T;return/object|function/.test(typeof Element>"u"?"undefined":e(Element))?c instanceof Element||c instanceof l.Element:c.nodeType===1&&typeof c.nodeName=="string"},plainObject:function(c){return R(c)&&!!c.constructor&&/function Object\b/.test(c.constructor.toString())},array:function(c){return R(c)&&c.length!==void 0&&N(c.splice)}};function Q(c){var l=c.interaction;if(l.prepared.name==="drag"){var u=l.prepared.axis;u==="x"?(l.coords.cur.page.y=l.coords.start.page.y,l.coords.cur.client.y=l.coords.start.client.y,l.coords.velocity.client.y=0,l.coords.velocity.page.y=0):u==="y"&&(l.coords.cur.page.x=l.coords.start.page.x,l.coords.cur.client.x=l.coords.start.client.x,l.coords.velocity.client.x=0,l.coords.velocity.page.x=0)}}function fe(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="drag"){var m=u.prepared.axis;if(m==="x"||m==="y"){var g=m==="x"?"y":"x";l.page[g]=u.coords.start.page[g],l.client[g]=u.coords.start.client[g],l.delta[g]=0}}}var Te={id:"actions/drag",install:function(c){var l=c.actions,u=c.Interactable,m=c.defaults;u.prototype.draggable=Te.draggable,l.map.drag=Te,l.methodDict.drag="draggable",m.actions.drag=Te.defaults},listeners:{"interactions:before-action-move":Q,"interactions:action-resume":Q,"interactions:action-move":fe,"auto-start:check":function(c){var l=c.interaction,u=c.interactable,m=c.buttons,g=u.options.drag;if(g&&g.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||m&u.options.drag.mouseButtons))return c.action={name:"drag",axis:g.lockAxis==="start"?g.startAxis:g.lockAxis},!1}},draggable:function(c){return $.object(c)?(this.options.drag.enabled=c.enabled!==!1,this.setPerAction("drag",c),this.setOnEvents("drag",c),/^(xy|x|y|start)$/.test(c.lockAxis)&&(this.options.drag.lockAxis=c.lockAxis),/^(xy|x|y)$/.test(c.startAxis)&&(this.options.drag.startAxis=c.startAxis),this):$.bool(c)?(this.options.drag.enabled=c,this):this.options.drag},beforeMove:Q,move:fe,defaults:{startAxis:"xy",lockAxis:"xy"},getCursor:function(){return"move"},filterEventType:function(c){return c.search("drag")===0}},et=Te,we={init:function(c){var l=c;we.document=l.document,we.DocumentFragment=l.DocumentFragment||ao,we.SVGElement=l.SVGElement||ao,we.SVGSVGElement=l.SVGSVGElement||ao,we.SVGElementInstance=l.SVGElementInstance||ao,we.Element=l.Element||ao,we.HTMLElement=l.HTMLElement||we.Element,we.Event=l.Event,we.Touch=l.Touch||ao,we.PointerEvent=l.PointerEvent||l.MSPointerEvent},document:null,DocumentFragment:null,SVGElement:null,SVGSVGElement:null,SVGElementInstance:null,Element:null,HTMLElement:null,Event:null,Touch:null,PointerEvent:null};function ao(){}var Fe=we,Zt={init:function(c){var l=Fe.Element,u=c.navigator||{};Zt.supportsTouch="ontouchstart"in c||$.func(c.DocumentTouch)&&Fe.document instanceof c.DocumentTouch,Zt.supportsPointerEvent=u.pointerEnabled!==!1&&!!Fe.PointerEvent,Zt.isIOS=/iP(hone|od|ad)/.test(u.platform),Zt.isIOS7=/iP(hone|od|ad)/.test(u.platform)&&/OS 7[^\d]/.test(u.appVersion),Zt.isIe9=/MSIE 9/.test(u.userAgent),Zt.isOperaMobile=u.appName==="Opera"&&Zt.supportsTouch&&/Presto/.test(u.userAgent),Zt.prefixedMatchesSelector="matches"in l.prototype?"matches":"webkitMatchesSelector"in l.prototype?"webkitMatchesSelector":"mozMatchesSelector"in l.prototype?"mozMatchesSelector":"oMatchesSelector"in l.prototype?"oMatchesSelector":"msMatchesSelector",Zt.pEventTypes=Zt.supportsPointerEvent?Fe.PointerEvent===c.MSPointerEvent?{up:"MSPointerUp",down:"MSPointerDown",over:"mouseover",out:"mouseout",move:"MSPointerMove",cancel:"MSPointerCancel"}:{up:"pointerup",down:"pointerdown",over:"pointerover",out:"pointerout",move:"pointermove",cancel:"pointercancel"}:null,Zt.wheelEvent=Fe.document&&"onmousewheel"in Fe.document?"mousewheel":"wheel"},supportsTouch:null,supportsPointerEvent:null,isIOS7:null,isIOS:null,isIe9:null,isOperaMobile:null,prefixedMatchesSelector:null,pEventTypes:null,wheelEvent:null},hr=Zt;function so(c,l){if(c.contains)return c.contains(l);for(;l;){if(l===c)return!0;l=l.parentNode}return!1}function sn(c,l){for(;$.element(c);){if(Po(c,l))return c;c=Xr(c)}return null}function Xr(c){var l=c.parentNode;if($.docFrag(l)){for(;(l=l.host)&&$.docFrag(l););return l}return l}function Po(c,l){return T!==z&&(l=l.replace(/\/deep\//g," ")),c[hr.prefixedMatchesSelector](l)}var L=function(c){return c.parentNode||c.host};function J(c,l){for(var u,m=[],g=c;(u=L(g))&&g!==l&&u!==g.ownerDocument;)m.unshift(g),g=u;return m}function he(c,l,u){for(;$.element(c);){if(Po(c,l))return!0;if((c=Xr(c))===u)return Po(c,l)}return!1}function Oe(c){return c.correspondingUseElement||c}function X(c){var l=c instanceof Fe.SVGElement?c.getBoundingClientRect():c.getClientRects()[0];return l&&{left:l.left,right:l.right,top:l.top,bottom:l.bottom,width:l.width||l.right-l.left,height:l.height||l.bottom-l.top}}function _e(c){var l,u=X(c);if(!hr.isIOS7&&u){var m={x:(l=(l=H(c))||T).scrollX||l.document.documentElement.scrollLeft,y:l.scrollY||l.document.documentElement.scrollTop};u.left+=m.x,u.right+=m.x,u.top+=m.y,u.bottom+=m.y}return u}function ae(c){for(var l=[];c;)l.push(c),c=Xr(c);return l}function Tr(c){return!!$.string(c)&&(Fe.document.querySelector(c),!0)}function K(c,l){for(var u in l)c[u]=l[u];return c}function si(c,l,u){return c==="parent"?Xr(u):c==="self"?l.getRect(u):sn(u,c)}function lo(c,l,u,m){var g=c;return $.string(g)?g=si(g,l,u):$.func(g)&&(g=g.apply(void 0,m)),$.element(g)&&(g=_e(g)),g}function Zr(c){return c&&{x:"x"in c?c.x:c.left,y:"y"in c?c.y:c.top}}function co(c){return!c||"x"in c&&"y"in c||((c=K({},c)).x=c.left||0,c.y=c.top||0,c.width=c.width||(c.right||0)-c.x,c.height=c.height||(c.bottom||0)-c.y),c}function li(c,l,u){c.left&&(l.left+=u.x),c.right&&(l.right+=u.x),c.top&&(l.top+=u.y),c.bottom&&(l.bottom+=u.y),l.width=l.right-l.left,l.height=l.bottom-l.top}function Bo(c,l,u){var m=u&&c.options[u];return Zr(lo(m&&m.origin||c.options.origin,c,l,[c&&l]))||{x:0,y:0}}function uo(c,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(w){return!0},m=arguments.length>3?arguments[3]:void 0;if(m=m||{},$.string(c)&&c.search(" ")!==-1&&(c=ln(c)),$.array(c))return c.forEach(function(w){return uo(w,l,u,m)}),m;if($.object(c)&&(l=c,c=""),$.func(l)&&u(c))m[c]=m[c]||[],m[c].push(l);else if($.array(l))for(var g=0,v=l;g<v.length;g++){var b=v[g];uo(c,b,u,m)}else if($.object(l))for(var y in l)uo(ln(y).map(function(w){return"".concat(c).concat(w)}),l[y],u,m);return m}function ln(c){return c.trim().split(/ +/)}var ea=function(c,l){return Math.sqrt(c*c+l*l)},P0=["webkit","moz"];function os(c,l){c.__set||(c.__set={});var u=function(g){if(P0.some(function(v){return g.indexOf(v)===0}))return 1;typeof c[g]!="function"&&g!=="__set"&&Object.defineProperty(c,g,{get:function(){return g in c.__set?c.__set[g]:c.__set[g]=l[g]},set:function(v){c.__set[g]=v},configurable:!0})};for(var m in l)u(m);return c}function is(c,l){c.page=c.page||{},c.page.x=l.page.x,c.page.y=l.page.y,c.client=c.client||{},c.client.x=l.client.x,c.client.y=l.client.y,c.timeStamp=l.timeStamp}function ku(c){c.page.x=0,c.page.y=0,c.client.x=0,c.client.y=0}function xu(c){return c instanceof Fe.Event||c instanceof Fe.Touch}function ns(c,l,u){return c=c||"page",(u=u||{}).x=l[c+"X"],u.y=l[c+"Y"],u}function wu(c,l){return l=l||{x:0,y:0},hr.isOperaMobile&&xu(c)?(ns("screen",c,l),l.x+=window.scrollX,l.y+=window.scrollY):ns("page",c,l),l}function ta(c){return $.number(c.pointerId)?c.pointerId:c.identifier}function j0(c,l,u){var m=l.length>1?_u(l):l[0];wu(m,c.page),function(g,v){v=v||{},hr.isOperaMobile&&xu(g)?ns("screen",g,v):ns("client",g,v)}(m,c.client),c.timeStamp=u}function Il(c){var l=[];return $.array(c)?(l[0]=c[0],l[1]=c[1]):c.type==="touchend"?c.touches.length===1?(l[0]=c.touches[0],l[1]=c.changedTouches[0]):c.touches.length===0&&(l[0]=c.changedTouches[0],l[1]=c.changedTouches[1]):(l[0]=c.touches[0],l[1]=c.touches[1]),l}function _u(c){for(var l={pageX:0,pageY:0,clientX:0,clientY:0,screenX:0,screenY:0},u=0;u<c.length;u++){var m=c[u];for(var g in l)l[g]+=m[g]}for(var v in l)l[v]/=c.length;return l}function Vl(c){if(!c.length)return null;var l=Il(c),u=Math.min(l[0].pageX,l[1].pageX),m=Math.min(l[0].pageY,l[1].pageY),g=Math.max(l[0].pageX,l[1].pageX),v=Math.max(l[0].pageY,l[1].pageY);return{x:u,y:m,left:u,top:m,right:g,bottom:v,width:g-u,height:v-m}}function Dl(c,l){var u=l+"X",m=l+"Y",g=Il(c),v=g[0][u]-g[1][u],b=g[0][m]-g[1][m];return ea(v,b)}function Fl(c,l){var u=l+"X",m=l+"Y",g=Il(c),v=g[1][u]-g[0][u],b=g[1][m]-g[0][m];return 180*Math.atan2(b,v)/Math.PI}function Mu(c){return $.string(c.pointerType)?c.pointerType:$.number(c.pointerType)?[void 0,void 0,"touch","pen","mouse"][c.pointerType]:/touch/.test(c.type||"")||c instanceof Fe.Touch?"touch":"mouse"}function Cu(c){var l=$.func(c.composedPath)?c.composedPath():c.path;return[Oe(l?l[0]:c.target),Oe(c.currentTarget)]}var as=function(){function c(l){t(this,c),this.immediatePropagationStopped=!1,this.propagationStopped=!1,this._interaction=l}return n(c,[{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),c}();Object.defineProperty(as.prototype,"interaction",{get:function(){return this._interaction._proxy},set:function(){}});var zu=function(c,l){for(var u=0;u<l.length;u++){var m=l[u];c.push(m)}return c},Eu=function(c){return zu([],c)},ra=function(c,l){for(var u=0;u<c.length;u++)if(l(c[u],u,c))return u;return-1},oa=function(c,l){return c[ra(c,l)]},cn=function(c){d(u,c);var l=x(u);function u(m,g,v){var b;t(this,u),(b=l.call(this,g._interaction)).dropzone=void 0,b.dragEvent=void 0,b.relatedTarget=void 0,b.draggable=void 0,b.propagationStopped=!1,b.immediatePropagationStopped=!1;var y=v==="dragleave"?m.prev:m.cur,w=y.element,M=y.dropzone;return b.type=v,b.target=w,b.currentTarget=w,b.dropzone=M,b.dragEvent=g,b.relatedTarget=g.target,b.draggable=g.interactable,b.timeStamp=g.timeStamp,b}return n(u,[{key:"reject",value:function(){var m=this,g=this._interaction.dropState;if(this.type==="dropactivate"||this.dropzone&&g.cur.dropzone===this.dropzone&&g.cur.element===this.target)if(g.prev.dropzone=this.dropzone,g.prev.element=this.target,g.rejected=!0,g.events.enter=null,this.stopImmediatePropagation(),this.type==="dropactivate"){var v=g.activeDrops,b=ra(v,function(w){var M=w.dropzone,_=w.element;return M===m.dropzone&&_===m.target});g.activeDrops.splice(b,1);var y=new u(g,this.dragEvent,"dropdeactivate");y.dropzone=this.dropzone,y.target=this.target,this.dropzone.fire(y)}else this.dropzone.fire(new u(g,this.dragEvent,"dragleave"))}},{key:"preventDefault",value:function(){}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}}]),u}(as);function Su(c,l){for(var u=0,m=c.slice();u<m.length;u++){var g=m[u],v=g.dropzone,b=g.element;l.dropzone=v,l.target=b,v.fire(l),l.propagationStopped=l.immediatePropagationStopped=!1}}function Nl(c,l){for(var u=function(v,b){for(var y=[],w=0,M=v.interactables.list;w<M.length;w++){var _=M[w];if(_.options.drop.enabled){var E=_.options.drop.accept;if(!($.element(E)&&E!==b||$.string(E)&&!Po(b,E)||$.func(E)&&!E({dropzone:_,draggableElement:b})))for(var j=0,V=_.getAllElements();j<V.length;j++){var I=V[j];I!==b&&y.push({dropzone:_,element:I,rect:_.getRect(I)})}}}return y}(c,l),m=0;m<u.length;m++){var g=u[m];g.rect=g.dropzone.getRect(g.element)}return u}function $u(c,l,u){for(var m=c.dropState,g=c.interactable,v=c.element,b=[],y=0,w=m.activeDrops;y<w.length;y++){var M=w[y],_=M.dropzone,E=M.element,j=M.rect,V=_.dropCheck(l,u,g,v,E,j);b.push(V?E:null)}var I=function(D){for(var W,B,G,de=[],ke=0;ke<D.length;ke++){var te=D[ke],pe=D[W];if(te&&ke!==W)if(pe){var mr=L(te),tt=L(pe);if(mr!==te.ownerDocument)if(tt!==te.ownerDocument)if(mr!==tt){de=de.length?de:J(pe);var Nr=void 0;if(pe instanceof Fe.HTMLElement&&te instanceof Fe.SVGElement&&!(te instanceof Fe.SVGSVGElement)){if(te===tt)continue;Nr=te.ownerSVGElement}else Nr=te;for(var ho=J(Nr,pe.ownerDocument),Wo=0;ho[Wo]&&ho[Wo]===de[Wo];)Wo++;var gs=[ho[Wo-1],ho[Wo],de[Wo]];if(gs[0])for(var ca=gs[0].lastChild;ca;){if(ca===gs[1]){W=ke,de=ho;break}if(ca===gs[2])break;ca=ca.previousSibling}}else G=pe,(parseInt(H(B=te).getComputedStyle(B).zIndex,10)||0)>=(parseInt(H(G).getComputedStyle(G).zIndex,10)||0)&&(W=ke);else W=ke}else W=ke}return W}(b);return m.activeDrops[I]||null}function Ll(c,l,u){var m=c.dropState,g={enter:null,leave:null,activate:null,deactivate:null,move:null,drop:null};return u.type==="dragstart"&&(g.activate=new cn(m,u,"dropactivate"),g.activate.target=null,g.activate.dropzone=null),u.type==="dragend"&&(g.deactivate=new cn(m,u,"dropdeactivate"),g.deactivate.target=null,g.deactivate.dropzone=null),m.rejected||(m.cur.element!==m.prev.element&&(m.prev.dropzone&&(g.leave=new cn(m,u,"dragleave"),u.dragLeave=g.leave.target=m.prev.element,u.prevDropzone=g.leave.dropzone=m.prev.dropzone),m.cur.dropzone&&(g.enter=new cn(m,u,"dragenter"),u.dragEnter=m.cur.element,u.dropzone=m.cur.dropzone)),u.type==="dragend"&&m.cur.dropzone&&(g.drop=new cn(m,u,"drop"),u.dropzone=m.cur.dropzone,u.relatedTarget=m.cur.element),u.type==="dragmove"&&m.cur.dropzone&&(g.move=new cn(m,u,"dropmove"),u.dropzone=m.cur.dropzone)),g}function Bl(c,l){var u=c.dropState,m=u.activeDrops,g=u.cur,v=u.prev;l.leave&&v.dropzone.fire(l.leave),l.enter&&g.dropzone.fire(l.enter),l.move&&g.dropzone.fire(l.move),l.drop&&g.dropzone.fire(l.drop),l.deactivate&&Su(m,l.deactivate),u.prev.dropzone=g.dropzone,u.prev.element=g.element}function Tu(c,l){var u=c.interaction,m=c.iEvent,g=c.event;if(m.type==="dragmove"||m.type==="dragend"){var v=u.dropState;l.dynamicDrop&&(v.activeDrops=Nl(l,u.element));var b=m,y=$u(u,b,g);v.rejected=v.rejected&&!!y&&y.dropzone===v.cur.dropzone&&y.element===v.cur.element,v.cur.dropzone=y&&y.dropzone,v.cur.element=y&&y.element,v.events=Ll(u,0,b)}}var Au={id:"actions/drop",install:function(c){var l=c.actions,u=c.interactStatic,m=c.Interactable,g=c.defaults;c.usePlugin(et),m.prototype.dropzone=function(v){return function(b,y){if($.object(y)){if(b.options.drop.enabled=y.enabled!==!1,y.listeners){var w=uo(y.listeners),M=Object.keys(w).reduce(function(E,j){return E[/^(enter|leave)/.test(j)?"drag".concat(j):/^(activate|deactivate|move)/.test(j)?"drop".concat(j):j]=w[j],E},{}),_=b.options.drop.listeners;_&&b.off(_),b.on(M),b.options.drop.listeners=M}return $.func(y.ondrop)&&b.on("drop",y.ondrop),$.func(y.ondropactivate)&&b.on("dropactivate",y.ondropactivate),$.func(y.ondropdeactivate)&&b.on("dropdeactivate",y.ondropdeactivate),$.func(y.ondragenter)&&b.on("dragenter",y.ondragenter),$.func(y.ondragleave)&&b.on("dragleave",y.ondragleave),$.func(y.ondropmove)&&b.on("dropmove",y.ondropmove),/^(pointer|center)$/.test(y.overlap)?b.options.drop.overlap=y.overlap:$.number(y.overlap)&&(b.options.drop.overlap=Math.max(Math.min(1,y.overlap),0)),"accept"in y&&(b.options.drop.accept=y.accept),"checker"in y&&(b.options.drop.checker=y.checker),b}return $.bool(y)?(b.options.drop.enabled=y,b):b.options.drop}(this,v)},m.prototype.dropCheck=function(v,b,y,w,M,_){return function(E,j,V,I,D,W,B){var G=!1;if(!(B=B||E.getRect(W)))return!!E.options.drop.checker&&E.options.drop.checker(j,V,G,E,W,I,D);var de=E.options.drop.overlap;if(de==="pointer"){var ke=Bo(I,D,"drag"),te=wu(j);te.x+=ke.x,te.y+=ke.y;var pe=te.x>B.left&&te.x<B.right,mr=te.y>B.top&&te.y<B.bottom;G=pe&&mr}var tt=I.getRect(D);if(tt&&de==="center"){var Nr=tt.left+tt.width/2,ho=tt.top+tt.height/2;G=Nr>=B.left&&Nr<=B.right&&ho>=B.top&&ho<=B.bottom}return tt&&$.number(de)&&(G=Math.max(0,Math.min(B.right,tt.right)-Math.max(B.left,tt.left))*Math.max(0,Math.min(B.bottom,tt.bottom)-Math.max(B.top,tt.top))/(tt.width*tt.height)>=de),E.options.drop.checker&&(G=E.options.drop.checker(j,V,G,E,W,I,D)),G}(this,v,b,y,w,M,_)},u.dynamicDrop=function(v){return $.bool(v)?(c.dynamicDrop=v,u):c.dynamicDrop},K(l.phaselessTypes,{dragenter:!0,dragleave:!0,dropactivate:!0,dropdeactivate:!0,dropmove:!0,drop:!0}),l.methodDict.drop="dropzone",c.dynamicDrop=!1,g.actions.drop=Au.defaults},listeners:{"interactions:before-action-start":function(c){var l=c.interaction;l.prepared.name==="drag"&&(l.dropState={cur:{dropzone:null,element:null},prev:{dropzone:null,element:null},rejected:null,events:null,activeDrops:[]})},"interactions:after-action-start":function(c,l){var u=c.interaction,m=(c.event,c.iEvent);if(u.prepared.name==="drag"){var g=u.dropState;g.activeDrops=[],g.events={},g.activeDrops=Nl(l,u.element),g.events=Ll(u,0,m),g.events.activate&&(Su(g.activeDrops,g.events.activate),l.fire("actions/drop:start",{interaction:u,dragEvent:m}))}},"interactions:action-move":Tu,"interactions:after-action-move":function(c,l){var u=c.interaction,m=c.iEvent;if(u.prepared.name==="drag"){var g=u.dropState;Bl(u,g.events),l.fire("actions/drop:move",{interaction:u,dragEvent:m}),g.events={}}},"interactions:action-end":function(c,l){if(c.interaction.prepared.name==="drag"){var u=c.interaction,m=c.iEvent;Tu(c,l),Bl(u,u.dropState.events),l.fire("actions/drop:end",{interaction:u,dragEvent:m})}},"interactions:stop":function(c){var l=c.interaction;if(l.prepared.name==="drag"){var u=l.dropState;u&&(u.activeDrops=null,u.events=null,u.cur.dropzone=null,u.cur.element=null,u.prev.dropzone=null,u.prev.element=null,u.rejected=!1)}}},getActiveDrops:Nl,getDrop:$u,getDropEvents:Ll,fireDropEvents:Bl,filterEventType:function(c){return c.search("drag")===0||c.search("drop")===0},defaults:{enabled:!1,accept:null,overlap:"pointer"}},O0=Au;function ql(c){var l=c.interaction,u=c.iEvent,m=c.phase;if(l.prepared.name==="gesture"){var g=l.pointers.map(function(M){return M.pointer}),v=m==="start",b=m==="end",y=l.interactable.options.deltaSource;if(u.touches=[g[0],g[1]],v)u.distance=Dl(g,y),u.box=Vl(g),u.scale=1,u.ds=0,u.angle=Fl(g,y),u.da=0,l.gesture.startDistance=u.distance,l.gesture.startAngle=u.angle;else if(b||l.pointers.length<2){var w=l.prevEvent;u.distance=w.distance,u.box=w.box,u.scale=w.scale,u.ds=0,u.angle=w.angle,u.da=0}else u.distance=Dl(g,y),u.box=Vl(g),u.scale=u.distance/l.gesture.startDistance,u.angle=Fl(g,y),u.ds=u.scale-l.gesture.scale,u.da=u.angle-l.gesture.angle;l.gesture.distance=u.distance,l.gesture.angle=u.angle,$.number(u.scale)&&u.scale!==1/0&&!isNaN(u.scale)&&(l.gesture.scale=u.scale)}}var Kl={id:"actions/gesture",before:["actions/drag","actions/resize"],install:function(c){var l=c.actions,u=c.Interactable,m=c.defaults;u.prototype.gesturable=function(g){return $.object(g)?(this.options.gesture.enabled=g.enabled!==!1,this.setPerAction("gesture",g),this.setOnEvents("gesture",g),this):$.bool(g)?(this.options.gesture.enabled=g,this):this.options.gesture},l.map.gesture=Kl,l.methodDict.gesture="gesturable",m.actions.gesture=Kl.defaults},listeners:{"interactions:action-start":ql,"interactions:action-move":ql,"interactions:action-end":ql,"interactions:new":function(c){c.interaction.gesture={angle:0,distance:0,scale:1,startAngle:0,startDistance:0}},"auto-start:check":function(c){if(!(c.interaction.pointers.length<2)){var l=c.interactable.options.gesture;if(l&&l.enabled)return c.action={name:"gesture"},!1}}},defaults:{},getCursor:function(){return""},filterEventType:function(c){return c.search("gesture")===0}},H0=Kl;function R0(c,l,u,m,g,v,b){if(!l)return!1;if(l===!0){var y=$.number(v.width)?v.width:v.right-v.left,w=$.number(v.height)?v.height:v.bottom-v.top;if(b=Math.min(b,Math.abs((c==="left"||c==="right"?y:w)/2)),y<0&&(c==="left"?c="right":c==="right"&&(c="left")),w<0&&(c==="top"?c="bottom":c==="bottom"&&(c="top")),c==="left"){var M=y>=0?v.left:v.right;return u.x<M+b}if(c==="top"){var _=w>=0?v.top:v.bottom;return u.y<_+b}if(c==="right")return u.x>(y>=0?v.right:v.left)-b;if(c==="bottom")return u.y>(w>=0?v.bottom:v.top)-b}return!!$.element(m)&&($.element(l)?l===m:he(m,l,g))}function Pu(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="resize"&&u.resizeAxes){var m=l;u.interactable.options.resize.square?(u.resizeAxes==="y"?m.delta.x=m.delta.y:m.delta.y=m.delta.x,m.axes="xy"):(m.axes=u.resizeAxes,u.resizeAxes==="x"?m.delta.y=0:u.resizeAxes==="y"&&(m.delta.x=0))}}var qo,Pi,Ko={id:"actions/resize",before:["actions/drag"],install:function(c){var l=c.actions,u=c.browser,m=c.Interactable,g=c.defaults;Ko.cursors=function(v){return v.isIe9?{x:"e-resize",y:"s-resize",xy:"se-resize",top:"n-resize",left:"w-resize",bottom:"s-resize",right:"e-resize",topleft:"se-resize",bottomright:"se-resize",topright:"ne-resize",bottomleft:"ne-resize"}:{x:"ew-resize",y:"ns-resize",xy:"nwse-resize",top:"ns-resize",left:"ew-resize",bottom:"ns-resize",right:"ew-resize",topleft:"nwse-resize",bottomright:"nwse-resize",topright:"nesw-resize",bottomleft:"nesw-resize"}}(u),Ko.defaultMargin=u.supportsTouch||u.supportsPointerEvent?20:10,m.prototype.resizable=function(v){return function(b,y,w){return $.object(y)?(b.options.resize.enabled=y.enabled!==!1,b.setPerAction("resize",y),b.setOnEvents("resize",y),$.string(y.axis)&&/^x$|^y$|^xy$/.test(y.axis)?b.options.resize.axis=y.axis:y.axis===null&&(b.options.resize.axis=w.defaults.actions.resize.axis),$.bool(y.preserveAspectRatio)?b.options.resize.preserveAspectRatio=y.preserveAspectRatio:$.bool(y.square)&&(b.options.resize.square=y.square),b):$.bool(y)?(b.options.resize.enabled=y,b):b.options.resize}(this,v,c)},l.map.resize=Ko,l.methodDict.resize="resizable",g.actions.resize=Ko.defaults},listeners:{"interactions:new":function(c){c.interaction.resizeAxes="xy"},"interactions:action-start":function(c){(function(l){var u=l.iEvent,m=l.interaction;if(m.prepared.name==="resize"&&m.prepared.edges){var g=u,v=m.rect;m._rects={start:K({},v),corrected:K({},v),previous:K({},v),delta:{left:0,right:0,width:0,top:0,bottom:0,height:0}},g.edges=m.prepared.edges,g.rect=m._rects.corrected,g.deltaRect=m._rects.delta}})(c),Pu(c)},"interactions:action-move":function(c){(function(l){var u=l.iEvent,m=l.interaction;if(m.prepared.name==="resize"&&m.prepared.edges){var g=u,v=m.interactable.options.resize.invert,b=v==="reposition"||v==="negate",y=m.rect,w=m._rects,M=w.start,_=w.corrected,E=w.delta,j=w.previous;if(K(j,_),b){if(K(_,y),v==="reposition"){if(_.top>_.bottom){var V=_.top;_.top=_.bottom,_.bottom=V}if(_.left>_.right){var I=_.left;_.left=_.right,_.right=I}}}else _.top=Math.min(y.top,M.bottom),_.bottom=Math.max(y.bottom,M.top),_.left=Math.min(y.left,M.right),_.right=Math.max(y.right,M.left);for(var D in _.width=_.right-_.left,_.height=_.bottom-_.top,_)E[D]=_[D]-j[D];g.edges=m.prepared.edges,g.rect=_,g.deltaRect=E}})(c),Pu(c)},"interactions:action-end":function(c){var l=c.iEvent,u=c.interaction;if(u.prepared.name==="resize"&&u.prepared.edges){var m=l;m.edges=u.prepared.edges,m.rect=u._rects.corrected,m.deltaRect=u._rects.delta}},"auto-start:check":function(c){var l=c.interaction,u=c.interactable,m=c.element,g=c.rect,v=c.buttons;if(g){var b=K({},l.coords.cur.page),y=u.options.resize;if(y&&y.enabled&&(!l.pointerIsDown||!/mouse|pointer/.test(l.pointerType)||v&y.mouseButtons)){if($.object(y.edges)){var w={left:!1,right:!1,top:!1,bottom:!1};for(var M in w)w[M]=R0(M,y.edges[M],b,l._latestPointer.eventTarget,m,g,y.margin||Ko.defaultMargin);w.left=w.left&&!w.right,w.top=w.top&&!w.bottom,(w.left||w.right||w.top||w.bottom)&&(c.action={name:"resize",edges:w})}else{var _=y.axis!=="y"&&b.x>g.right-Ko.defaultMargin,E=y.axis!=="x"&&b.y>g.bottom-Ko.defaultMargin;(_||E)&&(c.action={name:"resize",axes:(_?"x":"")+(E?"y":"")})}return!c.action&&void 0}}}},defaults:{square:!1,preserveAspectRatio:!1,axis:"xy",margin:NaN,edges:null,invert:"none"},cursors:null,getCursor:function(c){var l=c.edges,u=c.axis,m=c.name,g=Ko.cursors,v=null;if(u)v=g[m+u];else if(l){for(var b="",y=0,w=["top","bottom","left","right"];y<w.length;y++){var M=w[y];l[M]&&(b+=M)}v=g[b]}return v},filterEventType:function(c){return c.search("resize")===0},defaultMargin:null},I0=Ko,V0={id:"actions",install:function(c){c.usePlugin(H0),c.usePlugin(I0),c.usePlugin(et),c.usePlugin(O0)}},ju=0,ci={request:function(c){return qo(c)},cancel:function(c){return Pi(c)},init:function(c){if(qo=c.requestAnimationFrame,Pi=c.cancelAnimationFrame,!qo)for(var l=["ms","moz","webkit","o"],u=0;u<l.length;u++){var m=l[u];qo=c["".concat(m,"RequestAnimationFrame")],Pi=c["".concat(m,"CancelAnimationFrame")]||c["".concat(m,"CancelRequestAnimationFrame")]}qo=qo&&qo.bind(c),Pi=Pi&&Pi.bind(c),qo||(qo=function(g){var v=Date.now(),b=Math.max(0,16-(v-ju)),y=c.setTimeout(function(){g(v+b)},b);return ju=v+b,y},Pi=function(g){return clearTimeout(g)})}},re={defaults:{enabled:!1,margin:60,container:null,speed:300},now:Date.now,interaction:null,i:0,x:0,y:0,isScrolling:!1,prevTime:0,margin:0,speed:0,start:function(c){re.isScrolling=!0,ci.cancel(re.i),c.autoScroll=re,re.interaction=c,re.prevTime=re.now(),re.i=ci.request(re.scroll)},stop:function(){re.isScrolling=!1,re.interaction&&(re.interaction.autoScroll=null),ci.cancel(re.i)},scroll:function(){var c=re.interaction,l=c.interactable,u=c.element,m=c.prepared.name,g=l.options[m].autoScroll,v=Ou(g.container,l,u),b=re.now(),y=(b-re.prevTime)/1e3,w=g.speed*y;if(w>=1){var M={x:re.x*w,y:re.y*w};if(M.x||M.y){var _=Hu(v);$.window(v)?v.scrollBy(M.x,M.y):v&&(v.scrollLeft+=M.x,v.scrollTop+=M.y);var E=Hu(v),j={x:E.x-_.x,y:E.y-_.y};(j.x||j.y)&&l.fire({type:"autoscroll",target:u,interactable:l,delta:j,interaction:c,container:v})}re.prevTime=b}re.isScrolling&&(ci.cancel(re.i),re.i=ci.request(re.scroll))},check:function(c,l){var u;return(u=c.options[l].autoScroll)==null?void 0:u.enabled},onInteractionMove:function(c){var l=c.interaction,u=c.pointer;if(l.interacting()&&re.check(l.interactable,l.prepared.name))if(l.simulation)re.x=re.y=0;else{var m,g,v,b,y=l.interactable,w=l.element,M=l.prepared.name,_=y.options[M].autoScroll,E=Ou(_.container,y,w);if($.window(E))b=u.clientX<re.margin,m=u.clientY<re.margin,g=u.clientX>E.innerWidth-re.margin,v=u.clientY>E.innerHeight-re.margin;else{var j=X(E);b=u.clientX<j.left+re.margin,m=u.clientY<j.top+re.margin,g=u.clientX>j.right-re.margin,v=u.clientY>j.bottom-re.margin}re.x=g?1:b?-1:0,re.y=v?1:m?-1:0,re.isScrolling||(re.margin=_.margin,re.speed=_.speed,re.start(l))}}};function Ou(c,l,u){return($.string(c)?si(c,l,u):c)||H(u)}function Hu(c){return $.window(c)&&(c=window.document.body),{x:c.scrollLeft,y:c.scrollTop}}var D0={id:"auto-scroll",install:function(c){var l=c.defaults,u=c.actions;c.autoScroll=re,re.now=function(){return c.now()},u.phaselessTypes.autoscroll=!0,l.perAction.autoScroll=re.defaults},listeners:{"interactions:new":function(c){c.interaction.autoScroll=null},"interactions:destroy":function(c){c.interaction.autoScroll=null,re.stop(),re.interaction&&(re.interaction=null)},"interactions:stop":re.stop,"interactions:action-move":function(c){return re.onInteractionMove(c)}}},F0=D0;function ia(c,l){var u=!1;return function(){return u||(T.console.warn(l),u=!0),c.apply(this,arguments)}}function Wl(c,l){return c.name=l.name,c.axis=l.axis,c.edges=l.edges,c}function N0(c){return $.bool(c)?(this.options.styleCursor=c,this):c===null?(delete this.options.styleCursor,this):this.options.styleCursor}function L0(c){return $.func(c)?(this.options.actionChecker=c,this):c===null?(delete this.options.actionChecker,this):this.options.actionChecker}var B0={id:"auto-start/interactableMethods",install:function(c){var l=c.Interactable;l.prototype.getAction=function(u,m,g,v){var b=function(y,w,M,_,E){var j=y.getRect(_),V=w.buttons||{0:1,1:4,3:8,4:16}[w.button],I={action:null,interactable:y,interaction:M,element:_,rect:j,buttons:V};return E.fire("auto-start:check",I),I.action}(this,m,g,v,c);return this.options.actionChecker?this.options.actionChecker(u,m,b,this,v,g):b},l.prototype.ignoreFrom=ia(function(u){return this._backCompatOption("ignoreFrom",u)},"Interactable.ignoreFrom() has been deprecated. Use Interactble.draggable({ignoreFrom: newValue})."),l.prototype.allowFrom=ia(function(u){return this._backCompatOption("allowFrom",u)},"Interactable.allowFrom() has been deprecated. Use Interactble.draggable({allowFrom: newValue})."),l.prototype.actionChecker=L0,l.prototype.styleCursor=N0}};function Ru(c,l,u,m,g){return l.testIgnoreAllow(l.options[c.name],u,m)&&l.options[c.name].enabled&&ss(l,u,c,g)?c:null}function q0(c,l,u,m,g,v,b){for(var y=0,w=m.length;y<w;y++){var M=m[y],_=g[y],E=M.getAction(l,u,c,_);if(E){var j=Ru(E,M,_,v,b);if(j)return{action:j,interactable:M,element:_}}}return{action:null,interactable:null,element:null}}function Iu(c,l,u,m,g){var v=[],b=[],y=m;function w(_){v.push(_),b.push(y)}for(;$.element(y);){v=[],b=[],g.interactables.forEachMatch(y,w);var M=q0(c,l,u,v,b,m,g);if(M.action&&!M.interactable.options[M.action.name].manualStart)return M;y=Xr(y)}return{action:null,interactable:null,element:null}}function Vu(c,l,u){var m=l.action,g=l.interactable,v=l.element;m=m||{name:null},c.interactable=g,c.element=v,Wl(c.prepared,m),c.rect=g&&m.name?g.getRect(v):null,Fu(c,u),u.fire("autoStart:prepared",{interaction:c})}function ss(c,l,u,m){var g=c.options,v=g[u.name].max,b=g[u.name].maxPerElement,y=m.autoStart.maxInteractions,w=0,M=0,_=0;if(!(v&&b&&y))return!1;for(var E=0,j=m.interactions.list;E<j.length;E++){var V=j[E],I=V.prepared.name;if(V.interacting()&&(++w>=y||V.interactable===c&&((M+=I===u.name?1:0)>=v||V.element===l&&(_++,I===u.name&&_>=b))))return!1}return y>0}function Du(c,l){return $.number(c)?(l.autoStart.maxInteractions=c,this):l.autoStart.maxInteractions}function Ul(c,l,u){var m=u.autoStart.cursorElement;m&&m!==c&&(m.style.cursor=""),c.ownerDocument.documentElement.style.cursor=l,c.style.cursor=l,u.autoStart.cursorElement=l?c:null}function Fu(c,l){var u=c.interactable,m=c.element,g=c.prepared;if(c.pointerType==="mouse"&&u&&u.options.styleCursor){var v="";if(g.name){var b=u.options[g.name].cursorChecker;v=$.func(b)?b(g,u,m,c._interacting):l.actions.map[g.name].getCursor(g)}Ul(c.element,v||"",l)}else l.autoStart.cursorElement&&Ul(l.autoStart.cursorElement,"",l)}var K0={id:"auto-start/base",before:["actions"],install:function(c){var l=c.interactStatic,u=c.defaults;c.usePlugin(B0),u.base.actionChecker=null,u.base.styleCursor=!0,K(u.perAction,{manualStart:!1,max:1/0,maxPerElement:1,allowFrom:null,ignoreFrom:null,mouseButtons:1}),l.maxInteractions=function(m){return Du(m,c)},c.autoStart={maxInteractions:1/0,withinInteractionLimit:ss,cursorElement:null}},listeners:{"interactions:down":function(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget;u.interacting()||Vu(u,Iu(u,m,g,v,l),l)},"interactions:move":function(c,l){(function(u,m){var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget;g.pointerType!=="mouse"||g.pointerIsDown||g.interacting()||Vu(g,Iu(g,v,b,y,m),m)})(c,l),function(u,m){var g=u.interaction;if(g.pointerIsDown&&!g.interacting()&&g.pointerWasMoved&&g.prepared.name){m.fire("autoStart:before-start",u);var v=g.interactable,b=g.prepared.name;b&&v&&(v.options[b].manualStart||!ss(v,g.element,g.prepared,m)?g.stop():(g.start(g.prepared,v,g.element),Fu(g,m)))}}(c,l)},"interactions:stop":function(c,l){var u=c.interaction,m=u.interactable;m&&m.options.styleCursor&&Ul(u.element,"",l)}},maxInteractions:Du,withinInteractionLimit:ss,validateAction:Ru},Gl=K0,W0={id:"auto-start/dragAxis",listeners:{"autoStart:before-start":function(c,l){var u=c.interaction,m=c.eventTarget,g=c.dx,v=c.dy;if(u.prepared.name==="drag"){var b=Math.abs(g),y=Math.abs(v),w=u.interactable.options.drag,M=w.startAxis,_=b>y?"x":b<y?"y":"xy";if(u.prepared.axis=w.lockAxis==="start"?_[0]:w.lockAxis,_!=="xy"&&M!=="xy"&&M!==_){u.prepared.name=null;for(var E=m,j=function(I){if(I!==u.interactable){var D=u.interactable.options.drag;if(!D.manualStart&&I.testIgnoreAllow(D,E,m)){var W=I.getAction(u.downPointer,u.downEvent,u,E);if(W&&W.name==="drag"&&function(B,G){if(!G)return!1;var de=G.options.drag.startAxis;return B==="xy"||de==="xy"||de===B}(_,I)&&Gl.validateAction(W,I,E,m,l))return I}}};$.element(E);){var V=l.interactables.forEachMatch(E,j);if(V){u.prepared.name="drag",u.interactable=V,u.element=E;break}E=Xr(E)}}}}}};function Yl(c){var l=c.prepared&&c.prepared.name;if(!l)return null;var u=c.interactable.options;return u[l].hold||u[l].delay}var U0={id:"auto-start/hold",install:function(c){var l=c.defaults;c.usePlugin(Gl),l.perAction.hold=0,l.perAction.delay=0},listeners:{"interactions:new":function(c){c.interaction.autoStartHoldTimer=null},"autoStart:prepared":function(c){var l=c.interaction,u=Yl(l);u>0&&(l.autoStartHoldTimer=setTimeout(function(){l.start(l.prepared,l.interactable,l.element)},u))},"interactions:move":function(c){var l=c.interaction,u=c.duplicate;l.autoStartHoldTimer&&l.pointerWasMoved&&!u&&(clearTimeout(l.autoStartHoldTimer),l.autoStartHoldTimer=null)},"autoStart:before-start":function(c){var l=c.interaction;Yl(l)>0&&(l.prepared.name=null)}},getHoldDuration:Yl},G0=U0,Y0={id:"auto-start",install:function(c){c.usePlugin(Gl),c.usePlugin(G0),c.usePlugin(W0)}},X0=function(c){return/^(always|never|auto)$/.test(c)?(this.options.preventDefault=c,this):$.bool(c)?(this.options.preventDefault=c?"always":"never",this):this.options.preventDefault};function Z0(c){var l=c.interaction,u=c.event;l.interactable&&l.interactable.checkAndPreventDefault(u)}var Nu={id:"core/interactablePreventDefault",install:function(c){var l=c.Interactable;l.prototype.preventDefault=X0,l.prototype.checkAndPreventDefault=function(u){return function(m,g,v){var b=m.options.preventDefault;if(b!=="never")if(b!=="always"){if(g.events.supportsPassive&&/^touch(start|move)$/.test(v.type)){var y=H(v.target).document,w=g.getDocOptions(y);if(!w||!w.events||w.events.passive!==!1)return}/^(mouse|pointer|touch)*(down|start)/i.test(v.type)||$.element(v.target)&&Po(v.target,"input,select,textarea,[contenteditable=true],[contenteditable=true] *")||v.preventDefault()}else v.preventDefault()}(this,c,u)},c.interactions.docEvents.push({type:"dragstart",listener:function(u){for(var m=0,g=c.interactions.list;m<g.length;m++){var v=g[m];if(v.element&&(v.element===u.target||so(v.element,u.target)))return void v.interactable.checkAndPreventDefault(u)}}})},listeners:["down","move","up","cancel"].reduce(function(c,l){return c["interactions:".concat(l)]=Z0,c},{})};function ls(c,l){if(l.phaselessTypes[c])return!0;for(var u in l.map)if(c.indexOf(u)===0&&c.substr(u.length)in l.phases)return!0;return!1}function dn(c){var l={};for(var u in c){var m=c[u];$.plainObject(m)?l[u]=dn(m):$.array(m)?l[u]=Eu(m):l[u]=m}return l}var Xl=function(){function c(l){t(this,c),this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=l,this.result=cs(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}return n(c,[{key:"start",value:function(l,u){var m,g,v=l.phase,b=this.interaction,y=function(M){var _=M.interactable.options[M.prepared.name],E=_.modifiers;return E&&E.length?E:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map(function(j){var V=_[j];return V&&V.enabled&&{options:V,methods:V._methods}}).filter(function(j){return!!j})}(b);this.prepareStates(y),this.startEdges=K({},b.edges),this.edges=K({},this.startEdges),this.startOffset=(m=b.rect,g=u,m?{left:g.x-m.left,top:g.y-m.top,right:m.right-g.x,bottom:m.bottom-g.y}:{left:0,top:0,right:0,bottom:0}),this.startDelta={x:0,y:0};var w=this.fillArg({phase:v,pageCoords:u,preEnd:!1});return this.result=cs(),this.startAll(w),this.result=this.setAll(w)}},{key:"fillArg",value:function(l){var u=this.interaction;return l.interaction=u,l.interactable=u.interactable,l.element=u.element,l.rect||(l.rect=u.rect),l.edges||(l.edges=this.startEdges),l.startOffset=this.startOffset,l}},{key:"startAll",value:function(l){for(var u=0,m=this.states;u<m.length;u++){var g=m[u];g.methods.start&&(l.state=g,g.methods.start(l))}}},{key:"setAll",value:function(l){var u=l.phase,m=l.preEnd,g=l.skipModifiers,v=l.rect,b=l.edges;l.coords=K({},l.pageCoords),l.rect=K({},v),l.edges=K({},b);for(var y=g?this.states.slice(g):this.states,w=cs(l.coords,l.rect),M=0;M<y.length;M++){var _,E=y[M],j=E.options,V=K({},l.coords),I=null;(_=E.methods)!=null&&_.set&&this.shouldDo(j,m,u)&&(l.state=E,I=E.methods.set(l),li(l.edges,l.rect,{x:l.coords.x-V.x,y:l.coords.y-V.y})),w.eventProps.push(I)}K(this.edges,l.edges),w.delta.x=l.coords.x-l.pageCoords.x,w.delta.y=l.coords.y-l.pageCoords.y,w.rectDelta.left=l.rect.left-v.left,w.rectDelta.right=l.rect.right-v.right,w.rectDelta.top=l.rect.top-v.top,w.rectDelta.bottom=l.rect.bottom-v.bottom;var D=this.result.coords,W=this.result.rect;if(D&&W){var B=w.rect.left!==W.left||w.rect.right!==W.right||w.rect.top!==W.top||w.rect.bottom!==W.bottom;w.changed=B||D.x!==w.coords.x||D.y!==w.coords.y}return w}},{key:"applyToInteraction",value:function(l){var u=this.interaction,m=l.phase,g=u.coords.cur,v=u.coords.start,b=this.result,y=this.startDelta,w=b.delta;m==="start"&&K(this.startDelta,b.delta);for(var M=0,_=[[v,y],[g,w]];M<_.length;M++){var E=_[M],j=E[0],V=E[1];j.page.x+=V.x,j.page.y+=V.y,j.client.x+=V.x,j.client.y+=V.y}var I=this.result.rectDelta,D=l.rect||u.rect;D.left+=I.left,D.right+=I.right,D.top+=I.top,D.bottom+=I.bottom,D.width=D.right-D.left,D.height=D.bottom-D.top}},{key:"setAndApply",value:function(l){var u=this.interaction,m=l.phase,g=l.preEnd,v=l.skipModifiers,b=this.setAll(this.fillArg({preEnd:g,phase:m,pageCoords:l.modifiedCoords||u.coords.cur.page}));if(this.result=b,!b.changed&&(!v||v<this.states.length)&&u.interacting())return!1;if(l.modifiedCoords){var y=u.coords.cur.page,w={x:l.modifiedCoords.x-y.x,y:l.modifiedCoords.y-y.y};b.coords.x+=w.x,b.coords.y+=w.y,b.delta.x+=w.x,b.delta.y+=w.y}this.applyToInteraction(l)}},{key:"beforeEnd",value:function(l){var u=l.interaction,m=l.event,g=this.states;if(g&&g.length){for(var v=!1,b=0;b<g.length;b++){var y=g[b];l.state=y;var w=y.options,M=y.methods,_=M.beforeEnd&&M.beforeEnd(l);if(_)return this.endResult=_,!1;v=v||!v&&this.shouldDo(w,!0,l.phase,!0)}v&&u.move({event:m,preEnd:!0})}}},{key:"stop",value:function(l){var u=l.interaction;if(this.states&&this.states.length){var m=K({states:this.states,interactable:u.interactable,element:u.element,rect:null},l);this.fillArg(m);for(var g=0,v=this.states;g<v.length;g++){var b=v[g];m.state=b,b.methods.stop&&b.methods.stop(m)}this.states=null,this.endResult=null}}},{key:"prepareStates",value:function(l){this.states=[];for(var u=0;u<l.length;u++){var m=l[u],g=m.options,v=m.methods,b=m.name;this.states.push({options:g,methods:v,index:u,name:b})}return this.states}},{key:"restoreInteractionCoords",value:function(l){var u=l.interaction,m=u.coords,g=u.rect,v=u.modification;if(v.result){for(var b=v.startDelta,y=v.result,w=y.delta,M=y.rectDelta,_=0,E=[[m.start,b],[m.cur,w]];_<E.length;_++){var j=E[_],V=j[0],I=j[1];V.page.x-=I.x,V.page.y-=I.y,V.client.x-=I.x,V.client.y-=I.y}g.left-=M.left,g.right-=M.right,g.top-=M.top,g.bottom-=M.bottom}}},{key:"shouldDo",value:function(l,u,m,g){return!(!l||l.enabled===!1||g&&!l.endOnly||l.endOnly&&!u||m==="start"&&!l.setStart)}},{key:"copyFrom",value:function(l){this.startOffset=l.startOffset,this.startDelta=l.startDelta,this.startEdges=l.startEdges,this.edges=l.edges,this.states=l.states.map(function(u){return dn(u)}),this.result=cs(K({},l.result.coords),K({},l.result.rect))}},{key:"destroy",value:function(){for(var l in this)this[l]=null}}]),c}();function cs(c,l){return{rect:l,coords:c,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function di(c,l){var u=c.defaults,m={start:c.start,set:c.set,beforeEnd:c.beforeEnd,stop:c.stop},g=function(v){var b=v||{};for(var y in b.enabled=b.enabled!==!1,u)y in b||(b[y]=u[y]);var w={options:b,methods:m,name:l,enable:function(){return b.enabled=!0,w},disable:function(){return b.enabled=!1,w}};return w};return l&&typeof l=="string"&&(g._defaults=u,g._methods=m),g}function na(c){var l=c.iEvent,u=c.interaction.modification.result;u&&(l.modifiers=u.eventProps)}var Q0={id:"modifiers/base",before:["actions"],install:function(c){c.defaults.perAction.modifiers=[]},listeners:{"interactions:new":function(c){var l=c.interaction;l.modification=new Xl(l)},"interactions:before-action-start":function(c){var l=c.interaction,u=c.interaction.modification;u.start(c,l.coords.start.page),l.edges=u.edges,u.applyToInteraction(c)},"interactions:before-action-move":function(c){var l=c.interaction,u=l.modification,m=u.setAndApply(c);return l.edges=u.edges,m},"interactions:before-action-end":function(c){var l=c.interaction,u=l.modification,m=u.beforeEnd(c);return l.edges=u.startEdges,m},"interactions:action-start":na,"interactions:action-move":na,"interactions:action-end":na,"interactions:after-action-start":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-move":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:stop":function(c){return c.interaction.modification.stop(c)}}},Lu=Q0,Bu={base:{preventDefault:"auto",deltaSource:"page"},perAction:{enabled:!1,origin:{x:0,y:0}},actions:{}},Zl=function(c){d(u,c);var l=x(u);function u(m,g,v,b,y,w,M){var _;t(this,u),(_=l.call(this,m)).relatedTarget=null,_.screenX=void 0,_.screenY=void 0,_.button=void 0,_.buttons=void 0,_.ctrlKey=void 0,_.shiftKey=void 0,_.altKey=void 0,_.metaKey=void 0,_.page=void 0,_.client=void 0,_.delta=void 0,_.rect=void 0,_.x0=void 0,_.y0=void 0,_.t0=void 0,_.dt=void 0,_.duration=void 0,_.clientX0=void 0,_.clientY0=void 0,_.velocity=void 0,_.speed=void 0,_.swipe=void 0,_.axes=void 0,_.preEnd=void 0,y=y||m.element;var E=m.interactable,j=(E&&E.options||Bu).deltaSource,V=Bo(E,y,v),I=b==="start",D=b==="end",W=I?f(_):m.prevEvent,B=I?m.coords.start:D?{page:W.page,client:W.client,timeStamp:m.coords.cur.timeStamp}:m.coords.cur;return _.page=K({},B.page),_.client=K({},B.client),_.rect=K({},m.rect),_.timeStamp=B.timeStamp,D||(_.page.x-=V.x,_.page.y-=V.y,_.client.x-=V.x,_.client.y-=V.y),_.ctrlKey=g.ctrlKey,_.altKey=g.altKey,_.shiftKey=g.shiftKey,_.metaKey=g.metaKey,_.button=g.button,_.buttons=g.buttons,_.target=y,_.currentTarget=y,_.preEnd=w,_.type=M||v+(b||""),_.interactable=E,_.t0=I?m.pointers[m.pointers.length-1].downTime:W.t0,_.x0=m.coords.start.page.x-V.x,_.y0=m.coords.start.page.y-V.y,_.clientX0=m.coords.start.client.x-V.x,_.clientY0=m.coords.start.client.y-V.y,_.delta=I||D?{x:0,y:0}:{x:_[j].x-W[j].x,y:_[j].y-W[j].y},_.dt=m.coords.delta.timeStamp,_.duration=_.timeStamp-_.t0,_.velocity=K({},m.coords.velocity[j]),_.speed=ea(_.velocity.x,_.velocity.y),_.swipe=D||b==="inertiastart"?_.getSwipe():null,_}return n(u,[{key:"getSwipe",value:function(){var m=this._interaction;if(m.prevEvent.speed<600||this.timeStamp-m.prevEvent.timeStamp>150)return null;var g=180*Math.atan2(m.prevEvent.velocityY,m.prevEvent.velocityX)/Math.PI;g<0&&(g+=360);var v=112.5<=g&&g<247.5,b=202.5<=g&&g<337.5;return{up:b,down:!b&&22.5<=g&&g<157.5,left:v,right:!v&&(292.5<=g||g<67.5),angle:g,speed:m.prevEvent.speed,velocity:{x:m.prevEvent.velocityX,y:m.prevEvent.velocityY}}}},{key:"preventDefault",value:function(){}},{key:"stopImmediatePropagation",value:function(){this.immediatePropagationStopped=this.propagationStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}}]),u}(as);Object.defineProperties(Zl.prototype,{pageX:{get:function(){return this.page.x},set:function(c){this.page.x=c}},pageY:{get:function(){return this.page.y},set:function(c){this.page.y=c}},clientX:{get:function(){return this.client.x},set:function(c){this.client.x=c}},clientY:{get:function(){return this.client.y},set:function(c){this.client.y=c}},dx:{get:function(){return this.delta.x},set:function(c){this.delta.x=c}},dy:{get:function(){return this.delta.y},set:function(c){this.delta.y=c}},velocityX:{get:function(){return this.velocity.x},set:function(c){this.velocity.x=c}},velocityY:{get:function(){return this.velocity.y},set:function(c){this.velocity.y=c}}});var J0=n(function c(l,u,m,g,v){t(this,c),this.id=void 0,this.pointer=void 0,this.event=void 0,this.downTime=void 0,this.downTarget=void 0,this.id=l,this.pointer=u,this.event=m,this.downTime=g,this.downTarget=v}),e2=function(c){return c.interactable="",c.element="",c.prepared="",c.pointerIsDown="",c.pointerWasMoved="",c._proxy="",c}({}),qu=function(c){return c.start="",c.move="",c.end="",c.stop="",c.interacting="",c}({}),t2=0,r2=function(){function c(l){var u=this,m=l.pointerType,g=l.scopeFire;t(this,c),this.interactable=null,this.element=null,this.rect=null,this._rects=void 0,this.edges=null,this._scopeFire=void 0,this.prepared={name:null,axis:null,edges:null},this.pointerType=void 0,this.pointers=[],this.downEvent=null,this.downPointer={},this._latestPointer={pointer:null,event:null,eventTarget:null},this.prevEvent=null,this.pointerIsDown=!1,this.pointerWasMoved=!1,this._interacting=!1,this._ending=!1,this._stopped=!0,this._proxy=void 0,this.simulation=null,this.doMove=ia(function(_){this.move(_)},"The interaction.doMove() method has been renamed to interaction.move()"),this.coords={start:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},prev:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},cur:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},delta:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0},velocity:{page:{x:0,y:0},client:{x:0,y:0},timeStamp:0}},this._id=t2++,this._scopeFire=g,this.pointerType=m;var v=this;this._proxy={};var b=function(_){Object.defineProperty(u._proxy,_,{get:function(){return v[_]}})};for(var y in e2)b(y);var w=function(_){Object.defineProperty(u._proxy,_,{value:function(){return v[_].apply(v,arguments)}})};for(var M in qu)w(M);this._scopeFire("interactions:new",{interaction:this})}return n(c,[{key:"pointerMoveTolerance",get:function(){return 1}},{key:"pointerDown",value:function(l,u,m){var g=this.updatePointer(l,u,m,!0),v=this.pointers[g];this._scopeFire("interactions:down",{pointer:l,event:u,eventTarget:m,pointerIndex:g,pointerInfo:v,type:"down",interaction:this})}},{key:"start",value:function(l,u,m){return!(this.interacting()||!this.pointerIsDown||this.pointers.length<(l.name==="gesture"?2:1)||!u.options[l.name].enabled)&&(Wl(this.prepared,l),this.interactable=u,this.element=m,this.rect=u.getRect(m),this.edges=this.prepared.edges?K({},this.prepared.edges):{left:!0,right:!0,top:!0,bottom:!0},this._stopped=!1,this._interacting=this._doPhase({interaction:this,event:this.downEvent,phase:"start"})&&!this._stopped,this._interacting)}},{key:"pointerMove",value:function(l,u,m){this.simulation||this.modification&&this.modification.endResult||this.updatePointer(l,u,m,!1);var g,v,b=this.coords.cur.page.x===this.coords.prev.page.x&&this.coords.cur.page.y===this.coords.prev.page.y&&this.coords.cur.client.x===this.coords.prev.client.x&&this.coords.cur.client.y===this.coords.prev.client.y;this.pointerIsDown&&!this.pointerWasMoved&&(g=this.coords.cur.client.x-this.coords.start.client.x,v=this.coords.cur.client.y-this.coords.start.client.y,this.pointerWasMoved=ea(g,v)>this.pointerMoveTolerance);var y,w,M,_=this.getPointerIndex(l),E={pointer:l,pointerIndex:_,pointerInfo:this.pointers[_],event:u,type:"move",eventTarget:m,dx:g,dy:v,duplicate:b,interaction:this};b||(y=this.coords.velocity,w=this.coords.delta,M=Math.max(w.timeStamp/1e3,.001),y.page.x=w.page.x/M,y.page.y=w.page.y/M,y.client.x=w.client.x/M,y.client.y=w.client.y/M,y.timeStamp=M),this._scopeFire("interactions:move",E),b||this.simulation||(this.interacting()&&(E.type=null,this.move(E)),this.pointerWasMoved&&is(this.coords.prev,this.coords.cur))}},{key:"move",value:function(l){l&&l.event||ku(this.coords.delta),(l=K({pointer:this._latestPointer.pointer,event:this._latestPointer.event,eventTarget:this._latestPointer.eventTarget,interaction:this},l||{})).phase="move",this._doPhase(l)}},{key:"pointerUp",value:function(l,u,m,g){var v=this.getPointerIndex(l);v===-1&&(v=this.updatePointer(l,u,m,!1));var b=/cancel$/i.test(u.type)?"cancel":"up";this._scopeFire("interactions:".concat(b),{pointer:l,pointerIndex:v,pointerInfo:this.pointers[v],event:u,eventTarget:m,type:b,curEventTarget:g,interaction:this}),this.simulation||this.end(u),this.removePointer(l,u)}},{key:"documentBlur",value:function(l){this.end(l),this._scopeFire("interactions:blur",{event:l,type:"blur",interaction:this})}},{key:"end",value:function(l){var u;this._ending=!0,l=l||this._latestPointer.event,this.interacting()&&(u=this._doPhase({event:l,interaction:this,phase:"end"})),this._ending=!1,u===!0&&this.stop()}},{key:"currentAction",value:function(){return this._interacting?this.prepared.name:null}},{key:"interacting",value:function(){return this._interacting}},{key:"stop",value:function(){this._scopeFire("interactions:stop",{interaction:this}),this.interactable=this.element=null,this._interacting=!1,this._stopped=!0,this.prepared.name=this.prevEvent=null}},{key:"getPointerIndex",value:function(l){var u=ta(l);return this.pointerType==="mouse"||this.pointerType==="pen"?this.pointers.length-1:ra(this.pointers,function(m){return m.id===u})}},{key:"getPointerInfo",value:function(l){return this.pointers[this.getPointerIndex(l)]}},{key:"updatePointer",value:function(l,u,m,g){var v,b,y,w=ta(l),M=this.getPointerIndex(l),_=this.pointers[M];return g=g!==!1&&(g||/(down|start)$/i.test(u.type)),_?_.pointer=l:(_=new J0(w,l,u,null,null),M=this.pointers.length,this.pointers.push(_)),j0(this.coords.cur,this.pointers.map(function(E){return E.pointer}),this._now()),v=this.coords.delta,b=this.coords.prev,y=this.coords.cur,v.page.x=y.page.x-b.page.x,v.page.y=y.page.y-b.page.y,v.client.x=y.client.x-b.client.x,v.client.y=y.client.y-b.client.y,v.timeStamp=y.timeStamp-b.timeStamp,g&&(this.pointerIsDown=!0,_.downTime=this.coords.cur.timeStamp,_.downTarget=m,os(this.downPointer,l),this.interacting()||(is(this.coords.start,this.coords.cur),is(this.coords.prev,this.coords.cur),this.downEvent=u,this.pointerWasMoved=!1)),this._updateLatestPointer(l,u,m),this._scopeFire("interactions:update-pointer",{pointer:l,event:u,eventTarget:m,down:g,pointerInfo:_,pointerIndex:M,interaction:this}),M}},{key:"removePointer",value:function(l,u){var m=this.getPointerIndex(l);if(m!==-1){var g=this.pointers[m];this._scopeFire("interactions:remove-pointer",{pointer:l,event:u,eventTarget:null,pointerIndex:m,pointerInfo:g,interaction:this}),this.pointers.splice(m,1),this.pointerIsDown=!1}}},{key:"_updateLatestPointer",value:function(l,u,m){this._latestPointer.pointer=l,this._latestPointer.event=u,this._latestPointer.eventTarget=m}},{key:"destroy",value:function(){this._latestPointer.pointer=null,this._latestPointer.event=null,this._latestPointer.eventTarget=null}},{key:"_createPreparedEvent",value:function(l,u,m,g){return new Zl(this,l,this.prepared.name,u,this.element,m,g)}},{key:"_fireEvent",value:function(l){var u;(u=this.interactable)==null||u.fire(l),(!this.prevEvent||l.timeStamp>=this.prevEvent.timeStamp)&&(this.prevEvent=l)}},{key:"_doPhase",value:function(l){var u=l.event,m=l.phase,g=l.preEnd,v=l.type,b=this.rect;if(b&&m==="move"&&(li(this.edges,b,this.coords.delta[this.interactable.options.deltaSource]),b.width=b.right-b.left,b.height=b.bottom-b.top),this._scopeFire("interactions:before-action-".concat(m),l)===!1)return!1;var y=l.iEvent=this._createPreparedEvent(u,m,g,v);return this._scopeFire("interactions:action-".concat(m),l),m==="start"&&(this.prevEvent=y),this._fireEvent(y),this._scopeFire("interactions:after-action-".concat(m),l),!0}},{key:"_now",value:function(){return Date.now()}}]),c}();function Ku(c){Wu(c.interaction)}function Wu(c){if(!function(u){return!(!u.offset.pending.x&&!u.offset.pending.y)}(c))return!1;var l=c.offset.pending;return Ql(c.coords.cur,l),Ql(c.coords.delta,l),li(c.edges,c.rect,l),l.x=0,l.y=0,!0}function o2(c){var l=c.x,u=c.y;this.offset.pending.x+=l,this.offset.pending.y+=u,this.offset.total.x+=l,this.offset.total.y+=u}function Ql(c,l){var u=c.page,m=c.client,g=l.x,v=l.y;u.x+=g,u.y+=v,m.x+=g,m.y+=v}qu.offsetBy="";var i2={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install:function(c){c.Interaction.prototype.offsetBy=o2},listeners:{"interactions:new":function(c){c.interaction.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":function(c){return function(l){l.pointerIsDown&&(Ql(l.coords.cur,l.offset.total),l.offset.pending.x=0,l.offset.pending.y=0)}(c.interaction)},"interactions:before-action-start":Ku,"interactions:before-action-move":Ku,"interactions:before-action-end":function(c){var l=c.interaction;if(Wu(l))return l.move({offset:!0}),l.end(),!1},"interactions:stop":function(c){var l=c.interaction;l.offset.total.x=0,l.offset.total.y=0,l.offset.pending.x=0,l.offset.pending.y=0}}},Uu=i2,n2=function(){function c(l){t(this,c),this.active=!1,this.isModified=!1,this.smoothEnd=!1,this.allowResume=!1,this.modification=void 0,this.modifierCount=0,this.modifierArg=void 0,this.startCoords=void 0,this.t0=0,this.v0=0,this.te=0,this.targetOffset=void 0,this.modifiedOffset=void 0,this.currentOffset=void 0,this.lambda_v0=0,this.one_ve_v0=0,this.timeout=void 0,this.interaction=void 0,this.interaction=l}return n(c,[{key:"start",value:function(l){var u=this.interaction,m=ds(u);if(!m||!m.enabled)return!1;var g=u.coords.velocity.client,v=ea(g.x,g.y),b=this.modification||(this.modification=new Xl(u));if(b.copyFrom(u.modification),this.t0=u._now(),this.allowResume=m.allowResume,this.v0=v,this.currentOffset={x:0,y:0},this.startCoords=u.coords.cur.page,this.modifierArg=b.fillArg({pageCoords:this.startCoords,preEnd:!0,phase:"inertiastart"}),this.t0-u.coords.cur.timeStamp<50&&v>m.minSpeed&&v>m.endSpeed)this.startInertia();else{if(b.result=b.setAll(this.modifierArg),!b.result.changed)return!1;this.startSmoothEnd()}return u.modification.result.rect=null,u.offsetBy(this.targetOffset),u._doPhase({interaction:u,event:l,phase:"inertiastart"}),u.offsetBy({x:-this.targetOffset.x,y:-this.targetOffset.y}),u.modification.result.rect=null,this.active=!0,u.simulation=this,!0}},{key:"startInertia",value:function(){var l=this,u=this.interaction.coords.velocity.client,m=ds(this.interaction),g=m.resistance,v=-Math.log(m.endSpeed/this.v0)/g;this.targetOffset={x:(u.x-v)/g,y:(u.y-v)/g},this.te=v,this.lambda_v0=g/this.v0,this.one_ve_v0=1-m.endSpeed/this.v0;var b=this.modification,y=this.modifierArg;y.pageCoords={x:this.startCoords.x+this.targetOffset.x,y:this.startCoords.y+this.targetOffset.y},b.result=b.setAll(y),b.result.changed&&(this.isModified=!0,this.modifiedOffset={x:this.targetOffset.x+b.result.delta.x,y:this.targetOffset.y+b.result.delta.y}),this.onNextFrame(function(){return l.inertiaTick()})}},{key:"startSmoothEnd",value:function(){var l=this;this.smoothEnd=!0,this.isModified=!0,this.targetOffset={x:this.modification.result.delta.x,y:this.modification.result.delta.y},this.onNextFrame(function(){return l.smoothEndTick()})}},{key:"onNextFrame",value:function(l){var u=this;this.timeout=ci.request(function(){u.active&&l()})}},{key:"inertiaTick",value:function(){var l,u,m,g,v,b,y,w=this,M=this.interaction,_=ds(M).resistance,E=(M._now()-this.t0)/1e3;if(E<this.te){var j,V=1-(Math.exp(-_*E)-this.lambda_v0)/this.one_ve_v0;this.isModified?(l=0,u=0,m=this.targetOffset.x,g=this.targetOffset.y,v=this.modifiedOffset.x,b=this.modifiedOffset.y,j={x:Gu(y=V,l,m,v),y:Gu(y,u,g,b)}):j={x:this.targetOffset.x*V,y:this.targetOffset.y*V};var I={x:j.x-this.currentOffset.x,y:j.y-this.currentOffset.y};this.currentOffset.x+=I.x,this.currentOffset.y+=I.y,M.offsetBy(I),M.move(),this.onNextFrame(function(){return w.inertiaTick()})}else M.offsetBy({x:this.modifiedOffset.x-this.currentOffset.x,y:this.modifiedOffset.y-this.currentOffset.y}),this.end()}},{key:"smoothEndTick",value:function(){var l=this,u=this.interaction,m=u._now()-this.t0,g=ds(u).smoothEndDuration;if(m<g){var v={x:Yu(m,0,this.targetOffset.x,g),y:Yu(m,0,this.targetOffset.y,g)},b={x:v.x-this.currentOffset.x,y:v.y-this.currentOffset.y};this.currentOffset.x+=b.x,this.currentOffset.y+=b.y,u.offsetBy(b),u.move({skipModifiers:this.modifierCount}),this.onNextFrame(function(){return l.smoothEndTick()})}else u.offsetBy({x:this.targetOffset.x-this.currentOffset.x,y:this.targetOffset.y-this.currentOffset.y}),this.end()}},{key:"resume",value:function(l){var u=l.pointer,m=l.event,g=l.eventTarget,v=this.interaction;v.offsetBy({x:-this.currentOffset.x,y:-this.currentOffset.y}),v.updatePointer(u,m,g,!0),v._doPhase({interaction:v,event:m,phase:"resume"}),is(v.coords.prev,v.coords.cur),this.stop()}},{key:"end",value:function(){this.interaction.move(),this.interaction.end(),this.stop()}},{key:"stop",value:function(){this.active=this.smoothEnd=!1,this.interaction.simulation=null,ci.cancel(this.timeout)}}]),c}();function ds(c){var l=c.interactable,u=c.prepared;return l&&l.options&&u.name&&l.options[u.name].inertia}var a2={id:"inertia",before:["modifiers","actions"],install:function(c){var l=c.defaults;c.usePlugin(Uu),c.usePlugin(Lu),c.actions.phases.inertiastart=!0,c.actions.phases.resume=!0,l.perAction.inertia={enabled:!1,resistance:10,minSpeed:100,endSpeed:10,allowResume:!0,smoothEndDuration:300}},listeners:{"interactions:new":function(c){var l=c.interaction;l.inertia=new n2(l)},"interactions:before-action-end":function(c){var l=c.interaction,u=c.event;return(!l._interacting||l.simulation||!l.inertia.start(u))&&null},"interactions:down":function(c){var l=c.interaction,u=c.eventTarget,m=l.inertia;if(m.active)for(var g=u;$.element(g);){if(g===l.element){m.resume(c);break}g=Xr(g)}},"interactions:stop":function(c){var l=c.interaction.inertia;l.active&&l.stop()},"interactions:before-action-resume":function(c){var l=c.interaction.modification;l.stop(c),l.start(c,c.interaction.coords.cur.page),l.applyToInteraction(c)},"interactions:before-action-inertiastart":function(c){return c.interaction.modification.setAndApply(c)},"interactions:action-resume":na,"interactions:action-inertiastart":na,"interactions:after-action-inertiastart":function(c){return c.interaction.modification.restoreInteractionCoords(c)},"interactions:after-action-resume":function(c){return c.interaction.modification.restoreInteractionCoords(c)}}};function Gu(c,l,u,m){var g=1-c;return g*g*l+2*g*c*u+c*c*m}function Yu(c,l,u,m){return-u*(c/=m)*(c-2)+l}var s2=a2;function Xu(c,l){for(var u=0;u<l.length;u++){var m=l[u];if(c.immediatePropagationStopped)break;m(c)}}var Zu=function(){function c(l){t(this,c),this.options=void 0,this.types={},this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.global=void 0,this.options=K({},l||{})}return n(c,[{key:"fire",value:function(l){var u,m=this.global;(u=this.types[l.type])&&Xu(l,u),!l.propagationStopped&&m&&(u=m[l.type])&&Xu(l,u)}},{key:"on",value:function(l,u){var m=uo(l,u);for(l in m)this.types[l]=zu(this.types[l]||[],m[l])}},{key:"off",value:function(l,u){var m=uo(l,u);for(l in m){var g=this.types[l];if(g&&g.length)for(var v=0,b=m[l];v<b.length;v++){var y=b[v],w=g.indexOf(y);w!==-1&&g.splice(w,1)}}}},{key:"getRect",value:function(l){return null}}]),c}(),l2=function(){function c(l){t(this,c),this.currentTarget=void 0,this.originalEvent=void 0,this.type=void 0,this.originalEvent=l,os(this,l)}return n(c,[{key:"preventOriginalDefault",value:function(){this.originalEvent.preventDefault()}},{key:"stopPropagation",value:function(){this.originalEvent.stopPropagation()}},{key:"stopImmediatePropagation",value:function(){this.originalEvent.stopImmediatePropagation()}}]),c}();function aa(c){return $.object(c)?{capture:!!c.capture,passive:!!c.passive}:{capture:!!c,passive:!1}}function us(c,l){return c===l||(typeof c=="boolean"?!!l.capture===c&&!l.passive:!!c.capture==!!l.capture&&!!c.passive==!!l.passive)}var c2={id:"events",install:function(c){var l,u=[],m={},g=[],v={add:b,remove:y,addDelegate:function(_,E,j,V,I){var D=aa(I);if(!m[j]){m[j]=[];for(var W=0;W<g.length;W++){var B=g[W];b(B,j,w),b(B,j,M,!0)}}var G=m[j],de=oa(G,function(ke){return ke.selector===_&&ke.context===E});de||(de={selector:_,context:E,listeners:[]},G.push(de)),de.listeners.push({func:V,options:D})},removeDelegate:function(_,E,j,V,I){var D,W=aa(I),B=m[j],G=!1;if(B)for(D=B.length-1;D>=0;D--){var de=B[D];if(de.selector===_&&de.context===E){for(var ke=de.listeners,te=ke.length-1;te>=0;te--){var pe=ke[te];if(pe.func===V&&us(pe.options,W)){ke.splice(te,1),ke.length||(B.splice(D,1),y(E,j,w),y(E,j,M,!0)),G=!0;break}}if(G)break}}},delegateListener:w,delegateUseCapture:M,delegatedEvents:m,documents:g,targets:u,supportsOptions:!1,supportsPassive:!1};function b(_,E,j,V){if(_.addEventListener){var I=aa(V),D=oa(u,function(W){return W.eventTarget===_});D||(D={eventTarget:_,events:{}},u.push(D)),D.events[E]||(D.events[E]=[]),oa(D.events[E],function(W){return W.func===j&&us(W.options,I)})||(_.addEventListener(E,j,v.supportsOptions?I:I.capture),D.events[E].push({func:j,options:I}))}}function y(_,E,j,V){if(_.addEventListener&&_.removeEventListener){var I=ra(u,function(mr){return mr.eventTarget===_}),D=u[I];if(D&&D.events)if(E!=="all"){var W=!1,B=D.events[E];if(B){if(j==="all"){for(var G=B.length-1;G>=0;G--){var de=B[G];y(_,E,de.func,de.options)}return}for(var ke=aa(V),te=0;te<B.length;te++){var pe=B[te];if(pe.func===j&&us(pe.options,ke)){_.removeEventListener(E,j,v.supportsOptions?ke:ke.capture),B.splice(te,1),B.length===0&&(delete D.events[E],W=!0);break}}}W&&!Object.keys(D.events).length&&u.splice(I,1)}else for(E in D.events)D.events.hasOwnProperty(E)&&y(_,E,"all")}}function w(_,E){for(var j=aa(E),V=new l2(_),I=m[_.type],D=Cu(_)[0],W=D;$.element(W);){for(var B=0;B<I.length;B++){var G=I[B],de=G.selector,ke=G.context;if(Po(W,de)&&so(ke,D)&&so(ke,W)){var te=G.listeners;V.currentTarget=W;for(var pe=0;pe<te.length;pe++){var mr=te[pe];us(mr.options,j)&&mr.func(V)}}}W=Xr(W)}}function M(_){return w(_,!0)}return(l=c.document)==null||l.createElement("div").addEventListener("test",null,{get capture(){return v.supportsOptions=!0},get passive(){return v.supportsPassive=!0}}),c.events=v,v}},Jl={methodOrder:["simulationResume","mouseOrPen","hasPointer","idle"],search:function(c){for(var l=0,u=Jl.methodOrder;l<u.length;l++){var m=u[l],g=Jl[m](c);if(g)return g}return null},simulationResume:function(c){var l=c.pointerType,u=c.eventType,m=c.eventTarget,g=c.scope;if(!/down|start/i.test(u))return null;for(var v=0,b=g.interactions.list;v<b.length;v++){var y=b[v],w=m;if(y.simulation&&y.simulation.allowResume&&y.pointerType===l)for(;w;){if(w===y.element)return y;w=Xr(w)}}return null},mouseOrPen:function(c){var l,u=c.pointerId,m=c.pointerType,g=c.eventType,v=c.scope;if(m!=="mouse"&&m!=="pen")return null;for(var b=0,y=v.interactions.list;b<y.length;b++){var w=y[b];if(w.pointerType===m){if(w.simulation&&!Qu(w,u))continue;if(w.interacting())return w;l||(l=w)}}if(l)return l;for(var M=0,_=v.interactions.list;M<_.length;M++){var E=_[M];if(!(E.pointerType!==m||/down/i.test(g)&&E.simulation))return E}return null},hasPointer:function(c){for(var l=c.pointerId,u=0,m=c.scope.interactions.list;u<m.length;u++){var g=m[u];if(Qu(g,l))return g}return null},idle:function(c){for(var l=c.pointerType,u=0,m=c.scope.interactions.list;u<m.length;u++){var g=m[u];if(g.pointers.length===1){var v=g.interactable;if(v&&(!v.options.gesture||!v.options.gesture.enabled))continue}else if(g.pointers.length>=2)continue;if(!g.interacting()&&l===g.pointerType)return g}return null}};function Qu(c,l){return c.pointers.some(function(u){return u.id===l})}var d2=Jl,ec=["pointerDown","pointerMove","pointerUp","updatePointer","removePointer","windowBlur"];function Ju(c,l){return function(u){var m=l.interactions.list,g=Mu(u),v=Cu(u),b=v[0],y=v[1],w=[];if(/^touch/.test(u.type)){l.prevTouchTime=l.now();for(var M=0,_=u.changedTouches;M<_.length;M++){var E=_[M],j={pointer:E,pointerId:ta(E),pointerType:g,eventType:u.type,eventTarget:b,curEventTarget:y,scope:l},V=eh(j);w.push([j.pointer,j.eventTarget,j.curEventTarget,V])}}else{var I=!1;if(!hr.supportsPointerEvent&&/mouse/.test(u.type)){for(var D=0;D<m.length&&!I;D++)I=m[D].pointerType!=="mouse"&&m[D].pointerIsDown;I=I||l.now()-l.prevTouchTime<500||u.timeStamp===0}if(!I){var W={pointer:u,pointerId:ta(u),pointerType:g,eventType:u.type,curEventTarget:y,eventTarget:b,scope:l},B=eh(W);w.push([W.pointer,W.eventTarget,W.curEventTarget,B])}}for(var G=0;G<w.length;G++){var de=w[G],ke=de[0],te=de[1],pe=de[2];de[3][c](ke,u,te,pe)}}}function eh(c){var l=c.pointerType,u=c.scope,m={interaction:d2.search(c),searchDetails:c};return u.fire("interactions:find",m),m.interaction||u.interactions.new({pointerType:l})}function tc(c,l){var u=c.doc,m=c.scope,g=c.options,v=m.interactions.docEvents,b=m.events,y=b[l];for(var w in m.browser.isIOS&&!g.events&&(g.events={passive:!1}),b.delegatedEvents)y(u,w,b.delegateListener),y(u,w,b.delegateUseCapture,!0);for(var M=g&&g.events,_=0;_<v.length;_++){var E=v[_];y(u,E.type,E.listener,M)}}var u2={id:"core/interactions",install:function(c){for(var l={},u=0;u<ec.length;u++){var m=ec[u];l[m]=Ju(m,c)}var g,v=hr.pEventTypes;function b(){for(var y=0,w=c.interactions.list;y<w.length;y++){var M=w[y];if(M.pointerIsDown&&M.pointerType==="touch"&&!M._interacting)for(var _=function(){var V=j[E];c.documents.some(function(I){return so(I.doc,V.downTarget)})||M.removePointer(V.pointer,V.event)},E=0,j=M.pointers;E<j.length;E++)_()}}(g=Fe.PointerEvent?[{type:v.down,listener:b},{type:v.down,listener:l.pointerDown},{type:v.move,listener:l.pointerMove},{type:v.up,listener:l.pointerUp},{type:v.cancel,listener:l.pointerUp}]:[{type:"mousedown",listener:l.pointerDown},{type:"mousemove",listener:l.pointerMove},{type:"mouseup",listener:l.pointerUp},{type:"touchstart",listener:b},{type:"touchstart",listener:l.pointerDown},{type:"touchmove",listener:l.pointerMove},{type:"touchend",listener:l.pointerUp},{type:"touchcancel",listener:l.pointerUp}]).push({type:"blur",listener:function(y){for(var w=0,M=c.interactions.list;w<M.length;w++)M[w].documentBlur(y)}}),c.prevTouchTime=0,c.Interaction=function(y){d(M,y);var w=x(M);function M(){return t(this,M),w.apply(this,arguments)}return n(M,[{key:"pointerMoveTolerance",get:function(){return c.interactions.pointerMoveTolerance},set:function(_){c.interactions.pointerMoveTolerance=_}},{key:"_now",value:function(){return c.now()}}]),M}(r2),c.interactions={list:[],new:function(y){y.scopeFire=function(M,_){return c.fire(M,_)};var w=new c.Interaction(y);return c.interactions.list.push(w),w},listeners:l,docEvents:g,pointerMoveTolerance:1},c.usePlugin(Nu)},listeners:{"scope:add-document":function(c){return tc(c,"add")},"scope:remove-document":function(c){return tc(c,"remove")},"interactable:unset":function(c,l){for(var u=c.interactable,m=l.interactions.list.length-1;m>=0;m--){var g=l.interactions.list[m];g.interactable===u&&(g.stop(),l.fire("interactions:destroy",{interaction:g}),g.destroy(),l.interactions.list.length>2&&l.interactions.list.splice(m,1))}}},onDocSignal:tc,doOnInteractions:Ju,methodNames:ec},h2=u2,ui=function(c){return c[c.On=0]="On",c[c.Off=1]="Off",c}(ui||{}),p2=function(){function c(l,u,m,g){t(this,c),this.target=void 0,this.options=void 0,this._actions=void 0,this.events=new Zu,this._context=void 0,this._win=void 0,this._doc=void 0,this._scopeEvents=void 0,this._actions=u.actions,this.target=l,this._context=u.context||m,this._win=H(Tr(l)?this._context:l),this._doc=this._win.document,this._scopeEvents=g,this.set(u)}return n(c,[{key:"_defaults",get:function(){return{base:{},perAction:{},actions:{}}}},{key:"setOnEvents",value:function(l,u){return $.func(u.onstart)&&this.on("".concat(l,"start"),u.onstart),$.func(u.onmove)&&this.on("".concat(l,"move"),u.onmove),$.func(u.onend)&&this.on("".concat(l,"end"),u.onend),$.func(u.oninertiastart)&&this.on("".concat(l,"inertiastart"),u.oninertiastart),this}},{key:"updatePerActionListeners",value:function(l,u,m){var g,v=this,b=(g=this._actions.map[l])==null?void 0:g.filterEventType,y=function(w){return(b==null||b(w))&&ls(w,v._actions)};($.array(u)||$.object(u))&&this._onOff(ui.Off,l,u,void 0,y),($.array(m)||$.object(m))&&this._onOff(ui.On,l,m,void 0,y)}},{key:"setPerAction",value:function(l,u){var m=this._defaults;for(var g in u){var v=g,b=this.options[l],y=u[v];v==="listeners"&&this.updatePerActionListeners(l,b.listeners,y),$.array(y)?b[v]=Eu(y):$.plainObject(y)?(b[v]=K(b[v]||{},dn(y)),$.object(m.perAction[v])&&"enabled"in m.perAction[v]&&(b[v].enabled=y.enabled!==!1)):$.bool(y)&&$.object(m.perAction[v])?b[v].enabled=y:b[v]=y}}},{key:"getRect",value:function(l){return l=l||($.element(this.target)?this.target:null),$.string(this.target)&&(l=l||this._context.querySelector(this.target)),_e(l)}},{key:"rectChecker",value:function(l){var u=this;return $.func(l)?(this.getRect=function(m){var g=K({},l.apply(u,m));return"width"in g||(g.width=g.right-g.left,g.height=g.bottom-g.top),g},this):l===null?(delete this.getRect,this):this.getRect}},{key:"_backCompatOption",value:function(l,u){if(Tr(u)||$.object(u)){for(var m in this.options[l]=u,this._actions.map)this.options[m][l]=u;return this}return this.options[l]}},{key:"origin",value:function(l){return this._backCompatOption("origin",l)}},{key:"deltaSource",value:function(l){return l==="page"||l==="client"?(this.options.deltaSource=l,this):this.options.deltaSource}},{key:"getAllElements",value:function(){var l=this.target;return $.string(l)?Array.from(this._context.querySelectorAll(l)):$.func(l)&&l.getAllElements?l.getAllElements():$.element(l)?[l]:[]}},{key:"context",value:function(){return this._context}},{key:"inContext",value:function(l){return this._context===l.ownerDocument||so(this._context,l)}},{key:"testIgnoreAllow",value:function(l,u,m){return!this.testIgnore(l.ignoreFrom,u,m)&&this.testAllow(l.allowFrom,u,m)}},{key:"testAllow",value:function(l,u,m){return!l||!!$.element(m)&&($.string(l)?he(m,l,u):!!$.element(l)&&so(l,m))}},{key:"testIgnore",value:function(l,u,m){return!(!l||!$.element(m))&&($.string(l)?he(m,l,u):!!$.element(l)&&so(l,m))}},{key:"fire",value:function(l){return this.events.fire(l),this}},{key:"_onOff",value:function(l,u,m,g,v){$.object(u)&&!$.array(u)&&(g=m,m=null);var b=uo(u,m,v);for(var y in b){y==="wheel"&&(y=hr.wheelEvent);for(var w=0,M=b[y];w<M.length;w++){var _=M[w];ls(y,this._actions)?this.events[l===ui.On?"on":"off"](y,_):$.string(this.target)?this._scopeEvents[l===ui.On?"addDelegate":"removeDelegate"](this.target,this._context,y,_,g):this._scopeEvents[l===ui.On?"add":"remove"](this.target,y,_,g)}}return this}},{key:"on",value:function(l,u,m){return this._onOff(ui.On,l,u,m)}},{key:"off",value:function(l,u,m){return this._onOff(ui.Off,l,u,m)}},{key:"set",value:function(l){var u=this._defaults;for(var m in $.object(l)||(l={}),this.options=dn(u.base),this._actions.methodDict){var g=m,v=this._actions.methodDict[g];this.options[g]={},this.setPerAction(g,K(K({},u.perAction),u.actions[g])),this[v](l[g])}for(var b in l)b!=="getRect"?$.func(this[b])&&this[b](l[b]):this.rectChecker(l.getRect);return this}},{key:"unset",value:function(){if($.string(this.target))for(var l in this._scopeEvents.delegatedEvents)for(var u=this._scopeEvents.delegatedEvents[l],m=u.length-1;m>=0;m--){var g=u[m],v=g.selector,b=g.context,y=g.listeners;v===this.target&&b===this._context&&u.splice(m,1);for(var w=y.length-1;w>=0;w--)this._scopeEvents.removeDelegate(this.target,this._context,l,y[w][0],y[w][1])}else this._scopeEvents.remove(this.target,"all")}}]),c}(),m2=function(){function c(l){var u=this;t(this,c),this.list=[],this.selectorMap={},this.scope=void 0,this.scope=l,l.addListeners({"interactable:unset":function(m){var g=m.interactable,v=g.target,b=$.string(v)?u.selectorMap[v]:v[u.scope.id],y=ra(b,function(w){return w===g});b.splice(y,1)}})}return n(c,[{key:"new",value:function(l,u){u=K(u||{},{actions:this.scope.actions});var m=new this.scope.Interactable(l,u,this.scope.document,this.scope.events);return this.scope.addDocument(m._doc),this.list.push(m),$.string(l)?(this.selectorMap[l]||(this.selectorMap[l]=[]),this.selectorMap[l].push(m)):(m.target[this.scope.id]||Object.defineProperty(l,this.scope.id,{value:[],configurable:!0}),l[this.scope.id].push(m)),this.scope.fire("interactable:new",{target:l,options:u,interactable:m,win:this.scope._win}),m}},{key:"getExisting",value:function(l,u){var m=u&&u.context||this.scope.document,g=$.string(l),v=g?this.selectorMap[l]:l[this.scope.id];if(v)return oa(v,function(b){return b._context===m&&(g||b.inContext(l))})}},{key:"forEachMatch",value:function(l,u){for(var m=0,g=this.list;m<g.length;m++){var v=g[m],b=void 0;if(($.string(v.target)?$.element(l)&&Po(l,v.target):l===v.target)&&v.inContext(l)&&(b=u(v)),b!==void 0)return b}}}]),c}(),g2=function(){function c(){var l=this;t(this,c),this.id="__interact_scope_".concat(Math.floor(100*Math.random())),this.isInitialized=!1,this.listenerMaps=[],this.browser=hr,this.defaults=dn(Bu),this.Eventable=Zu,this.actions={map:{},phases:{start:!0,move:!0,end:!0},methodDict:{},phaselessTypes:{}},this.interactStatic=function(m){var g=function v(b,y){var w=m.interactables.getExisting(b,y);return w||((w=m.interactables.new(b,y)).events.global=v.globalEvents),w};return g.getPointerAverage=_u,g.getTouchBBox=Vl,g.getTouchDistance=Dl,g.getTouchAngle=Fl,g.getElementRect=_e,g.getElementClientRect=X,g.matchesSelector=Po,g.closest=sn,g.globalEvents={},g.version="1.10.27",g.scope=m,g.use=function(v,b){return this.scope.usePlugin(v,b),this},g.isSet=function(v,b){return!!this.scope.interactables.get(v,b&&b.context)},g.on=ia(function(v,b,y){if($.string(v)&&v.search(" ")!==-1&&(v=v.trim().split(/ +/)),$.array(v)){for(var w=0,M=v;w<M.length;w++){var _=M[w];this.on(_,b,y)}return this}if($.object(v)){for(var E in v)this.on(E,v[E],b);return this}return ls(v,this.scope.actions)?this.globalEvents[v]?this.globalEvents[v].push(b):this.globalEvents[v]=[b]:this.scope.events.add(this.scope.document,v,b,{options:y}),this},"The interact.on() method is being deprecated"),g.off=ia(function(v,b,y){if($.string(v)&&v.search(" ")!==-1&&(v=v.trim().split(/ +/)),$.array(v)){for(var w=0,M=v;w<M.length;w++){var _=M[w];this.off(_,b,y)}return this}if($.object(v)){for(var E in v)this.off(E,v[E],b);return this}var j;return ls(v,this.scope.actions)?v in this.globalEvents&&(j=this.globalEvents[v].indexOf(b))!==-1&&this.globalEvents[v].splice(j,1):this.scope.events.remove(this.scope.document,v,b,y),this},"The interact.off() method is being deprecated"),g.debug=function(){return this.scope},g.supportsTouch=function(){return hr.supportsTouch},g.supportsPointerEvent=function(){return hr.supportsPointerEvent},g.stop=function(){for(var v=0,b=this.scope.interactions.list;v<b.length;v++)b[v].stop();return this},g.pointerMoveTolerance=function(v){return $.number(v)?(this.scope.interactions.pointerMoveTolerance=v,this):this.scope.interactions.pointerMoveTolerance},g.addDocument=function(v,b){this.scope.addDocument(v,b)},g.removeDocument=function(v){this.scope.removeDocument(v)},g}(this),this.InteractEvent=Zl,this.Interactable=void 0,this.interactables=new m2(this),this._win=void 0,this.document=void 0,this.window=void 0,this.documents=[],this._plugins={list:[],map:{}},this.onWindowUnload=function(m){return l.removeDocument(m.target)};var u=this;this.Interactable=function(m){d(v,m);var g=x(v);function v(){return t(this,v),g.apply(this,arguments)}return n(v,[{key:"_defaults",get:function(){return u.defaults}},{key:"set",value:function(b){return k(h(v.prototype),"set",this).call(this,b),u.fire("interactable:set",{options:b,interactable:this}),this}},{key:"unset",value:function(){k(h(v.prototype),"unset",this).call(this);var b=u.interactables.list.indexOf(this);b<0||(u.interactables.list.splice(b,1),u.fire("interactable:unset",{interactable:this}))}}]),v}(p2)}return n(c,[{key:"addListeners",value:function(l,u){this.listenerMaps.push({id:u,map:l})}},{key:"fire",value:function(l,u){for(var m=0,g=this.listenerMaps;m<g.length;m++){var v=g[m].map[l];if(v&&v(u,this,l)===!1)return!1}}},{key:"init",value:function(l){return this.isInitialized?this:function(u,m){return u.isInitialized=!0,$.window(m)&&P(m),Fe.init(m),hr.init(m),ci.init(m),u.window=m,u.document=m.document,u.usePlugin(h2),u.usePlugin(c2),u}(this,l)}},{key:"pluginIsInstalled",value:function(l){var u=l.id;return u?!!this._plugins.map[u]:this._plugins.list.indexOf(l)!==-1}},{key:"usePlugin",value:function(l,u){if(!this.isInitialized)return this;if(this.pluginIsInstalled(l))return this;if(l.id&&(this._plugins.map[l.id]=l),this._plugins.list.push(l),l.install&&l.install(this,u),l.listeners&&l.before){for(var m=0,g=this.listenerMaps.length,v=l.before.reduce(function(y,w){return y[w]=!0,y[th(w)]=!0,y},{});m<g;m++){var b=this.listenerMaps[m].id;if(b&&(v[b]||v[th(b)]))break}this.listenerMaps.splice(m,0,{id:l.id,map:l.listeners})}else l.listeners&&this.listenerMaps.push({id:l.id,map:l.listeners});return this}},{key:"addDocument",value:function(l,u){if(this.getDocIndex(l)!==-1)return!1;var m=H(l);u=u?K({},u):{},this.documents.push({doc:l,options:u}),this.events.documents.push(l),l!==this.document&&this.events.add(m,"unload",this.onWindowUnload),this.fire("scope:add-document",{doc:l,window:m,scope:this,options:u})}},{key:"removeDocument",value:function(l){var u=this.getDocIndex(l),m=H(l),g=this.documents[u].options;this.events.remove(m,"unload",this.onWindowUnload),this.documents.splice(u,1),this.events.documents.splice(u,1),this.fire("scope:remove-document",{doc:l,window:m,scope:this,options:g})}},{key:"getDocIndex",value:function(l){for(var u=0;u<this.documents.length;u++)if(this.documents[u].doc===l)return u;return-1}},{key:"getDocOptions",value:function(l){var u=this.getDocIndex(l);return u===-1?null:this.documents[u].options}},{key:"now",value:function(){return(this.window.Date||Date).now()}}]),c}();function th(c){return c&&c.replace(/\/.*$/,"")}var rh=new g2,pr=rh.interactStatic,f2=typeof globalThis<"u"?globalThis:window;rh.init(f2);var v2=Object.freeze({__proto__:null,edgeTarget:function(){},elements:function(){},grid:function(c){var l=[["x","y"],["left","top"],["right","bottom"],["width","height"]].filter(function(m){var g=m[0],v=m[1];return g in c||v in c}),u=function(m,g){for(var v=c.range,b=c.limits,y=b===void 0?{left:-1/0,right:1/0,top:-1/0,bottom:1/0}:b,w=c.offset,M=w===void 0?{x:0,y:0}:w,_={range:v,grid:c,x:null,y:null},E=0;E<l.length;E++){var j=l[E],V=j[0],I=j[1],D=Math.round((m-M.x)/c[V]),W=Math.round((g-M.y)/c[I]);_[V]=Math.max(y.left,Math.min(y.right,D*c[V]+M.x)),_[I]=Math.max(y.top,Math.min(y.bottom,W*c[I]+M.y))}return _};return u.grid=c,u.coordFields=l,u}}),b2={id:"snappers",install:function(c){var l=c.interactStatic;l.snappers=K(l.snappers||{},v2),l.createSnapGrid=l.snappers.grid}},y2=b2,k2={start:function(c){var l=c.state,u=c.rect,m=c.edges,g=c.pageCoords,v=l.options,b=v.ratio,y=v.enabled,w=l.options,M=w.equalDelta,_=w.modifiers;b==="preserve"&&(b=u.width/u.height),l.startCoords=K({},g),l.startRect=K({},u),l.ratio=b,l.equalDelta=M;var E=l.linkedEdges={top:m.top||m.left&&!m.bottom,left:m.left||m.top&&!m.right,bottom:m.bottom||m.right&&!m.top,right:m.right||m.bottom&&!m.left};if(l.xIsPrimaryAxis=!(!m.left&&!m.right),l.equalDelta){var j=(E.left?1:-1)*(E.top?1:-1);l.edgeSign={x:j,y:j}}else l.edgeSign={x:E.left?-1:1,y:E.top?-1:1};if(y!==!1&&K(m,E),_!=null&&_.length){var V=new Xl(c.interaction);V.copyFrom(c.interaction.modification),V.prepareStates(_),l.subModification=V,V.startAll(o({},c))}},set:function(c){var l=c.state,u=c.rect,m=c.coords,g=l.linkedEdges,v=K({},m),b=l.equalDelta?x2:w2;if(K(c.edges,g),b(l,l.xIsPrimaryAxis,m,u),!l.subModification)return null;var y=K({},u);li(g,y,{x:m.x-v.x,y:m.y-v.y});var w=l.subModification.setAll(o(o({},c),{},{rect:y,edges:g,pageCoords:m,prevCoords:m,prevRect:y})),M=w.delta;return w.changed&&(b(l,Math.abs(M.x)>Math.abs(M.y),w.coords,w.rect),K(m,w.coords)),w.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function x2(c,l,u){var m=c.startCoords,g=c.edgeSign;l?u.y=m.y+(u.x-m.x)*g.y:u.x=m.x+(u.y-m.y)*g.x}function w2(c,l,u,m){var g=c.startRect,v=c.startCoords,b=c.ratio,y=c.edgeSign;if(l){var w=m.width/b;u.y=v.y+(w-g.height)*y.y}else{var M=m.height*b;u.x=v.x+(M-g.width)*y.x}}var _2=di(k2,"aspectRatio"),oh=function(){};oh._defaults={};var hs=oh;function ji(c,l,u){return $.func(c)?lo(c,l.interactable,l.element,[u.x,u.y,l]):lo(c,l.interactable,l.element)}var ps={start:function(c){var l=c.rect,u=c.startOffset,m=c.state,g=c.interaction,v=c.pageCoords,b=m.options,y=b.elementRect,w=K({left:0,top:0,right:0,bottom:0},b.offset||{});if(l&&y){var M=ji(b.restriction,g,v);if(M){var _=M.right-M.left-l.width,E=M.bottom-M.top-l.height;_<0&&(w.left+=_,w.right+=_),E<0&&(w.top+=E,w.bottom+=E)}w.left+=u.left-l.width*y.left,w.top+=u.top-l.height*y.top,w.right+=u.right-l.width*(1-y.right),w.bottom+=u.bottom-l.height*(1-y.bottom)}m.offset=w},set:function(c){var l=c.coords,u=c.interaction,m=c.state,g=m.options,v=m.offset,b=ji(g.restriction,u,l);if(b){var y=function(w){return!w||"left"in w&&"top"in w||((w=K({},w)).left=w.x||0,w.top=w.y||0,w.right=w.right||w.left+w.width,w.bottom=w.bottom||w.top+w.height),w}(b);l.x=Math.max(Math.min(y.right-v.right,l.x),y.left+v.left),l.y=Math.max(Math.min(y.bottom-v.bottom,l.y),y.top+v.top)}},defaults:{restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1}},M2=di(ps,"restrict"),ih={top:1/0,left:1/0,bottom:-1/0,right:-1/0},nh={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function ah(c,l){for(var u=0,m=["top","left","bottom","right"];u<m.length;u++){var g=m[u];g in c||(c[g]=l[g])}return c}var sa={noInner:ih,noOuter:nh,start:function(c){var l,u=c.interaction,m=c.startOffset,g=c.state,v=g.options;v&&(l=Zr(ji(v.offset,u,u.coords.start.page))),l=l||{x:0,y:0},g.offset={top:l.y+m.top,left:l.x+m.left,bottom:l.y-m.bottom,right:l.x-m.right}},set:function(c){var l=c.coords,u=c.edges,m=c.interaction,g=c.state,v=g.offset,b=g.options;if(u){var y=K({},l),w=ji(b.inner,m,y)||{},M=ji(b.outer,m,y)||{};ah(w,ih),ah(M,nh),u.top?l.y=Math.min(Math.max(M.top+v.top,y.y),w.top+v.top):u.bottom&&(l.y=Math.max(Math.min(M.bottom+v.bottom,y.y),w.bottom+v.bottom)),u.left?l.x=Math.min(Math.max(M.left+v.left,y.x),w.left+v.left):u.right&&(l.x=Math.max(Math.min(M.right+v.right,y.x),w.right+v.right))}},defaults:{inner:null,outer:null,offset:null,endOnly:!1,enabled:!1}},C2=di(sa,"restrictEdges"),z2=K({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(c){}},ps.defaults),E2=di({start:ps.start,set:ps.set,defaults:z2},"restrictRect"),S2={width:-1/0,height:-1/0},$2={width:1/0,height:1/0},T2=di({start:function(c){return sa.start(c)},set:function(c){var l=c.interaction,u=c.state,m=c.rect,g=c.edges,v=u.options;if(g){var b=co(ji(v.min,l,c.coords))||S2,y=co(ji(v.max,l,c.coords))||$2;u.options={endOnly:v.endOnly,inner:K({},sa.noInner),outer:K({},sa.noOuter)},g.top?(u.options.inner.top=m.bottom-b.height,u.options.outer.top=m.bottom-y.height):g.bottom&&(u.options.inner.bottom=m.top+b.height,u.options.outer.bottom=m.top+y.height),g.left?(u.options.inner.left=m.right-b.width,u.options.outer.left=m.right-y.width):g.right&&(u.options.inner.right=m.left+b.width,u.options.outer.right=m.left+y.width),sa.set(c),u.options=v}},defaults:{min:null,max:null,endOnly:!1,enabled:!1}},"restrictSize"),rc={start:function(c){var l,u=c.interaction,m=c.interactable,g=c.element,v=c.rect,b=c.state,y=c.startOffset,w=b.options,M=w.offsetWithOrigin?function(j){var V=j.interaction.element,I=Zr(lo(j.state.options.origin,null,null,[V])),D=I||Bo(j.interactable,V,j.interaction.prepared.name);return D}(c):{x:0,y:0};if(w.offset==="startCoords")l={x:u.coords.start.page.x,y:u.coords.start.page.y};else{var _=lo(w.offset,m,g,[u]);(l=Zr(_)||{x:0,y:0}).x+=M.x,l.y+=M.y}var E=w.relativePoints;b.offsets=v&&E&&E.length?E.map(function(j,V){return{index:V,relativePoint:j,x:y.left-v.width*j.x+l.x,y:y.top-v.height*j.y+l.y}}):[{index:0,relativePoint:null,x:l.x,y:l.y}]},set:function(c){var l=c.interaction,u=c.coords,m=c.state,g=m.options,v=m.offsets,b=Bo(l.interactable,l.element,l.prepared.name),y=K({},u),w=[];g.offsetWithOrigin||(y.x-=b.x,y.y-=b.y);for(var M=0,_=v;M<_.length;M++)for(var E=_[M],j=y.x-E.x,V=y.y-E.y,I=0,D=g.targets.length;I<D;I++){var W=g.targets[I],B=void 0;(B=$.func(W)?W(j,V,l._proxy,E,I):W)&&w.push({x:($.number(B.x)?B.x:j)+E.x,y:($.number(B.y)?B.y:V)+E.y,range:$.number(B.range)?B.range:g.range,source:W,index:I,offset:E})}for(var G={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}},de=0;de<w.length;de++){var ke=w[de],te=ke.range,pe=ke.x-y.x,mr=ke.y-y.y,tt=ea(pe,mr),Nr=tt<=te;te===1/0&&G.inRange&&G.range!==1/0&&(Nr=!1),G.target&&!(Nr?G.inRange&&te!==1/0?tt/te<G.distance/G.range:te===1/0&&G.range!==1/0||tt<G.distance:!G.inRange&&tt<G.distance)||(G.target=ke,G.distance=tt,G.range=te,G.inRange=Nr,G.delta.x=pe,G.delta.y=mr)}return G.inRange&&(u.x=G.target.x,u.y=G.target.y),m.closest=G,G},defaults:{range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1}},A2=di(rc,"snap"),ms={start:function(c){var l=c.state,u=c.edges,m=l.options;if(!u)return null;c.state={options:{targets:null,relativePoints:[{x:u.left?0:1,y:u.top?0:1}],offset:m.offset||"self",origin:{x:0,y:0},range:m.range}},l.targetFields=l.targetFields||[["width","height"],["x","y"]],rc.start(c),l.offsets=c.state.offsets,c.state=l},set:function(c){var l=c.interaction,u=c.state,m=c.coords,g=u.options,v=u.offsets,b={x:m.x-v[0].x,y:m.y-v[0].y};u.options=K({},g),u.options.targets=[];for(var y=0,w=g.targets||[];y<w.length;y++){var M=w[y],_=void 0;if(_=$.func(M)?M(b.x,b.y,l):M){for(var E=0,j=u.targetFields;E<j.length;E++){var V=j[E],I=V[0],D=V[1];if(I in _||D in _){_.x=_[I],_.y=_[D];break}}u.options.targets.push(_)}}var W=rc.set(c);return u.options=g,W},defaults:{range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1}},P2=di(ms,"snapSize"),oc={aspectRatio:_2,restrictEdges:C2,restrict:M2,restrictRect:E2,restrictSize:T2,snapEdges:di({start:function(c){var l=c.edges;return l?(c.state.targetFields=c.state.targetFields||[[l.left?"left":"right",l.top?"top":"bottom"]],ms.start(c)):null},set:ms.set,defaults:K(dn(ms.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})},"snapEdges"),snap:A2,snapSize:P2,spring:hs,avoid:hs,transform:hs,rubberband:hs},j2={id:"modifiers",install:function(c){var l=c.interactStatic;for(var u in c.usePlugin(Lu),c.usePlugin(y2),l.modifiers=oc,oc){var m=oc[u],g=m._defaults,v=m._methods;g._methods=v,c.defaults.perAction[u]=g}}},O2=j2,sh=function(c){d(u,c);var l=x(u);function u(m,g,v,b,y,w){var M;if(t(this,u),os(f(M=l.call(this,y)),v),v!==g&&os(f(M),g),M.timeStamp=w,M.originalEvent=v,M.type=m,M.pointerId=ta(g),M.pointerType=Mu(g),M.target=b,M.currentTarget=null,m==="tap"){var _=y.getPointerIndex(g);M.dt=M.timeStamp-y.pointers[_].downTime;var E=M.timeStamp-y.tapTime;M.double=!!y.prevTap&&y.prevTap.type!=="doubletap"&&y.prevTap.target===M.target&&E<500}else m==="doubletap"&&(M.dt=g.timeStamp-y.tapTime,M.double=!0);return M}return n(u,[{key:"_subtractOrigin",value:function(m){var g=m.x,v=m.y;return this.pageX-=g,this.pageY-=v,this.clientX-=g,this.clientY-=v,this}},{key:"_addOrigin",value:function(m){var g=m.x,v=m.y;return this.pageX+=g,this.pageY+=v,this.clientX+=g,this.clientY+=v,this}},{key:"preventDefault",value:function(){this.originalEvent.preventDefault()}}]),u}(as),la={id:"pointer-events/base",before:["inertia","modifiers","auto-start","actions"],install:function(c){c.pointerEvents=la,c.defaults.actions.pointerEvents=la.defaults,K(c.actions.phaselessTypes,la.types)},listeners:{"interactions:new":function(c){var l=c.interaction;l.prevTap=null,l.tapTime=0},"interactions:update-pointer":function(c){var l=c.down,u=c.pointerInfo;!l&&u.hold||(u.hold={duration:1/0,timeout:null})},"interactions:move":function(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget;c.duplicate||u.pointerIsDown&&!u.pointerWasMoved||(u.pointerIsDown&&ic(c),hi({interaction:u,pointer:m,event:g,eventTarget:v,type:"move"},l))},"interactions:down":function(c,l){(function(u,m){for(var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget,w=u.pointerIndex,M=g.pointers[w].hold,_=ae(y),E={interaction:g,pointer:v,event:b,eventTarget:y,type:"hold",targets:[],path:_,node:null},j=0;j<_.length;j++){var V=_[j];E.node=V,m.fire("pointerEvents:collect-targets",E)}if(E.targets.length){for(var I=1/0,D=0,W=E.targets;D<W.length;D++){var B=W[D].eventable.options.holdDuration;B<I&&(I=B)}M.duration=I,M.timeout=setTimeout(function(){hi({interaction:g,eventTarget:y,pointer:v,event:b,type:"hold"},m)},I)}})(c,l),hi(c,l)},"interactions:up":function(c,l){ic(c),hi(c,l),function(u,m){var g=u.interaction,v=u.pointer,b=u.event,y=u.eventTarget;g.pointerWasMoved||hi({interaction:g,eventTarget:y,pointer:v,event:b,type:"tap"},m)}(c,l)},"interactions:cancel":function(c,l){ic(c),hi(c,l)}},PointerEvent:sh,fire:hi,collectEventTargets:lh,defaults:{holdDuration:600,ignoreFrom:null,allowFrom:null,origin:{x:0,y:0}},types:{down:!0,move:!0,up:!0,cancel:!0,tap:!0,doubletap:!0,hold:!0}};function hi(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget,b=c.type,y=c.targets,w=y===void 0?lh(c,l):y,M=new sh(b,m,g,v,u,l.now());l.fire("pointerEvents:new",{pointerEvent:M});for(var _={interaction:u,pointer:m,event:g,eventTarget:v,targets:w,type:b,pointerEvent:M},E=0;E<w.length;E++){var j=w[E];for(var V in j.props||{})M[V]=j.props[V];var I=Bo(j.eventable,j.node);if(M._subtractOrigin(I),M.eventable=j.eventable,M.currentTarget=j.node,j.eventable.fire(M),M._addOrigin(I),M.immediatePropagationStopped||M.propagationStopped&&E+1<w.length&&w[E+1].node!==M.currentTarget)break}if(l.fire("pointerEvents:fired",_),b==="tap"){var D=M.double?hi({interaction:u,pointer:m,event:g,eventTarget:v,type:"doubletap"},l):M;u.prevTap=D,u.tapTime=D.timeStamp}return M}function lh(c,l){var u=c.interaction,m=c.pointer,g=c.event,v=c.eventTarget,b=c.type,y=u.getPointerIndex(m),w=u.pointers[y];if(b==="tap"&&(u.pointerWasMoved||!w||w.downTarget!==v))return[];for(var M=ae(v),_={interaction:u,pointer:m,event:g,eventTarget:v,type:b,path:M,targets:[],node:null},E=0;E<M.length;E++){var j=M[E];_.node=j,l.fire("pointerEvents:collect-targets",_)}return b==="hold"&&(_.targets=_.targets.filter(function(V){var I,D;return V.eventable.options.holdDuration===((I=u.pointers[y])==null||(D=I.hold)==null?void 0:D.duration)})),_.targets}function ic(c){var l=c.interaction,u=c.pointerIndex,m=l.pointers[u].hold;m&&m.timeout&&(clearTimeout(m.timeout),m.timeout=null)}var H2=Object.freeze({__proto__:null,default:la});function R2(c){var l=c.interaction;l.holdIntervalHandle&&(clearInterval(l.holdIntervalHandle),l.holdIntervalHandle=null)}var I2={id:"pointer-events/holdRepeat",install:function(c){c.usePlugin(la);var l=c.pointerEvents;l.defaults.holdRepeatInterval=0,l.types.holdrepeat=c.actions.phaselessTypes.holdrepeat=!0},listeners:["move","up","cancel","endall"].reduce(function(c,l){return c["pointerEvents:".concat(l)]=R2,c},{"pointerEvents:new":function(c){var l=c.pointerEvent;l.type==="hold"&&(l.count=(l.count||0)+1)},"pointerEvents:fired":function(c,l){var u=c.interaction,m=c.pointerEvent,g=c.eventTarget,v=c.targets;if(m.type==="hold"&&v.length){var b=v[0].eventable.options.holdRepeatInterval;b<=0||(u.holdIntervalHandle=setTimeout(function(){l.pointerEvents.fire({interaction:u,eventTarget:g,type:"hold",pointer:m,event:m},l)},b))}}})},V2=I2,D2={id:"pointer-events/interactableTargets",install:function(c){var l=c.Interactable;l.prototype.pointerEvents=function(m){return K(this.events.options,m),this};var u=l.prototype._backCompatOption;l.prototype._backCompatOption=function(m,g){var v=u.call(this,m,g);return v===this&&(this.events.options[m]=g),v}},listeners:{"pointerEvents:collect-targets":function(c,l){var u=c.targets,m=c.node,g=c.type,v=c.eventTarget;l.interactables.forEachMatch(m,function(b){var y=b.events,w=y.options;y.types[g]&&y.types[g].length&&b.testIgnoreAllow(w,m,v)&&u.push({node:m,eventable:y,props:{interactable:b}})})},"interactable:new":function(c){var l=c.interactable;l.events.getRect=function(u){return l.getRect(u)}},"interactable:set":function(c,l){var u=c.interactable,m=c.options;K(u.events.options,l.pointerEvents.defaults),K(u.events.options,m.pointerEvents||{})}}},F2=D2,N2={id:"pointer-events",install:function(c){c.usePlugin(H2),c.usePlugin(V2),c.usePlugin(F2)}},L2=N2,B2={id:"reflow",install:function(c){var l=c.Interactable;c.actions.phases.reflow=!0,l.prototype.reflow=function(u){return function(m,g,v){for(var b=m.getAllElements(),y=v.window.Promise,w=y?[]:null,M=function(){var E=b[_],j=m.getRect(E);if(!j)return 1;var V,I=oa(v.interactions.list,function(B){return B.interacting()&&B.interactable===m&&B.element===E&&B.prepared.name===g.name});if(I)I.move(),w&&(V=I._reflowPromise||new y(function(B){I._reflowResolve=B}));else{var D=co(j),W=function(B){return{coords:B,get page(){return this.coords.page},get client(){return this.coords.client},get timeStamp(){return this.coords.timeStamp},get pageX(){return this.coords.page.x},get pageY(){return this.coords.page.y},get clientX(){return this.coords.client.x},get clientY(){return this.coords.client.y},get pointerId(){return this.coords.pointerId},get target(){return this.coords.target},get type(){return this.coords.type},get pointerType(){return this.coords.pointerType},get buttons(){return this.coords.buttons},preventDefault:function(){}}}({page:{x:D.x,y:D.y},client:{x:D.x,y:D.y},timeStamp:v.now()});V=function(B,G,de,ke,te){var pe=B.interactions.new({pointerType:"reflow"}),mr={interaction:pe,event:te,pointer:te,eventTarget:de,phase:"reflow"};pe.interactable=G,pe.element=de,pe.prevEvent=te,pe.updatePointer(te,te,de,!0),ku(pe.coords.delta),Wl(pe.prepared,ke),pe._doPhase(mr);var tt=B.window,Nr=tt.Promise,ho=Nr?new Nr(function(Wo){pe._reflowResolve=Wo}):void 0;return pe._reflowPromise=ho,pe.start(ke,G,de),pe._interacting?(pe.move(mr),pe.end(te)):(pe.stop(),pe._reflowResolve()),pe.removePointer(te,te),ho}(v,m,E,g,W)}w&&w.push(V)},_=0;_<b.length&&!M();_++);return w&&y.all(w).then(function(){return m})}(this,u,c)}},listeners:{"interactions:stop":function(c,l){var u=c.interaction;u.pointerType==="reflow"&&(u._reflowResolve&&u._reflowResolve(),function(m,g){m.splice(m.indexOf(g),1)}(l.interactions.list,u))}}},q2=B2;if(pr.use(Nu),pr.use(Uu),pr.use(L2),pr.use(s2),pr.use(O2),pr.use(Y0),pr.use(V0),pr.use(F0),pr.use(q2),pr.default=pr,(typeof Bi>"u"?"undefined":e(Bi))==="object"&&Bi)try{Bi.exports=pr}catch{}return pr.default=pr,pr})});import{css as gg,html as ka,LitElement as fg,nothing as kc}from"lit";import{customElement as vg,property as mo,state as xc}from"lit/decorators.js";import{css as mh}from"lit";var A=mh`
2
2
  :host {
3
3
  /* Surfaces (refined workbench light) */
4
4
  --lui-color-bg: #ffffff;
@@ -453,7 +453,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
453
453
  transform: rotate(360deg);
454
454
  }
455
455
  }
456
- `],a([Le()],Ee.prototype,"name",2),a([Le({reflect:!0})],Ee.prototype,"type",2),a([Le()],Ee.prototype,"src",2),a([Le()],Ee.prototype,"svg",2),a([Le({attribute:"svg-body"})],Ee.prototype,"svgBody",2),a([Le({attribute:"icon-class"})],Ee.prototype,"iconClass",2),a([Le()],Ee.prototype,"alt",2),a([Le({attribute:"aria-label"})],Ee.prototype,"ariaLabel",2),a([Le({type:Boolean,reflect:!0})],Ee.prototype,"decorative",2),a([Le()],Ee.prototype,"color",2),a([Le()],Ee.prototype,"size",2),a([Le({type:Boolean,reflect:!0})],Ee.prototype,"spin",2),a([Le({attribute:!1})],Ee.prototype,"builtinPrefix",2),a([Le()],Ee.prototype,"glyph",2),a([Le({attribute:"font-family"})],Ee.prototype,"fontFamily",2),a([Le({attribute:"font-weight"})],Ee.prototype,"fontWeight",2),a([Le({type:Number})],Ee.prototype,"rotate",2),a([Le({type:Boolean,attribute:"flip-h"})],Ee.prototype,"flipH",2),a([Le({type:Boolean,attribute:"flip-v"})],Ee.prototype,"flipV",2),a([Le({attribute:"view-box"})],Ee.prototype,"viewBox",2),a([Le({attribute:"preserve-aspect-ratio"})],Ee.prototype,"preserveAspectRatio",2),a([Le({attribute:"stroke-width"})],Ee.prototype,"strokeWidth",2),a([Le()],Ee.prototype,"stroke",2),a([Le()],Ee.prototype,"fill",2),a([Le({attribute:"stroke-linecap"})],Ee.prototype,"strokeLinecap",2),a([Le({attribute:"stroke-linejoin"})],Ee.prototype,"strokeLinejoin",2),Ee=a([cg("lui-icon")],Ee);import{css as ug,html as hg,LitElement as pg}from"lit";import{customElement as mg,property as Oi}from"lit/decorators.js";var Nr=class extends pg{constructor(){super(...arguments);this.variant="current";this.decorative=!0}willUpdate(e){e.has("size")&&this._applyLength("--lui-spinner-size",this.size),e.has("thickness")&&this._applyLength("--lui-spinner-thickness",this.thickness),e.has("color")&&this._applyRaw("--lui-spinner-color",this.color),e.has("track")&&this._applyRaw("--lui-spinner-track",this.track),(e.has("decorative")||e.has("label"))&&this._syncA11y()}_applyLength(e,t){if(t==null||t===""){this.style.removeProperty(e);return}this.style.setProperty(e,mt(t))}_applyRaw(e,t){if(!t){this.style.removeProperty(e);return}this.style.setProperty(e,t)}_syncA11y(){if(this.decorative&&!this.label){this.setAttribute("aria-hidden","true"),this.removeAttribute("role"),this.removeAttribute("aria-label");return}this.removeAttribute("aria-hidden"),this.setAttribute("role","status"),this.label?this.setAttribute("aria-label",this.label):this.removeAttribute("aria-label")}connectedCallback(){super.connectedCallback(),this._syncA11y()}render(){return hg`<span class="ring" part="ring"></span>`}};Nr.styles=[A,O,ug`
456
+ `],a([Le()],Ee.prototype,"name",2),a([Le({reflect:!0})],Ee.prototype,"type",2),a([Le()],Ee.prototype,"src",2),a([Le()],Ee.prototype,"svg",2),a([Le({attribute:"svg-body"})],Ee.prototype,"svgBody",2),a([Le({attribute:"icon-class"})],Ee.prototype,"iconClass",2),a([Le()],Ee.prototype,"alt",2),a([Le({attribute:"aria-label"})],Ee.prototype,"ariaLabel",2),a([Le({type:Boolean,reflect:!0})],Ee.prototype,"decorative",2),a([Le()],Ee.prototype,"color",2),a([Le()],Ee.prototype,"size",2),a([Le({type:Boolean,reflect:!0})],Ee.prototype,"spin",2),a([Le({attribute:!1})],Ee.prototype,"builtinPrefix",2),a([Le()],Ee.prototype,"glyph",2),a([Le({attribute:"font-family"})],Ee.prototype,"fontFamily",2),a([Le({attribute:"font-weight"})],Ee.prototype,"fontWeight",2),a([Le({type:Number})],Ee.prototype,"rotate",2),a([Le({type:Boolean,attribute:"flip-h"})],Ee.prototype,"flipH",2),a([Le({type:Boolean,attribute:"flip-v"})],Ee.prototype,"flipV",2),a([Le({attribute:"view-box"})],Ee.prototype,"viewBox",2),a([Le({attribute:"preserve-aspect-ratio"})],Ee.prototype,"preserveAspectRatio",2),a([Le({attribute:"stroke-width"})],Ee.prototype,"strokeWidth",2),a([Le()],Ee.prototype,"stroke",2),a([Le()],Ee.prototype,"fill",2),a([Le({attribute:"stroke-linecap"})],Ee.prototype,"strokeLinecap",2),a([Le({attribute:"stroke-linejoin"})],Ee.prototype,"strokeLinejoin",2),Ee=a([cg("lui-icon")],Ee);import{css as ug,html as hg,LitElement as pg}from"lit";import{customElement as mg,property as Oi}from"lit/decorators.js";var Lr=class extends pg{constructor(){super(...arguments);this.variant="current";this.decorative=!0}willUpdate(e){e.has("size")&&this._applyLength("--lui-spinner-size",this.size),e.has("thickness")&&this._applyLength("--lui-spinner-thickness",this.thickness),e.has("color")&&this._applyRaw("--lui-spinner-color",this.color),e.has("track")&&this._applyRaw("--lui-spinner-track",this.track),(e.has("decorative")||e.has("label"))&&this._syncA11y()}_applyLength(e,t){if(t==null||t===""){this.style.removeProperty(e);return}this.style.setProperty(e,mt(t))}_applyRaw(e,t){if(!t){this.style.removeProperty(e);return}this.style.setProperty(e,t)}_syncA11y(){if(this.decorative&&!this.label){this.setAttribute("aria-hidden","true"),this.removeAttribute("role"),this.removeAttribute("aria-label");return}this.removeAttribute("aria-hidden"),this.setAttribute("role","status"),this.label?this.setAttribute("aria-label",this.label):this.removeAttribute("aria-label")}connectedCallback(){super.connectedCallback(),this._syncA11y()}render(){return hg`<span class="ring" part="ring"></span>`}};Lr.styles=[A,O,ug`
457
457
  :host {
458
458
  display: inline-flex;
459
459
  flex-shrink: 0;
@@ -491,7 +491,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
491
491
  animation-duration: 2.4s;
492
492
  }
493
493
  }
494
- `],a([Oi({reflect:!0})],Nr.prototype,"variant",2),a([Oi()],Nr.prototype,"size",2),a([Oi()],Nr.prototype,"thickness",2),a([Oi()],Nr.prototype,"color",2),a([Oi()],Nr.prototype,"track",2),a([Oi({type:Boolean,reflect:!0})],Nr.prototype,"decorative",2),a([Oi()],Nr.prototype,"label",2),Nr=a([mg("lui-spinner")],Nr);var xt=class extends fg{constructor(){super(...arguments);this.variant="default";this.size="md";this.radius="md";this.disabled=!1;this.loading=!1;this.iconOnly=!1;this.block=!1;this.ripple=!1;this.icon="";this.ariaLabel="";this.type="button";this._ripple=new gi(this);this._hasPrefixSlot=!1;this._hasDefaultSlot=!1;this._hasSuffixSlot=!1;this._explicitAttrs=new Set;this._onPointerDown=e=>{!this.ripple||this.disabled||this.loading||this._ripple.add(e)};this._onPrefixSlotChange=e=>{this._hasPrefixSlot=this._slotHasContent(e.currentTarget)};this._onDefaultSlotChange=e=>{this._hasDefaultSlot=this._slotHasContent(e.currentTarget)};this._onSuffixSlotChange=e=>{this._hasSuffixSlot=this._slotHasContent(e.currentTarget)}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){let t=F(this,"button");!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("ripple")&&typeof t.ripple=="boolean"&&this.ripple!==t.ripple&&(this.ripple=t.ripple),!this._explicitAttrs.has("block")&&typeof t.block=="boolean"&&this.block!==t.block&&(this.block=t.block)}_slotHasContent(e){return e.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.TEXT_NODE?!!t.textContent?.trim():t.nodeType===Node.ELEMENT_NODE)}render(){return ka`
494
+ `],a([Oi({reflect:!0})],Lr.prototype,"variant",2),a([Oi()],Lr.prototype,"size",2),a([Oi()],Lr.prototype,"thickness",2),a([Oi()],Lr.prototype,"color",2),a([Oi()],Lr.prototype,"track",2),a([Oi({type:Boolean,reflect:!0})],Lr.prototype,"decorative",2),a([Oi()],Lr.prototype,"label",2),Lr=a([mg("lui-spinner")],Lr);var xt=class extends fg{constructor(){super(...arguments);this.variant="default";this.size="md";this.radius="md";this.disabled=!1;this.loading=!1;this.iconOnly=!1;this.block=!1;this.ripple=!1;this.icon="";this.ariaLabel="";this.type="button";this._ripple=new gi(this);this._hasPrefixSlot=!1;this._hasDefaultSlot=!1;this._hasSuffixSlot=!1;this._explicitAttrs=new Set;this._onPointerDown=e=>{!this.ripple||this.disabled||this.loading||this._ripple.add(e)};this._onPrefixSlotChange=e=>{this._hasPrefixSlot=this._slotHasContent(e.currentTarget)};this._onDefaultSlotChange=e=>{this._hasDefaultSlot=this._slotHasContent(e.currentTarget)};this._onSuffixSlotChange=e=>{this._hasSuffixSlot=this._slotHasContent(e.currentTarget)}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){let t=F(this,"button");!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("ripple")&&typeof t.ripple=="boolean"&&this.ripple!==t.ripple&&(this.ripple=t.ripple),!this._explicitAttrs.has("block")&&typeof t.block=="boolean"&&this.block!==t.block&&(this.block=t.block)}_slotHasContent(e){return e.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.TEXT_NODE?!!t.textContent?.trim():t.nodeType===Node.ELEMENT_NODE)}render(){return ka`
495
495
  <button
496
496
  part="button"
497
497
  type=${this.type}
@@ -1033,7 +1033,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
1033
1033
  overflow: hidden;
1034
1034
  text-overflow: ellipsis;
1035
1035
  }
1036
- `],a([Ar({reflect:!0})],wt.prototype,"variant",2),a([Ar({reflect:!0})],wt.prototype,"size",2),a([Ar({reflect:!0})],wt.prototype,"radius",2),a([Ar({reflect:!0})],wt.prototype,"value",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"pressed",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"disabled",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"grouped",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"first",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"last",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"vertical",2),a([Ar({type:Boolean,attribute:"indicator-selected",reflect:!0})],wt.prototype,"indicatorSelected",2),a([Ar({type:Boolean,attribute:"divider-hidden",reflect:!0})],wt.prototype,"dividerHidden",2),a([Ar({type:Boolean,attribute:"interaction-active",reflect:!0})],wt.prototype,"interactionActive",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"ripple",2),wt=a([xg("lui-button-group-item")],wt);import{css as uf,html as yn,LitElement as hf,nothing as Ds}from"lit";import{customElement as pf,property as rt,query as bp,queryAll as mf,state as gf}from"lit/decorators.js";function wg(i){return i.type??"item"}function _g(i){if(i.items?.length)return i.items;if(i.children?.length)return i.children}function xa(i){return i.filter(o=>!o.hidden).map(o=>{let e=wg(o),t=_g(o),r=o.key??o.value??o.label;return{type:e,key:r,value:o.value??o.key,label:o.label,icon:o.icon,danger:o.danger,disabled:o.disabled,checked:o.checked,active:o.active,selectable:o.selectable,shortcut:o.shortcut,shortcutIcon:o.shortcutIcon,suffix:o.suffix,children:t?.length?xa(t):void 0,command:o.command,commandPayload:o.commandPayload,action:o.action,onSelect:o.onSelect,raw:o}})}function rp(i){return xa(i)}function op(i){return xa(i)}function ip(i,o){let e=i;for(let t of o){let r=e[t];if(!r?.children?.length)return[];e=r.children}return e}function mn(i,o){if(!o.length)return null;let e=i,t=null;for(let r of o){if(t=e[r]??null,!t)return null;e=t.children??[]}return t}function wa(i){return i.type!=="divider"&&i.type!=="group"&&!i.disabled&&!i.children?.length}import{html as Zr,nothing as be}from"lit";function Mg(i){return!!(i&&typeof i=="object")}function Cg(i){return/^<svg[\s>]/i.test(i.trim())}function zg(i){return/^<(path|g|circle|rect|line|polyline|polygon|ellipse)\b/i.test(i.trim())}function Eg(i){let o=i.trim();return/^(https?:\/\/|data:image\/|blob:|\/|\.\/|\.\.\/)/i.test(o)||/\.(svg|png|webp|jpe?g|gif|avif)([?#].*)?$/i.test(o)}function Hi(i,o){if(!i)return be;if(typeof i=="string"){let x=i.trim();return x?Cg(x)?Zr`<lui-icon part=${o??be} type="svg" .svg=${x}></lui-icon>`:zg(x)?Zr`<lui-icon part=${o??be} type="svg" .svgBody=${x}></lui-icon>`:Eg(x)?Zr`<lui-icon part=${o??be} type="img" src=${x}></lui-icon>`:Zr`<lui-icon part=${o??be} name=${x}></lui-icon>`:be}if(!Mg(i))return be;let e=i.svgBody??i["svg-body"]??"",t=i.type??(i.svg||e?"svg":i.src?"img":"builtin"),r=i.name??"",n=i.iconClass??i["icon-class"]??"",s=i.viewBox??i["view-box"]??"0 0 24 24",d=i.preserveAspectRatio??i["preserve-aspect-ratio"]??"xMidYMid meet",h=i.strokeWidth??i["stroke-width"],p=i.strokeLinecap??i["stroke-linecap"],f=i.strokeLinejoin??i["stroke-linejoin"];return Zr`
1036
+ `],a([Ar({reflect:!0})],wt.prototype,"variant",2),a([Ar({reflect:!0})],wt.prototype,"size",2),a([Ar({reflect:!0})],wt.prototype,"radius",2),a([Ar({reflect:!0})],wt.prototype,"value",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"pressed",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"disabled",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"grouped",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"first",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"last",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"vertical",2),a([Ar({type:Boolean,attribute:"indicator-selected",reflect:!0})],wt.prototype,"indicatorSelected",2),a([Ar({type:Boolean,attribute:"divider-hidden",reflect:!0})],wt.prototype,"dividerHidden",2),a([Ar({type:Boolean,attribute:"interaction-active",reflect:!0})],wt.prototype,"interactionActive",2),a([Ar({type:Boolean,reflect:!0})],wt.prototype,"ripple",2),wt=a([xg("lui-button-group-item")],wt);import{css as uf,html as yn,LitElement as hf,nothing as Ds}from"lit";import{customElement as pf,property as rt,query as bp,queryAll as mf,state as gf}from"lit/decorators.js";function wg(i){return i.type??"item"}function _g(i){if(i.items?.length)return i.items;if(i.children?.length)return i.children}function xa(i){return i.filter(o=>!o.hidden).map(o=>{let e=wg(o),t=_g(o),r=o.key??o.value??o.label;return{type:e,key:r,value:o.value??o.key,label:o.label,icon:o.icon,danger:o.danger,disabled:o.disabled,checked:o.checked,active:o.active,selectable:o.selectable,shortcut:o.shortcut,shortcutIcon:o.shortcutIcon,suffix:o.suffix,children:t?.length?xa(t):void 0,command:o.command,commandPayload:o.commandPayload,action:o.action,onSelect:o.onSelect,raw:o}})}function rp(i){return xa(i)}function op(i){return xa(i)}function ip(i,o){let e=i;for(let t of o){let r=e[t];if(!r?.children?.length)return[];e=r.children}return e}function mn(i,o){if(!o.length)return null;let e=i,t=null;for(let r of o){if(t=e[r]??null,!t)return null;e=t.children??[]}return t}function wa(i){return i.type!=="divider"&&i.type!=="group"&&!i.disabled&&!i.children?.length}import{html as Qr,nothing as be}from"lit";function Mg(i){return!!(i&&typeof i=="object")}function Cg(i){return/^<svg[\s>]/i.test(i.trim())}function zg(i){return/^<(path|g|circle|rect|line|polyline|polygon|ellipse)\b/i.test(i.trim())}function Eg(i){let o=i.trim();return/^(https?:\/\/|data:image\/|blob:|\/|\.\/|\.\.\/)/i.test(o)||/\.(svg|png|webp|jpe?g|gif|avif)([?#].*)?$/i.test(o)}function Hi(i,o){if(!i)return be;if(typeof i=="string"){let x=i.trim();return x?Cg(x)?Qr`<lui-icon part=${o??be} type="svg" .svg=${x}></lui-icon>`:zg(x)?Qr`<lui-icon part=${o??be} type="svg" .svgBody=${x}></lui-icon>`:Eg(x)?Qr`<lui-icon part=${o??be} type="img" src=${x}></lui-icon>`:Qr`<lui-icon part=${o??be} name=${x}></lui-icon>`:be}if(!Mg(i))return be;let e=i.svgBody??i["svg-body"]??"",t=i.type??(i.svg||e?"svg":i.src?"img":"builtin"),r=i.name??"",n=i.iconClass??i["icon-class"]??"",s=i.viewBox??i["view-box"]??"0 0 24 24",d=i.preserveAspectRatio??i["preserve-aspect-ratio"]??"xMidYMid meet",h=i.strokeWidth??i["stroke-width"],p=i.strokeLinecap??i["stroke-linecap"],f=i.strokeLinejoin??i["stroke-linejoin"];return Qr`
1037
1037
  <lui-icon
1038
1038
  part=${o??be}
1039
1039
  type=${t}
@@ -1057,17 +1057,17 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
1057
1057
  ?flip-v=${!!(i.flipV??i["flip-v"])}
1058
1058
  ?spin=${!!i.spin}
1059
1059
  ></lui-icon>
1060
- `}function Ss(i){if(!i.heading)return be;let o=i.titleClass??be,e=i.dividerClass??be,t=i.iconClass??be,r=i.spacerClass??be,n=i.labelClass??be;return Zr`
1060
+ `}function Ss(i){if(!i.heading)return be;let o=i.titleClass??be,e=i.dividerClass??be,t=i.iconClass??be,r=i.spacerClass??be,n=i.labelClass??be;return Qr`
1061
1061
  <div
1062
1062
  id=${i.id??be}
1063
1063
  part=${i.titlePart??be}
1064
1064
  class=${o}
1065
1065
  >
1066
- ${i.headingIcon?Zr`<span class=${t}>${Hi(i.headingIcon)}</span>`:Zr`<span class=${r}></span>`}
1066
+ ${i.headingIcon?Qr`<span class=${t}>${Hi(i.headingIcon)}</span>`:Qr`<span class=${r}></span>`}
1067
1067
  <span class=${n}>${i.heading}</span>
1068
1068
  </div>
1069
1069
  <div part=${i.dividerPart??be} class=${e} role="separator"></div>
1070
- `}function $s(i){return Zr`
1070
+ `}function $s(i){return Qr`
1071
1071
  <div
1072
1072
  part=${i.part??be}
1073
1073
  class=${i.className??be}
@@ -1076,12 +1076,12 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
1076
1076
  >
1077
1077
  ${i.label??""}
1078
1078
  </div>
1079
- `}function np(i={}){return Zr`<div part=${i.part??be} class=${i.className??be} role="separator"></div>`}function Ts(i,o={}){return i.checked?Hi(o.checkIconName??"check",o.checkPart):Hi(i.icon,o.iconPart)}function As(i,o={}){let e=i.shortcutIcon?Hi(i.shortcutIcon):i.shortcut??be,t=o.chevronIcon===void 0?o.chevronIconName??"chevron-right":o.chevronIcon;return o.showChevron&&t?Zr`
1079
+ `}function np(i={}){return Qr`<div part=${i.part??be} class=${i.className??be} role="separator"></div>`}function Ts(i,o={}){return i.checked?Hi(o.checkIconName??"check",o.checkPart):Hi(i.icon,o.iconPart)}function As(i,o={}){let e=i.shortcutIcon?Hi(i.shortcutIcon):i.shortcut??be,t=o.chevronIcon===void 0?o.chevronIconName??"chevron-right":o.chevronIcon;return o.showChevron&&t?Qr`
1080
1080
  ${e}
1081
1081
  <span class=${o.chevronWrapperClass??be}>
1082
1082
  ${Hi(t,o.chevronPart)}
1083
1083
  </span>
1084
- `:e}function ap(i,o={}){return Zr`
1084
+ `:e}function ap(i,o={}){return Qr`
1085
1085
  <span part=${o.leadPart??be} class=${o.leadClass??be}>
1086
1086
  ${Ts(i,{checkPart:o.checkPart,checkIconName:o.checkIconName,iconPart:o.iconPart})}
1087
1087
  </span>
@@ -1760,7 +1760,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
1760
1760
  min-width: var(--lui-menu-min-width, 200px);
1761
1761
  max-width: var(--lui-menu-max-width, 320px);
1762
1762
  }
1763
- `],a([vp({reflect:!0})],bi.prototype,"placement",2),a([vp({type:Boolean,attribute:"close-on-select"})],bi.prototype,"closeOnSelect",2),bi=a([Zg("lui-dropdown")],bi);import{css as af,html as za,LitElement as sf,nothing as lf}from"lit";import{customElement as cf,property as Vs,query as df}from"lit/decorators.js";import{css as Qg,html as Vi,LitElement as Jg,nothing as Ca}from"lit";import{customElement as ef,property as Lr}from"lit/decorators.js";var St=class extends Jg{constructor(){super(...arguments);this.disabled=!1;this.danger=!1;this.checked=!1;this.active=!1;this.label="";this.icon="";this.shortcut="";this.shortcutIcon="";this.suffix="";this.selectable=!0;this.hasChildren=!1;this._onHostClick=e=>{if(this.disabled){e.stopPropagation();return}this.selectable&&this._emitSelect(e)};this._onKey=e=>{this.disabled||!this.selectable||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),this._emitSelect(e))}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onHostClick),this.addEventListener("keydown",this._onKey),this._syncA11y()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onHostClick),this.removeEventListener("keydown",this._onKey)}updated(e){this._syncA11y()}_syncA11y(){if(this.setAttribute("role",this.checked?"menuitemcheckbox":"menuitem"),this.checked?this.setAttribute("aria-checked","true"):this.removeAttribute("aria-checked"),this.active?this.setAttribute("aria-current","true"):this.removeAttribute("aria-current"),this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.disabled){this.tabIndex=-1;return}!this.closest("lui-menu")&&this.tabIndex<0&&(this.tabIndex=0)}_emitSelect(e){this.dispatchEvent(new CustomEvent("select",{detail:{value:this.value,label:this.label,originalEvent:e,item:this},bubbles:!0,composed:!0}))}_renderLabel(){return this.label?this.label:Vi`<slot></slot>`}_hasNamedSlot(e){return Array.from(this.children).some(t=>t.getAttribute("slot")===e)}_renderResolvedIcon(){return this.checked?Vi`<lui-icon name="check"></lui-icon>`:this.icon?Vi`<lui-icon name=${this.icon}></lui-icon>`:Ca}_renderIcon(){let e=this._hasNamedSlot("icon")||this._hasNamedSlot("prefix");return Vi`
1763
+ `],a([vp({reflect:!0})],bi.prototype,"placement",2),a([vp({type:Boolean,attribute:"close-on-select"})],bi.prototype,"closeOnSelect",2),bi=a([Zg("lui-dropdown")],bi);import{css as af,html as za,LitElement as sf,nothing as lf}from"lit";import{customElement as cf,property as Vs,query as df}from"lit/decorators.js";import{css as Qg,html as Vi,LitElement as Jg,nothing as Ca}from"lit";import{customElement as ef,property as Br}from"lit/decorators.js";var St=class extends Jg{constructor(){super(...arguments);this.disabled=!1;this.danger=!1;this.checked=!1;this.active=!1;this.label="";this.icon="";this.shortcut="";this.shortcutIcon="";this.suffix="";this.selectable=!0;this.hasChildren=!1;this._onHostClick=e=>{if(this.disabled){e.stopPropagation();return}this.selectable&&this._emitSelect(e)};this._onKey=e=>{this.disabled||!this.selectable||(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),e.stopPropagation(),this._emitSelect(e))}}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this._onHostClick),this.addEventListener("keydown",this._onKey),this._syncA11y()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this._onHostClick),this.removeEventListener("keydown",this._onKey)}updated(e){this._syncA11y()}_syncA11y(){if(this.setAttribute("role",this.checked?"menuitemcheckbox":"menuitem"),this.checked?this.setAttribute("aria-checked","true"):this.removeAttribute("aria-checked"),this.active?this.setAttribute("aria-current","true"):this.removeAttribute("aria-current"),this.setAttribute("aria-disabled",this.disabled?"true":"false"),this.disabled){this.tabIndex=-1;return}!this.closest("lui-menu")&&this.tabIndex<0&&(this.tabIndex=0)}_emitSelect(e){this.dispatchEvent(new CustomEvent("select",{detail:{value:this.value,label:this.label,originalEvent:e,item:this},bubbles:!0,composed:!0}))}_renderLabel(){return this.label?this.label:Vi`<slot></slot>`}_hasNamedSlot(e){return Array.from(this.children).some(t=>t.getAttribute("slot")===e)}_renderResolvedIcon(){return this.checked?Vi`<lui-icon name="check"></lui-icon>`:this.icon?Vi`<lui-icon name=${this.icon}></lui-icon>`:Ca}_renderIcon(){let e=this._hasNamedSlot("icon")||this._hasNamedSlot("prefix");return Vi`
1764
1764
  <span part="icon">
1765
1765
  <slot name="icon"></slot>
1766
1766
  <slot name="prefix"></slot>
@@ -1876,7 +1876,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
1876
1876
  :host([danger]) [part="item"]:hover:not(.disabled) {
1877
1877
  background: var(--lui-color-danger-soft);
1878
1878
  }
1879
- `],a([Lr({type:Boolean,reflect:!0})],St.prototype,"disabled",2),a([Lr({type:Boolean,reflect:!0})],St.prototype,"danger",2),a([Lr({type:Boolean,reflect:!0})],St.prototype,"checked",2),a([Lr({type:Boolean,reflect:!0})],St.prototype,"active",2),a([Lr()],St.prototype,"value",2),a([Lr()],St.prototype,"label",2),a([Lr()],St.prototype,"icon",2),a([Lr()],St.prototype,"shortcut",2),a([Lr({attribute:"shortcut-icon"})],St.prototype,"shortcutIcon",2),a([Lr()],St.prototype,"suffix",2),a([Lr({type:Boolean,reflect:!0})],St.prototype,"selectable",2),a([Lr({type:Boolean,attribute:"has-children",reflect:!0})],St.prototype,"hasChildren",2),a([Lr({attribute:"submenu-icon"})],St.prototype,"submenuIcon",2),St=a([ef("lui-menu-item")],St);import{css as tf,html as rf,LitElement as of}from"lit";import{customElement as nf}from"lit/decorators.js";var bn=class extends of{connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}render(){return rf``}};bn.styles=[A,O,tf`
1879
+ `],a([Br({type:Boolean,reflect:!0})],St.prototype,"disabled",2),a([Br({type:Boolean,reflect:!0})],St.prototype,"danger",2),a([Br({type:Boolean,reflect:!0})],St.prototype,"checked",2),a([Br({type:Boolean,reflect:!0})],St.prototype,"active",2),a([Br()],St.prototype,"value",2),a([Br()],St.prototype,"label",2),a([Br()],St.prototype,"icon",2),a([Br()],St.prototype,"shortcut",2),a([Br({attribute:"shortcut-icon"})],St.prototype,"shortcutIcon",2),a([Br()],St.prototype,"suffix",2),a([Br({type:Boolean,reflect:!0})],St.prototype,"selectable",2),a([Br({type:Boolean,attribute:"has-children",reflect:!0})],St.prototype,"hasChildren",2),a([Br({attribute:"submenu-icon"})],St.prototype,"submenuIcon",2),St=a([ef("lui-menu-item")],St);import{css as tf,html as rf,LitElement as of}from"lit";import{customElement as nf}from"lit/decorators.js";var bn=class extends of{connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}render(){return rf``}};bn.styles=[A,O,tf`
1880
1880
  :host {
1881
1881
  display: block;
1882
1882
  height: 1px;
@@ -4073,7 +4073,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
4073
4073
  font-variant-numeric: tabular-nums;
4074
4074
  white-space: nowrap;
4075
4075
  }
4076
- `],a([$t()],Ce.prototype,"value",2),a([$t()],Ce.prototype,"placeholder",2),a([$t({attribute:"search-placeholder"})],Ce.prototype,"searchPlaceholder",2),a([$t({attribute:"empty-text"})],Ce.prototype,"emptyText",2),a([$t({reflect:!0})],Ce.prototype,"size",2),a([$t({type:Boolean,reflect:!0})],Ce.prototype,"disabled",2),a([$t({type:Boolean,reflect:!0})],Ce.prototype,"clearable",2),a([$t({type:Boolean,reflect:!0})],Ce.prototype,"searchable",2),a([$t()],Ce.prototype,"locale",2),a([$t({attribute:!1})],Ce.prototype,"translations",2),a([$t({type:Boolean,reflect:!0})],Ce.prototype,"open",2),a([$t()],Ce.prototype,"type",2),a([$t({type:Number})],Ce.prototype,"columns",2),a([$t({type:Number,attribute:"max-height"})],Ce.prototype,"maxHeight",2),a([$t({type:Number,attribute:"page-size"})],Ce.prototype,"pageSize",2),a([$t({attribute:!1})],Ce.prototype,"source",2),a([$t({attribute:!1})],Ce.prototype,"triggerProps",2),a([$t({attribute:!1})],Ce.prototype,"dropdownProps",2),a([$t({attribute:!1})],Ce.prototype,"paginationProps",2),a([Zs()],Ce.prototype,"_keyword",2),a([Zs()],Ce.prototype,"_activeCategory",2),a([Zs()],Ce.prototype,"_activeValue",2),a([Zs()],Ce.prototype,"_currentPage",2),a([Xs("lui-dropdown")],Ce.prototype,"_dropdown",2),a([Xs("button.trigger")],Ce.prototype,"_triggerEl",2),a([Gf("lui-pagination")],Ce.prototype,"_paginationEls",2),a([Xs(".search-input")],Ce.prototype,"_searchInput",2),a([Xs(".grid-wrap")],Ce.prototype,"_gridWrap",2),Ce=a([Uf("lui-icon-picker")],Ce);var el=da(_n(),1);import{css as Fp,html as q,LitElement as Np,nothing as ze}from"lit";import{customElement as Lp,property as Y,query as Dp,queryAssignedElements as sv,state as Qs}from"lit/decorators.js";import{repeat as Js}from"lit/directives/repeat.js";function Mn(i,o,e,t){var r=arguments.length,n=r<3?o:t===null?t=Object.getOwnPropertyDescriptor(o,e):t,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,o,e,t);else for(var d=i.length-1;d>=0;d--)(s=i[d])&&(n=(r<3?s(n):r>3?s(o,e,n):s(o,e))||n);return r>3&&n&&Object.defineProperty(o,e,n),n}import{html as Zf,LitElement as Qf}from"lit";import{property as Aa}from"lit/decorators/property.js";var Xo=class extends Qf{constructor(){super(...arguments),this.items=[],this.renderItem=Vc,this.keyFunction=Ic,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){let{items:o,renderItem:e,keyFunction:t,layout:r,scroller:n}=this;return Zf`${ki({items:o,renderItem:e,keyFunction:t,layout:r,scroller:n})}`}element(o){return this[Di]?.element(o)}get layoutComplete(){return this[Di]?.layoutComplete}scrollToIndex(o,e="start"){this.element(o)?.scrollIntoView({block:e})}};Mn([Aa({attribute:!1})],Xo.prototype,"items",void 0);Mn([Aa()],Xo.prototype,"renderItem",void 0);Mn([Aa()],Xo.prototype,"keyFunction",void 0);Mn([Aa({attribute:!1})],Xo.prototype,"layout",void 0);Mn([Aa({reflect:!0,type:Boolean})],Xo.prototype,"scroller",void 0);customElements.define("lit-virtualizer",Xo);import{css as Jf,html as qi,LitElement as ev,nothing as Bc}from"lit";import{customElement as tv,property as Br,query as rv}from"lit/decorators.js";var _t=class extends ev{constructor(){super(...arguments);this.checked=!1;this.disabled=!1;this.indeterminate=!1;this.radius="md";this.size="md";this.checkedIcon="check";this.indeterminateIcon="minus";this._onKeyDown=e=>{this.disabled||(e.key===" "||e.key==="Enter")&&(e.preventDefault(),this._toggle())}}connectedCallback(){super.connectedCallback(),this._disposeLocaleChange=ye(()=>this.requestUpdate()),this._lightDomObserver=new MutationObserver(()=>this.requestUpdate()),this._lightDomObserver.observe(this,{childList:!0,subtree:!1,characterData:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.(),this._lightDomObserver?.disconnect()}_t(e,t){return ne(ie(this.locale,this.translations),e,t)}_hasNamedSlot(e){return Array.from(this.children).some(t=>t.getAttribute("slot")===e)}_hasDefaultContent(){return Array.from(this.childNodes).some(e=>e.nodeType===Node.TEXT_NODE?(e.textContent??"").trim().length>0:e instanceof HTMLElement?!e.hasAttribute("slot"):!1)}focus(){this._input?.focus()}blur(){this._input?.blur()}_toggle(){this.disabled||(this.indeterminate?(this.indeterminate=!1,this.checked=!0):this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked,indeterminate:this.indeterminate,value:this.value},bubbles:!0,composed:!0})))}_currentIconName(){return this.indeterminate?this.indeterminateIcon:this.checkedIcon}_renderIcon(){let e=this._hasNamedSlot("icon"),t=this._currentIconName();return qi`
4076
+ `],a([$t()],Ce.prototype,"value",2),a([$t()],Ce.prototype,"placeholder",2),a([$t({attribute:"search-placeholder"})],Ce.prototype,"searchPlaceholder",2),a([$t({attribute:"empty-text"})],Ce.prototype,"emptyText",2),a([$t({reflect:!0})],Ce.prototype,"size",2),a([$t({type:Boolean,reflect:!0})],Ce.prototype,"disabled",2),a([$t({type:Boolean,reflect:!0})],Ce.prototype,"clearable",2),a([$t({type:Boolean,reflect:!0})],Ce.prototype,"searchable",2),a([$t()],Ce.prototype,"locale",2),a([$t({attribute:!1})],Ce.prototype,"translations",2),a([$t({type:Boolean,reflect:!0})],Ce.prototype,"open",2),a([$t()],Ce.prototype,"type",2),a([$t({type:Number})],Ce.prototype,"columns",2),a([$t({type:Number,attribute:"max-height"})],Ce.prototype,"maxHeight",2),a([$t({type:Number,attribute:"page-size"})],Ce.prototype,"pageSize",2),a([$t({attribute:!1})],Ce.prototype,"source",2),a([$t({attribute:!1})],Ce.prototype,"triggerProps",2),a([$t({attribute:!1})],Ce.prototype,"dropdownProps",2),a([$t({attribute:!1})],Ce.prototype,"paginationProps",2),a([Zs()],Ce.prototype,"_keyword",2),a([Zs()],Ce.prototype,"_activeCategory",2),a([Zs()],Ce.prototype,"_activeValue",2),a([Zs()],Ce.prototype,"_currentPage",2),a([Xs("lui-dropdown")],Ce.prototype,"_dropdown",2),a([Xs("button.trigger")],Ce.prototype,"_triggerEl",2),a([Gf("lui-pagination")],Ce.prototype,"_paginationEls",2),a([Xs(".search-input")],Ce.prototype,"_searchInput",2),a([Xs(".grid-wrap")],Ce.prototype,"_gridWrap",2),Ce=a([Uf("lui-icon-picker")],Ce);var el=da(_n(),1);import{css as Fp,html as q,LitElement as Np,nothing as ze}from"lit";import{customElement as Lp,property as Y,query as Dp,queryAssignedElements as sv,state as Qs}from"lit/decorators.js";import{repeat as Js}from"lit/directives/repeat.js";function Mn(i,o,e,t){var r=arguments.length,n=r<3?o:t===null?t=Object.getOwnPropertyDescriptor(o,e):t,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(i,o,e,t);else for(var d=i.length-1;d>=0;d--)(s=i[d])&&(n=(r<3?s(n):r>3?s(o,e,n):s(o,e))||n);return r>3&&n&&Object.defineProperty(o,e,n),n}import{html as Zf,LitElement as Qf}from"lit";import{property as Aa}from"lit/decorators/property.js";var Xo=class extends Qf{constructor(){super(...arguments),this.items=[],this.renderItem=Vc,this.keyFunction=Ic,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){let{items:o,renderItem:e,keyFunction:t,layout:r,scroller:n}=this;return Zf`${ki({items:o,renderItem:e,keyFunction:t,layout:r,scroller:n})}`}element(o){return this[Di]?.element(o)}get layoutComplete(){return this[Di]?.layoutComplete}scrollToIndex(o,e="start"){this.element(o)?.scrollIntoView({block:e})}};Mn([Aa({attribute:!1})],Xo.prototype,"items",void 0);Mn([Aa()],Xo.prototype,"renderItem",void 0);Mn([Aa()],Xo.prototype,"keyFunction",void 0);Mn([Aa({attribute:!1})],Xo.prototype,"layout",void 0);Mn([Aa({reflect:!0,type:Boolean})],Xo.prototype,"scroller",void 0);customElements.define("lit-virtualizer",Xo);import{css as Jf,html as qi,LitElement as ev,nothing as Bc}from"lit";import{customElement as tv,property as qr,query as rv}from"lit/decorators.js";var _t=class extends ev{constructor(){super(...arguments);this.checked=!1;this.disabled=!1;this.indeterminate=!1;this.radius="md";this.size="md";this.checkedIcon="check";this.indeterminateIcon="minus";this._onKeyDown=e=>{this.disabled||(e.key===" "||e.key==="Enter")&&(e.preventDefault(),this._toggle())}}connectedCallback(){super.connectedCallback(),this._disposeLocaleChange=ye(()=>this.requestUpdate()),this._lightDomObserver=new MutationObserver(()=>this.requestUpdate()),this._lightDomObserver.observe(this,{childList:!0,subtree:!1,characterData:!0,attributes:!0,attributeFilter:["slot"]})}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.(),this._lightDomObserver?.disconnect()}_t(e,t){return ne(ie(this.locale,this.translations),e,t)}_hasNamedSlot(e){return Array.from(this.children).some(t=>t.getAttribute("slot")===e)}_hasDefaultContent(){return Array.from(this.childNodes).some(e=>e.nodeType===Node.TEXT_NODE?(e.textContent??"").trim().length>0:e instanceof HTMLElement?!e.hasAttribute("slot"):!1)}focus(){this._input?.focus()}blur(){this._input?.blur()}_toggle(){this.disabled||(this.indeterminate?(this.indeterminate=!1,this.checked=!0):this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked,indeterminate:this.indeterminate,value:this.value},bubbles:!0,composed:!0})))}_currentIconName(){return this.indeterminate?this.indeterminateIcon:this.checkedIcon}_renderIcon(){let e=this._hasNamedSlot("icon"),t=this._currentIconName();return qi`
4077
4077
  <span class="icon" part="icon">
4078
4078
  <slot name="icon"></slot>
4079
4079
  ${!e&&t?qi`<lui-icon name=${t}></lui-icon>`:Bc}
@@ -4262,7 +4262,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
4262
4262
  animation: none;
4263
4263
  }
4264
4264
  }
4265
- `],a([Br({type:Boolean,reflect:!0})],_t.prototype,"checked",2),a([Br({type:Boolean,reflect:!0})],_t.prototype,"disabled",2),a([Br({type:Boolean,reflect:!0})],_t.prototype,"indeterminate",2),a([Br({reflect:!0})],_t.prototype,"radius",2),a([Br({reflect:!0})],_t.prototype,"size",2),a([Br()],_t.prototype,"name",2),a([Br()],_t.prototype,"value",2),a([Br()],_t.prototype,"label",2),a([Br()],_t.prototype,"description",2),a([Br({attribute:"checked-icon"})],_t.prototype,"checkedIcon",2),a([Br({attribute:"indeterminate-icon"})],_t.prototype,"indeterminateIcon",2),a([Br()],_t.prototype,"locale",2),a([Br({attribute:!1})],_t.prototype,"translations",2),a([rv("input")],_t.prototype,"_input",2),_t=a([tv("lui-checkbox")],_t);import{css as ov,html as qc,LitElement as iv,nothing as Vp}from"lit";import{customElement as nv,property as Pa,query as av}from"lit/decorators.js";var Qr=class extends iv{constructor(){super(...arguments);this.icon="folder";this.title="";this.heading="";this.description="";this.iconProps={}}updated(){let e=F(this,"emptyState");oe(this._iconEl,{...e.iconProps??{},...this.iconProps??{}})}render(){let e=this.title||this.heading;return qc`
4265
+ `],a([qr({type:Boolean,reflect:!0})],_t.prototype,"checked",2),a([qr({type:Boolean,reflect:!0})],_t.prototype,"disabled",2),a([qr({type:Boolean,reflect:!0})],_t.prototype,"indeterminate",2),a([qr({reflect:!0})],_t.prototype,"radius",2),a([qr({reflect:!0})],_t.prototype,"size",2),a([qr()],_t.prototype,"name",2),a([qr()],_t.prototype,"value",2),a([qr()],_t.prototype,"label",2),a([qr()],_t.prototype,"description",2),a([qr({attribute:"checked-icon"})],_t.prototype,"checkedIcon",2),a([qr({attribute:"indeterminate-icon"})],_t.prototype,"indeterminateIcon",2),a([qr()],_t.prototype,"locale",2),a([qr({attribute:!1})],_t.prototype,"translations",2),a([rv("input")],_t.prototype,"_input",2),_t=a([tv("lui-checkbox")],_t);import{css as ov,html as qc,LitElement as iv,nothing as Vp}from"lit";import{customElement as nv,property as Pa,query as av}from"lit/decorators.js";var Jr=class extends iv{constructor(){super(...arguments);this.icon="folder";this.title="";this.heading="";this.description="";this.iconProps={}}updated(){let e=F(this,"emptyState");oe(this._iconEl,{...e.iconProps??{},...this.iconProps??{}})}render(){let e=this.title||this.heading;return qc`
4266
4266
  <div class="state" part="state">
4267
4267
  <div class="icon-shell" part="icon-shell">
4268
4268
  <slot name="icon">
@@ -4278,7 +4278,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
4278
4278
  <slot name="actions"></slot>
4279
4279
  </div>
4280
4280
  </div>
4281
- `}};Qr.styles=[A,O,ov`
4281
+ `}};Jr.styles=[A,O,ov`
4282
4282
  :host {
4283
4283
  display: block;
4284
4284
  --lui-empty-state-radius: var(--lui-radius-lg);
@@ -4377,7 +4377,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
4377
4377
  --lui-button-hover-border: var(--lui-color-border-strong);
4378
4378
  --lui-button-hover-fg: var(--lui-color-fg);
4379
4379
  }
4380
- `],a([Pa()],Qr.prototype,"icon",2),a([Pa()],Qr.prototype,"title",2),a([Pa()],Qr.prototype,"heading",2),a([Pa()],Qr.prototype,"description",2),a([Pa({attribute:!1})],Qr.prototype,"iconProps",2),a([av(".icon-shell lui-icon")],Qr.prototype,"_iconEl",2),Qr=a([nv("lui-empty-state")],Qr);var zn={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1600};function Jr(i){return i==null||i===""?"":mt(i)}function Kc(i){if(i==null||i==="")return;if(typeof i=="number")return Number.isFinite(i)?i:void 0;let o=Number.parseFloat(i);return Number.isFinite(o)?o:void 0}function Cn(i,o){if(o)return o.split(".").reduce((e,t)=>{if(!(e==null||typeof e!="object"))return e[t]},i)}function lv(i,o){return i==null&&o==null?0:i==null?-1:o==null?1:typeof i=="number"&&typeof o=="number"?i-o:String(i).localeCompare(String(o),void 0,{numeric:!0,sensitivity:"base"})}function cv(i){if(i==null)return"";if(i instanceof Date)return i.toLocaleString();if(typeof i=="object")try{return JSON.stringify(i)}catch{return String(i)}return i}function Bp(i){let e=(Array.isArray(i)?i:typeof i=="string"?i.split(/[\s,|]+/).filter(Boolean):[]).map(t=>String(t).trim().toLowerCase()).filter(t=>t in zn);return e.length?Array.from(new Set(e)):void 0}function dv(i){return i>=zn.xxl?"xxl":i>=zn.xl?"xl":i>=zn.lg?"lg":i>=zn.md?"md":i>=zn.sm?"sm":"xs"}var qt=class extends Np{constructor(){super(...arguments);this.key="";this.dataIndex="";this.title="";this.width="";this.minWidth="";this.responsive="";this.align="left";this.fixed="";this.sortable=!1;this.resizable=!1;this.reorderable=!1}toColumn(){return{key:this.key||this.dataIndex||this.title,dataIndex:this.dataIndex||this.key,title:this.title,width:this.width,minWidth:this.minWidth,responsive:Bp(this.responsive),align:this.align,fixed:this.hasAttribute("fixed")?this.fixed==="right"?"right":"left":void 0,sortable:this.sortable,resizable:this.hasAttribute("resizable")?this.resizable:void 0,reorderable:this.hasAttribute("reorderable")?this.reorderable:void 0}}render(){return ze}};qt.styles=Fp`:host{display:none;}`,a([Y()],qt.prototype,"key",2),a([Y({attribute:"data-index"})],qt.prototype,"dataIndex",2),a([Y()],qt.prototype,"title",2),a([Y()],qt.prototype,"width",2),a([Y({attribute:"min-width"})],qt.prototype,"minWidth",2),a([Y()],qt.prototype,"responsive",2),a([Y({reflect:!0})],qt.prototype,"align",2),a([Y()],qt.prototype,"fixed",2),a([Y({type:Boolean,reflect:!0})],qt.prototype,"sortable",2),a([Y({type:Boolean,reflect:!0})],qt.prototype,"resizable",2),a([Y({type:Boolean,reflect:!0})],qt.prototype,"reorderable",2),qt=a([Lp("lui-table-column")],qt);var U=class extends Np{constructor(){super(...arguments);this.rowKey="key";this.size="md";this.selection="none";this.selectedRowKeys=[];this.bordered=!1;this.border=!1;this.noBorder=!1;this.striped=!1;this.hoverable=!0;this.stickyHeader=!1;this.showHeader=!0;this.columnResizable=!1;this.resizeMode="adaptive";this.columnReorderable=!1;this.loading=!1;this.virtual=!1;this.virtualHeight=360;this.overscan=6;this.pagination=!1;this.remotePagination=!1;this.current=1;this.pageSize=10;this.showSizeChanger=!1;this.showSeq=!1;this.seqLabel="\u5E8F\u53F7";this.showOverflow=!1;this.showHeaderOverflow=!1;this.emptyText="\u6682\u65E0\u6570\u636E";this.sortKey="";this.sortOrder="none";this.rowClickable=!1;this.selectOnClick=!1;this.rowAnimation="auto";this._responsiveWidth=0;this._internalSelectedRowKeys=[];this._columnWidthOverrides={};this._columnOrderKeys=[];this._virtualStart=0;this._scrollTop=0;this._scrollRaf=0;this._gutterRaf=0;this._resizeRaf=0;this._columnInteractRaf=0;this._columnInteractDisposers=[];this._columnDragGhost=null;this._leavingRows=[];this._enteringRowKeys=new Set;this._rowAnimationTimers=[];this._lastRangeKey="";this._activeRows=[];this._activeColumns=[];this._activeFixedMeta=[];this._columnResizeState=null;this._lastResizedColumnKey="";this._columnDraggedAt=0;this._activeEffectiveWidths=null;this._columnDragState=null;this._explicitAttrs=new Set;this._onScroll=e=>{let t=e.currentTarget;if(this._syncHorizontalScrollVars(t),!this.virtual)return;let r=t.scrollTop;this._scrollTop=r,!this._scrollRaf&&(this._scrollRaf=requestAnimationFrame(()=>{this._scrollRaf=0;let n=this._calculateVirtualStart(this._scrollTop);n!==this._virtualStart&&(this._virtualStart=n)}))};this._onCellMouseOver=e=>{if(!this.showOverflow&&!this.showHeaderOverflow)return;let t=e.target;if(!(t instanceof HTMLElement))return;let r=t.closest(".cell");if(!r)return;if(!(!!t.closest("th, .vhead-cell")?this.showHeaderOverflow:this.showOverflow)){r.title="";return}let d=(r.textContent??"").trim();r.title=d&&r.scrollWidth>r.clientWidth+1?d:""};this._onPageChange=e=>{let t=Number(e.detail?.current),r=Number(e.detail?.pageSize);!Number.isFinite(t)||!Number.isFinite(r)||(this.current=Math.max(1,Math.floor(t)),this.pageSize=Math.max(1,Math.floor(r)),this.dispatchEvent(new CustomEvent("page-change",{detail:{current:this.current,pageSize:this.pageSize,total:this._totalRows()},bubbles:!0,composed:!0})))};this._renderLitVirtualRow=e=>{let{row:t,index:r}=e,n=this._activeColumns.length?this._activeColumns:this._responsiveColumns(this._orderedColumns(this._columns())),s=this._activeFixedMeta.length?this._activeFixedMeta:this._fixedMeta(n),d=this._getRowKey(t,r),h=this._selectedKeys().some(p=>String(p)===String(d));return q`
4380
+ `],a([Pa()],Jr.prototype,"icon",2),a([Pa()],Jr.prototype,"title",2),a([Pa()],Jr.prototype,"heading",2),a([Pa()],Jr.prototype,"description",2),a([Pa({attribute:!1})],Jr.prototype,"iconProps",2),a([av(".icon-shell lui-icon")],Jr.prototype,"_iconEl",2),Jr=a([nv("lui-empty-state")],Jr);var zn={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1600};function Or(i){return i==null||i===""?"":mt(i)}function Kc(i){if(i==null||i==="")return;if(typeof i=="number")return Number.isFinite(i)?i:void 0;let o=Number.parseFloat(i);return Number.isFinite(o)?o:void 0}function Cn(i,o){if(o)return o.split(".").reduce((e,t)=>{if(!(e==null||typeof e!="object"))return e[t]},i)}function lv(i,o){return i==null&&o==null?0:i==null?-1:o==null?1:typeof i=="number"&&typeof o=="number"?i-o:String(i).localeCompare(String(o),void 0,{numeric:!0,sensitivity:"base"})}function cv(i){if(i==null)return"";if(i instanceof Date)return i.toLocaleString();if(typeof i=="object")try{return JSON.stringify(i)}catch{return String(i)}return i}function Bp(i){let e=(Array.isArray(i)?i:typeof i=="string"?i.split(/[\s,|]+/).filter(Boolean):[]).map(t=>String(t).trim().toLowerCase()).filter(t=>t in zn);return e.length?Array.from(new Set(e)):void 0}function dv(i){return i>=zn.xxl?"xxl":i>=zn.xl?"xl":i>=zn.lg?"lg":i>=zn.md?"md":i>=zn.sm?"sm":"xs"}var qt=class extends Np{constructor(){super(...arguments);this.key="";this.dataIndex="";this.title="";this.width="";this.minWidth="";this.responsive="";this.align="left";this.fixed="";this.sortable=!1;this.resizable=!1;this.reorderable=!1}toColumn(){return{key:this.key||this.dataIndex||this.title,dataIndex:this.dataIndex||this.key,title:this.title,width:this.width,minWidth:this.minWidth,responsive:Bp(this.responsive),align:this.align,fixed:this.hasAttribute("fixed")?this.fixed==="right"?"right":"left":void 0,sortable:this.sortable,resizable:this.hasAttribute("resizable")?this.resizable:void 0,reorderable:this.hasAttribute("reorderable")?this.reorderable:void 0}}render(){return ze}};qt.styles=Fp`:host{display:none;}`,a([Y()],qt.prototype,"key",2),a([Y({attribute:"data-index"})],qt.prototype,"dataIndex",2),a([Y()],qt.prototype,"title",2),a([Y()],qt.prototype,"width",2),a([Y({attribute:"min-width"})],qt.prototype,"minWidth",2),a([Y()],qt.prototype,"responsive",2),a([Y({reflect:!0})],qt.prototype,"align",2),a([Y()],qt.prototype,"fixed",2),a([Y({type:Boolean,reflect:!0})],qt.prototype,"sortable",2),a([Y({type:Boolean,reflect:!0})],qt.prototype,"resizable",2),a([Y({type:Boolean,reflect:!0})],qt.prototype,"reorderable",2),qt=a([Lp("lui-table-column")],qt);var U=class extends Np{constructor(){super(...arguments);this.rowKey="key";this.size="md";this.selection="none";this.selectedRowKeys=[];this.bordered=!1;this.border=!1;this.noBorder=!1;this.striped=!1;this.hoverable=!0;this.stickyHeader=!1;this.showHeader=!0;this.columnResizable=!1;this.resizeMode="adaptive";this.columnReorderable=!1;this.loading=!1;this.virtual=!1;this.virtualHeight=360;this.overscan=6;this.pagination=!1;this.remotePagination=!1;this.current=1;this.pageSize=10;this.showSizeChanger=!1;this.showSeq=!1;this.seqLabel="\u5E8F\u53F7";this.showOverflow=!1;this.showHeaderOverflow=!1;this.emptyText="\u6682\u65E0\u6570\u636E";this.sortKey="";this.sortOrder="none";this.rowClickable=!1;this.selectOnClick=!1;this.rowAnimation="auto";this._responsiveWidth=0;this._internalSelectedRowKeys=[];this._columnWidthOverrides={};this._columnOrderKeys=[];this._virtualStart=0;this._scrollTop=0;this._scrollRaf=0;this._gutterRaf=0;this._resizeRaf=0;this._columnInteractRaf=0;this._columnInteractDisposers=[];this._columnDragGhost=null;this._leavingRows=[];this._enteringRowKeys=new Set;this._rowAnimationTimers=[];this._lastRangeKey="";this._activeRows=[];this._activeColumns=[];this._activeFixedMeta=[];this._columnResizeState=null;this._lastResizedColumnKey="";this._columnDraggedAt=0;this._activeEffectiveWidths=null;this._columnDragState=null;this._explicitAttrs=new Set;this._onScroll=e=>{let t=e.currentTarget;if(this._syncHorizontalScrollVars(t),!this.virtual)return;let r=t.scrollTop;this._scrollTop=r,!this._scrollRaf&&(this._scrollRaf=requestAnimationFrame(()=>{this._scrollRaf=0;let n=this._calculateVirtualStart(this._scrollTop);n!==this._virtualStart&&(this._virtualStart=n)}))};this._onCellMouseOver=e=>{if(!this.showOverflow&&!this.showHeaderOverflow)return;let t=e.target;if(!(t instanceof HTMLElement))return;let r=t.closest(".cell");if(!r)return;if(!(!!t.closest("th, .vhead-cell")?this.showHeaderOverflow:this.showOverflow)){r.title="";return}let d=(r.textContent??"").trim();r.title=d&&r.scrollWidth>r.clientWidth+1?d:""};this._onPageChange=e=>{let t=Number(e.detail?.current),r=Number(e.detail?.pageSize);!Number.isFinite(t)||!Number.isFinite(r)||(this.current=Math.max(1,Math.floor(t)),this.pageSize=Math.max(1,Math.floor(r)),this.dispatchEvent(new CustomEvent("page-change",{detail:{current:this.current,pageSize:this.pageSize,total:this._totalRows()},bubbles:!0,composed:!0})))};this._renderLitVirtualRow=e=>{let{row:t,index:r}=e,n=this._activeColumns.length?this._activeColumns:this._responsiveColumns(this._orderedColumns(this._columns())),s=this._activeFixedMeta.length?this._activeFixedMeta:this._fixedMeta(n),d=this._getRowKey(t,r),h=this._selectedKeys().some(p=>String(p)===String(d));return q`
4381
4381
  <div
4382
4382
  class=${`lvrow ${r%2===1?"even":""} ${h?"selected":""} ${this.rowClickable||this.selectOnClick?"clickable":""}`}
4383
4383
  role="row"
@@ -4416,7 +4416,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
4416
4416
  </div>
4417
4417
  `})}
4418
4418
  </div>
4419
- `};this._virtualKey=e=>this._getRowKey(e.row,e.index);this._skeletonWidths=["62%","78%","45%","70%","55%","82%"]}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._applyVirtualStyles();let e=typeof window<"u"?window.innerWidth:0;this._responsiveWidth=Math.round(this.getBoundingClientRect().width||e||0),this._responsiveResizeObserver=new ResizeObserver(t=>{let r=t[0],n=typeof window<"u"?window.innerWidth:0,s=Math.round(r?.contentRect.width||this.getBoundingClientRect().width||n||0);s>0&&s!==this._responsiveWidth&&(this._responsiveWidth=s)}),this._responsiveResizeObserver.observe(this)}disconnectedCallback(){this._endColumnResize(),this._endColumnReorder(),this._removeColumnDragGhost(),this._teardownColumnInteractions(),this._clearRowAnimationTimers(),this._scrollRaf&&cancelAnimationFrame(this._scrollRaf),this._gutterRaf&&cancelAnimationFrame(this._gutterRaf),this._resizeRaf&&cancelAnimationFrame(this._resizeRaf),this._columnInteractRaf&&cancelAnimationFrame(this._columnInteractRaf),this._responsiveResizeObserver?.disconnect(),this._responsiveResizeObserver=void 0,this._scrollRaf=0,this._gutterRaf=0,this._resizeRaf=0,this._columnInteractRaf=0,super.disconnectedCallback()}willUpdate(e){e.has("selectedRowKeys")&&(this._internalSelectedRowKeys=[...this.selectedRowKeys??[]]),e.has("columnWidths")&&this.columnWidths&&this._applyColumnWidthOverrides({...this.columnWidths}),(e.has("data")||e.has("dataSource")||e.has("source"))&&this._prepareRowAnimations();let t=F(this,"table");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("bordered")&&typeof t.bordered=="boolean"&&this.bordered!==t.bordered&&(this.bordered=t.bordered),!this._explicitAttrs.has("border")&&typeof t.border=="boolean"&&this.border!==t.border&&(this.border=t.border),!this._explicitAttrs.has("noborder")&&typeof t.noBorder=="boolean"&&this.noBorder!==t.noBorder&&(this.noBorder=t.noBorder),!this._explicitAttrs.has("striped")&&typeof t.striped=="boolean"&&this.striped!==t.striped&&(this.striped=t.striped),!this._explicitAttrs.has("hoverable")&&typeof t.hoverable=="boolean"&&this.hoverable!==t.hoverable&&(this.hoverable=t.hoverable),!this._explicitAttrs.has("column-resizable")&&typeof t.columnResizable=="boolean"&&this.columnResizable!==t.columnResizable&&(this.columnResizable=t.columnResizable),!this._explicitAttrs.has("column-reorderable")&&typeof t.columnReorderable=="boolean"&&this.columnReorderable!==t.columnReorderable&&(this.columnReorderable=t.columnReorderable),!this._explicitAttrs.has("selection")&&typeof t.selection=="string"&&this.selection!==t.selection&&(this.selection=t.selection),!this._explicitAttrs.has("select-on-click")&&typeof t.selectOnClick=="boolean"&&this.selectOnClick!==t.selectOnClick&&(this.selectOnClick=t.selectOnClick),!this._explicitAttrs.has("pagination")&&typeof t.pagination=="boolean"&&this.pagination!==t.pagination&&(this.pagination=t.pagination),!this._explicitAttrs.has("virtual")&&typeof t.virtual=="boolean"&&this.virtual!==t.virtual&&(this.virtual=t.virtual),!this._explicitAttrs.has("row-animation")&&typeof t.rowAnimation=="string"&&this.rowAnimation!==t.rowAnimation&&(this.rowAnimation=t.rowAnimation),!this._explicitAttrs.has("virtual-height")&&(typeof t.virtualHeight=="number"||typeof t.virtualHeight=="string")&&this.virtualHeight!==t.virtualHeight&&(this.virtualHeight=t.virtualHeight),!this._explicitAttrs.has("row-height")&&typeof t.rowHeight=="number"&&this.rowHeight!==t.rowHeight&&(this.rowHeight=t.rowHeight)}updated(e){(e.has("virtual")||e.has("virtualHeight")||e.has("rowHeight"))&&this._applyVirtualStyles(),this.virtual?(this._scheduleVirtualScrollbarGutter(),this._syncHorizontalScrollVars()):(this.style.setProperty("--lui-table-scrollbar-width","0px"),this.style.setProperty("--lui-table-scroll-left","0px"),this.style.setProperty("--lui-table-scroll-overflow","0px")),(e.has("data")||e.has("dataSource")||e.has("source")||e.has("pagination")||e.has("current")||e.has("pageSize"))&&(this._scrollTop=0,this._virtualStart=0,this._lastRangeKey="",this._scrollEl&&(this._scrollEl.scrollTop=0)),this._scheduleColumnInteractions()}_applyVirtualStyles(){let e=this._resolvedVirtualHeight(),t=this.showHeader?this._resolvedRowHeight():0;this.style.setProperty("--lui-table-virtual-height",Jr(this.virtualHeight)||"360px"),this.style.setProperty("--lui-table-virtual-body-height",`${Math.max(80,e-t)}px`),typeof this.rowHeight=="number"&&Number.isFinite(this.rowHeight)&&this.style.setProperty("--lui-table-row-height",`${Math.max(24,this.rowHeight)}px`)}_scheduleVirtualScrollbarGutter(){this._gutterRaf||(this._gutterRaf=requestAnimationFrame(()=>{this._gutterRaf=0;let e=this._virtualizerEl,t=e?Math.max(0,e.offsetWidth-e.clientWidth):0;this.style.setProperty("--lui-table-scrollbar-width",`${t}px`)}))}_syncHorizontalScrollVars(e=this._scrollEl){if(!e)return;let t=Math.max(0,e.scrollLeft||0),r=Math.max(0,e.scrollWidth-e.clientWidth);this.style.setProperty("--lui-table-scroll-left",`${t}px`),this.style.setProperty("--lui-table-scroll-overflow",`${r}px`)}_rows(){return this.dataSource??this.source??this.data??[]}_columns(){return this.columns?.length?this.columns:(this._slottedColumns??[]).map(e=>e.toColumn())}_orderedColumns(e){if(!this._columnOrderKeys.length)return e;let t=e.map((d,h)=>({column:d,key:this._columnKey(d,h)})),r=new Map(t.map(d=>[d.key,d.column])),n=new Set,s=[];for(let d of this._columnOrderKeys){let h=r.get(d);!h||n.has(d)||(s.push(h),n.add(d))}for(let d of t)n.has(d.key)||s.push(d.column);return s}_currentBreakpoint(){let e=typeof window<"u"?window.innerWidth:0;return dv(this._responsiveWidth||Math.round(this.getBoundingClientRect().width||e||0))}_responsiveColumns(e){let t=this._currentBreakpoint();return e.filter(r=>{let n=Bp(r.responsive);return!n?.length||n.includes(t)})}_getRowKey(e,t){return typeof this.rowKey=="function"?this.rowKey(e,t):Cn(e,this.rowKey)??t}_columnKey(e,t){return String(e.key??e.dataIndex??t)}_columnFixed(e){if(e.fixed===!0||e.fixed==="left")return"left";if(e.fixed==="right")return"right"}_columnKeyForWidth(e,t){return this._columnKey(e,t)}_columnOverrideWidth(e,t){return this._columnWidthOverrides[this._columnKeyForWidth(e,t)]}_columnPixelWidth(e,t){return Math.max(this._columnMinWidth(e),this._columnOverrideWidth(e,t)??Kc(e.width)??Kc(e.minWidth)??120)}_leadingColumnWidth(){return(this.showSeq?60:0)+(this.selection!=="none"?44:0)}_seqBase(){return this.pagination?(Math.max(1,this.current)-1)*Math.max(1,this.pageSize||10):0}_resizedTableWidth(e){return this._leadingColumnWidth()+e.reduce((t,r,n)=>t+this._columnPixelWidth(r,n),0)}_effectiveColumnWidths(e){if(this.resizeMode!=="adaptive"||Object.keys(this._columnWidthOverrides).length===0)return null;let t=[];for(let k=0;k<e.length;k+=1){let C=e[k];if(!this._columnOverrideWidth(C,k)&&!Jr(C.width))return null;t.push(this._columnPixelWidth(C,k))}let r=this._columnResizeState?.key??this._lastResizedColumnKey,n=r?e.findIndex((k,C)=>this._columnKeyForWidth(k,C)===r):-1,s=-1;for(let k=e.length-1;k>=0;k-=1)if(k!==n){s=k;break}if(s<0)return null;let d=Math.floor(this._scrollEl?.clientWidth||this.getBoundingClientRect().width),h=this._leadingColumnWidth(),p=h+t.reduce((k,C)=>k+C,0),f=d-p;if(!Number.isFinite(d)||d<=h||f<=0)return null;let x=[...t];return x[s]=Math.max(this._columnMinWidth(e[s]),Math.floor(t[s]+f)),x}_findHeaderCellByColumnKey(e){return this.renderRoot.querySelector(`[data-column-key="${CSS.escape(e)}"]`)}_applyColumnWidthOverrides(e){this._columnWidthOverrides=e,this.toggleAttribute("column-resized",Object.keys(e).length>0)}_fixedColumnSize(e,t){let r=this._activeEffectiveWidths?.[t];if(r)return`${r}px`;let n=this._columnOverrideWidth(e,t);return n?`${n}px`:Jr(e.width??e.minWidth)||"120px"}_sumCss(e){return e.length?e.length===1?e[0]:`calc(${e.join(" + ")})`:"0px"}_updateHasEllipsisColumn(e){this.toggleAttribute("has-ellipsis-column",e.some(t=>!!t.ellipsis)),this.toggleAttribute("has-fixed-column",e.some(t=>!!t.ellipsis||!!this._columnFixed(t)||!!Jr(t.width)||!!Jr(t.minWidth)))}_fixedMeta(e){let t=e.map(h=>({fixed:this._columnFixed(h),offset:"0px",edge:!1})),r=t.map((h,p)=>h.fixed==="left"?p:-1).filter(h=>h>=0),n=t.map((h,p)=>h.fixed==="right"?p:-1).filter(h=>h>=0),s=this.selection!=="none"&&r.length>0?["44px"]:[];for(let h of r)t[h].offset=this._sumCss(s),s.push(this._fixedColumnSize(e[h],h));let d=[];for(let h=n.length-1;h>=0;h-=1){let p=n[h];t[p].offset=this._sumCss(d),d.push(this._fixedColumnSize(e[p],p))}return r.length&&(t[r[r.length-1]].edge=!0),n.length&&(t[n[0]].edge=!0),t}_hasLeftFixed(e){return e.some(t=>this._columnFixed(t)==="left")}_fixedClass(e,t=""){return e?.fixed?`${t} fixed-${e.fixed} ${e.edge?`fixed-${e.fixed}-edge`:""}`.trim():t}_fixedStyle(e,t=""){let r=t?[t]:[];return e?.fixed&&r.push(`--lui-table-sticky-${e.fixed}:${e.offset}`),r.filter(Boolean).join(";")}_selectionFixedClass(e,t=""){return this.selection==="none"||!this._hasLeftFixed(e)?t:`${t} fixed-left fixed-selection`.trim()}_selectionFixedStyle(e){return this.selection!=="none"&&this._hasLeftFixed(e)?"--lui-table-sticky-left:0px":""}_selectedKeys(){return this._internalSelectedRowKeys}_sortedRows(e,t){if(!this.sortKey||this.sortOrder==="none")return e;let r=t.find((s,d)=>this._columnKey(s,d)===this.sortKey);if(!r)return e;if(this.sorter)return this.sorter(e,{key:this.sortKey,order:this.sortOrder,column:r});let n=this.sortOrder==="asc"?1:-1;return[...e].sort((s,d)=>(r.sorter?r.sorter(s,d,r):lv(Cn(s,r.dataIndex??r.key),Cn(d,r.dataIndex??r.key)))*n)}_pagedRows(e){if(!this.pagination||this.remotePagination)return e;let t=Math.max(1,this.pageSize||10),r=Math.max(1,this.current||1);return e.slice((r-1)*t,r*t)}_rowKeyString(e,t){return String(this._getRowKey(e,t))}_rowAnimationsEnabled(e=this._activeRows.length){return this.rowAnimation!=="none"&&!this.virtual&&e<=500}_clearRowAnimationTimers(){for(let e of this._rowAnimationTimers)clearTimeout(e);this._rowAnimationTimers=[]}_prepareRowAnimations(){let e=this._activeRows??[],t=this._orderedColumns(this._columns()),r=this._pagedRows(this._sortedRows(this._rows(),t));if(!this._rowAnimationsEnabled(Math.max(e.length,r.length))||e.length===0){this._leavingRows=[],this._enteringRowKeys.clear();return}let n=e.map((k,C)=>this._rowKeyString(k,C)),s=r.map((k,C)=>this._rowKeyString(k,C)),d=new Set(n),h=new Set(s),p=[];e.forEach((k,C)=>{let S=n[C];h.has(S)||p.push({row:k,index:C,key:this._getRowKey(k,C)})});let f=new Set;if(s.forEach(k=>{d.has(k)||f.add(k)}),!p.length&&!f.size)return;this._clearRowAnimationTimers(),this._leavingRows=p,this._enteringRowKeys=f,this._rowAnimationTimers.push(setTimeout(()=>{this._leavingRows=[],this._enteringRowKeys.clear(),this.requestUpdate()},220))}_bodyDisplayRows(e,t,r,n){let s=e.map((h,p)=>{let f=t+p,x=this._getRowKey(h,f);return{row:h,rowIndex:f,key:x,leaving:!1,entering:this._enteringRowKeys.has(String(x))}});if(!this._rowAnimationsEnabled(s.length)||r>0||n>0||!this._leavingRows.length)return s;let d=new Set(s.map(h=>String(h.key)));for(let h of this._leavingRows)d.has(String(h.key))||s.splice(Math.min(h.index,s.length),0,{row:h.row,rowIndex:h.index,key:h.key,leaving:!0,entering:!1});return s}_resolvedRowHeight(){return typeof this.rowHeight=="number"&&Number.isFinite(this.rowHeight)?Math.max(24,this.rowHeight):this.size==="sm"?36:this.size==="lg"?52:44}_resolvedVirtualHeight(){if(typeof this.virtualHeight=="number"&&Number.isFinite(this.virtualHeight))return Math.max(80,this.virtualHeight);let e=Number.parseFloat(String(this.virtualHeight));return Number.isFinite(e)?Math.max(80,e):360}_calculateVirtualStart(e,t=this._resolvedRowHeight()){let r=Math.max(0,Math.floor(this.overscan||0));return Math.max(0,Math.floor(e/t)-r)}_virtualRange(e){if(!this.virtual||e.length===0)return{start:0,end:e.length,before:0,after:0,visibleRows:e};let t=this._resolvedRowHeight(),r=this._resolvedVirtualHeight(),n=Math.max(0,Math.floor(this.overscan||0)),s=Math.max(0,e.length-1),d=Math.min(s,this._virtualStart),h=Math.ceil(r/t)+n*2,p=Math.min(e.length,d+h),f=`${d}:${p}:${e.length}`;return f!==this._lastRangeKey&&(this._lastRangeKey=f,queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("visible-range-change",{detail:{start:d,end:p,total:e.length},bubbles:!0,composed:!0}))})),{start:d,end:p,before:d*t,after:Math.max(0,(e.length-p)*t),visibleRows:e.slice(d,p)}}scrollToIndex(e,t="start"){if(this.virtual&&this._virtualizerEl){this._virtualizerEl.scrollToIndex(e,t);return}let r=this._scrollEl;if(!r)return;let n=this._resolvedRowHeight(),s=this._resolvedVirtualHeight(),d=Math.max(0,e)*n;t==="center"&&(d-=(s-n)/2),t==="end"&&(d-=s-n),r.scrollTop=Math.max(0,d),this._scrollTop=r.scrollTop,this._virtualStart=this._calculateVirtualStart(this._scrollTop)}getColumnWidths(){return{...this._columnWidthOverrides}}_selectedRowsForKeys(e,t){if(!e.length)return[];let r=new Set(e.map(String)),n=[];for(let s=0;s<t.length;s+=1){let d=t[s];if(r.has(String(this._getRowKey(d,s)))&&n.push(d),n.length>=e.length)break}return n}_emitSelection(e,t){this._internalSelectedRowKeys=e,this.dispatchEvent(new CustomEvent("selection-change",{detail:{selectedRowKeys:e,selectedRows:this._selectedRowsForKeys(e,t)},bubbles:!0,composed:!0}))}_setCheckboxState(e,t,r=!1){e&&Object.assign(e,{checked:t,indeterminate:r})}_syncRenderedSelection(){let e=new Set(this._selectedKeys().map(String));this.renderRoot.querySelectorAll("[data-row-key]").forEach(r=>{let n=e.has(r.dataset.rowKey??"");r.classList.toggle("selected",n),this._setCheckboxState(r.querySelector("lui-checkbox"),n)}),this._syncHeaderCheckbox()}_syncHeaderCheckbox(){let e=this.renderRoot.querySelector('[data-table-select-all="true"]');if(!e)return;let t=Array.from(this.renderRoot.querySelectorAll("[data-row-key]")),r=new Set(this._selectedKeys().map(String)),n=t.filter(s=>r.has(s.dataset.rowKey??"")).length;this._setCheckboxState(e,t.length>0&&n===t.length,n>0&&n<t.length)}_toggleRow(e,t,r,n,s){let d=this._getRowKey(e,t);if(this.selection==="single"){this._emitSelection(r?[d]:[],n),this._syncRenderedSelection();return}let h=this._selectedKeys().filter(p=>String(p)!==String(d));r&&h.push(d),this._emitSelection(h,n),this._syncRenderedSelection()}_toggleAll(e,t,r){let n=this._selectedKeys(),s=t.map((f,x)=>this._getRowKey(f,x)),d=new Set(s.map(String)),h=n.filter(f=>!d.has(String(f))),p=e?[...h,...s]:h;this._emitSelection(p,r),this._syncRenderedSelection()}_toggleSort(e,t){if(!e.sortable&&!e.sorter)return;let r=this._columnKey(e,t),n="asc";this.sortKey===r&&(n=this.sortOrder==="asc"?"desc":this.sortOrder==="desc"?"none":"asc"),this.sortKey=n==="none"?"":r,this.sortOrder=n,this.dispatchEvent(new CustomEvent("sort",{detail:{key:r,order:n,column:e},bubbles:!0,composed:!0}))}_totalRows(){return typeof this.total=="number"?this.total:this._rows().length}_isInteractiveTarget(e){return e instanceof HTMLElement&&!!e.closest?.("lui-checkbox,lui-button,button,a,input,select,textarea,[data-table-ignore-row-click]")}_onRowClick(e,t,r,n){if(!this._isInteractiveTarget(e.target)){if(this.selectOnClick&&this.selection!=="none"){let s=this._selectedKeys().some(d=>String(d)===String(r));this._toggleRow(t,n,this.selection==="single"?!0:!s,this._activeRows,e)}this.onRow?.(t,n)?.onClick?.(e),this.dispatchEvent(new CustomEvent("row-click",{detail:{row:t,rowKey:r,index:n,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0}))}}_onRowDblClick(e,t,r,n){this._isInteractiveTarget(e.target)||(this.onRow?.(t,n)?.onDoubleClick?.(e),this.dispatchEvent(new CustomEvent("row-dblclick",{detail:{row:t,rowKey:r,index:n,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0})))}_onRowContextMenu(e,t,r){this._isInteractiveTarget(e.target)||this.onRow?.(t,r)?.onContextMenu?.(e)}_onRowMouseEnter(e,t,r){this.onRow?.(t,r)?.onMouseEnter?.(e)}_onRowMouseLeave(e,t,r){this.onRow?.(t,r)?.onMouseLeave?.(e)}_cellContext(e,t,r,n){let s=this._getRowKey(e,t),d=this._columnKey(r,n),h=Cn(e,r.dataIndex??r.key);return{row:e,rowKey:s,rowIndex:t,column:r,columnKey:d,columnIndex:n,value:h}}_onCellClick(e,t,r,n,s){if(this._isInteractiveTarget(e.target))return;let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onClick?.(e),this.onCell?.(d)?.onClick?.(e),n.onClick?.(e,d),this.dispatchEvent(new CustomEvent("cell-click",{detail:{...d,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_onCellDblClick(e,t,r,n,s){if(this._isInteractiveTarget(e.target))return;let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onDoubleClick?.(e),this.onCell?.(d)?.onDoubleClick?.(e),n.onDblClick?.(e,d),this.dispatchEvent(new CustomEvent("cell-dblclick",{detail:{...d,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_onCellContextMenu(e,t,r,n,s){let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onContextMenu?.(e),this.onCell?.(d)?.onContextMenu?.(e),n.onContextMenu?.(e,d),this.dispatchEvent(new CustomEvent("cell-contextmenu",{detail:{...d,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_onCellMouseEnter(e,t,r,n,s){let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onMouseEnter?.(e),this.onCell?.(d)?.onMouseEnter?.(e)}_onCellMouseLeave(e,t,r,n,s){let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onMouseLeave?.(e),this.onCell?.(d)?.onMouseLeave?.(e)}_headerCellContext(e,t){return{column:e,columnKey:this._columnKey(e,t),columnIndex:t}}_callHeaderRowHandler(e,t,r){this.onHeaderRow?.(r,0)?.[t]?.(e)}_callHeaderCellHandler(e,t,r,n){this.onHeaderCell?.(this._headerCellContext(r,n))?.[t]?.(e)}_onHeaderCellClick(e,t,r,n){performance.now()-this._columnDraggedAt<200||(this._callHeaderCellHandler(e,"onClick",t,r),n&&this._toggleSort(t,r))}_isColumnResizable(e){return e.resizable??this.columnResizable}_isColumnReorderable(e){return e.reorderable??this.columnReorderable}_columnMinWidth(e){return Math.max(48,Kc(e.minWidth)??48)}_columnInfoByKey(e){if(!e)return null;let t=this._responsiveColumns(this._orderedColumns(this._columns())),r=t.findIndex((n,s)=>this._columnKeyForWidth(n,s)===e);return r>=0?{column:t[r],index:r}:null}_teardownColumnInteractions(){for(let e of this._columnInteractDisposers)e();this._columnInteractDisposers=[]}_scheduleColumnInteractions(){this._columnInteractRaf||(this._columnInteractRaf=requestAnimationFrame(()=>{this._columnInteractRaf=0,this._syncColumnInteractions()}))}_syncColumnInteractions(){if(!this.isConnected||this._columnResizeState||this._columnDragState||(this._teardownColumnInteractions(),!this.showHeader))return;let e=Array.from(this.renderRoot.querySelectorAll(".column-resizer"));for(let n of e){let s=(0,el.default)(n).draggable({listeners:{start:d=>{let h=this._columnInfoByKey(n.dataset.columnKey);!h||!this._isColumnResizable(h.column)||this._startColumnResizeDrag(n,h.column,h.index,d.clientX??0)},move:d=>{this._moveColumnResize(d.clientX??0)},end:()=>{this._endColumnResize(),this._scheduleColumnInteractions()}}});this._columnInteractDisposers.push(()=>s.unset())}let t=Array.from(this.renderRoot.querySelectorAll(".column-drag-handle"));for(let n of t){let s=(0,el.default)(n).draggable({listeners:{start:d=>{let h=this._columnInfoByKey(n.dataset.columnKey);!h||!this._isColumnReorderable(h.column)||this._startColumnReorderDrag(n,h.column,h.index,d.clientX??0,d.clientY??0)},move:d=>{this._moveColumnReorder(d.clientX??0,d.clientY??0)},end:()=>{this._endColumnReorder(),this._scheduleColumnInteractions()}}});this._columnInteractDisposers.push(()=>s.unset())}let r=Array.from(this.renderRoot.querySelectorAll("th[data-reorderable='true'], .vhead-cell[data-reorderable='true']"));for(let n of r){let s=(0,el.default)(n).draggable({listeners:{start:d=>{if(this._columnResizeState||this._columnDragState)return;let h=this.renderRoot,p=d.clientX0??d.clientX??0,f=d.clientY0??d.clientY??0;if(h.elementFromPoint?.(p,f)?.closest?.(".column-resizer, .column-drag-handle"))return;let k=this._columnInfoByKey(n.dataset.columnKey);!k||!this._isColumnReorderable(k.column)||this._startColumnReorderDrag(n,k.column,k.index,d.clientX??0,d.clientY??0)},move:d=>{this._moveColumnReorder(d.clientX??0,d.clientY??0)},end:()=>{this._endColumnReorder(),this._scheduleColumnInteractions()}}});this._columnInteractDisposers.push(()=>s.unset())}}_startColumnResizeDrag(e,t,r,n){if(!this._isColumnResizable(t))return;let s=this._columnKeyForWidth(t,r),d=this._findHeaderCellByColumnKey(s),h=Math.max(this._columnMinWidth(t),Math.floor(d?.getBoundingClientRect().width||this._columnPixelWidth(t,r))),p={};this._responsiveColumns(this._orderedColumns(this._columns())).forEach((x,k)=>{let C=this._columnKeyForWidth(x,k),S=this._columnWidthOverrides[C];if(S!=null){p[C]=S;return}let z=C===s?d:this._findHeaderCellByColumnKey(C),T=C===s?h:Math.max(this._columnMinWidth(x),Math.floor(z?.getBoundingClientRect().width||this._columnPixelWidth(x,k)));p[C]=T}),this._applyColumnWidthOverrides(p),this._columnResizeState={key:s,column:t,columnIndex:r,startX:n,startWidth:h,minWidth:this._columnMinWidth(t),nextWidth:h},e.classList.add("active"),this.toggleAttribute("resizing-column",!0)}_moveColumnResize(e){if(!this._columnResizeState)return;let t=Math.max(this._columnResizeState.minWidth,Math.round(this._columnResizeState.startWidth+e-this._columnResizeState.startX));this._columnResizeState.nextWidth=t;let r=this._columnResizeState;this._applyColumnWidthOverrides({...this._columnWidthOverrides,[r.key]:r.nextWidth}),this.dispatchEvent(new CustomEvent("column-resize",{detail:{key:r.key,width:r.nextWidth,column:r.column,columnIndex:r.columnIndex},bubbles:!0,composed:!0}))}_endColumnResize(){this._columnResizeState&&(this._lastResizedColumnKey=this._columnResizeState.key,this._columnResizeState=null,this._resizeRaf&&(cancelAnimationFrame(this._resizeRaf),this._resizeRaf=0),this.toggleAttribute("resizing-column",!1),this.renderRoot.querySelectorAll(".column-resizer.active").forEach(e=>e.classList.remove("active")),this.dispatchEvent(new CustomEvent("column-widths-change",{detail:{widths:{...this._columnWidthOverrides}},bubbles:!0,composed:!0})))}_headerCellsByKey(e){return Array.from(this.renderRoot.querySelectorAll(`[data-column-key="${CSS.escape(e)}"]`))}_clearColumnDropMarkers(){this.renderRoot.querySelectorAll(".column-drop-before,.column-drop-after").forEach(e=>e.classList.remove("column-drop-before","column-drop-after"))}_clearColumnDragClasses(){this._clearColumnDropMarkers(),this.renderRoot.querySelectorAll(".column-drag-source,.column-drag-handle.active").forEach(e=>e.classList.remove("column-drag-source","active"))}_setColumnDropTarget(e,t="after"){let r=this._columnDragState;if(r&&!(r.overKey===e&&r.dropPosition===t)&&(this._clearColumnDropMarkers(),r.overKey=e,r.dropPosition=t,!!e))for(let n of this._headerCellsByKey(e))n.classList.add(t==="before"?"column-drop-before":"column-drop-after")}_applyColumnReorder(){let e=this._columnDragState;if(!e?.overKey)return;let r=this._responsiveColumns(this._orderedColumns(this._columns())).map((f,x)=>this._columnKey(f,x)),n=r.indexOf(e.key);if(n<0)return;let s=[...r],[d]=s.splice(n,1),h=s.indexOf(e.overKey);if(h<0||(s.splice(h+(e.dropPosition==="after"?1:0),0,d),s.join("\0")===r.join("\0")))return;this._columnOrderKeys=s;let p=this._responsiveColumns(this._orderedColumns(this._columns()));this._activeColumns=p,this._activeFixedMeta=this._fixedMeta(p),this.dispatchEvent(new CustomEvent("column-reorder",{detail:{fromKey:e.key,toKey:e.overKey,fromIndex:n,toIndex:s.indexOf(e.key),columns:p},bubbles:!0,composed:!0}))}_createColumnDragGhost(e,t,r){this._removeColumnDragGhost();let n=getComputedStyle(this),s=document.createElement("div");s.textContent=String(e.title??e.key??e.dataIndex??"Column"),s.style.cssText=["position:fixed","left:0","top:0","z-index:2147483000","pointer-events:none","display:inline-flex","align-items:center","max-width:220px","height:30px","padding:0 10px","border-radius:10px",`border:1px solid ${n.getPropertyValue("--lui-table-border").trim()||"rgb(0 0 0 / 0.12)"}`,`background:${n.getPropertyValue("--lui-color-bg-elevated").trim()||n.getPropertyValue("--lui-color-bg").trim()||"Canvas"}`,`color:${n.getPropertyValue("--lui-color-fg").trim()||"currentColor"}`,"box-shadow:0 12px 32px rgb(0 0 0 / 0.18)","font:600 13px/1 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif","white-space:nowrap","overflow:hidden","text-overflow:ellipsis","opacity:.96","will-change:transform"].join(";"),document.body.appendChild(s),this._columnDragGhost=s,this._moveColumnDragGhost(t,r)}_moveColumnDragGhost(e,t){this._columnDragGhost&&(this._columnDragGhost.style.transform=`translate3d(${Math.round(e+12)}px, ${Math.round(t+12)}px, 0)`)}_removeColumnDragGhost(){this._columnDragGhost?.remove(),this._columnDragGhost=null}_startColumnReorderDrag(e,t,r,n,s){if(!this._isColumnReorderable(t))return;let d=this._columnKeyForWidth(t,r);this._columnDragState={key:d,column:t,columnIndex:r,overKey:null,dropPosition:"after"},this._clearColumnDragClasses(),e.classList.add("active");for(let h of this._headerCellsByKey(d))h.classList.add("column-drag-source");this._createColumnDragGhost(t,n,s),this.toggleAttribute("dragging-column",!0)}_moveColumnReorder(e,t){let r=this._columnDragState;if(!r)return;this._moveColumnDragGhost(e,t);let d=[...this.renderRoot.elementsFromPoint?.(e,t)??[],...document.elementsFromPoint(e,t)].map(x=>x.closest?.("[data-column-key]")).find(x=>!!x),h=d?.dataset.columnKey;if(!d||!h||h===r.key){this._setColumnDropTarget(null);return}let p=d.getBoundingClientRect(),f=e<p.left+p.width/2?"before":"after";this._setColumnDropTarget(h,f)}_endColumnReorder(){this._columnDragState&&(this._columnDraggedAt=performance.now(),this._applyColumnReorder(),this._columnDragState=null,this.toggleAttribute("dragging-column",!1),this._clearColumnDragClasses(),this._removeColumnDragGhost())}_renderColumnDragHandle(e,t){return this._isColumnReorderable(e)?q`
4419
+ `};this._virtualKey=e=>this._getRowKey(e.row,e.index);this._skeletonWidths=["62%","78%","45%","70%","55%","82%"]}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._applyVirtualStyles();let e=typeof window<"u"?window.innerWidth:0;this._responsiveWidth=Math.round(this.getBoundingClientRect().width||e||0),this._responsiveResizeObserver=new ResizeObserver(t=>{let r=t[0],n=typeof window<"u"?window.innerWidth:0,s=Math.round(r?.contentRect.width||this.getBoundingClientRect().width||n||0);s>0&&s!==this._responsiveWidth&&(this._responsiveWidth=s)}),this._responsiveResizeObserver.observe(this)}disconnectedCallback(){this._endColumnResize(),this._endColumnReorder(),this._removeColumnDragGhost(),this._teardownColumnInteractions(),this._clearRowAnimationTimers(),this._scrollRaf&&cancelAnimationFrame(this._scrollRaf),this._gutterRaf&&cancelAnimationFrame(this._gutterRaf),this._resizeRaf&&cancelAnimationFrame(this._resizeRaf),this._columnInteractRaf&&cancelAnimationFrame(this._columnInteractRaf),this._responsiveResizeObserver?.disconnect(),this._responsiveResizeObserver=void 0,this._scrollRaf=0,this._gutterRaf=0,this._resizeRaf=0,this._columnInteractRaf=0,super.disconnectedCallback()}willUpdate(e){e.has("selectedRowKeys")&&(this._internalSelectedRowKeys=[...this.selectedRowKeys??[]]),e.has("columnWidths")&&this.columnWidths&&this._applyColumnWidthOverrides({...this.columnWidths}),(e.has("data")||e.has("dataSource")||e.has("source"))&&this._prepareRowAnimations();let t=F(this,"table");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("bordered")&&typeof t.bordered=="boolean"&&this.bordered!==t.bordered&&(this.bordered=t.bordered),!this._explicitAttrs.has("border")&&typeof t.border=="boolean"&&this.border!==t.border&&(this.border=t.border),!this._explicitAttrs.has("noborder")&&typeof t.noBorder=="boolean"&&this.noBorder!==t.noBorder&&(this.noBorder=t.noBorder),!this._explicitAttrs.has("striped")&&typeof t.striped=="boolean"&&this.striped!==t.striped&&(this.striped=t.striped),!this._explicitAttrs.has("hoverable")&&typeof t.hoverable=="boolean"&&this.hoverable!==t.hoverable&&(this.hoverable=t.hoverable),!this._explicitAttrs.has("column-resizable")&&typeof t.columnResizable=="boolean"&&this.columnResizable!==t.columnResizable&&(this.columnResizable=t.columnResizable),!this._explicitAttrs.has("column-reorderable")&&typeof t.columnReorderable=="boolean"&&this.columnReorderable!==t.columnReorderable&&(this.columnReorderable=t.columnReorderable),!this._explicitAttrs.has("selection")&&typeof t.selection=="string"&&this.selection!==t.selection&&(this.selection=t.selection),!this._explicitAttrs.has("select-on-click")&&typeof t.selectOnClick=="boolean"&&this.selectOnClick!==t.selectOnClick&&(this.selectOnClick=t.selectOnClick),!this._explicitAttrs.has("pagination")&&typeof t.pagination=="boolean"&&this.pagination!==t.pagination&&(this.pagination=t.pagination),!this._explicitAttrs.has("virtual")&&typeof t.virtual=="boolean"&&this.virtual!==t.virtual&&(this.virtual=t.virtual),!this._explicitAttrs.has("row-animation")&&typeof t.rowAnimation=="string"&&this.rowAnimation!==t.rowAnimation&&(this.rowAnimation=t.rowAnimation),!this._explicitAttrs.has("virtual-height")&&(typeof t.virtualHeight=="number"||typeof t.virtualHeight=="string")&&this.virtualHeight!==t.virtualHeight&&(this.virtualHeight=t.virtualHeight),!this._explicitAttrs.has("row-height")&&typeof t.rowHeight=="number"&&this.rowHeight!==t.rowHeight&&(this.rowHeight=t.rowHeight)}updated(e){(e.has("virtual")||e.has("virtualHeight")||e.has("rowHeight"))&&this._applyVirtualStyles(),this.virtual?(this._scheduleVirtualScrollbarGutter(),this._syncHorizontalScrollVars()):(this.style.setProperty("--lui-table-scrollbar-width","0px"),this.style.setProperty("--lui-table-scroll-left","0px"),this.style.setProperty("--lui-table-scroll-overflow","0px")),(e.has("data")||e.has("dataSource")||e.has("source")||e.has("pagination")||e.has("current")||e.has("pageSize"))&&(this._scrollTop=0,this._virtualStart=0,this._lastRangeKey="",this._scrollEl&&(this._scrollEl.scrollTop=0)),this._scheduleColumnInteractions()}_applyVirtualStyles(){let e=this._resolvedVirtualHeight(),t=this.showHeader?this._resolvedRowHeight():0;this.style.setProperty("--lui-table-virtual-height",Or(this.virtualHeight)||"360px"),this.style.setProperty("--lui-table-virtual-body-height",`${Math.max(80,e-t)}px`),typeof this.rowHeight=="number"&&Number.isFinite(this.rowHeight)&&this.style.setProperty("--lui-table-row-height",`${Math.max(24,this.rowHeight)}px`)}_scheduleVirtualScrollbarGutter(){this._gutterRaf||(this._gutterRaf=requestAnimationFrame(()=>{this._gutterRaf=0;let e=this._virtualizerEl,t=e?Math.max(0,e.offsetWidth-e.clientWidth):0;this.style.setProperty("--lui-table-scrollbar-width",`${t}px`)}))}_syncHorizontalScrollVars(e=this._scrollEl){if(!e)return;let t=Math.max(0,e.scrollLeft||0),r=Math.max(0,e.scrollWidth-e.clientWidth);this.style.setProperty("--lui-table-scroll-left",`${t}px`),this.style.setProperty("--lui-table-scroll-overflow",`${r}px`)}_rows(){return this.dataSource??this.source??this.data??[]}_columns(){return this.columns?.length?this.columns:(this._slottedColumns??[]).map(e=>e.toColumn())}_orderedColumns(e){if(!this._columnOrderKeys.length)return e;let t=e.map((d,h)=>({column:d,key:this._columnKey(d,h)})),r=new Map(t.map(d=>[d.key,d.column])),n=new Set,s=[];for(let d of this._columnOrderKeys){let h=r.get(d);!h||n.has(d)||(s.push(h),n.add(d))}for(let d of t)n.has(d.key)||s.push(d.column);return s}_currentBreakpoint(){let e=typeof window<"u"?window.innerWidth:0;return dv(this._responsiveWidth||Math.round(this.getBoundingClientRect().width||e||0))}_responsiveColumns(e){let t=this._currentBreakpoint();return e.filter(r=>{let n=Bp(r.responsive);return!n?.length||n.includes(t)})}_getRowKey(e,t){return typeof this.rowKey=="function"?this.rowKey(e,t):Cn(e,this.rowKey)??t}_columnKey(e,t){return String(e.key??e.dataIndex??t)}_columnFixed(e){if(e.fixed===!0||e.fixed==="left")return"left";if(e.fixed==="right")return"right"}_columnKeyForWidth(e,t){return this._columnKey(e,t)}_columnOverrideWidth(e,t){return this._columnWidthOverrides[this._columnKeyForWidth(e,t)]}_columnPixelWidth(e,t){return Math.max(this._columnMinWidth(e),this._columnOverrideWidth(e,t)??Kc(e.width)??Kc(e.minWidth)??120)}_leadingColumnWidth(){return(this.showSeq?60:0)+(this.selection!=="none"?44:0)}_seqBase(){return this.pagination?(Math.max(1,this.current)-1)*Math.max(1,this.pageSize||10):0}_resizedTableWidth(e){return this._leadingColumnWidth()+e.reduce((t,r,n)=>t+this._columnPixelWidth(r,n),0)}_effectiveColumnWidths(e){if(this.resizeMode!=="adaptive"||Object.keys(this._columnWidthOverrides).length===0)return null;let t=[];for(let k=0;k<e.length;k+=1){let C=e[k];if(!this._columnOverrideWidth(C,k)&&!Or(C.width))return null;t.push(this._columnPixelWidth(C,k))}let r=this._columnResizeState?.key??this._lastResizedColumnKey,n=r?e.findIndex((k,C)=>this._columnKeyForWidth(k,C)===r):-1,s=-1;for(let k=e.length-1;k>=0;k-=1)if(k!==n){s=k;break}if(s<0)return null;let d=Math.floor(this._scrollEl?.clientWidth||this.getBoundingClientRect().width),h=this._leadingColumnWidth(),p=h+t.reduce((k,C)=>k+C,0),f=d-p;if(!Number.isFinite(d)||d<=h||f<=0)return null;let x=[...t];return x[s]=Math.max(this._columnMinWidth(e[s]),Math.floor(t[s]+f)),x}_findHeaderCellByColumnKey(e){return this.renderRoot.querySelector(`[data-column-key="${CSS.escape(e)}"]`)}_applyColumnWidthOverrides(e){this._columnWidthOverrides=e,this.toggleAttribute("column-resized",Object.keys(e).length>0)}_fixedColumnSize(e,t){let r=this._activeEffectiveWidths?.[t];if(r)return`${r}px`;let n=this._columnOverrideWidth(e,t);return n?`${n}px`:Or(e.width??e.minWidth)||"120px"}_sumCss(e){return e.length?e.length===1?e[0]:`calc(${e.join(" + ")})`:"0px"}_updateHasEllipsisColumn(e){this.toggleAttribute("has-ellipsis-column",e.some(t=>!!t.ellipsis)),this.toggleAttribute("has-fixed-column",e.some(t=>!!t.ellipsis||!!this._columnFixed(t)||!!Or(t.width)||!!Or(t.minWidth)))}_fixedMeta(e){let t=e.map(h=>({fixed:this._columnFixed(h),offset:"0px",edge:!1})),r=t.map((h,p)=>h.fixed==="left"?p:-1).filter(h=>h>=0),n=t.map((h,p)=>h.fixed==="right"?p:-1).filter(h=>h>=0),s=this.selection!=="none"&&r.length>0?["44px"]:[];for(let h of r)t[h].offset=this._sumCss(s),s.push(this._fixedColumnSize(e[h],h));let d=[];for(let h=n.length-1;h>=0;h-=1){let p=n[h];t[p].offset=this._sumCss(d),d.push(this._fixedColumnSize(e[p],p))}return r.length&&(t[r[r.length-1]].edge=!0),n.length&&(t[n[0]].edge=!0),t}_hasLeftFixed(e){return e.some(t=>this._columnFixed(t)==="left")}_fixedClass(e,t=""){return e?.fixed?`${t} fixed-${e.fixed} ${e.edge?`fixed-${e.fixed}-edge`:""}`.trim():t}_fixedStyle(e,t=""){let r=t?[t]:[];return e?.fixed&&r.push(`--lui-table-sticky-${e.fixed}:${e.offset}`),r.filter(Boolean).join(";")}_selectionFixedClass(e,t=""){return this.selection==="none"||!this._hasLeftFixed(e)?t:`${t} fixed-left fixed-selection`.trim()}_selectionFixedStyle(e){return this.selection!=="none"&&this._hasLeftFixed(e)?"--lui-table-sticky-left:0px":""}_selectedKeys(){return this._internalSelectedRowKeys}_sortedRows(e,t){if(!this.sortKey||this.sortOrder==="none")return e;let r=t.find((s,d)=>this._columnKey(s,d)===this.sortKey);if(!r)return e;if(this.sorter)return this.sorter(e,{key:this.sortKey,order:this.sortOrder,column:r});let n=this.sortOrder==="asc"?1:-1;return[...e].sort((s,d)=>(r.sorter?r.sorter(s,d,r):lv(Cn(s,r.dataIndex??r.key),Cn(d,r.dataIndex??r.key)))*n)}_pagedRows(e){if(!this.pagination||this.remotePagination)return e;let t=Math.max(1,this.pageSize||10),r=Math.max(1,this.current||1);return e.slice((r-1)*t,r*t)}_rowKeyString(e,t){return String(this._getRowKey(e,t))}_rowAnimationsEnabled(e=this._activeRows.length){return this.rowAnimation!=="none"&&!this.virtual&&e<=500}_clearRowAnimationTimers(){for(let e of this._rowAnimationTimers)clearTimeout(e);this._rowAnimationTimers=[]}_prepareRowAnimations(){let e=this._activeRows??[],t=this._orderedColumns(this._columns()),r=this._pagedRows(this._sortedRows(this._rows(),t));if(!this._rowAnimationsEnabled(Math.max(e.length,r.length))||e.length===0){this._leavingRows=[],this._enteringRowKeys.clear();return}let n=e.map((k,C)=>this._rowKeyString(k,C)),s=r.map((k,C)=>this._rowKeyString(k,C)),d=new Set(n),h=new Set(s),p=[];e.forEach((k,C)=>{let S=n[C];h.has(S)||p.push({row:k,index:C,key:this._getRowKey(k,C)})});let f=new Set;if(s.forEach(k=>{d.has(k)||f.add(k)}),!p.length&&!f.size)return;this._clearRowAnimationTimers(),this._leavingRows=p,this._enteringRowKeys=f,this._rowAnimationTimers.push(setTimeout(()=>{this._leavingRows=[],this._enteringRowKeys.clear(),this.requestUpdate()},220))}_bodyDisplayRows(e,t,r,n){let s=e.map((h,p)=>{let f=t+p,x=this._getRowKey(h,f);return{row:h,rowIndex:f,key:x,leaving:!1,entering:this._enteringRowKeys.has(String(x))}});if(!this._rowAnimationsEnabled(s.length)||r>0||n>0||!this._leavingRows.length)return s;let d=new Set(s.map(h=>String(h.key)));for(let h of this._leavingRows)d.has(String(h.key))||s.splice(Math.min(h.index,s.length),0,{row:h.row,rowIndex:h.index,key:h.key,leaving:!0,entering:!1});return s}_resolvedRowHeight(){return typeof this.rowHeight=="number"&&Number.isFinite(this.rowHeight)?Math.max(24,this.rowHeight):this.size==="sm"?36:this.size==="lg"?52:44}_resolvedVirtualHeight(){if(typeof this.virtualHeight=="number"&&Number.isFinite(this.virtualHeight))return Math.max(80,this.virtualHeight);let e=Number.parseFloat(String(this.virtualHeight));return Number.isFinite(e)?Math.max(80,e):360}_calculateVirtualStart(e,t=this._resolvedRowHeight()){let r=Math.max(0,Math.floor(this.overscan||0));return Math.max(0,Math.floor(e/t)-r)}_virtualRange(e){if(!this.virtual||e.length===0)return{start:0,end:e.length,before:0,after:0,visibleRows:e};let t=this._resolvedRowHeight(),r=this._resolvedVirtualHeight(),n=Math.max(0,Math.floor(this.overscan||0)),s=Math.max(0,e.length-1),d=Math.min(s,this._virtualStart),h=Math.ceil(r/t)+n*2,p=Math.min(e.length,d+h),f=`${d}:${p}:${e.length}`;return f!==this._lastRangeKey&&(this._lastRangeKey=f,queueMicrotask(()=>{this.dispatchEvent(new CustomEvent("visible-range-change",{detail:{start:d,end:p,total:e.length},bubbles:!0,composed:!0}))})),{start:d,end:p,before:d*t,after:Math.max(0,(e.length-p)*t),visibleRows:e.slice(d,p)}}scrollToIndex(e,t="start"){if(this.virtual&&this._virtualizerEl){this._virtualizerEl.scrollToIndex(e,t);return}let r=this._scrollEl;if(!r)return;let n=this._resolvedRowHeight(),s=this._resolvedVirtualHeight(),d=Math.max(0,e)*n;t==="center"&&(d-=(s-n)/2),t==="end"&&(d-=s-n),r.scrollTop=Math.max(0,d),this._scrollTop=r.scrollTop,this._virtualStart=this._calculateVirtualStart(this._scrollTop)}getColumnWidths(){return{...this._columnWidthOverrides}}_selectedRowsForKeys(e,t){if(!e.length)return[];let r=new Set(e.map(String)),n=[];for(let s=0;s<t.length;s+=1){let d=t[s];if(r.has(String(this._getRowKey(d,s)))&&n.push(d),n.length>=e.length)break}return n}_emitSelection(e,t){this._internalSelectedRowKeys=e,this.dispatchEvent(new CustomEvent("selection-change",{detail:{selectedRowKeys:e,selectedRows:this._selectedRowsForKeys(e,t)},bubbles:!0,composed:!0}))}_setCheckboxState(e,t,r=!1){e&&Object.assign(e,{checked:t,indeterminate:r})}_syncRenderedSelection(){let e=new Set(this._selectedKeys().map(String));this.renderRoot.querySelectorAll("[data-row-key]").forEach(r=>{let n=e.has(r.dataset.rowKey??"");r.classList.toggle("selected",n),this._setCheckboxState(r.querySelector("lui-checkbox"),n)}),this._syncHeaderCheckbox()}_syncHeaderCheckbox(){let e=this.renderRoot.querySelector('[data-table-select-all="true"]');if(!e)return;let t=Array.from(this.renderRoot.querySelectorAll("[data-row-key]")),r=new Set(this._selectedKeys().map(String)),n=t.filter(s=>r.has(s.dataset.rowKey??"")).length;this._setCheckboxState(e,t.length>0&&n===t.length,n>0&&n<t.length)}_toggleRow(e,t,r,n,s){let d=this._getRowKey(e,t);if(this.selection==="single"){this._emitSelection(r?[d]:[],n),this._syncRenderedSelection();return}let h=this._selectedKeys().filter(p=>String(p)!==String(d));r&&h.push(d),this._emitSelection(h,n),this._syncRenderedSelection()}_toggleAll(e,t,r){let n=this._selectedKeys(),s=t.map((f,x)=>this._getRowKey(f,x)),d=new Set(s.map(String)),h=n.filter(f=>!d.has(String(f))),p=e?[...h,...s]:h;this._emitSelection(p,r),this._syncRenderedSelection()}_toggleSort(e,t){if(!e.sortable&&!e.sorter)return;let r=this._columnKey(e,t),n="asc";this.sortKey===r&&(n=this.sortOrder==="asc"?"desc":this.sortOrder==="desc"?"none":"asc"),this.sortKey=n==="none"?"":r,this.sortOrder=n,this.dispatchEvent(new CustomEvent("sort",{detail:{key:r,order:n,column:e},bubbles:!0,composed:!0}))}_totalRows(){return typeof this.total=="number"?this.total:this._rows().length}_isInteractiveTarget(e){return e instanceof HTMLElement&&!!e.closest?.("lui-checkbox,lui-button,button,a,input,select,textarea,[data-table-ignore-row-click]")}_onRowClick(e,t,r,n){if(!this._isInteractiveTarget(e.target)){if(this.selectOnClick&&this.selection!=="none"){let s=this._selectedKeys().some(d=>String(d)===String(r));this._toggleRow(t,n,this.selection==="single"?!0:!s,this._activeRows,e)}this.onRow?.(t,n)?.onClick?.(e),this.dispatchEvent(new CustomEvent("row-click",{detail:{row:t,rowKey:r,index:n,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0}))}}_onRowDblClick(e,t,r,n){this._isInteractiveTarget(e.target)||(this.onRow?.(t,n)?.onDoubleClick?.(e),this.dispatchEvent(new CustomEvent("row-dblclick",{detail:{row:t,rowKey:r,index:n,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0})))}_onRowContextMenu(e,t,r){this._isInteractiveTarget(e.target)||this.onRow?.(t,r)?.onContextMenu?.(e)}_onRowMouseEnter(e,t,r){this.onRow?.(t,r)?.onMouseEnter?.(e)}_onRowMouseLeave(e,t,r){this.onRow?.(t,r)?.onMouseLeave?.(e)}_cellContext(e,t,r,n){let s=this._getRowKey(e,t),d=this._columnKey(r,n),h=Cn(e,r.dataIndex??r.key);return{row:e,rowKey:s,rowIndex:t,column:r,columnKey:d,columnIndex:n,value:h}}_onCellClick(e,t,r,n,s){if(this._isInteractiveTarget(e.target))return;let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onClick?.(e),this.onCell?.(d)?.onClick?.(e),n.onClick?.(e,d),this.dispatchEvent(new CustomEvent("cell-click",{detail:{...d,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_onCellDblClick(e,t,r,n,s){if(this._isInteractiveTarget(e.target))return;let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onDoubleClick?.(e),this.onCell?.(d)?.onDoubleClick?.(e),n.onDblClick?.(e,d),this.dispatchEvent(new CustomEvent("cell-dblclick",{detail:{...d,clickCount:e.detail,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_onCellContextMenu(e,t,r,n,s){let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onContextMenu?.(e),this.onCell?.(d)?.onContextMenu?.(e),n.onContextMenu?.(e,d),this.dispatchEvent(new CustomEvent("cell-contextmenu",{detail:{...d,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_onCellMouseEnter(e,t,r,n,s){let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onMouseEnter?.(e),this.onCell?.(d)?.onMouseEnter?.(e)}_onCellMouseLeave(e,t,r,n,s){let d=this._cellContext(t,r,n,s);n.onCell?.(d)?.onMouseLeave?.(e),this.onCell?.(d)?.onMouseLeave?.(e)}_headerCellContext(e,t){return{column:e,columnKey:this._columnKey(e,t),columnIndex:t}}_callHeaderRowHandler(e,t,r){this.onHeaderRow?.(r,0)?.[t]?.(e)}_callHeaderCellHandler(e,t,r,n){this.onHeaderCell?.(this._headerCellContext(r,n))?.[t]?.(e)}_onHeaderCellClick(e,t,r,n){performance.now()-this._columnDraggedAt<200||(this._callHeaderCellHandler(e,"onClick",t,r),n&&this._toggleSort(t,r))}_isColumnResizable(e){return e.resizable??this.columnResizable}_isColumnReorderable(e){return e.reorderable??this.columnReorderable}_columnMinWidth(e){return Math.max(48,Kc(e.minWidth)??48)}_columnInfoByKey(e){if(!e)return null;let t=this._responsiveColumns(this._orderedColumns(this._columns())),r=t.findIndex((n,s)=>this._columnKeyForWidth(n,s)===e);return r>=0?{column:t[r],index:r}:null}_teardownColumnInteractions(){for(let e of this._columnInteractDisposers)e();this._columnInteractDisposers=[]}_scheduleColumnInteractions(){this._columnInteractRaf||(this._columnInteractRaf=requestAnimationFrame(()=>{this._columnInteractRaf=0,this._syncColumnInteractions()}))}_syncColumnInteractions(){if(!this.isConnected||this._columnResizeState||this._columnDragState||(this._teardownColumnInteractions(),!this.showHeader))return;let e=Array.from(this.renderRoot.querySelectorAll(".column-resizer"));for(let n of e){let s=(0,el.default)(n).draggable({listeners:{start:d=>{let h=this._columnInfoByKey(n.dataset.columnKey);!h||!this._isColumnResizable(h.column)||this._startColumnResizeDrag(n,h.column,h.index,d.clientX??0)},move:d=>{this._moveColumnResize(d.clientX??0)},end:()=>{this._endColumnResize(),this._scheduleColumnInteractions()}}});this._columnInteractDisposers.push(()=>s.unset())}let t=Array.from(this.renderRoot.querySelectorAll(".column-drag-handle"));for(let n of t){let s=(0,el.default)(n).draggable({listeners:{start:d=>{let h=this._columnInfoByKey(n.dataset.columnKey);!h||!this._isColumnReorderable(h.column)||this._startColumnReorderDrag(n,h.column,h.index,d.clientX??0,d.clientY??0)},move:d=>{this._moveColumnReorder(d.clientX??0,d.clientY??0)},end:()=>{this._endColumnReorder(),this._scheduleColumnInteractions()}}});this._columnInteractDisposers.push(()=>s.unset())}let r=Array.from(this.renderRoot.querySelectorAll("th[data-reorderable='true'], .vhead-cell[data-reorderable='true']"));for(let n of r){let s=(0,el.default)(n).draggable({listeners:{start:d=>{if(this._columnResizeState||this._columnDragState)return;let h=this.renderRoot,p=d.clientX0??d.clientX??0,f=d.clientY0??d.clientY??0;if(h.elementFromPoint?.(p,f)?.closest?.(".column-resizer, .column-drag-handle"))return;let k=this._columnInfoByKey(n.dataset.columnKey);!k||!this._isColumnReorderable(k.column)||this._startColumnReorderDrag(n,k.column,k.index,d.clientX??0,d.clientY??0)},move:d=>{this._moveColumnReorder(d.clientX??0,d.clientY??0)},end:()=>{this._endColumnReorder(),this._scheduleColumnInteractions()}}});this._columnInteractDisposers.push(()=>s.unset())}}_startColumnResizeDrag(e,t,r,n){if(!this._isColumnResizable(t))return;let s=this._columnKeyForWidth(t,r),d=this._findHeaderCellByColumnKey(s),h=Math.max(this._columnMinWidth(t),Math.floor(d?.getBoundingClientRect().width||this._columnPixelWidth(t,r))),p={};this._responsiveColumns(this._orderedColumns(this._columns())).forEach((x,k)=>{let C=this._columnKeyForWidth(x,k),S=this._columnWidthOverrides[C];if(S!=null){p[C]=S;return}let z=C===s?d:this._findHeaderCellByColumnKey(C),T=C===s?h:Math.max(this._columnMinWidth(x),Math.floor(z?.getBoundingClientRect().width||this._columnPixelWidth(x,k)));p[C]=T}),this._applyColumnWidthOverrides(p),this._columnResizeState={key:s,column:t,columnIndex:r,startX:n,startWidth:h,minWidth:this._columnMinWidth(t),nextWidth:h},e.classList.add("active"),this.toggleAttribute("resizing-column",!0)}_moveColumnResize(e){if(!this._columnResizeState)return;let t=Math.max(this._columnResizeState.minWidth,Math.round(this._columnResizeState.startWidth+e-this._columnResizeState.startX));this._columnResizeState.nextWidth=t;let r=this._columnResizeState;this._applyColumnWidthOverrides({...this._columnWidthOverrides,[r.key]:r.nextWidth}),this.dispatchEvent(new CustomEvent("column-resize",{detail:{key:r.key,width:r.nextWidth,column:r.column,columnIndex:r.columnIndex},bubbles:!0,composed:!0}))}_endColumnResize(){this._columnResizeState&&(this._lastResizedColumnKey=this._columnResizeState.key,this._columnResizeState=null,this._resizeRaf&&(cancelAnimationFrame(this._resizeRaf),this._resizeRaf=0),this.toggleAttribute("resizing-column",!1),this.renderRoot.querySelectorAll(".column-resizer.active").forEach(e=>e.classList.remove("active")),this.dispatchEvent(new CustomEvent("column-widths-change",{detail:{widths:{...this._columnWidthOverrides}},bubbles:!0,composed:!0})))}_headerCellsByKey(e){return Array.from(this.renderRoot.querySelectorAll(`[data-column-key="${CSS.escape(e)}"]`))}_clearColumnDropMarkers(){this.renderRoot.querySelectorAll(".column-drop-before,.column-drop-after").forEach(e=>e.classList.remove("column-drop-before","column-drop-after"))}_clearColumnDragClasses(){this._clearColumnDropMarkers(),this.renderRoot.querySelectorAll(".column-drag-source,.column-drag-handle.active").forEach(e=>e.classList.remove("column-drag-source","active"))}_setColumnDropTarget(e,t="after"){let r=this._columnDragState;if(r&&!(r.overKey===e&&r.dropPosition===t)&&(this._clearColumnDropMarkers(),r.overKey=e,r.dropPosition=t,!!e))for(let n of this._headerCellsByKey(e))n.classList.add(t==="before"?"column-drop-before":"column-drop-after")}_applyColumnReorder(){let e=this._columnDragState;if(!e?.overKey)return;let r=this._responsiveColumns(this._orderedColumns(this._columns())).map((f,x)=>this._columnKey(f,x)),n=r.indexOf(e.key);if(n<0)return;let s=[...r],[d]=s.splice(n,1),h=s.indexOf(e.overKey);if(h<0||(s.splice(h+(e.dropPosition==="after"?1:0),0,d),s.join("\0")===r.join("\0")))return;this._columnOrderKeys=s;let p=this._responsiveColumns(this._orderedColumns(this._columns()));this._activeColumns=p,this._activeFixedMeta=this._fixedMeta(p),this.dispatchEvent(new CustomEvent("column-reorder",{detail:{fromKey:e.key,toKey:e.overKey,fromIndex:n,toIndex:s.indexOf(e.key),columns:p},bubbles:!0,composed:!0}))}_createColumnDragGhost(e,t,r){this._removeColumnDragGhost();let n=getComputedStyle(this),s=document.createElement("div");s.textContent=String(e.title??e.key??e.dataIndex??"Column"),s.style.cssText=["position:fixed","left:0","top:0","z-index:2147483000","pointer-events:none","display:inline-flex","align-items:center","max-width:220px","height:30px","padding:0 10px","border-radius:10px",`border:1px solid ${n.getPropertyValue("--lui-table-border").trim()||"rgb(0 0 0 / 0.12)"}`,`background:${n.getPropertyValue("--lui-color-bg-elevated").trim()||n.getPropertyValue("--lui-color-bg").trim()||"Canvas"}`,`color:${n.getPropertyValue("--lui-color-fg").trim()||"currentColor"}`,"box-shadow:0 12px 32px rgb(0 0 0 / 0.18)","font:600 13px/1 system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif","white-space:nowrap","overflow:hidden","text-overflow:ellipsis","opacity:.96","will-change:transform"].join(";"),document.body.appendChild(s),this._columnDragGhost=s,this._moveColumnDragGhost(t,r)}_moveColumnDragGhost(e,t){this._columnDragGhost&&(this._columnDragGhost.style.transform=`translate3d(${Math.round(e+12)}px, ${Math.round(t+12)}px, 0)`)}_removeColumnDragGhost(){this._columnDragGhost?.remove(),this._columnDragGhost=null}_startColumnReorderDrag(e,t,r,n,s){if(!this._isColumnReorderable(t))return;let d=this._columnKeyForWidth(t,r);this._columnDragState={key:d,column:t,columnIndex:r,overKey:null,dropPosition:"after"},this._clearColumnDragClasses(),e.classList.add("active");for(let h of this._headerCellsByKey(d))h.classList.add("column-drag-source");this._createColumnDragGhost(t,n,s),this.toggleAttribute("dragging-column",!0)}_moveColumnReorder(e,t){let r=this._columnDragState;if(!r)return;this._moveColumnDragGhost(e,t);let d=[...this.renderRoot.elementsFromPoint?.(e,t)??[],...document.elementsFromPoint(e,t)].map(x=>x.closest?.("[data-column-key]")).find(x=>!!x),h=d?.dataset.columnKey;if(!d||!h||h===r.key){this._setColumnDropTarget(null);return}let p=d.getBoundingClientRect(),f=e<p.left+p.width/2?"before":"after";this._setColumnDropTarget(h,f)}_endColumnReorder(){this._columnDragState&&(this._columnDraggedAt=performance.now(),this._applyColumnReorder(),this._columnDragState=null,this.toggleAttribute("dragging-column",!1),this._clearColumnDragClasses(),this._removeColumnDragGhost())}_renderColumnDragHandle(e,t){return this._isColumnReorderable(e)?q`
4420
4420
  <span
4421
4421
  class="column-drag-handle"
4422
4422
  part="column-drag-handle"
@@ -4441,9 +4441,9 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
4441
4441
  <colgroup>
4442
4442
  ${this.showSeq?q`<col style="width:60px;min-width:60px;" />`:ze}
4443
4443
  ${this.selection!=="none"?q`<col style="width:44px;min-width:44px;" />`:ze}
4444
- ${e.map((t,r)=>{let n=this._columnOverrideWidth(t,r),s=this._activeEffectiveWidths?.[r],d=s?`${s}px`:n?`${n}px`:Jr(t.width),h=Jr(t.minWidth);return q`<col style=${[d?`width:${d}`:"",h?`min-width:${h}`:""].filter(Boolean).join(";")} />`})}
4444
+ ${e.map((t,r)=>{let n=this._columnOverrideWidth(t,r),s=this._activeEffectiveWidths?.[r],d=s?`${s}px`:n?`${n}px`:Or(t.width),h=Or(t.minWidth);return q`<col style=${[d?`width:${d}`:"",h?`min-width:${h}`:""].filter(Boolean).join(";")} />`})}
4445
4445
  </colgroup>
4446
- `}_gridTemplateColumns(e){let t=[];this.showSeq&&t.push("60px"),this.selection!=="none"&&t.push("44px");for(let r=0;r<e.length;r+=1){let n=e[r],s=this._columnOverrideWidth(n,r),d=this._activeEffectiveWidths?.[r];if(d)t.push(`${d}px`);else if(s)t.push(`${s}px`);else if(n.width){let h=Jr(n.width);t.push(this._columnFixed(n)?h:`minmax(${h}, 1fr)`)}else this._columnFixed(n)?t.push(this._fixedColumnSize(n,r)):n.minWidth?t.push(`minmax(${Jr(n.minWidth)}, 1fr)`):t.push("minmax(120px, 1fr)")}return t.join(" ")}_tableStyle(e,t=0){let r=[`--lui-table-grid-columns:${this._gridTemplateColumns(e)}`];if(Object.keys(this._columnWidthOverrides).length>0){let n=this._resizedTableWidth(e);r.push(`--lui-table-min-width:${n}px`),!e.some((d,h)=>!this._columnOverrideWidth(d,h)&&!Jr(d.width))&&!this._activeEffectiveWidths&&r.push(`--lui-table-resized-width:${n}px`)}return this.virtual&&r.push(`--lui-table-total-height:${Math.max(1,t)*this._resolvedRowHeight()}px`),r.join(";")}_renderVirtualHeader(e,t,r){if(!this.showHeader)return ze;let n=this._selectedKeys(),s=this._fixedMeta(e),h=t.map((p,f)=>this._getRowKey(p,f)).filter(p=>n.some(f=>String(f)===String(p))).length;return q`
4446
+ `}_gridTemplateColumns(e){let t=[];this.showSeq&&t.push("60px"),this.selection!=="none"&&t.push("44px");for(let r=0;r<e.length;r+=1){let n=e[r],s=this._columnOverrideWidth(n,r),d=this._activeEffectiveWidths?.[r];if(d)t.push(`${d}px`);else if(s)t.push(`${s}px`);else if(n.width){let h=Or(n.width);t.push(this._columnFixed(n)?h:`minmax(${h}, 1fr)`)}else this._columnFixed(n)?t.push(this._fixedColumnSize(n,r)):n.minWidth?t.push(`minmax(${Or(n.minWidth)}, 1fr)`):t.push("minmax(120px, 1fr)")}return t.join(" ")}_tableStyle(e,t=0){let r=[`--lui-table-grid-columns:${this._gridTemplateColumns(e)}`],n=e.some(s=>!!s.ellipsis||!!this._columnFixed(s)||!!Or(s.width)||!!Or(s.minWidth));if(Object.keys(this._columnWidthOverrides).length>0){let s=this._resizedTableWidth(e);r.push(`--lui-table-min-width:${s}px`),!e.some((h,p)=>!this._columnOverrideWidth(h,p)&&!Or(h.width))&&!this._activeEffectiveWidths&&r.push(`--lui-table-resized-width:${s}px`)}else n&&r.push(`--lui-table-min-width:${this._resizedTableWidth(e)}px`);return this.virtual&&r.push(`--lui-table-total-height:${Math.max(1,t)*this._resolvedRowHeight()}px`),r.join(";")}_renderVirtualHeader(e,t,r){if(!this.showHeader)return ze;let n=this._selectedKeys(),s=this._fixedMeta(e),h=t.map((p,f)=>this._getRowKey(p,f)).filter(p=>n.some(f=>String(f)===String(p))).length;return q`
4447
4447
  <div
4448
4448
  class="virtual-head"
4449
4449
  part="virtual-head"
@@ -4607,7 +4607,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
4607
4607
  `:ze}
4608
4608
  </th>
4609
4609
  `:ze}
4610
- ${e.map((p,f)=>{let x=p.align??"left",k=this._columnOverrideWidth(p,f),C=[k?`width:${k}px`:p.width?`width:${Jr(p.width)}`:"",p.minWidth?`min-width:${Jr(p.minWidth)}`:""].filter(Boolean).join(";"),S=!!(p.sortable||p.sorter),z=this.sortKey===this._columnKey(p,f)?this.sortOrder:"none",T=s[f];return q`
4610
+ ${e.map((p,f)=>{let x=p.align??"left",k=this._columnOverrideWidth(p,f),C=[k?`width:${k}px`:p.width?`width:${Or(p.width)}`:"",p.minWidth?`min-width:${Or(p.minWidth)}`:""].filter(Boolean).join(";"),S=!!(p.sortable||p.sorter),z=this.sortKey===this._columnKey(p,f)?this.sortOrder:"none",T=s[f];return q`
4611
4611
  <th
4612
4612
  class=${this._fixedClass(T,`align-${x} ${p.className??""}`)}
4613
4613
  style=${this._fixedStyle(T,C)}
@@ -6877,7 +6877,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
6877
6877
  transform: scale(2.4);
6878
6878
  }
6879
6879
  }
6880
- `],a([eo({reflect:!0})],Tt.prototype,"variant",2),a([eo({reflect:!0})],Tt.prototype,"size",2),a([eo({reflect:!0})],Tt.prototype,"radius",2),a([eo({reflect:!0})],Tt.prototype,"placement",2),a([eo()],Tt.prototype,"count",2),a([eo({type:Number})],Tt.prototype,"max",2),a([eo({type:Boolean,attribute:"show-zero"})],Tt.prototype,"showZero",2),a([eo({type:Boolean,reflect:!0})],Tt.prototype,"dot",2),a([eo({type:Boolean,reflect:!0})],Tt.prototype,"processing",2),a([eo()],Tt.prototype,"text",2),a([eo()],Tt.prototype,"color",2),a([eo()],Tt.prototype,"offset",2),a([Lv({flatten:!0})],Tt.prototype,"_assignedElements",2),Tt=a([Nv("lui-badge")],Tt);function Zo(i,o){return String(i.key??i.value??o)}function Kv(i,o){return i.length===o.length&&i.every((e,t)=>e===o[t])}var qr=class extends Qp{constructor(){super(...arguments);this.key="";this.value="";this.label="";this.icon="";this.badge="";this.disabled=!1;this.closable=!1}get tabKey(){return this.key||this.value}render(){return Ro`<slot></slot>`}};qr.styles=[A,O,Zp`
6880
+ `],a([eo({reflect:!0})],Tt.prototype,"variant",2),a([eo({reflect:!0})],Tt.prototype,"size",2),a([eo({reflect:!0})],Tt.prototype,"radius",2),a([eo({reflect:!0})],Tt.prototype,"placement",2),a([eo()],Tt.prototype,"count",2),a([eo({type:Number})],Tt.prototype,"max",2),a([eo({type:Boolean,attribute:"show-zero"})],Tt.prototype,"showZero",2),a([eo({type:Boolean,reflect:!0})],Tt.prototype,"dot",2),a([eo({type:Boolean,reflect:!0})],Tt.prototype,"processing",2),a([eo()],Tt.prototype,"text",2),a([eo()],Tt.prototype,"color",2),a([eo()],Tt.prototype,"offset",2),a([Lv({flatten:!0})],Tt.prototype,"_assignedElements",2),Tt=a([Nv("lui-badge")],Tt);function Zo(i,o){return String(i.key??i.value??o)}function Kv(i,o){return i.length===o.length&&i.every((e,t)=>e===o[t])}var Kr=class extends Qp{constructor(){super(...arguments);this.key="";this.value="";this.label="";this.icon="";this.badge="";this.disabled=!1;this.closable=!1}get tabKey(){return this.key||this.value}render(){return Ro`<slot></slot>`}};Kr.styles=[A,O,Zp`
6881
6881
  :host {
6882
6882
  display: block;
6883
6883
  min-width: 0;
@@ -6885,7 +6885,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
6885
6885
  :host([hidden]) {
6886
6886
  display: none !important;
6887
6887
  }
6888
- `],a([Kt()],qr.prototype,"key",2),a([Kt()],qr.prototype,"value",2),a([Kt()],qr.prototype,"label",2),a([Kt()],qr.prototype,"icon",2),a([Kt()],qr.prototype,"badge",2),a([Kt({type:Boolean,reflect:!0})],qr.prototype,"disabled",2),a([Kt({type:Boolean,reflect:!0})],qr.prototype,"closable",2),qr=a([Jc("lui-tab-panel")],qr);var vt=class extends Qp{constructor(){super(...arguments);this.activeKey="";this.size="md";this.variant="line";this.placement="top";this.closable=!1;this.disabled=!1;this.collapse="none";this.overflowLabel="\u66F4\u591A";this.overflowIcon="more-horizontal";this._overflowIndexes=[];this._explicitAttrs=new Set;this._observedTabButtons=new Set;this._layoutFrame=0;this._indicatorFrame=0;this._onExtraSlotChange=e=>{let r=e.currentTarget.assignedNodes({flatten:!0}).some(n=>n.nodeType===Node.ELEMENT_NODE?!0:!!n.textContent?.trim());this.toggleAttribute("has-extra",r)};this._onKeyDown=e=>{let t=this._tabs(),r=t.map((k,C)=>({item:k,index:C})).filter(({item:k})=>!k.disabled);if(!r.length)return;let n=this._resolvedActiveKey(t),s=Math.max(0,r.findIndex(({item:k,index:C})=>Zo(k,C)===n)),d=this.placement==="top"||this.placement==="bottom",h=d?"ArrowLeft":"ArrowUp",p=d?"ArrowRight":"ArrowDown",f=s;if(e.key===p)f=(s+1)%r.length;else if(e.key===h)f=(s-1+r.length)%r.length;else if(e.key==="Home")f=0;else if(e.key==="End")f=r.length-1;else return;e.preventDefault();let x=r[f];this._select(x.item,x.index),this.updateComplete.then(()=>{this.renderRoot.querySelector(`button[data-key="${CSS.escape(Zo(x.item,x.index))}"]`)?.focus()})}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._resizeObserver=new ResizeObserver(()=>this._scheduleLayout())}firstUpdated(){this._resizeObserver?.observe(this),this._navEl&&this._resizeObserver?.observe(this._navEl),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._syncObservedTabButtons(),this._scheduleLayout()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}willUpdate(e){let t=F(this,"tab");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&this.placement!==t.placement&&(this.placement=t.placement),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("closable")&&typeof t.closable=="boolean"&&this.closable!==t.closable&&(this.closable=t.closable)}updated(e){this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement));let t=this._resolvedActiveKey();t&&this.getAttribute("active-key")!==t&&this.setAttribute("active-key",t),this._syncPanels(),this._syncObservedTabButtons(),(e.has("items")||e.has("size")||e.has("variant")||e.has("placement")||e.has("closable")||e.has("disabled")||e.has("collapse")||e.has("activeKey"))&&this._scheduleLayout(),this._scheduleActiveIndicatorLayout()}_syncObservedTabButtons(){if(!this._resizeObserver)return;let e=new Set(Array.from(this.renderRoot.querySelectorAll(".tab-button, .overflow-trigger")));for(let t of this._observedTabButtons)e.has(t)||this._resizeObserver.unobserve(t);for(let t of e)this._observedTabButtons.has(t)||this._resizeObserver.observe(t);this._observedTabButtons=e}_panelElements(){return(this._defaultSlot?.assignedElements({flatten:!0})??this._assignedElements??[]).filter(t=>t.tagName.toLowerCase()==="lui-tab-panel")}_itemsFromPanels(){return this._panelElements().map((e,t)=>({key:e.tabKey||String(t),label:e.label||e.getAttribute("label")||e.tabKey||`Tab ${t+1}`,icon:e.icon,badge:e.badge,disabled:e.disabled,closable:e.closable}))}_tabs(){return this.items?.length?this.items:this._itemsFromPanels()}_resolvedActiveKey(e=this._tabs()){let t=e.filter(r=>!r.disabled);return t.length?this.activeKey&&t.some((r,n)=>Zo(r,e.indexOf(r)>=0?e.indexOf(r):n)===this.activeKey)?this.activeKey:Zo(t[0],e.indexOf(t[0])):""}_syncPanels(){if(this.items?.length)return;let e=this._panelElements(),t=this._itemsFromPanels(),r=this._resolvedActiveKey(t);r&&this.activeKey!==r&&(this.activeKey=r),r&&this.getAttribute("active-key")!==r&&this.setAttribute("active-key",r),e.forEach((n,s)=>{let d=n.tabKey||String(s);n.hidden=d!==r})}_select(e,t){if(this.disabled||e.disabled)return;let r=Zo(e,t),n=this._resolvedActiveKey();r===n&&this.activeKey||(this.activeKey=r,this.dispatchEvent(new CustomEvent("change",{detail:{key:r,previousKey:n,item:e,index:t},bubbles:!0,composed:!0})))}_close(e,t,r){e.preventDefault(),e.stopPropagation();let n=Zo(t,r);this.dispatchEvent(new CustomEvent("close",{detail:{key:n,item:t,index:r,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_scheduleLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._recomputeOverflow(),this._scheduleActiveIndicatorLayout()})}_scheduleActiveIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updateActiveIndicator()})}_updateActiveIndicator(){let e=this._navEl;if(!e)return;let t=this._resolvedActiveKey(),r=t?e.querySelector(`button.tab-button[data-key="${CSS.escape(t)}"]`):null;if(!r){e.style.setProperty("--lui-tab-indicator-opacity","0");return}let n=e.getBoundingClientRect(),s=r.getBoundingClientRect(),d=r.offsetWidth||s.width,h=r.offsetHeight||s.height;e.style.setProperty("--lui-tab-indicator-x",`${s.left-n.left+e.scrollLeft}px`),e.style.setProperty("--lui-tab-indicator-y",`${s.top-n.top+e.scrollTop}px`),e.style.setProperty("--lui-tab-indicator-width",`${d}px`),e.style.setProperty("--lui-tab-indicator-height",`${h}px`),e.style.setProperty("--lui-tab-indicator-opacity","1")}_isHorizontal(){return this.placement==="top"||this.placement==="bottom"}_tabWidthBudget(){return Math.floor(this._navEl?.clientWidth??0)}_visibleIndexesForAuto(e){if(this.collapse!=="auto"||!this._isHorizontal()||e.length<=1)return e.map((k,C)=>C);let t=this._tabWidthBudget(),r=Array.from(this.renderRoot.querySelectorAll("[data-measure-tab-index]")),n=this.renderRoot.querySelector("[data-measure-overflow-trigger]");if(!t||r.length!==e.length||!n)return e.map((k,C)=>C);let s=Number.parseFloat(getComputedStyle(this._navEl).columnGap||"0")||0,d=r.map(k=>Math.ceil(k.getBoundingClientRect().width)),h=Math.ceil(n.getBoundingClientRect().width);if(d.reduce((k,C)=>k+C,0)+Math.max(0,e.length-1)*s<=t)return e.map((k,C)=>C);let f=[],x=h;for(let k=0;k<e.length;k+=1){let C=d[k]??0,S=x+(f.length>0?s:0)+C;S<=t&&(f.push(k),x=S)}return f}_recomputeOverflow(){let e=this._tabs(),t=new Set(this._visibleIndexesForAuto(e)),r=e.map((n,s)=>s).filter(n=>!t.has(n));Kv(r,this._overflowIndexes)||(this._overflowIndexes=r)}_overflowMenuItems(e,t){return this._overflowIndexes.flatMap(r=>{let n=e[r];if(!n)return[];let s=Zo(n,r);return[{key:s,value:String(r),label:n.label??s,icon:n.icon,disabled:this.disabled||n.disabled,active:s===t}]})}_onOverflowSelect(e,t){let r=Number(e.detail?.value),n=t[r];n&&this._select(n,r)}_renderTab(e,t,r){let n=Zo(e,t),s=n===r,d=e.closable??this.closable;return Ro`
6888
+ `],a([Kt()],Kr.prototype,"key",2),a([Kt()],Kr.prototype,"value",2),a([Kt()],Kr.prototype,"label",2),a([Kt()],Kr.prototype,"icon",2),a([Kt()],Kr.prototype,"badge",2),a([Kt({type:Boolean,reflect:!0})],Kr.prototype,"disabled",2),a([Kt({type:Boolean,reflect:!0})],Kr.prototype,"closable",2),Kr=a([Jc("lui-tab-panel")],Kr);var vt=class extends Qp{constructor(){super(...arguments);this.activeKey="";this.size="md";this.variant="line";this.placement="top";this.closable=!1;this.disabled=!1;this.collapse="none";this.overflowLabel="\u66F4\u591A";this.overflowIcon="more-horizontal";this._overflowIndexes=[];this._explicitAttrs=new Set;this._observedTabButtons=new Set;this._layoutFrame=0;this._indicatorFrame=0;this._onExtraSlotChange=e=>{let r=e.currentTarget.assignedNodes({flatten:!0}).some(n=>n.nodeType===Node.ELEMENT_NODE?!0:!!n.textContent?.trim());this.toggleAttribute("has-extra",r)};this._onKeyDown=e=>{let t=this._tabs(),r=t.map((k,C)=>({item:k,index:C})).filter(({item:k})=>!k.disabled);if(!r.length)return;let n=this._resolvedActiveKey(t),s=Math.max(0,r.findIndex(({item:k,index:C})=>Zo(k,C)===n)),d=this.placement==="top"||this.placement==="bottom",h=d?"ArrowLeft":"ArrowUp",p=d?"ArrowRight":"ArrowDown",f=s;if(e.key===p)f=(s+1)%r.length;else if(e.key===h)f=(s-1+r.length)%r.length;else if(e.key==="Home")f=0;else if(e.key==="End")f=r.length-1;else return;e.preventDefault();let x=r[f];this._select(x.item,x.index),this.updateComplete.then(()=>{this.renderRoot.querySelector(`button[data-key="${CSS.escape(Zo(x.item,x.index))}"]`)?.focus()})}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._resizeObserver=new ResizeObserver(()=>this._scheduleLayout())}firstUpdated(){this._resizeObserver?.observe(this),this._navEl&&this._resizeObserver?.observe(this._navEl),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._syncObservedTabButtons(),this._scheduleLayout()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame)}willUpdate(e){let t=F(this,"tab");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&this.placement!==t.placement&&(this.placement=t.placement),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("closable")&&typeof t.closable=="boolean"&&this.closable!==t.closable&&(this.closable=t.closable)}updated(e){this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement));let t=this._resolvedActiveKey();t&&this.getAttribute("active-key")!==t&&this.setAttribute("active-key",t),this._syncPanels(),this._syncObservedTabButtons(),(e.has("items")||e.has("size")||e.has("variant")||e.has("placement")||e.has("closable")||e.has("disabled")||e.has("collapse")||e.has("activeKey"))&&this._scheduleLayout(),this._scheduleActiveIndicatorLayout()}_syncObservedTabButtons(){if(!this._resizeObserver)return;let e=new Set(Array.from(this.renderRoot.querySelectorAll(".tab-button, .overflow-trigger")));for(let t of this._observedTabButtons)e.has(t)||this._resizeObserver.unobserve(t);for(let t of e)this._observedTabButtons.has(t)||this._resizeObserver.observe(t);this._observedTabButtons=e}_panelElements(){return(this._defaultSlot?.assignedElements({flatten:!0})??this._assignedElements??[]).filter(t=>t.tagName.toLowerCase()==="lui-tab-panel")}_itemsFromPanels(){return this._panelElements().map((e,t)=>({key:e.tabKey||String(t),label:e.label||e.getAttribute("label")||e.tabKey||`Tab ${t+1}`,icon:e.icon,badge:e.badge,disabled:e.disabled,closable:e.closable}))}_tabs(){return this.items?.length?this.items:this._itemsFromPanels()}_resolvedActiveKey(e=this._tabs()){let t=e.filter(r=>!r.disabled);return t.length?this.activeKey&&t.some((r,n)=>Zo(r,e.indexOf(r)>=0?e.indexOf(r):n)===this.activeKey)?this.activeKey:Zo(t[0],e.indexOf(t[0])):""}_syncPanels(){if(this.items?.length)return;let e=this._panelElements(),t=this._itemsFromPanels(),r=this._resolvedActiveKey(t);r&&this.activeKey!==r&&(this.activeKey=r),r&&this.getAttribute("active-key")!==r&&this.setAttribute("active-key",r),e.forEach((n,s)=>{let d=n.tabKey||String(s);n.hidden=d!==r})}_select(e,t){if(this.disabled||e.disabled)return;let r=Zo(e,t),n=this._resolvedActiveKey();r===n&&this.activeKey||(this.activeKey=r,this.dispatchEvent(new CustomEvent("change",{detail:{key:r,previousKey:n,item:e,index:t},bubbles:!0,composed:!0})))}_close(e,t,r){e.preventDefault(),e.stopPropagation();let n=Zo(t,r);this.dispatchEvent(new CustomEvent("close",{detail:{key:n,item:t,index:r,originalEvent:e},bubbles:!0,composed:!0,cancelable:!0}))}_scheduleLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._recomputeOverflow(),this._scheduleActiveIndicatorLayout()})}_scheduleActiveIndicatorLayout(){this._indicatorFrame&&cancelAnimationFrame(this._indicatorFrame),this._indicatorFrame=requestAnimationFrame(()=>{this._indicatorFrame=0,this._updateActiveIndicator()})}_updateActiveIndicator(){let e=this._navEl;if(!e)return;let t=this._resolvedActiveKey(),r=t?e.querySelector(`button.tab-button[data-key="${CSS.escape(t)}"]`):null;if(!r){e.style.setProperty("--lui-tab-indicator-opacity","0");return}let n=e.getBoundingClientRect(),s=r.getBoundingClientRect(),d=r.offsetWidth||s.width,h=r.offsetHeight||s.height;e.style.setProperty("--lui-tab-indicator-x",`${s.left-n.left+e.scrollLeft}px`),e.style.setProperty("--lui-tab-indicator-y",`${s.top-n.top+e.scrollTop}px`),e.style.setProperty("--lui-tab-indicator-width",`${d}px`),e.style.setProperty("--lui-tab-indicator-height",`${h}px`),e.style.setProperty("--lui-tab-indicator-opacity","1")}_isHorizontal(){return this.placement==="top"||this.placement==="bottom"}_tabWidthBudget(){return Math.floor(this._navEl?.clientWidth??0)}_visibleIndexesForAuto(e){if(this.collapse!=="auto"||!this._isHorizontal()||e.length<=1)return e.map((k,C)=>C);let t=this._tabWidthBudget(),r=Array.from(this.renderRoot.querySelectorAll("[data-measure-tab-index]")),n=this.renderRoot.querySelector("[data-measure-overflow-trigger]");if(!t||r.length!==e.length||!n)return e.map((k,C)=>C);let s=Number.parseFloat(getComputedStyle(this._navEl).columnGap||"0")||0,d=r.map(k=>Math.ceil(k.getBoundingClientRect().width)),h=Math.ceil(n.getBoundingClientRect().width);if(d.reduce((k,C)=>k+C,0)+Math.max(0,e.length-1)*s<=t)return e.map((k,C)=>C);let f=[],x=h;for(let k=0;k<e.length;k+=1){let C=d[k]??0,S=x+(f.length>0?s:0)+C;S<=t&&(f.push(k),x=S)}return f}_recomputeOverflow(){let e=this._tabs(),t=new Set(this._visibleIndexesForAuto(e)),r=e.map((n,s)=>s).filter(n=>!t.has(n));Kv(r,this._overflowIndexes)||(this._overflowIndexes=r)}_overflowMenuItems(e,t){return this._overflowIndexes.flatMap(r=>{let n=e[r];if(!n)return[];let s=Zo(n,r);return[{key:s,value:String(r),label:n.label??s,icon:n.icon,disabled:this.disabled||n.disabled,active:s===t}]})}_onOverflowSelect(e,t){let r=Number(e.detail?.value),n=t[r];n&&this._select(n,r)}_renderTab(e,t,r){let n=Zo(e,t),s=n===r,d=e.closable??this.closable;return Ro`
6889
6889
  <button
6890
6890
  class=${`tab-button ${s?"active":""}`}
6891
6891
  part="tab"
@@ -7498,11 +7498,11 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
7498
7498
  transition-duration: 0.01ms;
7499
7499
  }
7500
7500
  }
7501
- `],a([kr()],yr.prototype,"key",2),a([kr()],yr.prototype,"value",2),a([kr()],yr.prototype,"label",2),a([kr()],yr.prototype,"description",2),a([kr()],yr.prototype,"icon",2),a([kr()],yr.prototype,"extra",2),a([kr({type:Boolean,reflect:!0})],yr.prototype,"disabled",2),a([kr({type:Boolean,reflect:!0})],yr.prototype,"open",2),a([kr({reflect:!0,attribute:"icon-placement"})],yr.prototype,"iconPlacement",2),yr=a([t1("lui-collapse-item")],yr);var Kr=class extends e1{constructor(){super(...arguments);this.variant="bordered";this.size="md";this.iconPlacement="end";this.accordion=!1;this.defaultOpenKeys="";this._internalOpen=null;this._items=[];this._onItemRequest=e=>{let t=e.target?.closest?.("lui-collapse-item");if(!t||t.disabled)return;e.stopPropagation();let r=this._items.indexOf(t);r<0||this._toggle(this._keyFor(t,r))};this._onSlotChange=()=>{this._items=Array.from(this.querySelectorAll("lui-collapse-item")),this._syncItems()}}connectedCallback(){super.connectedCallback(),this.addEventListener("item-toggle-request",this._onItemRequest)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("item-toggle-request",this._onItemRequest)}get _openList(){return this.openKeys!==void 0?this.openKeys:this._internalOpen!==null?this._internalOpen:this.defaultOpenKeys.split(",").map(e=>e.trim()).filter(Boolean)}_keyFor(e,t){return e.itemKey||String(t)}_toggle(e){let t=new Set(this._openList),r=!t.has(e),n;this.accordion?n=r?[e]:[]:(r?t.add(e):t.delete(e),n=[...t]);let s={key:e,open:r,openKeys:n},d=new CustomEvent("toggle",{detail:s,bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(d)&&(this.openKeys===void 0&&(this._internalOpen=n,this._syncItems(n)),this.dispatchEvent(new CustomEvent("change",{detail:s,bubbles:!0,composed:!0})))}_syncItems(e=this._openList){let t=new Set(e);this._items.forEach((r,n)=>{r.open=t.has(this._keyFor(r,n)),r.iconPlacement=this.iconPlacement})}openAll(){if(this.accordion)return;let e=this._items.map((t,r)=>({item:t,key:this._keyFor(t,r)})).filter(({item:t})=>!t.disabled).map(({key:t})=>t);this._applyExternal(e,!0)}closeAll(){this._applyExternal([],!1)}_applyExternal(e,t){this.openKeys===void 0&&(this._internalOpen=e,this._syncItems(e)),this.dispatchEvent(new CustomEvent("change",{detail:{key:"",open:t,openKeys:e},bubbles:!0,composed:!0}))}updated(){this._syncItems()}render(){let t=F(this,"collapse").variant??this.variant;return Oa`
7501
+ `],a([kr()],yr.prototype,"key",2),a([kr()],yr.prototype,"value",2),a([kr()],yr.prototype,"label",2),a([kr()],yr.prototype,"description",2),a([kr()],yr.prototype,"icon",2),a([kr()],yr.prototype,"extra",2),a([kr({type:Boolean,reflect:!0})],yr.prototype,"disabled",2),a([kr({type:Boolean,reflect:!0})],yr.prototype,"open",2),a([kr({reflect:!0,attribute:"icon-placement"})],yr.prototype,"iconPlacement",2),yr=a([t1("lui-collapse-item")],yr);var Wr=class extends e1{constructor(){super(...arguments);this.variant="bordered";this.size="md";this.iconPlacement="end";this.accordion=!1;this.defaultOpenKeys="";this._internalOpen=null;this._items=[];this._onItemRequest=e=>{let t=e.target?.closest?.("lui-collapse-item");if(!t||t.disabled)return;e.stopPropagation();let r=this._items.indexOf(t);r<0||this._toggle(this._keyFor(t,r))};this._onSlotChange=()=>{this._items=Array.from(this.querySelectorAll("lui-collapse-item")),this._syncItems()}}connectedCallback(){super.connectedCallback(),this.addEventListener("item-toggle-request",this._onItemRequest)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("item-toggle-request",this._onItemRequest)}get _openList(){return this.openKeys!==void 0?this.openKeys:this._internalOpen!==null?this._internalOpen:this.defaultOpenKeys.split(",").map(e=>e.trim()).filter(Boolean)}_keyFor(e,t){return e.itemKey||String(t)}_toggle(e){let t=new Set(this._openList),r=!t.has(e),n;this.accordion?n=r?[e]:[]:(r?t.add(e):t.delete(e),n=[...t]);let s={key:e,open:r,openKeys:n},d=new CustomEvent("toggle",{detail:s,bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(d)&&(this.openKeys===void 0&&(this._internalOpen=n,this._syncItems(n)),this.dispatchEvent(new CustomEvent("change",{detail:s,bubbles:!0,composed:!0})))}_syncItems(e=this._openList){let t=new Set(e);this._items.forEach((r,n)=>{r.open=t.has(this._keyFor(r,n)),r.iconPlacement=this.iconPlacement})}openAll(){if(this.accordion)return;let e=this._items.map((t,r)=>({item:t,key:this._keyFor(t,r)})).filter(({item:t})=>!t.disabled).map(({key:t})=>t);this._applyExternal(e,!0)}closeAll(){this._applyExternal([],!1)}_applyExternal(e,t){this.openKeys===void 0&&(this._internalOpen=e,this._syncItems(e)),this.dispatchEvent(new CustomEvent("change",{detail:{key:"",open:t,openKeys:e},bubbles:!0,composed:!0}))}updated(){this._syncItems()}render(){let t=F(this,"collapse").variant??this.variant;return Oa`
7502
7502
  <div class="root" part="base" data-variant=${t}>
7503
7503
  <slot @slotchange=${this._onSlotChange}></slot>
7504
7504
  </div>
7505
- `}};Kr.styles=[A,O,Jp`
7505
+ `}};Wr.styles=[A,O,Jp`
7506
7506
  :host {
7507
7507
  display: block;
7508
7508
  --lui-collapse-radius: var(--lui-radius);
@@ -7544,7 +7544,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
7544
7544
  :host([variant="plain"]) ::slotted(lui-collapse-item + lui-collapse-item) {
7545
7545
  border-top: 1px solid color-mix(in srgb, var(--lui-color-border) 72%, transparent);
7546
7546
  }
7547
- `],a([kr({reflect:!0})],Kr.prototype,"variant",2),a([kr({reflect:!0})],Kr.prototype,"size",2),a([kr({reflect:!0,attribute:"icon-placement"})],Kr.prototype,"iconPlacement",2),a([kr({type:Boolean,reflect:!0})],Kr.prototype,"accordion",2),a([kr({attribute:!1})],Kr.prototype,"openKeys",2),a([kr({attribute:"default-open-keys"})],Kr.prototype,"defaultOpenKeys",2),a([Wv()],Kr.prototype,"_internalOpen",2),Kr=a([t1("lui-collapse")],Kr);import{css as Uv,html as Sn,LitElement as Gv,nothing as ol}from"lit";import{customElement as Yv,property as xr,state as Xv}from"lit/decorators.js";var r1=[{color:"var(--lui-color-info)",bgMix:18,fgMix:92},{color:"oklch(64% 0.22 295)",bgMix:18,fgMix:88},{color:"var(--lui-color-success)",bgMix:16,fgMix:90},{color:"var(--lui-color-warning)",bgMix:18,fgMix:94},{color:"var(--lui-color-danger)",bgMix:16,fgMix:92},{color:"oklch(70% 0.16 185)",bgMix:16,fgMix:88},{color:"oklch(66% 0.24 310)",bgMix:18,fgMix:90},{color:"var(--lui-color-fg-muted)",bgMix:16,fgMix:88}],ut=class extends Gv{constructor(){super(...arguments);this.src="";this.alt="";this.name="";this.text="";this.icon="user";this.size="md";this.radius="full";this.color="auto";this.status="none";this.statusColor="";this.statusPosition="top-right";this.clickable=!1;this.disabled=!1;this.tooltip="";this.tooltipPlacement="top";this._imageError=!1;this._explicitAttrs=new Set;this._onImageError=()=>{this._imageError=!0};this._onClick=e=>{this.disabled&&(e.preventDefault(),e.stopPropagation())};this._onKeyDown=e=>{!this.clickable||this.disabled||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this._emitKeyboardClick())}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){e.has("src")&&(this._imageError=!1);let t=F(this,"avatar");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("color")&&typeof t.color=="string"&&this.color!==t.color&&(this.color=t.color),!this._explicitAttrs.has("status")&&typeof t.status=="string"&&this.status!==t.status&&(this.status=t.status),!this._explicitAttrs.has("status-position")&&typeof t.statusPosition=="string"&&this.statusPosition!==t.statusPosition&&(this.statusPosition=t.statusPosition),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("clickable")&&typeof t.clickable=="boolean"&&this.clickable!==t.clickable&&(this.clickable=t.clickable)}_getSeed(){return this.text||this.name||this.alt||this.icon||"avatar"}_getInitials(){let e=(this.text||this.name||this.alt||"").trim();if(!e)return"";let t=e.split(/[\s\-_]+/).map(r=>r.trim()).filter(Boolean);return t.length>=2?`${t[0][0]??""}${t[t.length-1][0]??""}`.toUpperCase():e.length<=2?e.toUpperCase():e.slice(0,2).toUpperCase()}_getAutoPaletteStyle(){if(this.color!=="auto"||this.src&&!this._imageError)return"";let e=this._getSeed(),t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;let r=r1[t%r1.length];return`--lui-avatar-bg:color-mix(in srgb, ${r.color} ${r.bgMix}%, var(--lui-color-bg));--lui-avatar-fg:color-mix(in srgb, ${r.color} ${r.fgMix}%, var(--lui-color-fg));--lui-avatar-border:color-mix(in srgb, ${r.color} 24%, transparent);`}_getAvatarStyle(){return[this._getAutoPaletteStyle(),this.statusColor?`--lui-avatar-status-bg:${this.statusColor};`:""].filter(Boolean).join("")||ol}_emitKeyboardClick(){this.disabled||!this.clickable||this.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0}))}_renderAvatar(){let e=!!this.src&&!this._imageError,t=this._getInitials(),r=this.alt||this.name||this.text||"avatar",n=this.status!=="none"||!!this.statusColor;return Sn`
7547
+ `],a([kr({reflect:!0})],Wr.prototype,"variant",2),a([kr({reflect:!0})],Wr.prototype,"size",2),a([kr({reflect:!0,attribute:"icon-placement"})],Wr.prototype,"iconPlacement",2),a([kr({type:Boolean,reflect:!0})],Wr.prototype,"accordion",2),a([kr({attribute:!1})],Wr.prototype,"openKeys",2),a([kr({attribute:"default-open-keys"})],Wr.prototype,"defaultOpenKeys",2),a([Wv()],Wr.prototype,"_internalOpen",2),Wr=a([t1("lui-collapse")],Wr);import{css as Uv,html as Sn,LitElement as Gv,nothing as ol}from"lit";import{customElement as Yv,property as xr,state as Xv}from"lit/decorators.js";var r1=[{color:"var(--lui-color-info)",bgMix:18,fgMix:92},{color:"oklch(64% 0.22 295)",bgMix:18,fgMix:88},{color:"var(--lui-color-success)",bgMix:16,fgMix:90},{color:"var(--lui-color-warning)",bgMix:18,fgMix:94},{color:"var(--lui-color-danger)",bgMix:16,fgMix:92},{color:"oklch(70% 0.16 185)",bgMix:16,fgMix:88},{color:"oklch(66% 0.24 310)",bgMix:18,fgMix:90},{color:"var(--lui-color-fg-muted)",bgMix:16,fgMix:88}],ut=class extends Gv{constructor(){super(...arguments);this.src="";this.alt="";this.name="";this.text="";this.icon="user";this.size="md";this.radius="full";this.color="auto";this.status="none";this.statusColor="";this.statusPosition="top-right";this.clickable=!1;this.disabled=!1;this.tooltip="";this.tooltipPlacement="top";this._imageError=!1;this._explicitAttrs=new Set;this._onImageError=()=>{this._imageError=!0};this._onClick=e=>{this.disabled&&(e.preventDefault(),e.stopPropagation())};this._onKeyDown=e=>{!this.clickable||this.disabled||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this._emitKeyboardClick())}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(e){e.has("src")&&(this._imageError=!1);let t=F(this,"avatar");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("color")&&typeof t.color=="string"&&this.color!==t.color&&(this.color=t.color),!this._explicitAttrs.has("status")&&typeof t.status=="string"&&this.status!==t.status&&(this.status=t.status),!this._explicitAttrs.has("status-position")&&typeof t.statusPosition=="string"&&this.statusPosition!==t.statusPosition&&(this.statusPosition=t.statusPosition),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("clickable")&&typeof t.clickable=="boolean"&&this.clickable!==t.clickable&&(this.clickable=t.clickable)}_getSeed(){return this.text||this.name||this.alt||this.icon||"avatar"}_getInitials(){let e=(this.text||this.name||this.alt||"").trim();if(!e)return"";let t=e.split(/[\s\-_]+/).map(r=>r.trim()).filter(Boolean);return t.length>=2?`${t[0][0]??""}${t[t.length-1][0]??""}`.toUpperCase():e.length<=2?e.toUpperCase():e.slice(0,2).toUpperCase()}_getAutoPaletteStyle(){if(this.color!=="auto"||this.src&&!this._imageError)return"";let e=this._getSeed(),t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;let r=r1[t%r1.length];return`--lui-avatar-bg:color-mix(in srgb, ${r.color} ${r.bgMix}%, var(--lui-color-bg));--lui-avatar-fg:color-mix(in srgb, ${r.color} ${r.fgMix}%, var(--lui-color-fg));--lui-avatar-border:color-mix(in srgb, ${r.color} 24%, transparent);`}_getAvatarStyle(){return[this._getAutoPaletteStyle(),this.statusColor?`--lui-avatar-status-bg:${this.statusColor};`:""].filter(Boolean).join("")||ol}_emitKeyboardClick(){this.disabled||!this.clickable||this.dispatchEvent(new MouseEvent("click",{bubbles:!0,composed:!0}))}_renderAvatar(){let e=!!this.src&&!this._imageError,t=this._getInitials(),r=this.alt||this.name||this.text||"avatar",n=this.status!=="none"||!!this.statusColor;return Sn`
7548
7548
  <span
7549
7549
  class="avatar"
7550
7550
  part="base"
@@ -7871,7 +7871,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
7871
7871
  font-size: var(--lui-font-size-xs);
7872
7872
  color: var(--lui-color-muted);
7873
7873
  }
7874
- `],a([yo({reflect:!0})],At.prototype,"size",2),a([yo({reflect:!0})],At.prototype,"radius",2),a([yo({type:Number})],At.prototype,"max",2),a([yo({type:Number})],At.prototype,"overlap",2),a([yo({type:Number})],At.prototype,"total",2),a([yo({attribute:!1})],At.prototype,"items",2),a([yo({type:Boolean})],At.prototype,"bordered",2),a([yo({reflect:!0})],At.prototype,"summaryColor",2),a([yo({reflect:!0,attribute:"expand-trigger"})],At.prototype,"expandTrigger",2),a([yo({attribute:"summary-text"})],At.prototype,"summaryText",2),a([yo({reflect:!0,attribute:"status-position"})],At.prototype,"statusPosition",2),a([eb({flatten:!0})],At.prototype,"_assignedElements",2),a([tb()],At.prototype,"_slotHiddenCount",2),At=a([Jv("lui-avatar-group")],At);import{css as vb,html as Tn,LitElement as bb,nothing as An}from"lit";typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(o,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var t=document.createEvent("CustomEvent");return t.initCustomEvent(o,e.bubbles,e.cancelable,e.detail),t}));var rb=typeof document<"u"&&!!document.documentMode,rd;function ob(){return rd||(rd=document.createElement("div").style)}var o1=["webkit","moz","ms"],il={};function ld(i){if(il[i])return il[i];let o=ob();if(i in o)return il[i]=i;let e=i[0].toUpperCase()+i.slice(1),t=o1.length;for(;t--;){let r=`${o1[t]}${e}`;if(r in o)return il[i]=r}}function nl(i,o){return parseFloat(o[ld(i)])||0}function al(i,o,e=window.getComputedStyle(i)){let t=o==="border"?"Width":"";return{left:nl(`${o}Left${t}`,e),right:nl(`${o}Right${t}`,e),top:nl(`${o}Top${t}`,e),bottom:nl(`${o}Bottom${t}`,e)}}function $n(i,o,e){i.style[ld(o)]=e}function ib(i,o){let e=ld("transform");$n(i,"transition",`${e} ${o.duration}ms ${o.easing}`)}function nb(i,{x:o,y:e,scale:t,isSVG:r},n){if($n(i,"transform",`scale(${t}) translate(${o}px, ${e}px)`),r&&rb){let s=window.getComputedStyle(i).getPropertyValue("transform");i.setAttribute("transform",s)}}function od(i){let o=i.parentNode;(!o||o.nodeType!==1)&&(o=document.documentElement);let e=window.getComputedStyle(i),t=window.getComputedStyle(o),r=i.getBoundingClientRect(),n=o.getBoundingClientRect();return{elem:{style:e,width:r.width,height:r.height,top:r.top,bottom:r.bottom,left:r.left,right:r.right,margin:al(i,"margin",e),border:al(i,"border",e)},parent:{style:t,width:n.width,height:n.height,top:n.top,bottom:n.bottom,left:n.left,right:n.right,padding:al(o,"padding",t),border:al(o,"border",t)}}}var Ha={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?Ha={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(Ha={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function id(i,o,e,t){Ha[i].split(" ").forEach(r=>{o.addEventListener(r,e,t)})}function nd(i,o,e){Ha[i].split(" ").forEach(t=>{o.removeEventListener(t,e)})}function n1(i,o){let e=i.length;for(;e--;)if(i[e].pointerId===o.pointerId)return e;return-1}function sd(i,o){let e;if(o.touches){e=0;for(let t of o.touches)t.pointerId=e++,sd(i,t);return}e=n1(i,o),e>-1&&i.splice(e,1),i.push(o)}function ab(i,o){if(o.touches){for(;i.length;)i.pop();return}let e=n1(i,o);e>-1&&i.splice(e,1)}function i1(i){i=i.slice(0);let o=i.pop(),e;for(;e=i.pop();)o={clientX:(e.clientX-o.clientX)/2+o.clientX,clientY:(e.clientY-o.clientY)/2+o.clientY};return o}function ad(i){if(i.length<2)return 0;let o=i[0],e=i[1];return Math.sqrt(Math.pow(Math.abs(e.clientX-o.clientX),2)+Math.pow(Math.abs(e.clientY-o.clientY),2))}function sb(i){let o=i;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1}function lb(i){return(i.getAttribute("class")||"").trim()}function cb(i,o){return i.nodeType===1&&` ${lb(i)} `.indexOf(` ${o} `)>-1}function db(i,o){for(let e=i;e!=null;e=e.parentNode)if(cb(e,o.excludeClass)||o.exclude.indexOf(e)>-1)return!0;return!1}var ub=/^http:[\w\.\/]+svg$/;function hb(i){return ub.test(i.namespaceURI)&&i.nodeName.toLowerCase()!=="svg"}function pb(i){let o={};for(let e in i)i.hasOwnProperty(e)&&(o[e]=i[e]);return o}var a1={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:i=>{i.preventDefault(),i.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:nb,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function cd(i,o){if(!i)throw new Error("Panzoom requires an element as an argument");if(i.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!sb(i))throw new Error("Panzoom should be called on elements that have been attached to the DOM");o={...a1,...o};let e=hb(i),t=i.parentNode;t.style.overflow=o.overflow,t.style.userSelect="none",t.style.touchAction=o.touchAction,(o.canvas?t:i).style.cursor=o.cursor,i.style.userSelect="none",i.style.touchAction=o.touchAction,$n(i,"transformOrigin",typeof o.origin=="string"?o.origin:e?"0 0":"50% 50%");function r(){t.style.overflow="",t.style.userSelect="",t.style.touchAction="",t.style.cursor="",i.style.cursor="",i.style.userSelect="",i.style.touchAction="",$n(i,"transformOrigin","")}function n(L={}){for(let J in L)L.hasOwnProperty(J)&&(o[J]=L[J]);(L.hasOwnProperty("cursor")||L.hasOwnProperty("canvas"))&&(t.style.cursor=i.style.cursor="",(o.canvas?t:i).style.cursor=o.cursor),L.hasOwnProperty("overflow")&&(t.style.overflow=L.overflow),L.hasOwnProperty("touchAction")&&(t.style.touchAction=L.touchAction,i.style.touchAction=L.touchAction)}let s=0,d=0,h=1,p=!1;z(o.startScale,{animate:!1,force:!0}),setTimeout(()=>{S(o.startX,o.startY,{animate:!1,force:!0})});function f(L,J,he){if(he.silent)return;let Oe=new CustomEvent(L,{detail:J});i.dispatchEvent(Oe)}function x(L,J,he){let Oe={x:s,y:d,scale:h,isSVG:e,originalEvent:he};return requestAnimationFrame(()=>{typeof J.animate=="boolean"&&(J.animate?ib(i,J):$n(i,"transition","none")),J.setTransform(i,Oe,J),f(L,Oe,J),f("panzoomchange",Oe,J)}),Oe}function k(L,J,he,Oe){let X={...o,...Oe},_e={x:s,y:d,opts:X};if(!Oe?.force&&(X.disablePan||X.panOnlyWhenZoomed&&h===X.startScale))return _e;if(L=parseFloat(L),J=parseFloat(J),X.disableXAxis||(_e.x=(X.relative?s:0)+L),X.disableYAxis||(_e.y=(X.relative?d:0)+J),X.contain){let ae=od(i),Tr=ae.elem.width/h,K=ae.elem.height/h,si=Tr*he,lo=K*he,Xr=(si-Tr)/2,co=(lo-K)/2;if(X.contain==="inside"){let li=(-ae.elem.margin.left-ae.parent.padding.left+Xr)/he,Bo=(ae.parent.width-si-ae.parent.padding.left-ae.elem.margin.left-ae.parent.border.left-ae.parent.border.right+Xr)/he;_e.x=Math.max(Math.min(_e.x,Bo),li);let uo=(-ae.elem.margin.top-ae.parent.padding.top+co)/he,ln=(ae.parent.height-lo-ae.parent.padding.top-ae.elem.margin.top-ae.parent.border.top-ae.parent.border.bottom+co)/he;_e.y=Math.max(Math.min(_e.y,ln),uo)}else if(X.contain==="outside"){let li=(-(si-ae.parent.width)-ae.parent.padding.left-ae.parent.border.left-ae.parent.border.right+Xr)/he,Bo=(Xr-ae.parent.padding.left)/he;_e.x=Math.max(Math.min(_e.x,Bo),li);let uo=(-(lo-ae.parent.height)-ae.parent.padding.top-ae.parent.border.top-ae.parent.border.bottom+co)/he,ln=(co-ae.parent.padding.top)/he;_e.y=Math.max(Math.min(_e.y,ln),uo)}}return X.roundPixels&&(_e.x=Math.round(_e.x),_e.y=Math.round(_e.y)),_e}function C(L,J){let he={...o,...J},Oe={scale:h,opts:he};if(!J?.force&&he.disableZoom)return Oe;let X=o.minScale,_e=o.maxScale;if(he.contain){let ae=od(i),Tr=ae.elem.width/h,K=ae.elem.height/h;if(Tr>1&&K>1){let si=ae.parent.width-ae.parent.border.left-ae.parent.border.right,lo=ae.parent.height-ae.parent.border.top-ae.parent.border.bottom,Xr=si/Tr,co=lo/K;o.contain==="inside"?_e=Math.min(_e,Xr,co):o.contain==="outside"&&(X=Math.max(X,Xr,co))}}return Oe.scale=Math.min(Math.max(L,X),_e),Oe}function S(L,J,he,Oe){let X=k(L,J,h,he);return s!==X.x||d!==X.y?(s=X.x,d=X.y,x("panzoompan",X.opts,Oe)):{x:s,y:d,scale:h,isSVG:e,originalEvent:Oe}}function z(L,J,he){let Oe=C(L,J),X=Oe.opts;if(!J?.force&&X.disableZoom)return;L=Oe.scale;let _e=s,ae=d;if(X.focal){let K=X.focal;_e=(K.x/L-K.x/h+s*L)/L,ae=(K.y/L-K.y/h+d*L)/L}let Tr=k(_e,ae,L,{relative:!1,force:!0});return s=Tr.x,d=Tr.y,h=L,x("panzoomzoom",X,he)}function T(L,J){let he={...o,animate:!0,...J};return z(h*Math.exp((L?1:-1)*he.step),he)}function P(L){return T(!0,L)}function H(L){return T(!1,L)}function R(L,J,he,Oe){let X=od(i),_e={width:X.parent.width-X.parent.padding.left-X.parent.padding.right-X.parent.border.left-X.parent.border.right,height:X.parent.height-X.parent.padding.top-X.parent.padding.bottom-X.parent.border.top-X.parent.border.bottom},ae=J.clientX-X.parent.left-X.parent.padding.left-X.parent.border.left-X.elem.margin.left,Tr=J.clientY-X.parent.top-X.parent.padding.top-X.parent.border.top-X.elem.margin.top;e||(ae-=X.elem.width/h/2,Tr-=X.elem.height/h/2);let K={x:ae/_e.width*(_e.width*L),y:Tr/_e.height*(_e.height*L)};return z(L,{...he,animate:!1,focal:K},Oe)}function N(L,J){L.preventDefault();let he={...o,...J,animate:!1},X=(L.deltaY===0&&L.deltaX?L.deltaX:L.deltaY)<0?1:-1,_e=C(h*Math.exp(X*he.step/3),he).scale;return R(_e,L,he,L)}function $(L){let J={...o,animate:!0,force:!0,...L};h=C(J.startScale,J).scale;let he=k(J.startX,J.startY,h,J);return s=he.x,d=he.y,x("panzoomreset",J)}let Q,fe,Te,et,we,ao,Fe=[];function Zt(L){if(db(L.target,o))return;sd(Fe,L),p=!0,o.handleStartEvent(L),Q=s,fe=d,f("panzoomstart",{x:s,y:d,scale:h,isSVG:e,originalEvent:L},o);let J=i1(Fe);Te=J.clientX,et=J.clientY,we=h,ao=ad(Fe)}function hr(L){if(!p||Q===void 0||fe===void 0||Te===void 0||et===void 0)return;sd(Fe,L);let J=i1(Fe),he=Fe.length>1,Oe=h;if(he){ao===0&&(ao=ad(Fe));let X=ad(Fe)-ao;Oe=C(X*o.step/80+we).scale,R(Oe,J,{animate:!1},L)}(!he||o.pinchAndPan)&&S(Q+(J.clientX-Te)/Oe,fe+(J.clientY-et)/Oe,{animate:!1},L)}function so(L){Fe.length===1&&f("panzoomend",{x:s,y:d,scale:h,isSVG:e,originalEvent:L},o),ab(Fe,L),p&&(p=!1,Q=fe=Te=et=void 0)}let sn=!1;function Yr(){sn||(sn=!0,id("down",o.canvas?t:i,Zt),id("move",document,hr,{passive:!0}),id("up",document,so,{passive:!0}))}function Po(){sn=!1,nd("down",o.canvas?t:i,Zt),nd("move",document,hr),nd("up",document,so)}return o.noBind||Yr(),{bind:Yr,destroy:Po,eventNames:Ha,getPan:()=>({x:s,y:d}),getScale:()=>h,getOptions:()=>pb(o),handleDown:Zt,handleMove:hr,handleUp:so,pan:S,reset:$,resetStyle:r,setOptions:n,setStyle:(L,J)=>$n(i,L,J),zoom:z,zoomIn:P,zoomOut:H,zoomToPoint:R,zoomWithWheel:N}}cd.defaultOptions=a1;import{customElement as yb,property as rr,query as dd,state as Pn}from"lit/decorators.js";import{css as mb,html as Ki,LitElement as gb,nothing as s1}from"lit";import{customElement as fb,property as Io}from"lit/decorators.js";var l1={fromAttribute(i){return i==null?!0:i!=="false"&&i!=="0"},toAttribute(i){return i?"":"false"}};function sl(i){return i==null||i===""?"":mt(i)}var tr=class extends gb{constructor(){super(...arguments);this.loading=!0;this.active=!0;this.variant="text";this.size="md";this.radius="md";this.rows=3;this.pauseWhenHidden=!0;this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._setupIntersectionObserver()}disconnectedCallback(){super.disconnectedCallback(),this._intersectionObserver?.disconnect()}_setupIntersectionObserver(){this._intersectionObserver?.disconnect(),this.dataset.inView="true",!(!this.pauseWhenHidden||typeof IntersectionObserver>"u")&&(this._intersectionObserver=new IntersectionObserver(e=>{let t=e[0];this.dataset.inView=t?.isIntersecting?"true":"false"}),this._intersectionObserver.observe(this))}willUpdate(e){e.has("pauseWhenHidden")&&this._setupIntersectionObserver();let t=F(this,"skeleton");!this._explicitAttrs.has("active")&&typeof t.active=="boolean"&&this.active!==t.active&&(this.active=t.active),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("rows")&&typeof t.rows=="number"&&this.rows!==t.rows&&(this.rows=t.rows)}_hostStyle(){let e=[this.width!=null&&this.variant!=="text"?`--lui-skeleton-width:${sl(this.width)}`:"",this.height!=null?`--lui-skeleton-height:${sl(this.height)}`:""].filter(Boolean);return e.length?e.join(";"):s1}_lineWidth(e,t){let r=this.widths?.[e];return r!=null?sl(r):this.width!=null&&t===1?sl(this.width):e===t-1&&t>1?"68%":e===0&&t>2?"92%":"100%"}_renderText(e=this.rows){let t=Math.max(1,Math.floor(e||1));return Ki`
7874
+ `],a([yo({reflect:!0})],At.prototype,"size",2),a([yo({reflect:!0})],At.prototype,"radius",2),a([yo({type:Number})],At.prototype,"max",2),a([yo({type:Number})],At.prototype,"overlap",2),a([yo({type:Number})],At.prototype,"total",2),a([yo({attribute:!1})],At.prototype,"items",2),a([yo({type:Boolean})],At.prototype,"bordered",2),a([yo({reflect:!0})],At.prototype,"summaryColor",2),a([yo({reflect:!0,attribute:"expand-trigger"})],At.prototype,"expandTrigger",2),a([yo({attribute:"summary-text"})],At.prototype,"summaryText",2),a([yo({reflect:!0,attribute:"status-position"})],At.prototype,"statusPosition",2),a([eb({flatten:!0})],At.prototype,"_assignedElements",2),a([tb()],At.prototype,"_slotHiddenCount",2),At=a([Jv("lui-avatar-group")],At);import{css as vb,html as Tn,LitElement as bb,nothing as An}from"lit";typeof window<"u"&&(window.NodeList&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach),typeof window.CustomEvent!="function"&&(window.CustomEvent=function(o,e){e=e||{bubbles:!1,cancelable:!1,detail:null};var t=document.createEvent("CustomEvent");return t.initCustomEvent(o,e.bubbles,e.cancelable,e.detail),t}));var rb=typeof document<"u"&&!!document.documentMode,rd;function ob(){return rd||(rd=document.createElement("div").style)}var o1=["webkit","moz","ms"],il={};function ld(i){if(il[i])return il[i];let o=ob();if(i in o)return il[i]=i;let e=i[0].toUpperCase()+i.slice(1),t=o1.length;for(;t--;){let r=`${o1[t]}${e}`;if(r in o)return il[i]=r}}function nl(i,o){return parseFloat(o[ld(i)])||0}function al(i,o,e=window.getComputedStyle(i)){let t=o==="border"?"Width":"";return{left:nl(`${o}Left${t}`,e),right:nl(`${o}Right${t}`,e),top:nl(`${o}Top${t}`,e),bottom:nl(`${o}Bottom${t}`,e)}}function $n(i,o,e){i.style[ld(o)]=e}function ib(i,o){let e=ld("transform");$n(i,"transition",`${e} ${o.duration}ms ${o.easing}`)}function nb(i,{x:o,y:e,scale:t,isSVG:r},n){if($n(i,"transform",`scale(${t}) translate(${o}px, ${e}px)`),r&&rb){let s=window.getComputedStyle(i).getPropertyValue("transform");i.setAttribute("transform",s)}}function od(i){let o=i.parentNode;(!o||o.nodeType!==1)&&(o=document.documentElement);let e=window.getComputedStyle(i),t=window.getComputedStyle(o),r=i.getBoundingClientRect(),n=o.getBoundingClientRect();return{elem:{style:e,width:r.width,height:r.height,top:r.top,bottom:r.bottom,left:r.left,right:r.right,margin:al(i,"margin",e),border:al(i,"border",e)},parent:{style:t,width:n.width,height:n.height,top:n.top,bottom:n.bottom,left:n.left,right:n.right,padding:al(o,"padding",t),border:al(o,"border",t)}}}var Ha={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?Ha={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(Ha={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function id(i,o,e,t){Ha[i].split(" ").forEach(r=>{o.addEventListener(r,e,t)})}function nd(i,o,e){Ha[i].split(" ").forEach(t=>{o.removeEventListener(t,e)})}function n1(i,o){let e=i.length;for(;e--;)if(i[e].pointerId===o.pointerId)return e;return-1}function sd(i,o){let e;if(o.touches){e=0;for(let t of o.touches)t.pointerId=e++,sd(i,t);return}e=n1(i,o),e>-1&&i.splice(e,1),i.push(o)}function ab(i,o){if(o.touches){for(;i.length;)i.pop();return}let e=n1(i,o);e>-1&&i.splice(e,1)}function i1(i){i=i.slice(0);let o=i.pop(),e;for(;e=i.pop();)o={clientX:(e.clientX-o.clientX)/2+o.clientX,clientY:(e.clientY-o.clientY)/2+o.clientY};return o}function ad(i){if(i.length<2)return 0;let o=i[0],e=i[1];return Math.sqrt(Math.pow(Math.abs(e.clientX-o.clientX),2)+Math.pow(Math.abs(e.clientY-o.clientY),2))}function sb(i){let o=i;for(;o&&o.parentNode;){if(o.parentNode===document)return!0;o=o.parentNode instanceof ShadowRoot?o.parentNode.host:o.parentNode}return!1}function lb(i){return(i.getAttribute("class")||"").trim()}function cb(i,o){return i.nodeType===1&&` ${lb(i)} `.indexOf(` ${o} `)>-1}function db(i,o){for(let e=i;e!=null;e=e.parentNode)if(cb(e,o.excludeClass)||o.exclude.indexOf(e)>-1)return!0;return!1}var ub=/^http:[\w\.\/]+svg$/;function hb(i){return ub.test(i.namespaceURI)&&i.nodeName.toLowerCase()!=="svg"}function pb(i){let o={};for(let e in i)i.hasOwnProperty(e)&&(o[e]=i[e]);return o}var a1={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:i=>{i.preventDefault(),i.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:nb,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function cd(i,o){if(!i)throw new Error("Panzoom requires an element as an argument");if(i.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!sb(i))throw new Error("Panzoom should be called on elements that have been attached to the DOM");o={...a1,...o};let e=hb(i),t=i.parentNode;t.style.overflow=o.overflow,t.style.userSelect="none",t.style.touchAction=o.touchAction,(o.canvas?t:i).style.cursor=o.cursor,i.style.userSelect="none",i.style.touchAction=o.touchAction,$n(i,"transformOrigin",typeof o.origin=="string"?o.origin:e?"0 0":"50% 50%");function r(){t.style.overflow="",t.style.userSelect="",t.style.touchAction="",t.style.cursor="",i.style.cursor="",i.style.userSelect="",i.style.touchAction="",$n(i,"transformOrigin","")}function n(L={}){for(let J in L)L.hasOwnProperty(J)&&(o[J]=L[J]);(L.hasOwnProperty("cursor")||L.hasOwnProperty("canvas"))&&(t.style.cursor=i.style.cursor="",(o.canvas?t:i).style.cursor=o.cursor),L.hasOwnProperty("overflow")&&(t.style.overflow=L.overflow),L.hasOwnProperty("touchAction")&&(t.style.touchAction=L.touchAction,i.style.touchAction=L.touchAction)}let s=0,d=0,h=1,p=!1;z(o.startScale,{animate:!1,force:!0}),setTimeout(()=>{S(o.startX,o.startY,{animate:!1,force:!0})});function f(L,J,he){if(he.silent)return;let Oe=new CustomEvent(L,{detail:J});i.dispatchEvent(Oe)}function x(L,J,he){let Oe={x:s,y:d,scale:h,isSVG:e,originalEvent:he};return requestAnimationFrame(()=>{typeof J.animate=="boolean"&&(J.animate?ib(i,J):$n(i,"transition","none")),J.setTransform(i,Oe,J),f(L,Oe,J),f("panzoomchange",Oe,J)}),Oe}function k(L,J,he,Oe){let X={...o,...Oe},_e={x:s,y:d,opts:X};if(!Oe?.force&&(X.disablePan||X.panOnlyWhenZoomed&&h===X.startScale))return _e;if(L=parseFloat(L),J=parseFloat(J),X.disableXAxis||(_e.x=(X.relative?s:0)+L),X.disableYAxis||(_e.y=(X.relative?d:0)+J),X.contain){let ae=od(i),Tr=ae.elem.width/h,K=ae.elem.height/h,si=Tr*he,lo=K*he,Zr=(si-Tr)/2,co=(lo-K)/2;if(X.contain==="inside"){let li=(-ae.elem.margin.left-ae.parent.padding.left+Zr)/he,Bo=(ae.parent.width-si-ae.parent.padding.left-ae.elem.margin.left-ae.parent.border.left-ae.parent.border.right+Zr)/he;_e.x=Math.max(Math.min(_e.x,Bo),li);let uo=(-ae.elem.margin.top-ae.parent.padding.top+co)/he,ln=(ae.parent.height-lo-ae.parent.padding.top-ae.elem.margin.top-ae.parent.border.top-ae.parent.border.bottom+co)/he;_e.y=Math.max(Math.min(_e.y,ln),uo)}else if(X.contain==="outside"){let li=(-(si-ae.parent.width)-ae.parent.padding.left-ae.parent.border.left-ae.parent.border.right+Zr)/he,Bo=(Zr-ae.parent.padding.left)/he;_e.x=Math.max(Math.min(_e.x,Bo),li);let uo=(-(lo-ae.parent.height)-ae.parent.padding.top-ae.parent.border.top-ae.parent.border.bottom+co)/he,ln=(co-ae.parent.padding.top)/he;_e.y=Math.max(Math.min(_e.y,ln),uo)}}return X.roundPixels&&(_e.x=Math.round(_e.x),_e.y=Math.round(_e.y)),_e}function C(L,J){let he={...o,...J},Oe={scale:h,opts:he};if(!J?.force&&he.disableZoom)return Oe;let X=o.minScale,_e=o.maxScale;if(he.contain){let ae=od(i),Tr=ae.elem.width/h,K=ae.elem.height/h;if(Tr>1&&K>1){let si=ae.parent.width-ae.parent.border.left-ae.parent.border.right,lo=ae.parent.height-ae.parent.border.top-ae.parent.border.bottom,Zr=si/Tr,co=lo/K;o.contain==="inside"?_e=Math.min(_e,Zr,co):o.contain==="outside"&&(X=Math.max(X,Zr,co))}}return Oe.scale=Math.min(Math.max(L,X),_e),Oe}function S(L,J,he,Oe){let X=k(L,J,h,he);return s!==X.x||d!==X.y?(s=X.x,d=X.y,x("panzoompan",X.opts,Oe)):{x:s,y:d,scale:h,isSVG:e,originalEvent:Oe}}function z(L,J,he){let Oe=C(L,J),X=Oe.opts;if(!J?.force&&X.disableZoom)return;L=Oe.scale;let _e=s,ae=d;if(X.focal){let K=X.focal;_e=(K.x/L-K.x/h+s*L)/L,ae=(K.y/L-K.y/h+d*L)/L}let Tr=k(_e,ae,L,{relative:!1,force:!0});return s=Tr.x,d=Tr.y,h=L,x("panzoomzoom",X,he)}function T(L,J){let he={...o,animate:!0,...J};return z(h*Math.exp((L?1:-1)*he.step),he)}function P(L){return T(!0,L)}function H(L){return T(!1,L)}function R(L,J,he,Oe){let X=od(i),_e={width:X.parent.width-X.parent.padding.left-X.parent.padding.right-X.parent.border.left-X.parent.border.right,height:X.parent.height-X.parent.padding.top-X.parent.padding.bottom-X.parent.border.top-X.parent.border.bottom},ae=J.clientX-X.parent.left-X.parent.padding.left-X.parent.border.left-X.elem.margin.left,Tr=J.clientY-X.parent.top-X.parent.padding.top-X.parent.border.top-X.elem.margin.top;e||(ae-=X.elem.width/h/2,Tr-=X.elem.height/h/2);let K={x:ae/_e.width*(_e.width*L),y:Tr/_e.height*(_e.height*L)};return z(L,{...he,animate:!1,focal:K},Oe)}function N(L,J){L.preventDefault();let he={...o,...J,animate:!1},X=(L.deltaY===0&&L.deltaX?L.deltaX:L.deltaY)<0?1:-1,_e=C(h*Math.exp(X*he.step/3),he).scale;return R(_e,L,he,L)}function $(L){let J={...o,animate:!0,force:!0,...L};h=C(J.startScale,J).scale;let he=k(J.startX,J.startY,h,J);return s=he.x,d=he.y,x("panzoomreset",J)}let Q,fe,Te,et,we,ao,Fe=[];function Zt(L){if(db(L.target,o))return;sd(Fe,L),p=!0,o.handleStartEvent(L),Q=s,fe=d,f("panzoomstart",{x:s,y:d,scale:h,isSVG:e,originalEvent:L},o);let J=i1(Fe);Te=J.clientX,et=J.clientY,we=h,ao=ad(Fe)}function hr(L){if(!p||Q===void 0||fe===void 0||Te===void 0||et===void 0)return;sd(Fe,L);let J=i1(Fe),he=Fe.length>1,Oe=h;if(he){ao===0&&(ao=ad(Fe));let X=ad(Fe)-ao;Oe=C(X*o.step/80+we).scale,R(Oe,J,{animate:!1},L)}(!he||o.pinchAndPan)&&S(Q+(J.clientX-Te)/Oe,fe+(J.clientY-et)/Oe,{animate:!1},L)}function so(L){Fe.length===1&&f("panzoomend",{x:s,y:d,scale:h,isSVG:e,originalEvent:L},o),ab(Fe,L),p&&(p=!1,Q=fe=Te=et=void 0)}let sn=!1;function Xr(){sn||(sn=!0,id("down",o.canvas?t:i,Zt),id("move",document,hr,{passive:!0}),id("up",document,so,{passive:!0}))}function Po(){sn=!1,nd("down",o.canvas?t:i,Zt),nd("move",document,hr),nd("up",document,so)}return o.noBind||Xr(),{bind:Xr,destroy:Po,eventNames:Ha,getPan:()=>({x:s,y:d}),getScale:()=>h,getOptions:()=>pb(o),handleDown:Zt,handleMove:hr,handleUp:so,pan:S,reset:$,resetStyle:r,setOptions:n,setStyle:(L,J)=>$n(i,L,J),zoom:z,zoomIn:P,zoomOut:H,zoomToPoint:R,zoomWithWheel:N}}cd.defaultOptions=a1;import{customElement as yb,property as rr,query as dd,state as Pn}from"lit/decorators.js";import{css as mb,html as Ki,LitElement as gb,nothing as s1}from"lit";import{customElement as fb,property as Io}from"lit/decorators.js";var l1={fromAttribute(i){return i==null?!0:i!=="false"&&i!=="0"},toAttribute(i){return i?"":"false"}};function sl(i){return i==null||i===""?"":mt(i)}var tr=class extends gb{constructor(){super(...arguments);this.loading=!0;this.active=!0;this.variant="text";this.size="md";this.radius="md";this.rows=3;this.pauseWhenHidden=!0;this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._setupIntersectionObserver()}disconnectedCallback(){super.disconnectedCallback(),this._intersectionObserver?.disconnect()}_setupIntersectionObserver(){this._intersectionObserver?.disconnect(),this.dataset.inView="true",!(!this.pauseWhenHidden||typeof IntersectionObserver>"u")&&(this._intersectionObserver=new IntersectionObserver(e=>{let t=e[0];this.dataset.inView=t?.isIntersecting?"true":"false"}),this._intersectionObserver.observe(this))}willUpdate(e){e.has("pauseWhenHidden")&&this._setupIntersectionObserver();let t=F(this,"skeleton");!this._explicitAttrs.has("active")&&typeof t.active=="boolean"&&this.active!==t.active&&(this.active=t.active),!this._explicitAttrs.has("variant")&&typeof t.variant=="string"&&this.variant!==t.variant&&(this.variant=t.variant),!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("rows")&&typeof t.rows=="number"&&this.rows!==t.rows&&(this.rows=t.rows)}_hostStyle(){let e=[this.width!=null&&this.variant!=="text"?`--lui-skeleton-width:${sl(this.width)}`:"",this.height!=null?`--lui-skeleton-height:${sl(this.height)}`:""].filter(Boolean);return e.length?e.join(";"):s1}_lineWidth(e,t){let r=this.widths?.[e];return r!=null?sl(r):this.width!=null&&t===1?sl(this.width):e===t-1&&t>1?"68%":e===0&&t>2?"92%":"100%"}_renderText(e=this.rows){let t=Math.max(1,Math.floor(e||1));return Ki`
7875
7875
  <div class="text" part="text">
7876
7876
  ${Array.from({length:t},(r,n)=>Ki`
7877
7877
  <div class="piece line" part="line" style=${`width:${this._lineWidth(n,t)}`}></div>
@@ -8325,7 +8325,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
8325
8325
  border-radius: var(--lui-radius-lg);
8326
8326
  }
8327
8327
  }
8328
- `],a([rr()],Pe.prototype,"src",2),a([rr({attribute:"preview-src"})],Pe.prototype,"previewSrc",2),a([rr()],Pe.prototype,"alt",2),a([rr({attribute:"fallback-src"})],Pe.prototype,"fallbackSrc",2),a([rr()],Pe.prototype,"fallback",2),a([rr({reflect:!0})],Pe.prototype,"fit",2),a([rr({reflect:!0})],Pe.prototype,"radius",2),a([rr()],Pe.prototype,"width",2),a([rr()],Pe.prototype,"height",2),a([rr({attribute:"aspect-ratio"})],Pe.prototype,"aspectRatio",2),a([rr()],Pe.prototype,"position",2),a([rr({reflect:!0})],Pe.prototype,"loading",2),a([rr({type:Boolean,reflect:!0})],Pe.prototype,"skeleton",2),a([rr({type:Boolean,reflect:!0})],Pe.prototype,"preview",2),a([rr({type:Boolean,attribute:"show-preview-icon"})],Pe.prototype,"showPreviewIcon",2),a([rr({type:Boolean})],Pe.prototype,"draggablePreview",2),a([Pn()],Pe.prototype,"_loaded",2),a([Pn()],Pe.prototype,"_errored",2),a([Pn()],Pe.prototype,"_previewOpen",2),a([Pn()],Pe.prototype,"_zoom",2),a([Pn()],Pe.prototype,"_rotate",2),a([Pn()],Pe.prototype,"_panning",2),a([dd(".preview-image")],Pe.prototype,"_previewImageEl",2),a([dd(".preview-panzoom")],Pe.prototype,"_previewPanzoomEl",2),a([dd(".preview-stage")],Pe.prototype,"_previewStageEl",2),Pe=a([yb("lui-image")],Pe);import{css as Kb,html as Bn,LitElement as Wb,nothing as Fa}from"lit";import{customElement as Ub,property as Co,query as R1,state as pl}from"lit/decorators.js";var Ra=typeof window<"u"&&typeof window.document<"u",Or=Ra?window:{},ud=Ra?"ontouchstart"in Or.document.documentElement:!1,hd=Ra?"PointerEvent"in Or:!1,Ci="cropper",to=`${Ci}-canvas`,u1=`${Ci}-crosshair`,h1=`${Ci}-grid`,p1=`${Ci}-handle`,ko=`${Ci}-image`,wr=`${Ci}-selection`,m1=`${Ci}-shade`,g1=`${Ci}-viewer`,jn="select",ll="move",Jo="scale",Ia="rotate",On="transform",xo="none",pd="n-resize",md="e-resize",gd="s-resize",fd="w-resize",Hn="ne-resize",Rn="nw-resize",In="se-resize",Vn="sw-resize",f1="action",kb=ud?"touchend touchcancel":"mouseup",xb=ud?"touchmove":"mousemove",wb=ud?"touchstart":"mousedown",vd=hd?"pointerdown":wb,bd=hd?"pointermove":xb,yd=hd?"pointerup pointercancel":kb,kd="error",xd="keydown",zi="load",wd="resize",_d="wheel",ei="action",wo="actionend",v1="actionmove",_o="actionstart",Mo="change",Va="transform";function Dn(i){return typeof i=="string"}var Md=Number.isNaN||Or.isNaN;function ge(i){return typeof i=="number"&&!Md(i)}function or(i){return ge(i)&&i>0&&i<1/0}function b1(i){return typeof i>"u"}function Cd(i){return typeof i=="object"&&i!==null}var{hasOwnProperty:_b}=Object.prototype;function Fn(i){if(!Cd(i))return!1;try{let{constructor:o}=i,{prototype:e}=o;return o&&e&&_b.call(e,"isPrototypeOf")}catch{return!1}}function Nn(i){return typeof i=="function"}function ti(i){return typeof i=="object"&&i!==null&&i.nodeType===1}var Mb=/([a-z\d])([A-Z])/g;function zd(i){return String(i).replace(Mb,"$1-$2").toLowerCase()}var Cb=/-[A-z\d]/g;function Ed(i){return i.replace(Cb,o=>o.slice(1).toUpperCase())}var y1=/\s\s*/;function Be(i,o,e,t){o.trim().split(y1).forEach(r=>{i.removeEventListener(r,e,t)})}function We(i,o,e,t){o.trim().split(y1).forEach(r=>{i.addEventListener(r,e,t)})}function Sd(i,o,e,t){We(i,o,e,Object.assign(Object.assign({},t),{once:!0}))}var zb={bubbles:!0,cancelable:!0,composed:!0};function k1(i,o,e,t){return i.dispatchEvent(new CustomEvent(o,Object.assign(Object.assign(Object.assign({},zb),{detail:e}),t)))}function x1(i){return typeof i.composedPath=="function"&&i.composedPath().find(ti)||i.target}var c1=Promise.resolve();function w1(i,o){return o?c1.then(i?o.bind(i):o):c1}function cl(i){let o=i.getRootNode();switch(o.nodeType){case 1:return o.ownerDocument;case 9:return o;case 11:return o}return null}function $d(i){let{documentElement:o}=i.ownerDocument,e=i.getBoundingClientRect();return{left:e.left+(Or.pageXOffset-o.clientLeft),top:e.top+(Or.pageYOffset-o.clientTop)}}var Eb=/deg|g?rad|turn$/i;function dl(i){let o=parseFloat(i)||0;if(o!==0){let[e="rad"]=String(i).match(Eb)||[];switch(e.toLowerCase()){case"deg":return o/360*(Math.PI*2);case"grad":return o/400*(Math.PI*2);case"turn":return o*(Math.PI*2)}}return o}var d1="contain",Sb="cover";function Ln(i,o=d1){let{aspectRatio:e}=i,{width:t,height:r}=i,n=or(t),s=or(r);if(n&&s){let d=r*e;o===d1&&d>t||o===Sb&&d<t?r=t/e:t=r*e}else n?r=t/e:s&&(t=r*e);return{width:t,height:r}}function Td(i,...o){if(o.length===0)return i;let[e,t,r,n,s,d]=i,[h,p,f,x,k,C]=o[0];return i=[e*h+r*p,t*h+n*p,e*f+r*x,t*f+n*x,e*k+r*C+s,t*k+n*C+d],Td(i,...o.slice(1))}var $b=":host([hidden]){display:none!important}",Tb=/left|top|width|height/i,_1="open",ul=new WeakMap,hl=new WeakMap,M1=new Map,C1=Or.document&&Array.isArray(Or.document.adoptedStyleSheets)&&"replaceSync"in Or.CSSStyleSheet.prototype,Mt=class extends HTMLElement{get $sharedStyle(){return`${this.themeColor?`:host{--theme-color: ${this.themeColor};}`:""}${$b}`}constructor(){var o,e;super(),this.shadowRootMode=_1,this.slottable=!0;let t=(e=(o=Object.getPrototypeOf(this))===null||o===void 0?void 0:o.constructor)===null||e===void 0?void 0:e.$name;t&&M1.set(t,this.tagName.toLowerCase())}static get observedAttributes(){return["shadow-root-mode","slottable","theme-color"]}attributeChangedCallback(o,e,t){if(Object.is(t,e))return;let r=Ed(o),n=this[r],s=t;switch(typeof n){case"boolean":s=t!==null&&t!=="false";break;case"number":s=Number(t);break}switch(this[r]=s,o){case"theme-color":{let d=hl.get(this),h=this.$sharedStyle;d&&h&&(C1?d.replaceSync(h):d.textContent=h);break}}}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(o=zd(o),typeof t){case"boolean":t===!0?this.hasAttribute(o)||this.setAttribute(o,""):this.removeAttribute(o);break;case"number":Md(t)?t="":t=String(t);default:t?this.getAttribute(o)!==t&&this.setAttribute(o,t):this.removeAttribute(o)}}connectedCallback(){Object.getPrototypeOf(this).constructor.observedAttributes.forEach(e=>{let t=Ed(e),r=this[t];b1(r)||this.$propertyChangedCallback(t,void 0,r),Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get(){return r},set(n){let s=r;r=n,this.$propertyChangedCallback(t,s,n)}})});let o=this.shadowRoot||this.attachShadow({mode:this.shadowRootMode||_1});if(ul.set(this,o),hl.set(this,this.$addStyles(this.$sharedStyle)),this.$style&&this.$addStyles(this.$style),this.$template){let e=document.createElement("template");e.innerHTML=this.$template,o.appendChild(e.content)}if(this.slottable){let e=document.createElement("slot");o.appendChild(e)}}disconnectedCallback(){hl.has(this)&&hl.delete(this),ul.has(this)&&ul.delete(this)}$getTagNameOf(o){var e;return(e=M1.get(o))!==null&&e!==void 0?e:o}$setStyles(o){return Object.keys(o).forEach(e=>{let t=o[e];ge(t)&&(t!==0&&Tb.test(e)?t=`${t}px`:t=String(t)),this.style[e]=t}),this}$getShadowRoot(){return this.shadowRoot||ul.get(this)}$addStyles(o){let e,t=this.$getShadowRoot();return C1?(e=new CSSStyleSheet,e.replaceSync(o),t.adoptedStyleSheets=t.adoptedStyleSheets.concat(e)):(e=document.createElement("style"),e.textContent=o,t.appendChild(e)),e}$emit(o,e,t){return k1(this,o,e,t)}$nextTick(o){return w1(this,o)}static $define(o,e){Cd(o)&&(e=o,o=""),o||(o=this.$name||this.name),o=zd(o),Ra&&Or.customElements&&!Or.customElements.get(o)&&customElements.define(o,this,e)}};Mt.$version="2.1.1";var Ab=':host{display:block;min-height:100px;min-width:200px;overflow:hidden;position:relative;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([background]){background-color:#fff;background-image:repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);background-image:repeating-conic-gradient(#ccc 0 25%,#fff 0 50%);background-position:0 0,.5rem .5rem;background-size:1rem 1rem}:host([disabled]){pointer-events:none}:host([disabled]):after{bottom:0;content:"";cursor:not-allowed;display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}',Wi=class extends Mt{constructor(){super(...arguments),this.$onPointerDown=null,this.$onPointerMove=null,this.$onPointerUp=null,this.$onWheel=null,this.$wheeling=!1,this.$pointers=new Map,this.$style=Ab,this.$action=xo,this.background=!1,this.disabled=!1,this.scaleStep=.1,this.themeColor="#39f"}static get observedAttributes(){return super.observedAttributes.concat(["background","disabled","scale-step"])}connectedCallback(){super.connectedCallback(),this.disabled||this.$bind()}disconnectedCallback(){this.disabled||this.$unbind(),super.disconnectedCallback()}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"disabled":t?this.$unbind():this.$bind();break}}$bind(){this.$onPointerDown||(this.$onPointerDown=this.$handlePointerDown.bind(this),We(this,vd,this.$onPointerDown)),this.$onPointerMove||(this.$onPointerMove=this.$handlePointerMove.bind(this),We(this.ownerDocument,bd,this.$onPointerMove)),this.$onPointerUp||(this.$onPointerUp=this.$handlePointerUp.bind(this),We(this.ownerDocument,yd,this.$onPointerUp)),this.$onWheel||(this.$onWheel=this.$handleWheel.bind(this),We(this,_d,this.$onWheel,{passive:!1,capture:!0}))}$unbind(){this.$onPointerDown&&(Be(this,vd,this.$onPointerDown),this.$onPointerDown=null),this.$onPointerMove&&(Be(this.ownerDocument,bd,this.$onPointerMove),this.$onPointerMove=null),this.$onPointerUp&&(Be(this.ownerDocument,yd,this.$onPointerUp),this.$onPointerUp=null),this.$onWheel&&(Be(this,_d,this.$onWheel,{capture:!0}),this.$onWheel=null)}$handlePointerDown(o){let{buttons:e,button:t,type:r}=o;if(this.disabled||(r==="pointerdown"&&o.pointerType==="mouse"||r==="mousedown")&&(ge(e)&&e!==1||ge(t)&&t!==0||o.ctrlKey))return;let{$pointers:n}=this,s="";if(o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:d,pageX:h,pageY:p})=>{n.set(d,{startX:h,startY:p,endX:h,endY:p})});else{let{pointerId:d=0,pageX:h,pageY:p}=o;n.set(d,{startX:h,startY:p,endX:h,endY:p})}n.size>1?s=On:ti(o.target)&&(s=o.target.action||o.target.getAttribute(f1)||""),this.$emit(_o,{action:s,relatedEvent:o})!==!1&&(o.preventDefault(),this.$action=s,this.style.willChange="transform")}$handlePointerMove(o){let{$action:e,$pointers:t}=this;if(this.disabled||e===xo||t.size===0||this.$emit(v1,{action:e,relatedEvent:o})===!1)return;if(o.preventDefault(),o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:n,pageX:s,pageY:d})=>{let h=t.get(n);h&&Object.assign(h,{endX:s,endY:d})});else{let{pointerId:n=0,pageX:s,pageY:d}=o,h=t.get(n);h&&Object.assign(h,{endX:s,endY:d})}let r={action:e,relatedEvent:o};if(e===On){let n=new Map(t),s=0,d=0,h=0,p=0,f=o.pageX,x=o.pageY;t.forEach((S,z)=>{n.delete(z),n.forEach(T=>{let P=T.startX-S.startX,H=T.startY-S.startY,R=T.endX-S.endX,N=T.endY-S.endY,$=0,Q=0,fe=0,Te=0;if(P===0?H<0?fe=Math.PI*2:H>0&&(fe=Math.PI):P>0?fe=Math.PI/2+Math.atan(H/P):P<0&&(fe=Math.PI*1.5+Math.atan(H/P)),R===0?N<0?Te=Math.PI*2:N>0&&(Te=Math.PI):R>0?Te=Math.PI/2+Math.atan(N/R):R<0&&(Te=Math.PI*1.5+Math.atan(N/R)),Te>0||fe>0){let et=Te-fe,we=Math.abs(et);we>s&&(s=we,h=et,f=(S.startX+T.startX)/2,x=(S.startY+T.startY)/2)}if(P=Math.abs(P),H=Math.abs(H),R=Math.abs(R),N=Math.abs(N),P>0&&H>0?$=Math.sqrt(P*P+H*H):P>0?$=P:H>0&&($=H),R>0&&N>0?Q=Math.sqrt(R*R+N*N):R>0?Q=R:N>0&&(Q=N),$>0&&Q>0){let et=(Q-$)/$,we=Math.abs(et);we>d&&(d=we,p=et,f=(S.startX+T.startX)/2,x=(S.startY+T.startY)/2)}})});let k=s>0,C=d>0;k&&C?(r.rotate=h,r.scale=p,r.centerX=f,r.centerY=x):k?(r.action=Ia,r.rotate=h,r.centerX=f,r.centerY=x):C?(r.action=Jo,r.scale=p,r.centerX=f,r.centerY=x):r.action=xo}else{let[n]=Array.from(t.values());Object.assign(r,n)}t.forEach(n=>{n.startX=n.endX,n.startY=n.endY}),r.action!==xo&&this.$emit(ei,r,{cancelable:!1})}$handlePointerUp(o){let{$action:e,$pointers:t}=this;if(!(this.disabled||e===xo)&&this.$emit(wo,{action:e,relatedEvent:o})!==!1){if(o.preventDefault(),o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:r})=>{t.delete(r)});else{let{pointerId:r=0}=o;t.delete(r)}t.size===0&&(this.style.willChange="",this.$action=xo)}}$handleWheel(o){if(this.disabled||(o.preventDefault(),this.$wheeling))return;this.$wheeling=!0,setTimeout(()=>{this.$wheeling=!1},50);let t=(o.deltaY>0?-1:1)*this.scaleStep;this.$emit(ei,{action:Jo,scale:t,relatedEvent:o},{cancelable:!1})}$setAction(o){return Dn(o)&&(this.$action=o),this}$toCanvas(o){return new Promise((e,t)=>{if(!this.isConnected){t(new Error("The current element is not connected to the DOM."));return}let r=document.createElement("canvas"),n=this.offsetWidth,s=this.offsetHeight,d=1;Fn(o)&&(or(o.width)||or(o.height))&&({width:n,height:s}=Ln({aspectRatio:n/s,width:o.width,height:o.height}),d=n/this.offsetWidth),r.width=n,r.height=s;let h=this.querySelector(this.$getTagNameOf(ko));if(!h){e(r);return}h.$ready().then(p=>{let f=r.getContext("2d");if(f){let[x,k,C,S,z,T]=h.$getTransform(),P=z,H=T,R=p.naturalWidth,N=p.naturalHeight;d!==1&&(P*=d,H*=d,R*=d,N*=d);let $=R/2,Q=N/2;f.fillStyle="transparent",f.fillRect(0,0,n,s),Fn(o)&&Nn(o.beforeDraw)&&o.beforeDraw.call(this,f,r),f.save(),f.translate($,Q),f.transform(x,k,C,S,P,H),f.translate(-$,-Q),f.drawImage(p,0,0,R,N),f.restore()}e(r)}).catch(t)})}};Wi.$name=to;Wi.$version="2.1.1";var Pb=":host{display:inline-block}img{display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}",z1=new WeakMap,E1=["alt","crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","src","srcset"],Ui=class extends Mt{constructor(){super(...arguments),this.$isReady=!1,this.$matrix=[1,0,0,1,0,0],this.$onLoad=null,this.$onCanvasAction=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$actionStartTarget=null,this.$style=Pb,this.$image=new Image,this.initialCenterSize="contain",this.rotatable=!1,this.scalable=!1,this.skewable=!1,this.slottable=!1,this.translatable=!1,this.alt="",this.crossorigin="",this.decoding="",this.elementtiming="",this.fetchpriority="",this.loading="",this.referrerpolicy="",this.sizes="",this.src="",this.srcset=""}set $canvas(o){z1.set(this,o)}get $canvas(){return z1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(E1,["initial-center-size","rotatable","scalable","skewable","translatable"])}attributeChangedCallback(o,e,t){Object.is(t,e)||(super.attributeChangedCallback(o,e,t),E1.includes(o)&&this.$image.setAttribute(o,t))}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"initialCenterSize":this.$nextTick(()=>{this.$center(t)});break;case"src":this.$isReady=!1;break}}connectedCallback(){super.connectedCallback();let{$image:o}=this,e=this.closest(this.$getTagNameOf(to));e&&(this.$canvas=e,this.$setStyles({display:"block",position:"absolute"}),this.$onCanvasActionStart=t=>{var r,n;this.$actionStartTarget=(n=(r=t.detail)===null||r===void 0?void 0:r.relatedEvent)===null||n===void 0?void 0:n.target},this.$onCanvasActionEnd=()=>{this.$actionStartTarget=null},this.$onCanvasAction=this.$handleAction.bind(this),We(e,_o,this.$onCanvasActionStart),We(e,wo,this.$onCanvasActionEnd),We(e,ei,this.$onCanvasAction)),this.$onLoad=this.$handleLoad.bind(this),We(o,zi,this.$onLoad),this.$getShadowRoot().appendChild(o)}disconnectedCallback(){let{$image:o,$canvas:e}=this;e&&(this.$onCanvasActionStart&&(Be(e,_o,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(Be(e,wo,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(Be(e,ei,this.$onCanvasAction),this.$onCanvasAction=null)),o&&this.$onLoad&&(Be(o,zi,this.$onLoad),this.$onLoad=null),this.$getShadowRoot().removeChild(o),super.disconnectedCallback()}$handleLoad(){let{$image:o}=this;this.$setStyles({width:o.naturalWidth,height:o.naturalHeight}),this.$canvas&&this.$center(this.initialCenterSize),this.$isReady=!0}$handleAction(o){if(this.hidden||!(this.rotatable||this.scalable||this.translatable))return;let{$canvas:e}=this,{detail:t}=o;if(t){let{relatedEvent:r}=t,{action:n}=t;switch(n===On&&(!this.rotatable||!this.scalable)&&(this.rotatable?n=Ia:this.scalable?n=Jo:n=xo),n){case ll:if(this.translatable){let s=null;r&&(s=r.target.closest(this.$getTagNameOf(wr))),s||(s=e.querySelector(this.$getTagNameOf(wr))),s&&s.multiple&&!s.active&&(s=e.querySelector(`${this.$getTagNameOf(wr)}[active]`)),(!s||s.hidden||!s.movable||s.dynamic||!(this.$actionStartTarget&&s.contains(this.$actionStartTarget)))&&this.$move(t.endX-t.startX,t.endY-t.startY)}break;case Ia:if(this.rotatable)if(r){let{x:s,y:d}=this.getBoundingClientRect();this.$rotate(t.rotate,r.clientX-s,r.clientY-d)}else this.$rotate(t.rotate);break;case Jo:if(this.scalable)if(r){let s=r.target.closest(this.$getTagNameOf(wr));if(!s||!s.zoomable||s.zoomable&&s.dynamic){let{x:d,y:h}=this.getBoundingClientRect();this.$zoom(t.scale,r.clientX-d,r.clientY-h)}}else this.$zoom(t.scale);break;case On:if(this.rotatable&&this.scalable){let{rotate:s}=t,{scale:d}=t;d<0?d=1/(1-d):d+=1;let h=Math.cos(s),p=Math.sin(s),[f,x,k,C]=[h*d,p*d,-p*d,h*d];if(r){let S=this.getBoundingClientRect(),z=r.clientX-S.x,T=r.clientY-S.y,[P,H,R,N]=this.$matrix,$=S.width/2,Q=S.height/2,fe=z-$,Te=T-Q,et=(fe*N-R*Te)/(P*N-R*H),we=(Te*P-H*fe)/(P*N-R*H);this.$transform(f,x,k,C,et*(1-f)+we*k,we*(1-C)+et*x)}else this.$transform(f,x,k,C,0,0)}break}}}$ready(o){let{$image:e}=this,t=new Promise((r,n)=>{let s=new Error("Failed to load the image source");if(e.complete)e.naturalWidth>0&&e.naturalHeight>0?r(e):n(s);else{let d=()=>{Be(e,kd,h),setTimeout(()=>{r(e)})},h=()=>{Be(e,zi,d),n(s)};Sd(e,zi,d),Sd(e,kd,h)}});return Nn(o)&&t.then(r=>(o(r),r)),t}$center(o){let{parentElement:e}=this;if(!e)return this;let t=e.getBoundingClientRect(),r=t.width,n=t.height,{x:s,y:d,width:h,height:p}=this.getBoundingClientRect(),f=s+h/2,x=d+p/2,k=t.x+r/2,C=t.y+n/2,{translatable:S}=this;if(!S&&!this.$isReady&&(this.translatable=!0,this.$nextTick(()=>{this.translatable=S})),this.$move(k-f,C-x),o&&(h!==r||p!==n)){let z=r/h,T=n/p,{scalable:P}=this;switch(o&&!P&&!this.$isReady&&(this.scalable=!0,this.$nextTick(()=>{this.scalable=P})),o){case"cover":this.$scale(Math.max(z,T));break;case"contain":this.$scale(Math.min(z,T));break}}return this}$move(o,e=o){if(this.translatable&&ge(o)&&ge(e)){let[t,r,n,s]=this.$matrix,d=(o*s-n*e)/(t*s-n*r),h=(e*t-r*o)/(t*s-n*r);this.$translate(d,h)}return this}$moveTo(o,e=o){if(this.translatable&&ge(o)&&ge(e)){let[t,r,n,s]=this.$matrix,d=(o*s-n*e)/(t*s-n*r),h=(e*t-r*o)/(t*s-n*r);this.$setTransform(t,r,n,s,d,h)}return this}$rotate(o,e,t){if(this.rotatable){let r=dl(o),n=Math.cos(r),s=Math.sin(r),[d,h,p,f]=[n,s,-s,n];if(ge(e)&&ge(t)){let[x,k,C,S]=this.$matrix,{width:z,height:T}=this.getBoundingClientRect(),P=z/2,H=T/2,R=e-P,N=t-H,$=(R*S-C*N)/(x*S-C*k),Q=(N*x-k*R)/(x*S-C*k);this.$transform(d,h,p,f,$*(1-d)-Q*p,Q*(1-f)-$*h)}else this.$transform(d,h,p,f,0,0)}return this}$zoom(o,e,t){if(!this.scalable||o===0)return this;if(o<0?o=1/(1-o):o+=1,ge(e)&&ge(t)){let[r,n,s,d]=this.$matrix,{width:h,height:p}=this.getBoundingClientRect(),f=h/2,x=p/2,k=e-f,C=t-x,S=(k*d-s*C)/(r*d-s*n),z=(C*r-n*k)/(r*d-s*n);this.$transform(o,0,0,o,S*(1-o),z*(1-o))}else this.$scale(o);return this}$scale(o,e=o){return this.scalable&&this.$transform(o,0,0,e,0,0),this}$skew(o,e=0){if(this.skewable){let t=dl(o),r=dl(e);this.$transform(1,Math.tan(r),Math.tan(t),1,0,0)}return this}$translate(o,e=o){return this.translatable&&ge(o)&&ge(e)&&this.$transform(1,0,0,1,o,e),this}$transform(o,e,t,r,n,s){return ge(o)&&ge(e)&&ge(t)&&ge(r)&&ge(n)&&ge(s)?this.$setTransform(Td(this.$matrix,[o,e,t,r,n,s])):this}$setTransform(o,e,t,r,n,s){if((this.rotatable||this.scalable||this.skewable||this.translatable)&&(Array.isArray(o)&&([o,e,t,r,n,s]=o),ge(o)&&ge(e)&&ge(t)&&ge(r)&&ge(n)&&ge(s))){let d=[...this.$matrix],h=[o,e,t,r,n,s];if(this.$emit(Va,{matrix:h,oldMatrix:d})===!1)return this;this.$matrix=h,this.style.transform=`matrix(${h.join(", ")})`}return this}$getTransform(){return this.$matrix.slice()}$resetTransform(){return this.$setTransform([1,0,0,1,0,0])}};Ui.$name=ko;Ui.$version="2.1.1";var jb=":host{display:block;height:0;left:0;outline:var(--theme-color) solid 1px;position:relative;top:0;width:0}:host([transparent]){outline-color:transparent}",S1=new WeakMap,Gi=class extends Mt{constructor(){super(...arguments),this.$onWindowResize=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$onSelectionChange=null,this.$style=jb,this.x=0,this.y=0,this.width=0,this.height=0,this.slottable=!1,this.themeColor="rgba(0, 0, 0, 0.65)"}set $canvas(o){S1.set(this,o)}get $canvas(){return S1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["height","width","x","y"])}connectedCallback(){super.connectedCallback();let o=this.closest(this.$getTagNameOf(to));if(o){this.$canvas=o,this.style.position="absolute";let e=o.querySelector(this.$getTagNameOf(wr));e&&(this.$onWindowResize=this.$render.bind(this),this.$onCanvasActionStart=t=>{e.hidden&&t.detail.action===jn&&(this.hidden=!1)},this.$onCanvasActionEnd=t=>{e.hidden&&t.detail.action===jn&&(this.hidden=!0)},this.$onSelectionChange=t=>{let{x:r,y:n,width:s,height:d}=t.defaultPrevented?e:t.detail;this.$change(r,n,s,d),(e.hidden||r===0&&n===0&&s===0&&d===0)&&(this.hidden=!0)},We(window,wd,this.$onWindowResize),We(o,_o,this.$onCanvasActionStart),We(o,wo,this.$onCanvasActionEnd),We(o,Mo,this.$onSelectionChange))}this.$render()}disconnectedCallback(){let{$canvas:o}=this;o&&(this.$onWindowResize&&(Be(window,wd,this.$onWindowResize),this.$onWindowResize=null),this.$onCanvasActionStart&&(Be(o,_o,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(Be(o,wo,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onSelectionChange&&(Be(o,Mo,this.$onSelectionChange),this.$onSelectionChange=null)),super.disconnectedCallback()}$change(o,e,t=this.width,r=this.height){return!ge(o)||!ge(e)||!ge(t)||!ge(r)||o===this.x&&e===this.y&&t===this.width&&r===this.height?this:(this.hidden&&(this.hidden=!1),this.x=o,this.y=e,this.width=t,this.height=r,this.$render())}$reset(){return this.$change(0,0,0,0)}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height,outlineWidth:Or.innerWidth*Or.devicePixelRatio})}};Gi.$name=m1;Gi.$version="2.1.1";var Ob=':host{background-color:var(--theme-color);display:block}:host([action=move]),:host([action=select]){height:100%;left:0;position:absolute;top:0;width:100%}:host([action=move]){cursor:move}:host([action=select]){cursor:crosshair}:host([action$=-resize]){background-color:transparent;height:15px;position:absolute;width:15px}:host([action$=-resize]):after{background-color:var(--theme-color);content:"";display:block;height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:5px}:host([action=n-resize]),:host([action=s-resize]){cursor:ns-resize;left:50%;transform:translateX(-50%);width:100%}:host([action=n-resize]){top:-8px}:host([action=s-resize]){bottom:-8px}:host([action=e-resize]),:host([action=w-resize]){cursor:ew-resize;height:100%;top:50%;transform:translateY(-50%)}:host([action=e-resize]){right:-8px}:host([action=w-resize]){left:-8px}:host([action=ne-resize]){cursor:nesw-resize;right:-8px;top:-8px}:host([action=nw-resize]){cursor:nwse-resize;left:-8px;top:-8px}:host([action=se-resize]){bottom:-8px;cursor:nwse-resize;right:-8px}:host([action=se-resize]):after{height:15px;width:15px}@media (pointer:coarse){:host([action=se-resize]):after{height:10px;width:10px}}@media (pointer:fine){:host([action=se-resize]):after{height:5px;width:5px}}:host([action=sw-resize]){bottom:-8px;cursor:nesw-resize;left:-8px}:host([plain]){background-color:transparent}',Yi=class extends Mt{constructor(){super(...arguments),this.$onCanvasCropEnd=null,this.$onCanvasCropStart=null,this.$style=Ob,this.action=xo,this.plain=!1,this.slottable=!1,this.themeColor="rgba(51, 153, 255, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["action","plain"])}};Yi.$name=p1;Yi.$version="2.1.1";var Hb=':host{display:block;left:0;position:relative;right:0}:host([outlined]){outline:1px solid var(--theme-color)}:host([multiple]){outline:1px dashed hsla(0,0%,100%,.5)}:host([multiple]):after{bottom:0;content:"";cursor:pointer;display:block;left:0;position:absolute;right:0;top:0}:host([multiple][active]){outline-color:var(--theme-color);z-index:1}:host([multiple])>*{visibility:hidden}:host([multiple][active])>*{visibility:visible}:host([multiple][active]):after{display:none}',$1=new WeakMap,Xi=class extends Mt{constructor(){super(...arguments),this.$onCanvasAction=null,this.$onCanvasActionStart=null,this.$onCanvasActionEnd=null,this.$onDocumentKeyDown=null,this.$action="",this.$actionStartTarget=null,this.$changing=!1,this.$style=Hb,this.$initialSelection={x:0,y:0,width:0,height:0},this.x=0,this.y=0,this.width=0,this.height=0,this.aspectRatio=NaN,this.initialAspectRatio=NaN,this.initialCoverage=NaN,this.active=!1,this.linked=!1,this.dynamic=!1,this.movable=!1,this.resizable=!1,this.zoomable=!1,this.multiple=!1,this.keyboard=!1,this.outlined=!1,this.precise=!1}set $canvas(o){$1.set(this,o)}get $canvas(){return $1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["active","aspect-ratio","dynamic","height","initial-aspect-ratio","initial-coverage","keyboard","linked","movable","multiple","outlined","precise","resizable","width","x","y","zoomable"])}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"x":case"y":case"width":case"height":this.$changing||this.$nextTick(()=>{this.$change(this.x,this.y,this.width,this.height,this.aspectRatio,!0)});break;case"aspectRatio":case"initialAspectRatio":this.$nextTick(()=>{this.$initSelection()});break;case"initialCoverage":this.$nextTick(()=>{or(t)&&t<=1&&this.$initSelection(!0,!0)});break;case"keyboard":this.$nextTick(()=>{this.$canvas&&(t?this.$onDocumentKeyDown||(this.$onDocumentKeyDown=this.$handleKeyDown.bind(this),We(this.ownerDocument,xd,this.$onDocumentKeyDown)):this.$onDocumentKeyDown&&(Be(this.ownerDocument,xd,this.$onDocumentKeyDown),this.$onDocumentKeyDown=null))});break;case"multiple":this.$nextTick(()=>{if(this.$canvas){let r=this.$getSelections();t?(r.forEach(n=>{n.active=!1}),this.active=!0,this.$emit(Mo,{x:this.x,y:this.y,width:this.width,height:this.height})):(this.active=!1,r.slice(1).forEach(n=>{this.$removeSelection(n)}))}});break;case"precise":this.$nextTick(()=>{this.$change(this.x,this.y)});break;case"linked":t&&(this.dynamic=!0);break}}connectedCallback(){super.connectedCallback();let o=this.closest(this.$getTagNameOf(to));o?(this.$canvas=o,this.$setStyles({position:"absolute",transform:`translate(${this.x}px, ${this.y}px)`}),this.hidden||this.$render(),this.$initSelection(!0),this.$onCanvasActionStart=this.$handleActionStart.bind(this),this.$onCanvasActionEnd=this.$handleActionEnd.bind(this),this.$onCanvasAction=this.$handleAction.bind(this),We(o,_o,this.$onCanvasActionStart),We(o,wo,this.$onCanvasActionEnd),We(o,ei,this.$onCanvasAction)):this.$render()}disconnectedCallback(){let{$canvas:o}=this;o&&(this.$onCanvasActionStart&&(Be(o,_o,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(Be(o,wo,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(Be(o,ei,this.$onCanvasAction),this.$onCanvasAction=null)),super.disconnectedCallback()}$getSelections(){let o=[];return this.parentElement&&(o=Array.from(this.parentElement.querySelectorAll(this.$getTagNameOf(wr)))),o}$initSelection(o=!1,e=!1){let{initialCoverage:t,parentElement:r}=this;if(or(t)&&r){let n=this.aspectRatio||this.initialAspectRatio,s=(e?0:this.width)||r.offsetWidth*t,d=(e?0:this.height)||r.offsetHeight*t;or(n)&&({width:s,height:d}=Ln({aspectRatio:n,width:s,height:d})),this.$change(this.x,this.y,s,d),o&&this.$center(),this.$initialSelection={x:this.x,y:this.y,width:this.width,height:this.height}}}$createSelection(){let o=this.cloneNode(!0);return this.hasAttribute("id")&&o.removeAttribute("id"),o.initialCoverage=NaN,this.active=!1,this.parentElement&&this.parentElement.insertBefore(o,this.nextSibling),o}$removeSelection(o=this){if(this.parentElement){let e=this.$getSelections();if(e.length>1){let t=e.indexOf(o),r=e[t+1]||e[t-1];r&&(o.active=!1,this.parentElement.removeChild(o),r.active=!0,r.$emit(Mo,{x:r.x,y:r.y,width:r.width,height:r.height}))}else this.$clear()}}$handleActionStart(o){var e,t;let r=(t=(e=o.detail)===null||e===void 0?void 0:e.relatedEvent)===null||t===void 0?void 0:t.target;this.$action="",this.$actionStartTarget=r,!this.hidden&&this.multiple&&!this.active&&r===this&&this.parentElement&&(this.$getSelections().forEach(n=>{n.active=!1}),this.active=!0,this.$emit(Mo,{x:this.x,y:this.y,width:this.width,height:this.height}))}$handleAction(o){let{currentTarget:e,detail:t}=o;if(!e||!t)return;let{relatedEvent:r}=t,{action:n}=t,s=r?x1(r):null;if(!n&&this.multiple&&(n=this.$action||s?.action,this.$action=n),!n||this.hidden&&n!==jn||this.multiple&&!this.active&&n!==Jo)return;let{width:d,height:h}=this,p=t.endX-t.startX,f=t.endY-t.startY,{aspectRatio:x}=this;switch(!or(x)&&r.shiftKey&&(x=or(d)&&or(h)?d/h:1),n){case jn:if(p!==0||f!==0){p===0?p=f:f===0&&(f=p);let{$canvas:k}=this,C=$d(e);(this.multiple&&!this.hidden?this.$createSelection():this).$change(t.startX-C.left,t.startY-C.top,Math.abs(p),Math.abs(f),x),p<0?f<0?n=Rn:f>0&&(n=Vn):p>0&&(f<0?n=Hn:f>0&&(n=In)),k&&(k.$action=n)}break;case ll:this.movable&&(this.dynamic||this.$actionStartTarget&&this.contains(this.$actionStartTarget))&&this.$move(p,f);break;case Jo:if(r&&this.zoomable&&(this.dynamic||this.contains(r.target))){let k=$d(e);this.$zoom(t.scale,r.pageX-k.left,r.pageY-k.top)}break;default:this.$resize(n,p,f,x)}}$handleActionEnd(){this.$action="",this.$actionStartTarget=null}$handleKeyDown(o){if(this.hidden||!this.keyboard||this.multiple&&!this.active||o.defaultPrevented)return;let{activeElement:e}=document;if(!(e&&(["INPUT","TEXTAREA"].includes(e.tagName)||["true","plaintext-only"].includes(e.contentEditable))))switch(o.key){case"Backspace":o.metaKey&&(o.preventDefault(),this.$removeSelection());break;case"Delete":o.preventDefault(),this.$removeSelection();break;case"ArrowLeft":o.preventDefault(),this.$move(-1,0);break;case"ArrowRight":o.preventDefault(),this.$move(1,0);break;case"ArrowUp":o.preventDefault(),this.$move(0,-1);break;case"ArrowDown":o.preventDefault(),this.$move(0,1);break;case"+":o.preventDefault(),this.$zoom(.1);break;case"-":o.preventDefault(),this.$zoom(-.1);break}}$center(){let{parentElement:o}=this;if(!o)return this;let e=(o.offsetWidth-this.width)/2,t=(o.offsetHeight-this.height)/2;return this.$change(e,t)}$move(o,e=o){return this.$moveTo(this.x+o,this.y+e)}$moveTo(o,e=o){return this.movable?this.$change(o,e):this}$resize(o,e=0,t=0,r=this.aspectRatio){if(!this.resizable)return this;let n=or(r),{$canvas:s}=this,{x:d,y:h,width:p,height:f}=this;switch(o){case pd:h+=t,f-=t,f<0&&(o=gd,f=-f,h-=f),n&&(e=t*r,d+=e/2,p-=e,p<0&&(p=-p,d-=p));break;case md:p+=e,p<0&&(o=fd,p=-p,d-=p),n&&(t=e/r,h-=t/2,f+=t,f<0&&(f=-f,h-=f));break;case gd:f+=t,f<0&&(o=pd,f=-f,h-=f),n&&(e=t*r,d-=e/2,p+=e,p<0&&(p=-p,d-=p));break;case fd:d+=e,p-=e,p<0&&(o=md,p=-p,d-=p),n&&(t=e/r,h+=t/2,f-=t,f<0&&(f=-f,h-=f));break;case Hn:n&&(t=-e/r),h+=t,f-=t,p+=e,p<0&&f<0?(o=Vn,p=-p,f=-f,d-=p,h-=f):p<0?(o=Rn,p=-p,d-=p):f<0&&(o=In,f=-f,h-=f);break;case Rn:n&&(t=e/r),d+=e,h+=t,p-=e,f-=t,p<0&&f<0?(o=In,p=-p,f=-f,d-=p,h-=f):p<0?(o=Hn,p=-p,d-=p):f<0&&(o=Vn,f=-f,h-=f);break;case In:n&&(t=e/r),p+=e,f+=t,p<0&&f<0?(o=Rn,p=-p,f=-f,d-=p,h-=f):p<0?(o=Vn,p=-p,d-=p):f<0&&(o=Hn,f=-f,h-=f);break;case Vn:n&&(t=-e/r),d+=e,p-=e,f+=t,p<0&&f<0?(o=Hn,p=-p,f=-f,d-=p,h-=f):p<0?(o=In,p=-p,d-=p):f<0&&(o=Rn,f=-f,h-=f);break}return s&&s.$setAction(o),this.$change(d,h,p,f)}$zoom(o,e,t){if(!this.zoomable||o===0)return this;o<0?o=1/(1-o):o+=1;let{width:r,height:n}=this,s=r*o,d=n*o,h=this.x,p=this.y;return ge(e)&&ge(t)?(h-=(s-r)*((e-this.x)/r),p-=(d-n)*((t-this.y)/n)):(h-=(s-r)/2,p-=(d-n)/2),this.$change(h,p,s,d)}$change(o,e,t=this.width,r=this.height,n=this.aspectRatio,s=!1){return this.$changing||!ge(o)||!ge(e)||!ge(t)||!ge(r)||t<0||r<0?this:(or(n)&&({width:t,height:r}=Ln({aspectRatio:n,width:t,height:r},"cover")),this.precise||(o=Math.round(o),e=Math.round(e),t=Math.round(t),r=Math.round(r)),o===this.x&&e===this.y&&t===this.width&&r===this.height&&Object.is(n,this.aspectRatio)&&!s?this:(this.hidden&&(this.hidden=!1),this.$emit(Mo,{x:o,y:e,width:t,height:r})===!1?this:(this.$changing=!0,this.x=o,this.y=e,this.width=t,this.height=r,this.$changing=!1,this.$render())))}$reset(){let{x:o,y:e,width:t,height:r}=this.$initialSelection;return this.$change(o,e,t,r)}$clear(){return this.$change(0,0,0,0,NaN,!0),this.hidden=!0,this}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height})}$toCanvas(o){return new Promise((e,t)=>{if(!this.isConnected){t(new Error("The current element is not connected to the DOM."));return}let r=document.createElement("canvas"),{width:n,height:s}=this,d=1;if(Fn(o)&&(or(o.width)||or(o.height))&&({width:n,height:s}=Ln({aspectRatio:n/s,width:o.width,height:o.height}),d=n/this.width),r.width=n,r.height=s,!this.$canvas){e(r);return}let h=this.$canvas.querySelector(this.$getTagNameOf(ko));if(!h){e(r);return}h.$ready().then(p=>{let f=r.getContext("2d");if(f){let[x,k,C,S,z,T]=h.$getTransform(),P=-this.x,H=-this.y,R=(P*S-C*H)/(x*S-C*k),N=(H*x-k*P)/(x*S-C*k),$=x*R+C*N+z,Q=k*R+S*N+T,fe=p.naturalWidth,Te=p.naturalHeight;d!==1&&($*=d,Q*=d,fe*=d,Te*=d);let et=fe/2,we=Te/2;f.fillStyle="transparent",f.fillRect(0,0,n,s),Fn(o)&&Nn(o.beforeDraw)&&o.beforeDraw.call(this,f,r),f.save(),f.translate(et,we),f.transform(x,k,C,S,$,Q),f.translate(-et,-we),f.drawImage(p,0,0,fe,Te),f.restore()}e(r)}).catch(t)})}};Xi.$name=wr;Xi.$version="2.1.1";var Rb=":host{display:flex;flex-direction:column;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([bordered]){border:1px dashed var(--theme-color)}:host([covered]){bottom:0;left:0;position:absolute;right:0;top:0}:host>span{display:flex;flex:1}:host>span+span{border-top:1px dashed var(--theme-color)}:host>span>span{flex:1}:host>span>span+span{border-left:1px dashed var(--theme-color)}",Zi=class extends Mt{constructor(){super(...arguments),this.$style=Rb,this.bordered=!1,this.columns=3,this.covered=!1,this.rows=3,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["bordered","columns","covered","rows"])}$propertyChangedCallback(o,e,t){Object.is(t,e)||(super.$propertyChangedCallback(o,e,t),(o==="rows"||o==="columns")&&this.$nextTick(()=>{this.$render()}))}connectedCallback(){super.connectedCallback(),this.$render()}$render(){let o=this.$getShadowRoot(),e=document.createDocumentFragment();for(let t=0;t<this.rows;t+=1){let r=document.createElement("span");r.setAttribute("role","row");for(let n=0;n<this.columns;n+=1){let s=document.createElement("span");s.setAttribute("role","gridcell"),r.appendChild(s)}e.appendChild(r)}o&&(o.innerHTML="",o.appendChild(e))}};Zi.$name=h1;Zi.$version="2.1.1";var Ib=':host{display:inline-block;height:1em;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1em}:host:after,:host:before{background-color:var(--theme-color);content:"";display:block;position:absolute}:host:before{height:1px;left:0;top:50%;transform:translateY(-50%);width:100%}:host:after{height:100%;left:50%;top:0;transform:translateX(-50%);width:1px}:host([centered]){left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}',Qi=class extends Mt{constructor(){super(...arguments),this.$style=Ib,this.centered=!1,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["centered"])}};Qi.$name=u1;Qi.$version="2.1.1";var Vb=":host{display:block;height:100%;overflow:hidden;position:relative;width:100%}",T1=new WeakMap,A1=new WeakMap,P1=new WeakMap,j1=new WeakMap,Db="both",Fb="horizontal",O1="vertical",Nb="none",Ji=class extends Mt{constructor(){super(...arguments),this.$onSelectionChange=null,this.$onSourceImageLoad=null,this.$onSourceImageTransform=null,this.$scale=1,this.$style=Vb,this.resize=O1,this.selection="",this.slottable=!1}set $image(o){A1.set(this,o)}get $image(){return A1.get(this)}set $sourceImage(o){j1.set(this,o)}get $sourceImage(){return j1.get(this)}set $canvas(o){T1.set(this,o)}get $canvas(){return T1.get(this)}set $selection(o){P1.set(this,o)}get $selection(){return P1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["resize","selection"])}connectedCallback(){var o,e;super.connectedCallback();let t=null;if(this.selection?t=(e=(o=cl(this))===null||o===void 0?void 0:o.querySelector(this.selection))!==null&&e!==void 0?e:null:t=this.closest(this.$getTagNameOf(wr)),ti(t)){this.$selection=t,this.$onSelectionChange=this.$handleSelectionChange.bind(this),We(t,Mo,this.$onSelectionChange);let r=t.closest(this.$getTagNameOf(to));if(r){this.$canvas=r;let n=r.querySelector(this.$getTagNameOf(ko));n&&(this.$sourceImage=n,this.$image=n.cloneNode(!0),this.$getShadowRoot().appendChild(this.$image),this.$onSourceImageLoad=this.$handleSourceImageLoad.bind(this),this.$onSourceImageTransform=this.$handleSourceImageTransform.bind(this),We(n.$image,zi,this.$onSourceImageLoad),We(n,Va,this.$onSourceImageTransform))}this.$render()}}disconnectedCallback(){let{$selection:o,$sourceImage:e}=this;o&&this.$onSelectionChange&&(Be(o,Mo,this.$onSelectionChange),this.$onSelectionChange=null),e&&this.$onSourceImageLoad&&(Be(e.$image,zi,this.$onSourceImageLoad),this.$onSourceImageLoad=null),e&&this.$onSourceImageTransform&&(Be(e,Va,this.$onSourceImageTransform),this.$onSourceImageTransform=null),super.disconnectedCallback()}$handleSelectionChange(o){this.$render(o.defaultPrevented?this.$selection:o.detail)}$handleSourceImageLoad(){let{$image:o,$sourceImage:e}=this,t=o.getAttribute("src"),r=e.getAttribute("src");r&&r!==t&&(o.setAttribute("src",r),o.$ready(()=>{this.$render()}))}$handleSourceImageTransform(o){this.$render(void 0,o.detail.matrix)}$render(o,e){let{$canvas:t,$selection:r}=this;!o&&!r.hidden&&(o=r),(!o||o.x===0&&o.y===0&&o.width===0&&o.height===0)&&(o={x:0,y:0,width:t.offsetWidth,height:t.offsetHeight});let{x:n,y:s,width:d,height:h}=o,p={},{clientWidth:f,clientHeight:x}=this,k=f,C=x,S=NaN;switch(this.resize){case Db:S=1,k=d,C=h,p.width=d,p.height=h;break;case Fb:S=h>0?x/h:0,k=d*S,p.width=k;break;case O1:S=d>0?f/d:0,C=h*S,p.height=C;break;case Nb:default:f>0?S=d>0?f/d:0:x>0&&(S=h>0?x/h:0)}this.$scale=S,this.$setStyles(p),this.$sourceImage&&setTimeout(()=>{this.$transformImageByOffset(e??this.$sourceImage.$getTransform(),-n,-s)})}$transformImageByOffset(o,e,t){let{$image:r,$scale:n,$sourceImage:s}=this;if(s&&r&&n>=0){let[d,h,p,f,x,k]=o,C=(e*f-p*t)/(d*f-p*h),S=(t*d-h*e)/(d*f-p*h),z=d*C+p*S+x,T=h*C+f*S+k;s.$ready(P=>{this.$setStyles.call(r,{width:P.naturalWidth*n,height:P.naturalHeight*n})}),r.$setTransform(d,h,p,f,z*n,T*n)}}};Ji.$name=g1;Ji.$version="2.1.1";var Lb='<cropper-canvas background><cropper-image rotatable scalable skewable translatable></cropper-image><cropper-shade hidden></cropper-shade><cropper-handle action="select" plain></cropper-handle><cropper-selection initial-coverage="0.5" movable resizable><cropper-grid role="grid" bordered covered></cropper-grid><cropper-crosshair centered></cropper-crosshair><cropper-handle action="move" theme-color="rgba(255, 255, 255, 0.35)"></cropper-handle><cropper-handle action="n-resize"></cropper-handle><cropper-handle action="e-resize"></cropper-handle><cropper-handle action="s-resize"></cropper-handle><cropper-handle action="w-resize"></cropper-handle><cropper-handle action="ne-resize"></cropper-handle><cropper-handle action="nw-resize"></cropper-handle><cropper-handle action="se-resize"></cropper-handle><cropper-handle action="sw-resize"></cropper-handle></cropper-selection></cropper-canvas>',Bb=/^img|canvas$/,qb=/<(\/?(?:script|style)[^>]*)>/gi,H1={template:Lb};Wi.$define();Qi.$define();Zi.$define();Yi.$define();Ui.$define();Xi.$define();Gi.$define();Ji.$define();var Da=class{constructor(o,e){var t;if(this.options=H1,Dn(o)&&(o=document.querySelector(o)),!ti(o)||!Bb.test(o.localName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=o,e=Object.assign(Object.assign({},H1),e),this.options=e;let{container:r}=e;if(r&&(Dn(r)&&(r=(t=cl(o))===null||t===void 0?void 0:t.querySelector(r)),!ti(r)))throw new Error("The `container` option must be an element or a valid selector.");ti(r)||(o.parentElement?r=o.parentElement:r=o.ownerDocument.body),this.container=r;let n=o.localName,s="";n==="img"?{src:s}=o:n==="canvas"&&window.HTMLCanvasElement&&(s=o.toDataURL());let{template:d}=e;if(d&&Dn(d)){let h=document.createElement("template"),p=document.createDocumentFragment();h.innerHTML=d.replace(qb,"&lt;$1&gt;"),p.appendChild(h.content),Array.from(p.querySelectorAll(ko)).forEach(f=>{f.setAttribute("src",s),f.setAttribute("alt",o.alt||"The image to crop"),n==="img"&&["crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","srcset"].forEach(x=>{o.hasAttribute(x)&&f.setAttribute(x,o.getAttribute(x)||"")})}),o.parentElement?(o.style.display="none",r.insertBefore(p,o.nextSibling)):r.appendChild(p)}}getCropperCanvas(){return this.container.querySelector(to)}getCropperImage(){return this.container.querySelector(ko)}getCropperSelection(){return this.container.querySelector(wr)}getCropperSelections(){return this.container.querySelectorAll(wr)}destroy(){var o;let e=this.getCropperCanvas();e&&((o=e.parentElement)===null||o===void 0||o.removeChild(e)),this.element&&(this.element.style.display="")}};Da.version="2.1.1";function Gb(i){if(typeof i=="number")return Number.isFinite(i)&&i>0?i:null;let o=String(i??"").trim();if(!o||o==="free")return null;if(o.includes("/")){let[t,r]=o.split("/").map(n=>Number(n.trim()));return Number.isFinite(t)&&Number.isFinite(r)&&t>0&&r>0?t/r:null}let e=Number(o);return Number.isFinite(e)&&e>0?e:null}function Yb(i,o,e){return new Promise(t=>i.toBlob(t,o,e))}var nt=class extends Wb{constructor(){super(...arguments);this.src="";this.alt="";this.aspectRatio="1";this.mimeType="image/png";this.quality=.92;this.height=420;this.crossOrigin="anonymous";this.disabled=!1;this.showResult=!0;this._loaded=!1;this._errored=!1;this._result="";this._onSelectionChange=e=>{let t=e.detail;this._selection={x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height),aspectRatio:this._ratio},this.dispatchEvent(new CustomEvent("change",{detail:this._selection,bubbles:!0,composed:!0}))};this._onLoad=()=>{this._loaded=!0,this._errored=!1,this._setupCropper(),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,composed:!0}))};this._onError=()=>{this._loaded=!1,this._errored=!0,this._destroyCropper(),this.dispatchEvent(new CustomEvent("error",{bubbles:!0,composed:!0}))}}disconnectedCallback(){this._destroyCropper(),super.disconnectedCallback()}updated(e){e.has("src")&&(this._loaded=!1,this._errored=!1,this._result="",this._selection=void 0,this._destroyCropper()),e.has("height")&&this.style.setProperty("--lui-image-cropper-height",`${this.height}px`),(e.has("aspectRatio")||e.has("src"))&&this._loaded&&this._setupCropper()}reset(){this._selectionEl?.$reset(),this._cropper?.getCropperImage()?.$resetTransform(),this._emitSelectionChange()}clear(){this._selectionEl?.$clear(),this._result="",this._selection=void 0}zoomIn(){this._cropper?.getCropperImage()?.$zoom(.1)}zoomOut(){this._cropper?.getCropperImage()?.$zoom(-.1)}rotateLeft(){this._cropper?.getCropperImage()?.$rotate("-90deg")}rotateRight(){this._cropper?.getCropperImage()?.$rotate("90deg")}async crop(){let e=this._cropper?.getCropperSelection();if(!e||e.hidden||!e.width||!e.height)return null;let t=await e.$toCanvas({width:this.outputWidth,height:this.outputHeight}),r=this.mimeType||"image/png",n=Math.max(0,Math.min(1,this.quality)),s=t.toDataURL(r,n),d=await Yb(t,r,n),h={...this._readSelection(e),dataUrl:s,blob:d,canvas:t};return this._result=s,this._selection=h,this.dispatchEvent(new CustomEvent("crop",{detail:h,bubbles:!0,composed:!0})),h}get _ratio(){return Gb(this.aspectRatio)}_template(){let e=this._ratio;return`
8328
+ `],a([rr()],Pe.prototype,"src",2),a([rr({attribute:"preview-src"})],Pe.prototype,"previewSrc",2),a([rr()],Pe.prototype,"alt",2),a([rr({attribute:"fallback-src"})],Pe.prototype,"fallbackSrc",2),a([rr()],Pe.prototype,"fallback",2),a([rr({reflect:!0})],Pe.prototype,"fit",2),a([rr({reflect:!0})],Pe.prototype,"radius",2),a([rr()],Pe.prototype,"width",2),a([rr()],Pe.prototype,"height",2),a([rr({attribute:"aspect-ratio"})],Pe.prototype,"aspectRatio",2),a([rr()],Pe.prototype,"position",2),a([rr({reflect:!0})],Pe.prototype,"loading",2),a([rr({type:Boolean,reflect:!0})],Pe.prototype,"skeleton",2),a([rr({type:Boolean,reflect:!0})],Pe.prototype,"preview",2),a([rr({type:Boolean,attribute:"show-preview-icon"})],Pe.prototype,"showPreviewIcon",2),a([rr({type:Boolean})],Pe.prototype,"draggablePreview",2),a([Pn()],Pe.prototype,"_loaded",2),a([Pn()],Pe.prototype,"_errored",2),a([Pn()],Pe.prototype,"_previewOpen",2),a([Pn()],Pe.prototype,"_zoom",2),a([Pn()],Pe.prototype,"_rotate",2),a([Pn()],Pe.prototype,"_panning",2),a([dd(".preview-image")],Pe.prototype,"_previewImageEl",2),a([dd(".preview-panzoom")],Pe.prototype,"_previewPanzoomEl",2),a([dd(".preview-stage")],Pe.prototype,"_previewStageEl",2),Pe=a([yb("lui-image")],Pe);import{css as Kb,html as Bn,LitElement as Wb,nothing as Fa}from"lit";import{customElement as Ub,property as Co,query as R1,state as pl}from"lit/decorators.js";var Ra=typeof window<"u"&&typeof window.document<"u",Hr=Ra?window:{},ud=Ra?"ontouchstart"in Hr.document.documentElement:!1,hd=Ra?"PointerEvent"in Hr:!1,Ci="cropper",to=`${Ci}-canvas`,u1=`${Ci}-crosshair`,h1=`${Ci}-grid`,p1=`${Ci}-handle`,ko=`${Ci}-image`,wr=`${Ci}-selection`,m1=`${Ci}-shade`,g1=`${Ci}-viewer`,jn="select",ll="move",Jo="scale",Ia="rotate",On="transform",xo="none",pd="n-resize",md="e-resize",gd="s-resize",fd="w-resize",Hn="ne-resize",Rn="nw-resize",In="se-resize",Vn="sw-resize",f1="action",kb=ud?"touchend touchcancel":"mouseup",xb=ud?"touchmove":"mousemove",wb=ud?"touchstart":"mousedown",vd=hd?"pointerdown":wb,bd=hd?"pointermove":xb,yd=hd?"pointerup pointercancel":kb,kd="error",xd="keydown",zi="load",wd="resize",_d="wheel",ei="action",wo="actionend",v1="actionmove",_o="actionstart",Mo="change",Va="transform";function Dn(i){return typeof i=="string"}var Md=Number.isNaN||Hr.isNaN;function ge(i){return typeof i=="number"&&!Md(i)}function or(i){return ge(i)&&i>0&&i<1/0}function b1(i){return typeof i>"u"}function Cd(i){return typeof i=="object"&&i!==null}var{hasOwnProperty:_b}=Object.prototype;function Fn(i){if(!Cd(i))return!1;try{let{constructor:o}=i,{prototype:e}=o;return o&&e&&_b.call(e,"isPrototypeOf")}catch{return!1}}function Nn(i){return typeof i=="function"}function ti(i){return typeof i=="object"&&i!==null&&i.nodeType===1}var Mb=/([a-z\d])([A-Z])/g;function zd(i){return String(i).replace(Mb,"$1-$2").toLowerCase()}var Cb=/-[A-z\d]/g;function Ed(i){return i.replace(Cb,o=>o.slice(1).toUpperCase())}var y1=/\s\s*/;function Be(i,o,e,t){o.trim().split(y1).forEach(r=>{i.removeEventListener(r,e,t)})}function We(i,o,e,t){o.trim().split(y1).forEach(r=>{i.addEventListener(r,e,t)})}function Sd(i,o,e,t){We(i,o,e,Object.assign(Object.assign({},t),{once:!0}))}var zb={bubbles:!0,cancelable:!0,composed:!0};function k1(i,o,e,t){return i.dispatchEvent(new CustomEvent(o,Object.assign(Object.assign(Object.assign({},zb),{detail:e}),t)))}function x1(i){return typeof i.composedPath=="function"&&i.composedPath().find(ti)||i.target}var c1=Promise.resolve();function w1(i,o){return o?c1.then(i?o.bind(i):o):c1}function cl(i){let o=i.getRootNode();switch(o.nodeType){case 1:return o.ownerDocument;case 9:return o;case 11:return o}return null}function $d(i){let{documentElement:o}=i.ownerDocument,e=i.getBoundingClientRect();return{left:e.left+(Hr.pageXOffset-o.clientLeft),top:e.top+(Hr.pageYOffset-o.clientTop)}}var Eb=/deg|g?rad|turn$/i;function dl(i){let o=parseFloat(i)||0;if(o!==0){let[e="rad"]=String(i).match(Eb)||[];switch(e.toLowerCase()){case"deg":return o/360*(Math.PI*2);case"grad":return o/400*(Math.PI*2);case"turn":return o*(Math.PI*2)}}return o}var d1="contain",Sb="cover";function Ln(i,o=d1){let{aspectRatio:e}=i,{width:t,height:r}=i,n=or(t),s=or(r);if(n&&s){let d=r*e;o===d1&&d>t||o===Sb&&d<t?r=t/e:t=r*e}else n?r=t/e:s&&(t=r*e);return{width:t,height:r}}function Td(i,...o){if(o.length===0)return i;let[e,t,r,n,s,d]=i,[h,p,f,x,k,C]=o[0];return i=[e*h+r*p,t*h+n*p,e*f+r*x,t*f+n*x,e*k+r*C+s,t*k+n*C+d],Td(i,...o.slice(1))}var $b=":host([hidden]){display:none!important}",Tb=/left|top|width|height/i,_1="open",ul=new WeakMap,hl=new WeakMap,M1=new Map,C1=Hr.document&&Array.isArray(Hr.document.adoptedStyleSheets)&&"replaceSync"in Hr.CSSStyleSheet.prototype,Mt=class extends HTMLElement{get $sharedStyle(){return`${this.themeColor?`:host{--theme-color: ${this.themeColor};}`:""}${$b}`}constructor(){var o,e;super(),this.shadowRootMode=_1,this.slottable=!0;let t=(e=(o=Object.getPrototypeOf(this))===null||o===void 0?void 0:o.constructor)===null||e===void 0?void 0:e.$name;t&&M1.set(t,this.tagName.toLowerCase())}static get observedAttributes(){return["shadow-root-mode","slottable","theme-color"]}attributeChangedCallback(o,e,t){if(Object.is(t,e))return;let r=Ed(o),n=this[r],s=t;switch(typeof n){case"boolean":s=t!==null&&t!=="false";break;case"number":s=Number(t);break}switch(this[r]=s,o){case"theme-color":{let d=hl.get(this),h=this.$sharedStyle;d&&h&&(C1?d.replaceSync(h):d.textContent=h);break}}}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(o=zd(o),typeof t){case"boolean":t===!0?this.hasAttribute(o)||this.setAttribute(o,""):this.removeAttribute(o);break;case"number":Md(t)?t="":t=String(t);default:t?this.getAttribute(o)!==t&&this.setAttribute(o,t):this.removeAttribute(o)}}connectedCallback(){Object.getPrototypeOf(this).constructor.observedAttributes.forEach(e=>{let t=Ed(e),r=this[t];b1(r)||this.$propertyChangedCallback(t,void 0,r),Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get(){return r},set(n){let s=r;r=n,this.$propertyChangedCallback(t,s,n)}})});let o=this.shadowRoot||this.attachShadow({mode:this.shadowRootMode||_1});if(ul.set(this,o),hl.set(this,this.$addStyles(this.$sharedStyle)),this.$style&&this.$addStyles(this.$style),this.$template){let e=document.createElement("template");e.innerHTML=this.$template,o.appendChild(e.content)}if(this.slottable){let e=document.createElement("slot");o.appendChild(e)}}disconnectedCallback(){hl.has(this)&&hl.delete(this),ul.has(this)&&ul.delete(this)}$getTagNameOf(o){var e;return(e=M1.get(o))!==null&&e!==void 0?e:o}$setStyles(o){return Object.keys(o).forEach(e=>{let t=o[e];ge(t)&&(t!==0&&Tb.test(e)?t=`${t}px`:t=String(t)),this.style[e]=t}),this}$getShadowRoot(){return this.shadowRoot||ul.get(this)}$addStyles(o){let e,t=this.$getShadowRoot();return C1?(e=new CSSStyleSheet,e.replaceSync(o),t.adoptedStyleSheets=t.adoptedStyleSheets.concat(e)):(e=document.createElement("style"),e.textContent=o,t.appendChild(e)),e}$emit(o,e,t){return k1(this,o,e,t)}$nextTick(o){return w1(this,o)}static $define(o,e){Cd(o)&&(e=o,o=""),o||(o=this.$name||this.name),o=zd(o),Ra&&Hr.customElements&&!Hr.customElements.get(o)&&customElements.define(o,this,e)}};Mt.$version="2.1.1";var Ab=':host{display:block;min-height:100px;min-width:200px;overflow:hidden;position:relative;touch-action:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([background]){background-color:#fff;background-image:repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc),repeating-linear-gradient(45deg,#ccc 25%,transparent 0,transparent 75%,#ccc 0,#ccc);background-image:repeating-conic-gradient(#ccc 0 25%,#fff 0 50%);background-position:0 0,.5rem .5rem;background-size:1rem 1rem}:host([disabled]){pointer-events:none}:host([disabled]):after{bottom:0;content:"";cursor:not-allowed;display:block;left:0;pointer-events:none;position:absolute;right:0;top:0}',Wi=class extends Mt{constructor(){super(...arguments),this.$onPointerDown=null,this.$onPointerMove=null,this.$onPointerUp=null,this.$onWheel=null,this.$wheeling=!1,this.$pointers=new Map,this.$style=Ab,this.$action=xo,this.background=!1,this.disabled=!1,this.scaleStep=.1,this.themeColor="#39f"}static get observedAttributes(){return super.observedAttributes.concat(["background","disabled","scale-step"])}connectedCallback(){super.connectedCallback(),this.disabled||this.$bind()}disconnectedCallback(){this.disabled||this.$unbind(),super.disconnectedCallback()}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"disabled":t?this.$unbind():this.$bind();break}}$bind(){this.$onPointerDown||(this.$onPointerDown=this.$handlePointerDown.bind(this),We(this,vd,this.$onPointerDown)),this.$onPointerMove||(this.$onPointerMove=this.$handlePointerMove.bind(this),We(this.ownerDocument,bd,this.$onPointerMove)),this.$onPointerUp||(this.$onPointerUp=this.$handlePointerUp.bind(this),We(this.ownerDocument,yd,this.$onPointerUp)),this.$onWheel||(this.$onWheel=this.$handleWheel.bind(this),We(this,_d,this.$onWheel,{passive:!1,capture:!0}))}$unbind(){this.$onPointerDown&&(Be(this,vd,this.$onPointerDown),this.$onPointerDown=null),this.$onPointerMove&&(Be(this.ownerDocument,bd,this.$onPointerMove),this.$onPointerMove=null),this.$onPointerUp&&(Be(this.ownerDocument,yd,this.$onPointerUp),this.$onPointerUp=null),this.$onWheel&&(Be(this,_d,this.$onWheel,{capture:!0}),this.$onWheel=null)}$handlePointerDown(o){let{buttons:e,button:t,type:r}=o;if(this.disabled||(r==="pointerdown"&&o.pointerType==="mouse"||r==="mousedown")&&(ge(e)&&e!==1||ge(t)&&t!==0||o.ctrlKey))return;let{$pointers:n}=this,s="";if(o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:d,pageX:h,pageY:p})=>{n.set(d,{startX:h,startY:p,endX:h,endY:p})});else{let{pointerId:d=0,pageX:h,pageY:p}=o;n.set(d,{startX:h,startY:p,endX:h,endY:p})}n.size>1?s=On:ti(o.target)&&(s=o.target.action||o.target.getAttribute(f1)||""),this.$emit(_o,{action:s,relatedEvent:o})!==!1&&(o.preventDefault(),this.$action=s,this.style.willChange="transform")}$handlePointerMove(o){let{$action:e,$pointers:t}=this;if(this.disabled||e===xo||t.size===0||this.$emit(v1,{action:e,relatedEvent:o})===!1)return;if(o.preventDefault(),o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:n,pageX:s,pageY:d})=>{let h=t.get(n);h&&Object.assign(h,{endX:s,endY:d})});else{let{pointerId:n=0,pageX:s,pageY:d}=o,h=t.get(n);h&&Object.assign(h,{endX:s,endY:d})}let r={action:e,relatedEvent:o};if(e===On){let n=new Map(t),s=0,d=0,h=0,p=0,f=o.pageX,x=o.pageY;t.forEach((S,z)=>{n.delete(z),n.forEach(T=>{let P=T.startX-S.startX,H=T.startY-S.startY,R=T.endX-S.endX,N=T.endY-S.endY,$=0,Q=0,fe=0,Te=0;if(P===0?H<0?fe=Math.PI*2:H>0&&(fe=Math.PI):P>0?fe=Math.PI/2+Math.atan(H/P):P<0&&(fe=Math.PI*1.5+Math.atan(H/P)),R===0?N<0?Te=Math.PI*2:N>0&&(Te=Math.PI):R>0?Te=Math.PI/2+Math.atan(N/R):R<0&&(Te=Math.PI*1.5+Math.atan(N/R)),Te>0||fe>0){let et=Te-fe,we=Math.abs(et);we>s&&(s=we,h=et,f=(S.startX+T.startX)/2,x=(S.startY+T.startY)/2)}if(P=Math.abs(P),H=Math.abs(H),R=Math.abs(R),N=Math.abs(N),P>0&&H>0?$=Math.sqrt(P*P+H*H):P>0?$=P:H>0&&($=H),R>0&&N>0?Q=Math.sqrt(R*R+N*N):R>0?Q=R:N>0&&(Q=N),$>0&&Q>0){let et=(Q-$)/$,we=Math.abs(et);we>d&&(d=we,p=et,f=(S.startX+T.startX)/2,x=(S.startY+T.startY)/2)}})});let k=s>0,C=d>0;k&&C?(r.rotate=h,r.scale=p,r.centerX=f,r.centerY=x):k?(r.action=Ia,r.rotate=h,r.centerX=f,r.centerY=x):C?(r.action=Jo,r.scale=p,r.centerX=f,r.centerY=x):r.action=xo}else{let[n]=Array.from(t.values());Object.assign(r,n)}t.forEach(n=>{n.startX=n.endX,n.startY=n.endY}),r.action!==xo&&this.$emit(ei,r,{cancelable:!1})}$handlePointerUp(o){let{$action:e,$pointers:t}=this;if(!(this.disabled||e===xo)&&this.$emit(wo,{action:e,relatedEvent:o})!==!1){if(o.preventDefault(),o.changedTouches)Array.from(o.changedTouches).forEach(({identifier:r})=>{t.delete(r)});else{let{pointerId:r=0}=o;t.delete(r)}t.size===0&&(this.style.willChange="",this.$action=xo)}}$handleWheel(o){if(this.disabled||(o.preventDefault(),this.$wheeling))return;this.$wheeling=!0,setTimeout(()=>{this.$wheeling=!1},50);let t=(o.deltaY>0?-1:1)*this.scaleStep;this.$emit(ei,{action:Jo,scale:t,relatedEvent:o},{cancelable:!1})}$setAction(o){return Dn(o)&&(this.$action=o),this}$toCanvas(o){return new Promise((e,t)=>{if(!this.isConnected){t(new Error("The current element is not connected to the DOM."));return}let r=document.createElement("canvas"),n=this.offsetWidth,s=this.offsetHeight,d=1;Fn(o)&&(or(o.width)||or(o.height))&&({width:n,height:s}=Ln({aspectRatio:n/s,width:o.width,height:o.height}),d=n/this.offsetWidth),r.width=n,r.height=s;let h=this.querySelector(this.$getTagNameOf(ko));if(!h){e(r);return}h.$ready().then(p=>{let f=r.getContext("2d");if(f){let[x,k,C,S,z,T]=h.$getTransform(),P=z,H=T,R=p.naturalWidth,N=p.naturalHeight;d!==1&&(P*=d,H*=d,R*=d,N*=d);let $=R/2,Q=N/2;f.fillStyle="transparent",f.fillRect(0,0,n,s),Fn(o)&&Nn(o.beforeDraw)&&o.beforeDraw.call(this,f,r),f.save(),f.translate($,Q),f.transform(x,k,C,S,P,H),f.translate(-$,-Q),f.drawImage(p,0,0,R,N),f.restore()}e(r)}).catch(t)})}};Wi.$name=to;Wi.$version="2.1.1";var Pb=":host{display:inline-block}img{display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}",z1=new WeakMap,E1=["alt","crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","src","srcset"],Ui=class extends Mt{constructor(){super(...arguments),this.$isReady=!1,this.$matrix=[1,0,0,1,0,0],this.$onLoad=null,this.$onCanvasAction=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$actionStartTarget=null,this.$style=Pb,this.$image=new Image,this.initialCenterSize="contain",this.rotatable=!1,this.scalable=!1,this.skewable=!1,this.slottable=!1,this.translatable=!1,this.alt="",this.crossorigin="",this.decoding="",this.elementtiming="",this.fetchpriority="",this.loading="",this.referrerpolicy="",this.sizes="",this.src="",this.srcset=""}set $canvas(o){z1.set(this,o)}get $canvas(){return z1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(E1,["initial-center-size","rotatable","scalable","skewable","translatable"])}attributeChangedCallback(o,e,t){Object.is(t,e)||(super.attributeChangedCallback(o,e,t),E1.includes(o)&&this.$image.setAttribute(o,t))}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"initialCenterSize":this.$nextTick(()=>{this.$center(t)});break;case"src":this.$isReady=!1;break}}connectedCallback(){super.connectedCallback();let{$image:o}=this,e=this.closest(this.$getTagNameOf(to));e&&(this.$canvas=e,this.$setStyles({display:"block",position:"absolute"}),this.$onCanvasActionStart=t=>{var r,n;this.$actionStartTarget=(n=(r=t.detail)===null||r===void 0?void 0:r.relatedEvent)===null||n===void 0?void 0:n.target},this.$onCanvasActionEnd=()=>{this.$actionStartTarget=null},this.$onCanvasAction=this.$handleAction.bind(this),We(e,_o,this.$onCanvasActionStart),We(e,wo,this.$onCanvasActionEnd),We(e,ei,this.$onCanvasAction)),this.$onLoad=this.$handleLoad.bind(this),We(o,zi,this.$onLoad),this.$getShadowRoot().appendChild(o)}disconnectedCallback(){let{$image:o,$canvas:e}=this;e&&(this.$onCanvasActionStart&&(Be(e,_o,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(Be(e,wo,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(Be(e,ei,this.$onCanvasAction),this.$onCanvasAction=null)),o&&this.$onLoad&&(Be(o,zi,this.$onLoad),this.$onLoad=null),this.$getShadowRoot().removeChild(o),super.disconnectedCallback()}$handleLoad(){let{$image:o}=this;this.$setStyles({width:o.naturalWidth,height:o.naturalHeight}),this.$canvas&&this.$center(this.initialCenterSize),this.$isReady=!0}$handleAction(o){if(this.hidden||!(this.rotatable||this.scalable||this.translatable))return;let{$canvas:e}=this,{detail:t}=o;if(t){let{relatedEvent:r}=t,{action:n}=t;switch(n===On&&(!this.rotatable||!this.scalable)&&(this.rotatable?n=Ia:this.scalable?n=Jo:n=xo),n){case ll:if(this.translatable){let s=null;r&&(s=r.target.closest(this.$getTagNameOf(wr))),s||(s=e.querySelector(this.$getTagNameOf(wr))),s&&s.multiple&&!s.active&&(s=e.querySelector(`${this.$getTagNameOf(wr)}[active]`)),(!s||s.hidden||!s.movable||s.dynamic||!(this.$actionStartTarget&&s.contains(this.$actionStartTarget)))&&this.$move(t.endX-t.startX,t.endY-t.startY)}break;case Ia:if(this.rotatable)if(r){let{x:s,y:d}=this.getBoundingClientRect();this.$rotate(t.rotate,r.clientX-s,r.clientY-d)}else this.$rotate(t.rotate);break;case Jo:if(this.scalable)if(r){let s=r.target.closest(this.$getTagNameOf(wr));if(!s||!s.zoomable||s.zoomable&&s.dynamic){let{x:d,y:h}=this.getBoundingClientRect();this.$zoom(t.scale,r.clientX-d,r.clientY-h)}}else this.$zoom(t.scale);break;case On:if(this.rotatable&&this.scalable){let{rotate:s}=t,{scale:d}=t;d<0?d=1/(1-d):d+=1;let h=Math.cos(s),p=Math.sin(s),[f,x,k,C]=[h*d,p*d,-p*d,h*d];if(r){let S=this.getBoundingClientRect(),z=r.clientX-S.x,T=r.clientY-S.y,[P,H,R,N]=this.$matrix,$=S.width/2,Q=S.height/2,fe=z-$,Te=T-Q,et=(fe*N-R*Te)/(P*N-R*H),we=(Te*P-H*fe)/(P*N-R*H);this.$transform(f,x,k,C,et*(1-f)+we*k,we*(1-C)+et*x)}else this.$transform(f,x,k,C,0,0)}break}}}$ready(o){let{$image:e}=this,t=new Promise((r,n)=>{let s=new Error("Failed to load the image source");if(e.complete)e.naturalWidth>0&&e.naturalHeight>0?r(e):n(s);else{let d=()=>{Be(e,kd,h),setTimeout(()=>{r(e)})},h=()=>{Be(e,zi,d),n(s)};Sd(e,zi,d),Sd(e,kd,h)}});return Nn(o)&&t.then(r=>(o(r),r)),t}$center(o){let{parentElement:e}=this;if(!e)return this;let t=e.getBoundingClientRect(),r=t.width,n=t.height,{x:s,y:d,width:h,height:p}=this.getBoundingClientRect(),f=s+h/2,x=d+p/2,k=t.x+r/2,C=t.y+n/2,{translatable:S}=this;if(!S&&!this.$isReady&&(this.translatable=!0,this.$nextTick(()=>{this.translatable=S})),this.$move(k-f,C-x),o&&(h!==r||p!==n)){let z=r/h,T=n/p,{scalable:P}=this;switch(o&&!P&&!this.$isReady&&(this.scalable=!0,this.$nextTick(()=>{this.scalable=P})),o){case"cover":this.$scale(Math.max(z,T));break;case"contain":this.$scale(Math.min(z,T));break}}return this}$move(o,e=o){if(this.translatable&&ge(o)&&ge(e)){let[t,r,n,s]=this.$matrix,d=(o*s-n*e)/(t*s-n*r),h=(e*t-r*o)/(t*s-n*r);this.$translate(d,h)}return this}$moveTo(o,e=o){if(this.translatable&&ge(o)&&ge(e)){let[t,r,n,s]=this.$matrix,d=(o*s-n*e)/(t*s-n*r),h=(e*t-r*o)/(t*s-n*r);this.$setTransform(t,r,n,s,d,h)}return this}$rotate(o,e,t){if(this.rotatable){let r=dl(o),n=Math.cos(r),s=Math.sin(r),[d,h,p,f]=[n,s,-s,n];if(ge(e)&&ge(t)){let[x,k,C,S]=this.$matrix,{width:z,height:T}=this.getBoundingClientRect(),P=z/2,H=T/2,R=e-P,N=t-H,$=(R*S-C*N)/(x*S-C*k),Q=(N*x-k*R)/(x*S-C*k);this.$transform(d,h,p,f,$*(1-d)-Q*p,Q*(1-f)-$*h)}else this.$transform(d,h,p,f,0,0)}return this}$zoom(o,e,t){if(!this.scalable||o===0)return this;if(o<0?o=1/(1-o):o+=1,ge(e)&&ge(t)){let[r,n,s,d]=this.$matrix,{width:h,height:p}=this.getBoundingClientRect(),f=h/2,x=p/2,k=e-f,C=t-x,S=(k*d-s*C)/(r*d-s*n),z=(C*r-n*k)/(r*d-s*n);this.$transform(o,0,0,o,S*(1-o),z*(1-o))}else this.$scale(o);return this}$scale(o,e=o){return this.scalable&&this.$transform(o,0,0,e,0,0),this}$skew(o,e=0){if(this.skewable){let t=dl(o),r=dl(e);this.$transform(1,Math.tan(r),Math.tan(t),1,0,0)}return this}$translate(o,e=o){return this.translatable&&ge(o)&&ge(e)&&this.$transform(1,0,0,1,o,e),this}$transform(o,e,t,r,n,s){return ge(o)&&ge(e)&&ge(t)&&ge(r)&&ge(n)&&ge(s)?this.$setTransform(Td(this.$matrix,[o,e,t,r,n,s])):this}$setTransform(o,e,t,r,n,s){if((this.rotatable||this.scalable||this.skewable||this.translatable)&&(Array.isArray(o)&&([o,e,t,r,n,s]=o),ge(o)&&ge(e)&&ge(t)&&ge(r)&&ge(n)&&ge(s))){let d=[...this.$matrix],h=[o,e,t,r,n,s];if(this.$emit(Va,{matrix:h,oldMatrix:d})===!1)return this;this.$matrix=h,this.style.transform=`matrix(${h.join(", ")})`}return this}$getTransform(){return this.$matrix.slice()}$resetTransform(){return this.$setTransform([1,0,0,1,0,0])}};Ui.$name=ko;Ui.$version="2.1.1";var jb=":host{display:block;height:0;left:0;outline:var(--theme-color) solid 1px;position:relative;top:0;width:0}:host([transparent]){outline-color:transparent}",S1=new WeakMap,Gi=class extends Mt{constructor(){super(...arguments),this.$onWindowResize=null,this.$onCanvasActionEnd=null,this.$onCanvasActionStart=null,this.$onSelectionChange=null,this.$style=jb,this.x=0,this.y=0,this.width=0,this.height=0,this.slottable=!1,this.themeColor="rgba(0, 0, 0, 0.65)"}set $canvas(o){S1.set(this,o)}get $canvas(){return S1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["height","width","x","y"])}connectedCallback(){super.connectedCallback();let o=this.closest(this.$getTagNameOf(to));if(o){this.$canvas=o,this.style.position="absolute";let e=o.querySelector(this.$getTagNameOf(wr));e&&(this.$onWindowResize=this.$render.bind(this),this.$onCanvasActionStart=t=>{e.hidden&&t.detail.action===jn&&(this.hidden=!1)},this.$onCanvasActionEnd=t=>{e.hidden&&t.detail.action===jn&&(this.hidden=!0)},this.$onSelectionChange=t=>{let{x:r,y:n,width:s,height:d}=t.defaultPrevented?e:t.detail;this.$change(r,n,s,d),(e.hidden||r===0&&n===0&&s===0&&d===0)&&(this.hidden=!0)},We(window,wd,this.$onWindowResize),We(o,_o,this.$onCanvasActionStart),We(o,wo,this.$onCanvasActionEnd),We(o,Mo,this.$onSelectionChange))}this.$render()}disconnectedCallback(){let{$canvas:o}=this;o&&(this.$onWindowResize&&(Be(window,wd,this.$onWindowResize),this.$onWindowResize=null),this.$onCanvasActionStart&&(Be(o,_o,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(Be(o,wo,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onSelectionChange&&(Be(o,Mo,this.$onSelectionChange),this.$onSelectionChange=null)),super.disconnectedCallback()}$change(o,e,t=this.width,r=this.height){return!ge(o)||!ge(e)||!ge(t)||!ge(r)||o===this.x&&e===this.y&&t===this.width&&r===this.height?this:(this.hidden&&(this.hidden=!1),this.x=o,this.y=e,this.width=t,this.height=r,this.$render())}$reset(){return this.$change(0,0,0,0)}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height,outlineWidth:Hr.innerWidth*Hr.devicePixelRatio})}};Gi.$name=m1;Gi.$version="2.1.1";var Ob=':host{background-color:var(--theme-color);display:block}:host([action=move]),:host([action=select]){height:100%;left:0;position:absolute;top:0;width:100%}:host([action=move]){cursor:move}:host([action=select]){cursor:crosshair}:host([action$=-resize]){background-color:transparent;height:15px;position:absolute;width:15px}:host([action$=-resize]):after{background-color:var(--theme-color);content:"";display:block;height:5px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:5px}:host([action=n-resize]),:host([action=s-resize]){cursor:ns-resize;left:50%;transform:translateX(-50%);width:100%}:host([action=n-resize]){top:-8px}:host([action=s-resize]){bottom:-8px}:host([action=e-resize]),:host([action=w-resize]){cursor:ew-resize;height:100%;top:50%;transform:translateY(-50%)}:host([action=e-resize]){right:-8px}:host([action=w-resize]){left:-8px}:host([action=ne-resize]){cursor:nesw-resize;right:-8px;top:-8px}:host([action=nw-resize]){cursor:nwse-resize;left:-8px;top:-8px}:host([action=se-resize]){bottom:-8px;cursor:nwse-resize;right:-8px}:host([action=se-resize]):after{height:15px;width:15px}@media (pointer:coarse){:host([action=se-resize]):after{height:10px;width:10px}}@media (pointer:fine){:host([action=se-resize]):after{height:5px;width:5px}}:host([action=sw-resize]){bottom:-8px;cursor:nesw-resize;left:-8px}:host([plain]){background-color:transparent}',Yi=class extends Mt{constructor(){super(...arguments),this.$onCanvasCropEnd=null,this.$onCanvasCropStart=null,this.$style=Ob,this.action=xo,this.plain=!1,this.slottable=!1,this.themeColor="rgba(51, 153, 255, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["action","plain"])}};Yi.$name=p1;Yi.$version="2.1.1";var Hb=':host{display:block;left:0;position:relative;right:0}:host([outlined]){outline:1px solid var(--theme-color)}:host([multiple]){outline:1px dashed hsla(0,0%,100%,.5)}:host([multiple]):after{bottom:0;content:"";cursor:pointer;display:block;left:0;position:absolute;right:0;top:0}:host([multiple][active]){outline-color:var(--theme-color);z-index:1}:host([multiple])>*{visibility:hidden}:host([multiple][active])>*{visibility:visible}:host([multiple][active]):after{display:none}',$1=new WeakMap,Xi=class extends Mt{constructor(){super(...arguments),this.$onCanvasAction=null,this.$onCanvasActionStart=null,this.$onCanvasActionEnd=null,this.$onDocumentKeyDown=null,this.$action="",this.$actionStartTarget=null,this.$changing=!1,this.$style=Hb,this.$initialSelection={x:0,y:0,width:0,height:0},this.x=0,this.y=0,this.width=0,this.height=0,this.aspectRatio=NaN,this.initialAspectRatio=NaN,this.initialCoverage=NaN,this.active=!1,this.linked=!1,this.dynamic=!1,this.movable=!1,this.resizable=!1,this.zoomable=!1,this.multiple=!1,this.keyboard=!1,this.outlined=!1,this.precise=!1}set $canvas(o){$1.set(this,o)}get $canvas(){return $1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["active","aspect-ratio","dynamic","height","initial-aspect-ratio","initial-coverage","keyboard","linked","movable","multiple","outlined","precise","resizable","width","x","y","zoomable"])}$propertyChangedCallback(o,e,t){if(!Object.is(t,e))switch(super.$propertyChangedCallback(o,e,t),o){case"x":case"y":case"width":case"height":this.$changing||this.$nextTick(()=>{this.$change(this.x,this.y,this.width,this.height,this.aspectRatio,!0)});break;case"aspectRatio":case"initialAspectRatio":this.$nextTick(()=>{this.$initSelection()});break;case"initialCoverage":this.$nextTick(()=>{or(t)&&t<=1&&this.$initSelection(!0,!0)});break;case"keyboard":this.$nextTick(()=>{this.$canvas&&(t?this.$onDocumentKeyDown||(this.$onDocumentKeyDown=this.$handleKeyDown.bind(this),We(this.ownerDocument,xd,this.$onDocumentKeyDown)):this.$onDocumentKeyDown&&(Be(this.ownerDocument,xd,this.$onDocumentKeyDown),this.$onDocumentKeyDown=null))});break;case"multiple":this.$nextTick(()=>{if(this.$canvas){let r=this.$getSelections();t?(r.forEach(n=>{n.active=!1}),this.active=!0,this.$emit(Mo,{x:this.x,y:this.y,width:this.width,height:this.height})):(this.active=!1,r.slice(1).forEach(n=>{this.$removeSelection(n)}))}});break;case"precise":this.$nextTick(()=>{this.$change(this.x,this.y)});break;case"linked":t&&(this.dynamic=!0);break}}connectedCallback(){super.connectedCallback();let o=this.closest(this.$getTagNameOf(to));o?(this.$canvas=o,this.$setStyles({position:"absolute",transform:`translate(${this.x}px, ${this.y}px)`}),this.hidden||this.$render(),this.$initSelection(!0),this.$onCanvasActionStart=this.$handleActionStart.bind(this),this.$onCanvasActionEnd=this.$handleActionEnd.bind(this),this.$onCanvasAction=this.$handleAction.bind(this),We(o,_o,this.$onCanvasActionStart),We(o,wo,this.$onCanvasActionEnd),We(o,ei,this.$onCanvasAction)):this.$render()}disconnectedCallback(){let{$canvas:o}=this;o&&(this.$onCanvasActionStart&&(Be(o,_o,this.$onCanvasActionStart),this.$onCanvasActionStart=null),this.$onCanvasActionEnd&&(Be(o,wo,this.$onCanvasActionEnd),this.$onCanvasActionEnd=null),this.$onCanvasAction&&(Be(o,ei,this.$onCanvasAction),this.$onCanvasAction=null)),super.disconnectedCallback()}$getSelections(){let o=[];return this.parentElement&&(o=Array.from(this.parentElement.querySelectorAll(this.$getTagNameOf(wr)))),o}$initSelection(o=!1,e=!1){let{initialCoverage:t,parentElement:r}=this;if(or(t)&&r){let n=this.aspectRatio||this.initialAspectRatio,s=(e?0:this.width)||r.offsetWidth*t,d=(e?0:this.height)||r.offsetHeight*t;or(n)&&({width:s,height:d}=Ln({aspectRatio:n,width:s,height:d})),this.$change(this.x,this.y,s,d),o&&this.$center(),this.$initialSelection={x:this.x,y:this.y,width:this.width,height:this.height}}}$createSelection(){let o=this.cloneNode(!0);return this.hasAttribute("id")&&o.removeAttribute("id"),o.initialCoverage=NaN,this.active=!1,this.parentElement&&this.parentElement.insertBefore(o,this.nextSibling),o}$removeSelection(o=this){if(this.parentElement){let e=this.$getSelections();if(e.length>1){let t=e.indexOf(o),r=e[t+1]||e[t-1];r&&(o.active=!1,this.parentElement.removeChild(o),r.active=!0,r.$emit(Mo,{x:r.x,y:r.y,width:r.width,height:r.height}))}else this.$clear()}}$handleActionStart(o){var e,t;let r=(t=(e=o.detail)===null||e===void 0?void 0:e.relatedEvent)===null||t===void 0?void 0:t.target;this.$action="",this.$actionStartTarget=r,!this.hidden&&this.multiple&&!this.active&&r===this&&this.parentElement&&(this.$getSelections().forEach(n=>{n.active=!1}),this.active=!0,this.$emit(Mo,{x:this.x,y:this.y,width:this.width,height:this.height}))}$handleAction(o){let{currentTarget:e,detail:t}=o;if(!e||!t)return;let{relatedEvent:r}=t,{action:n}=t,s=r?x1(r):null;if(!n&&this.multiple&&(n=this.$action||s?.action,this.$action=n),!n||this.hidden&&n!==jn||this.multiple&&!this.active&&n!==Jo)return;let{width:d,height:h}=this,p=t.endX-t.startX,f=t.endY-t.startY,{aspectRatio:x}=this;switch(!or(x)&&r.shiftKey&&(x=or(d)&&or(h)?d/h:1),n){case jn:if(p!==0||f!==0){p===0?p=f:f===0&&(f=p);let{$canvas:k}=this,C=$d(e);(this.multiple&&!this.hidden?this.$createSelection():this).$change(t.startX-C.left,t.startY-C.top,Math.abs(p),Math.abs(f),x),p<0?f<0?n=Rn:f>0&&(n=Vn):p>0&&(f<0?n=Hn:f>0&&(n=In)),k&&(k.$action=n)}break;case ll:this.movable&&(this.dynamic||this.$actionStartTarget&&this.contains(this.$actionStartTarget))&&this.$move(p,f);break;case Jo:if(r&&this.zoomable&&(this.dynamic||this.contains(r.target))){let k=$d(e);this.$zoom(t.scale,r.pageX-k.left,r.pageY-k.top)}break;default:this.$resize(n,p,f,x)}}$handleActionEnd(){this.$action="",this.$actionStartTarget=null}$handleKeyDown(o){if(this.hidden||!this.keyboard||this.multiple&&!this.active||o.defaultPrevented)return;let{activeElement:e}=document;if(!(e&&(["INPUT","TEXTAREA"].includes(e.tagName)||["true","plaintext-only"].includes(e.contentEditable))))switch(o.key){case"Backspace":o.metaKey&&(o.preventDefault(),this.$removeSelection());break;case"Delete":o.preventDefault(),this.$removeSelection();break;case"ArrowLeft":o.preventDefault(),this.$move(-1,0);break;case"ArrowRight":o.preventDefault(),this.$move(1,0);break;case"ArrowUp":o.preventDefault(),this.$move(0,-1);break;case"ArrowDown":o.preventDefault(),this.$move(0,1);break;case"+":o.preventDefault(),this.$zoom(.1);break;case"-":o.preventDefault(),this.$zoom(-.1);break}}$center(){let{parentElement:o}=this;if(!o)return this;let e=(o.offsetWidth-this.width)/2,t=(o.offsetHeight-this.height)/2;return this.$change(e,t)}$move(o,e=o){return this.$moveTo(this.x+o,this.y+e)}$moveTo(o,e=o){return this.movable?this.$change(o,e):this}$resize(o,e=0,t=0,r=this.aspectRatio){if(!this.resizable)return this;let n=or(r),{$canvas:s}=this,{x:d,y:h,width:p,height:f}=this;switch(o){case pd:h+=t,f-=t,f<0&&(o=gd,f=-f,h-=f),n&&(e=t*r,d+=e/2,p-=e,p<0&&(p=-p,d-=p));break;case md:p+=e,p<0&&(o=fd,p=-p,d-=p),n&&(t=e/r,h-=t/2,f+=t,f<0&&(f=-f,h-=f));break;case gd:f+=t,f<0&&(o=pd,f=-f,h-=f),n&&(e=t*r,d-=e/2,p+=e,p<0&&(p=-p,d-=p));break;case fd:d+=e,p-=e,p<0&&(o=md,p=-p,d-=p),n&&(t=e/r,h+=t/2,f-=t,f<0&&(f=-f,h-=f));break;case Hn:n&&(t=-e/r),h+=t,f-=t,p+=e,p<0&&f<0?(o=Vn,p=-p,f=-f,d-=p,h-=f):p<0?(o=Rn,p=-p,d-=p):f<0&&(o=In,f=-f,h-=f);break;case Rn:n&&(t=e/r),d+=e,h+=t,p-=e,f-=t,p<0&&f<0?(o=In,p=-p,f=-f,d-=p,h-=f):p<0?(o=Hn,p=-p,d-=p):f<0&&(o=Vn,f=-f,h-=f);break;case In:n&&(t=e/r),p+=e,f+=t,p<0&&f<0?(o=Rn,p=-p,f=-f,d-=p,h-=f):p<0?(o=Vn,p=-p,d-=p):f<0&&(o=Hn,f=-f,h-=f);break;case Vn:n&&(t=-e/r),d+=e,p-=e,f+=t,p<0&&f<0?(o=Hn,p=-p,f=-f,d-=p,h-=f):p<0?(o=In,p=-p,d-=p):f<0&&(o=Rn,f=-f,h-=f);break}return s&&s.$setAction(o),this.$change(d,h,p,f)}$zoom(o,e,t){if(!this.zoomable||o===0)return this;o<0?o=1/(1-o):o+=1;let{width:r,height:n}=this,s=r*o,d=n*o,h=this.x,p=this.y;return ge(e)&&ge(t)?(h-=(s-r)*((e-this.x)/r),p-=(d-n)*((t-this.y)/n)):(h-=(s-r)/2,p-=(d-n)/2),this.$change(h,p,s,d)}$change(o,e,t=this.width,r=this.height,n=this.aspectRatio,s=!1){return this.$changing||!ge(o)||!ge(e)||!ge(t)||!ge(r)||t<0||r<0?this:(or(n)&&({width:t,height:r}=Ln({aspectRatio:n,width:t,height:r},"cover")),this.precise||(o=Math.round(o),e=Math.round(e),t=Math.round(t),r=Math.round(r)),o===this.x&&e===this.y&&t===this.width&&r===this.height&&Object.is(n,this.aspectRatio)&&!s?this:(this.hidden&&(this.hidden=!1),this.$emit(Mo,{x:o,y:e,width:t,height:r})===!1?this:(this.$changing=!0,this.x=o,this.y=e,this.width=t,this.height=r,this.$changing=!1,this.$render())))}$reset(){let{x:o,y:e,width:t,height:r}=this.$initialSelection;return this.$change(o,e,t,r)}$clear(){return this.$change(0,0,0,0,NaN,!0),this.hidden=!0,this}$render(){return this.$setStyles({transform:`translate(${this.x}px, ${this.y}px)`,width:this.width,height:this.height})}$toCanvas(o){return new Promise((e,t)=>{if(!this.isConnected){t(new Error("The current element is not connected to the DOM."));return}let r=document.createElement("canvas"),{width:n,height:s}=this,d=1;if(Fn(o)&&(or(o.width)||or(o.height))&&({width:n,height:s}=Ln({aspectRatio:n/s,width:o.width,height:o.height}),d=n/this.width),r.width=n,r.height=s,!this.$canvas){e(r);return}let h=this.$canvas.querySelector(this.$getTagNameOf(ko));if(!h){e(r);return}h.$ready().then(p=>{let f=r.getContext("2d");if(f){let[x,k,C,S,z,T]=h.$getTransform(),P=-this.x,H=-this.y,R=(P*S-C*H)/(x*S-C*k),N=(H*x-k*P)/(x*S-C*k),$=x*R+C*N+z,Q=k*R+S*N+T,fe=p.naturalWidth,Te=p.naturalHeight;d!==1&&($*=d,Q*=d,fe*=d,Te*=d);let et=fe/2,we=Te/2;f.fillStyle="transparent",f.fillRect(0,0,n,s),Fn(o)&&Nn(o.beforeDraw)&&o.beforeDraw.call(this,f,r),f.save(),f.translate(et,we),f.transform(x,k,C,S,$,Q),f.translate(-et,-we),f.drawImage(p,0,0,fe,Te),f.restore()}e(r)}).catch(t)})}};Xi.$name=wr;Xi.$version="2.1.1";var Rb=":host{display:flex;flex-direction:column;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([bordered]){border:1px dashed var(--theme-color)}:host([covered]){bottom:0;left:0;position:absolute;right:0;top:0}:host>span{display:flex;flex:1}:host>span+span{border-top:1px dashed var(--theme-color)}:host>span>span{flex:1}:host>span>span+span{border-left:1px dashed var(--theme-color)}",Zi=class extends Mt{constructor(){super(...arguments),this.$style=Rb,this.bordered=!1,this.columns=3,this.covered=!1,this.rows=3,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["bordered","columns","covered","rows"])}$propertyChangedCallback(o,e,t){Object.is(t,e)||(super.$propertyChangedCallback(o,e,t),(o==="rows"||o==="columns")&&this.$nextTick(()=>{this.$render()}))}connectedCallback(){super.connectedCallback(),this.$render()}$render(){let o=this.$getShadowRoot(),e=document.createDocumentFragment();for(let t=0;t<this.rows;t+=1){let r=document.createElement("span");r.setAttribute("role","row");for(let n=0;n<this.columns;n+=1){let s=document.createElement("span");s.setAttribute("role","gridcell"),r.appendChild(s)}e.appendChild(r)}o&&(o.innerHTML="",o.appendChild(e))}};Zi.$name=h1;Zi.$version="2.1.1";var Ib=':host{display:inline-block;height:1em;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1em}:host:after,:host:before{background-color:var(--theme-color);content:"";display:block;position:absolute}:host:before{height:1px;left:0;top:50%;transform:translateY(-50%);width:100%}:host:after{height:100%;left:50%;top:0;transform:translateX(-50%);width:1px}:host([centered]){left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}',Qi=class extends Mt{constructor(){super(...arguments),this.$style=Ib,this.centered=!1,this.slottable=!1,this.themeColor="rgba(238, 238, 238, 0.5)"}static get observedAttributes(){return super.observedAttributes.concat(["centered"])}};Qi.$name=u1;Qi.$version="2.1.1";var Vb=":host{display:block;height:100%;overflow:hidden;position:relative;width:100%}",T1=new WeakMap,A1=new WeakMap,P1=new WeakMap,j1=new WeakMap,Db="both",Fb="horizontal",O1="vertical",Nb="none",Ji=class extends Mt{constructor(){super(...arguments),this.$onSelectionChange=null,this.$onSourceImageLoad=null,this.$onSourceImageTransform=null,this.$scale=1,this.$style=Vb,this.resize=O1,this.selection="",this.slottable=!1}set $image(o){A1.set(this,o)}get $image(){return A1.get(this)}set $sourceImage(o){j1.set(this,o)}get $sourceImage(){return j1.get(this)}set $canvas(o){T1.set(this,o)}get $canvas(){return T1.get(this)}set $selection(o){P1.set(this,o)}get $selection(){return P1.get(this)}static get observedAttributes(){return super.observedAttributes.concat(["resize","selection"])}connectedCallback(){var o,e;super.connectedCallback();let t=null;if(this.selection?t=(e=(o=cl(this))===null||o===void 0?void 0:o.querySelector(this.selection))!==null&&e!==void 0?e:null:t=this.closest(this.$getTagNameOf(wr)),ti(t)){this.$selection=t,this.$onSelectionChange=this.$handleSelectionChange.bind(this),We(t,Mo,this.$onSelectionChange);let r=t.closest(this.$getTagNameOf(to));if(r){this.$canvas=r;let n=r.querySelector(this.$getTagNameOf(ko));n&&(this.$sourceImage=n,this.$image=n.cloneNode(!0),this.$getShadowRoot().appendChild(this.$image),this.$onSourceImageLoad=this.$handleSourceImageLoad.bind(this),this.$onSourceImageTransform=this.$handleSourceImageTransform.bind(this),We(n.$image,zi,this.$onSourceImageLoad),We(n,Va,this.$onSourceImageTransform))}this.$render()}}disconnectedCallback(){let{$selection:o,$sourceImage:e}=this;o&&this.$onSelectionChange&&(Be(o,Mo,this.$onSelectionChange),this.$onSelectionChange=null),e&&this.$onSourceImageLoad&&(Be(e.$image,zi,this.$onSourceImageLoad),this.$onSourceImageLoad=null),e&&this.$onSourceImageTransform&&(Be(e,Va,this.$onSourceImageTransform),this.$onSourceImageTransform=null),super.disconnectedCallback()}$handleSelectionChange(o){this.$render(o.defaultPrevented?this.$selection:o.detail)}$handleSourceImageLoad(){let{$image:o,$sourceImage:e}=this,t=o.getAttribute("src"),r=e.getAttribute("src");r&&r!==t&&(o.setAttribute("src",r),o.$ready(()=>{this.$render()}))}$handleSourceImageTransform(o){this.$render(void 0,o.detail.matrix)}$render(o,e){let{$canvas:t,$selection:r}=this;!o&&!r.hidden&&(o=r),(!o||o.x===0&&o.y===0&&o.width===0&&o.height===0)&&(o={x:0,y:0,width:t.offsetWidth,height:t.offsetHeight});let{x:n,y:s,width:d,height:h}=o,p={},{clientWidth:f,clientHeight:x}=this,k=f,C=x,S=NaN;switch(this.resize){case Db:S=1,k=d,C=h,p.width=d,p.height=h;break;case Fb:S=h>0?x/h:0,k=d*S,p.width=k;break;case O1:S=d>0?f/d:0,C=h*S,p.height=C;break;case Nb:default:f>0?S=d>0?f/d:0:x>0&&(S=h>0?x/h:0)}this.$scale=S,this.$setStyles(p),this.$sourceImage&&setTimeout(()=>{this.$transformImageByOffset(e??this.$sourceImage.$getTransform(),-n,-s)})}$transformImageByOffset(o,e,t){let{$image:r,$scale:n,$sourceImage:s}=this;if(s&&r&&n>=0){let[d,h,p,f,x,k]=o,C=(e*f-p*t)/(d*f-p*h),S=(t*d-h*e)/(d*f-p*h),z=d*C+p*S+x,T=h*C+f*S+k;s.$ready(P=>{this.$setStyles.call(r,{width:P.naturalWidth*n,height:P.naturalHeight*n})}),r.$setTransform(d,h,p,f,z*n,T*n)}}};Ji.$name=g1;Ji.$version="2.1.1";var Lb='<cropper-canvas background><cropper-image rotatable scalable skewable translatable></cropper-image><cropper-shade hidden></cropper-shade><cropper-handle action="select" plain></cropper-handle><cropper-selection initial-coverage="0.5" movable resizable><cropper-grid role="grid" bordered covered></cropper-grid><cropper-crosshair centered></cropper-crosshair><cropper-handle action="move" theme-color="rgba(255, 255, 255, 0.35)"></cropper-handle><cropper-handle action="n-resize"></cropper-handle><cropper-handle action="e-resize"></cropper-handle><cropper-handle action="s-resize"></cropper-handle><cropper-handle action="w-resize"></cropper-handle><cropper-handle action="ne-resize"></cropper-handle><cropper-handle action="nw-resize"></cropper-handle><cropper-handle action="se-resize"></cropper-handle><cropper-handle action="sw-resize"></cropper-handle></cropper-selection></cropper-canvas>',Bb=/^img|canvas$/,qb=/<(\/?(?:script|style)[^>]*)>/gi,H1={template:Lb};Wi.$define();Qi.$define();Zi.$define();Yi.$define();Ui.$define();Xi.$define();Gi.$define();Ji.$define();var Da=class{constructor(o,e){var t;if(this.options=H1,Dn(o)&&(o=document.querySelector(o)),!ti(o)||!Bb.test(o.localName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=o,e=Object.assign(Object.assign({},H1),e),this.options=e;let{container:r}=e;if(r&&(Dn(r)&&(r=(t=cl(o))===null||t===void 0?void 0:t.querySelector(r)),!ti(r)))throw new Error("The `container` option must be an element or a valid selector.");ti(r)||(o.parentElement?r=o.parentElement:r=o.ownerDocument.body),this.container=r;let n=o.localName,s="";n==="img"?{src:s}=o:n==="canvas"&&window.HTMLCanvasElement&&(s=o.toDataURL());let{template:d}=e;if(d&&Dn(d)){let h=document.createElement("template"),p=document.createDocumentFragment();h.innerHTML=d.replace(qb,"&lt;$1&gt;"),p.appendChild(h.content),Array.from(p.querySelectorAll(ko)).forEach(f=>{f.setAttribute("src",s),f.setAttribute("alt",o.alt||"The image to crop"),n==="img"&&["crossorigin","decoding","elementtiming","fetchpriority","loading","referrerpolicy","sizes","srcset"].forEach(x=>{o.hasAttribute(x)&&f.setAttribute(x,o.getAttribute(x)||"")})}),o.parentElement?(o.style.display="none",r.insertBefore(p,o.nextSibling)):r.appendChild(p)}}getCropperCanvas(){return this.container.querySelector(to)}getCropperImage(){return this.container.querySelector(ko)}getCropperSelection(){return this.container.querySelector(wr)}getCropperSelections(){return this.container.querySelectorAll(wr)}destroy(){var o;let e=this.getCropperCanvas();e&&((o=e.parentElement)===null||o===void 0||o.removeChild(e)),this.element&&(this.element.style.display="")}};Da.version="2.1.1";function Gb(i){if(typeof i=="number")return Number.isFinite(i)&&i>0?i:null;let o=String(i??"").trim();if(!o||o==="free")return null;if(o.includes("/")){let[t,r]=o.split("/").map(n=>Number(n.trim()));return Number.isFinite(t)&&Number.isFinite(r)&&t>0&&r>0?t/r:null}let e=Number(o);return Number.isFinite(e)&&e>0?e:null}function Yb(i,o,e){return new Promise(t=>i.toBlob(t,o,e))}var nt=class extends Wb{constructor(){super(...arguments);this.src="";this.alt="";this.aspectRatio="1";this.mimeType="image/png";this.quality=.92;this.height=420;this.crossOrigin="anonymous";this.disabled=!1;this.showResult=!0;this._loaded=!1;this._errored=!1;this._result="";this._onSelectionChange=e=>{let t=e.detail;this._selection={x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height),aspectRatio:this._ratio},this.dispatchEvent(new CustomEvent("change",{detail:this._selection,bubbles:!0,composed:!0}))};this._onLoad=()=>{this._loaded=!0,this._errored=!1,this._setupCropper(),this.dispatchEvent(new CustomEvent("load",{bubbles:!0,composed:!0}))};this._onError=()=>{this._loaded=!1,this._errored=!0,this._destroyCropper(),this.dispatchEvent(new CustomEvent("error",{bubbles:!0,composed:!0}))}}disconnectedCallback(){this._destroyCropper(),super.disconnectedCallback()}updated(e){e.has("src")&&(this._loaded=!1,this._errored=!1,this._result="",this._selection=void 0,this._destroyCropper()),e.has("height")&&this.style.setProperty("--lui-image-cropper-height",`${this.height}px`),(e.has("aspectRatio")||e.has("src"))&&this._loaded&&this._setupCropper()}reset(){this._selectionEl?.$reset(),this._cropper?.getCropperImage()?.$resetTransform(),this._emitSelectionChange()}clear(){this._selectionEl?.$clear(),this._result="",this._selection=void 0}zoomIn(){this._cropper?.getCropperImage()?.$zoom(.1)}zoomOut(){this._cropper?.getCropperImage()?.$zoom(-.1)}rotateLeft(){this._cropper?.getCropperImage()?.$rotate("-90deg")}rotateRight(){this._cropper?.getCropperImage()?.$rotate("90deg")}async crop(){let e=this._cropper?.getCropperSelection();if(!e||e.hidden||!e.width||!e.height)return null;let t=await e.$toCanvas({width:this.outputWidth,height:this.outputHeight}),r=this.mimeType||"image/png",n=Math.max(0,Math.min(1,this.quality)),s=t.toDataURL(r,n),d=await Yb(t,r,n),h={...this._readSelection(e),dataUrl:s,blob:d,canvas:t};return this._result=s,this._selection=h,this.dispatchEvent(new CustomEvent("crop",{detail:h,bubbles:!0,composed:!0})),h}get _ratio(){return Gb(this.aspectRatio)}_template(){let e=this._ratio;return`
8329
8329
  <cropper-canvas background>
8330
8330
  <cropper-image rotatable scalable translatable></cropper-image>
8331
8331
  <cropper-shade hidden></cropper-shade>
@@ -9010,13 +9010,13 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
9010
9010
  :host {
9011
9011
  display: contents;
9012
9012
  }
9013
- `,a([ro()],Ft.prototype,"locale",2),a([ro({attribute:!1})],Ft.prototype,"translations",2),a([ro({reflect:!0})],Ft.prototype,"theme",2),a([ro({reflect:!0})],Ft.prototype,"size",2),a([ro({type:Boolean,reflect:!0})],Ft.prototype,"disabled",2),a([ro({reflect:!0})],Ft.prototype,"variant",2),a([ro({reflect:!0,attribute:"direction"})],Ft.prototype,"direction",2),a([ro({attribute:!1})],Ft.prototype,"popupContainer",2),a([ro({attribute:!1})],Ft.prototype,"overlayContainer",2),a([ro({type:Number,attribute:"z-index-base"})],Ft.prototype,"zIndexBase",2),a([ro({attribute:!1})],Ft.prototype,"renderEmpty",2),a([ro({attribute:!1})],Ft.prototype,"componentConfig",2),Ft=a([my("lui-config-provider")],Ft);import{css as I1,html as Hr,LitElement as V1,nothing as Ei}from"lit";import{customElement as D1,property as ht,query as gy,queryAssignedElements as fy,state as vy}from"lit/decorators.js";function jd(i,o){return String(i.key??i.value??i.href??i.label??o)}function Od(i){return i==="chevron"?Hr`<lui-icon name="chevron-right"></lui-icon>`:i==="dot"?Hr`<span class="dot" aria-hidden="true"></span>`:i==="slash"?"/":i||"/"}function by(i,o){return i.length===o.length&&i.every((e,t)=>e===o[t])}var Wt=class extends V1{constructor(){super(...arguments);this.key="";this.value="";this.label="";this.href="";this.target="";this.rel="";this.icon="";this.disabled=!1;this.current=!1;this.first=!1;this.separator="/";this._onClick=e=>{if(this.disabled||this.current){e.preventDefault(),e.stopPropagation();return}this.dispatchEvent(new CustomEvent("item-click",{detail:{key:this.itemKey,index:-1,originalEvent:e},bubbles:!0,composed:!0}))}}get itemKey(){return this.key||this.value||this.href||this.label}_renderLabel(){return Hr`
9014
- ${this.icon?Hr`<lui-icon name=${this.icon}></lui-icon>`:Ei}
9013
+ `,a([ro()],Ft.prototype,"locale",2),a([ro({attribute:!1})],Ft.prototype,"translations",2),a([ro({reflect:!0})],Ft.prototype,"theme",2),a([ro({reflect:!0})],Ft.prototype,"size",2),a([ro({type:Boolean,reflect:!0})],Ft.prototype,"disabled",2),a([ro({reflect:!0})],Ft.prototype,"variant",2),a([ro({reflect:!0,attribute:"direction"})],Ft.prototype,"direction",2),a([ro({attribute:!1})],Ft.prototype,"popupContainer",2),a([ro({attribute:!1})],Ft.prototype,"overlayContainer",2),a([ro({type:Number,attribute:"z-index-base"})],Ft.prototype,"zIndexBase",2),a([ro({attribute:!1})],Ft.prototype,"renderEmpty",2),a([ro({attribute:!1})],Ft.prototype,"componentConfig",2),Ft=a([my("lui-config-provider")],Ft);import{css as I1,html as Rr,LitElement as V1,nothing as Ei}from"lit";import{customElement as D1,property as ht,query as gy,queryAssignedElements as fy,state as vy}from"lit/decorators.js";function jd(i,o){return String(i.key??i.value??i.href??i.label??o)}function Od(i){return i==="chevron"?Rr`<lui-icon name="chevron-right"></lui-icon>`:i==="dot"?Rr`<span class="dot" aria-hidden="true"></span>`:i==="slash"?"/":i||"/"}function by(i,o){return i.length===o.length&&i.every((e,t)=>e===o[t])}var Wt=class extends V1{constructor(){super(...arguments);this.key="";this.value="";this.label="";this.href="";this.target="";this.rel="";this.icon="";this.disabled=!1;this.current=!1;this.first=!1;this.separator="/";this._onClick=e=>{if(this.disabled||this.current){e.preventDefault(),e.stopPropagation();return}this.dispatchEvent(new CustomEvent("item-click",{detail:{key:this.itemKey,index:-1,originalEvent:e},bubbles:!0,composed:!0}))}}get itemKey(){return this.key||this.value||this.href||this.label}_renderLabel(){return Rr`
9014
+ ${this.icon?Rr`<lui-icon name=${this.icon}></lui-icon>`:Ei}
9015
9015
  <span class="label"><slot>${this.label}</slot></span>
9016
- `}render(){let e=["link",this.current?"current":"",this.disabled?"disabled":""].filter(Boolean).join(" "),t=this._renderLabel();return Hr`
9016
+ `}render(){let e=["link",this.current?"current":"",this.disabled?"disabled":""].filter(Boolean).join(" "),t=this._renderLabel();return Rr`
9017
9017
  <span class="item" part="item">
9018
9018
  <span class="separator" part="separator" aria-hidden="true">${Od(this.separator)}</span>
9019
- ${this.href&&!this.disabled&&!this.current?Hr`
9019
+ ${this.href&&!this.disabled&&!this.current?Rr`
9020
9020
  <a
9021
9021
  class=${e}
9022
9022
  part="link"
@@ -9025,7 +9025,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
9025
9025
  rel=${this.rel||(this.target==="_blank"?"noopener noreferrer":Ei)}
9026
9026
  @click=${this._onClick}
9027
9027
  >${t}</a>
9028
- `:this.current||this.disabled?Hr`<span class=${e} part="link" aria-current=${this.current?"page":Ei} aria-disabled=${this.disabled?"true":Ei}>${t}</span>`:Hr`<button class=${e} part="link" type="button" @click=${this._onClick}>${t}</button>`}
9028
+ `:this.current||this.disabled?Rr`<span class=${e} part="link" aria-current=${this.current?"page":Ei} aria-disabled=${this.disabled?"true":Ei}>${t}</span>`:Rr`<button class=${e} part="link" type="button" @click=${this._onClick}>${t}</button>`}
9029
9029
  </span>
9030
9030
  `}};Wt.styles=[A,O,I1`
9031
9031
  :host {
@@ -9114,7 +9114,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
9114
9114
  lui-icon {
9115
9115
  --lui-icon-size: 16px;
9116
9116
  }
9117
- `],a([ht()],Wt.prototype,"key",2),a([ht()],Wt.prototype,"value",2),a([ht()],Wt.prototype,"label",2),a([ht()],Wt.prototype,"href",2),a([ht()],Wt.prototype,"target",2),a([ht()],Wt.prototype,"rel",2),a([ht()],Wt.prototype,"icon",2),a([ht({type:Boolean,reflect:!0})],Wt.prototype,"disabled",2),a([ht({type:Boolean,reflect:!0})],Wt.prototype,"current",2),a([ht({type:Boolean,reflect:!0})],Wt.prototype,"first",2),a([ht()],Wt.prototype,"separator",2),Wt=a([D1("lui-breadcrumb-item")],Wt);var Ct=class extends V1{constructor(){super(...arguments);this.separator="/";this.size="md";this.currentKey="";this.maxItems=0;this.collapse="auto";this.collapsedLabel="...";this.overflowIcon="more-horizontal";this.overflowLabel="\u66F4\u591A";this.disabled=!1;this.ariaLabel="Breadcrumb";this._overflowIndexes=[];this._explicitAttrs=new Set;this._layoutFrame=0}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._resizeObserver=new ResizeObserver(()=>this._scheduleLayout())}firstUpdated(){this._resizeObserver?.observe(this),this._listEl&&this._resizeObserver?.observe(this._listEl),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._scheduleLayout()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame)}willUpdate(e){let t=F(this,"breadcrumb");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("separator")&&typeof t.separator=="string"&&this.separator!==t.separator&&(this.separator=t.separator),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("max-items")&&typeof t.maxItems=="number"&&this.maxItems!==t.maxItems&&(this.maxItems=t.maxItems)}updated(e){this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._syncSlottedItems(),(e.has("items")||e.has("separator")||e.has("size")||e.has("currentKey")||e.has("maxItems")||e.has("collapse")||e.has("collapsedLabel")||e.has("disabled"))&&this._scheduleLayout()}_syncSlottedItems(){if(this.items?.length)return;let e=(this._assignedElements??[]).filter(t=>t.tagName.toLowerCase()==="lui-breadcrumb-item");e.forEach((t,r)=>{t.first=r===0,t.hasAttribute("separator")||(t.separator=this.separator),this.disabled?(t.disabled||t.setAttribute("data-lui-breadcrumb-disabled",""),t.disabled=!0):t.hasAttribute("data-lui-breadcrumb-disabled")&&(t.removeAttribute("data-lui-breadcrumb-disabled"),t.disabled=!1),this.currentKey&&t.itemKey===this.currentKey&&(t.current=!0),!this.currentKey&&r===e.length-1&&!t.hasAttribute("current")&&(t.current=!0)})}_resolvedItems(){let e=[...this.items??[]];if(!e.length)return[];let t=this.currentKey;return e.map((r,n)=>({...r,disabled:this.disabled||r.disabled,current:r.current||(t?jd(r,n)===t:n===e.length-1),separator:r.separator??this.separator}))}_countOverflowIndexes(e){let t=Math.floor(this.maxItems||0);if(!t||e.length<=t||t<3)return[];let r=t-2,n=Math.max(1,e.length-r);return e.slice(1,n).map((s,d)=>d+1)}_autoOverflowIndexes(e){if(e.length<=2)return[];let t=Math.floor(this._listEl?.clientWidth??0);if(!t)return this._countOverflowIndexes(e);let r=Array.from(this.renderRoot.querySelectorAll("[data-measure-index]")),n=this.renderRoot.querySelector('[data-measure-overflow="true"]');if(r.length!==e.length||!n)return this._countOverflowIndexes(e);let s=Number.parseFloat(getComputedStyle(this._listEl).columnGap||"0")||0,d=r.map(z=>Math.ceil(z.getBoundingClientRect().width)),h=Math.ceil(n.getBoundingClientRect().width),p=this.maxItems>=3?Math.min(this.maxItems,e.length):e.length;if(d.reduce((z,T)=>z+T,0)+Math.max(0,e.length-1)*s<=t&&e.length<=p)return[];let x=e.slice(1,-1),k=Math.min(x.length,Math.max(0,p-2)),C=z=>{let T=x.length-z,P=[0,...x.slice(T).map((R,N)=>T+N+1),e.length-1],H=[d[0]??0,h,...P.slice(1).map(R=>d[R]??0)];return H.reduce((R,N)=>R+N,0)+Math.max(0,H.length-1)*s};for(;k>0&&C(k)>t;)k-=1;let S=x.length-k;return x.slice(0,S).map((z,T)=>T+1)}_nextOverflowIndexes(e){return this.collapse==="none"?[]:this.collapse==="count"?this._countOverflowIndexes(e):this._autoOverflowIndexes(e)}_scheduleLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._recomputeLayout()})}_recomputeLayout(){if(!this.items?.length){this._overflowIndexes.length&&(this._overflowIndexes=[]);return}let e=this._resolvedItems(),t=this._nextOverflowIndexes(e);by(t,this._overflowIndexes)||(this._overflowIndexes=t)}_displayItems(e){if(!this._overflowIndexes.length)return e;let t=new Set(this._overflowIndexes),r=[];return e.forEach((n,s)=>{t.has(s)||(r.push(n),s===0&&r.push({key:"__collapsed__",value:"__collapsed__",label:this.collapsedLabel,disabled:!0,separator:this.separator}))}),r}_overflowMenuItems(e){return this._overflowIndexes.flatMap(t=>{let r=e[t];return r?[{key:String(t),value:String(t),label:r.label??r.value??r.href??r.key??String(t),icon:r.icon,disabled:this.disabled||r.disabled,checked:r.current}]:[]})}_onItemClick(e,t,r){if(this.disabled||t.disabled||t.current)return;e.stopPropagation();let n=jd(t,r);this.dispatchEvent(new CustomEvent("item-click",{detail:{key:n,item:t,index:r,originalEvent:e.detail.originalEvent??e},bubbles:!0,composed:!0}))}_onOverflowSelect(e,t){let r=Number(e.detail?.value),n=t[r];!n||this.disabled||n.disabled||n.current||this.dispatchEvent(new CustomEvent("item-click",{detail:{key:jd(n,r),item:n,index:r,originalEvent:e.detail?.triggerEvent??e},bubbles:!0,composed:!0}))}_renderOverflow(e,t){let r=this._overflowMenuItems(e);return r.length?Hr`
9117
+ `],a([ht()],Wt.prototype,"key",2),a([ht()],Wt.prototype,"value",2),a([ht()],Wt.prototype,"label",2),a([ht()],Wt.prototype,"href",2),a([ht()],Wt.prototype,"target",2),a([ht()],Wt.prototype,"rel",2),a([ht()],Wt.prototype,"icon",2),a([ht({type:Boolean,reflect:!0})],Wt.prototype,"disabled",2),a([ht({type:Boolean,reflect:!0})],Wt.prototype,"current",2),a([ht({type:Boolean,reflect:!0})],Wt.prototype,"first",2),a([ht()],Wt.prototype,"separator",2),Wt=a([D1("lui-breadcrumb-item")],Wt);var Ct=class extends V1{constructor(){super(...arguments);this.separator="/";this.size="md";this.currentKey="";this.maxItems=0;this.collapse="auto";this.collapsedLabel="...";this.overflowIcon="more-horizontal";this.overflowLabel="\u66F4\u591A";this.disabled=!1;this.ariaLabel="Breadcrumb";this._overflowIndexes=[];this._explicitAttrs=new Set;this._layoutFrame=0}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._resizeObserver=new ResizeObserver(()=>this._scheduleLayout())}firstUpdated(){this._resizeObserver?.observe(this),this._listEl&&this._resizeObserver?.observe(this._listEl),this.parentElement&&(this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._scheduleLayout()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._layoutFrame&&cancelAnimationFrame(this._layoutFrame)}willUpdate(e){let t=F(this,"breadcrumb");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("separator")&&typeof t.separator=="string"&&this.separator!==t.separator&&(this.separator=t.separator),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("max-items")&&typeof t.maxItems=="number"&&this.maxItems!==t.maxItems&&(this.maxItems=t.maxItems)}updated(e){this.parentElement&&this.parentElement!==this._observedParent&&(this._observedParent&&this._resizeObserver?.unobserve(this._observedParent),this._observedParent=this.parentElement,this._resizeObserver?.observe(this.parentElement)),this._syncSlottedItems(),(e.has("items")||e.has("separator")||e.has("size")||e.has("currentKey")||e.has("maxItems")||e.has("collapse")||e.has("collapsedLabel")||e.has("disabled"))&&this._scheduleLayout()}_syncSlottedItems(){if(this.items?.length)return;let e=(this._assignedElements??[]).filter(t=>t.tagName.toLowerCase()==="lui-breadcrumb-item");e.forEach((t,r)=>{t.first=r===0,t.hasAttribute("separator")||(t.separator=this.separator),this.disabled?(t.disabled||t.setAttribute("data-lui-breadcrumb-disabled",""),t.disabled=!0):t.hasAttribute("data-lui-breadcrumb-disabled")&&(t.removeAttribute("data-lui-breadcrumb-disabled"),t.disabled=!1),this.currentKey&&t.itemKey===this.currentKey&&(t.current=!0),!this.currentKey&&r===e.length-1&&!t.hasAttribute("current")&&(t.current=!0)})}_resolvedItems(){let e=[...this.items??[]];if(!e.length)return[];let t=this.currentKey;return e.map((r,n)=>({...r,disabled:this.disabled||r.disabled,current:r.current||(t?jd(r,n)===t:n===e.length-1),separator:r.separator??this.separator}))}_countOverflowIndexes(e){let t=Math.floor(this.maxItems||0);if(!t||e.length<=t||t<3)return[];let r=t-2,n=Math.max(1,e.length-r);return e.slice(1,n).map((s,d)=>d+1)}_autoOverflowIndexes(e){if(e.length<=2)return[];let t=Math.floor(this._listEl?.clientWidth??0);if(!t)return this._countOverflowIndexes(e);let r=Array.from(this.renderRoot.querySelectorAll("[data-measure-index]")),n=this.renderRoot.querySelector('[data-measure-overflow="true"]');if(r.length!==e.length||!n)return this._countOverflowIndexes(e);let s=Number.parseFloat(getComputedStyle(this._listEl).columnGap||"0")||0,d=r.map(z=>Math.ceil(z.getBoundingClientRect().width)),h=Math.ceil(n.getBoundingClientRect().width),p=this.maxItems>=3?Math.min(this.maxItems,e.length):e.length;if(d.reduce((z,T)=>z+T,0)+Math.max(0,e.length-1)*s<=t&&e.length<=p)return[];let x=e.slice(1,-1),k=Math.min(x.length,Math.max(0,p-2)),C=z=>{let T=x.length-z,P=[0,...x.slice(T).map((R,N)=>T+N+1),e.length-1],H=[d[0]??0,h,...P.slice(1).map(R=>d[R]??0)];return H.reduce((R,N)=>R+N,0)+Math.max(0,H.length-1)*s};for(;k>0&&C(k)>t;)k-=1;let S=x.length-k;return x.slice(0,S).map((z,T)=>T+1)}_nextOverflowIndexes(e){return this.collapse==="none"?[]:this.collapse==="count"?this._countOverflowIndexes(e):this._autoOverflowIndexes(e)}_scheduleLayout(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._recomputeLayout()})}_recomputeLayout(){if(!this.items?.length){this._overflowIndexes.length&&(this._overflowIndexes=[]);return}let e=this._resolvedItems(),t=this._nextOverflowIndexes(e);by(t,this._overflowIndexes)||(this._overflowIndexes=t)}_displayItems(e){if(!this._overflowIndexes.length)return e;let t=new Set(this._overflowIndexes),r=[];return e.forEach((n,s)=>{t.has(s)||(r.push(n),s===0&&r.push({key:"__collapsed__",value:"__collapsed__",label:this.collapsedLabel,disabled:!0,separator:this.separator}))}),r}_overflowMenuItems(e){return this._overflowIndexes.flatMap(t=>{let r=e[t];return r?[{key:String(t),value:String(t),label:r.label??r.value??r.href??r.key??String(t),icon:r.icon,disabled:this.disabled||r.disabled,checked:r.current}]:[]})}_onItemClick(e,t,r){if(this.disabled||t.disabled||t.current)return;e.stopPropagation();let n=jd(t,r);this.dispatchEvent(new CustomEvent("item-click",{detail:{key:n,item:t,index:r,originalEvent:e.detail.originalEvent??e},bubbles:!0,composed:!0}))}_onOverflowSelect(e,t){let r=Number(e.detail?.value),n=t[r];!n||this.disabled||n.disabled||n.current||this.dispatchEvent(new CustomEvent("item-click",{detail:{key:jd(n,r),item:n,index:r,originalEvent:e.detail?.triggerEvent??e},bubbles:!0,composed:!0}))}_renderOverflow(e,t){let r=this._overflowMenuItems(e);return r.length?Rr`
9118
9118
  <li class="overflow-li">
9119
9119
  <span class="overflow-item">
9120
9120
  <span class="overflow-separator" aria-hidden="true" ?hidden=${t}>${Od(this.separator)}</span>
@@ -9138,7 +9138,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
9138
9138
  </lui-dropmenu>
9139
9139
  </span>
9140
9140
  </li>
9141
- `:Ei}_renderItem(e,t,r=t){return e.key==="__collapsed__"?Ei:Hr`
9141
+ `:Ei}_renderItem(e,t,r=t){return e.key==="__collapsed__"?Ei:Rr`
9142
9142
  <li data-current=${e.current?"true":"false"}>
9143
9143
  <lui-breadcrumb-item
9144
9144
  .key=${e.key??""}
@@ -9155,9 +9155,9 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
9155
9155
  @item-click=${n=>this._onItemClick(n,e,t)}
9156
9156
  ></lui-breadcrumb-item>
9157
9157
  </li>
9158
- `}_renderMeasuredItems(e){return Hr`
9158
+ `}_renderMeasuredItems(e){return Rr`
9159
9159
  <div class="measure" aria-hidden="true">
9160
- ${e.map((t,r)=>Hr`
9160
+ ${e.map((t,r)=>Rr`
9161
9161
  <lui-breadcrumb-item
9162
9162
  data-measure-index=${r}
9163
9163
  .key=${t.key??""}
@@ -9177,10 +9177,10 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
9177
9177
  </button>
9178
9178
  </span>
9179
9179
  </div>
9180
- `}render(){let e=this._resolvedItems(),t=this._displayItems(e),r=0;return Hr`
9180
+ `}render(){let e=this._resolvedItems(),t=this._displayItems(e),r=0;return Rr`
9181
9181
  <nav aria-label=${this.ariaLabel} part="nav">
9182
9182
  <ol part="list">
9183
- ${t.length?t.map(n=>{if(n.key==="__collapsed__")return this._renderOverflow(e,r===0);let s=e.indexOf(n),d=this._renderItem(n,s,r);return r+=1,d}):Hr`<slot @slotchange=${()=>this._syncSlottedItems()}></slot>`}
9183
+ ${t.length?t.map(n=>{if(n.key==="__collapsed__")return this._renderOverflow(e,r===0);let s=e.indexOf(n),d=this._renderItem(n,s,r);return r+=1,d}):Rr`<slot @slotchange=${()=>this._syncSlottedItems()}></slot>`}
9184
9184
  </ol>
9185
9185
  ${e.length?this._renderMeasuredItems(e):Ei}
9186
9186
  </nav>
@@ -9315,7 +9315,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
9315
9315
  slot {
9316
9316
  display: contents;
9317
9317
  }
9318
- `],a([oo({converter:wy})],zo.prototype,"gutter",2),a([oo()],zo.prototype,"align",2),a([oo()],zo.prototype,"justify",2),a([oo({type:Boolean})],zo.prototype,"nowrap",2),a([yy({flatten:!0})],zo.prototype,"_assignedElements",2),zo=a([B1("lui-row")],zo);var Rr=class extends L1{constructor(){super(...arguments);this._parentRo=null;this._layoutFrame=0;this._lastContainerWidth=-1}connectedCallback(){super.connectedCallback();let e=this.closest("lui-row");e&&(this._parentRo=new ResizeObserver(()=>this._applySpan()),this._parentRo.observe(e)),this._scheduleApply()}disconnectedCallback(){this._parentRo?.disconnect(),this._parentRo=null,this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),super.disconnectedCallback()}updated(){this._scheduleApply()}updateLayout(e){e!=null&&(this._lastContainerWidth=Math.max(0,Math.floor(e))),this._applySpan()}_scheduleApply(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._applySpan()})}_activeBreakpoint(e){return q1.find(([,t])=>e>=t)?.[0]??"xs"}_resolveSpan(e){return this[e]??this.span??24}_applySpan(){let e=this.closest("lui-row"),t=this._lastContainerWidth>=0?this._lastContainerWidth:Math.floor(e?.getBoundingClientRect().width||e?.offsetWidth||0),r=this._activeBreakpoint(t),n=this._resolveSpan(r),s=this.style;if(!Number.isFinite(n)||n<=0){_r(s,"display","none"),_r(s,"flex",""),_r(s,"maxWidth",""),_r(s,"marginLeft","");return}let d=`${Math.min(24,Math.max(0,n))/24*100}%`;_r(s,"display","block"),_r(s,"flex",`0 0 ${d}`),_r(s,"maxWidth",d),_r(s,"marginLeft",this.offset!=null?`${this.offset/24*100}%`:""),_r(s,"order",this.colOrder!=null?String(this.colOrder):"")}render(){return N1`<slot></slot>`}};Rr.styles=[A,F1`
9318
+ `],a([oo({converter:wy})],zo.prototype,"gutter",2),a([oo()],zo.prototype,"align",2),a([oo()],zo.prototype,"justify",2),a([oo({type:Boolean})],zo.prototype,"nowrap",2),a([yy({flatten:!0})],zo.prototype,"_assignedElements",2),zo=a([B1("lui-row")],zo);var Ir=class extends L1{constructor(){super(...arguments);this._parentRo=null;this._layoutFrame=0;this._lastContainerWidth=-1}connectedCallback(){super.connectedCallback();let e=this.closest("lui-row");e&&(this._parentRo=new ResizeObserver(()=>this._applySpan()),this._parentRo.observe(e)),this._scheduleApply()}disconnectedCallback(){this._parentRo?.disconnect(),this._parentRo=null,this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),super.disconnectedCallback()}updated(){this._scheduleApply()}updateLayout(e){e!=null&&(this._lastContainerWidth=Math.max(0,Math.floor(e))),this._applySpan()}_scheduleApply(){this._layoutFrame&&cancelAnimationFrame(this._layoutFrame),this._layoutFrame=requestAnimationFrame(()=>{this._layoutFrame=0,this._applySpan()})}_activeBreakpoint(e){return q1.find(([,t])=>e>=t)?.[0]??"xs"}_resolveSpan(e){return this[e]??this.span??24}_applySpan(){let e=this.closest("lui-row"),t=this._lastContainerWidth>=0?this._lastContainerWidth:Math.floor(e?.getBoundingClientRect().width||e?.offsetWidth||0),r=this._activeBreakpoint(t),n=this._resolveSpan(r),s=this.style;if(!Number.isFinite(n)||n<=0){_r(s,"display","none"),_r(s,"flex",""),_r(s,"maxWidth",""),_r(s,"marginLeft","");return}let d=`${Math.min(24,Math.max(0,n))/24*100}%`;_r(s,"display","block"),_r(s,"flex",`0 0 ${d}`),_r(s,"maxWidth",d),_r(s,"marginLeft",this.offset!=null?`${this.offset/24*100}%`:""),_r(s,"order",this.colOrder!=null?String(this.colOrder):"")}render(){return N1`<slot></slot>`}};Ir.styles=[A,F1`
9319
9319
  :host {
9320
9320
  display: block;
9321
9321
  box-sizing: border-box;
@@ -9330,7 +9330,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
9330
9330
  slot {
9331
9331
  display: contents;
9332
9332
  }
9333
- `],a([oo({type:Number})],Rr.prototype,"span",2),a([oo({type:Number})],Rr.prototype,"xs",2),a([oo({type:Number})],Rr.prototype,"sm",2),a([oo({type:Number})],Rr.prototype,"md",2),a([oo({type:Number})],Rr.prototype,"lg",2),a([oo({type:Number})],Rr.prototype,"xl",2),a([oo({type:Number})],Rr.prototype,"offset",2),a([oo({type:Number,attribute:"order"})],Rr.prototype,"colOrder",2),Rr=a([B1("lui-col")],Rr);import{css as _k,html as Z,LitElement as Mk,nothing as je}from"lit";import{customElement as Ck,property as Wa,state as bl}from"lit/decorators.js";import{keyed as zk}from"lit/directives/keyed.js";import{ref as yl}from"lit/directives/ref.js";import{repeat as Ek}from"lit/directives/repeat.js";import{TanStackFormController as Sk,isStandardSchemaValidator as $k,standardSchemaValidators as Tk}from"@tanstack/lit-form";import{css as My,html as Hd,LitElement as Cy}from"lit";import{customElement as zy,property as Ge,query as Ey}from"lit/decorators.js";var $e=class extends Cy{constructor(){super(...arguments);this.value="";this.placeholder="";this.type="text";this.size="md";this.disabled=!1;this.readonly=!1;this.autofocus=!1;this.clearable=!1;this.revealable=!1;this.invalid=!1;this.noborder=!1;this.spellcheck=!1;this.autocapitalize="";this._focused=!1;this._revealed=!1;this._explicitAttrs=new Set;this._keepFocus=e=>{e.preventDefault()};this._clearValue=()=>{this.disabled||this.readonly||(this.value="",this._revealed=!1,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("clear",{detail:{value:this.value},bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.focus()))};this._toggleReveal=()=>{this.disabled||this.type!=="password"||(this._revealed=!this._revealed,this.requestUpdate(),this.updateComplete.then(()=>this.focus()))};this._onInput=e=>{e.stopPropagation(),this.value=e.target.value,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))};this._onChange=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))};this._onKeyDown=e=>{if(e.key==="Enter"){let t=e.composedPath().find(r=>r.localName==="form");if(t){if(!t.reportValidity())return;t.requestSubmit()}}}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ye(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.()}_t(e,t){let r=Ne(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}willUpdate(){let e=F(this,"input");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled),!this._explicitAttrs.has("clearable")&&typeof e.clearable=="boolean"&&this.clearable!==e.clearable&&(this.clearable=e.clearable),!this._explicitAttrs.has("revealable")&&typeof e.revealable=="boolean"&&this.revealable!==e.revealable&&(this.revealable=e.revealable),!this._explicitAttrs.has("noborder")&&typeof e.noborder=="boolean"&&this.noborder!==e.noborder&&(this.noborder=e.noborder),!this._explicitAttrs.has("placeholder")&&typeof e.placeholder=="string"&&!this.placeholder&&(this.placeholder=e.placeholder)}focus(){this._input?.focus()}blur(){this._input?.blur()}insertText(e){let t=this._input;if(!t){this.value=`${this.value}${e}`;return}let r=t.selectionStart??t.value.length,n=t.selectionEnd??r;t.setRangeText(e,r,n,"end"),this.value=t.value,t.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),t.focus()}render(){let e=["wrapper"];this._focused&&e.push("focused"),this.disabled&&e.push("disabled"),this.invalid&&e.push("invalid");let t=this.clearable&&!this.disabled&&!this.readonly&&this.value.length>0,r=this.revealable&&this.type==="password"&&!this.disabled;return Hd`
9333
+ `],a([oo({type:Number})],Ir.prototype,"span",2),a([oo({type:Number})],Ir.prototype,"xs",2),a([oo({type:Number})],Ir.prototype,"sm",2),a([oo({type:Number})],Ir.prototype,"md",2),a([oo({type:Number})],Ir.prototype,"lg",2),a([oo({type:Number})],Ir.prototype,"xl",2),a([oo({type:Number})],Ir.prototype,"offset",2),a([oo({type:Number,attribute:"order"})],Ir.prototype,"colOrder",2),Ir=a([B1("lui-col")],Ir);import{css as _k,html as Z,LitElement as Mk,nothing as je}from"lit";import{customElement as Ck,property as Wa,state as bl}from"lit/decorators.js";import{keyed as zk}from"lit/directives/keyed.js";import{ref as yl}from"lit/directives/ref.js";import{repeat as Ek}from"lit/directives/repeat.js";import{TanStackFormController as Sk,isStandardSchemaValidator as $k,standardSchemaValidators as Tk}from"@tanstack/lit-form";import{css as My,html as Hd,LitElement as Cy}from"lit";import{customElement as zy,property as Ge,query as Ey}from"lit/decorators.js";var $e=class extends Cy{constructor(){super(...arguments);this.value="";this.placeholder="";this.type="text";this.size="md";this.disabled=!1;this.readonly=!1;this.autofocus=!1;this.clearable=!1;this.revealable=!1;this.invalid=!1;this.noborder=!1;this.spellcheck=!1;this.autocapitalize="";this._focused=!1;this._revealed=!1;this._explicitAttrs=new Set;this._keepFocus=e=>{e.preventDefault()};this._clearValue=()=>{this.disabled||this.readonly||(this.value="",this._revealed=!1,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("clear",{detail:{value:this.value},bubbles:!0,composed:!0})),this.updateComplete.then(()=>this.focus()))};this._toggleReveal=()=>{this.disabled||this.type!=="password"||(this._revealed=!this._revealed,this.requestUpdate(),this.updateComplete.then(()=>this.focus()))};this._onInput=e=>{e.stopPropagation(),this.value=e.target.value,this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value},bubbles:!0,composed:!0}))};this._onChange=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}))};this._onKeyDown=e=>{if(e.key==="Enter"){let t=e.composedPath().find(r=>r.localName==="form");if(t){if(!t.reportValidity())return;t.requestSubmit()}}}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ye(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.()}_t(e,t){let r=Ne(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}willUpdate(){let e=F(this,"input");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled),!this._explicitAttrs.has("clearable")&&typeof e.clearable=="boolean"&&this.clearable!==e.clearable&&(this.clearable=e.clearable),!this._explicitAttrs.has("revealable")&&typeof e.revealable=="boolean"&&this.revealable!==e.revealable&&(this.revealable=e.revealable),!this._explicitAttrs.has("noborder")&&typeof e.noborder=="boolean"&&this.noborder!==e.noborder&&(this.noborder=e.noborder),!this._explicitAttrs.has("placeholder")&&typeof e.placeholder=="string"&&!this.placeholder&&(this.placeholder=e.placeholder)}focus(){this._input?.focus()}blur(){this._input?.blur()}insertText(e){let t=this._input;if(!t){this.value=`${this.value}${e}`;return}let r=t.selectionStart??t.value.length,n=t.selectionEnd??r;t.setRangeText(e,r,n,"end"),this.value=t.value,t.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),t.focus()}render(){let e=["wrapper"];this._focused&&e.push("focused"),this.disabled&&e.push("disabled"),this.invalid&&e.push("invalid");let t=this.clearable&&!this.disabled&&!this.readonly&&this.value.length>0,r=this.revealable&&this.type==="password"&&!this.disabled;return Hd`
9334
9334
  <div class=${e.join(" ")} part="wrapper">
9335
9335
  <slot name="prefix"></slot>
9336
9336
  <input
@@ -9643,7 +9643,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
9643
9643
  font-size: var(--lui-font-size-lg);
9644
9644
  padding: 10px 16px;
9645
9645
  }
9646
- `],a([Nt()],Ye.prototype,"value",2),a([Nt()],Ye.prototype,"placeholder",2),a([Nt({type:Number})],Ye.prototype,"rows",2),a([Nt({type:Number,attribute:"min-rows"})],Ye.prototype,"minRows",2),a([Nt({type:Number,attribute:"max-rows"})],Ye.prototype,"maxRows",2),a([Nt({reflect:!0})],Ye.prototype,"size",2),a([Nt({type:Boolean,reflect:!0})],Ye.prototype,"disabled",2),a([Nt({type:Boolean,reflect:!0})],Ye.prototype,"readonly",2),a([Nt({type:Boolean,reflect:!0})],Ye.prototype,"invalid",2),a([Nt({type:Boolean,reflect:!0})],Ye.prototype,"noborder",2),a([Nt({type:Boolean,reflect:!0,attribute:"auto-resize"})],Ye.prototype,"autoResize",2),a([Nt()],Ye.prototype,"name",2),a([Nt()],Ye.prototype,"autocomplete",2),a([Nt({type:Number,attribute:"maxlength"})],Ye.prototype,"maxLength",2),a([Nt({type:Number,attribute:"minlength"})],Ye.prototype,"minLength",2),a([Nt()],Ye.prototype,"enterkeyhint",2),a([Nt({type:Boolean})],Ye.prototype,"spellcheck",2),a([Nt()],Ye.prototype,"autocapitalize",2),a([Py("textarea")],Ye.prototype,"_textarea",2),Ye=a([Ay("lui-textarea")],Ye);import{css as jy,html as K1,LitElement as Oy}from"lit";import{customElement as Hy,property as en,query as Ry}from"lit/decorators.js";var Ir=class extends Oy{constructor(){super(...arguments);this.checked=!1;this.disabled=!1;this.size="md";this._onKeyDown=e=>{this.disabled||(e.key===" "||e.key==="Enter")&&(e.preventDefault(),this._toggle())}}connectedCallback(){super.connectedCallback(),this._disposeLocaleChange=ye(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.()}_t(e,t){return ne(ie(this.locale,this.translations),e,t)}focus(){this._input?.focus()}blur(){this._input?.blur()}_toggle(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked},bubbles:!0,composed:!0})))}render(){return K1`
9646
+ `],a([Nt()],Ye.prototype,"value",2),a([Nt()],Ye.prototype,"placeholder",2),a([Nt({type:Number})],Ye.prototype,"rows",2),a([Nt({type:Number,attribute:"min-rows"})],Ye.prototype,"minRows",2),a([Nt({type:Number,attribute:"max-rows"})],Ye.prototype,"maxRows",2),a([Nt({reflect:!0})],Ye.prototype,"size",2),a([Nt({type:Boolean,reflect:!0})],Ye.prototype,"disabled",2),a([Nt({type:Boolean,reflect:!0})],Ye.prototype,"readonly",2),a([Nt({type:Boolean,reflect:!0})],Ye.prototype,"invalid",2),a([Nt({type:Boolean,reflect:!0})],Ye.prototype,"noborder",2),a([Nt({type:Boolean,reflect:!0,attribute:"auto-resize"})],Ye.prototype,"autoResize",2),a([Nt()],Ye.prototype,"name",2),a([Nt()],Ye.prototype,"autocomplete",2),a([Nt({type:Number,attribute:"maxlength"})],Ye.prototype,"maxLength",2),a([Nt({type:Number,attribute:"minlength"})],Ye.prototype,"minLength",2),a([Nt()],Ye.prototype,"enterkeyhint",2),a([Nt({type:Boolean})],Ye.prototype,"spellcheck",2),a([Nt()],Ye.prototype,"autocapitalize",2),a([Py("textarea")],Ye.prototype,"_textarea",2),Ye=a([Ay("lui-textarea")],Ye);import{css as jy,html as K1,LitElement as Oy}from"lit";import{customElement as Hy,property as en,query as Ry}from"lit/decorators.js";var Vr=class extends Oy{constructor(){super(...arguments);this.checked=!1;this.disabled=!1;this.size="md";this._onKeyDown=e=>{this.disabled||(e.key===" "||e.key==="Enter")&&(e.preventDefault(),this._toggle())}}connectedCallback(){super.connectedCallback(),this._disposeLocaleChange=ye(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._disposeLocaleChange?.()}_t(e,t){return ne(ie(this.locale,this.translations),e,t)}focus(){this._input?.focus()}blur(){this._input?.blur()}_toggle(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked},bubbles:!0,composed:!0})))}render(){return K1`
9647
9647
  <input
9648
9648
  type="checkbox"
9649
9649
  role="switch"
@@ -9658,7 +9658,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
9658
9658
  <div class="thumb" part="thumb"></div>
9659
9659
  </div>
9660
9660
  ${this.label?K1`<label @click=${this._toggle}>${this.label}</label>`:""}
9661
- `}};Ir.styles=[A,O,jy`
9661
+ `}};Vr.styles=[A,O,jy`
9662
9662
  :host {
9663
9663
  display: inline-flex;
9664
9664
  align-items: center;
@@ -9769,7 +9769,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
9769
9769
  transition: none;
9770
9770
  }
9771
9771
  }
9772
- `],a([en({type:Boolean,reflect:!0})],Ir.prototype,"checked",2),a([en({type:Boolean,reflect:!0})],Ir.prototype,"disabled",2),a([en({reflect:!0})],Ir.prototype,"size",2),a([en()],Ir.prototype,"name",2),a([en()],Ir.prototype,"label",2),a([en()],Ir.prototype,"locale",2),a([en({attribute:!1})],Ir.prototype,"translations",2),a([Ry("input")],Ir.prototype,"_input",2),Ir=a([Hy("lui-switch")],Ir);import{css as Iy,html as Na,LitElement as Vy,nothing as Rd}from"lit";import{customElement as Dy,property as oi,query as Fy,queryAll as Ny}from"lit/decorators.js";var Ut=class extends Vy{constructor(){super(...arguments);this.source=[];this.value=[];this.direction="horizontal";this.radius="md";this.size="md";this.disabled=!1;this.checkboxProps={};this._explicitAttrs=new Set;this._syncFrame=0;this._onSlottedChange=e=>{if(this.source.length>0)return;let t=e.target;!t||t.tagName.toLowerCase()!=="lui-checkbox"||this._toggle(t.value??"")}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._lightDomObserver=new MutationObserver(()=>this._scheduleSync()),this._lightDomObserver.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","disabled","checked","indeterminate","label","description","slot"]})}disconnectedCallback(){super.disconnectedCallback(),this._lightDomObserver?.disconnect(),this._syncFrame&&cancelAnimationFrame(this._syncFrame)}_isChecked(e){return this.value?.includes(e)??!1}_toggle(e){let t=this.value??[],r=t.includes(e)?t.filter(n=>n!==e):[...t,e];this.value=r,this.dispatchEvent(new CustomEvent("change",{detail:{value:r},bubbles:!0,composed:!0}))}firstUpdated(){this._scheduleSync()}willUpdate(){let e=F(this,"checkboxGroup");!this._explicitAttrs.has("direction")&&typeof e.direction=="string"&&this.direction!==e.direction&&(this.direction=e.direction),!this._explicitAttrs.has("radius")&&typeof e.radius=="string"&&this.radius!==e.radius&&(this.radius=e.radius),!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled)}updated(e){(e.has("value")||e.has("disabled")||e.has("radius")||e.has("size")||e.has("name")||e.has("source")||e.has("checkboxProps"))&&this._scheduleSync()}_scheduleSync(){this._syncFrame&&cancelAnimationFrame(this._syncFrame),this._syncFrame=requestAnimationFrame(()=>{this._syncFrame=0,this._syncSlottedCheckboxes(),this._syncRenderedCheckboxes()})}_getSlottedCheckboxes(){return this._slotEl?this._slotEl.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()==="lui-checkbox"):[]}_mergedCheckboxProps(){return{...F(this,"checkboxGroup").checkboxProps??{},...this.checkboxProps??{}}}_syncRenderedCheckboxes(){if(!this.source.length)return;let e=this._mergedCheckboxProps();for(let t of this._renderedCheckboxes??[])oe(t,e)}_syncSlottedCheckboxes(){if(this.source.length>0)return;let e=this._getSlottedCheckboxes();for(let t of e){let r=t.value??"";t.checked=this._isChecked(r),this.disabled?(t.disabled||t.setAttribute("data-lui-checkbox-group-disabled",""),t.disabled=!0):t.hasAttribute("data-lui-checkbox-group-disabled")&&(t.removeAttribute("data-lui-checkbox-group-disabled"),t.disabled=!1),t.radius=this._effectiveRadius(),t.size=this.size,this.name&&(t.name=this.name)}}_effectiveRadius(e){return e||this.radius}_renderOption(e){let t={...this._mergedCheckboxProps(),checked:this._isChecked(e.value),indeterminate:!!(e.indeterminate&&!this._isChecked(e.value)),value:e.value,label:e.label,description:e.description??"",name:this.name??"",radius:this._effectiveRadius(e.radius),size:e.size??this.size,checkedIcon:e.checkedIcon??this.checkboxProps.checkedIcon??"check",indeterminateIcon:e.indeterminateIcon??this.checkboxProps.indeterminateIcon??"minus",disabled:this.disabled||(e.disabled??!1)};return Na`
9772
+ `],a([en({type:Boolean,reflect:!0})],Vr.prototype,"checked",2),a([en({type:Boolean,reflect:!0})],Vr.prototype,"disabled",2),a([en({reflect:!0})],Vr.prototype,"size",2),a([en()],Vr.prototype,"name",2),a([en()],Vr.prototype,"label",2),a([en()],Vr.prototype,"locale",2),a([en({attribute:!1})],Vr.prototype,"translations",2),a([Ry("input")],Vr.prototype,"_input",2),Vr=a([Hy("lui-switch")],Vr);import{css as Iy,html as Na,LitElement as Vy,nothing as Rd}from"lit";import{customElement as Dy,property as oi,query as Fy,queryAll as Ny}from"lit/decorators.js";var Ut=class extends Vy{constructor(){super(...arguments);this.source=[];this.value=[];this.direction="horizontal";this.radius="md";this.size="md";this.disabled=!1;this.checkboxProps={};this._explicitAttrs=new Set;this._syncFrame=0;this._onSlottedChange=e=>{if(this.source.length>0)return;let t=e.target;!t||t.tagName.toLowerCase()!=="lui-checkbox"||this._toggle(t.value??"")}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._lightDomObserver=new MutationObserver(()=>this._scheduleSync()),this._lightDomObserver.observe(this,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["value","disabled","checked","indeterminate","label","description","slot"]})}disconnectedCallback(){super.disconnectedCallback(),this._lightDomObserver?.disconnect(),this._syncFrame&&cancelAnimationFrame(this._syncFrame)}_isChecked(e){return this.value?.includes(e)??!1}_toggle(e){let t=this.value??[],r=t.includes(e)?t.filter(n=>n!==e):[...t,e];this.value=r,this.dispatchEvent(new CustomEvent("change",{detail:{value:r},bubbles:!0,composed:!0}))}firstUpdated(){this._scheduleSync()}willUpdate(){let e=F(this,"checkboxGroup");!this._explicitAttrs.has("direction")&&typeof e.direction=="string"&&this.direction!==e.direction&&(this.direction=e.direction),!this._explicitAttrs.has("radius")&&typeof e.radius=="string"&&this.radius!==e.radius&&(this.radius=e.radius),!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("disabled")&&typeof e.disabled=="boolean"&&this.disabled!==e.disabled&&(this.disabled=e.disabled)}updated(e){(e.has("value")||e.has("disabled")||e.has("radius")||e.has("size")||e.has("name")||e.has("source")||e.has("checkboxProps"))&&this._scheduleSync()}_scheduleSync(){this._syncFrame&&cancelAnimationFrame(this._syncFrame),this._syncFrame=requestAnimationFrame(()=>{this._syncFrame=0,this._syncSlottedCheckboxes(),this._syncRenderedCheckboxes()})}_getSlottedCheckboxes(){return this._slotEl?this._slotEl.assignedElements({flatten:!0}).filter(e=>e.tagName.toLowerCase()==="lui-checkbox"):[]}_mergedCheckboxProps(){return{...F(this,"checkboxGroup").checkboxProps??{},...this.checkboxProps??{}}}_syncRenderedCheckboxes(){if(!this.source.length)return;let e=this._mergedCheckboxProps();for(let t of this._renderedCheckboxes??[])oe(t,e)}_syncSlottedCheckboxes(){if(this.source.length>0)return;let e=this._getSlottedCheckboxes();for(let t of e){let r=t.value??"";t.checked=this._isChecked(r),this.disabled?(t.disabled||t.setAttribute("data-lui-checkbox-group-disabled",""),t.disabled=!0):t.hasAttribute("data-lui-checkbox-group-disabled")&&(t.removeAttribute("data-lui-checkbox-group-disabled"),t.disabled=!1),t.radius=this._effectiveRadius(),t.size=this.size,this.name&&(t.name=this.name)}}_effectiveRadius(e){return e||this.radius}_renderOption(e){let t={...this._mergedCheckboxProps(),checked:this._isChecked(e.value),indeterminate:!!(e.indeterminate&&!this._isChecked(e.value)),value:e.value,label:e.label,description:e.description??"",name:this.name??"",radius:this._effectiveRadius(e.radius),size:e.size??this.size,checkedIcon:e.checkedIcon??this.checkboxProps.checkedIcon??"check",indeterminateIcon:e.indeterminateIcon??this.checkboxProps.indeterminateIcon??"minus",disabled:this.disabled||(e.disabled??!1)};return Na`
9773
9773
  <lui-checkbox
9774
9774
  .checked=${t.checked}
9775
9775
  .indeterminate=${t.indeterminate}
@@ -10289,7 +10289,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
10289
10289
  }
10290
10290
  :host([size="sm"]) .value { font-size: var(--lui-font-size-xs); }
10291
10291
  :host([size="lg"]) .value { font-size: var(--lui-font-size); }
10292
- `],a([nr({attribute:!1})],Xe.prototype,"value",2),a([nr({type:Number})],Xe.prototype,"min",2),a([nr({type:Number})],Xe.prototype,"max",2),a([nr({type:Number})],Xe.prototype,"step",2),a([nr({type:Boolean,reflect:!0})],Xe.prototype,"disabled",2),a([nr({reflect:!0})],Xe.prototype,"size",2),a([nr()],Xe.prototype,"name",2),a([nr({type:Boolean})],Xe.prototype,"showValue",2),a([nr()],Xe.prototype,"track",2),a([nr({attribute:!1})],Xe.prototype,"marks",2),a([nr({type:Boolean,attribute:"snap-to-marks"})],Xe.prototype,"snapToMarks",2),a([nr({type:Boolean,reflect:!0})],Xe.prototype,"range",2),a([nr({attribute:!1})],Xe.prototype,"rangeValue",2),a([nr({attribute:"value-label-display"})],Xe.prototype,"valueLabelDisplay",2),a([nr()],Xe.prototype,"valuePrefix",2),a([nr()],Xe.prototype,"valueSuffix",2),a([Vd()],Xe.prototype,"_hovered",2),a([Vd()],Xe.prototype,"_focusedThumb",2),a([Vd()],Xe.prototype,"_draggingThumb",2),Xe=a([Gy("lui-slider")],Xe);import{css as Yy,html as gl,LitElement as Xy,nothing as Zy}from"lit";import{customElement as Qy,property as tn}from"lit/decorators.js";var Wr=class extends Xy{constructor(){super(...arguments);this.disabled=!1;this.size="md";this.multiple=!1;this.files=[];this.placeholder="\u70B9\u51FB\u6216\u62D6\u62FD\u4E0A\u4F20"}render(){let e=this.files.length>0,t=["dropzone"];return this.disabled&&t.push("disabled"),e&&t.push("has-files"),gl`
10292
+ `],a([nr({attribute:!1})],Xe.prototype,"value",2),a([nr({type:Number})],Xe.prototype,"min",2),a([nr({type:Number})],Xe.prototype,"max",2),a([nr({type:Number})],Xe.prototype,"step",2),a([nr({type:Boolean,reflect:!0})],Xe.prototype,"disabled",2),a([nr({reflect:!0})],Xe.prototype,"size",2),a([nr()],Xe.prototype,"name",2),a([nr({type:Boolean})],Xe.prototype,"showValue",2),a([nr()],Xe.prototype,"track",2),a([nr({attribute:!1})],Xe.prototype,"marks",2),a([nr({type:Boolean,attribute:"snap-to-marks"})],Xe.prototype,"snapToMarks",2),a([nr({type:Boolean,reflect:!0})],Xe.prototype,"range",2),a([nr({attribute:!1})],Xe.prototype,"rangeValue",2),a([nr({attribute:"value-label-display"})],Xe.prototype,"valueLabelDisplay",2),a([nr()],Xe.prototype,"valuePrefix",2),a([nr()],Xe.prototype,"valueSuffix",2),a([Vd()],Xe.prototype,"_hovered",2),a([Vd()],Xe.prototype,"_focusedThumb",2),a([Vd()],Xe.prototype,"_draggingThumb",2),Xe=a([Gy("lui-slider")],Xe);import{css as Yy,html as gl,LitElement as Xy,nothing as Zy}from"lit";import{customElement as Qy,property as tn}from"lit/decorators.js";var Ur=class extends Xy{constructor(){super(...arguments);this.disabled=!1;this.size="md";this.multiple=!1;this.files=[];this.placeholder="\u70B9\u51FB\u6216\u62D6\u62FD\u4E0A\u4F20"}render(){let e=this.files.length>0,t=["dropzone"];return this.disabled&&t.push("disabled"),e&&t.push("has-files"),gl`
10293
10293
  <div
10294
10294
  class=${t.join(" ")}
10295
10295
  @click=${()=>!this.disabled&&this._inputEl?.click()}
@@ -10318,7 +10318,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
10318
10318
  ?disabled=${this.disabled}
10319
10319
  @change=${this._onFileChange}
10320
10320
  />
10321
- `}get _inputEl(){return this.renderRoot?.querySelector('input[type="file"]')}_onFileChange(e){e.stopPropagation();let t=e.target;this.files=Array.from(t.files??[]),this.dispatchEvent(new CustomEvent("change",{detail:{files:this.files},bubbles:!0,composed:!0}))}_onDrop(e){e.preventDefault(),!this.disabled&&(this.files=Array.from(e.dataTransfer?.files??[]),this.dispatchEvent(new CustomEvent("change",{detail:{files:this.files},bubbles:!0,composed:!0})))}_formatSize(e){return e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":(e/(1024*1024)).toFixed(1)+" MB"}};Wr.styles=[A,O,Yy`
10321
+ `}get _inputEl(){return this.renderRoot?.querySelector('input[type="file"]')}_onFileChange(e){e.stopPropagation();let t=e.target;this.files=Array.from(t.files??[]),this.dispatchEvent(new CustomEvent("change",{detail:{files:this.files},bubbles:!0,composed:!0}))}_onDrop(e){e.preventDefault(),!this.disabled&&(this.files=Array.from(e.dataTransfer?.files??[]),this.dispatchEvent(new CustomEvent("change",{detail:{files:this.files},bubbles:!0,composed:!0})))}_formatSize(e){return e<1024?e+" B":e<1024*1024?(e/1024).toFixed(1)+" KB":(e/(1024*1024)).toFixed(1)+" MB"}};Ur.styles=[A,O,Yy`
10322
10322
  :host {
10323
10323
  display: block;
10324
10324
  width: 100%;
@@ -10406,7 +10406,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
10406
10406
  input[type="file"] {
10407
10407
  display: none;
10408
10408
  }
10409
- `],a([tn({type:Boolean,reflect:!0})],Wr.prototype,"disabled",2),a([tn({reflect:!0})],Wr.prototype,"size",2),a([tn()],Wr.prototype,"accept",2),a([tn({type:Boolean})],Wr.prototype,"multiple",2),a([tn()],Wr.prototype,"name",2),a([tn({attribute:!1})],Wr.prototype,"files",2),a([tn()],Wr.prototype,"placeholder",2),Wr=a([Qy("lui-file-input")],Wr);import{css as Jy,html as La,LitElement as ek}from"lit";import{customElement as tk,property as ni,queryAll as rk}from"lit/decorators.js";var ar=class extends ek{constructor(){super(...arguments);this.value="";this.length=6;this.size="md";this.disabled=!1;this.readonly=!1;this.invalid=!1;this.type="number";this.format=""}focus(){this._cells?.[0]?.focus()}blur(){this._cells?.forEach(e=>e.blur())}_charCount(){return this.format?(this.format.match(/#/g)||[]).length:this.length}_chars(){let e=this._charCount(),t=this.value||"",r=[];for(let n=0;n<e;n++)r.push(n<t.length?t[n]:"");return r}_emit(){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}));let e=this._charCount();this.value.length===e&&this.dispatchEvent(new CustomEvent("complete",{detail:{value:this.value},bubbles:!0,composed:!0}))}_onInput(e,t){e.stopPropagation();let r=e.target,n=r.value;if(this.type==="number"&&n&&!/^\d$/.test(n)){r.value="";return}let s=this._chars();if(n.length>1){let d=n[n.length-1];s[t]=d,r.value=d}else s[t]=n;this.value=s.join(""),n&&t<this._charCount()-1&&this._cells[t+1]?.focus(),this._emit()}_onKeyDown(e,t){if(this.readonly)return;let r=e.target,n=this._charCount();if(e.key==="Backspace"&&!r.value&&t>0){let s=this._cells[t-1];s.focus(),s.value="";let d=this._chars();d[t-1]="",this.value=d.join(""),this._emit()}else if(e.key==="ArrowLeft"&&t>0)this._cells[t-1]?.focus();else if(e.key==="ArrowRight"&&t<n-1)this._cells[t+1]?.focus();else if(e.key==="Delete"){let s=this._chars();s[t]="",this.value=s.join(""),this._emit()}}_onFocus(e){if(this.readonly)return;e.target.select()}_onPaste(e,t){if(e.preventDefault(),this.disabled||this.readonly)return;let r=e.clipboardData?.getData("text")?.trim()??"";if(!r)return;let n=this.type==="number"?r.replace(/\D/g,""):r;if(!n)return;let s=this._chars(),d=this._charCount();for(let p=0;p<n.length&&t+p<d;p++)s[t+p]=n[p];this.value=s.join("");let h=Math.min(t+n.length,d-1);this._cells[h]?.focus(),this._emit()}render(){let e=this._chars();if(this.format){let t=0,r=[];for(let n=0;n<this.format.length;n++)if(this.format[n]==="#"){let s=t,d=e[s];r.push(La`
10409
+ `],a([tn({type:Boolean,reflect:!0})],Ur.prototype,"disabled",2),a([tn({reflect:!0})],Ur.prototype,"size",2),a([tn()],Ur.prototype,"accept",2),a([tn({type:Boolean})],Ur.prototype,"multiple",2),a([tn()],Ur.prototype,"name",2),a([tn({attribute:!1})],Ur.prototype,"files",2),a([tn()],Ur.prototype,"placeholder",2),Ur=a([Qy("lui-file-input")],Ur);import{css as Jy,html as La,LitElement as ek}from"lit";import{customElement as tk,property as ni,queryAll as rk}from"lit/decorators.js";var ar=class extends ek{constructor(){super(...arguments);this.value="";this.length=6;this.size="md";this.disabled=!1;this.readonly=!1;this.invalid=!1;this.type="number";this.format=""}focus(){this._cells?.[0]?.focus()}blur(){this._cells?.forEach(e=>e.blur())}_charCount(){return this.format?(this.format.match(/#/g)||[]).length:this.length}_chars(){let e=this._charCount(),t=this.value||"",r=[];for(let n=0;n<e;n++)r.push(n<t.length?t[n]:"");return r}_emit(){this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value},bubbles:!0,composed:!0}));let e=this._charCount();this.value.length===e&&this.dispatchEvent(new CustomEvent("complete",{detail:{value:this.value},bubbles:!0,composed:!0}))}_onInput(e,t){e.stopPropagation();let r=e.target,n=r.value;if(this.type==="number"&&n&&!/^\d$/.test(n)){r.value="";return}let s=this._chars();if(n.length>1){let d=n[n.length-1];s[t]=d,r.value=d}else s[t]=n;this.value=s.join(""),n&&t<this._charCount()-1&&this._cells[t+1]?.focus(),this._emit()}_onKeyDown(e,t){if(this.readonly)return;let r=e.target,n=this._charCount();if(e.key==="Backspace"&&!r.value&&t>0){let s=this._cells[t-1];s.focus(),s.value="";let d=this._chars();d[t-1]="",this.value=d.join(""),this._emit()}else if(e.key==="ArrowLeft"&&t>0)this._cells[t-1]?.focus();else if(e.key==="ArrowRight"&&t<n-1)this._cells[t+1]?.focus();else if(e.key==="Delete"){let s=this._chars();s[t]="",this.value=s.join(""),this._emit()}}_onFocus(e){if(this.readonly)return;e.target.select()}_onPaste(e,t){if(e.preventDefault(),this.disabled||this.readonly)return;let r=e.clipboardData?.getData("text")?.trim()??"";if(!r)return;let n=this.type==="number"?r.replace(/\D/g,""):r;if(!n)return;let s=this._chars(),d=this._charCount();for(let p=0;p<n.length&&t+p<d;p++)s[t+p]=n[p];this.value=s.join("");let h=Math.min(t+n.length,d-1);this._cells[h]?.focus(),this._emit()}render(){let e=this._chars();if(this.format){let t=0,r=[];for(let n=0;n<this.format.length;n++)if(this.format[n]==="#"){let s=t,d=e[s];r.push(La`
10410
10410
  <input
10411
10411
  class=${`otp-cell${d?" filled":""}${this.invalid?" invalid":""}`}
10412
10412
  .value=${d}
@@ -11464,7 +11464,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
11464
11464
  :host([readonly]) .panel {
11465
11465
  pointer-events: none;
11466
11466
  }
11467
- `],a([Yt()],qe.prototype,"value",2),a([Yt()],qe.prototype,"placeholder",2),a([Yt({reflect:!0})],qe.prototype,"size",2),a([Yt({reflect:!0})],qe.prototype,"format",2),a([Yt({type:Boolean,reflect:!0})],qe.prototype,"open",2),a([Yt({type:Boolean,reflect:!0})],qe.prototype,"disabled",2),a([Yt({type:Boolean,reflect:!0})],qe.prototype,"readonly",2),a([Yt({type:Boolean,reflect:!0})],qe.prototype,"invalid",2),a([Yt({type:Boolean})],qe.prototype,"clearable",2),a([Yt({reflect:!0})],qe.prototype,"backdrop",2),a([Yt({attribute:"backdrop-style"})],qe.prototype,"backdropStyle",2),a([Yt({type:Boolean,attribute:"close-on-outside-press"})],qe.prototype,"closeOnOutsidePress",2),a([Yt({attribute:"show-alpha",type:Boolean})],qe.prototype,"showAlpha",2),a([Yt()],qe.prototype,"placement",2),a([Yt()],qe.prototype,"name",2),a([Yt({attribute:"preset-colors"})],qe.prototype,"presetColors",2),a([Yt({attribute:!1})],qe.prototype,"swatches",2),a([Y1("lui-dropdown")],qe.prototype,"_dropdown",2),a([Y1(".sv")],qe.prototype,"_svEl",2),a([gk()],qe.prototype,"_hsv",2),qe=a([mk("lui-color-picker")],qe);import{css as kk,html as So,LitElement as xk,nothing as Kn}from"lit";import{customElement as wk,property as Ur}from"lit/decorators.js";var jt=class extends xk{constructor(){super(...arguments);this.label="";this.required=!1;this.description="";this.help="";this.extra="";this.tooltip="";this.errors=[];this.invalid=!1;this.hiddenLabel=!1;this.inline=!1;this.size="md";this.labelPlacement="top";this.labelWidth="120px";this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(){let e=F(this,"formItem");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("label-placement")&&typeof e.labelPlacement=="string"&&this.labelPlacement!==e.labelPlacement&&(this.labelPlacement=e.labelPlacement),!this._explicitAttrs.has("label-width")&&(typeof e.labelWidth=="string"||typeof e.labelWidth=="number")&&this.labelWidth!==e.labelWidth&&(this.labelWidth=e.labelWidth)}_onLabelClick(){this.dispatchEvent(new CustomEvent("label-click",{bubbles:!0,composed:!0}))}_normalizedPlacement(){return this.labelPlacement==="left"||this.labelPlacement==="horizontal"?"left":"top"}_renderLabel(){let t=!this.hiddenLabel&&this.label?So`
11467
+ `],a([Yt()],qe.prototype,"value",2),a([Yt()],qe.prototype,"placeholder",2),a([Yt({reflect:!0})],qe.prototype,"size",2),a([Yt({reflect:!0})],qe.prototype,"format",2),a([Yt({type:Boolean,reflect:!0})],qe.prototype,"open",2),a([Yt({type:Boolean,reflect:!0})],qe.prototype,"disabled",2),a([Yt({type:Boolean,reflect:!0})],qe.prototype,"readonly",2),a([Yt({type:Boolean,reflect:!0})],qe.prototype,"invalid",2),a([Yt({type:Boolean})],qe.prototype,"clearable",2),a([Yt({reflect:!0})],qe.prototype,"backdrop",2),a([Yt({attribute:"backdrop-style"})],qe.prototype,"backdropStyle",2),a([Yt({type:Boolean,attribute:"close-on-outside-press"})],qe.prototype,"closeOnOutsidePress",2),a([Yt({attribute:"show-alpha",type:Boolean})],qe.prototype,"showAlpha",2),a([Yt()],qe.prototype,"placement",2),a([Yt()],qe.prototype,"name",2),a([Yt({attribute:"preset-colors"})],qe.prototype,"presetColors",2),a([Yt({attribute:!1})],qe.prototype,"swatches",2),a([Y1("lui-dropdown")],qe.prototype,"_dropdown",2),a([Y1(".sv")],qe.prototype,"_svEl",2),a([gk()],qe.prototype,"_hsv",2),qe=a([mk("lui-color-picker")],qe);import{css as kk,html as So,LitElement as xk,nothing as Kn}from"lit";import{customElement as wk,property as Gr}from"lit/decorators.js";var jt=class extends xk{constructor(){super(...arguments);this.label="";this.required=!1;this.description="";this.help="";this.extra="";this.tooltip="";this.errors=[];this.invalid=!1;this.hiddenLabel=!1;this.inline=!1;this.size="md";this.labelPlacement="top";this.labelWidth="120px";this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames())}willUpdate(){let e=F(this,"formItem");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("label-placement")&&typeof e.labelPlacement=="string"&&this.labelPlacement!==e.labelPlacement&&(this.labelPlacement=e.labelPlacement),!this._explicitAttrs.has("label-width")&&(typeof e.labelWidth=="string"||typeof e.labelWidth=="number")&&this.labelWidth!==e.labelWidth&&(this.labelWidth=e.labelWidth)}_onLabelClick(){this.dispatchEvent(new CustomEvent("label-click",{bubbles:!0,composed:!0}))}_normalizedPlacement(){return this.labelPlacement==="left"||this.labelPlacement==="horizontal"?"left":"top"}_renderLabel(){let t=!this.hiddenLabel&&this.label?So`
11468
11468
  <span class=${`label-row ${this.inline?"clickable":""}`} @click=${this._onLabelClick}>
11469
11469
  <slot name="label">${this.label}</slot>
11470
11470
  ${this.required?So`<span class="required">*</span>`:Kn}
@@ -11585,7 +11585,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
11585
11585
  --lui-form-item-control-height: var(--lui-control-height-lg, 44px);
11586
11586
  --lui-form-item-gap: 6px;
11587
11587
  }
11588
- `],a([Ur()],jt.prototype,"label",2),a([Ur({type:Boolean})],jt.prototype,"required",2),a([Ur()],jt.prototype,"description",2),a([Ur()],jt.prototype,"help",2),a([Ur()],jt.prototype,"extra",2),a([Ur()],jt.prototype,"tooltip",2),a([Ur({attribute:!1})],jt.prototype,"errors",2),a([Ur({type:Boolean,reflect:!0})],jt.prototype,"invalid",2),a([Ur({type:Boolean,attribute:"hidden-label"})],jt.prototype,"hiddenLabel",2),a([Ur({type:Boolean,reflect:!0})],jt.prototype,"inline",2),a([Ur({reflect:!0})],jt.prototype,"size",2),a([Ur({reflect:!0,attribute:"label-placement"})],jt.prototype,"labelPlacement",2),a([Ur({attribute:"label-width"})],jt.prototype,"labelWidth",2),jt=a([wk("lui-form-item")],jt);function Fd(i,o){if(!i||!o)return;let e=i;for(let[t,r]of Object.entries(o))r!=null&&(t==="style"&&typeof r=="string"?i.setAttribute("style",r):typeof r=="boolean"?r?i.setAttribute(t,""):i.removeAttribute(t):e[t]=r)}var Ua=new Map;function Ak(i,o){return Ua.set(i,o),()=>{Ua.get(i)===o&&Ua.delete(i)}}function Pk(i){Ua.delete(i)}function Nd(i){let o={};for(let e of i)e.type==="group"&&e.fields?Object.assign(o,Nd(e.fields)):e.type==="array"?o[e.name]=e.defaultValue!==void 0?e.defaultValue:[]:o[e.name]=e.defaultValue!==void 0?e.defaultValue:e.type==="switch"||e.type==="checkbox"?!1:e.type==="checkbox-group"?[]:e.type==="number"||e.type==="slider"?0:(e.type==="date"||e.type==="time"||e.type==="datetime","");return o}function kl(i,o){return o.split(/[.[\]]/).filter(Boolean).reduce((e,t)=>e?.[t],i)}function jk(i,o){if(!i)return{visible:!0,disabled:!1,required:!1};let e=Array.isArray(i.when)?i.when:[i.when],t=!1;for(let n of e){let s=kl(o,n);if(i.is!==void 0?t=s===i.is:i.isNot!==void 0?t=s!==i.isNot:i.contains!==void 0?t=Array.isArray(s)&&s.includes(i.contains):i.pattern!==void 0?t=new RegExp(i.pattern).test(String(s??"")):t=!!s,t)break}let r=t?i.then??{visible:!0}:i.else??{visible:!1};return{visible:r.visible??!0,disabled:r.disabled??!1,required:r.required??!1}}function Ok(i){let e={...i.validators??{}};i.validator&&(e.onSubmit=e.onSubmit??i.validator);let t=r=>{if(r!=null)return $k(r)?n=>Tk.validate({value:n.value,validationSource:"field"},r)??void 0:r};return e.onChange=t(e.onChange),e.onSubmit=t(e.onSubmit),Object.keys(e).length?e:void 0}function on(i,o={}){if(i==null)return[];if(typeof i=="string")return i?[i]:[];if(typeof i=="number"||typeof i=="boolean")return[String(i)];if(i instanceof Error)return i.message?[i.message]:[String(i)];if(Array.isArray(i))return Array.from(new Set(i.flatMap(e=>on(e,o))));if(typeof i=="object"){let e=i,t=[];return typeof e.message=="string"&&e.message&&t.push(e.message),"form"in e&&t.push(...on(e.form,o)),o.includeFieldErrors&&"fields"in e&&t.push(...on(e.fields,o)),Array.from(new Set(t))}return[]}function Wn(i){return i==null||i===!1?!1:typeof i=="string"?i.length>0:typeof i=="number"||typeof i=="boolean"||i instanceof Error?!0:Array.isArray(i)?i.some(Wn):typeof i=="object"?Object.values(i).some(Wn):!1}function Hk(i,o){let e=i.successMessage;return typeof e=="function"?e(o):e??"\u63D0\u4EA4\u6210\u529F"}var ue,kt=class extends Mk{constructor(){super(...arguments);this.schema=null;this.showActions=!0;this.size="md";this.labelPlacement="top";this.labelWidth="120px";this._currentStep=0;this._isStepPending=!1;this._submitErrorMessages=[];this._submitSuccessMessage="";hh(this,ue);this._explicitAttrs=new Set;this._collapsedArrayItems=new Set;this._initializedSchema=null}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._ensureControllerInitialized()}submit(){this._ensureControllerInitialized(),this._submitForm()}_dispatchValidate(e){ve(this,ue)&&this.dispatchEvent(new CustomEvent("validate",{detail:{valid:e,errors:ve(this,ue).api.getAllErrors(),values:this.getValues()},bubbles:!0,composed:!0}))}getValues(){return this._ensureControllerInitialized(),{...ve(this,ue)?.api.state.values??{}}}setValues(e,t={}){if(this._ensureControllerInitialized(),!!ve(this,ue)){for(let[r,n]of Object.entries(e))ve(this,ue).api.setFieldValue(r,n,{dontUpdateMeta:!t.touch});this._emitFormChange("setValues",void 0,void 0,this.getValues())}}getValue(e){return kl(this.getValues(),e)}setValue(e,t,r={}){this._ensureControllerInitialized(),ve(this,ue)&&(ve(this,ue).api.setFieldValue(e,t,{dontUpdateMeta:!r.touch}),this._emitFormChange("setValue",e,t,this.getValues()))}async validate(){if(this._ensureControllerInitialized(),!ve(this,ue)||!this.schema)return!0;this._clearSubmissionFeedback();let e=this.schema.steps?this.schema.steps.flatMap(d=>d.fields):this.schema.fields??[],t=Array.from(new Set(this._collectVisibleFieldNames(e)));this._markFieldsTouched(t);let r=await Promise.all(t.map(d=>ve(this,ue).api.validateField(d,"submit"))),n=await ve(this,ue).api.validate("submit"),s=!r.some(Wn)&&!this._hasFieldErrors(t)&&!Wn(n)&&this._getFormErrorMessages(ve(this,ue)).length===0;return this._dispatchValidate(s),this.requestUpdate(),s}clearValidate(e){if(this._ensureControllerInitialized(),!ve(this,ue)||!this.schema)return;this._clearSubmissionFeedback();let t=this.schema.steps?this.schema.steps.flatMap(n=>n.fields):this.schema.fields??[],r=e?.length?e:Array.from(new Set(this._collectVisibleFieldNames(t)));for(let n of r)ve(this,ue).api.setFieldMeta(n,s=>({...s,isValidating:!1,isTouched:!1,isBlurred:!1,isValid:!0,errors:[],errorMap:{},errorSourceMap:{}}));this.requestUpdate()}_clearSubmissionFeedback(){(this._submitErrorMessages.length||this._submitSuccessMessage)&&(this._submitErrorMessages=[],this._submitSuccessMessage="")}async _submitForm(){if(!ve(this,ue)||!this.schema)return;if(this._clearSubmissionFeedback(),!await this.validate()){this._scrollToFirstError(),this.requestUpdate();return}await ve(this,ue).api.handleSubmit(),this.requestUpdate()}reset(e){this._ensureControllerInitialized(),this._clearSubmissionFeedback(),ve(this,ue)?.api.reset(e),this._collapsedArrayItems.clear(),this._emitFormChange("reset",void 0,void 0,ve(this,ue)?.api.state.values??{})}_emitFormChange(e,t,r,n=this.getValues()){this.dispatchEvent(new CustomEvent("change",{detail:{reason:e,name:t,value:r,values:n},bubbles:!0,composed:!0}))}_emitFieldChange(e,t,r){let n=this.getValues();this._emitFormChange("field",e.name,t,n)}focusField(e){let r=this._fieldElement(e)?.querySelector("lui-input,lui-textarea,lui-select,lui-input-number,lui-datepicker,lui-color-picker,lui-input-opt,lui-checkbox,lui-switch,lui-radio,button,input,textarea,select");return r?.focus?.(),!!r}scrollToField(e,t={block:"center",behavior:"smooth"}){let r=this._fieldElement(e);return r?.scrollIntoView(t),!!r}_fieldElement(e){return this.renderRoot.querySelector(`[data-field-name="${CSS.escape(e)}"]`)}_findFieldDef(e){let t=e.replace(/\[\d+\]/g,""),r=this.schema?.steps?this.schema.steps.flatMap(s=>s.fields):this.schema?.fields??[],n=s=>{for(let d of s){if(d.name===e||d.name===t||t.endsWith(`.${d.name}`))return d;if(d.fields){let h=n(d.fields);if(h)return h}}};return n(r)}_firstErrorFieldName(){if(!ve(this,ue)||!this.schema)return;let e=this.schema.steps?this.schema.steps.flatMap(r=>r.fields):this.schema.fields??[];return Array.from(new Set(this._collectVisibleFieldNames(e))).find(r=>(ve(this,ue).api.getFieldMeta(r)?.errors?.length??0)>0)}_scrollToFirstError(){let e=this._firstErrorFieldName();e&&requestAnimationFrame(()=>{this.scrollToField(e),this.focusField(e)})}_effectiveSize(e){return e?.size??this.schema?.size??this.size}_effectiveLabelPlacement(e){return e?.labelPlacement??this.schema?.labelPlacement??this.labelPlacement}_normalizedLabelPlacement(e){let t=this._effectiveLabelPlacement(e);return t==="left"||t==="horizontal"?"left":"top"}_effectiveLabelWidth(e){return mt(e?.labelWidth??this.schema?.labelWidth??this.labelWidth)||"120px"}_effectiveValidateTrigger(e){return e?.validateTrigger??this.schema?.validateTrigger??"change"}_fieldClass(e){return`field ${this._normalizedLabelPlacement(e)}`}_fieldStyle(e){return`--lui-form-label-width:${this._effectiveLabelWidth(e)}`}willUpdate(){this._ensureControllerInitialized();let e=F(this,"form");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("label-placement")&&typeof e.labelPlacement=="string"&&this.labelPlacement!==e.labelPlacement&&(this.labelPlacement=e.labelPlacement),!this._explicitAttrs.has("label-width")&&(typeof e.labelWidth=="string"||typeof e.labelWidth=="number")&&this.labelWidth!==e.labelWidth&&(this.labelWidth=e.labelWidth),!this._explicitAttrs.has("show-actions")&&typeof e.showActions=="boolean"&&this.showActions!==e.showActions&&(this.showActions=e.showActions)}updated(e){super.updated(e),e.has("schema")&&this.schema&&(this._currentStep=0,this._clearSubmissionFeedback(),this._initializedSchema!==this.schema&&(this._initForm(),this.requestUpdate()))}_initForm(){if(!this.schema)return;let e=this.schema.steps?this.schema.steps.flatMap(n=>n.fields):this.schema.fields??[],t={...Nd(e),...this.schema.defaultValues},r={...this.schema.validators??{}};this.schema.validator&&(r.onSubmit=r.onSubmit??this.schema.validator),ph(this,ue,new Sk(this,{defaultValues:t,validators:r,validationLogic:this.schema.validationLogic,onSubmit:async({value:n})=>{this._clearSubmissionFeedback(),this.dispatchEvent(new CustomEvent("submit",{detail:{value:n},bubbles:!0,composed:!0}));try{typeof this.schema.onSubmit=="function"&&await this.schema.onSubmit(n),this._submitSuccessMessage=Hk(this.schema,n)}catch(s){let d=on(s);throw this._submitErrorMessages=d.length?d:["\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"],this._submitSuccessMessage="",s}},onSubmitInvalid:()=>{this._submitSuccessMessage="",this._dispatchValidate(!1),this._scrollToFirstError()}})),this._initializedSchema=this.schema}_ensureControllerInitialized(){ve(this,ue)&&this._initializedSchema===this.schema||this.schema&&this._initForm()}_isGroupInline(e){return e.length>1&&e.every(t=>t.type!=="textarea"&&t.type!=="array"&&t.type!=="slider"&&t.type!=="date"&&t.type!=="time"&&t.type!=="datetime"&&t.type!=="file")}_getFieldCondition(e){let t=ve(this,ue)?.api?.state?.values??{},r=jk(e.condition,t);return{visible:!e.hidden&&r.visible,disabled:(this.schema?.disabled??!1)||(e.disabled??!1)||r.disabled,readonly:(this.schema?.readonly??!1)||(e.readonly??!1),required:(e.required??!1)||r.required}}_isFieldRenderable(e){return e.type==="group"||e.type==="array"||e.type==="button"?!0:this._getFieldCondition(e).visible}_renderField(e,t,r=!1,n=!1){if(e.type==="group"&&e.fields)return this._renderGroup(e,t,r,n);if(e.type==="array")return this._renderArrayField(e,t,r,n);if(e.type==="button")return this._renderButtonField(e,r);let s=this._getFieldCondition(e);if(!s.visible)return je;let d={name:e.name},h={...e,required:s.required},p=Ok(h);return p&&(d.validators=p),t.field(d,f=>{let x=on(f.state.meta.errors||[],{includeFieldErrors:!0}),k=f.state.meta.isTouched||ve(this,ue).api.state.submissionAttempts>0,C=k&&x.length>0,S=fe=>{let Te=f.state.value;this._clearSubmissionFeedback(),f.handleChange(fe),this._effectiveValidateTrigger(h)==="change"&&f.validate?.("change"),this._emitFieldChange(h,fe,Te)},z={field:h,value:f.state.value,errors:x,disabled:s.disabled||r,readonly:s.readonly||n,required:!!h.required,touched:k,invalid:x.length>0,formValues:ve(this,ue).api.state.values,fieldApi:f,blur:()=>f.handleBlur(),clearFeedback:()=>this._clearSubmissionFeedback(),handleChange:S,submit:()=>void this._submitForm(),reset:()=>this.reset()},T=this._withProps(h,this._renderControl(h,f,s.disabled||r,s.readonly||n,z)),P=h.hiddenLabel?"":h.label??"",H=Z`
11588
+ `],a([Gr()],jt.prototype,"label",2),a([Gr({type:Boolean})],jt.prototype,"required",2),a([Gr()],jt.prototype,"description",2),a([Gr()],jt.prototype,"help",2),a([Gr()],jt.prototype,"extra",2),a([Gr()],jt.prototype,"tooltip",2),a([Gr({attribute:!1})],jt.prototype,"errors",2),a([Gr({type:Boolean,reflect:!0})],jt.prototype,"invalid",2),a([Gr({type:Boolean,attribute:"hidden-label"})],jt.prototype,"hiddenLabel",2),a([Gr({type:Boolean,reflect:!0})],jt.prototype,"inline",2),a([Gr({reflect:!0})],jt.prototype,"size",2),a([Gr({reflect:!0,attribute:"label-placement"})],jt.prototype,"labelPlacement",2),a([Gr({attribute:"label-width"})],jt.prototype,"labelWidth",2),jt=a([wk("lui-form-item")],jt);function Fd(i,o){if(!i||!o)return;let e=i;for(let[t,r]of Object.entries(o))r!=null&&(t==="style"&&typeof r=="string"?i.setAttribute("style",r):typeof r=="boolean"?r?i.setAttribute(t,""):i.removeAttribute(t):e[t]=r)}var Ua=new Map;function Ak(i,o){return Ua.set(i,o),()=>{Ua.get(i)===o&&Ua.delete(i)}}function Pk(i){Ua.delete(i)}function Nd(i){let o={};for(let e of i)e.type==="group"&&e.fields?Object.assign(o,Nd(e.fields)):e.type==="array"?o[e.name]=e.defaultValue!==void 0?e.defaultValue:[]:o[e.name]=e.defaultValue!==void 0?e.defaultValue:e.type==="switch"||e.type==="checkbox"?!1:e.type==="checkbox-group"?[]:e.type==="number"||e.type==="slider"?0:(e.type==="date"||e.type==="time"||e.type==="datetime","");return o}function kl(i,o){return o.split(/[.[\]]/).filter(Boolean).reduce((e,t)=>e?.[t],i)}function jk(i,o){if(!i)return{visible:!0,disabled:!1,required:!1};let e=Array.isArray(i.when)?i.when:[i.when],t=!1;for(let n of e){let s=kl(o,n);if(i.is!==void 0?t=s===i.is:i.isNot!==void 0?t=s!==i.isNot:i.contains!==void 0?t=Array.isArray(s)&&s.includes(i.contains):i.pattern!==void 0?t=new RegExp(i.pattern).test(String(s??"")):t=!!s,t)break}let r=t?i.then??{visible:!0}:i.else??{visible:!1};return{visible:r.visible??!0,disabled:r.disabled??!1,required:r.required??!1}}function Ok(i){let e={...i.validators??{}};i.validator&&(e.onSubmit=e.onSubmit??i.validator);let t=r=>{if(r!=null)return $k(r)?n=>Tk.validate({value:n.value,validationSource:"field"},r)??void 0:r};return e.onChange=t(e.onChange),e.onSubmit=t(e.onSubmit),Object.keys(e).length?e:void 0}function on(i,o={}){if(i==null)return[];if(typeof i=="string")return i?[i]:[];if(typeof i=="number"||typeof i=="boolean")return[String(i)];if(i instanceof Error)return i.message?[i.message]:[String(i)];if(Array.isArray(i))return Array.from(new Set(i.flatMap(e=>on(e,o))));if(typeof i=="object"){let e=i,t=[];return typeof e.message=="string"&&e.message&&t.push(e.message),"form"in e&&t.push(...on(e.form,o)),o.includeFieldErrors&&"fields"in e&&t.push(...on(e.fields,o)),Array.from(new Set(t))}return[]}function Wn(i){return i==null||i===!1?!1:typeof i=="string"?i.length>0:typeof i=="number"||typeof i=="boolean"||i instanceof Error?!0:Array.isArray(i)?i.some(Wn):typeof i=="object"?Object.values(i).some(Wn):!1}function Hk(i,o){let e=i.successMessage;return typeof e=="function"?e(o):e??"\u63D0\u4EA4\u6210\u529F"}var ue,kt=class extends Mk{constructor(){super(...arguments);this.schema=null;this.showActions=!0;this.size="md";this.labelPlacement="top";this.labelWidth="120px";this._currentStep=0;this._isStepPending=!1;this._submitErrorMessages=[];this._submitSuccessMessage="";hh(this,ue);this._explicitAttrs=new Set;this._collapsedArrayItems=new Set;this._initializedSchema=null}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._ensureControllerInitialized()}submit(){this._ensureControllerInitialized(),this._submitForm()}_dispatchValidate(e){ve(this,ue)&&this.dispatchEvent(new CustomEvent("validate",{detail:{valid:e,errors:ve(this,ue).api.getAllErrors(),values:this.getValues()},bubbles:!0,composed:!0}))}getValues(){return this._ensureControllerInitialized(),{...ve(this,ue)?.api.state.values??{}}}setValues(e,t={}){if(this._ensureControllerInitialized(),!!ve(this,ue)){for(let[r,n]of Object.entries(e))ve(this,ue).api.setFieldValue(r,n,{dontUpdateMeta:!t.touch});this._emitFormChange("setValues",void 0,void 0,this.getValues())}}getValue(e){return kl(this.getValues(),e)}setValue(e,t,r={}){this._ensureControllerInitialized(),ve(this,ue)&&(ve(this,ue).api.setFieldValue(e,t,{dontUpdateMeta:!r.touch}),this._emitFormChange("setValue",e,t,this.getValues()))}async validate(){if(this._ensureControllerInitialized(),!ve(this,ue)||!this.schema)return!0;this._clearSubmissionFeedback();let e=this.schema.steps?this.schema.steps.flatMap(d=>d.fields):this.schema.fields??[],t=Array.from(new Set(this._collectVisibleFieldNames(e)));this._markFieldsTouched(t);let r=await Promise.all(t.map(d=>ve(this,ue).api.validateField(d,"submit"))),n=await ve(this,ue).api.validate("submit"),s=!r.some(Wn)&&!this._hasFieldErrors(t)&&!Wn(n)&&this._getFormErrorMessages(ve(this,ue)).length===0;return this._dispatchValidate(s),this.requestUpdate(),s}clearValidate(e){if(this._ensureControllerInitialized(),!ve(this,ue)||!this.schema)return;this._clearSubmissionFeedback();let t=this.schema.steps?this.schema.steps.flatMap(n=>n.fields):this.schema.fields??[],r=e?.length?e:Array.from(new Set(this._collectVisibleFieldNames(t)));for(let n of r)ve(this,ue).api.setFieldMeta(n,s=>({...s,isValidating:!1,isTouched:!1,isBlurred:!1,isValid:!0,errors:[],errorMap:{},errorSourceMap:{}}));this.requestUpdate()}_clearSubmissionFeedback(){(this._submitErrorMessages.length||this._submitSuccessMessage)&&(this._submitErrorMessages=[],this._submitSuccessMessage="")}async _submitForm(){if(!ve(this,ue)||!this.schema)return;if(this._clearSubmissionFeedback(),!await this.validate()){this._scrollToFirstError(),this.requestUpdate();return}await ve(this,ue).api.handleSubmit(),this.requestUpdate()}reset(e){this._ensureControllerInitialized(),this._clearSubmissionFeedback(),ve(this,ue)?.api.reset(e),this._collapsedArrayItems.clear(),this._emitFormChange("reset",void 0,void 0,ve(this,ue)?.api.state.values??{})}_emitFormChange(e,t,r,n=this.getValues()){this.dispatchEvent(new CustomEvent("change",{detail:{reason:e,name:t,value:r,values:n},bubbles:!0,composed:!0}))}_emitFieldChange(e,t,r){let n=this.getValues();this._emitFormChange("field",e.name,t,n)}focusField(e){let r=this._fieldElement(e)?.querySelector("lui-input,lui-textarea,lui-select,lui-input-number,lui-datepicker,lui-color-picker,lui-input-opt,lui-checkbox,lui-switch,lui-radio,button,input,textarea,select");return r?.focus?.(),!!r}scrollToField(e,t={block:"center",behavior:"smooth"}){let r=this._fieldElement(e);return r?.scrollIntoView(t),!!r}_fieldElement(e){return this.renderRoot.querySelector(`[data-field-name="${CSS.escape(e)}"]`)}_findFieldDef(e){let t=e.replace(/\[\d+\]/g,""),r=this.schema?.steps?this.schema.steps.flatMap(s=>s.fields):this.schema?.fields??[],n=s=>{for(let d of s){if(d.name===e||d.name===t||t.endsWith(`.${d.name}`))return d;if(d.fields){let h=n(d.fields);if(h)return h}}};return n(r)}_firstErrorFieldName(){if(!ve(this,ue)||!this.schema)return;let e=this.schema.steps?this.schema.steps.flatMap(r=>r.fields):this.schema.fields??[];return Array.from(new Set(this._collectVisibleFieldNames(e))).find(r=>(ve(this,ue).api.getFieldMeta(r)?.errors?.length??0)>0)}_scrollToFirstError(){let e=this._firstErrorFieldName();e&&requestAnimationFrame(()=>{this.scrollToField(e),this.focusField(e)})}_effectiveSize(e){return e?.size??this.schema?.size??this.size}_effectiveLabelPlacement(e){return e?.labelPlacement??this.schema?.labelPlacement??this.labelPlacement}_normalizedLabelPlacement(e){let t=this._effectiveLabelPlacement(e);return t==="left"||t==="horizontal"?"left":"top"}_effectiveLabelWidth(e){return mt(e?.labelWidth??this.schema?.labelWidth??this.labelWidth)||"120px"}_effectiveValidateTrigger(e){return e?.validateTrigger??this.schema?.validateTrigger??"change"}_fieldClass(e){return`field ${this._normalizedLabelPlacement(e)}`}_fieldStyle(e){return`--lui-form-label-width:${this._effectiveLabelWidth(e)}`}willUpdate(){this._ensureControllerInitialized();let e=F(this,"form");!this._explicitAttrs.has("size")&&typeof e.size=="string"&&this.size!==e.size&&(this.size=e.size),!this._explicitAttrs.has("label-placement")&&typeof e.labelPlacement=="string"&&this.labelPlacement!==e.labelPlacement&&(this.labelPlacement=e.labelPlacement),!this._explicitAttrs.has("label-width")&&(typeof e.labelWidth=="string"||typeof e.labelWidth=="number")&&this.labelWidth!==e.labelWidth&&(this.labelWidth=e.labelWidth),!this._explicitAttrs.has("show-actions")&&typeof e.showActions=="boolean"&&this.showActions!==e.showActions&&(this.showActions=e.showActions)}updated(e){super.updated(e),e.has("schema")&&this.schema&&(this._currentStep=0,this._clearSubmissionFeedback(),this._initializedSchema!==this.schema&&(this._initForm(),this.requestUpdate()))}_initForm(){if(!this.schema)return;let e=this.schema.steps?this.schema.steps.flatMap(n=>n.fields):this.schema.fields??[],t={...Nd(e),...this.schema.defaultValues},r={...this.schema.validators??{}};this.schema.validator&&(r.onSubmit=r.onSubmit??this.schema.validator),ph(this,ue,new Sk(this,{defaultValues:t,validators:r,validationLogic:this.schema.validationLogic,onSubmit:async({value:n})=>{this._clearSubmissionFeedback(),this.dispatchEvent(new CustomEvent("submit",{detail:{value:n},bubbles:!0,composed:!0}));try{typeof this.schema.onSubmit=="function"&&await this.schema.onSubmit(n),this._submitSuccessMessage=Hk(this.schema,n)}catch(s){let d=on(s);throw this._submitErrorMessages=d.length?d:["\u63D0\u4EA4\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5"],this._submitSuccessMessage="",s}},onSubmitInvalid:()=>{this._submitSuccessMessage="",this._dispatchValidate(!1),this._scrollToFirstError()}})),this._initializedSchema=this.schema}_ensureControllerInitialized(){ve(this,ue)&&this._initializedSchema===this.schema||this.schema&&this._initForm()}_isGroupInline(e){return e.length>1&&e.every(t=>t.type!=="textarea"&&t.type!=="array"&&t.type!=="slider"&&t.type!=="date"&&t.type!=="time"&&t.type!=="datetime"&&t.type!=="file")}_getFieldCondition(e){let t=ve(this,ue)?.api?.state?.values??{},r=jk(e.condition,t);return{visible:!e.hidden&&r.visible,disabled:(this.schema?.disabled??!1)||(e.disabled??!1)||r.disabled,readonly:(this.schema?.readonly??!1)||(e.readonly??!1),required:(e.required??!1)||r.required}}_isFieldRenderable(e){return e.type==="group"||e.type==="array"||e.type==="button"?!0:this._getFieldCondition(e).visible}_renderField(e,t,r=!1,n=!1){if(e.type==="group"&&e.fields)return this._renderGroup(e,t,r,n);if(e.type==="array")return this._renderArrayField(e,t,r,n);if(e.type==="button")return this._renderButtonField(e,r);let s=this._getFieldCondition(e);if(!s.visible)return je;let d={name:e.name},h={...e,required:s.required},p=Ok(h);return p&&(d.validators=p),t.field(d,f=>{let x=on(f.state.meta.errors||[],{includeFieldErrors:!0}),k=f.state.meta.isTouched||ve(this,ue).api.state.submissionAttempts>0,C=k&&x.length>0,S=fe=>{let Te=f.state.value;this._clearSubmissionFeedback(),f.handleChange(fe),this._effectiveValidateTrigger(h)==="change"&&f.validate?.("change"),this._emitFieldChange(h,fe,Te)},z={field:h,value:f.state.value,errors:x,disabled:s.disabled||r,readonly:s.readonly||n,required:!!h.required,touched:k,invalid:x.length>0,formValues:ve(this,ue).api.state.values,fieldApi:f,blur:()=>f.handleBlur(),clearFeedback:()=>this._clearSubmissionFeedback(),handleChange:S,submit:()=>void this._submitForm(),reset:()=>this.reset()},T=this._withProps(h,this._renderControl(h,f,s.disabled||r,s.readonly||n,z)),P=h.hiddenLabel?"":h.label??"",H=Z`
11589
11589
  <lui-form-item
11590
11590
  data-field-name=${h.name}
11591
11591
  .label=${P}
@@ -12508,7 +12508,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
12508
12508
  .host .numInputWrapper span.arrowDown:after {
12509
12509
  border-top-color: var(--lui-color-fg-muted);
12510
12510
  }
12511
- `],a([Er()],lr.prototype,"value",2),a([Er({attribute:"selection-mode",reflect:!0})],lr.prototype,"selectionMode",2),a([Er({reflect:!0})],lr.prototype,"size",2),a([Er()],lr.prototype,"min",2),a([Er()],lr.prototype,"max",2),a([Er({type:Boolean})],lr.prototype,"disabled",2),a([Er({type:Number,attribute:"show-months"})],lr.prototype,"showMonths",2),a([Er({attribute:"default-date"})],lr.prototype,"defaultDate",2),a([Z1(".input")],lr.prototype,"_inputEl",2),a([Z1(".host")],lr.prototype,"_hostEl",2),lr=a([t0("lui-calendar")],lr);var Gr=class extends e0{constructor(){super(...arguments);this.value="";this.placeholder="\u9009\u62E9\u65E5\u671F\u8303\u56F4";this.size="md";this.disabled=!1;this.clearable=!0;this._onChange=e=>{let t=e.detail;this.value=t.value,this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))}}render(){return J1`
12511
+ `],a([Er()],lr.prototype,"value",2),a([Er({attribute:"selection-mode",reflect:!0})],lr.prototype,"selectionMode",2),a([Er({reflect:!0})],lr.prototype,"size",2),a([Er()],lr.prototype,"min",2),a([Er()],lr.prototype,"max",2),a([Er({type:Boolean})],lr.prototype,"disabled",2),a([Er({type:Number,attribute:"show-months"})],lr.prototype,"showMonths",2),a([Er({attribute:"default-date"})],lr.prototype,"defaultDate",2),a([Z1(".input")],lr.prototype,"_inputEl",2),a([Z1(".host")],lr.prototype,"_hostEl",2),lr=a([t0("lui-calendar")],lr);var Yr=class extends e0{constructor(){super(...arguments);this.value="";this.placeholder="\u9009\u62E9\u65E5\u671F\u8303\u56F4";this.size="md";this.disabled=!1;this.clearable=!0;this._onChange=e=>{let t=e.detail;this.value=t.value,this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))}}render(){return J1`
12512
12512
  <lui-datepicker
12513
12513
  type="date"
12514
12514
  selection-mode="range"
@@ -12521,7 +12521,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
12521
12521
  .clearable=${this.clearable}
12522
12522
  @change=${this._onChange}
12523
12523
  ></lui-datepicker>
12524
- `}};Gr.styles=[A,O,Q1`:host{display:block;width:100%;}`],a([Er()],Gr.prototype,"value",2),a([Er()],Gr.prototype,"placeholder",2),a([Er({reflect:!0})],Gr.prototype,"size",2),a([Er()],Gr.prototype,"min",2),a([Er()],Gr.prototype,"max",2),a([Er({type:Boolean})],Gr.prototype,"disabled",2),a([Er({type:Boolean})],Gr.prototype,"clearable",2),Gr=a([t0("lui-date-range-picker")],Gr);import{css as Kk,html as Gn,LitElement as Wk,nothing as nn}from"lit";import{customElement as Uk,property as ot,query as a0,state as wl}from"lit/decorators.js";var r0=da(_n(),1);function Bd(i,o){i.style.setProperty("--lui-dialog-left",`${o.left}px`),i.style.setProperty("--lui-dialog-top",`${o.top}px`),i.style.setProperty("--lui-dialog-right","auto"),i.style.setProperty("--lui-dialog-bottom","auto"),i.style.setProperty("--lui-dialog-base-translate-x","0px"),i.style.setProperty("--lui-dialog-base-translate-y","0px")}function o0(i){let{target:o,handle:e,visibleMarginX:t=72,visibleMarginY:r=48,ignoreFrom:n="button, input, textarea, select, option, a, [data-no-drag], [data-resize-handle]",initialState:s,onStart:d,onMove:h}=i,p={left:s?.left??o.getBoundingClientRect().left,top:s?.top??o.getBoundingClientRect().top},f=(0,r0.default)(e).draggable({ignoreFrom:n,listeners:{start(){d?.()},move(x){let k=o.getBoundingClientRect(),C=t-k.width,S=window.innerWidth-t,z=r-k.height,T=window.innerHeight-r,P=Math.min(S,Math.max(C,p.left+x.dx)),H=Math.min(T,Math.max(z,p.top+x.dy));p={left:P,top:H},Bd(o,p),h?.(p)}}});return{dispose(){f.unset()},reset(){p={left:0,top:0},Bd(o,p),h?.(p)},getState(){return{...p}},setState(x,k){p={left:x.left??p.left,top:x.top??p.top},k?.apply!==!1&&Bd(o,p),k?.notify!==!1&&h?.(p)}}}var qd=da(_n(),1);function xl(i){let o=Number.parseFloat(i);return Number.isFinite(o)?o:void 0}function Un(i,o,e){return Math.min(e,Math.max(o,i))}function Bk(i){return i.top&&i.left?"nw":i.top&&i.right?"ne":i.bottom&&i.left?"sw":i.bottom&&i.right?"se":i.top?"n":i.right?"e":i.bottom?"s":"w"}function qk(i,o,e){let r=window.getComputedStyle(i),n=xl(r.minWidth)??o,s=xl(r.minHeight)??e,d=Math.max(n,window.innerWidth-16*2),h=Math.max(s,window.innerHeight-16*2),p=Math.min(xl(r.maxWidth)??d,d),f=Math.min(xl(r.maxHeight)??h,h);return{minWidth:n,minHeight:s,maxWidth:p,maxHeight:f,viewportMargin:16}}function i0(i,o){i.style.setProperty("--lui-dialog-left",`${o.left}px`),i.style.setProperty("--lui-dialog-top",`${o.top}px`),i.style.setProperty("--lui-dialog-right","auto"),i.style.setProperty("--lui-dialog-bottom","auto"),i.style.setProperty("--lui-dialog-base-translate-x","0px"),i.style.setProperty("--lui-dialog-base-translate-y","0px"),i.style.setProperty("--lui-dialog-width",`${o.width}px`),i.style.setProperty("--lui-dialog-height",`${o.height}px`)}function n0(i){let{target:o,left:e,top:t,width:r,height:n,minWidth:s=320,minHeight:d=220,onStart:h,onEnd:p,onMove:f}=i,x=o.getBoundingClientRect(),k={left:e??x.left,top:t??x.top,width:r??x.width,height:n??x.height},C=(0,qd.default)(o).resizable({edges:{top:'[data-resize-handle="n"], [data-resize-handle="nw"], [data-resize-handle="ne"]',right:'[data-resize-handle="e"], [data-resize-handle="ne"], [data-resize-handle="se"]',bottom:'[data-resize-handle="s"], [data-resize-handle="sw"], [data-resize-handle="se"]',left:'[data-resize-handle="w"], [data-resize-handle="nw"], [data-resize-handle="sw"]'},invert:"reposition",modifiers:[qd.default.modifiers.restrictSize({min:{width:s,height:d}})],listeners:{start(S){h?.(Bk(S.edges))},move(S){let z=qk(o,s,d),T=k.left,P=k.top,H=k.width,R=k.height;if(S.edges?.left){let N=k.left+k.width,$=N-z.minWidth;T=Un(k.left+S.deltaRect.left,z.viewportMargin,$),H=Un(N-T,z.minWidth,Math.min(z.maxWidth,window.innerWidth-z.viewportMargin-T)),T=N-H}else S.edges?.right&&(H=Un(S.rect.width,z.minWidth,Math.min(z.maxWidth,window.innerWidth-z.viewportMargin-k.left)));if(S.edges?.top){let N=k.top+k.height,$=N-z.minHeight;P=Un(k.top+S.deltaRect.top,z.viewportMargin,$),R=Un(N-P,z.minHeight,Math.min(z.maxHeight,window.innerHeight-z.viewportMargin-P)),P=N-R}else S.edges?.bottom&&(R=Un(S.rect.height,z.minHeight,Math.min(z.maxHeight,window.innerHeight-z.viewportMargin-k.top)));k={left:T,top:P,width:H,height:R},i0(o,k),f?.({...k})},end(){p?.()}}});return{dispose(){C.unset()},getState(){return{...k}},setState(S,z){k={left:S.left??k.left,top:S.top??k.top,width:S.width??k.width,height:S.height??k.height},z?.apply!==!1&&i0(o,k),z?.notify!==!1&&f?.({...k})}}}var Gk=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", "),Yk=new Set(["lui-input","lui-select","lui-textarea","lui-switch","lui-checkbox","lui-radio","lui-input-number","lui-datepicker","lui-color-picker","lui-input-opt","lui-file-input"]),Ya=0,s0={fromAttribute(i){return i==null?!1:i!=="false"&&i!=="0"},toAttribute(i){return i?"":null}};function _l(i,o){let e=o;for(;e;){if(e===i)return!0;let t=e.getRootNode?.();if(t instanceof ShadowRoot&&t.host){e=t.host;continue}e=e.parentNode}return!1}function Xk(i){let o=i.activeElement;for(;o&&o.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o instanceof HTMLElement?o:null}function Zk(i){return i.hasAttribute("disabled")||i.getAttribute("aria-hidden")||i.tabIndex===-1||i.hidden?!1:i.matches(Gk)?!0:Yk.has(i.tagName.toLowerCase())}function Qk(i,o){if(!(i instanceof HTMLElement)||i===o||!_l(o,i)||!i.hasAttribute("open"))return!1;let e=i.tagName.toLowerCase();return e==="lui-popover"||e==="lui-select"||e==="lui-dropdown"||e==="lui-datepicker"||e==="lui-context-menu"}var xe=class extends Wk{constructor(){super(...arguments);this.open=!1;this.title="";this.noClose=!1;this.closeOnOutsidePress=!0;this.shakeOnOutsideClick=!0;this.noHeader=!1;this.noFooter=!1;this.draggable=!1;this.resizable=!1;this.destroyOnClose=!1;this.fullscreen=!1;this.placement="center";this.offset="";this.backdrop="opaque";this.backdropStyle="";this.portal=!1;this.overlayLayer="modal";this._shaking=!1;this._opening=!1;this._resizing=!1;this._activeResizeHandle=null;this._shakeTimer=0;this._openingTimer=0;this._draggableHandle=null;this._resizableHandle=null;this._explicitAttrs=new Set;this._overlayStackRegistered=!1;this._portalPlaceholder=null;this._portalLayerEl=null;this._isPortalMoving=!1;this._suppressBackdropClickUntil=0;this._previousActiveElement=null;this._bodyScrollLocked=!1;this._bodyUserSelect="";this._bodyWebkitUserSelect="";this._interactiveRect=null;this._destroyOnCloseTemplate=[];this._isSyncingDestroyOnCloseContent=!1;this._onDocumentKeyDown=e=>{if(!this.open||!this._isTopmostDialog())return;if(e.key==="Escape"){let h=e.composedPath();if(fn(h,this)||h.some(p=>Qk(p,this)))return;e.preventDefault(),this.close();return}if(e.key!=="Tab"||!this._dialog)return;let t=this._getFocusableElements();if(t.length===0){e.preventDefault(),this._dialog.focus({preventScroll:!0});return}let r=Xk(this.ownerDocument),n=t.findIndex(h=>h===r||_l(h,r)),s=t[0],d=t[t.length-1];if(e.shiftKey){n<=0&&(e.preventDefault(),d.focus({preventScroll:!0}));return}(n===-1||n===t.length-1)&&(e.preventDefault(),s.focus({preventScroll:!0}))};this._onDialogClick=e=>{if(e.target!==this._dialog||!this._isTopmostDialog())return;let t=e.composedPath();if(t.some(s=>s instanceof Node&&s!==this._dialog&&_l(this,s))||fn(t,this)||Date.now()<this._suppressBackdropClickUntil||Rs(this))return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()};this._onBackdropClick=e=>{if(e.stopPropagation(),!this._isTopmostDialog())return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()};this._onNativeClose=e=>{e.target===this._dialog&&this.open&&(this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))};this._onDocumentPointerDown=e=>{if(!this.open||!this._dialog){this._suppressBackdropClickUntil=0;return}let t=e.composedPath(),r=t[0]===this._dialog,n=t.some(d=>d instanceof Node&&d!==this._dialog&&_l(this,d)),s=fn(t,this);this._suppressBackdropClickUntil=!r&&(n||s)?Date.now()+320:0}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ye(()=>this.requestUpdate()),this._captureDestroyOnCloseTemplate(),this._lightDomObserver=new MutationObserver(()=>{!this._isSyncingDestroyOnCloseContent&&!(this.destroyOnClose&&!this.open&&this.childNodes.length===0)&&this._captureDestroyOnCloseTemplate(),this.requestUpdate()}),this._lightDomObserver.observe(this,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["slot"]}),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeyDown,!0)}disconnectedCallback(){this._releaseOverlayStack(),super.disconnectedCallback(),this._disposeLocaleChange?.(),this._lightDomObserver?.disconnect(),this._lightDomObserver=void 0,document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeyDown,!0),this._unlockBodyScroll(),this._setResizing(!1),this._teardownDraggable(),this._teardownResizable(),window.clearTimeout(this._shakeTimer),window.clearTimeout(this._openingTimer),this._isPortalMoving||(this._portalPlaceholder?.remove(),this._portalPlaceholder=null,this._portalLayerEl=null)}_t(e,t){let r=Ne(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}willUpdate(e){(e.has("open")||e.has("destroyOnClose"))&&this._syncDestroyOnCloseContent(),this._dialog&&this.open&&!this._dialog.open&&(this._opening=!0,window.clearTimeout(this._openingTimer),this._openingTimer=window.setTimeout(()=>{this._opening=!1},300)),e.has("open")&&!this.open&&(this._opening=!1,this._shaking=!1);let t=F(this,"dialog");!this._explicitAttrs.has("no-close")&&typeof t.noClose=="boolean"&&this.noClose!==t.noClose&&(this.noClose=t.noClose),!this._explicitAttrs.has("close-on-outside-press")&&typeof t.closeOnOutsidePress=="boolean"&&this.closeOnOutsidePress!==t.closeOnOutsidePress&&(this.closeOnOutsidePress=t.closeOnOutsidePress),!this._explicitAttrs.has("shake-on-outside-click")&&typeof t.shakeOnOutsideClick=="boolean"&&this.shakeOnOutsideClick!==t.shakeOnOutsideClick&&(this.shakeOnOutsideClick=t.shakeOnOutsideClick),!this._explicitAttrs.has("no-header")&&typeof t.noHeader=="boolean"&&this.noHeader!==t.noHeader&&(this.noHeader=t.noHeader),!this._explicitAttrs.has("no-footer")&&typeof t.noFooter=="boolean"&&this.noFooter!==t.noFooter&&(this.noFooter=t.noFooter),!this._explicitAttrs.has("draggable")&&typeof t.draggable=="boolean"&&this.draggable!==t.draggable&&(this.draggable=t.draggable),!this._explicitAttrs.has("resizable")&&typeof t.resizable=="boolean"&&this.resizable!==t.resizable&&(this.resizable=t.resizable),!this._explicitAttrs.has("destroy-on-close")&&typeof t.destroyOnClose=="boolean"&&this.destroyOnClose!==t.destroyOnClose&&(this.destroyOnClose=t.destroyOnClose),!this._explicitAttrs.has("fullscreen")&&typeof t.fullscreen=="boolean"&&this.fullscreen!==t.fullscreen&&(this.fullscreen=t.fullscreen),!this._explicitAttrs.has("width")&&(typeof t.width=="string"||typeof t.width=="number")&&this.width!==t.width&&(this.width=t.width),!this._explicitAttrs.has("drag-visible-margin-x")&&typeof t.dragVisibleMarginX=="number"&&this.dragVisibleMarginX!==t.dragVisibleMarginX&&(this.dragVisibleMarginX=t.dragVisibleMarginX),!this._explicitAttrs.has("drag-visible-margin-y")&&typeof t.dragVisibleMarginY=="number"&&this.dragVisibleMarginY!==t.dragVisibleMarginY&&(this.dragVisibleMarginY=t.dragVisibleMarginY),!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&this.placement!==t.placement&&(this.placement=t.placement),!this._explicitAttrs.has("offset")&&typeof t.offset=="string"&&this.offset!==t.offset&&(this.offset=t.offset),!this._explicitAttrs.has("backdrop")&&typeof t.backdrop=="string"&&this.backdrop!==t.backdrop&&(this.backdrop=t.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof t.backdropStyle=="string"&&this.backdropStyle!==t.backdropStyle&&(this.backdropStyle=t.backdropStyle),!this._explicitAttrs.has("portal")&&typeof t.portal=="boolean"&&this.portal!==t.portal&&(this.portal=t.portal),!this._explicitAttrs.has("overlay-layer")&&typeof t.overlayLayer=="string"&&this.overlayLayer!==t.overlayLayer&&(this.overlayLayer=t.overlayLayer),this.container==null&&t.container!=null&&(this.container=t.container)}updated(e){let t=e.has("portal")||e.has("container")||e.has("overlayLayer");if(this.open&&(e.has("open")||t)&&(this.portal?this._moveToPortalLayer():t&&this._restorePortalPlacement(),this._registerOverlayStack(),st(this)),e.has("open")&&this._dialog)if(this.open&&!this._dialog.open){try{this._dialog.show()}catch{this._dialog.setAttribute("open","")}this._previousActiveElement=this.ownerDocument.activeElement instanceof HTMLElement?this.ownerDocument.activeElement:null,this._lockBodyScroll(),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>{this._focusInitialElement()})}else!this.open&&this._dialog.open&&(this._unlockBodyScroll(),this._dialog.close(),this._restoreFocus());e.has("open")&&!this.open&&(this._releaseOverlayStack(),this._restorePortalPlacement(),this._resetInteractiveLayout()),e.has("width")&&this._interactiveRect&&!this._resizing&&(this._interactiveRect.width=void 0),(e.has("draggable")||e.has("fullscreen")||e.has("noHeader")||e.has("open")||e.has("dragHandle"))&&queueMicrotask(()=>this._syncDraggable()),(e.has("resizable")||e.has("fullscreen")||e.has("open")||e.has("width")||e.has("placement"))&&queueMicrotask(()=>this._syncResizable())}show(){this.portal&&this._moveToPortalLayer(),this.open=!0}close(e=!0){if(this.open){if(e){let t=new CustomEvent("close",{bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(t),t.defaultPrevented)return}this.open=!1}}_getFocusableElements(){if(!this._dialog)return[];let e=this.ownerDocument.createTreeWalker(this._dialog,NodeFilter.SHOW_ELEMENT),t=[],r=e.currentNode;for(;r;)r!==this._dialog&&Zk(r)&&!t.includes(r)&&t.push(r),r=e.nextNode();return t}_focusInitialElement(){if(!this.open||!this._dialog)return;let t=this._getFocusableElements()[0]??this._dialog;t===this._dialog&&(this._dialog.tabIndex=-1),t.focus({preventScroll:!0})}_restoreFocus(){let e=this._previousActiveElement;this._previousActiveElement=null,e&&e.isConnected&&e.focus({preventScroll:!0})}_lockBodyScroll(){this._bodyScrollLocked||!this.ownerDocument?.body||(Ya===0&&(this.ownerDocument.body.style.overflow="hidden"),Ya+=1,this._bodyScrollLocked=!0)}_unlockBodyScroll(){!this._bodyScrollLocked||!this.ownerDocument?.body||(Ya=Math.max(0,Ya-1),Ya===0&&(this.ownerDocument.body.style.overflow=""),this._bodyScrollLocked=!1)}_shake(){!this.shakeOnOutsideClick||!this.open||(window.clearTimeout(this._shakeTimer),this._shaking=!1,this.updateComplete.then(()=>{this._dialog?.offsetWidth,this._shaking=!0,this._shakeTimer=window.setTimeout(()=>{this._shaking=!1},380)}))}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}_hasFooterContent(){return this.noFooter?!1:Array.from(this.childNodes).some(e=>e.nodeType!==Node.ELEMENT_NODE?!1:e.slot==="footer")}_shouldRenderHeader(){return this.noHeader?!1:this.title||!this.noClose?!0:Array.from(this.childNodes).some(e=>e.nodeType!==Node.ELEMENT_NODE?!1:e.slot==="title")}_isTopmostDialog(){return!this._overlayStackRegistered||Is(this)}_registerOverlayStack(){let e=vn(this);if(!e){this._releaseOverlayStack();return}Et(this,e.layer,e.layerName),this._overlayStackRegistered=!0}_releaseOverlayStack(){this._overlayStackRegistered&&(fo(this),this._overlayStackRegistered=!1)}_resolvePortalMountTarget(){return Qt(this.overlayLayer||"modal",this.container??mi(this)??pi(this))}_moveToPortalLayer(){let e=this._resolvePortalMountTarget();if(this.parentNode===e){this._portalLayerEl=e;return}!this._portalPlaceholder&&this.parentNode&&(this._portalPlaceholder=this.ownerDocument.createComment("lui-dialog-portal"),this.parentNode.insertBefore(this._portalPlaceholder,this.nextSibling)),this._isPortalMoving=!0;try{e.appendChild(this),this._portalLayerEl=e}finally{this._isPortalMoving=!1}}_restorePortalPlacement(){if(!this._portalPlaceholder){this._portalLayerEl=null;return}let e=this._portalPlaceholder,t=e.parentNode;this._isPortalMoving=!0;try{t&&t.insertBefore(this,e),e.remove(),this._portalPlaceholder=null,this._portalLayerEl=null}finally{this._isPortalMoving=!1}}_teardownDraggable(){this._draggableHandle?.dispose(),this._draggableHandle=null}_syncDestroyOnCloseContent(){if(!this.destroyOnClose){this._restoreDestroyOnCloseContent();return}if(this.open){this._restoreDestroyOnCloseContent();return}this._stashDestroyOnCloseContent()}_captureDestroyOnCloseTemplate(){this._isSyncingDestroyOnCloseContent||(this._destroyOnCloseTemplate=Array.from(this.childNodes).map(e=>e.cloneNode(!0)))}_restoreDestroyOnCloseContent(){if(!(this.childNodes.length>0||this._destroyOnCloseTemplate.length===0)){this._isSyncingDestroyOnCloseContent=!0;try{this.replaceChildren(...this._destroyOnCloseTemplate.map(e=>e.cloneNode(!0)))}finally{this._isSyncingDestroyOnCloseContent=!1}}}_stashDestroyOnCloseContent(){if(!(!this.destroyOnClose||this.childNodes.length===0)){this._isSyncingDestroyOnCloseContent=!0;try{this.replaceChildren()}finally{this._isSyncingDestroyOnCloseContent=!1}}}_teardownResizable(){this._resizableHandle?.dispose(),this._resizableHandle=null,this._activeResizeHandle=null,this._setResizing(!1)}_setResizing(e){if(this._resizing===e)return;this._resizing=e;let t=this.ownerDocument?.body;if(t){if(e){this._bodyUserSelect=t.style.userSelect,this._bodyWebkitUserSelect=t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none";return}t.style.userSelect=this._bodyUserSelect,t.style.webkitUserSelect=this._bodyWebkitUserSelect}}_resetInteractiveLayout(){this._interactiveRect=null}_materializeInteractiveRect(){if(!this.open||!this._dialog)return null;let e=this._dialog.getBoundingClientRect();return this._interactiveRect={left:Math.round(e.left),top:Math.round(e.top),width:Math.round(e.width),height:Math.round(e.height)},this.requestUpdate(),this._interactiveRect}_syncDraggable(){if(this._teardownDraggable(),this.fullscreen||!this.open||!this.draggable||!this._dialog)return;let e=null;this.dragHandle?e=this._dialog.querySelector(this.dragHandle)||this.querySelector(this.dragHandle):!this.noHeader&&this._headerEl&&(e=this._headerEl),e&&(this._draggableHandle=o0({target:this._dialog,handle:e,initialState:this._interactiveRect?{left:this._interactiveRect.left,top:this._interactiveRect.top}:void 0,visibleMarginX:typeof this.dragVisibleMarginX=="number"&&Number.isFinite(this.dragVisibleMarginX)?this.dragVisibleMarginX:void 0,visibleMarginY:typeof this.dragVisibleMarginY=="number"&&Number.isFinite(this.dragVisibleMarginY)?this.dragVisibleMarginY:void 0,ignoreFrom:'[part="close"], button, input, textarea, select, option, a, [data-no-drag], [data-resize-handle], .resize-handle',onStart:()=>{let t=this._materializeInteractiveRect();t&&(this._draggableHandle?.setState({left:t.left,top:t.top},{notify:!1}),this._resizableHandle?.setState({left:t.left,top:t.top,width:t.width,height:t.height},{notify:!1}))},onMove:t=>{let r=this._interactiveRect??this._materializeInteractiveRect();r&&(this._interactiveRect={...r,left:t.left,top:t.top},this._resizableHandle?.setState({left:t.left,top:t.top},{notify:!1,apply:!1}),this.requestUpdate())}}))}syncDraggable(){this._syncDraggable()}_syncResizable(){this._teardownResizable(),!(this.fullscreen||!this.open||!this.resizable||!this._dialog)&&(this._resizableHandle=n0({target:this._dialog,left:this._interactiveRect?.left,top:this._interactiveRect?.top,width:this._interactiveRect?.width,height:this._interactiveRect?.height,minWidth:320,minHeight:220,onStart:e=>{let t=this._materializeInteractiveRect();t&&(this._resizableHandle?.setState({left:t.left,top:t.top,width:t.width,height:t.height},{notify:!1}),this._draggableHandle?.setState({left:t.left,top:t.top},{notify:!1,apply:!1})),this._activeResizeHandle=e,this._setResizing(!0)},onEnd:()=>{this._activeResizeHandle=null,this._setResizing(!1)},onMove:e=>{this._interactiveRect={left:e.left,top:e.top,width:e.width,height:e.height},this._draggableHandle?.setState({left:e.left,top:e.top},{notify:!1,apply:!1}),this.requestUpdate()}}))}_dialogStyle(){let e=this._interactiveRect?.width!=null?`${this._interactiveRect.width}px`:mt(this.width),t=this._interactiveRect?.height!=null?`${this._interactiveRect.height}px`:"",r=[this._interactiveRect?`--lui-dialog-left:${this._interactiveRect.left}px`:"",this._interactiveRect?`--lui-dialog-top:${this._interactiveRect.top}px`:"",this._interactiveRect?"--lui-dialog-right:auto":"",this._interactiveRect?"--lui-dialog-bottom:auto":"",this._interactiveRect?"--lui-dialog-base-translate-x:0px":"",this._interactiveRect?"--lui-dialog-base-translate-y:0px":"",this.offset?`--lui-dialog-offset:${this.offset}`:"",e?`--lui-dialog-width:${e}`:"",t?`--lui-dialog-height:${t}`:""].filter(Boolean);return r.length?r.join(";"):nn}render(){let e=this.open||!this.destroyOnClose,t=this._hasFooterContent();return Gn`
12524
+ `}};Yr.styles=[A,O,Q1`:host{display:block;width:100%;}`],a([Er()],Yr.prototype,"value",2),a([Er()],Yr.prototype,"placeholder",2),a([Er({reflect:!0})],Yr.prototype,"size",2),a([Er()],Yr.prototype,"min",2),a([Er()],Yr.prototype,"max",2),a([Er({type:Boolean})],Yr.prototype,"disabled",2),a([Er({type:Boolean})],Yr.prototype,"clearable",2),Yr=a([t0("lui-date-range-picker")],Yr);import{css as Kk,html as Gn,LitElement as Wk,nothing as nn}from"lit";import{customElement as Uk,property as ot,query as a0,state as wl}from"lit/decorators.js";var r0=da(_n(),1);function Bd(i,o){i.style.setProperty("--lui-dialog-left",`${o.left}px`),i.style.setProperty("--lui-dialog-top",`${o.top}px`),i.style.setProperty("--lui-dialog-right","auto"),i.style.setProperty("--lui-dialog-bottom","auto"),i.style.setProperty("--lui-dialog-base-translate-x","0px"),i.style.setProperty("--lui-dialog-base-translate-y","0px")}function o0(i){let{target:o,handle:e,visibleMarginX:t=72,visibleMarginY:r=48,ignoreFrom:n="button, input, textarea, select, option, a, [data-no-drag], [data-resize-handle]",initialState:s,onStart:d,onMove:h}=i,p={left:s?.left??o.getBoundingClientRect().left,top:s?.top??o.getBoundingClientRect().top},f=(0,r0.default)(e).draggable({ignoreFrom:n,listeners:{start(){d?.()},move(x){let k=o.getBoundingClientRect(),C=t-k.width,S=window.innerWidth-t,z=r-k.height,T=window.innerHeight-r,P=Math.min(S,Math.max(C,p.left+x.dx)),H=Math.min(T,Math.max(z,p.top+x.dy));p={left:P,top:H},Bd(o,p),h?.(p)}}});return{dispose(){f.unset()},reset(){p={left:0,top:0},Bd(o,p),h?.(p)},getState(){return{...p}},setState(x,k){p={left:x.left??p.left,top:x.top??p.top},k?.apply!==!1&&Bd(o,p),k?.notify!==!1&&h?.(p)}}}var qd=da(_n(),1);function xl(i){let o=Number.parseFloat(i);return Number.isFinite(o)?o:void 0}function Un(i,o,e){return Math.min(e,Math.max(o,i))}function Bk(i){return i.top&&i.left?"nw":i.top&&i.right?"ne":i.bottom&&i.left?"sw":i.bottom&&i.right?"se":i.top?"n":i.right?"e":i.bottom?"s":"w"}function qk(i,o,e){let r=window.getComputedStyle(i),n=xl(r.minWidth)??o,s=xl(r.minHeight)??e,d=Math.max(n,window.innerWidth-16*2),h=Math.max(s,window.innerHeight-16*2),p=Math.min(xl(r.maxWidth)??d,d),f=Math.min(xl(r.maxHeight)??h,h);return{minWidth:n,minHeight:s,maxWidth:p,maxHeight:f,viewportMargin:16}}function i0(i,o){i.style.setProperty("--lui-dialog-left",`${o.left}px`),i.style.setProperty("--lui-dialog-top",`${o.top}px`),i.style.setProperty("--lui-dialog-right","auto"),i.style.setProperty("--lui-dialog-bottom","auto"),i.style.setProperty("--lui-dialog-base-translate-x","0px"),i.style.setProperty("--lui-dialog-base-translate-y","0px"),i.style.setProperty("--lui-dialog-width",`${o.width}px`),i.style.setProperty("--lui-dialog-height",`${o.height}px`)}function n0(i){let{target:o,left:e,top:t,width:r,height:n,minWidth:s=320,minHeight:d=220,onStart:h,onEnd:p,onMove:f}=i,x=o.getBoundingClientRect(),k={left:e??x.left,top:t??x.top,width:r??x.width,height:n??x.height},C=(0,qd.default)(o).resizable({edges:{top:'[data-resize-handle="n"], [data-resize-handle="nw"], [data-resize-handle="ne"]',right:'[data-resize-handle="e"], [data-resize-handle="ne"], [data-resize-handle="se"]',bottom:'[data-resize-handle="s"], [data-resize-handle="sw"], [data-resize-handle="se"]',left:'[data-resize-handle="w"], [data-resize-handle="nw"], [data-resize-handle="sw"]'},invert:"reposition",modifiers:[qd.default.modifiers.restrictSize({min:{width:s,height:d}})],listeners:{start(S){h?.(Bk(S.edges))},move(S){let z=qk(o,s,d),T=k.left,P=k.top,H=k.width,R=k.height;if(S.edges?.left){let N=k.left+k.width,$=N-z.minWidth;T=Un(k.left+S.deltaRect.left,z.viewportMargin,$),H=Un(N-T,z.minWidth,Math.min(z.maxWidth,window.innerWidth-z.viewportMargin-T)),T=N-H}else S.edges?.right&&(H=Un(S.rect.width,z.minWidth,Math.min(z.maxWidth,window.innerWidth-z.viewportMargin-k.left)));if(S.edges?.top){let N=k.top+k.height,$=N-z.minHeight;P=Un(k.top+S.deltaRect.top,z.viewportMargin,$),R=Un(N-P,z.minHeight,Math.min(z.maxHeight,window.innerHeight-z.viewportMargin-P)),P=N-R}else S.edges?.bottom&&(R=Un(S.rect.height,z.minHeight,Math.min(z.maxHeight,window.innerHeight-z.viewportMargin-k.top)));k={left:T,top:P,width:H,height:R},i0(o,k),f?.({...k})},end(){p?.()}}});return{dispose(){C.unset()},getState(){return{...k}},setState(S,z){k={left:S.left??k.left,top:S.top??k.top,width:S.width??k.width,height:S.height??k.height},z?.apply!==!1&&i0(o,k),z?.notify!==!1&&f?.({...k})}}}var Gk=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", "),Yk=new Set(["lui-input","lui-select","lui-textarea","lui-switch","lui-checkbox","lui-radio","lui-input-number","lui-datepicker","lui-color-picker","lui-input-opt","lui-file-input"]),Ya=0,s0={fromAttribute(i){return i==null?!1:i!=="false"&&i!=="0"},toAttribute(i){return i?"":null}};function _l(i,o){let e=o;for(;e;){if(e===i)return!0;let t=e.getRootNode?.();if(t instanceof ShadowRoot&&t.host){e=t.host;continue}e=e.parentNode}return!1}function Xk(i){let o=i.activeElement;for(;o&&o.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;return o instanceof HTMLElement?o:null}function Zk(i){return i.hasAttribute("disabled")||i.getAttribute("aria-hidden")||i.tabIndex===-1||i.hidden?!1:i.matches(Gk)?!0:Yk.has(i.tagName.toLowerCase())}function Qk(i,o){if(!(i instanceof HTMLElement)||i===o||!_l(o,i)||!i.hasAttribute("open"))return!1;let e=i.tagName.toLowerCase();return e==="lui-popover"||e==="lui-select"||e==="lui-dropdown"||e==="lui-datepicker"||e==="lui-context-menu"}var xe=class extends Wk{constructor(){super(...arguments);this.open=!1;this.title="";this.noClose=!1;this.closeOnOutsidePress=!0;this.shakeOnOutsideClick=!0;this.noHeader=!1;this.noFooter=!1;this.draggable=!1;this.resizable=!1;this.destroyOnClose=!1;this.fullscreen=!1;this.placement="center";this.offset="";this.backdrop="opaque";this.backdropStyle="";this.portal=!1;this.overlayLayer="modal";this._shaking=!1;this._opening=!1;this._resizing=!1;this._activeResizeHandle=null;this._shakeTimer=0;this._openingTimer=0;this._draggableHandle=null;this._resizableHandle=null;this._explicitAttrs=new Set;this._overlayStackRegistered=!1;this._portalPlaceholder=null;this._portalLayerEl=null;this._isPortalMoving=!1;this._suppressBackdropClickUntil=0;this._previousActiveElement=null;this._bodyScrollLocked=!1;this._bodyUserSelect="";this._bodyWebkitUserSelect="";this._interactiveRect=null;this._destroyOnCloseTemplate=[];this._isSyncingDestroyOnCloseContent=!1;this._onDocumentKeyDown=e=>{if(!this.open||!this._isTopmostDialog())return;if(e.key==="Escape"){let h=e.composedPath();if(fn(h,this)||h.some(p=>Qk(p,this)))return;e.preventDefault(),this.close();return}if(e.key!=="Tab"||!this._dialog)return;let t=this._getFocusableElements();if(t.length===0){e.preventDefault(),this._dialog.focus({preventScroll:!0});return}let r=Xk(this.ownerDocument),n=t.findIndex(h=>h===r||_l(h,r)),s=t[0],d=t[t.length-1];if(e.shiftKey){n<=0&&(e.preventDefault(),d.focus({preventScroll:!0}));return}(n===-1||n===t.length-1)&&(e.preventDefault(),s.focus({preventScroll:!0}))};this._onDialogClick=e=>{if(e.target!==this._dialog||!this._isTopmostDialog())return;let t=e.composedPath();if(t.some(s=>s instanceof Node&&s!==this._dialog&&_l(this,s))||fn(t,this)||Date.now()<this._suppressBackdropClickUntil||Rs(this))return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()};this._onBackdropClick=e=>{if(e.stopPropagation(),!this._isTopmostDialog())return;if(this._emitOutsidePress(e)&&this.closeOnOutsidePress){this.close();return}this._shake()};this._onNativeClose=e=>{e.target===this._dialog&&this.open&&(this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0})))};this._onDocumentPointerDown=e=>{if(!this.open||!this._dialog){this._suppressBackdropClickUntil=0;return}let t=e.composedPath(),r=t[0]===this._dialog,n=t.some(d=>d instanceof Node&&d!==this._dialog&&_l(this,d)),s=fn(t,this);this._suppressBackdropClickUntil=!r&&(n||s)?Date.now()+320:0}}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._disposeLocaleChange=ye(()=>this.requestUpdate()),this._captureDestroyOnCloseTemplate(),this._lightDomObserver=new MutationObserver(()=>{!this._isSyncingDestroyOnCloseContent&&!(this.destroyOnClose&&!this.open&&this.childNodes.length===0)&&this._captureDestroyOnCloseTemplate(),this.requestUpdate()}),this._lightDomObserver.observe(this,{childList:!0,subtree:!1,attributes:!0,attributeFilter:["slot"]}),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0),document.addEventListener("keydown",this._onDocumentKeyDown,!0)}disconnectedCallback(){this._releaseOverlayStack(),super.disconnectedCallback(),this._disposeLocaleChange?.(),this._lightDomObserver?.disconnect(),this._lightDomObserver=void 0,document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0),document.removeEventListener("keydown",this._onDocumentKeyDown,!0),this._unlockBodyScroll(),this._setResizing(!1),this._teardownDraggable(),this._teardownResizable(),window.clearTimeout(this._shakeTimer),window.clearTimeout(this._openingTimer),this._isPortalMoving||(this._portalPlaceholder?.remove(),this._portalPlaceholder=null,this._portalLayerEl=null)}_t(e,t){let r=Ne(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}willUpdate(e){(e.has("open")||e.has("destroyOnClose"))&&this._syncDestroyOnCloseContent(),this._dialog&&this.open&&!this._dialog.open&&(this._opening=!0,window.clearTimeout(this._openingTimer),this._openingTimer=window.setTimeout(()=>{this._opening=!1},300)),e.has("open")&&!this.open&&(this._opening=!1,this._shaking=!1);let t=F(this,"dialog");!this._explicitAttrs.has("no-close")&&typeof t.noClose=="boolean"&&this.noClose!==t.noClose&&(this.noClose=t.noClose),!this._explicitAttrs.has("close-on-outside-press")&&typeof t.closeOnOutsidePress=="boolean"&&this.closeOnOutsidePress!==t.closeOnOutsidePress&&(this.closeOnOutsidePress=t.closeOnOutsidePress),!this._explicitAttrs.has("shake-on-outside-click")&&typeof t.shakeOnOutsideClick=="boolean"&&this.shakeOnOutsideClick!==t.shakeOnOutsideClick&&(this.shakeOnOutsideClick=t.shakeOnOutsideClick),!this._explicitAttrs.has("no-header")&&typeof t.noHeader=="boolean"&&this.noHeader!==t.noHeader&&(this.noHeader=t.noHeader),!this._explicitAttrs.has("no-footer")&&typeof t.noFooter=="boolean"&&this.noFooter!==t.noFooter&&(this.noFooter=t.noFooter),!this._explicitAttrs.has("draggable")&&typeof t.draggable=="boolean"&&this.draggable!==t.draggable&&(this.draggable=t.draggable),!this._explicitAttrs.has("resizable")&&typeof t.resizable=="boolean"&&this.resizable!==t.resizable&&(this.resizable=t.resizable),!this._explicitAttrs.has("destroy-on-close")&&typeof t.destroyOnClose=="boolean"&&this.destroyOnClose!==t.destroyOnClose&&(this.destroyOnClose=t.destroyOnClose),!this._explicitAttrs.has("fullscreen")&&typeof t.fullscreen=="boolean"&&this.fullscreen!==t.fullscreen&&(this.fullscreen=t.fullscreen),!this._explicitAttrs.has("width")&&(typeof t.width=="string"||typeof t.width=="number")&&this.width!==t.width&&(this.width=t.width),!this._explicitAttrs.has("drag-visible-margin-x")&&typeof t.dragVisibleMarginX=="number"&&this.dragVisibleMarginX!==t.dragVisibleMarginX&&(this.dragVisibleMarginX=t.dragVisibleMarginX),!this._explicitAttrs.has("drag-visible-margin-y")&&typeof t.dragVisibleMarginY=="number"&&this.dragVisibleMarginY!==t.dragVisibleMarginY&&(this.dragVisibleMarginY=t.dragVisibleMarginY),!this._explicitAttrs.has("placement")&&typeof t.placement=="string"&&this.placement!==t.placement&&(this.placement=t.placement),!this._explicitAttrs.has("offset")&&typeof t.offset=="string"&&this.offset!==t.offset&&(this.offset=t.offset),!this._explicitAttrs.has("backdrop")&&typeof t.backdrop=="string"&&this.backdrop!==t.backdrop&&(this.backdrop=t.backdrop),!this._explicitAttrs.has("backdrop-style")&&typeof t.backdropStyle=="string"&&this.backdropStyle!==t.backdropStyle&&(this.backdropStyle=t.backdropStyle),!this._explicitAttrs.has("portal")&&typeof t.portal=="boolean"&&this.portal!==t.portal&&(this.portal=t.portal),!this._explicitAttrs.has("overlay-layer")&&typeof t.overlayLayer=="string"&&this.overlayLayer!==t.overlayLayer&&(this.overlayLayer=t.overlayLayer),this.container==null&&t.container!=null&&(this.container=t.container)}updated(e){let t=e.has("portal")||e.has("container")||e.has("overlayLayer");if(this.open&&(e.has("open")||t)&&(this.portal?this._moveToPortalLayer():t&&this._restorePortalPlacement(),this._registerOverlayStack(),st(this)),e.has("open")&&this._dialog)if(this.open&&!this._dialog.open){try{this._dialog.show()}catch{this._dialog.setAttribute("open","")}this._previousActiveElement=this.ownerDocument.activeElement instanceof HTMLElement?this.ownerDocument.activeElement:null,this._lockBodyScroll(),this.dispatchEvent(new CustomEvent("open",{bubbles:!0,composed:!0})),this.updateComplete.then(()=>{this._focusInitialElement()})}else!this.open&&this._dialog.open&&(this._unlockBodyScroll(),this._dialog.close(),this._restoreFocus());e.has("open")&&!this.open&&(this._releaseOverlayStack(),this._restorePortalPlacement(),this._resetInteractiveLayout()),e.has("width")&&this._interactiveRect&&!this._resizing&&(this._interactiveRect.width=void 0),(e.has("draggable")||e.has("fullscreen")||e.has("noHeader")||e.has("open")||e.has("dragHandle"))&&queueMicrotask(()=>this._syncDraggable()),(e.has("resizable")||e.has("fullscreen")||e.has("open")||e.has("width")||e.has("placement"))&&queueMicrotask(()=>this._syncResizable())}show(){this.portal&&this._moveToPortalLayer(),this.open=!0}close(e=!0){if(this.open){if(e){let t=new CustomEvent("close",{bubbles:!0,composed:!0,cancelable:!0});if(this.dispatchEvent(t),t.defaultPrevented)return}this.open=!1}}_getFocusableElements(){if(!this._dialog)return[];let e=this.ownerDocument.createTreeWalker(this._dialog,NodeFilter.SHOW_ELEMENT),t=[],r=e.currentNode;for(;r;)r!==this._dialog&&Zk(r)&&!t.includes(r)&&t.push(r),r=e.nextNode();return t}_focusInitialElement(){if(!this.open||!this._dialog)return;let t=this._getFocusableElements()[0]??this._dialog;t===this._dialog&&(this._dialog.tabIndex=-1),t.focus({preventScroll:!0})}_restoreFocus(){let e=this._previousActiveElement;this._previousActiveElement=null,e&&e.isConnected&&e.focus({preventScroll:!0})}_lockBodyScroll(){this._bodyScrollLocked||!this.ownerDocument?.body||(Ya===0&&(this.ownerDocument.body.style.overflow="hidden"),Ya+=1,this._bodyScrollLocked=!0)}_unlockBodyScroll(){!this._bodyScrollLocked||!this.ownerDocument?.body||(Ya=Math.max(0,Ya-1),Ya===0&&(this.ownerDocument.body.style.overflow=""),this._bodyScrollLocked=!1)}_shake(){!this.shakeOnOutsideClick||!this.open||(window.clearTimeout(this._shakeTimer),this._shaking=!1,this.updateComplete.then(()=>{this._dialog?.offsetWidth,this._shaking=!0,this._shakeTimer=window.setTimeout(()=>{this._shaking=!1},380)}))}_emitOutsidePress(e){let t=new CustomEvent("outside-press",{detail:{originalEvent:e,target:e.target},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(t),!t.defaultPrevented}_hasFooterContent(){return this.noFooter?!1:Array.from(this.childNodes).some(e=>e.nodeType!==Node.ELEMENT_NODE?!1:e.slot==="footer")}_shouldRenderHeader(){return this.noHeader?!1:this.title||!this.noClose?!0:Array.from(this.childNodes).some(e=>e.nodeType!==Node.ELEMENT_NODE?!1:e.slot==="title")}_isTopmostDialog(){return!this._overlayStackRegistered||Is(this)}_registerOverlayStack(){let e=vn(this);if(!e){this._releaseOverlayStack();return}Et(this,e.layer,e.layerName),this._overlayStackRegistered=!0}_releaseOverlayStack(){this._overlayStackRegistered&&(fo(this),this._overlayStackRegistered=!1)}_resolvePortalMountTarget(){return Qt(this.overlayLayer||"modal",this.container??mi(this)??pi(this))}_moveToPortalLayer(){let e=this._resolvePortalMountTarget();if(this.parentNode===e){this._portalLayerEl=e;return}!this._portalPlaceholder&&this.parentNode&&(this._portalPlaceholder=this.ownerDocument.createComment("lui-dialog-portal"),this.parentNode.insertBefore(this._portalPlaceholder,this.nextSibling)),this._isPortalMoving=!0;try{e.appendChild(this),this._portalLayerEl=e}finally{this._isPortalMoving=!1}}_restorePortalPlacement(){if(!this._portalPlaceholder){this._portalLayerEl=null;return}let e=this._portalPlaceholder,t=e.parentNode;this._isPortalMoving=!0;try{t&&t.insertBefore(this,e),e.remove(),this._portalPlaceholder=null,this._portalLayerEl=null}finally{this._isPortalMoving=!1}}_teardownDraggable(){this._draggableHandle?.dispose(),this._draggableHandle=null}_syncDestroyOnCloseContent(){if(!this.destroyOnClose){this._restoreDestroyOnCloseContent();return}if(this.open){this._restoreDestroyOnCloseContent();return}this._stashDestroyOnCloseContent()}_captureDestroyOnCloseTemplate(){this._isSyncingDestroyOnCloseContent||(this._destroyOnCloseTemplate=Array.from(this.childNodes).map(e=>e.cloneNode(!0)))}_restoreDestroyOnCloseContent(){if(!(this.childNodes.length>0||this._destroyOnCloseTemplate.length===0)){this._isSyncingDestroyOnCloseContent=!0;try{this.replaceChildren(...this._destroyOnCloseTemplate.map(e=>e.cloneNode(!0)))}finally{this._isSyncingDestroyOnCloseContent=!1}}}_stashDestroyOnCloseContent(){if(!(!this.destroyOnClose||this.childNodes.length===0)){this._isSyncingDestroyOnCloseContent=!0;try{this.replaceChildren()}finally{this._isSyncingDestroyOnCloseContent=!1}}}_teardownResizable(){this._resizableHandle?.dispose(),this._resizableHandle=null,this._activeResizeHandle=null,this._setResizing(!1)}_setResizing(e){if(this._resizing===e)return;this._resizing=e;let t=this.ownerDocument?.body;if(t){if(e){this._bodyUserSelect=t.style.userSelect,this._bodyWebkitUserSelect=t.style.webkitUserSelect,t.style.userSelect="none",t.style.webkitUserSelect="none";return}t.style.userSelect=this._bodyUserSelect,t.style.webkitUserSelect=this._bodyWebkitUserSelect}}_resetInteractiveLayout(){this._interactiveRect=null}_materializeInteractiveRect(){if(!this.open||!this._dialog)return null;let e=this._dialog.getBoundingClientRect();return this._interactiveRect={left:Math.round(e.left),top:Math.round(e.top),width:Math.round(e.width),height:Math.round(e.height)},this.requestUpdate(),this._interactiveRect}_syncDraggable(){if(this._teardownDraggable(),this.fullscreen||!this.open||!this.draggable||!this._dialog)return;let e=null;this.dragHandle?e=this._dialog.querySelector(this.dragHandle)||this.querySelector(this.dragHandle):!this.noHeader&&this._headerEl&&(e=this._headerEl),e&&(this._draggableHandle=o0({target:this._dialog,handle:e,initialState:this._interactiveRect?{left:this._interactiveRect.left,top:this._interactiveRect.top}:void 0,visibleMarginX:typeof this.dragVisibleMarginX=="number"&&Number.isFinite(this.dragVisibleMarginX)?this.dragVisibleMarginX:void 0,visibleMarginY:typeof this.dragVisibleMarginY=="number"&&Number.isFinite(this.dragVisibleMarginY)?this.dragVisibleMarginY:void 0,ignoreFrom:'[part="close"], button, input, textarea, select, option, a, [data-no-drag], [data-resize-handle], .resize-handle',onStart:()=>{let t=this._materializeInteractiveRect();t&&(this._draggableHandle?.setState({left:t.left,top:t.top},{notify:!1}),this._resizableHandle?.setState({left:t.left,top:t.top,width:t.width,height:t.height},{notify:!1}))},onMove:t=>{let r=this._interactiveRect??this._materializeInteractiveRect();r&&(this._interactiveRect={...r,left:t.left,top:t.top},this._resizableHandle?.setState({left:t.left,top:t.top},{notify:!1,apply:!1}),this.requestUpdate())}}))}syncDraggable(){this._syncDraggable()}_syncResizable(){this._teardownResizable(),!(this.fullscreen||!this.open||!this.resizable||!this._dialog)&&(this._resizableHandle=n0({target:this._dialog,left:this._interactiveRect?.left,top:this._interactiveRect?.top,width:this._interactiveRect?.width,height:this._interactiveRect?.height,minWidth:320,minHeight:220,onStart:e=>{let t=this._materializeInteractiveRect();t&&(this._resizableHandle?.setState({left:t.left,top:t.top,width:t.width,height:t.height},{notify:!1}),this._draggableHandle?.setState({left:t.left,top:t.top},{notify:!1,apply:!1})),this._activeResizeHandle=e,this._setResizing(!0)},onEnd:()=>{this._activeResizeHandle=null,this._setResizing(!1)},onMove:e=>{this._interactiveRect={left:e.left,top:e.top,width:e.width,height:e.height},this._draggableHandle?.setState({left:e.left,top:e.top},{notify:!1,apply:!1}),this.requestUpdate()}}))}_dialogStyle(){let e=this._interactiveRect?.width!=null?`${this._interactiveRect.width}px`:mt(this.width),t=this._interactiveRect?.height!=null?`${this._interactiveRect.height}px`:"",r=[this._interactiveRect?`--lui-dialog-left:${this._interactiveRect.left}px`:"",this._interactiveRect?`--lui-dialog-top:${this._interactiveRect.top}px`:"",this._interactiveRect?"--lui-dialog-right:auto":"",this._interactiveRect?"--lui-dialog-bottom:auto":"",this._interactiveRect?"--lui-dialog-base-translate-x:0px":"",this._interactiveRect?"--lui-dialog-base-translate-y:0px":"",this.offset?`--lui-dialog-offset:${this.offset}`:"",e?`--lui-dialog-width:${e}`:"",t?`--lui-dialog-height:${t}`:""].filter(Boolean);return r.length?r.join(";"):nn}render(){let e=this.open||!this.destroyOnClose,t=this._hasFooterContent();return Gn`
12525
12525
  <div
12526
12526
  part="custom-backdrop"
12527
12527
  style=${this.backdropStyle||nn}
@@ -13820,7 +13820,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
13820
13820
  gap: 6px;
13821
13821
  margin-top: 10px;
13822
13822
  }
13823
- `],a([dr()],it.prototype,"title",2),a([dr()],it.prototype,"description",2),a([dr({reflect:!0})],it.prototype,"status",2),a([dr()],it.prototype,"icon",2),a([dr({type:Boolean,attribute:"no-icon",reflect:!0})],it.prototype,"noIcon",2),a([dr({reflect:!0})],it.prototype,"placement",2),a([dr({attribute:"confirm-text"})],it.prototype,"confirmText",2),a([dr({attribute:"cancel-text"})],it.prototype,"cancelText",2),a([dr({attribute:"confirm-variant"})],it.prototype,"confirmVariant",2),a([dr({attribute:"cancel-variant"})],it.prototype,"cancelVariant",2),a([dr({type:Boolean,reflect:!0})],it.prototype,"disabled",2),a([dr({type:Boolean})],it.prototype,"portal",2),a([dr({type:Number,attribute:"offset-distance"})],it.prototype,"offsetDistance",2),a([dr({attribute:!1})],it.prototype,"onConfirm",2),a([dr({reflect:!0})],it.prototype,"locale",2),a([dr({attribute:!1})],it.prototype,"translations",2),a([x4()],it.prototype,"_loading",2),a([k4("lui-popover")],it.prototype,"_popover",2),it=a([y4("lui-popconfirm")],it);import{css as w4,html as zl,LitElement as _4,nothing as Xn}from"lit";import{customElement as M4,property as Vr}from"lit/decorators.js";var C4={fromAttribute(i){return i==null?!0:i!=="false"&&i!=="0"},toAttribute(i){return i?"":"false"}},zt=class extends _4{constructor(){super(...arguments);this.type="line";this.percent=0;this.status="normal";this.size="md";this.radius="full";this.showText=!0;this.textInside=!1;this.striped=!1;this.indeterminate=!1;this.disabled=!1;this.label="";this.pauseWhenHidden=!0;this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._setupIntersectionObserver()}disconnectedCallback(){super.disconnectedCallback(),this._intersectionObserver?.disconnect()}_setupIntersectionObserver(){this._intersectionObserver?.disconnect(),this.dataset.inView="true",!(!this.pauseWhenHidden||typeof IntersectionObserver>"u")&&(this._intersectionObserver=new IntersectionObserver(e=>{let t=e[0];this.dataset.inView=t?.isIntersecting?"true":"false"}),this._intersectionObserver.observe(this))}willUpdate(e){e.has("pauseWhenHidden")&&this._setupIntersectionObserver();let t=F(this,"progress");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("status")&&typeof t.status=="string"&&this.status!==t.status&&(this.status=t.status),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("show-text")&&typeof t.showText=="boolean"&&this.showText!==t.showText&&(this.showText=t.showText),!this._explicitAttrs.has("text-inside")&&typeof t.textInside=="boolean"&&this.textInside!==t.textInside&&(this.textInside=t.textInside),!this._explicitAttrs.has("striped")&&typeof t.striped=="boolean"&&this.striped!==t.striped&&(this.striped=t.striped)}_clampPercent(){return Number.isFinite(this.percent)?Math.max(0,Math.min(100,this.percent)):0}_resolvedStatus(e){return this.status==="normal"&&e>=100?"success":this.status}_statusIcon(e){return ai(e)}_formatText(e,t){return this.format?this.format(e,t):this.indeterminate?this.label||"Loading":`${Math.round(e)}%`}_statusColorVar(e){return e==="success"?"var(--lui-color-success)":e==="warning"?"var(--lui-color-warning)":e==="danger"||e==="exception"?"var(--lui-color-danger)":"var(--lui-color-primary)"}_progressStyle(e,t){let r=[`--lui-progress-percent:${e}%`,`--lui-progress-fill-bg:${this._statusColorVar(t)}`,`--lui-progress-fill-min-width:${this.textInside&&e>0?"34px":"0px"}`];return typeof this.strokeWidth=="number"&&Number.isFinite(this.strokeWidth)&&r.push(`--lui-progress-height:${Math.max(1,this.strokeWidth)}px`),r.join(";")}render(){let e=this._clampPercent(),t=this._resolvedStatus(e),r=this._statusIcon(t),n=this._formatText(e,t),s=this.label||"Progress";return zl`
13823
+ `],a([dr()],it.prototype,"title",2),a([dr()],it.prototype,"description",2),a([dr({reflect:!0})],it.prototype,"status",2),a([dr()],it.prototype,"icon",2),a([dr({type:Boolean,attribute:"no-icon",reflect:!0})],it.prototype,"noIcon",2),a([dr({reflect:!0})],it.prototype,"placement",2),a([dr({attribute:"confirm-text"})],it.prototype,"confirmText",2),a([dr({attribute:"cancel-text"})],it.prototype,"cancelText",2),a([dr({attribute:"confirm-variant"})],it.prototype,"confirmVariant",2),a([dr({attribute:"cancel-variant"})],it.prototype,"cancelVariant",2),a([dr({type:Boolean,reflect:!0})],it.prototype,"disabled",2),a([dr({type:Boolean})],it.prototype,"portal",2),a([dr({type:Number,attribute:"offset-distance"})],it.prototype,"offsetDistance",2),a([dr({attribute:!1})],it.prototype,"onConfirm",2),a([dr({reflect:!0})],it.prototype,"locale",2),a([dr({attribute:!1})],it.prototype,"translations",2),a([x4()],it.prototype,"_loading",2),a([k4("lui-popover")],it.prototype,"_popover",2),it=a([y4("lui-popconfirm")],it);import{css as w4,html as zl,LitElement as _4,nothing as Xn}from"lit";import{customElement as M4,property as Dr}from"lit/decorators.js";var C4={fromAttribute(i){return i==null?!0:i!=="false"&&i!=="0"},toAttribute(i){return i?"":"false"}},zt=class extends _4{constructor(){super(...arguments);this.type="line";this.percent=0;this.status="normal";this.size="md";this.radius="full";this.showText=!0;this.textInside=!1;this.striped=!1;this.indeterminate=!1;this.disabled=!1;this.label="";this.pauseWhenHidden=!0;this._explicitAttrs=new Set}connectedCallback(){super.connectedCallback(),this._explicitAttrs=new Set(this.getAttributeNames()),this._setupIntersectionObserver()}disconnectedCallback(){super.disconnectedCallback(),this._intersectionObserver?.disconnect()}_setupIntersectionObserver(){this._intersectionObserver?.disconnect(),this.dataset.inView="true",!(!this.pauseWhenHidden||typeof IntersectionObserver>"u")&&(this._intersectionObserver=new IntersectionObserver(e=>{let t=e[0];this.dataset.inView=t?.isIntersecting?"true":"false"}),this._intersectionObserver.observe(this))}willUpdate(e){e.has("pauseWhenHidden")&&this._setupIntersectionObserver();let t=F(this,"progress");!this._explicitAttrs.has("size")&&typeof t.size=="string"&&this.size!==t.size&&(this.size=t.size),!this._explicitAttrs.has("status")&&typeof t.status=="string"&&this.status!==t.status&&(this.status=t.status),!this._explicitAttrs.has("radius")&&typeof t.radius=="string"&&this.radius!==t.radius&&(this.radius=t.radius),!this._explicitAttrs.has("disabled")&&typeof t.disabled=="boolean"&&this.disabled!==t.disabled&&(this.disabled=t.disabled),!this._explicitAttrs.has("show-text")&&typeof t.showText=="boolean"&&this.showText!==t.showText&&(this.showText=t.showText),!this._explicitAttrs.has("text-inside")&&typeof t.textInside=="boolean"&&this.textInside!==t.textInside&&(this.textInside=t.textInside),!this._explicitAttrs.has("striped")&&typeof t.striped=="boolean"&&this.striped!==t.striped&&(this.striped=t.striped)}_clampPercent(){return Number.isFinite(this.percent)?Math.max(0,Math.min(100,this.percent)):0}_resolvedStatus(e){return this.status==="normal"&&e>=100?"success":this.status}_statusIcon(e){return ai(e)}_formatText(e,t){return this.format?this.format(e,t):this.indeterminate?this.label||"Loading":`${Math.round(e)}%`}_statusColorVar(e){return e==="success"?"var(--lui-color-success)":e==="warning"?"var(--lui-color-warning)":e==="danger"||e==="exception"?"var(--lui-color-danger)":"var(--lui-color-primary)"}_progressStyle(e,t){let r=[`--lui-progress-percent:${e}%`,`--lui-progress-fill-bg:${this._statusColorVar(t)}`,`--lui-progress-fill-min-width:${this.textInside&&e>0?"34px":"0px"}`];return typeof this.strokeWidth=="number"&&Number.isFinite(this.strokeWidth)&&r.push(`--lui-progress-height:${Math.max(1,this.strokeWidth)}px`),r.join(";")}render(){let e=this._clampPercent(),t=this._resolvedStatus(e),r=this._statusIcon(t),n=this._formatText(e,t),s=this.label||"Progress";return zl`
13824
13824
  <div
13825
13825
  class="progress"
13826
13826
  part="progress"
@@ -14043,7 +14043,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
14043
14043
  inset-inline-start: 100%;
14044
14044
  }
14045
14045
  }
14046
- `],a([Vr({reflect:!0})],zt.prototype,"type",2),a([Vr({type:Number})],zt.prototype,"percent",2),a([Vr({reflect:!0})],zt.prototype,"status",2),a([Vr({reflect:!0})],zt.prototype,"size",2),a([Vr({reflect:!0})],zt.prototype,"radius",2),a([Vr({type:Number,attribute:"stroke-width"})],zt.prototype,"strokeWidth",2),a([Vr({attribute:"show-text",converter:C4})],zt.prototype,"showText",2),a([Vr({type:Boolean,reflect:!0,attribute:"text-inside"})],zt.prototype,"textInside",2),a([Vr({type:Boolean,reflect:!0})],zt.prototype,"striped",2),a([Vr({type:Boolean,reflect:!0})],zt.prototype,"indeterminate",2),a([Vr({type:Boolean,reflect:!0})],zt.prototype,"disabled",2),a([Vr()],zt.prototype,"label",2),a([Vr({attribute:!1})],zt.prototype,"format",2),a([Vr({type:Boolean,attribute:"pause-when-hidden"})],zt.prototype,"pauseWhenHidden",2),zt=a([M4("lui-progress")],zt);import{css as z4,html as Ti,LitElement as E4,nothing as Yd}from"lit";import{customElement as S4,property as Sr,query as $4,state as Xd}from"lit/decorators.js";var Ze=class extends E4{constructor(){super(...arguments);this.nodes=[];this.value=[];this.size="md";this.placeholder="";this.separator=" / ";this.expandTrigger="click";this.changeOnSelect=!1;this.disabled=!1;this.clearable=!1;this.invalid=!1;this.portal=!0;this.open=!1;this._activePath=[];this._loadingKey="";this._loaded={};this._onTriggerClick=()=>{this._setOpen(!this.open)};this._onTriggerKeyDown=e=>{if(e.key==="Enter"||e.key===" "){e.preventDefault(),this._setOpen(!this.open);return}if(e.key==="ArrowDown"&&!this.open){e.preventDefault(),this._setOpen(!0);return}e.key==="Escape"&&this.open&&(e.stopPropagation(),this._setOpen(!1))};this._clear=e=>{e.stopPropagation(),this._activePath=[],this._commit([])}}connectedCallback(){super.connectedCallback(),this._localeCleanup=ye(()=>this.requestUpdate()),this._activePath=[...this.value]}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}willUpdate(e){e.has("value")&&(this._activePath=[...this.value])}_t(e,t){let r=Ne(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}_childrenOf(e,t){let r=e.children;return Array.isArray(r)&&r.length?r:this._loaded[t.join("\0")]??[]}_hasChildren(e,t){return this._childrenOf(e,t).length>0?!0:!!e.hasChildren&&!e.isLeaf}get _columns(){let e=[this.nodes],t=this.nodes;for(let r=0;r<this._activePath.length;r+=1){let n=this._activePath[r],s=t.find(h=>Dt(h)===n);if(!s)break;let d=this._childrenOf(s,this._activePath.slice(0,r+1));if(!d.length)break;e.push(d),t=d}return e}_nodesForPath(e){let t=[],r=this.nodes;for(let n of e){let s=r.find(d=>Dt(d)===n);if(!s)break;t.push(s),r=this._childrenOf(s,e.slice(0,t.length))}return t}get _displayLabel(){let e=this._nodesForPath(this.value);return e.length!==this.value.length||!e.length?"":e.map(Ho).join(this.separator)}_setOpen(e){this.disabled||this.open===e||(this.open=e,e?(this._activePath=[...this.value],this._popover?.show()):this._popover?.hide())}_commit(e){this.value=e;let t=this._nodesForPath(e);this.dispatchEvent(new CustomEvent("change",{detail:{value:e,nodes:t,label:t.map(Ho).join(this.separator)},bubbles:!0,composed:!0}))}async _openNode(e,t){this._activePath=t;let r=Dt(e);if(!(this._childrenOf(e,t).length>0||!this.childrenLoader||!this._hasChildren(e,t))){this._loadingKey=r;try{let s=await this.childrenLoader(e,t);this._loaded={...this._loaded,[t.join("\0")]:s}}finally{this._loadingKey=""}}}async _onOptionClick(e,t){if(e.disabled)return;let r=[...this._activePath.slice(0,t),Dt(e)];if(this._hasChildren(e,r)){await this._openNode(e,r),this.changeOnSelect&&this._commit(r);return}this._activePath=r,this._commit(r),this._setOpen(!1)}_onOptionEnter(e,t){if(this.expandTrigger!=="hover"||e.disabled)return;let r=[...this._activePath.slice(0,t),Dt(e)];this._hasChildren(e,r)?this._openNode(e,r):this._activePath=r}render(){let t=F(this,"cascader").size??this.size,r=this._displayLabel,n=r!=="",s=this.clearable&&n&&!this.disabled,d=this._columns;return Ti`
14046
+ `],a([Dr({reflect:!0})],zt.prototype,"type",2),a([Dr({type:Number})],zt.prototype,"percent",2),a([Dr({reflect:!0})],zt.prototype,"status",2),a([Dr({reflect:!0})],zt.prototype,"size",2),a([Dr({reflect:!0})],zt.prototype,"radius",2),a([Dr({type:Number,attribute:"stroke-width"})],zt.prototype,"strokeWidth",2),a([Dr({attribute:"show-text",converter:C4})],zt.prototype,"showText",2),a([Dr({type:Boolean,reflect:!0,attribute:"text-inside"})],zt.prototype,"textInside",2),a([Dr({type:Boolean,reflect:!0})],zt.prototype,"striped",2),a([Dr({type:Boolean,reflect:!0})],zt.prototype,"indeterminate",2),a([Dr({type:Boolean,reflect:!0})],zt.prototype,"disabled",2),a([Dr()],zt.prototype,"label",2),a([Dr({attribute:!1})],zt.prototype,"format",2),a([Dr({type:Boolean,attribute:"pause-when-hidden"})],zt.prototype,"pauseWhenHidden",2),zt=a([M4("lui-progress")],zt);import{css as z4,html as Ti,LitElement as E4,nothing as Yd}from"lit";import{customElement as S4,property as Sr,query as $4,state as Xd}from"lit/decorators.js";var Ze=class extends E4{constructor(){super(...arguments);this.nodes=[];this.value=[];this.size="md";this.placeholder="";this.separator=" / ";this.expandTrigger="click";this.changeOnSelect=!1;this.disabled=!1;this.clearable=!1;this.invalid=!1;this.portal=!0;this.open=!1;this._activePath=[];this._loadingKey="";this._loaded={};this._onTriggerClick=()=>{this._setOpen(!this.open)};this._onTriggerKeyDown=e=>{if(e.key==="Enter"||e.key===" "){e.preventDefault(),this._setOpen(!this.open);return}if(e.key==="ArrowDown"&&!this.open){e.preventDefault(),this._setOpen(!0);return}e.key==="Escape"&&this.open&&(e.stopPropagation(),this._setOpen(!1))};this._clear=e=>{e.stopPropagation(),this._activePath=[],this._commit([])}}connectedCallback(){super.connectedCallback(),this._localeCleanup=ye(()=>this.requestUpdate()),this._activePath=[...this.value]}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}willUpdate(e){e.has("value")&&(this._activePath=[...this.value])}_t(e,t){let r=Ne(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}_childrenOf(e,t){let r=e.children;return Array.isArray(r)&&r.length?r:this._loaded[t.join("\0")]??[]}_hasChildren(e,t){return this._childrenOf(e,t).length>0?!0:!!e.hasChildren&&!e.isLeaf}get _columns(){let e=[this.nodes],t=this.nodes;for(let r=0;r<this._activePath.length;r+=1){let n=this._activePath[r],s=t.find(h=>Dt(h)===n);if(!s)break;let d=this._childrenOf(s,this._activePath.slice(0,r+1));if(!d.length)break;e.push(d),t=d}return e}_nodesForPath(e){let t=[],r=this.nodes;for(let n of e){let s=r.find(d=>Dt(d)===n);if(!s)break;t.push(s),r=this._childrenOf(s,e.slice(0,t.length))}return t}get _displayLabel(){let e=this._nodesForPath(this.value);return e.length!==this.value.length||!e.length?"":e.map(Ho).join(this.separator)}_setOpen(e){this.disabled||this.open===e||(this.open=e,e?(this._activePath=[...this.value],this._popover?.show()):this._popover?.hide())}_commit(e){this.value=e;let t=this._nodesForPath(e);this.dispatchEvent(new CustomEvent("change",{detail:{value:e,nodes:t,label:t.map(Ho).join(this.separator)},bubbles:!0,composed:!0}))}async _openNode(e,t){this._activePath=t;let r=Dt(e);if(!(this._childrenOf(e,t).length>0||!this.childrenLoader||!this._hasChildren(e,t))){this._loadingKey=r;try{let s=await this.childrenLoader(e,t);this._loaded={...this._loaded,[t.join("\0")]:s}}finally{this._loadingKey=""}}}async _onOptionClick(e,t){if(e.disabled)return;let r=[...this._activePath.slice(0,t),Dt(e)];if(this._hasChildren(e,r)){await this._openNode(e,r),this.changeOnSelect&&this._commit(r);return}this._activePath=r,this._commit(r),this._setOpen(!1)}_onOptionEnter(e,t){if(this.expandTrigger!=="hover"||e.disabled)return;let r=[...this._activePath.slice(0,t),Dt(e)];this._hasChildren(e,r)?this._openNode(e,r):this._activePath=r}render(){let t=F(this,"cascader").size??this.size,r=this._displayLabel,n=r!=="",s=this.clearable&&n&&!this.disabled,d=this._columns;return Ti`
14047
14047
  <lui-popover
14048
14048
  trigger="manual"
14049
14049
  placement="bottom-start"
@@ -14359,7 +14359,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
14359
14359
  overscroll-behavior: contain;
14360
14360
  scrollbar-width: thin;
14361
14361
  }
14362
- `],a([ur({attribute:!1})],Qe.prototype,"nodes",2),a([ur({attribute:!1})],Qe.prototype,"value",2),a([ur({reflect:!0})],Qe.prototype,"mode",2),a([ur({reflect:!0})],Qe.prototype,"size",2),a([ur()],Qe.prototype,"placeholder",2),a([ur({type:Boolean,reflect:!0})],Qe.prototype,"disabled",2),a([ur({type:Boolean,reflect:!0})],Qe.prototype,"clearable",2),a([ur({type:Boolean,reflect:!0})],Qe.prototype,"invalid",2),a([ur({type:Boolean,reflect:!0})],Qe.prototype,"filterable",2),a([ur({type:Boolean,attribute:"check-strictly"})],Qe.prototype,"checkStrictly",2),a([ur({attribute:!1})],Qe.prototype,"childrenLoader",2),a([ur({type:Boolean,attribute:"close-on-select"})],Qe.prototype,"closeOnSelect",2),a([ur({type:Boolean})],Qe.prototype,"portal",2),a([ur({type:Boolean,reflect:!0,attribute:"open"})],Qe.prototype,"open",2),a([ur({reflect:!0})],Qe.prototype,"locale",2),a([ur({attribute:!1})],Qe.prototype,"translations",2),a([O4()],Qe.prototype,"_keys",2),a([d0("lui-popover")],Qe.prototype,"_popover",2),a([d0("lui-tree")],Qe.prototype,"_tree",2),Qe=a([j4("lui-tree-select")],Qe);import{css as H4,html as Zn,LitElement as R4,nothing as u0}from"lit";import{customElement as I4,property as Dr,query as h0,state as Zd}from"lit/decorators.js";function V4(i){return typeof i=="string"?{label:i,value:i}:i}var Je=class extends R4{constructor(){super(...arguments);this.options=[];this.value="";this.placeholder="";this.size="md";this.disabled=!1;this.readonly=!1;this.clearable=!1;this.invalid=!1;this.minChars=1;this.maxItems=0;this.portal=!0;this._matches=[];this._activeIndex=-1;this._open=!1;this._queryToken=0;this._onInput=async e=>{e.stopPropagation();let t=e.target.value??"";this.value=t,this.dispatchEvent(new CustomEvent("input",{detail:{value:t},bubbles:!0,composed:!0})),await this._recompute(t),this._setOpen(this._shouldOpen(t)&&this._matches.length>0)};this._onFocus=async()=>{this.minChars>0&&!this.value||(await this._recompute(this.value),this._setOpen(this._shouldOpen(this.value)&&this._matches.length>0))};this._onKeyDown=e=>{if(e.key==="ArrowDown"||e.key==="ArrowUp"){if(!this._open){this._onFocus();return}e.preventDefault();let t=this._matches.length;if(!t)return;let r=e.key==="ArrowDown"?1:-1,n=this._activeIndex;for(let s=0;s<t&&(n=(n+r+t)%t,!!this._matches[n]?.disabled);s+=1);this._activeIndex=n;return}if(e.key==="Enter"){let t=this._matches[this._activeIndex];this._open&&t&&(e.preventDefault(),this._commit(t));return}if(e.key==="Escape"){this._open&&(e.stopPropagation(),this._setOpen(!1));return}e.key==="Tab"&&this._setOpen(!1)};this._onClear=()=>{this.value="",this._matches=[],this._setOpen(!1)}}connectedCallback(){super.connectedCallback(),this._localeCleanup=ye(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}_t(e,t){let r=Ne(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}get _pool(){return this.options.map(V4)}_defaultFilter(e,t){if(!e)return t;let r=e.toLowerCase();return t.filter(n=>n.label.toLowerCase().includes(r))}async _recompute(e){let t=++this._queryToken,r=this._pool,n=this.filter?await this.filter(e,r):this._defaultFilter(e,r);if(t!==this._queryToken)return;let s=this.maxItems>0?n.slice(0,this.maxItems):n;this._matches=s,this._activeIndex=s.length?0:-1}_shouldOpen(e){return this.disabled||this.readonly?!1:e.length>=this.minChars}_setOpen(e){this._open!==e&&(this._open=e,e?this._popover?.show():this._popover?.hide())}_commit(e){e.disabled||(this.value=e.value,this._setOpen(!1),this.dispatchEvent(new CustomEvent("select",{detail:{value:e.value,option:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value},bubbles:!0,composed:!0})))}_renderLabel(e){let t=this.value.trim();if(!t)return e;let r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:Zn`${e.slice(0,r)}<span class="match"
14362
+ `],a([ur({attribute:!1})],Qe.prototype,"nodes",2),a([ur({attribute:!1})],Qe.prototype,"value",2),a([ur({reflect:!0})],Qe.prototype,"mode",2),a([ur({reflect:!0})],Qe.prototype,"size",2),a([ur()],Qe.prototype,"placeholder",2),a([ur({type:Boolean,reflect:!0})],Qe.prototype,"disabled",2),a([ur({type:Boolean,reflect:!0})],Qe.prototype,"clearable",2),a([ur({type:Boolean,reflect:!0})],Qe.prototype,"invalid",2),a([ur({type:Boolean,reflect:!0})],Qe.prototype,"filterable",2),a([ur({type:Boolean,attribute:"check-strictly"})],Qe.prototype,"checkStrictly",2),a([ur({attribute:!1})],Qe.prototype,"childrenLoader",2),a([ur({type:Boolean,attribute:"close-on-select"})],Qe.prototype,"closeOnSelect",2),a([ur({type:Boolean})],Qe.prototype,"portal",2),a([ur({type:Boolean,reflect:!0,attribute:"open"})],Qe.prototype,"open",2),a([ur({reflect:!0})],Qe.prototype,"locale",2),a([ur({attribute:!1})],Qe.prototype,"translations",2),a([O4()],Qe.prototype,"_keys",2),a([d0("lui-popover")],Qe.prototype,"_popover",2),a([d0("lui-tree")],Qe.prototype,"_tree",2),Qe=a([j4("lui-tree-select")],Qe);import{css as H4,html as Zn,LitElement as R4,nothing as u0}from"lit";import{customElement as I4,property as Fr,query as h0,state as Zd}from"lit/decorators.js";function V4(i){return typeof i=="string"?{label:i,value:i}:i}var Je=class extends R4{constructor(){super(...arguments);this.options=[];this.value="";this.placeholder="";this.size="md";this.disabled=!1;this.readonly=!1;this.clearable=!1;this.invalid=!1;this.minChars=1;this.maxItems=0;this.portal=!0;this._matches=[];this._activeIndex=-1;this._open=!1;this._queryToken=0;this._onInput=async e=>{e.stopPropagation();let t=e.target.value??"";this.value=t,this.dispatchEvent(new CustomEvent("input",{detail:{value:t},bubbles:!0,composed:!0})),await this._recompute(t),this._setOpen(this._shouldOpen(t)&&this._matches.length>0)};this._onFocus=async()=>{this.minChars>0&&!this.value||(await this._recompute(this.value),this._setOpen(this._shouldOpen(this.value)&&this._matches.length>0))};this._onKeyDown=e=>{if(e.key==="ArrowDown"||e.key==="ArrowUp"){if(!this._open){this._onFocus();return}e.preventDefault();let t=this._matches.length;if(!t)return;let r=e.key==="ArrowDown"?1:-1,n=this._activeIndex;for(let s=0;s<t&&(n=(n+r+t)%t,!!this._matches[n]?.disabled);s+=1);this._activeIndex=n;return}if(e.key==="Enter"){let t=this._matches[this._activeIndex];this._open&&t&&(e.preventDefault(),this._commit(t));return}if(e.key==="Escape"){this._open&&(e.stopPropagation(),this._setOpen(!1));return}e.key==="Tab"&&this._setOpen(!1)};this._onClear=()=>{this.value="",this._matches=[],this._setOpen(!1)}}connectedCallback(){super.connectedCallback(),this._localeCleanup=ye(()=>this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._localeCleanup?.(),this._localeCleanup=void 0}_t(e,t){let r=Ne(this,this.locale,this.translations);return ne(ie(r.locale,r.translations),e,t)}get _pool(){return this.options.map(V4)}_defaultFilter(e,t){if(!e)return t;let r=e.toLowerCase();return t.filter(n=>n.label.toLowerCase().includes(r))}async _recompute(e){let t=++this._queryToken,r=this._pool,n=this.filter?await this.filter(e,r):this._defaultFilter(e,r);if(t!==this._queryToken)return;let s=this.maxItems>0?n.slice(0,this.maxItems):n;this._matches=s,this._activeIndex=s.length?0:-1}_shouldOpen(e){return this.disabled||this.readonly?!1:e.length>=this.minChars}_setOpen(e){this._open!==e&&(this._open=e,e?this._popover?.show():this._popover?.hide())}_commit(e){e.disabled||(this.value=e.value,this._setOpen(!1),this.dispatchEvent(new CustomEvent("select",{detail:{value:e.value,option:e},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("change",{detail:{value:e.value},bubbles:!0,composed:!0})))}_renderLabel(e){let t=this.value.trim();if(!t)return e;let r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?e:Zn`${e.slice(0,r)}<span class="match"
14363
14363
  >${e.slice(r,r+t.length)}</span
14364
14364
  >${e.slice(r+t.length)}`}render(){let t=F(this,"autocomplete").size??this.size;return Zn`
14365
14365
  <lui-popover
@@ -14467,7 +14467,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
14467
14467
  font-size: var(--lui-font-size-sm);
14468
14468
  text-align: center;
14469
14469
  }
14470
- `],a([Dr({attribute:!1})],Je.prototype,"options",2),a([Dr()],Je.prototype,"value",2),a([Dr()],Je.prototype,"placeholder",2),a([Dr({reflect:!0})],Je.prototype,"size",2),a([Dr({type:Boolean,reflect:!0})],Je.prototype,"disabled",2),a([Dr({type:Boolean,reflect:!0})],Je.prototype,"readonly",2),a([Dr({type:Boolean,reflect:!0})],Je.prototype,"clearable",2),a([Dr({type:Boolean,reflect:!0})],Je.prototype,"invalid",2),a([Dr({type:Number,attribute:"min-chars"})],Je.prototype,"minChars",2),a([Dr({type:Number,attribute:"max-items"})],Je.prototype,"maxItems",2),a([Dr({attribute:!1})],Je.prototype,"filter",2),a([Dr({type:Boolean})],Je.prototype,"portal",2),a([Dr({reflect:!0})],Je.prototype,"locale",2),a([Dr({attribute:!1})],Je.prototype,"translations",2),a([Zd()],Je.prototype,"_matches",2),a([Zd()],Je.prototype,"_activeIndex",2),a([Zd()],Je.prototype,"_open",2),a([h0("lui-popover")],Je.prototype,"_popover",2),a([h0("lui-input")],Je.prototype,"_input",2),Je=a([I4("lui-autocomplete")],Je);var Qd=da(_n(),1);import{css as D4,html as p0,LitElement as F4,nothing as N4}from"lit";import{customElement as L4,property as Qn,query as m0,state as B4}from"lit/decorators.js";var $r=class extends F4{constructor(){super(...arguments);this.orientation="horizontal";this.percent=50;this.minFirst=80;this.minSecond=80;this.disabled=!1;this.noGrip=!1;this._dragging=!1;this._interact=null;this._origin={total:0,percent:50};this._onKeyDown=e=>{if(this.disabled)return;let t=this._isHorizontal?"ArrowLeft":"ArrowUp",r=this._isHorizontal?"ArrowRight":"ArrowDown",n=null;if(e.key===t?n=this.percent-(e.shiftKey?10:2):e.key===r?n=this.percent+(e.shiftKey?10:2):e.key==="Home"?n=0:e.key==="End"&&(n=100),n===null)return;e.preventDefault();let s=this._root?.getBoundingClientRect(),d=(this._isHorizontal?s?.width:s?.height)??0,h=this._clampPercent(n,d);h!==this.percent&&(this.percent=h,this._emit("resize"),this._emit("change"))}}disconnectedCallback(){super.disconnectedCallback(),this._teardown()}firstUpdated(){this._setup()}updated(e){(e.has("disabled")||e.has("orientation"))&&(this._teardown(),this._setup())}get _isHorizontal(){return this.orientation!=="vertical"}_pxMin(e,t){let r=mt(e);if(r.endsWith("%")){let s=Number.parseFloat(r)/100;return Number.isFinite(s)?t*s:0}let n=Number.parseFloat(r);return Number.isFinite(n)?n:0}_clampPercent(e,t){if(t<=0)return Math.min(100,Math.max(0,e));let r=this._gutter?.getBoundingClientRect(),n=(this._isHorizontal?r?.width:r?.height)??0,s=Math.max(0,t-n),d=this._pxMin(this.minFirst,s),h=this._pxMin(this.minSecond,s);if(d+h>=s)return 50;let p=d/s*100,f=100-h/s*100;return Math.min(f,Math.max(p,e))}_setup(){let e=this._gutter;!e||this.disabled||(this._interact=(0,Qd.default)(e).draggable({inertia:!1,modifiers:[Qd.default.modifiers.restrict({restriction:"parent"})],listeners:{start:()=>{let t=this._root?.getBoundingClientRect();this._origin={total:(this._isHorizontal?t?.width:t?.height)??0,percent:this.percent},this._dragging=!0,this.toggleAttribute("data-dragging",!0)},move:t=>{let{total:r}=this._origin;if(r<=0)return;let n=this._isHorizontal?t.dx:t.dy,s=this._clampPercent(this.percent+n/r*100,r);s!==this.percent&&(this.percent=s,this._emit("resize"))},end:()=>{this._dragging=!1,this.toggleAttribute("data-dragging",!1),this._emit("change")}}}))}_teardown(){this._interact?.unset(),this._interact=null,this.toggleAttribute("data-dragging",!1)}_emit(e){let t=this._root?.getBoundingClientRect(),r=(this._isHorizontal?t?.width:t?.height)??0;this.dispatchEvent(new CustomEvent(e,{detail:{percent:this.percent,size:r*this.percent/100},bubbles:!0,composed:!0}))}render(){let t=F(this,"splitter").orientation??this.orientation;return p0`
14470
+ `],a([Fr({attribute:!1})],Je.prototype,"options",2),a([Fr()],Je.prototype,"value",2),a([Fr()],Je.prototype,"placeholder",2),a([Fr({reflect:!0})],Je.prototype,"size",2),a([Fr({type:Boolean,reflect:!0})],Je.prototype,"disabled",2),a([Fr({type:Boolean,reflect:!0})],Je.prototype,"readonly",2),a([Fr({type:Boolean,reflect:!0})],Je.prototype,"clearable",2),a([Fr({type:Boolean,reflect:!0})],Je.prototype,"invalid",2),a([Fr({type:Number,attribute:"min-chars"})],Je.prototype,"minChars",2),a([Fr({type:Number,attribute:"max-items"})],Je.prototype,"maxItems",2),a([Fr({attribute:!1})],Je.prototype,"filter",2),a([Fr({type:Boolean})],Je.prototype,"portal",2),a([Fr({reflect:!0})],Je.prototype,"locale",2),a([Fr({attribute:!1})],Je.prototype,"translations",2),a([Zd()],Je.prototype,"_matches",2),a([Zd()],Je.prototype,"_activeIndex",2),a([Zd()],Je.prototype,"_open",2),a([h0("lui-popover")],Je.prototype,"_popover",2),a([h0("lui-input")],Je.prototype,"_input",2),Je=a([I4("lui-autocomplete")],Je);var Qd=da(_n(),1);import{css as D4,html as p0,LitElement as F4,nothing as N4}from"lit";import{customElement as L4,property as Qn,query as m0,state as B4}from"lit/decorators.js";var $r=class extends F4{constructor(){super(...arguments);this.orientation="horizontal";this.percent=50;this.minFirst=80;this.minSecond=80;this.disabled=!1;this.noGrip=!1;this._dragging=!1;this._interact=null;this._origin={total:0,percent:50};this._onKeyDown=e=>{if(this.disabled)return;let t=this._isHorizontal?"ArrowLeft":"ArrowUp",r=this._isHorizontal?"ArrowRight":"ArrowDown",n=null;if(e.key===t?n=this.percent-(e.shiftKey?10:2):e.key===r?n=this.percent+(e.shiftKey?10:2):e.key==="Home"?n=0:e.key==="End"&&(n=100),n===null)return;e.preventDefault();let s=this._root?.getBoundingClientRect(),d=(this._isHorizontal?s?.width:s?.height)??0,h=this._clampPercent(n,d);h!==this.percent&&(this.percent=h,this._emit("resize"),this._emit("change"))}}disconnectedCallback(){super.disconnectedCallback(),this._teardown()}firstUpdated(){this._setup()}updated(e){(e.has("disabled")||e.has("orientation"))&&(this._teardown(),this._setup())}get _isHorizontal(){return this.orientation!=="vertical"}_pxMin(e,t){let r=mt(e);if(r.endsWith("%")){let s=Number.parseFloat(r)/100;return Number.isFinite(s)?t*s:0}let n=Number.parseFloat(r);return Number.isFinite(n)?n:0}_clampPercent(e,t){if(t<=0)return Math.min(100,Math.max(0,e));let r=this._gutter?.getBoundingClientRect(),n=(this._isHorizontal?r?.width:r?.height)??0,s=Math.max(0,t-n),d=this._pxMin(this.minFirst,s),h=this._pxMin(this.minSecond,s);if(d+h>=s)return 50;let p=d/s*100,f=100-h/s*100;return Math.min(f,Math.max(p,e))}_setup(){let e=this._gutter;!e||this.disabled||(this._interact=(0,Qd.default)(e).draggable({inertia:!1,modifiers:[Qd.default.modifiers.restrict({restriction:"parent"})],listeners:{start:()=>{let t=this._root?.getBoundingClientRect();this._origin={total:(this._isHorizontal?t?.width:t?.height)??0,percent:this.percent},this._dragging=!0,this.toggleAttribute("data-dragging",!0)},move:t=>{let{total:r}=this._origin;if(r<=0)return;let n=this._isHorizontal?t.dx:t.dy,s=this._clampPercent(this.percent+n/r*100,r);s!==this.percent&&(this.percent=s,this._emit("resize"))},end:()=>{this._dragging=!1,this.toggleAttribute("data-dragging",!1),this._emit("change")}}}))}_teardown(){this._interact?.unset(),this._interact=null,this.toggleAttribute("data-dragging",!1)}_emit(e){let t=this._root?.getBoundingClientRect(),r=(this._isHorizontal?t?.width:t?.height)??0;this.dispatchEvent(new CustomEvent(e,{detail:{percent:this.percent,size:r*this.percent/100},bubbles:!0,composed:!0}))}render(){let t=F(this,"splitter").orientation??this.orientation;return p0`
14471
14471
  <div class="root" style=${`--lui-splitter-first:${this.percent}%;`}>
14472
14472
  <div part="pane first"><slot name="first"></slot></div>
14473
14473
  <div
@@ -14896,7 +14896,7 @@ var K2=Object.create;var fs=Object.defineProperty;var ch=Object.getOwnPropertyDe
14896
14896
  @keyframes lui-dialog-loading-spin {
14897
14897
  to { transform: rotate(360deg); }
14898
14898
  }
14899
- `,document.head.appendChild(r)}return o}function F5(i){let o=typeof i=="string"?{message:i}:i,e=cu({title:o.title??Jn("dialog.loading_title","\u8BF7\u7A0D\u5019"),message:void 0,noClose:o.noClose??!0,closeOnOutsidePress:o.closeOnOutsidePress??!1,shakeOnOutsideClick:o.shakeOnOutsideClick,placement:o.placement,offset:o.offset,backdrop:o.backdrop,backdropStyle:o.backdropStyle,backdropContent:o.backdropContent,noHeader:o.noHeader,noFooter:o.noFooter,draggable:o.draggable,destroyOnClose:o.destroyOnClose,fullscreen:o.fullscreen,width:o.width,portal:o.portal,overlayLayer:o.overlayLayer,container:o.container}),t=D5(o.message??Jn("dialog.loading_message","\u5904\u7406\u4E2D..."));return e.appendChild(t),e.show(),{close:()=>du(e),update(r){let n=typeof r=="string"?{message:r}:r;n.title!=null&&(e.title=n.title,e.requestUpdate());let s=t.querySelector('[data-role="message"]');n.message!=null&&s&&(s.textContent=n.message)}}}function N5(){[...Al].forEach(i=>i.close?.())}var L5={create:ts,open:uu,alert:R5,confirm:I5,prompt:V5,loading:F5,closeAll:N5};function x0(i,o){let e=po();return ne(ie(e.locale,e.translations),i,o)}function w0(i,o="default"){let e=document.createElement("lui-button");return oe(e,pt("button")),e.slot="footer",e.variant=o,e.textContent=i,e}function pu(i){return{...i,source:i.source?[...i.source]:void 0,fields:i.fields?i.fields.map(pu):void 0,condition:i.condition?{...i.condition}:void 0}}function B5(i){return{...i,fields:i.fields.map(pu)}}function jl(i,o){return{...i,fields:i.fields?i.fields.map(pu):void 0,steps:i.steps?i.steps.map(B5):void 0,defaultValues:i.defaultValues?{...i.defaultValues}:void 0,onSubmit:o??i.onSubmit}}function mu(i){let o="schema"in i?i.schema:i,e=document.createElement("lui-form");oe(e,pt("form")),e.schema=jl(o);let t=!1;return{el:e,get mounted(){return t&&e.isConnected},get visible(){return!e.hidden},mount(n){return n&&!e.isConnected&&(n.appendChild(e),t=!0),this},unmount(){return e.isConnected&&e.remove(),t=!1,this},show(){return e.hidden=!1,this},hide(){return e.hidden=!0,this},update(n){let s=e.schema??jl(o);return e.schema=jl({...s,...n,onSubmit:n.onSubmit??s.onSubmit}),this},destroy(){this.unmount()},submit(){return Promise.resolve(e.submit())},validate(){return e.validate()},reset(n){e.reset(n)},getValues(){return e.getValues()},setValues(n){e.setValues(n)},getValue(n){return e.getValue(n)},setValue(n,s){e.setValue(n,s)},focusField(n){return e.focusField(n)},scrollToField(n){return e.scrollToField(n)}}}var q5=mu;function _0(i){let o=i.schema.onSubmit,e=jl(i.schema,async x=>{await o?.(x),h(x)}),t=mu(e),r,n=!1,s=new Promise(x=>{r=x}),d=ts({...i,content:t.el,showCancel:!1}),h=x=>{n||(n=!0,r(x),d.destroy())},p=!!e.steps?.length;if(t.el.showActions=p,!p){let x=w0(i.cancelText??e.cancelLabel??x0("common.cancel","\u53D6\u6D88")),k=w0(i.submitText??e.submitLabel??x0("common.submit","\u63D0\u4EA4"),"primary");x.addEventListener("click",()=>h(null),{once:!0}),k.addEventListener("click",()=>t.submit(),{once:!1}),d.el.append(x,k)}return d.el.addEventListener("close",x=>{x.target===d.el&&h(null)}),{el:d.el,form:t,submit(){return t.submit()},validate(){return t.validate()},reset(x){t.reset(x)},getValues(){return t.getValues()},setValues(x){t.setValues(x)},getValue(x){return t.getValue(x)},setValue(x,k){t.setValue(x,k)},focusField(x){return t.focusField(x)},scrollToField(x){return t.scrollToField(x)},get mounted(){return d.mounted},get visible(){return d.visible},get closed(){return s},mount(x){return d.mount(x),this},unmount(){return d.unmount(),this},show(){return d.show(),this},hide(){return d.hide(),this},close(x){h(x??null)},update(x){return d.update(x),this},destroy(){d.destroy()}}}function hu(i){let o=_0(i);return o.show(),o}function K5(i){return"onSubmit"in i?hu({schema:i}):hu(i)}var W5={create:mu,open:hu,prompt:K5};function U5(){let i=document.createElement("lui-context-menu");return oe(i,pt("contextMenu")),i.trigger="manual",i}function gu(i,o){i.heading=o.heading??"",i.headingIcon=o.headingIcon??"",i.placement=o.placement??"bottom-start","items"in o&&o.items!==void 0&&(i.items=o.items),i.closeOnSelect=o.closeOnSelect??!0,i.closeOnOutsidePress=o.closeOnOutsidePress??!0,i.closeOnEscape=o.closeOnEscape??!0,i.submenuTrigger=o.submenuTrigger??"hover",i.backdrop=o.backdrop??"none",i.backdropStyle=o.backdropStyle??""}function Ol(i={}){let o=U5(),e=null,t=!1,r=s=>{e&&(o.removeEventListener("select",e),e=null),s&&(e=d=>{s(d.detail)},o.addEventListener("select",e))},n={el:o,get mounted(){return t&&o.isConnected},get visible(){return o.open},mount(s){if(o.isConnected)return this;let d=Qt("menu",s??i.container??Go()??Uo());return d.appendChild(o),Et(o,d,"menu"),t=!0,this},unmount(){return o.isConnected&&o.remove(),t=!1,this},show(s){o.isConnected||this.mount();let d={...i,...s};gu(o,d),st(o),r(d.onSelect),o.showAt(d.x,d.y,{items:d.items,context:d.context,triggerEvent:d.triggerEvent,source:d.source??"api"})},hide(){return o.hide(),this},update(s){return Object.assign(i,s),gu(o,{x:0,y:0,...i}),this},destroy(){r(void 0),o.hide(),this.unmount()}};return(i.items||i.heading||i.headingIcon||i.placement)&&gu(o,{x:0,y:0,...i}),n}var an=null,M0=new WeakMap;function C0(i){if(i.container){let o=M0.get(i.container);return(!o||!o.el.isConnected)&&(o=Ol({container:i.container}),M0.set(i.container,o)),o.show(i),o}return(!an||!an.el.isConnected)&&(an=Ol()),an.show(i),an}function z0(){document.querySelectorAll("lui-context-menu").forEach(i=>{i.hide?.()})}function G5(){an?.destroy(),an=null,document.querySelectorAll("lui-context-menu").forEach(i=>{i.hide?.(),i.remove()})}var Y5={create:Ol,show:C0,hideAll:z0,destroyAll:G5};function rs(i,o,e){if(e==null)return;let t=typeof e=="function"?e():e;if(typeof t=="string"){let n=document.createElement("div");n.slot=o,n.textContent=t,i.appendChild(n);return}if(t instanceof DocumentFragment){let n=document.createElement("div");n.slot=o,n.appendChild(t),i.appendChild(n);return}if(t instanceof HTMLElement||t instanceof SVGElement){t.setAttribute("slot",o),i.appendChild(t);return}let r=document.createElement("div");r.slot=o,r.appendChild(t),i.appendChild(r)}function X5(i){let o=document.createElement("lui-popover");return oe(o,pt("popover")),i.trigger!=null&&(o.trigger=i.trigger),i.placement!=null&&(o.placement=i.placement),i.disabled!=null&&(o.disabled=i.disabled),i.interactive!=null&&(o.interactive=i.interactive),i.showArrow!=null&&(o.showArrow=i.showArrow),i.closeOnOutsidePress!=null&&(o.closeOnOutsidePress=i.closeOnOutsidePress),i.closeOnEsc!=null&&(o.closeOnEsc=i.closeOnEsc),i.openDelay!=null&&(o.openDelay=i.openDelay),i.closeDelay!=null&&(o.closeDelay=i.closeDelay),i.offsetDistance!=null&&(o.offsetDistance=i.offsetDistance),i.autoFlip!=null&&(o.autoFlip=i.autoFlip),i.autoShift!=null&&(o.autoShift=i.autoShift),i.sameWidth!=null&&(o.sameWidth=i.sameWidth),i.maxWidth!=null&&(o.maxWidth=i.maxWidth),i.maxHeight!=null&&(o.maxHeight=i.maxHeight),i.backdrop!=null&&(o.backdrop=i.backdrop),i.backdropStyle!=null&&(o.backdropStyle=i.backdropStyle),i.portal!=null&&(o.portal=i.portal),i.overlayLayer!=null&&(o.overlayLayer=i.overlayLayer),i.container!=null&&(o.container=i.container),rs(o,"trigger",i.triggerContent),rs(o,"header",i.header),rs(o,"content",i.content),rs(o,"footer",i.footer),rs(o,"backdrop",i.backdropContent),o}function fu(i={}){let o=X5(i),e=!1,t=!1,r,n=new Promise(h=>{r=h}),s=()=>{t||(t=!0,r({action:"close"}))};return o.addEventListener("close",h=>{h.target===o&&s()}),{el:o,get mounted(){return e&&o.isConnected},get visible(){return o.open},get closed(){return n},mount(h){return o.isConnected?this:((h??document.body).appendChild(o),e=!0,this)},unmount(){return o.isConnected&&o.remove(),e=!1,this},show(){return o.isConnected||this.mount(),o.portal&&o._portalHost&&st(o._portalHost),o.show(),this},hide(){return o.hide(),this},close(){o.hide(),s()},update(h){return Object.assign(o,h),this},destroy(){t||s(),this.unmount()}}}function Z5(i={}){let o=fu({...i,trigger:"manual"});return o.show(),o}function Q5(){document.querySelectorAll("lui-popover").forEach(i=>{i.hide?.()})}function J5(){document.querySelectorAll("lui-popover").forEach(i=>{i.hide?.(),i.remove()})}var ex={create:fu,open:Z5,closeAll:Q5,destroyAll:J5};var no=new Map;function tx(){return Qt("toast",Go()??Uo())}function $0(i){let o=pt("toast"),e=typeof o.position=="string"?o.position:void 0;return i??e??"top-right"}function vu(i){let o=po();i.locale=o.locale,i.translations=o.translations,oe(i,pt("toast"))}function Rl(){for(let[i,o]of no)o?.isConnected||no.delete(i)}function rx(i){let o=no.get(i);o&&(no.delete(i),o.isConnected&&o.remove())}function ox(i,o,e,t,r,n){Rl();let s=$0(i),d=no.get(s);if(d?.isConnected)return vu(d),st(d),d.position=s,typeof o=="number"&&(d.max=o),typeof e=="string"&&(d.radius=e),typeof t=="boolean"&&(d.stacked=t),typeof r=="number"&&(d.stackMaxVisible=r),typeof n=="number"&&(d.stackGap=n),d;let h=document.createElement("lui-toast");h.listen=!1,vu(h),h.position=s,typeof o=="number"&&(h.max=o),typeof e=="string"&&(h.radius=e),typeof t=="boolean"&&(h.stacked=t),typeof r=="number"&&(h.stackMaxVisible=r),typeof n=="number"&&(h.stackGap=n),h.addEventListener("empty",()=>rx(s));let p=tx();return p.appendChild(h),Et(h,p,"toast"),no.set(s,h),h}function T0(i={}){let o=!1,e=null,t=r=>{if(e?.isConnected)return e;let n=$0(i.position);e=document.createElement("lui-toast"),e.listen=!1,vu(e),e.position=n,typeof i.max=="number"&&(e.max=i.max),typeof i.radius=="string"&&(e.radius=i.radius),typeof i.stacked=="boolean"&&(e.stacked=i.stacked),typeof i.stackMaxVisible=="number"&&(e.stackMaxVisible=i.stackMaxVisible),typeof i.stackGap=="number"&&(e.stackGap=i.stackGap);let s=Qt("toast",r??Go()??Uo());return s.appendChild(e),Et(e,s,"toast"),o=!0,e};return{get el(){return t()},get mounted(){return o&&!!e?.isConnected},get visible(){return!!e?.isConnected},mount(r){return t(r),this},unmount(){return e?.isConnected&&e.remove(),o=!1,this},show(r){let n=typeof r=="string"?{message:r}:r;return t().show({level:n.level??i.level,message:n.message,duration:n.duration??i.duration,radius:n.radius??i.radius,pauseOnHover:n.pauseOnHover??i.pauseOnHover,showProgress:n.showProgress??i.showProgress,action:n.action,delay:n.delay,stacked:n.stacked??i.stacked,stackMaxVisible:n.stackMaxVisible??i.stackMaxVisible,stackGap:n.stackGap??i.stackGap})},hide(){return e?.clear(),this},update(r){return Object.assign(i,r),e&&(typeof i.max=="number"&&(e.max=i.max),typeof i.radius=="string"&&(e.radius=i.radius),typeof i.stacked=="boolean"&&(e.stacked=i.stacked),typeof i.stackMaxVisible=="number"&&(e.stackMaxVisible=i.stackMaxVisible),typeof i.stackGap=="number"&&(e.stackGap=i.stackGap)),this},destroy(){this.unmount()},close(r){return e?e.close(r):!1},updateToast(r,n){if(!e)return!1;let s=typeof n=="string"?{message:n}:n;return e.updateToast(r,s)},clear(){e?.clear()}}}function ix(){Rl();for(let i of no.values())i.clear()}function bu(i){let o=typeof i=="string"?{message:i}:i;return ox(o.position,o.max,o.radius,o.stacked,o.stackMaxVisible,o.stackGap).show({level:o.level,message:o.message,duration:o.duration,radius:o.radius,pauseOnHover:o.pauseOnHover,showProgress:o.showProgress,action:o.action,delay:o.delay,stacked:o.stacked,stackMaxVisible:o.stackMaxVisible,stackGap:o.stackGap})}function E0(i){Rl();for(let o of no.values())if(o.has(i))return o;return null}function Hl(i,o,e){let t=typeof o=="string"?{message:o,duration:e}:o;return bu({...t,level:i,duration:t.duration??e})}function S0(i,o,e){return i==null?{message:o}:typeof i=="string"?{message:i}:typeof i=="function"?{message:i(e)}:i}var Ai={create:T0,show:bu,clearAll:ix,close(i){let o=E0(i);return o?o.close(i):!1},update(i,o){let e=E0(i);if(!e)return!1;let t=typeof o=="string"?{message:o}:o;return e.updateToast(i,t)},loading(i){let o=typeof i=="string"?{message:i}:i,e=bu({level:o.level??"info",message:o.message,duration:0,position:o.position,max:o.max,pauseOnHover:o.pauseOnHover,showProgress:o.showProgress??!1,action:o.action,delay:o.delay,stacked:o.stacked,stackMaxVisible:o.stackMaxVisible,stackGap:o.stackGap});return{id:e,close:()=>Ai.close(e),update:t=>{let r=typeof t=="string"?{message:t}:t;return Ai.update(e,r)},info:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"info",duration:2500,...r})},warning:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"warning",duration:3e3,...r})},success:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"success",duration:2500,...r})},error:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"error",duration:3500,...r})}}},async promise(i,o){let e=Ai.loading(o.loading);try{let t=await(typeof i=="function"?i():i),r=S0(o.success,"Completed successfully",t);return(o.successStrategy??(o.closeOnSuccess?"close":"update"))==="close"?e.close():e.update({level:"success",duration:o.successDuration??2500,...r}),t}catch(t){let r=S0(o.error,t instanceof Error?t.message:"Something went wrong",t);throw(o.errorStrategy??(o.closeOnError?"close":"update"))==="close"?e.close():e.update({level:"error",duration:o.errorDuration??3500,...r}),t}},closeAll(i){if(Rl(),i){let o=no.get(i);if(!o?.isConnected){no.delete(i);return}o.clear();return}for(let[o,e]of no){if(!e?.isConnected){no.delete(o);continue}e.clear()}},info(i,o){return Hl("info",i,o)},success(i,o){return Hl("success",i,o)},warning(i,o){return Hl("warning",i,o)},error(i,o){return Hl("error",i,o)}};function yu(i,o){o.columns!=null&&(i.columns=o.columns),o.data!=null&&(i.data=o.data),o.dataSource!=null&&(i.dataSource=o.dataSource),o.source!=null&&(i.source=o.source),o.rowKey!=null&&(i.rowKey=o.rowKey),o.size!=null&&(i.size=o.size),o.selection!=null&&(i.selection=o.selection),o.selectedRowKeys!=null&&(i.selectedRowKeys=[...o.selectedRowKeys]),o.bordered!=null&&(i.bordered=o.bordered),o.border!=null&&(i.border=o.border),o.noBorder!=null&&(i.noBorder=o.noBorder),o.striped!=null&&(i.striped=o.striped),o.hoverable!=null&&(i.hoverable=o.hoverable),o.stickyHeader!=null&&(i.stickyHeader=o.stickyHeader),o.showHeader!=null&&(i.showHeader=o.showHeader),o.columnResizable!=null&&(i.columnResizable=o.columnResizable),o.columnReorderable!=null&&(i.columnReorderable=o.columnReorderable),o.loading!=null&&(i.loading=o.loading),o.virtual!=null&&(i.virtual=o.virtual),o.virtualHeight!=null&&(i.virtualHeight=o.virtualHeight),o.rowHeight!=null&&(i.rowHeight=o.rowHeight),o.overscan!=null&&(i.overscan=o.overscan),o.pagination!=null&&(i.pagination=o.pagination),o.current!=null&&(i.current=o.current),o.pageSize!=null&&(i.pageSize=o.pageSize),o.total!=null&&(i.total=o.total),o.showSizeChanger!=null&&(i.showSizeChanger=o.showSizeChanger),o.emptyText!=null&&(i.emptyText=o.emptyText),o.sortKey!=null&&(i.sortKey=o.sortKey),o.sortOrder!=null&&(i.sortOrder=o.sortOrder),o.rowClickable!=null&&(i.rowClickable=o.rowClickable),o.selectOnClick!=null&&(i.selectOnClick=o.selectOnClick),o.rowAnimation!=null&&(i.rowAnimation=o.rowAnimation),o.onRow!=null&&(i.onRow=o.onRow),o.onCell!=null&&(i.onCell=o.onCell),o.onHeaderRow!=null&&(i.onHeaderRow=o.onHeaderRow),o.onHeaderCell!=null&&(i.onHeaderCell=o.onHeaderCell)}function A0(i={}){let o=document.createElement("lui-table");oe(o,pt("table")),yu(o,i);let e=!1;return{el:o,get mounted(){return e&&o.isConnected},get visible(){return!o.hidden},mount(r){return r&&!o.isConnected&&(r.appendChild(o),e=!0),this},unmount(){return o.isConnected&&o.remove(),e=!1,this},show(){return o.hidden=!1,this},hide(){return o.hidden=!0,this},update(r){return yu(o,r),this},destroy(){this.unmount()},setData(r){return o.dataSource=r,this},setColumns(r){return o.columns=r,this},getData(){return o.dataSource??o.source??o.data??[]},getColumns(){return o.columns??[]},setLoading(r){return o.loading=r,this},getSelectedRowKeys(){return[...o.selectedRowKeys??[]]},setSelectedRowKeys(r){return o.selectedRowKeys=[...r],this},setSelection(r,n=o.selectedRowKeys??[]){return o.selection=r,o.selectedRowKeys=[...n],this},setPagination(r){return yu(o,r),this}}}var nx={create:A0};export{q1 as BP,Xt as LuiAlert,Je as LuiAutocomplete,ut as LuiAvatar,At as LuiAvatarGroup,Ue as LuiBackground,Tt as LuiBadge,Ct as LuiBreadcrumb,Wt as LuiBreadcrumbItem,xt as LuiButton,Re as LuiButtonGroup,wt as LuiButtonGroupItem,lr as LuiCalendar,ft as LuiCard,Ze as LuiCascader,_t as LuiCheckbox,Ut as LuiCheckboxGroup,Rr as LuiCol,Kr as LuiCollapse,yr as LuiCollapseItem,qe as LuiColorPicker,Ot as LuiCommandPalette,Ft as LuiConfigProvider,Ae as LuiContextMenu,Gr as LuiDateRangePicker,at as LuiDatepicker,xe as LuiDialog,ir as LuiDivider,Ke as LuiDrawer,bi as LuiDropdown,Me as LuiDropmenu,Qr as LuiEmptyState,Wr as LuiFileInput,kt as LuiForm,jt as LuiFormItem,Ee as LuiIcon,Ce as LuiIconPicker,Pe as LuiImage,nt as LuiImageCropper,$e as LuiInput,yt as LuiInputNumber,ar as LuiInputOpt,vo as LuiMenu,bn as LuiMenuDivider,St as LuiMenuItem,jo as LuiOption,Ni as LuiOptionGroup,_a as LuiOverlayRoot,Ie as LuiPagination,it as LuiPopconfirm,ee as LuiPopover,zt as LuiProgress,Lt as LuiQrcode,Gt as LuiRadio,sr as LuiRadioGroup,zo as LuiRow,bt as LuiScrollArea,me as LuiSelect,tr as LuiSkeleton,Xe as LuiSlider,Nr as LuiSpinner,$r as LuiSplitter,dt as LuiStatistic,Ir as LuiSwitch,vt as LuiTab,qr as LuiTabPanel,U as LuiTable,qt as LuiTableColumn,ja as LuiTabs,jr as LuiTag,Ve as LuiText,Ye as LuiTextarea,Ht as LuiToast,fr as LuiTooltip,se as LuiTree,Qe as LuiTreeSelect,O as baseStyles,st as bringOverlayStackToFront,bc as builtinIconCollection,zs as builtinIconNames,pn as builtinIconPrefix,Tp as builtinTranslations,x5 as commandPalette,Y5 as contextMenu,su as createCommandPalette,Ol as createContextMenu,ts as createDialog,_0 as createDialogForm,lu as createDrawer,q5 as createForm,fu as createPopover,A0 as createTable,T0 as createToastHost,L5 as dialog,P5 as drawer,iu as encodeQr,Qt as ensureOverlayExternalLayer,zc as ensureOverlayLayer,Cc as ensureOverlayRoot,fn as eventPathContainsOwnedOverlay,W5 as form,Hx as formatDate,Ox as formatSize,Q3 as getLocale,Rs as hasRecentOverlayInteraction,z0 as hideAllContextMenus,yc as isImageIconSource,Is as isOverlayTopmost,Hs as markOverlayInteraction,ie as mergeTranslations,Yn as normalizeStatus,ye as onLocaleChange,ex as popover,Ak as registerFormField,Et as registerOverlayStack,Pp as registerTranslations,ya as resolveBuiltinIcon,Rf as resolveBuiltinTranslations,vn as resolveOverlayLayerRegistration,Ap as setLocale,pp as setOverlayOwner,Es as setupBuiltinIcons,C0 as showContextMenu,h4 as statusColorToken,CE as statusColorVar,ai as statusIcon,zE as statusOrder,J3 as t,nx as table,mt as toCssLength,Ai as toast,A as tokens,ne as translate,Pk as unregisterFormField,fo as unregisterOverlayStack};
14899
+ `,document.head.appendChild(r)}return o}function F5(i){let o=typeof i=="string"?{message:i}:i,e=cu({title:o.title??Jn("dialog.loading_title","\u8BF7\u7A0D\u5019"),message:void 0,noClose:o.noClose??!0,closeOnOutsidePress:o.closeOnOutsidePress??!1,shakeOnOutsideClick:o.shakeOnOutsideClick,placement:o.placement,offset:o.offset,backdrop:o.backdrop,backdropStyle:o.backdropStyle,backdropContent:o.backdropContent,noHeader:o.noHeader,noFooter:o.noFooter,draggable:o.draggable,destroyOnClose:o.destroyOnClose,fullscreen:o.fullscreen,width:o.width,portal:o.portal,overlayLayer:o.overlayLayer,container:o.container}),t=D5(o.message??Jn("dialog.loading_message","\u5904\u7406\u4E2D..."));return e.appendChild(t),e.show(),{close:()=>du(e),update(r){let n=typeof r=="string"?{message:r}:r;n.title!=null&&(e.title=n.title,e.requestUpdate());let s=t.querySelector('[data-role="message"]');n.message!=null&&s&&(s.textContent=n.message)}}}function N5(){[...Al].forEach(i=>i.close?.())}var L5={create:ts,open:uu,alert:R5,confirm:I5,prompt:V5,loading:F5,closeAll:N5};function x0(i,o){let e=po();return ne(ie(e.locale,e.translations),i,o)}function w0(i,o="default"){let e=document.createElement("lui-button");return oe(e,pt("button")),e.slot="footer",e.variant=o,e.textContent=i,e}function pu(i){return{...i,source:i.source?[...i.source]:void 0,fields:i.fields?i.fields.map(pu):void 0,condition:i.condition?{...i.condition}:void 0}}function B5(i){return{...i,fields:i.fields.map(pu)}}function jl(i,o){return{...i,fields:i.fields?i.fields.map(pu):void 0,steps:i.steps?i.steps.map(B5):void 0,defaultValues:i.defaultValues?{...i.defaultValues}:void 0,onSubmit:o??i.onSubmit}}function mu(i){let o="schema"in i?i.schema:i,e=document.createElement("lui-form");oe(e,pt("form")),e.schema=jl(o);let t=!1;return{el:e,get mounted(){return t&&e.isConnected},get visible(){return!e.hidden},mount(n){return n&&!e.isConnected&&(n.appendChild(e),t=!0),this},unmount(){return e.isConnected&&e.remove(),t=!1,this},show(){return e.hidden=!1,this},hide(){return e.hidden=!0,this},update(n){let s=e.schema??jl(o);return e.schema=jl({...s,...n,onSubmit:n.onSubmit??s.onSubmit}),this},destroy(){this.unmount()},submit(){return Promise.resolve(e.submit())},validate(){return e.validate()},reset(n){e.reset(n)},getValues(){return e.getValues()},setValues(n){e.setValues(n)},getValue(n){return e.getValue(n)},setValue(n,s){e.setValue(n,s)},focusField(n){return e.focusField(n)},scrollToField(n){return e.scrollToField(n)}}}var q5=mu;function _0(i){let o=i.schema.onSubmit,e=jl(i.schema,async x=>{await o?.(x),h(x)}),t=mu(e),r,n=!1,s=new Promise(x=>{r=x}),d=ts({...i,content:t.el,showCancel:!1}),h=x=>{n||(n=!0,r(x),d.destroy())},p=!!e.steps?.length;if(t.el.showActions=p,!p){let x=w0(i.cancelText??e.cancelLabel??x0("common.cancel","\u53D6\u6D88")),k=w0(i.submitText??e.submitLabel??x0("common.submit","\u63D0\u4EA4"),"primary");x.addEventListener("click",()=>h(null),{once:!0}),k.addEventListener("click",()=>t.submit(),{once:!1}),d.el.append(x,k)}return d.el.addEventListener("close",x=>{x.target===d.el&&h(null)}),{el:d.el,form:t,submit(){return t.submit()},validate(){return t.validate()},reset(x){t.reset(x)},getValues(){return t.getValues()},setValues(x){t.setValues(x)},getValue(x){return t.getValue(x)},setValue(x,k){t.setValue(x,k)},focusField(x){return t.focusField(x)},scrollToField(x){return t.scrollToField(x)},get mounted(){return d.mounted},get visible(){return d.visible},get closed(){return s},mount(x){return d.mount(x),this},unmount(){return d.unmount(),this},show(){return d.show(),this},hide(){return d.hide(),this},close(x){h(x??null)},update(x){return d.update(x),this},destroy(){d.destroy()}}}function hu(i){let o=_0(i);return o.show(),o}function K5(i){return"onSubmit"in i?hu({schema:i}):hu(i)}var W5={create:mu,open:hu,prompt:K5};function U5(){let i=document.createElement("lui-context-menu");return oe(i,pt("contextMenu")),i.trigger="manual",i}function gu(i,o){i.heading=o.heading??"",i.headingIcon=o.headingIcon??"",i.placement=o.placement??"bottom-start","items"in o&&o.items!==void 0&&(i.items=o.items),i.closeOnSelect=o.closeOnSelect??!0,i.closeOnOutsidePress=o.closeOnOutsidePress??!0,i.closeOnEscape=o.closeOnEscape??!0,i.submenuTrigger=o.submenuTrigger??"hover",i.backdrop=o.backdrop??"none",i.backdropStyle=o.backdropStyle??""}function Ol(i={}){let o=U5(),e=null,t=!1,r=s=>{e&&(o.removeEventListener("select",e),e=null),s&&(e=d=>{s(d.detail)},o.addEventListener("select",e))},n={el:o,get mounted(){return t&&o.isConnected},get visible(){return o.open},mount(s){if(o.isConnected)return this;let d=Qt("menu",s??i.container??Go()??Uo());return d.appendChild(o),Et(o,d,"menu"),t=!0,this},unmount(){return o.isConnected&&o.remove(),t=!1,this},show(s){o.isConnected||this.mount();let d={...i,...s};gu(o,d),st(o),r(d.onSelect),o.showAt(d.x,d.y,{items:d.items,context:d.context,triggerEvent:d.triggerEvent,source:d.source??"api"})},hide(){return o.hide(),this},update(s){return Object.assign(i,s),gu(o,{x:0,y:0,...i}),this},destroy(){r(void 0),o.hide(),this.unmount()}};return(i.items||i.heading||i.headingIcon||i.placement)&&gu(o,{x:0,y:0,...i}),n}var an=null,M0=new WeakMap;function C0(i){if(i.container){let o=M0.get(i.container);return(!o||!o.el.isConnected)&&(o=Ol({container:i.container}),M0.set(i.container,o)),o.show(i),o}return(!an||!an.el.isConnected)&&(an=Ol()),an.show(i),an}function z0(){document.querySelectorAll("lui-context-menu").forEach(i=>{i.hide?.()})}function G5(){an?.destroy(),an=null,document.querySelectorAll("lui-context-menu").forEach(i=>{i.hide?.(),i.remove()})}var Y5={create:Ol,show:C0,hideAll:z0,destroyAll:G5};function rs(i,o,e){if(e==null)return;let t=typeof e=="function"?e():e;if(typeof t=="string"){let n=document.createElement("div");n.slot=o,n.textContent=t,i.appendChild(n);return}if(t instanceof DocumentFragment){let n=document.createElement("div");n.slot=o,n.appendChild(t),i.appendChild(n);return}if(t instanceof HTMLElement||t instanceof SVGElement){t.setAttribute("slot",o),i.appendChild(t);return}let r=document.createElement("div");r.slot=o,r.appendChild(t),i.appendChild(r)}function X5(i){let o=document.createElement("lui-popover");return oe(o,pt("popover")),i.trigger!=null&&(o.trigger=i.trigger),i.placement!=null&&(o.placement=i.placement),i.disabled!=null&&(o.disabled=i.disabled),i.interactive!=null&&(o.interactive=i.interactive),i.showArrow!=null&&(o.showArrow=i.showArrow),i.closeOnOutsidePress!=null&&(o.closeOnOutsidePress=i.closeOnOutsidePress),i.closeOnEsc!=null&&(o.closeOnEsc=i.closeOnEsc),i.openDelay!=null&&(o.openDelay=i.openDelay),i.closeDelay!=null&&(o.closeDelay=i.closeDelay),i.offsetDistance!=null&&(o.offsetDistance=i.offsetDistance),i.autoFlip!=null&&(o.autoFlip=i.autoFlip),i.autoShift!=null&&(o.autoShift=i.autoShift),i.sameWidth!=null&&(o.sameWidth=i.sameWidth),i.maxWidth!=null&&(o.maxWidth=i.maxWidth),i.maxHeight!=null&&(o.maxHeight=i.maxHeight),i.backdrop!=null&&(o.backdrop=i.backdrop),i.backdropStyle!=null&&(o.backdropStyle=i.backdropStyle),i.portal!=null&&(o.portal=i.portal),i.overlayLayer!=null&&(o.overlayLayer=i.overlayLayer),i.container!=null&&(o.container=i.container),rs(o,"trigger",i.triggerContent),rs(o,"header",i.header),rs(o,"content",i.content),rs(o,"footer",i.footer),rs(o,"backdrop",i.backdropContent),o}function fu(i={}){let o=X5(i),e=!1,t=!1,r,n=new Promise(h=>{r=h}),s=()=>{t||(t=!0,r({action:"close"}))};return o.addEventListener("close",h=>{h.target===o&&s()}),{el:o,get mounted(){return e&&o.isConnected},get visible(){return o.open},get closed(){return n},mount(h){return o.isConnected?this:((h??document.body).appendChild(o),e=!0,this)},unmount(){return o.isConnected&&o.remove(),e=!1,this},show(){return o.isConnected||this.mount(),o.portal&&o._portalHost&&st(o._portalHost),o.show(),this},hide(){return o.hide(),this},close(){o.hide(),s()},update(h){return Object.assign(o,h),this},destroy(){t||s(),this.unmount()}}}function Z5(i={}){let o=fu({...i,trigger:"manual"});return o.show(),o}function Q5(){document.querySelectorAll("lui-popover").forEach(i=>{i.hide?.()})}function J5(){document.querySelectorAll("lui-popover").forEach(i=>{i.hide?.(),i.remove()})}var ex={create:fu,open:Z5,closeAll:Q5,destroyAll:J5};var no=new Map;function tx(){return Qt("toast",Go()??Uo())}function $0(i){let o=pt("toast"),e=typeof o.position=="string"?o.position:void 0;return i??e??"top-right"}function vu(i){let o=po();i.locale=o.locale,i.translations=o.translations,oe(i,pt("toast"))}function Rl(){for(let[i,o]of no)o?.isConnected||no.delete(i)}function rx(i){let o=no.get(i);o&&(no.delete(i),o.isConnected&&o.remove())}function ox(i,o,e,t,r,n){Rl();let s=$0(i),d=no.get(s);if(d?.isConnected)return vu(d),st(d),d.position=s,typeof o=="number"&&(d.max=o),typeof e=="string"&&(d.radius=e),typeof t=="boolean"&&(d.stacked=t),typeof r=="number"&&(d.stackMaxVisible=r),typeof n=="number"&&(d.stackGap=n),d;let h=document.createElement("lui-toast");h.listen=!1,vu(h),h.position=s,typeof o=="number"&&(h.max=o),typeof e=="string"&&(h.radius=e),typeof t=="boolean"&&(h.stacked=t),typeof r=="number"&&(h.stackMaxVisible=r),typeof n=="number"&&(h.stackGap=n),h.addEventListener("empty",()=>rx(s));let p=tx();return p.appendChild(h),Et(h,p,"toast"),no.set(s,h),h}function T0(i={}){let o=!1,e=null,t=r=>{if(e?.isConnected)return e;let n=$0(i.position);e=document.createElement("lui-toast"),e.listen=!1,vu(e),e.position=n,typeof i.max=="number"&&(e.max=i.max),typeof i.radius=="string"&&(e.radius=i.radius),typeof i.stacked=="boolean"&&(e.stacked=i.stacked),typeof i.stackMaxVisible=="number"&&(e.stackMaxVisible=i.stackMaxVisible),typeof i.stackGap=="number"&&(e.stackGap=i.stackGap);let s=Qt("toast",r??Go()??Uo());return s.appendChild(e),Et(e,s,"toast"),o=!0,e};return{get el(){return t()},get mounted(){return o&&!!e?.isConnected},get visible(){return!!e?.isConnected},mount(r){return t(r),this},unmount(){return e?.isConnected&&e.remove(),o=!1,this},show(r){let n=typeof r=="string"?{message:r}:r;return t().show({level:n.level??i.level,message:n.message,duration:n.duration??i.duration,radius:n.radius??i.radius,pauseOnHover:n.pauseOnHover??i.pauseOnHover,showProgress:n.showProgress??i.showProgress,action:n.action,delay:n.delay,stacked:n.stacked??i.stacked,stackMaxVisible:n.stackMaxVisible??i.stackMaxVisible,stackGap:n.stackGap??i.stackGap})},hide(){return e?.clear(),this},update(r){return Object.assign(i,r),e&&(typeof i.max=="number"&&(e.max=i.max),typeof i.radius=="string"&&(e.radius=i.radius),typeof i.stacked=="boolean"&&(e.stacked=i.stacked),typeof i.stackMaxVisible=="number"&&(e.stackMaxVisible=i.stackMaxVisible),typeof i.stackGap=="number"&&(e.stackGap=i.stackGap)),this},destroy(){this.unmount()},close(r){return e?e.close(r):!1},updateToast(r,n){if(!e)return!1;let s=typeof n=="string"?{message:n}:n;return e.updateToast(r,s)},clear(){e?.clear()}}}function ix(){Rl();for(let i of no.values())i.clear()}function bu(i){let o=typeof i=="string"?{message:i}:i;return ox(o.position,o.max,o.radius,o.stacked,o.stackMaxVisible,o.stackGap).show({level:o.level,message:o.message,duration:o.duration,radius:o.radius,pauseOnHover:o.pauseOnHover,showProgress:o.showProgress,action:o.action,delay:o.delay,stacked:o.stacked,stackMaxVisible:o.stackMaxVisible,stackGap:o.stackGap})}function E0(i){Rl();for(let o of no.values())if(o.has(i))return o;return null}function Hl(i,o,e){let t=typeof o=="string"?{message:o,duration:e}:o;return bu({...t,level:i,duration:t.duration??e})}function S0(i,o,e){return i==null?{message:o}:typeof i=="string"?{message:i}:typeof i=="function"?{message:i(e)}:i}var Ai={create:T0,show:bu,clearAll:ix,close(i){let o=E0(i);return o?o.close(i):!1},update(i,o){let e=E0(i);if(!e)return!1;let t=typeof o=="string"?{message:o}:o;return e.updateToast(i,t)},loading(i){let o=typeof i=="string"?{message:i}:i,e=bu({level:o.level??"info",message:o.message,duration:0,position:o.position,max:o.max,pauseOnHover:o.pauseOnHover,showProgress:o.showProgress??!1,action:o.action,delay:o.delay,stacked:o.stacked,stackMaxVisible:o.stackMaxVisible,stackGap:o.stackGap});return{id:e,close:()=>Ai.close(e),update:t=>{let r=typeof t=="string"?{message:t}:t;return Ai.update(e,r)},info:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"info",duration:2500,...r})},warning:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"warning",duration:3e3,...r})},success:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"success",duration:2500,...r})},error:t=>{let r=t==null?{}:typeof t=="string"?{message:t}:t;return Ai.update(e,{level:"error",duration:3500,...r})}}},async promise(i,o){let e=Ai.loading(o.loading);try{let t=await(typeof i=="function"?i():i),r=S0(o.success,"Completed successfully",t);return(o.successStrategy??(o.closeOnSuccess?"close":"update"))==="close"?e.close():e.update({level:"success",duration:o.successDuration??2500,...r}),t}catch(t){let r=S0(o.error,t instanceof Error?t.message:"Something went wrong",t);throw(o.errorStrategy??(o.closeOnError?"close":"update"))==="close"?e.close():e.update({level:"error",duration:o.errorDuration??3500,...r}),t}},closeAll(i){if(Rl(),i){let o=no.get(i);if(!o?.isConnected){no.delete(i);return}o.clear();return}for(let[o,e]of no){if(!e?.isConnected){no.delete(o);continue}e.clear()}},info(i,o){return Hl("info",i,o)},success(i,o){return Hl("success",i,o)},warning(i,o){return Hl("warning",i,o)},error(i,o){return Hl("error",i,o)}};function yu(i,o){o.columns!=null&&(i.columns=o.columns),o.data!=null&&(i.data=o.data),o.dataSource!=null&&(i.dataSource=o.dataSource),o.source!=null&&(i.source=o.source),o.rowKey!=null&&(i.rowKey=o.rowKey),o.size!=null&&(i.size=o.size),o.selection!=null&&(i.selection=o.selection),o.selectedRowKeys!=null&&(i.selectedRowKeys=[...o.selectedRowKeys]),o.bordered!=null&&(i.bordered=o.bordered),o.border!=null&&(i.border=o.border),o.noBorder!=null&&(i.noBorder=o.noBorder),o.striped!=null&&(i.striped=o.striped),o.hoverable!=null&&(i.hoverable=o.hoverable),o.stickyHeader!=null&&(i.stickyHeader=o.stickyHeader),o.showHeader!=null&&(i.showHeader=o.showHeader),o.columnResizable!=null&&(i.columnResizable=o.columnResizable),o.columnReorderable!=null&&(i.columnReorderable=o.columnReorderable),o.loading!=null&&(i.loading=o.loading),o.virtual!=null&&(i.virtual=o.virtual),o.virtualHeight!=null&&(i.virtualHeight=o.virtualHeight),o.rowHeight!=null&&(i.rowHeight=o.rowHeight),o.overscan!=null&&(i.overscan=o.overscan),o.pagination!=null&&(i.pagination=o.pagination),o.current!=null&&(i.current=o.current),o.pageSize!=null&&(i.pageSize=o.pageSize),o.total!=null&&(i.total=o.total),o.showSizeChanger!=null&&(i.showSizeChanger=o.showSizeChanger),o.emptyText!=null&&(i.emptyText=o.emptyText),o.sortKey!=null&&(i.sortKey=o.sortKey),o.sortOrder!=null&&(i.sortOrder=o.sortOrder),o.rowClickable!=null&&(i.rowClickable=o.rowClickable),o.selectOnClick!=null&&(i.selectOnClick=o.selectOnClick),o.rowAnimation!=null&&(i.rowAnimation=o.rowAnimation),o.onRow!=null&&(i.onRow=o.onRow),o.onCell!=null&&(i.onCell=o.onCell),o.onHeaderRow!=null&&(i.onHeaderRow=o.onHeaderRow),o.onHeaderCell!=null&&(i.onHeaderCell=o.onHeaderCell)}function A0(i={}){let o=document.createElement("lui-table");oe(o,pt("table")),yu(o,i);let e=!1;return{el:o,get mounted(){return e&&o.isConnected},get visible(){return!o.hidden},mount(r){return r&&!o.isConnected&&(r.appendChild(o),e=!0),this},unmount(){return o.isConnected&&o.remove(),e=!1,this},show(){return o.hidden=!1,this},hide(){return o.hidden=!0,this},update(r){return yu(o,r),this},destroy(){this.unmount()},setData(r){return o.dataSource=r,this},setColumns(r){return o.columns=r,this},getData(){return o.dataSource??o.source??o.data??[]},getColumns(){return o.columns??[]},setLoading(r){return o.loading=r,this},getSelectedRowKeys(){return[...o.selectedRowKeys??[]]},setSelectedRowKeys(r){return o.selectedRowKeys=[...r],this},setSelection(r,n=o.selectedRowKeys??[]){return o.selection=r,o.selectedRowKeys=[...n],this},setPagination(r){return yu(o,r),this}}}var nx={create:A0};export{q1 as BP,Xt as LuiAlert,Je as LuiAutocomplete,ut as LuiAvatar,At as LuiAvatarGroup,Ue as LuiBackground,Tt as LuiBadge,Ct as LuiBreadcrumb,Wt as LuiBreadcrumbItem,xt as LuiButton,Re as LuiButtonGroup,wt as LuiButtonGroupItem,lr as LuiCalendar,ft as LuiCard,Ze as LuiCascader,_t as LuiCheckbox,Ut as LuiCheckboxGroup,Ir as LuiCol,Wr as LuiCollapse,yr as LuiCollapseItem,qe as LuiColorPicker,Ot as LuiCommandPalette,Ft as LuiConfigProvider,Ae as LuiContextMenu,Yr as LuiDateRangePicker,at as LuiDatepicker,xe as LuiDialog,ir as LuiDivider,Ke as LuiDrawer,bi as LuiDropdown,Me as LuiDropmenu,Jr as LuiEmptyState,Ur as LuiFileInput,kt as LuiForm,jt as LuiFormItem,Ee as LuiIcon,Ce as LuiIconPicker,Pe as LuiImage,nt as LuiImageCropper,$e as LuiInput,yt as LuiInputNumber,ar as LuiInputOpt,vo as LuiMenu,bn as LuiMenuDivider,St as LuiMenuItem,jo as LuiOption,Ni as LuiOptionGroup,_a as LuiOverlayRoot,Ie as LuiPagination,it as LuiPopconfirm,ee as LuiPopover,zt as LuiProgress,Lt as LuiQrcode,Gt as LuiRadio,sr as LuiRadioGroup,zo as LuiRow,bt as LuiScrollArea,me as LuiSelect,tr as LuiSkeleton,Xe as LuiSlider,Lr as LuiSpinner,$r as LuiSplitter,dt as LuiStatistic,Vr as LuiSwitch,vt as LuiTab,Kr as LuiTabPanel,U as LuiTable,qt as LuiTableColumn,ja as LuiTabs,jr as LuiTag,Ve as LuiText,Ye as LuiTextarea,Ht as LuiToast,fr as LuiTooltip,se as LuiTree,Qe as LuiTreeSelect,O as baseStyles,st as bringOverlayStackToFront,bc as builtinIconCollection,zs as builtinIconNames,pn as builtinIconPrefix,Tp as builtinTranslations,x5 as commandPalette,Y5 as contextMenu,su as createCommandPalette,Ol as createContextMenu,ts as createDialog,_0 as createDialogForm,lu as createDrawer,q5 as createForm,fu as createPopover,A0 as createTable,T0 as createToastHost,L5 as dialog,P5 as drawer,iu as encodeQr,Qt as ensureOverlayExternalLayer,zc as ensureOverlayLayer,Cc as ensureOverlayRoot,fn as eventPathContainsOwnedOverlay,W5 as form,Hx as formatDate,Ox as formatSize,Q3 as getLocale,Rs as hasRecentOverlayInteraction,z0 as hideAllContextMenus,yc as isImageIconSource,Is as isOverlayTopmost,Hs as markOverlayInteraction,ie as mergeTranslations,Yn as normalizeStatus,ye as onLocaleChange,ex as popover,Ak as registerFormField,Et as registerOverlayStack,Pp as registerTranslations,ya as resolveBuiltinIcon,Rf as resolveBuiltinTranslations,vn as resolveOverlayLayerRegistration,Ap as setLocale,pp as setOverlayOwner,Es as setupBuiltinIcons,C0 as showContextMenu,h4 as statusColorToken,CE as statusColorVar,ai as statusIcon,zE as statusOrder,J3 as t,nx as table,mt as toCssLength,Ai as toast,A as tokens,ne as translate,Pk as unregisterFormField,fo as unregisterOverlayStack};
14900
14900
  /*! Bundled license information:
14901
14901
 
14902
14902
  @lit-labs/virtualizer/layouts/shared/SizeCache.js: