@arbocollab/arbo-plugin-item-table 0.0.75 → 0.0.76
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/lib/es/index.es.js +4 -2
- package/lib/umd/index.umd.js +2 -2
- package/package.json +1 -1
package/lib/es/index.es.js
CHANGED
|
@@ -74648,8 +74648,10 @@ const fme = () => [...[
|
|
|
74648
74648
|
ut(e, (c) => l(c), { immediate: !0 });
|
|
74649
74649
|
const u = Lo((c, d) => {
|
|
74650
74650
|
var w, S;
|
|
74651
|
-
if (["uiColumnResized",
|
|
74651
|
+
if (["uiColumnResized", "uiColumnMoved", "api"].indexOf(c.source) === -1) {
|
|
74652
|
+
console.log("Skipping saveColumnConfig for source:", c.source);
|
|
74652
74653
|
return;
|
|
74654
|
+
}
|
|
74653
74655
|
const h = (w = n == null ? void 0 : n.value) == null ? void 0 : w.getColumnDefs(), f = (S = n == null ? void 0 : n.value) == null ? void 0 : S.getColumnState().reduce(
|
|
74654
74656
|
(_, C) => (_[C.colId] = Number(C.width), _),
|
|
74655
74657
|
{}
|
|
@@ -78247,7 +78249,7 @@ const rye = { key: 1 }, aye = /* @__PURE__ */ ht({
|
|
|
78247
78249
|
"beta-tag": "_beta-tag_1lefh_57"
|
|
78248
78250
|
}, wye = {
|
|
78249
78251
|
$style: Cye
|
|
78250
|
-
}, bye = /* @__PURE__ */ St(fye, [["__cssModules", wye]]), HL = "0.0.
|
|
78252
|
+
}, bye = /* @__PURE__ */ St(fye, [["__cssModules", wye]]), HL = "0.0.76", Sye = { key: 0 }, Eye = /* @__PURE__ */ ht({
|
|
78251
78253
|
__name: "app",
|
|
78252
78254
|
setup(e) {
|
|
78253
78255
|
const t = z(() => n.id.length === 0 || n.workspaceId.length === 0), n = ts({
|
package/lib/umd/index.umd.js
CHANGED
|
@@ -183,7 +183,7 @@ If you are trying to annotate ${i} with application data, use the '${i}.context'
|
|
|
183
183
|
width: 16px;
|
|
184
184
|
height: 16px;
|
|
185
185
|
margin: 0;
|
|
186
|
-
`,this.selectionChangedListener=i=>{this.syncCheckboxWithRow(i)},t.node.addEventListener("rowSelected",i=>{this.syncCheckboxWithRow(i)}),this.eGui.addEventListener("click",this.handleCellClick),this.eCheckbox.addEventListener("change",this.handleCheckboxChange),this.eGui.appendChild(this.eCheckbox)}syncCheckboxWithRow(t){if(t.node.data===void 0?this.eGui.classList.add("is-loading"):this.eGui.classList.remove("is-loading"),!this.isUpdating&&this.eCheckbox){const i=!!this.params.node.isSelected();this.eCheckbox.checked!==i&&(this.eCheckbox.checked=i)}}getGui(){return this.eGui}refresh(t){var s;const n=(s=t.data)==null?void 0:s.id;return this.previousDataId!==n&&(this.previousDataId=n,this.eCheckbox.checked=!!t.node.isSelected()),this.params=t,t.data!==void 0?this.eGui.classList.remove("is-loading"):this.eGui.classList.add("is-loading"),this.syncCheckboxWithRow(t),!0}destroy(){this.selectionChangedListener&&this.params.node.removeEventListener("rowSelected",this.selectionChangedListener),this.eGui.removeEventListener("click",this.handleCellClick),this.eCheckbox.removeEventListener("change",this.handleCheckboxChange)}}function hc(e){return tI(e)}const Nce=()=>[...[{headerName:"Scene name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:hc(ul)},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:hc(ul)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:hc(ul)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:hc(ul)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:hc(ul),cellRendererParams:n=>{var i,s,o;return{...n,value:(i=n==null?void 0:n.data)==null?void 0:i.lastUpdated.value,tooltip:((o=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:o.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:hc(ul),cellRendererParams:n=>{var i,s,o;return{...n,value:(i=n==null?void 0:n.data)==null?void 0:i.completedOn.value,tooltip:((o=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:o.tooltip)||void 0,readOnly:!0}}}].map(n=>Zd.fromType(n))],Cm={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},Vce={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0},Bce=()=>({field:"__checkboxSelection",width:Cm.WIDTH,minWidth:Cm.WIDTH,maxWidth:Cm.WIDTH,pinned:"left",lockPosition:!0,suppressMovable:!0,suppressColumnsToolPanel:!0,editable:!1,sortable:!1,filter:!1,resizable:!1,headerClass:Cm.HEADER_CLASS,headerComponent:pg(K7),cellRenderer:Lce}),Hce={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0},$ce=(e,t,n)=>{const{getCachedValue:i,setCachedValue:s}=od({dbName:"item_table_column_configs",storeName:"column_configs"}),o=async()=>{const c=await i(t);if(c&&typeof c=="string")try{return JSON.parse(c)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},r=G([]),a=Bce(),l=async c=>{const d=await o(),h=new Map;d==null||d.forEach(x=>{x.width&&h.set(x.field,x.width)});const f=Nce(),p=Zd.fromType(Hce),y=((c==null?void 0:c.map(x=>{var L;return{headerName:x.name,field:`metric_${x.id}`,editable:((L=x==null?void 0:x.auth_permission)==null?void 0:L.permission)==2,sortable:!0,filter:!1,flex:1,context:{...x},hide:!(x.is_primary||x.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:pg(ul),headerComponentParams:N=>({headerType:x.metric_type.code=="number"||x.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${x.id}`)}}))||[]).map(x=>Zd.fromType(x)),w=[a,...f,...y,Vce,p],S=w.filter(x=>x.pinned==="left"),_=w.filter(x=>x.pinned==="right"||x.field==="blank"),C=w.filter(x=>!x.pinned&&x.field!=="blank");if(!d||d.length===0){r.value=w;return}const E=new Map(d.map(x=>[x.field,x])),R=new Map(C.map(x=>[x.field,x])),P=[];for(const x of d)if(x.field&&R.has(x.field)){const L=R.get(x.field);P.push({...L,hide:x.hide,width:x.width}),R.delete(x.field)}const I=Array.from(R.values()),k=[...P,...I],O=S.map(x=>{const L=E.get(x.field);return L!=null&&L.width?{...x,width:L.width}:x}),F=_.map(x=>{const L=E.get(x.field);return L!=null&&L.width?{...x,width:L.width}:x});r.value=[...O,...k,...F]};ut(e,c=>l(c),{immediate:!0});const u=Ds((c,d)=>{var w,S;if(["uiColumnResized",'"uiColumnMoved"',"api"].indexOf(c.source)===-1)return;const h=(w=n==null?void 0:n.value)==null?void 0:w.getColumnDefs(),f=(S=n==null?void 0:n.value)==null?void 0:S.getColumnState().reduce((_,C)=>(_[C.colId]=Number(C.width),_),{}),p=new Map;Object.entries(f||{}).forEach(([_,C])=>{p.set(_,C)});const m=h==null?void 0:h.filter(_=>!_.pinned&&_.field!=="blank"),y=(m==null?void 0:m.map(_=>({field:_.field,hide:_.hide,width:p.get(_.field)||_.width,pinned:_.pinned})))||[];d&&s(t,JSON.stringify(y))},300);return{columnDefs:r,checkboxColumn:a,saveColumnConfig:u}};function EM(e,t){return function(){return e.apply(t,arguments)}}const{toString:Gce}=Object.prototype,{getPrototypeOf:NS}=Object,{iterator:wm,toStringTag:RM}=Symbol,bm=(e=>t=>{const n=Gce.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),lo=e=>(e=e.toLowerCase(),t=>bm(t)===e),Sm=e=>t=>typeof t===e,{isArray:fc}=Array,pc=Sm("undefined");function Oh(e){return e!==null&&!pc(e)&&e.constructor!==null&&!pc(e.constructor)&&zi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _M=lo("ArrayBuffer");function Wce(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_M(e.buffer),t}const Uce=Sm("string"),zi=Sm("function"),DM=Sm("number"),Mh=e=>e!==null&&typeof e=="object",zce=e=>e===!0||e===!1,Em=e=>{if(bm(e)!=="object")return!1;const t=NS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(RM in e)&&!(wm in e)},jce=e=>{if(!Mh(e)||Oh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Kce=lo("Date"),qce=lo("File"),Yce=lo("Blob"),Zce=lo("FileList"),Xce=e=>Mh(e)&&zi(e.pipe),Jce=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||zi(e.append)&&((t=bm(e))==="formdata"||t==="object"&&zi(e.toString)&&e.toString()==="[object FormData]"))},Qce=lo("URLSearchParams"),[ede,tde,nde,ide]=["ReadableStream","Request","Response","Headers"].map(lo),sde=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Lh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,s;if(typeof e!="object"&&(e=[e]),fc(e))for(i=0,s=e.length;i<s;i++)t.call(null,e[i],i,e);else{if(Oh(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),r=o.length;let a;for(i=0;i<r;i++)a=o[i],t.call(null,e[a],a,e)}}function xM(e,t){if(Oh(e))return null;t=t.toLowerCase();const n=Object.keys(e);let i=n.length,s;for(;i-- >0;)if(s=n[i],t===s.toLowerCase())return s;return null}const Fl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,FM=e=>!pc(e)&&e!==Fl;function VS(){const{caseless:e,skipUndefined:t}=FM(this)&&this||{},n={},i=(s,o)=>{const r=e&&xM(n,o)||o;Em(n[r])&&Em(s)?n[r]=VS(n[r],s):Em(s)?n[r]=VS({},s):fc(s)?n[r]=s.slice():(!t||!pc(s))&&(n[r]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Lh(arguments[s],i);return n}const ode=(e,t,n,{allOwnKeys:i}={})=>(Lh(t,(s,o)=>{n&&zi(s)?e[o]=EM(s,n):e[o]=s},{allOwnKeys:i}),e),rde=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ade=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},lde=(e,t,n,i)=>{let s,o,r;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)r=s[o],(!i||i(r,e,t))&&!a[r]&&(t[r]=e[r],a[r]=!0);e=n!==!1&&NS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ude=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},cde=e=>{if(!e)return null;if(fc(e))return e;let t=e.length;if(!DM(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},dde=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&NS(Uint8Array)),hde=(e,t)=>{const i=(e&&e[wm]).call(e);let s;for(;(s=i.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},fde=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},pde=lo("HTMLFormElement"),gde=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,s){return i.toUpperCase()+s}),TM=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),mde=lo("RegExp"),PM=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};Lh(n,(s,o)=>{let r;(r=t(s,o,e))!==!1&&(i[o]=r||s)}),Object.defineProperties(e,i)},vde=e=>{PM(e,(t,n)=>{if(zi(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(zi(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},yde=(e,t)=>{const n={},i=s=>{s.forEach(o=>{n[o]=!0})};return fc(e)?i(e):i(String(e).split(t)),n},Cde=()=>{},wde=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function bde(e){return!!(e&&zi(e.append)&&e[RM]==="FormData"&&e[wm])}const Sde=e=>{const t=new Array(10),n=(i,s)=>{if(Mh(i)){if(t.indexOf(i)>=0)return;if(Oh(i))return i;if(!("toJSON"in i)){t[s]=i;const o=fc(i)?[]:{};return Lh(i,(r,a)=>{const l=n(r,s+1);!pc(l)&&(o[a]=l)}),t[s]=void 0,o}}return i};return n(e,0)},Ede=lo("AsyncFunction"),Rde=e=>e&&(Mh(e)||zi(e))&&zi(e.then)&&zi(e.catch),IM=((e,t)=>e?setImmediate:t?((n,i)=>(Fl.addEventListener("message",({source:s,data:o})=>{s===Fl&&o===n&&i.length&&i.shift()()},!1),s=>{i.push(s),Fl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",zi(Fl.postMessage)),_de=typeof queueMicrotask<"u"?queueMicrotask.bind(Fl):typeof V<"u"&&V.nextTick||IM,be={isArray:fc,isArrayBuffer:_M,isBuffer:Oh,isFormData:Jce,isArrayBufferView:Wce,isString:Uce,isNumber:DM,isBoolean:zce,isObject:Mh,isPlainObject:Em,isEmptyObject:jce,isReadableStream:ede,isRequest:tde,isResponse:nde,isHeaders:ide,isUndefined:pc,isDate:Kce,isFile:qce,isBlob:Yce,isRegExp:mde,isFunction:zi,isStream:Xce,isURLSearchParams:Qce,isTypedArray:dde,isFileList:Zce,forEach:Lh,merge:VS,extend:ode,trim:sde,stripBOM:rde,inherits:ade,toFlatObject:lde,kindOf:bm,kindOfTest:lo,endsWith:ude,toArray:cde,forEachEntry:hde,matchAll:fde,isHTMLForm:pde,hasOwnProperty:TM,hasOwnProp:TM,reduceDescriptors:PM,freezeMethods:vde,toObjectSet:yde,toCamelCase:gde,noop:Cde,toFiniteNumber:wde,findKey:xM,global:Fl,isContextDefined:FM,isSpecCompliantForm:bde,toJSONObject:Sde,isAsyncFn:Ede,isThenable:Rde,setImmediate:IM,asap:_de,isIterable:e=>e!=null&&zi(e[wm])};function Vt(e,t,n,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s,this.status=s.status?s.status:null)}be.inherits(Vt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:be.toJSONObject(this.config),code:this.code,status:this.status}}});const AM=Vt.prototype,kM={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{kM[e]={value:e}}),Object.defineProperties(Vt,kM),Object.defineProperty(AM,"isAxiosError",{value:!0}),Vt.from=(e,t,n,i,s,o)=>{const r=Object.create(AM);be.toFlatObject(e,r,function(c){return c!==Error.prototype},u=>u!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return Vt.call(r,a,l,n,i,s),e&&r.cause==null&&Object.defineProperty(r,"cause",{value:e,configurable:!0}),r.name=e&&e.name||"Error",o&&Object.assign(r,o),r};const Dde=null;function BS(e){return be.isPlainObject(e)||be.isArray(e)}function OM(e){return be.endsWith(e,"[]")?e.slice(0,-2):e}function MM(e,t,n){return e?e.concat(t).map(function(s,o){return s=OM(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function xde(e){return be.isArray(e)&&!e.some(BS)}const Fde=be.toFlatObject(be,{},null,function(t){return/^is[A-Z]/.test(t)});function Rm(e,t,n){if(!be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!be.isUndefined(y[m])});const i=n.metaTokens,s=n.visitor||c,o=n.dots,r=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&be.isSpecCompliantForm(t);if(!be.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(be.isDate(p))return p.toISOString();if(be.isBoolean(p))return p.toString();if(!l&&be.isBlob(p))throw new Vt("Blob is not supported. Use a Buffer instead.");return be.isArrayBuffer(p)||be.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,m,y){let w=p;if(p&&!y&&typeof p=="object"){if(be.endsWith(m,"{}"))m=i?m:m.slice(0,-2),p=JSON.stringify(p);else if(be.isArray(p)&&xde(p)||(be.isFileList(p)||be.endsWith(m,"[]"))&&(w=be.toArray(p)))return m=OM(m),w.forEach(function(_,C){!(be.isUndefined(_)||_===null)&&t.append(r===!0?MM([m],C,o):r===null?m:m+"[]",u(_))}),!1}return BS(p)?!0:(t.append(MM(y,m,o),u(p)),!1)}const d=[],h=Object.assign(Fde,{defaultVisitor:c,convertValue:u,isVisitable:BS});function f(p,m){if(!be.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),be.forEach(p,function(w,S){(!(be.isUndefined(w)||w===null)&&s.call(t,w,be.isString(S)?S.trim():S,m,h))===!0&&f(w,m?m.concat(S):[S])}),d.pop()}}if(!be.isObject(e))throw new TypeError("data must be an object");return f(e),t}function LM(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function HS(e,t){this._pairs=[],e&&Rm(e,this,t)}const NM=HS.prototype;NM.append=function(t,n){this._pairs.push([t,n])},NM.toString=function(t){const n=t?function(i){return t.call(this,i,LM)}:LM;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Tde(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function VM(e,t,n){if(!t)return e;const i=n&&n.encode||Tde;be.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=be.isURLSearchParams(t)?t.toString():new HS(t,n).toString(i),o){const r=e.indexOf("#");r!==-1&&(e=e.slice(0,r)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class BM{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){be.forEach(this.handlers,function(i){i!==null&&t(i)})}}const HM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Pde={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:HS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},$S=typeof window<"u"&&typeof document<"u",GS=typeof navigator=="object"&&navigator||void 0,Ide=$S&&(!GS||["ReactNative","NativeScript","NS"].indexOf(GS.product)<0),Ade=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",kde=$S&&window.location.href||"http://localhost",Si={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:$S,hasStandardBrowserEnv:Ide,hasStandardBrowserWebWorkerEnv:Ade,navigator:GS,origin:kde},Symbol.toStringTag,{value:"Module"})),...Pde};function Ode(e,t){return Rm(e,new Si.classes.URLSearchParams,{visitor:function(n,i,s,o){return Si.isNode&&be.isBuffer(n)?(this.append(i,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Mde(e){return be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Lde(e){const t={},n=Object.keys(e);let i;const s=n.length;let o;for(i=0;i<s;i++)o=n[i],t[o]=e[o];return t}function $M(e){function t(n,i,s,o){let r=n[o++];if(r==="__proto__")return!0;const a=Number.isFinite(+r),l=o>=n.length;return r=!r&&be.isArray(s)?s.length:r,l?(be.hasOwnProp(s,r)?s[r]=[s[r],i]:s[r]=i,!a):((!s[r]||!be.isObject(s[r]))&&(s[r]=[]),t(n,i,s[r],o)&&be.isArray(s[r])&&(s[r]=Lde(s[r])),!a)}if(be.isFormData(e)&&be.isFunction(e.entries)){const n={};return be.forEachEntry(e,(i,s)=>{t(Mde(i),s,n,0)}),n}return null}function Nde(e,t,n){if(be.isString(e))try{return(t||JSON.parse)(e),be.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const Nh={transitional:HM,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const i=n.getContentType()||"",s=i.indexOf("application/json")>-1,o=be.isObject(t);if(o&&be.isHTMLForm(t)&&(t=new FormData(t)),be.isFormData(t))return s?JSON.stringify($M(t)):t;if(be.isArrayBuffer(t)||be.isBuffer(t)||be.isStream(t)||be.isFile(t)||be.isBlob(t)||be.isReadableStream(t))return t;if(be.isArrayBufferView(t))return t.buffer;if(be.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Ode(t,this.formSerializer).toString();if((a=be.isFileList(t))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Rm(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Nde(t)):t}],transformResponse:[function(t){const n=this.transitional||Nh.transitional,i=n&&n.forcedJSONParsing,s=this.responseType==="json";if(be.isResponse(t)||be.isReadableStream(t))return t;if(t&&be.isString(t)&&(i&&!this.responseType||s)){const r=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(r)throw a.name==="SyntaxError"?Vt.from(a,Vt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Si.classes.FormData,Blob:Si.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};be.forEach(["delete","get","head","post","put","patch"],e=>{Nh.headers[e]={}});const Vde=be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Bde=e=>{const t={};let n,i,s;return e&&e.split(`
|
|
186
|
+
`,this.selectionChangedListener=i=>{this.syncCheckboxWithRow(i)},t.node.addEventListener("rowSelected",i=>{this.syncCheckboxWithRow(i)}),this.eGui.addEventListener("click",this.handleCellClick),this.eCheckbox.addEventListener("change",this.handleCheckboxChange),this.eGui.appendChild(this.eCheckbox)}syncCheckboxWithRow(t){if(t.node.data===void 0?this.eGui.classList.add("is-loading"):this.eGui.classList.remove("is-loading"),!this.isUpdating&&this.eCheckbox){const i=!!this.params.node.isSelected();this.eCheckbox.checked!==i&&(this.eCheckbox.checked=i)}}getGui(){return this.eGui}refresh(t){var s;const n=(s=t.data)==null?void 0:s.id;return this.previousDataId!==n&&(this.previousDataId=n,this.eCheckbox.checked=!!t.node.isSelected()),this.params=t,t.data!==void 0?this.eGui.classList.remove("is-loading"):this.eGui.classList.add("is-loading"),this.syncCheckboxWithRow(t),!0}destroy(){this.selectionChangedListener&&this.params.node.removeEventListener("rowSelected",this.selectionChangedListener),this.eGui.removeEventListener("click",this.handleCellClick),this.eCheckbox.removeEventListener("change",this.handleCheckboxChange)}}function hc(e){return tI(e)}const Nce=()=>[...[{headerName:"Scene name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:hc(ul)},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:hc(ul)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:hc(ul)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:hc(ul)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:hc(ul),cellRendererParams:n=>{var i,s,o;return{...n,value:(i=n==null?void 0:n.data)==null?void 0:i.lastUpdated.value,tooltip:((o=(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated)==null?void 0:o.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:hc(ul),cellRendererParams:n=>{var i,s,o;return{...n,value:(i=n==null?void 0:n.data)==null?void 0:i.completedOn.value,tooltip:((o=(s=n==null?void 0:n.data)==null?void 0:s.completedOn)==null?void 0:o.tooltip)||void 0,readOnly:!0}}}].map(n=>Zd.fromType(n))],Cm={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},Vce={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0},Bce=()=>({field:"__checkboxSelection",width:Cm.WIDTH,minWidth:Cm.WIDTH,maxWidth:Cm.WIDTH,pinned:"left",lockPosition:!0,suppressMovable:!0,suppressColumnsToolPanel:!0,editable:!1,sortable:!1,filter:!1,resizable:!1,headerClass:Cm.HEADER_CLASS,headerComponent:pg(K7),cellRenderer:Lce}),Hce={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0},$ce=(e,t,n)=>{const{getCachedValue:i,setCachedValue:s}=od({dbName:"item_table_column_configs",storeName:"column_configs"}),o=async()=>{const c=await i(t);if(c&&typeof c=="string")try{return JSON.parse(c)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},r=G([]),a=Bce(),l=async c=>{const d=await o(),h=new Map;d==null||d.forEach(x=>{x.width&&h.set(x.field,x.width)});const f=Nce(),p=Zd.fromType(Hce),y=((c==null?void 0:c.map(x=>{var L;return{headerName:x.name,field:`metric_${x.id}`,editable:((L=x==null?void 0:x.auth_permission)==null?void 0:L.permission)==2,sortable:!0,filter:!1,flex:1,context:{...x},hide:!(x.is_primary||x.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:pg(ul),headerComponentParams:N=>({headerType:x.metric_type.code=="number"||x.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${x.id}`)}}))||[]).map(x=>Zd.fromType(x)),w=[a,...f,...y,Vce,p],S=w.filter(x=>x.pinned==="left"),_=w.filter(x=>x.pinned==="right"||x.field==="blank"),C=w.filter(x=>!x.pinned&&x.field!=="blank");if(!d||d.length===0){r.value=w;return}const E=new Map(d.map(x=>[x.field,x])),R=new Map(C.map(x=>[x.field,x])),P=[];for(const x of d)if(x.field&&R.has(x.field)){const L=R.get(x.field);P.push({...L,hide:x.hide,width:x.width}),R.delete(x.field)}const I=Array.from(R.values()),k=[...P,...I],O=S.map(x=>{const L=E.get(x.field);return L!=null&&L.width?{...x,width:L.width}:x}),F=_.map(x=>{const L=E.get(x.field);return L!=null&&L.width?{...x,width:L.width}:x});r.value=[...O,...k,...F]};ut(e,c=>l(c),{immediate:!0});const u=Ds((c,d)=>{var w,S;if(["uiColumnResized","uiColumnMoved","api"].indexOf(c.source)===-1){console.log("Skipping saveColumnConfig for source:",c.source);return}const h=(w=n==null?void 0:n.value)==null?void 0:w.getColumnDefs(),f=(S=n==null?void 0:n.value)==null?void 0:S.getColumnState().reduce((_,C)=>(_[C.colId]=Number(C.width),_),{}),p=new Map;Object.entries(f||{}).forEach(([_,C])=>{p.set(_,C)});const m=h==null?void 0:h.filter(_=>!_.pinned&&_.field!=="blank"),y=(m==null?void 0:m.map(_=>({field:_.field,hide:_.hide,width:p.get(_.field)||_.width,pinned:_.pinned})))||[];d&&s(t,JSON.stringify(y))},300);return{columnDefs:r,checkboxColumn:a,saveColumnConfig:u}};function EM(e,t){return function(){return e.apply(t,arguments)}}const{toString:Gce}=Object.prototype,{getPrototypeOf:NS}=Object,{iterator:wm,toStringTag:RM}=Symbol,bm=(e=>t=>{const n=Gce.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),lo=e=>(e=e.toLowerCase(),t=>bm(t)===e),Sm=e=>t=>typeof t===e,{isArray:fc}=Array,pc=Sm("undefined");function Oh(e){return e!==null&&!pc(e)&&e.constructor!==null&&!pc(e.constructor)&&zi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _M=lo("ArrayBuffer");function Wce(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_M(e.buffer),t}const Uce=Sm("string"),zi=Sm("function"),DM=Sm("number"),Mh=e=>e!==null&&typeof e=="object",zce=e=>e===!0||e===!1,Em=e=>{if(bm(e)!=="object")return!1;const t=NS(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(RM in e)&&!(wm in e)},jce=e=>{if(!Mh(e)||Oh(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Kce=lo("Date"),qce=lo("File"),Yce=lo("Blob"),Zce=lo("FileList"),Xce=e=>Mh(e)&&zi(e.pipe),Jce=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||zi(e.append)&&((t=bm(e))==="formdata"||t==="object"&&zi(e.toString)&&e.toString()==="[object FormData]"))},Qce=lo("URLSearchParams"),[ede,tde,nde,ide]=["ReadableStream","Request","Response","Headers"].map(lo),sde=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Lh(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,s;if(typeof e!="object"&&(e=[e]),fc(e))for(i=0,s=e.length;i<s;i++)t.call(null,e[i],i,e);else{if(Oh(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),r=o.length;let a;for(i=0;i<r;i++)a=o[i],t.call(null,e[a],a,e)}}function xM(e,t){if(Oh(e))return null;t=t.toLowerCase();const n=Object.keys(e);let i=n.length,s;for(;i-- >0;)if(s=n[i],t===s.toLowerCase())return s;return null}const Fl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,FM=e=>!pc(e)&&e!==Fl;function VS(){const{caseless:e,skipUndefined:t}=FM(this)&&this||{},n={},i=(s,o)=>{const r=e&&xM(n,o)||o;Em(n[r])&&Em(s)?n[r]=VS(n[r],s):Em(s)?n[r]=VS({},s):fc(s)?n[r]=s.slice():(!t||!pc(s))&&(n[r]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Lh(arguments[s],i);return n}const ode=(e,t,n,{allOwnKeys:i}={})=>(Lh(t,(s,o)=>{n&&zi(s)?e[o]=EM(s,n):e[o]=s},{allOwnKeys:i}),e),rde=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ade=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},lde=(e,t,n,i)=>{let s,o,r;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)r=s[o],(!i||i(r,e,t))&&!a[r]&&(t[r]=e[r],a[r]=!0);e=n!==!1&&NS(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},ude=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},cde=e=>{if(!e)return null;if(fc(e))return e;let t=e.length;if(!DM(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},dde=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&NS(Uint8Array)),hde=(e,t)=>{const i=(e&&e[wm]).call(e);let s;for(;(s=i.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},fde=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},pde=lo("HTMLFormElement"),gde=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,s){return i.toUpperCase()+s}),TM=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),mde=lo("RegExp"),PM=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};Lh(n,(s,o)=>{let r;(r=t(s,o,e))!==!1&&(i[o]=r||s)}),Object.defineProperties(e,i)},vde=e=>{PM(e,(t,n)=>{if(zi(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const i=e[n];if(zi(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},yde=(e,t)=>{const n={},i=s=>{s.forEach(o=>{n[o]=!0})};return fc(e)?i(e):i(String(e).split(t)),n},Cde=()=>{},wde=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function bde(e){return!!(e&&zi(e.append)&&e[RM]==="FormData"&&e[wm])}const Sde=e=>{const t=new Array(10),n=(i,s)=>{if(Mh(i)){if(t.indexOf(i)>=0)return;if(Oh(i))return i;if(!("toJSON"in i)){t[s]=i;const o=fc(i)?[]:{};return Lh(i,(r,a)=>{const l=n(r,s+1);!pc(l)&&(o[a]=l)}),t[s]=void 0,o}}return i};return n(e,0)},Ede=lo("AsyncFunction"),Rde=e=>e&&(Mh(e)||zi(e))&&zi(e.then)&&zi(e.catch),IM=((e,t)=>e?setImmediate:t?((n,i)=>(Fl.addEventListener("message",({source:s,data:o})=>{s===Fl&&o===n&&i.length&&i.shift()()},!1),s=>{i.push(s),Fl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",zi(Fl.postMessage)),_de=typeof queueMicrotask<"u"?queueMicrotask.bind(Fl):typeof V<"u"&&V.nextTick||IM,be={isArray:fc,isArrayBuffer:_M,isBuffer:Oh,isFormData:Jce,isArrayBufferView:Wce,isString:Uce,isNumber:DM,isBoolean:zce,isObject:Mh,isPlainObject:Em,isEmptyObject:jce,isReadableStream:ede,isRequest:tde,isResponse:nde,isHeaders:ide,isUndefined:pc,isDate:Kce,isFile:qce,isBlob:Yce,isRegExp:mde,isFunction:zi,isStream:Xce,isURLSearchParams:Qce,isTypedArray:dde,isFileList:Zce,forEach:Lh,merge:VS,extend:ode,trim:sde,stripBOM:rde,inherits:ade,toFlatObject:lde,kindOf:bm,kindOfTest:lo,endsWith:ude,toArray:cde,forEachEntry:hde,matchAll:fde,isHTMLForm:pde,hasOwnProperty:TM,hasOwnProp:TM,reduceDescriptors:PM,freezeMethods:vde,toObjectSet:yde,toCamelCase:gde,noop:Cde,toFiniteNumber:wde,findKey:xM,global:Fl,isContextDefined:FM,isSpecCompliantForm:bde,toJSONObject:Sde,isAsyncFn:Ede,isThenable:Rde,setImmediate:IM,asap:_de,isIterable:e=>e!=null&&zi(e[wm])};function Vt(e,t,n,i,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),s&&(this.response=s,this.status=s.status?s.status:null)}be.inherits(Vt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:be.toJSONObject(this.config),code:this.code,status:this.status}}});const AM=Vt.prototype,kM={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{kM[e]={value:e}}),Object.defineProperties(Vt,kM),Object.defineProperty(AM,"isAxiosError",{value:!0}),Vt.from=(e,t,n,i,s,o)=>{const r=Object.create(AM);be.toFlatObject(e,r,function(c){return c!==Error.prototype},u=>u!=="isAxiosError");const a=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return Vt.call(r,a,l,n,i,s),e&&r.cause==null&&Object.defineProperty(r,"cause",{value:e,configurable:!0}),r.name=e&&e.name||"Error",o&&Object.assign(r,o),r};const Dde=null;function BS(e){return be.isPlainObject(e)||be.isArray(e)}function OM(e){return be.endsWith(e,"[]")?e.slice(0,-2):e}function MM(e,t,n){return e?e.concat(t).map(function(s,o){return s=OM(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function xde(e){return be.isArray(e)&&!e.some(BS)}const Fde=be.toFlatObject(be,{},null,function(t){return/^is[A-Z]/.test(t)});function Rm(e,t,n){if(!be.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=be.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!be.isUndefined(y[m])});const i=n.metaTokens,s=n.visitor||c,o=n.dots,r=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&be.isSpecCompliantForm(t);if(!be.isFunction(s))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(be.isDate(p))return p.toISOString();if(be.isBoolean(p))return p.toString();if(!l&&be.isBlob(p))throw new Vt("Blob is not supported. Use a Buffer instead.");return be.isArrayBuffer(p)||be.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function c(p,m,y){let w=p;if(p&&!y&&typeof p=="object"){if(be.endsWith(m,"{}"))m=i?m:m.slice(0,-2),p=JSON.stringify(p);else if(be.isArray(p)&&xde(p)||(be.isFileList(p)||be.endsWith(m,"[]"))&&(w=be.toArray(p)))return m=OM(m),w.forEach(function(_,C){!(be.isUndefined(_)||_===null)&&t.append(r===!0?MM([m],C,o):r===null?m:m+"[]",u(_))}),!1}return BS(p)?!0:(t.append(MM(y,m,o),u(p)),!1)}const d=[],h=Object.assign(Fde,{defaultVisitor:c,convertValue:u,isVisitable:BS});function f(p,m){if(!be.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),be.forEach(p,function(w,S){(!(be.isUndefined(w)||w===null)&&s.call(t,w,be.isString(S)?S.trim():S,m,h))===!0&&f(w,m?m.concat(S):[S])}),d.pop()}}if(!be.isObject(e))throw new TypeError("data must be an object");return f(e),t}function LM(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(i){return t[i]})}function HS(e,t){this._pairs=[],e&&Rm(e,this,t)}const NM=HS.prototype;NM.append=function(t,n){this._pairs.push([t,n])},NM.toString=function(t){const n=t?function(i){return t.call(this,i,LM)}:LM;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Tde(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function VM(e,t,n){if(!t)return e;const i=n&&n.encode||Tde;be.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=be.isURLSearchParams(t)?t.toString():new HS(t,n).toString(i),o){const r=e.indexOf("#");r!==-1&&(e=e.slice(0,r)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class BM{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){be.forEach(this.handlers,function(i){i!==null&&t(i)})}}const HM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Pde={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:HS,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},$S=typeof window<"u"&&typeof document<"u",GS=typeof navigator=="object"&&navigator||void 0,Ide=$S&&(!GS||["ReactNative","NativeScript","NS"].indexOf(GS.product)<0),Ade=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",kde=$S&&window.location.href||"http://localhost",Si={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:$S,hasStandardBrowserEnv:Ide,hasStandardBrowserWebWorkerEnv:Ade,navigator:GS,origin:kde},Symbol.toStringTag,{value:"Module"})),...Pde};function Ode(e,t){return Rm(e,new Si.classes.URLSearchParams,{visitor:function(n,i,s,o){return Si.isNode&&be.isBuffer(n)?(this.append(i,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Mde(e){return be.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Lde(e){const t={},n=Object.keys(e);let i;const s=n.length;let o;for(i=0;i<s;i++)o=n[i],t[o]=e[o];return t}function $M(e){function t(n,i,s,o){let r=n[o++];if(r==="__proto__")return!0;const a=Number.isFinite(+r),l=o>=n.length;return r=!r&&be.isArray(s)?s.length:r,l?(be.hasOwnProp(s,r)?s[r]=[s[r],i]:s[r]=i,!a):((!s[r]||!be.isObject(s[r]))&&(s[r]=[]),t(n,i,s[r],o)&&be.isArray(s[r])&&(s[r]=Lde(s[r])),!a)}if(be.isFormData(e)&&be.isFunction(e.entries)){const n={};return be.forEachEntry(e,(i,s)=>{t(Mde(i),s,n,0)}),n}return null}function Nde(e,t,n){if(be.isString(e))try{return(t||JSON.parse)(e),be.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const Nh={transitional:HM,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const i=n.getContentType()||"",s=i.indexOf("application/json")>-1,o=be.isObject(t);if(o&&be.isHTMLForm(t)&&(t=new FormData(t)),be.isFormData(t))return s?JSON.stringify($M(t)):t;if(be.isArrayBuffer(t)||be.isBuffer(t)||be.isStream(t)||be.isFile(t)||be.isBlob(t)||be.isReadableStream(t))return t;if(be.isArrayBufferView(t))return t.buffer;if(be.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(i.indexOf("application/x-www-form-urlencoded")>-1)return Ode(t,this.formSerializer).toString();if((a=be.isFileList(t))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Rm(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),Nde(t)):t}],transformResponse:[function(t){const n=this.transitional||Nh.transitional,i=n&&n.forcedJSONParsing,s=this.responseType==="json";if(be.isResponse(t)||be.isReadableStream(t))return t;if(t&&be.isString(t)&&(i&&!this.responseType||s)){const r=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(r)throw a.name==="SyntaxError"?Vt.from(a,Vt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Si.classes.FormData,Blob:Si.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};be.forEach(["delete","get","head","post","put","patch"],e=>{Nh.headers[e]={}});const Vde=be.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Bde=e=>{const t={};let n,i,s;return e&&e.split(`
|
|
187
187
|
`).forEach(function(r){s=r.indexOf(":"),n=r.substring(0,s).trim().toLowerCase(),i=r.substring(s+1).trim(),!(!n||t[n]&&Vde[n])&&(n==="set-cookie"?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t},GM=Symbol("internals");function Vh(e){return e&&String(e).trim().toLowerCase()}function _m(e){return e===!1||e==null?e:be.isArray(e)?e.map(_m):String(e)}function Hde(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const $de=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function WS(e,t,n,i,s){if(be.isFunction(i))return i.call(this,t,n);if(s&&(t=n),!!be.isString(t)){if(be.isString(i))return t.indexOf(i)!==-1;if(be.isRegExp(i))return i.test(t)}}function Gde(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function Wde(e,t){const n=be.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(s,o,r){return this[i].call(this,t,s,o,r)},configurable:!0})})}let ji=class{constructor(t){t&&this.set(t)}set(t,n,i){const s=this;function o(a,l,u){const c=Vh(l);if(!c)throw new Error("header name must be a non-empty string");const d=be.findKey(s,c);(!d||s[d]===void 0||u===!0||u===void 0&&s[d]!==!1)&&(s[d||l]=_m(a))}const r=(a,l)=>be.forEach(a,(u,c)=>o(u,c,l));if(be.isPlainObject(t)||t instanceof this.constructor)r(t,n);else if(be.isString(t)&&(t=t.trim())&&!$de(t))r(Bde(t),n);else if(be.isObject(t)&&be.isIterable(t)){let a={},l,u;for(const c of t){if(!be.isArray(c))throw TypeError("Object iterator must return a key-value pair");a[u=c[0]]=(l=a[u])?be.isArray(l)?[...l,c[1]]:[l,c[1]]:c[1]}r(a,n)}else t!=null&&o(n,t,i);return this}get(t,n){if(t=Vh(t),t){const i=be.findKey(this,t);if(i){const s=this[i];if(!n)return s;if(n===!0)return Hde(s);if(be.isFunction(n))return n.call(this,s,i);if(be.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Vh(t),t){const i=be.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||WS(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let s=!1;function o(r){if(r=Vh(r),r){const a=be.findKey(i,r);a&&(!n||WS(i,i[a],a,n))&&(delete i[a],s=!0)}}return be.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let i=n.length,s=!1;for(;i--;){const o=n[i];(!t||WS(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,i={};return be.forEach(this,(s,o)=>{const r=be.findKey(i,o);if(r){n[r]=_m(s),delete n[o];return}const a=t?Gde(o):String(o).trim();a!==o&&delete n[o],n[a]=_m(s),i[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return be.forEach(this,(i,s)=>{i!=null&&i!==!1&&(n[s]=t&&be.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
188
188
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const i=new this(t);return n.forEach(s=>i.set(s)),i}static accessor(t){const i=(this[GM]=this[GM]={accessors:{}}).accessors,s=this.prototype;function o(r){const a=Vh(r);i[a]||(Wde(s,r),i[a]=!0)}return be.isArray(t)?t.forEach(o):o(t),this}};ji.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),be.reduceDescriptors(ji.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}}),be.freezeMethods(ji);function US(e,t){const n=this||Nh,i=t||n,s=ji.from(i.headers);let o=i.data;return be.forEach(e,function(a){o=a.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function WM(e){return!!(e&&e.__CANCEL__)}function gc(e,t,n){Vt.call(this,e??"canceled",Vt.ERR_CANCELED,t,n),this.name="CanceledError"}be.inherits(gc,Vt,{__CANCEL__:!0});function UM(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new Vt("Request failed with status code "+n.status,[Vt.ERR_BAD_REQUEST,Vt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Ude(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function zde(e,t){e=e||10;const n=new Array(e),i=new Array(e);let s=0,o=0,r;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=i[o];r||(r=u),n[s]=l,i[s]=u;let d=o,h=0;for(;d!==s;)h+=n[d++],d=d%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),u-r<t)return;const f=c&&u-c;return f?Math.round(h*1e3/f):void 0}}function jde(e,t){let n=0,i=1e3/t,s,o;const r=(u,c=Date.now())=>{n=c,s=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const c=Date.now(),d=c-n;d>=i?r(u,c):(s=u,o||(o=setTimeout(()=>{o=null,r(s)},i-d)))},()=>s&&r(s)]}const Dm=(e,t,n=3)=>{let i=0;const s=zde(50,250);return jde(o=>{const r=o.loaded,a=o.lengthComputable?o.total:void 0,l=r-i,u=s(l),c=r<=a;i=r;const d={loaded:r,total:a,progress:a?r/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&c?(a-r)/u:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},zM=(e,t)=>{const n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},jM=e=>(...t)=>be.asap(()=>e(...t)),Kde=Si.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Si.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Si.origin),Si.navigator&&/(msie|trident)/i.test(Si.navigator.userAgent)):()=>!0,qde=Si.hasStandardBrowserEnv?{write(e,t,n,i,s,o,r){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];be.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),be.isString(i)&&a.push(`path=${i}`),be.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),be.isString(r)&&a.push(`SameSite=${r}`),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 Yde(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Zde(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function KM(e,t,n){let i=!Yde(t);return e&&(i||n==!1)?Zde(e,t):t}const qM=e=>e instanceof ji?{...e}:e;function Tl(e,t){t=t||{};const n={};function i(u,c,d,h){return be.isPlainObject(u)&&be.isPlainObject(c)?be.merge.call({caseless:h},u,c):be.isPlainObject(c)?be.merge({},c):be.isArray(c)?c.slice():c}function s(u,c,d,h){if(be.isUndefined(c)){if(!be.isUndefined(u))return i(void 0,u,d,h)}else return i(u,c,d,h)}function o(u,c){if(!be.isUndefined(c))return i(void 0,c)}function r(u,c){if(be.isUndefined(c)){if(!be.isUndefined(u))return i(void 0,u)}else return i(void 0,c)}function a(u,c,d){if(d in t)return i(u,c);if(d in e)return i(void 0,u)}const l={url:o,method:o,data:o,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:a,headers:(u,c,d)=>s(qM(u),qM(c),d,!0)};return be.forEach(Object.keys({...e,...t}),function(c){const d=l[c]||s,h=d(e[c],t[c],c);be.isUndefined(h)&&d!==a||(n[c]=h)}),n}const YM=e=>{const t=Tl({},e);let{data:n,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:r,auth:a}=t;if(t.headers=r=ji.from(r),t.url=VM(KM(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&r.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),be.isFormData(n)){if(Si.hasStandardBrowserEnv||Si.hasStandardBrowserWebWorkerEnv)r.setContentType(void 0);else if(be.isFunction(n.getHeaders)){const l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([c,d])=>{u.includes(c.toLowerCase())&&r.set(c,d)})}}if(Si.hasStandardBrowserEnv&&(i&&be.isFunction(i)&&(i=i(t)),i||i!==!1&&Kde(t.url))){const l=s&&o&&qde.read(o);l&&r.set(s,l)}return t},Xde=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,i){const s=YM(e);let o=s.data;const r=ji.from(s.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:u}=s,c,d,h,f,p;function m(){f&&f(),p&&p(),s.cancelToken&&s.cancelToken.unsubscribe(c),s.signal&&s.signal.removeEventListener("abort",c)}let y=new XMLHttpRequest;y.open(s.method.toUpperCase(),s.url,!0),y.timeout=s.timeout;function w(){if(!y)return;const _=ji.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),E={data:!a||a==="text"||a==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:_,config:e,request:y};UM(function(P){n(P),m()},function(P){i(P),m()},E),y=null}"onloadend"in y?y.onloadend=w:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(w)},y.onabort=function(){y&&(i(new Vt("Request aborted",Vt.ECONNABORTED,e,y)),y=null)},y.onerror=function(C){const E=C&&C.message?C.message:"Network Error",R=new Vt(E,Vt.ERR_NETWORK,e,y);R.event=C||null,i(R),y=null},y.ontimeout=function(){let C=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const E=s.transitional||HM;s.timeoutErrorMessage&&(C=s.timeoutErrorMessage),i(new Vt(C,E.clarifyTimeoutError?Vt.ETIMEDOUT:Vt.ECONNABORTED,e,y)),y=null},o===void 0&&r.setContentType(null),"setRequestHeader"in y&&be.forEach(r.toJSON(),function(C,E){y.setRequestHeader(E,C)}),be.isUndefined(s.withCredentials)||(y.withCredentials=!!s.withCredentials),a&&a!=="json"&&(y.responseType=s.responseType),u&&([h,p]=Dm(u,!0),y.addEventListener("progress",h)),l&&y.upload&&([d,f]=Dm(l),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",f)),(s.cancelToken||s.signal)&&(c=_=>{y&&(i(!_||_.type?new gc(null,e,y):_),y.abort(),y=null)},s.cancelToken&&s.cancelToken.subscribe(c),s.signal&&(s.signal.aborted?c():s.signal.addEventListener("abort",c)));const S=Ude(s.url);if(S&&Si.protocols.indexOf(S)===-1){i(new Vt("Unsupported protocol "+S+":",Vt.ERR_BAD_REQUEST,e));return}y.send(o||null)})},Jde=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let i=new AbortController,s;const o=function(u){if(!s){s=!0,a();const c=u instanceof Error?u:this.reason;i.abort(c instanceof Vt?c:new gc(c instanceof Error?c.message:c))}};let r=t&&setTimeout(()=>{r=null,o(new Vt(`timeout ${t} of ms exceeded`,Vt.ETIMEDOUT))},t);const a=()=>{e&&(r&&clearTimeout(r),r=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}=i;return l.unsubscribe=()=>be.asap(a),l}},Qde=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let i=0,s;for(;i<n;)s=i+t,yield e.slice(i,s),i=s},ehe=async function*(e,t){for await(const n of the(e))yield*Qde(n,t)},the=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:i}=await t.read();if(n)break;yield i}}finally{await t.cancel()}},ZM=(e,t,n,i)=>{const s=ehe(e,t);let o=0,r,a=l=>{r||(r=!0,i&&i(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await s.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),s.return()}},{highWaterMark:2})},XM=64*1024,{isFunction:xm}=be,nhe=(({Request:e,Response:t})=>({Request:e,Response:t}))(be.global),{ReadableStream:JM,TextEncoder:QM}=be.global,eL=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ihe=e=>{e=be.merge.call({skipUndefined:!0},nhe,e);const{fetch:t,Request:n,Response:i}=e,s=t?xm(t):typeof fetch=="function",o=xm(n),r=xm(i);if(!s)return!1;const a=s&&xm(JM),l=s&&(typeof QM=="function"?(p=>m=>p.encode(m))(new QM):async p=>new Uint8Array(await new n(p).arrayBuffer())),u=o&&a&&eL(()=>{let p=!1;const m=new n(Si.origin,{body:new JM,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!m}),c=r&&a&&eL(()=>be.isReadableStream(new i("").body)),d={stream:c&&(p=>p.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!d[p]&&(d[p]=(m,y)=>{let w=m&&m[p];if(w)return w.call(m);throw new Vt(`Response type '${p}' is not supported`,Vt.ERR_NOT_SUPPORT,y)})});const h=async p=>{if(p==null)return 0;if(be.isBlob(p))return p.size;if(be.isSpecCompliantForm(p))return(await new n(Si.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(be.isArrayBufferView(p)||be.isArrayBuffer(p))return p.byteLength;if(be.isURLSearchParams(p)&&(p=p+""),be.isString(p))return(await l(p)).byteLength},f=async(p,m)=>{const y=be.toFiniteNumber(p.getContentLength());return y??h(m)};return async p=>{let{url:m,method:y,data:w,signal:S,cancelToken:_,timeout:C,onDownloadProgress:E,onUploadProgress:R,responseType:P,headers:I,withCredentials:k="same-origin",fetchOptions:O}=YM(p),F=t||fetch;P=P?(P+"").toLowerCase():"text";let x=Jde([S,_&&_.toAbortSignal()],C),L=null;const N=x&&x.unsubscribe&&(()=>{x.unsubscribe()});let te;try{if(R&&u&&y!=="get"&&y!=="head"&&(te=await f(I,w))!==0){let ve=new n(m,{method:"POST",body:w,duplex:"half"}),ne;if(be.isFormData(w)&&(ne=ve.headers.get("content-type"))&&I.setContentType(ne),ve.body){const[Q,we]=zM(te,Dm(jM(R)));w=ZM(ve.body,XM,Q,we)}}be.isString(k)||(k=k?"include":"omit");const ee=o&&"credentials"in n.prototype,Z={...O,signal:x,method:y.toUpperCase(),headers:I.normalize().toJSON(),body:w,duplex:"half",credentials:ee?k:void 0};L=o&&new n(m,Z);let B=await(o?F(L,O):F(m,Z));const j=c&&(P==="stream"||P==="response");if(c&&(E||j&&N)){const ve={};["status","statusText","headers"].forEach(X=>{ve[X]=B[X]});const ne=be.toFiniteNumber(B.headers.get("content-length")),[Q,we]=E&&zM(ne,Dm(jM(E),!0))||[];B=new i(ZM(B.body,XM,Q,()=>{we&&we(),N&&N()}),ve)}P=P||"text";let K=await d[be.findKey(d,P)||"text"](B,p);return!j&&N&&N(),await new Promise((ve,ne)=>{UM(ve,ne,{data:K,headers:ji.from(B.headers),status:B.status,statusText:B.statusText,config:p,request:L})})}catch(ee){throw N&&N(),ee&&ee.name==="TypeError"&&/Load failed|fetch/i.test(ee.message)?Object.assign(new Vt("Network Error",Vt.ERR_NETWORK,p,L),{cause:ee.cause||ee}):Vt.from(ee,ee&&ee.code,p,L)}}},she=new Map,tL=e=>{let t=e&&e.env||{};const{fetch:n,Request:i,Response:s}=t,o=[i,s,n];let r=o.length,a=r,l,u,c=she;for(;a--;)l=o[a],u=c.get(l),u===void 0&&c.set(l,u=a?new Map:ihe(t)),c=u;return u};tL();const zS={http:Dde,xhr:Xde,fetch:{get:tL}};be.forEach(zS,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const nL=e=>`- ${e}`,ohe=e=>be.isFunction(e)||e===null||e===!1;function rhe(e,t){e=be.isArray(e)?e:[e];const{length:n}=e;let i,s;const o={};for(let r=0;r<n;r++){i=e[r];let a;if(s=i,!ohe(i)&&(s=zS[(a=String(i)).toLowerCase()],s===void 0))throw new Vt(`Unknown adapter '${a}'`);if(s&&(be.isFunction(s)||(s=s.get(t))))break;o[a||"#"+r]=s}if(!s){const r=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?r.length>1?`since :
|
|
189
189
|
`+r.map(nL).join(`
|
|
@@ -192,4 +192,4 @@ If you are trying to annotate ${i} with application data, use the '${i}.context'
|
|
|
192
192
|
<rect width="32" height="32" rx="4" fill="#CCF3EB"/>
|
|
193
193
|
<path d="M11 9C9.89688 9 9 9.89688 9 11V21C9 22.1031 9.89688 23 11 23H21C22.1031 23 23 22.1031 23 21V11C23 9.89688 22.1031 9 21 9H11ZM19.5312 14.5312L15.5312 18.5312C15.2375 18.825 14.7625 18.825 14.4719 18.5312L12.4719 16.5312C12.1781 16.2375 12.1781 15.7625 12.4719 15.4719C12.7656 15.1813 13.2406 15.1781 13.5312 15.4719L15 16.9406L18.4688 13.4688C18.7625 13.175 19.2375 13.175 19.5281 13.4688C19.8187 13.7625 19.8219 14.2375 19.5281 14.5281L19.5312 14.5312Z" fill="#00A18D"/>
|
|
194
194
|
</svg>
|
|
195
|
-
`,Dhe=St(ct({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Yi,i=JC(),{setUserPermissions:s,setEntityPermissions:o}=i,{entityPermissions:r}=is(i),{addNotification:a}=Vd(),l=G(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},c=z(()=>{var $e;const Me=(($e=r.value)==null?void 0:$e.has_create_item_permission)===1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!Me},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Me,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Me,id:"overwrite_scenes_option"}]}),d=e;Zd.initialize({wrapVueCellRenderer:pg,wrapVueCellEditor:tI});const h=G(null),f=G([]),p=iw(),{rowCount:m}=is(p),y=G(!1),w=G(""),S=hP(),{metricList:_}=is(S),C=G(""),E=G(!1),R=G(new Set),P=G(new Map),{apiServices:I}=Hi(!1,d),{columnDefs:k,checkboxColumn:O,saveColumnConfig:F}=$ce(_,d.entityId,h),{updateRowData:x,setMetricValues:L}=whe(h),N=z(()=>({isSearching:w.value.length>0,isFiltering:Re.value.length>0})),te=z(Dd),ee=z(()=>k.value.filter(Me=>{var $e;return(($e=Me.field)==null?void 0:$e.startsWith("metric_"))&&!Me.hide}).map(Me=>{var $e;return(($e=Me.field)==null?void 0:$e.replace("metric_",""))||""}));Ma("timezone",te);const Z=z(()=>({autoFetch:!1,workspaceId:d.workspaceId,entityId:d.entityId,metricIds:ee.value,updateItemData:x})),{fetchItems:B,getMetricList:j,cusorMap:K,getMetricValues:ve}=Che(Z),ne=z(()=>{if(!h.value)return!1;const Me=h.value.getSelectedRows().length;return Me>0&&Me>=m.value.total}),Q=z(()=>{var Me;return((Me=l.value)==null?void 0:Me.name)||"Items"}),we=(Me,$e)=>{var Mt,cn,hs;m.value.total=Me.meta.total??0,(Mt=Me.meta.next)!=null&&Mt.cursor&&(K[$e+1]=Me.meta.next.cursor),C.value=Me.meta["X-Tsr-signature"]||"",Me.meta.total===0?(cn=h.value)==null||cn.showNoRowsOverlay():(hs=h.value)==null||hs.hideOverlay()},X=KP(),{sortingAPIConfiguration:ge,isSortingRunning:Le}=is(X),ot=G({}),Re=G([]),pt=async({page:Me,pageSize:$e,filterText:Mt})=>{var co;(co=h.value)==null||co.hideOverlay();const cn=K[Me],hs=!cn&&Me>1?(Me-1)*$e:void 0,fs=ge.value;fs.length>0&&(Le.value=!0);try{const ga={cursor:cn,size:$e,searchQuery:Mt,offset:hs,sort_by:fs,...ot.value},dn=await B(ga);if(!dn)return{rows:[],total:0};const YS=(mc=>{const Il=mc.data.map(Rr=>X1(Rr,te.value));return Il.forEach(Rr=>{R.value.add(String(Rr.id)),P.value.set(String(Rr.id),{})}),Il})(dn);return we(dn,Me),{rows:YS,total:m.value.total}}catch(ga){return console.error("Failed to fetch items:",ga),{rows:[],total:0}}finally{Le.value=!1}},{isLoading:He,toggleSidebar:et,onGridReady:M,handleUnSelect:Y,onSearch:me,firstLoad:Pe}=She({selectRowData:G([]),isSidebarOpen:y,quickFilterText:w,gridApi:h,perPage:u.ROWS_PER_PAGE,fetcher:pt}),xe=G([]),Fe=()=>{var Me;xe.value=((Me=h.value)==null?void 0:Me.getSelectedRows())||[]},Be=z(()=>({blockLoadDebounceMillis:1e3,columnDefs:k.value,rowModelType:"infinite",cacheBlockSize:u.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,headerCheckbox:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:u.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:u.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ie,noRowsOverlayComponent:pg(H9),noRowsOverlayComponentParams:()=>N.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Me=>Me.data.id,getRowClass:Me=>{if(!Me.data)return["row-empty"];const $e=["row-highlight"];return Me.data.id||$e.push("row-inactive"),Me.data.isDeleted&&$e.push("row-deleted"),Me.data.isArchived&&$e.push("row-archived"),$e},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:d.workspaceId,entityId:d.entityId,apiServices:I.value,sorting:Le.value},suppressKeyboardEvent:Me=>{const $e=Me.event.key;return $e==="ArrowUp"||$e==="ArrowDown"||$e==="ArrowLeft"||$e==="ArrowRight"||$e==="Tab"||$e==="Enter"},navigateToNextCell:()=>null,suppressHeaderFocus:!0}));function Ie(){if(!h.value)return;const Me=h.value.getCacheBlockState();if(!Me)return;const $e=Object.values(Me).reduce((Mt,cn)=>(cn==null?void 0:cn.pageStatus)==="loaded"?Mt+(cn.endRow-cn.startRow):Mt,0);m.value.loaded=Math.min($e,m.value.total)}ut(()=>ge,()=>{h.value&&(C.value="",R.value.clear(),h.value.deselectAll(),Object.keys(K).forEach(Me=>delete K[Number(Me)]),h.value.purgeInfiniteCache(),h.value.ensureIndexVisible(0),h.value.refreshCells({force:!0}))},{deep:!0});const ke=G(),Oe=G(),gt=()=>{var Me;(Me=Oe.value)==null||Me.open()},ze=()=>{var Me;(Me=ke.value)==null||Me.open()},lt=async()=>{Pe.value=!0,h.value&&(C.value="",R.value.clear(),Object.keys(K).forEach(Me=>delete K[Number(Me)]),await h.value.deselectAll(),await h.value.ensureIndexVisible(0,"top"),await h.value.purgeInfiniteCache(),await h.value.refreshInfiniteCache())},wt=z(()=>sessionStorage.getItem("ITEM_TABLE_APP_VERSION")||""),kt=G();function Bt(Me){var $e;Me==="new_scene"?($e=kt.value)==null||$e.show():Me==="import_scenes"?ze():Me==="overwrite_scenes"&>()}const Ut=Me=>{f.value=Me.api.getSelectedRows().map($e=>$e.id)},Pn=Me=>{const $e=M(Me);return $e&&($e.addEventListener("modelUpdated",Ie),$e.addEventListener("bodyScroll",()=>$e.stopEditing()),$e.addEventListener("selectionChanged",Fe),$e.addEventListener("columnMoved",Mt=>F(Mt,!0)),$e.addEventListener("columnResized",Mt=>F(Mt,!0)),$e.addEventListener("firstDataRendered",()=>{Pe.value=!1})),$e},vn=(Me,$e)=>{if(!h.value)return;const Mt=h.value.getRowNode(Me);Mt?(h.value.ensureIndexVisible(Number(Mt.rowIndex),"middle"),h.value.flashCells({rowNodes:[Mt],flashDuration:3e3,fadeDuration:1e3})):h.value.ensureIndexVisible(m.value.total-1,"bottom")},Jn=async Me=>{var Mt;let $e;if(!(!I.value||!Me.trim())){He.value=!0;try{$e=await I.value.createNewScene({workspaceId:d.workspaceId,entityId:d.entityId,name:Me}),m.value.total<50&&await lt()}catch(cn){console.error("Error creating new scene:",cn)}finally{He.value=!1,$e!=null&&$e.id&&a({id:String($e==null?void 0:$e.id),message:`${Me} created successfully`,actions:[{label:"View",variant:"secondary",action:()=>{vn(String($e==null?void 0:$e.id))}},{label:"Scene Hub",variant:"primary",action:()=>{const cn=Ss({type:"scene_hub",config:{ws_code:d.workspaceId,baseDomain:sessionStorage.getItem("BASE_URL")||"",scene_id:String($e==null?void 0:$e.id)}}).url;window.open(cn,"_blank")},btnIcon:"CustomSceneHub"}],icon:_he,type:"interactive"}),(Mt=kt.value)==null||Mt.hide()}}},ii=Me=>Me.metric_type.code==="number"?"number":"default",_e=async()=>{if(d.entityId)try{const Me=await j(d.entityId);_.value=Me.data.map($e=>({...$e,sortType:ii($e)}))}catch(Me){console.error("Failed to initialize metric list:",Me),_.value=[]}},Te=async()=>{if(I.value)try{const Me=await I.value.getUserPermission(d.workspaceId);s(Me)}catch(Me){console.error("Failed to fetch user permissions:",Me)}},ht=async()=>{if(I.value)try{const Me=await I.value.getEntityDetail(d.workspaceId,d.entityId);o(Me.permission),l.value=Me}catch(Me){console.error("Failed to fetch entity details:",Me)}},_t=Fw(),{setUser:Ot}=_t,We=async()=>{if(I.value)try{const Me=await I.value.getMe();return Ot(Me),Me}catch(Me){console.error("Failed to fetch user details:",Me)}},si=async()=>{var Me;if(I.value)try{const $e=await I.value.getWorkspaces(d.workspaceId),Mt=(Me=$e.data[0])==null?void 0:Me.ws_user_role_id;return Mt&&_t.setUserRoleId(Mt),$e}catch($e){console.error("Failed to fetch workspace details:",$e)}};ut(()=>[d.entityId,d.workspaceId],async([Me,$e])=>{!Me||!$e||(We(),si(),_e(),Te(),ht())},{immediate:!0,deep:!0}),ut(ee,(Me,$e)=>{const Mt=Me.filter(cn=>!($e!=null&&$e.includes(cn)));Mt.length>0&&ve(Array.from(R.value),Mt).then(cn=>{L(cn,R.value,Mt)})},{immediate:!0,deep:!0}),ut(C,(Me,$e)=>{E.value=!!($e&&Me&&$e!==Me)}),t({refreshTable:lt});const uo=Me=>{ot.value=Me,lt()},pa=Me=>{Re.value=Me,lt()};return(Me,$e)=>($(),Ue(U(V7),{"is-sidebar-open":y.value,onCloseSidebar:U(et),onSidebarClear:U(et),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U(et)},{"header-left":pe(()=>[fe("h1",{class:W(Me.$style.tableTitle)},"Scenes",2),fe("div",{class:W(Me.$style["beta-tag"])},"Beta",2),ae(U(rw),{variant:["primary"],options:c.value,onSelect:Bt,onHandleClick:$e[1]||($e[1]=Mt=>Bt("new_scene")),id:"create_scene_dropdown"},{prefix:pe(()=>[ae(U(mt),{id:"create_new_scene",variant:["primary"],onClick:$e[0]||($e[0]=Mt=>Bt("new_scene")),label:"New"})]),_:1},8,["options"]),fe("span",null,Ct(wt.value),1)]),"header-actions":pe(()=>[ae(U(fK),{"onUpdate:assignees":pa,onApplyFilter:uo,loading:U(Pe)},null,8,["loading"]),Ye(ae(U(tw),{modelValue:w.value,"onUpdate:modelValue":$e[2]||($e[2]=Mt=>w.value=Mt),onSearch:U(me),class:W(Me.$style.itemSearchBox),onClear:$e[3]||($e[3]=Mt=>U(me)("")),id:"item_search_box"},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(Pe),fullwidth:!0}]]),Ye(($(),Ue(U(rP),{status:U(He)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":E.value},{default:pe(()=>[ae(U(mt),{variant:"secondary",disabled:U(He),onClick:lt},{prefix:pe(()=>[ae(U(ft),{src:"ArrowsRotate"})]),default:pe(()=>[$e[6]||($e[6]=dt(" Refresh ",-1))]),_:1},8,["disabled"])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(Pe),fullwidth:!0}]]),Ye(ae(U(N9),{modelValue:U(k),"onUpdate:modelValue":[$e[4]||($e[4]=Mt=>Qt(k)?k.value=Mt:null),$e[5]||($e[5]=Mt=>U(F)(Mt,!0))],checkboxColumn:U(O),id:"table_customization",gridApi:h.value},null,8,["modelValue","checkboxColumn","gridApi"]),[[U(n),{isLoading:U(Pe),fullwidth:!0}]])]),grid:pe(({availableHeight:Mt})=>[ae(U(Mce),Xt({id:"item_table_main",ref:"agGrid"},Be.value,{height:Mt+"px",isSorting:U(Le),onOnGridReady:Pn,onSelectionChanged:Ut}),null,16,["height","isSorting"])]),footer:pe(()=>[fe("div",{class:W(Me.$style.tableFooter),id:"table_footer"},[fe("span",null,[$e[7]||($e[7]=dt(" Showing ",-1)),fe("b",null,Ct(U(m).loaded)+" of "+Ct(U(m).total),1)])],2)]),"new-row":pe(()=>[ae(U(G9),{onCreateNewItem:Jn,ref_key:"createNewSceneRef",ref:kt},null,512)]),"bulk-update-actions":pe(()=>[!y.value&&f.value.length>0?($(),Ue(U(D7),{key:0,selectRowData:xe.value,"workspace-id":d.workspaceId,"entity-id":d.entityId,"grid-api":h.value,onUnselect:U(Y),"take-name":Q.value,"selected-all":ne.value,onUpdated:Fe},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","take-name","selected-all"])):Qe("",!0)]),snackbar:pe(()=>[ae(U(J7))]),popup:pe(()=>[ae(vK,{ref_key:"popupCreateSceneRef",ref:ke,"workspace-id":d.workspaceId,"entity-id":d.entityId,onImportSuccess:lt},null,8,["workspace-id","entity-id"]),ae(Rhe,{ref_key:"popupOverwriteScenesRef",ref:Oe,"workspace-id":d.workspaceId,"entity-id":d.entityId,onImportSuccess:lt},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1lefh_1",tableFooter:"_tableFooter_1lefh_7",footerStart:"_footerStart_1lefh_17",newRow:"_newRow_1lefh_25","warning-text":"_warning-text_1lefh_44","has-error":"_has-error_1lefh_49",itemSearchBox:"_itemSearchBox_1lefh_53","beta-tag":"_beta-tag_1lefh_57"}}]]),uL="0.0.75",xhe={key:0},Fhe=St(ct({__name:"app",setup(e){const t=z(()=>n.id.length===0||n.workspaceId.length===0),n=Ws({id:"",workspaceId:"",apiConfig:{}}),i=Vd(),{showMessage:s}=i,o=c=>{var d,h;c.success?s(c.apiCode,"success"):s(((h=(d=c.res)==null?void 0:d.data)==null?void 0:h.message)||c.apiCode,"error")},r=G(null),a=()=>{const c=sessionStorage.getItem("API_BASE_URL");return c!=null&&c.includes("v1")?c.slice(0,c.lastIndexOf("/v1")):String(c)};Rf(()=>{var c,d,h;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",uL);try{if(r.value=ri(),!r.value)throw new Error("Current instance is null");n.id=((c=r.value)==null?void 0:c.appContext.config.globalProperties.id)||"",n.workspaceId=((d=r.value)==null?void 0:d.appContext.config.globalProperties.workspaceId)||sessionStorage.getItem("ws.code")||"";const f={domainApi:a(),wsCode:sessionStorage.getItem("ws.code")||"",entityId:n.id};if(n.apiConfig=(h=r.value)==null?void 0:h.appContext.config.globalProperties.apiConfig,!f.entityId||!f.wsCode||!f.domainApi)throw new Error("API configuration is missing in dashboardConfig");const p=new lL(n.apiConfig,f);p.on("call-api",o),r.value.appContext.config.globalProperties.apiServices=p}catch(f){console.error("Error getting current instance:",f)}}),Yn(()=>{r.value.appContext.config.globalProperties.apiServices.off("call-api",o)});const l=z(()=>n.id),u=z(()=>n.workspaceId);return Ma("workspaceId",u),Ma("entityId",l),(c,d)=>($(),le("div",{class:W(c.$style.dashboardPluginWrapper)},[t.value?($(),le("span",xhe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):l.value?($(),Ue(U(Dhe),{key:1,entityId:l.value,workspaceId:u.value},null,8,["entityId","workspaceId"])):Qe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),qS=async(e={},t={})=>{const n=QR(Fhe),i=Lj();n.use(i);const s=["apiConfig","workspaceId","id"],o={};return Object.entries(e).forEach(([r,a])=>{a!==void 0&&(n.config.globalProperties[r]=a,o[r]=a,s.includes(r)&&typeof a=="string"?sessionStorage.setItem(r,a):console.error(`[Config Error] Key "${r}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=o,Object.values(t).forEach(r=>{r&&typeof r.install=="function"&&n.use(r)}),n.config.errorHandler=(r,a,l)=>{console.error("[Vue Error]",r),l&&console.error("[Info]",l)},console.log(`%cArbo Dashboard Plugin v${uL}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),n.provide("switchInstance",n.config.globalProperties.$switchInstance),n};typeof window<"u"&&(window.arboDashboard=qS),yn.default=qS,yn.initDashboard=qS,Object.defineProperties(yn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
195
|
+
`,Dhe=St(ct({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=Yi,i=JC(),{setUserPermissions:s,setEntityPermissions:o}=i,{entityPermissions:r}=is(i),{addNotification:a}=Vd(),l=G(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},c=z(()=>{var $e;const Me=(($e=r.value)==null?void 0:$e.has_create_item_permission)===1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!Me},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Me,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Me,id:"overwrite_scenes_option"}]}),d=e;Zd.initialize({wrapVueCellRenderer:pg,wrapVueCellEditor:tI});const h=G(null),f=G([]),p=iw(),{rowCount:m}=is(p),y=G(!1),w=G(""),S=hP(),{metricList:_}=is(S),C=G(""),E=G(!1),R=G(new Set),P=G(new Map),{apiServices:I}=Hi(!1,d),{columnDefs:k,checkboxColumn:O,saveColumnConfig:F}=$ce(_,d.entityId,h),{updateRowData:x,setMetricValues:L}=whe(h),N=z(()=>({isSearching:w.value.length>0,isFiltering:Re.value.length>0})),te=z(Dd),ee=z(()=>k.value.filter(Me=>{var $e;return(($e=Me.field)==null?void 0:$e.startsWith("metric_"))&&!Me.hide}).map(Me=>{var $e;return(($e=Me.field)==null?void 0:$e.replace("metric_",""))||""}));Ma("timezone",te);const Z=z(()=>({autoFetch:!1,workspaceId:d.workspaceId,entityId:d.entityId,metricIds:ee.value,updateItemData:x})),{fetchItems:B,getMetricList:j,cusorMap:K,getMetricValues:ve}=Che(Z),ne=z(()=>{if(!h.value)return!1;const Me=h.value.getSelectedRows().length;return Me>0&&Me>=m.value.total}),Q=z(()=>{var Me;return((Me=l.value)==null?void 0:Me.name)||"Items"}),we=(Me,$e)=>{var Mt,cn,hs;m.value.total=Me.meta.total??0,(Mt=Me.meta.next)!=null&&Mt.cursor&&(K[$e+1]=Me.meta.next.cursor),C.value=Me.meta["X-Tsr-signature"]||"",Me.meta.total===0?(cn=h.value)==null||cn.showNoRowsOverlay():(hs=h.value)==null||hs.hideOverlay()},X=KP(),{sortingAPIConfiguration:ge,isSortingRunning:Le}=is(X),ot=G({}),Re=G([]),pt=async({page:Me,pageSize:$e,filterText:Mt})=>{var co;(co=h.value)==null||co.hideOverlay();const cn=K[Me],hs=!cn&&Me>1?(Me-1)*$e:void 0,fs=ge.value;fs.length>0&&(Le.value=!0);try{const ga={cursor:cn,size:$e,searchQuery:Mt,offset:hs,sort_by:fs,...ot.value},dn=await B(ga);if(!dn)return{rows:[],total:0};const YS=(mc=>{const Il=mc.data.map(Rr=>X1(Rr,te.value));return Il.forEach(Rr=>{R.value.add(String(Rr.id)),P.value.set(String(Rr.id),{})}),Il})(dn);return we(dn,Me),{rows:YS,total:m.value.total}}catch(ga){return console.error("Failed to fetch items:",ga),{rows:[],total:0}}finally{Le.value=!1}},{isLoading:He,toggleSidebar:et,onGridReady:M,handleUnSelect:Y,onSearch:me,firstLoad:Pe}=She({selectRowData:G([]),isSidebarOpen:y,quickFilterText:w,gridApi:h,perPage:u.ROWS_PER_PAGE,fetcher:pt}),xe=G([]),Fe=()=>{var Me;xe.value=((Me=h.value)==null?void 0:Me.getSelectedRows())||[]},Be=z(()=>({blockLoadDebounceMillis:1e3,columnDefs:k.value,rowModelType:"infinite",cacheBlockSize:u.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,headerCheckbox:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:u.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:u.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ie,noRowsOverlayComponent:pg(H9),noRowsOverlayComponentParams:()=>N.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Me=>Me.data.id,getRowClass:Me=>{if(!Me.data)return["row-empty"];const $e=["row-highlight"];return Me.data.id||$e.push("row-inactive"),Me.data.isDeleted&&$e.push("row-deleted"),Me.data.isArchived&&$e.push("row-archived"),$e},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:d.workspaceId,entityId:d.entityId,apiServices:I.value,sorting:Le.value},suppressKeyboardEvent:Me=>{const $e=Me.event.key;return $e==="ArrowUp"||$e==="ArrowDown"||$e==="ArrowLeft"||$e==="ArrowRight"||$e==="Tab"||$e==="Enter"},navigateToNextCell:()=>null,suppressHeaderFocus:!0}));function Ie(){if(!h.value)return;const Me=h.value.getCacheBlockState();if(!Me)return;const $e=Object.values(Me).reduce((Mt,cn)=>(cn==null?void 0:cn.pageStatus)==="loaded"?Mt+(cn.endRow-cn.startRow):Mt,0);m.value.loaded=Math.min($e,m.value.total)}ut(()=>ge,()=>{h.value&&(C.value="",R.value.clear(),h.value.deselectAll(),Object.keys(K).forEach(Me=>delete K[Number(Me)]),h.value.purgeInfiniteCache(),h.value.ensureIndexVisible(0),h.value.refreshCells({force:!0}))},{deep:!0});const ke=G(),Oe=G(),gt=()=>{var Me;(Me=Oe.value)==null||Me.open()},ze=()=>{var Me;(Me=ke.value)==null||Me.open()},lt=async()=>{Pe.value=!0,h.value&&(C.value="",R.value.clear(),Object.keys(K).forEach(Me=>delete K[Number(Me)]),await h.value.deselectAll(),await h.value.ensureIndexVisible(0,"top"),await h.value.purgeInfiniteCache(),await h.value.refreshInfiniteCache())},wt=z(()=>sessionStorage.getItem("ITEM_TABLE_APP_VERSION")||""),kt=G();function Bt(Me){var $e;Me==="new_scene"?($e=kt.value)==null||$e.show():Me==="import_scenes"?ze():Me==="overwrite_scenes"&>()}const Ut=Me=>{f.value=Me.api.getSelectedRows().map($e=>$e.id)},Pn=Me=>{const $e=M(Me);return $e&&($e.addEventListener("modelUpdated",Ie),$e.addEventListener("bodyScroll",()=>$e.stopEditing()),$e.addEventListener("selectionChanged",Fe),$e.addEventListener("columnMoved",Mt=>F(Mt,!0)),$e.addEventListener("columnResized",Mt=>F(Mt,!0)),$e.addEventListener("firstDataRendered",()=>{Pe.value=!1})),$e},vn=(Me,$e)=>{if(!h.value)return;const Mt=h.value.getRowNode(Me);Mt?(h.value.ensureIndexVisible(Number(Mt.rowIndex),"middle"),h.value.flashCells({rowNodes:[Mt],flashDuration:3e3,fadeDuration:1e3})):h.value.ensureIndexVisible(m.value.total-1,"bottom")},Jn=async Me=>{var Mt;let $e;if(!(!I.value||!Me.trim())){He.value=!0;try{$e=await I.value.createNewScene({workspaceId:d.workspaceId,entityId:d.entityId,name:Me}),m.value.total<50&&await lt()}catch(cn){console.error("Error creating new scene:",cn)}finally{He.value=!1,$e!=null&&$e.id&&a({id:String($e==null?void 0:$e.id),message:`${Me} created successfully`,actions:[{label:"View",variant:"secondary",action:()=>{vn(String($e==null?void 0:$e.id))}},{label:"Scene Hub",variant:"primary",action:()=>{const cn=Ss({type:"scene_hub",config:{ws_code:d.workspaceId,baseDomain:sessionStorage.getItem("BASE_URL")||"",scene_id:String($e==null?void 0:$e.id)}}).url;window.open(cn,"_blank")},btnIcon:"CustomSceneHub"}],icon:_he,type:"interactive"}),(Mt=kt.value)==null||Mt.hide()}}},ii=Me=>Me.metric_type.code==="number"?"number":"default",_e=async()=>{if(d.entityId)try{const Me=await j(d.entityId);_.value=Me.data.map($e=>({...$e,sortType:ii($e)}))}catch(Me){console.error("Failed to initialize metric list:",Me),_.value=[]}},Te=async()=>{if(I.value)try{const Me=await I.value.getUserPermission(d.workspaceId);s(Me)}catch(Me){console.error("Failed to fetch user permissions:",Me)}},ht=async()=>{if(I.value)try{const Me=await I.value.getEntityDetail(d.workspaceId,d.entityId);o(Me.permission),l.value=Me}catch(Me){console.error("Failed to fetch entity details:",Me)}},_t=Fw(),{setUser:Ot}=_t,We=async()=>{if(I.value)try{const Me=await I.value.getMe();return Ot(Me),Me}catch(Me){console.error("Failed to fetch user details:",Me)}},si=async()=>{var Me;if(I.value)try{const $e=await I.value.getWorkspaces(d.workspaceId),Mt=(Me=$e.data[0])==null?void 0:Me.ws_user_role_id;return Mt&&_t.setUserRoleId(Mt),$e}catch($e){console.error("Failed to fetch workspace details:",$e)}};ut(()=>[d.entityId,d.workspaceId],async([Me,$e])=>{!Me||!$e||(We(),si(),_e(),Te(),ht())},{immediate:!0,deep:!0}),ut(ee,(Me,$e)=>{const Mt=Me.filter(cn=>!($e!=null&&$e.includes(cn)));Mt.length>0&&ve(Array.from(R.value),Mt).then(cn=>{L(cn,R.value,Mt)})},{immediate:!0,deep:!0}),ut(C,(Me,$e)=>{E.value=!!($e&&Me&&$e!==Me)}),t({refreshTable:lt});const uo=Me=>{ot.value=Me,lt()},pa=Me=>{Re.value=Me,lt()};return(Me,$e)=>($(),Ue(U(V7),{"is-sidebar-open":y.value,onCloseSidebar:U(et),onSidebarClear:U(et),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U(et)},{"header-left":pe(()=>[fe("h1",{class:W(Me.$style.tableTitle)},"Scenes",2),fe("div",{class:W(Me.$style["beta-tag"])},"Beta",2),ae(U(rw),{variant:["primary"],options:c.value,onSelect:Bt,onHandleClick:$e[1]||($e[1]=Mt=>Bt("new_scene")),id:"create_scene_dropdown"},{prefix:pe(()=>[ae(U(mt),{id:"create_new_scene",variant:["primary"],onClick:$e[0]||($e[0]=Mt=>Bt("new_scene")),label:"New"})]),_:1},8,["options"]),fe("span",null,Ct(wt.value),1)]),"header-actions":pe(()=>[ae(U(fK),{"onUpdate:assignees":pa,onApplyFilter:uo,loading:U(Pe)},null,8,["loading"]),Ye(ae(U(tw),{modelValue:w.value,"onUpdate:modelValue":$e[2]||($e[2]=Mt=>w.value=Mt),onSearch:U(me),class:W(Me.$style.itemSearchBox),onClear:$e[3]||($e[3]=Mt=>U(me)("")),id:"item_search_box"},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(Pe),fullwidth:!0}]]),Ye(($(),Ue(U(rP),{status:U(He)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":E.value},{default:pe(()=>[ae(U(mt),{variant:"secondary",disabled:U(He),onClick:lt},{prefix:pe(()=>[ae(U(ft),{src:"ArrowsRotate"})]),default:pe(()=>[$e[6]||($e[6]=dt(" Refresh ",-1))]),_:1},8,["disabled"])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(Pe),fullwidth:!0}]]),Ye(ae(U(N9),{modelValue:U(k),"onUpdate:modelValue":[$e[4]||($e[4]=Mt=>Qt(k)?k.value=Mt:null),$e[5]||($e[5]=Mt=>U(F)(Mt,!0))],checkboxColumn:U(O),id:"table_customization",gridApi:h.value},null,8,["modelValue","checkboxColumn","gridApi"]),[[U(n),{isLoading:U(Pe),fullwidth:!0}]])]),grid:pe(({availableHeight:Mt})=>[ae(U(Mce),Xt({id:"item_table_main",ref:"agGrid"},Be.value,{height:Mt+"px",isSorting:U(Le),onOnGridReady:Pn,onSelectionChanged:Ut}),null,16,["height","isSorting"])]),footer:pe(()=>[fe("div",{class:W(Me.$style.tableFooter),id:"table_footer"},[fe("span",null,[$e[7]||($e[7]=dt(" Showing ",-1)),fe("b",null,Ct(U(m).loaded)+" of "+Ct(U(m).total),1)])],2)]),"new-row":pe(()=>[ae(U(G9),{onCreateNewItem:Jn,ref_key:"createNewSceneRef",ref:kt},null,512)]),"bulk-update-actions":pe(()=>[!y.value&&f.value.length>0?($(),Ue(U(D7),{key:0,selectRowData:xe.value,"workspace-id":d.workspaceId,"entity-id":d.entityId,"grid-api":h.value,onUnselect:U(Y),"take-name":Q.value,"selected-all":ne.value,onUpdated:Fe},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","take-name","selected-all"])):Qe("",!0)]),snackbar:pe(()=>[ae(U(J7))]),popup:pe(()=>[ae(vK,{ref_key:"popupCreateSceneRef",ref:ke,"workspace-id":d.workspaceId,"entity-id":d.entityId,onImportSuccess:lt},null,8,["workspace-id","entity-id"]),ae(Rhe,{ref_key:"popupOverwriteScenesRef",ref:Oe,"workspace-id":d.workspaceId,"entity-id":d.entityId,onImportSuccess:lt},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1lefh_1",tableFooter:"_tableFooter_1lefh_7",footerStart:"_footerStart_1lefh_17",newRow:"_newRow_1lefh_25","warning-text":"_warning-text_1lefh_44","has-error":"_has-error_1lefh_49",itemSearchBox:"_itemSearchBox_1lefh_53","beta-tag":"_beta-tag_1lefh_57"}}]]),uL="0.0.76",xhe={key:0},Fhe=St(ct({__name:"app",setup(e){const t=z(()=>n.id.length===0||n.workspaceId.length===0),n=Ws({id:"",workspaceId:"",apiConfig:{}}),i=Vd(),{showMessage:s}=i,o=c=>{var d,h;c.success?s(c.apiCode,"success"):s(((h=(d=c.res)==null?void 0:d.data)==null?void 0:h.message)||c.apiCode,"error")},r=G(null),a=()=>{const c=sessionStorage.getItem("API_BASE_URL");return c!=null&&c.includes("v1")?c.slice(0,c.lastIndexOf("/v1")):String(c)};Rf(()=>{var c,d,h;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",uL);try{if(r.value=ri(),!r.value)throw new Error("Current instance is null");n.id=((c=r.value)==null?void 0:c.appContext.config.globalProperties.id)||"",n.workspaceId=((d=r.value)==null?void 0:d.appContext.config.globalProperties.workspaceId)||sessionStorage.getItem("ws.code")||"";const f={domainApi:a(),wsCode:sessionStorage.getItem("ws.code")||"",entityId:n.id};if(n.apiConfig=(h=r.value)==null?void 0:h.appContext.config.globalProperties.apiConfig,!f.entityId||!f.wsCode||!f.domainApi)throw new Error("API configuration is missing in dashboardConfig");const p=new lL(n.apiConfig,f);p.on("call-api",o),r.value.appContext.config.globalProperties.apiServices=p}catch(f){console.error("Error getting current instance:",f)}}),Yn(()=>{r.value.appContext.config.globalProperties.apiServices.off("call-api",o)});const l=z(()=>n.id),u=z(()=>n.workspaceId);return Ma("workspaceId",u),Ma("entityId",l),(c,d)=>($(),le("div",{class:W(c.$style.dashboardPluginWrapper)},[t.value?($(),le("span",xhe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):l.value?($(),Ue(U(Dhe),{key:1,entityId:l.value,workspaceId:u.value},null,8,["entityId","workspaceId"])):Qe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),qS=async(e={},t={})=>{const n=QR(Fhe),i=Lj();n.use(i);const s=["apiConfig","workspaceId","id"],o={};return Object.entries(e).forEach(([r,a])=>{a!==void 0&&(n.config.globalProperties[r]=a,o[r]=a,s.includes(r)&&typeof a=="string"?sessionStorage.setItem(r,a):console.error(`[Config Error] Key "${r}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=o,Object.values(t).forEach(r=>{r&&typeof r.install=="function"&&n.use(r)}),n.config.errorHandler=(r,a,l)=>{console.error("[Vue Error]",r),l&&console.error("[Info]",l)},console.log(`%cArbo Dashboard Plugin v${uL}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),n.provide("switchInstance",n.config.globalProperties.$switchInstance),n};typeof window<"u"&&(window.arboDashboard=qS),yn.default=qS,yn.initDashboard=qS,Object.defineProperties(yn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|