@arbocollab/arbo-plugin-item-table 0.1.31 → 0.1.32
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 +2 -2
- package/lib/umd/index.umd.js +2 -2
- package/package.json +1 -1
package/lib/es/index.es.js
CHANGED
|
@@ -35769,7 +35769,7 @@ const Ete = /* @__PURE__ */ ft({
|
|
|
35769
35769
|
isStated: "actual_start_date",
|
|
35770
35770
|
isCompleted: "actual_due_date",
|
|
35771
35771
|
lastUpdated: "updated_at",
|
|
35772
|
-
completedOn: "
|
|
35772
|
+
completedOn: "actual_due_date",
|
|
35773
35773
|
status: "template_flow_status",
|
|
35774
35774
|
assignees: "assignee"
|
|
35775
35775
|
}, n = {
|
|
@@ -85982,7 +85982,7 @@ const nRe = {
|
|
|
85982
85982
|
"beta-tag": "_beta-tag_1sow5_56"
|
|
85983
85983
|
}, RRe = {
|
|
85984
85984
|
$style: _Re
|
|
85985
|
-
}, DRe = /* @__PURE__ */ _t(yRe, [["__cssModules", RRe]]), kB = "0.1.
|
|
85985
|
+
}, DRe = /* @__PURE__ */ _t(yRe, [["__cssModules", RRe]]), kB = "0.1.32", TRe = { key: 0 }, FRe = /* @__PURE__ */ ft({
|
|
85986
85986
|
__name: "app",
|
|
85987
85987
|
setup(e) {
|
|
85988
85988
|
const t = K(() => n.id.length === 0 || n.workspaceId.length === 0), n = ti({
|
package/lib/umd/index.umd.js
CHANGED
|
@@ -145,7 +145,7 @@ This will fail in production.`);r=$l,r._s.has(e)||(o?Gb(e,t,s,r):CA(e,s,r),$.env
|
|
|
145
145
|
* @author RubaXa <trash@rubaxa.org>
|
|
146
146
|
* @author owenm <owen23355@gmail.com>
|
|
147
147
|
* @license MIT
|
|
148
|
-
*/function tk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tk(Object(n),!0).forEach(function(s){AZ(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tk(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function xm(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xm=function(t){return typeof t}:xm=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xm(e)}function AZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zr(){return Zr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Zr.apply(this,arguments)}function kZ(e,t){if(e==null)return{};var n={},s=Object.keys(e),o,i;for(i=0;i<s.length;i++)o=s[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function OZ(e,t){if(e==null)return{};var n=kZ(e,t),s,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)s=i[o],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}var MZ="1.14.0";function Xr(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Jr=Xr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Xh=Xr(/Edge/i),nk=Xr(/firefox/i),Jh=Xr(/safari/i)&&!Xr(/chrome/i)&&!Xr(/android/i),sk=Xr(/iP(ad|od|hone)/i),NZ=Xr(/chrome/i)&&Xr(/android/i),ok={capture:!1,passive:!1};function pn(e,t,n){e.addEventListener(t,n,!Jr&&ok)}function an(e,t,n){e.removeEventListener(t,n,!Jr&&ok)}function Pm(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function LZ(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function rr(e,t,n,s){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Pm(e,t):Pm(e,t))||s&&e===n)return e;if(e===n)break}while(e=LZ(e))}return null}var ik=/\s+/g;function To(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(ik," ").replace(" "+t+" "," ");e.className=(s+(n?" "+t:"")).replace(ik," ")}}function Mt(e,t,n){var s=e&&e.style;if(s){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in s)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),s[t]=n+(typeof n=="string"?"":"px")}}function Fc(e,t){var n="";if(typeof e=="string")n=e;else do{var s=Mt(e,"transform");s&&s!=="none"&&(n=s+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function rk(e,t,n){if(e){var s=e.getElementsByTagName(t),o=0,i=s.length;if(n)for(;o<i;o++)n(s[o],o);return s}return[]}function ar(){var e=document.scrollingElement;return e||document.documentElement}function ys(e,t,n,s,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,r,a,l,u,c,d;if(e!==window&&e.parentNode&&e!==ar()?(i=e.getBoundingClientRect(),r=i.top,a=i.left,l=i.bottom,u=i.right,c=i.height,d=i.width):(r=0,a=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!Jr))do if(o&&o.getBoundingClientRect&&(Mt(o,"transform")!=="none"||n&&Mt(o,"position")!=="static")){var h=o.getBoundingClientRect();r-=h.top+parseInt(Mt(o,"border-top-width")),a-=h.left+parseInt(Mt(o,"border-left-width")),l=r+i.height,u=a+i.width;break}while(o=o.parentNode);if(s&&e!==window){var f=Fc(o||e),p=f&&f.a,g=f&&f.d;f&&(r/=g,a/=p,d/=p,c/=g,l=r+c,u=a+d)}return{top:r,left:a,bottom:l,right:u,width:d,height:c}}}function ak(e,t,n){for(var s=Va(e,!0),o=ys(e)[t];s;){var i=ys(s)[n],r=void 0;if(r=o>=i,!r)return s;if(s===ar())break;s=Va(s,!1)}return!1}function Ic(e,t,n,s){for(var o=0,i=0,r=e.children;i<r.length;){if(r[i].style.display!=="none"&&r[i]!==Nt.ghost&&(s||r[i]!==Nt.dragged)&&rr(r[i],n.draggable,e,!1)){if(o===t)return r[i];o++}i++}return null}function tS(e,t){for(var n=e.lastElementChild;n&&(n===Nt.ghost||Mt(n,"display")==="none"||t&&!Pm(n,t));)n=n.previousElementSibling;return n||null}function Zo(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==Nt.clone&&(!t||Pm(e,t))&&n++;return n}function lk(e){var t=0,n=0,s=ar();if(e)do{var o=Fc(e),i=o.a,r=o.d;t+=e.scrollLeft*i,n+=e.scrollTop*r}while(e!==s&&(e=e.parentNode));return[t,n]}function VZ(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var s in t)if(t.hasOwnProperty(s)&&t[s]===e[n][s])return Number(n)}return-1}function Va(e,t){if(!e||!e.getBoundingClientRect)return ar();var n=e,s=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=Mt(n);if(n.clientWidth<n.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return ar();if(s||t)return n;s=!0}}while(n=n.parentNode);return ar()}function BZ(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function nS(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Qh;function uk(e,t){return function(){if(!Qh){var n=arguments,s=this;n.length===1?e.call(s,n[0]):e.apply(s,n),Qh=setTimeout(function(){Qh=void 0},t)}}}function $Z(){clearTimeout(Qh),Qh=void 0}function ck(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function dk(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var Fo="Sortable"+new Date().getTime();function HZ(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(o){if(!(Mt(o,"display")==="none"||o===Nt.ghost)){e.push({target:o,rect:ys(o)});var i=ir({},e[e.length-1].rect);if(o.thisAnimationDuration){var r=Fc(o,!0);r&&(i.top-=r.f,i.left-=r.e)}o.fromRect=i}})}},addAnimationState:function(s){e.push(s)},removeAnimationState:function(s){e.splice(VZ(e,{target:s}),1)},animateAll:function(s){var o=this;if(!this.options.animation){clearTimeout(t),typeof s=="function"&&s();return}var i=!1,r=0;e.forEach(function(a){var l=0,u=a.target,c=u.fromRect,d=ys(u),h=u.prevFromRect,f=u.prevToRect,p=a.rect,g=Fc(u,!0);g&&(d.top-=g.f,d.left-=g.e),u.toRect=d,u.thisAnimationDuration&&nS(h,d)&&!nS(c,d)&&(p.top-d.top)/(p.left-d.left)===(c.top-d.top)/(c.left-d.left)&&(l=UZ(p,h,f,o.options)),nS(d,c)||(u.prevFromRect=c,u.prevToRect=d,l||(l=o.options.animation),o.animate(u,p,d,l)),l&&(i=!0,r=Math.max(r,l),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},l),u.thisAnimationDuration=l)}),clearTimeout(t),i?t=setTimeout(function(){typeof s=="function"&&s()},r):typeof s=="function"&&s(),e=[]},animate:function(s,o,i,r){if(r){Mt(s,"transition",""),Mt(s,"transform","");var a=Fc(this.el),l=a&&a.a,u=a&&a.d,c=(o.left-i.left)/(l||1),d=(o.top-i.top)/(u||1);s.animatingX=!!c,s.animatingY=!!d,Mt(s,"transform","translate3d("+c+"px,"+d+"px,0)"),this.forRepaintDummy=GZ(s),Mt(s,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),Mt(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){Mt(s,"transition",""),Mt(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},r)}}}}function GZ(e){return e.offsetWidth}function UZ(e,t,n,s){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*s.animation}var xc=[],sS={initializeByDefault:!0},ef={mount:function(t){for(var n in sS)sS.hasOwnProperty(n)&&!(n in t)&&(t[n]=sS[n]);xc.forEach(function(s){if(s.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),xc.push(t)},pluginEvent:function(t,n,s){var o=this;this.eventCanceled=!1,s.cancel=function(){o.eventCanceled=!0};var i=t+"Global";xc.forEach(function(r){n[r.pluginName]&&(n[r.pluginName][i]&&n[r.pluginName][i](ir({sortable:n},s)),n.options[r.pluginName]&&n[r.pluginName][t]&&n[r.pluginName][t](ir({sortable:n},s)))})},initializePlugins:function(t,n,s,o){xc.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var u=new a(t,n,t.options);u.sortable=t,u.options=t.options,t[l]=u,Zr(s,u.defaults)}});for(var i in t.options)if(t.options.hasOwnProperty(i)){var r=this.modifyOption(t,i,t.options[i]);typeof r<"u"&&(t.options[i]=r)}},getEventProperties:function(t,n){var s={};return xc.forEach(function(o){typeof o.eventProperties=="function"&&Zr(s,o.eventProperties.call(n[o.pluginName],t))}),s},modifyOption:function(t,n,s){var o;return xc.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],s))}),o}};function WZ(e){var t=e.sortable,n=e.rootEl,s=e.name,o=e.targetEl,i=e.cloneEl,r=e.toEl,a=e.fromEl,l=e.oldIndex,u=e.newIndex,c=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[Fo],!!t){var g,v=t.options,C="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!Jr&&!Xh?g=new CustomEvent(s,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(s,!0,!0)),g.to=r||n,g.from=a||n,g.item=o||n,g.clone=i,g.oldIndex=l,g.newIndex=u,g.oldDraggableIndex=c,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var b=ir(ir({},p),ef.getEventProperties(s,t));for(var S in b)g[S]=b[S];n&&n.dispatchEvent(g),v[C]&&v[C].call(t,g)}}var zZ=["evt"],ao=function(t,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=s.evt,i=OZ(s,zZ);ef.pluginEvent.bind(Nt)(t,n,ir({dragEl:ht,parentEl:Kn,ghostEl:Wt,rootEl:Vn,nextEl:zl,lastDownEl:Am,cloneEl:qn,cloneHidden:Ba,dragStarted:nf,putSortable:Fs,activeSortable:Nt.active,originalEvent:o,oldIndex:Pc,oldDraggableIndex:tf,newIndex:Io,newDraggableIndex:$a,hideGhostForTarget:yk,unhideGhostForTarget:wk,cloneNowHidden:function(){Ba=!0},cloneNowShown:function(){Ba=!1},dispatchSortableEvent:function(a){Js({sortable:n,name:a,originalEvent:o})}},i))};function Js(e){WZ(ir({putSortable:Fs,cloneEl:qn,targetEl:ht,rootEl:Vn,oldIndex:Pc,oldDraggableIndex:tf,newIndex:Io,newDraggableIndex:$a},e))}var ht,Kn,Wt,Vn,zl,Am,qn,Ba,Pc,Io,tf,$a,km,Fs,Ac=!1,Om=!1,Mm=[],jl,Di,oS,iS,hk,fk,nf,kc,sf,of=!1,Nm=!1,Lm,$s,rS=[],aS=!1,Vm=[],Bm=typeof document<"u",$m=sk,pk=Xh||Jr?"cssFloat":"float",jZ=Bm&&!NZ&&!sk&&"draggable"in document.createElement("div"),gk=function(){if(Bm){if(Jr)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),mk=function(t,n){var s=Mt(t),o=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),i=Ic(t,0,n),r=Ic(t,1,n),a=i&&Mt(i),l=r&&Mt(r),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+ys(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+ys(r).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return i&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||u>=o&&s[pk]==="none"||r&&s[pk]==="none"&&u+c>o)?"vertical":"horizontal"},KZ=function(t,n,s){var o=s?t.left:t.top,i=s?t.right:t.bottom,r=s?t.width:t.height,a=s?n.left:n.top,l=s?n.right:n.bottom,u=s?n.width:n.height;return o===a||i===l||o+r/2===a+u/2},qZ=function(t,n){var s;return Mm.some(function(o){var i=o[Fo].options.emptyInsertThreshold;if(!(!i||tS(o))){var r=ys(o),a=t>=r.left-i&&t<=r.right+i,l=n>=r.top-i&&n<=r.bottom+i;if(a&&l)return s=o}}),s},vk=function(t){function n(i,r){return function(a,l,u,c){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(i==null&&(r||d))return!0;if(i==null||i===!1)return!1;if(r&&i==="clone")return i;if(typeof i=="function")return n(i(a,l,u,c),r)(a,l,u,c);var h=(r?a:l).options.group.name;return i===!0||typeof i=="string"&&i===h||i.join&&i.indexOf(h)>-1}}var s={},o=t.group;(!o||xm(o)!="object")&&(o={name:o}),s.name=o.name,s.checkPull=n(o.pull,!0),s.checkPut=n(o.put),s.revertClone=o.revertClone,t.group=s},yk=function(){!gk&&Wt&&Mt(Wt,"display","none")},wk=function(){!gk&&Wt&&Mt(Wt,"display","")};Bm&&document.addEventListener("click",function(e){if(Om)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Om=!1,!1},!0);var Kl=function(t){if(ht){t=t.touches?t.touches[0]:t;var n=qZ(t.clientX,t.clientY);if(n){var s={};for(var o in t)t.hasOwnProperty(o)&&(s[o]=t[o]);s.target=s.rootEl=n,s.preventDefault=void 0,s.stopPropagation=void 0,n[Fo]._onDragOver(s)}}},YZ=function(t){ht&&ht.parentNode[Fo]._isOutsideThisEl(t.target)};function Nt(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Zr({},t),e[Fo]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return mk(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,a){r.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Nt.supportPointer!==!1&&"PointerEvent"in window&&!Jh,emptyInsertThreshold:5};ef.initializePlugins(this,e,n);for(var s in n)!(s in t)&&(t[s]=n[s]);vk(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:jZ,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?pn(e,"pointerdown",this._onTapStart):(pn(e,"mousedown",this._onTapStart),pn(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(pn(e,"dragover",this),pn(e,"dragenter",this)),Mm.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Zr(this,HZ())}Nt.prototype={constructor:Nt,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(kc=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,ht):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,s=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(sX(s),!ht&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Jh&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=rr(l,o.draggable,s,!1),!(l&&l.animated)&&Am!==l)){if(Pc=Zo(l),tf=Zo(l,o.draggable),typeof c=="function"){if(c.call(this,t,l,this)){Js({sortable:n,rootEl:u,name:"filter",targetEl:l,toEl:s,fromEl:s}),ao("filter",n,{evt:t}),i&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(d){if(d=rr(u,d.trim(),s,!1),d)return Js({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:s,toEl:s}),ao("filter",n,{evt:t}),!0}),c)){i&&t.cancelable&&t.preventDefault();return}o.handle&&!rr(u,o.handle,s,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,s){var o=this,i=o.el,r=o.options,a=i.ownerDocument,l;if(s&&!ht&&s.parentNode===i){var u=ys(s);if(Vn=i,ht=s,Kn=ht.parentNode,zl=ht.nextSibling,Am=s,km=r.group,Nt.dragged=ht,jl={target:ht,clientX:(n||t).clientX,clientY:(n||t).clientY},hk=jl.clientX-u.left,fk=jl.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,ht.style["will-change"]="all",l=function(){if(ao("delayEnded",o,{evt:t}),Nt.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!nk&&o.nativeDraggable&&(ht.draggable=!0),o._triggerDragStart(t,n),Js({sortable:o,name:"choose",originalEvent:t}),To(ht,r.chosenClass,!0)},r.ignore.split(",").forEach(function(c){rk(ht,c.trim(),lS)}),pn(a,"dragover",Kl),pn(a,"mousemove",Kl),pn(a,"touchmove",Kl),pn(a,"mouseup",o._onDrop),pn(a,"touchend",o._onDrop),pn(a,"touchcancel",o._onDrop),nk&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ht.draggable=!0),ao("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Xh||Jr))){if(Nt.eventCanceled){this._onDrop();return}pn(a,"mouseup",o._disableDelayedDrag),pn(a,"touchend",o._disableDelayedDrag),pn(a,"touchcancel",o._disableDelayedDrag),pn(a,"mousemove",o._delayedDragTouchMoveHandler),pn(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&pn(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,r.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ht&&lS(ht),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;an(t,"mouseup",this._disableDelayedDrag),an(t,"touchend",this._disableDelayedDrag),an(t,"touchcancel",this._disableDelayedDrag),an(t,"mousemove",this._delayedDragTouchMoveHandler),an(t,"touchmove",this._delayedDragTouchMoveHandler),an(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?pn(document,"pointermove",this._onTouchMove):n?pn(document,"touchmove",this._onTouchMove):pn(document,"mousemove",this._onTouchMove):(pn(ht,"dragend",this),pn(Vn,"dragstart",this._onDragStart));try{document.selection?Gm(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Ac=!1,Vn&&ht){ao("dragStarted",this,{evt:n}),this.nativeDraggable&&pn(document,"dragover",YZ);var s=this.options;!t&&To(ht,s.dragClass,!1),To(ht,s.ghostClass,!0),Nt.active=this,t&&this._appendGhost(),Js({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Di){this._lastX=Di.clientX,this._lastY=Di.clientY,yk();for(var t=document.elementFromPoint(Di.clientX,Di.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Di.clientX,Di.clientY),t!==n);)n=t;if(ht.parentNode[Fo]._isOutsideThisEl(t),n)do{if(n[Fo]){var s=void 0;if(s=n[Fo]._onDragOver({clientX:Di.clientX,clientY:Di.clientY,target:t,rootEl:n}),s&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);wk()}},_onTouchMove:function(t){if(jl){var n=this.options,s=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,r=Wt&&Fc(Wt,!0),a=Wt&&r&&r.a,l=Wt&&r&&r.d,u=$m&&$s&&lk($s),c=(i.clientX-jl.clientX+o.x)/(a||1)+(u?u[0]-rS[0]:0)/(a||1),d=(i.clientY-jl.clientY+o.y)/(l||1)+(u?u[1]-rS[1]:0)/(l||1);if(!Nt.active&&!Ac){if(s&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<s)return;this._onDragStart(t,!0)}if(Wt){r?(r.e+=c-(oS||0),r.f+=d-(iS||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var h="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");Mt(Wt,"webkitTransform",h),Mt(Wt,"mozTransform",h),Mt(Wt,"msTransform",h),Mt(Wt,"transform",h),oS=c,iS=d,Di=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Wt){var t=this.options.fallbackOnBody?document.body:Vn,n=ys(ht,!0,$m,!0,t),s=this.options;if($m){for($s=t;Mt($s,"position")==="static"&&Mt($s,"transform")==="none"&&$s!==document;)$s=$s.parentNode;$s!==document.body&&$s!==document.documentElement?($s===document&&($s=ar()),n.top+=$s.scrollTop,n.left+=$s.scrollLeft):$s=ar(),rS=lk($s)}Wt=ht.cloneNode(!0),To(Wt,s.ghostClass,!1),To(Wt,s.fallbackClass,!0),To(Wt,s.dragClass,!0),Mt(Wt,"transition",""),Mt(Wt,"transform",""),Mt(Wt,"box-sizing","border-box"),Mt(Wt,"margin",0),Mt(Wt,"top",n.top),Mt(Wt,"left",n.left),Mt(Wt,"width",n.width),Mt(Wt,"height",n.height),Mt(Wt,"opacity","0.8"),Mt(Wt,"position",$m?"absolute":"fixed"),Mt(Wt,"zIndex","100000"),Mt(Wt,"pointerEvents","none"),Nt.ghost=Wt,t.appendChild(Wt),Mt(Wt,"transform-origin",hk/parseInt(Wt.style.width)*100+"% "+fk/parseInt(Wt.style.height)*100+"%")}},_onDragStart:function(t,n){var s=this,o=t.dataTransfer,i=s.options;if(ao("dragStart",this,{evt:t}),Nt.eventCanceled){this._onDrop();return}ao("setupClone",this),Nt.eventCanceled||(qn=dk(ht),qn.draggable=!1,qn.style["will-change"]="",this._hideClone(),To(qn,this.options.chosenClass,!1),Nt.clone=qn),s.cloneId=Gm(function(){ao("clone",s),!Nt.eventCanceled&&(s.options.removeCloneOnHide||Vn.insertBefore(qn,ht),s._hideClone(),Js({sortable:s,name:"clone"}))}),!n&&To(ht,i.dragClass,!0),n?(Om=!0,s._loopId=setInterval(s._emulateDragOver,50)):(an(document,"mouseup",s._onDrop),an(document,"touchend",s._onDrop),an(document,"touchcancel",s._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(s,o,ht)),pn(document,"drop",s),Mt(ht,"transform","translateZ(0)")),Ac=!0,s._dragStartId=Gm(s._dragStarted.bind(s,n,t)),pn(document,"selectstart",s),nf=!0,Jh&&Mt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,s=t.target,o,i,r,a=this.options,l=a.group,u=Nt.active,c=km===l,d=a.sort,h=Fs||u,f,p=this,g=!1;if(aS)return;function v(ee,G){ao(ee,p,ir({evt:t,isOwner:c,axis:f?"vertical":"horizontal",revert:r,dragRect:o,targetRect:i,canSort:d,fromSortable:h,target:s,completed:b,onMove:function(H,J){return Hm(Vn,n,ht,o,H,ys(H),t,J)},changed:S},G))}function C(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function b(ee){return v("dragOverCompleted",{insertion:ee}),ee&&(c?u._hideClone():u._showClone(p),p!==h&&(To(ht,Fs?Fs.options.ghostClass:u.options.ghostClass,!1),To(ht,a.ghostClass,!0)),Fs!==p&&p!==Nt.active?Fs=p:p===Nt.active&&Fs&&(Fs=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===ht&&!ht.animated||s===n&&!s.animated)&&(kc=null),!a.dragoverBubble&&!t.rootEl&&s!==document&&(ht.parentNode[Fo]._isOutsideThisEl(t.target),!ee&&Kl(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function S(){Io=Zo(ht),$a=Zo(ht,a.draggable),Js({sortable:p,name:"change",toEl:n,newIndex:Io,newDraggableIndex:$a,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),s=rr(s,a.draggable,n,!0),v("dragOver"),Nt.eventCanceled)return g;if(ht.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return b(!1);if(Om=!1,u&&!a.disabled&&(c?d||(r=Kn!==Vn):Fs===this||(this.lastPutMode=km.checkPull(this,u,ht,t))&&l.checkPut(this,u,ht,t))){if(f=this._getDirection(t,s)==="vertical",o=ys(ht),v("dragOverValid"),Nt.eventCanceled)return g;if(r)return Kn=Vn,C(),this._hideClone(),v("revert"),Nt.eventCanceled||(zl?Vn.insertBefore(ht,zl):Vn.appendChild(ht)),b(!0);var y=tS(n,a.draggable);if(!y||QZ(t,f,this)&&!y.animated){if(y===ht)return b(!1);if(y&&n===t.target&&(s=y),s&&(i=ys(s)),Hm(Vn,n,ht,o,s,i,t,!!s)!==!1)return C(),n.appendChild(ht),Kn=n,S(),b(!0)}else if(y&&JZ(t,f,this)){var R=Ic(n,0,a,!0);if(R===ht)return b(!1);if(s=R,i=ys(s),Hm(Vn,n,ht,o,s,i,t,!1)!==!1)return C(),n.insertBefore(ht,R),Kn=n,S(),b(!0)}else if(s.parentNode===n){i=ys(s);var E=0,F,k=ht.parentNode!==n,O=!KZ(ht.animated&&ht.toRect||o,s.animated&&s.toRect||i,f),I=f?"top":"left",D=ak(s,"top","top")||ak(ht,"top","top"),T=D?D.scrollTop:void 0;kc!==s&&(F=i[I],of=!1,Nm=!O&&a.invertSwap||k),E=eX(t,s,i,f,O?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Nm,kc===s);var A;if(E!==0){var Y=Zo(ht);do Y-=E,A=Kn.children[Y];while(A&&(Mt(A,"display")==="none"||A===Wt))}if(E===0||A===s)return b(!1);kc=s,sf=E;var Z=s.nextElementSibling,te=!1;te=E===1;var ie=Hm(Vn,n,ht,o,s,i,t,te);if(ie!==!1)return(ie===1||ie===-1)&&(te=ie===1),aS=!0,setTimeout(XZ,30),C(),te&&!Z?n.appendChild(ht):s.parentNode.insertBefore(ht,te?Z:s),D&&ck(D,0,T-D.scrollTop),Kn=ht.parentNode,F!==void 0&&!Nm&&(Lm=Math.abs(F-ys(s)[I])),S(),b(!0)}if(n.contains(ht))return b(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){an(document,"mousemove",this._onTouchMove),an(document,"touchmove",this._onTouchMove),an(document,"pointermove",this._onTouchMove),an(document,"dragover",Kl),an(document,"mousemove",Kl),an(document,"touchmove",Kl)},_offUpEvents:function(){var t=this.el.ownerDocument;an(t,"mouseup",this._onDrop),an(t,"touchend",this._onDrop),an(t,"pointerup",this._onDrop),an(t,"touchcancel",this._onDrop),an(document,"selectstart",this)},_onDrop:function(t){var n=this.el,s=this.options;if(Io=Zo(ht),$a=Zo(ht,s.draggable),ao("drop",this,{evt:t}),Kn=ht&&ht.parentNode,Io=Zo(ht),$a=Zo(ht,s.draggable),Nt.eventCanceled){this._nulling();return}Ac=!1,Nm=!1,of=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),uS(this.cloneId),uS(this._dragStartId),this.nativeDraggable&&(an(document,"drop",this),an(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Jh&&Mt(document.body,"user-select",""),Mt(ht,"transform",""),t&&(nf&&(t.cancelable&&t.preventDefault(),!s.dropBubble&&t.stopPropagation()),Wt&&Wt.parentNode&&Wt.parentNode.removeChild(Wt),(Vn===Kn||Fs&&Fs.lastPutMode!=="clone")&&qn&&qn.parentNode&&qn.parentNode.removeChild(qn),ht&&(this.nativeDraggable&&an(ht,"dragend",this),lS(ht),ht.style["will-change"]="",nf&&!Ac&&To(ht,Fs?Fs.options.ghostClass:this.options.ghostClass,!1),To(ht,this.options.chosenClass,!1),Js({sortable:this,name:"unchoose",toEl:Kn,newIndex:null,newDraggableIndex:null,originalEvent:t}),Vn!==Kn?(Io>=0&&(Js({rootEl:Kn,name:"add",toEl:Kn,fromEl:Vn,originalEvent:t}),Js({sortable:this,name:"remove",toEl:Kn,originalEvent:t}),Js({rootEl:Kn,name:"sort",toEl:Kn,fromEl:Vn,originalEvent:t}),Js({sortable:this,name:"sort",toEl:Kn,originalEvent:t})),Fs&&Fs.save()):Io!==Pc&&Io>=0&&(Js({sortable:this,name:"update",toEl:Kn,originalEvent:t}),Js({sortable:this,name:"sort",toEl:Kn,originalEvent:t})),Nt.active&&((Io==null||Io===-1)&&(Io=Pc,$a=tf),Js({sortable:this,name:"end",toEl:Kn,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){ao("nulling",this),Vn=ht=Kn=Wt=zl=qn=Am=Ba=jl=Di=nf=Io=$a=Pc=tf=kc=sf=Fs=km=Nt.dragged=Nt.ghost=Nt.clone=Nt.active=null,Vm.forEach(function(t){t.checked=!0}),Vm.length=oS=iS=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ht&&(this._onDragOver(t),ZZ(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,s=this.el.children,o=0,i=s.length,r=this.options;o<i;o++)n=s[o],rr(n,r.draggable,this.el,!1)&&t.push(n.getAttribute(r.dataIdAttr)||nX(n));return t},sort:function(t,n){var s={},o=this.el;this.toArray().forEach(function(i,r){var a=o.children[r];rr(a,this.options.draggable,o,!1)&&(s[i]=a)},this),n&&this.captureAnimationState(),t.forEach(function(i){s[i]&&(o.removeChild(s[i]),o.appendChild(s[i]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return rr(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var s=this.options;if(n===void 0)return s[t];var o=ef.modifyOption(this,t,n);typeof o<"u"?s[t]=o:s[t]=n,t==="group"&&vk(s)},destroy:function(){ao("destroy",this);var t=this.el;t[Fo]=null,an(t,"mousedown",this._onTapStart),an(t,"touchstart",this._onTapStart),an(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(an(t,"dragover",this),an(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Mm.splice(Mm.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Ba){if(ao("hideClone",this),Nt.eventCanceled)return;Mt(qn,"display","none"),this.options.removeCloneOnHide&&qn.parentNode&&qn.parentNode.removeChild(qn),Ba=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Ba){if(ao("showClone",this),Nt.eventCanceled)return;ht.parentNode==Vn&&!this.options.group.revertClone?Vn.insertBefore(qn,ht):zl?Vn.insertBefore(qn,zl):Vn.appendChild(qn),this.options.group.revertClone&&this.animate(ht,qn),Mt(qn,"display",""),Ba=!1}}};function ZZ(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Hm(e,t,n,s,o,i,r,a){var l,u=e[Fo],c=u.options.onMove,d;return window.CustomEvent&&!Jr&&!Xh?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=s,l.related=o||t,l.relatedRect=i||ys(t),l.willInsertAfter=a,l.originalEvent=r,e.dispatchEvent(l),c&&(d=c.call(u,l,r)),d}function lS(e){e.draggable=!1}function XZ(){aS=!1}function JZ(e,t,n){var s=ys(Ic(n.el,0,n.options,!0)),o=10;return t?e.clientX<s.left-o||e.clientY<s.top&&e.clientX<s.right:e.clientY<s.top-o||e.clientY<s.bottom&&e.clientX<s.left}function QZ(e,t,n){var s=ys(tS(n.el,n.options.draggable)),o=10;return t?e.clientX>s.right+o||e.clientX<=s.right&&e.clientY>s.bottom&&e.clientX>=s.left:e.clientX>s.right&&e.clientY>s.top||e.clientX<=s.right&&e.clientY>s.bottom+o}function eX(e,t,n,s,o,i,r,a){var l=s?e.clientY:e.clientX,u=s?n.height:n.width,c=s?n.top:n.left,d=s?n.bottom:n.right,h=!1;if(!r){if(a&&Lm<u*o){if(!of&&(sf===1?l>c+u*i/2:l<d-u*i/2)&&(of=!0),of)h=!0;else if(sf===1?l<c+Lm:l>d-Lm)return-sf}else if(l>c+u*(1-o)/2&&l<d-u*(1-o)/2)return tX(t)}return h=h||r,h&&(l<c+u*i/2||l>d-u*i/2)?l>c+u/2?1:-1:0}function tX(e){return Zo(ht)<Zo(e)?1:-1}function nX(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,s=0;n--;)s+=t.charCodeAt(n);return s.toString(36)}function sX(e){Vm.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var s=t[n];s.checked&&Vm.push(s)}}function Gm(e){return setTimeout(e,0)}function uS(e){return clearTimeout(e)}Bm&&pn(document,"touchmove",function(e){(Nt.active||Ac)&&e.cancelable&&e.preventDefault()}),Nt.utils={on:pn,off:an,css:Mt,find:rk,is:function(t,n){return!!rr(t,n,t,!1)},extend:BZ,throttle:uk,closest:rr,toggleClass:To,clone:dk,index:Zo,nextTick:Gm,cancelNextTick:uS,detectDirection:mk,getChild:Ic},Nt.get=function(e){return e[Fo]},Nt.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(s){if(!s.prototype||!s.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(s));s.utils&&(Nt.utils=ir(ir({},Nt.utils),s.utils)),ef.mount(s)})},Nt.create=function(e,t){return new Nt(e,t)},Nt.version=MZ;var us=[],rf,cS,dS=!1,hS,fS,Um,af;function oX(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var s=n.originalEvent;this.sortable.nativeDraggable?pn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?pn(document,"pointermove",this._handleFallbackAutoScroll):s.touches?pn(document,"touchmove",this._handleFallbackAutoScroll):pn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var s=n.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?an(document,"dragover",this._handleAutoScroll):(an(document,"pointermove",this._handleFallbackAutoScroll),an(document,"touchmove",this._handleFallbackAutoScroll),an(document,"mousemove",this._handleFallbackAutoScroll)),Ck(),Wm(),$Z()},nulling:function(){Um=cS=rf=dS=af=hS=fS=null,us.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,s){var o=this,i=(n.touches?n.touches[0]:n).clientX,r=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(i,r);if(Um=n,s||this.options.forceAutoScrollFallback||Xh||Jr||Jh){pS(n,this.options,a,s);var l=Va(a,!0);dS&&(!af||i!==hS||r!==fS)&&(af&&Ck(),af=setInterval(function(){var u=Va(document.elementFromPoint(i,r),!0);u!==l&&(l=u,Wm()),pS(n,o.options,u,s)},10),hS=i,fS=r)}else{if(!this.options.bubbleScroll||Va(a,!0)===ar()){Wm();return}pS(n,this.options,Va(a,!1),!1)}}},Zr(e,{pluginName:"scroll",initializeByDefault:!0})}function Wm(){us.forEach(function(e){clearInterval(e.pid)}),us=[]}function Ck(){clearInterval(af)}var pS=uk(function(e,t,n,s){if(t.scroll){var o=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,r=t.scrollSensitivity,a=t.scrollSpeed,l=ar(),u=!1,c;cS!==n&&(cS=n,Wm(),rf=t.scroll,c=t.scrollFn,rf===!0&&(rf=Va(n,!0)));var d=0,h=rf;do{var f=h,p=ys(f),g=p.top,v=p.bottom,C=p.left,b=p.right,S=p.width,y=p.height,R=void 0,E=void 0,F=f.scrollWidth,k=f.scrollHeight,O=Mt(f),I=f.scrollLeft,D=f.scrollTop;f===l?(R=S<F&&(O.overflowX==="auto"||O.overflowX==="scroll"||O.overflowX==="visible"),E=y<k&&(O.overflowY==="auto"||O.overflowY==="scroll"||O.overflowY==="visible")):(R=S<F&&(O.overflowX==="auto"||O.overflowX==="scroll"),E=y<k&&(O.overflowY==="auto"||O.overflowY==="scroll"));var T=R&&(Math.abs(b-o)<=r&&I+S<F)-(Math.abs(C-o)<=r&&!!I),A=E&&(Math.abs(v-i)<=r&&D+y<k)-(Math.abs(g-i)<=r&&!!D);if(!us[d])for(var Y=0;Y<=d;Y++)us[Y]||(us[Y]={});(us[d].vx!=T||us[d].vy!=A||us[d].el!==f)&&(us[d].el=f,us[d].vx=T,us[d].vy=A,clearInterval(us[d].pid),(T!=0||A!=0)&&(u=!0,us[d].pid=setInterval((function(){s&&this.layer===0&&Nt.active._onTouchMove(Um);var Z=us[this.layer].vy?us[this.layer].vy*a:0,te=us[this.layer].vx?us[this.layer].vx*a:0;typeof c=="function"&&c.call(Nt.dragged.parentNode[Fo],te,Z,e,Um,us[this.layer].el)!=="continue"||ck(us[this.layer].el,te,Z)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=Va(h,!1)));dS=u}},30),bk=function(t){var n=t.originalEvent,s=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var u=s||i;a();var c=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(c.clientX,c.clientY);l(),u&&!u.el.contains(d)&&(r("spill"),this.onSpill({dragEl:o,putSortable:s}))}};function gS(){}gS.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,s=t.putSortable;this.sortable.captureAnimationState(),s&&s.captureAnimationState();var o=Ic(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(n,o):this.sortable.el.appendChild(n),this.sortable.animateAll(),s&&s.animateAll()},drop:bk},Zr(gS,{pluginName:"revertOnSpill"});function mS(){}mS.prototype={onSpill:function(t){var n=t.dragEl,s=t.putSortable,o=s||this.sortable;o.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),o.animateAll()},drop:bk},Zr(mS,{pluginName:"removeOnSpill"}),Nt.mount(new oX),Nt.mount(mS,gS);function iX(e,t){return Object.values(e).indexOf(t)}function rX(e,t,n,s){if(!e)return[];const o=Object.values(e),i=t.length-s;return[...t].map((a,l)=>l>=i?o.length:o.indexOf(a))}function aX(e){return["transition-group","TransitionGroup"].includes(e)}function Sk(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?aX(t.name):!1}function lX(e,t){return t?{...t.props,...t.attrs}:e}const vS=["Start","Add","Remove","Update","End"],yS=["Choose","Unchoose","Sort","Filter","Clone"],uX=["Move",...vS,...yS].map(e=>"on"+e);let wS=null;const cX=dt({name:"VueDraggableNext",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},emits:["update:modelValue","move","change",...vS.map(e=>e.toLowerCase()),...yS.map(e=>e.toLowerCase())],setup(e,{emit:t,slots:n,attrs:s}){const o=L(!1),i=L(!1),r=L(0),a=L(0),l=L([]),u=L(null),c=L(null),d=K(()=>e.list?e.list:e.modelValue),h=Cs();function f(){return e.component?lH(e.component):e.tag}function p(V){if(c.value)for(const se in V){const ue=QA(se);uX.indexOf(ue)===-1&&c.value.option(ue,V[se])}}function g(){var V;return((V=h==null?void 0:h.proxy)==null?void 0:V.$el.children)||[]}async function v(){var V;await Dt(),l.value=rX(g(),((V=h==null?void 0:h.proxy)==null?void 0:V.$el.children)||[],o.value,a.value)}function C(V){const se=iX(g()||[],V);if(se===-1)return null;const ue=d.value?d.value[se]:null;return{index:se,element:ue}}function b(V){Dt(()=>t("change",V))}function S(V){if(e.list){V(e.list);return}const se=[...e.modelValue||[]];V(se),t("update:modelValue",se)}function y(...V){S(ue=>ue.splice(...V))}function R(V,se){S(Ue=>Ue.splice(se,0,Ue.splice(V,1)[0]))}function E(V){const se=l.value,ue=se.length;return V>ue-1?ue:se[V]}function F(){var se,ue;return n.default&&((ue=(se=n.default()[0])==null?void 0:se.component)==null?void 0:ue.proxy)||null}function k(V){if(!e.noTransitionOnDrag||!o.value)return;const se=g();se[V]&&(se[V].data=null);const ue=F();ue&&(ue.children=[],ue.kept=void 0)}function O(V){v(),u.value=C(V.item),u.value&&(V.item._underlying_vm_=e.clone(u.value.element),wS=V.item)}function I(V){const se=V.item._underlying_vm_;if(se===void 0)return;eS(V.item);const ue=E(V.newIndex);y(ue,0,se),v(),b({added:{element:se,newIndex:ue}})}function D(V){var ue;if(ek((ue=h==null?void 0:h.proxy)==null?void 0:ue.$el,V.item,V.oldIndex),V.pullMode==="clone"){eS(V.clone);return}if(!u.value)return;const se=u.value.index;y(se,1),k(se),b({removed:{element:u.value.element,oldIndex:se}})}function T(V){var Ue,de;eS(V.item),ek(V.from,V.item,V.oldIndex);const se=(Ue=u.value)==null?void 0:Ue.index,ue=E(V.newIndex);R(se,ue),b({moved:{element:(de=u.value)==null?void 0:de.element,oldIndex:se,newIndex:ue}})}function A(V,se){Object.prototype.hasOwnProperty.call(V,se)&&(V[se]+=r.value)}function Y(V){return V.__draggable_component__}function Z({to:V,related:se}){const ue=Y(V);if(!ue)return{component:ue};const Ue=ue.realList,de={list:Ue,component:ue};if(V!==se&&Ue&&ue.getUnderlyingVm){const _e=ue.getUnderlyingVm(se);if(_e)return Object.assign(_e,de)}return de}function te(V,se){const ue=[...se.to.children].filter(X=>X.style.display!=="none");if(ue.length===0)return 0;const Ue=ue.indexOf(se.related),de=V.component.getVmIndex(Ue);return ue.indexOf(wS)!==-1||!se.willInsertAfter?de:de+1}const ie=()=>{var de,_e;const V={};vS.forEach(X=>{V["on"+X]=G(X)}),yS.forEach(X=>{V["on"+X]=ee.bind(null,X)});const se=Object.keys(s).reduce((X,Ee)=>(X[QA(Ee)]=s[Ee],X),{}),ue=Object.assign({},se,V,{onMove:(X,Ee)=>le(X,Ee)});"draggable"in ue||(ue.draggable=">*");const Ue=((de=h==null?void 0:h.proxy)==null?void 0:de.$el.nodeType)===1?h.proxy.$el:((_e=h==null?void 0:h.proxy)==null?void 0:_e.$el.parentElement)||null;Ue&&(c.value=new Nt(Ue,ue),Ue.__draggable_component__=h==null?void 0:h.proxy,v())};function ee(V,se){Dt(()=>t(V.toLowerCase(),se))}function G(V){return se=>{if(d.value!==null){const ue="onDrag"+V,Ue=J[ue];Ue&&Ue(se)}ee(V,se)}}function le(V,se){const ue=e.move;if(!ue||!d.value)return!0;const Ue=Z(V),de=u.value,_e=te(Ue,V);de&&Object.assign(de,{futureIndex:_e});const X=Object.assign({},V,{relatedContext:Ue,draggedContext:de});return ue(X,se)}function H(){v(),wS=null}const J={onDragStart:O,onDragAdd:I,onDragRemove:D,onDragUpdate:T,onDragMove:le,onDragEnd:H};return Qt(()=>{ie()}),e.list!==null&&e.modelValue!==null&&IZ.error("list props are mutually exclusive! Please set one."),{getTag:f,realList:d,visibleIndexes:l,noneFunctionalComponentMode:i,headerOffset:r,footerOffset:a,transitionMode:o,computeIndexes:v,updateOptions:p,getChildrenNodes:g,getUnderlyingVm:C,emitChanges:b,alterList:S,spliceList:y,updatePosition:R,getVmIndex:E,getComponent:F,resetTransitionData:k,onDragStart:O,onDragAdd:I,onDragRemove:D,onDragUpdate:T,updateProperty:A,onDragMove:le,onDragEnd:H,mounted:ie,context:u,sortableInstance:c,getRelatedContextFromMoveEvent:Z,getTargetedComponent:Y,computeFutureIndex:te}},render(){const e=this.getTag(),t=lX(this.$attrs,this.componentData);if(typeof e=="string"){const s=this.$slots.default&&typeof this.$slots.default=="function"?this.$slots.default():null;return s?(this.transitionMode=Sk(s),Lu(e,t,s)):Lu(e,t,[])}const n=this.$slots.default?{default:this.$slots.default}:{};if(this.$slots.default){const s=typeof this.$slots.default=="function"?this.$slots.default():null;this.transitionMode=Sk(s||[])}return Lu(e,t,n)}}),dX=_t(dt({__name:"DragDropList",props:{modelValue:{},groupName:{},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["changed","update:modelValue"],setup(e,{emit:t}){const n=L([]),s=e,o=t,i=L({}),r=()=>{n.value=s.modelValue.map(u=>({id:u.field,name:u.headerName,...u}))||[],s.modelValue.forEach(u=>{i.value[u.field]={...u}})};tt(()=>s.modelValue,u=>{r()},{immediate:!0,deep:!0}),tt(n,u=>{if(u.length===s.modelValue.length&&!u.every((d,h)=>d.id===s.modelValue[h].field)){const d=u.map(h=>i.value[h.id]);o("changed",d),o("update:modelValue",d)}});const a=()=>!(s.readOnly||s.disabled),l=u=>!(s.readOnly||s.disabled);return(u,c)=>(z(),ze(U(cX),{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d),tag:"transition-group",disabled:s.disabled||s.readOnly,onMove:l,onStart:a,"item-key":"id","component-data":{tag:"div",type:"transition",name:"fade"},animation:300,easing:"cubic-bezier(0.4, 0, 0.2, 1)","ghost-class":"ghost","chosen-class":"chosen","drag-class":"drag"},{default:ye(()=>[(z(!0),ae(Ft,null,Ln(n.value,d=>(z(),ae("div",{key:d.id,class:"fade-item"},[xt(u.$slots,"item",{item:d},()=>[ot(bt(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-6f5d2b3c"]]),hX={key:0},fX={key:1,style:{"font-style":"italic"}},pX={key:2,style:{"font-style":"italic"}},gX={key:3},zm=_t(dt({__name:"DragDropItem",props:{item:{},isDisableNewCheck:{type:Boolean,default:!1},disableDrag:{type:Boolean,default:!1},disableCheckbox:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},columnStates:{},disableDragTooltip:{default:""}},emits:["toggle-column"],setup(e,{emit:t}){const n=qt,s=e;L(!1);const o=L(s.columnStates[String(s.item.field)]||!1),i=t,r=h=>{o.value=h},a=K(()=>{var h;return(h=s.item)==null?void 0:h.context}),l=K(()=>{var f,p;return a.value.formula?"formular":((p=(f=a.value)==null?void 0:f.metric_type)==null?void 0:p.code)||"number"}),u=K(()=>{var h,f;return(f=(h=s.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),c=K(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=K(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return tt(()=>o.value,()=>{i("toggle-column",s.item.field,s.item.required)}),(h,f)=>(z(),ae("div",{key:e.item.field,class:q([h.$style["column-config__item"],{[h.$style.disabled]:s.readOnly,[h.$style["is-metric"]]:u.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:c.value}])},[ce(VA,{id:`col-${e.item.field}`,"model-value":o.value==!0?U($t).CHECKED:U($t).UNCHECK,"onUpdate:modelValue":r,disabled:s.disableCheckbox||e.isDisableNewCheck&&!o.value,size:"16px"},null,8,["id","model-value","disabled"]),qe((z(),ae("div",{class:"move-handler",style:on({cursor:s.disableDrag?"not-allowed":"move"})},[ce(lt,{color:s.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:q(h.$style.handler)},null,8,["color","class"])],4)),[[U(n),s.disableDrag==!0?s.disableDragTooltip:""]]),u.value?(z(),ae("div",{key:0,class:q(h.$style["metric-type"])},[l.value=="rating"?(z(),ae("span",hX,"★")):l.value=="formular"?(z(),ae("span",fX," ƒx ")):l.value=="number"?(z(),ae("span",pX," # ")):(z(),ae("span",gX,bt(l.value),1))],2)):Ze("",!0),pe("span",{class:q(h.$style["column-config__item-label"])},[qe((z(),ae("div",null,[ot(bt(e.item.headerName),1)])),[[U(n),{content:e.item.headerName}]])],2),d.value?qe((z(),ae("div",{key:1,class:q(h.$style["metric-icon"])},[ce(lt,{src:"Bullseye",color:"#A6A6A6"})],2)),[[U(n),"Point metric"]]):Ze("",!0),c.value?qe((z(),ae("div",{key:2,class:q(h.$style["metric-icon"])},[ce(lt,{src:"ChartPie",color:"#A6A6A6"})],2)),[[U(n),"Woohoo metric"]]):Ze("",!0)],2))}}),[["__cssModules",{$style:{"column-config__item":"_column-config__item_1qb26_1","is-metric":"_is-metric_1qb26_8","is-woohoo-metric":"_is-woohoo-metric_1qb26_12","is-point-metric":"_is-point-metric_1qb26_15","column-config__item-label":"_column-config__item-label_1qb26_18",disabled:"_disabled_1qb26_34",readOnly:"_readOnly_1qb26_38","column-config__item--pinned":"_column-config__item--pinned_1qb26_41",handler:"_handler_1qb26_48",badge:"_badge_1qb26_52","metric-type":"_metric-type_1qb26_78","metric-icon":"_metric-icon_1qb26_106"}}]]),mX={class:"reach-limit-icon"},vX=_t(dt({__name:"TableCustomization",props:{modelValue:{},readOnly:{type:Boolean},disabled:{type:Boolean},checkboxColumn:{},gridApi:{},tableHeight:{}},emits:["update:modelValue","input","change"],setup(e,{expose:t,emit:n}){const s=qt,o=e,i=n,r=L(""),a=L(),l=K(()=>r.value.trim().length>0),u=L([]),c=L({}),{triggerRef:d,popupRef:h,isVisible:f}=Jn({placement:"bottom-end",trigger:"click",offset:[0,0]});tt(f,T=>{var A;T&&((A=a.value)==null||A.focus())});const p=K(()=>o.disabled||r.value.length>0),g=K(()=>u.value.filter(T=>T.pinned==="left"&&T.field&&T.headerName)),v=K(()=>u.value.filter(T=>T.pinned==="right"&&T.field||T.field==="blank")),C=K({get:()=>u.value.filter(T=>!T.pinned&&T.field&&T.field!=="blank"),set:T=>{u.value=[...g.value,...T,...v.value]}}),b=K(()=>{if(!r.value)return{};const T=r.value.toLowerCase();return[...u.value,...C.value].reduce((A,Y)=>{var Z;return(Z=Y.headerName)!=null&&Z.toLowerCase().includes(T)&&Y.field&&(A[Y.field]=!0),A},{})}),S=K(()=>o.modelValue),y=()=>{const T={};u.value.forEach(A=>{A.field&&(T[A.field]=!A.hide)}),c.value=T},R=K(()=>{if(!r.value)return u.value;const T=r.value.toLowerCase();return u.value.filter(A=>{var Y;return(Y=A.headerName)==null?void 0:Y.toLowerCase().includes(T)})}),E=()=>{var Y;const T=(Y=o.gridApi)==null?void 0:Y.getColumnState().reduce((Z,te)=>(Z[te.colId]=Number(te.width),Z),{}),A=u.value.map(Z=>({...Z,hide:Z.field?!c.value[Z.field]:!1,width:Z.field?T==null?void 0:T[Z.field]:Z.width}));i("update:modelValue",A),i("change",A),i("input",A)},F=T=>{const A=[...g.value,...T,...v.value];o.checkboxColumn&&A.unshift(o.checkboxColumn),u.value=A,E()},k=T=>{T&&(c.value[T]=!c.value[T],E())};tt(S,T=>{T&&T.length>0&&(u.value=[...T],y())},{immediate:!0}),t({updateColumnDefs(T){u.value=[...T],y()}});const O=K(()=>D.value>=5),I=K(()=>o.disabled||r.value.length>0),D=K(()=>u.value.reduce((T,A)=>A.field&&A.field.includes("metric")&&c.value[A.field]===!0?T+1:T,0));return(T,A)=>(z(),ae("div",{class:q(T.$style["table-customization"])},[pe("div",{ref_key:"triggerRef",ref:d},[xt(T.$slots,"trigger",{},()=>[qe((z(),ze(mt,{"data-tab-index":7,variant:["secondary"],disabled:o.disabled,actived:U(f),style:{width:"32px"}},{prefix:ye(()=>[ce(lt,{src:"TableColumns"})]),_:1},8,["disabled","actived"])),[[U(s),"Columns"]])])],512),pe("div",{ref_key:"popupRef",ref:h,class:q(T.$style["tippy-content-wrapper"])},[pe("div",{class:q([T.$style["column-config"],O.value?T.$style["has-warning"]:""]),style:on({"--max-height":o.tableHeight?o.tableHeight:"max(500px, 60vh)"})},[ce(jb,{modelValue:r.value,"onUpdate:modelValue":A[0]||(A[0]=Y=>r.value=Y),ref_key:"searchBoxRef",ref:a},null,8,["modelValue"]),pe("div",{class:q(T.$style["column-config__header"])},[...A[2]||(A[2]=[pe("span",null,"Manage columns",-1)])],2),O.value?(z(),ae("div",{key:0,class:q(T.$style["reach-limit"])},[pe("div",mX,[ce(lt,{src:"InfoCircle",color:"#F7941D",size:14})]),pe("div",{class:q(T.$style["warning-limit-text"])},[...A[3]||(A[3]=[ot(" You’ve reached the maximum number of metric columns. ",-1),pe("br",null,null,-1),ot(" Deselect one to show another. ",-1)])],2)],2)):Ze("",!0),l.value?(z(),ae(Ft,{key:1},[R.value.length===0&&l.value?(z(),ae("div",{key:0,class:q(T.$style["no-columns"])},[...A[4]||(A[4]=[ot(" No results. ",-1),pe("br",null,null,-1),ot(" Try another search. ",-1)])],2)):Ze("",!0),l.value&&R.value.length>0?(z(),ae("div",{key:1,class:q(T.$style["column-config__pinned-section"])},[(z(!0),ae(Ft,null,Ln(R.value,Y=>{var Z;return z(),ze(zm,{key:Y.colId,item:Y,columnStates:c.value,disableDrag:I.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:o.readOnly,isDisableNewCheck:O.value&&((Z=Y.colId)==null?void 0:Z.includes("metric")),onToggleColumn:k},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Ze("",!0)],64)):Ze("",!0),l.value?Ze("",!0):(z(),ae("div",{key:2,class:q(T.$style["column-config__list"])},[(z(!0),ae(Ft,null,Ln(g.value,Y=>qe((z(),ze(zm,{key:Y.field,item:Y,disabled:!0,readOnly:!0,disableDrag:!0,disableDragTooltip:" ","disable-checkbox":!0,columnStates:c.value},null,8,["item","columnStates"])),[[Yi,b.value[Y.field]||!r.value]])),128)),ce(dX,{modelValue:C.value,"onUpdate:modelValue":A[1]||(A[1]=Y=>C.value=Y),"group-name":"columns",onChanged:F,disabled:p.value,readOnly:o.readOnly},{item:ye(({item:Y})=>[qe((z(),ze(zm,{key:Y.id,item:Y,columnStates:c.value,disableDrag:I.value,disableDragTooltip:I.value?"Reordering is disabled while search is active.":void 0,readOnly:o.readOnly,isDisableNewCheck:O.value&&Y.id.includes("metric"),onToggleColumn:k},null,8,["item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[Yi,b.value[Y.field]||!r.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(z(!0),ae(Ft,null,Ln(v.value.filter(Y=>{var Z;return Y.headerName&&((Z=Y.headerName)==null?void 0:Z.length)>0}),Y=>qe((z(),ze(zm,{key:Y.field,item:Y,disabled:o.disabled,readOnly:o.readOnly,columnStates:c.value},null,8,["item","disabled","readOnly","columnStates"])),[[Yi,b.value[Y.field]||!r.value]])),128))],2))],6)],2)],2))}}),[["__cssModules",{$style:{"reach-limit":"_reach-limit_1m3bt_1","reach-limit-icon":"_reach-limit-icon_1m3bt_11","warning-limit-text":"_warning-limit-text_1m3bt_18","table-customization":"_table-customization_1m3bt_24","table-customization__trigger":"_table-customization__trigger_1m3bt_30","column-config":"_column-config_1m3bt_46","has-warning":"_has-warning_1m3bt_61","column-config__header":"_column-config__header_1m3bt_64","icon-color":"_icon-color_1m3bt_73","column-config__list":"_column-config__list_1m3bt_76","column-config__section-label":"_column-config__section-label_1m3bt_80","column-config__footer":"_column-config__footer_1m3bt_89","column-config__add-button":"_column-config__add-button_1m3bt_92","cs-icon":"_cs-icon_1m3bt_110","no-columns":"_no-columns_1m3bt_114"}}]]),yX={class:"wrapper-suffix"},wX=_t(dt({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{type:Function},workspaceId:{},id:{}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const s=qt,o={PER_PAGE:20,INITIAL_PAGE:1},i=e,r=L(i.modelValue),a=n,l=K(()=>f.value.find(D=>D.id===r.value)||null),u=D=>{r.value=D.id,a("update:modelValue",D.id)},c=K(()=>{if(!r.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const D=f.value.find(A=>A.id===r.value),T=String((D==null?void 0:D.color)||"white");return{backgroundColor:T,border:vh(T,"white")?"1px solid #ccc":"1px solid #fff"}}),d=L(null),h=()=>{var D;(D=d.value)==null||D.focus()},f=L([]),p=L(!1),g=L(!1),v=L(null),C=L(o.INITIAL_PAGE),b=L(!0),S=L(0),y=L(""),R=K(()=>!!(i.id&&i.workspaceId)),E=D=>{const T=f.value.find(A=>A.id===D.value);T&&u(T)},F=D=>({label:D.name,value:D.id,selected:r.value===D.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:D,id:D.id,color:D.color}),k=async(D=o.INITIAL_PAGE,T="",A=!1)=>{var Y;if(!R.value){console.error("Missing required props",i);return}A?g.value=!0:p.value=!0,v.value=null;try{const Z={workspaceId:String(i.workspaceId),itemIds:i.id,page:D,perPage:o.PER_PAGE,name_like:T.trim()};if(i.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const te=await i.getStatusFunc(Z);if(!te){A||(f.value=[]),b.value=!1;return}const ie=te.data.map(F);f.value=A?[...f.value,...ie]:ie,S.value=((Y=te.meta)==null?void 0:Y.total)??te.data.length,b.value=f.value.length<S.value,C.value=D}catch(Z){console.error("Error fetching statuses:",Z),v.value="Failed to load statuses",A||(f.value=[]),b.value=!1,a("error",v.value)}finally{p.value=!1,g.value=!1}},O=async()=>{!b.value||g.value||await k(C.value+1,y.value,!0)};tt([()=>i.id,()=>i.workspaceId],()=>{k()},{deep:!0,immediate:!0});const I=async D=>{y.value=D,C.value=o.INITIAL_PAGE,await k(o.INITIAL_PAGE,D,!1)};return t({focus:h,clear:()=>{r.value=null,a("update:modelValue",null)}}),(D,T)=>(z(),ze(AA,{onOpen:h,placement:"bottom-start","max-width":500},{trigger:ye(({open:A})=>[ce(ms,{actived:A,class:q(D.$style["status-wrapper"])},{suffix:ye(()=>[pe("div",yX,[ce(lt,{src:"ChevronUp",source:"remote",class:q([[D.$style["dropdown-icon"]],{[D.$style["dropdown-icon-show"]]:!A}])},null,8,["class"])])]),default:ye(()=>{var Y;return[pe("div",{class:q(D.$style.status)},[pe("div",{class:q(D.$style["color-indicator"]),style:on(c.value)},null,6),qe((z(),ae("span",{style:{"max-width":"400px"},class:q({[D.$style.empty]:!l.value})},[ot(bt(l.value?l.value.label:"Select status"),1)],2)),[[U(s),{content:((Y=l.value)==null?void 0:Y.label)||void 0}]])],2)]}),_:2},1032,["actived","class"])]),content:ye(({closeDropdown:A})=>{var Y;return[ce(Yr,{ref_key:"popupRef",ref:d,"selected-id":(Y=l.value)==null?void 0:Y.id,options:f.value,loading:p.value,"loading-more":g.value,"has-more":b.value,error:v.value,onSearch:I,onSelect:Z=>{E(Z),A()},onLoadMore:O,onCancel:T[0]||(T[0]=Z=>a("cancel")),style:{width:"500px"}},null,8,["selected-id","options","loading","loading-more","has-more","error","onSelect"])]}),_:1}))}}),[["__cssModules",{$style:{"status-wrapper":"_status-wrapper_1hlgx_1",status:"_status_1hlgx_1","color-indicator":"_color-indicator_1hlgx_12",empty:"_empty_1hlgx_21","dropdown-icon":"_dropdown-icon_1hlgx_25","dropdown-icon-show":"_dropdown-icon-show_1hlgx_30",options:"_options_1hlgx_34"}}]]),Ek=e=>({updateCellData:({rowId:n,field:s,value:o})=>{if(!e)return;const i=e.getRowNode(n);i&&i.setDataValue(s,o),e.refreshCells({rowNodes:i?[i]:[],columns:[s],force:!0})}}),CX={key:2},bX=_t(dt({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){var b;const n=e,s=L(n.value),o=L(!0),i=L(""),r=()=>{var I,D,T;const S=(I=c.value)==null?void 0:I.restricted_type.trim(),y=((T=(D=c.value)==null?void 0:D.restricted_value)==null?void 0:T.split(",").map(Number))||[],[R,E]=y,k={range:`Enter a value between ${R} and ${E}`,not:`These values are not allowed: ${y.join(", ")}`,exact:"Value is not allowed"}[S];return o.value?"":k},a=S=>{if(c.value){if(S===null||S===""){o.value=!0;return}if(u.value!=="number"){o.value=!0;return}o.value=Qg(c.value,Number(S)),i.value=r()}};K(()=>o.value?{content:"",showOnCreate:!1}:{content:i.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=L(null),u=K(()=>vx(c.value)),c=K(()=>{var y,R;return((R=(y=n.params)==null?void 0:y.colDef)==null?void 0:R.context)||null}),{apiServices:d}=Xn(!0,n),{updateCellData:h}=Ek((b=n.params)==null?void 0:b.api),f=L(!1),p=gi(n,"id"),g=()=>{var S;(S=n.params)==null||S.api.stopEditing()},v=()=>{g()},C=async S=>{var R,E;if(g(),f.value=!0,s.value=S||null,S===n.value){f.value=!1;return}const y={itemIds:[String(p.value)],metricId:((R=c.value)==null?void 0:R.id)||"",workspaceId:String(n.workspaceId)};S==null?y.clear=1:y.value=S,h({rowId:String(p.value),field:`metric_${y.metricId}`,value:void 0});try{const F=await((E=d.value)==null?void 0:E.bulkUpdateMetric(y));(F==null?void 0:F.message)=="Done"?h({rowId:String(p.value),field:`metric_${y.metricId}`,value:S||null}):(h({rowId:String(p.value),field:`metric_${y.metricId}`,value:n.value}),console.error("Failed to update metric value:",F),s.value=n.value)}catch(F){console.error("Error during bulk metric update:",F),h({rowId:String(p.value),field:`metric_${y.metricId}`,value:n.value})}finally{f.value=!1}};return(S,y)=>(z(),ae("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[u.value=="dropdown"&&c.value?(z(),ze(xA,{key:0,config:c.value,modelValue:s.value,"onUpdate:modelValue":y[0]||(y[0]=R=>s.value=R),onChange:C,onHandleCancel:v},null,8,["config","modelValue"])):u.value=="number"&&c.value?(z(),ze(PA,{key:1,showInlineError:!1,autoEmit:!0,config:c.value,modelValue:s.value,"onUpdate:modelValue":y[1]||(y[1]=R=>s.value=R),style:{width:"100%"},onHandleChange:C,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(z(),ae("div",CX,"Metric type:"+bt(u.value),1))],512))}}),[["__scopeId","data-v-de0dd7ce"]]),SX=_t(dt({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."},s=K(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate"),o=K(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),i=L(!1);return Qt(()=>{i.value=!0}),(r,a)=>(z(),ae("div",{class:q(r.$style["no-data-item-table"])},[pe("div",{class:q(r.$style.visual)},[i.value?(z(),ze(bm,{key:0,source:"remote",src:s.value,ratio:"4/3",maxWidth:500,maxHeight:350},null,8,["src"])):Ze("",!0)],2),pe("div",{class:q(r.$style.description)},bt(o.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),_k=Ul("sortStore",()=>{const e=L({}),t={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"due_date",status:"template_flow_status",assignees:"assignee"},n={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}},s=K(()=>{const a=e.value;return Object.values(a).filter(u=>u.sort!=="none"&&!!u.sort).map(u=>{let c;switch(u.colId){case"dateRange":c=n[u.sort];break;default:if(u.colId.includes("metric")){const[d,h]=u.colId.split("_");c={column:d,direction:u.sort,type:h}}else c={column:t[u.colId]||u.colId,direction:u.sort};break}return c})}),o=(a,l)=>{e.value={[a]:{colId:a,sort:l}}},i=()=>{e.value={}},r=L(!1);return{sortingAPIConfiguration:s,sorts:e,setSort:o,clearSorting:i,isSortingRunning:r}}),ql=dt({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=_k(),{sorts:s}=Bs(n),o=K(()=>{var l,u;return((u=(l=t.params)==null?void 0:l.column)==null?void 0:u.getColId())||"template_col_id"}),i=l=>{o.value&&n.setSort(o.value,l)},r=K(()=>t.params.headerType||void 0),a=L("none");return tt(()=>s.value,Ci(()=>{if(o.value){const l=s.value[o.value];a.value=l?l.sort:"none"}},nr),{deep:!0,immediate:!0}),(l,u)=>o.value?(z(),ze(ZY,Kt({key:0},t,{"header-type":r.value,modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=c=>a.value=c),onSortChanged:i}),null,16,["header-type","modelValue"])):Ze("",!0)}});function EX(){const e=No({isCreating:!1,name:"",error:void 0,assignees:null,status:null,start_date:null,due_date:null}),t=()=>{const o=e.name.trim();e.status,o.length===0?e.error="Name cannot be empty":o.length>25?e.error="Name cannot exceed 25 characters":e.error=void 0},n=()=>{e.isCreating=!0,e.name="",e.error=void 0,e.assignees=null,e.status=null,e.start_date=null,e.due_date=null},s=()=>{e.isCreating=!1};return tt(()=>e,()=>{t()},{deep:!0}),{newItemData:e,validateNewItem:t,openNewItemForm:n,closeNewItemForm:s,resetNewItemForm:()=>{e.name="",e.assignees=null,e.start_date=null,e.due_date=null,e.error=void 0}}}const jm=Ul("userStore",()=>{const e=L(null),t=L(null);return{user:e,setUser:o=>{e.value=o},setUserRoleId:o=>{t.value=o},workspaceUserRoleId:t}}),_X=["innerHTML"],RX=20,DX=_t(dt({__name:"AddNewAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const s=e,{triggerRef:o,popupRef:i,isVisible:r,show:a,hide:l}=Jn({appendTo:"parent",offset:[-15,8]}),u=()=>{a()},c=L(null),d=()=>{I.value=[],ue.value=!1},h=K(()=>r.value),f=K(()=>{var X;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((X=I.value)==null?void 0:X.length)===0,wrapperRef:o,active:h,bordered:!0}}),{argsMain:p}=gs(f),g=qt,v=n,C=K(()=>{var X;return Math.max(0,(((X=I.value)==null?void 0:X.length)||0)-s.maxVisible)}),b=K(()=>{var X;return C.value<=0?"":((X=I.value)==null?void 0:X.slice(s.maxVisible).map(Ee=>Ee.name).join(", "))||""}),S=L(!1),y=L(!1),R=L(null),E=L(1),F=L(!0),k=L(0),O=L(""),I=L([]),D=K(()=>{var X;return((X=I.value)==null?void 0:X.map(Ee=>Ee.id))||[]}),{assigneeList:T,mergedOptions:A}=om({...s,value:[]}),{apiServices:Y}=Xn(!1,s),Z=Sn("entityId"),te=async(X=1,Ee="",Pe=!1)=>{var W,ne,we,Le,Ae;if(!Y.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(Pe?y.value=!0:S.value=!0,R.value=null,!((W=Y.value)!=null&&W.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const $e=yn.getInstance().getItem("ws.code");try{const P=await((ne=Y.value)==null?void 0:ne.getAssignableAssignees(String($e),{entity_ids:(Z==null?void 0:Z.value)||"",page:X,per_page:RX,display_name_like:Ee})),M=((we=cc(P.data))==null?void 0:we.map(sm))??[];T.value=Pe?Zu(T.value,M,"id"):M,k.value=P.meta.total,F.value=(((Le=P==null?void 0:P.meta)==null?void 0:Le.current_page)||0)<(((Ae=P==null?void 0:P.meta)==null?void 0:Ae.last_page)||0),E.value=X}catch(P){console.error("Error fetching assignable users:",P),R.value="Failed to load assignable users"}finally{S.value=!1,y.value=!1}},ie=X=>{var Ee,Pe,$e;if((Ee=I.value)!=null&&Ee.some(W=>W.id===X.data.id)){I.value=(Pe=I.value)==null?void 0:Pe.filter(W=>W.id!==X.data.id);return}I.value=[...I.value||[],X.data],($e=c.value)==null||$e.focus()},ee=()=>{I.value=[]},G=()=>{!y.value&&F.value&&te(E.value+1,O.value,!0)},le=Ci(async X=>{O.value=X,await te(1,X,!1)},nr);tt(()=>r.value,X=>{var Ee;X?(te(1,O.value,!1),(Ee=c.value)==null||Ee.focus(),v("show")):v("hide")});const H=K(()=>{var X;return((X=I.value)==null?void 0:X.slice(0,3))||[]}),J=K(()=>H.value.map(X=>({id:X.id,name:X.name,initial:X.initial,avatarId:X.id,profile_image:X.profile_image,color:X.color,size:24,user:X}))),V=jm(),{user:se}=Bs(V),ue=L(!1);t({getData:()=>I.value,clear:d,setData:X=>{I.value=X},focus:()=>{a(),Dt(()=>{var X;(X=c.value)==null||X.focus()})},hide:()=>{l()}}),tt([I,ue],()=>{v("updated",I.value)},{deep:!0});const Ue=X=>{var Ee;I.value=(Ee=I.value)==null?void 0:Ee.filter(Pe=>Pe.id!==X)},de=X=>{var Pe;const Ee=yn.getInstance().getItem("ws.code");return((Pe=Y.value)==null?void 0:Pe.getUserInformation(Ee,X))||Promise.resolve(null)},_e=L();return(X,Ee)=>(z(),ae("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:_e},[ce(ms,Kt(U(p),{style:{"--icon-size":"18px"}}),{prefix:ye(()=>[J.value.length==0?(z(),ae("div",{key:0,class:q([X.$style["icon-wrapper"],"wrapper-prefix"]),onClick:Pt(u,["stop","prevent"])},[ce(lt,{src:"UserPlus",color:"#A6A6A6"})],2)):Ze("",!0)]),default:ye(()=>[pe("div",{class:q([X.$style["assignee-row"],X.$style["assignee-selector"]]),ref_key:"triggerRef",ref:o},[pe("div",{style:{flex:1},class:q([X.$style["assignee-row"]])},[(z(!0),ae(Ft,null,Ln(J.value,Pe=>(z(),ze(_m,{onClear:$e=>Ue(Pe.id),key:Pe.user.id,"disable-remove":!1},{default:ye(()=>[ce(Wl,{user:Pe.user,apiUpdateFunction:de,appendTo:_e.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),C.value>0?qe((z(),ae("div",{key:0,class:q(X.$style["extra-avatars"])},[ot(" +"+bt(C.value),1)],2)),[[U(g),b.value]]):Ze("",!0)],2)],2)]),_:1},16),pe("div",{ref_key:"popupRef",ref:i},[ce(Yr,Kt({"selected-id":D.value},{...s},{options:U(A),loading:S.value,"loading-more":y.value,"has-more":F.value,ref_key:"searchListRef",ref:c,onTab:Ee[0]||(Ee[0]=Pe=>v("tab",Pe)),onSelect:Ee[1]||(Ee[1]=Pe=>{ie(Pe),v("start-update")}),onSearch:U(le),onClose:Ee[2]||(Ee[2]=()=>v("close")),onLoadMore:G}),{"extra-item":ye(()=>[ce(mt,{variant:"menu-item",onHandleClick:ee},{prefix:ye(()=>[pe("div",{class:q(X.$style["unassign-icon"])},[ce(lt,{src:"UserXMark",source:"remote"})],2)]),default:ye(()=>[Ee[3]||(Ee[3]=ot(" Unassign all ",-1))]),_:1})]),item:ye(({item:Pe,selectedIndex:$e,isSelected:W,handleSelect:ne,handleItemHover:we,getHighlightedLabel:Le,query:Ae,idx:P})=>[ce(qr,Kt(Pe,{hover:P===$e,selected:W(Pe),type:Pe.type,onClick:Pt(M=>ne(Pe,M),["stop","prevent"]),onMouseover:M=>we(P),class:X.$style["item-assignee"]}),{prefix:ye(()=>[ce(Wl,{user:Pe.data,apiUpdateFunction:de,appendTo:U(i)},null,8,["user","appendTo"])]),label:ye(({})=>[Ae?qe((z(),ae("span",{key:0,class:q([X.$style["item-label"],X.$style.match]),style:{flex:"1"},innerHTML:Le(Pe.label)},null,10,_X)),[[U(g),{content:Pe.label}]]):qe((z(),ae("span",{key:1,class:q(X.$style["item-label"]),style:{flex:"1"}},[ot(bt(Pe.label),1)],2)),[[U(g),{content:Pe.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],512))}}),[["__cssModules",{$style:{action:"_action_q5jol_1","item-assignee":"_item-assignee_q5jol_6","item-action":"_item-action_q5jol_6","item-label":"_item-label_q5jol_16","unassign-icon":"_unassign-icon_q5jol_25","icon-wrapper":"_icon-wrapper_q5jol_37","error-message":"_error-message_q5jol_46","empty-state":"_empty-state_q5jol_56","assignee-row":"_assignee-row_q5jol_69","assignee-selector":"_assignee-selector_q5jol_77",seperator:"_seperator_q5jol_81","extra-avatars":"_extra-avatars_q5jol_89",list:"_list_q5jol_101"}}]]),TX={key:0},FX={key:1},IX={key:0},xX={key:1},PX={key:0,class:"wrapper-suffix"},AX={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},kX=_t(dt({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const s=qt,{triggerRef:o,popupRef:i,isVisible:r,hide:a,show:l}=Jn({appendTo:"parent",offset:[0,0]}),u=()=>{c.value=[null,null]},c=L([null,null]),d=y=>{const R=Jg();return y?pt.fromJSDate(y,{zone:R}).toFormat("MMM dd"):""},h=K(()=>r.value),f=K(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value[0]===null&&c.value[1]===null,wrapperRef:o,active:h,bordered:!0})),{argsMain:p}=gs(f),g=L(!1),v=y=>{b("tab",y)},C=y=>{"start"in y&&y.start!==void 0&&(c.value[0]=y.start),"end"in y&&y.end!==void 0&&(c.value[1]=y.end)};t({getData:()=>c.value,clear:u,setData:y=>{c.value=y},focus:()=>{l(),Dt(()=>{var y;(y=S.value)==null||y.focus()})},hide:()=>{a()}});const b=n;tt(()=>c.value,y=>{b("updated",y)},{deep:!0});const S=L(null);return tt(()=>r.value,y=>{y?(Dt(()=>{var R;(R=S.value)==null||R.focus()}),b("show")):b("hide")}),(y,R)=>(z(),ae(Ft,null,[ce(ms,Kt({ref_key:"triggerRef",ref:o},U(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:ye(({focused:E})=>[pe("div",{class:q(y.$style["date-time"])},[pe("div",{class:q(y.$style.date)},[c.value[0]==null&&(E||U(r))?(z(),ae("span",TX,"MMMDD")):(z(),ae("span",FX,bt(d(c.value[0])),1))],2),c.value[0]!==null||c.value[1]!==null||E||U(r)?(z(),ae("div",{key:0,class:q(y.$style.separator)}," → ",2)):Ze("",!0),pe("div",{class:q(y.$style.date)},[c.value[1]==null&&(E||U(r))?(z(),ae("span",IX,"MMMDD")):(z(),ae("span",xX,bt(d(c.value[1])),1))],2)],2)]),suffix:ye(({hovered:E,focused:F})=>[(c.value[0]!==null||c.value[1]!==null)&&(E||F||U(r))?(z(),ae("div",PX,[qe((z(),ze(mt,{onClick:Pt(u,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[ce(lt,{src:"XMarkSolid",size:"8"})]),_:1})),[[U(s),"Clear"]])])):Ze("",!0)]),prefix:ye(()=>[c.value[0]===null&&c.value[1]===null?(z(),ae("div",AX,[ce(lt,{src:"Calendar",color:"#A6A6A6"})])):Ze("",!0)]),_:1},16),pe("div",{ref_key:"popupRef",ref:i},[U(r)?(z(),ze(Sm,{key:0,immediatelyUpdate:!1,value:c.value,onConfirmed:C,ref_key:"calendarRef",ref:S,onClosed:U(a),onStartUpdate:R[0]||(R[0]=E=>g.value=!0),onFinishUpdate:R[1]||(R[1]=E=>g.value=!1),onTab:v},null,8,["value","onClosed"])):Ze("",!0)],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_n9o5g_2","date-time":"_date-time_n9o5g_5",date:"_date_n9o5g_5",separator:"_separator_n9o5g_18"}}]]),OX=_t(dt({__name:"AddNewStatus",props:{entityId:{}},emits:["updated","error","cancel","update:modelValue","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const s=e,o={PER_PAGE:20,INITIAL_PAGE:1},{triggerRef:i,popupRef:r,isVisible:a,show:l,hide:u}=Jn({appendTo:"parent"}),c=L(null),d=L([]),h=L(!1),f=L(!1),p=L(null),g=L(o.INITIAL_PAGE),v=L(!0),C=L(0),b=L(""),S=n,y=K(()=>a.value),R=K(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!c.value,wrapperRef:i,active:y,bordered:!0})),E=L(null),{argsMain:F}=gs(R),k=K(()=>c.value?d.value.filter(H=>H.id===c.value):[]),O=K(()=>!c.value||k.value.length===0?"":k.value[0].label),I=K(()=>c.value?[c.value]:[]),D=K(()=>{if(!c.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const H=k.value[0],J=String((H==null?void 0:H.color)||"white");return{backgroundColor:J,border:vh(J,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),T=H=>({label:H.name,value:H.id,selected:c.value===H.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:H,id:H.id,color:H.color}),{apiServices:A}=Xn(!1,s),Y=async(H=o.INITIAL_PAGE,J="",V=!1)=>{var se,ue;V?f.value=!0:h.value=!0,p.value=null;try{const Ue=yn.getInstance().getItem("ws.code"),de=await((se=A.value)==null?void 0:se.getAssignableStatuses(Ue,{entity_id:s.entityId||"",name_like:J,page:H,per_page:o.PER_PAGE}));if(!de){V||(d.value=[]),v.value=!1;return}const _e=de.data.map(T);d.value=V?[...d.value,..._e]:_e,C.value=((ue=de.meta)==null?void 0:ue.total)??de.data.length,v.value=d.value.length<C.value,g.value=H}catch(Ue){console.error("Error fetching statuses:",Ue),p.value="Failed to load statuses",V||(d.value=[]),v.value=!1,S("error",p.value)}finally{h.value=!1,f.value=!1}},Z=(H,J)=>{var se;J.stopImmediatePropagation(),J.preventDefault(),J.stopPropagation();const V=H.id;c.value=V,(se=E.value)==null||se.focus(),S("update:modelValue",c.value),u()},te=async()=>{!v.value||f.value||await Y(g.value+1,b.value,!0)},ie=async H=>{b.value=H,g.value=o.INITIAL_PAGE,await Y(o.INITIAL_PAGE,H,!1)},ee=()=>{c.value=null,S("update:modelValue",null)},G=()=>{l(),Dt(()=>{var H;(H=E.value)==null||H.focus()})};return tt(()=>a.value,H=>{var J;H?(Y(1,b.value,!1),(J=E.value)==null||J.focus(),S("show")):S("hide")}),tt(()=>c.value,H=>{S("updated",H)}),t({focus:G,clear:ee,getData:()=>c.value,setData:H=>{c.value=H},hide:u,autoFillDefault:async()=>{b.value="",await Y(1,b.value,!1),d.value.length>0&&(c.value=d.value[0].id,S("update:modelValue",c.value))}}),(H,J)=>{const V=zd("tooltip");return z(),ae(Ft,null,[ce(ms,Kt({ref_key:"triggerRef",ref:i},U(F),{style:{"--icon-size":"18px"}}),{default:ye(()=>[pe("div",{class:q(H.$style.status)},[pe("div",{class:q(H.$style["color-indicator"]),style:on(D.value)},null,6),qe((z(),ae("span",{class:q({[H.$style.empty]:k.value.length===0,[H.$style["status-text"]]:!0})},[ot(bt(O.value),1)],2)),[[V,{content:O.value}]])],2)]),_:1},16),pe("div",{ref_key:"popupRef",ref:r},[ce(Yr,{style:{width:"200px"},ref_key:"searchListRef",ref:E,"selected-id":I.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:ie,onSelect:Z,onLoadMore:te,onCancel:J[0]||(J[0]=se=>S("cancel")),onTab:J[1]||(J[1]=se=>S("tab",se)),onClose:J[2]||(J[2]=()=>S("close"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_1gv28_2",status:"_status_1gv28_6","color-indicator":"_color-indicator_1gv28_12","count-badge":"_count-badge_1gv28_25","status-text":"_status-text_1gv28_32",empty:"_empty_1gv28_41"}}],["__scopeId","data-v-cb0f9265"]]),MX=_t(dt({__name:"CreateNewScene",emits:["create-new-item","focus-on-id","search-for-code"],setup(e,{expose:t,emit:n}){const s=["name","assignees","status","date","cancel","create-keep","create"],o=qt,i=Q$("target"),r=Sn("workspaceId"),a=Sn("entityId"),l=n,u=e,{newItemData:c,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=EX(),{apiServices:p}=Xn(!1,u),{openSceneHub:g}=zh(),v=L(!1),C=L(null),b=L({assignees:!1,status:!1,date:!1}),S={name:L(null),assignees:L(null),status:L(null),date:L(null),cancel:L(null),"create-keep":L(null),create:L(null)},y=S.name,R=S.assignees,E=S.status,F=S.date,k=S.cancel,O=S["create-keep"],I=S.create,D=L(new Map),T=K(()=>!!c.error||!c.name.trim()),A=(P,M)=>{P&&D.value.set(M,P.$el||P)},Y=(P,M)=>{if(P==="date"){const[j,fe]=Array.isArray(M)?M:[void 0,void 0];c.start_date=j,c.due_date=fe}else c[P]=M},Z=()=>{c.isCreating=!0,C.value="name"},te=()=>{c.isCreating=!1,h()},ie=Sn("switchInstance"),{addNotification:ee}=Zh(),G=P=>{l("focus-on-id",P)},le=(P,M,j)=>{const fe=XK(void 0,"created");ee({id:String(P),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${fe}</b>
|
|
148
|
+
*/function tk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,s)}return n}function ir(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tk(Object(n),!0).forEach(function(s){AZ(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tk(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function xm(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xm=function(t){return typeof t}:xm=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xm(e)}function AZ(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zr(){return Zr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Zr.apply(this,arguments)}function kZ(e,t){if(e==null)return{};var n={},s=Object.keys(e),o,i;for(i=0;i<s.length;i++)o=s[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function OZ(e,t){if(e==null)return{};var n=kZ(e,t),s,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)s=i[o],!(t.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}var MZ="1.14.0";function Xr(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Jr=Xr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Xh=Xr(/Edge/i),nk=Xr(/firefox/i),Jh=Xr(/safari/i)&&!Xr(/chrome/i)&&!Xr(/android/i),sk=Xr(/iP(ad|od|hone)/i),NZ=Xr(/chrome/i)&&Xr(/android/i),ok={capture:!1,passive:!1};function pn(e,t,n){e.addEventListener(t,n,!Jr&&ok)}function an(e,t,n){e.removeEventListener(t,n,!Jr&&ok)}function Pm(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function LZ(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function rr(e,t,n,s){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&Pm(e,t):Pm(e,t))||s&&e===n)return e;if(e===n)break}while(e=LZ(e))}return null}var ik=/\s+/g;function To(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var s=(" "+e.className+" ").replace(ik," ").replace(" "+t+" "," ");e.className=(s+(n?" "+t:"")).replace(ik," ")}}function Mt(e,t,n){var s=e&&e.style;if(s){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in s)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),s[t]=n+(typeof n=="string"?"":"px")}}function Fc(e,t){var n="";if(typeof e=="string")n=e;else do{var s=Mt(e,"transform");s&&s!=="none"&&(n=s+" "+n)}while(!t&&(e=e.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(n)}function rk(e,t,n){if(e){var s=e.getElementsByTagName(t),o=0,i=s.length;if(n)for(;o<i;o++)n(s[o],o);return s}return[]}function ar(){var e=document.scrollingElement;return e||document.documentElement}function ys(e,t,n,s,o){if(!(!e.getBoundingClientRect&&e!==window)){var i,r,a,l,u,c,d;if(e!==window&&e.parentNode&&e!==ar()?(i=e.getBoundingClientRect(),r=i.top,a=i.left,l=i.bottom,u=i.right,c=i.height,d=i.width):(r=0,a=0,l=window.innerHeight,u=window.innerWidth,c=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(o=o||e.parentNode,!Jr))do if(o&&o.getBoundingClientRect&&(Mt(o,"transform")!=="none"||n&&Mt(o,"position")!=="static")){var h=o.getBoundingClientRect();r-=h.top+parseInt(Mt(o,"border-top-width")),a-=h.left+parseInt(Mt(o,"border-left-width")),l=r+i.height,u=a+i.width;break}while(o=o.parentNode);if(s&&e!==window){var f=Fc(o||e),p=f&&f.a,g=f&&f.d;f&&(r/=g,a/=p,d/=p,c/=g,l=r+c,u=a+d)}return{top:r,left:a,bottom:l,right:u,width:d,height:c}}}function ak(e,t,n){for(var s=Va(e,!0),o=ys(e)[t];s;){var i=ys(s)[n],r=void 0;if(r=o>=i,!r)return s;if(s===ar())break;s=Va(s,!1)}return!1}function Ic(e,t,n,s){for(var o=0,i=0,r=e.children;i<r.length;){if(r[i].style.display!=="none"&&r[i]!==Nt.ghost&&(s||r[i]!==Nt.dragged)&&rr(r[i],n.draggable,e,!1)){if(o===t)return r[i];o++}i++}return null}function tS(e,t){for(var n=e.lastElementChild;n&&(n===Nt.ghost||Mt(n,"display")==="none"||t&&!Pm(n,t));)n=n.previousElementSibling;return n||null}function Zo(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!=="TEMPLATE"&&e!==Nt.clone&&(!t||Pm(e,t))&&n++;return n}function lk(e){var t=0,n=0,s=ar();if(e)do{var o=Fc(e),i=o.a,r=o.d;t+=e.scrollLeft*i,n+=e.scrollTop*r}while(e!==s&&(e=e.parentNode));return[t,n]}function VZ(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var s in t)if(t.hasOwnProperty(s)&&t[s]===e[n][s])return Number(n)}return-1}function Va(e,t){if(!e||!e.getBoundingClientRect)return ar();var n=e,s=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var o=Mt(n);if(n.clientWidth<n.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return ar();if(s||t)return n;s=!0}}while(n=n.parentNode);return ar()}function BZ(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function nS(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var Qh;function uk(e,t){return function(){if(!Qh){var n=arguments,s=this;n.length===1?e.call(s,n[0]):e.apply(s,n),Qh=setTimeout(function(){Qh=void 0},t)}}}function $Z(){clearTimeout(Qh),Qh=void 0}function ck(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function dk(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}var Fo="Sortable"+new Date().getTime();function HZ(){var e=[],t;return{captureAnimationState:function(){if(e=[],!!this.options.animation){var s=[].slice.call(this.el.children);s.forEach(function(o){if(!(Mt(o,"display")==="none"||o===Nt.ghost)){e.push({target:o,rect:ys(o)});var i=ir({},e[e.length-1].rect);if(o.thisAnimationDuration){var r=Fc(o,!0);r&&(i.top-=r.f,i.left-=r.e)}o.fromRect=i}})}},addAnimationState:function(s){e.push(s)},removeAnimationState:function(s){e.splice(VZ(e,{target:s}),1)},animateAll:function(s){var o=this;if(!this.options.animation){clearTimeout(t),typeof s=="function"&&s();return}var i=!1,r=0;e.forEach(function(a){var l=0,u=a.target,c=u.fromRect,d=ys(u),h=u.prevFromRect,f=u.prevToRect,p=a.rect,g=Fc(u,!0);g&&(d.top-=g.f,d.left-=g.e),u.toRect=d,u.thisAnimationDuration&&nS(h,d)&&!nS(c,d)&&(p.top-d.top)/(p.left-d.left)===(c.top-d.top)/(c.left-d.left)&&(l=UZ(p,h,f,o.options)),nS(d,c)||(u.prevFromRect=c,u.prevToRect=d,l||(l=o.options.animation),o.animate(u,p,d,l)),l&&(i=!0,r=Math.max(r,l),clearTimeout(u.animationResetTimer),u.animationResetTimer=setTimeout(function(){u.animationTime=0,u.prevFromRect=null,u.fromRect=null,u.prevToRect=null,u.thisAnimationDuration=null},l),u.thisAnimationDuration=l)}),clearTimeout(t),i?t=setTimeout(function(){typeof s=="function"&&s()},r):typeof s=="function"&&s(),e=[]},animate:function(s,o,i,r){if(r){Mt(s,"transition",""),Mt(s,"transform","");var a=Fc(this.el),l=a&&a.a,u=a&&a.d,c=(o.left-i.left)/(l||1),d=(o.top-i.top)/(u||1);s.animatingX=!!c,s.animatingY=!!d,Mt(s,"transform","translate3d("+c+"px,"+d+"px,0)"),this.forRepaintDummy=GZ(s),Mt(s,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),Mt(s,"transform","translate3d(0,0,0)"),typeof s.animated=="number"&&clearTimeout(s.animated),s.animated=setTimeout(function(){Mt(s,"transition",""),Mt(s,"transform",""),s.animated=!1,s.animatingX=!1,s.animatingY=!1},r)}}}}function GZ(e){return e.offsetWidth}function UZ(e,t,n,s){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*s.animation}var xc=[],sS={initializeByDefault:!0},ef={mount:function(t){for(var n in sS)sS.hasOwnProperty(n)&&!(n in t)&&(t[n]=sS[n]);xc.forEach(function(s){if(s.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")}),xc.push(t)},pluginEvent:function(t,n,s){var o=this;this.eventCanceled=!1,s.cancel=function(){o.eventCanceled=!0};var i=t+"Global";xc.forEach(function(r){n[r.pluginName]&&(n[r.pluginName][i]&&n[r.pluginName][i](ir({sortable:n},s)),n.options[r.pluginName]&&n[r.pluginName][t]&&n[r.pluginName][t](ir({sortable:n},s)))})},initializePlugins:function(t,n,s,o){xc.forEach(function(a){var l=a.pluginName;if(!(!t.options[l]&&!a.initializeByDefault)){var u=new a(t,n,t.options);u.sortable=t,u.options=t.options,t[l]=u,Zr(s,u.defaults)}});for(var i in t.options)if(t.options.hasOwnProperty(i)){var r=this.modifyOption(t,i,t.options[i]);typeof r<"u"&&(t.options[i]=r)}},getEventProperties:function(t,n){var s={};return xc.forEach(function(o){typeof o.eventProperties=="function"&&Zr(s,o.eventProperties.call(n[o.pluginName],t))}),s},modifyOption:function(t,n,s){var o;return xc.forEach(function(i){t[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[n]=="function"&&(o=i.optionListeners[n].call(t[i.pluginName],s))}),o}};function WZ(e){var t=e.sortable,n=e.rootEl,s=e.name,o=e.targetEl,i=e.cloneEl,r=e.toEl,a=e.fromEl,l=e.oldIndex,u=e.newIndex,c=e.oldDraggableIndex,d=e.newDraggableIndex,h=e.originalEvent,f=e.putSortable,p=e.extraEventProperties;if(t=t||n&&n[Fo],!!t){var g,v=t.options,C="on"+s.charAt(0).toUpperCase()+s.substr(1);window.CustomEvent&&!Jr&&!Xh?g=new CustomEvent(s,{bubbles:!0,cancelable:!0}):(g=document.createEvent("Event"),g.initEvent(s,!0,!0)),g.to=r||n,g.from=a||n,g.item=o||n,g.clone=i,g.oldIndex=l,g.newIndex=u,g.oldDraggableIndex=c,g.newDraggableIndex=d,g.originalEvent=h,g.pullMode=f?f.lastPutMode:void 0;var b=ir(ir({},p),ef.getEventProperties(s,t));for(var S in b)g[S]=b[S];n&&n.dispatchEvent(g),v[C]&&v[C].call(t,g)}}var zZ=["evt"],ao=function(t,n){var s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=s.evt,i=OZ(s,zZ);ef.pluginEvent.bind(Nt)(t,n,ir({dragEl:ht,parentEl:Kn,ghostEl:Wt,rootEl:Vn,nextEl:zl,lastDownEl:Am,cloneEl:qn,cloneHidden:Ba,dragStarted:nf,putSortable:Fs,activeSortable:Nt.active,originalEvent:o,oldIndex:Pc,oldDraggableIndex:tf,newIndex:Io,newDraggableIndex:$a,hideGhostForTarget:yk,unhideGhostForTarget:wk,cloneNowHidden:function(){Ba=!0},cloneNowShown:function(){Ba=!1},dispatchSortableEvent:function(a){Js({sortable:n,name:a,originalEvent:o})}},i))};function Js(e){WZ(ir({putSortable:Fs,cloneEl:qn,targetEl:ht,rootEl:Vn,oldIndex:Pc,oldDraggableIndex:tf,newIndex:Io,newDraggableIndex:$a},e))}var ht,Kn,Wt,Vn,zl,Am,qn,Ba,Pc,Io,tf,$a,km,Fs,Ac=!1,Om=!1,Mm=[],jl,Di,oS,iS,hk,fk,nf,kc,sf,of=!1,Nm=!1,Lm,$s,rS=[],aS=!1,Vm=[],Bm=typeof document<"u",$m=sk,pk=Xh||Jr?"cssFloat":"float",jZ=Bm&&!NZ&&!sk&&"draggable"in document.createElement("div"),gk=function(){if(Bm){if(Jr)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),mk=function(t,n){var s=Mt(t),o=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),i=Ic(t,0,n),r=Ic(t,1,n),a=i&&Mt(i),l=r&&Mt(r),u=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+ys(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+ys(r).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return r&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return i&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||u>=o&&s[pk]==="none"||r&&s[pk]==="none"&&u+c>o)?"vertical":"horizontal"},KZ=function(t,n,s){var o=s?t.left:t.top,i=s?t.right:t.bottom,r=s?t.width:t.height,a=s?n.left:n.top,l=s?n.right:n.bottom,u=s?n.width:n.height;return o===a||i===l||o+r/2===a+u/2},qZ=function(t,n){var s;return Mm.some(function(o){var i=o[Fo].options.emptyInsertThreshold;if(!(!i||tS(o))){var r=ys(o),a=t>=r.left-i&&t<=r.right+i,l=n>=r.top-i&&n<=r.bottom+i;if(a&&l)return s=o}}),s},vk=function(t){function n(i,r){return function(a,l,u,c){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(i==null&&(r||d))return!0;if(i==null||i===!1)return!1;if(r&&i==="clone")return i;if(typeof i=="function")return n(i(a,l,u,c),r)(a,l,u,c);var h=(r?a:l).options.group.name;return i===!0||typeof i=="string"&&i===h||i.join&&i.indexOf(h)>-1}}var s={},o=t.group;(!o||xm(o)!="object")&&(o={name:o}),s.name=o.name,s.checkPull=n(o.pull,!0),s.checkPut=n(o.put),s.revertClone=o.revertClone,t.group=s},yk=function(){!gk&&Wt&&Mt(Wt,"display","none")},wk=function(){!gk&&Wt&&Mt(Wt,"display","")};Bm&&document.addEventListener("click",function(e){if(Om)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Om=!1,!1},!0);var Kl=function(t){if(ht){t=t.touches?t.touches[0]:t;var n=qZ(t.clientX,t.clientY);if(n){var s={};for(var o in t)t.hasOwnProperty(o)&&(s[o]=t[o]);s.target=s.rootEl=n,s.preventDefault=void 0,s.stopPropagation=void 0,n[Fo]._onDragOver(s)}}},YZ=function(t){ht&&ht.parentNode[Fo]._isOutsideThisEl(t.target)};function Nt(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=Zr({},t),e[Fo]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return mk(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(r,a){r.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Nt.supportPointer!==!1&&"PointerEvent"in window&&!Jh,emptyInsertThreshold:5};ef.initializePlugins(this,e,n);for(var s in n)!(s in t)&&(t[s]=n[s]);vk(t);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=t.forceFallback?!1:jZ,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?pn(e,"pointerdown",this._onTapStart):(pn(e,"mousedown",this._onTapStart),pn(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(pn(e,"dragover",this),pn(e,"dragenter",this)),Mm.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Zr(this,HZ())}Nt.prototype={constructor:Nt,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(kc=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,ht):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,s=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,u=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(sX(s),!ht&&!(/mousedown|pointerdown/.test(r)&&t.button!==0||o.disabled)&&!u.isContentEditable&&!(!this.nativeDraggable&&Jh&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=rr(l,o.draggable,s,!1),!(l&&l.animated)&&Am!==l)){if(Pc=Zo(l),tf=Zo(l,o.draggable),typeof c=="function"){if(c.call(this,t,l,this)){Js({sortable:n,rootEl:u,name:"filter",targetEl:l,toEl:s,fromEl:s}),ao("filter",n,{evt:t}),i&&t.cancelable&&t.preventDefault();return}}else if(c&&(c=c.split(",").some(function(d){if(d=rr(u,d.trim(),s,!1),d)return Js({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:s,toEl:s}),ao("filter",n,{evt:t}),!0}),c)){i&&t.cancelable&&t.preventDefault();return}o.handle&&!rr(u,o.handle,s,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,s){var o=this,i=o.el,r=o.options,a=i.ownerDocument,l;if(s&&!ht&&s.parentNode===i){var u=ys(s);if(Vn=i,ht=s,Kn=ht.parentNode,zl=ht.nextSibling,Am=s,km=r.group,Nt.dragged=ht,jl={target:ht,clientX:(n||t).clientX,clientY:(n||t).clientY},hk=jl.clientX-u.left,fk=jl.clientY-u.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,ht.style["will-change"]="all",l=function(){if(ao("delayEnded",o,{evt:t}),Nt.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!nk&&o.nativeDraggable&&(ht.draggable=!0),o._triggerDragStart(t,n),Js({sortable:o,name:"choose",originalEvent:t}),To(ht,r.chosenClass,!0)},r.ignore.split(",").forEach(function(c){rk(ht,c.trim(),lS)}),pn(a,"dragover",Kl),pn(a,"mousemove",Kl),pn(a,"touchmove",Kl),pn(a,"mouseup",o._onDrop),pn(a,"touchend",o._onDrop),pn(a,"touchcancel",o._onDrop),nk&&this.nativeDraggable&&(this.options.touchStartThreshold=4,ht.draggable=!0),ao("delayStart",this,{evt:t}),r.delay&&(!r.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(Xh||Jr))){if(Nt.eventCanceled){this._onDrop();return}pn(a,"mouseup",o._disableDelayedDrag),pn(a,"touchend",o._disableDelayedDrag),pn(a,"touchcancel",o._disableDelayedDrag),pn(a,"mousemove",o._delayedDragTouchMoveHandler),pn(a,"touchmove",o._delayedDragTouchMoveHandler),r.supportPointer&&pn(a,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(l,r.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){ht&&lS(ht),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;an(t,"mouseup",this._disableDelayedDrag),an(t,"touchend",this._disableDelayedDrag),an(t,"touchcancel",this._disableDelayedDrag),an(t,"mousemove",this._delayedDragTouchMoveHandler),an(t,"touchmove",this._delayedDragTouchMoveHandler),an(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?pn(document,"pointermove",this._onTouchMove):n?pn(document,"touchmove",this._onTouchMove):pn(document,"mousemove",this._onTouchMove):(pn(ht,"dragend",this),pn(Vn,"dragstart",this._onDragStart));try{document.selection?Gm(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Ac=!1,Vn&&ht){ao("dragStarted",this,{evt:n}),this.nativeDraggable&&pn(document,"dragover",YZ);var s=this.options;!t&&To(ht,s.dragClass,!1),To(ht,s.ghostClass,!0),Nt.active=this,t&&this._appendGhost(),Js({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Di){this._lastX=Di.clientX,this._lastY=Di.clientY,yk();for(var t=document.elementFromPoint(Di.clientX,Di.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(Di.clientX,Di.clientY),t!==n);)n=t;if(ht.parentNode[Fo]._isOutsideThisEl(t),n)do{if(n[Fo]){var s=void 0;if(s=n[Fo]._onDragOver({clientX:Di.clientX,clientY:Di.clientY,target:t,rootEl:n}),s&&!this.options.dragoverBubble)break}t=n}while(n=n.parentNode);wk()}},_onTouchMove:function(t){if(jl){var n=this.options,s=n.fallbackTolerance,o=n.fallbackOffset,i=t.touches?t.touches[0]:t,r=Wt&&Fc(Wt,!0),a=Wt&&r&&r.a,l=Wt&&r&&r.d,u=$m&&$s&&lk($s),c=(i.clientX-jl.clientX+o.x)/(a||1)+(u?u[0]-rS[0]:0)/(a||1),d=(i.clientY-jl.clientY+o.y)/(l||1)+(u?u[1]-rS[1]:0)/(l||1);if(!Nt.active&&!Ac){if(s&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<s)return;this._onDragStart(t,!0)}if(Wt){r?(r.e+=c-(oS||0),r.f+=d-(iS||0)):r={a:1,b:0,c:0,d:1,e:c,f:d};var h="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");Mt(Wt,"webkitTransform",h),Mt(Wt,"mozTransform",h),Mt(Wt,"msTransform",h),Mt(Wt,"transform",h),oS=c,iS=d,Di=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!Wt){var t=this.options.fallbackOnBody?document.body:Vn,n=ys(ht,!0,$m,!0,t),s=this.options;if($m){for($s=t;Mt($s,"position")==="static"&&Mt($s,"transform")==="none"&&$s!==document;)$s=$s.parentNode;$s!==document.body&&$s!==document.documentElement?($s===document&&($s=ar()),n.top+=$s.scrollTop,n.left+=$s.scrollLeft):$s=ar(),rS=lk($s)}Wt=ht.cloneNode(!0),To(Wt,s.ghostClass,!1),To(Wt,s.fallbackClass,!0),To(Wt,s.dragClass,!0),Mt(Wt,"transition",""),Mt(Wt,"transform",""),Mt(Wt,"box-sizing","border-box"),Mt(Wt,"margin",0),Mt(Wt,"top",n.top),Mt(Wt,"left",n.left),Mt(Wt,"width",n.width),Mt(Wt,"height",n.height),Mt(Wt,"opacity","0.8"),Mt(Wt,"position",$m?"absolute":"fixed"),Mt(Wt,"zIndex","100000"),Mt(Wt,"pointerEvents","none"),Nt.ghost=Wt,t.appendChild(Wt),Mt(Wt,"transform-origin",hk/parseInt(Wt.style.width)*100+"% "+fk/parseInt(Wt.style.height)*100+"%")}},_onDragStart:function(t,n){var s=this,o=t.dataTransfer,i=s.options;if(ao("dragStart",this,{evt:t}),Nt.eventCanceled){this._onDrop();return}ao("setupClone",this),Nt.eventCanceled||(qn=dk(ht),qn.draggable=!1,qn.style["will-change"]="",this._hideClone(),To(qn,this.options.chosenClass,!1),Nt.clone=qn),s.cloneId=Gm(function(){ao("clone",s),!Nt.eventCanceled&&(s.options.removeCloneOnHide||Vn.insertBefore(qn,ht),s._hideClone(),Js({sortable:s,name:"clone"}))}),!n&&To(ht,i.dragClass,!0),n?(Om=!0,s._loopId=setInterval(s._emulateDragOver,50)):(an(document,"mouseup",s._onDrop),an(document,"touchend",s._onDrop),an(document,"touchcancel",s._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(s,o,ht)),pn(document,"drop",s),Mt(ht,"transform","translateZ(0)")),Ac=!0,s._dragStartId=Gm(s._dragStarted.bind(s,n,t)),pn(document,"selectstart",s),nf=!0,Jh&&Mt(document.body,"user-select","none")},_onDragOver:function(t){var n=this.el,s=t.target,o,i,r,a=this.options,l=a.group,u=Nt.active,c=km===l,d=a.sort,h=Fs||u,f,p=this,g=!1;if(aS)return;function v(ee,G){ao(ee,p,ir({evt:t,isOwner:c,axis:f?"vertical":"horizontal",revert:r,dragRect:o,targetRect:i,canSort:d,fromSortable:h,target:s,completed:b,onMove:function(H,J){return Hm(Vn,n,ht,o,H,ys(H),t,J)},changed:S},G))}function C(){v("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function b(ee){return v("dragOverCompleted",{insertion:ee}),ee&&(c?u._hideClone():u._showClone(p),p!==h&&(To(ht,Fs?Fs.options.ghostClass:u.options.ghostClass,!1),To(ht,a.ghostClass,!0)),Fs!==p&&p!==Nt.active?Fs=p:p===Nt.active&&Fs&&(Fs=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll(function(){v("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===ht&&!ht.animated||s===n&&!s.animated)&&(kc=null),!a.dragoverBubble&&!t.rootEl&&s!==document&&(ht.parentNode[Fo]._isOutsideThisEl(t.target),!ee&&Kl(t)),!a.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function S(){Io=Zo(ht),$a=Zo(ht,a.draggable),Js({sortable:p,name:"change",toEl:n,newIndex:Io,newDraggableIndex:$a,originalEvent:t})}if(t.preventDefault!==void 0&&t.cancelable&&t.preventDefault(),s=rr(s,a.draggable,n,!0),v("dragOver"),Nt.eventCanceled)return g;if(ht.contains(t.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return b(!1);if(Om=!1,u&&!a.disabled&&(c?d||(r=Kn!==Vn):Fs===this||(this.lastPutMode=km.checkPull(this,u,ht,t))&&l.checkPut(this,u,ht,t))){if(f=this._getDirection(t,s)==="vertical",o=ys(ht),v("dragOverValid"),Nt.eventCanceled)return g;if(r)return Kn=Vn,C(),this._hideClone(),v("revert"),Nt.eventCanceled||(zl?Vn.insertBefore(ht,zl):Vn.appendChild(ht)),b(!0);var y=tS(n,a.draggable);if(!y||QZ(t,f,this)&&!y.animated){if(y===ht)return b(!1);if(y&&n===t.target&&(s=y),s&&(i=ys(s)),Hm(Vn,n,ht,o,s,i,t,!!s)!==!1)return C(),n.appendChild(ht),Kn=n,S(),b(!0)}else if(y&&JZ(t,f,this)){var R=Ic(n,0,a,!0);if(R===ht)return b(!1);if(s=R,i=ys(s),Hm(Vn,n,ht,o,s,i,t,!1)!==!1)return C(),n.insertBefore(ht,R),Kn=n,S(),b(!0)}else if(s.parentNode===n){i=ys(s);var E=0,F,k=ht.parentNode!==n,O=!KZ(ht.animated&&ht.toRect||o,s.animated&&s.toRect||i,f),I=f?"top":"left",D=ak(s,"top","top")||ak(ht,"top","top"),T=D?D.scrollTop:void 0;kc!==s&&(F=i[I],of=!1,Nm=!O&&a.invertSwap||k),E=eX(t,s,i,f,O?1:a.swapThreshold,a.invertedSwapThreshold==null?a.swapThreshold:a.invertedSwapThreshold,Nm,kc===s);var A;if(E!==0){var Y=Zo(ht);do Y-=E,A=Kn.children[Y];while(A&&(Mt(A,"display")==="none"||A===Wt))}if(E===0||A===s)return b(!1);kc=s,sf=E;var Z=s.nextElementSibling,te=!1;te=E===1;var ie=Hm(Vn,n,ht,o,s,i,t,te);if(ie!==!1)return(ie===1||ie===-1)&&(te=ie===1),aS=!0,setTimeout(XZ,30),C(),te&&!Z?n.appendChild(ht):s.parentNode.insertBefore(ht,te?Z:s),D&&ck(D,0,T-D.scrollTop),Kn=ht.parentNode,F!==void 0&&!Nm&&(Lm=Math.abs(F-ys(s)[I])),S(),b(!0)}if(n.contains(ht))return b(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){an(document,"mousemove",this._onTouchMove),an(document,"touchmove",this._onTouchMove),an(document,"pointermove",this._onTouchMove),an(document,"dragover",Kl),an(document,"mousemove",Kl),an(document,"touchmove",Kl)},_offUpEvents:function(){var t=this.el.ownerDocument;an(t,"mouseup",this._onDrop),an(t,"touchend",this._onDrop),an(t,"pointerup",this._onDrop),an(t,"touchcancel",this._onDrop),an(document,"selectstart",this)},_onDrop:function(t){var n=this.el,s=this.options;if(Io=Zo(ht),$a=Zo(ht,s.draggable),ao("drop",this,{evt:t}),Kn=ht&&ht.parentNode,Io=Zo(ht),$a=Zo(ht,s.draggable),Nt.eventCanceled){this._nulling();return}Ac=!1,Nm=!1,of=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),uS(this.cloneId),uS(this._dragStartId),this.nativeDraggable&&(an(document,"drop",this),an(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),Jh&&Mt(document.body,"user-select",""),Mt(ht,"transform",""),t&&(nf&&(t.cancelable&&t.preventDefault(),!s.dropBubble&&t.stopPropagation()),Wt&&Wt.parentNode&&Wt.parentNode.removeChild(Wt),(Vn===Kn||Fs&&Fs.lastPutMode!=="clone")&&qn&&qn.parentNode&&qn.parentNode.removeChild(qn),ht&&(this.nativeDraggable&&an(ht,"dragend",this),lS(ht),ht.style["will-change"]="",nf&&!Ac&&To(ht,Fs?Fs.options.ghostClass:this.options.ghostClass,!1),To(ht,this.options.chosenClass,!1),Js({sortable:this,name:"unchoose",toEl:Kn,newIndex:null,newDraggableIndex:null,originalEvent:t}),Vn!==Kn?(Io>=0&&(Js({rootEl:Kn,name:"add",toEl:Kn,fromEl:Vn,originalEvent:t}),Js({sortable:this,name:"remove",toEl:Kn,originalEvent:t}),Js({rootEl:Kn,name:"sort",toEl:Kn,fromEl:Vn,originalEvent:t}),Js({sortable:this,name:"sort",toEl:Kn,originalEvent:t})),Fs&&Fs.save()):Io!==Pc&&Io>=0&&(Js({sortable:this,name:"update",toEl:Kn,originalEvent:t}),Js({sortable:this,name:"sort",toEl:Kn,originalEvent:t})),Nt.active&&((Io==null||Io===-1)&&(Io=Pc,$a=tf),Js({sortable:this,name:"end",toEl:Kn,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){ao("nulling",this),Vn=ht=Kn=Wt=zl=qn=Am=Ba=jl=Di=nf=Io=$a=Pc=tf=kc=sf=Fs=km=Nt.dragged=Nt.ghost=Nt.clone=Nt.active=null,Vm.forEach(function(t){t.checked=!0}),Vm.length=oS=iS=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":ht&&(this._onDragOver(t),ZZ(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,s=this.el.children,o=0,i=s.length,r=this.options;o<i;o++)n=s[o],rr(n,r.draggable,this.el,!1)&&t.push(n.getAttribute(r.dataIdAttr)||nX(n));return t},sort:function(t,n){var s={},o=this.el;this.toArray().forEach(function(i,r){var a=o.children[r];rr(a,this.options.draggable,o,!1)&&(s[i]=a)},this),n&&this.captureAnimationState(),t.forEach(function(i){s[i]&&(o.removeChild(s[i]),o.appendChild(s[i]))}),n&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,n){return rr(t,n||this.options.draggable,this.el,!1)},option:function(t,n){var s=this.options;if(n===void 0)return s[t];var o=ef.modifyOption(this,t,n);typeof o<"u"?s[t]=o:s[t]=n,t==="group"&&vk(s)},destroy:function(){ao("destroy",this);var t=this.el;t[Fo]=null,an(t,"mousedown",this._onTapStart),an(t,"touchstart",this._onTapStart),an(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(an(t,"dragover",this),an(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Mm.splice(Mm.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!Ba){if(ao("hideClone",this),Nt.eventCanceled)return;Mt(qn,"display","none"),this.options.removeCloneOnHide&&qn.parentNode&&qn.parentNode.removeChild(qn),Ba=!0}},_showClone:function(t){if(t.lastPutMode!=="clone"){this._hideClone();return}if(Ba){if(ao("showClone",this),Nt.eventCanceled)return;ht.parentNode==Vn&&!this.options.group.revertClone?Vn.insertBefore(qn,ht):zl?Vn.insertBefore(qn,zl):Vn.appendChild(qn),this.options.group.revertClone&&this.animate(ht,qn),Mt(qn,"display",""),Ba=!1}}};function ZZ(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}function Hm(e,t,n,s,o,i,r,a){var l,u=e[Fo],c=u.options.onMove,d;return window.CustomEvent&&!Jr&&!Xh?l=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(l=document.createEvent("Event"),l.initEvent("move",!0,!0)),l.to=t,l.from=e,l.dragged=n,l.draggedRect=s,l.related=o||t,l.relatedRect=i||ys(t),l.willInsertAfter=a,l.originalEvent=r,e.dispatchEvent(l),c&&(d=c.call(u,l,r)),d}function lS(e){e.draggable=!1}function XZ(){aS=!1}function JZ(e,t,n){var s=ys(Ic(n.el,0,n.options,!0)),o=10;return t?e.clientX<s.left-o||e.clientY<s.top&&e.clientX<s.right:e.clientY<s.top-o||e.clientY<s.bottom&&e.clientX<s.left}function QZ(e,t,n){var s=ys(tS(n.el,n.options.draggable)),o=10;return t?e.clientX>s.right+o||e.clientX<=s.right&&e.clientY>s.bottom&&e.clientX>=s.left:e.clientX>s.right&&e.clientY>s.top||e.clientX<=s.right&&e.clientY>s.bottom+o}function eX(e,t,n,s,o,i,r,a){var l=s?e.clientY:e.clientX,u=s?n.height:n.width,c=s?n.top:n.left,d=s?n.bottom:n.right,h=!1;if(!r){if(a&&Lm<u*o){if(!of&&(sf===1?l>c+u*i/2:l<d-u*i/2)&&(of=!0),of)h=!0;else if(sf===1?l<c+Lm:l>d-Lm)return-sf}else if(l>c+u*(1-o)/2&&l<d-u*(1-o)/2)return tX(t)}return h=h||r,h&&(l<c+u*i/2||l>d-u*i/2)?l>c+u/2?1:-1:0}function tX(e){return Zo(ht)<Zo(e)?1:-1}function nX(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,s=0;n--;)s+=t.charCodeAt(n);return s.toString(36)}function sX(e){Vm.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var s=t[n];s.checked&&Vm.push(s)}}function Gm(e){return setTimeout(e,0)}function uS(e){return clearTimeout(e)}Bm&&pn(document,"touchmove",function(e){(Nt.active||Ac)&&e.cancelable&&e.preventDefault()}),Nt.utils={on:pn,off:an,css:Mt,find:rk,is:function(t,n){return!!rr(t,n,t,!1)},extend:BZ,throttle:uk,closest:rr,toggleClass:To,clone:dk,index:Zo,nextTick:Gm,cancelNextTick:uS,detectDirection:mk,getChild:Ic},Nt.get=function(e){return e[Fo]},Nt.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(s){if(!s.prototype||!s.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(s));s.utils&&(Nt.utils=ir(ir({},Nt.utils),s.utils)),ef.mount(s)})},Nt.create=function(e,t){return new Nt(e,t)},Nt.version=MZ;var us=[],rf,cS,dS=!1,hS,fS,Um,af;function oX(){function e(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var t in this)t.charAt(0)==="_"&&typeof this[t]=="function"&&(this[t]=this[t].bind(this))}return e.prototype={dragStarted:function(n){var s=n.originalEvent;this.sortable.nativeDraggable?pn(document,"dragover",this._handleAutoScroll):this.options.supportPointer?pn(document,"pointermove",this._handleFallbackAutoScroll):s.touches?pn(document,"touchmove",this._handleFallbackAutoScroll):pn(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var s=n.originalEvent;!this.options.dragOverBubble&&!s.rootEl&&this._handleAutoScroll(s)},drop:function(){this.sortable.nativeDraggable?an(document,"dragover",this._handleAutoScroll):(an(document,"pointermove",this._handleFallbackAutoScroll),an(document,"touchmove",this._handleFallbackAutoScroll),an(document,"mousemove",this._handleFallbackAutoScroll)),Ck(),Wm(),$Z()},nulling:function(){Um=cS=rf=dS=af=hS=fS=null,us.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,s){var o=this,i=(n.touches?n.touches[0]:n).clientX,r=(n.touches?n.touches[0]:n).clientY,a=document.elementFromPoint(i,r);if(Um=n,s||this.options.forceAutoScrollFallback||Xh||Jr||Jh){pS(n,this.options,a,s);var l=Va(a,!0);dS&&(!af||i!==hS||r!==fS)&&(af&&Ck(),af=setInterval(function(){var u=Va(document.elementFromPoint(i,r),!0);u!==l&&(l=u,Wm()),pS(n,o.options,u,s)},10),hS=i,fS=r)}else{if(!this.options.bubbleScroll||Va(a,!0)===ar()){Wm();return}pS(n,this.options,Va(a,!1),!1)}}},Zr(e,{pluginName:"scroll",initializeByDefault:!0})}function Wm(){us.forEach(function(e){clearInterval(e.pid)}),us=[]}function Ck(){clearInterval(af)}var pS=uk(function(e,t,n,s){if(t.scroll){var o=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,r=t.scrollSensitivity,a=t.scrollSpeed,l=ar(),u=!1,c;cS!==n&&(cS=n,Wm(),rf=t.scroll,c=t.scrollFn,rf===!0&&(rf=Va(n,!0)));var d=0,h=rf;do{var f=h,p=ys(f),g=p.top,v=p.bottom,C=p.left,b=p.right,S=p.width,y=p.height,R=void 0,E=void 0,F=f.scrollWidth,k=f.scrollHeight,O=Mt(f),I=f.scrollLeft,D=f.scrollTop;f===l?(R=S<F&&(O.overflowX==="auto"||O.overflowX==="scroll"||O.overflowX==="visible"),E=y<k&&(O.overflowY==="auto"||O.overflowY==="scroll"||O.overflowY==="visible")):(R=S<F&&(O.overflowX==="auto"||O.overflowX==="scroll"),E=y<k&&(O.overflowY==="auto"||O.overflowY==="scroll"));var T=R&&(Math.abs(b-o)<=r&&I+S<F)-(Math.abs(C-o)<=r&&!!I),A=E&&(Math.abs(v-i)<=r&&D+y<k)-(Math.abs(g-i)<=r&&!!D);if(!us[d])for(var Y=0;Y<=d;Y++)us[Y]||(us[Y]={});(us[d].vx!=T||us[d].vy!=A||us[d].el!==f)&&(us[d].el=f,us[d].vx=T,us[d].vy=A,clearInterval(us[d].pid),(T!=0||A!=0)&&(u=!0,us[d].pid=setInterval((function(){s&&this.layer===0&&Nt.active._onTouchMove(Um);var Z=us[this.layer].vy?us[this.layer].vy*a:0,te=us[this.layer].vx?us[this.layer].vx*a:0;typeof c=="function"&&c.call(Nt.dragged.parentNode[Fo],te,Z,e,Um,us[this.layer].el)!=="continue"||ck(us[this.layer].el,te,Z)}).bind({layer:d}),24))),d++}while(t.bubbleScroll&&h!==l&&(h=Va(h,!1)));dS=u}},30),bk=function(t){var n=t.originalEvent,s=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(n){var u=s||i;a();var c=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,d=document.elementFromPoint(c.clientX,c.clientY);l(),u&&!u.el.contains(d)&&(r("spill"),this.onSpill({dragEl:o,putSortable:s}))}};function gS(){}gS.prototype={startIndex:null,dragStart:function(t){var n=t.oldDraggableIndex;this.startIndex=n},onSpill:function(t){var n=t.dragEl,s=t.putSortable;this.sortable.captureAnimationState(),s&&s.captureAnimationState();var o=Ic(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(n,o):this.sortable.el.appendChild(n),this.sortable.animateAll(),s&&s.animateAll()},drop:bk},Zr(gS,{pluginName:"revertOnSpill"});function mS(){}mS.prototype={onSpill:function(t){var n=t.dragEl,s=t.putSortable,o=s||this.sortable;o.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),o.animateAll()},drop:bk},Zr(mS,{pluginName:"removeOnSpill"}),Nt.mount(new oX),Nt.mount(mS,gS);function iX(e,t){return Object.values(e).indexOf(t)}function rX(e,t,n,s){if(!e)return[];const o=Object.values(e),i=t.length-s;return[...t].map((a,l)=>l>=i?o.length:o.indexOf(a))}function aX(e){return["transition-group","TransitionGroup"].includes(e)}function Sk(e){if(!e||e.length!==1)return!1;const[{type:t}]=e;return t?aX(t.name):!1}function lX(e,t){return t?{...t.props,...t.attrs}:e}const vS=["Start","Add","Remove","Update","End"],yS=["Choose","Unchoose","Sort","Filter","Clone"],uX=["Move",...vS,...yS].map(e=>"on"+e);let wS=null;const cX=dt({name:"VueDraggableNext",inheritAttrs:!1,props:{options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:e=>e},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},emits:["update:modelValue","move","change",...vS.map(e=>e.toLowerCase()),...yS.map(e=>e.toLowerCase())],setup(e,{emit:t,slots:n,attrs:s}){const o=L(!1),i=L(!1),r=L(0),a=L(0),l=L([]),u=L(null),c=L(null),d=K(()=>e.list?e.list:e.modelValue),h=Cs();function f(){return e.component?lH(e.component):e.tag}function p(V){if(c.value)for(const se in V){const ue=QA(se);uX.indexOf(ue)===-1&&c.value.option(ue,V[se])}}function g(){var V;return((V=h==null?void 0:h.proxy)==null?void 0:V.$el.children)||[]}async function v(){var V;await Dt(),l.value=rX(g(),((V=h==null?void 0:h.proxy)==null?void 0:V.$el.children)||[],o.value,a.value)}function C(V){const se=iX(g()||[],V);if(se===-1)return null;const ue=d.value?d.value[se]:null;return{index:se,element:ue}}function b(V){Dt(()=>t("change",V))}function S(V){if(e.list){V(e.list);return}const se=[...e.modelValue||[]];V(se),t("update:modelValue",se)}function y(...V){S(ue=>ue.splice(...V))}function R(V,se){S(Ue=>Ue.splice(se,0,Ue.splice(V,1)[0]))}function E(V){const se=l.value,ue=se.length;return V>ue-1?ue:se[V]}function F(){var se,ue;return n.default&&((ue=(se=n.default()[0])==null?void 0:se.component)==null?void 0:ue.proxy)||null}function k(V){if(!e.noTransitionOnDrag||!o.value)return;const se=g();se[V]&&(se[V].data=null);const ue=F();ue&&(ue.children=[],ue.kept=void 0)}function O(V){v(),u.value=C(V.item),u.value&&(V.item._underlying_vm_=e.clone(u.value.element),wS=V.item)}function I(V){const se=V.item._underlying_vm_;if(se===void 0)return;eS(V.item);const ue=E(V.newIndex);y(ue,0,se),v(),b({added:{element:se,newIndex:ue}})}function D(V){var ue;if(ek((ue=h==null?void 0:h.proxy)==null?void 0:ue.$el,V.item,V.oldIndex),V.pullMode==="clone"){eS(V.clone);return}if(!u.value)return;const se=u.value.index;y(se,1),k(se),b({removed:{element:u.value.element,oldIndex:se}})}function T(V){var Ue,de;eS(V.item),ek(V.from,V.item,V.oldIndex);const se=(Ue=u.value)==null?void 0:Ue.index,ue=E(V.newIndex);R(se,ue),b({moved:{element:(de=u.value)==null?void 0:de.element,oldIndex:se,newIndex:ue}})}function A(V,se){Object.prototype.hasOwnProperty.call(V,se)&&(V[se]+=r.value)}function Y(V){return V.__draggable_component__}function Z({to:V,related:se}){const ue=Y(V);if(!ue)return{component:ue};const Ue=ue.realList,de={list:Ue,component:ue};if(V!==se&&Ue&&ue.getUnderlyingVm){const _e=ue.getUnderlyingVm(se);if(_e)return Object.assign(_e,de)}return de}function te(V,se){const ue=[...se.to.children].filter(X=>X.style.display!=="none");if(ue.length===0)return 0;const Ue=ue.indexOf(se.related),de=V.component.getVmIndex(Ue);return ue.indexOf(wS)!==-1||!se.willInsertAfter?de:de+1}const ie=()=>{var de,_e;const V={};vS.forEach(X=>{V["on"+X]=G(X)}),yS.forEach(X=>{V["on"+X]=ee.bind(null,X)});const se=Object.keys(s).reduce((X,Ee)=>(X[QA(Ee)]=s[Ee],X),{}),ue=Object.assign({},se,V,{onMove:(X,Ee)=>le(X,Ee)});"draggable"in ue||(ue.draggable=">*");const Ue=((de=h==null?void 0:h.proxy)==null?void 0:de.$el.nodeType)===1?h.proxy.$el:((_e=h==null?void 0:h.proxy)==null?void 0:_e.$el.parentElement)||null;Ue&&(c.value=new Nt(Ue,ue),Ue.__draggable_component__=h==null?void 0:h.proxy,v())};function ee(V,se){Dt(()=>t(V.toLowerCase(),se))}function G(V){return se=>{if(d.value!==null){const ue="onDrag"+V,Ue=J[ue];Ue&&Ue(se)}ee(V,se)}}function le(V,se){const ue=e.move;if(!ue||!d.value)return!0;const Ue=Z(V),de=u.value,_e=te(Ue,V);de&&Object.assign(de,{futureIndex:_e});const X=Object.assign({},V,{relatedContext:Ue,draggedContext:de});return ue(X,se)}function H(){v(),wS=null}const J={onDragStart:O,onDragAdd:I,onDragRemove:D,onDragUpdate:T,onDragMove:le,onDragEnd:H};return Qt(()=>{ie()}),e.list!==null&&e.modelValue!==null&&IZ.error("list props are mutually exclusive! Please set one."),{getTag:f,realList:d,visibleIndexes:l,noneFunctionalComponentMode:i,headerOffset:r,footerOffset:a,transitionMode:o,computeIndexes:v,updateOptions:p,getChildrenNodes:g,getUnderlyingVm:C,emitChanges:b,alterList:S,spliceList:y,updatePosition:R,getVmIndex:E,getComponent:F,resetTransitionData:k,onDragStart:O,onDragAdd:I,onDragRemove:D,onDragUpdate:T,updateProperty:A,onDragMove:le,onDragEnd:H,mounted:ie,context:u,sortableInstance:c,getRelatedContextFromMoveEvent:Z,getTargetedComponent:Y,computeFutureIndex:te}},render(){const e=this.getTag(),t=lX(this.$attrs,this.componentData);if(typeof e=="string"){const s=this.$slots.default&&typeof this.$slots.default=="function"?this.$slots.default():null;return s?(this.transitionMode=Sk(s),Lu(e,t,s)):Lu(e,t,[])}const n=this.$slots.default?{default:this.$slots.default}:{};if(this.$slots.default){const s=typeof this.$slots.default=="function"?this.$slots.default():null;this.transitionMode=Sk(s||[])}return Lu(e,t,n)}}),dX=_t(dt({__name:"DragDropList",props:{modelValue:{},groupName:{},disabled:{type:Boolean},readOnly:{type:Boolean}},emits:["changed","update:modelValue"],setup(e,{emit:t}){const n=L([]),s=e,o=t,i=L({}),r=()=>{n.value=s.modelValue.map(u=>({id:u.field,name:u.headerName,...u}))||[],s.modelValue.forEach(u=>{i.value[u.field]={...u}})};tt(()=>s.modelValue,u=>{r()},{immediate:!0,deep:!0}),tt(n,u=>{if(u.length===s.modelValue.length&&!u.every((d,h)=>d.id===s.modelValue[h].field)){const d=u.map(h=>i.value[h.id]);o("changed",d),o("update:modelValue",d)}});const a=()=>!(s.readOnly||s.disabled),l=u=>!(s.readOnly||s.disabled);return(u,c)=>(z(),ze(U(cX),{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[0]=d=>n.value=d),tag:"transition-group",disabled:s.disabled||s.readOnly,onMove:l,onStart:a,"item-key":"id","component-data":{tag:"div",type:"transition",name:"fade"},animation:300,easing:"cubic-bezier(0.4, 0, 0.2, 1)","ghost-class":"ghost","chosen-class":"chosen","drag-class":"drag"},{default:ye(()=>[(z(!0),ae(Ft,null,Ln(n.value,d=>(z(),ae("div",{key:d.id,class:"fade-item"},[xt(u.$slots,"item",{item:d},()=>[ot(bt(d.name),1)],!0)]))),128))]),_:3},8,["modelValue","disabled"]))}}),[["__scopeId","data-v-6f5d2b3c"]]),hX={key:0},fX={key:1,style:{"font-style":"italic"}},pX={key:2,style:{"font-style":"italic"}},gX={key:3},zm=_t(dt({__name:"DragDropItem",props:{item:{},isDisableNewCheck:{type:Boolean,default:!1},disableDrag:{type:Boolean,default:!1},disableCheckbox:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},columnStates:{},disableDragTooltip:{default:""}},emits:["toggle-column"],setup(e,{emit:t}){const n=qt,s=e;L(!1);const o=L(s.columnStates[String(s.item.field)]||!1),i=t,r=h=>{o.value=h},a=K(()=>{var h;return(h=s.item)==null?void 0:h.context}),l=K(()=>{var f,p;return a.value.formula?"formular":((p=(f=a.value)==null?void 0:f.metric_type)==null?void 0:p.code)||"number"}),u=K(()=>{var h,f;return(f=(h=s.item)==null?void 0:h.field)==null?void 0:f.includes("metric")}),c=K(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_primary)==1}),d=K(()=>{var h;return u.value&&((h=a.value)==null?void 0:h.is_point_metric)==1});return tt(()=>o.value,()=>{i("toggle-column",s.item.field,s.item.required)}),(h,f)=>(z(),ae("div",{key:e.item.field,class:q([h.$style["column-config__item"],{[h.$style.disabled]:s.readOnly,[h.$style["is-metric"]]:u.value,[h.$style["is-point-metric"]]:d.value,[h.$style["is-woohoo-metric"]]:c.value}])},[ce(VA,{id:`col-${e.item.field}`,"model-value":o.value==!0?U($t).CHECKED:U($t).UNCHECK,"onUpdate:modelValue":r,disabled:s.disableCheckbox||e.isDisableNewCheck&&!o.value,size:"16px"},null,8,["id","model-value","disabled"]),qe((z(),ae("div",{class:"move-handler",style:on({cursor:s.disableDrag?"not-allowed":"move"})},[ce(lt,{color:s.disableDrag?"#D7D7D7":"#6B6B6B",source:"remote",src:"GripVertical",class:q(h.$style.handler)},null,8,["color","class"])],4)),[[U(n),s.disableDrag==!0?s.disableDragTooltip:""]]),u.value?(z(),ae("div",{key:0,class:q(h.$style["metric-type"])},[l.value=="rating"?(z(),ae("span",hX,"★")):l.value=="formular"?(z(),ae("span",fX," ƒx ")):l.value=="number"?(z(),ae("span",pX," # ")):(z(),ae("span",gX,bt(l.value),1))],2)):Ze("",!0),pe("span",{class:q(h.$style["column-config__item-label"])},[qe((z(),ae("div",null,[ot(bt(e.item.headerName),1)])),[[U(n),{content:e.item.headerName}]])],2),d.value?qe((z(),ae("div",{key:1,class:q(h.$style["metric-icon"])},[ce(lt,{src:"Bullseye",color:"#A6A6A6"})],2)),[[U(n),"Point metric"]]):Ze("",!0),c.value?qe((z(),ae("div",{key:2,class:q(h.$style["metric-icon"])},[ce(lt,{src:"ChartPie",color:"#A6A6A6"})],2)),[[U(n),"Woohoo metric"]]):Ze("",!0)],2))}}),[["__cssModules",{$style:{"column-config__item":"_column-config__item_1qb26_1","is-metric":"_is-metric_1qb26_8","is-woohoo-metric":"_is-woohoo-metric_1qb26_12","is-point-metric":"_is-point-metric_1qb26_15","column-config__item-label":"_column-config__item-label_1qb26_18",disabled:"_disabled_1qb26_34",readOnly:"_readOnly_1qb26_38","column-config__item--pinned":"_column-config__item--pinned_1qb26_41",handler:"_handler_1qb26_48",badge:"_badge_1qb26_52","metric-type":"_metric-type_1qb26_78","metric-icon":"_metric-icon_1qb26_106"}}]]),mX={class:"reach-limit-icon"},vX=_t(dt({__name:"TableCustomization",props:{modelValue:{},readOnly:{type:Boolean},disabled:{type:Boolean},checkboxColumn:{},gridApi:{},tableHeight:{}},emits:["update:modelValue","input","change"],setup(e,{expose:t,emit:n}){const s=qt,o=e,i=n,r=L(""),a=L(),l=K(()=>r.value.trim().length>0),u=L([]),c=L({}),{triggerRef:d,popupRef:h,isVisible:f}=Jn({placement:"bottom-end",trigger:"click",offset:[0,0]});tt(f,T=>{var A;T&&((A=a.value)==null||A.focus())});const p=K(()=>o.disabled||r.value.length>0),g=K(()=>u.value.filter(T=>T.pinned==="left"&&T.field&&T.headerName)),v=K(()=>u.value.filter(T=>T.pinned==="right"&&T.field||T.field==="blank")),C=K({get:()=>u.value.filter(T=>!T.pinned&&T.field&&T.field!=="blank"),set:T=>{u.value=[...g.value,...T,...v.value]}}),b=K(()=>{if(!r.value)return{};const T=r.value.toLowerCase();return[...u.value,...C.value].reduce((A,Y)=>{var Z;return(Z=Y.headerName)!=null&&Z.toLowerCase().includes(T)&&Y.field&&(A[Y.field]=!0),A},{})}),S=K(()=>o.modelValue),y=()=>{const T={};u.value.forEach(A=>{A.field&&(T[A.field]=!A.hide)}),c.value=T},R=K(()=>{if(!r.value)return u.value;const T=r.value.toLowerCase();return u.value.filter(A=>{var Y;return(Y=A.headerName)==null?void 0:Y.toLowerCase().includes(T)})}),E=()=>{var Y;const T=(Y=o.gridApi)==null?void 0:Y.getColumnState().reduce((Z,te)=>(Z[te.colId]=Number(te.width),Z),{}),A=u.value.map(Z=>({...Z,hide:Z.field?!c.value[Z.field]:!1,width:Z.field?T==null?void 0:T[Z.field]:Z.width}));i("update:modelValue",A),i("change",A),i("input",A)},F=T=>{const A=[...g.value,...T,...v.value];o.checkboxColumn&&A.unshift(o.checkboxColumn),u.value=A,E()},k=T=>{T&&(c.value[T]=!c.value[T],E())};tt(S,T=>{T&&T.length>0&&(u.value=[...T],y())},{immediate:!0}),t({updateColumnDefs(T){u.value=[...T],y()}});const O=K(()=>D.value>=5),I=K(()=>o.disabled||r.value.length>0),D=K(()=>u.value.reduce((T,A)=>A.field&&A.field.includes("metric")&&c.value[A.field]===!0?T+1:T,0));return(T,A)=>(z(),ae("div",{class:q(T.$style["table-customization"])},[pe("div",{ref_key:"triggerRef",ref:d},[xt(T.$slots,"trigger",{},()=>[qe((z(),ze(mt,{"data-tab-index":7,variant:["secondary"],disabled:o.disabled,actived:U(f),style:{width:"32px"}},{prefix:ye(()=>[ce(lt,{src:"TableColumns"})]),_:1},8,["disabled","actived"])),[[U(s),"Columns"]])])],512),pe("div",{ref_key:"popupRef",ref:h,class:q(T.$style["tippy-content-wrapper"])},[pe("div",{class:q([T.$style["column-config"],O.value?T.$style["has-warning"]:""]),style:on({"--max-height":o.tableHeight?o.tableHeight:"max(500px, 60vh)"})},[ce(jb,{modelValue:r.value,"onUpdate:modelValue":A[0]||(A[0]=Y=>r.value=Y),ref_key:"searchBoxRef",ref:a},null,8,["modelValue"]),pe("div",{class:q(T.$style["column-config__header"])},[...A[2]||(A[2]=[pe("span",null,"Manage columns",-1)])],2),O.value?(z(),ae("div",{key:0,class:q(T.$style["reach-limit"])},[pe("div",mX,[ce(lt,{src:"InfoCircle",color:"#F7941D",size:14})]),pe("div",{class:q(T.$style["warning-limit-text"])},[...A[3]||(A[3]=[ot(" You’ve reached the maximum number of metric columns. ",-1),pe("br",null,null,-1),ot(" Deselect one to show another. ",-1)])],2)],2)):Ze("",!0),l.value?(z(),ae(Ft,{key:1},[R.value.length===0&&l.value?(z(),ae("div",{key:0,class:q(T.$style["no-columns"])},[...A[4]||(A[4]=[ot(" No results. ",-1),pe("br",null,null,-1),ot(" Try another search. ",-1)])],2)):Ze("",!0),l.value&&R.value.length>0?(z(),ae("div",{key:1,class:q(T.$style["column-config__pinned-section"])},[(z(!0),ae(Ft,null,Ln(R.value,Y=>{var Z;return z(),ze(zm,{key:Y.colId,item:Y,columnStates:c.value,disableDrag:I.value,disableDragTooltip:"Reordering is disabled while search is active.",readOnly:o.readOnly,isDisableNewCheck:O.value&&((Z=Y.colId)==null?void 0:Z.includes("metric")),onToggleColumn:k},null,8,["item","columnStates","disableDrag","readOnly","isDisableNewCheck"])}),128))],2)):Ze("",!0)],64)):Ze("",!0),l.value?Ze("",!0):(z(),ae("div",{key:2,class:q(T.$style["column-config__list"])},[(z(!0),ae(Ft,null,Ln(g.value,Y=>qe((z(),ze(zm,{key:Y.field,item:Y,disabled:!0,readOnly:!0,disableDrag:!0,disableDragTooltip:" ","disable-checkbox":!0,columnStates:c.value},null,8,["item","columnStates"])),[[Yi,b.value[Y.field]||!r.value]])),128)),ce(dX,{modelValue:C.value,"onUpdate:modelValue":A[1]||(A[1]=Y=>C.value=Y),"group-name":"columns",onChanged:F,disabled:p.value,readOnly:o.readOnly},{item:ye(({item:Y})=>[qe((z(),ze(zm,{key:Y.id,item:Y,columnStates:c.value,disableDrag:I.value,disableDragTooltip:I.value?"Reordering is disabled while search is active.":void 0,readOnly:o.readOnly,isDisableNewCheck:O.value&&Y.id.includes("metric"),onToggleColumn:k},null,8,["item","columnStates","disableDrag","disableDragTooltip","readOnly","isDisableNewCheck"])),[[Yi,b.value[Y.field]||!r.value]])]),_:1},8,["modelValue","disabled","readOnly"]),(z(!0),ae(Ft,null,Ln(v.value.filter(Y=>{var Z;return Y.headerName&&((Z=Y.headerName)==null?void 0:Z.length)>0}),Y=>qe((z(),ze(zm,{key:Y.field,item:Y,disabled:o.disabled,readOnly:o.readOnly,columnStates:c.value},null,8,["item","disabled","readOnly","columnStates"])),[[Yi,b.value[Y.field]||!r.value]])),128))],2))],6)],2)],2))}}),[["__cssModules",{$style:{"reach-limit":"_reach-limit_1m3bt_1","reach-limit-icon":"_reach-limit-icon_1m3bt_11","warning-limit-text":"_warning-limit-text_1m3bt_18","table-customization":"_table-customization_1m3bt_24","table-customization__trigger":"_table-customization__trigger_1m3bt_30","column-config":"_column-config_1m3bt_46","has-warning":"_has-warning_1m3bt_61","column-config__header":"_column-config__header_1m3bt_64","icon-color":"_icon-color_1m3bt_73","column-config__list":"_column-config__list_1m3bt_76","column-config__section-label":"_column-config__section-label_1m3bt_80","column-config__footer":"_column-config__footer_1m3bt_89","column-config__add-button":"_column-config__add-button_1m3bt_92","cs-icon":"_cs-icon_1m3bt_110","no-columns":"_no-columns_1m3bt_114"}}]]),yX={class:"wrapper-suffix"},wX=_t(dt({__name:"StatusSelect",props:{modelValue:{},getStatusFunc:{type:Function},workspaceId:{},id:{}},emits:["updated","error","cancel","update:modelValue"],setup(e,{expose:t,emit:n}){const s=qt,o={PER_PAGE:20,INITIAL_PAGE:1},i=e,r=L(i.modelValue),a=n,l=K(()=>f.value.find(D=>D.id===r.value)||null),u=D=>{r.value=D.id,a("update:modelValue",D.id)},c=K(()=>{if(!r.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6"};const D=f.value.find(A=>A.id===r.value),T=String((D==null?void 0:D.color)||"white");return{backgroundColor:T,border:vh(T,"white")?"1px solid #ccc":"1px solid #fff"}}),d=L(null),h=()=>{var D;(D=d.value)==null||D.focus()},f=L([]),p=L(!1),g=L(!1),v=L(null),C=L(o.INITIAL_PAGE),b=L(!0),S=L(0),y=L(""),R=K(()=>!!(i.id&&i.workspaceId)),E=D=>{const T=f.value.find(A=>A.id===D.value);T&&u(T)},F=D=>({label:D.name,value:D.id,selected:r.value===D.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:D,id:D.id,color:D.color}),k=async(D=o.INITIAL_PAGE,T="",A=!1)=>{var Y;if(!R.value){console.error("Missing required props",i);return}A?g.value=!0:p.value=!0,v.value=null;try{const Z={workspaceId:String(i.workspaceId),itemIds:i.id,page:D,perPage:o.PER_PAGE,name_like:T.trim()};if(i.getStatusFunc===void 0)throw new Error("API service getAssignableStatus is undefined");const te=await i.getStatusFunc(Z);if(!te){A||(f.value=[]),b.value=!1;return}const ie=te.data.map(F);f.value=A?[...f.value,...ie]:ie,S.value=((Y=te.meta)==null?void 0:Y.total)??te.data.length,b.value=f.value.length<S.value,C.value=D}catch(Z){console.error("Error fetching statuses:",Z),v.value="Failed to load statuses",A||(f.value=[]),b.value=!1,a("error",v.value)}finally{p.value=!1,g.value=!1}},O=async()=>{!b.value||g.value||await k(C.value+1,y.value,!0)};tt([()=>i.id,()=>i.workspaceId],()=>{k()},{deep:!0,immediate:!0});const I=async D=>{y.value=D,C.value=o.INITIAL_PAGE,await k(o.INITIAL_PAGE,D,!1)};return t({focus:h,clear:()=>{r.value=null,a("update:modelValue",null)}}),(D,T)=>(z(),ze(AA,{onOpen:h,placement:"bottom-start","max-width":500},{trigger:ye(({open:A})=>[ce(ms,{actived:A,class:q(D.$style["status-wrapper"])},{suffix:ye(()=>[pe("div",yX,[ce(lt,{src:"ChevronUp",source:"remote",class:q([[D.$style["dropdown-icon"]],{[D.$style["dropdown-icon-show"]]:!A}])},null,8,["class"])])]),default:ye(()=>{var Y;return[pe("div",{class:q(D.$style.status)},[pe("div",{class:q(D.$style["color-indicator"]),style:on(c.value)},null,6),qe((z(),ae("span",{style:{"max-width":"400px"},class:q({[D.$style.empty]:!l.value})},[ot(bt(l.value?l.value.label:"Select status"),1)],2)),[[U(s),{content:((Y=l.value)==null?void 0:Y.label)||void 0}]])],2)]}),_:2},1032,["actived","class"])]),content:ye(({closeDropdown:A})=>{var Y;return[ce(Yr,{ref_key:"popupRef",ref:d,"selected-id":(Y=l.value)==null?void 0:Y.id,options:f.value,loading:p.value,"loading-more":g.value,"has-more":b.value,error:v.value,onSearch:I,onSelect:Z=>{E(Z),A()},onLoadMore:O,onCancel:T[0]||(T[0]=Z=>a("cancel")),style:{width:"500px"}},null,8,["selected-id","options","loading","loading-more","has-more","error","onSelect"])]}),_:1}))}}),[["__cssModules",{$style:{"status-wrapper":"_status-wrapper_1hlgx_1",status:"_status_1hlgx_1","color-indicator":"_color-indicator_1hlgx_12",empty:"_empty_1hlgx_21","dropdown-icon":"_dropdown-icon_1hlgx_25","dropdown-icon-show":"_dropdown-icon-show_1hlgx_30",options:"_options_1hlgx_34"}}]]),Ek=e=>({updateCellData:({rowId:n,field:s,value:o})=>{if(!e)return;const i=e.getRowNode(n);i&&i.setDataValue(s,o),e.refreshCells({rowNodes:i?[i]:[],columns:[s],force:!0})}}),CX={key:2},bX=_t(dt({name:"MetricEditorWrapper",__name:"MetricEditorWrapper",props:{disabled:{type:Boolean},readOnly:{type:Boolean},value:{},data:{},id:{},params:{},workspaceId:{},entityId:{},tooltip:{},__checkboxSelection:{type:Boolean},error:{type:Boolean}},emits:["update:value","clear","copy"],setup(e,{emit:t}){var b;const n=e,s=L(n.value),o=L(!0),i=L(""),r=()=>{var I,D,T;const S=(I=c.value)==null?void 0:I.restricted_type.trim(),y=((T=(D=c.value)==null?void 0:D.restricted_value)==null?void 0:T.split(",").map(Number))||[],[R,E]=y,k={range:`Enter a value between ${R} and ${E}`,not:`These values are not allowed: ${y.join(", ")}`,exact:"Value is not allowed"}[S];return o.value?"":k},a=S=>{if(c.value){if(S===null||S===""){o.value=!0;return}if(u.value!=="number"){o.value=!0;return}o.value=Qg(c.value,Number(S)),i.value=r()}};K(()=>o.value?{content:"",showOnCreate:!1}:{content:i.value,bypassOverflowCheck:!0,showOnCreate:!0,theme:"error",alwaysShow:!0});const l=L(null),u=K(()=>vx(c.value)),c=K(()=>{var y,R;return((R=(y=n.params)==null?void 0:y.colDef)==null?void 0:R.context)||null}),{apiServices:d}=Xn(!0,n),{updateCellData:h}=Ek((b=n.params)==null?void 0:b.api),f=L(!1),p=gi(n,"id"),g=()=>{var S;(S=n.params)==null||S.api.stopEditing()},v=()=>{g()},C=async S=>{var R,E;if(g(),f.value=!0,s.value=S||null,S===n.value){f.value=!1;return}const y={itemIds:[String(p.value)],metricId:((R=c.value)==null?void 0:R.id)||"",workspaceId:String(n.workspaceId)};S==null?y.clear=1:y.value=S,h({rowId:String(p.value),field:`metric_${y.metricId}`,value:void 0});try{const F=await((E=d.value)==null?void 0:E.bulkUpdateMetric(y));(F==null?void 0:F.message)=="Done"?h({rowId:String(p.value),field:`metric_${y.metricId}`,value:S||null}):(h({rowId:String(p.value),field:`metric_${y.metricId}`,value:n.value}),console.error("Failed to update metric value:",F),s.value=n.value)}catch(F){console.error("Error during bulk metric update:",F),h({rowId:String(p.value),field:`metric_${y.metricId}`,value:n.value})}finally{f.value=!1}};return(S,y)=>(z(),ae("div",{class:"metric-editor-wrapper",ref_key:"metricEditorWrapperRef",ref:l},[u.value=="dropdown"&&c.value?(z(),ze(xA,{key:0,config:c.value,modelValue:s.value,"onUpdate:modelValue":y[0]||(y[0]=R=>s.value=R),onChange:C,onHandleCancel:v},null,8,["config","modelValue"])):u.value=="number"&&c.value?(z(),ze(PA,{key:1,showInlineError:!1,autoEmit:!0,config:c.value,modelValue:s.value,"onUpdate:modelValue":y[1]||(y[1]=R=>s.value=R),style:{width:"100%"},onHandleChange:C,onCancel:v,onOnValidation:a},null,8,["config","modelValue"])):(z(),ae("div",CX,"Metric type:"+bt(u.value),1))],512))}}),[["__scopeId","data-v-de0dd7ce"]]),SX=_t(dt({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."},s=K(()=>t.isSearching||t.isFiltering?"NoDataSearchFilter":"ClickToCreate"),o=K(()=>t.isSearching&&!t.isFiltering?n.noSearchResults:t.isFiltering&&!t.isSearching?n.noFilterResults:t.isSearching&&t.isFiltering?n.emptySearchFilter:n.noData),i=L(!1);return Qt(()=>{i.value=!0}),(r,a)=>(z(),ae("div",{class:q(r.$style["no-data-item-table"])},[pe("div",{class:q(r.$style.visual)},[i.value?(z(),ze(bm,{key:0,source:"remote",src:s.value,ratio:"4/3",maxWidth:500,maxHeight:350},null,8,["src"])):Ze("",!0)],2),pe("div",{class:q(r.$style.description)},bt(o.value),3)],2))}}),[["__cssModules",{$style:{"no-data-item-table":"_no-data-item-table_oh0wi_1",visual:"_visual_oh0wi_12",description:"_description_oh0wi_19"}}]]),_k=Ul("sortStore",()=>{const e=L({}),t={id:"id",name:"name",isStated:"actual_start_date",isCompleted:"actual_due_date",lastUpdated:"updated_at",completedOn:"actual_due_date",status:"template_flow_status",assignees:"assignee"},n={start_asc:{column:"start_date",direction:"asc"},start_desc:{column:"start_date",direction:"desc"},due_asc:{column:"due_date",direction:"asc"},due_desc:{column:"due_date",direction:"desc"}},s=K(()=>{const a=e.value;return Object.values(a).filter(u=>u.sort!=="none"&&!!u.sort).map(u=>{let c;switch(u.colId){case"dateRange":c=n[u.sort];break;default:if(u.colId.includes("metric")){const[d,h]=u.colId.split("_");c={column:d,direction:u.sort,type:h}}else c={column:t[u.colId]||u.colId,direction:u.sort};break}return c})}),o=(a,l)=>{e.value={[a]:{colId:a,sort:l}}},i=()=>{e.value={}},r=L(!1);return{sortingAPIConfiguration:s,sorts:e,setSort:o,clearSorting:i,isSortingRunning:r}}),ql=dt({name:"HeaderSorting",__name:"HeaderWrapper",props:{params:{},headerType:{},disabled:{type:Boolean},readOnly:{type:Boolean}},setup(e){const t=e,n=_k(),{sorts:s}=Bs(n),o=K(()=>{var l,u;return((u=(l=t.params)==null?void 0:l.column)==null?void 0:u.getColId())||"template_col_id"}),i=l=>{o.value&&n.setSort(o.value,l)},r=K(()=>t.params.headerType||void 0),a=L("none");return tt(()=>s.value,Ci(()=>{if(o.value){const l=s.value[o.value];a.value=l?l.sort:"none"}},nr),{deep:!0,immediate:!0}),(l,u)=>o.value?(z(),ze(ZY,Kt({key:0},t,{"header-type":r.value,modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=c=>a.value=c),onSortChanged:i}),null,16,["header-type","modelValue"])):Ze("",!0)}});function EX(){const e=No({isCreating:!1,name:"",error:void 0,assignees:null,status:null,start_date:null,due_date:null}),t=()=>{const o=e.name.trim();e.status,o.length===0?e.error="Name cannot be empty":o.length>25?e.error="Name cannot exceed 25 characters":e.error=void 0},n=()=>{e.isCreating=!0,e.name="",e.error=void 0,e.assignees=null,e.status=null,e.start_date=null,e.due_date=null},s=()=>{e.isCreating=!1};return tt(()=>e,()=>{t()},{deep:!0}),{newItemData:e,validateNewItem:t,openNewItemForm:n,closeNewItemForm:s,resetNewItemForm:()=>{e.name="",e.assignees=null,e.start_date=null,e.due_date=null,e.error=void 0}}}const jm=Ul("userStore",()=>{const e=L(null),t=L(null);return{user:e,setUser:o=>{e.value=o},setUserRoleId:o=>{t.value=o},workspaceUserRoleId:t}}),_X=["innerHTML"],RX=20,DX=_t(dt({__name:"AddNewAssignee",props:{maxVisible:{default:3}},emits:["updated","cancel","start-update","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const s=e,{triggerRef:o,popupRef:i,isVisible:r,show:a,hide:l}=Jn({appendTo:"parent",offset:[-15,8]}),u=()=>{a()},c=L(null),d=()=>{I.value=[],ue.value=!1},h=K(()=>r.value),f=K(()=>{var X;return{disabled:!1,error:!1,readOnly:!1,isEmpty:((X=I.value)==null?void 0:X.length)===0,wrapperRef:o,active:h,bordered:!0}}),{argsMain:p}=gs(f),g=qt,v=n,C=K(()=>{var X;return Math.max(0,(((X=I.value)==null?void 0:X.length)||0)-s.maxVisible)}),b=K(()=>{var X;return C.value<=0?"":((X=I.value)==null?void 0:X.slice(s.maxVisible).map(Ee=>Ee.name).join(", "))||""}),S=L(!1),y=L(!1),R=L(null),E=L(1),F=L(!0),k=L(0),O=L(""),I=L([]),D=K(()=>{var X;return((X=I.value)==null?void 0:X.map(Ee=>Ee.id))||[]}),{assigneeList:T,mergedOptions:A}=om({...s,value:[]}),{apiServices:Y}=Xn(!1,s),Z=Sn("entityId"),te=async(X=1,Ee="",Pe=!1)=>{var W,ne,we,Le,Ae;if(!Y.value)throw console.error("API service or item identifiers are undefined"),new Error("API service or item identifiers are undefined");if(Pe?y.value=!0:S.value=!0,R.value=null,!((W=Y.value)!=null&&W.getAssignableAssignees))throw new Error("API service getAssignableAssignees is undefined");const $e=yn.getInstance().getItem("ws.code");try{const P=await((ne=Y.value)==null?void 0:ne.getAssignableAssignees(String($e),{entity_ids:(Z==null?void 0:Z.value)||"",page:X,per_page:RX,display_name_like:Ee})),M=((we=cc(P.data))==null?void 0:we.map(sm))??[];T.value=Pe?Zu(T.value,M,"id"):M,k.value=P.meta.total,F.value=(((Le=P==null?void 0:P.meta)==null?void 0:Le.current_page)||0)<(((Ae=P==null?void 0:P.meta)==null?void 0:Ae.last_page)||0),E.value=X}catch(P){console.error("Error fetching assignable users:",P),R.value="Failed to load assignable users"}finally{S.value=!1,y.value=!1}},ie=X=>{var Ee,Pe,$e;if((Ee=I.value)!=null&&Ee.some(W=>W.id===X.data.id)){I.value=(Pe=I.value)==null?void 0:Pe.filter(W=>W.id!==X.data.id);return}I.value=[...I.value||[],X.data],($e=c.value)==null||$e.focus()},ee=()=>{I.value=[]},G=()=>{!y.value&&F.value&&te(E.value+1,O.value,!0)},le=Ci(async X=>{O.value=X,await te(1,X,!1)},nr);tt(()=>r.value,X=>{var Ee;X?(te(1,O.value,!1),(Ee=c.value)==null||Ee.focus(),v("show")):v("hide")});const H=K(()=>{var X;return((X=I.value)==null?void 0:X.slice(0,3))||[]}),J=K(()=>H.value.map(X=>({id:X.id,name:X.name,initial:X.initial,avatarId:X.id,profile_image:X.profile_image,color:X.color,size:24,user:X}))),V=jm(),{user:se}=Bs(V),ue=L(!1);t({getData:()=>I.value,clear:d,setData:X=>{I.value=X},focus:()=>{a(),Dt(()=>{var X;(X=c.value)==null||X.focus()})},hide:()=>{l()}}),tt([I,ue],()=>{v("updated",I.value)},{deep:!0});const Ue=X=>{var Ee;I.value=(Ee=I.value)==null?void 0:Ee.filter(Pe=>Pe.id!==X)},de=X=>{var Pe;const Ee=yn.getInstance().getItem("ws.code");return((Pe=Y.value)==null?void 0:Pe.getUserInformation(Ee,X))||Promise.resolve(null)},_e=L();return(X,Ee)=>(z(),ae("div",{class:"new-assignee-wrapper",ref_key:"wrapperRef",ref:_e},[ce(ms,Kt(U(p),{style:{"--icon-size":"18px"}}),{prefix:ye(()=>[J.value.length==0?(z(),ae("div",{key:0,class:q([X.$style["icon-wrapper"],"wrapper-prefix"]),onClick:Pt(u,["stop","prevent"])},[ce(lt,{src:"UserPlus",color:"#A6A6A6"})],2)):Ze("",!0)]),default:ye(()=>[pe("div",{class:q([X.$style["assignee-row"],X.$style["assignee-selector"]]),ref_key:"triggerRef",ref:o},[pe("div",{style:{flex:1},class:q([X.$style["assignee-row"]])},[(z(!0),ae(Ft,null,Ln(J.value,Pe=>(z(),ze(_m,{onClear:$e=>Ue(Pe.id),key:Pe.user.id,"disable-remove":!1},{default:ye(()=>[ce(Wl,{user:Pe.user,apiUpdateFunction:de,appendTo:_e.value},null,8,["user","appendTo"])]),_:2},1032,["onClear"]))),128)),C.value>0?qe((z(),ae("div",{key:0,class:q(X.$style["extra-avatars"])},[ot(" +"+bt(C.value),1)],2)),[[U(g),b.value]]):Ze("",!0)],2)],2)]),_:1},16),pe("div",{ref_key:"popupRef",ref:i},[ce(Yr,Kt({"selected-id":D.value},{...s},{options:U(A),loading:S.value,"loading-more":y.value,"has-more":F.value,ref_key:"searchListRef",ref:c,onTab:Ee[0]||(Ee[0]=Pe=>v("tab",Pe)),onSelect:Ee[1]||(Ee[1]=Pe=>{ie(Pe),v("start-update")}),onSearch:U(le),onClose:Ee[2]||(Ee[2]=()=>v("close")),onLoadMore:G}),{"extra-item":ye(()=>[ce(mt,{variant:"menu-item",onHandleClick:ee},{prefix:ye(()=>[pe("div",{class:q(X.$style["unassign-icon"])},[ce(lt,{src:"UserXMark",source:"remote"})],2)]),default:ye(()=>[Ee[3]||(Ee[3]=ot(" Unassign all ",-1))]),_:1})]),item:ye(({item:Pe,selectedIndex:$e,isSelected:W,handleSelect:ne,handleItemHover:we,getHighlightedLabel:Le,query:Ae,idx:P})=>[ce(qr,Kt(Pe,{hover:P===$e,selected:W(Pe),type:Pe.type,onClick:Pt(M=>ne(Pe,M),["stop","prevent"]),onMouseover:M=>we(P),class:X.$style["item-assignee"]}),{prefix:ye(()=>[ce(Wl,{user:Pe.data,apiUpdateFunction:de,appendTo:U(i)},null,8,["user","appendTo"])]),label:ye(({})=>[Ae?qe((z(),ae("span",{key:0,class:q([X.$style["item-label"],X.$style.match]),style:{flex:"1"},innerHTML:Le(Pe.label)},null,10,_X)),[[U(g),{content:Pe.label}]]):qe((z(),ae("span",{key:1,class:q(X.$style["item-label"]),style:{flex:"1"}},[ot(bt(Pe.label),1)],2)),[[U(g),{content:Pe.label}]])]),_:2},1040,["hover","selected","type","onClick","onMouseover","class"])]),_:1},16,["selected-id","options","loading","loading-more","has-more","onSearch"])],512)],512))}}),[["__cssModules",{$style:{action:"_action_q5jol_1","item-assignee":"_item-assignee_q5jol_6","item-action":"_item-action_q5jol_6","item-label":"_item-label_q5jol_16","unassign-icon":"_unassign-icon_q5jol_25","icon-wrapper":"_icon-wrapper_q5jol_37","error-message":"_error-message_q5jol_46","empty-state":"_empty-state_q5jol_56","assignee-row":"_assignee-row_q5jol_69","assignee-selector":"_assignee-selector_q5jol_77",seperator:"_seperator_q5jol_81","extra-avatars":"_extra-avatars_q5jol_89",list:"_list_q5jol_101"}}]]),TX={key:0},FX={key:1},IX={key:0},xX={key:1},PX={key:0,class:"wrapper-suffix"},AX={key:0,class:"wrapper-prefix",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"24px",height:"24px"}},kX=_t(dt({__name:"AddNewDate",emits:["updated","tab","show","hide"],setup(e,{expose:t,emit:n}){const s=qt,{triggerRef:o,popupRef:i,isVisible:r,hide:a,show:l}=Jn({appendTo:"parent",offset:[0,0]}),u=()=>{c.value=[null,null]},c=L([null,null]),d=y=>{const R=Jg();return y?pt.fromJSDate(y,{zone:R}).toFormat("MMM dd"):""},h=K(()=>r.value),f=K(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:c.value[0]===null&&c.value[1]===null,wrapperRef:o,active:h,bordered:!0})),{argsMain:p}=gs(f),g=L(!1),v=y=>{b("tab",y)},C=y=>{"start"in y&&y.start!==void 0&&(c.value[0]=y.start),"end"in y&&y.end!==void 0&&(c.value[1]=y.end)};t({getData:()=>c.value,clear:u,setData:y=>{c.value=y},focus:()=>{l(),Dt(()=>{var y;(y=S.value)==null||y.focus()})},hide:()=>{a()}});const b=n;tt(()=>c.value,y=>{b("updated",y)},{deep:!0});const S=L(null);return tt(()=>r.value,y=>{y?(Dt(()=>{var R;(R=S.value)==null||R.focus()}),b("show")):b("hide")}),(y,R)=>(z(),ae(Ft,null,[ce(ms,Kt({ref_key:"triggerRef",ref:o},U(p),{style:{"--icon-size":"18px",cursor:"pointer"}}),{default:ye(({focused:E})=>[pe("div",{class:q(y.$style["date-time"])},[pe("div",{class:q(y.$style.date)},[c.value[0]==null&&(E||U(r))?(z(),ae("span",TX,"MMMDD")):(z(),ae("span",FX,bt(d(c.value[0])),1))],2),c.value[0]!==null||c.value[1]!==null||E||U(r)?(z(),ae("div",{key:0,class:q(y.$style.separator)}," → ",2)):Ze("",!0),pe("div",{class:q(y.$style.date)},[c.value[1]==null&&(E||U(r))?(z(),ae("span",IX,"MMMDD")):(z(),ae("span",xX,bt(d(c.value[1])),1))],2)],2)]),suffix:ye(({hovered:E,focused:F})=>[(c.value[0]!==null||c.value[1]!==null)&&(E||F||U(r))?(z(),ae("div",PX,[qe((z(),ze(mt,{onClick:Pt(u,["stop","prevent"]),variant:["icon","primary"],rounded:!0,size:18},{default:ye(()=>[ce(lt,{src:"XMarkSolid",size:"8"})]),_:1})),[[U(s),"Clear"]])])):Ze("",!0)]),prefix:ye(()=>[c.value[0]===null&&c.value[1]===null?(z(),ae("div",AX,[ce(lt,{src:"Calendar",color:"#A6A6A6"})])):Ze("",!0)]),_:1},16),pe("div",{ref_key:"popupRef",ref:i},[U(r)?(z(),ze(Sm,{key:0,immediatelyUpdate:!1,value:c.value,onConfirmed:C,ref_key:"calendarRef",ref:S,onClosed:U(a),onStartUpdate:R[0]||(R[0]=E=>g.value=!0),onFinishUpdate:R[1]||(R[1]=E=>g.value=!1),onTab:v},null,8,["value","onClosed"])):Ze("",!0)],512)],64))}}),[["__cssModules",{$style:{"list-item":"_list-item_n9o5g_2","date-time":"_date-time_n9o5g_5",date:"_date_n9o5g_5",separator:"_separator_n9o5g_18"}}]]),OX=_t(dt({__name:"AddNewStatus",props:{entityId:{}},emits:["updated","error","cancel","update:modelValue","tab","close","show","hide"],setup(e,{expose:t,emit:n}){const s=e,o={PER_PAGE:20,INITIAL_PAGE:1},{triggerRef:i,popupRef:r,isVisible:a,show:l,hide:u}=Jn({appendTo:"parent"}),c=L(null),d=L([]),h=L(!1),f=L(!1),p=L(null),g=L(o.INITIAL_PAGE),v=L(!0),C=L(0),b=L(""),S=n,y=K(()=>a.value),R=K(()=>({disabled:!1,error:!1,readOnly:!1,isEmpty:!c.value,wrapperRef:i,active:y,bordered:!0})),E=L(null),{argsMain:F}=gs(R),k=K(()=>c.value?d.value.filter(H=>H.id===c.value):[]),O=K(()=>!c.value||k.value.length===0?"":k.value[0].label),I=K(()=>c.value?[c.value]:[]),D=K(()=>{if(!c.value)return{backgroundColor:"#A6A6A6",border:"1px solid #A6A6A6",minWidth:"14px"};const H=k.value[0],J=String((H==null?void 0:H.color)||"white");return{backgroundColor:J,border:vh(J,"white")?"1px solid #ccc":"1px solid #fff",minWidth:"14px"}}),T=H=>({label:H.name,value:H.id,selected:c.value===H.id,hover:!1,type:"status",disabled:!1,clickable:!0,danger:!1,data:H,id:H.id,color:H.color}),{apiServices:A}=Xn(!1,s),Y=async(H=o.INITIAL_PAGE,J="",V=!1)=>{var se,ue;V?f.value=!0:h.value=!0,p.value=null;try{const Ue=yn.getInstance().getItem("ws.code"),de=await((se=A.value)==null?void 0:se.getAssignableStatuses(Ue,{entity_id:s.entityId||"",name_like:J,page:H,per_page:o.PER_PAGE}));if(!de){V||(d.value=[]),v.value=!1;return}const _e=de.data.map(T);d.value=V?[...d.value,..._e]:_e,C.value=((ue=de.meta)==null?void 0:ue.total)??de.data.length,v.value=d.value.length<C.value,g.value=H}catch(Ue){console.error("Error fetching statuses:",Ue),p.value="Failed to load statuses",V||(d.value=[]),v.value=!1,S("error",p.value)}finally{h.value=!1,f.value=!1}},Z=(H,J)=>{var se;J.stopImmediatePropagation(),J.preventDefault(),J.stopPropagation();const V=H.id;c.value=V,(se=E.value)==null||se.focus(),S("update:modelValue",c.value),u()},te=async()=>{!v.value||f.value||await Y(g.value+1,b.value,!0)},ie=async H=>{b.value=H,g.value=o.INITIAL_PAGE,await Y(o.INITIAL_PAGE,H,!1)},ee=()=>{c.value=null,S("update:modelValue",null)},G=()=>{l(),Dt(()=>{var H;(H=E.value)==null||H.focus()})};return tt(()=>a.value,H=>{var J;H?(Y(1,b.value,!1),(J=E.value)==null||J.focus(),S("show")):S("hide")}),tt(()=>c.value,H=>{S("updated",H)}),t({focus:G,clear:ee,getData:()=>c.value,setData:H=>{c.value=H},hide:u,autoFillDefault:async()=>{b.value="",await Y(1,b.value,!1),d.value.length>0&&(c.value=d.value[0].id,S("update:modelValue",c.value))}}),(H,J)=>{const V=zd("tooltip");return z(),ae(Ft,null,[ce(ms,Kt({ref_key:"triggerRef",ref:i},U(F),{style:{"--icon-size":"18px"}}),{default:ye(()=>[pe("div",{class:q(H.$style.status)},[pe("div",{class:q(H.$style["color-indicator"]),style:on(D.value)},null,6),qe((z(),ae("span",{class:q({[H.$style.empty]:k.value.length===0,[H.$style["status-text"]]:!0})},[ot(bt(O.value),1)],2)),[[V,{content:O.value}]])],2)]),_:1},16),pe("div",{ref_key:"popupRef",ref:r},[ce(Yr,{style:{width:"200px"},ref_key:"searchListRef",ref:E,"selected-id":I.value,options:d.value,loading:h.value,"loading-more":f.value,"has-more":v.value,error:p.value,onSearch:ie,onSelect:Z,onLoadMore:te,onCancel:J[0]||(J[0]=se=>S("cancel")),onTab:J[1]||(J[1]=se=>S("tab",se)),onClose:J[2]||(J[2]=()=>S("close"))},null,8,["selected-id","options","loading","loading-more","has-more","error"])],512)],64)}}}),[["__cssModules",{$style:{"list-item":"_list-item_1gv28_2",status:"_status_1gv28_6","color-indicator":"_color-indicator_1gv28_12","count-badge":"_count-badge_1gv28_25","status-text":"_status-text_1gv28_32",empty:"_empty_1gv28_41"}}],["__scopeId","data-v-cb0f9265"]]),MX=_t(dt({__name:"CreateNewScene",emits:["create-new-item","focus-on-id","search-for-code"],setup(e,{expose:t,emit:n}){const s=["name","assignees","status","date","cancel","create-keep","create"],o=qt,i=Q$("target"),r=Sn("workspaceId"),a=Sn("entityId"),l=n,u=e,{newItemData:c,validateNewItem:d,resetNewItemForm:h,closeNewItemForm:f}=EX(),{apiServices:p}=Xn(!1,u),{openSceneHub:g}=zh(),v=L(!1),C=L(null),b=L({assignees:!1,status:!1,date:!1}),S={name:L(null),assignees:L(null),status:L(null),date:L(null),cancel:L(null),"create-keep":L(null),create:L(null)},y=S.name,R=S.assignees,E=S.status,F=S.date,k=S.cancel,O=S["create-keep"],I=S.create,D=L(new Map),T=K(()=>!!c.error||!c.name.trim()),A=(P,M)=>{P&&D.value.set(M,P.$el||P)},Y=(P,M)=>{if(P==="date"){const[j,fe]=Array.isArray(M)?M:[void 0,void 0];c.start_date=j,c.due_date=fe}else c[P]=M},Z=()=>{c.isCreating=!0,C.value="name"},te=()=>{c.isCreating=!1,h()},ie=Sn("switchInstance"),{addNotification:ee}=Zh(),G=P=>{l("focus-on-id",P)},le=(P,M,j)=>{const fe=XK(void 0,"created");ee({id:String(P),message:`<div style="display:flex; flex-direction: column; align-items: flex-start;"><b>${fe}</b>
|
|
149
149
|
<span>${M} </span></div>`,actions:[{label:"Find in table",variant:"secondary",btnIcon:"MagnifyingGlass",action:()=>{l("search-for-code",{code:j,name:M}),G(String(P))}},{label:"Full view",btnIcon:"CustomSceneHub",variant:"primary",action:Fe=>{if(Fe.ctrlKey||Fe.metaKey){const je=Ms({type:"scene_hub",config:{ws_code:r,baseDomain:yn.getInstance().getItem("BASE_URL")||"",scene_id:String(P)}}).url;window.open(je,"_blank");return}else ie("scene_hub",{id:String(P)},{showLoading:!1})}}],type:"interactive"})},H=P=>{P&&Dt(()=>{var j;const M=(j=S[P])==null?void 0:j.value;M&&(typeof M.focus=="function"?M.focus():M.$el&&typeof M.$el.focus=="function"&&M.$el.focus())})},J=P=>{var M;(M=i.value)==null||M.focus()},V=P=>{const M=j=>{var fe;return(fe=j==null?void 0:j.hide)==null?void 0:fe.call(j)};P!=="assignees"&&M(R.value),P!=="status"&&M(E.value),P!=="date"&&M(F.value)},se=(P,M)=>{M instanceof KeyboardEvent&&M.key!=="Tab"&&M.preventDefault();const j=C.value?s.indexOf(C.value):-1;if(j===-1){H("name");return}let Fe=(j+(P==="next"?1:-1)+s.length)%s.length,je=s[Fe];(je==="create"||je==="create-keep")&&T.value&&(Fe=0,je=s[0]),V(je),H(je)},ue=P=>{b.value[P]=!0,C.value=P},Ue=P=>{b.value[P]=!1,J()},de=P=>{b.value[P]||(C.value=null)},_e=P=>{P.target===i.value&&H("name")},X=P=>{var M,j,fe;if(P.key==="Enter"){if(!C.value)return;switch(P.preventDefault(),P.stopPropagation(),C.value){case"create":T.value||ne("clear");break;case"create-keep":T.value||ne("keep");break;case"cancel":f();break;case"assignees":(M=R.value)==null||M.focus();break;case"status":(j=E.value)==null||j.focus();break;case"date":(fe=F.value)==null||fe.focus();break}return}if(P.key==="Tab"){P.preventDefault(),P.stopImmediatePropagation(),P.stopPropagation(),C.value!=="name"&&Ee(P);return}if(P.key==="Escape"){C.value=null,te();return}},Ee=P=>{P.preventDefault(),P.stopImmediatePropagation(),P.stopPropagation();const M=P.shiftKey?"prev":"next";se(M,P)},Pe=()=>{var P;return(P=R.value)==null?void 0:P.focus()},$e=()=>{var P;return(P=E.value)==null?void 0:P.focus()},W=()=>{var P;return(P=F.value)==null?void 0:P.focus()},ne=async(P="clear")=>{var j,fe,Fe,je,Be,he,Te,Je,yt,Vt,dn;if(T.value||v.value)return;v.value=!0;const M={name:c.name,template_flow_status_id:c.status??void 0,ws_user_role_ids:(j=c.assignees)==null?void 0:j.map(Ht=>Ht.id),start_date:c.start_date?nm(c.start_date):void 0,due_date:c.due_date?nm(c.due_date):void 0};if(!((fe=p.value)!=null&&fe.addNewItem)){console.warn("API service unavailable"),v.value=!1;return}try{const Ht=await p.value.addNewItem(r,a,M),mn=c.name;if(le(Ht.id,Ht.name,Ht.code),!Ht.id)throw new Error("Invalid response from server: missing scene ID");switch(P){case"close":h(),(Fe=R.value)==null||Fe.setData([]),(je=E.value)==null||je.setData(null),(Be=F.value)==null||Be.setData([null,null]),f(),te();break;case"close-open":h(),(he=R.value)==null||he.setData([]),(Te=E.value)==null||Te.setData(null),(Je=F.value)==null||Je.setData([null,null]),f(),te(),g(Ht.id);break;case"clear":l("create-new-item",mn),h(),(yt=R.value)==null||yt.setData([]),(Vt=E.value)==null||Vt.setData(null),(dn=F.value)==null||dn.setData([null,null]),H("name");break;case"keep":l("create-new-item",mn),c.name="",c.error="",H("name");break}}catch(Ht){console.error("Error creating scene:",Ht),P=="close"&&(f(),te())}finally{v.value=!1}},we=(P,M)=>{T.value||(M.metaKey||M.ctrlKey?ne("close-open"):M.shiftKey?ne("keep"):ne("clear"))},Le=(P=!1)=>{c.isCreating&&(!T.value&&!c.error?ne(P?"close":"clear"):te())},Ae=()=>f();return RA(i,P=>{const M=P.target.closest(".notification-center"),j=P.target.closest("#people-insight-container");if(M||j)return!1;Le(!0)}),tt(()=>c.isCreating,P=>{P&&H("name")}),t({show:Z,hide:te}),(P,M)=>qe((z(),ae("div",{class:q(P.$style.newRow),ref_key:"target",ref:i,onKeydown:X,onClick:_e,tabindex:"-1"},[pe("div",{ref:j=>A(j,"name"),class:q({[P.$style["field-wrapper"]]:!0,[P.$style.active]:C.value==="name"})},[ce(zb,{ref_key:"nameInputRef",ref:y,modelValue:U(c).name,"onUpdate:modelValue":M[0]||(M[0]=j=>U(c).name=j),onChange:U(d),onEnter:we,onCancel:Ae,onTab:M[1]||(M[1]=(j,fe)=>Ee(fe)),onFocus:M[2]||(M[2]=j=>C.value="name"),placeholder:"Enter name",focused:!0,"max-length":25,type:"text","auto-emit":!0,style:{"--bg-input":"transparent","--border-color":"#f3f5f7"},bordered:!0,class:"border-f3f5f7"},null,8,["modelValue","onChange"])],2),pe("div",{ref:j=>A(j,"assignees"),onEnter:Pt(Pe,["prevent","stop"]),class:q({[P.$style["field-wrapper"]]:!0,[P.$style.active]:C.value==="assignees"})},[ce(DX,{ref_key:"assigneeRef",ref:R,onUpdated:M[3]||(M[3]=j=>Y("assignees",j)),onTab:M[4]||(M[4]=j=>Ee(j)),onEnter:Pe,onFocus:M[5]||(M[5]=j=>C.value="assignees"),onBlur:M[6]||(M[6]=j=>de("assignees")),onShow:M[7]||(M[7]=j=>ue("assignees")),onHide:M[8]||(M[8]=j=>Ue("assignees"))},null,512)],34),pe("div",{ref:j=>A(j,"status"),class:q({[P.$style["field-wrapper"]]:!0,[P.$style.active]:C.value==="status"})},[ce(OX,{ref_key:"statusRef",ref:E,"entity-id":U(a),onUpdated:M[9]||(M[9]=j=>Y("status",j)),onTab:M[10]||(M[10]=j=>Ee(j)),onEnter:$e,onFocus:M[11]||(M[11]=j=>C.value="status"),onBlur:M[12]||(M[12]=j=>de("status")),onShow:M[13]||(M[13]=j=>ue("status")),onHide:M[14]||(M[14]=j=>Ue("status"))},null,8,["entity-id"])],2),pe("div",{ref:j=>A(j,"date"),class:q({[P.$style["field-wrapper"]]:!0,[P.$style.active]:C.value==="date"})},[ce(kX,{ref_key:"dateRef",ref:F,onUpdated:M[15]||(M[15]=j=>Y("date",j)),onTab:M[16]||(M[16]=j=>Ee(j)),onEnter:W,onFocus:M[17]||(M[17]=j=>C.value="date"),onBlur:M[18]||(M[18]=j=>de("date")),onShow:M[19]||(M[19]=j=>ue("date")),onHide:M[20]||(M[20]=j=>Ue("date"))},null,512)],2),pe("div",{class:q(P.$style["field-actions"])},[pe("div",{ref:j=>A(j,"cancel"),class:q({[P.$style["field-wrapper"]]:!0,[P.$style.active]:C.value==="cancel",[P.$style["field-button"]]:!0})},[ce(mt,{ref_key:"cancelRef",ref:k,variant:["secondary"],onClick:U(f),onKeydown:[Ds(U(f),["enter"]),M[22]||(M[22]=Ds(j=>Ee(j),["tab"]))],onFocus:M[21]||(M[21]=j=>C.value="cancel"),tabindex:"0"},{default:ye(()=>[...M[31]||(M[31]=[ot(" Cancel ",-1)])]),_:1},8,["onClick","onKeydown"])],2),qe((z(),ae("div",{ref:j=>A(j,"create-keep"),class:q({[P.$style["field-wrapper"]]:!0,[P.$style["field-button"]]:!0,[P.$style.active]:C.value==="create-keep"})},[ce(mt,{ref_key:"createKeepRef",ref:O,onClick:M[23]||(M[23]=()=>ne("keep")),onKeydown:[M[24]||(M[24]=Ds(j=>!T.value&&ne("keep"),["enter"])),M[26]||(M[26]=Ds(j=>Ee(j),["tab"]))],onFocus:M[25]||(M[25]=j=>C.value="create-keep"),disabled:T.value,variant:["primary"],loading:v.value,tabindex:"0",style:on([{padding:"4px 8px",width:"100%"},{"letter-spacing":"-0.5px"}])},{default:ye(()=>[...M[32]||(M[32]=[ot(" Create & Keep ",-1)])]),_:1},8,["disabled","loading"])],2)),[[U(o),T.value?"Enter a name and select a status to continue.":"Create and keep field values (⇧↵ Shift+Enter)"]]),qe((z(),ae("div",{ref:j=>A(j,"create"),class:q({[P.$style["field-wrapper"]]:!0,[P.$style.active]:C.value==="create",[P.$style["field-button"]]:!0})},[ce(mt,{ref_key:"createRef",ref:I,onClick:M[27]||(M[27]=()=>ne("clear")),onKeydown:[M[28]||(M[28]=Ds(j=>!T.value&&ne("clear"),["enter"])),M[30]||(M[30]=Ds(j=>Ee(j),["tab"]))],onFocus:M[29]||(M[29]=j=>C.value="create"),disabled:T.value,variant:["primary"],loading:v.value,tabindex:"0"},{default:ye(()=>[...M[33]||(M[33]=[ot(" Create ",-1)])]),_:1},8,["disabled","loading"])],2)),[[U(o),T.value?"Enter a name and select a status to continue.":"Create and clear the fields (↵ Enter)"]])],2)],34)),[[Yi,U(c).isCreating]])}}),[["__cssModules",{$style:{newRow:"_newRow_mf32t_1","field-actions":"_field-actions_mf32t_14","field-wrapper":"_field-wrapper_mf32t_43",active:"_active_mf32t_49","field-button":"_field-button_mf32t_52","warning-text":"_warning-text_mf32t_55","has-error":"_has-error_mf32t_60"}}]]),NX=["innerHTML"],LX=["accept"],Rk=_t(dt({__name:"FileUploader",props:{modelValue:{},acceptTypes:{default:()=>["xlsx","xls","csv"]}},emits:["update:modelValue"],setup(e,{expose:t,emit:n}){const s=L(null),o=O=>`<svg xmlns="http://www.w3.org/2000/svg" width="49" height="49" viewBox="0 0 49 49" fill="none">
|
|
150
150
|
<g clip-path="url(#clip0)">
|
|
151
151
|
<path d="M9.86719 3.56641C9.86719 2.05448 11.1053 0.816406 12.6172 0.816406H33.5136L45.3672 12.67V45.5664C45.3672 47.0783 44.1291 48.3164 42.6172 48.3164H12.6172C11.1053 48.3164 9.86719 47.0783 9.86719 45.5664V3.56641Z" stroke="#232323" stroke-width="0.5"/>
|
|
@@ -247,4 +247,4 @@ If you are trying to annotate ${s} with application data, use the '${s}.context'
|
|
|
247
247
|
`+r.map(q2).join(`
|
|
248
248
|
`):" "+q2(r[0]):"as no adapter specified";throw new zt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const Y2={getAdapter:xwe,adapters:d_};function h_(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new yd(null,e)}function Z2(e){return h_(e),e.headers=go.from(e.headers),e.data=c_.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Y2.getAdapter(e.adapter||sp.adapter,e)(e).then(function(s){return h_(e),s.data=c_.call(e,e.transformResponse,s),s.headers=go.from(s.headers),s},function(s){return M2(s)||(h_(e),s&&s.response&&(s.response.data=c_.call(e,e.transformResponse,s.response),s.response.headers=go.from(s.response.headers))),Promise.reject(s)})}const X2="1.13.2",my={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{my[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const J2={};my.transitional=function(t,n,s){function o(i,r){return"[Axios v"+X2+"] Transitional option '"+i+"'"+r+(s?". "+s:"")}return(i,r,a)=>{if(t===!1)throw new zt(o(r," has been removed"+(n?" in "+n:"")),zt.ERR_DEPRECATED);return n&&!J2[r]&&(J2[r]=!0,console.warn(o(r," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,r,a):!0}},my.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function Pwe(e,t,n){if(typeof e!="object")throw new zt("options must be an object",zt.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let o=s.length;for(;o-- >0;){const i=s[o],r=t[i];if(r){const a=e[i],l=a===void 0||r(a,i,e);if(l!==!0)throw new zt("option "+i+" must be "+l,zt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new zt("Unknown option "+i,zt.ERR_BAD_OPTION)}}const vy={assertOptions:Pwe,validators:my},Rr=vy.validators;let wu=class{constructor(t){this.defaults=t||{},this.interceptors={request:new P2,response:new P2}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
|
|
249
249
|
`+i):s.stack=i}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=yu(this.defaults,n);const{transitional:s,paramsSerializer:o,headers:i}=n;s!==void 0&&vy.assertOptions(s,{silentJSONParsing:Rr.transitional(Rr.boolean),forcedJSONParsing:Rr.transitional(Rr.boolean),clarifyTimeoutError:Rr.transitional(Rr.boolean)},!1),o!=null&&(ke.isFunction(o)?n.paramsSerializer={serialize:o}:vy.assertOptions(o,{encode:Rr.function,serialize:Rr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),vy.assertOptions(n,{baseUrl:Rr.spelling("baseURL"),withXsrfToken:Rr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let r=i&&ke.merge(i.common,i[n.method]);i&&ke.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=go.concat(r,i);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let c,d=0,h;if(!l){const p=[Z2.bind(this),void 0];for(p.unshift(...a),p.push(...u),h=p.length,c=Promise.resolve(n);d<h;)c=c.then(p[d++],p[d++]);return c}h=a.length;let f=n;for(;d<h;){const p=a[d++],g=a[d++];try{f=p(f)}catch(v){g.call(this,v);break}}try{c=Z2.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=u.length;d<h;)c=c.then(u[d++],u[d++]);return c}getUri(t){t=yu(this.defaults,t);const n=B2(t.baseURL,t.url,t.allowAbsoluteUrls);return x2(n,t.params,t.paramsSerializer)}};ke.forEach(["delete","get","head","options"],function(t){wu.prototype[t]=function(n,s){return this.request(yu(s||{},{method:t,url:n,data:(s||{}).data}))}}),ke.forEach(["post","put","patch"],function(t){function n(s){return function(i,r,a){return this.request(yu(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}wu.prototype[t]=n(),wu.prototype[t+"Form"]=n(!0)});let Awe=class MB{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 s=this;this.promise.then(o=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](o);s._listeners=null}),this.promise.then=o=>{let i;const r=new Promise(a=>{s.subscribe(a),i=a}).then(o);return r.cancel=function(){s.unsubscribe(i)},r},t(function(i,r,a){s.reason||(s.reason=new yd(i,r,a),n(s.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=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new MB(function(o){t=o}),cancel:t}}};function kwe(e){return function(n){return e.apply(null,n)}}function Owe(e){return ke.isObject(e)&&e.isAxiosError===!0}const f_={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(f_).forEach(([e,t])=>{f_[t]=e});function Q2(e){const t=new wu(e),n=g2(wu.prototype.request,t);return ke.extend(n,wu.prototype,t,{allOwnKeys:!0}),ke.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Q2(yu(e,o))},n}const ns=Q2(sp);ns.Axios=wu,ns.CanceledError=yd,ns.CancelToken=Awe,ns.isCancel=M2,ns.VERSION=X2,ns.toFormData=hy,ns.AxiosError=zt,ns.Cancel=ns.CanceledError,ns.all=function(t){return Promise.all(t)},ns.spread=kwe,ns.isAxiosError=Owe,ns.mergeConfig=yu,ns.AxiosHeaders=go,ns.formToJSON=e=>k2(ke.isHTMLForm(e)?new FormData(e):e),ns.getAdapter=Y2.getAdapter,ns.HttpStatusCode=f_,ns.default=ns;const{Axios:_Re,AxiosError:RRe,CanceledError:DRe,isCancel:TRe,CancelToken:FRe,VERSION:IRe,all:xRe,Cancel:PRe,isAxiosError:Mwe,spread:ARe,toFormData:kRe,AxiosHeaders:ORe,HttpStatusCode:MRe,formToJSON:NRe,getAdapter:LRe,mergeConfig:VRe}=ns,Nwe=e=>{const n=`; ${document.cookie}`.split(`; ${e}=`);if(n.length===2){const s=n.pop();return(s==null?void 0:s.split(";").shift())??null}return null},Lwe=6e4,eB=e=>({[`/api/v1/workspace/${e}/item/2`]:1,[`/api/v1/workspace/${e}/item/2/metrics`]:5,default:5}),yy=new Map,tB=e=>{const t=e.match(/\/api\/v1\/workspace\/([^/]+)/);return t?t[1]:null},Vwe=e=>{const t=tB(e),n=eB(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default";yy.has(i)||yy.set(i,{ongoing:0,queue:[]});const r=yy.get(i);return new Promise(a=>{r?r.ongoing<n[i]?(r.ongoing++,a()):r.queue.push(()=>{r.ongoing++,a()}):a()})},nB=e=>{const t=tB(e),n=eB(t||"none"),o=new URL(e,"https://dummy.com").pathname,i=Object.keys(n).find(a=>a!=="default"&&o===a)||"default",r=yy.get(i);if(r&&(r.ongoing--,r.queue.length>0)){const a=r.queue.shift();setTimeout(()=>{a==null||a()},1e3)}},Bwe=(()=>{const e=ns.create({timeout:Lwe,headers:{"Content-Type":"application/json"}});return e.interceptors.request.use(async t=>{const n=t.url||"";await Vwe(n);const s=Nwe("account.token");return s&&t.headers&&(t.headers.Authorization=`Bearer ${s}`),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=>(nB(t.config.url||""),t),async t=>{var s,o;if(t.config&&nB(t.config.url||""),t.code==="ERR_NETWORK"||!navigator.onLine)return Promise.reject(t);const n=t.config;if(((s=t.response)==null?void 0:s.status)===429&&(!n._retryCount||n._retryCount<3)){n._retryCount=(n._retryCount||0)+1;const i=t.response.headers["retry-after"],r=i?parseInt(i)*1e3:Math.pow(2,n._retryCount)*1e3;return await new Promise(a=>setTimeout(a,r)),e(n)}return((o=t.response)==null?void 0:o.status)===401&&!n._retry&&(n._retry=!0),Promise.reject(t)}),e})();class ip extends Error{constructor(t,n,s,o,i){super(t),this.name="ApiError",this.statusCode=n,this.code=s,this.details=o,this.type=i,Object.setPrototypeOf(this,ip.prototype)}}const rp=e=>{var t,n;if(Mwe(e)){const s=(t=e.response)==null?void 0:t.status,o=(n=e.response)==null?void 0:n.data,i=(o==null?void 0:o.message)||e.message||"An unexpected error occurred",r=(o==null?void 0:o.code)||e.code,a=(o==null?void 0:o.details)||o;let l="UNKNOWN";return!s||e.code==="ERR_NETWORK"||e.code==="ECONNABORTED"?l=e.code==="ECONNABORTED"?"TIMEOUT":"NETWORK":s>=500?l="SERVER":s===bc.UNAUTHORIZED||s===bc.FORBIDDEN?l="AUTH":s===bc.UNPROCESSABLE_ENTITY||s===bc.BAD_REQUEST?l="VALIDATION":s>=bc.BAD_REQUEST&&(l="CLIENT"),new ip(i,s,r,a,l)}return e instanceof Error?new ip(e.message,void 0,void 0,void 0,"UNKNOWN"):new ip("An unknown error occurred",void 0,void 0,void 0,"UNKNOWN")};class $we{constructor(){this.axios=Bwe}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(([o,i])=>{i!=null&&i!==""&&(Array.isArray(i)?i.forEach(r=>n.append(o,String(r))):typeof i=="object"?n.append(o,JSON.stringify(i)):n.append(o,String(i)))});const s=n.toString();return s?`?${s}`:""}async get(t="",n,s){try{const o=this.buildUrl(t),i=n?this.buildQueryParams(n):"";return(await this.axios.get(`${o}${i}`,s)).data}catch(o){throw rp(o)}}async post(t="",n,s,o){try{const i=this.buildUrl(t),r=n?this.buildQueryParams(n):"";return(await this.axios.post(`${i}${r}`,s,o)).data}catch(i){throw rp(i)}}async put(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.put(o,n,s)).data}catch(o){throw rp(o)}}async patch(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.patch(o,n,s)).data}catch(o){throw rp(o)}}async delete(t="",n,s){try{const o=this.buildUrl(t);return(await this.axios.delete(o,{data:n,...s})).data}catch(o){throw rp(o)}}}const Hwe=({domainApi:e,wsCode:t,entityId:n})=>({list_cursor:{url:`${e}/v1/workspace/${t}/item/2`,method:"post",code:"list_cursor"},assignedUser:{url:`${e}/v1/workspace/${t}/item/2/assigned-users`,method:"post",code:"assignedUser"},metricValues:{url:`${e}/v1/workspace/${t}/item/2/metrics`,method:"post",code:"metricValues"},multipleAssignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"multipleAssignableUser"},assignableUser:{url:`${e}/v1/workspace/${t}/item/2/assignable-users`,method:"post",code:"assignableUser"},assignableStatus:{url:`${e}/v1/workspace/${t}/item/2/assignable-statuses`,method:"post",code:"assignableStatus"},delete_rendition:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-rendition`,method:"delete",code:"delete_rendition"},delete_thumbnail:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-thumbnail`,method:"delete",code:"delete_thumbnail"},archive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"archive_item"},unarchive_item:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"unarchive_item"},removeAssignee:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete-assignee`,method:"delete",code:"removeAssignee"},basicInfor:{url:`${e}/v1/workspace/${t}/tile/people/ws-user-roles/{userId}/basic-info`,method:"get",code:"basicInfor"},bulkDelete:{url:`${e}/v1/workspace/${t}/item/2/bulk-delete`,method:"delete",code:"bulkDelete"},bulkArchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkArchive"},bulkDateUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-date-update`,method:"put",code:"bulkDateUpdate"},bulkAssignUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-assignee-update`,method:"put",code:"bulkAssignUpdate"},bulkStatusUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-status-update`,method:"put",code:"bulkStatusUpdate"},bulkMetricUpdate:{url:`${e}/v1/workspace/${t}/item/2/bulk-metric-update`,method:"put",code:"bulkMetricUpdate"},getPermission:{url:`${e}/v1/workspace/${t}/item/2/permissions`,method:"post",code:"getPermission"},getUserPermission:{url:`${e}/v1/workspace/${t}/permissions`,method:"get",code:"getUserPermission"},bulkUnarchive:{url:`${e}/v1/workspace/${t}/item/2/bulk-archive`,method:"put",code:"bulkUnarchive"},downloadTemplate:{url:`${e}/v1/workspace/${t}/item/2/download-sample`,method:"get",code:"downloadTemplate"},importItems:{url:`${e}/v1/workspace/${t}/item/2/import-from-file`,method:"post",code:"importItems"},exportItems:{url:`${e}/v1/workspace/${t}/item/2/export`,method:"get",code:"exportItems"},updateFromFile:{url:`${e}/v1/workspace/${t}/item/2/update-from-file`,method:"post",code:"updateFromFile"},metricList:{url:`${e}/v1/workspace/${t}/entity/2/metrics`,method:"get",code:"metricList"},getEntityDetail:{url:`${e}/workspace/${t}/entities/${n}?include_permission=1`,method:"get",code:"getEntityDetail"},item:{url:`${e}/v1/workspace/${t}/item/2/update`,method:"put",code:"item"},me:{url:`${e}/v1/me`,method:"get",code:"me"},workspaces:{url:`${e}/v1/workspaces`,method:"get",code:"workspaces"},entityUserRoles:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"entityUserRoles"},templateFlowStatuses:{url:`${e}/workspace/${t}/entities/${n}/template_flow_statuses`,method:"get",code:"templateFlowStatuses"},createNewItem:{url:`${e}/v1/workspace/${t}/item/2/new?entity_id=${n}`,method:"post",code:"createNewItem"},getAssignableStatuses:{url:`${e}/v1/workspace/${t}/entity/2/assignable-statuses`,method:"get",code:"getAssignableStatuses"},getAssignableAssignees:{url:`${e}/v1/workspace/${t}/entity/2/users`,method:"get",code:"getAssignableAssignees"},getFilterStatuses:{url:`${e}/v1/workspace/${t}/entity/2/statuses`,method:"get",code:"getFilterStatuses"}}),Gwe=(e,t)=>{const n=new Blob([e]),s=globalThis.URL.createObjectURL(n),o=document.createElement("a");o.href=s,o.download=t,document.body.appendChild(o),o.click(),o.remove(),globalThis.URL.revokeObjectURL(s)};class sB extends $we{constructor(t,n){const s=n==null?void 0:n.domainApi,o=n==null?void 0:n.wsCode,i=(n==null?void 0:n.entityId)||"";super(),this.events=Object.create(null);const r=Hwe({domainApi:s,wsCode:o,entityId:i}),a={};Object.entries(r).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 s;((s=this.events)[t]??(s[t]=[])).push(n)}off(t,n){const s=this.events[t];s&&(this.events[t]=s.filter(o=>o!==n))}emit(t,...n){const s=this.events[t];s!=null&&s.length&&s.forEach(o=>{try{o(...n)}catch(i){console.error(`Error in event listener for ${t}:`,i)}})}buildHeaders(t){return typeof FormData<"u"&&t instanceof FormData?{"Content-Type":"multipart/form-data"}:{}}async _requestHandler({method:t,path:n,params:s,payload:o,code:i,responseType:r}){var u,c;const a=this.buildHeaders(o);let l;try{if(l=await this.axios.request({method:t,url:n,params:s,data:o,headers:a,responseType:r}),(((u=l.headers)==null?void 0:u["content-type"])||"").includes("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")){const h=((c=l.headers)==null?void 0:c["content-disposition"])||"",f=h.includes("filename=")?h.split("filename=")[1]:"exported_items.xlsx";Gwe(l.data,f)}if(l.status>=400&&l.status<=500)throw new Error(`Client error (${l.status}): ${l.statusText}`);return this.emit("call-api",{apiCode:i,path:n,params:s,payload:o,res:l,success:!0}),l.data}catch(d){throw console.error("API Request Error:",d),d.code==="ERR_NETWORK"||!navigator.onLine?this.emit("call-api",{path:n,params:s,payload:o,error:new Error("You are currently offline. Please check your network connection."),success:!1,apiCode:"offline"}):this.emit("call-api",{path:n,params:s,payload:o,error:d,success:!1,apiCode:i,res:d==null?void 0:d.response}),d}}generateUrl(t,n){let s=t;return Object.entries(n).forEach(([o,i])=>{s=s.replace(`{${o}}`,String(i))}),s}async request(t,n,s={}){const{url:o,code:i,method:r}=this.apiConfig[t],a=this.generateUrl(o,n);return this._requestHandler({method:r,path:a,params:s.params,payload:s.payload,code:i,responseType:s.responseType})}async getAllItem_cursor(t){var i;const n=t.workspaceId,s={entity_ids:((i=t.entityIds)==null?void 0:i.join(","))||"",cursor:t.cursor||void 0,per_page:t.pageSize||t.perPage||20,offset:t.offset||void 0,search:t.search||t.q||void 0,include_signature:1,include:"last_updated_by,property,last_completed_by",include_permission:"{include_permission}",assignee_any_ina:(t==null?void 0:t.assignee_any_ina)||"",assignee_all_ina:(t==null?void 0:t.assignee_all_ina)||void 0,with_not_assigned:t.with_not_assigned||void 0,status_ina:t.status_ina||void 0,status_eq:t.status_eq||void 0,start_date_gte:t.start_date_gte||void 0,start_date_lte:t.start_date_lte||void 0,start_date_btw:t.start_date_btw||void 0,due_date_gte:t.due_date_gte||void 0,due_date_lte:t.due_date_lte||void 0,due_date_btw:t.due_date_btw||void 0,condition_combine_type:t.condition_combine_type||"or",preflight_status:t.preflight_status||void 0},o=t.sortBy;return this.request("list_cursor",{workspaceId:n},{params:s,payload:{sort_by:o}})}async getAssignedUser(t){const n={item_ids:t.item_ids||[],metric_ids:t.metric_ids||[]},s={per_page:t.per_page};return this.request("assignedUser",{workspaceId:t.workspaceId},{params:s,payload:n})}async getMetricList({workspaceId:t,entityId:n,page:s,query:o,per_page:i}){return this.request("metricList",{workspaceId:t,entityId:n},{params:{status_ed:1,include:"metric_type",entity_id:n,include_permission:1,per_page:i||100,page:s||1,name_like:o||void 0}})}async getMetricValues({workspaceId:t,item_ids:n,per_page:s,metric_ids:o}){const i={item_ids:n,metric_ids:o};return this.request("metricValues",{workspaceId:t},{params:{per_page:s,include_permission:1},payload:i})}async multipleAssignableUser(t){const n=t.workspaceId,s=t.itemIds,o={page:t.page||1,per_page:t.perPage,display_name_like:t.q||"",item_ids:s||[]};return this.request("multipleAssignableUser",{workspaceId:n},{payload:o})}async getAssignableStatus(t){const n=t.workspaceId,s={item_ids:t.itemIds||[],page:t.page||1,per_page:t.perPage||10,name_like:t.name_like||""};return this.request("assignableStatus",{workspaceId:n||""},{payload:s})}async updateSceneName({workspaceId:t,entityId:n,itemId:s,name:o}){const i={item_id:s,entity_id:n,name:o,include:"item_user_roles"};return this.request("item",{workspaceId:t,itemId:s},{payload:i})}async deleteScene(t,n,s){const o={item_ids:[s]};return this.request("bulkDelete",{workspaceId:t,entityId:n},{payload:o})}async deleteThumbnail({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("delete_thumbnail",{workspaceId:t},{payload:o})}async deleteRendition({workspaceId:t,itemIds:n,deleteAll:s=!1,entityId:o}){const i={item_ids:n,delete_all:s?1:void 0,entity_id:o};return!n||n.length===0?i.item_ids=void 0:i.entity_id=void 0,this.request("delete_rendition",{workspaceId:t},{payload:i})}async archiveScene(t,n,s){const o={item_ids:s,status:0};return this.request("archive_item",{workspaceId:t,entityId:n},{payload:o})}async changeDate({workspaceId:t,itemIds:n,startDate:s,dueDate:o,entityId:i,filterParams:r}){const a={item_ids:n,start_date:s,due_date:o,entity_id:i};return this.request("bulkDateUpdate",{workspaceId:t},{payload:a,params:r})}async updateAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}createUpdateEntityPayload(t){const{itemIds:n,userIds:s,entityId:o}=t,i={item_ids:n,ws_user_role_ids:s,entity_id:o};return!n||n.length===0?(i.item_ids=void 0,i.entity_id=o):(i.item_ids=n,i.entity_id=void 0),i}async removeAssignee(t){const n=this.createUpdateEntityPayload(t);return this.request("removeAssignee",{workspaceId:t.workspaceId},{payload:n,params:t.filterParams})}async replaceAssignee(t){const{workspaceId:n,itemIds:s,userIds:o,entityId:i}=t,r={item_ids:s,ws_user_role_ids:o,entity_id:i};return this.request("bulkAssignUpdate",{workspaceId:n},{params:{replace:1,...t.filterParams},payload:r})}async addAssignee({workspaceId:t,itemIds:n,userIds:s,entityId:o,filterParams:i}){const r={item_ids:n,ws_user_role_ids:s,entity_id:o};return this.request("bulkAssignUpdate",{workspaceId:t},{payload:r,params:i})}async unAssignAll(t){const{workspaceId:n,entityId:s,itemIds:o,filterParams:i}=t,r={item_ids:o,entity_id:s,ws_user_role_ids:[]};return!o||o.length===0?r.item_ids=void 0:r.entity_id=void 0,this.request("removeAssignee",{workspaceId:n,entityId:String(s)},{payload:r,params:i})}async updateItemStatus(t){const{workspaceId:n,itemIds:s=[],statusId:o,entityId:i}=t,r={item_ids:s,template_flow_status_id:o};return s.length||(r.item_ids=void 0,r.entity_id=i),this.request("bulkStatusUpdate",{workspaceId:n},{payload:r,params:t.filterParams})}async getUserInformation(t,n){return this.request("basicInfor",{workspaceId:t,userId:n})}async bulkDeleteItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkDelete",{workspaceId:t},{payload:o})}async bulkUnarchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:1,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkUnarchive",{workspaceId:t},{payload:o})}async bulkArchiveItems({workspaceId:t,itemIds:n,entityId:s}){const o={item_ids:n,status:0,entity_id:s};return!n||n.length===0?o.item_ids=void 0:o.entity_id=void 0,this.request("bulkArchive",{workspaceId:t},{payload:o})}async bulkUpdateMetric(t){const{workspaceId:n,itemIds:s,metricId:o,value:i,clear:r}=t,a={item_ids:s,metric_id:o,metric_value:i,clear:r??(i==null?1:0),entity_id:t.entityId};return t.itemIds===void 0?(delete a.item_ids,a.entity_id=String(t.entityId)):(a.item_ids=s,a.entity_id=void 0),this.request("bulkMetricUpdate",{workspaceId:n},{payload:a,params:t.filterParams})}async getPermissionForItems({workspaceId:t,itemIds:n}){const s={item_ids:n};return this.request("getPermission",{workspaceId:t},{payload:s,params:{per_page:50}})}async unarchiveScene(t,n,s){const o={item_ids:s,status:1};return this.request("unarchive_item",{workspaceId:t,entityId:n},{payload:o})}async getUserPermission(t){return this.request("getUserPermission",{workspaceId:t})}async getEntityDetail(t,n){return this.request("getEntityDetail",{workspaceId:t,entityId:n})}async downloadTemplate(t,n){return this.request("downloadTemplate",{workspaceId:t,entityId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async downloadExportedItemsFile(t,n){return this.request("exportItems",{workspaceId:t,exportId:n},{responseType:"blob",params:{format:"xlsx",entity_id:n}})}async addNewSceneViaImportFile(t,n,s){return this.request("importItems",{workspaceId:t,entityId:n},{payload:s})}async overwriteScenesViaImportFile(t,n,s){return this.request("updateFromFile",{workspaceId:t,entityId:n},{payload:s})}async getMe(){return this.request("me",{})}async getWorkspaces(t){const n={page:1,per_page:1,"ws_user_role>status_eq":1,include:"owner",include_ws:t};return this.request("workspaces",{},{params:n})}async getEntityUserRoles(t){const{workspaceId:n,page:s,per_page:o,display_name_like:i,entity_ids:r}=t;return this.request("entityUserRoles",{workspaceId:n},{params:{page:s,per_page:o,display_name_like:i,entity_ids:r}})}async getTemplateFlowStatuses(t){const{workspaceId:n,entityId:s}=t;return this.request("templateFlowStatuses",{workspaceId:n,entityId:s},{params:{per_page:100,page:t.page??1,all:1,name_like:t.name_like}})}async addNewItem(t,n,s){return this.request("createNewItem",{workspaceId:t,entityId:n},{payload:s})}async getFilterStatuses(t,n,s){return this.request("getFilterStatuses",{workspaceId:t,entityId:n},{params:s})}async getAssignableStatuses(t,n){return this.request("getAssignableStatuses",{workspaceId:t},{params:n})}async getAssignableAssignees(t,n){return this.request("getAssignableAssignees",{workspaceId:t},{params:n})}}const Uwe=()=>{const e=yn.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},Wwe=e=>{var T,A,Y;const{showMessage:t,showErrorNetMessage:n}=Zh(),s=Cs(),o={domainApi:Uwe(),wsCode:yn.getInstance().getItem("ws.code"),entityId:e.value.entityId},i=(Y=(A=(T=s==null?void 0:s.appContext)==null?void 0:T.config)==null?void 0:A.globalProperties)==null?void 0:Y.apiConfig;if(!i||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const r=new sB(i,o);r.on("call-api",Z=>{Z.success?t(Z.apiCode,"success"):n(Z)});const a=No({}),l=L([]),u=L(!1),c=L(null),d=L(null),h=L(1),f=L(20);let p=Promise.resolve();const{setCachedUsers:g}=i7(),v=Z=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:Z}),C=50,b=async(Z,te,ie)=>{if(!Z.length)return[];const ee=g4(Z,te);return(await Promise.all(ee.map(ie))).flat()},S=async Z=>{try{return(await r.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:Z})).data.map(ie=>[ie.id,ie.permission])}catch(te){return console.error("Failed to fetch item permissions chunk:",te),[]}},y=async(Z,te)=>{try{const ie=await r.getMetricValues({workspaceId:e.value.workspaceId,item_ids:Z,per_page:Z.length*te.length,metric_ids:te}),ee=ie.data.map(le=>{const H=new Map(le.item_metrics.map(V=>[V.metric_id,{value:V.value,auth_permission:V==null?void 0:V.auth_permission}])),J=Object.fromEntries(te.map(V=>[V,H.get(V)??null]));return[le.id,J]}),G=new Set(ie.data.map(le=>le.id));for(const le of Z)if(!G.has(le)){const H=Object.fromEntries(te.map(J=>[J,{value:null,auth_permission:void 0}]));ee.push([le,H])}return ee}catch(ie){return console.error("Failed to fetch a chunk of metric values:",ie),Z.map(G=>[G,Object.fromEntries(te.map(le=>[le,void 0]))])}},R=async Z=>{try{const te=await r.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:Z,per_page:Z.length}),ie=te.data.flatMap(ee=>ee.assignees);return g(ie),te.data.map(ee=>[ee.id,ee.assignees])}catch(te){return console.error("Failed to fetch a chunk of assigned users:",te),[]}},E=async Z=>{if(!Z.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const te=await b(Z,C,S);return Object.fromEntries(te)}catch(te){return console.error("Failed to fetch item permissions:",te),{}}},F=async(Z,te)=>!Z.length||!te.length?{}:(p=p.then(async()=>{try{const G=[];let le=0;for(let J=0;J<te.length;J+=5){le++;const V=te.slice(J,J+5),se=[];for(let Ue=0;Ue<V.length;Ue++){const de=V[Ue],_e=await b(Z,C,X=>y(X,[de]));se.push(_e),await new Promise(X=>setTimeout(X,500))}G.push(...se);const ue=J+5>=te.length}const H={};for(const J of G.flat()){const[V,se]=J;H[V]||(H[V]={}),Object.assign(H[V],se)}return H}catch(ie){return console.error("Failed to fetch metric values:",ie),{}}}),p),k=async Z=>{if(!Z.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const te=await b(Z,C,R);return Object.fromEntries(te)}catch(te){return console.error("Failed to fetch assigned users:",te),{}}};return{items:l,loading:u,error:c,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async Z=>{const{cursor:te,offset:ie,size:ee,searchQuery:G}=Z;let le=[];u.value=!0,c.value=null;try{const H=await r.getAllItem_cursor({...Z,cursor:te||void 0,offset:ie||void 0,pageSize:ee||f.value,...v(G),sortBy:Z.sort_by});return l.value=H.data,d.value=H.meta,h.value=H.meta.current_page||0,le=H.data.map(J=>J.id),H}catch(H){throw c.value=H,console.error("Failed to fetch items (cursor):",H),H}finally{const H=async()=>{try{const[J,V]=await Promise.all([k(le),E(le)]);e.value.updateItemData({assignees:J,permission:V},le);const se=await F(le,e.value.metricIds);e.value.setMetricValues(se,new Set(le),e.value.metricIds)}catch(J){console.error("Post-fetch processing failed:",J)}};u.value=!1,setTimeout(H)}},getAssignableStatus:async Z=>{try{return await r.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:Z})}catch(te){throw console.error("Failed to fetch assignable status:",te),te}},getMetricList:async Z=>{try{return await r.getMetricList({workspaceId:e.value.workspaceId,entityId:Z})}catch(te){throw console.error("Failed to fetch metric list:",te),te}},getMetricValues:F,getAssignedUsers:k}};function zwe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const i=[],r=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(u=>{if(u.field&&u.field.startsWith("metric_")&&(u.hide===!1||u.hide===void 0))return u.field}).filter(Boolean);o.forEach(u=>{var d;const c=(d=e.value)==null?void 0:d.getRowNode(u);if(c){if(i.push(c),s.assignees){const h=zK((s.assignees[u]||[]).map(hx));c.data.assignees=h,r.add("assignees")}s.permission&&(c.data.permissions=s.permission[u]),l.forEach(h=>{c.data[h]=c.data[h]??null})}}),r.add("assignees"),r.add("status"),r.add("dateRange"),r.add("moreActions"),r.add("name"),e.value.refreshCells({rowNodes:i,columns:Array.from(r),force:!0})},setMetricValues:(s,o,i)=>{const r=e.value;if(!r)return;const a=new Map(Array.from(o).map(u=>[u,new Map(i.map(c=>[c,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([u,c])=>{Object.entries(c).forEach(([d,h])=>{var f;(f=a.get(u))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([u,c])=>{const d=r.getRowNode(u);return d!=null&&d.data?(c.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&r.refreshCells({rowNodes:l,columns:Array.from(i).map(u=>`metric_${u}`),force:!0})}}}function jwe(e,t,n,s,o){let i=!0;return{async getRows(r){try{s(!0),i&&(o(!0),i=!1);const a=Math.floor(r.startRow/t)+1,{rows:l,total:u}=await e({page:a,pageSize:t,filterText:n(),sort_by:r.sortModel});let c=-1;Number.isFinite(u)?c=u:l.length<t&&(c=r.startRow+l.length),r.context={pageSize:t,text:n()},r.successCallback(l,c),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),r.failCallback(),s(!1),o(!1)}}}}function Kwe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:i}=e,r=L(!0),a=L(!0),l=L(!1),u=()=>{n.value=!n.value},c=v=>{if(r.value=!1,o.value=v,!v)return null;const{addEventListener:C,setGridOption:b}=v;if(!i)return console.error("Fetcher function is undefined"),null;const S=jwe(i,e.perPage,()=>s.value,y=>{r.value=y},y=>{a.value=y});return b==null||b("datasource",S),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,b;if((C=o.value)==null||C.hideOverlay(),v!==void 0&&(s.value=v),(b=o.value)==null||b.deselectAll(),t.value=[],r.value=!0,!o.value||!i){console.error("Grid API or fetcher is not available"),r.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{r.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Ci(v=>{d(v)},nr),p=()=>{o.value},g=L(!1);return{isLoading:r,toggleSidebar:u,onGridReady:c,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const qwe={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},Ywe=e=>{var t;return(t=Object.entries(qwe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},Zwe={key:1},Xwe=_t(dt({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=L(null),o=e,i=()=>{s.value&&s.value.show()},r=L(""),a=L("idle"),l=L({file:null,format:null}),{apiServices:u}=Xn(!1,{}),c=L(!1),d=async()=>{c.value=!0;const F=o.workspaceId,k=o.entityId;if(!F||!k||!u.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await u.value.downloadExportedItemsFile(F,k))throw new Error("No response from downloadTemplate API")}catch(O){console.error("Error downloading template:",O)}c.value=!1},h=n,f=()=>{h("import-success"),b()},p=async F=>{var I,D,T;const k=new FormData,O=((I=F.name.split(".").pop())==null?void 0:I.toString())||"";if(k.append("file",F),k.append("format",O),k.append("entity_id",o.entityId||""),!u.value){console.error("API services not available");return}try{await u.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,k),g()}catch(A){throw console.error("Error uploading file:",A),v(((T=(D=A.response)==null?void 0:D.data)==null?void 0:T.message)||"An unknown error occurred during file upload."),A}},g=()=>{a.value="success"},v=F=>{r.value=F,a.value="error"},C=async()=>{!l.value||!l.value.file||await p(l.value.file)},b=()=>{var F;E(),(F=s.value)==null||F.hide()};t({close:b,open:i});const S=K(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),y=K(()=>l.value.file?!1:(console.error("No file selected"),!0)),R=L(null),E=()=>{var F;(F=R.value)==null||F.clear(),r.value="",l.value={file:null,format:null},a.value="idle"};return(F,k)=>(z(),ze(U(BA),{"popup-name":S.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:E},jd({default:ye(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(z(),ze(GO,{key:0,state:a.value,"error-message":r.value,overwrite:!0},null,8,["state","error-message"])):(z(),ae("div",Zwe,[pe("div",{class:q(F.$style["step-section"])},[pe("span",{class:q(F.$style["step-title"])},"Step 1: Download current data",2),pe("span",{class:q(F.$style["step-description"])},[...k[1]||(k[1]=[ot(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),pe("br",null,null,-1),pe("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),ce(U(mt),{class:q(F.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:c.value,onHandleClick:d},{prefix:ye(()=>[ce(U(lt),{src:"Download"})]),default:ye(()=>[k[2]||(k[2]=ot(" Download file ",-1))]),_:1},8,["class","disabled"])],2),pe("div",{class:q(F.$style["step-section"])},[pe("span",{class:q(F.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),ce(U(Rk),{modelValue:l.value,"onUpdate:modelValue":k[0]||(k[0]=O=>l.value=O),ref_key:"filUploaderRef",ref:R},null,8,["modelValue"])],2),pe("div",{class:q(F.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[ce(UO)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ye(()=>[ce(U(mt),{style:{flex:"1"},variant:"secondary",onClick:b},{default:ye(()=>[...k[3]||(k[3]=[ot(" Cancel ",-1)])]),_:1}),ce(U(mt),{disabled:y.value,style:{flex:"1"},variant:"primary",onClick:C},{default:ye(()=>[...k[4]||(k[4]=[ot(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ye(()=>[ce(U(mt),{style:{flex:"1"},variant:"primary",onClick:f},{default:ye(()=>[...k[5]||(k[5]=[ot(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:ye(()=>[ce(U(mt),{style:{flex:"1"},variant:"primary",onClick:E},{default:ye(()=>[...k[6]||(k[6]=[ot(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_lw86z_1","step-title":"_step-title_lw86z_11","step-title-2":"_step-title-2_lw86z_17","step-description":"_step-description_lw86z_23","date-format-guide":"_date-format-guide_lw86z_28","import-error":"_import-error_lw86z_39","drop-area":"_drop-area_lw86z_49","is-dragging":"_is-dragging_lw86z_49","drop-area-content":"_drop-area-content_lw86z_52",browse:"_browse_lw86z_61","download-sample-btn":"_download-sample-btn_lw86z_65"}}]]),Jwe={key:0},Qwe=_t(dt({__name:"OpenInTake",props:{entityId:{},workspaceId:{},loading:{type:Boolean}},setup(e){const t=qt,n=e,{triggerRef:s,popupRef:o}=Jn({placement:"bottom-end",offset:[0,0]}),i=yn.getInstance().getItem("BASE_REVIEW_URL"),r=yn.getInstance().getItem("BASE_URL"),a=()=>{const v=Ms({type:"review_take",config:{reviewDomain:i,ws_code:n.workspaceId,take_id:n.entityId}});window.open(v.url,"_blank")},l=()=>{const v=Ms({type:"update",config:{baseDomain:r,ws_code:n.workspaceId,entity_id:n.entityId}});window.open(v.url,"_blank")},u=()=>{const v=Ms({type:"woohoo",config:{baseDomain:r,ws_code:n.workspaceId,woohoo_id:n.entityId}});window.open(v.url,"_blank")},c=wm(),{userPermissions:d}=Bs(c),h=K(()=>d.value.includes(Cm)),f=K(()=>d.value.includes(SA)),p=K(()=>d.value.includes(bA)),g=oo;return(v,C)=>h.value||f.value||p.value?(z(),ae("div",Jwe,[pe("div",{ref_key:"triggerRef",ref:s},[qe((z(),ze(U(mt),{variant:["secondary","icon"],width:"32px","data-tab-index":6},{default:ye(()=>[ce(U(lt),{src:"ArrowUpRightFromSquare"})]),_:1})),[[U(g),{isLoading:e.loading,fullwidth:!0}],[U(t),"Open in"]])],512),pe("div",{ref_key:"popupRef",ref:o,style:{width:"200px"}},[h.value?(z(),ze(U(mt),{key:0,variant:"menu-item",style:{width:"200px",borderLeft:"0"},onClick:Pt(a,["stop"])},{prefix:ye(()=>[pe("div",{class:q(v.$style.icon)},[ce(U(lt),{src:"PenRuler",color:"#A6A6A6"})],2)]),default:ye(()=>[C[0]||(C[0]=ot(" Review ",-1))]),_:1})):Ze("",!0),f.value?(z(),ze(U(mt),{key:1,variant:"menu-item",style:{width:"200px",borderLeft:"0"},onClick:Pt(l,["stop"])},{prefix:ye(()=>[pe("div",{class:q(v.$style.icon)},[ce(U(lt),{src:"UserCheck",color:"#A6A6A6"})],2)]),default:ye(()=>[C[1]||(C[1]=ot(" Update ",-1))]),_:1})):Ze("",!0),p.value?(z(),ze(U(mt),{key:2,variant:"menu-item",style:{width:"200px",borderLeft:"0"},onClick:Pt(u,["stop"])},{prefix:ye(()=>[pe("div",{class:q(v.$style.icon)},[ce(U(lt),{src:"ChartPie",color:"#A6A6A6"})],2)]),default:ye(()=>[C[2]||(C[2]=ot(" Woohoo Details ",-1))]),_:1})):Ze("",!0)],512)])):Ze("",!0)}}),[["__cssModules",{$style:{icon:"_icon_a5uxo_1"}}]]),eCe={style:{cursor:"help"}},tCe=_t(dt({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=oo,s=wm(),{setUserPermissions:o,setEntityPermissions:i}=s,{entityPermissions:r}=Bs(s),a=qt,l=L(null),u={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},c=L(""),d=K(()=>{var Xe;const Ve=((Xe=r.value)==null?void 0:Xe.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!Ve},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!Ve,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!Ve,id:"overwrite_scenes_option"}]}),h=e;mf.initialize({wrapVueCellRenderer:nv,wrapVueCellEditor:KO});const f=zh(),{switchInstanceFunc:p}=Bs(f);Qt(()=>{const Ve=Cs();p.value=Ve==null?void 0:Ve.appContext.config.globalProperties.switchInstance,console.log("Switch instance set in store:",p.value)});const g=L(null),v=L([]),C=Em(),{rowCount:b}=Bs(C),S=L(!1),y=L(""),R=L(),E=FA(),{metricList:F}=Bs(E),k=L(""),O=L(!1),I=L(new Set),D=L(new Map),{apiServices:T}=Xn(!1,h),{columnDefs:A,checkboxColumn:Y,saveColumnConfig:Z}=dye(F,h.entityId,g),te=L();tt(()=>A,()=>{var Ve;(Ve=te.value)==null||Ve.updateColumnDefs(A.value)},{deep:!0});const ie=(Ve,Xe)=>{Z(Ve,Xe)},{updateRowData:ee,setMetricValues:G}=zwe(g),le=K(()=>({isSearching:y.value.length>0,isFiltering:!(Object.keys(we.value||{}).length==1&&Object.keys(we.value)[0]=="preflight_status")&&Object.keys(we.value||{}).length>0})),H=K(Jg),J=K(()=>A.value.filter(Ve=>{var Xe;return((Xe=Ve.field)==null?void 0:Xe.startsWith("metric_"))&&!Ve.hide}).map(Ve=>{var Xe;return((Xe=Ve.field)==null?void 0:Xe.replace("metric_",""))||""}));zi("timezone",H);const V=K(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:J.value,updateItemData:ee,setMetricValues:G})),{fetchItems:se,getMetricList:ue,cusorMap:Ue,getMetricValues:de}=Wwe(V),_e=K(()=>{if(!g.value)return!1;const Ve=g.value.getSelectedRows().length;return Ve>0&&Ve>=b.value.total}),X=K(()=>{var Ve;return((Ve=l.value)==null?void 0:Ve.name)||"Items"}),Ee=(Ve,Xe)=>{var en,bn,Li;b.value.total=Ve.meta.total??0,(en=Ve.meta.next)!=null&&en.cursor&&(Ue[Xe+1]=Ve.meta.next.cursor),k.value=Ve.meta["X-Tsr-signature"]||"",Ve.meta.total===0?(bn=g.value)==null||bn.showNoRowsOverlay():(Li=g.value)==null||Li.hideOverlay()},Pe=_k(),$e=L(null),{sortingAPIConfiguration:W,isSortingRunning:ne}=Bs(Pe),we=L({preflight_status:"1"}),Le=K(()=>({...we.value,search:y.value}));zi("filterParams",Le);const Ae=L([]),P=async({page:Ve,pageSize:Xe,filterText:en})=>{var Vi;(Vi=g.value)==null||Vi.hideOverlay();const bn=Ue[Ve],Li=!bn&&Ve>1?(Ve-1)*Xe:void 0,wy=W.value;wy.length>0&&(ne.value=!0);try{const Ed={cursor:bn,size:Xe,searchQuery:en,offset:Li,sort_by:wy,...we.value},Bi=await se(Ed);if(!Bi)return{rows:[],total:0};const ap=(Wn=>{const Ir=Wn.data.map(mo=>px(mo,H.value));return Ir.forEach(mo=>{I.value.add(String(mo.id)),D.value.set(String(mo.id),{})}),Ir})(Bi);return Ee(Bi,Ve),{rows:ap,total:b.value.total}}catch(Ed){return console.error("Failed to fetch items:",Ed),{rows:[],total:0}}finally{ne.value=!1}},{isLoading:M,toggleSidebar:j,onGridReady:fe,handleUnSelect:Fe,handleSelectAll:je,onSearch:Be,firstLoad:he}=Kwe({selectRowData:L([]),isSidebarOpen:S,quickFilterText:y,gridApi:g,perPage:u.ROWS_PER_PAGE,fetcher:P}),Te=L([]),Je=()=>{var Ve;Te.value=((Ve=g.value)==null?void 0:Ve.getSelectedRows())||[]},yt=No({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),Vt=K(()=>({blockLoadDebounceMillis:1e3,columnDefs:A.value,rowModelType:"infinite",cacheBlockSize:u.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!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:dn,noRowsOverlayComponent:nv(SX),noRowsOverlayComponentParams:()=>le.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:Ve=>Ve.data.id,getRowClass:Ve=>{if(!Ve.data)return["row-empty"];const Xe=["row-highlight"];return Ve.data.id||Xe.push("row-inactive"),Ve.data.isDeleted&&Xe.push("row-deleted"),Ve.data.disabled&&Xe.push("row-deleted"),Ve.data.isArchived&&Xe.push("row-archived"),Xe},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:T.value,sorting:ne.value},suppressKeyboardEvent:Ve=>{const Xe=Ve.event.key;return Ve.editing&&Xe==="Enter"?!1:Xe==="Enter"?(Ve.event.preventDefault(),Ve.event.stopPropagation(),!0):Xe==="ArrowUp"||Xe==="ArrowDown"||Xe==="ArrowLeft"||Xe==="ArrowRight"||Xe==="Tab"||Xe==="Enter"},navigateToNextCell:()=>null,onBodyScroll:Ve=>{const Xe=Ve.api.getFirstDisplayedRowIndex(),en=Ve.api.getLastDisplayedRowIndex();yt.rowsDisplay.fromIndex=Xe,yt.rowsDisplay.toIndex=en,yt.columnsDisplay=Ve.api.getAllDisplayedVirtualColumns().map(bn=>bn.getColId())},onViewportChanged:Ve=>{yt.columnsDisplay=Ve.api.getAllDisplayedVirtualColumns().map(Xe=>Xe.getColId())},suppressHeaderFocus:!0}));function dn(){if(!g.value)return;let Ve=0;g.value.forEachNode(Xe=>{Xe.data&&Ve++}),b.value.loaded=Math.min(Ve,b.value.total)}tt(()=>W,()=>{g.value&&(k.value="",I.value.clear(),g.value.deselectAll(),Object.keys(Ue).forEach(Ve=>delete Ue[Number(Ve)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const Ht=L(),mn=L(),ds=()=>{var Ve;(Ve=mn.value)==null||Ve.open()},Me=()=>{var Ve;(Ve=Ht.value)==null||Ve.open()},Ge=async()=>{he.value=!0,g.value&&(k.value="",I.value.clear(),Object.keys(Ue).forEach(Ve=>delete Ue[Number(Ve)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},Ct=K(()=>yn.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),At=L(),Gt=K(()=>{var Ve;return(Ve=Ywe(Ct.value))==null?void 0:Ve.map(Xe=>`<div>• ${Xe}</div>`).join(`
|
|
250
|
-
`)});function et(Ve){var Xe;Ve==="new_scene"?(Xe=At.value)==null||Xe.show():Ve==="import_scenes"?Me():Ve==="overwrite_scenes"&&ds()}const _s=Ve=>{v.value=Ve.api.getSelectedRows().map(Xe=>Xe.id)},Mi=Ve=>{const Xe=fe(Ve);return Xe&&(Xe.addEventListener("modelUpdated",dn),Xe.addEventListener("bodyScroll",()=>Xe.stopEditing()),Xe.addEventListener("selectionChanged",Je),Xe.addEventListener("columnMoved",bn=>ie(bn,!0)),Xe.addEventListener("columnResized",bn=>ie(bn,!0)),Xe.addEventListener("firstDataRendered",()=>{he.value=!1}),!document.querySelector(".ag-body-viewport")),Xe},Dr=()=>{var Ve;c.value=(((Ve=document.getElementById("item-table-layout-id"))==null?void 0:Ve.clientHeight)??0)-78+"px"};Qt(()=>{Dt(()=>{Dr()}),window.addEventListener("resize",Dr);function Ve(){requestAnimationFrame(Ve)}Ve()}),Yn(()=>{window.removeEventListener("resize",Dr)});const ai=async({code:Ve,name:Xe})=>{await Be(Ve),setTimeout(()=>{var en;(en=R.value)==null||en.setValue(Xe)},300)},fa=Ve=>{if(!g.value)return;const Xe=g.value.getRowNode(Ve);Xe?(g.value.ensureIndexVisible(Number(Xe.rowIndex),"middle"),g.value.flashCells({rowNodes:[Xe],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(b.value.total-1,"bottom")},il=Ve=>Ve.metric_type.code==="number"?"number":"default",Tr=async()=>{if(h.entityId)try{const Ve=await ue(h.entityId);F.value=Ve.data.map(Xe=>({...Xe,sortType:il(Xe)}))}catch(Ve){console.error("Failed to initialize metric list:",Ve),F.value=[]}},Fr=async()=>{if(T.value)try{const Ve=await T.value.getUserPermission(h.workspaceId);o(Ve)}catch(Ve){console.error("Failed to fetch user permissions:",Ve)}},li=async()=>{if(T.value)try{const Ve=await T.value.getEntityDetail(h.workspaceId,h.entityId);i(Ve.permission),l.value=Ve}catch(Ve){console.error("Failed to fetch entity details:",Ve)}},Ni=jm(),{setUser:wd}=Ni,xn=async()=>{if(T.value)try{const Ve=await T.value.getMe();return wd(Ve),Ve}catch(Ve){console.error("Failed to fetch user details:",Ve)}},hs=async()=>{var Ve;if(T.value)try{const Xe=await T.value.getWorkspaces(h.workspaceId),en=(Ve=Xe.data[0])==null?void 0:Ve.ws_user_role_id;return en&&Ni.setUserRoleId(en),Xe}catch(Xe){console.error("Failed to fetch workspace details:",Xe)}};tt(()=>[h.entityId,h.workspaceId],async([Ve,Xe])=>{!Ve||!Xe||(xn(),hs(),Tr(),Fr(),li())},{immediate:!0,deep:!0}),tt(J,(Ve,Xe)=>{const en=Ve.filter(bn=>!(Xe!=null&&Xe.includes(bn)));en.length>0&&de(Array.from(I.value),en).then(bn=>{G(bn,I.value,en)})},{immediate:!0,deep:!0}),tt(k,(Ve,Xe)=>{O.value=!!(Xe&&Ve&&Xe!==Ve)}),t({refreshTable:Ge});const g_=Ve=>{we.value=Ve,Ge()},Cd=Ve=>{Ae.value=Ve,Ge()},bd=Ve=>{A.value=Ve||[],ie({},!0)},Sd=K(()=>{var bn;const Ve=yn.getInstance().getItem("ws.terminology");return`New ${((bn=(Ve?JSON.parse(Ve):null).find(Li=>Li.code==="scene"))==null?void 0:bn.name)||"Scene"}`});return(Ve,Xe)=>(z(),ze(U(jY),{"is-sidebar-open":S.value,onCloseSidebar:U(j),onSidebarClear:U(j),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U(j)},{"header-left":ye(()=>{var en;return[((en=U(r))==null?void 0:en.has_create_item_permission)==1?(z(),ze(U(qb),{key:0,variant:["primary"],options:d.value,onSelect:et,onHandleClick:Xe[1]||(Xe[1]=bn=>et("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ye(()=>[ce(U(mt),{"data-tab-index":1,"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Xe[0]||(Xe[0]=bn=>et("new_scene")),label:Sd.value},null,8,["label"])]),_:1},8,["options"])):Ze("",!0),pe("div",{class:q(Ve.$style["beta-tag"])},"Beta",2),qe((z(),ae("span",eCe,[ot(bt(Ct.value),1)])),[[U(a),Gt.value||""]])]}),"header-actions":ye(()=>[ce(U(sJ),{"onUpdate:assignees":Cd,onApplyFilter:g_,loading:U(he),entityId:h.entityId},null,8,["loading","entityId"]),qe(ce(U(jb),{"data-tab-index":4,modelValue:y.value,"onUpdate:modelValue":Xe[2]||(Xe[2]=en=>y.value=en),onSearch:U(Be),class:q(Ve.$style.itemSearchBox),onClear:Xe[3]||(Xe[3]=en=>U(Be)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:R},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(he),fullwidth:!0}]]),qe((z(),ze(U(EA),{status:U(M)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":O.value},{default:ye(()=>[qe((z(),ze(U(mt),{"data-tab-index":5,variant:["secondary","icon"],disabled:U(M),onClick:Ge},{default:ye(()=>[ce(U(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(he),fullwidth:!0}]]),ce(Qwe,{loading:U(he),entityId:h.entityId,workspaceId:h.workspaceId},null,8,["loading","entityId","workspaceId"]),qe(ce(U(vX),{"model-value":U(A),onChange:Xe[4]||(Xe[4]=en=>bd(en)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:te,"checkbox-column":U(Y),tableHeight:c.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(he),fullwidth:!0}]])]),grid:ye(({availableHeight:en})=>[ce(U(rye),Kt({id:"item_table_main",ref_key:"agGrid",ref:$e},Vt.value,{height:en+"px",isSorting:U(ne),onOnGridReady:Mi,onSelectionChanged:_s}),null,16,["height","isSorting"])]),footer:ye(()=>[pe("div",{class:q(Ve.$style.tableFooter),id:"table_footer"},[pe("span",null,[Xe[5]||(Xe[5]=ot(" Showing ",-1)),pe("b",null,bt(U(b).loaded)+" of "+bt(U(b).total),1)])],2)]),"new-row":ye(()=>[ce(U(MX),{ref_key:"createNewSceneRef",ref:At,onSearchForCode:ai,onFocusOnId:fa},null,512)]),"bulk-update-actions":ye(()=>[qe(ce(U(LY),{selectRowData:Te.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Fe),onSelectAll:U(je),"take-name":X.value,"selected-all":_e.value,"total-rows":U(b).total,"visible-rows":U(b).loaded,onUpdated:Je,loading:U(M)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"]),[[Yi,!S.value&&v.value.length>0]])]),snackbar:ye(()=>[ce(U(TZ))]),popup:ye(()=>[ce($ee,{ref_key:"popupCreateSceneRef",ref:Ht,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ge},null,8,["workspace-id","entity-id"]),ce(Xwe,{ref_key:"popupOverwriteScenesRef",ref:mn,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ge},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),oB="0.1.
|
|
250
|
+
`)});function et(Ve){var Xe;Ve==="new_scene"?(Xe=At.value)==null||Xe.show():Ve==="import_scenes"?Me():Ve==="overwrite_scenes"&&ds()}const _s=Ve=>{v.value=Ve.api.getSelectedRows().map(Xe=>Xe.id)},Mi=Ve=>{const Xe=fe(Ve);return Xe&&(Xe.addEventListener("modelUpdated",dn),Xe.addEventListener("bodyScroll",()=>Xe.stopEditing()),Xe.addEventListener("selectionChanged",Je),Xe.addEventListener("columnMoved",bn=>ie(bn,!0)),Xe.addEventListener("columnResized",bn=>ie(bn,!0)),Xe.addEventListener("firstDataRendered",()=>{he.value=!1}),!document.querySelector(".ag-body-viewport")),Xe},Dr=()=>{var Ve;c.value=(((Ve=document.getElementById("item-table-layout-id"))==null?void 0:Ve.clientHeight)??0)-78+"px"};Qt(()=>{Dt(()=>{Dr()}),window.addEventListener("resize",Dr);function Ve(){requestAnimationFrame(Ve)}Ve()}),Yn(()=>{window.removeEventListener("resize",Dr)});const ai=async({code:Ve,name:Xe})=>{await Be(Ve),setTimeout(()=>{var en;(en=R.value)==null||en.setValue(Xe)},300)},fa=Ve=>{if(!g.value)return;const Xe=g.value.getRowNode(Ve);Xe?(g.value.ensureIndexVisible(Number(Xe.rowIndex),"middle"),g.value.flashCells({rowNodes:[Xe],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(b.value.total-1,"bottom")},il=Ve=>Ve.metric_type.code==="number"?"number":"default",Tr=async()=>{if(h.entityId)try{const Ve=await ue(h.entityId);F.value=Ve.data.map(Xe=>({...Xe,sortType:il(Xe)}))}catch(Ve){console.error("Failed to initialize metric list:",Ve),F.value=[]}},Fr=async()=>{if(T.value)try{const Ve=await T.value.getUserPermission(h.workspaceId);o(Ve)}catch(Ve){console.error("Failed to fetch user permissions:",Ve)}},li=async()=>{if(T.value)try{const Ve=await T.value.getEntityDetail(h.workspaceId,h.entityId);i(Ve.permission),l.value=Ve}catch(Ve){console.error("Failed to fetch entity details:",Ve)}},Ni=jm(),{setUser:wd}=Ni,xn=async()=>{if(T.value)try{const Ve=await T.value.getMe();return wd(Ve),Ve}catch(Ve){console.error("Failed to fetch user details:",Ve)}},hs=async()=>{var Ve;if(T.value)try{const Xe=await T.value.getWorkspaces(h.workspaceId),en=(Ve=Xe.data[0])==null?void 0:Ve.ws_user_role_id;return en&&Ni.setUserRoleId(en),Xe}catch(Xe){console.error("Failed to fetch workspace details:",Xe)}};tt(()=>[h.entityId,h.workspaceId],async([Ve,Xe])=>{!Ve||!Xe||(xn(),hs(),Tr(),Fr(),li())},{immediate:!0,deep:!0}),tt(J,(Ve,Xe)=>{const en=Ve.filter(bn=>!(Xe!=null&&Xe.includes(bn)));en.length>0&&de(Array.from(I.value),en).then(bn=>{G(bn,I.value,en)})},{immediate:!0,deep:!0}),tt(k,(Ve,Xe)=>{O.value=!!(Xe&&Ve&&Xe!==Ve)}),t({refreshTable:Ge});const g_=Ve=>{we.value=Ve,Ge()},Cd=Ve=>{Ae.value=Ve,Ge()},bd=Ve=>{A.value=Ve||[],ie({},!0)},Sd=K(()=>{var bn;const Ve=yn.getInstance().getItem("ws.terminology");return`New ${((bn=(Ve?JSON.parse(Ve):null).find(Li=>Li.code==="scene"))==null?void 0:bn.name)||"Scene"}`});return(Ve,Xe)=>(z(),ze(U(jY),{"is-sidebar-open":S.value,onCloseSidebar:U(j),onSidebarClear:U(j),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:U(j)},{"header-left":ye(()=>{var en;return[((en=U(r))==null?void 0:en.has_create_item_permission)==1?(z(),ze(U(qb),{key:0,variant:["primary"],options:d.value,onSelect:et,onHandleClick:Xe[1]||(Xe[1]=bn=>et("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ye(()=>[ce(U(mt),{"data-tab-index":1,"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Xe[0]||(Xe[0]=bn=>et("new_scene")),label:Sd.value},null,8,["label"])]),_:1},8,["options"])):Ze("",!0),pe("div",{class:q(Ve.$style["beta-tag"])},"Beta",2),qe((z(),ae("span",eCe,[ot(bt(Ct.value),1)])),[[U(a),Gt.value||""]])]}),"header-actions":ye(()=>[ce(U(sJ),{"onUpdate:assignees":Cd,onApplyFilter:g_,loading:U(he),entityId:h.entityId},null,8,["loading","entityId"]),qe(ce(U(jb),{"data-tab-index":4,modelValue:y.value,"onUpdate:modelValue":Xe[2]||(Xe[2]=en=>y.value=en),onSearch:U(Be),class:q(Ve.$style.itemSearchBox),onClear:Xe[3]||(Xe[3]=en=>U(Be)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:R},null,8,["modelValue","onSearch","class"]),[[U(n),{isLoading:U(he),fullwidth:!0}]]),qe((z(),ze(U(EA),{status:U(M)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":O.value},{default:ye(()=>[qe((z(),ze(U(mt),{"data-tab-index":5,variant:["secondary","icon"],disabled:U(M),onClick:Ge},{default:ye(()=>[ce(U(lt),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[U(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[U(n),{isLoading:U(he),fullwidth:!0}]]),ce(Qwe,{loading:U(he),entityId:h.entityId,workspaceId:h.workspaceId},null,8,["loading","entityId","workspaceId"]),qe(ce(U(vX),{"model-value":U(A),onChange:Xe[4]||(Xe[4]=en=>bd(en)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:te,"checkbox-column":U(Y),tableHeight:c.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[U(n),{isLoading:U(he),fullwidth:!0}]])]),grid:ye(({availableHeight:en})=>[ce(U(rye),Kt({id:"item_table_main",ref_key:"agGrid",ref:$e},Vt.value,{height:en+"px",isSorting:U(ne),onOnGridReady:Mi,onSelectionChanged:_s}),null,16,["height","isSorting"])]),footer:ye(()=>[pe("div",{class:q(Ve.$style.tableFooter),id:"table_footer"},[pe("span",null,[Xe[5]||(Xe[5]=ot(" Showing ",-1)),pe("b",null,bt(U(b).loaded)+" of "+bt(U(b).total),1)])],2)]),"new-row":ye(()=>[ce(U(MX),{ref_key:"createNewSceneRef",ref:At,onSearchForCode:ai,onFocusOnId:fa},null,512)]),"bulk-update-actions":ye(()=>[qe(ce(U(LY),{selectRowData:Te.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:U(Fe),onSelectAll:U(je),"take-name":X.value,"selected-all":_e.value,"total-rows":U(b).total,"visible-rows":U(b).loaded,onUpdated:Je,loading:U(M)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"]),[[Yi,!S.value&&v.value.length>0]])]),snackbar:ye(()=>[ce(U(TZ))]),popup:ye(()=>[ce($ee,{ref_key:"popupCreateSceneRef",ref:Ht,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ge},null,8,["workspace-id","entity-id"]),ce(Xwe,{ref_key:"popupOverwriteScenesRef",ref:mn,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:Ge},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"]))}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),oB="0.1.32",nCe={key:0},sCe=_t(dt({__name:"app",setup(e){const t=K(()=>n.id.length===0||n.workspaceId.length===0),n=No({id:"",workspaceId:"",apiConfig:{}}),s=Zh(),{showMessage:o,showErrorNetMessage:i}=s,r=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):r.includes(h.apiCode)||i(h)},l=L(null),u=()=>{const h=yn.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};zp(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",oB);try{if(l.value=Cs(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||yn.getInstance().getItem("ws.code");const g={domainApi:u(),wsCode:yn.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new sB(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),Yn(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const c=K(()=>n.id),d=K(()=>n.workspaceId);return zi("workspaceId",d),zi("entityId",c),(h,f)=>(z(),ae("div",{class:q(h.$style.dashboardPluginWrapper)},[t.value?(z(),ae("span",nCe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):c.value?(z(),ze(U(tCe),{key:1,entityId:c.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Ze("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),p_=async(e={},t={})=>{const n=gT(sCe),s=xq();n.use(s);const o=["apiConfig","workspaceId","id"],i={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,i[a]=l,o.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=i,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,u)=>{console.error("[Vue Error]",a),u&&console.error("[Info]",u)},console.log(`%cArbo Dashboard Plugin v${oB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",qt);const r=await Lee();return n.use(r),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=p_),Pn.default=p_,Pn.initDashboard=p_,Object.defineProperties(Pn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|