@arbocollab/arbo-web-scene 1.26.2 → 1.26.3

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/es/index.es.js CHANGED
@@ -11911,7 +11911,7 @@ const nKe = (e, t) => {
11911
11911
  (a = (s = e == null ? void 0 : e.config) == null ? void 0 : s.globalProperties) == null || a.setStoreValue("scene", "setCurrentSceneTabId", o);
11912
11912
  }
11913
11913
  return e.config.globalProperties.setStoreValue = r, e.config.globalProperties.handleSetTab = i, { handleSetTab: i };
11914
- }, rKe = "1.26.2", iKe = {
11914
+ }, rKe = "1.26.3", iKe = {
11915
11915
  "@arbocollab/arbo-chart-component": "1.0.1",
11916
11916
  "@arbocollab/arbo-comment-utils": "1.0.1",
11917
11917
  "@arbocollab/arbo-common-utils": "npm:@arbocollab/arbo-common-utils@1.0.11",
@@ -11919,7 +11919,7 @@ const nKe = (e, t) => {
11919
11919
  "@arbocollab/arbo-table-component": "1.0.1",
11920
11920
  "@arbocollab/arbo-ui-components": "npm:@arbocollab/arbo-ui-components-beta@0.0.373-alpha.23",
11921
11921
  "@arbocollab/arbo-calendar-component": "0.0.12",
11922
- "@arbocollab/arbo-metric-table": "npm:@arbocollab/arbo-metric-table@0.0.22",
11922
+ "@arbocollab/arbo-metric-table": "npm:@arbocollab/arbo-metric-table@0.0.23",
11923
11923
  "@vueuse/core": "^10.11.1",
11924
11924
  axios: "^1.7.2",
11925
11925
  "date-fns": "^4.1.0",
@@ -182207,8 +182207,8 @@ const abn = {
182207
182207
  }, vbn = "API_BASE_URL", ybn = "formula", XL = 10, bbn = !1, wbn = /* @__PURE__ */ Ct({
182208
182208
  __name: "App",
182209
182209
  props: {
182210
- sceneId: { default: "7jjrrtjv" },
182211
- workspaceId: { default: "w:yngazem" },
182210
+ sceneId: { default: "" },
182211
+ workspaceId: { default: "" },
182212
182212
  availableHeight: {}
182213
182213
  },
182214
182214
  emits: ["update-success", "update-error"],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arbocollab/arbo-web-scene",
3
3
  "description": "Arbo Web Scene",
4
- "version": "1.26.2",
4
+ "version": "1.26.3",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "scripts": {
package/umd/index.umd.js CHANGED
@@ -37,7 +37,7 @@ Only state can be modified.`);s[0]="$state",wS=!1,r.set(o,s,r.state.value),wS=!0
37
37
  Found in store "${A.$id}".`),g&&o&&n.hydrate&&n.hydrate(A.$state,g),u=!0,c=!0,A}/*! #__NO_SIDE_EFFECTS__ */function Up(e,t,n){let r;const i=typeof t=="function";r=i?n:t;function o(s,a){const l=Fre();if(s=(Me.env.NODE_ENV==="test"&&zk&&zk._testing?null:s)||(l?gf(Rse,null):null),s&&jk(s),Me.env.NODE_ENV!=="production"&&!zk)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
38
38
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
39
39
  This will fail in production.`);s=zk,s._s.has(e)||(i?EU(e,t,r,s):qse(e,r,s),Me.env.NODE_ENV!=="production"&&(o._pinia=s));const u=s._s.get(e);if(Me.env.NODE_ENV!=="production"&&a){const c="__hot:"+e,d=i?EU(c,t,r,s,!0):qse(c,bf({},r),s,!0);a._hotUpdate(d),delete s.state.value[c],s._s.delete(c)}if(Me.env.NODE_ENV!=="production"&&$b){const c=Ci();if(c&&c.proxy&&!a){const d=c.proxy,h="_pStores"in d?d._pStores:d._pStores={};h[e]=u}}return u}return o.$id=e,o}function Mn(e){const t=yr(e),n={};for(const r in t){const i=t[r];i.effect?n[r]=re({get:()=>e[r],set(o){e[r]=o}}):(ar(i)||Nu(i))&&(n[r]=ch(e,r))}return n}function eje(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var n=e.indexOf("Trident/");if(n>0){var r=e.indexOf("rv:");return parseInt(e.substring(r+3,e.indexOf(".",r)),10)}var i=e.indexOf("Edge/");return i>0?parseInt(e.substring(i+5,e.indexOf(".",i)),10):-1}let bM;function TU(){TU.init||(TU.init=!0,bM=eje()!==-1)}var wM={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){TU(),Gt(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",bM&&this.$el.appendChild(e),e.data="about:blank",bM||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!bM&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const tje=I5e();O5e("data-v-b329ee4c");const nje={class:"resize-observer",tabindex:"-1"};R5e();const rje=tje((e,t,n,r,i,o)=>(W(),ut("div",nje)));wM.render=rje,wM.__scopeId="data-v-b329ee4c",wM.__file="src/components/ResizeObserver.vue";function _M(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_M=function(t){return typeof t}:_M=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_M(e)}function ije(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oje(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function sje(e,t,n){return t&&oje(e.prototype,t),e}function Kse(e){return aje(e)||lje(e)||uje(e)||cje()}function aje(e){if(Array.isArray(e))return AU(e)}function lje(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function uje(e,t){if(e){if(typeof e=="string")return AU(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return AU(e,t)}}function AU(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cje(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
40
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dje(e){var t;return typeof e=="function"?t={callback:e}:t=e,t}function hje(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,i,o,s=function(l){for(var u=arguments.length,c=new Array(u>1?u-1:0),d=1;d<u;d++)c[d-1]=arguments[d];if(o=c,!(r&&l===i)){var h=n.leading;typeof h=="function"&&(h=h(l,i)),(!r||l!==i)&&h&&e.apply(void 0,[l].concat(Kse(o))),i=l,clearTimeout(r),r=setTimeout(function(){e.apply(void 0,[l].concat(Kse(o))),r=0},t)}};return s._clear=function(){clearTimeout(r),r=null},s}function Yse(e,t){if(e===t)return!0;if(_M(e)==="object"){for(var n in e)if(!Yse(e[n],t[n]))return!1;return!0}return!1}var fje=function(){function e(t,n,r){ije(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(n,r)}return sje(e,[{key:"createObserver",value:function(n,r){var i=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=dje(n),this.callback=function(a,l){i.options.callback(a,l),a&&i.options.once&&(i.frozen=!0,i.destroyObserver())},this.callback&&this.options.throttle){var o=this.options.throttleOptions||{},s=o.leading;this.callback=hje(this.callback,this.options.throttle,{leading:function(l){return s==="both"||s==="visible"&&l||s==="hidden"&&!l}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(a){var l=a[0];if(a.length>1){var u=a.find(function(d){return d.isIntersecting});u&&(l=u)}if(i.callback){var c=l.isIntersecting&&l.intersectionRatio>=i.threshold;if(c===i.oldResult)return;i.oldResult=c,i.callback(c,l)}},this.options.intersection),Gt(function(){i.observer&&i.observer.observe(i.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),e}();function Xse(e,t,n){var r=t.value;if(r)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var i=new fje(e,r,n);e._vue_visibilityState=i}}function pje(e,t,n){var r=t.value,i=t.oldValue;if(!Yse(r,i)){var o=e._vue_visibilityState;if(!r){Zse(e);return}o?o.createObserver(r,n):Xse(e,{value:r},n)}}function Zse(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var mje={beforeMount:Xse,updated:pje,unmounted:Zse};function gje(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){(e.get(t)||[]).slice().map(function(r){r(n)}),(e.get("*")||[]).slice().map(function(r){r(t,n)})}}}var Qse={itemsLimit:1e3},vje=/(auto|scroll)/;function Jse(e,t){return e.parentNode===null?t:Jse(e.parentNode,t.concat([e]))}var kU=function(t,n){return getComputedStyle(t,null).getPropertyValue(n)},yje=function(t){return kU(t,"overflow")+kU(t,"overflow-y")+kU(t,"overflow-x")},bje=function(t){return vje.test(yje(t))};function eae(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=Jse(e.parentNode,[]),n=0;n<t.length;n+=1)if(bje(t[n]))return t[n];return document.scrollingElement||document.documentElement}}function DU(e){"@babel/helpers - typeof";return DU=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},DU(e)}var tae={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(t){return["vertical","horizontal"].includes(t)}},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function nae(){return this.items.length&&DU(this.items[0])!=="object"}var OU=!1;if(typeof window<"u"){OU=!1;try{var wje=Object.defineProperty({},"passive",{get:function(){OU=!0}});window.addEventListener("test",null,wje)}catch{}}let _je=0;var Wk={name:"RecycleScroller",components:{ResizeObserver:wM},directives:{ObserveVisibility:mje},props:{...tae,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},updateInterval:{type:Number,default:0},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},emits:["resize","visible","hidden","update","scroll-start","scroll-end"],data(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes(){if(this.itemSize===null){const e={"-1":{accumulator:0}},t=this.items,n=this.sizeField,r=this.minItemSize;let i=1e4,o=0,s;for(let a=0,l=t.length;a<l;a++)s=t[a][n]||r,s<i&&(i=s),o+=s,e[a]={accumulator:o,size:s};return this.$_computedMinItemSize=i,e}return[]},simpleArray:nae,itemIndexByKey(){const{keyField:e,items:t}=this,n={};for(let r=0,i=t.length;r<i;r++)n[t[r][e]]=r;return n}},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted(){this.applyPageMode(),this.$nextTick(()=>{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const e=this.$_lastUpdateScrollPosition;typeof e=="number"&&this.$nextTick(()=>{this.scrollToPosition(e)})},beforeUnmount(){this.removeListeners()},methods:{addView(e,t,n,r,i){const o=$u({id:_je++,index:t,used:!0,key:r,type:i}),s=Hne({item:n,position:0,nr:o});return e.push(s),s},unuseView(e,t=!1){const n=this.$_unusedViews,r=e.nr.type;let i=n.get(r);i||(i=[],n.set(r,i)),i.push(e),t||(e.nr.used=!1,e.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const t=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:n}=this.updateVisibleItems(!1,!0);n||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});t(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&t()},this.updateInterval))}},handleVisibilityChange(e,t){this.ready&&(e||t.boundingClientRect.width!==0||t.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const n=this.itemSize,r=this.gridItems||1,i=this.itemSecondarySize||n,o=this.$_computedMinItemSize,s=this.typeField,a=this.simpleArray?null:this.keyField,l=this.items,u=l.length,c=this.sizes,d=this.$_views,h=this.$_unusedViews,f=this.pool,g=this.itemIndexByKey;let m,v,_,w,C;if(!u)m=v=w=C=_=0;else if(this.$_prerender)m=w=0,v=C=Math.min(this.prerender,l.length),_=null;else{const k=this.getScroll();if(t){let M=k.start-this.$_lastUpdateScrollPosition;if(M<0&&(M=-M),n===null&&M<o||M<n)return{continuous:!0}}this.$_lastUpdateScrollPosition=k.start;const P=this.buffer;k.start-=P,k.end+=P;let L=0;if(this.$refs.before&&(L=this.$refs.before.scrollHeight,k.start-=L),this.$refs.after){const M=this.$refs.after.scrollHeight;k.end+=M}if(n===null){let M,$=0,B=u-1,N=~~(u/2),V;do V=N,M=c[N].accumulator,M<k.start?$=N:N<u-1&&c[N+1].accumulator>k.start&&(B=N),N=~~(($+B)/2);while(N!==V);for(N<0&&(N=0),m=N,_=c[u-1].accumulator,v=N;v<u&&c[v].accumulator<k.end;v++);for(v===-1?v=l.length-1:(v++,v>u&&(v=u)),w=m;w<u&&L+c[w].accumulator<k.start;w++);for(C=w;C<u&&L+c[C].accumulator<k.end;C++);}else{m=~~(k.start/n*r);const M=m%r;m-=M,v=Math.ceil(k.end/n*r),w=Math.max(0,Math.floor((k.start-L)/n*r)),C=Math.floor((k.end-L)/n*r),m<0&&(m=0),v>u&&(v=u),w<0&&(w=0),C>u&&(C=u),_=Math.ceil(u/r)*n}}v-m>Qse.itemsLimit&&this.itemsLimitError(),this.totalSize=_;let y;const E=m<=this.$_endIndex&&v>=this.$_startIndex;if(E)for(let k=0,P=f.length;k<P;k++)y=f[k],y.nr.used&&(e&&(y.nr.index=g[y.item[a]]),(y.nr.index==null||y.nr.index<m||y.nr.index>=v)&&this.unuseView(y));const x=E?null:new Map;let A,I,D;for(let k=m;k<v;k++){A=l[k];const P=a?A[a]:A;if(P==null)throw new Error(`Key is ${P} on item (keyField is '${a}')`);if(y=d.get(P),!n&&!c[k].size){y&&this.unuseView(y);continue}I=A[s];let L=h.get(I),M=!1;if(!y)E?L&&L.length?y=L.pop():y=this.addView(f,k,A,P,I):(D=x.get(I)||0,(!L||D>=L.length)&&(y=this.addView(f,k,A,P,I),this.unuseView(y,!0),L=h.get(I)),y=L[D],x.set(I,D+1)),d.delete(y.nr.key),y.nr.used=!0,y.nr.index=k,y.nr.key=P,y.nr.type=I,d.set(P,y),M=!0;else if(!y.nr.used&&(y.nr.used=!0,M=!0,L)){const $=L.indexOf(y);$!==-1&&L.splice($,1)}y.item=A,M&&(k===l.length-1&&this.$emit("scroll-end"),k===0&&this.$emit("scroll-start")),n===null?(y.position=c[k-1].accumulator,y.offset=0):(y.position=Math.floor(k/r)*n,y.offset=k%r*i)}return this.$_startIndex=m,this.$_endIndex=v,this.emitUpdate&&this.$emit("update",m,v,w,C),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:E}},getListenerTarget(){let e=eae(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){const{$el:e,direction:t}=this,n=t==="vertical";let r;if(this.pageMode){const i=e.getBoundingClientRect(),o=n?i.height:i.width;let s=-(n?i.top:i.left),a=n?window.innerHeight:window.innerWidth;s<0&&(a+=s,s=0),s+a>o&&(a=o-s),r={start:s,end:s+a}}else n?r={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:r={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return r},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,OU?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(e){let t;const n=this.gridItems||1;this.itemSize===null?t=e>0?this.sizes[e-1].accumulator:0:t=Math.floor(e/n)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,r,i;if(this.pageMode){const o=eae(this.$el),s=o.tagName==="HTML"?0:o[t.scroll],a=o.getBoundingClientRect(),u=this.$el.getBoundingClientRect()[t.start]-a[t.start];n=o,r=t.scroll,i=e+s+u}else n=this.$el,r=t.scroll,i=e;n[r]=i},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((e,t)=>e.nr.index-t.nr.index)}}};const Cje={key:0,ref:"before",class:"vue-recycle-scroller__slot"},Sje={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function xje(e,t,n,r,i,o){const s=yn("ResizeObserver"),a=Bu("observe-visibility");return qt((W(),se("div",{class:et(["vue-recycle-scroller",{ready:i.ready,"page-mode":n.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...l)=>o.handleScroll&&o.handleScroll(...l))},[e.$slots.before?(W(),se("div",Cje,[rt(e.$slots,"before")],512)):je("v-if",!0),(W(),ut(Np(n.listTag),{ref:"wrapper",style:Jt({[e.direction==="vertical"?"minHeight":"minWidth"]:i.totalSize+"px"}),class:et(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:it(()=>[(W(!0),se(Mt,null,vn(i.pool,l=>(W(),ut(Np(n.itemTag),Lt({key:l.nr.id,style:i.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${l.position}px) translate${e.direction==="vertical"?"X":"Y"}(${l.offset}px)`,width:n.gridItems?`${e.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${e.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&i.hoverKey===l.nr.key}]]},H5e(n.skipHover?{}:{mouseenter:()=>{i.hoverKey=l.nr.key},mouseleave:()=>{i.hoverKey=null}})),{default:it(()=>[rt(e.$slots,"default",{item:l.item,index:l.nr.index,active:l.nr.used})]),_:2},1040,["style","class"]))),128)),rt(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?(W(),se("div",Sje,[rt(e.$slots,"after")],512)):je("v-if",!0),Ne(s,{onNotify:o.handleResize},null,8,["onNotify"])],34)),[[a,o.handleVisibilityChange]])}Wk.render=xje,Wk.__file="src/components/RecycleScroller.vue";var CM={name:"DynamicScroller",components:{RecycleScroller:Wk},provide(){return typeof ResizeObserver<"u"&&(this.$_resizeObserver=new ResizeObserver(e=>{requestAnimationFrame(()=>{if(Array.isArray(e)){for(const t of e)if(t.target&&t.target.$_vs_onResize){let n,r;if(t.borderBoxSize){const i=t.borderBoxSize[0];n=i.inlineSize,r=i.blockSize}else n=t.contentRect.width,r=t.contentRect.height;t.target.$_vs_onResize(t.target.$_vs_id,n,r)}}})})),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},inheritAttrs:!1,props:{...tae,minItemSize:{type:[Number,String],required:!0}},emits:["resize","visible"],data(){return{vscrollData:{active:!0,sizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray:nae,itemsWithSize(){const e=[],{items:t,keyField:n,simpleArray:r}=this,i=this.vscrollData.sizes,o=t.length;for(let s=0;s<o;s++){const a=t[s],l=r?s:a[n];let u=i[l];typeof u>"u"&&!this.$_undefinedMap[l]&&(u=0),e.push({item:a,id:l,size:u})}return e}},watch:{items(){this.forceUpdate()},simpleArray:{handler(e){this.vscrollData.simpleArray=e},immediate:!0},direction(e){this.forceUpdate(!0)},itemsWithSize(e,t){const n=this.$el.scrollTop;let r=0,i=0;const o=Math.min(e.length,t.length);for(let a=0;a<o&&!(r>=n);a++)r+=t[a].size||this.minItemSize,i+=e[a].size||this.minItemSize;const s=i-r;s!==0&&(this.$el.scrollTop+=s)}},beforeCreate(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={},this.$_events=gje()},activated(){this.vscrollData.active=!0},deactivated(){this.vscrollData.active=!1},unmounted(){this.$_events.all.clear()},methods:{onScrollerResize(){this.$refs.scroller&&this.forceUpdate(),this.$emit("resize")},onScrollerVisible(){this.$_events.emit("vscroll:update",{force:!1}),this.$emit("visible")},forceUpdate(e=!1){(e||this.simpleArray)&&(this.vscrollData.sizes={}),this.$_events.emit("vscroll:update",{force:!0})},scrollToItem(e){const t=this.$refs.scroller;t&&t.scrollToItem(e)},getItemSize(e,t=void 0){const n=this.simpleArray?t??this.items.indexOf(e):e[this.keyField];return this.vscrollData.sizes[n]||0},scrollToBottom(){if(this.$_scrollingToBottom)return;this.$_scrollingToBottom=!0;const e=this.$el;this.$nextTick(()=>{e.scrollTop=e.scrollHeight+5e3;const t=()=>{e.scrollTop=e.scrollHeight+5e3,requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight+5e3,this.$_undefinedSizes===0?this.$_scrollingToBottom=!1:requestAnimationFrame(t)})};requestAnimationFrame(t)})}}};function Eje(e,t,n,r,i,o){const s=yn("RecycleScroller");return W(),ut(s,Lt({ref:"scroller",items:o.itemsWithSize,"min-item-size":n.minItemSize,direction:e.direction,"key-field":"id","list-tag":e.listTag,"item-tag":e.itemTag},e.$attrs,{onResize:o.onScrollerResize,onVisible:o.onScrollerVisible}),{default:it(({item:a,index:l,active:u})=>[rt(e.$slots,"default",Vo(hs({item:a.item,index:l,active:u,itemWithSize:a})))]),before:it(()=>[rt(e.$slots,"before")]),after:it(()=>[rt(e.$slots,"after")]),empty:it(()=>[rt(e.$slots,"empty")]),_:3},16,["items","min-item-size","direction","list-tag","item-tag","onResize","onVisible"])}CM.render=Eje,CM.__file="src/components/DynamicScroller.vue";var RU={name:"DynamicScrollerItem",inject:["vscrollData","vscrollParent","vscrollResizeObserver"],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},emitResize:{type:Boolean,default:!1},tag:{type:String,default:"div"}},emits:["resize"],computed:{id(){if(this.vscrollData.simpleArray)return this.index;if(this.vscrollData.keyField in this.item)return this.item[this.vscrollData.keyField];throw new Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)},size(){return this.vscrollData.sizes[this.id]||0},finalActive(){return this.active&&this.vscrollData.active}},watch:{watchData:"updateWatchData",id(e,t){if(this.$el.$_vs_id=this.id,this.size||this.onDataUpdate(),this.$_sizeObserved){const n=this.vscrollData.sizes[t],r=this.vscrollData.sizes[e];n!=null&&n!==r&&this.applySize(n)}},finalActive(e){this.size||(e?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?e?this.observeSize():this.unobserveSize():e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created(){if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver)){for(const e in this.sizeDependencies)this.$watch(()=>this.sizeDependencies[e],this.onDataUpdate);this.vscrollParent.$_events.on("vscroll:update",this.onVscrollUpdate)}},mounted(){this.finalActive&&(this.updateSize(),this.observeSize())},beforeUnmount(){this.vscrollParent.$_events.off("vscroll:update",this.onVscrollUpdate),this.unobserveSize()},methods:{updateSize(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData(){this.watchData&&!this.vscrollResizeObserver?this.$_watchData=this.$watch("item",()=>{this.onDataUpdate()},{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate({force:e}){!this.finalActive&&e&&(this.$_pendingVScrollUpdate=this.id),(this.$_forceNextVScrollUpdate===this.id||e||!this.size)&&this.updateSize()},onDataUpdate(){this.updateSize()},computeSize(e){this.$nextTick(()=>{if(this.id===e){const t=this.$el.offsetWidth,n=this.$el.offsetHeight;this.applyWidthHeight(t,n)}this.$_pendingSizeUpdate=null})},applyWidthHeight(e,t){const n=~~(this.vscrollParent.direction==="vertical"?t:e);n&&this.size!==n&&this.applySize(n)},applySize(e){this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.vscrollData.sizes[this.id]=e,this.emitResize&&this.$emit("resize",this.id)},observeSize(){this.vscrollResizeObserver&&(this.$_sizeObserved||(this.vscrollResizeObserver.observe(this.$el),this.$el.$_vs_id=this.id,this.$el.$_vs_onResize=this.onResize,this.$_sizeObserved=!0))},unobserveSize(){this.vscrollResizeObserver&&this.$_sizeObserved&&(this.vscrollResizeObserver.unobserve(this.$el),this.$el.$_vs_onResize=void 0,this.$_sizeObserved=!1)},onResize(e,t,n){this.id===e&&this.applyWidthHeight(t,n)}},render(){return Fl(this.tag,this.$slots.default())}};RU.__file="src/components/DynamicScrollerItem.vue";function Tje(e,t){e.component("".concat(t,"recycle-scroller"),Wk),e.component("".concat(t,"RecycleScroller"),Wk),e.component("".concat(t,"dynamic-scroller"),CM),e.component("".concat(t,"DynamicScroller"),CM),e.component("".concat(t,"dynamic-scroller-item"),RU),e.component("".concat(t,"DynamicScrollerItem"),RU)}var Aje={version:"2.0.0-beta.8",install:function(t,n){var r=Object.assign({},{installComponents:!0,componentsPrefix:""},n);for(var i in r)typeof r[i]<"u"&&(Qse[i]=r[i]);r.installComponents&&Tje(t,r.componentsPrefix)}};const kje=(e,t)=>{const n=o=>t._s.get(o),r=(o,s,a)=>{const l=n(o);return l&&s in l?(l[s](a),!0):(console.warn(`[initWebScene] Store "${o}" or dispactcher "${s}" not found`),!1)};function i(o){var s,a;(a=(s=e==null?void 0:e.config)==null?void 0:s.globalProperties)==null||a.setStoreValue("scene","setCurrentSceneTabId",o)}return e.config.globalProperties.setStoreValue=r,e.config.globalProperties.handleSetTab=i,{handleSetTab:i}},Dje="1.26.2",Oje={"@arbocollab/arbo-chart-component":"1.0.1","@arbocollab/arbo-comment-utils":"1.0.1","@arbocollab/arbo-common-utils":"npm:@arbocollab/arbo-common-utils@1.0.11","@arbocollab/arbo-media-player-component":"1.0.6","@arbocollab/arbo-table-component":"1.0.1","@arbocollab/arbo-ui-components":"npm:@arbocollab/arbo-ui-components-beta@0.0.373-alpha.23","@arbocollab/arbo-calendar-component":"0.0.12","@arbocollab/arbo-metric-table":"npm:@arbocollab/arbo-metric-table@0.0.22","@vueuse/core":"^10.11.1",axios:"^1.7.2","date-fns":"^4.1.0","date-fns-tz":"^3.2.0",dayjs:"^1.11.11",dexie:"4.0.10","js-cookie":"^3.0.5",pinia:"^3.0.3","prettier-plugin-stylus":"^0.1.0","sanitize-html":"^2.15.0","vite-bundle-visualizer":"^1.2.1","vite-plugin-html":"^3.2.2",vue:"^3.5.18","vue-draggable-next":"^2.2.1","vue-i18n":"^9.13.1","vue-router":"^4.5.1","vue-virtual-scroller":"^2.0.0-beta.8"};var fr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gk(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Rje(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var rae={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(fr,function(){var n=function(p,b){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,O){T.__proto__=O}||function(T,O){for(var F in O)Object.prototype.hasOwnProperty.call(O,F)&&(T[F]=O[F])})(p,b)},r=function(){return(r=Object.assign||function(p){for(var b,T=1,O=arguments.length;T<O;T++)for(var F in b=arguments[T])Object.prototype.hasOwnProperty.call(b,F)&&(p[F]=b[F]);return p}).apply(this,arguments)};function i(p,b,T){for(var O,F=0,z=b.length;F<z;F++)!O&&F in b||((O=O||Array.prototype.slice.call(b,0,F))[F]=b[F]);return p.concat(O||Array.prototype.slice.call(b))}var o=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:fr,s=Object.keys,a=Array.isArray;function l(p,b){return typeof b!="object"||s(b).forEach(function(T){p[T]=b[T]}),p}typeof Promise>"u"||o.Promise||(o.Promise=Promise);var u=Object.getPrototypeOf,c={}.hasOwnProperty;function d(p,b){return c.call(p,b)}function h(p,b){typeof b=="function"&&(b=b(u(p))),(typeof Reflect>"u"?s:Reflect.ownKeys)(b).forEach(function(T){g(p,T,b[T])})}var f=Object.defineProperty;function g(p,b,T,O){f(p,b,l(T&&d(T,"get")&&typeof T.get=="function"?{get:T.get,set:T.set,configurable:!0}:{value:T,configurable:!0,writable:!0},O))}function m(p){return{from:function(b){return p.prototype=Object.create(b.prototype),g(p.prototype,"constructor",p),{extend:h.bind(null,p.prototype)}}}}var v=Object.getOwnPropertyDescriptor,_=[].slice;function w(p,b,T){return _.call(p,b,T)}function C(p,b){return b(p)}function y(p){if(!p)throw new Error("Assertion Failed")}function E(p){o.setImmediate?setImmediate(p):setTimeout(p,0)}function x(p,b){if(typeof b=="string"&&d(p,b))return p[b];if(!b)return p;if(typeof b!="string"){for(var T=[],O=0,F=b.length;O<F;++O){var z=x(p,b[O]);T.push(z)}return T}var X=b.indexOf(".");if(X!==-1){var ue=p[b.substr(0,X)];return ue==null?void 0:x(ue,b.substr(X+1))}}function A(p,b,T){if(p&&b!==void 0&&!("isFrozen"in Object&&Object.isFrozen(p)))if(typeof b!="string"&&"length"in b){y(typeof T!="string"&&"length"in T);for(var O=0,F=b.length;O<F;++O)A(p,b[O],T[O])}else{var z,X,ue=b.indexOf(".");ue!==-1?(z=b.substr(0,ue),(X=b.substr(ue+1))===""?T===void 0?a(p)&&!isNaN(parseInt(z))?p.splice(z,1):delete p[z]:p[z]=T:A(ue=!(ue=p[z])||!d(p,z)?p[z]={}:ue,X,T)):T===void 0?a(p)&&!isNaN(parseInt(b))?p.splice(b,1):delete p[b]:p[b]=T}}function I(p){var b,T={};for(b in p)d(p,b)&&(T[b]=p[b]);return T}var D=[].concat;function k(p){return D.apply([],p)}var Ii="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(k([8,16,32,64].map(function(p){return["Int","Uint","Float"].map(function(b){return b+p+"Array"})}))).filter(function(p){return o[p]}),P=new Set(Ii.map(function(p){return o[p]})),L=null;function M(p){return L=new WeakMap,p=function b(T){if(!T||typeof T!="object")return T;var O=L.get(T);if(O)return O;if(a(T)){O=[],L.set(T,O);for(var F=0,z=T.length;F<z;++F)O.push(b(T[F]))}else if(P.has(T.constructor))O=T;else{var X,ue=u(T);for(X in O=ue===Object.prototype?{}:Object.create(ue),L.set(T,O),T)d(T,X)&&(O[X]=b(T[X]))}return O}(p),L=null,p}var $={}.toString;function B(p){return $.call(p).slice(8,-1)}var N=typeof Symbol<"u"?Symbol.iterator:"@@iterator",V=typeof N=="symbol"?function(p){var b;return p!=null&&(b=p[N])&&b.apply(p)}:function(){return null};function K(p,b){return b=p.indexOf(b),0<=b&&p.splice(b,1),0<=b}var te={};function ve(p){var b,T,O,F;if(arguments.length===1){if(a(p))return p.slice();if(this===te&&typeof p=="string")return[p];if(F=V(p)){for(T=[];!(O=F.next()).done;)T.push(O.value);return T}if(p==null)return[p];if(typeof(b=p.length)!="number")return[p];for(T=new Array(b);b--;)T[b]=p[b];return T}for(b=arguments.length,T=new Array(b);b--;)T[b]=arguments[b];return T}var ce=typeof Symbol<"u"?function(p){return p[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},xt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Zr=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(xt),Z={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function U(p,b){this.name=p,this.message=b}function J(p,b){return p+". Errors: "+Object.keys(b).map(function(T){return b[T].toString()}).filter(function(T,O,F){return F.indexOf(T)===O}).join(`
40
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dje(e){var t;return typeof e=="function"?t={callback:e}:t=e,t}function hje(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,i,o,s=function(l){for(var u=arguments.length,c=new Array(u>1?u-1:0),d=1;d<u;d++)c[d-1]=arguments[d];if(o=c,!(r&&l===i)){var h=n.leading;typeof h=="function"&&(h=h(l,i)),(!r||l!==i)&&h&&e.apply(void 0,[l].concat(Kse(o))),i=l,clearTimeout(r),r=setTimeout(function(){e.apply(void 0,[l].concat(Kse(o))),r=0},t)}};return s._clear=function(){clearTimeout(r),r=null},s}function Yse(e,t){if(e===t)return!0;if(_M(e)==="object"){for(var n in e)if(!Yse(e[n],t[n]))return!1;return!0}return!1}var fje=function(){function e(t,n,r){ije(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(n,r)}return sje(e,[{key:"createObserver",value:function(n,r){var i=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=dje(n),this.callback=function(a,l){i.options.callback(a,l),a&&i.options.once&&(i.frozen=!0,i.destroyObserver())},this.callback&&this.options.throttle){var o=this.options.throttleOptions||{},s=o.leading;this.callback=hje(this.callback,this.options.throttle,{leading:function(l){return s==="both"||s==="visible"&&l||s==="hidden"&&!l}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(a){var l=a[0];if(a.length>1){var u=a.find(function(d){return d.isIntersecting});u&&(l=u)}if(i.callback){var c=l.isIntersecting&&l.intersectionRatio>=i.threshold;if(c===i.oldResult)return;i.oldResult=c,i.callback(c,l)}},this.options.intersection),Gt(function(){i.observer&&i.observer.observe(i.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),e}();function Xse(e,t,n){var r=t.value;if(r)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var i=new fje(e,r,n);e._vue_visibilityState=i}}function pje(e,t,n){var r=t.value,i=t.oldValue;if(!Yse(r,i)){var o=e._vue_visibilityState;if(!r){Zse(e);return}o?o.createObserver(r,n):Xse(e,{value:r},n)}}function Zse(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var mje={beforeMount:Xse,updated:pje,unmounted:Zse};function gje(e){return{all:e=e||new Map,on:function(t,n){var r=e.get(t);r&&r.push(n)||e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&r.splice(r.indexOf(n)>>>0,1)},emit:function(t,n){(e.get(t)||[]).slice().map(function(r){r(n)}),(e.get("*")||[]).slice().map(function(r){r(t,n)})}}}var Qse={itemsLimit:1e3},vje=/(auto|scroll)/;function Jse(e,t){return e.parentNode===null?t:Jse(e.parentNode,t.concat([e]))}var kU=function(t,n){return getComputedStyle(t,null).getPropertyValue(n)},yje=function(t){return kU(t,"overflow")+kU(t,"overflow-y")+kU(t,"overflow-x")},bje=function(t){return vje.test(yje(t))};function eae(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=Jse(e.parentNode,[]),n=0;n<t.length;n+=1)if(bje(t[n]))return t[n];return document.scrollingElement||document.documentElement}}function DU(e){"@babel/helpers - typeof";return DU=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},DU(e)}var tae={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(t){return["vertical","horizontal"].includes(t)}},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function nae(){return this.items.length&&DU(this.items[0])!=="object"}var OU=!1;if(typeof window<"u"){OU=!1;try{var wje=Object.defineProperty({},"passive",{get:function(){OU=!0}});window.addEventListener("test",null,wje)}catch{}}let _je=0;var Wk={name:"RecycleScroller",components:{ResizeObserver:wM},directives:{ObserveVisibility:mje},props:{...tae,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},updateInterval:{type:Number,default:0},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},emits:["resize","visible","hidden","update","scroll-start","scroll-end"],data(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes(){if(this.itemSize===null){const e={"-1":{accumulator:0}},t=this.items,n=this.sizeField,r=this.minItemSize;let i=1e4,o=0,s;for(let a=0,l=t.length;a<l;a++)s=t[a][n]||r,s<i&&(i=s),o+=s,e[a]={accumulator:o,size:s};return this.$_computedMinItemSize=i,e}return[]},simpleArray:nae,itemIndexByKey(){const{keyField:e,items:t}=this,n={};for(let r=0,i=t.length;r<i;r++)n[t[r][e]]=r;return n}},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted(){this.applyPageMode(),this.$nextTick(()=>{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const e=this.$_lastUpdateScrollPosition;typeof e=="number"&&this.$nextTick(()=>{this.scrollToPosition(e)})},beforeUnmount(){this.removeListeners()},methods:{addView(e,t,n,r,i){const o=$u({id:_je++,index:t,used:!0,key:r,type:i}),s=Hne({item:n,position:0,nr:o});return e.push(s),s},unuseView(e,t=!1){const n=this.$_unusedViews,r=e.nr.type;let i=n.get(r);i||(i=[],n.set(r,i)),i.push(e),t||(e.nr.used=!1,e.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const t=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:n}=this.updateVisibleItems(!1,!0);n||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});t(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&t()},this.updateInterval))}},handleVisibilityChange(e,t){this.ready&&(e||t.boundingClientRect.width!==0||t.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const n=this.itemSize,r=this.gridItems||1,i=this.itemSecondarySize||n,o=this.$_computedMinItemSize,s=this.typeField,a=this.simpleArray?null:this.keyField,l=this.items,u=l.length,c=this.sizes,d=this.$_views,h=this.$_unusedViews,f=this.pool,g=this.itemIndexByKey;let m,v,_,w,C;if(!u)m=v=w=C=_=0;else if(this.$_prerender)m=w=0,v=C=Math.min(this.prerender,l.length),_=null;else{const k=this.getScroll();if(t){let M=k.start-this.$_lastUpdateScrollPosition;if(M<0&&(M=-M),n===null&&M<o||M<n)return{continuous:!0}}this.$_lastUpdateScrollPosition=k.start;const P=this.buffer;k.start-=P,k.end+=P;let L=0;if(this.$refs.before&&(L=this.$refs.before.scrollHeight,k.start-=L),this.$refs.after){const M=this.$refs.after.scrollHeight;k.end+=M}if(n===null){let M,$=0,B=u-1,N=~~(u/2),V;do V=N,M=c[N].accumulator,M<k.start?$=N:N<u-1&&c[N+1].accumulator>k.start&&(B=N),N=~~(($+B)/2);while(N!==V);for(N<0&&(N=0),m=N,_=c[u-1].accumulator,v=N;v<u&&c[v].accumulator<k.end;v++);for(v===-1?v=l.length-1:(v++,v>u&&(v=u)),w=m;w<u&&L+c[w].accumulator<k.start;w++);for(C=w;C<u&&L+c[C].accumulator<k.end;C++);}else{m=~~(k.start/n*r);const M=m%r;m-=M,v=Math.ceil(k.end/n*r),w=Math.max(0,Math.floor((k.start-L)/n*r)),C=Math.floor((k.end-L)/n*r),m<0&&(m=0),v>u&&(v=u),w<0&&(w=0),C>u&&(C=u),_=Math.ceil(u/r)*n}}v-m>Qse.itemsLimit&&this.itemsLimitError(),this.totalSize=_;let y;const E=m<=this.$_endIndex&&v>=this.$_startIndex;if(E)for(let k=0,P=f.length;k<P;k++)y=f[k],y.nr.used&&(e&&(y.nr.index=g[y.item[a]]),(y.nr.index==null||y.nr.index<m||y.nr.index>=v)&&this.unuseView(y));const x=E?null:new Map;let A,I,D;for(let k=m;k<v;k++){A=l[k];const P=a?A[a]:A;if(P==null)throw new Error(`Key is ${P} on item (keyField is '${a}')`);if(y=d.get(P),!n&&!c[k].size){y&&this.unuseView(y);continue}I=A[s];let L=h.get(I),M=!1;if(!y)E?L&&L.length?y=L.pop():y=this.addView(f,k,A,P,I):(D=x.get(I)||0,(!L||D>=L.length)&&(y=this.addView(f,k,A,P,I),this.unuseView(y,!0),L=h.get(I)),y=L[D],x.set(I,D+1)),d.delete(y.nr.key),y.nr.used=!0,y.nr.index=k,y.nr.key=P,y.nr.type=I,d.set(P,y),M=!0;else if(!y.nr.used&&(y.nr.used=!0,M=!0,L)){const $=L.indexOf(y);$!==-1&&L.splice($,1)}y.item=A,M&&(k===l.length-1&&this.$emit("scroll-end"),k===0&&this.$emit("scroll-start")),n===null?(y.position=c[k-1].accumulator,y.offset=0):(y.position=Math.floor(k/r)*n,y.offset=k%r*i)}return this.$_startIndex=m,this.$_endIndex=v,this.emitUpdate&&this.$emit("update",m,v,w,C),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:E}},getListenerTarget(){let e=eae(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){const{$el:e,direction:t}=this,n=t==="vertical";let r;if(this.pageMode){const i=e.getBoundingClientRect(),o=n?i.height:i.width;let s=-(n?i.top:i.left),a=n?window.innerHeight:window.innerWidth;s<0&&(a+=s,s=0),s+a>o&&(a=o-s),r={start:s,end:s+a}}else n?r={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:r={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return r},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,OU?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(e){let t;const n=this.gridItems||1;this.itemSize===null?t=e>0?this.sizes[e-1].accumulator:0:t=Math.floor(e/n)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,r,i;if(this.pageMode){const o=eae(this.$el),s=o.tagName==="HTML"?0:o[t.scroll],a=o.getBoundingClientRect(),u=this.$el.getBoundingClientRect()[t.start]-a[t.start];n=o,r=t.scroll,i=e+s+u}else n=this.$el,r=t.scroll,i=e;n[r]=i},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((e,t)=>e.nr.index-t.nr.index)}}};const Cje={key:0,ref:"before",class:"vue-recycle-scroller__slot"},Sje={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function xje(e,t,n,r,i,o){const s=yn("ResizeObserver"),a=Bu("observe-visibility");return qt((W(),se("div",{class:et(["vue-recycle-scroller",{ready:i.ready,"page-mode":n.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...l)=>o.handleScroll&&o.handleScroll(...l))},[e.$slots.before?(W(),se("div",Cje,[rt(e.$slots,"before")],512)):je("v-if",!0),(W(),ut(Np(n.listTag),{ref:"wrapper",style:Jt({[e.direction==="vertical"?"minHeight":"minWidth"]:i.totalSize+"px"}),class:et(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:it(()=>[(W(!0),se(Mt,null,vn(i.pool,l=>(W(),ut(Np(n.itemTag),Lt({key:l.nr.id,style:i.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${l.position}px) translate${e.direction==="vertical"?"X":"Y"}(${l.offset}px)`,width:n.gridItems?`${e.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${e.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&i.hoverKey===l.nr.key}]]},H5e(n.skipHover?{}:{mouseenter:()=>{i.hoverKey=l.nr.key},mouseleave:()=>{i.hoverKey=null}})),{default:it(()=>[rt(e.$slots,"default",{item:l.item,index:l.nr.index,active:l.nr.used})]),_:2},1040,["style","class"]))),128)),rt(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?(W(),se("div",Sje,[rt(e.$slots,"after")],512)):je("v-if",!0),Ne(s,{onNotify:o.handleResize},null,8,["onNotify"])],34)),[[a,o.handleVisibilityChange]])}Wk.render=xje,Wk.__file="src/components/RecycleScroller.vue";var CM={name:"DynamicScroller",components:{RecycleScroller:Wk},provide(){return typeof ResizeObserver<"u"&&(this.$_resizeObserver=new ResizeObserver(e=>{requestAnimationFrame(()=>{if(Array.isArray(e)){for(const t of e)if(t.target&&t.target.$_vs_onResize){let n,r;if(t.borderBoxSize){const i=t.borderBoxSize[0];n=i.inlineSize,r=i.blockSize}else n=t.contentRect.width,r=t.contentRect.height;t.target.$_vs_onResize(t.target.$_vs_id,n,r)}}})})),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},inheritAttrs:!1,props:{...tae,minItemSize:{type:[Number,String],required:!0}},emits:["resize","visible"],data(){return{vscrollData:{active:!0,sizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray:nae,itemsWithSize(){const e=[],{items:t,keyField:n,simpleArray:r}=this,i=this.vscrollData.sizes,o=t.length;for(let s=0;s<o;s++){const a=t[s],l=r?s:a[n];let u=i[l];typeof u>"u"&&!this.$_undefinedMap[l]&&(u=0),e.push({item:a,id:l,size:u})}return e}},watch:{items(){this.forceUpdate()},simpleArray:{handler(e){this.vscrollData.simpleArray=e},immediate:!0},direction(e){this.forceUpdate(!0)},itemsWithSize(e,t){const n=this.$el.scrollTop;let r=0,i=0;const o=Math.min(e.length,t.length);for(let a=0;a<o&&!(r>=n);a++)r+=t[a].size||this.minItemSize,i+=e[a].size||this.minItemSize;const s=i-r;s!==0&&(this.$el.scrollTop+=s)}},beforeCreate(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={},this.$_events=gje()},activated(){this.vscrollData.active=!0},deactivated(){this.vscrollData.active=!1},unmounted(){this.$_events.all.clear()},methods:{onScrollerResize(){this.$refs.scroller&&this.forceUpdate(),this.$emit("resize")},onScrollerVisible(){this.$_events.emit("vscroll:update",{force:!1}),this.$emit("visible")},forceUpdate(e=!1){(e||this.simpleArray)&&(this.vscrollData.sizes={}),this.$_events.emit("vscroll:update",{force:!0})},scrollToItem(e){const t=this.$refs.scroller;t&&t.scrollToItem(e)},getItemSize(e,t=void 0){const n=this.simpleArray?t??this.items.indexOf(e):e[this.keyField];return this.vscrollData.sizes[n]||0},scrollToBottom(){if(this.$_scrollingToBottom)return;this.$_scrollingToBottom=!0;const e=this.$el;this.$nextTick(()=>{e.scrollTop=e.scrollHeight+5e3;const t=()=>{e.scrollTop=e.scrollHeight+5e3,requestAnimationFrame(()=>{e.scrollTop=e.scrollHeight+5e3,this.$_undefinedSizes===0?this.$_scrollingToBottom=!1:requestAnimationFrame(t)})};requestAnimationFrame(t)})}}};function Eje(e,t,n,r,i,o){const s=yn("RecycleScroller");return W(),ut(s,Lt({ref:"scroller",items:o.itemsWithSize,"min-item-size":n.minItemSize,direction:e.direction,"key-field":"id","list-tag":e.listTag,"item-tag":e.itemTag},e.$attrs,{onResize:o.onScrollerResize,onVisible:o.onScrollerVisible}),{default:it(({item:a,index:l,active:u})=>[rt(e.$slots,"default",Vo(hs({item:a.item,index:l,active:u,itemWithSize:a})))]),before:it(()=>[rt(e.$slots,"before")]),after:it(()=>[rt(e.$slots,"after")]),empty:it(()=>[rt(e.$slots,"empty")]),_:3},16,["items","min-item-size","direction","list-tag","item-tag","onResize","onVisible"])}CM.render=Eje,CM.__file="src/components/DynamicScroller.vue";var RU={name:"DynamicScrollerItem",inject:["vscrollData","vscrollParent","vscrollResizeObserver"],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},emitResize:{type:Boolean,default:!1},tag:{type:String,default:"div"}},emits:["resize"],computed:{id(){if(this.vscrollData.simpleArray)return this.index;if(this.vscrollData.keyField in this.item)return this.item[this.vscrollData.keyField];throw new Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)},size(){return this.vscrollData.sizes[this.id]||0},finalActive(){return this.active&&this.vscrollData.active}},watch:{watchData:"updateWatchData",id(e,t){if(this.$el.$_vs_id=this.id,this.size||this.onDataUpdate(),this.$_sizeObserved){const n=this.vscrollData.sizes[t],r=this.vscrollData.sizes[e];n!=null&&n!==r&&this.applySize(n)}},finalActive(e){this.size||(e?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?e?this.observeSize():this.unobserveSize():e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created(){if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver)){for(const e in this.sizeDependencies)this.$watch(()=>this.sizeDependencies[e],this.onDataUpdate);this.vscrollParent.$_events.on("vscroll:update",this.onVscrollUpdate)}},mounted(){this.finalActive&&(this.updateSize(),this.observeSize())},beforeUnmount(){this.vscrollParent.$_events.off("vscroll:update",this.onVscrollUpdate),this.unobserveSize()},methods:{updateSize(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData(){this.watchData&&!this.vscrollResizeObserver?this.$_watchData=this.$watch("item",()=>{this.onDataUpdate()},{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate({force:e}){!this.finalActive&&e&&(this.$_pendingVScrollUpdate=this.id),(this.$_forceNextVScrollUpdate===this.id||e||!this.size)&&this.updateSize()},onDataUpdate(){this.updateSize()},computeSize(e){this.$nextTick(()=>{if(this.id===e){const t=this.$el.offsetWidth,n=this.$el.offsetHeight;this.applyWidthHeight(t,n)}this.$_pendingSizeUpdate=null})},applyWidthHeight(e,t){const n=~~(this.vscrollParent.direction==="vertical"?t:e);n&&this.size!==n&&this.applySize(n)},applySize(e){this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.vscrollData.sizes[this.id]=e,this.emitResize&&this.$emit("resize",this.id)},observeSize(){this.vscrollResizeObserver&&(this.$_sizeObserved||(this.vscrollResizeObserver.observe(this.$el),this.$el.$_vs_id=this.id,this.$el.$_vs_onResize=this.onResize,this.$_sizeObserved=!0))},unobserveSize(){this.vscrollResizeObserver&&this.$_sizeObserved&&(this.vscrollResizeObserver.unobserve(this.$el),this.$el.$_vs_onResize=void 0,this.$_sizeObserved=!1)},onResize(e,t,n){this.id===e&&this.applyWidthHeight(t,n)}},render(){return Fl(this.tag,this.$slots.default())}};RU.__file="src/components/DynamicScrollerItem.vue";function Tje(e,t){e.component("".concat(t,"recycle-scroller"),Wk),e.component("".concat(t,"RecycleScroller"),Wk),e.component("".concat(t,"dynamic-scroller"),CM),e.component("".concat(t,"DynamicScroller"),CM),e.component("".concat(t,"dynamic-scroller-item"),RU),e.component("".concat(t,"DynamicScrollerItem"),RU)}var Aje={version:"2.0.0-beta.8",install:function(t,n){var r=Object.assign({},{installComponents:!0,componentsPrefix:""},n);for(var i in r)typeof r[i]<"u"&&(Qse[i]=r[i]);r.installComponents&&Tje(t,r.componentsPrefix)}};const kje=(e,t)=>{const n=o=>t._s.get(o),r=(o,s,a)=>{const l=n(o);return l&&s in l?(l[s](a),!0):(console.warn(`[initWebScene] Store "${o}" or dispactcher "${s}" not found`),!1)};function i(o){var s,a;(a=(s=e==null?void 0:e.config)==null?void 0:s.globalProperties)==null||a.setStoreValue("scene","setCurrentSceneTabId",o)}return e.config.globalProperties.setStoreValue=r,e.config.globalProperties.handleSetTab=i,{handleSetTab:i}},Dje="1.26.3",Oje={"@arbocollab/arbo-chart-component":"1.0.1","@arbocollab/arbo-comment-utils":"1.0.1","@arbocollab/arbo-common-utils":"npm:@arbocollab/arbo-common-utils@1.0.11","@arbocollab/arbo-media-player-component":"1.0.6","@arbocollab/arbo-table-component":"1.0.1","@arbocollab/arbo-ui-components":"npm:@arbocollab/arbo-ui-components-beta@0.0.373-alpha.23","@arbocollab/arbo-calendar-component":"0.0.12","@arbocollab/arbo-metric-table":"npm:@arbocollab/arbo-metric-table@0.0.23","@vueuse/core":"^10.11.1",axios:"^1.7.2","date-fns":"^4.1.0","date-fns-tz":"^3.2.0",dayjs:"^1.11.11",dexie:"4.0.10","js-cookie":"^3.0.5",pinia:"^3.0.3","prettier-plugin-stylus":"^0.1.0","sanitize-html":"^2.15.0","vite-bundle-visualizer":"^1.2.1","vite-plugin-html":"^3.2.2",vue:"^3.5.18","vue-draggable-next":"^2.2.1","vue-i18n":"^9.13.1","vue-router":"^4.5.1","vue-virtual-scroller":"^2.0.0-beta.8"};var fr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gk(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Rje(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var rae={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(fr,function(){var n=function(p,b){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,O){T.__proto__=O}||function(T,O){for(var F in O)Object.prototype.hasOwnProperty.call(O,F)&&(T[F]=O[F])})(p,b)},r=function(){return(r=Object.assign||function(p){for(var b,T=1,O=arguments.length;T<O;T++)for(var F in b=arguments[T])Object.prototype.hasOwnProperty.call(b,F)&&(p[F]=b[F]);return p}).apply(this,arguments)};function i(p,b,T){for(var O,F=0,z=b.length;F<z;F++)!O&&F in b||((O=O||Array.prototype.slice.call(b,0,F))[F]=b[F]);return p.concat(O||Array.prototype.slice.call(b))}var o=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:fr,s=Object.keys,a=Array.isArray;function l(p,b){return typeof b!="object"||s(b).forEach(function(T){p[T]=b[T]}),p}typeof Promise>"u"||o.Promise||(o.Promise=Promise);var u=Object.getPrototypeOf,c={}.hasOwnProperty;function d(p,b){return c.call(p,b)}function h(p,b){typeof b=="function"&&(b=b(u(p))),(typeof Reflect>"u"?s:Reflect.ownKeys)(b).forEach(function(T){g(p,T,b[T])})}var f=Object.defineProperty;function g(p,b,T,O){f(p,b,l(T&&d(T,"get")&&typeof T.get=="function"?{get:T.get,set:T.set,configurable:!0}:{value:T,configurable:!0,writable:!0},O))}function m(p){return{from:function(b){return p.prototype=Object.create(b.prototype),g(p.prototype,"constructor",p),{extend:h.bind(null,p.prototype)}}}}var v=Object.getOwnPropertyDescriptor,_=[].slice;function w(p,b,T){return _.call(p,b,T)}function C(p,b){return b(p)}function y(p){if(!p)throw new Error("Assertion Failed")}function E(p){o.setImmediate?setImmediate(p):setTimeout(p,0)}function x(p,b){if(typeof b=="string"&&d(p,b))return p[b];if(!b)return p;if(typeof b!="string"){for(var T=[],O=0,F=b.length;O<F;++O){var z=x(p,b[O]);T.push(z)}return T}var X=b.indexOf(".");if(X!==-1){var ue=p[b.substr(0,X)];return ue==null?void 0:x(ue,b.substr(X+1))}}function A(p,b,T){if(p&&b!==void 0&&!("isFrozen"in Object&&Object.isFrozen(p)))if(typeof b!="string"&&"length"in b){y(typeof T!="string"&&"length"in T);for(var O=0,F=b.length;O<F;++O)A(p,b[O],T[O])}else{var z,X,ue=b.indexOf(".");ue!==-1?(z=b.substr(0,ue),(X=b.substr(ue+1))===""?T===void 0?a(p)&&!isNaN(parseInt(z))?p.splice(z,1):delete p[z]:p[z]=T:A(ue=!(ue=p[z])||!d(p,z)?p[z]={}:ue,X,T)):T===void 0?a(p)&&!isNaN(parseInt(b))?p.splice(b,1):delete p[b]:p[b]=T}}function I(p){var b,T={};for(b in p)d(p,b)&&(T[b]=p[b]);return T}var D=[].concat;function k(p){return D.apply([],p)}var Ii="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(k([8,16,32,64].map(function(p){return["Int","Uint","Float"].map(function(b){return b+p+"Array"})}))).filter(function(p){return o[p]}),P=new Set(Ii.map(function(p){return o[p]})),L=null;function M(p){return L=new WeakMap,p=function b(T){if(!T||typeof T!="object")return T;var O=L.get(T);if(O)return O;if(a(T)){O=[],L.set(T,O);for(var F=0,z=T.length;F<z;++F)O.push(b(T[F]))}else if(P.has(T.constructor))O=T;else{var X,ue=u(T);for(X in O=ue===Object.prototype?{}:Object.create(ue),L.set(T,O),T)d(T,X)&&(O[X]=b(T[X]))}return O}(p),L=null,p}var $={}.toString;function B(p){return $.call(p).slice(8,-1)}var N=typeof Symbol<"u"?Symbol.iterator:"@@iterator",V=typeof N=="symbol"?function(p){var b;return p!=null&&(b=p[N])&&b.apply(p)}:function(){return null};function K(p,b){return b=p.indexOf(b),0<=b&&p.splice(b,1),0<=b}var te={};function ve(p){var b,T,O,F;if(arguments.length===1){if(a(p))return p.slice();if(this===te&&typeof p=="string")return[p];if(F=V(p)){for(T=[];!(O=F.next()).done;)T.push(O.value);return T}if(p==null)return[p];if(typeof(b=p.length)!="number")return[p];for(T=new Array(b);b--;)T[b]=p[b];return T}for(b=arguments.length,T=new Array(b);b--;)T[b]=arguments[b];return T}var ce=typeof Symbol<"u"?function(p){return p[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},xt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Zr=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(xt),Z={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function U(p,b){this.name=p,this.message=b}function J(p,b){return p+". Errors: "+Object.keys(b).map(function(T){return b[T].toString()}).filter(function(T,O,F){return F.indexOf(T)===O}).join(`
41
41
  `)}function he(p,b,T,O){this.failures=b,this.failedKeys=O,this.successCount=T,this.message=J(p,b)}function ke(p,b){this.name="BulkError",this.failures=Object.keys(b).map(function(T){return b[T]}),this.failuresByPos=b,this.message=J(p,this.failures)}m(U).from(Error).extend({toString:function(){return this.name+": "+this.message}}),m(he).from(U),m(ke).from(U);var we=Zr.reduce(function(p,b){return p[b]=b+"Error",p},{}),Y=U,Q=Zr.reduce(function(p,b){var T=b+"Error";function O(F,z){this.name=T,F?typeof F=="string"?(this.message="".concat(F).concat(z?`
42
42
  `+z:""),this.inner=z||null):typeof F=="object"&&(this.message="".concat(F.name," ").concat(F.message),this.inner=F):(this.message=Z[b]||T,this.inner=null)}return m(O).from(Y),p[b]=O,p},{});Q.Syntax=SyntaxError,Q.Type=TypeError,Q.Range=RangeError;var Le=xt.reduce(function(p,b){return p[b+"Error"]=Q[b],p},{}),Re=Zr.reduce(function(p,b){return["Syntax","Type","Range"].indexOf(b)===-1&&(p[b+"Error"]=Q[b]),p},{});function qe(){}function pe(p){return p}function fe(p,b){return p==null||p===pe?b:function(T){return b(p(T))}}function me(p,b){return function(){p.apply(this,arguments),b.apply(this,arguments)}}function Ye(p,b){return p===qe?b:function(){var T=p.apply(this,arguments);T!==void 0&&(arguments[0]=T);var O=this.onsuccess,F=this.onerror;this.onsuccess=null,this.onerror=null;var z=b.apply(this,arguments);return O&&(this.onsuccess=this.onsuccess?me(O,this.onsuccess):O),F&&(this.onerror=this.onerror?me(F,this.onerror):F),z!==void 0?z:T}}function st(p,b){return p===qe?b:function(){p.apply(this,arguments);var T=this.onsuccess,O=this.onerror;this.onsuccess=this.onerror=null,b.apply(this,arguments),T&&(this.onsuccess=this.onsuccess?me(T,this.onsuccess):T),O&&(this.onerror=this.onerror?me(O,this.onerror):O)}}function Be(p,b){return p===qe?b:function(T){var O=p.apply(this,arguments);l(T,O);var F=this.onsuccess,z=this.onerror;return this.onsuccess=null,this.onerror=null,T=b.apply(this,arguments),F&&(this.onsuccess=this.onsuccess?me(F,this.onsuccess):F),z&&(this.onerror=this.onerror?me(z,this.onerror):z),O===void 0?T===void 0?void 0:T:l(O,T)}}function Xe(p,b){return p===qe?b:function(){return b.apply(this,arguments)!==!1&&p.apply(this,arguments)}}function Ee(p,b){return p===qe?b:function(){var T=p.apply(this,arguments);if(T&&typeof T.then=="function"){for(var O=this,F=arguments.length,z=new Array(F);F--;)z[F]=arguments[F];return T.then(function(){return b.apply(O,z)})}return b.apply(this,arguments)}}Re.ModifyError=he,Re.DexieError=U,Re.BulkError=ke;var Pe=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Je(p){Pe=p}var De={},Ge=100,Ii=typeof Promise>"u"?[]:function(){var p=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[p,u(p),p];var b=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[b,u(b),p]}(),xt=Ii[0],Zr=Ii[1],Ii=Ii[2],Zr=Zr&&Zr.then,Dt=xt&&xt.constructor,gt=!!Ii,wt=function(p,b){Qe.push([p,b]),un&&(queueMicrotask(en),un=!1)},jt=!0,un=!0,In=[],gn=[],Bt=pe,ne={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:qe,pgp:!1,env:{},finalize:qe},ge=ne,Qe=[],pt=0,Ke=[];function ze(p){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var b=this._PSD=ge;if(typeof p!="function"){if(p!==De)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Fe(this,this._value))}this._state=null,this._value=null,++b.ref,function T(O,F){try{F(function(z){if(O._state===null){if(z===O)throw new TypeError("A promise cannot be resolved with itself.");var X=O._lib&&pn();z&&typeof z.then=="function"?T(O,function(ue,Ce){z instanceof ze?z._then(ue,Ce):z.then(ue,Ce)}):(O._state=!0,O._value=z,Ve(O)),X&&kn()}},Fe.bind(null,O))}catch(z){Fe(O,z)}}(this,p)}var Ut={get:function(){var p=ge,b=Eo;function T(O,F){var z=this,X=!p.global&&(p!==ge||b!==Eo),ue=X&&!Ai(),Ce=new ze(function(ie,de){tt(z,new wn(Xl(O,p,X,ue),Xl(F,p,X,ue),ie,de,p))});return this._consoleTask&&(Ce._consoleTask=this._consoleTask),Ce}return T.prototype=De,T},set:function(p){g(this,"then",p&&p.prototype===De?Ut:{get:function(){return p},set:Ut.set})}};function wn(p,b,T,O,F){this.onFulfilled=typeof p=="function"?p:null,this.onRejected=typeof b=="function"?b:null,this.resolve=T,this.reject=O,this.psd=F}function Fe(p,b){var T,O;gn.push(b),p._state===null&&(T=p._lib&&pn(),b=Bt(b),p._state=!1,p._value=b,O=p,In.some(function(F){return F._value===O._value})||In.push(O),Ve(p),T&&kn())}function Ve(p){var b=p._listeners;p._listeners=[];for(var T=0,O=b.length;T<O;++T)tt(p,b[T]);var F=p._PSD;--F.ref||F.finalize(),pt===0&&(++pt,wt(function(){--pt==0&&oi()},[]))}function tt(p,b){if(p._state!==null){var T=p._state?b.onFulfilled:b.onRejected;if(T===null)return(p._state?b.resolve:b.reject)(p._value);++b.psd.ref,++pt,wt(kt,[T,p,b])}else p._listeners.push(b)}function kt(p,b,T){try{var O,F=b._value;!b._state&&gn.length&&(gn=[]),O=Pe&&b._consoleTask?b._consoleTask.run(function(){return p(F)}):p(F),b._state||gn.indexOf(F)!==-1||function(z){for(var X=In.length;X;)if(In[--X]._value===z._value)return In.splice(X,1)}(b),T.resolve(O)}catch(z){T.reject(z)}finally{--pt==0&&oi(),--T.psd.ref||T.psd.finalize()}}function en(){zo(ne,function(){pn()&&kn()})}function pn(){var p=jt;return un=jt=!1,p}function kn(){var p,b,T;do for(;0<Qe.length;)for(p=Qe,Qe=[],T=p.length,b=0;b<T;++b){var O=p[b];O[0].apply(null,O[1])}while(0<Qe.length);un=jt=!0}function oi(){var p=In;In=[],p.forEach(function(O){O._PSD.onunhandled.call(null,O._value,O)});for(var b=Ke.slice(0),T=b.length;T;)b[--T]()}function Ki(p){return new ze(De,!1,p)}function _n(p,b){var T=ge;return function(){var O=pn(),F=ge;try{return Hi(T,!0),p.apply(this,arguments)}catch(z){b&&b(z)}finally{Hi(F,!1),O&&kn()}}}h(ze.prototype,{then:Ut,_then:function(p,b){tt(this,new wn(null,null,p,b,ge))},catch:function(p){if(arguments.length===1)return this.then(null,p);var b=p,T=arguments[1];return typeof b=="function"?this.then(null,function(O){return(O instanceof b?T:Ki)(O)}):this.then(null,function(O){return(O&&O.name===b?T:Ki)(O)})},finally:function(p){return this.then(function(b){return ze.resolve(p()).then(function(){return b})},function(b){return ze.resolve(p()).then(function(){return Ki(b)})})},timeout:function(p,b){var T=this;return p<1/0?new ze(function(O,F){var z=setTimeout(function(){return F(new Q.Timeout(b))},p);T.then(O,F).finally(clearTimeout.bind(null,z))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&g(ze.prototype,Symbol.toStringTag,"Dexie.Promise"),ne.env=nd(),h(ze,{all:function(){var p=ve.apply(null,arguments).map(mr);return new ze(function(b,T){p.length===0&&b([]);var O=p.length;p.forEach(function(F,z){return ze.resolve(F).then(function(X){p[z]=X,--O||b(p)},T)})})},resolve:function(p){return p instanceof ze?p:p&&typeof p.then=="function"?new ze(function(b,T){p.then(b,T)}):new ze(De,!0,p)},reject:Ki,race:function(){var p=ve.apply(null,arguments).map(mr);return new ze(function(b,T){p.map(function(O){return ze.resolve(O).then(b,T)})})},PSD:{get:function(){return ge},set:function(p){return ge=p}},totalEchoes:{get:function(){return Eo}},newPSD:ai,usePSD:zo,scheduler:{get:function(){return wt},set:function(p){wt=p}},rejectionMapper:{get:function(){return Bt},set:function(p){Bt=p}},follow:function(p,b){return new ze(function(T,O){return ai(function(F,z){var X=ge;X.unhandleds=[],X.onunhandled=z,X.finalize=me(function(){var ue,Ce=this;ue=function(){Ce.unhandleds.length===0?F():z(Ce.unhandleds[0])},Ke.push(function ie(){ue(),Ke.splice(Ke.indexOf(ie),1)}),++pt,wt(function(){--pt==0&&oi()},[])},X.finalize),p()},b,T,O)})}}),Dt&&(Dt.allSettled&&g(ze,"allSettled",function(){var p=ve.apply(null,arguments).map(mr);return new ze(function(b){p.length===0&&b([]);var T=p.length,O=new Array(T);p.forEach(function(F,z){return ze.resolve(F).then(function(X){return O[z]={status:"fulfilled",value:X}},function(X){return O[z]={status:"rejected",reason:X}}).then(function(){return--T||b(O)})})})}),Dt.any&&typeof AggregateError<"u"&&g(ze,"any",function(){var p=ve.apply(null,arguments).map(mr);return new ze(function(b,T){p.length===0&&T(new AggregateError([]));var O=p.length,F=new Array(O);p.forEach(function(z,X){return ze.resolve(z).then(function(ue){return b(ue)},function(ue){F[X]=ue,--O||T(new AggregateError(F))})})})}),Dt.withResolvers&&(ze.withResolvers=Dt.withResolvers));var Wn={awaits:0,echoes:0,id:0},Ra=0,xo=[],si=0,Eo=0,Tu=0;function ai(p,b,T,O){var F=ge,z=Object.create(F);return z.parent=F,z.ref=0,z.global=!1,z.id=++Tu,ne.env,z.env=gt?{Promise:ze,PromiseProp:{value:ze,configurable:!0,writable:!0},all:ze.all,race:ze.race,allSettled:ze.allSettled,any:ze.any,resolve:ze.resolve,reject:ze.reject}:{},b&&l(z,b),++F.ref,z.finalize=function(){--this.parent.ref||this.parent.finalize()},O=zo(z,p,T,O),z.ref===0&&z.finalize(),O}function xr(){return Wn.id||(Wn.id=++Ra),++Wn.awaits,Wn.echoes+=Ge,Wn.id}function Ai(){return!!Wn.awaits&&(--Wn.awaits==0&&(Wn.id=0),Wn.echoes=Wn.awaits*Ge,!0)}function mr(p){return Wn.echoes&&p&&p.constructor===Dt?(xr(),p.then(function(b){return Ai(),b},function(b){return Ai(),Gn(b)})):p}function of(){var p=xo[xo.length-1];xo.pop(),Hi(p,!1)}function Hi(p,b){var T,O=ge;(b?!Wn.echoes||si++&&p===ge:!si||--si&&p===ge)||queueMicrotask(b?(function(F){++Eo,Wn.echoes&&--Wn.echoes!=0||(Wn.echoes=Wn.awaits=Wn.id=0),xo.push(ge),Hi(F,!0)}).bind(null,p):of),p!==ge&&(ge=p,O===ne&&(ne.env=nd()),gt&&(T=ne.env.Promise,b=p.env,(O.global||p.global)&&(Object.defineProperty(o,"Promise",b.PromiseProp),T.all=b.all,T.race=b.race,T.resolve=b.resolve,T.reject=b.reject,b.allSettled&&(T.allSettled=b.allSettled),b.any&&(T.any=b.any))))}function nd(){var p=o.Promise;return gt?{Promise:p,PromiseProp:Object.getOwnPropertyDescriptor(o,"Promise"),all:p.all,race:p.race,allSettled:p.allSettled,any:p.any,resolve:p.resolve,reject:p.reject}:{}}function zo(p,b,T,O,F){var z=ge;try{return Hi(p,!0),b(T,O,F)}finally{Hi(z,!1)}}function Xl(p,b,T,O){return typeof p!="function"?p:function(){var F=ge;T&&xr(),Hi(b,!0);try{return p.apply(this,arguments)}finally{Hi(F,!1),O&&queueMicrotask(Ai)}}}function hi(p){Promise===Dt&&Wn.echoes===0?si===0?p():enqueueNativeMicroTask(p):setTimeout(p,0)}(""+Zr).indexOf("[native code]")===-1&&(xr=Ai=qe);var Gn=ze.reject,zi="￿",ji="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",rd="String expected.",As=[],_l="__dbnames",Au="readonly",Zl="readwrite";function To(p,b){return p?b?function(){return p.apply(this,arguments)&&b.apply(this,arguments)}:p:b}var sf={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Ql(p){return typeof p!="string"||/\./.test(p)?function(b){return b}:function(b){return b[p]===void 0&&p in b&&delete(b=M(b))[p],b}}function id(){throw Q.Type()}function rn(p,b){try{var T=af(p),O=af(b);if(T!==O)return T==="Array"?1:O==="Array"?-1:T==="binary"?1:O==="binary"?-1:T==="string"?1:O==="string"?-1:T==="Date"?1:O!=="Date"?NaN:-1;switch(T){case"number":case"Date":case"string":return b<p?1:p<b?-1:0;case"binary":return function(F,z){for(var X=F.length,ue=z.length,Ce=X<ue?X:ue,ie=0;ie<Ce;++ie)if(F[ie]!==z[ie])return F[ie]<z[ie]?-1:1;return X===ue?0:X<ue?-1:1}(ku(p),ku(b));case"Array":return function(F,z){for(var X=F.length,ue=z.length,Ce=X<ue?X:ue,ie=0;ie<Ce;++ie){var de=rn(F[ie],z[ie]);if(de!==0)return de}return X===ue?0:X<ue?-1:1}(p,b)}}catch{}return NaN}function af(p){var b=typeof p;return b!="object"?b:ArrayBuffer.isView(p)?"binary":(p=B(p),p==="ArrayBuffer"?"binary":p)}function ku(p){return p instanceof Uint8Array?p:ArrayBuffer.isView(p)?new Uint8Array(p.buffer,p.byteOffset,p.byteLength):new Uint8Array(p)}var Du=(Cn.prototype._trans=function(p,b,T){var O=this._tx||ge.trans,F=this.name,z=Pe&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(p==="readonly"?"read":"write"," ").concat(this.name));function X(ie,de,ee){if(!ee.schema[F])throw new Q.NotFound("Table "+F+" not part of transaction");return b(ee.idbtrans,ee)}var ue=pn();try{var Ce=O&&O.db._novip===this.db._novip?O===ge.trans?O._promise(p,X,T):ai(function(){return O._promise(p,X,T)},{trans:O,transless:ge.transless||ge}):function ie(de,ee,Te,ye){if(de.idbdb&&(de._state.openComplete||ge.letThrough||de._vip)){var Ae=de._createTransaction(ee,Te,de._dbSchema);try{Ae.create(),de._state.PR1398_maxLoop=3}catch(Ie){return Ie.name===we.InvalidState&&de.isOpen()&&0<--de._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),de.close({disableAutoOpen:!1}),de.open().then(function(){return ie(de,ee,Te,ye)})):Gn(Ie)}return Ae._promise(ee,function(Ie,xe){return ai(function(){return ge.trans=Ae,ye(Ie,xe,Ae)})}).then(function(Ie){if(ee==="readwrite")try{Ae.idbtrans.commit()}catch{}return ee==="readonly"?Ie:Ae._completion.then(function(){return Ie})})}if(de._state.openComplete)return Gn(new Q.DatabaseClosed(de._state.dbOpenError));if(!de._state.isBeingOpened){if(!de._state.autoOpen)return Gn(new Q.DatabaseClosed);de.open().catch(qe)}return de._state.dbReadyPromise.then(function(){return ie(de,ee,Te,ye)})}(this.db,p,[this.name],X);return z&&(Ce._consoleTask=z,Ce=Ce.catch(function(ie){return console.trace(ie),Gn(ie)})),Ce}finally{ue&&kn()}},Cn.prototype.get=function(p,b){var T=this;return p&&p.constructor===Object?this.where(p).first(b):p==null?Gn(new Q.Type("Invalid argument to Table.get()")):this._trans("readonly",function(O){return T.core.get({trans:O,key:p}).then(function(F){return T.hook.reading.fire(F)})}).then(b)},Cn.prototype.where=function(p){if(typeof p=="string")return new this.db.WhereClause(this,p);if(a(p))return new this.db.WhereClause(this,"[".concat(p.join("+"),"]"));var b=s(p);if(b.length===1)return this.where(b[0]).equals(p[b[0]]);var T=this.schema.indexes.concat(this.schema.primKey).filter(function(ue){if(ue.compound&&b.every(function(ie){return 0<=ue.keyPath.indexOf(ie)})){for(var Ce=0;Ce<b.length;++Ce)if(b.indexOf(ue.keyPath[Ce])===-1)return!1;return!0}return!1}).sort(function(ue,Ce){return ue.keyPath.length-Ce.keyPath.length})[0];if(T&&this.db._maxKey!==zi){var z=T.keyPath.slice(0,b.length);return this.where(z).equals(z.map(function(Ce){return p[Ce]}))}!T&&Pe&&console.warn("The query ".concat(JSON.stringify(p)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(b.join("+"),"]"));var O=this.schema.idxByName;function F(ue,Ce){return rn(ue,Ce)===0}var X=b.reduce(function(ee,Ce){var ie=ee[0],de=ee[1],ee=O[Ce],Te=p[Ce];return[ie||ee,ie||!ee?To(de,ee&&ee.multi?function(ye){return ye=x(ye,Ce),a(ye)&&ye.some(function(Ae){return F(Te,Ae)})}:function(ye){return F(Te,x(ye,Ce))}):de]},[null,null]),z=X[0],X=X[1];return z?this.where(z.name).equals(p[z.keyPath]).filter(X):T?this.filter(X):this.where(b).equals("")},Cn.prototype.filter=function(p){return this.toCollection().and(p)},Cn.prototype.count=function(p){return this.toCollection().count(p)},Cn.prototype.offset=function(p){return this.toCollection().offset(p)},Cn.prototype.limit=function(p){return this.toCollection().limit(p)},Cn.prototype.each=function(p){return this.toCollection().each(p)},Cn.prototype.toArray=function(p){return this.toCollection().toArray(p)},Cn.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Cn.prototype.orderBy=function(p){return new this.db.Collection(new this.db.WhereClause(this,a(p)?"[".concat(p.join("+"),"]"):p))},Cn.prototype.reverse=function(){return this.toCollection().reverse()},Cn.prototype.mapToClass=function(p){var b,T=this.db,O=this.name;function F(){return b!==null&&b.apply(this,arguments)||this}(this.schema.mappedClass=p).prototype instanceof id&&(function(Ce,ie){if(typeof ie!="function"&&ie!==null)throw new TypeError("Class extends value "+String(ie)+" is not a constructor or null");function de(){this.constructor=Ce}n(Ce,ie),Ce.prototype=ie===null?Object.create(ie):(de.prototype=ie.prototype,new de)}(F,b=p),Object.defineProperty(F.prototype,"db",{get:function(){return T},enumerable:!1,configurable:!0}),F.prototype.table=function(){return O},p=F);for(var z=new Set,X=p.prototype;X;X=u(X))Object.getOwnPropertyNames(X).forEach(function(Ce){return z.add(Ce)});function ue(Ce){if(!Ce)return Ce;var ie,de=Object.create(p.prototype);for(ie in Ce)if(!z.has(ie))try{de[ie]=Ce[ie]}catch{}return de}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=ue,this.hook("reading",ue),p},Cn.prototype.defineClass=function(){return this.mapToClass(function(p){l(this,p)})},Cn.prototype.add=function(p,b){var T=this,O=this.schema.primKey,F=O.auto,z=O.keyPath,X=p;return z&&F&&(X=Ql(z)(p)),this._trans("readwrite",function(ue){return T.core.mutate({trans:ue,type:"add",keys:b!=null?[b]:null,values:[X]})}).then(function(ue){return ue.numFailures?ze.reject(ue.failures[0]):ue.lastResult}).then(function(ue){if(z)try{A(p,z,ue)}catch{}return ue})},Cn.prototype.update=function(p,b){return typeof p!="object"||a(p)?this.where(":id").equals(p).modify(b):(p=x(p,this.schema.primKey.keyPath),p===void 0?Gn(new Q.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(p).modify(b))},Cn.prototype.put=function(p,b){var T=this,O=this.schema.primKey,F=O.auto,z=O.keyPath,X=p;return z&&F&&(X=Ql(z)(p)),this._trans("readwrite",function(ue){return T.core.mutate({trans:ue,type:"put",values:[X],keys:b!=null?[b]:null})}).then(function(ue){return ue.numFailures?ze.reject(ue.failures[0]):ue.lastResult}).then(function(ue){if(z)try{A(p,z,ue)}catch{}return ue})},Cn.prototype.delete=function(p){var b=this;return this._trans("readwrite",function(T){return b.core.mutate({trans:T,type:"delete",keys:[p]})}).then(function(T){return T.numFailures?ze.reject(T.failures[0]):void 0})},Cn.prototype.clear=function(){var p=this;return this._trans("readwrite",function(b){return p.core.mutate({trans:b,type:"deleteRange",range:sf})}).then(function(b){return b.numFailures?ze.reject(b.failures[0]):void 0})},Cn.prototype.bulkGet=function(p){var b=this;return this._trans("readonly",function(T){return b.core.getMany({keys:p,trans:T}).then(function(O){return O.map(function(F){return b.hook.reading.fire(F)})})})},Cn.prototype.bulkAdd=function(p,b,T){var O=this,F=Array.isArray(b)?b:void 0,z=(T=T||(F?void 0:b))?T.allKeys:void 0;return this._trans("readwrite",function(X){var ie=O.schema.primKey,ue=ie.auto,ie=ie.keyPath;if(ie&&F)throw new Q.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(F&&F.length!==p.length)throw new Q.InvalidArgument("Arguments objects and keys must have the same length");var Ce=p.length,ie=ie&&ue?p.map(Ql(ie)):p;return O.core.mutate({trans:X,type:"add",keys:F,values:ie,wantResults:z}).then(function(Ae){var ee=Ae.numFailures,Te=Ae.results,ye=Ae.lastResult,Ae=Ae.failures;if(ee===0)return z?Te:ye;throw new ke("".concat(O.name,".bulkAdd(): ").concat(ee," of ").concat(Ce," operations failed"),Ae)})})},Cn.prototype.bulkPut=function(p,b,T){var O=this,F=Array.isArray(b)?b:void 0,z=(T=T||(F?void 0:b))?T.allKeys:void 0;return this._trans("readwrite",function(X){var ie=O.schema.primKey,ue=ie.auto,ie=ie.keyPath;if(ie&&F)throw new Q.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(F&&F.length!==p.length)throw new Q.InvalidArgument("Arguments objects and keys must have the same length");var Ce=p.length,ie=ie&&ue?p.map(Ql(ie)):p;return O.core.mutate({trans:X,type:"put",keys:F,values:ie,wantResults:z}).then(function(Ae){var ee=Ae.numFailures,Te=Ae.results,ye=Ae.lastResult,Ae=Ae.failures;if(ee===0)return z?Te:ye;throw new ke("".concat(O.name,".bulkPut(): ").concat(ee," of ").concat(Ce," operations failed"),Ae)})})},Cn.prototype.bulkUpdate=function(p){var b=this,T=this.core,O=p.map(function(X){return X.key}),F=p.map(function(X){return X.changes}),z=[];return this._trans("readwrite",function(X){return T.getMany({trans:X,keys:O,cache:"clone"}).then(function(ue){var Ce=[],ie=[];p.forEach(function(ee,Te){var ye=ee.key,Ae=ee.changes,Ie=ue[Te];if(Ie){for(var xe=0,$e=Object.keys(Ae);xe<$e.length;xe++){var He=$e[xe],Ue=Ae[He];if(He===b.schema.primKey.keyPath){if(rn(Ue,ye)!==0)throw new Q.Constraint("Cannot update primary key in bulkUpdate()")}else A(Ie,He,Ue)}z.push(Te),Ce.push(ye),ie.push(Ie)}});var de=Ce.length;return T.mutate({trans:X,type:"put",keys:Ce,values:ie,updates:{keys:O,changeSpecs:F}}).then(function(ee){var Te=ee.numFailures,ye=ee.failures;if(Te===0)return de;for(var Ae=0,Ie=Object.keys(ye);Ae<Ie.length;Ae++){var xe,$e=Ie[Ae],He=z[Number($e)];He!=null&&(xe=ye[$e],delete ye[$e],ye[He]=xe)}throw new ke("".concat(b.name,".bulkUpdate(): ").concat(Te," of ").concat(de," operations failed"),ye)})})})},Cn.prototype.bulkDelete=function(p){var b=this,T=p.length;return this._trans("readwrite",function(O){return b.core.mutate({trans:O,type:"delete",keys:p})}).then(function(X){var F=X.numFailures,z=X.lastResult,X=X.failures;if(F===0)return z;throw new ke("".concat(b.name,".bulkDelete(): ").concat(F," of ").concat(T," operations failed"),X)})},Cn);function Cn(){}function jo(p){function b(X,ue){if(ue){for(var Ce=arguments.length,ie=new Array(Ce-1);--Ce;)ie[Ce-1]=arguments[Ce];return T[X].subscribe.apply(null,ie),p}if(typeof X=="string")return T[X]}var T={};b.addEventType=z;for(var O=1,F=arguments.length;O<F;++O)z(arguments[O]);return b;function z(X,ue,Ce){if(typeof X!="object"){var ie;ue=ue||Xe;var de={subscribers:[],fire:Ce=Ce||qe,subscribe:function(ee){de.subscribers.indexOf(ee)===-1&&(de.subscribers.push(ee),de.fire=ue(de.fire,ee))},unsubscribe:function(ee){de.subscribers=de.subscribers.filter(function(Te){return Te!==ee}),de.fire=de.subscribers.reduce(ue,Ce)}};return T[X]=b[X]=de}s(ie=X).forEach(function(ee){var Te=ie[ee];if(a(Te))z(ee,ie[ee][0],ie[ee][1]);else{if(Te!=="asap")throw new Q.InvalidArgument("Invalid event config");var ye=z(ee,pe,function(){for(var Ae=arguments.length,Ie=new Array(Ae);Ae--;)Ie[Ae]=arguments[Ae];ye.subscribers.forEach(function(xe){E(function(){xe.apply(null,Ie)})})})}})}}function Ia(p,b){return m(b).from({prototype:p}),b}function Qo(p,b){return!(p.filter||p.algorithm||p.or)&&(b?p.justLimit:!p.replayFilter)}function Jl(p,b){p.filter=To(p.filter,b)}function yc(p,b,T){var O=p.replayFilter;p.replayFilter=O?function(){return To(O(),b())}:b,p.justLimit=T&&!O}function cs(p,b){if(p.isPrimKey)return b.primaryKey;var T=b.getIndexByKeyPath(p.index);if(!T)throw new Q.Schema("KeyPath "+p.index+" on object store "+b.name+" is not indexed");return T}function bc(p,b,T){var O=cs(p,b.schema);return b.openCursor({trans:T,values:!p.keysOnly,reverse:p.dir==="prev",unique:!!p.unique,query:{index:O,range:p.range}})}function Cl(p,b,T,O){var F=p.replayFilter?To(p.filter,p.replayFilter()):p.filter;if(p.or){var z={},X=function(ue,Ce,ie){var de,ee;F&&!F(Ce,ie,function(Te){return Ce.stop(Te)},function(Te){return Ce.fail(Te)})||((ee=""+(de=Ce.primaryKey))=="[object ArrayBuffer]"&&(ee=""+new Uint8Array(de)),d(z,ee)||(z[ee]=!0,b(ue,Ce,ie)))};return Promise.all([p.or._iterate(X,T),wc(bc(p,O,T),p.algorithm,X,!p.keysOnly&&p.valueMapper)])}return wc(bc(p,O,T),To(p.algorithm,F),b,!p.keysOnly&&p.valueMapper)}function wc(p,b,T,O){var F=_n(O?function(z,X,ue){return T(O(z),X,ue)}:T);return p.then(function(z){if(z)return z.start(function(){var X=function(){return z.continue()};b&&!b(z,function(ue){return X=ue},function(ue){z.stop(ue),X=qe},function(ue){z.fail(ue),X=qe})||F(z.value,z,function(ue){return X=ue}),X()})})}var Ii=Symbol(),Yi=(Zd.prototype.execute=function(p){if(this.add!==void 0){var b=this.add;if(a(b))return i(i([],a(p)?p:[],!0),b).sort();if(typeof b=="number")return(Number(p)||0)+b;if(typeof b=="bigint")try{return BigInt(p)+b}catch{return BigInt(0)+b}throw new TypeError("Invalid term ".concat(b))}if(this.remove!==void 0){var T=this.remove;if(a(T))return a(p)?p.filter(function(O){return!T.includes(O)}).sort():[];if(typeof T=="number")return Number(p)-T;if(typeof T=="bigint")try{return BigInt(p)-T}catch{return BigInt(0)-T}throw new TypeError("Invalid subtrahend ".concat(T))}return b=(b=this.replacePrefix)===null||b===void 0?void 0:b[0],b&&typeof p=="string"&&p.startsWith(b)?this.replacePrefix[1]+p.substring(b.length):p},Zd);function Zd(p){Object.assign(this,p)}var Qd=(sn.prototype._read=function(p,b){var T=this._ctx;return T.error?T.table._trans(null,Gn.bind(null,T.error)):T.table._trans("readonly",p).then(b)},sn.prototype._write=function(p){var b=this._ctx;return b.error?b.table._trans(null,Gn.bind(null,b.error)):b.table._trans("readwrite",p,"locked")},sn.prototype._addAlgorithm=function(p){var b=this._ctx;b.algorithm=To(b.algorithm,p)},sn.prototype._iterate=function(p,b){return Cl(this._ctx,p,b,this._ctx.table.core)},sn.prototype.clone=function(p){var b=Object.create(this.constructor.prototype),T=Object.create(this._ctx);return p&&l(T,p),b._ctx=T,b},sn.prototype.raw=function(){return this._ctx.valueMapper=null,this},sn.prototype.each=function(p){var b=this._ctx;return this._read(function(T){return Cl(b,p,T,b.table.core)})},sn.prototype.count=function(p){var b=this;return this._read(function(T){var O=b._ctx,F=O.table.core;if(Qo(O,!0))return F.count({trans:T,query:{index:cs(O,F.schema),range:O.range}}).then(function(X){return Math.min(X,O.limit)});var z=0;return Cl(O,function(){return++z,!1},T,F).then(function(){return z})}).then(p)},sn.prototype.sortBy=function(p,b){var T=p.split(".").reverse(),O=T[0],F=T.length-1;function z(Ce,ie){return ie?z(Ce[T[ie]],ie-1):Ce[O]}var X=this._ctx.dir==="next"?1:-1;function ue(Ce,ie){return rn(z(Ce,F),z(ie,F))*X}return this.toArray(function(Ce){return Ce.sort(ue)}).then(b)},sn.prototype.toArray=function(p){var b=this;return this._read(function(T){var O=b._ctx;if(O.dir==="next"&&Qo(O,!0)&&0<O.limit){var F=O.valueMapper,z=cs(O,O.table.core.schema);return O.table.core.query({trans:T,limit:O.limit,values:!0,query:{index:z,range:O.range}}).then(function(ue){return ue=ue.result,F?ue.map(F):ue})}var X=[];return Cl(O,function(ue){return X.push(ue)},T,O.table.core).then(function(){return X})},p)},sn.prototype.offset=function(p){var b=this._ctx;return p<=0||(b.offset+=p,Qo(b)?yc(b,function(){var T=p;return function(O,F){return T===0||(T===1?--T:F(function(){O.advance(T),T=0}),!1)}}):yc(b,function(){var T=p;return function(){return--T<0}})),this},sn.prototype.limit=function(p){return this._ctx.limit=Math.min(this._ctx.limit,p),yc(this._ctx,function(){var b=p;return function(T,O,F){return--b<=0&&O(F),0<=b}},!0),this},sn.prototype.until=function(p,b){return Jl(this._ctx,function(T,O,F){return!p(T.value)||(O(F),b)}),this},sn.prototype.first=function(p){return this.limit(1).toArray(function(b){return b[0]}).then(p)},sn.prototype.last=function(p){return this.reverse().first(p)},sn.prototype.filter=function(p){var b;return Jl(this._ctx,function(T){return p(T.value)}),(b=this._ctx).isMatch=To(b.isMatch,p),this},sn.prototype.and=function(p){return this.filter(p)},sn.prototype.or=function(p){return new this.db.WhereClause(this._ctx.table,p,this)},sn.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},sn.prototype.desc=function(){return this.reverse()},sn.prototype.eachKey=function(p){var b=this._ctx;return b.keysOnly=!b.isMatch,this.each(function(T,O){p(O.key,O)})},sn.prototype.eachUniqueKey=function(p){return this._ctx.unique="unique",this.eachKey(p)},sn.prototype.eachPrimaryKey=function(p){var b=this._ctx;return b.keysOnly=!b.isMatch,this.each(function(T,O){p(O.primaryKey,O)})},sn.prototype.keys=function(p){var b=this._ctx;b.keysOnly=!b.isMatch;var T=[];return this.each(function(O,F){T.push(F.key)}).then(function(){return T}).then(p)},sn.prototype.primaryKeys=function(p){var b=this._ctx;if(b.dir==="next"&&Qo(b,!0)&&0<b.limit)return this._read(function(O){var F=cs(b,b.table.core.schema);return b.table.core.query({trans:O,values:!1,limit:b.limit,query:{index:F,range:b.range}})}).then(function(O){return O.result}).then(p);b.keysOnly=!b.isMatch;var T=[];return this.each(function(O,F){T.push(F.primaryKey)}).then(function(){return T}).then(p)},sn.prototype.uniqueKeys=function(p){return this._ctx.unique="unique",this.keys(p)},sn.prototype.firstKey=function(p){return this.limit(1).keys(function(b){return b[0]}).then(p)},sn.prototype.lastKey=function(p){return this.reverse().firstKey(p)},sn.prototype.distinct=function(){var p=this._ctx,p=p.index&&p.table.schema.idxByName[p.index];if(!p||!p.multi)return this;var b={};return Jl(this._ctx,function(F){var O=F.primaryKey.toString(),F=d(b,O);return b[O]=!0,!F}),this},sn.prototype.modify=function(p){var b=this,T=this._ctx;return this._write(function(O){var F,z,X;X=typeof p=="function"?p:(F=s(p),z=F.length,function(xe){for(var $e=!1,He=0;He<z;++He){var Ue=F[He],Ze=p[Ue],ct=x(xe,Ue);Ze instanceof Yi?(A(xe,Ue,Ze.execute(ct)),$e=!0):ct!==Ze&&(A(xe,Ue,Ze),$e=!0)}return $e});var ue=T.table.core,ee=ue.schema.primaryKey,Ce=ee.outbound,ie=ee.extractKey,de=200,ee=b.db._options.modifyChunkSize;ee&&(de=typeof ee=="object"?ee[ue.name]||ee["*"]||200:ee);function Te(xe,Ue){var He=Ue.failures,Ue=Ue.numFailures;Ae+=xe-Ue;for(var Ze=0,ct=s(He);Ze<ct.length;Ze++){var vt=ct[Ze];ye.push(He[vt])}}var ye=[],Ae=0,Ie=[];return b.clone().primaryKeys().then(function(xe){function $e(Ue){var Ze=Math.min(de,xe.length-Ue);return ue.getMany({trans:O,keys:xe.slice(Ue,Ue+Ze),cache:"immutable"}).then(function(ct){for(var vt=[],lt=[],dt=Ce?[]:null,ht=[],_t=0;_t<Ze;++_t){var Tt=ct[_t],Wt={value:M(Tt),primKey:xe[Ue+_t]};X.call(Wt,Wt.value,Wt)!==!1&&(Wt.value==null?ht.push(xe[Ue+_t]):Ce||rn(ie(Tt),ie(Wt.value))===0?(lt.push(Wt.value),Ce&&dt.push(xe[Ue+_t])):(ht.push(xe[Ue+_t]),vt.push(Wt.value)))}return Promise.resolve(0<vt.length&&ue.mutate({trans:O,type:"add",values:vt}).then(function(Qt){for(var tn in Qt.failures)ht.splice(parseInt(tn),1);Te(vt.length,Qt)})).then(function(){return(0<lt.length||He&&typeof p=="object")&&ue.mutate({trans:O,type:"put",keys:dt,values:lt,criteria:He,changeSpec:typeof p!="function"&&p,isAdditionalChunk:0<Ue}).then(function(Qt){return Te(lt.length,Qt)})}).then(function(){return(0<ht.length||He&&p===Sl)&&ue.mutate({trans:O,type:"delete",keys:ht,criteria:He,isAdditionalChunk:0<Ue}).then(function(Qt){return Te(ht.length,Qt)})}).then(function(){return xe.length>Ue+Ze&&$e(Ue+de)})})}var He=Qo(T)&&T.limit===1/0&&(typeof p!="function"||p===Sl)&&{index:T.index,range:T.range};return $e(0).then(function(){if(0<ye.length)throw new he("Error modifying one or more objects",ye,Ae,Ie);return xe.length})})})},sn.prototype.delete=function(){var p=this._ctx,b=p.range;return Qo(p)&&(p.isPrimKey||b.type===3)?this._write(function(T){var O=p.table.core.schema.primaryKey,F=b;return p.table.core.count({trans:T,query:{index:O,range:F}}).then(function(z){return p.table.core.mutate({trans:T,type:"deleteRange",range:F}).then(function(X){var ue=X.failures;if(X.lastResult,X.results,X=X.numFailures,X)throw new he("Could not delete some values",Object.keys(ue).map(function(Ce){return ue[Ce]}),z-X);return z-X})})}):this.modify(Sl)},sn);function sn(){}var Sl=function(p,b){return b.value=null};function od(p,b){return p<b?-1:p===b?0:1}function Km(p,b){return b<p?-1:p===b?0:1}function Lr(p,b,T){return p=p instanceof sd?new p.Collection(p):p,p._ctx.error=new(T||TypeError)(b),p}function Wo(p){return new p.Collection(p,function(){return bp("")}).limit(0)}function xl(p,b,T,O){var F,z,X,ue,Ce,ie,de,ee=T.length;if(!T.every(function(Ae){return typeof Ae=="string"}))return Lr(p,rd);function Te(Ae){F=Ae==="next"?function(xe){return xe.toUpperCase()}:function(xe){return xe.toLowerCase()},z=Ae==="next"?function(xe){return xe.toLowerCase()}:function(xe){return xe.toUpperCase()},X=Ae==="next"?od:Km;var Ie=T.map(function(xe){return{lower:z(xe),upper:F(xe)}}).sort(function(xe,$e){return X(xe.lower,$e.lower)});ue=Ie.map(function(xe){return xe.upper}),Ce=Ie.map(function(xe){return xe.lower}),de=(ie=Ae)==="next"?"":O}Te("next"),p=new p.Collection(p,function(){return lo(ue[0],Ce[ee-1]+O)}),p._ondirectionchange=function(Ae){Te(Ae)};var ye=0;return p._addAlgorithm(function(Ae,Ie,xe){var $e=Ae.key;if(typeof $e!="string")return!1;var He=z($e);if(b(He,Ce,ye))return!0;for(var Ue=null,Ze=ye;Ze<ee;++Ze){var ct=function(vt,lt,dt,ht,_t,Tt){for(var Wt=Math.min(vt.length,ht.length),Qt=-1,tn=0;tn<Wt;++tn){var Ur=lt[tn];if(Ur!==ht[tn])return _t(vt[tn],dt[tn])<0?vt.substr(0,tn)+dt[tn]+dt.substr(tn+1):_t(vt[tn],ht[tn])<0?vt.substr(0,tn)+ht[tn]+dt.substr(tn+1):0<=Qt?vt.substr(0,Qt)+lt[Qt]+dt.substr(Qt+1):null;_t(vt[tn],Ur)<0&&(Qt=tn)}return Wt<ht.length&&Tt==="next"?vt+dt.substr(vt.length):Wt<vt.length&&Tt==="prev"?vt.substr(0,dt.length):Qt<0?null:vt.substr(0,Qt)+ht[Qt]+dt.substr(Qt+1)}($e,He,ue[Ze],Ce[Ze],X,ie);ct===null&&Ue===null?ye=Ze+1:(Ue===null||0<X(Ue,ct))&&(Ue=ct)}return Ie(Ue!==null?function(){Ae.continue(Ue+de)}:xe),!1}),p}function lo(p,b,T,O){return{type:2,lower:p,upper:b,lowerOpen:T,upperOpen:O}}function bp(p){return{type:1,lower:p,upper:p}}var sd=(Object.defineProperty(Jn.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Jn.prototype.between=function(p,b,T,O){T=T!==!1,O=O===!0;try{return 0<this._cmp(p,b)||this._cmp(p,b)===0&&(T||O)&&(!T||!O)?Wo(this):new this.Collection(this,function(){return lo(p,b,!T,!O)})}catch{return Lr(this,ji)}},Jn.prototype.equals=function(p){return p==null?Lr(this,ji):new this.Collection(this,function(){return bp(p)})},Jn.prototype.above=function(p){return p==null?Lr(this,ji):new this.Collection(this,function(){return lo(p,void 0,!0)})},Jn.prototype.aboveOrEqual=function(p){return p==null?Lr(this,ji):new this.Collection(this,function(){return lo(p,void 0,!1)})},Jn.prototype.below=function(p){return p==null?Lr(this,ji):new this.Collection(this,function(){return lo(void 0,p,!1,!0)})},Jn.prototype.belowOrEqual=function(p){return p==null?Lr(this,ji):new this.Collection(this,function(){return lo(void 0,p)})},Jn.prototype.startsWith=function(p){return typeof p!="string"?Lr(this,rd):this.between(p,p+zi,!0,!0)},Jn.prototype.startsWithIgnoreCase=function(p){return p===""?this.startsWith(p):xl(this,function(b,T){return b.indexOf(T[0])===0},[p],zi)},Jn.prototype.equalsIgnoreCase=function(p){return xl(this,function(b,T){return b===T[0]},[p],"")},Jn.prototype.anyOfIgnoreCase=function(){var p=ve.apply(te,arguments);return p.length===0?Wo(this):xl(this,function(b,T){return T.indexOf(b)!==-1},p,"")},Jn.prototype.startsWithAnyOfIgnoreCase=function(){var p=ve.apply(te,arguments);return p.length===0?Wo(this):xl(this,function(b,T){return T.some(function(O){return b.indexOf(O)===0})},p,zi)},Jn.prototype.anyOf=function(){var p=this,b=ve.apply(te,arguments),T=this._cmp;try{b.sort(T)}catch{return Lr(this,ji)}if(b.length===0)return Wo(this);var O=new this.Collection(this,function(){return lo(b[0],b[b.length-1])});O._ondirectionchange=function(z){T=z==="next"?p._ascending:p._descending,b.sort(T)};var F=0;return O._addAlgorithm(function(z,X,ue){for(var Ce=z.key;0<T(Ce,b[F]);)if(++F===b.length)return X(ue),!1;return T(Ce,b[F])===0||(X(function(){z.continue(b[F])}),!1)}),O},Jn.prototype.notEqual=function(p){return this.inAnyRange([[-1/0,p],[p,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Jn.prototype.noneOf=function(){var p=ve.apply(te,arguments);if(p.length===0)return new this.Collection(this);try{p.sort(this._ascending)}catch{return Lr(this,ji)}var b=p.reduce(function(T,O){return T?T.concat([[T[T.length-1][1],O]]):[[-1/0,O]]},null);return b.push([p[p.length-1],this.db._maxKey]),this.inAnyRange(b,{includeLowers:!1,includeUppers:!1})},Jn.prototype.inAnyRange=function($e,b){var T=this,O=this._cmp,F=this._ascending,z=this._descending,X=this._min,ue=this._max;if($e.length===0)return Wo(this);if(!$e.every(function(He){return He[0]!==void 0&&He[1]!==void 0&&F(He[0],He[1])<=0}))return Lr(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Q.InvalidArgument);var Ce=!b||b.includeLowers!==!1,ie=b&&b.includeUppers===!0,de,ee=F;function Te(He,Ue){return ee(He[0],Ue[0])}try{(de=$e.reduce(function(He,Ue){for(var Ze=0,ct=He.length;Ze<ct;++Ze){var vt=He[Ze];if(O(Ue[0],vt[1])<0&&0<O(Ue[1],vt[0])){vt[0]=X(vt[0],Ue[0]),vt[1]=ue(vt[1],Ue[1]);break}}return Ze===ct&&He.push(Ue),He},[])).sort(Te)}catch{return Lr(this,ji)}var ye=0,Ae=ie?function(He){return 0<F(He,de[ye][1])}:function(He){return 0<=F(He,de[ye][1])},Ie=Ce?function(He){return 0<z(He,de[ye][0])}:function(He){return 0<=z(He,de[ye][0])},xe=Ae,$e=new this.Collection(this,function(){return lo(de[0][0],de[de.length-1][1],!Ce,!ie)});return $e._ondirectionchange=function(He){ee=He==="next"?(xe=Ae,F):(xe=Ie,z),de.sort(Te)},$e._addAlgorithm(function(He,Ue,Ze){for(var ct,vt=He.key;xe(vt);)if(++ye===de.length)return Ue(Ze),!1;return!Ae(ct=vt)&&!Ie(ct)||(T._cmp(vt,de[ye][1])===0||T._cmp(vt,de[ye][0])===0||Ue(function(){ee===F?He.continue(de[ye][0]):He.continue(de[ye][1])}),!1)}),$e},Jn.prototype.startsWithAnyOf=function(){var p=ve.apply(te,arguments);return p.every(function(b){return typeof b=="string"})?p.length===0?Wo(this):this.inAnyRange(p.map(function(b){return[b,b+zi]})):Lr(this,"startsWithAnyOf() only works with strings")},Jn);function Jn(){}function yi(p){return _n(function(b){return ca(b),p(b.target.error),!1})}function ca(p){p.stopPropagation&&p.stopPropagation(),p.preventDefault&&p.preventDefault()}var Pa="storagemutated",_c="x-storagemutated-1",vo=jo(null,Pa),Jd=(li.prototype._lock=function(){return y(!ge.global),++this._reculock,this._reculock!==1||ge.global||(ge.lockOwnerFor=this),this},li.prototype._unlock=function(){if(y(!ge.global),--this._reculock==0)for(ge.global||(ge.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var p=this._blockedFuncs.shift();try{zo(p[1],p[0])}catch{}}return this},li.prototype._locked=function(){return this._reculock&&ge.lockOwnerFor!==this},li.prototype.create=function(p){var b=this;if(!this.mode)return this;var T=this.db.idbdb,O=this.db._state.dbOpenError;if(y(!this.idbtrans),!p&&!T)switch(O&&O.name){case"DatabaseClosedError":throw new Q.DatabaseClosed(O);case"MissingAPIError":throw new Q.MissingAPI(O.message,O);default:throw new Q.OpenFailed(O)}if(!this.active)throw new Q.TransactionInactive;return y(this._completion._state===null),(p=this.idbtrans=p||(this.db.core||T).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=_n(function(F){ca(F),b._reject(p.error)}),p.onabort=_n(function(F){ca(F),b.active&&b._reject(new Q.Abort(p.error)),b.active=!1,b.on("abort").fire(F)}),p.oncomplete=_n(function(){b.active=!1,b._resolve(),"mutatedParts"in p&&vo.storagemutated.fire(p.mutatedParts)}),this},li.prototype._promise=function(p,b,T){var O=this;if(p==="readwrite"&&this.mode!=="readwrite")return Gn(new Q.ReadOnly("Transaction is readonly"));if(!this.active)return Gn(new Q.TransactionInactive);if(this._locked())return new ze(function(z,X){O._blockedFuncs.push([function(){O._promise(p,b,T).then(z,X)},ge])});if(T)return ai(function(){var z=new ze(function(X,ue){O._lock();var Ce=b(X,ue,O);Ce&&Ce.then&&Ce.then(X,ue)});return z.finally(function(){return O._unlock()}),z._lib=!0,z});var F=new ze(function(z,X){var ue=b(z,X,O);ue&&ue.then&&ue.then(z,X)});return F._lib=!0,F},li.prototype._root=function(){return this.parent?this.parent._root():this},li.prototype.waitFor=function(p){var b,T=this._root(),O=ze.resolve(p);T._waitingFor?T._waitingFor=T._waitingFor.then(function(){return O}):(T._waitingFor=O,T._waitingQueue=[],b=T.idbtrans.objectStore(T.storeNames[0]),function z(){for(++T._spinCount;T._waitingQueue.length;)T._waitingQueue.shift()();T._waitingFor&&(b.get(-1/0).onsuccess=z)}());var F=T._waitingFor;return new ze(function(z,X){O.then(function(ue){return T._waitingQueue.push(_n(z.bind(null,ue)))},function(ue){return T._waitingQueue.push(_n(X.bind(null,ue)))}).finally(function(){T._waitingFor===F&&(T._waitingFor=null)})})},li.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Q.Abort))},li.prototype.table=function(p){var b=this._memoizedTables||(this._memoizedTables={});if(d(b,p))return b[p];var T=this.schema[p];if(!T)throw new Q.NotFound("Table "+p+" not part of transaction");return T=new this.db.Table(p,T,this),T.core=this.db.core.table(p),b[p]=T},li);function li(){}function Cc(p,b,T,O,F,z,X){return{name:p,keyPath:b,unique:T,multi:O,auto:F,compound:z,src:(T&&!X?"&":"")+(O?"*":"")+(F?"++":"")+wp(b)}}function wp(p){return typeof p=="string"?p:p?"["+[].join.call(p,"+")+"]":""}function ad(p,b,T){return{name:p,primKey:b,indexes:T,mappedClass:null,idxByName:(O=function(F){return[F.name,F]},T.reduce(function(F,z,X){return X=O(z,X),X&&(F[X[0]]=X[1]),F},{}))};var O}var da=function(p){try{return p.only([[]]),da=function(){return[[]]},[[]]}catch{return da=function(){return zi},zi}};function ti(p){return p==null?function(){}:typeof p=="string"?(b=p).split(".").length===1?function(T){return T[b]}:function(T){return x(T,b)}:function(T){return x(T,p)};var b}function bi(p){return[].slice.call(p)}var Ov=0;function Fa(p){return p==null?":id":typeof p=="string"?p:"[".concat(p.join("+"),"]")}function pb(p,b,Ce){function O(xe){if(xe.type===3)return null;if(xe.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var ye=xe.lower,Ae=xe.upper,Ie=xe.lowerOpen,xe=xe.upperOpen;return ye===void 0?Ae===void 0?null:b.upperBound(Ae,!!xe):Ae===void 0?b.lowerBound(ye,!!Ie):b.bound(ye,Ae,!!Ie,!!xe)}function F(Te){var ye,Ae=Te.name;return{name:Ae,schema:Te,mutate:function(Ie){var xe=Ie.trans,$e=Ie.type,He=Ie.keys,Ue=Ie.values,Ze=Ie.range;return new Promise(function(ct,vt){ct=_n(ct);var lt=xe.objectStore(Ae),dt=lt.keyPath==null,ht=$e==="put"||$e==="add";if(!ht&&$e!=="delete"&&$e!=="deleteRange")throw new Error("Invalid operation type: "+$e);var _t,Tt=(He||Ue||{length:1}).length;if(He&&Ue&&He.length!==Ue.length)throw new Error("Given keys array must have same length as given values array.");if(Tt===0)return ct({numFailures:0,failures:{},results:[],lastResult:void 0});function Wt(cr){++Ur,ca(cr)}var Qt=[],tn=[],Ur=0;if($e==="deleteRange"){if(Ze.type===4)return ct({numFailures:Ur,failures:tn,results:[],lastResult:void 0});Ze.type===3?Qt.push(_t=lt.clear()):Qt.push(_t=lt.delete(O(Ze)))}else{var dt=ht?dt?[Ue,He]:[Ue,null]:[He,null],zt=dt[0],er=dt[1];if(ht)for(var ir=0;ir<Tt;++ir)Qt.push(_t=er&&er[ir]!==void 0?lt[$e](zt[ir],er[ir]):lt[$e](zt[ir])),_t.onerror=Wt;else for(ir=0;ir<Tt;++ir)Qt.push(_t=lt[$e](zt[ir])),_t.onerror=Wt}function Il(cr){cr=cr.target.result,Qt.forEach(function(Bo,Dc){return Bo.error!=null&&(tn[Dc]=Bo.error)}),ct({numFailures:Ur,failures:tn,results:$e==="delete"?He:Qt.map(function(Bo){return Bo.result}),lastResult:cr})}_t.onerror=function(cr){Wt(cr),Il(cr)},_t.onsuccess=Il})},getMany:function(Ie){var xe=Ie.trans,$e=Ie.keys;return new Promise(function(He,Ue){He=_n(He);for(var Ze,ct=xe.objectStore(Ae),vt=$e.length,lt=new Array(vt),dt=0,ht=0,_t=function(Qt){Qt=Qt.target,lt[Qt._pos]=Qt.result,++ht===dt&&He(lt)},Tt=yi(Ue),Wt=0;Wt<vt;++Wt)$e[Wt]!=null&&((Ze=ct.get($e[Wt]))._pos=Wt,Ze.onsuccess=_t,Ze.onerror=Tt,++dt);dt===0&&He(lt)})},get:function(Ie){var xe=Ie.trans,$e=Ie.key;return new Promise(function(He,Ue){He=_n(He);var Ze=xe.objectStore(Ae).get($e);Ze.onsuccess=function(ct){return He(ct.target.result)},Ze.onerror=yi(Ue)})},query:(ye=ie,function(Ie){return new Promise(function(xe,$e){xe=_n(xe);var He,Ue,Ze,dt=Ie.trans,ct=Ie.values,vt=Ie.limit,_t=Ie.query,lt=vt===1/0?void 0:vt,ht=_t.index,_t=_t.range,dt=dt.objectStore(Ae),ht=ht.isPrimaryKey?dt:dt.index(ht.name),_t=O(_t);if(vt===0)return xe({result:[]});ye?((lt=ct?ht.getAll(_t,lt):ht.getAllKeys(_t,lt)).onsuccess=function(Tt){return xe({result:Tt.target.result})},lt.onerror=yi($e)):(He=0,Ue=!ct&&"openKeyCursor"in ht?ht.openKeyCursor(_t):ht.openCursor(_t),Ze=[],Ue.onsuccess=function(Tt){var Wt=Ue.result;return Wt?(Ze.push(ct?Wt.value:Wt.primaryKey),++He===vt?xe({result:Ze}):void Wt.continue()):xe({result:Ze})},Ue.onerror=yi($e))})}),openCursor:function(Ie){var xe=Ie.trans,$e=Ie.values,He=Ie.query,Ue=Ie.reverse,Ze=Ie.unique;return new Promise(function(ct,vt){ct=_n(ct);var ht=He.index,lt=He.range,dt=xe.objectStore(Ae),dt=ht.isPrimaryKey?dt:dt.index(ht.name),ht=Ue?Ze?"prevunique":"prev":Ze?"nextunique":"next",_t=!$e&&"openKeyCursor"in dt?dt.openKeyCursor(O(lt),ht):dt.openCursor(O(lt),ht);_t.onerror=yi(vt),_t.onsuccess=_n(function(Tt){var Wt,Qt,tn,Ur,zt=_t.result;zt?(zt.___id=++Ov,zt.done=!1,Wt=zt.continue.bind(zt),Qt=(Qt=zt.continuePrimaryKey)&&Qt.bind(zt),tn=zt.advance.bind(zt),Ur=function(){throw new Error("Cursor not stopped")},zt.trans=xe,zt.stop=zt.continue=zt.continuePrimaryKey=zt.advance=function(){throw new Error("Cursor not started")},zt.fail=_n(vt),zt.next=function(){var er=this,ir=1;return this.start(function(){return ir--?er.continue():er.stop()}).then(function(){return er})},zt.start=function(er){function ir(){if(_t.result)try{er()}catch(cr){zt.fail(cr)}else zt.done=!0,zt.start=function(){throw new Error("Cursor behind last entry")},zt.stop()}var Il=new Promise(function(cr,Bo){cr=_n(cr),_t.onerror=yi(Bo),zt.fail=Bo,zt.stop=function(Dc){zt.stop=zt.continue=zt.continuePrimaryKey=zt.advance=Ur,cr(Dc)}});return _t.onsuccess=_n(function(cr){_t.onsuccess=ir,ir()}),zt.continue=Wt,zt.continuePrimaryKey=Qt,zt.advance=tn,ir(),Il},ct(zt)):ct(null)},vt)})},count:function(Ie){var xe=Ie.query,$e=Ie.trans,He=xe.index,Ue=xe.range;return new Promise(function(Ze,ct){var vt=$e.objectStore(Ae),lt=He.isPrimaryKey?vt:vt.index(He.name),vt=O(Ue),lt=vt?lt.count(vt):lt.count();lt.onsuccess=_n(function(dt){return Ze(dt.target.result)}),lt.onerror=yi(ct)})}}}var z,X,ue,de=(X=Ce,ue=bi((z=p).objectStoreNames),{schema:{name:z.name,tables:ue.map(function(Te){return X.objectStore(Te)}).map(function(Te){var ye=Te.keyPath,xe=Te.autoIncrement,Ae=a(ye),Ie={},xe={name:Te.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:ye==null,compound:Ae,keyPath:ye,autoIncrement:xe,unique:!0,extractKey:ti(ye)},indexes:bi(Te.indexNames).map(function($e){return Te.index($e)}).map(function(Ze){var He=Ze.name,Ue=Ze.unique,ct=Ze.multiEntry,Ze=Ze.keyPath,ct={name:He,compound:a(Ze),keyPath:Ze,unique:Ue,multiEntry:ct,extractKey:ti(Ze)};return Ie[Fa(Ze)]=ct}),getIndexByKeyPath:function($e){return Ie[Fa($e)]}};return Ie[":id"]=xe.primaryKey,ye!=null&&(Ie[Fa(ye)]=xe.primaryKey),xe})},hasGetAll:0<ue.length&&"getAll"in X.objectStore(ue[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),Ce=de.schema,ie=de.hasGetAll,de=Ce.tables.map(F),ee={};return de.forEach(function(Te){return ee[Te.name]=Te}),{stack:"dbcore",transaction:p.transaction.bind(p),table:function(Te){if(!ee[Te])throw new Error("Table '".concat(Te,"' not found"));return ee[Te]},MIN_KEY:-1/0,MAX_KEY:da(b),schema:Ce}}function mb(p,b,T,O){var F=T.IDBKeyRange;return T.indexedDB,{dbcore:(O=pb(b,F,O),p.dbcore.reduce(function(z,X){return X=X.create,r(r({},z),X(z))},O))}}function eu(p,O){var T=O.db,O=mb(p._middlewares,T,p._deps,O);p.core=O.dbcore,p.tables.forEach(function(F){var z=F.name;p.core.schema.tables.some(function(X){return X.name===z})&&(F.core=p.core.table(z),p[z]instanceof p.Table&&(p[z].core=F.core))})}function tu(p,b,T,O){T.forEach(function(F){var z=O[F];b.forEach(function(X){var ue=function Ce(ie,de){return v(ie,de)||(ie=u(ie))&&Ce(ie,de)}(X,F);(!ue||"value"in ue&&ue.value===void 0)&&(X===p.Transaction.prototype||X instanceof p.Transaction?g(X,F,{get:function(){return this.table(F)},set:function(Ce){f(this,F,{value:Ce,writable:!0,configurable:!0,enumerable:!0})}}):X[F]=new p.Table(F,z))})})}function Sc(p,b){b.forEach(function(T){for(var O in T)T[O]instanceof p.Table&&delete T[O]})}function Ym(p,b){return p._cfg.version-b._cfg.version}function ds(p,b,T,O){var F=p._dbSchema;T.objectStoreNames.contains("$meta")&&!F.$meta&&(F.$meta=ad("$meta",Ec("")[0],[]),p._storeNames.push("$meta"));var z=p._createTransaction("readwrite",p._storeNames,F);z.create(T),z._completion.catch(O);var X=z._reject.bind(z),ue=ge.transless||ge;ai(function(){return ge.trans=z,ge.transless=ue,b!==0?(eu(p,T),ie=b,((Ce=z).storeNames.includes("$meta")?Ce.table("$meta").get("version").then(function(de){return de??ie}):ze.resolve(ie)).then(function(de){return Te=de,ye=z,Ae=T,Ie=[],de=(ee=p)._versions,xe=ee._dbSchema=El(0,ee.idbdb,Ae),(de=de.filter(function($e){return $e._cfg.version>=Te})).length!==0?(de.forEach(function($e){Ie.push(function(){var He=xe,Ue=$e._cfg.dbschema;Tl(ee,He,Ae),Tl(ee,Ue,Ae),xe=ee._dbSchema=Ue;var Ze=ks(He,Ue);Ze.add.forEach(function(ht){xc(Ae,ht[0],ht[1].primKey,ht[1].indexes)}),Ze.change.forEach(function(ht){if(ht.recreate)throw new Q.Upgrade("Not yet support for changing primary key");var _t=Ae.objectStore(ht.name);ht.add.forEach(function(Tt){return Ao(_t,Tt)}),ht.change.forEach(function(Tt){_t.deleteIndex(Tt.name),Ao(_t,Tt)}),ht.del.forEach(function(Tt){return _t.deleteIndex(Tt)})});var ct=$e._cfg.contentUpgrade;if(ct&&$e._cfg.version>Te){eu(ee,Ae),ye._memoizedTables={};var vt=I(Ue);Ze.del.forEach(function(ht){vt[ht]=He[ht]}),Sc(ee,[ee.Transaction.prototype]),tu(ee,[ee.Transaction.prototype],s(vt),vt),ye.schema=vt;var lt,dt=ce(ct);return dt&&xr(),Ze=ze.follow(function(){var ht;(lt=ct(ye))&&dt&&(ht=Ai.bind(null,null),lt.then(ht,ht))}),lt&&typeof lt.then=="function"?ze.resolve(lt):Ze.then(function(){return lt})}}),Ie.push(function(He){var Ue,Ze,ct=$e._cfg.dbschema;Ue=ct,Ze=He,[].slice.call(Ze.db.objectStoreNames).forEach(function(vt){return Ue[vt]==null&&Ze.db.deleteObjectStore(vt)}),Sc(ee,[ee.Transaction.prototype]),tu(ee,[ee.Transaction.prototype],ee._storeNames,ee._dbSchema),ye.schema=ee._dbSchema}),Ie.push(function(He){ee.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(ee.idbdb.version/10)===$e._cfg.version?(ee.idbdb.deleteObjectStore("$meta"),delete ee._dbSchema.$meta,ee._storeNames=ee._storeNames.filter(function(Ue){return Ue!=="$meta"})):He.objectStore("$meta").put($e._cfg.version,"version"))})}),function $e(){return Ie.length?ze.resolve(Ie.shift()(ye.idbtrans)).then($e):ze.resolve()}().then(function(){eh(xe,Ae)})):ze.resolve();var ee,Te,ye,Ae,Ie,xe}).catch(X)):(s(F).forEach(function(de){xc(T,de,F[de].primKey,F[de].indexes)}),eu(p,T),void ze.follow(function(){return p.on.populate.fire(z)}).catch(X));var Ce,ie})}function _p(p,b){eh(p._dbSchema,b),b.db.version%10!=0||b.objectStoreNames.contains("$meta")||b.db.createObjectStore("$meta").add(Math.ceil(b.db.version/10-1),"version");var T=El(0,p.idbdb,b);Tl(p,p._dbSchema,b);for(var O=0,F=ks(T,p._dbSchema).change;O<F.length;O++){var z=function(X){if(X.change.length||X.recreate)return console.warn("Unable to patch indexes of table ".concat(X.name," because it has changes on the type of index or primary key.")),{value:void 0};var ue=b.objectStore(X.name);X.add.forEach(function(Ce){Pe&&console.debug("Dexie upgrade patch: Creating missing index ".concat(X.name,".").concat(Ce.src)),Ao(ue,Ce)})}(F[O]);if(typeof z=="object")return z.value}}function ks(p,b){var T,O={del:[],add:[],change:[]};for(T in p)b[T]||O.del.push(T);for(T in b){var F=p[T],z=b[T];if(F){var X={name:T,def:z,recreate:!1,del:[],add:[],change:[]};if(""+(F.primKey.keyPath||"")!=""+(z.primKey.keyPath||"")||F.primKey.auto!==z.primKey.auto)X.recreate=!0,O.change.push(X);else{var ue=F.idxByName,Ce=z.idxByName,ie=void 0;for(ie in ue)Ce[ie]||X.del.push(ie);for(ie in Ce){var de=ue[ie],ee=Ce[ie];de?de.src!==ee.src&&X.change.push(ee):X.add.push(ee)}(0<X.del.length||0<X.add.length||0<X.change.length)&&O.change.push(X)}}else O.add.push([T,z])}return O}function xc(p,b,T,O){var F=p.db.createObjectStore(b,T.keyPath?{keyPath:T.keyPath,autoIncrement:T.auto}:{autoIncrement:T.auto});return O.forEach(function(z){return Ao(F,z)}),F}function eh(p,b){s(p).forEach(function(T){b.db.objectStoreNames.contains(T)||(Pe&&console.debug("Dexie: Creating missing table",T),xc(b,T,p[T].primKey,p[T].indexes))})}function Ao(p,b){p.createIndex(b.name,b.keyPath,{unique:b.unique,multiEntry:b.multi})}function El(p,b,T){var O={};return w(b.objectStoreNames,0).forEach(function(F){for(var z=T.objectStore(F),X=Cc(wp(ie=z.keyPath),ie||"",!0,!1,!!z.autoIncrement,ie&&typeof ie!="string",!0),ue=[],Ce=0;Ce<z.indexNames.length;++Ce){var de=z.index(z.indexNames[Ce]),ie=de.keyPath,de=Cc(de.name,ie,!!de.unique,!!de.multiEntry,!1,ie&&typeof ie!="string",!1);ue.push(de)}O[F]=ad(F,X,ue)}),O}function Tl(p,b,T){for(var O=T.db.objectStoreNames,F=0;F<O.length;++F){var z=O[F],X=T.objectStore(z);p._hasGetAll="getAll"in X;for(var ue=0;ue<X.indexNames.length;++ue){var Ce=X.indexNames[ue],ie=X.index(Ce).keyPath,de=typeof ie=="string"?ie:"["+w(ie).join("+")+"]";!b[z]||(ie=b[z].idxByName[de])&&(ie.name=Ce,delete b[z].idxByName[de],b[z].idxByName[Ce]=ie)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&o.WorkerGlobalScope&&o instanceof o.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(p._hasGetAll=!1)}function Ec(p){return p.split(",").map(function(b,T){var O=(b=b.trim()).replace(/([&*]|\+\+)/g,""),F=/^\[/.test(O)?O.match(/^\[(.*)\]$/)[1].split("+"):O;return Cc(O,F||null,/\&/.test(b),/\*/.test(b),/\+\+/.test(b),a(F),T===0)})}var th=(Hs.prototype._parseStoresSpec=function(p,b){s(p).forEach(function(T){if(p[T]!==null){var O=Ec(p[T]),F=O.shift();if(F.unique=!0,F.multi)throw new Q.Schema("Primary key cannot be multi-valued");O.forEach(function(z){if(z.auto)throw new Q.Schema("Only primary key can be marked as autoIncrement (++)");if(!z.keyPath)throw new Q.Schema("Index must have a name and cannot be an empty string")}),b[T]=ad(T,F,O)}})},Hs.prototype.stores=function(T){var b=this.db;this._cfg.storesSource=this._cfg.storesSource?l(this._cfg.storesSource,T):T;var T=b._versions,O={},F={};return T.forEach(function(z){l(O,z._cfg.storesSource),F=z._cfg.dbschema={},z._parseStoresSpec(O,F)}),b._dbSchema=F,Sc(b,[b._allTables,b,b.Transaction.prototype]),tu(b,[b._allTables,b,b.Transaction.prototype,this._cfg.tables],s(F),F),b._storeNames=s(F),this},Hs.prototype.upgrade=function(p){return this._cfg.contentUpgrade=Ee(this._cfg.contentUpgrade||qe,p),this},Hs);function Hs(){}function Al(p,b){var T=p._dbNamesDB;return T||(T=p._dbNamesDB=new Li(_l,{addons:[],indexedDB:p,IDBKeyRange:b})).version(1).stores({dbnames:"name"}),T.table("dbnames")}function wi(p){return p&&typeof p.databases=="function"}function zs(p){return ai(function(){return ge.letThrough=!0,p()})}function ko(p){return!("from"in p)}var ur=function(p,b){if(!this){var T=new ur;return p&&"d"in p&&l(T,p),T}l(this,arguments.length?{d:1,from:p,to:1<arguments.length?b:p}:{d:0})};function ha(p,b,T){var O=rn(b,T);if(!isNaN(O)){if(0<O)throw RangeError();if(ko(p))return l(p,{from:b,to:T,d:1});var F=p.l,O=p.r;if(rn(T,p.from)<0)return F?ha(F,b,T):p.l={from:b,to:T,d:1,l:null,r:null},ki(p);if(0<rn(b,p.to))return O?ha(O,b,T):p.r={from:b,to:T,d:1,l:null,r:null},ki(p);rn(b,p.from)<0&&(p.from=b,p.l=null,p.d=O?O.d+1:1),0<rn(T,p.to)&&(p.to=T,p.r=null,p.d=p.l?p.l.d+1:1),T=!p.r,F&&!p.l&&$o(p,F),O&&T&&$o(p,O)}}function $o(p,b){ko(b)||function T(O,Ce){var z=Ce.from,X=Ce.to,ue=Ce.l,Ce=Ce.r;ha(O,z,X),ue&&T(O,ue),Ce&&T(O,Ce)}(p,b)}function ld(p,b){var T=nl(b),O=T.next();if(O.done)return!1;for(var F=O.value,z=nl(p),X=z.next(F.from),ue=X.value;!O.done&&!X.done;){if(rn(ue.from,F.to)<=0&&0<=rn(ue.to,F.from))return!0;rn(F.from,ue.from)<0?F=(O=T.next(ue.from)).value:ue=(X=z.next(F.from)).value}return!1}function nl(p){var b=ko(p)?null:{s:0,n:p};return{next:function(T){for(var O=0<arguments.length;b;)switch(b.s){case 0:if(b.s=1,O)for(;b.n.l&&rn(T,b.n.from)<0;)b={up:b,n:b.n.l,s:1};else for(;b.n.l;)b={up:b,n:b.n.l,s:1};case 1:if(b.s=2,!O||rn(T,b.n.to)<=0)return{value:b.n,done:!1};case 2:if(b.n.r){b.s=3,b={up:b,n:b.n.r,s:0};continue}case 3:b=b.up}return{done:!0}}}}function ki(p){var b,T,O=(((b=p.r)===null||b===void 0?void 0:b.d)||0)-(((T=p.l)===null||T===void 0?void 0:T.d)||0),F=1<O?"r":O<-1?"l":"";F&&(b=F=="r"?"l":"r",T=r({},p),O=p[F],p.from=O.from,p.to=O.to,p[F]=O[F],T[F]=O[b],(p[b]=T).d=rl(T)),p.d=rl(p)}function rl(T){var b=T.r,T=T.l;return(b?T?Math.max(b.d,T.d):b.d:T?T.d:0)+1}function js(p,b){return s(b).forEach(function(T){p[T]?$o(p[T],b[T]):p[T]=function O(F){var z,X,ue={};for(z in F)d(F,z)&&(X=F[z],ue[z]=!X||typeof X!="object"||P.has(X.constructor)?X:O(X));return ue}(b[T])}),p}function kl(p,b){return p.all||b.all||Object.keys(p).some(function(T){return b[T]&&ld(b[T],p[T])})}h(ur.prototype,((Zr={add:function(p){return $o(this,p),this},addKey:function(p){return ha(this,p,p),this},addKeys:function(p){var b=this;return p.forEach(function(T){return ha(b,T,T)}),this},hasKey:function(p){var b=nl(this).next(p).value;return b&&rn(b.from,p)<=0&&0<=rn(b.to,p)}})[N]=function(){return nl(this)},Zr));var Xi={},Ma={},ud=!1;function Dl(p){js(Ma,p),ud||(ud=!0,setTimeout(function(){ud=!1,Ou(Ma,!(Ma={}))},0))}function Ou(p,b){b===void 0&&(b=!1);var T=new Set;if(p.all)for(var O=0,F=Object.values(Xi);O<F.length;O++)Tc(X=F[O],p,T,b);else for(var z in p){var X,ue=/^idb\:\/\/(.*)\/(.*)\//.exec(z);ue&&(z=ue[1],ue=ue[2],(X=Xi["idb://".concat(z,"/").concat(ue)])&&Tc(X,p,T,b))}T.forEach(function(Ce){return Ce()})}function Tc(p,b,T,O){for(var F=[],z=0,X=Object.entries(p.queries.query);z<X.length;z++){for(var ue=X[z],Ce=ue[0],ie=[],de=0,ee=ue[1];de<ee.length;de++){var Te=ee[de];kl(b,Te.obsSet)?Te.subscribers.forEach(function(xe){return T.add(xe)}):O&&ie.push(Te)}O&&F.push([Ce,ie])}if(O)for(var ye=0,Ae=F;ye<Ae.length;ye++){var Ie=Ae[ye],Ce=Ie[0],ie=Ie[1];p.queries.query[Ce]=ie}}function nh(p){var b=p._state,T=p._deps.indexedDB;if(b.isBeingOpened||p.idbdb)return b.dbReadyPromise.then(function(){return b.dbOpenError?Gn(b.dbOpenError):p});b.isBeingOpened=!0,b.dbOpenError=null,b.openComplete=!1;var O=b.openCanceller,F=Math.round(10*p.verno),z=!1;function X(){if(b.openCanceller!==O)throw new Q.DatabaseClosed("db.open() was cancelled")}function ue(){return new ze(function(Te,ye){if(X(),!T)throw new Q.MissingAPI;var Ae=p.name,Ie=b.autoSchema||!F?T.open(Ae):T.open(Ae,F);if(!Ie)throw new Q.MissingAPI;Ie.onerror=yi(ye),Ie.onblocked=_n(p._fireOnBlocked),Ie.onupgradeneeded=_n(function(xe){var $e;de=Ie.transaction,b.autoSchema&&!p._options.allowEmptyDB?(Ie.onerror=ca,de.abort(),Ie.result.close(),($e=T.deleteDatabase(Ae)).onsuccess=$e.onerror=_n(function(){ye(new Q.NoSuchDatabase("Database ".concat(Ae," doesnt exist")))})):(de.onerror=yi(ye),xe=xe.oldVersion>Math.pow(2,62)?0:xe.oldVersion,ee=xe<1,p.idbdb=Ie.result,z&&_p(p,de),ds(p,xe/10,de,ye))},ye),Ie.onsuccess=_n(function(){de=null;var xe,$e,He,Ue,Ze,ct=p.idbdb=Ie.result,vt=w(ct.objectStoreNames);if(0<vt.length)try{var lt=ct.transaction((Ue=vt).length===1?Ue[0]:Ue,"readonly");if(b.autoSchema)$e=ct,He=lt,(xe=p).verno=$e.version/10,He=xe._dbSchema=El(0,$e,He),xe._storeNames=w($e.objectStoreNames,0),tu(xe,[xe._allTables],s(He),He);else if(Tl(p,p._dbSchema,lt),((Ze=ks(El(0,(Ze=p).idbdb,lt),Ze._dbSchema)).add.length||Ze.change.some(function(dt){return dt.add.length||dt.change.length}))&&!z)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),ct.close(),F=ct.version+1,z=!0,Te(ue());eu(p,lt)}catch{}As.push(p),ct.onversionchange=_n(function(dt){b.vcFired=!0,p.on("versionchange").fire(dt)}),ct.onclose=_n(function(dt){p.on("close").fire(dt)}),ee&&(Ze=p._deps,lt=Ae,ct=Ze.indexedDB,Ze=Ze.IDBKeyRange,wi(ct)||lt===_l||Al(ct,Ze).put({name:lt}).catch(qe)),Te()},ye)}).catch(function(Te){switch(Te==null?void 0:Te.name){case"UnknownError":if(0<b.PR1398_maxLoop)return b.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),ue();break;case"VersionError":if(0<F)return F=0,ue()}return ze.reject(Te)})}var Ce,ie=b.dbReadyResolve,de=null,ee=!1;return ze.race([O,(typeof navigator>"u"?ze.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(Te){function ye(){return indexedDB.databases().finally(Te)}Ce=setInterval(ye,100),ye()}).finally(function(){return clearInterval(Ce)}):Promise.resolve()).then(ue)]).then(function(){return X(),b.onReadyBeingFired=[],ze.resolve(zs(function(){return p.on.ready.fire(p.vip)})).then(function Te(){if(0<b.onReadyBeingFired.length){var ye=b.onReadyBeingFired.reduce(Ee,qe);return b.onReadyBeingFired=[],ze.resolve(zs(function(){return ye(p.vip)})).then(Te)}})}).finally(function(){b.openCanceller===O&&(b.onReadyBeingFired=null,b.isBeingOpened=!1)}).catch(function(Te){b.dbOpenError=Te;try{de&&de.abort()}catch{}return O===b.openCanceller&&p._close(),Gn(Te)}).finally(function(){b.openComplete=!0,ie()}).then(function(){var Te;return ee&&(Te={},p.tables.forEach(function(ye){ye.schema.indexes.forEach(function(Ae){Ae.name&&(Te["idb://".concat(p.name,"/").concat(ye.name,"/").concat(Ae.name)]=new ur(-1/0,[[[]]]))}),Te["idb://".concat(p.name,"/").concat(ye.name,"/")]=Te["idb://".concat(p.name,"/").concat(ye.name,"/:dels")]=new ur(-1/0,[[[]]])}),vo(Pa).fire(Te),Ou(Te,!0)),p})}function cd(p){function b(z){return p.next(z)}var T=F(b),O=F(function(z){return p.throw(z)});function F(z){return function(Ce){var ue=z(Ce),Ce=ue.value;return ue.done?Ce:Ce&&typeof Ce.then=="function"?Ce.then(T,O):a(Ce)?Promise.all(Ce).then(T,O):T(Ce)}}return F(b)()}function Ol(p,b,T){for(var O=a(p)?p.slice():[p],F=0;F<T;++F)O.push(b);return O}var lf={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(p){return r(r({},p),{table:function(b){var T=p.table(b),O=T.schema,F={},z=[];function X(ee,Te,ye){var Ae=Fa(ee),Ie=F[Ae]=F[Ae]||[],xe=ee==null?0:typeof ee=="string"?1:ee.length,$e=0<Te,$e=r(r({},ye),{name:$e?"".concat(Ae,"(virtual-from:").concat(ye.name,")"):ye.name,lowLevelIndex:ye,isVirtual:$e,keyTail:Te,keyLength:xe,extractKey:ti(ee),unique:!$e&&ye.unique});return Ie.push($e),$e.isPrimaryKey||z.push($e),1<xe&&X(xe===2?ee[0]:ee.slice(0,xe-1),Te+1,ye),Ie.sort(function(He,Ue){return He.keyTail-Ue.keyTail}),$e}b=X(O.primaryKey.keyPath,0,O.primaryKey),F[":id"]=[b];for(var ue=0,Ce=O.indexes;ue<Ce.length;ue++){var ie=Ce[ue];X(ie.keyPath,0,ie)}function de(ee){var Te,ye=ee.query.index;return ye.isVirtual?r(r({},ee),{query:{index:ye.lowLevelIndex,range:(Te=ee.query.range,ye=ye.keyTail,{type:Te.type===1?2:Te.type,lower:Ol(Te.lower,Te.lowerOpen?p.MAX_KEY:p.MIN_KEY,ye),lowerOpen:!0,upper:Ol(Te.upper,Te.upperOpen?p.MIN_KEY:p.MAX_KEY,ye),upperOpen:!0})}}):ee}return r(r({},T),{schema:r(r({},O),{primaryKey:b,indexes:z,getIndexByKeyPath:function(ee){return(ee=F[Fa(ee)])&&ee[0]}}),count:function(ee){return T.count(de(ee))},query:function(ee){return T.query(de(ee))},openCursor:function(ee){var Te=ee.query.index,ye=Te.keyTail,Ae=Te.isVirtual,Ie=Te.keyLength;return Ae?T.openCursor(de(ee)).then(function($e){return $e&&xe($e)}):T.openCursor(ee);function xe($e){return Object.create($e,{continue:{value:function(He){He!=null?$e.continue(Ol(He,ee.reverse?p.MAX_KEY:p.MIN_KEY,ye)):ee.unique?$e.continue($e.key.slice(0,Ie).concat(ee.reverse?p.MIN_KEY:p.MAX_KEY,ye)):$e.continue()}},continuePrimaryKey:{value:function(He,Ue){$e.continuePrimaryKey(Ol(He,p.MAX_KEY,ye),Ue)}},primaryKey:{get:function(){return $e.primaryKey}},key:{get:function(){var He=$e.key;return Ie===1?He[0]:He.slice(0,Ie)}},value:{get:function(){return $e.value}}})}}})}})}};function Ru(p,b,T,O){return T=T||{},O=O||"",s(p).forEach(function(F){var z,X,ue;d(b,F)?(z=p[F],X=b[F],typeof z=="object"&&typeof X=="object"&&z&&X?(ue=B(z))!==B(X)?T[O+F]=b[F]:ue==="Object"?Ru(z,X,T,O+F+"."):z!==X&&(T[O+F]=b[F]):z!==X&&(T[O+F]=b[F])):T[O+F]=void 0}),s(b).forEach(function(F){d(p,F)||(T[O+F]=b[F])}),T}function nu(p,b){return b.type==="delete"?b.keys:b.keys||b.values.map(p.extractKey)}var Rv={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(p){return r(r({},p),{table:function(b){var T=p.table(b),O=T.schema.primaryKey;return r(r({},T),{mutate:function(F){var z=ge.trans,X=z.table(b).hook,ue=X.deleting,Ce=X.creating,ie=X.updating;switch(F.type){case"add":if(Ce.fire===qe)break;return z._promise("readwrite",function(){return de(F)},!0);case"put":if(Ce.fire===qe&&ie.fire===qe)break;return z._promise("readwrite",function(){return de(F)},!0);case"delete":if(ue.fire===qe)break;return z._promise("readwrite",function(){return de(F)},!0);case"deleteRange":if(ue.fire===qe)break;return z._promise("readwrite",function(){return function ee(Te,ye,Ae){return T.query({trans:Te,values:!1,query:{index:O,range:ye},limit:Ae}).then(function(Ie){var xe=Ie.result;return de({type:"delete",keys:xe,trans:Te}).then(function($e){return 0<$e.numFailures?Promise.reject($e.failures[0]):xe.length<Ae?{failures:[],numFailures:0,lastResult:void 0}:ee(Te,r(r({},ye),{lower:xe[xe.length-1],lowerOpen:!0}),Ae)})})}(F.trans,F.range,1e4)},!0)}return T.mutate(F);function de(ee){var Te,ye,Ae,Ie=ge.trans,xe=ee.keys||nu(O,ee);if(!xe)throw new Error("Keys missing");return(ee=ee.type==="add"||ee.type==="put"?r(r({},ee),{keys:xe}):r({},ee)).type!=="delete"&&(ee.values=i([],ee.values)),ee.keys&&(ee.keys=i([],ee.keys)),Te=T,Ae=xe,((ye=ee).type==="add"?Promise.resolve([]):Te.getMany({trans:ye.trans,keys:Ae,cache:"immutable"})).then(function($e){var He=xe.map(function(Ue,Ze){var ct,vt,lt,dt=$e[Ze],ht={onerror:null,onsuccess:null};return ee.type==="delete"?ue.fire.call(ht,Ue,dt,Ie):ee.type==="add"||dt===void 0?(ct=Ce.fire.call(ht,Ue,ee.values[Ze],Ie),Ue==null&&ct!=null&&(ee.keys[Ze]=Ue=ct,O.outbound||A(ee.values[Ze],O.keyPath,Ue))):(ct=Ru(dt,ee.values[Ze]),(vt=ie.fire.call(ht,ct,Ue,dt,Ie))&&(lt=ee.values[Ze],Object.keys(vt).forEach(function(_t){d(lt,_t)?lt[_t]=vt[_t]:A(lt,_t,vt[_t])}))),ht});return T.mutate(ee).then(function(Ue){for(var Ze=Ue.failures,ct=Ue.results,vt=Ue.numFailures,Ue=Ue.lastResult,lt=0;lt<xe.length;++lt){var dt=(ct||xe)[lt],ht=He[lt];dt==null?ht.onerror&&ht.onerror(Ze[lt]):ht.onsuccess&&ht.onsuccess(ee.type==="put"&&$e[lt]?ee.values[lt]:dt)}return{failures:Ze,results:ct,numFailures:vt,lastResult:Ue}}).catch(function(Ue){return He.forEach(function(Ze){return Ze.onerror&&Ze.onerror(Ue)}),Promise.reject(Ue)})})}}})}})}};function Cp(p,b,T){try{if(!b||b.keys.length<p.length)return null;for(var O=[],F=0,z=0;F<b.keys.length&&z<p.length;++F)rn(b.keys[F],p[z])===0&&(O.push(T?M(b.values[F]):b.values[F]),++z);return O.length===p.length?O:null}catch{return null}}var Sp={stack:"dbcore",level:-1,create:function(p){return{table:function(b){var T=p.table(b);return r(r({},T),{getMany:function(O){if(!O.cache)return T.getMany(O);var F=Cp(O.keys,O.trans._cache,O.cache==="clone");return F?ze.resolve(F):T.getMany(O).then(function(z){return O.trans._cache={keys:O.keys,values:O.cache==="clone"?M(z):z},z})},mutate:function(O){return O.type!=="add"&&(O.trans._cache=null),T.mutate(O)}})}}}};function Ac(p,b){return p.trans.mode==="readonly"&&!!p.subscr&&!p.trans.explicit&&p.trans.db._options.cache!=="disabled"&&!b.schema.primaryKey.outbound}function xp(p,b){switch(p){case"query":return b.values&&!b.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Iv={stack:"dbcore",level:0,name:"Observability",create:function(p){var b=p.schema.name,T=new ur(p.MIN_KEY,p.MAX_KEY);return r(r({},p),{transaction:function(O,F,z){if(ge.subscr&&F!=="readonly")throw new Q.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(ge.querier));return p.transaction(O,F,z)},table:function(O){var F=p.table(O),z=F.schema,X=z.primaryKey,ee=z.indexes,ue=X.extractKey,Ce=X.outbound,ie=X.autoIncrement&&ee.filter(function(ye){return ye.compound&&ye.keyPath.includes(X.keyPath)}),de=r(r({},F),{mutate:function(ye){function Ae(_t){return _t="idb://".concat(b,"/").concat(O,"/").concat(_t),Ue[_t]||(Ue[_t]=new ur)}var Ie,xe,$e,He=ye.trans,Ue=ye.mutatedParts||(ye.mutatedParts={}),Ze=Ae(""),ct=Ae(":dels"),vt=ye.type,ht=ye.type==="deleteRange"?[ye.range]:ye.type==="delete"?[ye.keys]:ye.values.length<50?[nu(X,ye).filter(function(_t){return _t}),ye.values]:[],lt=ht[0],dt=ht[1],ht=ye.trans._cache;return a(lt)?(Ze.addKeys(lt),(ht=vt==="delete"||lt.length===dt.length?Cp(lt,ht):null)||ct.addKeys(lt),(ht||dt)&&(Ie=Ae,xe=ht,$e=dt,z.indexes.forEach(function(_t){var Tt=Ie(_t.name||"");function Wt(tn){return tn!=null?_t.extractKey(tn):null}function Qt(tn){return _t.multiEntry&&a(tn)?tn.forEach(function(Ur){return Tt.addKey(Ur)}):Tt.addKey(tn)}(xe||$e).forEach(function(tn,er){var zt=xe&&Wt(xe[er]),er=$e&&Wt($e[er]);rn(zt,er)!==0&&(zt!=null&&Qt(zt),er!=null&&Qt(er))})}))):lt?(dt={from:(dt=lt.lower)!==null&&dt!==void 0?dt:p.MIN_KEY,to:(dt=lt.upper)!==null&&dt!==void 0?dt:p.MAX_KEY},ct.add(dt),Ze.add(dt)):(Ze.add(T),ct.add(T),z.indexes.forEach(function(_t){return Ae(_t.name).add(T)})),F.mutate(ye).then(function(_t){return!lt||ye.type!=="add"&&ye.type!=="put"||(Ze.addKeys(_t.results),ie&&ie.forEach(function(Tt){for(var Wt=ye.values.map(function(zt){return Tt.extractKey(zt)}),Qt=Tt.keyPath.findIndex(function(zt){return zt===X.keyPath}),tn=0,Ur=_t.results.length;tn<Ur;++tn)Wt[tn][Qt]=_t.results[tn];Ae(Tt.name).addKeys(Wt)})),He.mutatedParts=js(He.mutatedParts||{},Ue),_t})}}),ee=function(Ae){var Ie=Ae.query,Ae=Ie.index,Ie=Ie.range;return[Ae,new ur((Ae=Ie.lower)!==null&&Ae!==void 0?Ae:p.MIN_KEY,(Ie=Ie.upper)!==null&&Ie!==void 0?Ie:p.MAX_KEY)]},Te={get:function(ye){return[X,new ur(ye.key)]},getMany:function(ye){return[X,new ur().addKeys(ye.keys)]},count:ee,query:ee,openCursor:ee};return s(Te).forEach(function(ye){de[ye]=function(Ae){var Ie=ge.subscr,xe=!!Ie,$e=Ac(ge,F)&&xp(ye,Ae)?Ae.obsSet={}:Ie;if(xe){var He=function(dt){return dt="idb://".concat(b,"/").concat(O,"/").concat(dt),$e[dt]||($e[dt]=new ur)},Ue=He(""),Ze=He(":dels"),Ie=Te[ye](Ae),xe=Ie[0],Ie=Ie[1];if((ye==="query"&&xe.isPrimaryKey&&!Ae.values?Ze:He(xe.name||"")).add(Ie),!xe.isPrimaryKey){if(ye!=="count"){var ct=ye==="query"&&Ce&&Ae.values&&F.query(r(r({},Ae),{values:!1}));return F[ye].apply(this,arguments).then(function(dt){if(ye==="query"){if(Ce&&Ae.values)return ct.then(function(Wt){return Wt=Wt.result,Ue.addKeys(Wt),dt});var ht=Ae.values?dt.result.map(ue):dt.result;(Ae.values?Ue:Ze).addKeys(ht)}else if(ye==="openCursor"){var _t=dt,Tt=Ae.values;return _t&&Object.create(_t,{key:{get:function(){return Ze.addKey(_t.primaryKey),_t.key}},primaryKey:{get:function(){var Wt=_t.primaryKey;return Ze.addKey(Wt),Wt}},value:{get:function(){return Tt&&Ue.addKey(_t.primaryKey),_t.value}}})}return dt})}Ze.add(T)}}return F[ye].apply(this,arguments)}}),de}})}};function Ds(p,b,T){if(T.numFailures===0)return b;if(b.type==="deleteRange")return null;var O=b.keys?b.keys.length:"values"in b&&b.values?b.values.length:1;return T.numFailures===O?null:(b=r({},b),a(b.keys)&&(b.keys=b.keys.filter(function(F,z){return!(z in T.failures)})),"values"in b&&a(b.values)&&(b.values=b.values.filter(function(F,z){return!(z in T.failures)})),b)}function Rl(p,b){return T=p,((O=b).lower===void 0||(O.lowerOpen?0<rn(T,O.lower):0<=rn(T,O.lower)))&&(p=p,(b=b).upper===void 0||(b.upperOpen?rn(p,b.upper)<0:rn(p,b.upper)<=0));var T,O}function kc(p,b,Te,O,F,z){if(!Te||Te.length===0)return p;var X=b.query.index,ue=X.multiEntry,Ce=b.query.range,ie=O.schema.primaryKey.extractKey,de=X.extractKey,ee=(X.lowLevelIndex||X).extractKey,Te=Te.reduce(function(ye,Ae){var Ie=ye,xe=[];if(Ae.type==="add"||Ae.type==="put")for(var $e=new ur,He=Ae.values.length-1;0<=He;--He){var Ue,Ze=Ae.values[He],ct=ie(Ze);$e.hasKey(ct)||(Ue=de(Ze),(ue&&a(Ue)?Ue.some(function(_t){return Rl(_t,Ce)}):Rl(Ue,Ce))&&($e.addKey(ct),xe.push(Ze)))}switch(Ae.type){case"add":var vt=new ur().addKeys(b.values?ye.map(function(Tt){return ie(Tt)}):ye),Ie=ye.concat(b.values?xe.filter(function(Tt){return Tt=ie(Tt),!vt.hasKey(Tt)&&(vt.addKey(Tt),!0)}):xe.map(function(Tt){return ie(Tt)}).filter(function(Tt){return!vt.hasKey(Tt)&&(vt.addKey(Tt),!0)}));break;case"put":var lt=new ur().addKeys(Ae.values.map(function(Tt){return ie(Tt)}));Ie=ye.filter(function(Tt){return!lt.hasKey(b.values?ie(Tt):Tt)}).concat(b.values?xe:xe.map(function(Tt){return ie(Tt)}));break;case"delete":var dt=new ur().addKeys(Ae.keys);Ie=ye.filter(function(Tt){return!dt.hasKey(b.values?ie(Tt):Tt)});break;case"deleteRange":var ht=Ae.range;Ie=ye.filter(function(Tt){return!Rl(ie(Tt),ht)})}return Ie},p);return Te===p?p:(Te.sort(function(ye,Ae){return rn(ee(ye),ee(Ae))||rn(ie(ye),ie(Ae))}),b.limit&&b.limit<1/0&&(Te.length>b.limit?Te.length=b.limit:p.length===b.limit&&Te.length<b.limit&&(F.dirty=!0)),z?Object.freeze(Te):Te)}function rh(p,b){return rn(p.lower,b.lower)===0&&rn(p.upper,b.upper)===0&&!!p.lowerOpen==!!b.lowerOpen&&!!p.upperOpen==!!b.upperOpen}function Pv(p,b){return function(T,O,F,z){if(T===void 0)return O!==void 0?-1:0;if(O===void 0)return 1;if((O=rn(T,O))===0){if(F&&z)return 0;if(F)return 1;if(z)return-1}return O}(p.lower,b.lower,p.lowerOpen,b.lowerOpen)<=0&&0<=function(T,O,F,z){if(T===void 0)return O!==void 0?1:0;if(O===void 0)return-1;if((O=rn(T,O))===0){if(F&&z)return 0;if(F)return-1;if(z)return 1}return O}(p.upper,b.upper,p.upperOpen,b.upperOpen)}function gb(p,b,T,O){p.subscribers.add(T),O.addEventListener("abort",function(){var F,z;p.subscribers.delete(T),p.subscribers.size===0&&(F=p,z=b,setTimeout(function(){F.subscribers.size===0&&K(z,F)},3e3))})}var Fv={stack:"dbcore",level:0,name:"Cache",create:function(p){var b=p.schema.name;return r(r({},p),{transaction:function(T,O,F){var z,X,ue=p.transaction(T,O,F);return O==="readwrite"&&(X=(z=new AbortController).signal,F=function(Ce){return function(){if(z.abort(),O==="readwrite"){for(var ie=new Set,de=0,ee=T;de<ee.length;de++){var Te=ee[de],ye=Xi["idb://".concat(b,"/").concat(Te)];if(ye){var Ae=p.table(Te),Ie=ye.optimisticOps.filter(function(Tt){return Tt.trans===ue});if(ue._explicit&&Ce&&ue.mutatedParts)for(var xe=0,$e=Object.values(ye.queries.query);xe<$e.length;xe++)for(var He=0,Ue=(vt=$e[xe]).slice();He<Ue.length;He++)kl((lt=Ue[He]).obsSet,ue.mutatedParts)&&(K(vt,lt),lt.subscribers.forEach(function(Tt){return ie.add(Tt)}));else if(0<Ie.length){ye.optimisticOps=ye.optimisticOps.filter(function(Tt){return Tt.trans!==ue});for(var Ze=0,ct=Object.values(ye.queries.query);Ze<ct.length;Ze++)for(var vt,lt,dt,ht=0,_t=(vt=ct[Ze]).slice();ht<_t.length;ht++)(lt=_t[ht]).res!=null&&ue.mutatedParts&&(Ce&&!lt.dirty?(dt=Object.isFrozen(lt.res),dt=kc(lt.res,lt.req,Ie,Ae,lt,dt),lt.dirty?(K(vt,lt),lt.subscribers.forEach(function(Tt){return ie.add(Tt)})):dt!==lt.res&&(lt.res=dt,lt.promise=ze.resolve({result:dt}))):(lt.dirty&&K(vt,lt),lt.subscribers.forEach(function(Tt){return ie.add(Tt)})))}}}ie.forEach(function(Tt){return Tt()})}}},ue.addEventListener("abort",F(!1),{signal:X}),ue.addEventListener("error",F(!1),{signal:X}),ue.addEventListener("complete",F(!0),{signal:X})),ue},table:function(T){var O=p.table(T),F=O.schema.primaryKey;return r(r({},O),{mutate:function(z){var X=ge.trans;if(F.outbound||X.db._options.cache==="disabled"||X.explicit||X.idbtrans.mode!=="readwrite")return O.mutate(z);var ue=Xi["idb://".concat(b,"/").concat(T)];return ue?(X=O.mutate(z),z.type!=="add"&&z.type!=="put"||!(50<=z.values.length||nu(F,z).some(function(Ce){return Ce==null}))?(ue.optimisticOps.push(z),z.mutatedParts&&Dl(z.mutatedParts),X.then(function(Ce){0<Ce.numFailures&&(K(ue.optimisticOps,z),(Ce=Ds(0,z,Ce))&&ue.optimisticOps.push(Ce),z.mutatedParts&&Dl(z.mutatedParts))}),X.catch(function(){K(ue.optimisticOps,z),z.mutatedParts&&Dl(z.mutatedParts)})):X.then(function(Ce){var ie=Ds(0,r(r({},z),{values:z.values.map(function(de,ee){var Te;return Ce.failures[ee]?de:(de=(Te=F.keyPath)!==null&&Te!==void 0&&Te.includes(".")?M(de):r({},de),A(de,F.keyPath,Ce.results[ee]),de)})}),Ce);ue.optimisticOps.push(ie),queueMicrotask(function(){return z.mutatedParts&&Dl(z.mutatedParts)})}),X):O.mutate(z)},query:function(z){if(!Ac(ge,O)||!xp("query",z))return O.query(z);var X=((ie=ge.trans)===null||ie===void 0?void 0:ie.db._options.cache)==="immutable",ee=ge,ue=ee.requery,Ce=ee.signal,ie=function(Ae,Ie,xe,$e){var He=Xi["idb://".concat(Ae,"/").concat(Ie)];if(!He)return[];if(!(Ie=He.queries[xe]))return[null,!1,He,null];var Ue=Ie[($e.query?$e.query.index.name:null)||""];if(!Ue)return[null,!1,He,null];switch(xe){case"query":var Ze=Ue.find(function(ct){return ct.req.limit===$e.limit&&ct.req.values===$e.values&&rh(ct.req.query.range,$e.query.range)});return Ze?[Ze,!0,He,Ue]:[Ue.find(function(ct){return("limit"in ct.req?ct.req.limit:1/0)>=$e.limit&&(!$e.values||ct.req.values)&&Pv(ct.req.query.range,$e.query.range)}),!1,He,Ue];case"count":return Ze=Ue.find(function(ct){return rh(ct.req.query.range,$e.query.range)}),[Ze,!!Ze,He,Ue]}}(b,T,"query",z),de=ie[0],ee=ie[1],Te=ie[2],ye=ie[3];return de&&ee?de.obsSet=z.obsSet:(ee=O.query(z).then(function(Ae){var Ie=Ae.result;if(de&&(de.res=Ie),X){for(var xe=0,$e=Ie.length;xe<$e;++xe)Object.freeze(Ie[xe]);Object.freeze(Ie)}else Ae.result=M(Ie);return Ae}).catch(function(Ae){return ye&&de&&K(ye,de),Promise.reject(Ae)}),de={obsSet:z.obsSet,promise:ee,subscribers:new Set,type:"query",req:z,dirty:!1},ye?ye.push(de):(ye=[de],(Te=Te||(Xi["idb://".concat(b,"/").concat(T)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[z.query.index.name||""]=ye)),gb(de,ye,ue,Ce),de.promise.then(function(Ae){return{result:kc(Ae.result,z,Te==null?void 0:Te.optimisticOps,O,de,X)}})}})}})}};function ru(p,b){return new Proxy(p,{get:function(T,O,F){return O==="db"?b:Reflect.get(T,O,F)}})}var Li=(qn.prototype.version=function(p){if(isNaN(p)||p<.1)throw new Q.Type("Given version is not a positive number");if(p=Math.round(10*p)/10,this.idbdb||this._state.isBeingOpened)throw new Q.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,p);var b=this._versions,T=b.filter(function(O){return O._cfg.version===p})[0];return T||(T=new this.Version(p),b.push(T),b.sort(Ym),T.stores({}),this._state.autoSchema=!1,T)},qn.prototype._whenReady=function(p){var b=this;return this.idbdb&&(this._state.openComplete||ge.letThrough||this._vip)?p():new ze(function(T,O){if(b._state.openComplete)return O(new Q.DatabaseClosed(b._state.dbOpenError));if(!b._state.isBeingOpened){if(!b._state.autoOpen)return void O(new Q.DatabaseClosed);b.open().catch(qe)}b._state.dbReadyPromise.then(T,O)}).then(p)},qn.prototype.use=function(p){var b=p.stack,T=p.create,O=p.level,F=p.name;return F&&this.unuse({stack:b,name:F}),p=this._middlewares[b]||(this._middlewares[b]=[]),p.push({stack:b,create:T,level:O??10,name:F}),p.sort(function(z,X){return z.level-X.level}),this},qn.prototype.unuse=function(p){var b=p.stack,T=p.name,O=p.create;return b&&this._middlewares[b]&&(this._middlewares[b]=this._middlewares[b].filter(function(F){return O?F.create!==O:!!T&&F.name!==T})),this},qn.prototype.open=function(){var p=this;return zo(ne,function(){return nh(p)})},qn.prototype._close=function(){var p=this._state,b=As.indexOf(this);if(0<=b&&As.splice(b,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}p.isBeingOpened||(p.dbReadyPromise=new ze(function(T){p.dbReadyResolve=T}),p.openCanceller=new ze(function(T,O){p.cancelOpen=O}))},qn.prototype.close=function(T){var b=(T===void 0?{disableAutoOpen:!0}:T).disableAutoOpen,T=this._state;b?(T.isBeingOpened&&T.cancelOpen(new Q.DatabaseClosed),this._close(),T.autoOpen=!1,T.dbOpenError=new Q.DatabaseClosed):(this._close(),T.autoOpen=this._options.autoOpen||T.isBeingOpened,T.openComplete=!1,T.dbOpenError=null)},qn.prototype.delete=function(p){var b=this;p===void 0&&(p={disableAutoOpen:!0});var T=0<arguments.length&&typeof arguments[0]!="object",O=this._state;return new ze(function(F,z){function X(){b.close(p);var ue=b._deps.indexedDB.deleteDatabase(b.name);ue.onsuccess=_n(function(){var Ce,ie,de;Ce=b._deps,ie=b.name,de=Ce.indexedDB,Ce=Ce.IDBKeyRange,wi(de)||ie===_l||Al(de,Ce).delete(ie).catch(qe),F()}),ue.onerror=yi(z),ue.onblocked=b._fireOnBlocked}if(T)throw new Q.InvalidArgument("Invalid closeOptions argument to db.delete()");O.isBeingOpened?O.dbReadyPromise.then(X):X()})},qn.prototype.backendDB=function(){return this.idbdb},qn.prototype.isOpen=function(){return this.idbdb!==null},qn.prototype.hasBeenClosed=function(){var p=this._state.dbOpenError;return p&&p.name==="DatabaseClosed"},qn.prototype.hasFailed=function(){return this._state.dbOpenError!==null},qn.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(qn.prototype,"tables",{get:function(){var p=this;return s(this._allTables).map(function(b){return p._allTables[b]})},enumerable:!1,configurable:!0}),qn.prototype.transaction=function(){var p=(function(b,T,O){var F=arguments.length;if(F<2)throw new Q.InvalidArgument("Too few arguments");for(var z=new Array(F-1);--F;)z[F-1]=arguments[F];return O=z.pop(),[b,k(z),O]}).apply(this,arguments);return this._transaction.apply(this,p)},qn.prototype._transaction=function(p,b,T){var O=this,F=ge.trans;F&&F.db===this&&p.indexOf("!")===-1||(F=null);var z,X,ue=p.indexOf("?")!==-1;p=p.replace("!","").replace("?","");try{if(X=b.map(function(ie){if(ie=ie instanceof O.Table?ie.name:ie,typeof ie!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return ie}),p=="r"||p===Au)z=Au;else{if(p!="rw"&&p!=Zl)throw new Q.InvalidArgument("Invalid transaction mode: "+p);z=Zl}if(F){if(F.mode===Au&&z===Zl){if(!ue)throw new Q.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");F=null}F&&X.forEach(function(ie){if(F&&F.storeNames.indexOf(ie)===-1){if(!ue)throw new Q.SubTransaction("Table "+ie+" not included in parent transaction.");F=null}}),ue&&F&&!F.active&&(F=null)}}catch(ie){return F?F._promise(null,function(de,ee){ee(ie)}):Gn(ie)}var Ce=(function ie(de,ee,Te,ye,Ae){return ze.resolve().then(function(){var Ie=ge.transless||ge,xe=de._createTransaction(ee,Te,de._dbSchema,ye);if(xe.explicit=!0,Ie={trans:xe,transless:Ie},ye)xe.idbtrans=ye.idbtrans;else try{xe.create(),xe.idbtrans._explicit=!0,de._state.PR1398_maxLoop=3}catch(Ue){return Ue.name===we.InvalidState&&de.isOpen()&&0<--de._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),de.close({disableAutoOpen:!1}),de.open().then(function(){return ie(de,ee,Te,null,Ae)})):Gn(Ue)}var $e,He=ce(Ae);return He&&xr(),Ie=ze.follow(function(){var Ue;($e=Ae.call(xe,xe))&&(He?(Ue=Ai.bind(null,null),$e.then(Ue,Ue)):typeof $e.next=="function"&&typeof $e.throw=="function"&&($e=cd($e)))},Ie),($e&&typeof $e.then=="function"?ze.resolve($e).then(function(Ue){return xe.active?Ue:Gn(new Q.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):Ie.then(function(){return $e})).then(function(Ue){return ye&&xe._resolve(),xe._completion.then(function(){return Ue})}).catch(function(Ue){return xe._reject(Ue),Gn(Ue)})})}).bind(null,this,z,X,F,T);return F?F._promise(z,Ce,"lock"):ge.trans?zo(ge.transless,function(){return O._whenReady(Ce)}):this._whenReady(Ce)},qn.prototype.table=function(p){if(!d(this._allTables,p))throw new Q.InvalidTable("Table ".concat(p," does not exist"));return this._allTables[p]},qn);function qn(p,b){var T=this;this._middlewares={},this.verno=0;var O=qn.dependencies;this._options=b=r({addons:qn.addons,autoOpen:!0,indexedDB:O.indexedDB,IDBKeyRange:O.IDBKeyRange,cache:"cloned"},b),this._deps={indexedDB:b.indexedDB,IDBKeyRange:b.IDBKeyRange},O=b.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var F,z,X,ue,Ce,ie={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:qe,dbReadyPromise:null,cancelOpen:qe,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:b.autoOpen};ie.dbReadyPromise=new ze(function(ee){ie.dbReadyResolve=ee}),ie.openCanceller=new ze(function(ee,Te){ie.cancelOpen=Te}),this._state=ie,this.name=p,this.on=jo(this,"populate","blocked","versionchange","close",{ready:[Ee,qe]}),this.on.ready.subscribe=C(this.on.ready.subscribe,function(ee){return function(Te,ye){qn.vip(function(){var Ae,Ie=T._state;Ie.openComplete?(Ie.dbOpenError||ze.resolve().then(Te),ye&&ee(Te)):Ie.onReadyBeingFired?(Ie.onReadyBeingFired.push(Te),ye&&ee(Te)):(ee(Te),Ae=T,ye||ee(function xe(){Ae.on.ready.unsubscribe(Te),Ae.on.ready.unsubscribe(xe)}))})}}),this.Collection=(F=this,Ia(Qd.prototype,function($e,xe){this.db=F;var ye=sf,Ae=null;if(xe)try{ye=xe()}catch(He){Ae=He}var Ie=$e._ctx,xe=Ie.table,$e=xe.hook.reading.fire;this._ctx={table:xe,index:Ie.index,isPrimKey:!Ie.index||xe.schema.primKey.keyPath&&Ie.index===xe.schema.primKey.name,range:ye,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:Ae,or:Ie.or,valueMapper:$e!==pe?$e:null}})),this.Table=(z=this,Ia(Du.prototype,function(ee,Te,ye){this.db=z,this._tx=ye,this.name=ee,this.schema=Te,this.hook=z._allTables[ee]?z._allTables[ee].hook:jo(null,{creating:[Ye,qe],reading:[fe,pe],updating:[Be,qe],deleting:[st,qe]})})),this.Transaction=(X=this,Ia(Jd.prototype,function(ee,Te,ye,Ae,Ie){var xe=this;this.db=X,this.mode=ee,this.storeNames=Te,this.schema=ye,this.chromeTransactionDurability=Ae,this.idbtrans=null,this.on=jo(this,"complete","error","abort"),this.parent=Ie||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ze(function($e,He){xe._resolve=$e,xe._reject=He}),this._completion.then(function(){xe.active=!1,xe.on.complete.fire()},function($e){var He=xe.active;return xe.active=!1,xe.on.error.fire($e),xe.parent?xe.parent._reject($e):He&&xe.idbtrans&&xe.idbtrans.abort(),Gn($e)})})),this.Version=(ue=this,Ia(th.prototype,function(ee){this.db=ue,this._cfg={version:ee,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(Ce=this,Ia(sd.prototype,function(ee,Te,ye){if(this.db=Ce,this._ctx={table:ee,index:Te===":id"?null:Te,or:ye},this._cmp=this._ascending=rn,this._descending=function(Ae,Ie){return rn(Ie,Ae)},this._max=function(Ae,Ie){return 0<rn(Ae,Ie)?Ae:Ie},this._min=function(Ae,Ie){return rn(Ae,Ie)<0?Ae:Ie},this._IDBKeyRange=Ce._deps.IDBKeyRange,!this._IDBKeyRange)throw new Q.MissingAPI})),this.on("versionchange",function(ee){0<ee.newVersion?console.warn("Another connection wants to upgrade database '".concat(T.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(T.name,"'. Closing db now to resume the delete request.")),T.close({disableAutoOpen:!1})}),this.on("blocked",function(ee){!ee.newVersion||ee.newVersion<ee.oldVersion?console.warn("Dexie.delete('".concat(T.name,"') was blocked")):console.warn("Upgrade '".concat(T.name,"' blocked by other connection holding version ").concat(ee.oldVersion/10))}),this._maxKey=da(b.IDBKeyRange),this._createTransaction=function(ee,Te,ye,Ae){return new T.Transaction(ee,Te,ye,T._options.chromeTransactionDurability,Ae)},this._fireOnBlocked=function(ee){T.on("blocked").fire(ee),As.filter(function(Te){return Te.name===T.name&&Te!==T&&!Te._state.vcFired}).map(function(Te){return Te.on("versionchange").fire(ee)})},this.use(Sp),this.use(Fv),this.use(Iv),this.use(lf),this.use(Rv);var de=new Proxy(this,{get:function(ee,Te,ye){if(Te==="_vip")return!0;if(Te==="table")return function(Ie){return ru(T.table(Ie),de)};var Ae=Reflect.get(ee,Te,ye);return Ae instanceof Du?ru(Ae,de):Te==="tables"?Ae.map(function(Ie){return ru(Ie,de)}):Te==="_createTransaction"?function(){return ru(Ae.apply(this,arguments),de)}:Ae}});this.vip=de,O.forEach(function(ee){return ee(T)})}var Os,Zr=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",vb=(il.prototype.subscribe=function(p,b,T){return this._subscribe(p&&typeof p!="function"?p:{next:p,error:b,complete:T})},il.prototype[Zr]=function(){return this},il);function il(p){this._subscribe=p}try{Os={indexedDB:o.indexedDB||o.mozIndexedDB||o.webkitIndexedDB||o.msIndexedDB,IDBKeyRange:o.IDBKeyRange||o.webkitIDBKeyRange}}catch{Os={indexedDB:null,IDBKeyRange:null}}function uf(p){var b,T=!1,O=new vb(function(F){var z=ce(p),X,ue=!1,Ce={},ie={},de={get closed(){return ue},unsubscribe:function(){ue||(ue=!0,X&&X.abort(),ee&&vo.storagemutated.unsubscribe(ye))}};F.start&&F.start(de);var ee=!1,Te=function(){return hi(Ae)},ye=function(Ie){js(Ce,Ie),kl(ie,Ce)&&Te()},Ae=function(){var Ie,xe,$e;!ue&&Os.indexedDB&&(Ce={},Ie={},X&&X.abort(),X=new AbortController,$e=function(He){var Ue=pn();try{z&&xr();var Ze=ai(p,He);return Ze=z?Ze.finally(Ai):Ze}finally{Ue&&kn()}}(xe={subscr:Ie,signal:X.signal,requery:Te,querier:p,trans:null}),Promise.resolve($e).then(function(He){T=!0,b=He,ue||xe.signal.aborted||(Ce={},function(Ue){for(var Ze in Ue)if(d(Ue,Ze))return;return 1}(ie=Ie)||ee||(vo(Pa,ye),ee=!0),hi(function(){return!ue&&F.next&&F.next(He)}))},function(He){T=!1,["DatabaseClosedError","AbortError"].includes(He==null?void 0:He.name)||ue||hi(function(){ue||F.error&&F.error(He)})}))};return setTimeout(Te,0),de});return O.hasValue=function(){return T},O.getValue=function(){return b},O}var Ni=Li;function iu(p){var b=uo;try{uo=!0,vo.storagemutated.fire(p),Ou(p,!0)}finally{uo=b}}h(Ni,r(r({},Re),{delete:function(p){return new Ni(p,{addons:[]}).delete()},exists:function(p){return new Ni(p,{addons:[]}).open().then(function(b){return b.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(p){try{return b=Ni.dependencies,T=b.indexedDB,b=b.IDBKeyRange,(wi(T)?Promise.resolve(T.databases()).then(function(O){return O.map(function(F){return F.name}).filter(function(F){return F!==_l})}):Al(T,b).toCollection().primaryKeys()).then(p)}catch{return Gn(new Q.MissingAPI)}var b,T},defineClass:function(){return function(p){l(this,p)}},ignoreTransaction:function(p){return ge.trans?zo(ge.transless,p):p()},vip:zs,async:function(p){return function(){try{var b=cd(p.apply(this,arguments));return b&&typeof b.then=="function"?b:ze.resolve(b)}catch(T){return Gn(T)}}},spawn:function(p,b,T){try{var O=cd(p.apply(T,b||[]));return O&&typeof O.then=="function"?O:ze.resolve(O)}catch(F){return Gn(F)}},currentTransaction:{get:function(){return ge.trans||null}},waitFor:function(p,b){return b=ze.resolve(typeof p=="function"?Ni.ignoreTransaction(p):p).timeout(b||6e4),ge.trans?ge.trans.waitFor(b):b},Promise:ze,debug:{get:function(){return Pe},set:function(p){Je(p)}},derive:m,extend:l,props:h,override:C,Events:jo,on:vo,liveQuery:uf,extendObservabilitySet:js,getByKeyPath:x,setByKeyPath:A,delByKeyPath:function(p,b){typeof b=="string"?A(p,b,void 0):"length"in b&&[].map.call(b,function(T){A(p,T,void 0)})},shallowClone:I,deepClone:M,getObjectDiff:Ru,cmp:rn,asap:E,minKey:-1/0,addons:[],connections:As,errnames:we,dependencies:Os,cache:Xi,semVer:"4.0.10",version:"4.0.10".split(".").map(function(p){return parseInt(p)}).reduce(function(p,b,T){return p+b/Math.pow(10,2*T)})})),Ni.maxKey=da(Ni.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(vo(Pa,function(p){uo||(p=new CustomEvent(_c,{detail:p}),uo=!0,dispatchEvent(p),uo=!1)}),addEventListener(_c,function(p){p=p.detail,uo||iu(p)}));var Rs,uo=!1,Ep=function(){};return typeof BroadcastChannel<"u"&&((Ep=function(){(Rs=new BroadcastChannel(_c)).onmessage=function(p){return p.data&&iu(p.data)}})(),typeof Rs.unref=="function"&&Rs.unref(),vo(Pa,function(p){uo||Rs.postMessage(p)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(p){if(!Li.disableBfCache&&p.persisted){Pe&&console.debug("Dexie: handling persisted pagehide"),Rs!=null&&Rs.close();for(var b=0,T=As;b<T.length;b++)T[b].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(p){!Li.disableBfCache&&p.persisted&&(Pe&&console.debug("Dexie: handling persisted pageshow"),Ep(),iu({all:new ur(-1/0,[[]])}))})),ze.rejectionMapper=function(p,b){return!p||p instanceof U||p instanceof TypeError||p instanceof SyntaxError||!p.name||!Le[p.name]?p:(b=new Le[p.name](b||p.message,p),"stack"in p&&g(b,"stack",{get:function(){return this.inner.stack}}),b)},Je(Pe),r(Li,Object.freeze({__proto__:null,Dexie:Li,liveQuery:uf,Entity:id,cmp:rn,PropModSymbol:Ii,PropModification:Yi,replacePrefix:function(p,b){return new Yi({replacePrefix:[p,b]})},add:function(p){return new Yi({add:p})},remove:function(p){return new Yi({remove:p})},default:Li,RangeSet:ur,mergeRanges:$o,rangesOverlap:ld}),{default:Li}),Li})})(rae);var Ije=rae.exports;const IU=Gk(Ije),iae=Symbol.for("Dexie"),CS=globalThis[iae]||(globalThis[iae]=IU);if(IU.semVer!==CS.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${IU.semVer} and ${CS.semVer}`);const{liveQuery:kEn,mergeRanges:DEn,rangesOverlap:OEn,RangeSet:REn,cmp:IEn,Entity:PEn,PropModSymbol:FEn,PropModification:MEn,replacePrefix:LEn,add:NEn,remove:$En}=CS,Xv=new CS("CommentDatabase");Xv.version(1).stores({comments:"++renditionId, comment "});const Vb=new CS("CommentFile");Vb.version(1).stores({files:"++id, files "});const Hp="MMM DD, YYYY",PU="MMM DD, YYYY | HH:mm:ss",SM="MMM DD, YYYY | HH:mm:ss",Pje="MMM dd, yyyy | HH:mm",oae="MMM DD",Fje=[{label:"User",key:"user",sortAble:!1},{label:"Field",key:"field",sortAble:!1},{label:"Before",key:"before",sortAble:!1,type:"number"},{label:"After",key:"after",sortAble:!1},{label:"Timestamp",key:"timestamp",sortAble:!1}],FU={dropdown:"dropdown",number:"number",rating:"icon"};function Mje(e){switch(e){case"archived_status":return"Archive status";default:return e}}const xM={text:"text",description:"description",name:"name",start_date:"start_date",due_date:"due_date",avatar:"avatar",image:"image",color:"color",Status:"template_flow_status_id",archived_status:"archived_status"},EM={image:["image/png","image/jpeg","image/jpg","image"],video:["video/mp4","video/quicktime","video"],audio:["audio/mp3","audio/webm","audio/mpeg","audio"],document:["application/pdf","application/msword","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","text/csv","document"],zip:["application/x-zip-compressed","application/zip","zip","other"]},TM=Object.entries(EM).reduce((e,[,t])=>(e.push(...t),e)).flat(),sae={renditionName:"renditionName",description:"description"},Lje=["jpeg","png","mov","mp4","quicktime"],Nje=5e6,AM=5e7,MU="scene_comment";/*! js-cookie v3.0.5 | MIT */function kM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var $je={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function LU(e,t){function n(i,o,s){if(!(typeof document>"u")){s=kM({},t,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var l in s)s[l]&&(a+="; "+l,s[l]!==!0&&(a+="="+s[l].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+a}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],s={},a=0;a<o.length;a++){var l=o[a].split("="),u=l.slice(1).join("=");try{var c=decodeURIComponent(l[0]);if(s[c]=e.read(u,c),i===c)break}catch{}}return i?s[i]:s}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",kM({},o,{expires:-1}))},withAttributes:function(i){return LU(this.converter,kM({},this.attributes,i))},withConverter:function(i){return LU(kM({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var qk=LU($je,{path:"/"});const aae={Accept:"application/json","Content-Type":"application/json"},Kk="parent,attachments,markers,ws_creator,ws_editor,fulfiller,parent.ws_creator,parent.attachments,parent.assigned_user,parent.resolved_user,assigned_user,emoji_users,resolved_user",Yk="created_at-desc",Bje="account.token",Vje="ws.code",DM="account.last_prefered_timezone",Uje=3e5,zp=10,Hje=500,Ub=1,Wi={success:!1,data:void 0},Ua=()=>sessionStorage.getItem(Vje)||"",Hu=()=>{const e=sessionStorage.getItem("scene_id")||"";return e||(console.error("Scene ID not found in sessionStorage"),"")};var di=(e=>(e.Scene="scene",e.Rendition="rendition",e))(di||{});const zje=30*24*60*60*1e3,OM=()=>{const e=Hu(),t=10,n=async()=>{try{const f=(await Xv.table("comments").toArray()).filter(g=>g.updatedAt&&new Date(g.updatedAt).getTime()>=new Date().getTime()-zje).sort((g,m)=>{const v=new Date(g.updatedAt).getTime();return new Date(m.updatedAt).getTime()-v}).slice(0,t).map(g=>g.renditionId);r(f)}catch(h){console.error("Error optimizing database",h)}},r=async h=>{if(!Array.isArray(h)){console.error("Invalid ids array provided to clearNonMatchingRecords");return}try{const m=(await Xv.table("comments").toArray()).filter(v=>!h.includes(v.renditionId)).map(async v=>{try{return await Xv.table("comments").delete(v.renditionId)}catch(_){return console.warn(`Failed to delete comment ${v.renditionId}:`,_),null}});await Promise.all(m)}catch(f){console.error("Error clearing non-matching records",f)}},i=async(h,f)=>{try{return await Xv.table(h).where("renditionId").equals(f).first()}catch(g){console.error("Error fetching data",g);return}};return{addDraftCommentData:async(h,f)=>{if(!h||typeof h!="string")return console.warn("Invalid id provided to addDraftCommentData"),!1;if(!f||typeof f!="string")return console.warn("Invalid data provided to addDraftCommentData"),!1;try{return await Xv.comments.where("renditionId").equals(h).first()?await Xv.comments.update(h,{comment:f,renditionId:h,updatedAt:new Date().toISOString()}):await Xv.comments.add({renditionId:h,comment:f,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}),!0}catch(g){return console.error("Error adding comment",g),!1}},getCommentFile:async h=>{try{return await Vb.files.where("id").equals(h).first()}catch(f){console.error("Error removing comment file",f)}},removeDraft:async h=>{try{await Xv.comments.where("renditionId").equals(h).delete()}catch(f){console.error("Error removing draft",f)}},handleLoadDraftComment:async(h,f)=>{if(h==di.Scene)return await i("comments",`${MU}:${e}`);if(h==di.Rendition&&(f!=null&&f.trim()))return await i("comments",f)},setCommentFile:async h=>{await Vb.files.where("id").equals(h.id).first()?await Vb.files.update(h.id,h):await Vb.files.add(h)},updateCommentFile:async(h,f)=>{try{await Vb.files.update(h,f)}catch(g){console.error("Error updating comment file",g)}},removeCommentFile:async h=>{try{await Vb.files.where("id").equals(h).delete()}catch(f){console.error("Error removing comment file",f)}},optimizeDatabase:n}};/*!
43
43
  * shared v9.14.5
@@ -517,7 +517,7 @@ If you are trying to annotate ${r} with application data, use the '${r}.context'
517
517
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(r=>n.set(r)),n}static accessor(e){const t=(this[KMe]=this[KMe]={accessors:{}}).accessors,n=this.prototype;function r(i){const o=qI(i);t[o]||(ddn(n,i),t[o]=!0)}return $t.isArray(e)?e.forEach(r):r(e),this}};Wd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$t.reduceDescriptors(Wd.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),$t.freezeMethods(Wd);function UQ(e,t){const n=this||GI,r=t||n,i=Wd.from(r.headers);let o=r.data;return $t.forEach(e,function(s){o=s.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function YMe(e){return!!(e&&e.__CANCEL__)}function aA(e,t,n){Yr.call(this,e??"canceled",Yr.ERR_CANCELED,t,n),this.name="CanceledError"}$t.inherits(aA,Yr,{__CANCEL__:!0});function XMe(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Yr("Request failed with status code "+n.status,[Yr.ERR_BAD_REQUEST,Yr.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function hdn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function fdn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(a){const l=Date.now(),u=r[o];s||(s=l),n[i]=a,r[i]=l;let c=o,d=0;for(;c!==i;)d+=n[c++],c=c%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),l-s<t)return;const h=u&&l-u;return h?Math.round(d*1e3/h):void 0}}function pdn(e,t){let n=0,r=1e3/t,i,o;const s=(a,l=Date.now())=>{n=l,i=null,o&&(clearTimeout(o),o=null),e(...a)};return[(...a)=>{const l=Date.now(),u=l-n;u>=r?s(a,l):(i=a,o||(o=setTimeout(()=>{o=null,s(i)},r-u)))},()=>i&&s(i)]}const Q6=(e,t,n=3)=>{let r=0;const i=fdn(50,250);return pdn(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,l=s-r,u=i(l),c=s<=a;r=s;const d={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-s)/u:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},ZMe=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},QMe=e=>(...t)=>$t.asap(()=>e(...t)),mdn=fc.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,fc.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(fc.origin),fc.navigator&&/(msie|trident)/i.test(fc.navigator.userAgent)):()=>!0,gdn=fc.hasStandardBrowserEnv?{write(e,t,n,r,i,o,s){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];$t.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),$t.isString(r)&&a.push(`path=${r}`),$t.isString(i)&&a.push(`domain=${i}`),o===!0&&a.push("secure"),$t.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function vdn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function ydn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function JMe(e,t,n){let r=!vdn(t);return e&&(r||n==!1)?ydn(e,t):t}const eLe=e=>e instanceof Wd?{...e}:e;function _1(e,t){t=t||{};const n={};function r(u,c,d,h){return $t.isPlainObject(u)&&$t.isPlainObject(c)?$t.merge.call({caseless:h},u,c):$t.isPlainObject(c)?$t.merge({},c):$t.isArray(c)?c.slice():c}function i(u,c,d,h){if($t.isUndefined(c)){if(!$t.isUndefined(u))return r(void 0,u,d,h)}else return r(u,c,d,h)}function o(u,c){if(!$t.isUndefined(c))return r(void 0,c)}function s(u,c){if($t.isUndefined(c)){if(!$t.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function a(u,c,d){if(d in t)return r(u,c);if(d in e)return r(void 0,u)}const l={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,c,d)=>i(eLe(u),eLe(c),d,!0)};return $t.forEach(Object.keys({...e,...t}),function(u){const c=l[u]||i,d=c(e[u],t[u],u);$t.isUndefined(d)&&c!==a||(n[u]=d)}),n}const tLe=e=>{const t=_1({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;if(t.headers=s=Wd.from(s),t.url=jMe(JMe(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),$t.isFormData(n)){if(fc.hasStandardBrowserEnv||fc.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if($t.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,d])=>{u.includes(c.toLowerCase())&&s.set(c,d)})}}if(fc.hasStandardBrowserEnv&&(r&&$t.isFunction(r)&&(r=r(t)),r||r!==!1&&mdn(t.url))){const l=i&&o&&gdn.read(o);l&&s.set(i,l)}return t},bdn=typeof XMLHttpRequest<"u",wdn=bdn&&function(e){return new Promise(function(t,n){const r=tLe(e);let i=r.data;const o=Wd.from(r.headers).normalize();let{responseType:s,onUploadProgress:a,onDownloadProgress:l}=r,u,c,d,h,f;function g(){h&&h(),f&&f(),r.cancelToken&&r.cancelToken.unsubscribe(u),r.signal&&r.signal.removeEventListener("abort",u)}let m=new XMLHttpRequest;m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout;function v(){if(!m)return;const w=Wd.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders()),C={data:!s||s==="text"||s==="json"?m.responseText:m.response,status:m.status,statusText:m.statusText,headers:w,config:e,request:m};XMe(function(y){t(y),g()},function(y){n(y),g()},C),m=null}"onloadend"in m?m.onloadend=v:m.onreadystatechange=function(){!m||m.readyState!==4||m.status===0&&!(m.responseURL&&m.responseURL.indexOf("file:")===0)||setTimeout(v)},m.onabort=function(){m&&(n(new Yr("Request aborted",Yr.ECONNABORTED,e,m)),m=null)},m.onerror=function(w){const C=w&&w.message?w.message:"Network Error",y=new Yr(C,Yr.ERR_NETWORK,e,m);y.event=w||null,n(y),m=null},m.ontimeout=function(){let w=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const C=r.transitional||GMe;r.timeoutErrorMessage&&(w=r.timeoutErrorMessage),n(new Yr(w,C.clarifyTimeoutError?Yr.ETIMEDOUT:Yr.ECONNABORTED,e,m)),m=null},i===void 0&&o.setContentType(null),"setRequestHeader"in m&&$t.forEach(o.toJSON(),function(w,C){m.setRequestHeader(C,w)}),$t.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),s&&s!=="json"&&(m.responseType=r.responseType),l&&([d,f]=Q6(l,!0),m.addEventListener("progress",d)),a&&m.upload&&([c,h]=Q6(a),m.upload.addEventListener("progress",c),m.upload.addEventListener("loadend",h)),(r.cancelToken||r.signal)&&(u=w=>{m&&(n(!w||w.type?new aA(null,e,m):w),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(u),r.signal&&(r.signal.aborted?u():r.signal.addEventListener("abort",u)));const _=hdn(r.url);if(_&&fc.protocols.indexOf(_)===-1){n(new Yr("Unsupported protocol "+_+":",Yr.ERR_BAD_REQUEST,e));return}m.send(i||null)})},_dn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(u){if(!i){i=!0,a();const c=u instanceof Error?u:this.reason;r.abort(c instanceof Yr?c:new aA(c instanceof Error?c.message:c))}};let s=t&&setTimeout(()=>{s=null,o(new Yr(`timeout ${t} of ms exceeded`,Yr.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(o):u.removeEventListener("abort",o)}),e=null)};e.forEach(u=>u.addEventListener("abort",o));const{signal:l}=r;return l.unsubscribe=()=>$t.asap(a),l}},Cdn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},Sdn=async function*(e,t){for await(const n of xdn(e))yield*Cdn(n,t)},xdn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},nLe=(e,t,n,r)=>{const i=Sdn(e,t);let o=0,s,a=l=>{s||(s=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await i.next();if(u){a(),l.close();return}let d=c.byteLength;if(n){let h=o+=d;n(h)}l.enqueue(new Uint8Array(c))}catch(u){throw a(u),u}},cancel(l){return a(l),i.return()}},{highWaterMark:2})},rLe=64*1024,{isFunction:J6}=$t,Edn=(({Request:e,Response:t})=>({Request:e,Response:t}))($t.global),{ReadableStream:iLe,TextEncoder:oLe}=$t.global,sLe=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Tdn=e=>{e=$t.merge.call({skipUndefined:!0},Edn,e);const{fetch:t,Request:n,Response:r}=e,i=t?J6(t):typeof fetch=="function",o=J6(n),s=J6(r);if(!i)return!1;const a=i&&J6(iLe),l=i&&(typeof oLe=="function"?(g=>m=>g.encode(m))(new oLe):async g=>new Uint8Array(await new n(g).arrayBuffer())),u=o&&a&&sLe(()=>{let g=!1;const m=new n(fc.origin,{body:new iLe,method:"POST",get duplex(){return g=!0,"half"}}).headers.has("Content-Type");return g&&!m}),c=s&&a&&sLe(()=>$t.isReadableStream(new r("").body)),d={stream:c&&(g=>g.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(g=>{!d[g]&&(d[g]=(m,v)=>{let _=m&&m[g];if(_)return _.call(m);throw new Yr(`Response type '${g}' is not supported`,Yr.ERR_NOT_SUPPORT,v)})});const h=async g=>{if(g==null)return 0;if($t.isBlob(g))return g.size;if($t.isSpecCompliantForm(g))return(await new n(fc.origin,{method:"POST",body:g}).arrayBuffer()).byteLength;if($t.isArrayBufferView(g)||$t.isArrayBuffer(g))return g.byteLength;if($t.isURLSearchParams(g)&&(g=g+""),$t.isString(g))return(await l(g)).byteLength},f=async(g,m)=>$t.toFiniteNumber(g.getContentLength())??h(m);return async g=>{let{url:m,method:v,data:_,signal:w,cancelToken:C,timeout:y,onDownloadProgress:E,onUploadProgress:x,responseType:A,headers:I,withCredentials:D="same-origin",fetchOptions:k}=tLe(g),P=t||fetch;A=A?(A+"").toLowerCase():"text";let L=_dn([w,C&&C.toAbortSignal()],y),M=null;const $=L&&L.unsubscribe&&(()=>{L.unsubscribe()});let B;try{if(x&&u&&v!=="get"&&v!=="head"&&(B=await f(I,_))!==0){let ce=new n(m,{method:"POST",body:_,duplex:"half"}),Z;if($t.isFormData(_)&&(Z=ce.headers.get("content-type"))&&I.setContentType(Z),ce.body){const[U,J]=ZMe(B,Q6(QMe(x)));_=nLe(ce.body,rLe,U,J)}}$t.isString(D)||(D=D?"include":"omit");const N=o&&"credentials"in n.prototype,V={...k,signal:L,method:v.toUpperCase(),headers:I.normalize().toJSON(),body:_,duplex:"half",credentials:N?D:void 0};M=o&&new n(m,V);let K=await(o?P(M,k):P(m,V));const te=c&&(A==="stream"||A==="response");if(c&&(E||te&&$)){const ce={};["status","statusText","headers"].forEach(he=>{ce[he]=K[he]});const Z=$t.toFiniteNumber(K.headers.get("content-length")),[U,J]=E&&ZMe(Z,Q6(QMe(E),!0))||[];K=new r(nLe(K.body,rLe,U,()=>{J&&J(),$&&$()}),ce)}A=A||"text";let ve=await d[$t.findKey(d,A)||"text"](K,g);return!te&&$&&$(),await new Promise((ce,Z)=>{XMe(ce,Z,{data:ve,headers:Wd.from(K.headers),status:K.status,statusText:K.statusText,config:g,request:M})})}catch(N){throw $&&$(),N&&N.name==="TypeError"&&/Load failed|fetch/i.test(N.message)?Object.assign(new Yr("Network Error",Yr.ERR_NETWORK,g,M),{cause:N.cause||N}):Yr.from(N,N&&N.code,g,M)}}},Adn=new Map,aLe=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let s=o.length,a=s,l,u,c=Adn;for(;a--;)l=o[a],u=c.get(l),u===void 0&&c.set(l,u=a?new Map:Tdn(t)),c=u;return u};aLe();const HQ={http:jcn,xhr:wdn,fetch:{get:aLe}};$t.forEach(HQ,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const lLe=e=>`- ${e}`,kdn=e=>$t.isFunction(e)||e===null||e===!1;function Ddn(e,t){e=$t.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let s=0;s<n;s++){r=e[s];let a;if(i=r,!kdn(r)&&(i=HQ[(a=String(r)).toLowerCase()],i===void 0))throw new Yr(`Unknown adapter '${a}'`);if(i&&($t.isFunction(i)||(i=i.get(t))))break;o[a||"#"+s]=i}if(!i){const s=Object.entries(o).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=n?s.length>1?`since :
518
518
  `+s.map(lLe).join(`
519
519
  `):" "+lLe(s[0]):"as no adapter specified";throw new Yr("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return i}const uLe={getAdapter:Ddn,adapters:HQ};function zQ(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new aA(null,e)}function cLe(e){return zQ(e),e.headers=Wd.from(e.headers),e.data=UQ.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),uLe.getAdapter(e.adapter||GI.adapter,e)(e).then(function(t){return zQ(e),t.data=UQ.call(e,e.transformResponse,t),t.headers=Wd.from(t.headers),t},function(t){return YMe(t)||(zQ(e),t&&t.response&&(t.response.data=UQ.call(e,e.transformResponse,t.response),t.response.headers=Wd.from(t.response.headers))),Promise.reject(t)})}const dLe="1.13.2",eV={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{eV[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const hLe={};eV.transitional=function(e,t,n){function r(i,o){return"[Axios v"+dLe+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,s)=>{if(e===!1)throw new Yr(r(o," has been removed"+(t?" in "+t:"")),Yr.ERR_DEPRECATED);return t&&!hLe[o]&&(hLe[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,s):!0}},eV.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function Odn(e,t,n){if(typeof e!="object")throw new Yr("options must be an object",Yr.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],l=a===void 0||s(a,o,e);if(l!==!0)throw new Yr("option "+o+" must be "+l,Yr.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Yr("Unknown option "+o,Yr.ERR_BAD_OPTION)}}const tV={assertOptions:Odn,validators:eV},gv=tV.validators;let C1=class{constructor(e){this.defaults=e||{},this.interceptors={request:new WMe,response:new WMe}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
520
- `+i):n.stack=i}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=_1(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&tV.assertOptions(n,{silentJSONParsing:gv.transitional(gv.boolean),forcedJSONParsing:gv.transitional(gv.boolean),clarifyTimeoutError:gv.transitional(gv.boolean)},!1),r!=null&&($t.isFunction(r)?t.paramsSerializer={serialize:r}:tV.assertOptions(r,{encode:gv.function,serialize:gv.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),tV.assertOptions(t,{baseUrl:gv.spelling("baseURL"),withXsrfToken:gv.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&$t.merge(i.common,i[t.method]);i&&$t.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),t.headers=Wd.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(t)===!1||(a=a&&f.synchronous,s.unshift(f.fulfilled,f.rejected))});const l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let u,c=0,d;if(!a){const f=[cLe.bind(this),void 0];for(f.unshift(...s),f.push(...l),d=f.length,u=Promise.resolve(t);c<d;)u=u.then(f[c++],f[c++]);return u}d=s.length;let h=t;for(;c<d;){const f=s[c++],g=s[c++];try{h=f(h)}catch(m){g.call(this,m);break}}try{u=cLe.call(this,h)}catch(f){return Promise.reject(f)}for(c=0,d=l.length;c<d;)u=u.then(l[c++],l[c++]);return u}getUri(e){e=_1(this.defaults,e);const t=JMe(e.baseURL,e.url,e.allowAbsoluteUrls);return jMe(t,e.params,e.paramsSerializer)}};$t.forEach(["delete","get","head","options"],function(e){C1.prototype[e]=function(t,n){return this.request(_1(n||{},{method:e,url:t,data:(n||{}).data}))}}),$t.forEach(["post","put","patch"],function(e){function t(n){return function(r,i,o){return this.request(_1(o||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}C1.prototype[e]=t(),C1.prototype[e+"Form"]=t(!0)});let Rdn=class yVe{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(i,o,s){r.reason||(r.reason=new aA(i,o,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new yVe(function(n){t=n}),cancel:t}}};function Idn(e){return function(t){return e.apply(null,t)}}function Pdn(e){return $t.isObject(e)&&e.isAxiosError===!0}const jQ={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(jQ).forEach(([e,t])=>{jQ[t]=e});function fLe(e){const t=new C1(e),n=DMe(C1.prototype.request,t);return $t.extend(n,C1.prototype,t,{allOwnKeys:!0}),$t.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return fLe(_1(e,r))},n}const Da=fLe(GI);Da.Axios=C1,Da.CanceledError=aA,Da.CancelToken=Rdn,Da.isCancel=YMe,Da.VERSION=dLe,Da.toFormData=X6,Da.AxiosError=Yr,Da.Cancel=Da.CanceledError,Da.all=function(e){return Promise.all(e)},Da.spread=Idn,Da.isAxiosError=Pdn,Da.mergeConfig=_1,Da.AxiosHeaders=Wd,Da.formToJSON=e=>qMe($t.isHTMLForm(e)?new FormData(e):e),Da.getAdapter=uLe.getAdapter,Da.HttpStatusCode=jQ,Da.default=Da;const{Axios:$An,AxiosError:BAn,CanceledError:VAn,isCancel:UAn,CancelToken:HAn,VERSION:zAn,all:jAn,Cancel:WAn,isAxiosError:Fdn,spread:GAn,toFormData:qAn,AxiosHeaders:KAn,HttpStatusCode:YAn,formToJSON:XAn,getAdapter:ZAn,mergeConfig:QAn}=Da,Mdn=e=>{const t=`; ${document.cookie}`.split(`; ${e}=`);if(t.length===2){const n=t.pop();return(n==null?void 0:n.split(";").shift())??null}return null},Ldn=6e4,pLe=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),nV=new Map,mLe=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},Ndn=e=>{const t=mLe(e),n=pLe(t||"none"),r=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(s=>s!=="default"&&r===s)||"default";nV.has(i)||nV.set(i,{ongoing:0,queue:[]});const o=nV.get(i);return new Promise(s=>{o?o.ongoing<n[i]?(o.ongoing++,s()):o.queue.push(()=>{o.ongoing++,s()}):s()})},gLe=e=>{const t=mLe(e),n=pLe(t||"none"),r=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(s=>s!=="default"&&r===s)||"default",o=nV.get(i);if(o&&(o.ongoing--,o.queue.length>0)){const s=o.queue.shift();setTimeout(()=>{s==null||s()},1e3)}},$dn=()=>{const e=Da.create({timeout:Ldn,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await Ndn(n);const r=Mdn("account.token");return r&&t.headers&&(t.headers.Authorization=`Bearer ${r}`),t.headers&&(t.headers["Access-Control-Allow-Origin"]="*",t.headers["Access-Control-Allow-Headers"]="*",t.headers["Accept-Language"]="*"),t},t=>Promise.reject(t)),e.interceptors.response.use(t=>(gLe(t.config.url||""),t),async t=>{var n,r,i;if(((n=t.response)==null?void 0:n.status)===401){const s=sessionStorage.getItem("BASE_URL")||"";(()=>{const a=`${s}/start`;window.postMessage({type:"TOKEN_EXPIRED",message:"Authentication token has expired"},"*"),window.location.replace(a)})()}if(t.config&&gLe(t.config.url||""),t.code==="ERR_NETWORK"||!navigator.onLine)return Promise.reject(t);const o=t.config;if(((r=t.response)==null?void 0:r.status)===429&&(!o._retryCount||o._retryCount<3)){o._retryCount=(o._retryCount||0)+1;const s=t.response.headers["retry-after"],a=s?parseInt(s)*1e3:Math.pow(2,o._retryCount)*1e3;return await new Promise(l=>setTimeout(l,a)),e(o)}return((i=t.response)==null?void 0:i.status)===401&&!o._retry&&(o._retry=!0),Promise.reject(t)}),e},Bdn=$dn();class KI extends Error{constructor(t,n,r,i,o){super(t),this.name="ApiError",this.statusCode=n,this.code=r,this.details=i,this.type=o,Object.setPrototypeOf(this,KI.prototype)}}const YI=e=>{var t,n;if(Fdn(e)){const r=(t=e.response)==null?void 0:t.status,i=(n=e.response)==null?void 0:n.data,o=(i==null?void 0:i.message)||e.message||"An unexpected error occurred",s=(i==null?void 0:i.code)||e.code,a=(i==null?void 0:i.details)||i;let l="UNKNOWN";return!r||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":r>=500?l="SERVER":r===iA.UNAUTHORIZED||r===iA.FORBIDDEN?l="AUTH":r===iA.UNPROCESSABLE_ENTITY||r===iA.BAD_REQUEST?l="VALIDATION":r>=iA.BAD_REQUEST&&(l="CLIENT"),new KI(o,r,s,a,l)}return e instanceof Error?new KI(e.message,void 0,void 0,void 0,"UNKNOWN"):new KI("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class Vdn{constructor(){this.axios=Bdn}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n??""}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([i,o])=>{o!=null&&o!==""&&(Array.isArray(o)?o.forEach(s=>n.append(i,String(s))):typeof o=="object"?n.append(i,JSON.stringify(o)):n.append(i,String(o)))});const r=n.toString();return r?`?${r}`:""}async get(t="",n,r){try{const i=this.buildUrl(t),o=n?this.buildQueryParams(n):"";return(await this.axios.get(`${i}${o}`,r)).data}catch(i){throw YI(i)}}async post(t="",n,r,i){try{const o=this.buildUrl(t),s=n?this.buildQueryParams(n):"";return(await this.axios.post(`${o}${s}`,r,i)).data}catch(o){throw YI(o)}}async put(t="",n,r){try{const i=this.buildUrl(t);return(await this.axios.put(i,n,r)).data}catch(i){throw YI(i)}}async patch(t="",n,r){try{const i=this.buildUrl(t);return(await this.axios.patch(i,n,r)).data}catch(i){throw YI(i)}}async delete(t="",n,r){try{const i=this.buildUrl(t);return(await this.axios.delete(i,{data:n,...r})).data}catch(i){throw YI(i)}}}const Udn=({domainApi:e,wsCode:t,sceneId:n})=>({getMetrics:{url:`${e}/v1/workspace/${t}/items/${n}/metrics`,method:"get",code:"getMetrics"},updateMetrics:{url:`${e}/v1/workspace/${t}/items/${n}/metrics`,method:"put",code:"updateMetrics"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"}}),Hdn=10;class zdn extends Vdn{constructor(t,n){const r=n==null?void 0:n.domainApi,i=n==null?void 0:n.wsCode,o=(n==null?void 0:n.sceneId)||"";super(),this.events=Object.create(null);const s=Udn({domainApi:r,wsCode:i,sceneId:o}),a={};Object.entries(s).forEach(([l,u])=>{const c=l;t[c]?a[c]=t[c]:(console.warn(`API config for ${c} is missing, using base config.`),a[c]=u)}),this.apiConfig=a}on(t,n){var r;((r=this.events)[t]??(r[t]=[])).push(n)}off(t,n){const r=this.events[t];r&&(this.events[t]=r.filter(i=>i!==n))}emit(t,...n){const r=this.events[t];r!=null&&r.length&&r.forEach(i=>{try{i(...n)}catch(o){console.error(`Error in event listener for ${t}:`,o)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:r,payload:i,code:o,responseType:s}){var a,l;const u=this.buildHeaders(i);let c;try{if(c=await this.axios.request({method:t,url:n,params:r,data:i,headers:u,responseType:s}),(((a=c.headers)==null?void 0:a["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const d=((l=c.headers)==null?void 0:l["content-disposition"])||"",h=d.includes("filename=")?d.split("filename=")[1]:"exported_items.xlsx"}if(c.status>=400&&c.status<=500)throw new Error(`Client error (${c.status}): ${c.statusText}`);return this.emit("call-api",{apiCode:o,path:n,params:r,payload:i,res:c,success:!0}),c.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:r,payload:i,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:r,payload:i,error:d,success:!1,apiCode:o,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let r=t;return Object.entries(n).forEach(([i,o])=>{r=r.replace(`{${i}}`,String(o))}),r}async request(t,n,r={}){const{url:i,code:o,method:s}=this.apiConfig[t],a=this.generateUrl(i,n);return this._requestHandler({method:s,path:a,params:r.params,payload:r.payload,code:o,responseType:r.responseType})}getMetrics(t,n=1,r=Hdn){return this.request("getMetrics",{itemId:t},{params:{page:n,per_page:r}})}updateMetrics(t){return this.request("updateMetrics",{},{payload:t})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:r,metricId:i,value:o,clear:s}=t,a={item_ids:r,metric_id:i,metric_value:o,clear:s??(o==null||o==0?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=r,a.entity_id=void 0),a.clear===1&&delete a.metric_value,this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}}CMe();const vLe=(e,t)=>{const n=oe(Number(e.value.value)),r=re(()=>e.value.metricConfig),i=re(()=>{var a,l;const u=r.value,c=t.value,d=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,h=!!e.value.error,f=(u==null?void 0:u.format_type)==="icon",{disabled:g}=e.value;return{pendingCalculation:e.value.value=="N/A"||d&&((a=u==null?void 0:u.metric_type)==null?void 0:a.code)==="formula",isEmpty:d,isError:h,hasPrefix:!d&&!h&&(u==null?void 0:u.morpheme_type)==="prefix",hasSuffix:!d&&!h&&(u==null?void 0:u.morpheme_type)==="suffix",isDropdown:(u==null?void 0:u.format_type)==="dropdown",isFormula:((l=u==null?void 0:u.metric_type)==null?void 0:l.code)==="formula",isLoading:e.value.value===void 0,isRating:f,showActions:c&&!d&&!g}}),o=17,s=re(()=>{var a;return{maxRating:((a=r.value)==null?void 0:a.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:o}});return{componentState:i,metricConfig:r,ICON_SIZE:o,ratingParams:s,standardNameforIcon:()=>{var a;return(((a=r.value)==null?void 0:a.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},jdn=["aria-label"],Wdn=Ct({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=CZ,r=fv,i=e,o=rg(!1),s=oe(null),a=oe(null),{isEditing:l}=xMe(i),u=re(()=>{var $,B;return{value:i.value,metricConfig:((B=($=i.params)==null?void 0:$.colDef)==null?void 0:B.context)||i.config,error:i.error,hovered:o.value,readOnly:i.readOnly,disabled:i.disabled,active:l}}),{componentState:c,metricConfig:d,internalValue:h}=vLe(u,o),f=re(()=>{var $,B;let N=!1;if(["number","formula"].includes(d.value.metric_type.code)){const V=Number(i.value),K=Number(($=d.value)==null?void 0:$.format_value);Number.isFinite(K)&&K>=0&&(N=(((B=V.toString().split(".")[1])==null?void 0:B.length)||0)>K)}return N}),g=re(()=>{var $;return!!(($=d.value)!=null&&$.morpheme_value)||c.value.isEmpty||f.value}),m=re(()=>{var $,B,N;if(c.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(c.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(c.value.isEmpty)return;const V=D.value,K=($=d.value)==null?void 0:$.morpheme_type;return K==="prefix"?`${((B=d.value)==null?void 0:B.morpheme_value)||""} ${V}`.trim():K==="suffix"?`${V} ${((N=d.value)==null?void 0:N.morpheme_value)||""}`.trim():V}),v=re(()=>{const{format_type:$,format_value:B}=d.value;if($==="dropdown"&&typeof B=="string"&&B.startsWith("["))try{return JSON.parse(B)}catch{return[]}return[]}),_=re(()=>({disabled:i.disabled,error:c.value.isError,inputRef:s,wrapperRef:a,clickable:!I.value,readOnly:i.readOnly||I.value,isEmpty:c.value.isEmpty})),{argsMain:w,isHover:C}=j6(_),y=($,B,N="en-US")=>new Intl.NumberFormat(N,{minimumFractionDigits:B,maximumFractionDigits:B}).format($),E=re(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const $=i.value,{format_type:B,format_value:N,mapping:V}=d.value;if(V&&typeof V=="object"&&!Array.isArray(V)){const K=V[`!${$}`];if(K)return K}if(B==="dropdown"){const K=v.value.find(te=>String(te.name)===String($));if(K)return K.name}if(typeof $=="string"){const K=Number($);return Number.isNaN(K)?$:$.replace(/[.-]/g,"").length>16?x($,N):x(K,N)}return typeof $=="number"?x($,N):String($)}),x=($,B)=>{const N=Number.parseInt(String(B)||"2",10),V=Number.isFinite(N)&&N>=0?N:2;try{if(typeof $=="string"){const K=$.split("."),te=K[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ve=K[1]?K[1].substring(0,V).padEnd(V,"0"):"0".repeat(V);return V>0?`${te}.${ve}`:te}return y($,V)}catch(K){return console.error("Error formatting metric value:",K,{num:$,decimals:V}),String($)}},A=($,B)=>{const N=Number.parseInt(String(B)||"2",10),V=Number.isFinite(N)&&N>=0?N:2;try{if(typeof $=="string"){const K=$.split("."),te=K[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ve=K[1]?K[1].length:0,ce=Math.max(V,ve),Z=K[1]?K[1].padEnd(ce,"0"):"0".repeat(ce);return ce>0?`${te}.${Z}`:te}return new Intl.NumberFormat("en-US",{minimumFractionDigits:V,maximumFractionDigits:20}).format($)}catch(K){return console.error("Error formatting exact metric value:",K,{num:$,decimals:V}),String($)}},I=re(()=>{var $;return(($=d.value)==null?void 0:$.metric_type.code)==="formula"}),D=re(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const $=i.value,{format_type:B,format_value:N,mapping:V}=d.value;if(V&&typeof V=="object"&&!Array.isArray(V)){const K=V[`!${$}`];if(K)return K}if(B==="dropdown"){const K=v.value.find(te=>String(te.name)===String($));if(K)return K.name}if(typeof $=="string"){const K=Number($);return Number.isNaN(K)?$:$.replace(/[.-]/g,"").length>16?A($,N):A(K,N)}return typeof $=="number"?A($,N):String($)}),{tooltip:k}=pln(""),P=async $=>{$.stopPropagation(),$.preventDefault(),$.stopImmediatePropagation();try{await navigator.clipboard.writeText(D.value),k.value="Copied",setTimeout(()=>{k.value="Copy"},3e3)}catch(B){console.error("Failed to copy text:",B),k.value="Copy failed",setTimeout(()=>{k.value="Copy"},3e3)}};mt(()=>i.value,($,B)=>{const N=Number($);Number.isFinite(N)&&N!==h.value?h.value=N:$==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const L=()=>{o.value=!0},M=()=>{o.value=!1};return($,B)=>qt((W(),ut(W6,Lt(G(w),{onMouseenter:L,style:{"--icon-size":"24px"},onMouseleave:M,ref_key:"wrapperRef",ref:a,actived:G(l),bordered:!0}),{suffix:it(()=>[i.disabled?je("",!0):(W(),se("div",{key:0,class:et([$.$style.suffix,"wrapper-suffix"])},[o.value&&!G(c).isEmpty&&!G(c).isError?qt((W(),ut(Xc,{key:0,variant:["icon","secondary"],size:24,onClick:Xt(P,["prevent","stop"])},{default:it(()=>[Ne(cc,{src:"Copy",source:"remote",size:12})]),_:1})),[[G(r),{content:G(k),hideOnClick:!1,contentClass:"extra-padding"}]]):je("",!0)],2))]),default:it(()=>[_e("div",{class:et($.$style["metric-wrapper"]),"aria-label":G(d).format_value||void 0},[_e("div",{class:et([$.$style["metric-content"],i.disabled?$.$style.disabled:""])},[!G(c).isError&&G(c).isEmpty?(W(),se(Mt,{key:0},[G(c).pendingCalculation?qt((W(),se("span",{key:0,class:et($.$style["metric-empty"])},[...B[0]||(B[0]=[Fn(" - ",-1)])],2)),[[G(r),"Can’t calculate yet. Complete required fields."]]):G(c).isEmpty?(W(),se("span",{key:1,class:et($.$style["metric-empty"])}," - ",2)):je("",!0)],64)):je("",!0),G(c).isError?qt((W(),se("div",{key:1,class:et($.$style["metric-error"])},[...B[1]||(B[1]=[Fn(" Error ",-1)])],2)),[[G(r),"Something went wrong. Review formula, inputs and retry."]]):je("",!0),!G(c).isEmpty&&!G(c).isError?qt((W(),se("span",{key:2,class:et([$.$style["metric-value"],G(C)?$.$style.hovered:"",{[$.$style.disabled]:i.disabled}])},[Fn(Et(E.value),1)],2)),[[G(r),{content:m.value,bypassOverflowCheck:g.value}]]):je("",!0)],2)],10,jdn)]),_:1},16,["actived"])),[[G(n),{isLoading:G(c).isLoading}]])}}),Gdn="_disabled_7otc0_15",qdn="_hovered_7otc0_19",Kdn={"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:Gdn,"metric-value":"_metric-value_7otc0_19",hovered:qdn,"metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"},Ydn={$style:Kdn},yLe=uc(Wdn,[["__cssModules",Ydn]]);class Xdn extends Error{}class xw extends Xdn{constructor(){super("Zone is an abstract class")}}class bLe{get type(){throw new xw}get name(){throw new xw}get ianaName(){return this.name}get isUniversal(){throw new xw}offsetName(t,n){throw new xw}formatOffset(t,n){throw new xw}offset(t){throw new xw}equals(t){throw new xw}get isValid(){throw new xw}}const WQ=new Map;function Zdn(e){let t=WQ.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),WQ.set(e,t)),t}const Qdn={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Jdn(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,l,u,c]=r;return[s,i,o,a,l,u,c]}function ehn(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:o,value:s}=n[i],a=Qdn[o];o==="era"?r[a]=s:iV(a)||(r[a]=parseInt(s,10))}return r}const GQ=new Map;class rV extends bLe{static create(t){let n=GQ.get(t);return n===void 0&&GQ.set(t,n=new rV(t)),n}static resetCache(){GQ.clear(),WQ.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=rV.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return rhn(t,n,r,this.name)}formatOffset(t,n){return sV(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=Zdn(this.name);let[i,o,s,a,l,u,c]=r.formatToParts?ehn(r,n):Jdn(r,n);a==="BC"&&(i=-Math.abs(i)+1);const d=nhn({year:i,month:o,day:s,hour:l===24?0:l,minute:u,second:c,millisecond:0});let h=+n;const f=h%1e3;return h-=f>=0?f:1e3+f,(d-h)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let qQ=null;class lA extends bLe{static get utcInstance(){return qQ===null&&(qQ=new lA(0)),qQ}static instance(t){return t===0?lA.utcInstance:new lA(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new lA(_Le(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${sV(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${sV(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return sV(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function iV(e){return typeof e>"u"}function oV(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function wLe(e){if(!(iV(e)||e===null||e===""))return parseInt(e,10)}function thn(e){if(!(iV(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function nhn(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function rhn(e,t,n,r=null){const i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function _Le(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function sV(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${oV(n,2)}:${oV(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${oV(n,2)}${oV(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const CLe=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function uA(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function cA(...e){return t=>e.reduce(([n,r,i],o)=>{const[s,a,l]=o(t,i);return[{...n,...s},a||r,l]},[{},null,1]).slice(0,2)}function SLe(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=wLe(t[n+i]);return[r,null,n+i]}}const xLe=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,ihn=`(?:${xLe.source}?(?:\\[(${CLe.source})\\])?)?`,ELe=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,TLe=RegExp(`${ELe.source}${ihn}`),KQ=RegExp(`(?:T${TLe.source})?`),ohn=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,shn=/(\d{4})-?W(\d\d)(?:-?(\d))?/,ahn=/(\d{4})-?(\d{3})/,lhn=SLe("weekYear","weekNumber","weekDay"),uhn=SLe("year","ordinal"),chn=/(\d{4})-(\d\d)-(\d\d)/,ALe=RegExp(`${ELe.source} ?(?:${xLe.source}|(${CLe.source}))?`),dhn=RegExp(`(?: ${ALe.source})?`);function dA(e,t,n){const r=e[t];return iV(r)?n:wLe(r)}function hhn(e,t){return[{year:dA(e,t),month:dA(e,t+1,1),day:dA(e,t+2,1)},null,t+3]}function hA(e,t){return[{hours:dA(e,t,0),minutes:dA(e,t+1,0),seconds:dA(e,t+2,0),milliseconds:thn(e[t+3])},null,t+4]}function XI(e,t){const n=!e[t]&&!e[t+1],r=_Le(e[t+1],e[t+2]),i=n?null:lA.instance(r);return[{},i,t+3]}function ZI(e,t){const n=e[t]?rV.create(e[t]):null;return[{},n,t+1]}uA(ohn,KQ),uA(shn,KQ),uA(ahn,KQ),uA(TLe),cA(hhn,hA,XI,ZI),cA(lhn,hA,XI,ZI),cA(uhn,hA,XI,ZI),cA(hA,XI,ZI),cA(hA),uA(chn,dhn),uA(ALe),cA(hA,XI,ZI);var bl;(function(e){e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}"})(bl||(bl={})),bl.review,bl.review_take,bl.review_scene,bl.review_rendition,bl.review_frame,bl.review_rendition_comment,bl.review_comment,bl.scene_hub,bl.hub_rendition,bl.hub_comment,bl.people_insight,bl.people_detail,bl.project,bl.woohoo,bl.update,bl.core,bl.project_focusMode,new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const fhn=Ct({name:"EmptyData",__name:"EmptyData",props:{isSearching:{type:Boolean},isFiltering:{type:Boolean}},setup(e){const t=e,n={noData:"No data available.",noSearchResults:"No results. Try another search.",noFilterResults:"No results. Try another filter.",emptySearchFilter:"No results. Try another search or filter."},r=re(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate"),i=re(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),o=oe(!1);return ln(()=>{o.value=!0}),(s,a)=>(W(),se("div",{class:et(s.$style["no-data-item-table"])},[_e("div",{class:et(s.$style.visual)},[o.value?(W(),ut(Sln,{key:0,source:"remote",src:r.value,ratio:"4/3",maxWidth:500,maxHeight:350},null,8,["src"])):je("",!0)],2),_e("div",{class:et(s.$style.description)},Et(i.value),3)],2))}}),phn="_visual_oh0wi_12",mhn="_description_oh0wi_19",ghn={"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:phn,description:mhn},vhn={$style:ghn},yhn=uc(fhn,[["__cssModules",vhn]]),bhn={ROW_HEIGHT:38},whn=e=>{var t,n,r;if(e){if(Number((t=e.metric_type)==null?void 0:t.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number((n=e.metric_type)==null?void 0:n.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number((r=e.metric_type)==null?void 0:r.id)==3)return}},YQ=e=>{if(e)return whn(e)};class _hn{constructor(){Qa(this,"eGui"),Qa(this,"params")}init(t){this.params=t}getGui(){var t,n,r,i,o;const s=document.createElement("div");return(t=this.params)!=null&&t.height&&s.style.setProperty("--height",(n=this.params)==null?void 0:n.height),(r=this.params)!=null&&r.width?s.style.setProperty("--width",(i=this.params)==null?void 0:i.width):(o=this.params)!=null&&o.fullwidth?s.style.setProperty("--width","100%"):s.style.setProperty("--width",`${Math.floor(Math.random()*50)+50}%`),s.className="ag-cell-skeleton",s.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation()}),this.eGui=s,s}refresh(t){return!1}getValue(){var t;return(t=this.params)==null?void 0:t.value}isPopup(t){return!1}getPopupPosition(){}destroy(){}}const Chn=new Map;window.trackingRenderTimes=Chn;const Shn=Ct({__name:"Vue3Wrapper",props:{component:{},params:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},tooltip:{},isNoData:{type:Boolean,default:!1},workspaceId:{},entityId:{},axiosService:{},isSearching:{type:Boolean,default:!1},isFiltering:{type:Boolean,default:!1},sortType:{default:"default"},maxRating:{default:5},config:{}},setup(e,{expose:t}){const n=e,r=oe(null),i=re(()=>{var a;return((a=n.component)==null?void 0:a.name)||"UnknownComponent"}),o=re(()=>{var a;return((a=n.component)==null?void 0:a.default)||n.component}),s=re(()=>({params:n.params,disabled:n.disabled,readOnly:n.readOnly,value:n.value,maxRating:n.maxRating,data:n.data,id:n.id,workspaceId:n.workspaceId,entityId:n.entityId,axiosService:n.axiosService,tooltip:n.tooltip,isSearching:n.isSearching,isFiltering:n.isFiltering,isNoData:n.isNoData,config:n.config}));return t({focus:()=>{var a;return(a=r.value)!=null&&a.focus?r.value.focus():console.warn(`Component ${i.value} does not have a focus method.`),!0},blur:()=>{var a,l;return(l=(a=r.value)==null?void 0:a.blur)==null||l.call(a),!0},trigger:(a,l)=>{var u;return(u=r.value)==null||u.$emit(a,l),!0}}),(a,l)=>(W(),ut(Np(o.value),Lt(s.value,{ref_key:"componentRef",ref:r}),null,16))}}),xhn="_skeleton_7xde7_1",Ehn="_shimmer_7xde7_16",Thn={skeleton:xhn,shimmer:Ehn,"skeleton-loading":"_skeleton-loading_7xde7_1"},Ahn={$style:Thn},khn=uc(Shn,[["__cssModules",Ahn]]);function Dhn(e){return"stopEditing"in e}const Ohn=8,Rhn=e=>{if(!e)return;const t=e.__vueParentComponent,n=t==null?void 0:t.exposed;n&&typeof n.triggerFocus=="function"?n.triggerFocus():e.focus()};function kLe(e){return class{constructor(){Qa(this,"container"),Qa(this,"vNode",null),Qa(this,"componentInstance",null),Qa(this,"componsenExposed",null),Qa(this,"params"),Qa(this,"isEditor",!1),Qa(this,"_destroyed",!1)}init(t){var n,r,i,o;if(!t){console.error("[Vue3CellWrapper] Missing params");return}const s=performance.now();this.params=t,this.isEditor=Dhn(t),this.container=document.createElement("div"),this.container.classList.add("ag-vue3-cell-wrapper"),this.container.style.width="100%",this.container.style.height="100%";const a=t.context.apiClass,l=t,u={component:e,params:Object.freeze(t),disabled:!1,readOnly:l.readOnly??!1,value:t.value,maxRating:l.maxRating??void 0,data:t.data,id:(n=t==null?void 0:t.data)==null?void 0:n.id,workspaceId:t.context.workspaceId,entityId:t.context.entityId,axiosService:a,tooltip:l.tooltip??void 0,isSearching:l.isSearching??!1,isFiltering:l.isFiltering??!1,isNoData:l.isNoData??!1,config:l.config,sceneId:(l==null?void 0:l.sceneId)||void 0};this.vNode=Ne(khn,u),Fk(this.vNode,this.container);const c=performance.now()-s;c>Ohn&&console.warn(`[Vue3CellWrapper] Slow render (${c.toFixed(1)}ms) for "${(r=t.colDef)==null?void 0:r.field}"`),this.componentInstance=(i=this.vNode.component)==null?void 0:i.proxy,this.componsenExposed=(o=this.vNode.component)==null?void 0:o.exposed}getGui(){return this.container}refresh(t){return!1}focusUi(){var t;(t=this.componsenExposed)!=null&&t.focus?this.componsenExposed.focus():Rhn(this.container)}getValue(){var t,n,r;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((r=(n=this.componentInstance).getValue)==null?void 0:r.call(n))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(t=this.params)==null?void 0:t.value)}isPopup(t){var n,r,i,o,s;const a=(i=(r=(n=this.params)==null?void 0:n.colDef)==null?void 0:r.field)==null?void 0:i.includes("metric"),l=((o=this.params)==null?void 0:o.context)&&YQ(this.params.context);return a||l==="number"||l==="rating"||!this.isEditor?!1:(s=this.componentInstance)!=null&&s.isPopup?this.componentInstance.isPopup():!0}getPopupPosition(){var t,n,r;return this.isEditor?(t=this.componentInstance)!=null&&t.getPopupPosition?this.componentInstance.getPopupPosition():((r=(n=this.params)==null?void 0:n.colDef)==null?void 0:r.cellEditorPopupPosition)??"under":void 0}afterGuiAttached(){!this.isEditor||this.componentInstance}destroy(){if(!this._destroyed&&(this._destroyed=!0,!!this.container))try{const t=this.componentInstance;if(t){try{typeof t.$destroy=="function"&&t.$destroy()}catch(n){console.warn("[Vue3CellWrapper] Error during $destroy:",n)}try{typeof t.destroy=="function"&&t.destroy()}catch(n){console.warn("[Vue3CellWrapper] Error during destroy():",n)}}(typeof queueMicrotask=="function"?queueMicrotask:n=>Promise.resolve().then(n))(()=>{try{Fk(null,this.container)}catch(n){console.warn("[Vue3CellWrapper] Error during unmount:",n)}finally{this.container.textContent=""}})}catch(t){console.error("[Vue3CellWrapper] Error during cleanup:",t)}finally{this.vNode=null,this.componentInstance=null}}}}function Ihn(e){return kLe(e)}function Phn(e){return kLe(e)}let DLe=!1;DLe||(hHt.registerModules([wnn,uIe]),DLe=!0);class Fhn{constructor(t,n){Qa(this,"gridApi",null),Qa(this,"container"),Qa(this,"config"),Qa(this,"eventListeners",new Map),this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:r,onRowSelected:i,...o}=this.config,s={...o,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{r&&r(a)},onRowSelected:a=>{i&&i(a)}};return this.gridApi=HXt(this.container,s),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const r={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(r),n==="bottom"){const i=this.gridApi.getDisplayedRowCount();i>0&&this.gridApi.ensureIndexVisible(i-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const r={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(r),n==="bottom"){const i=this.gridApi.getDisplayedRowCount();i>0&&this.gridApi.ensureIndexVisible(i-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(r=>{var i;(i=this.gridApi)==null||i.removeEventListener(n,r)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const Mhn=YOe.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),Lhn=Ct({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=oe(null);eun(o,()=>{var m;const v=(m=s.value)==null?void 0:m.getApi();v==null||v.clearFocusedCell()});const s=oe(null),a=re(()=>({width:"100%",height:r.height||"500px"})),l=re(()=>({...r,theme:Mhn}));function u(){if(!o.value){console.warn("Grid container element not found");return}const m={...l.value,height:r.height};s.value=new Fhn(o.value,m),s.value.init(),c()}function c(){var m;const v=((m=s.value)==null?void 0:m.getApi())??null;i("onGridReady",v)}function d(m){var v,_;if(!m)return;(v=s.value)==null||v.updateColumnDefs(m);const w=m.map(C=>C.field&&C.width&&!C.hide?{colId:C.field,width:C.width}:null).filter(C=>C!==null);(_=s.value)==null||_.setColumnWidth(w)}function h(){var m;(m=s.value)==null||m.destroy(),s.value=null}function f(){var m;return((m=s.value)==null?void 0:m.getApi())||void 0}function g(){return s.value||null}return mt(()=>r.columnDefs,(m,v)=>{const _=m==null?void 0:m.filter(C=>!C.hide).map(C=>C.field).join(","),w=v==null?void 0:v.filter(C=>!C.hide).map(C=>C.field).join(",");_!==w&&d(m)},{deep:!0}),pi(()=>{h()}),t({gridApi:f,gridManager:g,syncColumnDefs:d}),ln(()=>{u()}),pi(()=>{h()}),(m,v)=>(W(),se("div",{ref_key:"gridContainerRef",ref:o,style:Jt(a.value),class:et(["ag-theme-quartz",["ag-table-container",r.isSorting?"is-sorting":""]])},null,6))}}),QI=Phn;function OLe(e){return{sceneId:re(()=>{var t;const n=(t=e.params)==null?void 0:t.context;return(n==null?void 0:n.sceneId)||""}),updateCellData:t=>{var n,r,i,o,s;const a=((n=e.params)==null?void 0:n.node.id)||"",l=(i=(r=e.params)==null?void 0:r.api)==null?void 0:i.getRowNode(a);l&&l.setDataValue("metric_value",t),(s=(o=e.params)==null?void 0:o.api)==null||s.refreshCells({rowNodes:l?[l]:[],columns:["metric_value"],force:!0})}}}const Nhn={class:"metric-editor-wrapper",ref:"metricEditorWrapperRef"},$hn=Ct({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},setup(e){const t=e,n=oe(t.value),r=oe(!0),i=oe(""),o=()=>{var v,_,w;const C=(v=l.value)==null?void 0:v.restricted_type.trim(),y=((w=(_=l.value)==null?void 0:_.restricted_value)==null?void 0:w.split(",").map(Number))||[],[E,x]=y,A={range:`Enter a value between ${E} and ${x}`,not:`These values are not allowed: ${y.join(", ")}`,exact:"Value is not allowed"}[C];return r.value?"":A},s=v=>{if(l.value){if(v===null||v===""){r.value=!0;return}if(a.value!=="number"){r.value=!0;return}r.value=OQ(l.value,Number(v)),i.value=o()}},a=re(()=>dln(l.value)),l=re(()=>{var v;return((v=t.params)==null?void 0:v.data.metric_config)||null}),{apiServices:u}=JZ(!0,t),{sceneId:c,updateCellData:d}=OLe(t),h=oe(!1),f=()=>{var v;(v=t.params)==null||v.api.stopEditing()},g=()=>{f()},m=async v=>{var _,w,C;if(f(),console.log("Handling update with value:",v),h.value=!0,n.value=v||null,v===t.value){h.value=!1;return}const y={itemIds:[c.value],metricId:((_=l.value)==null?void 0:_.id)||"",workspaceId:String(t.workspaceId)};v==null?y.clear=1:y.value=v;const E=v||null,x=t.value;console.log("Prepared payload for metric update:",y),d(E);try{const A=await((w=u.value)==null?void 0:w.bulkUpdateMetric(y));console.log("Bulk update metric response:",A),(A==null?void 0:A.message)=="Done"?(d(E),n.value=E):(d(x),console.error("Failed to update metric value:",A),n.value=x)}catch(A){d(x),n.value=x,console.error("Error during bulk metric update:",A)}finally{h.value=!1,(C=t.params)==null||C.api.stopEditing()}};return(v,_)=>(W(),se("div",Nhn,[a.value=="dropdown"&&l.value?(W(),ut(G(tcn),{key:0,config:l.value,modelValue:n.value,"onUpdate:modelValue":_[0]||(_[0]=w=>n.value=w),onChange:m,onHandleCancel:g},null,8,["config","modelValue"])):a.value=="number"&&l.value?(W(),ut(G(icn),{key:1,showInlineError:!1,autoEmit:!0,config:l.value,modelValue:n.value,"onUpdate:modelValue":_[1]||(_[1]=w=>n.value=w),style:{width:"100%"},onHandleChange:m,onCancel:g,onOnValidation:s},null,8,["config","modelValue"])):je("",!0)],512))}}),Bhn=uc($hn,[["__scopeId","data-v-8e5ec6c4"]]),Vhn={key:0,style:{color:"#6b6b6b"}},Uhn=Ct({__name:"MetricCellRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=fv,n=e,r=re(()=>{var s,a;return(a=(s=n.params)==null?void 0:s.value)==null?void 0:a.morpheme}),i=re(()=>{var s,a;return(a=(s=n.params)==null?void 0:s.value)==null?void 0:a.name}),o=re(()=>{var s;const a=(s=n.params)==null?void 0:s.value;return(a==null?void 0:a.is_primary)==1?"primary":(a==null?void 0:a.is_point_metric)==1?"secondary":""});return(s,a)=>(W(),se("div",{class:et(s.$style["metric-content"])},[qt((W(),se("span",null,[Fn(Et(i.value),1)])),[[G(t),{content:i.value}]]),r.value?(W(),se("small",Vhn," ("+Et(r.value)+") ",1)):je("",!0),o.value==="primary"?qt((W(),se("div",{key:1,class:et(s.$style["icon-metric"])},[Ne(G(cc),{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[G(t),"Woohoo metric"]]):je("",!0),o.value==="secondary"?qt((W(),se("div",{key:2,class:et(s.$style["icon-metric"])},[Ne(G(cc),{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[G(t),"Point Metric"]]):je("",!0)],2))}}),Hhn={"icon-metric":"_icon-metric_wflah_1","metric-content":"_metric-content_wflah_10"},zhn={$style:Hhn},jhn=uc(Uhn,[["__cssModules",zhn]]),Whn=Ct({__name:"MetricRating",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},setup(e,{expose:t}){const n=CZ,r=e,{isEditing:i}=xMe(r),{apiServices:o}=JZ(!0,r),s=re(()=>{var x,A;return{value:a.value,metricConfig:((A=(x=r.params)==null?void 0:x.colDef)==null?void 0:A.context)||r.config,error:r.error,hovered:!1,readOnly:r.disabled,disabled:r.readOnly,apiServices:o.value}}),a=oe(Number(r.value)),l=oe(!1),{componentState:u,metricConfig:c,ICON_SIZE:d,ratingParams:h,standardNameforIcon:f}=vLe(s,l),{sceneId:g,updateCellData:m}=OLe(r),v=oe(a.value),_=async x=>{var A,I;a.value=x,v.value,m(void 0),a.value=NaN;const D={itemIds:[g.value],metricId:((A=c.value)==null?void 0:A.id)||"",workspaceId:String(r.workspaceId)};x==null?D.clear=1:D.value=x;try{const k=await((I=o.value)==null?void 0:I.bulkUpdateMetric(D));(k==null?void 0:k.message)=="Done"?(m(x),a.value=Number(x),v.value=x):(m(v.value),a.value=Number(v.value),console.error("Failed to update metric value:",k))}catch(k){m(v.value),a.value=Number(v.value),console.error("Error during bulk metric update:",k)}},w=QZ(async x=>{Gt(()=>{setTimeout(()=>{_(a.value)},100)})},300),C=re(()=>({disabled:r.disabled,error:u.value.isError,clickable:!0,readOnly:r.readOnly,isEmpty:u.value.isEmpty})),y=oe(null),{argsMain:E}=j6(C);return t({focus:()=>{var x,A;(A=(x=y.value)==null?void 0:x.focus)==null||A.call(x)}}),(x,A)=>(W(),ut(G(W6),Lt({style:{"--icon-size":"24px","--box-padding":"0 0 0 0"}},G(E),{ref:"wrapperRef",actived:G(i),size:32,tabindex:"0",bordered:!0}),{default:it(()=>[G(u).isRating&&G(h).maxRating?qt((W(),ut(G(Qun),{key:0,modelValue:a.value,"onUpdate:modelValue":A[0]||(A[0]=I=>a.value=I),ref_key:"ratingComponentRef",ref:y,params:G(h),readOnly:r.readOnly,disabled:r.disabled,onHandleEnter:_},{icon:it(({value:I})=>[Ne(G(cc),{onClick:D=>G(w)(I),source:"rating",src:G(f)()||"Star",size:G(d)},null,8,["onClick","src","size"])]),_:1},8,["modelValue","params","readOnly","disabled"])),[[G(n),{isLoading:G(u).isLoading,fullwidth:!0}]]):je("",!0)]),_:1},16,["actived"]))}}),Ghn={id:"metric-table",ref:"tableWrapperRef"},qhn="API_BASE_URL",Khn="formula",aV=10,Yhn=!1,Xhn=Ct({__name:"App",props:{sceneId:{default:"7jjrrtjv"},workspaceId:{default:"w:yngazem"},availableHeight:{}},emits:["update-success","update-error"],setup(e,{expose:t,emit:n}){const r=e,i=re(()=>r.availableHeight??window.innerHeight-200),o=k=>MPe.getInstance().getItem(k)||"",s=()=>{const k=o(qhn);return k.includes("/v1")?k.slice(0,k.lastIndexOf("/v1")):k},a=k=>{var P;return((P=k==null?void 0:k.metric_type)==null?void 0:P.code)===Khn},l=k=>{var P;return((P=k==null?void 0:k.metric_type)==null?void 0:P.code)==="rating"&&(k==null?void 0:k.format_type)=="icon"},u=k=>a(k)?k.metric_value??null:(l(k),k.input_value??null),c=k=>k.map((P,L)=>({id:String(P.id??L),name:{name:String(P.name??"Untitled metric"),is_primary:P.is_primary,is_point_metric:P.is_point_metric,morpheme:P.morpheme_value},metric_config:P,metric_value:u(P),metric_permission:P.auth_permission})),d=k=>{var P,L;const M=k.data,$=(P=k.node.data)==null?void 0:P.metric_value,B=(L=k.node.data)==null?void 0:L.metric_config,N=YQ(B);return M===void 0?{component:_hn,params:{}}:N==="rating"?{component:QI(Whn),params:{config:B,value:$,maxRating:B==null?void 0:B.range,sceneId:r.sceneId}}:N==="dropdown"?{component:QI(yLe),params:{config:B,value:$}}:{component:QI(yLe),params:{config:B,value:$}}},h=k=>{var P,L,M,$,B;const N=YQ((P=k.node.data)==null?void 0:P.metric_config);return{component:QI(Bhn),params:{config:(L=k.node.data)==null?void 0:L.metric_config,value:(M=k.node.data)==null?void 0:M.metric_value,maxRating:(B=($=k.node.data)==null?void 0:$.metric_config)==null?void 0:B.range},popup:!(N=="number"||N=="rating")}};function f(k){var P;return!k||a(k)||l(k)?!1:((P=k.auth_permission)==null?void 0:P.permission)==2}const g=k=>!!(k.data&&k.node.data&&f(k.data.metric_config)),m=k=>({component:QI(jhn),params:{value:k.value}}),{apiServices:v}=JZ(!1,r),_=re(()=>[{field:"name",headerName:"Metric",minWidth:220,flex:2,cellRendererSelector:m,editable:!1,cellEditorSelector:void 0},{field:"metric_value",headerName:"Value",minWidth:140,flex:1,cellRendererSelector:d,cellEditorSelector:h,editable:g,cellEditorPopupPosition:"under",cellEditorPopup:!0}]),w=n,C=re(()=>({isSearching:!1,isFiltering:!1})),y=re(()=>({headerHeight:32,blockLoadDebounceMillis:300,columnDefs:_.value,rowModelType:"infinite",cacheBlockSize:aV,infiniteInitialRowCount:aV,pagination:!1,rowHeight:bhn.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,suppressScrollOnNewData:!0,rowBuffer:aV,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,stopEditingWhenCellsLoseFocus:!1,noRowsOverlayComponent:Ihn(yhn),noRowsOverlayComponentParams:()=>C.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:k=>k.data.id,getRowClass:k=>k.data?["row-highlight"]:["row-empty"],suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:r.workspaceId,sorting:!1,apiServices:v.value,sceneId:r.sceneId},suppressHeaderFocus:!0,navigateToNextCell:()=>null,onCellEditRequest:k=>{console.log("Cell edit requested:",k)},onCellKeyDown:k=>{var P,L,M;if(((P=k==null?void 0:k.event)==null?void 0:P.key)==="Enter"){const{api:$,node:B,column:N}=k,V=$.getCellRendererInstances({rowNodes:[B],columns:[N]});if(V.length>0){const K=V[0];K&&typeof((L=K.componsenExposed)==null?void 0:L.focus)=="function"&&((M=K.componsenExposed)==null||M.focus())}}},isRowSelectable:k=>!k.group,suppressKeyboardEvent:k=>{var P;if((P=k.data)!=null&&P.isDeleted)return!0;const L=k.event.key,M=k.editing;return M&&L==="Tab"?!0:M&&L==="Enter"?!1:L==="Enter"?(k.event.preventDefault(),k.event.stopPropagation(),console.log("Enter key pressed, suppressing default behavior"),!0):L==="ArrowUp"||L==="ArrowDown"||L==="ArrowLeft"||L==="ArrowRight"||L==="Tab"||L==="Enter"},onBodyScroll:k=>{k.api.getFirstDisplayedRowIndex(),k.api.getLastDisplayedRowIndex()},onViewportChanged:k=>{},onCellEditingStarted(k){console.log("Cell editing started:",k)},tabToNextCell:k=>{let P=k.nextCellPosition;if(P&&P.column.getColId()==="ag-Grid-SelectionColumn"){const L=k.api.getAllDisplayedColumns(),M=L.indexOf(P.column),$=k.backwards?-1:1,B=L[M+$];if(B)return{rowIndex:P.rowIndex,column:B,rowPinned:P.rowPinned}}return P||!1}})),E=async k=>{var P,L;try{const M=await((P=v.value)==null?void 0:P.getMetrics(r.sceneId,k.page,k.pageSize)),$=Array.isArray(M==null?void 0:M.data)?M.data:[],B=Number(((L=M==null?void 0:M.meta)==null?void 0:L.total)??$.length??0);return{rows:c($),total:B}}catch(M){return console.error("Failed to fetch metrics",M),{rows:[],total:0}}},x=oe(-1);function A(k,P){return{async getRows(L){try{const M=Math.floor(L.startRow/P)+1,{rows:$,total:B}=await k({page:M,pageSize:P,sort_by:L.sortModel});x.value=B,L.successCallback($,x.value)}catch(M){console.error("Datasource fetch error",M),L.failCallback()}}}}const I=oe(null),D=k=>{var P;return k?(I.value=k,(P=k.setGridOption)==null||P.call(k,"datasource",A(E,aV)),k):null};return Ms(()=>{try{const k=Ci();if(!k)throw new Error("Current instance is null");const P={domainApi:s(),wsCode:r.workspaceId,sceneId:r.sceneId};if(!P.sceneId||!P.wsCode||!P.domainApi)throw new Error("API configuration is incomplete");const L=new zdn({},{domainApi:P.domainApi,wsCode:P.wsCode,sceneId:P.sceneId});L.on("call-api",M=>{console.log("API call event:",M),M.success?w("update-success",M):(console.error("API call failed:",M),w("update-error",M))}),k.appContext.config.globalProperties.apiServices=L}catch(k){console.error("Error getting current instance:",k)}}),t({refreshGrid:()=>{const k=I.value||null;k&&k.refreshInfiniteCache()}}),(k,P)=>(W(),se("div",Ghn,[Ne(G(Lhn),Lt({id:"item_table_main",ref:"agGrid"},y.value,{height:i.value+"px",isSorting:Yhn,onOnGridReady:D}),null,16,["height"])],512))}}),Zhn=e=>JSON.parse(e).map((t,n)=>({id:String(n),text:t.name})),Qhn=()=>{const e=oe(),t=oe(!1),n=Za(),r=Or(),{showErrorSnackbar:i}=r,{updateMetric:o}=n,s=async w=>{t.value=!0;const C=await o(w);return setTimeout(()=>{t.value=!1},50),C},a=fl(async(w,C,y,E)=>{const x=I=>{E(y,!1),i({label:I})},A={...C,metric_value:w};try{const I=await s(A);I!=null&&I.success&&E(w,!0)}catch(I){Sn(I,"updateMetricValue"),x("Update failed.")}},300),l=({params:w,idMetricPayload:C})=>{var I;const y=Zhn(w.data.formatValue).map(D=>({value:D.id,label:D.text||""})),E=((I=y.find(D=>D.label==w.data.inputValue))==null?void 0:I.value)??"",x=w.data.auth_permission.permission!==2,A={options:y,scrollerClass:".ag-body-viewport",placeholder:"",morpheme:w.data.morpheme||void 0,limitDecimal:Number(w.data.format_value),value:E,disabled:x,mappingValue:w.data.mapping,"onUpdate:modelValue":D=>{var P;const k=((P=y.find(L=>L.value==D))==null?void 0:P.label)??"";a(k,C,String(E),(L,M)=>{var $;if(M)v(w.data.id,L);else{const B=(($=y.find(N=>N.value==E))==null?void 0:$.label)??"";v(w.data.id,B)}})}};return{childComponent:uq,childProps:A,isEdit:w.data.isEdit}},u=({params:w,idMetricPayload:C})=>{var D;const y=w.data.restricted_value.split(",").map(k=>({value:k,label:w.data.mapping&&w.data.mapping[`!${k}`]?w.data.mapping[`!${k}`]:k})),E=((D=y.find(k=>k.label==w.data.inputValue))==null?void 0:D.value)??"",x=oe(E),A=w.data.auth_permission.permission!==2,I={options:y,scrollerClass:".ag-body-viewport",placeholder:"",disabled:A,morpheme:w.data.morpheme,limitDecimal:Number(w.data.format_value),value:x.value,mappingValue:w.data.mapping,"onUpdate:modelValue":fl(k=>a(k,C,String(E),P=>{var M;const L=((M=y.find($=>$.value==P))==null?void 0:M.label)??"";m(w.data.id,P,L)}),500)};return{childComponent:uq,childProps:I,isEdit:w.data.isEdit}},c=({params:w,idMetricPayload:C})=>{const y=Number(w.data.inputValue),E=oe(y),x=w.data.auth_permission.permission!==2,A={ratingIcon:w.data.format_symbol||"BoltSolid",value:E.value,maxRating:w.data.range,readOnly:x,"onUpdate:modelValue":async I=>a(I,C,Number(E.value),D=>v(w.data.id,D))};return{childComponent:oxe,childProps:A,isEdit:w.data.isEdit}},d=({params:w,idMetricPayload:C})=>{var I;const y=((I=w.data)==null?void 0:I.inputValue)===null?"":String(w.data.inputValue),E=oe(y),x=w.data.auth_permission.permission!==2,A={value:E.value,morpheme:w.data.morpheme,disabled:x,limitDecimal:Number(w.data.format_value),inputType:"number",change:D=>{a(D,C,String(E.value),k=>{v(w.data.id,k)})}};return{childComponent:mq,childProps:A,isEdit:w.data.isEdit}},h=Hu(),f=w=>{if(!w.data)return;const C={item_ids:[h??""],metric_id:w.data.id},y=w.data.formatType;let E={childComponent:mq,childProps:{},isEdit:w.data.isEdit};switch(y){case FU.dropdown:E=l({params:w,idMetricPayload:C});break;case FU.rating:E=c({params:w,idMetricPayload:C});break;case FU.number:w.data.restricted_type==="exact"?(w.data.formatValue=w.data.restricted_value,E=u({params:w,idMetricPayload:C})):w.data.formula?E=g({params:w}):E=d({params:w,idMetricPayload:C});break;default:E=d({params:w,idMetricPayload:C});break}return E},g=({params:w})=>{var y,E,x;const C={formulaValue:((y=w.data)==null?void 0:y.inputValue)||"",morpheme:((E=w.data)==null?void 0:E.morpheme)||"",limitDecimal:Number((x=w.data)==null?void 0:x.format_value),disable:w.data.auth_permission.permission!==2};return{childComponent:lq,childProps:C,isEdit:w.data.isEdit}},m=(w,C,y)=>{(x=>{e.value.forEachNode(A=>{A.data.id===w&&A.setData({...A.data,value:x||"",inputValue:y})})})(String(C))},v=(w,C)=>{(E=>{e.value.forEachNode(x=>{x.data.id===w&&x.setData({...x.data,inputValue:E})})})(String(C))};return{childComponent:f,updateRows:v,refreshing:t,gridApi:e}},Jhn={class:"h-full bg-white metric-log"},efn={key:0,class:"flex flex-1 p-10 items-center justify-center w-full h-[calc(100%-40px)]"},tfn=Vr(Ct({__name:"SceneMetric",emits:["loaded"],setup(e,{emit:t}){const n=Za(),{sceneId:r,workspaceId:i}=Mn(n),{refreshing:o}=Qhn(),s=oe(!1),a=oe(void 0),l=oe(null),u=re(()=>s.value&&!o.value),c=TC(),{connectState:d}=Mn(c),h=oe(!1),f=oe(null),g=async()=>{var C;(C=f.value)==null||C.refreshGrid()},m=C=>{},v=C=>{if(console.error("AAAAAAAAAAAAAAAAAAcallbackUpdateError",C),C.apiCode=="offline"){Or().showErrorSnackbar({label:"You are currently offline. Please check your internet connection."});return}else C.res&&C.res.data&&Or().showErrorNetMessage(C.res.data)},_=t,w=()=>{var C;if(l.value){const y=(((C=l.value)==null?void 0:C.offsetHeight)||0)-40;a.value=y}};return ln(()=>{window.addEventListener("resize",w),Gt(()=>{w(),_("loaded")}),_("loaded")}),pi(()=>{window.removeEventListener("resize",w)}),(C,y)=>(W(),ut(C4,{type:"metric","handle-reload":g,class:"scene-metric"},{view:it(({})=>[_e("div",{ref_key:"metricLogRef",ref:l,style:{height:"100%"}},[_e("div",null,[Ne(BO,{title:"Metric","disable-refresh":G(o),onRefresh:g},null,8,["disable-refresh"])]),_e("div",Jhn,[u.value?(W(),se("div",efn,[Ne(VC,{type:"metric"})])):je("",!0),h.value?(W(),ut(qE,{key:1,class:"loading-indicator"})):je("",!0),a.value?(W(),ut(G(Xhn),{key:2,sceneId:G(r),workspaceId:G(i),ref_key:"metricTableRef",ref:f,availableHeight:a.value,onUpdateSuccess:m,onUpdateError:v},null,8,["sceneId","workspaceId","availableHeight"])):je("",!0)])],512)]),_:1}))}}),[["__scopeId","data-v-7a31c580"]]);function XQ(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nfn(e){if(Array.isArray(e))return XQ(e)}function rfn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RLe(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function ILe(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){RLe(o,r,i,s,a,"next",l)}function a(l){RLe(o,r,i,s,a,"throw",l)}s(void 0)})}}function ifn(e,t,n){return t=lV(t),cfn(e,FLe()?Reflect.construct(t,n||[],lV(e).constructor):t.apply(e,n))}function ofn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sfn(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function PLe(e,t,n){return(t=hfn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lV(e){return lV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lV(e)}function afn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ZQ(e,t)}function FLe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FLe=function(){return!!e})()}function lfn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ufn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
520
+ `+i):n.stack=i}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=_1(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&tV.assertOptions(n,{silentJSONParsing:gv.transitional(gv.boolean),forcedJSONParsing:gv.transitional(gv.boolean),clarifyTimeoutError:gv.transitional(gv.boolean)},!1),r!=null&&($t.isFunction(r)?t.paramsSerializer={serialize:r}:tV.assertOptions(r,{encode:gv.function,serialize:gv.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),tV.assertOptions(t,{baseUrl:gv.spelling("baseURL"),withXsrfToken:gv.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&$t.merge(i.common,i[t.method]);i&&$t.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),t.headers=Wd.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(t)===!1||(a=a&&f.synchronous,s.unshift(f.fulfilled,f.rejected))});const l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let u,c=0,d;if(!a){const f=[cLe.bind(this),void 0];for(f.unshift(...s),f.push(...l),d=f.length,u=Promise.resolve(t);c<d;)u=u.then(f[c++],f[c++]);return u}d=s.length;let h=t;for(;c<d;){const f=s[c++],g=s[c++];try{h=f(h)}catch(m){g.call(this,m);break}}try{u=cLe.call(this,h)}catch(f){return Promise.reject(f)}for(c=0,d=l.length;c<d;)u=u.then(l[c++],l[c++]);return u}getUri(e){e=_1(this.defaults,e);const t=JMe(e.baseURL,e.url,e.allowAbsoluteUrls);return jMe(t,e.params,e.paramsSerializer)}};$t.forEach(["delete","get","head","options"],function(e){C1.prototype[e]=function(t,n){return this.request(_1(n||{},{method:e,url:t,data:(n||{}).data}))}}),$t.forEach(["post","put","patch"],function(e){function t(n){return function(r,i,o){return this.request(_1(o||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}C1.prototype[e]=t(),C1.prototype[e+"Form"]=t(!0)});let Rdn=class yVe{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(i=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(i,o,s){r.reason||(r.reason=new aA(i,o,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new yVe(function(n){t=n}),cancel:t}}};function Idn(e){return function(t){return e.apply(null,t)}}function Pdn(e){return $t.isObject(e)&&e.isAxiosError===!0}const jQ={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(jQ).forEach(([e,t])=>{jQ[t]=e});function fLe(e){const t=new C1(e),n=DMe(C1.prototype.request,t);return $t.extend(n,C1.prototype,t,{allOwnKeys:!0}),$t.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return fLe(_1(e,r))},n}const Da=fLe(GI);Da.Axios=C1,Da.CanceledError=aA,Da.CancelToken=Rdn,Da.isCancel=YMe,Da.VERSION=dLe,Da.toFormData=X6,Da.AxiosError=Yr,Da.Cancel=Da.CanceledError,Da.all=function(e){return Promise.all(e)},Da.spread=Idn,Da.isAxiosError=Pdn,Da.mergeConfig=_1,Da.AxiosHeaders=Wd,Da.formToJSON=e=>qMe($t.isHTMLForm(e)?new FormData(e):e),Da.getAdapter=uLe.getAdapter,Da.HttpStatusCode=jQ,Da.default=Da;const{Axios:$An,AxiosError:BAn,CanceledError:VAn,isCancel:UAn,CancelToken:HAn,VERSION:zAn,all:jAn,Cancel:WAn,isAxiosError:Fdn,spread:GAn,toFormData:qAn,AxiosHeaders:KAn,HttpStatusCode:YAn,formToJSON:XAn,getAdapter:ZAn,mergeConfig:QAn}=Da,Mdn=e=>{const t=`; ${document.cookie}`.split(`; ${e}=`);if(t.length===2){const n=t.pop();return(n==null?void 0:n.split(";").shift())??null}return null},Ldn=6e4,pLe=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),nV=new Map,mLe=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},Ndn=e=>{const t=mLe(e),n=pLe(t||"none"),r=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(s=>s!=="default"&&r===s)||"default";nV.has(i)||nV.set(i,{ongoing:0,queue:[]});const o=nV.get(i);return new Promise(s=>{o?o.ongoing<n[i]?(o.ongoing++,s()):o.queue.push(()=>{o.ongoing++,s()}):s()})},gLe=e=>{const t=mLe(e),n=pLe(t||"none"),r=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(s=>s!=="default"&&r===s)||"default",o=nV.get(i);if(o&&(o.ongoing--,o.queue.length>0)){const s=o.queue.shift();setTimeout(()=>{s==null||s()},1e3)}},$dn=()=>{const e=Da.create({timeout:Ldn,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await Ndn(n);const r=Mdn("account.token");return r&&t.headers&&(t.headers.Authorization=`Bearer ${r}`),t.headers&&(t.headers["Access-Control-Allow-Origin"]="*",t.headers["Access-Control-Allow-Headers"]="*",t.headers["Accept-Language"]="*"),t},t=>Promise.reject(t)),e.interceptors.response.use(t=>(gLe(t.config.url||""),t),async t=>{var n,r,i;if(((n=t.response)==null?void 0:n.status)===401){const s=sessionStorage.getItem("BASE_URL")||"";(()=>{const a=`${s}/start`;window.postMessage({type:"TOKEN_EXPIRED",message:"Authentication token has expired"},"*"),window.location.replace(a)})()}if(t.config&&gLe(t.config.url||""),t.code==="ERR_NETWORK"||!navigator.onLine)return Promise.reject(t);const o=t.config;if(((r=t.response)==null?void 0:r.status)===429&&(!o._retryCount||o._retryCount<3)){o._retryCount=(o._retryCount||0)+1;const s=t.response.headers["retry-after"],a=s?parseInt(s)*1e3:Math.pow(2,o._retryCount)*1e3;return await new Promise(l=>setTimeout(l,a)),e(o)}return((i=t.response)==null?void 0:i.status)===401&&!o._retry&&(o._retry=!0),Promise.reject(t)}),e},Bdn=$dn();class KI extends Error{constructor(t,n,r,i,o){super(t),this.name="ApiError",this.statusCode=n,this.code=r,this.details=i,this.type=o,Object.setPrototypeOf(this,KI.prototype)}}const YI=e=>{var t,n;if(Fdn(e)){const r=(t=e.response)==null?void 0:t.status,i=(n=e.response)==null?void 0:n.data,o=(i==null?void 0:i.message)||e.message||"An unexpected error occurred",s=(i==null?void 0:i.code)||e.code,a=(i==null?void 0:i.details)||i;let l="UNKNOWN";return!r||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":r>=500?l="SERVER":r===iA.UNAUTHORIZED||r===iA.FORBIDDEN?l="AUTH":r===iA.UNPROCESSABLE_ENTITY||r===iA.BAD_REQUEST?l="VALIDATION":r>=iA.BAD_REQUEST&&(l="CLIENT"),new KI(o,r,s,a,l)}return e instanceof Error?new KI(e.message,void 0,void 0,void 0,"UNKNOWN"):new KI("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class Vdn{constructor(){this.axios=Bdn}buildUrl(t=""){const n=t.replace(/^\//,"");return!n.startsWith("http://")&&!n.startsWith("https://")?`/${n}`:n??""}buildQueryParams(t){const n=new URLSearchParams;Object.entries(t).forEach(([i,o])=>{o!=null&&o!==""&&(Array.isArray(o)?o.forEach(s=>n.append(i,String(s))):typeof o=="object"?n.append(i,JSON.stringify(o)):n.append(i,String(o)))});const r=n.toString();return r?`?${r}`:""}async get(t="",n,r){try{const i=this.buildUrl(t),o=n?this.buildQueryParams(n):"";return(await this.axios.get(`${i}${o}`,r)).data}catch(i){throw YI(i)}}async post(t="",n,r,i){try{const o=this.buildUrl(t),s=n?this.buildQueryParams(n):"";return(await this.axios.post(`${o}${s}`,r,i)).data}catch(o){throw YI(o)}}async put(t="",n,r){try{const i=this.buildUrl(t);return(await this.axios.put(i,n,r)).data}catch(i){throw YI(i)}}async patch(t="",n,r){try{const i=this.buildUrl(t);return(await this.axios.patch(i,n,r)).data}catch(i){throw YI(i)}}async delete(t="",n,r){try{const i=this.buildUrl(t);return(await this.axios.delete(i,{data:n,...r})).data}catch(i){throw YI(i)}}}const Udn=({domainApi:e,wsCode:t,sceneId:n})=>({getMetrics:{url:`${e}/v1/workspace/${t}/items/${n}/metrics`,method:"get",code:"getMetrics"},updateMetrics:{url:`${e}/v1/workspace/${t}/items/${n}/metrics`,method:"put",code:"updateMetrics"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"}}),Hdn=10;class zdn extends Vdn{constructor(t,n){const r=n==null?void 0:n.domainApi,i=n==null?void 0:n.wsCode,o=(n==null?void 0:n.sceneId)||"";super(),this.events=Object.create(null);const s=Udn({domainApi:r,wsCode:i,sceneId:o}),a={};Object.entries(s).forEach(([l,u])=>{const c=l;t[c]?a[c]=t[c]:(console.warn(`API config for ${c} is missing, using base config.`),a[c]=u)}),this.apiConfig=a}on(t,n){var r;((r=this.events)[t]??(r[t]=[])).push(n)}off(t,n){const r=this.events[t];r&&(this.events[t]=r.filter(i=>i!==n))}emit(t,...n){const r=this.events[t];r!=null&&r.length&&r.forEach(i=>{try{i(...n)}catch(o){console.error(`Error in event listener for ${t}:`,o)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:r,payload:i,code:o,responseType:s}){var a,l;const u=this.buildHeaders(i);let c;try{if(c=await this.axios.request({method:t,url:n,params:r,data:i,headers:u,responseType:s}),(((a=c.headers)==null?void 0:a["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const d=((l=c.headers)==null?void 0:l["content-disposition"])||"",h=d.includes("filename=")?d.split("filename=")[1]:"exported_items.xlsx"}if(c.status>=400&&c.status<=500)throw new Error(`Client error (${c.status}): ${c.statusText}`);return this.emit("call-api",{apiCode:o,path:n,params:r,payload:i,res:c,success:!0}),c.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:r,payload:i,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:r,payload:i,error:d,success:!1,apiCode:o,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let r=t;return Object.entries(n).forEach(([i,o])=>{r=r.replace(`{${i}}`,String(o))}),r}async request(t,n,r={}){const{url:i,code:o,method:s}=this.apiConfig[t],a=this.generateUrl(i,n);return this._requestHandler({method:s,path:a,params:r.params,payload:r.payload,code:o,responseType:r.responseType})}getMetrics(t,n=1,r=Hdn){return this.request("getMetrics",{itemId:t},{params:{page:n,per_page:r}})}updateMetrics(t){return this.request("updateMetrics",{},{payload:t})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:r,metricId:i,value:o,clear:s}=t,a={item_ids:r,metric_id:i,metric_value:o,clear:s??(o==null||o==0?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=r,a.entity_id=void 0),a.clear===1&&delete a.metric_value,this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}}CMe();const vLe=(e,t)=>{const n=oe(Number(e.value.value)),r=re(()=>e.value.metricConfig),i=re(()=>{var a,l;const u=r.value,c=t.value,d=e.value.value=="N/A"||e.value.value===null||e.value.value===void 0||String(e.value.value).length===0,h=!!e.value.error,f=(u==null?void 0:u.format_type)==="icon",{disabled:g}=e.value;return{pendingCalculation:e.value.value=="N/A"||d&&((a=u==null?void 0:u.metric_type)==null?void 0:a.code)==="formula",isEmpty:d,isError:h,hasPrefix:!d&&!h&&(u==null?void 0:u.morpheme_type)==="prefix",hasSuffix:!d&&!h&&(u==null?void 0:u.morpheme_type)==="suffix",isDropdown:(u==null?void 0:u.format_type)==="dropdown",isFormula:((l=u==null?void 0:u.metric_type)==null?void 0:l.code)==="formula",isLoading:e.value.value===void 0,isRating:f,showActions:c&&!d&&!g}}),o=17,s=re(()=>{var a;return{maxRating:((a=r.value)==null?void 0:a.range)||5,readOnly:e.value.readOnly,disabled:e.value.disabled,size:o}});return{componentState:i,metricConfig:r,ICON_SIZE:o,ratingParams:s,standardNameforIcon:()=>{var a;return(((a=r.value)==null?void 0:a.format_symbol)||"BoltSolid").split(/[\s-_]+/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("").replace(/Outline|Solid/g,"")},internalValue:n}},jdn=["aria-label"],Wdn=Ct({name:"MetricRenderer",__name:"MetricRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},emits:["update:value","clear","copy"],setup(e,{emit:t}){const n=CZ,r=fv,i=e,o=rg(!1),s=oe(null),a=oe(null),{isEditing:l}=xMe(i),u=re(()=>{var $,B;return{value:i.value,metricConfig:((B=($=i.params)==null?void 0:$.colDef)==null?void 0:B.context)||i.config,error:i.error,hovered:o.value,readOnly:i.readOnly,disabled:i.disabled,active:l}}),{componentState:c,metricConfig:d,internalValue:h}=vLe(u,o),f=re(()=>{var $,B;let N=!1;if(["number","formula"].includes(d.value.metric_type.code)){const V=Number(i.value),K=Number(($=d.value)==null?void 0:$.format_value);Number.isFinite(K)&&K>=0&&(N=(((B=V.toString().split(".")[1])==null?void 0:B.length)||0)>K)}return N}),g=re(()=>{var $;return!!(($=d.value)!=null&&$.morpheme_value)||c.value.isEmpty||f.value}),m=re(()=>{var $,B,N;if(c.value.isError)return"Something went wrong. Review formula, inputs and retry.";if(c.value.pendingCalculation)return"Can’t calculate yet. Complete required fields.";if(c.value.isEmpty)return;const V=D.value,K=($=d.value)==null?void 0:$.morpheme_type;return K==="prefix"?`${((B=d.value)==null?void 0:B.morpheme_value)||""} ${V}`.trim():K==="suffix"?`${V} ${((N=d.value)==null?void 0:N.morpheme_value)||""}`.trim():V}),v=re(()=>{const{format_type:$,format_value:B}=d.value;if($==="dropdown"&&typeof B=="string"&&B.startsWith("["))try{return JSON.parse(B)}catch{return[]}return[]}),_=re(()=>({disabled:i.disabled,error:c.value.isError,inputRef:s,wrapperRef:a,clickable:!I.value,readOnly:i.readOnly||I.value,isEmpty:c.value.isEmpty})),{argsMain:w,isHover:C}=j6(_),y=($,B,N="en-US")=>new Intl.NumberFormat(N,{minimumFractionDigits:B,maximumFractionDigits:B}).format($),E=re(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const $=i.value,{format_type:B,format_value:N,mapping:V}=d.value;if(V&&typeof V=="object"&&!Array.isArray(V)){const K=V[`!${$}`];if(K)return K}if(B==="dropdown"){const K=v.value.find(te=>String(te.name)===String($));if(K)return K.name}if(typeof $=="string"){const K=Number($);return Number.isNaN(K)?$:$.replace(/[.-]/g,"").length>16?x($,N):x(K,N)}return typeof $=="number"?x($,N):String($)}),x=($,B)=>{const N=Number.parseInt(String(B)||"2",10),V=Number.isFinite(N)&&N>=0?N:2;try{if(typeof $=="string"){const K=$.split("."),te=K[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ve=K[1]?K[1].substring(0,V).padEnd(V,"0"):"0".repeat(V);return V>0?`${te}.${ve}`:te}return y($,V)}catch(K){return console.error("Error formatting metric value:",K,{num:$,decimals:V}),String($)}},A=($,B)=>{const N=Number.parseInt(String(B)||"2",10),V=Number.isFinite(N)&&N>=0?N:2;try{if(typeof $=="string"){const K=$.split("."),te=K[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),ve=K[1]?K[1].length:0,ce=Math.max(V,ve),Z=K[1]?K[1].padEnd(ce,"0"):"0".repeat(ce);return ce>0?`${te}.${Z}`:te}return new Intl.NumberFormat("en-US",{minimumFractionDigits:V,maximumFractionDigits:20}).format($)}catch(K){return console.error("Error formatting exact metric value:",K,{num:$,decimals:V}),String($)}},I=re(()=>{var $;return(($=d.value)==null?void 0:$.metric_type.code)==="formula"}),D=re(()=>{if(c.value.isEmpty)return"";if(c.value.pendingCalculation)return"pending";const $=i.value,{format_type:B,format_value:N,mapping:V}=d.value;if(V&&typeof V=="object"&&!Array.isArray(V)){const K=V[`!${$}`];if(K)return K}if(B==="dropdown"){const K=v.value.find(te=>String(te.name)===String($));if(K)return K.name}if(typeof $=="string"){const K=Number($);return Number.isNaN(K)?$:$.replace(/[.-]/g,"").length>16?A($,N):A(K,N)}return typeof $=="number"?A($,N):String($)}),{tooltip:k}=pln(""),P=async $=>{$.stopPropagation(),$.preventDefault(),$.stopImmediatePropagation();try{await navigator.clipboard.writeText(D.value),k.value="Copied",setTimeout(()=>{k.value="Copy"},3e3)}catch(B){console.error("Failed to copy text:",B),k.value="Copy failed",setTimeout(()=>{k.value="Copy"},3e3)}};mt(()=>i.value,($,B)=>{const N=Number($);Number.isFinite(N)&&N!==h.value?h.value=N:$==null&&h.value!==0&&(h.value=0)},{immediate:!0,deep:!0});const L=()=>{o.value=!0},M=()=>{o.value=!1};return($,B)=>qt((W(),ut(W6,Lt(G(w),{onMouseenter:L,style:{"--icon-size":"24px"},onMouseleave:M,ref_key:"wrapperRef",ref:a,actived:G(l),bordered:!0}),{suffix:it(()=>[i.disabled?je("",!0):(W(),se("div",{key:0,class:et([$.$style.suffix,"wrapper-suffix"])},[o.value&&!G(c).isEmpty&&!G(c).isError?qt((W(),ut(Xc,{key:0,variant:["icon","secondary"],size:24,onClick:Xt(P,["prevent","stop"])},{default:it(()=>[Ne(cc,{src:"Copy",source:"remote",size:12})]),_:1})),[[G(r),{content:G(k),hideOnClick:!1,contentClass:"extra-padding"}]]):je("",!0)],2))]),default:it(()=>[_e("div",{class:et($.$style["metric-wrapper"]),"aria-label":G(d).format_value||void 0},[_e("div",{class:et([$.$style["metric-content"],i.disabled?$.$style.disabled:""])},[!G(c).isError&&G(c).isEmpty?(W(),se(Mt,{key:0},[G(c).pendingCalculation?qt((W(),se("span",{key:0,class:et($.$style["metric-empty"])},[...B[0]||(B[0]=[Fn(" - ",-1)])],2)),[[G(r),"Can’t calculate yet. Complete required fields."]]):G(c).isEmpty?(W(),se("span",{key:1,class:et($.$style["metric-empty"])}," - ",2)):je("",!0)],64)):je("",!0),G(c).isError?qt((W(),se("div",{key:1,class:et($.$style["metric-error"])},[...B[1]||(B[1]=[Fn(" Error ",-1)])],2)),[[G(r),"Something went wrong. Review formula, inputs and retry."]]):je("",!0),!G(c).isEmpty&&!G(c).isError?qt((W(),se("span",{key:2,class:et([$.$style["metric-value"],G(C)?$.$style.hovered:"",{[$.$style.disabled]:i.disabled}])},[Fn(Et(E.value),1)],2)),[[G(r),{content:m.value,bypassOverflowCheck:g.value}]]):je("",!0)],2)],10,jdn)]),_:1},16,["actived"])),[[G(n),{isLoading:G(c).isLoading}]])}}),Gdn="_disabled_7otc0_15",qdn="_hovered_7otc0_19",Kdn={"metric-wrapper":"_metric-wrapper_7otc0_1","metric-content":"_metric-content_7otc0_5",disabled:Gdn,"metric-value":"_metric-value_7otc0_19",hovered:qdn,"metric-error":"_metric-error_7otc0_23","with-morpheme":"_with-morpheme_7otc0_38","with-formula-icon":"_with-formula-icon_7otc0_41","metric-value--number":"_metric-value--number_7otc0_47","metric-value--currency":"_metric-value--currency_7otc0_47","metric-value--percentage":"_metric-value--percentage_7otc0_47","metric-morpheme":"_metric-morpheme_7otc0_51","metric-empty":"_metric-empty_7otc0_64","metric-icon":"_metric-icon_7otc0_71"},Ydn={$style:Kdn},yLe=uc(Wdn,[["__cssModules",Ydn]]);class Xdn extends Error{}class xw extends Xdn{constructor(){super("Zone is an abstract class")}}class bLe{get type(){throw new xw}get name(){throw new xw}get ianaName(){return this.name}get isUniversal(){throw new xw}offsetName(t,n){throw new xw}formatOffset(t,n){throw new xw}offset(t){throw new xw}equals(t){throw new xw}get isValid(){throw new xw}}const WQ=new Map;function Zdn(e){let t=WQ.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),WQ.set(e,t)),t}const Qdn={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Jdn(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,l,u,c]=r;return[s,i,o,a,l,u,c]}function ehn(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:o,value:s}=n[i],a=Qdn[o];o==="era"?r[a]=s:iV(a)||(r[a]=parseInt(s,10))}return r}const GQ=new Map;class rV extends bLe{static create(t){let n=GQ.get(t);return n===void 0&&GQ.set(t,n=new rV(t)),n}static resetCache(){GQ.clear(),WQ.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=rV.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return rhn(t,n,r,this.name)}formatOffset(t,n){return sV(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=Zdn(this.name);let[i,o,s,a,l,u,c]=r.formatToParts?ehn(r,n):Jdn(r,n);a==="BC"&&(i=-Math.abs(i)+1);const d=nhn({year:i,month:o,day:s,hour:l===24?0:l,minute:u,second:c,millisecond:0});let h=+n;const f=h%1e3;return h-=f>=0?f:1e3+f,(d-h)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let qQ=null;class lA extends bLe{static get utcInstance(){return qQ===null&&(qQ=new lA(0)),qQ}static instance(t){return t===0?lA.utcInstance:new lA(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new lA(_Le(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${sV(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${sV(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return sV(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}function iV(e){return typeof e>"u"}function oV(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function wLe(e){if(!(iV(e)||e===null||e===""))return parseInt(e,10)}function thn(e){if(!(iV(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function nhn(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function rhn(e,t,n,r=null){const i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function _Le(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function sV(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${oV(n,2)}:${oV(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${oV(n,2)}${oV(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}const CLe=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function uA(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function cA(...e){return t=>e.reduce(([n,r,i],o)=>{const[s,a,l]=o(t,i);return[{...n,...s},a||r,l]},[{},null,1]).slice(0,2)}function SLe(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=wLe(t[n+i]);return[r,null,n+i]}}const xLe=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,ihn=`(?:${xLe.source}?(?:\\[(${CLe.source})\\])?)?`,ELe=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,TLe=RegExp(`${ELe.source}${ihn}`),KQ=RegExp(`(?:T${TLe.source})?`),ohn=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,shn=/(\d{4})-?W(\d\d)(?:-?(\d))?/,ahn=/(\d{4})-?(\d{3})/,lhn=SLe("weekYear","weekNumber","weekDay"),uhn=SLe("year","ordinal"),chn=/(\d{4})-(\d\d)-(\d\d)/,ALe=RegExp(`${ELe.source} ?(?:${xLe.source}|(${CLe.source}))?`),dhn=RegExp(`(?: ${ALe.source})?`);function dA(e,t,n){const r=e[t];return iV(r)?n:wLe(r)}function hhn(e,t){return[{year:dA(e,t),month:dA(e,t+1,1),day:dA(e,t+2,1)},null,t+3]}function hA(e,t){return[{hours:dA(e,t,0),minutes:dA(e,t+1,0),seconds:dA(e,t+2,0),milliseconds:thn(e[t+3])},null,t+4]}function XI(e,t){const n=!e[t]&&!e[t+1],r=_Le(e[t+1],e[t+2]),i=n?null:lA.instance(r);return[{},i,t+3]}function ZI(e,t){const n=e[t]?rV.create(e[t]):null;return[{},n,t+1]}uA(ohn,KQ),uA(shn,KQ),uA(ahn,KQ),uA(TLe),cA(hhn,hA,XI,ZI),cA(lhn,hA,XI,ZI),cA(uhn,hA,XI,ZI),cA(hA,XI,ZI),cA(hA),uA(chn,dhn),uA(ALe),cA(hA,XI,ZI);var bl;(function(e){e.review="{reviewDomain}/{ws_code}",e.review_take="{reviewDomain}/{ws_code}?id={take_id}",e.review_scene="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&tab=iteration",e.review_rendition="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}",e.review_frame="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&rendition_id={rendition_id}&tab=comment&refresh_marker=true#type=frame&data={frame}",e.review_rendition_comment="{reviewDomain}/{ws_code}?scene_id={scene_id}&rendition_id={rendition_id}&comment_id={comment_id}&tab=comment",e.review_comment="{reviewDomain}/{ws_code}?id={take_id}&scene_id={scene_id}&comment_id={comment_id}",e.scene_hub="{baseDomain}/{ws_code}/{scene_id}?o=st",e.hub_rendition="{baseDomain}/{ws_code}/{scene_id}?o=st&renditionId={rendition_id}",e.hub_comment="{baseDomain}/{ws_code}/{scene_id}?o=st&comment_id={comment_id}",e.people_insight="{baseDomain}/{ws_code}/{user_id}?o=pt",e.people_detail="{baseDomain}/{ws_code}/ws/ppl/{display_name}-{user_id}",e.project="{baseDomain}/{ws_code}/pl/dir/{entity_id}",e.project_focusMode="{baseDomain}/{ws_code}/pl/dir/{parent_id}?f={entity_id}",e.woohoo="{baseDomain}/{ws_code}/pl/woo/rpt/{woohoo_id}",e.update="{baseDomain}/{ws_code}/pl/au?id={entity_id}",e.core="{baseDomain}/{ws_code}"})(bl||(bl={})),bl.review,bl.review_take,bl.review_scene,bl.review_rendition,bl.review_frame,bl.review_rendition_comment,bl.review_comment,bl.scene_hub,bl.hub_rendition,bl.hub_comment,bl.people_insight,bl.people_detail,bl.project,bl.woohoo,bl.update,bl.core,bl.project_focusMode,new Date().getUTCFullYear()-12,new Date().getUTCFullYear()+12;const fhn=Ct({name:"EmptyData",__name:"EmptyData",props:{isSearching:{type:Boolean},isFiltering:{type:Boolean}},setup(e){const t=e,n={noData:"No data available.",noSearchResults:"No results. Try another search.",noFilterResults:"No results. Try another filter.",emptySearchFilter:"No results. Try another search or filter."},r=re(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate"),i=re(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),o=oe(!1);return ln(()=>{o.value=!0}),(s,a)=>(W(),se("div",{class:et(s.$style["no-data-item-table"])},[_e("div",{class:et(s.$style.visual)},[o.value?(W(),ut(Sln,{key:0,source:"remote",src:r.value,ratio:"4/3",maxWidth:500,maxHeight:350},null,8,["src"])):je("",!0)],2),_e("div",{class:et(s.$style.description)},Et(i.value),3)],2))}}),phn="_visual_oh0wi_12",mhn="_description_oh0wi_19",ghn={"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:phn,description:mhn},vhn={$style:ghn},yhn=uc(fhn,[["__cssModules",vhn]]),bhn={ROW_HEIGHT:38},whn=e=>{var t,n,r;if(e){if(Number((t=e.metric_type)==null?void 0:t.id)==1)return["none","not","range"].includes(e.restricted_type)?"number":"dropdown";if(Number((n=e.metric_type)==null?void 0:n.id)==2)return e.format_type=="icon"?"rating":"dropdown";if(Number((r=e.metric_type)==null?void 0:r.id)==3)return}},YQ=e=>{if(e)return whn(e)};class _hn{constructor(){Qa(this,"eGui"),Qa(this,"params")}init(t){this.params=t}getGui(){var t,n,r,i,o;const s=document.createElement("div");return(t=this.params)!=null&&t.height&&s.style.setProperty("--height",(n=this.params)==null?void 0:n.height),(r=this.params)!=null&&r.width?s.style.setProperty("--width",(i=this.params)==null?void 0:i.width):(o=this.params)!=null&&o.fullwidth?s.style.setProperty("--width","100%"):s.style.setProperty("--width",`${Math.floor(Math.random()*50)+50}%`),s.className="ag-cell-skeleton",s.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation()}),this.eGui=s,s}refresh(t){return!1}getValue(){var t;return(t=this.params)==null?void 0:t.value}isPopup(t){return!1}getPopupPosition(){}destroy(){}}const Chn=new Map;window.trackingRenderTimes=Chn;const Shn=Ct({__name:"Vue3Wrapper",props:{component:{},params:{},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!0},value:{},data:{},id:{},tooltip:{},isNoData:{type:Boolean,default:!1},workspaceId:{},entityId:{},axiosService:{},isSearching:{type:Boolean,default:!1},isFiltering:{type:Boolean,default:!1},sortType:{default:"default"},maxRating:{default:5},config:{}},setup(e,{expose:t}){const n=e,r=oe(null),i=re(()=>{var a;return((a=n.component)==null?void 0:a.name)||"UnknownComponent"}),o=re(()=>{var a;return((a=n.component)==null?void 0:a.default)||n.component}),s=re(()=>({params:n.params,disabled:n.disabled,readOnly:n.readOnly,value:n.value,maxRating:n.maxRating,data:n.data,id:n.id,workspaceId:n.workspaceId,entityId:n.entityId,axiosService:n.axiosService,tooltip:n.tooltip,isSearching:n.isSearching,isFiltering:n.isFiltering,isNoData:n.isNoData,config:n.config}));return t({focus:()=>{var a;return(a=r.value)!=null&&a.focus?r.value.focus():console.warn(`Component ${i.value} does not have a focus method.`),!0},blur:()=>{var a,l;return(l=(a=r.value)==null?void 0:a.blur)==null||l.call(a),!0},trigger:(a,l)=>{var u;return(u=r.value)==null||u.$emit(a,l),!0}}),(a,l)=>(W(),ut(Np(o.value),Lt(s.value,{ref_key:"componentRef",ref:r}),null,16))}}),xhn="_skeleton_7xde7_1",Ehn="_shimmer_7xde7_16",Thn={skeleton:xhn,shimmer:Ehn,"skeleton-loading":"_skeleton-loading_7xde7_1"},Ahn={$style:Thn},khn=uc(Shn,[["__cssModules",Ahn]]);function Dhn(e){return"stopEditing"in e}const Ohn=8,Rhn=e=>{if(!e)return;const t=e.__vueParentComponent,n=t==null?void 0:t.exposed;n&&typeof n.triggerFocus=="function"?n.triggerFocus():e.focus()};function kLe(e){return class{constructor(){Qa(this,"container"),Qa(this,"vNode",null),Qa(this,"componentInstance",null),Qa(this,"componsenExposed",null),Qa(this,"params"),Qa(this,"isEditor",!1),Qa(this,"_destroyed",!1)}init(t){var n,r,i,o;if(!t){console.error("[Vue3CellWrapper] Missing params");return}const s=performance.now();this.params=t,this.isEditor=Dhn(t),this.container=document.createElement("div"),this.container.classList.add("ag-vue3-cell-wrapper"),this.container.style.width="100%",this.container.style.height="100%";const a=t.context.apiClass,l=t,u={component:e,params:Object.freeze(t),disabled:!1,readOnly:l.readOnly??!1,value:t.value,maxRating:l.maxRating??void 0,data:t.data,id:(n=t==null?void 0:t.data)==null?void 0:n.id,workspaceId:t.context.workspaceId,entityId:t.context.entityId,axiosService:a,tooltip:l.tooltip??void 0,isSearching:l.isSearching??!1,isFiltering:l.isFiltering??!1,isNoData:l.isNoData??!1,config:l.config,sceneId:(l==null?void 0:l.sceneId)||void 0};this.vNode=Ne(khn,u),Fk(this.vNode,this.container);const c=performance.now()-s;c>Ohn&&console.warn(`[Vue3CellWrapper] Slow render (${c.toFixed(1)}ms) for "${(r=t.colDef)==null?void 0:r.field}"`),this.componentInstance=(i=this.vNode.component)==null?void 0:i.proxy,this.componsenExposed=(o=this.vNode.component)==null?void 0:o.exposed}getGui(){return this.container}refresh(t){return!1}focusUi(){var t;(t=this.componsenExposed)!=null&&t.focus?this.componsenExposed.focus():Rhn(this.container)}getValue(){var t,n,r;return this.params._editorValue!==void 0?this.params._editorValue:this.componentInstance?((r=(n=this.componentInstance).getValue)==null?void 0:r.call(n))??this.componentInstance.value:(console.warn("[Vue3CellWrapper] getValue() called but component instance not available"),(t=this.params)==null?void 0:t.value)}isPopup(t){var n,r,i,o,s;const a=(i=(r=(n=this.params)==null?void 0:n.colDef)==null?void 0:r.field)==null?void 0:i.includes("metric"),l=((o=this.params)==null?void 0:o.context)&&YQ(this.params.context);return a||l==="number"||l==="rating"||!this.isEditor?!1:(s=this.componentInstance)!=null&&s.isPopup?this.componentInstance.isPopup():!0}getPopupPosition(){var t,n,r;return this.isEditor?(t=this.componentInstance)!=null&&t.getPopupPosition?this.componentInstance.getPopupPosition():((r=(n=this.params)==null?void 0:n.colDef)==null?void 0:r.cellEditorPopupPosition)??"under":void 0}afterGuiAttached(){!this.isEditor||this.componentInstance}destroy(){if(!this._destroyed&&(this._destroyed=!0,!!this.container))try{const t=this.componentInstance;if(t){try{typeof t.$destroy=="function"&&t.$destroy()}catch(n){console.warn("[Vue3CellWrapper] Error during $destroy:",n)}try{typeof t.destroy=="function"&&t.destroy()}catch(n){console.warn("[Vue3CellWrapper] Error during destroy():",n)}}(typeof queueMicrotask=="function"?queueMicrotask:n=>Promise.resolve().then(n))(()=>{try{Fk(null,this.container)}catch(n){console.warn("[Vue3CellWrapper] Error during unmount:",n)}finally{this.container.textContent=""}})}catch(t){console.error("[Vue3CellWrapper] Error during cleanup:",t)}finally{this.vNode=null,this.componentInstance=null}}}}function Ihn(e){return kLe(e)}function Phn(e){return kLe(e)}let DLe=!1;DLe||(hHt.registerModules([wnn,uIe]),DLe=!0);class Fhn{constructor(t,n){Qa(this,"gridApi",null),Qa(this,"container"),Qa(this,"config"),Qa(this,"eventListeners",new Map),this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:r,onRowSelected:i,...o}=this.config,s={...o,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{r&&r(a)},onRowSelected:a=>{i&&i(a)}};return this.gridApi=HXt(this.container,s),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const r={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(r),n==="bottom"){const i=this.gridApi.getDisplayedRowCount();i>0&&this.gridApi.ensureIndexVisible(i-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const r={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(r),n==="bottom"){const i=this.gridApi.getDisplayedRowCount();i>0&&this.gridApi.ensureIndexVisible(i-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(r=>{var i;(i=this.gridApi)==null||i.removeEventListener(n,r)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const Mhn=YOe.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),Lhn=Ct({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=oe(null);eun(o,()=>{var m;const v=(m=s.value)==null?void 0:m.getApi();v==null||v.clearFocusedCell()});const s=oe(null),a=re(()=>({width:"100%",height:r.height||"500px"})),l=re(()=>({...r,theme:Mhn}));function u(){if(!o.value){console.warn("Grid container element not found");return}const m={...l.value,height:r.height};s.value=new Fhn(o.value,m),s.value.init(),c()}function c(){var m;const v=((m=s.value)==null?void 0:m.getApi())??null;i("onGridReady",v)}function d(m){var v,_;if(!m)return;(v=s.value)==null||v.updateColumnDefs(m);const w=m.map(C=>C.field&&C.width&&!C.hide?{colId:C.field,width:C.width}:null).filter(C=>C!==null);(_=s.value)==null||_.setColumnWidth(w)}function h(){var m;(m=s.value)==null||m.destroy(),s.value=null}function f(){var m;return((m=s.value)==null?void 0:m.getApi())||void 0}function g(){return s.value||null}return mt(()=>r.columnDefs,(m,v)=>{const _=m==null?void 0:m.filter(C=>!C.hide).map(C=>C.field).join(","),w=v==null?void 0:v.filter(C=>!C.hide).map(C=>C.field).join(",");_!==w&&d(m)},{deep:!0}),pi(()=>{h()}),t({gridApi:f,gridManager:g,syncColumnDefs:d}),ln(()=>{u()}),pi(()=>{h()}),(m,v)=>(W(),se("div",{ref_key:"gridContainerRef",ref:o,style:Jt(a.value),class:et(["ag-theme-quartz",["ag-table-container",r.isSorting?"is-sorting":""]])},null,6))}}),QI=Phn;function OLe(e){return{sceneId:re(()=>{var t;const n=(t=e.params)==null?void 0:t.context;return(n==null?void 0:n.sceneId)||""}),updateCellData:t=>{var n,r,i,o,s;const a=((n=e.params)==null?void 0:n.node.id)||"",l=(i=(r=e.params)==null?void 0:r.api)==null?void 0:i.getRowNode(a);l&&l.setDataValue("metric_value",t),(s=(o=e.params)==null?void 0:o.api)==null||s.refreshCells({rowNodes:l?[l]:[],columns:["metric_value"],force:!0})}}}const Nhn={class:"metric-editor-wrapper",ref:"metricEditorWrapperRef"},$hn=Ct({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},setup(e){const t=e,n=oe(t.value),r=oe(!0),i=oe(""),o=()=>{var v,_,w;const C=(v=l.value)==null?void 0:v.restricted_type.trim(),y=((w=(_=l.value)==null?void 0:_.restricted_value)==null?void 0:w.split(",").map(Number))||[],[E,x]=y,A={range:`Enter a value between ${E} and ${x}`,not:`These values are not allowed: ${y.join(", ")}`,exact:"Value is not allowed"}[C];return r.value?"":A},s=v=>{if(l.value){if(v===null||v===""){r.value=!0;return}if(a.value!=="number"){r.value=!0;return}r.value=OQ(l.value,Number(v)),i.value=o()}},a=re(()=>dln(l.value)),l=re(()=>{var v;return((v=t.params)==null?void 0:v.data.metric_config)||null}),{apiServices:u}=JZ(!0,t),{sceneId:c,updateCellData:d}=OLe(t),h=oe(!1),f=()=>{var v;(v=t.params)==null||v.api.stopEditing()},g=()=>{f()},m=async v=>{var _,w,C;if(f(),console.log("Handling update with value:",v),h.value=!0,n.value=v||null,v===t.value){h.value=!1;return}const y={itemIds:[c.value],metricId:((_=l.value)==null?void 0:_.id)||"",workspaceId:String(t.workspaceId)};v==null?y.clear=1:y.value=v;const E=v||null,x=t.value;console.log("Prepared payload for metric update:",y),d(E);try{const A=await((w=u.value)==null?void 0:w.bulkUpdateMetric(y));console.log("Bulk update metric response:",A),(A==null?void 0:A.message)=="Done"?(d(E),n.value=E):(d(x),console.error("Failed to update metric value:",A),n.value=x)}catch(A){d(x),n.value=x,console.error("Error during bulk metric update:",A)}finally{h.value=!1,(C=t.params)==null||C.api.stopEditing()}};return(v,_)=>(W(),se("div",Nhn,[a.value=="dropdown"&&l.value?(W(),ut(G(tcn),{key:0,config:l.value,modelValue:n.value,"onUpdate:modelValue":_[0]||(_[0]=w=>n.value=w),onChange:m,onHandleCancel:g},null,8,["config","modelValue"])):a.value=="number"&&l.value?(W(),ut(G(icn),{key:1,showInlineError:!1,autoEmit:!0,config:l.value,modelValue:n.value,"onUpdate:modelValue":_[1]||(_[1]=w=>n.value=w),style:{width:"100%"},onHandleChange:m,onCancel:g,onOnValidation:s},null,8,["config","modelValue"])):je("",!0)],512))}}),Bhn=uc($hn,[["__scopeId","data-v-8e5ec6c4"]]),Vhn={key:0,style:{color:"#6b6b6b"}},Uhn=Ct({__name:"MetricCellRenderer",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean}},setup(e){const t=fv,n=e,r=re(()=>{var s,a;return(a=(s=n.params)==null?void 0:s.value)==null?void 0:a.morpheme}),i=re(()=>{var s,a;return(a=(s=n.params)==null?void 0:s.value)==null?void 0:a.name}),o=re(()=>{var s;const a=(s=n.params)==null?void 0:s.value;return(a==null?void 0:a.is_primary)==1?"primary":(a==null?void 0:a.is_point_metric)==1?"secondary":""});return(s,a)=>(W(),se("div",{class:et(s.$style["metric-content"])},[qt((W(),se("span",null,[Fn(Et(i.value),1)])),[[G(t),{content:i.value}]]),r.value?(W(),se("small",Vhn," ("+Et(r.value)+") ",1)):je("",!0),o.value==="primary"?qt((W(),se("div",{key:1,class:et(s.$style["icon-metric"])},[Ne(G(cc),{src:"ChartPie",color:"#A6A6A6",size:"14"})],2)),[[G(t),"Woohoo metric"]]):je("",!0),o.value==="secondary"?qt((W(),se("div",{key:2,class:et(s.$style["icon-metric"])},[Ne(G(cc),{src:"Bullseye",color:"#A6A6A6",size:"14"})],2)),[[G(t),"Point Metric"]]):je("",!0)],2))}}),Hhn={"icon-metric":"_icon-metric_wflah_1","metric-content":"_metric-content_wflah_10"},zhn={$style:Hhn},jhn=uc(Uhn,[["__cssModules",zhn]]),Whn=Ct({__name:"MetricRating",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean},config:{}},setup(e,{expose:t}){const n=CZ,r=e,{isEditing:i}=xMe(r),{apiServices:o}=JZ(!0,r),s=re(()=>{var x,A;return{value:a.value,metricConfig:((A=(x=r.params)==null?void 0:x.colDef)==null?void 0:A.context)||r.config,error:r.error,hovered:!1,readOnly:r.disabled,disabled:r.readOnly,apiServices:o.value}}),a=oe(Number(r.value)),l=oe(!1),{componentState:u,metricConfig:c,ICON_SIZE:d,ratingParams:h,standardNameforIcon:f}=vLe(s,l),{sceneId:g,updateCellData:m}=OLe(r),v=oe(a.value),_=async x=>{var A,I;a.value=x,v.value,m(void 0),a.value=NaN;const D={itemIds:[g.value],metricId:((A=c.value)==null?void 0:A.id)||"",workspaceId:String(r.workspaceId)};x==null?D.clear=1:D.value=x;try{const k=await((I=o.value)==null?void 0:I.bulkUpdateMetric(D));(k==null?void 0:k.message)=="Done"?(m(x),a.value=Number(x),v.value=x):(m(v.value),a.value=Number(v.value),console.error("Failed to update metric value:",k))}catch(k){m(v.value),a.value=Number(v.value),console.error("Error during bulk metric update:",k)}},w=QZ(async x=>{Gt(()=>{setTimeout(()=>{_(a.value)},100)})},300),C=re(()=>({disabled:r.disabled,error:u.value.isError,clickable:!0,readOnly:r.readOnly,isEmpty:u.value.isEmpty})),y=oe(null),{argsMain:E}=j6(C);return t({focus:()=>{var x,A;(A=(x=y.value)==null?void 0:x.focus)==null||A.call(x)}}),(x,A)=>(W(),ut(G(W6),Lt({style:{"--icon-size":"24px","--box-padding":"0 0 0 0"}},G(E),{ref:"wrapperRef",actived:G(i),size:32,tabindex:"0",bordered:!0}),{default:it(()=>[G(u).isRating&&G(h).maxRating?qt((W(),ut(G(Qun),{key:0,modelValue:a.value,"onUpdate:modelValue":A[0]||(A[0]=I=>a.value=I),ref_key:"ratingComponentRef",ref:y,params:G(h),readOnly:r.readOnly,disabled:r.disabled,onHandleEnter:_},{icon:it(({value:I})=>[Ne(G(cc),{onClick:D=>G(w)(I),source:"rating",src:G(f)()||"Star",size:G(d)},null,8,["onClick","src","size"])]),_:1},8,["modelValue","params","readOnly","disabled"])),[[G(n),{isLoading:G(u).isLoading,fullwidth:!0}]]):je("",!0)]),_:1},16,["actived"]))}}),Ghn={id:"metric-table",ref:"tableWrapperRef"},qhn="API_BASE_URL",Khn="formula",aV=10,Yhn=!1,Xhn=Ct({__name:"App",props:{sceneId:{default:""},workspaceId:{default:""},availableHeight:{}},emits:["update-success","update-error"],setup(e,{expose:t,emit:n}){const r=e,i=re(()=>r.availableHeight??window.innerHeight-200),o=k=>MPe.getInstance().getItem(k)||"",s=()=>{const k=o(qhn);return k.includes("/v1")?k.slice(0,k.lastIndexOf("/v1")):k},a=k=>{var P;return((P=k==null?void 0:k.metric_type)==null?void 0:P.code)===Khn},l=k=>{var P;return((P=k==null?void 0:k.metric_type)==null?void 0:P.code)==="rating"&&(k==null?void 0:k.format_type)=="icon"},u=k=>a(k)?k.metric_value??null:(l(k),k.input_value??null),c=k=>k.map((P,L)=>({id:String(P.id??L),name:{name:String(P.name??"Untitled metric"),is_primary:P.is_primary,is_point_metric:P.is_point_metric,morpheme:P.morpheme_value},metric_config:P,metric_value:u(P),metric_permission:P.auth_permission})),d=k=>{var P,L;const M=k.data,$=(P=k.node.data)==null?void 0:P.metric_value,B=(L=k.node.data)==null?void 0:L.metric_config,N=YQ(B);return M===void 0?{component:_hn,params:{}}:N==="rating"?{component:QI(Whn),params:{config:B,value:$,maxRating:B==null?void 0:B.range,sceneId:r.sceneId}}:N==="dropdown"?{component:QI(yLe),params:{config:B,value:$}}:{component:QI(yLe),params:{config:B,value:$}}},h=k=>{var P,L,M,$,B;const N=YQ((P=k.node.data)==null?void 0:P.metric_config);return{component:QI(Bhn),params:{config:(L=k.node.data)==null?void 0:L.metric_config,value:(M=k.node.data)==null?void 0:M.metric_value,maxRating:(B=($=k.node.data)==null?void 0:$.metric_config)==null?void 0:B.range},popup:!(N=="number"||N=="rating")}};function f(k){var P;return!k||a(k)||l(k)?!1:((P=k.auth_permission)==null?void 0:P.permission)==2}const g=k=>!!(k.data&&k.node.data&&f(k.data.metric_config)),m=k=>({component:QI(jhn),params:{value:k.value}}),{apiServices:v}=JZ(!1,r),_=re(()=>[{field:"name",headerName:"Metric",minWidth:220,flex:2,cellRendererSelector:m,editable:!1,cellEditorSelector:void 0},{field:"metric_value",headerName:"Value",minWidth:140,flex:1,cellRendererSelector:d,cellEditorSelector:h,editable:g,cellEditorPopupPosition:"under",cellEditorPopup:!0}]),w=n,C=re(()=>({isSearching:!1,isFiltering:!1})),y=re(()=>({headerHeight:32,blockLoadDebounceMillis:300,columnDefs:_.value,rowModelType:"infinite",cacheBlockSize:aV,infiniteInitialRowCount:aV,pagination:!1,rowHeight:bhn.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,suppressScrollOnNewData:!0,rowBuffer:aV,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,stopEditingWhenCellsLoseFocus:!1,noRowsOverlayComponent:Ihn(yhn),noRowsOverlayComponentParams:()=>C.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:k=>k.data.id,getRowClass:k=>k.data?["row-highlight"]:["row-empty"],suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:r.workspaceId,sorting:!1,apiServices:v.value,sceneId:r.sceneId},suppressHeaderFocus:!0,navigateToNextCell:()=>null,onCellEditRequest:k=>{console.log("Cell edit requested:",k)},onCellKeyDown:k=>{var P,L,M;if(((P=k==null?void 0:k.event)==null?void 0:P.key)==="Enter"){const{api:$,node:B,column:N}=k,V=$.getCellRendererInstances({rowNodes:[B],columns:[N]});if(V.length>0){const K=V[0];K&&typeof((L=K.componsenExposed)==null?void 0:L.focus)=="function"&&((M=K.componsenExposed)==null||M.focus())}}},isRowSelectable:k=>!k.group,suppressKeyboardEvent:k=>{var P;if((P=k.data)!=null&&P.isDeleted)return!0;const L=k.event.key,M=k.editing;return M&&L==="Tab"?!0:M&&L==="Enter"?!1:L==="Enter"?(k.event.preventDefault(),k.event.stopPropagation(),console.log("Enter key pressed, suppressing default behavior"),!0):L==="ArrowUp"||L==="ArrowDown"||L==="ArrowLeft"||L==="ArrowRight"||L==="Tab"||L==="Enter"},onBodyScroll:k=>{k.api.getFirstDisplayedRowIndex(),k.api.getLastDisplayedRowIndex()},onViewportChanged:k=>{},onCellEditingStarted(k){console.log("Cell editing started:",k)},tabToNextCell:k=>{let P=k.nextCellPosition;if(P&&P.column.getColId()==="ag-Grid-SelectionColumn"){const L=k.api.getAllDisplayedColumns(),M=L.indexOf(P.column),$=k.backwards?-1:1,B=L[M+$];if(B)return{rowIndex:P.rowIndex,column:B,rowPinned:P.rowPinned}}return P||!1}})),E=async k=>{var P,L;try{const M=await((P=v.value)==null?void 0:P.getMetrics(r.sceneId,k.page,k.pageSize)),$=Array.isArray(M==null?void 0:M.data)?M.data:[],B=Number(((L=M==null?void 0:M.meta)==null?void 0:L.total)??$.length??0);return{rows:c($),total:B}}catch(M){return console.error("Failed to fetch metrics",M),{rows:[],total:0}}},x=oe(-1);function A(k,P){return{async getRows(L){try{const M=Math.floor(L.startRow/P)+1,{rows:$,total:B}=await k({page:M,pageSize:P,sort_by:L.sortModel});x.value=B,L.successCallback($,x.value)}catch(M){console.error("Datasource fetch error",M),L.failCallback()}}}}const I=oe(null),D=k=>{var P;return k?(I.value=k,(P=k.setGridOption)==null||P.call(k,"datasource",A(E,aV)),k):null};return Ms(()=>{try{const k=Ci();if(!k)throw new Error("Current instance is null");const P={domainApi:s(),wsCode:r.workspaceId,sceneId:r.sceneId};if(!P.sceneId||!P.wsCode||!P.domainApi)throw new Error("API configuration is incomplete");const L=new zdn({},{domainApi:P.domainApi,wsCode:P.wsCode,sceneId:P.sceneId});L.on("call-api",M=>{console.log("API call event:",M),M.success?w("update-success",M):(console.error("API call failed:",M),w("update-error",M))}),k.appContext.config.globalProperties.apiServices=L}catch(k){console.error("Error getting current instance:",k)}}),t({refreshGrid:()=>{const k=I.value||null;k&&k.refreshInfiniteCache()}}),(k,P)=>(W(),se("div",Ghn,[Ne(G(Lhn),Lt({id:"item_table_main",ref:"agGrid"},y.value,{height:i.value+"px",isSorting:Yhn,onOnGridReady:D}),null,16,["height"])],512))}}),Zhn=e=>JSON.parse(e).map((t,n)=>({id:String(n),text:t.name})),Qhn=()=>{const e=oe(),t=oe(!1),n=Za(),r=Or(),{showErrorSnackbar:i}=r,{updateMetric:o}=n,s=async w=>{t.value=!0;const C=await o(w);return setTimeout(()=>{t.value=!1},50),C},a=fl(async(w,C,y,E)=>{const x=I=>{E(y,!1),i({label:I})},A={...C,metric_value:w};try{const I=await s(A);I!=null&&I.success&&E(w,!0)}catch(I){Sn(I,"updateMetricValue"),x("Update failed.")}},300),l=({params:w,idMetricPayload:C})=>{var I;const y=Zhn(w.data.formatValue).map(D=>({value:D.id,label:D.text||""})),E=((I=y.find(D=>D.label==w.data.inputValue))==null?void 0:I.value)??"",x=w.data.auth_permission.permission!==2,A={options:y,scrollerClass:".ag-body-viewport",placeholder:"",morpheme:w.data.morpheme||void 0,limitDecimal:Number(w.data.format_value),value:E,disabled:x,mappingValue:w.data.mapping,"onUpdate:modelValue":D=>{var P;const k=((P=y.find(L=>L.value==D))==null?void 0:P.label)??"";a(k,C,String(E),(L,M)=>{var $;if(M)v(w.data.id,L);else{const B=(($=y.find(N=>N.value==E))==null?void 0:$.label)??"";v(w.data.id,B)}})}};return{childComponent:uq,childProps:A,isEdit:w.data.isEdit}},u=({params:w,idMetricPayload:C})=>{var D;const y=w.data.restricted_value.split(",").map(k=>({value:k,label:w.data.mapping&&w.data.mapping[`!${k}`]?w.data.mapping[`!${k}`]:k})),E=((D=y.find(k=>k.label==w.data.inputValue))==null?void 0:D.value)??"",x=oe(E),A=w.data.auth_permission.permission!==2,I={options:y,scrollerClass:".ag-body-viewport",placeholder:"",disabled:A,morpheme:w.data.morpheme,limitDecimal:Number(w.data.format_value),value:x.value,mappingValue:w.data.mapping,"onUpdate:modelValue":fl(k=>a(k,C,String(E),P=>{var M;const L=((M=y.find($=>$.value==P))==null?void 0:M.label)??"";m(w.data.id,P,L)}),500)};return{childComponent:uq,childProps:I,isEdit:w.data.isEdit}},c=({params:w,idMetricPayload:C})=>{const y=Number(w.data.inputValue),E=oe(y),x=w.data.auth_permission.permission!==2,A={ratingIcon:w.data.format_symbol||"BoltSolid",value:E.value,maxRating:w.data.range,readOnly:x,"onUpdate:modelValue":async I=>a(I,C,Number(E.value),D=>v(w.data.id,D))};return{childComponent:oxe,childProps:A,isEdit:w.data.isEdit}},d=({params:w,idMetricPayload:C})=>{var I;const y=((I=w.data)==null?void 0:I.inputValue)===null?"":String(w.data.inputValue),E=oe(y),x=w.data.auth_permission.permission!==2,A={value:E.value,morpheme:w.data.morpheme,disabled:x,limitDecimal:Number(w.data.format_value),inputType:"number",change:D=>{a(D,C,String(E.value),k=>{v(w.data.id,k)})}};return{childComponent:mq,childProps:A,isEdit:w.data.isEdit}},h=Hu(),f=w=>{if(!w.data)return;const C={item_ids:[h??""],metric_id:w.data.id},y=w.data.formatType;let E={childComponent:mq,childProps:{},isEdit:w.data.isEdit};switch(y){case FU.dropdown:E=l({params:w,idMetricPayload:C});break;case FU.rating:E=c({params:w,idMetricPayload:C});break;case FU.number:w.data.restricted_type==="exact"?(w.data.formatValue=w.data.restricted_value,E=u({params:w,idMetricPayload:C})):w.data.formula?E=g({params:w}):E=d({params:w,idMetricPayload:C});break;default:E=d({params:w,idMetricPayload:C});break}return E},g=({params:w})=>{var y,E,x;const C={formulaValue:((y=w.data)==null?void 0:y.inputValue)||"",morpheme:((E=w.data)==null?void 0:E.morpheme)||"",limitDecimal:Number((x=w.data)==null?void 0:x.format_value),disable:w.data.auth_permission.permission!==2};return{childComponent:lq,childProps:C,isEdit:w.data.isEdit}},m=(w,C,y)=>{(x=>{e.value.forEachNode(A=>{A.data.id===w&&A.setData({...A.data,value:x||"",inputValue:y})})})(String(C))},v=(w,C)=>{(E=>{e.value.forEachNode(x=>{x.data.id===w&&x.setData({...x.data,inputValue:E})})})(String(C))};return{childComponent:f,updateRows:v,refreshing:t,gridApi:e}},Jhn={class:"h-full bg-white metric-log"},efn={key:0,class:"flex flex-1 p-10 items-center justify-center w-full h-[calc(100%-40px)]"},tfn=Vr(Ct({__name:"SceneMetric",emits:["loaded"],setup(e,{emit:t}){const n=Za(),{sceneId:r,workspaceId:i}=Mn(n),{refreshing:o}=Qhn(),s=oe(!1),a=oe(void 0),l=oe(null),u=re(()=>s.value&&!o.value),c=TC(),{connectState:d}=Mn(c),h=oe(!1),f=oe(null),g=async()=>{var C;(C=f.value)==null||C.refreshGrid()},m=C=>{},v=C=>{if(console.error("AAAAAAAAAAAAAAAAAAcallbackUpdateError",C),C.apiCode=="offline"){Or().showErrorSnackbar({label:"You are currently offline. Please check your internet connection."});return}else C.res&&C.res.data&&Or().showErrorNetMessage(C.res.data)},_=t,w=()=>{var C;if(l.value){const y=(((C=l.value)==null?void 0:C.offsetHeight)||0)-40;a.value=y}};return ln(()=>{window.addEventListener("resize",w),Gt(()=>{w(),_("loaded")}),_("loaded")}),pi(()=>{window.removeEventListener("resize",w)}),(C,y)=>(W(),ut(C4,{type:"metric","handle-reload":g,class:"scene-metric"},{view:it(({})=>[_e("div",{ref_key:"metricLogRef",ref:l,style:{height:"100%"}},[_e("div",null,[Ne(BO,{title:"Metric","disable-refresh":G(o),onRefresh:g},null,8,["disable-refresh"])]),_e("div",Jhn,[u.value?(W(),se("div",efn,[Ne(VC,{type:"metric"})])):je("",!0),h.value?(W(),ut(qE,{key:1,class:"loading-indicator"})):je("",!0),a.value?(W(),ut(G(Xhn),{key:2,sceneId:G(r),workspaceId:G(i),ref_key:"metricTableRef",ref:f,availableHeight:a.value,onUpdateSuccess:m,onUpdateError:v},null,8,["sceneId","workspaceId","availableHeight"])):je("",!0)])],512)]),_:1}))}}),[["__scopeId","data-v-7a31c580"]]);function XQ(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nfn(e){if(Array.isArray(e))return XQ(e)}function rfn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function RLe(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(u){return void n(u)}a.done?t(l):Promise.resolve(l).then(r,i)}function ILe(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(l){RLe(o,r,i,s,a,"next",l)}function a(l){RLe(o,r,i,s,a,"throw",l)}s(void 0)})}}function ifn(e,t,n){return t=lV(t),cfn(e,FLe()?Reflect.construct(t,n||[],lV(e).constructor):t.apply(e,n))}function ofn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sfn(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function PLe(e,t,n){return(t=hfn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lV(e){return lV=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},lV(e)}function afn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ZQ(e,t)}function FLe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FLe=function(){return!!e})()}function lfn(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ufn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
521
521
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MLe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function S1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?MLe(Object(n),!0).forEach(function(r){PLe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MLe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cfn(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rfn(e)}function JI(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(f,g,m,v){var _=g&&g.prototype instanceof a?g:a,w=Object.create(_.prototype);return Xh(w,"_invoke",function(C,y,E){var x,A,I,D=0,k=E||[],P=!1,L={p:0,n:0,v:e,a:M,f:M.bind(e,4),d:function($,B){return x=$,A=0,I=e,L.n=B,s}};function M($,B){for(A=$,I=B,t=0;!P&&D&&!N&&t<k.length;t++){var N,V=k[t],K=L.p,te=V[2];$>3?(N=te===B)&&(I=V[(A=V[4])?5:(A=3,3)],V[4]=V[5]=e):V[0]<=K&&((N=$<2&&K<V[1])?(A=0,L.v=B,L.n=V[1]):K<te&&(N=$<3||V[0]>B||B>te)&&(V[4]=$,V[5]=B,L.n=te,A=0))}if(N||$>1)return s;throw P=!0,B}return function($,B,N){if(D>1)throw TypeError("Generator is already running");for(P&&B===1&&M(B,N),A=B,I=N;(t=A<2?e:I)||!P;){x||(A?A<3?(A>1&&(L.n=-1),M(A,I)):L.n=I:L.v=I);try{if(D=2,x){if(A||($="next"),t=x[$]){if(!(t=t.call(x,I)))throw TypeError("iterator result is not an object");if(!t.done)return t;I=t.value,A<2&&(A=0)}else A===1&&(t=x.return)&&t.call(x),A<2&&(I=TypeError("The iterator does not provide a '"+$+"' method"),A=1);x=e}else if((t=(P=L.n<0)?I:C.call(y,L))!==s)break}catch(V){x=e,A=1,I=V}finally{D=1}}return{value:t,done:P}}}(f,m,v),!0),w}var s={};function a(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Xh(t={},r,function(){return this}),t),d=u.prototype=a.prototype=Object.create(c);function h(f){return Object.setPrototypeOf?Object.setPrototypeOf(f,u):(f.__proto__=u,Xh(f,i,"GeneratorFunction")),f.prototype=Object.create(d),f}return l.prototype=u,Xh(d,"constructor",u),Xh(u,"constructor",l),l.displayName="GeneratorFunction",Xh(u,i,"GeneratorFunction"),Xh(d),Xh(d,i,"Generator"),Xh(d,r,function(){return this}),Xh(d,"toString",function(){return"[object Generator]"}),(JI=function(){return{w:o,m:h}})()}function Xh(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch{i=0}Xh=function(o,s,a,l){function u(c,d){Xh(o,c,function(h){return this._invoke(c,d,h)})}s?i?i(o,s,{value:a,enumerable:!l,configurable:!l,writable:!l}):o[s]=a:(u("next",0),u("throw",1),u("return",2))},Xh(e,t,n,r)}function ZQ(e,t){return ZQ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ZQ(e,t)}function QQ(e){return nfn(e)||lfn(e)||ffn(e)||ufn()}function dfn(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hfn(e){var t=dfn(e,"string");return typeof t=="symbol"?t:t+""}function ffn(e,t){if(e){if(typeof e=="string")return XQ(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XQ(e,t):void 0}}var uV=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function pfn(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var JQ,LLe;function cV(){if(LLe)return JQ;LLe=1;var e;return typeof window<"u"?e=window:typeof uV<"u"?e=uV:typeof self<"u"?e=self:e={},JQ=e,JQ}var mfn=cV(),bt=eP(mfn),gfn={},vfn=Object.freeze({__proto__:null,default:gfn}),yfn=pfn(vfn),eJ,NLe;function $Le(){if(NLe)return eJ;NLe=1;var e=typeof uV<"u"?uV:typeof window<"u"?window:{},t=yfn,n;return typeof document<"u"?n=document:(n=e["__GLOBAL_DOCUMENT_CACHE@4"],n||(n=e["__GLOBAL_DOCUMENT_CACHE@4"]=t)),eJ=n,eJ}var bfn=$Le(),bn=eP(bfn),dV={exports:{}},tJ={exports:{}},BLe;function wfn(){return BLe||(BLe=1,function(e){function t(){return e.exports=t=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var o in i)({}).hasOwnProperty.call(i,o)&&(n[o]=i[o])}return n},e.exports.__esModule=!0,e.exports.default=e.exports,t.apply(null,arguments)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports}(tJ)),tJ.exports}var nJ,VLe;function _fn(){if(VLe)return nJ;VLe=1,nJ=t;var e=Object.prototype.toString;function t(n){if(!n)return!1;var r=e.call(n);return r==="[object Function]"||typeof n=="function"&&r!=="[object RegExp]"||typeof window<"u"&&(n===window.setTimeout||n===window.alert||n===window.confirm||n===window.prompt)}return nJ}var rJ,ULe;function Cfn(){if(ULe)return rJ;ULe=1;function e(i,o){var s=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(s)return(s=s.call(i)).next.bind(s);if(Array.isArray(i)||(s=t(i))||o){s&&(i=s);var a=0;return function(){return a>=i.length?{done:!0}:{done:!1,value:i[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
522
522
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t(i,o){if(i){if(typeof i=="string")return n(i,o);var s=Object.prototype.toString.call(i).slice(8,-1);if(s==="Object"&&i.constructor&&(s=i.constructor.name),s==="Map"||s==="Set")return Array.from(i);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return n(i,o)}}function n(i,o){(o==null||o>i.length)&&(o=i.length);for(var s=0,a=new Array(o);s<o;s++)a[s]=i[s];return a}var r=function(){function i(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var o=i.prototype;return o.getIsEnabled=function(){return this.enabled_},o.enable=function(){this.enabled_=!0},o.disable=function(){this.enabled_=!1},o.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},o.addInterceptor=function(a,l){this.typeToInterceptorsMap_.has(a)||this.typeToInterceptorsMap_.set(a,new Set);var u=this.typeToInterceptorsMap_.get(a);return u.has(l)?!1:(u.add(l),!0)},o.removeInterceptor=function(a,l){var u=this.typeToInterceptorsMap_.get(a);return u&&u.has(l)?(u.delete(l),!0):!1},o.clearInterceptorsByType=function(a){var l=this.typeToInterceptorsMap_.get(a);return l?(this.typeToInterceptorsMap_.delete(a),this.typeToInterceptorsMap_.set(a,new Set),!0):!1},o.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},o.getForType=function(a){return this.typeToInterceptorsMap_.get(a)||new Set},o.execute=function(a,l){for(var u=this.getForType(a),c=e(u),d;!(d=c()).done;){var h=d.value;try{l=h(l)}catch{}}return l},i}();return rJ=r,rJ}var iJ,HLe;function Sfn(){if(HLe)return iJ;HLe=1;var e=function(){function n(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var r=n.prototype;return r.getIsEnabled=function(){return this.enabled_},r.enable=function(){this.enabled_=!0},r.disable=function(){this.enabled_=!1},r.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},r.getMaxAttempts=function(){return this.maxAttempts_},r.setMaxAttempts=function(o){this.maxAttempts_=o},r.getDelayFactor=function(){return this.delayFactor_},r.setDelayFactor=function(o){this.delayFactor_=o},r.getFuzzFactor=function(){return this.fuzzFactor_},r.setFuzzFactor=function(o){this.fuzzFactor_=o},r.getInitialDelay=function(){return this.initialDelay_},r.setInitialDelay=function(o){this.initialDelay_=o},r.createRetry=function(o){var s=o===void 0?{}:o,a=s.maxAttempts,l=s.delayFactor,u=s.fuzzFactor,c=s.initialDelay;return new t({maxAttempts:a||this.maxAttempts_,delayFactor:l||this.delayFactor_,fuzzFactor:u||this.fuzzFactor_,initialDelay:c||this.initialDelay_})},n}(),t=function(){function n(i){this.maxAttempts_=i.maxAttempts,this.delayFactor_=i.delayFactor,this.fuzzFactor_=i.fuzzFactor,this.currentDelay_=i.initialDelay,this.currentAttempt_=1}var r=n.prototype;return r.moveToNextAttempt=function(){this.currentAttempt_++;var o=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+o},r.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},r.getCurrentDelay=function(){return this.currentDelay_},r.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},r.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},r.getCurrentFuzzedDelay=function(){var o=this.getCurrentMinPossibleDelay(),s=this.getCurrentMaxPossibleDelay();return o+Math.random()*(s-o)},n}();return iJ=e,iJ}var oJ,zLe;function xfn(){if(zLe)return oJ;zLe=1;var e=cV(),t=function(i,o){return o===void 0&&(o=!1),function(s,a,l){if(s){i(s);return}if(a.statusCode>=400&&a.statusCode<=599){var u=l;if(o)if(e.TextDecoder){var c=n(a.headers&&a.headers["content-type"]);try{u=new TextDecoder(c).decode(l)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(l));i({cause:u});return}i(null,l)}};function n(r){return r===void 0&&(r=""),r.toLowerCase().split(";").reduce(function(i,o){var s=o.split("="),a=s[0],l=s[1];return a.trim()==="charset"?l.trim():i},"utf-8")}return oJ=t,oJ}var jLe;function Efn(){if(jLe)return dV.exports;jLe=1;var e=cV(),t=wfn(),n=_fn(),r=Cfn(),i=Sfn();u.httpHandler=xfn(),u.requestInterceptorsStorage=new r,u.responseInterceptorsStorage=new r,u.retryManager=new i;/**
523
523
  * @license