@26lights/orcha 0.42.77 → 0.42.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/orcha.cjs.js
CHANGED
|
@@ -51,8 +51,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
51
51
|
`);let u=!1;const d=[];for(let f=0;f<c.length;f++){const p=c[f].trimEnd(),h=d[d.length-1];mue.test(p)?d.push(p):gg.test(p)||Hc.test(p)?(u=!u,d.push(p)):u||p===""||h===""||!h||qc.test(h)||qc.test(p)||mg.test(p)||pg.test(p)||hg.test(p)||hue.test(p)||gue.test(p)||vue.test(p)||!l||op.test(p)||rp.test(p)||ip(rp).test(h)||ip(op).test(h)||Hc.test(h)?d.push(p):d[d.length-1]=h+" "+p.trimStart()}return d.join(`
|
|
52
52
|
`)}(t,r);return uue(e,o)(s,n)}function Due(t=Yu,e,n=!1){return function(r,s=!1){const a=Ku(r),l=[...a.multilineElement,...a.element],c=!s,u=a.textFormat.filter(d=>d.format.length===1).sort((d,f)=>Number(d.format.includes("code"))-Number(f.format.includes("code")));return d=>{const f=[],p=(d||Le()).getChildren();for(let h=0;h<p.length;h++){const m=p[h],g=lue(m,l,u,a.textMatch);g!=null&&f.push(c&&h>0&&!Uc(m)&&!Uc(p[h-1])?`
|
|
53
53
|
`.concat(g):g)}return f.join(`
|
|
54
|
-
`)}}(t,n)(e)}var Mue=process.env.NODE_ENV==="production",oc="Invariant failed";function $ue(t,e){if(!t){if(Mue)throw new Error(oc);var n=typeof e=="function"?e():e,o=n?"".concat(oc,": ").concat(n):oc;throw new Error(o)}}const Ng=Symbol("LexicalEditor"),Bue=(()=>{const t=i.defineComponent({name:"LexicalComposer",props:{initialConfig:{required:!0}},emits:["error"],setup(e,n){let{emit:o,expose:r}=n;const s=o;r();const a=e,l={tag:Ai},{theme:c,namespace:u,nodes:d,onError:f,editorState:p,html:h}=a.initialConfig,m=zle({editable:a.initialConfig.editable,html:h,namespace:u,nodes:d,theme:c,onError(C){s("error",C,m),f==null||f(C,m)}});g(m,p);function g(C,_){if(_!==null){if(_===void 0)C.update(()=>{const y=Le();if(y.isEmpty()){const v=De();y.append(v);const w=yce?document.activeElement:null;(te()!==null||w!==null&&w===C.getRootElement())&&v.select()}},l);else if(_!==null)switch(typeof _){case"string":{const y=C.parseEditorState(_);C.setEditorState(y,l);break}case"object":C.setEditorState(_,l);break;case"function":C.update(()=>{Le().isEmpty()&&_(C)},l);break}}}return i.provide(Ng,m),i.onMounted(()=>{const C=a.initialConfig.editable;m.setEditable(C!==void 0?C:!0)}),(C,_)=>i.renderSlot(C.$slots,"default")}});return t.__vue_vine=!0,t})();function Gr(){const t=i.inject(Ng,null);return t||$ue(!1,"useLexicalComposer: cannot find a LexicalComposer"),t}function Oue(t,e){if(t==null)return{};var n=Lue(t,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)o=s[r],e.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function Lue(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,s;for(s=0;s<o.length;s++)r=o[s],e.indexOf(r)>=0||(n[r]=t[r]);return n}const Iue=(()=>{const t=["aria-activedescendant","aria-autocomplete","aria-controls","aria-describedby","aria-expanded","aria-label","aria-labelledby","aria-multiline","aria-owns","aria-readonly","aria-required","autocapitalize","contenteditable","role","spellcheck","tabindex"],e=i.defineComponent({name:"ContentEditableElement",props:{editor:{required:!0},ariaActiveDescendant:{},ariaAutoComplete:{},ariaControls:{},ariaDescribedBy:{},ariaErrorMessage:{},ariaExpanded:{type:Boolean},ariaInvalid:{type:Boolean},ariaLabel:{},ariaLabelledBy:{},ariaMultiline:{type:Boolean},ariaOwns:{},ariaRequired:{type:Boolean},onCopy:{},onCut:{},onPaste:{},onCompositionend:{},onCompositionstart:{},onCompositionupdate:{},onDrag:{},onDragend:{},onDragenter:{},onDragexit:{},onDragleave:{},onDragover:{},onDragstart:{},onDrop:{},onFocus:{},onFocusin:{},onFocusout:{},onBlur:{},onChange:{},onBeforeinput:{},onFormdata:{},onInput:{},onReset:{},onSubmit:{},onInvalid:{},onFullscreenchange:{},onFullscreenerror:{},onLoad:{},onError:{},onKeydown:{},onKeypress:{},onKeyup:{},onDblclick:{},onMousedown:{},onMouseenter:{},onMouseleave:{},onMousemove:{},onMouseout:{},onMouseover:{},onMouseup:{},onAbort:{},onCanplay:{},onCanplaythrough:{},onDurationchange:{},onEmptied:{},onEncrypted:{},onEnded:{},onLoadeddata:{},onLoadedmetadata:{},onLoadstart:{},onPause:{},onPlay:{},onPlaying:{},onProgress:{},onRatechange:{},onSeeked:{},onSeeking:{},onStalled:{},onSuspend:{},onTimeupdate:{},onVolumechange:{},onWaiting:{},onSelect:{},onScroll:{},onScrollend:{},onTouchcancel:{},onTouchend:{},onTouchmove:{},onTouchstart:{},onAuxclick:{},onClick:{},onContextmenu:{},onGotpointercapture:{},onLostpointercapture:{},onPointerdown:{},onPointermove:{},onPointerup:{},onPointercancel:{},onPointerenter:{},onPointerleave:{},onPointerover:{},onPointerout:{},onBeforetoggle:{},onToggle:{},onWheel:{},onAnimationcancel:{},onAnimationstart:{},onAnimationend:{},onAnimationiteration:{},onSecuritypolicyviolation:{},onTransitioncancel:{},onTransitionend:{},onTransitionrun:{},onTransitionstart:{},innerHTML:{},class:{},style:{type:Boolean},accesskey:{},contenteditable:{type:Boolean},contextmenu:{},dir:{},draggable:{type:Boolean},hidden:{type:Boolean},id:{},inert:{type:Boolean},lang:{},spellcheck:{type:Boolean},tabindex:{},title:{},translate:{},radiogroup:{},role:{},about:{},datatype:{},inlist:{},prefix:{},property:{},resource:{},typeof:{},vocab:{},autocapitalize:{},autocorrect:{},autosave:{},color:{},itemprop:{},itemscope:{type:Boolean},itemtype:{},itemid:{},itemref:{},results:{},security:{},unselectable:{},inputmode:{},is:{},"aria-activedescendant":{},"aria-atomic":{type:Boolean},"aria-autocomplete":{},"aria-busy":{type:Boolean},"aria-checked":{type:Boolean},"aria-colcount":{},"aria-colindex":{},"aria-colspan":{},"aria-controls":{},"aria-current":{type:Boolean},"aria-describedby":{},"aria-details":{},"aria-disabled":{type:Boolean},"aria-dropeffect":{},"aria-errormessage":{},"aria-expanded":{type:Boolean},"aria-flowto":{},"aria-grabbed":{type:Boolean},"aria-haspopup":{type:Boolean},"aria-hidden":{type:Boolean},"aria-invalid":{type:Boolean},"aria-keyshortcuts":{},"aria-label":{},"aria-labelledby":{},"aria-level":{},"aria-live":{},"aria-modal":{type:Boolean},"aria-multiline":{type:Boolean},"aria-multiselectable":{type:Boolean},"aria-orientation":{},"aria-owns":{},"aria-placeholder":{},"aria-posinset":{},"aria-pressed":{type:Boolean},"aria-readonly":{type:Boolean},"aria-relevant":{},"aria-required":{type:Boolean},"aria-roledescription":{},"aria-rowcount":{},"aria-rowindex":{},"aria-rowspan":{},"aria-selected":{type:Boolean},"aria-setsize":{},"aria-sort":{},"aria-valuemax":{},"aria-valuemin":{},"aria-valuenow":{},"aria-valuetext":{}},setup(n,o){let{expose:r}=o;r();const s=n,a=i.useTemplateRef("root"),l=i.ref(s.editor.isEditable()),c=i.computed(()=>Oue(s,["editor"]));i.onMounted(()=>{function d(p){p&&p.ownerDocument&&p.ownerDocument.defaultView?s.editor.setRootElement(p):s.editor.setRootElement(null)}d(a.value),l.value=s.editor.isEditable();const f=s.editor.registerEditableListener(p=>{l.value=p});i.onUnmounted(f)});const u=i.computed(()=>{var d;return(d=s.role)!=null?d:"textbox"});return(d,f)=>(i.openBlock(),i.createElementBlock("div",i.mergeProps({ref_key:"root",ref:a},c.value,{"aria-activedescendant":l.value?d.ariaActiveDescendant:void 0,"aria-autocomplete":l.value?d.ariaAutoComplete:"none","aria-controls":l.value?d.ariaControls:void 0,"aria-describedby":d.ariaDescribedBy,"aria-expanded":l.value&&u.value==="combobox"?!!d.ariaExpanded:void 0,"aria-label":d.ariaLabel,"aria-labelledby":d.ariaLabelledBy,"aria-multiline":d.ariaMultiline,"aria-owns":l.value?d.ariaOwns:void 0,"aria-readonly":l.value?void 0:!0,"aria-required":d.ariaRequired,autocapitalize:d.autocapitalize,contenteditable:l.value,role:l.value?u.value:void 0,spellcheck:d.spellcheck||!0,tabindex:d.tabindex}),null,16,t))}});return e.__vue_vine=!0,e})();function Pue(){return Le().getTextContent()}function Fue(t,e=!0){if(t)return!1;let n=Pue();return e&&(n=n.trim()),n===""}function Vue(t){if(!Fue(t,!1))return!1;const e=Le().getChildren(),n=e.length;if(n>1)return!1;for(let o=0;o<n;o++){const r=e[o];if(be(r))return!1;if(R(r)){if(!ls(r)||r.__indent!==0)return!1;const s=r.getChildren(),a=s.length;for(let l=0;l<a;l++){const c=s[o];if(!X(c))return!1}}}return!0}function Dg(t){return()=>Vue(t)}function Rue(t){return t.getEditorState().read(Dg(t.isComposing()))}function Mg(t){const e=t.getEditorState().read(Dg(t.isComposing())),n=i.ref(e);function o(){const r=Rue(t);n.value=r}return i.onMounted(()=>{const r=ds(t.registerUpdateListener(()=>{o()}),t.registerEditableListener(()=>{o()}));i.onUnmounted(()=>{r()})}),i.readonly(n)}function zue(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Uue(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),o.forEach(function(r){zue(t,r,n[r])})}return t}function que(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Hue(t,e){return e=e??{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):que(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}const jue=(()=>{const t={key:0,"aria-hidden":"true"},e=i.defineComponent({name:"ContentEditable",props:{onCopy:{},onCut:{},onPaste:{},onCompositionend:{},onCompositionstart:{},onCompositionupdate:{},onDrag:{},onDragend:{},onDragenter:{},onDragexit:{},onDragleave:{},onDragover:{},onDragstart:{},onDrop:{},onFocus:{},onFocusin:{},onFocusout:{},onBlur:{},onChange:{},onBeforeinput:{},onFormdata:{},onInput:{},onReset:{},onSubmit:{},onInvalid:{},onFullscreenchange:{},onFullscreenerror:{},onLoad:{},onError:{},onKeydown:{},onKeypress:{},onKeyup:{},onDblclick:{},onMousedown:{},onMouseenter:{},onMouseleave:{},onMousemove:{},onMouseout:{},onMouseover:{},onMouseup:{},onAbort:{},onCanplay:{},onCanplaythrough:{},onDurationchange:{},onEmptied:{},onEncrypted:{},onEnded:{},onLoadeddata:{},onLoadedmetadata:{},onLoadstart:{},onPause:{},onPlay:{},onPlaying:{},onProgress:{},onRatechange:{},onSeeked:{},onSeeking:{},onStalled:{},onSuspend:{},onTimeupdate:{},onVolumechange:{},onWaiting:{},onSelect:{},onScroll:{},onScrollend:{},onTouchcancel:{},onTouchend:{},onTouchmove:{},onTouchstart:{},onAuxclick:{},onClick:{},onContextmenu:{},onGotpointercapture:{},onLostpointercapture:{},onPointerdown:{},onPointermove:{},onPointerup:{},onPointercancel:{},onPointerenter:{},onPointerleave:{},onPointerover:{},onPointerout:{},onBeforetoggle:{},onToggle:{},onWheel:{},onAnimationcancel:{},onAnimationstart:{},onAnimationend:{},onAnimationiteration:{},onSecuritypolicyviolation:{},onTransitioncancel:{},onTransitionend:{},onTransitionrun:{},onTransitionstart:{},innerHTML:{},class:{},style:{type:Boolean},accesskey:{},contenteditable:{type:Boolean},contextmenu:{},dir:{},draggable:{type:Boolean},hidden:{type:Boolean},id:{},inert:{type:Boolean},lang:{},spellcheck:{type:Boolean},tabindex:{},title:{},translate:{},radiogroup:{},role:{},about:{},datatype:{},inlist:{},prefix:{},property:{},resource:{},typeof:{},vocab:{},autocapitalize:{},autocorrect:{},autosave:{},color:{},itemprop:{},itemscope:{type:Boolean},itemtype:{},itemid:{},itemref:{},results:{},security:{},unselectable:{},inputmode:{},is:{},"aria-activedescendant":{},"aria-atomic":{type:Boolean},"aria-autocomplete":{},"aria-busy":{type:Boolean},"aria-checked":{type:Boolean},"aria-colcount":{},"aria-colindex":{},"aria-colspan":{},"aria-controls":{},"aria-current":{type:Boolean},"aria-describedby":{},"aria-details":{},"aria-disabled":{type:Boolean},"aria-dropeffect":{},"aria-errormessage":{},"aria-expanded":{type:Boolean},"aria-flowto":{},"aria-grabbed":{type:Boolean},"aria-haspopup":{type:Boolean},"aria-hidden":{type:Boolean},"aria-invalid":{type:Boolean},"aria-keyshortcuts":{},"aria-label":{},"aria-labelledby":{},"aria-level":{},"aria-live":{},"aria-modal":{type:Boolean},"aria-multiline":{type:Boolean},"aria-multiselectable":{type:Boolean},"aria-orientation":{},"aria-owns":{},"aria-placeholder":{},"aria-posinset":{},"aria-pressed":{type:Boolean},"aria-readonly":{type:Boolean},"aria-relevant":{},"aria-required":{type:Boolean},"aria-roledescription":{},"aria-rowcount":{},"aria-rowindex":{},"aria-rowspan":{},"aria-selected":{type:Boolean},"aria-setsize":{},"aria-sort":{},"aria-valuemax":{},"aria-valuemin":{},"aria-valuenow":{},"aria-valuetext":{},ariaActiveDescendant:{},ariaAutoComplete:{},ariaControls:{},ariaDescribedBy:{},ariaErrorMessage:{},ariaExpanded:{type:Boolean},ariaInvalid:{type:Boolean},ariaLabel:{},ariaLabelledBy:{},ariaMultiline:{type:Boolean},ariaOwns:{},ariaRequired:{type:Boolean}},setup(n,o){let{expose:r}=o;r();const s=Gr(),a=i.ref(!1),l=Mg(s);return i.onMounted(()=>{a.value=s.isEditable();const c=s.registerEditableListener(u=>{a.value=u});i.onUnmounted(c)}),(c,u)=>{var d,f;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(i.unref(Iue),i.mergeProps({editor:i.unref(s)},Hue(Uue({},c.$props),{role:(d=c.role)!=null?d:"textbox",spellcheck:(f=c.spellcheck)!=null?f:!0})),null,16,["editor"]),i.unref(l)?(i.openBlock(),i.createElementBlock("div",t,[i.renderSlot(c.$slots,"placeholder")])):i.createCommentVNode("",!0)],64)}}});return e.__vue_vine=!0,e})();function Wue(t,e,n,o,r){if(t===null||n.size===0&&o.size===0&&!r)return 0;const s=e._selection,a=t._selection;if(r)return 1;if(!(W(s)&&W(a)&&a.isCollapsed()&&s.isCollapsed()))return 0;const l=function(_,y,v){const w=_._nodeMap,k=[];for(const b of y){const S=w.get(b);S!==void 0&&k.push(S)}for(const[b,S]of v){if(!S)continue;const T=w.get(b);T===void 0||Re(T)||k.push(T)}return k}(e,n,o);if(l.length===0)return 0;if(l.length>1){const _=e._nodeMap,y=_.get(s.anchor.key),v=_.get(a.anchor.key);return y&&v&&!t._nodeMap.has(y.__key)&&X(y)&&y.__text.length===1&&s.anchor.offset===1?2:0}const c=l[0],u=t._nodeMap.get(c.__key);if(!X(u)||!X(c)||u.__mode!==c.__mode)return 0;const d=u.__text,f=c.__text;if(d===f)return 0;const p=s.anchor,h=a.anchor;if(p.key!==h.key||p.type!=="text")return 0;const m=p.offset,g=h.offset,C=f.length-d.length;return C===1&&g===m-1?2:C===-1&&g===m+1?3:C===-1&&g===m?4:0}function Zue(t,e){let n=Date.now(),o=0;return(r,s,a,l,c,u)=>{const d=Date.now();if(u.has(da))return o=0,n=d,2;const f=Wue(r,s,l,c,t.isComposing()),p=(()=>{const h=a===null||a.editor===t,m=u.has(Cle);if(!m&&h&&u.has(Ai))return 0;if(r===null)return 1;const g=s._selection;if(!(l.size>0||c.size>0))return g!==null?0:2;const C=typeof e=="number"?e:e.peek();return m===!1&&f!==0&&f===o&&d<n+C&&h||l.size===1&&function(_,y,v){const w=y._nodeMap.get(_),k=v._nodeMap.get(_),b=y._selection,S=v._selection;return!(W(b)&&W(S)&&b.anchor.type==="element"&&b.focus.type==="element"&&S.anchor.type==="text"&&S.focus.type==="text"||!X(w)||!X(k)||w.__parent!==k.__parent)&&JSON.stringify(y.read(()=>w.exportJSON()))===JSON.stringify(v.read(()=>k.exportJSON()))}(Array.from(l)[0],r,s)?0:1})();return n=d,o=f,p}}function ap(t){t.undoStack=[],t.redoStack=[],t.current=null}function Kue(t,e,n){const o=Zue(t,n);return ds(t.registerCommand(_u,()=>(function(s,a){const l=a.redoStack,c=a.undoStack;if(c.length!==0){const u=a.current,d=c.pop();u!==null&&(l.push(u),s.dispatchCommand(Ms,!0)),c.length===0&&s.dispatchCommand($s,!1),a.current=d||null,d&&d.editor.setEditorState(d.editorState,{tag:da})}}(t,e),!0),Ce),t.registerCommand(Cu,()=>(function(s,a){const l=a.redoStack,c=a.undoStack;if(l.length!==0){const u=a.current;u!==null&&(c.push(u),s.dispatchCommand($s,!0));const d=l.pop();l.length===0&&s.dispatchCommand(Ms,!1),a.current=d||null,d&&d.editor.setEditorState(d.editorState,{tag:da})}}(t,e),!0),Ce),t.registerCommand(hle,()=>(ap(e),!1),Ce),t.registerCommand(mle,()=>(ap(e),t.dispatchCommand(Ms,!1),t.dispatchCommand($s,!1),!0),Ce),t.registerUpdateListener(({editorState:s,prevEditorState:a,dirtyLeaves:l,dirtyElements:c,tags:u})=>{const d=e.current,f=e.redoStack,p=e.undoStack,h=d===null?null:d.editorState;if(d!==null&&s===h)return;const m=o(a,s,d,l,c,u);if(m===1)f.length!==0&&(e.redoStack=[],t.dispatchCommand(Ms,!1)),d!==null&&(p.push({...d}),t.dispatchCommand($s,!0));else if(m===2)return;e.current={editor:t,editorState:s}}))}function Gue(){return{current:null,redoStack:[],undoStack:[]}}function Yue(t,e,n){const o=i.computed(()=>i.toValue(e)||Gue());i.watchEffect(r=>{const s=Kue(i.toValue(t),o.value,i.toValue(n)||1e3);r(s)})}const Jue=(()=>{const t=i.defineComponent({name:"HistoryPlugin",props:{delay:{},externalHistoryState:{}},setup(e,n){let{expose:o}=n;o();const r=e,s=Gr();return Yue(s,()=>r.externalHistoryState,()=>r.delay),(a,l)=>null}});return t.__vue_vine=!0,t})();function Xue(t){i.onMounted(()=>{const e=Mce(t);i.onUnmounted(()=>{e()})})}const Que=(()=>{const t=i.defineComponent({name:"ListPlugin",props:{hasStrictIndent:{type:Boolean}},setup(e,n){let{expose:o}=n;o();const r=e,s=Gr();return i.watchEffect(a=>{if(!s.hasNodes([or,Co]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");if(!r.hasStrictIndent)return;const l=$ce(s);a(l)}),Xue(s),(a,l)=>null}});return t.__vue_vine=!0,t})();function ede(t){const e=i.shallowRef(t.getDecorators());return i.onMounted(()=>{const n=t.registerDecoratorListener(o=>{e.value=o});i.onUnmounted(()=>{n()})}),i.computed(()=>{const n=[],o=Object.keys(i.unref(e));for(let r=0;r<o.length;r++){const s=o[r],a=e.value[s],l=t.getElementByKey(s);l!==null&&n.push(i.h(i.Teleport,{to:l},a))}return n})}const tde=i.defineComponent({name:"LexicalDecoratedTeleports",setup(){const t=Gr(),e=ede(t);return()=>e.value}});function nde(t){i.onMounted(()=>{const e=ds(Yce(t),Uce(t));i.onUnmounted(e)})}const ode=(()=>{const t=i.defineComponent({name:"RichTextPlugin",setup(e,n){let{expose:o}=n;o();const r=Gr(),s=Mg(r);return nde(r),(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.unref(s)?i.renderSlot(a.$slots,"placeholder",{key:0}):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"contentEditable"),i.createVNode(i.unref(tde))],64))}});return t.__vue_vine=!0,t})(),rc=[_g,Cg,bg,kg,Eg,xg,Tg,Sg,wg],rde={class:"ao-lexical-editor__placeholder"},$g=i.defineComponent({__name:"AoLexicalEditor",props:{initialMarkdown:{default:""},placeholder:{default:"Enter text..."},variant:{default:"default"}},emits:["ready","keydown"],setup(t,{expose:e,emit:n}){const o=t,r=n,s=i.shallowRef(null),a=i.shallowRef(null),l=i.ref("paragraph"),c=i.computed(()=>({"ao-lexical-editor--compact":o.variant==="compact"})),u={namespace:"AoLexicalEditor",nodes:[or,Co,il,sl],theme:{paragraph:"ao-lexical-editor__paragraph",heading:{h1:"ao-lexical-editor__heading-h1",h2:"ao-lexical-editor__heading-h2",h3:"ao-lexical-editor__heading-h3"},code:"ao-lexical-editor__code-block",text:{bold:"ao-lexical-editor__text-bold",italic:"ao-lexical-editor__text-italic",strikethrough:"ao-lexical-editor__text-strikethrough",code:"ao-lexical-editor__inline-code"},list:{ul:"ao-lexical-editor__list-ul",ol:"ao-lexical-editor__list-ol",listitem:"ao-lexical-editor__list-item"}},editorState:()=>{Nue(o.initialMarkdown||"",rc)},onError(x){console.error("Lexical error:",x)}},d=i.defineComponent({name:"AoLexicalEditorBridge",emits:{ready:x=>!0,blockStyleChange:x=>!0,selectionChange:x=>!0},setup(x,{emit:O}){const M=Gr();let $=null,B=null;function P(){M.getEditorState().read(()=>{const F=te();if(!W(F))return;O("selectionChange",F.clone());const K=F.anchor.getNode(),V=K.getKey()==="root"?K:K.getTopLevelElementOrThrow();if(sg(V)){const N=V.getTag();if(N==="h1"||N==="h2"||N==="h3"){O("blockStyleChange",N);return}}if(al(V)){O("blockStyleChange","code");return}O("blockStyleChange","paragraph")})}return i.onMounted(()=>{O("ready",M),P(),B=Aue(M,rc),$=M.registerUpdateListener(()=>{P()})}),i.onUnmounted(()=>{B==null||B(),$==null||$()}),()=>null}});function f(x){s.value=x,r("ready",x)}function p(x){a.value=x}function h(x){r("keydown",x)}function m(){a.value&&nt(a.value.clone())}function g(x){const O=s.value;O&&(O.update(()=>{m(),x()}),O.focus())}function C(){const x=s.value;x&&(x.update(()=>{m()}),x.dispatchCommand(Rt,"bold"),x.focus())}function _(){const x=s.value;x&&(x.update(()=>{m()}),x.dispatchCommand(Rt,"italic"),x.focus())}function y(){const x=s.value;x&&(x.update(()=>{m()}),x.dispatchCommand(Rt,"strikethrough"),x.focus())}function v(){const x=s.value;x&&(x.update(()=>{m()}),x.dispatchCommand(Rt,"code"),x.focus())}function w(){const x=s.value;x&&(x.update(()=>{m()}),x.dispatchCommand(Jm,void 0),x.focus())}function k(){const x=s.value;x&&(x.update(()=>{m()}),x.dispatchCommand(Xm,void 0),x.focus())}function b(x){g(()=>{const O=te();if(W(O)){if(O.isCollapsed()||O.focus.set(O.anchor.key,O.anchor.offset,O.anchor.type),x==="paragraph"){Ql(O,()=>De());return}if(x==="code"){Ql(O,()=>vn());return}Ql(O,()=>Io(x))}}),l.value=x}function S(){const x=s.value;return x?x.getEditorState().read(()=>Due(rc)):""}function T(){const x=s.value;x&&x.update(()=>{const O=Le();O.clear(),O.append(De())})}function A(){var x;(x=s.value)==null||x.focus()}return e({toggleBold:C,toggleItalic:_,toggleStrikethrough:y,toggleInlineCode:v,insertBulletList:w,insertNumberedList:k,setBlockStyle:b,getMarkdown:S,clear:T,focus:A,blockStyle:l}),(x,O)=>(i.openBlock(),i.createBlock(i.unref(Bue),{"initial-config":u},{default:i.withCtx(()=>[i.renderSlot(x.$slots,"toolbar"),i.createElementVNode("div",{class:i.normalizeClass(["ao-lexical-editor",c.value])},[i.createVNode(i.unref(ode),null,{contentEditable:i.withCtx(()=>[i.createVNode(i.unref(jue),{class:"ao-lexical-editor__content",onKeydown:h},{placeholder:i.withCtx(()=>[i.createElementVNode("div",rde,i.toDisplayString(t.placeholder),1)]),_:1})]),_:1})],2),i.createVNode(i.unref(Jue)),i.createVNode(i.unref(Que)),i.createVNode(i.unref(d),{onReady:f,onBlockStyleChange:O[0]||(O[0]=M=>l.value=M),onSelectionChange:p})]),_:3}))}});function ide(t,e){const n=i.ref(""),o=i.ref(!1),r=i.ref({top:0,left:0}),s=i.ref(0),a=i.computed(()=>e.value.filter(m=>m.firstName||m.lastName).map(m=>({id:m.id,name:$p(m)}))),l=i.computed(()=>a.value.filter(m=>m.name.toLowerCase().includes(n.value.toLowerCase())));function c(){o.value=!1,n.value="",s.value=0}function u(){const m=te();if(!W(m)||!m.isCollapsed()){c();return}const g=m.anchor.getNode();if(!X(g)){c();return}const _=g.getTextContent().slice(0,m.anchor.offset).match(/@([\p{L}\p{M}0-9_-]*)$/u);if(!_){c();return}n.value=_[1],o.value=!0,s.value>=l.value.length&&(s.value=0)}function d(){const m=t.value;if(!m||!o.value)return;const g=window.getSelection();if(!g||g.rangeCount===0)return;const C=g.getRangeAt(0),_=C.getClientRects().item(0)??C.getBoundingClientRect(),y=m.getRootElement();if(!y)return;const v=y.getBoundingClientRect();r.value={top:_.bottom-v.top+4,left:_.left-v.left}}function f(m){const g=t.value;g&&(g.update(()=>{const C=te();if(!W(C)||!C.isCollapsed())return;const _=C.anchor.getNode();if(!X(_))return;const y=_.getTextContent(),v=C.anchor.offset,k=y.slice(0,v).match(/@([\p{L}\p{M}0-9_-]*)$/u);if(!k)return;const b=v-k[0].length,S=`@${m} `,T=y.slice(0,b)+S+y.slice(v);_.setTextContent(T);const A=b+S.length;C.anchor.set(_.getKey(),A,"text"),C.focus.set(_.getKey(),A,"text")}),c(),g.focus())}function p(m){if(!o.value)return!1;switch(m.key){case"ArrowDown":return m.preventDefault(),l.value.length>0&&(s.value=(s.value+1)%l.value.length),!0;case"ArrowUp":return m.preventDefault(),l.value.length>0&&(s.value=(s.value-1+l.value.length)%l.value.length),!0;case"Enter":{if(l.value.length===0)return!1;m.preventDefault();const g=l.value[s.value];return g&&f(g.name),!0}case"Escape":return m.preventDefault(),c(),!0;default:return!1}}function h(){const m=t.value;if(m)return m.registerUpdateListener(({editorState:g})=>{g.read(()=>{u()}),o.value&&requestAnimationFrame(()=>{d()})})}return{mentionQuery:n,showMentionList:o,mentionListPosition:r,filteredUsers:l,selectedIndex:s,selectUserMention:f,handleKeydown:p,closeMentionList:c,setupMentionTracking:h}}const sde={key:0,class:"ao-comment-editor__toolbar"},ade=["onClick"],Bg=i.defineComponent({__name:"AoCommentEditor",props:{initialMarkdown:{default:""},placeholder:{default:"Add a comment..."},mentionableUsers:{default:()=>[]},showSubmitButton:{type:Boolean,default:!0},toolbarVisibility:{default:"focus"}},emits:["submit","cancel","focus","blur"],setup(t,{expose:e,emit:n}){const o=t,r=n,s=i.ref(null),a=i.shallowRef(null),l=i.ref(!1),c=i.toRef(o,"mentionableUsers"),{showMentionList:u,mentionListPosition:d,filteredUsers:f,selectedIndex:p,selectUserMention:h,handleKeydown:m,closeMentionList:g,setupMentionTracking:C}=ide(a,c);let _,y;const v=i.computed(()=>o.toolbarVisibility==="always"||l.value);i.onUnmounted(()=>{_==null||_(),y!==void 0&&window.clearTimeout(y)});function w(M){a.value=M,_==null||_(),_=C()}function k(){y!==void 0&&(window.clearTimeout(y),y=void 0),l.value||(l.value=!0,r("focus"))}function b(){y!==void 0&&window.clearTimeout(y),y=window.setTimeout(()=>{var B;y=void 0;const M=(B=a.value)==null?void 0:B.getRootElement(),$=document.activeElement;M&&$ instanceof Node&&M.contains($)||l.value&&(l.value=!1,r("blur"))},100)}function S(M){if(!m(M)){if(M.key==="Enter"&&(M.ctrlKey||M.metaKey)){M.preventDefault(),T();return}if(M.key==="Escape"){if(u.value){g();return}M.preventDefault(),A()}}}function T(){const M=s.value;if(!M)return;const $=M.getMarkdown();$.trim()&&r("submit",$)}function A(){g(),r("cancel")}function x(){var M;(M=s.value)==null||M.clear(),g()}function O(){var M;(M=s.value)==null||M.focus()}return e({submit:T,cancel:A,reset:x,focus:O}),(M,$)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ao-comment-editor",{"ao-comment-editor--focused":l.value}])},[v.value?(i.openBlock(),i.createElementBlock("div",sde,[i.createElementVNode("button",{type:"button",class:"ao-comment-editor__toolbar-button",title:"Bold",onMousedown:$[0]||($[0]=i.withModifiers(()=>{},["prevent"])),onClick:$[1]||($[1]=B=>{var P;return(P=s.value)==null?void 0:P.toggleBold()})},[...$[14]||($[14]=[i.createElementVNode("strong",null,"B",-1)])],32),i.createElementVNode("button",{type:"button",class:"ao-comment-editor__toolbar-button",title:"Italic",onMousedown:$[2]||($[2]=i.withModifiers(()=>{},["prevent"])),onClick:$[3]||($[3]=B=>{var P;return(P=s.value)==null?void 0:P.toggleItalic()})},[...$[15]||($[15]=[i.createElementVNode("em",null,"I",-1)])],32),i.createElementVNode("button",{type:"button",class:"ao-comment-editor__toolbar-button",title:"Strikethrough",onMousedown:$[4]||($[4]=i.withModifiers(()=>{},["prevent"])),onClick:$[5]||($[5]=B=>{var P;return(P=s.value)==null?void 0:P.toggleStrikethrough()})},[...$[16]||($[16]=[i.createElementVNode("s",null,"S",-1)])],32),i.createElementVNode("button",{type:"button",class:"ao-comment-editor__toolbar-button",title:"Inline code",onMousedown:$[6]||($[6]=i.withModifiers(()=>{},["prevent"])),onClick:$[7]||($[7]=B=>{var P;return(P=s.value)==null?void 0:P.toggleInlineCode()})},[...$[17]||($[17]=[i.createElementVNode("span",null,"</>",-1)])],32),$[18]||($[18]=i.createElementVNode("span",{class:"ao-comment-editor__toolbar-divider"},null,-1)),i.createElementVNode("button",{type:"button",class:"ao-comment-editor__toolbar-button",title:"Bullet list",onMousedown:$[8]||($[8]=i.withModifiers(()=>{},["prevent"])),onClick:$[9]||($[9]=B=>{var P;return(P=s.value)==null?void 0:P.insertBulletList()})}," • ",32),i.createElementVNode("button",{type:"button",class:"ao-comment-editor__toolbar-button",title:"Numbered list",onMousedown:$[10]||($[10]=i.withModifiers(()=>{},["prevent"])),onClick:$[11]||($[11]=B=>{var P;return(P=s.value)==null?void 0:P.insertNumberedList()})}," 1. ",32)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"ao-comment-editor__wrapper",onFocusin:k,onFocusout:b},[i.createVNode($g,{ref_key:"lexicalEditorRef",ref:s,"initial-markdown":t.initialMarkdown,placeholder:t.placeholder,variant:"compact",onReady:w,onKeydown:S},null,8,["initial-markdown","placeholder"]),i.unref(u)&&i.unref(f).length>0?(i.openBlock(),i.createElementBlock("ul",{key:0,class:"ao-comment-editor__mention-list",style:i.normalizeStyle({top:i.unref(d).top+"px",left:i.unref(d).left+"px"})},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(f),(B,P)=>(i.openBlock(),i.createElementBlock("li",{key:B.id,class:i.normalizeClass({"ao-comment-editor__mention-item--selected":P===i.unref(p)}),onMousedown:$[12]||($[12]=i.withModifiers(()=>{},["prevent"])),onClick:F=>i.unref(h)(B.name)}," @"+i.toDisplayString(B.name),43,ade))),128))],4)):i.createCommentVNode("",!0),t.showSubmitButton?(i.openBlock(),i.createElementBlock("button",{key:1,type:"button",class:"ao-comment-editor__submit",title:"Send comment",onMousedown:$[13]||($[13]=i.withModifiers(()=>{},["prevent"])),onClick:T},[i.createVNode(ke,{name:"SendRounded"})],32)):i.createCommentVNode("",!0)],32)],2))}});const lde={class:"ao-comment"},cde={class:"ao-comment__created-at"},ude={class:"ao-comment__body"},dde={class:"ao-comment__content-wrapper"},fde={key:0,class:"ao-comment__footer"},pde=i.defineComponent({__name:"AoComment",props:{user:{},content:{},createdAt:{},editedAt:{},isEditable:{type:Boolean},mentionableUsers:{}},emits:["edit","remove"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{const m=n.user;return m?`${m.firstName??""}${m.firstName?" ":""}${m.lastName??""}`:null}),s=i.ref(!1),a=i.ref(n.content),l=i.ref(null),c=i.computed(()=>{const m=n.editedAt&&Li(n.editedAt),g=Li(n.createdAt),C=new Date,_=m??g;return _&&L7(_,C)});i.watch(()=>n.content,m=>{s.value||(a.value=m)});function u(){a.value=n.content,s.value=!0,i.nextTick(()=>{var m;(m=l.value)==null||m.focus()})}function d(m){o("edit",m),s.value=!1}function f(){var m;(m=l.value)==null||m.submit()}function p(){s.value=!1,a.value=n.content}function h(){o("remove")}return(m,g)=>{var C;return i.openBlock(),i.createElementBlock("li",lde,[i.createElementVNode("span",cde,i.toDisplayString(c.value),1),r.value?(i.openBlock(),i.createBlock(Un,{key:0,"avatar-url":(C=t.user)==null?void 0:C.avatarUrl,"user-name":r.value,class:"ao-comment__avatar"},null,8,["avatar-url","user-name"])):i.createCommentVNode("",!0),i.createElementVNode("div",ude,[i.createElementVNode("div",dde,[s.value?(i.openBlock(),i.createBlock(Bg,{key:1,ref_key:"commentEditorRef",ref:l,"initial-markdown":a.value,"mentionable-users":t.mentionableUsers,"show-submit-button":!1,"toolbar-visibility":"always",onSubmit:d,onCancel:p},null,8,["initial-markdown","mentionable-users"])):(i.openBlock(),i.createBlock(Ch,{key:0,content:t.content,placeholder:"",class:"ao-comment__content"},null,8,["content"]))]),t.isEditable?(i.openBlock(),i.createElementBlock("div",fde,[s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createVNode(pe,{"icon-name":"CloseRounded",size:"sm",variant:"ghost",color:"neutral",onClick:p}),i.createVNode(pe,{"icon-name":"CheckSmallRounded",size:"sm",variant:"solid",corners:"round",color:"black",onClick:f})],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createVNode(pe,{label:m.$t("activity.comment.edit"),size:"sm",variant:"ghost",color:"neutral",onClick:u},null,8,["label"]),i.createVNode(pe,{label:m.$t("activity.comment.delete"),size:"sm",variant:"ghost",color:"neutral",onClick:h},null,8,["label"])],64))])):i.createCommentVNode("",!0)])])}}});const hde={class:"ao-comments__new"},mde={key:0,class:"ao-comments__list"},gde=i.defineComponent({__name:"AoActivityDetailsComments",props:{comments:{default:()=>[]},users:{},newComment:{default:""},userId:{}},emits:["createComment","updateComment","removeComment"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>[...n.comments].sort((f,p)=>xy(Li(f.createdAt),Li(p.createdAt)))),s=f=>n.users.find(p=>p.id===f),a=i.ref(null);i.nextTick(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)});const l=i.ref(null);function c(f){var h;if(!f.trim())return;const p=wd(f,n.users);o("createComment",{authorId:n.userId,message:f,mentionedUserIds:p}),(h=l.value)==null||h.reset()}function u(f,p){const h=wd(p,n.users);o("updateComment",{id:f,message:p,mentionedUserIds:h})}function d(f){o("removeComment",{id:f})}return(f,p)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"commentsContainer",ref:a,class:"ao-comments"},[i.createElementVNode("div",hde,[i.createVNode(Bg,{ref_key:"newCommentEditorRef",ref:l,"initial-markdown":t.newComment,"mentionable-users":t.users,placeholder:f.$t("activity.comment.label"),onSubmit:c},null,8,["initial-markdown","mentionable-users","placeholder"])]),r.value.length>0?(i.openBlock(),i.createElementBlock("ul",mde,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,h=>(i.openBlock(),i.createBlock(pde,{key:h.id,user:s(h.author.id),content:h.message,"created-at":h.createdAt,"edited-at":h.updatedAt,"is-editable":h.author.id===t.userId,"mentionable-users":t.users,class:"ao-comment",onEdit:m=>u(h.id,m),onRemove:()=>d(h.id)},null,8,["user","content","created-at","edited-at","is-editable","mentionable-users","onEdit","onRemove"]))),128))])):i.createCommentVNode("",!0)],512))}});const vde=["aria-label"],yde={class:"ao-file-preview__container"},_de={class:"ao-file-preview__header"},Cde=["title"],bde={class:"ao-file-preview__actions"},kde=["aria-label"],wde={key:0,class:"ao-file-preview__loading"},Ede=["src","alt"],xde=["src","title"],Sde={key:3,class:"ao-file-preview__fallback"},Tde={class:"ao-file-preview__fallback-title"},Ade={class:"ao-file-preview__fallback-filename"},Nde=["aria-label"],Dde={key:0,class:"ao-file-preview__counter"},Mde=i.defineComponent({__name:"AoFilePreview",props:{attachments:{},currentIndex:{},loadPreview:{type:Function}},emits:["update:currentIndex","close"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(null),s=i.ref(!1),a=i.ref(!1);let l=0;const c=i.computed(()=>n.attachments[n.currentIndex]),u=i.computed(()=>n.currentIndex===0),d=i.computed(()=>n.currentIndex===n.attachments.length-1),f=i.computed(()=>{var x,O;return((O=(x=c.value)==null?void 0:x.mimeType)==null?void 0:O.toLowerCase())??""}),p=i.computed(()=>{var x;return((x=c.value)==null?void 0:x.name)??""}),h=i.computed(()=>{var x;return((x=p.value.split(".").pop())==null?void 0:x.toLowerCase())??""}),m=i.computed(()=>f.value.startsWith("image/")?!0:["jpg","jpeg","png","gif","webp"].includes(h.value)),g=i.computed(()=>f.value==="application/pdf"||h.value==="pdf"),C=i.computed(()=>m.value||g.value),_=i.computed(()=>m.value?"ImageRounded":g.value?"PictureAsPdfRounded":"InsertDriveFileRounded");function y(){r.value&&(URL.revokeObjectURL(r.value),r.value=null)}async function v(){const x=c.value,O=++l;if(y(),a.value=!1,s.value=!1,!x||!C.value){a.value=!0;return}s.value=!0;try{const M=await n.loadPreview(x);if(O!==l)return;if(!M.size)throw new Error("Empty file received");r.value=URL.createObjectURL(M)}catch(M){if(O!==l)return;console.error("Failed to load attachment preview:",M),a.value=!0}finally{O===l&&(s.value=!1)}}function w(){u.value||o("update:currentIndex",n.currentIndex-1)}function k(){d.value||o("update:currentIndex",n.currentIndex+1)}function b(){const x=c.value;if(!(x!=null&&x.url))return;const O=document.createElement("a");O.href=x.url,O.download=x.name,O.target="_blank",O.rel="noopener noreferrer",document.body.appendChild(O),O.click(),O.remove()}function S(){y(),a.value=!0}function T(){++l,y(),o("close")}function A(x){switch(x.key){case"Escape":T();break;case"ArrowLeft":w();break;case"ArrowRight":k();break}}return i.watch(()=>n.currentIndex,()=>{if(n.currentIndex<0||n.currentIndex>=n.attachments.length){T();return}v()},{immediate:!0}),i.onMounted(()=>{document.addEventListener("keydown",A)}),i.onUnmounted(()=>{++l,document.removeEventListener("keydown",A),y()}),(x,O)=>{var M,$,B,P,F,K;return i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createElementVNode("div",{class:"ao-file-preview",role:"dialog","aria-modal":"true","aria-label":(M=c.value)==null?void 0:M.name},[i.createElementVNode("div",{class:"ao-file-preview__backdrop",onClick:T}),i.createElementVNode("div",yde,[i.createElementVNode("header",_de,[i.createElementVNode("span",{class:"ao-file-preview__filename",title:($=c.value)==null?void 0:$.name},i.toDisplayString((B=c.value)==null?void 0:B.name),9,Cde),i.createElementVNode("div",bde,[i.createVNode(pe,{"icon-name":"DownloadRounded",variant:"ghost",color:"primary",size:"sm","aria-label":x.$t("activity.attachment.preview.download"),title:x.$t("activity.attachment.preview.download"),onClick:b},null,8,["aria-label","title"]),i.createVNode(pe,{"icon-name":"CloseRounded",variant:"ghost",color:"primary",size:"sm","aria-label":x.$t("activity.attachment.preview.close"),title:x.$t("activity.attachment.preview.close"),onClick:T},null,8,["aria-label","title"])])]),i.createElementVNode("main",{class:i.normalizeClass(["ao-file-preview__content",{"ao-file-preview__content--image":m.value&&r.value&&!a.value}])},[u.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",class:"ao-file-preview__nav ao-file-preview__nav--prev","aria-label":x.$t("activity.attachment.preview.previous"),onClick:i.withModifiers(w,["stop"])},[i.createVNode(ke,{name:"ArrowBackRounded",size:"lg"})],8,kde)),i.createElementVNode("div",{class:"ao-file-preview__viewer",onClick:O[0]||(O[0]=i.withModifiers(()=>{},["stop"]))},[s.value?(i.openBlock(),i.createElementBlock("div",wde,[...O[1]||(O[1]=[i.createElementVNode("div",{class:"ao-file-preview__spinner","aria-hidden":"true"},null,-1),i.createElementVNode("span",null,"Loading...",-1)])])):m.value&&r.value&&!a.value?(i.openBlock(),i.createElementBlock("img",{key:1,src:r.value,alt:(P=c.value)==null?void 0:P.name,class:"ao-file-preview__image",onError:S},null,40,Ede)):g.value&&r.value&&!a.value?(i.openBlock(),i.createElementBlock("iframe",{key:2,src:r.value,title:(F=c.value)==null?void 0:F.name,class:"ao-file-preview__pdf"},null,8,xde)):(i.openBlock(),i.createElementBlock("div",Sde,[i.createVNode(ke,{name:_.value,size:"xl"},null,8,["name"]),i.createElementVNode("p",Tde,i.toDisplayString(x.$t("activity.attachment.preview.notAvailable")),1),i.createElementVNode("p",Ade,i.toDisplayString((K=c.value)==null?void 0:K.name),1),i.createVNode(pe,{variant:"solid",color:"primary",size:"sm",label:x.$t("activity.attachment.preview.download"),onClick:b},null,8,["label"])]))]),d.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:1,type:"button",class:"ao-file-preview__nav ao-file-preview__nav--next","aria-label":x.$t("activity.attachment.preview.next"),onClick:i.withModifiers(k,["stop"])},[i.createVNode(ke,{name:"ArrowForwardRounded",size:"lg"})],8,Nde))],2),t.attachments.length>1?(i.openBlock(),i.createElementBlock("footer",Dde,i.toDisplayString(t.currentIndex+1)+" / "+i.toDisplayString(t.attachments.length),1)):i.createCommentVNode("",!0)])],8,vde)])}}});const Og=i.defineComponent({__name:"AoButtonCheck",props:{modelValue:{type:Boolean},color:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=()=>{o("update:modelValue",!n.modelValue)};return(s,a)=>(i.openBlock(),i.createBlock(pe,{color:t.modelValue?t.color:i.unref(Wc).NEUTRAL,"icon-position":"start",onClick:a[0]||(a[0]=()=>r())},null,8,["color"]))}}),$de=i.defineComponent({props:{modelValue:{type:[String,Number],required:!0},tabs:{type:Array,required:!0},variant:{type:String,default:void 0,validator:t=>["underline"].includes(t)}},emits:["update:modelValue"],methods:{selectTab(t){this.$emit("update:modelValue",t)}}});const Bde=["onClick"],Ode={class:"tab-button__label"},Lde={key:0,class:"tab-button__badge"};function Ide(t,e,n,o,r,s){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["tabbar-wrapper",{"tabbar-wrapper--underline":t.variant==="underline"}])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.tabs,a=>(i.openBlock(),i.createElementBlock("button",{key:a.value,class:i.normalizeClass(["tab-button",{"tab-button--active":a.value===t.modelValue,"tab-button--underline":t.variant==="underline"}]),type:"button",onClick:l=>t.selectTab(a.value)},[i.createElementVNode("span",Ode,i.toDisplayString(a.label),1),a.count!==void 0&&a.count>0?(i.openBlock(),i.createElementBlock("span",Lde,i.toDisplayString(a.count),1)):i.createCommentVNode("",!0)],10,Bde))),128))],2)}const fs=oe($de,[["render",Ide],["__scopeId","data-v-3d268d7b"]]),Pde={class:"ao-rich-text-editor"},Fde={class:"ao-rich-text-editor__toolbar"},Vde=["value"],Rde={class:"ao-rich-text-editor__actions"},zde=i.defineComponent({__name:"AoRichTextEditor",props:{initialMarkdown:{default:""},placeholder:{default:"Enter description..."}},emits:["save","cancel"],setup(t,{emit:e}){const n=e,o=i.ref(null);function r(l){var u;const c=l.target;(u=o.value)==null||u.setBlockStyle(c.value)}function s(){const l=o.value;l&&n("save",l.getMarkdown())}function a(){n("cancel")}return(l,c)=>(i.openBlock(),i.createElementBlock("div",Pde,[i.createVNode($g,{ref_key:"lexicalEditorRef",ref:o,"initial-markdown":t.initialMarkdown,placeholder:t.placeholder},{toolbar:i.withCtx(()=>{var u;return[i.createElementVNode("div",Fde,[i.createElementVNode("select",{class:"ao-rich-text-editor__select",title:"Text style",value:(u=o.value)==null?void 0:u.blockStyle,onChange:r},[...c[12]||(c[12]=[i.createElementVNode("option",{value:"paragraph"},"Paragraph",-1),i.createElementVNode("option",{value:"h1"},"Heading 1",-1),i.createElementVNode("option",{value:"h2"},"Heading 2",-1),i.createElementVNode("option",{value:"h3"},"Heading 3",-1),i.createElementVNode("option",{value:"code"},"Code block",-1)])],40,Vde),c[17]||(c[17]=i.createElementVNode("span",{class:"ao-rich-text-editor__toolbar-divider"},null,-1)),i.createElementVNode("button",{type:"button",class:"ao-rich-text-editor__toolbar-button",title:"Bold",onMousedown:c[0]||(c[0]=i.withModifiers(()=>{},["prevent"])),onClick:c[1]||(c[1]=d=>{var f;return(f=o.value)==null?void 0:f.toggleBold()})},[...c[13]||(c[13]=[i.createElementVNode("strong",null,"B",-1)])],32),i.createElementVNode("button",{type:"button",class:"ao-rich-text-editor__toolbar-button",title:"Italic",onMousedown:c[2]||(c[2]=i.withModifiers(()=>{},["prevent"])),onClick:c[3]||(c[3]=d=>{var f;return(f=o.value)==null?void 0:f.toggleItalic()})},[...c[14]||(c[14]=[i.createElementVNode("em",null,"I",-1)])],32),i.createElementVNode("button",{type:"button",class:"ao-rich-text-editor__toolbar-button",title:"Strikethrough",onMousedown:c[4]||(c[4]=i.withModifiers(()=>{},["prevent"])),onClick:c[5]||(c[5]=d=>{var f;return(f=o.value)==null?void 0:f.toggleStrikethrough()})},[...c[15]||(c[15]=[i.createElementVNode("s",null,"S",-1)])],32),i.createElementVNode("button",{type:"button",class:"ao-rich-text-editor__toolbar-button",title:"Inline code",onMousedown:c[6]||(c[6]=i.withModifiers(()=>{},["prevent"])),onClick:c[7]||(c[7]=d=>{var f;return(f=o.value)==null?void 0:f.toggleInlineCode()})},[...c[16]||(c[16]=[i.createElementVNode("span",null,"</>",-1)])],32),c[18]||(c[18]=i.createElementVNode("span",{class:"ao-rich-text-editor__toolbar-divider"},null,-1)),i.createElementVNode("button",{type:"button",class:"ao-rich-text-editor__toolbar-button",title:"Bullet list",onMousedown:c[8]||(c[8]=i.withModifiers(()=>{},["prevent"])),onClick:c[9]||(c[9]=d=>{var f;return(f=o.value)==null?void 0:f.insertBulletList()})}," • ",32),i.createElementVNode("button",{type:"button",class:"ao-rich-text-editor__toolbar-button",title:"Numbered list",onMousedown:c[10]||(c[10]=i.withModifiers(()=>{},["prevent"])),onClick:c[11]||(c[11]=d=>{var f;return(f=o.value)==null?void 0:f.insertNumberedList()})}," 1. ",32)])]}),_:1},8,["initial-markdown","placeholder"]),i.createElementVNode("div",Rde,[i.createVNode(pe,{variant:"ghost",color:"neutral",label:"Cancel",onClick:a}),i.createVNode(pe,{variant:"solid",color:"primary",label:"Save",onClick:s})])]))}});const Ude={class:"ao-activity-details"},qde={class:"ao-activity-details__main"},Hde={class:"ao-activity-details__header"},jde={key:1,class:"ao-activity__category"},Wde={class:"ao-feed__activity-details__header"},Zde={key:0,class:"ao-field ao-feed__activity-details__project"},Kde={class:"ao-field__label"},Gde={key:1,class:"ao-field ao-feed__activity-details__project"},Yde={class:"ao-field__label"},Jde={class:"ao-activity-details__content"},Xde={class:"ao-activity-details__tab-content"},Qde={class:"ao-fieldset"},e1e={class:"ao-field__row"},t1e={class:"ao-activity-details__tab-content"},n1e={class:"ao-fieldset"},o1e={class:"ao-fieldset__body"},r1e={class:"ao-activity-details__tab-content"},i1e={key:0,class:"ao-fieldset"},s1e={class:"ao-activity-details__aside"},a1e={class:"ao-activity-details__close-button"},l1e={key:0,class:"ao-activity-details__aside-section"},c1e={class:"ao-field"},u1e={class:"ao-field__label"},d1e={class:"ao-activity-details__aside-section"},f1e={class:"ao-field ao-field--multiselect"},p1e={class:"assignee-inline"},h1e={class:"ao-field__label"},m1e={class:"ao-activity-details__aside-section"},g1e={key:0,class:"ao-field__row"},v1e={class:"ao-field"},y1e={class:"ao-field__label"},_1e=["readonly"],C1e={class:"ao-activity-details__aside-section"},b1e={class:"ao-field__row"},k1e={class:"ao-field ao-field--inline"},w1e={class:"ao-field__label"},E1e=["readonly"],x1e={class:"ao-field__row"},S1e={class:"ao-field ao-field--inline"},T1e={class:"ao-field__label"},A1e={class:"ao-field__input ao-field__input--estim ao-field__input--readonly"},N1e={class:"ao-activity-details__aside-section"},D1e={class:"ao-fieldset ao-activity-details__aside-section"},M1e={class:"ao-fieldset__title"},$1e={class:"ao-fieldset__body"},B1e={class:"ao-field__row"},O1e={class:"ao-field ao-field--multiselect"},L1e={class:"ao-field__label"},I1e={class:"ao-field__row"},P1e={class:"ao-field ao-field--multiselect"},F1e={class:"ao-field__label"},Ju=i.defineComponent({__name:"AoActivityDetails",props:{activity:{},activityTypes:{},breadcrumbs:{},milestoneId:{},templateActivities:{},templateMilestones:{},isTemplate:{type:Boolean},users:{},userId:{},isTaskCheckable:{},statuses:{},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean},projects:{default:()=>[]},timeTrackingData:{},loadAttachmentPreview:{}},emits:["update:activity","close","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","toast"],setup(t,{emit:e}){const n=t,o=e,{t:r}=Hn(),s=i.ref("description"),a=i.computed(()=>{var I,ee;return[{label:r("activity.description.label")||"Description",value:"description"},{label:r("activity.tasks.title")||"Checklist",value:"checklist",count:((I=n.activity.tasks)==null?void 0:I.length)??0},{label:r("activity.comments.title")||"Commentaires",value:"comments",count:((ee=n.activity.comments)==null?void 0:ee.length)??0}]}),l=i.computed(()=>{var I;return n.isEditable===!0?!0:n.userId&&n.isEditable==="only-own"?n.userId===((I=n.activity.assignee)==null?void 0:I.id):!1}),c=i.ref(!1),u=i.ref(null),d=I=>{o("update:activity",{id:n.activity.id,name:I})},f=i.computed(()=>n.activity.description??""),p=()=>{l.value&&(c.value=!0)},h=I=>{o("update:activity",{id:n.activity.id,description:I}),c.value=!1},m=()=>{c.value=!1};i.watch(()=>n.activity.id,()=>{c.value=!1});const g=i.computed({get(){return n.activity.estimation??0},set(I){o("update:activity",{id:n.activity.id,estimation:I})}}),C=i.computed({get(){var ee;const I=(ee=n.timeTrackingData)==null?void 0:ee[n.activity.id];return(I==null?void 0:I.timeSpent)??0},set(){}}),_=i.computed(()=>{var ee;return((ee=n.activity.project)==null?void 0:ee.estimationUnit)==="days"?"d":"h"}),y=i.computed(()=>{var ee;const I=(ee=n.activity.project)==null?void 0:ee.estimationUnit;return Aa(C.value,I)}),v=i.computed({get(){return n.activity.important??!1},set(I){o("update:activity",{id:n.activity.id,important:I})}});i.computed({get(){return n.activity.private??!1},set(I){o("update:activity",{id:n.activity.id,private:I})}});const w=i.computed({get(){return n.activity.deadline},set(I){o("update:activity",{id:n.activity.id,deadline:I})}});i.computed(()=>{var I;return(I=n.activityTypes)==null?void 0:I.map(ee=>({label:ee.name,value:ee.id}))}),i.computed({get(){var I;return(I=n.activity.type)==null?void 0:I.id},set(I){o("update:activity",{id:n.activity.id,typeId:I})}});const k=i.computed(()=>n.templateActivities.filter(I=>I.id!==n.activity.id).map(I=>({label:I.name,value:I.id}))),b=i.computed({get(){var I;return(I=n.activity.dependingOn)==null?void 0:I.map(ee=>ee.id)},set(I){I&&o("update:activity",{id:n.activity.id,dependingOn:I})}}),S=i.computed(()=>k.value.map(I=>{var ee;return{...I,disabled:(ee=n.activity.blocking)==null?void 0:ee.some(ve=>ve.id===I.value)}})),T=i.computed({get(){var I;return(I=n.activity.blocking)==null?void 0:I.map(ee=>ee.id)},set(I){I&&o("update:activity",{id:n.activity.id,blocking:I})}}),A=i.computed(()=>k.value.map(I=>{var ee;return{...I,disabled:(ee=n.activity.dependingOn)==null?void 0:ee.some(ve=>ve.id===I.value)}})),x=I=>{o("addSubtask",I)},O=I=>{o("updateSubtask",I)},M=I=>{o("deleteSubtask",I)};function $(){n.userId?F.value=[n.userId]:console.error("Failed assigning to self: userId is missing")}function B(I){F.value=[I]}const P=i.computed(()=>{var ee;const I=new Map;return(ee=n.users)==null||ee.forEach(ve=>{I.has(ve.id)||I.set(ve.id,ve)}),Array.from(I.values()).map(ve=>({label:`${ve.firstName} ${ve.lastName}`,value:ve.id,avatar:ve.avatarUrl}))}),F=i.computed({get(){var I,ee;return(I=n.activity.assignee)!=null&&I.id?[(ee=n.activity.assignee)==null?void 0:ee.id]:[]},set(I){o("update:activity",{id:n.activity.id,assigneeId:I[0]??null})}}),K=I=>{o("addFiles",{activityId:n.activity.id,files:I})},V=I=>{o("removeFile",{activityId:n.activity.id,file:I})},N=i.computed(()=>n.projects.map(I=>({value:I.id,label:I.name}))),G=i.computed(()=>{var ee,ve,me;const I=(me=(ve=(ee=n.activity)==null?void 0:ee.project)==null?void 0:ve.phases)==null?void 0:me.reduce((Ve,le)=>[...Ve,...le.milestones],[]);return I==null?void 0:I.map(Ve=>({value:Ve.id,label:Ve.name}))}),z=I=>{n.activity&&o("update:activity",{id:n.activity.id,projectId:I})},H=I=>{n.activity&&o("update:activity",{id:n.activity.id,milestoneId:I})},ue=i.computed(()=>{var I;return(I=n.statuses)==null?void 0:I.map(ee=>({value:ee.id,label:ee.name}))}),Q=I=>{o("update:activity",{id:n.activity.id,statusId:I})},ie=I=>{o("addComment",{...I,activityId:n.activity.id})},U=I=>{o("updateComment",I)},ne=I=>{o("removeComment",I)};i.computed(()=>{var I,ee;return((I=n.activity.createdBy)==null?void 0:I.firstName)&&((ee=n.activity.createdBy)==null?void 0:ee.lastName)&&`${n.activity.createdBy.firstName} ${n.activity.createdBy.lastName}`});function ge(){const I=window.location.origin,ee=n.activity.slug,ve=`${I}/activity-feed/slug/${ee}`;navigator.clipboard.writeText(ve).then(()=>{console.log(`Link copied to clipboard: ${ve}`),o("toast","clipboard.copy.success","success")}).catch(()=>{console.log("Failed to copy link"),o("toast","clipboard.copy.error","error")})}return(I,ee)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Da,{onClose:ee[9]||(ee[9]=ve=>I.$emit("close"))},{default:i.withCtx(()=>{var ve,me,Ve;return[i.createElementVNode("div",Ude,[i.createElementVNode("div",qde,[i.createElementVNode("div",Hde,[t.activity.slug?(i.openBlock(),i.createBlock($i,{key:0,label:t.activity.slug,clickable:!0,variant:"solid_icon",color:"primary","icon-name":"ContentCopyOutline",class:"ao-activity__ao-tag",onClick:ge},null,8,["label"])):i.createCommentVNode("",!0),t.breadcrumbs?(i.openBlock(),i.createElementBlock("div",jde,i.toDisplayString(t.breadcrumbs),1)):i.createCommentVNode("",!0),i.createVNode(at,{title:t.activity.name||"",level:4,"is-editable":l.value,"onUpdate:title":d},null,8,["title","is-editable"]),i.createElementVNode("div",Wde,[N.value?(i.openBlock(),i.createElementBlock("label",Zde,[i.createElementVNode("span",Kde,i.toDisplayString(I.$t("activity.project.label")),1),i.createVNode(Dt,{options:N.value,value:(ve=t.activity.project)==null?void 0:ve.id,searchable:!0,disabled:!l.value,caret:l.value,onChange:z},null,8,["options","value","disabled","caret"])])):i.createCommentVNode("",!0),G.value?(i.openBlock(),i.createElementBlock("label",Gde,[i.createElementVNode("span",Yde,i.toDisplayString(I.$t("activity.milestone.label")),1),i.createVNode(Dt,{options:G.value,value:(me=t.activity.milestone)==null?void 0:me.id,searchable:!0,disabled:!l.value,caret:l.value,onChange:H},null,8,["options","value","disabled","caret"])])):i.createCommentVNode("",!0)]),i.renderSlot(I.$slots,"header")]),i.createElementVNode("div",Jde,[i.createVNode(fs,{modelValue:s.value,"onUpdate:modelValue":ee[0]||(ee[0]=le=>s.value=le),tabs:a.value,variant:"underline",class:"ao-activity-details__tabs"},null,8,["modelValue","tabs"]),i.withDirectives(i.createElementVNode("div",Xde,[i.createElementVNode("fieldset",Qde,[i.createElementVNode("div",e1e,[i.createVNode(z9,{attachments:t.activity.attachments,"is-editable":t.attachmentEnabled&&l.value&&t.isTemplate!==!0&&!!t.userId,onAdd:K,onRemove:V,onPreview:ee[1]||(ee[1]=le=>u.value=le)},{default:i.withCtx(()=>[c.value?(i.openBlock(),i.createBlock(zde,{key:1,"initial-markdown":f.value,onSave:h,onCancel:m},null,8,["initial-markdown"])):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ao-activity-details__description",{"ao-activity-details__description--editable":l.value}]),onClick:p},[i.createVNode(Ch,{content:f.value},null,8,["content"])],2))]),_:1},8,["attachments","is-editable"])])])],512),[[i.vShow,s.value==="description"]]),i.withDirectives(i.createElementVNode("div",t1e,[i.createElementVNode("fieldset",n1e,[i.createElementVNode("div",o1e,[i.createVNode(N9,{class:"ao-activity-details__tasks ao-field__row",tasks:t.activity.tasks||[],"activity-id":t.activity.id,users:t.users,"is-checkable":t.isTaskCheckable,"is-editable":l.value,"is-template":t.isTemplate,onAdd:x,onUpdate:O,onDelete:M},null,8,["tasks","activity-id","users","is-checkable","is-editable","is-template"])])])],512),[[i.vShow,s.value==="checklist"]]),i.withDirectives(i.createElementVNode("div",r1e,[t.isTemplate!==!0&&t.userId?(i.openBlock(),i.createElementBlock("div",i1e,[i.createVNode(gde,{comments:t.activity.comments,users:t.users,"user-id":t.userId,onCreateComment:ie,onUpdateComment:U,onRemoveComment:ne},null,8,["comments","users","user-id"])])):i.createCommentVNode("",!0)],512),[[i.vShow,s.value==="comments"]])])]),i.createElementVNode("div",s1e,[i.createElementVNode("div",a1e,[i.createVNode(ke,{name:"CloseRounded",onClick:ee[2]||(ee[2]=le=>I.$emit("close"))})]),ue.value?(i.openBlock(),i.createElementBlock("div",l1e,[i.createElementVNode("label",c1e,[i.createElementVNode("span",u1e,i.toDisplayString(I.$t("activity.status.label")),1),i.createVNode(Dt,{class:"ao-activity-details__multiselect",options:ue.value,value:(Ve=t.activity.status)==null?void 0:Ve.id,"can-clear":!1,"can-deselect":!1,disabled:!l.value,caret:l.value,onChange:Q},null,8,["options","value","disabled","caret"])])])):i.createCommentVNode("",!0),i.createElementVNode("div",d1e,[i.createElementVNode("div",f1e,[i.createElementVNode("div",p1e,[i.createElementVNode("span",h1e,i.toDisplayString(I.$t("activity.assignee.label")),1),i.createVNode(pe,{label:I.$t("activity.assignee.toMe"),type:"button",color:"primary",variant:"solid",class:"ao-button--sm",onClick:$},null,8,["label"])]),i.createVNode(Dt,{modelValue:F.value,"onUpdate:modelValue":ee[3]||(ee[3]=le=>F.value=le),class:"ao-activity-details__assignees ao-activity-details__multiselect",options:P.value,"close-on-select":!0,searchable:!0,placeholder:I.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!l.value,caret:l.value,onSelect:B},{tag:i.withCtx(({option:le,handleTagRemove:ft})=>[i.createVNode(Un,{"user-name":le.label,"avatar-url":le.avatar,"is-closable":!0,onClose:xe=>ft(le,xe)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),i.createElementVNode("div",m1e,[t.isTemplate!==!0&&t.userId?(i.openBlock(),i.createElementBlock("div",g1e,[i.createElementVNode("label",v1e,[i.createElementVNode("span",y1e,i.toDisplayString(I.$t("activity.deadline.label")),1),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":ee[4]||(ee[4]=le=>w.value=le),readonly:!l.value,class:"ao-field__input",type:"date"},null,8,_1e),[[i.vModelText,w.value,void 0,{lazy:!0}]])])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",C1e,[i.createElementVNode("div",b1e,[i.createElementVNode("label",k1e,[i.createElementVNode("span",w1e,i.toDisplayString(I.$t("activity.estimation.label"))+" ("+i.toDisplayString(_.value)+")",1),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":ee[5]||(ee[5]=le=>g.value=le),readonly:!l.value,class:"ao-field__input ao-field__input--estim",type:"number",min:"0"},null,8,E1e),[[i.vModelText,g.value,void 0,{lazy:!0,number:!0}]])])]),i.createElementVNode("div",x1e,[i.createElementVNode("label",S1e,[i.createElementVNode("span",T1e,i.toDisplayString(I.$t("activity.timeSpent.label"))+" ("+i.toDisplayString(_.value)+")",1),i.createElementVNode("span",A1e,i.toDisplayString(y.value),1)])])]),i.createElementVNode("div",N1e,[i.createVNode(Og,{modelValue:v.value,"onUpdate:modelValue":ee[6]||(ee[6]=le=>v.value=le),modelModifiers:{lazy:!0},label:I.$t("activity.important.label"),disabled:!l.value,variant:"ghost","icon-name":"FlagRounded",class:"ao-field__input",color:"danger",type:"checkbox",size:"sm"},null,8,["modelValue","label","disabled"])]),i.createElementVNode("fieldset",D1e,[i.createElementVNode("div",M1e,[i.createVNode(ke,{name:"FlowsheetOutlineRounded"}),i.createVNode(at,{level:4,title:I.$t("activity.dependencies.title")},null,8,["title"])]),i.createElementVNode("div",$1e,[i.createElementVNode("div",B1e,[i.createElementVNode("label",O1e,[i.createElementVNode("span",L1e,i.toDisplayString(I.$t("activity.dependingOn.label")),1),i.createVNode(Dt,{modelValue:b.value,"onUpdate:modelValue":ee[7]||(ee[7]=le=>b.value=le),class:"ao-activity-details__multiselect",mode:"tags","close-on-select":!1,searchable:!0,options:S.value,disabled:!l.value,caret:l.value},null,8,["modelValue","options","disabled","caret"])])]),i.createElementVNode("div",I1e,[i.createElementVNode("label",P1e,[i.createElementVNode("span",F1e,i.toDisplayString(I.$t("activity.blocking.label")),1),i.createVNode(Dt,{modelValue:T.value,"onUpdate:modelValue":ee[8]||(ee[8]=le=>T.value=le),class:"ao-activity-details__multiselect",mode:"tags","close-on-select":!1,searchable:!0,options:A.value,disabled:!l.value,caret:l.value},null,8,["modelValue","options","disabled","caret"])])])])]),i.renderSlot(I.$slots,"default",{activity:t.activity})])])]}),_:3}),u.value!==null&&n.loadAttachmentPreview?(i.openBlock(),i.createBlock(Mde,{key:0,attachments:t.activity.attachments||[],"current-index":u.value,"load-preview":n.loadAttachmentPreview,"onUpdate:currentIndex":ee[10]||(ee[10]=ve=>u.value=ve),onClose:ee[11]||(ee[11]=ve=>u.value=null)},null,8,["attachments","current-index","load-preview"])):i.createCommentVNode("",!0)],64))}});const V1e=i.defineComponent({__name:"AoRuleLine",props:{rule:{},templatePhases:{},templateMilestones:{},templateActivities:{},tagName:{default:"li"}},emits:["update:rule","close"],setup(t,{emit:e}){const n=t,o=e,r=i.toRef(n.rule.itemType||Be.ACTIVITIES),s=i.computed({get(){return r.value},set(y){r.value=y,o("update:rule",{...n.rule,itemType:y,subItemId:void 0})}}),a=i.computed(()=>Object.values(Be)),l=i.computed({get(){return n.rule.subItemId},set(y){o("update:rule",{...n.rule,subItemId:y,itemType:n.rule.itemType||s.value})}}),c=i.computed(()=>{var v;return!n.templateActivities||!n.templateMilestones||!n.templatePhases?null:(v={[Be.ACTIVITIES]:n.templateActivities,[Be.MILESTONES]:n.templateMilestones,[Be.PHASES]:n.templatePhases}[r.value])==null?void 0:v.map(w=>({value:w.id,label:w.name}))}),u=i.toRef(n.rule.comparator),d=i.computed({get(){return u.value},set(y){o("update:rule",{...n.rule,comparator:y})}}),f=i.computed(()=>Object.values(fp)),p=i.toRef(n.rule.trigger),h=i.computed({get(){return p.value},set(y){o("update:rule",{...n.rule,trigger:y})}}),m=i.computed(()=>Object.values(pp)),g=i.computed({get(){return n.rule.duration},set(y){o("update:rule",{...n.rule,duration:y})}}),C=i.computed({get(){return n.rule.durationUnit},set(y){o("update:rule",{...n.rule,durationUnit:y})}}),_=i.computed(()=>Object.values(hp));return(y,v)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.tagName),{class:"ao-rule-line"},{default:i.withCtx(()=>[i.createVNode(i.unref(to),{modelValue:s.value,"onUpdate:modelValue":v[0]||(v[0]=w=>s.value=w),options:a.value},null,8,["modelValue","options"]),i.createVNode(i.unref(to),{modelValue:l.value,"onUpdate:modelValue":v[1]||(v[1]=w=>l.value=w),options:c.value},null,8,["modelValue","options"]),i.createVNode(i.unref(to),{modelValue:h.value,"onUpdate:modelValue":v[2]||(v[2]=w=>h.value=w),options:m.value},null,8,["modelValue","options"]),i.createVNode(i.unref(to),{modelValue:d.value,"onUpdate:modelValue":v[3]||(v[3]=w=>d.value=w),options:f.value},null,8,["modelValue","options"]),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":v[4]||(v[4]=w=>g.value=w),type:"number",min:"0"},null,512),[[i.vModelText,g.value,void 0,{number:!0}]]),i.createVNode(i.unref(to),{modelValue:C.value,"onUpdate:modelValue":v[5]||(v[5]=w=>C.value=w),options:_.value},null,8,["modelValue","options"]),i.createVNode(pe,{class:"ao-rule-line__remove","icon-name":"CloseRounded",variant:"ghost",onClick:v[6]||(v[6]=w=>y.$emit("close"))})]),_:1}))}});const R1e={class:"ao-template-rules__body"},z1e={class:"ao-template-rules__list"},U1e=i.defineComponent({__name:"AoTemplateRules",props:{templateId:{},rules:{},templatePhases:{},templateMilestones:{},templateActivities:{}},emits:["addRule","removeRule"],setup(t,{emit:e}){const n=e,o=()=>{n("addRule")},r=s=>{n("removeRule",s)};return(s,a)=>(i.openBlock(),i.createBlock(Da,null,{header:i.withCtx(()=>[i.createVNode(at,{title:s.$t("template.rules.title"),level:2},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("div",R1e,[i.createElementVNode("ul",z1e,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.rules,l=>(i.openBlock(),i.createBlock(V1e,{key:l.id,rule:l,"template-phases":t.templatePhases,"template-milestones":t.templateMilestones,"template-activities":t.templateActivities,class:"ao-template-rule",onClose:()=>r(l.id)},null,8,["rule","template-phases","template-milestones","template-activities","onClose"]))),128))]),i.createVNode(go,{label:s.$t("template.rules.add"),"icon-name":"Add",onClick:o},null,8,["label"])])]),_:1}))}});function Uo(t,e,n){const o=t.length,r=t.at(-1),s=r?it.LexoRank.parse(r.rank).genNext():it.LexoRank.middle();return{name:n(`template.defaultName.${e}`,{idx:o+1}),rank:s.format()}}const q1e={key:0,class:"ao-template-details"},H1e={class:"ao-template-details__body"},j1e={class:"ao-template-details__cols"},W1e={class:"ao-template-details__col"},Z1e={class:"ao-list__footer"},K1e={class:"ao-template-details__col"},G1e={class:"ao-template-details__col"},Lg=i.defineComponent({__name:"AoTemplateDetails",props:{templateId:{},templates:{},users:{},phaseId:{},milestoneId:{},activityId:{},activityTypes:{}},emits:["addItem","removeItem","updateItem","addRule","removeRule","addFiles","removeFile"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e,s=i.computed(()=>{var V;return(V=o.templates)==null?void 0:V.find(N=>N.id===o.templateId)}),a=i.ref(!1);i.watch(()=>[o.templateId,o.phaseId,o.milestoneId],()=>a.value=!1),i.watch(()=>{var V;return(V=s.value)==null?void 0:V.phases},(V,N)=>{a.value&&In(V,N)});const l=i.computed(()=>{var V,N;return(N=(V=s==null?void 0:s.value)==null?void 0:V.phases)==null?void 0:N.find(G=>G.id===o.phaseId)});i.watch(()=>{var V;return(V=l.value)==null?void 0:V.milestones},(V,N)=>{a.value&&In(V,N)});const c=i.computed(()=>{var V,N;return(N=(V=l.value)==null?void 0:V.milestones)==null?void 0:N.find(G=>G.id===o.milestoneId)});i.watch(()=>{var V;return(V=c.value)==null?void 0:V.activities},(V,N)=>{a.value&&In(V,N)});const u=i.computed(()=>{var V,N;return((N=(V=s.value)==null?void 0:V.phases)==null?void 0:N.reduce((G,z)=>{const H=z.milestones||[];return[...G,...H]},[]))||[]}),d=i.computed(()=>{var V,N;return((N=(V=s.value)==null?void 0:V.phases)==null?void 0:N.reduce((G,z)=>{const ue=(z.milestones||[]).reduce((Q,ie)=>ie.activities?[...Q,...ie.activities]:Q,[]);return[...G,...ue]},[]))||[]}),f=i.computed(()=>{var V,N;return(N=(V=c.value)==null?void 0:V.activities)==null?void 0:N.find(G=>G.id===o.activityId)}),p=i.computed(()=>{var V;return((V=s.value)==null?void 0:V.name)||o.templateId}),h=()=>{if(!s.value)return;const{name:V,rank:N}=Uo(s.value.phases,"phase",n);a.value=!0,r("addItem",{type:Be.PHASES,templateId:o.templateId,item:{name:V,rank:N}})},m=V=>{r("updateItem",{templateId:o.templateId,id:o.templateId,itemType:Be.TEMPLATES,data:{name:V}})},g=V=>{r("removeItem",{itemType:Be.PHASES,templateId:o.templateId,data:{id:V}})},C=(V,N)=>{r("updateItem",{templateId:o.templateId,id:V,itemType:Be.PHASES,data:{name:N}})},_=V=>{r("updateItem",V)},y=V=>{if(!l.value)return;const{name:N,rank:G}=Uo(l.value.milestones,"milestone",n);a.value=!0,r("addItem",{type:Be.MILESTONES,templateId:o.templateId,phaseId:V.phaseId,item:{name:N,rank:G,phaseId:V.phaseId}})},v=V=>{r("removeItem",{itemType:Be.MILESTONES,templateId:o.templateId,phaseId:V.phaseId,data:{id:V.id}})},w=V=>{const{id:N,...G}=V;r("updateItem",{itemType:Be.MILESTONES,id:N,templateId:o.templateId,data:G})},k=V=>{const{milestoneId:N}=V;if(!c.value)return;const{name:G,rank:z}=Uo(c.value.activities,"activity",n);a.value=!0,r("addItem",{type:Be.ACTIVITIES,milestoneId:N,templateId:o.templateId,item:{name:G,rank:z,milestoneId:N}})},b=V=>{var N,G;r("removeItem",{itemType:Be.ACTIVITIES,templateId:o.templateId,phaseId:(N=l.value)==null?void 0:N.id,milestoneId:(G=c.value)==null?void 0:G.id,data:{id:V.id}})},S=V=>{const{id:N,...G}=V;r("updateItem",{itemType:Be.ACTIVITIES,id:N,templateId:o.templateId,data:G})},T=i.ref(!1),A=()=>{T.value=!T.value},x=()=>{r("addRule",{templateId:o.templateId})},O=V=>{r("removeRule",{id:V,templateId:o.templateId})},M=V=>{var N;if(V.moved){const G=Xi(V,((N=s.value)==null?void 0:N.phases)??[]);r("updateItem",{itemType:Be.PHASES,id:V.moved.element.id,templateId:o.templateId,data:{rank:G}})}},$=V=>{!l.value||!c.value||!f.value||r("addItem",{type:Be.TASKS,activityId:V.activityId,milestoneId:c.value.id,phaseId:l.value.id,templateId:o.templateId,item:V})},B=V=>{!l.value||!c.value||!f.value||r("updateItem",{itemType:Be.TASKS,id:V.id,templateId:o.templateId,data:V})},P=V=>{!l.value||!c.value||!f.value||r("removeItem",{itemType:Be.TASKS,activityId:f.value.id,milestoneId:c.value.id,phaseId:l.value.id,templateId:o.templateId,data:V})},F=V=>{r("addFiles",V)},K=V=>{r("removeFile",V)};return(V,N)=>{var G,z,H,ue,Q,ie;return s.value?(i.openBlock(),i.createElementBlock("div",q1e,[i.createVNode(Qi,{"can-go-back":!0,onGoBack:N[1]||(N[1]=U=>V.$router.push({name:i.unref(Po).TEMPLATES_LIST}))},{primary:i.withCtx(()=>[i.createVNode(at,{title:p.value,level:2,"is-editable":!0,"onUpdate:title":N[0]||(N[0]=U=>{m(U)})},null,8,["title"])]),_:1}),i.createElementVNode("div",H1e,[i.createElementVNode("ol",j1e,[i.createElementVNode("li",W1e,[i.createVNode(i.unref(mo),{"model-value":s.value.phases,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:M},{header:i.withCtx(()=>[i.createVNode(at,{title:V.$t("template.phases.title"),level:3,class:"ao-list__title"},null,8,["title"])]),item:i.withCtx(({element:U})=>{var ne;return[i.createVNode(Z_,{id:U.id,name:U.name,milestones:U.milestones,"is-active":((ne=l.value)==null?void 0:ne.id)===U.id,"is-draggable":!0,onClick:ge=>V.$router.push({params:{templateId:t.templateId,phaseId:U.id}}),"onUpdate:title":ge=>{C(U.id,ge)},onRemove:()=>g(U.id)},null,8,["id","name","milestones","is-active","onClick","onUpdate:title","onRemove"])]}),footer:i.withCtx(()=>[i.createElementVNode("div",Z1e,[i.createVNode(go,{"icon-name":"AddBoxOutlineRounded",label:V.$t("template.phases.add"),onClick:h},null,8,["label"])])]),_:1},8,["model-value"])]),i.createElementVNode("li",K1e,[l.value?(i.openBlock(),i.createBlock(Y_,{key:0,"template-id":t.templateId,phase:l.value,"milestone-id":(G=c.value)==null?void 0:G.id,onAddMilestone:y,onUpdateMilestone:w,onUpdatePhase:_,onRemoveMilestone:v},null,8,["template-id","phase","milestone-id"])):i.createCommentVNode("",!0)]),i.createElementVNode("li",G1e,[l.value&&c.value?(i.openBlock(),i.createBlock(Q_,{key:0,"template-id":t.templateId,"phase-id":(z=l.value)==null?void 0:z.id,milestone:c.value,"activity-id":(H=f.value)==null?void 0:H.id,onAddActivity:k,onUpdateActivity:S,onRemoveActivity:b},null,8,["template-id","phase-id","milestone","activity-id"])):i.createCommentVNode("",!0)])])]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[f.value?(i.openBlock(),i.createBlock(Ju,{key:0,activity:f.value,"activity-types":t.activityTypes,breadcrumbs:`${s.value.name} / ${(ue=l.value)==null?void 0:ue.name} / ${(Q=c.value)==null?void 0:Q.name}`,"milestone-id":(ie=c.value)==null?void 0:ie.id,"template-activities":d.value,"template-milestones":u.value,"is-template":!0,"is-editable":!0,users:t.users,"attachment-enabled":!1,"onUpdate:activity":N[2]||(N[2]=U=>{f.value&&S(U)}),onClose:V.$router.back,onAddSubtask:$,onUpdateSubtask:B,onDeleteSubtask:P,onAddFiles:F,onRemoveFile:K},{default:i.withCtx(U=>[i.renderSlot(V.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(U)))]),_:3},8,["activity","activity-types","breadcrumbs","milestone-id","template-activities","template-milestones","users","onClose"])):i.createCommentVNode("",!0)])),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[T.value?(i.openBlock(),i.createBlock(U1e,{key:0,"template-id":s.value.id,rules:s.value.rules||[],"template-phases":s.value.phases,"template-milestones":u.value,"template-activities":d.value,onClose:A,onAddRule:x,onRemoveRule:O},null,8,["template-id","rules","template-phases","template-milestones","template-activities"])):i.createCommentVNode("",!0)]))])):i.createCommentVNode("",!0)}}});const Y1e={class:"ao-card__content"},J1e={key:0,class:"ao-card__header"},X1e={class:"ao-card__body"},Q1e={key:1,class:"ao-card__footer"},cl=i.defineComponent({__name:"AoCard",props:{isClickable:{type:Boolean},tagName:{default:"div"},isSelected:{type:Boolean},color:{},withLeftBorder:{type:Boolean,default:!1}},setup(t){return(e,n)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.tagName),{class:i.normalizeClass(["ao-card",{"ao-card--clickable":t.isClickable}]),style:i.normalizeStyle(t.isSelected?{border:"solid",borderColor:t.color||"var(--ao-color-blue-base)",borderWidth:"thick"}:{})},{default:i.withCtx(()=>[t.withLeftBorder?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ao-card__left-border",style:i.normalizeStyle({backgroundColor:t.color})},null,4)):i.createCommentVNode("",!0),i.createElementVNode("div",Y1e,[e.$slots.header?(i.openBlock(),i.createElementBlock("header",J1e,[i.renderSlot(e.$slots,"header")])):i.createCommentVNode("",!0),i.createElementVNode("div",X1e,[i.renderSlot(e.$slots,"default")]),e.$slots.footer?(i.openBlock(),i.createElementBlock("footer",Q1e,[i.renderSlot(e.$slots,"footer")])):i.createCommentVNode("",!0)])]),_:3},8,["class","style"]))}});const ul=i.defineComponent({__name:"AoProgress",props:{percentages:{},status:{},color:{}},setup(t){const e=t,n=i.computed(()=>typeof e.percentages=="number"?[e.percentages]:e.percentages??[]);return(o,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ao-progress",t.status?`ao-progress--${t.status}`:""]),role:"meter"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,s=>(i.openBlock(),i.createElementBlock("div",{key:s,class:i.normalizeClass(["ao-progress__progress"]),style:i.normalizeStyle({width:`${s*100}%`,"--ao-progress-color":t.color||"var(--ao-color-primary-base)"})},null,4))),128))],2))}});/*!
|
|
54
|
+
`)}}(t,n)(e)}var Mue=process.env.NODE_ENV==="production",oc="Invariant failed";function $ue(t,e){if(!t){if(Mue)throw new Error(oc);var n=typeof e=="function"?e():e,o=n?"".concat(oc,": ").concat(n):oc;throw new Error(o)}}const Ng=Symbol("LexicalEditor"),Bue=(()=>{const t=i.defineComponent({name:"LexicalComposer",props:{initialConfig:{required:!0}},emits:["error"],setup(e,n){let{emit:o,expose:r}=n;const s=o;r();const a=e,l={tag:Ai},{theme:c,namespace:u,nodes:d,onError:f,editorState:p,html:h}=a.initialConfig,m=zle({editable:a.initialConfig.editable,html:h,namespace:u,nodes:d,theme:c,onError(C){s("error",C,m),f==null||f(C,m)}});g(m,p);function g(C,_){if(_!==null){if(_===void 0)C.update(()=>{const y=Le();if(y.isEmpty()){const v=De();y.append(v);const w=yce?document.activeElement:null;(te()!==null||w!==null&&w===C.getRootElement())&&v.select()}},l);else if(_!==null)switch(typeof _){case"string":{const y=C.parseEditorState(_);C.setEditorState(y,l);break}case"object":C.setEditorState(_,l);break;case"function":C.update(()=>{Le().isEmpty()&&_(C)},l);break}}}return i.provide(Ng,m),i.onMounted(()=>{const C=a.initialConfig.editable;m.setEditable(C!==void 0?C:!0)}),(C,_)=>i.renderSlot(C.$slots,"default")}});return t.__vue_vine=!0,t})();function Gr(){const t=i.inject(Ng,null);return t||$ue(!1,"useLexicalComposer: cannot find a LexicalComposer"),t}function Oue(t,e){if(t==null)return{};var n=Lue(t,e),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)o=s[r],e.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(t,o)&&(n[o]=t[o])}return n}function Lue(t,e){if(t==null)return{};var n={},o=Object.keys(t),r,s;for(s=0;s<o.length;s++)r=o[s],e.indexOf(r)>=0||(n[r]=t[r]);return n}const Iue=(()=>{const t=["aria-activedescendant","aria-autocomplete","aria-controls","aria-describedby","aria-expanded","aria-label","aria-labelledby","aria-multiline","aria-owns","aria-readonly","aria-required","autocapitalize","contenteditable","role","spellcheck","tabindex"],e=i.defineComponent({name:"ContentEditableElement",props:{editor:{required:!0},ariaActiveDescendant:{},ariaAutoComplete:{},ariaControls:{},ariaDescribedBy:{},ariaErrorMessage:{},ariaExpanded:{type:Boolean},ariaInvalid:{type:Boolean},ariaLabel:{},ariaLabelledBy:{},ariaMultiline:{type:Boolean},ariaOwns:{},ariaRequired:{type:Boolean},onCopy:{},onCut:{},onPaste:{},onCompositionend:{},onCompositionstart:{},onCompositionupdate:{},onDrag:{},onDragend:{},onDragenter:{},onDragexit:{},onDragleave:{},onDragover:{},onDragstart:{},onDrop:{},onFocus:{},onFocusin:{},onFocusout:{},onBlur:{},onChange:{},onBeforeinput:{},onFormdata:{},onInput:{},onReset:{},onSubmit:{},onInvalid:{},onFullscreenchange:{},onFullscreenerror:{},onLoad:{},onError:{},onKeydown:{},onKeypress:{},onKeyup:{},onDblclick:{},onMousedown:{},onMouseenter:{},onMouseleave:{},onMousemove:{},onMouseout:{},onMouseover:{},onMouseup:{},onAbort:{},onCanplay:{},onCanplaythrough:{},onDurationchange:{},onEmptied:{},onEncrypted:{},onEnded:{},onLoadeddata:{},onLoadedmetadata:{},onLoadstart:{},onPause:{},onPlay:{},onPlaying:{},onProgress:{},onRatechange:{},onSeeked:{},onSeeking:{},onStalled:{},onSuspend:{},onTimeupdate:{},onVolumechange:{},onWaiting:{},onSelect:{},onScroll:{},onScrollend:{},onTouchcancel:{},onTouchend:{},onTouchmove:{},onTouchstart:{},onAuxclick:{},onClick:{},onContextmenu:{},onGotpointercapture:{},onLostpointercapture:{},onPointerdown:{},onPointermove:{},onPointerup:{},onPointercancel:{},onPointerenter:{},onPointerleave:{},onPointerover:{},onPointerout:{},onBeforetoggle:{},onToggle:{},onWheel:{},onAnimationcancel:{},onAnimationstart:{},onAnimationend:{},onAnimationiteration:{},onSecuritypolicyviolation:{},onTransitioncancel:{},onTransitionend:{},onTransitionrun:{},onTransitionstart:{},innerHTML:{},class:{},style:{type:Boolean},accesskey:{},contenteditable:{type:Boolean},contextmenu:{},dir:{},draggable:{type:Boolean},hidden:{type:Boolean},id:{},inert:{type:Boolean},lang:{},spellcheck:{type:Boolean},tabindex:{},title:{},translate:{},radiogroup:{},role:{},about:{},datatype:{},inlist:{},prefix:{},property:{},resource:{},typeof:{},vocab:{},autocapitalize:{},autocorrect:{},autosave:{},color:{},itemprop:{},itemscope:{type:Boolean},itemtype:{},itemid:{},itemref:{},results:{},security:{},unselectable:{},inputmode:{},is:{},"aria-activedescendant":{},"aria-atomic":{type:Boolean},"aria-autocomplete":{},"aria-busy":{type:Boolean},"aria-checked":{type:Boolean},"aria-colcount":{},"aria-colindex":{},"aria-colspan":{},"aria-controls":{},"aria-current":{type:Boolean},"aria-describedby":{},"aria-details":{},"aria-disabled":{type:Boolean},"aria-dropeffect":{},"aria-errormessage":{},"aria-expanded":{type:Boolean},"aria-flowto":{},"aria-grabbed":{type:Boolean},"aria-haspopup":{type:Boolean},"aria-hidden":{type:Boolean},"aria-invalid":{type:Boolean},"aria-keyshortcuts":{},"aria-label":{},"aria-labelledby":{},"aria-level":{},"aria-live":{},"aria-modal":{type:Boolean},"aria-multiline":{type:Boolean},"aria-multiselectable":{type:Boolean},"aria-orientation":{},"aria-owns":{},"aria-placeholder":{},"aria-posinset":{},"aria-pressed":{type:Boolean},"aria-readonly":{type:Boolean},"aria-relevant":{},"aria-required":{type:Boolean},"aria-roledescription":{},"aria-rowcount":{},"aria-rowindex":{},"aria-rowspan":{},"aria-selected":{type:Boolean},"aria-setsize":{},"aria-sort":{},"aria-valuemax":{},"aria-valuemin":{},"aria-valuenow":{},"aria-valuetext":{}},setup(n,o){let{expose:r}=o;r();const s=n,a=i.useTemplateRef("root"),l=i.ref(s.editor.isEditable()),c=i.computed(()=>Oue(s,["editor"]));i.onMounted(()=>{function d(p){p&&p.ownerDocument&&p.ownerDocument.defaultView?s.editor.setRootElement(p):s.editor.setRootElement(null)}d(a.value),l.value=s.editor.isEditable();const f=s.editor.registerEditableListener(p=>{l.value=p});i.onUnmounted(f)});const u=i.computed(()=>{var d;return(d=s.role)!=null?d:"textbox"});return(d,f)=>(i.openBlock(),i.createElementBlock("div",i.mergeProps({ref_key:"root",ref:a},c.value,{"aria-activedescendant":l.value?d.ariaActiveDescendant:void 0,"aria-autocomplete":l.value?d.ariaAutoComplete:"none","aria-controls":l.value?d.ariaControls:void 0,"aria-describedby":d.ariaDescribedBy,"aria-expanded":l.value&&u.value==="combobox"?!!d.ariaExpanded:void 0,"aria-label":d.ariaLabel,"aria-labelledby":d.ariaLabelledBy,"aria-multiline":d.ariaMultiline,"aria-owns":l.value?d.ariaOwns:void 0,"aria-readonly":l.value?void 0:!0,"aria-required":d.ariaRequired,autocapitalize:d.autocapitalize,contenteditable:l.value,role:l.value?u.value:void 0,spellcheck:d.spellcheck||!0,tabindex:d.tabindex}),null,16,t))}});return e.__vue_vine=!0,e})();function Pue(){return Le().getTextContent()}function Fue(t,e=!0){if(t)return!1;let n=Pue();return e&&(n=n.trim()),n===""}function Vue(t){if(!Fue(t,!1))return!1;const e=Le().getChildren(),n=e.length;if(n>1)return!1;for(let o=0;o<n;o++){const r=e[o];if(be(r))return!1;if(R(r)){if(!ls(r)||r.__indent!==0)return!1;const s=r.getChildren(),a=s.length;for(let l=0;l<a;l++){const c=s[o];if(!X(c))return!1}}}return!0}function Dg(t){return()=>Vue(t)}function Rue(t){return t.getEditorState().read(Dg(t.isComposing()))}function Mg(t){const e=t.getEditorState().read(Dg(t.isComposing())),n=i.ref(e);function o(){const r=Rue(t);n.value=r}return i.onMounted(()=>{const r=ds(t.registerUpdateListener(()=>{o()}),t.registerEditableListener(()=>{o()}));i.onUnmounted(()=>{r()})}),i.readonly(n)}function zue(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Uue(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{},o=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable}))),o.forEach(function(r){zue(t,r,n[r])})}return t}function que(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,o)}return n}function Hue(t,e){return e=e??{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):que(Object(e)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}const jue=(()=>{const t={key:0,"aria-hidden":"true"},e=i.defineComponent({name:"ContentEditable",props:{onCopy:{},onCut:{},onPaste:{},onCompositionend:{},onCompositionstart:{},onCompositionupdate:{},onDrag:{},onDragend:{},onDragenter:{},onDragexit:{},onDragleave:{},onDragover:{},onDragstart:{},onDrop:{},onFocus:{},onFocusin:{},onFocusout:{},onBlur:{},onChange:{},onBeforeinput:{},onFormdata:{},onInput:{},onReset:{},onSubmit:{},onInvalid:{},onFullscreenchange:{},onFullscreenerror:{},onLoad:{},onError:{},onKeydown:{},onKeypress:{},onKeyup:{},onDblclick:{},onMousedown:{},onMouseenter:{},onMouseleave:{},onMousemove:{},onMouseout:{},onMouseover:{},onMouseup:{},onAbort:{},onCanplay:{},onCanplaythrough:{},onDurationchange:{},onEmptied:{},onEncrypted:{},onEnded:{},onLoadeddata:{},onLoadedmetadata:{},onLoadstart:{},onPause:{},onPlay:{},onPlaying:{},onProgress:{},onRatechange:{},onSeeked:{},onSeeking:{},onStalled:{},onSuspend:{},onTimeupdate:{},onVolumechange:{},onWaiting:{},onSelect:{},onScroll:{},onScrollend:{},onTouchcancel:{},onTouchend:{},onTouchmove:{},onTouchstart:{},onAuxclick:{},onClick:{},onContextmenu:{},onGotpointercapture:{},onLostpointercapture:{},onPointerdown:{},onPointermove:{},onPointerup:{},onPointercancel:{},onPointerenter:{},onPointerleave:{},onPointerover:{},onPointerout:{},onBeforetoggle:{},onToggle:{},onWheel:{},onAnimationcancel:{},onAnimationstart:{},onAnimationend:{},onAnimationiteration:{},onSecuritypolicyviolation:{},onTransitioncancel:{},onTransitionend:{},onTransitionrun:{},onTransitionstart:{},innerHTML:{},class:{},style:{type:Boolean},accesskey:{},contenteditable:{type:Boolean},contextmenu:{},dir:{},draggable:{type:Boolean},hidden:{type:Boolean},id:{},inert:{type:Boolean},lang:{},spellcheck:{type:Boolean},tabindex:{},title:{},translate:{},radiogroup:{},role:{},about:{},datatype:{},inlist:{},prefix:{},property:{},resource:{},typeof:{},vocab:{},autocapitalize:{},autocorrect:{},autosave:{},color:{},itemprop:{},itemscope:{type:Boolean},itemtype:{},itemid:{},itemref:{},results:{},security:{},unselectable:{},inputmode:{},is:{},"aria-activedescendant":{},"aria-atomic":{type:Boolean},"aria-autocomplete":{},"aria-busy":{type:Boolean},"aria-checked":{type:Boolean},"aria-colcount":{},"aria-colindex":{},"aria-colspan":{},"aria-controls":{},"aria-current":{type:Boolean},"aria-describedby":{},"aria-details":{},"aria-disabled":{type:Boolean},"aria-dropeffect":{},"aria-errormessage":{},"aria-expanded":{type:Boolean},"aria-flowto":{},"aria-grabbed":{type:Boolean},"aria-haspopup":{type:Boolean},"aria-hidden":{type:Boolean},"aria-invalid":{type:Boolean},"aria-keyshortcuts":{},"aria-label":{},"aria-labelledby":{},"aria-level":{},"aria-live":{},"aria-modal":{type:Boolean},"aria-multiline":{type:Boolean},"aria-multiselectable":{type:Boolean},"aria-orientation":{},"aria-owns":{},"aria-placeholder":{},"aria-posinset":{},"aria-pressed":{type:Boolean},"aria-readonly":{type:Boolean},"aria-relevant":{},"aria-required":{type:Boolean},"aria-roledescription":{},"aria-rowcount":{},"aria-rowindex":{},"aria-rowspan":{},"aria-selected":{type:Boolean},"aria-setsize":{},"aria-sort":{},"aria-valuemax":{},"aria-valuemin":{},"aria-valuenow":{},"aria-valuetext":{},ariaActiveDescendant:{},ariaAutoComplete:{},ariaControls:{},ariaDescribedBy:{},ariaErrorMessage:{},ariaExpanded:{type:Boolean},ariaInvalid:{type:Boolean},ariaLabel:{},ariaLabelledBy:{},ariaMultiline:{type:Boolean},ariaOwns:{},ariaRequired:{type:Boolean}},setup(n,o){let{expose:r}=o;r();const s=Gr(),a=i.ref(!1),l=Mg(s);return i.onMounted(()=>{a.value=s.isEditable();const c=s.registerEditableListener(u=>{a.value=u});i.onUnmounted(c)}),(c,u)=>{var d,f;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(i.unref(Iue),i.mergeProps({editor:i.unref(s)},Hue(Uue({},c.$props),{role:(d=c.role)!=null?d:"textbox",spellcheck:(f=c.spellcheck)!=null?f:!0})),null,16,["editor"]),i.unref(l)?(i.openBlock(),i.createElementBlock("div",t,[i.renderSlot(c.$slots,"placeholder")])):i.createCommentVNode("",!0)],64)}}});return e.__vue_vine=!0,e})();function Wue(t,e,n,o,r){if(t===null||n.size===0&&o.size===0&&!r)return 0;const s=e._selection,a=t._selection;if(r)return 1;if(!(W(s)&&W(a)&&a.isCollapsed()&&s.isCollapsed()))return 0;const l=function(_,y,v){const w=_._nodeMap,k=[];for(const b of y){const S=w.get(b);S!==void 0&&k.push(S)}for(const[b,S]of v){if(!S)continue;const T=w.get(b);T===void 0||Re(T)||k.push(T)}return k}(e,n,o);if(l.length===0)return 0;if(l.length>1){const _=e._nodeMap,y=_.get(s.anchor.key),v=_.get(a.anchor.key);return y&&v&&!t._nodeMap.has(y.__key)&&X(y)&&y.__text.length===1&&s.anchor.offset===1?2:0}const c=l[0],u=t._nodeMap.get(c.__key);if(!X(u)||!X(c)||u.__mode!==c.__mode)return 0;const d=u.__text,f=c.__text;if(d===f)return 0;const p=s.anchor,h=a.anchor;if(p.key!==h.key||p.type!=="text")return 0;const m=p.offset,g=h.offset,C=f.length-d.length;return C===1&&g===m-1?2:C===-1&&g===m+1?3:C===-1&&g===m?4:0}function Zue(t,e){let n=Date.now(),o=0;return(r,s,a,l,c,u)=>{const d=Date.now();if(u.has(da))return o=0,n=d,2;const f=Wue(r,s,l,c,t.isComposing()),p=(()=>{const h=a===null||a.editor===t,m=u.has(Cle);if(!m&&h&&u.has(Ai))return 0;if(r===null)return 1;const g=s._selection;if(!(l.size>0||c.size>0))return g!==null?0:2;const C=typeof e=="number"?e:e.peek();return m===!1&&f!==0&&f===o&&d<n+C&&h||l.size===1&&function(_,y,v){const w=y._nodeMap.get(_),k=v._nodeMap.get(_),b=y._selection,S=v._selection;return!(W(b)&&W(S)&&b.anchor.type==="element"&&b.focus.type==="element"&&S.anchor.type==="text"&&S.focus.type==="text"||!X(w)||!X(k)||w.__parent!==k.__parent)&&JSON.stringify(y.read(()=>w.exportJSON()))===JSON.stringify(v.read(()=>k.exportJSON()))}(Array.from(l)[0],r,s)?0:1})();return n=d,o=f,p}}function ap(t){t.undoStack=[],t.redoStack=[],t.current=null}function Kue(t,e,n){const o=Zue(t,n);return ds(t.registerCommand(_u,()=>(function(s,a){const l=a.redoStack,c=a.undoStack;if(c.length!==0){const u=a.current,d=c.pop();u!==null&&(l.push(u),s.dispatchCommand(Ms,!0)),c.length===0&&s.dispatchCommand($s,!1),a.current=d||null,d&&d.editor.setEditorState(d.editorState,{tag:da})}}(t,e),!0),Ce),t.registerCommand(Cu,()=>(function(s,a){const l=a.redoStack,c=a.undoStack;if(l.length!==0){const u=a.current;u!==null&&(c.push(u),s.dispatchCommand($s,!0));const d=l.pop();l.length===0&&s.dispatchCommand(Ms,!1),a.current=d||null,d&&d.editor.setEditorState(d.editorState,{tag:da})}}(t,e),!0),Ce),t.registerCommand(hle,()=>(ap(e),!1),Ce),t.registerCommand(mle,()=>(ap(e),t.dispatchCommand(Ms,!1),t.dispatchCommand($s,!1),!0),Ce),t.registerUpdateListener(({editorState:s,prevEditorState:a,dirtyLeaves:l,dirtyElements:c,tags:u})=>{const d=e.current,f=e.redoStack,p=e.undoStack,h=d===null?null:d.editorState;if(d!==null&&s===h)return;const m=o(a,s,d,l,c,u);if(m===1)f.length!==0&&(e.redoStack=[],t.dispatchCommand(Ms,!1)),d!==null&&(p.push({...d}),t.dispatchCommand($s,!0));else if(m===2)return;e.current={editor:t,editorState:s}}))}function Gue(){return{current:null,redoStack:[],undoStack:[]}}function Yue(t,e,n){const o=i.computed(()=>i.toValue(e)||Gue());i.watchEffect(r=>{const s=Kue(i.toValue(t),o.value,i.toValue(n)||1e3);r(s)})}const Jue=(()=>{const t=i.defineComponent({name:"HistoryPlugin",props:{delay:{},externalHistoryState:{}},setup(e,n){let{expose:o}=n;o();const r=e,s=Gr();return Yue(s,()=>r.externalHistoryState,()=>r.delay),(a,l)=>null}});return t.__vue_vine=!0,t})();function Xue(t){i.onMounted(()=>{const e=Mce(t);i.onUnmounted(()=>{e()})})}const Que=(()=>{const t=i.defineComponent({name:"ListPlugin",props:{hasStrictIndent:{type:Boolean}},setup(e,n){let{expose:o}=n;o();const r=e,s=Gr();return i.watchEffect(a=>{if(!s.hasNodes([or,Co]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");if(!r.hasStrictIndent)return;const l=$ce(s);a(l)}),Xue(s),(a,l)=>null}});return t.__vue_vine=!0,t})();function ede(t){const e=i.shallowRef(t.getDecorators());return i.onMounted(()=>{const n=t.registerDecoratorListener(o=>{e.value=o});i.onUnmounted(()=>{n()})}),i.computed(()=>{const n=[],o=Object.keys(i.unref(e));for(let r=0;r<o.length;r++){const s=o[r],a=e.value[s],l=t.getElementByKey(s);l!==null&&n.push(i.h(i.Teleport,{to:l},a))}return n})}const tde=i.defineComponent({name:"LexicalDecoratedTeleports",setup(){const t=Gr(),e=ede(t);return()=>e.value}});function nde(t){i.onMounted(()=>{const e=ds(Yce(t),Uce(t));i.onUnmounted(e)})}const ode=(()=>{const t=i.defineComponent({name:"RichTextPlugin",setup(e,n){let{expose:o}=n;o();const r=Gr(),s=Mg(r);return nde(r),(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.unref(s)?i.renderSlot(a.$slots,"placeholder",{key:0}):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"contentEditable"),i.createVNode(i.unref(tde))],64))}});return t.__vue_vine=!0,t})(),rc=[_g,Cg,bg,kg,Eg,xg,Tg,Sg,wg],rde={class:"ao-lexical-editor__placeholder"},$g=i.defineComponent({__name:"AoLexicalEditor",props:{initialMarkdown:{default:""},placeholder:{default:"Enter text..."},variant:{default:"default"}},emits:["ready","keydown"],setup(t,{expose:e,emit:n}){const o=t,r=n,s=i.shallowRef(null),a=i.shallowRef(null),l=i.ref("paragraph"),c=i.computed(()=>({"ao-lexical-editor--compact":o.variant==="compact"})),u={namespace:"AoLexicalEditor",nodes:[or,Co,il,sl],theme:{paragraph:"ao-lexical-editor__paragraph",heading:{h1:"ao-lexical-editor__heading-h1",h2:"ao-lexical-editor__heading-h2",h3:"ao-lexical-editor__heading-h3"},code:"ao-lexical-editor__code-block",text:{bold:"ao-lexical-editor__text-bold",italic:"ao-lexical-editor__text-italic",strikethrough:"ao-lexical-editor__text-strikethrough",code:"ao-lexical-editor__inline-code"},list:{ul:"ao-lexical-editor__list-ul",ol:"ao-lexical-editor__list-ol",listitem:"ao-lexical-editor__list-item"}},editorState:()=>{Nue(o.initialMarkdown||"",rc)},onError(x){console.error("Lexical error:",x)}},d=i.defineComponent({name:"AoLexicalEditorBridge",emits:{ready:x=>!0,blockStyleChange:x=>!0,selectionChange:x=>!0},setup(x,{emit:O}){const M=Gr();let $=null,B=null;function P(){M.getEditorState().read(()=>{const F=te();if(!W(F))return;O("selectionChange",F.clone());const K=F.anchor.getNode(),V=K.getKey()==="root"?K:K.getTopLevelElementOrThrow();if(sg(V)){const N=V.getTag();if(N==="h1"||N==="h2"||N==="h3"){O("blockStyleChange",N);return}}if(al(V)){O("blockStyleChange","code");return}O("blockStyleChange","paragraph")})}return i.onMounted(()=>{O("ready",M),P(),B=Aue(M,rc),$=M.registerUpdateListener(()=>{P()})}),i.onUnmounted(()=>{B==null||B(),$==null||$()}),()=>null}});function f(x){s.value=x,r("ready",x)}function p(x){a.value=x}function h(x){r("keydown",x)}function m(){a.value&&nt(a.value.clone())}function g(x){const O=s.value;O&&(O.update(()=>{m(),x()}),O.focus())}function C(){const x=s.value;x&&(x.update(()=>{m()}),x.dispatchCommand(Rt,"bold"),x.focus())}function _(){const x=s.value;x&&(x.update(()=>{m()}),x.dispatchCommand(Rt,"italic"),x.focus())}function y(){const x=s.value;x&&(x.update(()=>{m()}),x.dispatchCommand(Rt,"strikethrough"),x.focus())}function v(){const x=s.value;x&&(x.update(()=>{m()}),x.dispatchCommand(Rt,"code"),x.focus())}function w(){const x=s.value;x&&(x.update(()=>{m()}),x.dispatchCommand(Jm,void 0),x.focus())}function k(){const x=s.value;x&&(x.update(()=>{m()}),x.dispatchCommand(Xm,void 0),x.focus())}function b(x){g(()=>{const O=te();if(W(O)){if(O.isCollapsed()||O.focus.set(O.anchor.key,O.anchor.offset,O.anchor.type),x==="paragraph"){Ql(O,()=>De());return}if(x==="code"){Ql(O,()=>vn());return}Ql(O,()=>Io(x))}}),l.value=x}function S(){const x=s.value;return x?x.getEditorState().read(()=>Due(rc)):""}function T(){const x=s.value;x&&x.update(()=>{const O=Le();O.clear(),O.append(De())})}function A(){var x;(x=s.value)==null||x.focus()}return e({toggleBold:C,toggleItalic:_,toggleStrikethrough:y,toggleInlineCode:v,insertBulletList:w,insertNumberedList:k,setBlockStyle:b,getMarkdown:S,clear:T,focus:A,blockStyle:l}),(x,O)=>(i.openBlock(),i.createBlock(i.unref(Bue),{"initial-config":u},{default:i.withCtx(()=>[i.renderSlot(x.$slots,"toolbar"),i.createElementVNode("div",{class:i.normalizeClass(["ao-lexical-editor",c.value])},[i.createVNode(i.unref(ode),null,{contentEditable:i.withCtx(()=>[i.createVNode(i.unref(jue),{class:"ao-lexical-editor__content",onKeydown:h},{placeholder:i.withCtx(()=>[i.createElementVNode("div",rde,i.toDisplayString(t.placeholder),1)]),_:1})]),_:1})],2),i.createVNode(i.unref(Jue)),i.createVNode(i.unref(Que)),i.createVNode(i.unref(d),{onReady:f,onBlockStyleChange:O[0]||(O[0]=M=>l.value=M),onSelectionChange:p})]),_:3}))}});function ide(t,e){const n=i.ref(""),o=i.ref(!1),r=i.ref({top:0,left:0}),s=i.ref(0),a=i.computed(()=>e.value.filter(m=>m.firstName||m.lastName).map(m=>({id:m.id,name:$p(m)}))),l=i.computed(()=>a.value.filter(m=>m.name.toLowerCase().includes(n.value.toLowerCase())));function c(){o.value=!1,n.value="",s.value=0}function u(){const m=te();if(!W(m)||!m.isCollapsed()){c();return}const g=m.anchor.getNode();if(!X(g)){c();return}const _=g.getTextContent().slice(0,m.anchor.offset).match(/@([\p{L}\p{M}0-9_-]*)$/u);if(!_){c();return}n.value=_[1],o.value=!0,s.value>=l.value.length&&(s.value=0)}function d(){const m=t.value;if(!m||!o.value)return;const g=window.getSelection();if(!g||g.rangeCount===0)return;const C=g.getRangeAt(0),_=C.getClientRects().item(0)??C.getBoundingClientRect(),y=m.getRootElement();if(!y)return;const v=y.getBoundingClientRect();r.value={top:_.bottom-v.top+4,left:_.left-v.left}}function f(m){const g=t.value;g&&(g.update(()=>{const C=te();if(!W(C)||!C.isCollapsed())return;const _=C.anchor.getNode();if(!X(_))return;const y=_.getTextContent(),v=C.anchor.offset,k=y.slice(0,v).match(/@([\p{L}\p{M}0-9_-]*)$/u);if(!k)return;const b=v-k[0].length,S=`@${m} `,T=y.slice(0,b)+S+y.slice(v);_.setTextContent(T);const A=b+S.length;C.anchor.set(_.getKey(),A,"text"),C.focus.set(_.getKey(),A,"text")}),c(),g.focus())}function p(m){if(!o.value)return!1;switch(m.key){case"ArrowDown":return m.preventDefault(),l.value.length>0&&(s.value=(s.value+1)%l.value.length),!0;case"ArrowUp":return m.preventDefault(),l.value.length>0&&(s.value=(s.value-1+l.value.length)%l.value.length),!0;case"Enter":{if(l.value.length===0)return!1;m.preventDefault();const g=l.value[s.value];return g&&f(g.name),!0}case"Escape":return m.preventDefault(),c(),!0;default:return!1}}function h(){const m=t.value;if(m)return m.registerUpdateListener(({editorState:g})=>{g.read(()=>{u()}),o.value&&requestAnimationFrame(()=>{d()})})}return{mentionQuery:n,showMentionList:o,mentionListPosition:r,filteredUsers:l,selectedIndex:s,selectUserMention:f,handleKeydown:p,closeMentionList:c,setupMentionTracking:h}}const sde={key:0,class:"ao-comment-editor__toolbar"},ade=["onClick"],Bg=i.defineComponent({__name:"AoCommentEditor",props:{initialMarkdown:{default:""},placeholder:{default:"Add a comment..."},mentionableUsers:{default:()=>[]},showSubmitButton:{type:Boolean,default:!0},toolbarVisibility:{default:"focus"}},emits:["submit","cancel","focus","blur"],setup(t,{expose:e,emit:n}){const o=t,r=n,s=i.ref(null),a=i.shallowRef(null),l=i.ref(!1),c=i.toRef(o,"mentionableUsers"),{showMentionList:u,mentionListPosition:d,filteredUsers:f,selectedIndex:p,selectUserMention:h,handleKeydown:m,closeMentionList:g,setupMentionTracking:C}=ide(a,c);let _,y;const v=i.computed(()=>o.toolbarVisibility==="always"||l.value);i.onUnmounted(()=>{_==null||_(),y!==void 0&&window.clearTimeout(y)});function w(M){a.value=M,_==null||_(),_=C()}function k(){y!==void 0&&(window.clearTimeout(y),y=void 0),l.value||(l.value=!0,r("focus"))}function b(){y!==void 0&&window.clearTimeout(y),y=window.setTimeout(()=>{var B;y=void 0;const M=(B=a.value)==null?void 0:B.getRootElement(),$=document.activeElement;M&&$ instanceof Node&&M.contains($)||l.value&&(l.value=!1,r("blur"))},100)}function S(M){if(!m(M)){if(M.key==="Enter"&&(M.ctrlKey||M.metaKey)){M.preventDefault(),T();return}if(M.key==="Escape"){if(u.value){g();return}M.preventDefault(),A()}}}function T(){const M=s.value;if(!M)return;const $=M.getMarkdown();$.trim()&&r("submit",$)}function A(){g(),r("cancel")}function x(){var M;(M=s.value)==null||M.clear(),g()}function O(){var M;(M=s.value)==null||M.focus()}return e({submit:T,cancel:A,reset:x,focus:O}),(M,$)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ao-comment-editor",{"ao-comment-editor--focused":l.value}])},[v.value?(i.openBlock(),i.createElementBlock("div",sde,[i.createElementVNode("button",{type:"button",class:"ao-comment-editor__toolbar-button",title:"Bold",onMousedown:$[0]||($[0]=i.withModifiers(()=>{},["prevent"])),onClick:$[1]||($[1]=B=>{var P;return(P=s.value)==null?void 0:P.toggleBold()})},[...$[14]||($[14]=[i.createElementVNode("strong",null,"B",-1)])],32),i.createElementVNode("button",{type:"button",class:"ao-comment-editor__toolbar-button",title:"Italic",onMousedown:$[2]||($[2]=i.withModifiers(()=>{},["prevent"])),onClick:$[3]||($[3]=B=>{var P;return(P=s.value)==null?void 0:P.toggleItalic()})},[...$[15]||($[15]=[i.createElementVNode("em",null,"I",-1)])],32),i.createElementVNode("button",{type:"button",class:"ao-comment-editor__toolbar-button",title:"Strikethrough",onMousedown:$[4]||($[4]=i.withModifiers(()=>{},["prevent"])),onClick:$[5]||($[5]=B=>{var P;return(P=s.value)==null?void 0:P.toggleStrikethrough()})},[...$[16]||($[16]=[i.createElementVNode("s",null,"S",-1)])],32),i.createElementVNode("button",{type:"button",class:"ao-comment-editor__toolbar-button",title:"Inline code",onMousedown:$[6]||($[6]=i.withModifiers(()=>{},["prevent"])),onClick:$[7]||($[7]=B=>{var P;return(P=s.value)==null?void 0:P.toggleInlineCode()})},[...$[17]||($[17]=[i.createElementVNode("span",null,"</>",-1)])],32),$[18]||($[18]=i.createElementVNode("span",{class:"ao-comment-editor__toolbar-divider"},null,-1)),i.createElementVNode("button",{type:"button",class:"ao-comment-editor__toolbar-button",title:"Bullet list",onMousedown:$[8]||($[8]=i.withModifiers(()=>{},["prevent"])),onClick:$[9]||($[9]=B=>{var P;return(P=s.value)==null?void 0:P.insertBulletList()})}," • ",32),i.createElementVNode("button",{type:"button",class:"ao-comment-editor__toolbar-button",title:"Numbered list",onMousedown:$[10]||($[10]=i.withModifiers(()=>{},["prevent"])),onClick:$[11]||($[11]=B=>{var P;return(P=s.value)==null?void 0:P.insertNumberedList()})}," 1. ",32)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"ao-comment-editor__wrapper",onFocusin:k,onFocusout:b},[i.createVNode($g,{ref_key:"lexicalEditorRef",ref:s,"initial-markdown":t.initialMarkdown,placeholder:t.placeholder,variant:"compact",onReady:w,onKeydown:S},null,8,["initial-markdown","placeholder"]),i.unref(u)&&i.unref(f).length>0?(i.openBlock(),i.createElementBlock("ul",{key:0,class:"ao-comment-editor__mention-list",style:i.normalizeStyle({top:i.unref(d).top+"px",left:i.unref(d).left+"px"})},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(f),(B,P)=>(i.openBlock(),i.createElementBlock("li",{key:B.id,class:i.normalizeClass({"ao-comment-editor__mention-item--selected":P===i.unref(p)}),onMousedown:$[12]||($[12]=i.withModifiers(()=>{},["prevent"])),onClick:F=>i.unref(h)(B.name)}," @"+i.toDisplayString(B.name),43,ade))),128))],4)):i.createCommentVNode("",!0),t.showSubmitButton?(i.openBlock(),i.createElementBlock("button",{key:1,type:"button",class:"ao-comment-editor__submit",title:"Send comment",onMousedown:$[13]||($[13]=i.withModifiers(()=>{},["prevent"])),onClick:T},[i.createVNode(ke,{name:"SendRounded"})],32)):i.createCommentVNode("",!0)],32)],2))}});const lde={class:"ao-comment"},cde={class:"ao-comment__created-at"},ude={class:"ao-comment__body"},dde={class:"ao-comment__content-wrapper"},fde={key:0,class:"ao-comment__footer"},pde=i.defineComponent({__name:"AoComment",props:{user:{},content:{},createdAt:{},editedAt:{},isEditable:{type:Boolean},mentionableUsers:{}},emits:["edit","remove"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{const m=n.user;return m?`${m.firstName??""}${m.firstName?" ":""}${m.lastName??""}`:null}),s=i.ref(!1),a=i.ref(n.content),l=i.ref(null),c=i.computed(()=>{const m=n.editedAt&&Li(n.editedAt),g=Li(n.createdAt),C=new Date,_=m??g;return _&&L7(_,C)});i.watch(()=>n.content,m=>{s.value||(a.value=m)});function u(){a.value=n.content,s.value=!0,i.nextTick(()=>{var m;(m=l.value)==null||m.focus()})}function d(m){o("edit",m),s.value=!1}function f(){var m;(m=l.value)==null||m.submit()}function p(){s.value=!1,a.value=n.content}function h(){o("remove")}return(m,g)=>{var C;return i.openBlock(),i.createElementBlock("li",lde,[i.createElementVNode("span",cde,i.toDisplayString(c.value),1),r.value?(i.openBlock(),i.createBlock(Un,{key:0,"avatar-url":(C=t.user)==null?void 0:C.avatarUrl,"user-name":r.value,class:"ao-comment__avatar"},null,8,["avatar-url","user-name"])):i.createCommentVNode("",!0),i.createElementVNode("div",ude,[i.createElementVNode("div",dde,[s.value?(i.openBlock(),i.createBlock(Bg,{key:1,ref_key:"commentEditorRef",ref:l,"initial-markdown":a.value,"mentionable-users":t.mentionableUsers,"show-submit-button":!1,"toolbar-visibility":"always",onSubmit:d,onCancel:p},null,8,["initial-markdown","mentionable-users"])):(i.openBlock(),i.createBlock(Ch,{key:0,content:t.content,placeholder:"",class:"ao-comment__content"},null,8,["content"]))]),t.isEditable?(i.openBlock(),i.createElementBlock("div",fde,[s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createVNode(pe,{"icon-name":"CloseRounded",size:"sm",variant:"ghost",color:"neutral",onClick:p}),i.createVNode(pe,{"icon-name":"CheckSmallRounded",size:"sm",variant:"solid",corners:"round",color:"black",onClick:f})],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createVNode(pe,{label:m.$t("activity.comment.edit"),size:"sm",variant:"ghost",color:"neutral",onClick:u},null,8,["label"]),i.createVNode(pe,{label:m.$t("activity.comment.delete"),size:"sm",variant:"ghost",color:"neutral",onClick:h},null,8,["label"])],64))])):i.createCommentVNode("",!0)])])}}});const hde={class:"ao-comments__new"},mde={key:0,class:"ao-comments__list"},gde=i.defineComponent({__name:"AoActivityDetailsComments",props:{comments:{default:()=>[]},users:{},newComment:{default:""},userId:{}},emits:["createComment","updateComment","removeComment"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>[...n.comments].sort((f,p)=>xy(Li(f.createdAt),Li(p.createdAt)))),s=f=>n.users.find(p=>p.id===f),a=i.ref(null);i.nextTick(()=>{a.value&&(a.value.scrollTop=a.value.scrollHeight)});const l=i.ref(null);function c(f){var h;if(!f.trim())return;const p=wd(f,n.users);o("createComment",{authorId:n.userId,message:f,mentionedUserIds:p}),(h=l.value)==null||h.reset()}function u(f,p){const h=wd(p,n.users);o("updateComment",{id:f,message:p,mentionedUserIds:h})}function d(f){o("removeComment",{id:f})}return(f,p)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"commentsContainer",ref:a,class:"ao-comments"},[i.createElementVNode("div",hde,[i.createVNode(Bg,{ref_key:"newCommentEditorRef",ref:l,"initial-markdown":t.newComment,"mentionable-users":t.users,placeholder:f.$t("activity.comment.label"),onSubmit:c},null,8,["initial-markdown","mentionable-users","placeholder"])]),r.value.length>0?(i.openBlock(),i.createElementBlock("ul",mde,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,h=>(i.openBlock(),i.createBlock(pde,{key:h.id,user:s(h.author.id),content:h.message,"created-at":h.createdAt,"edited-at":h.updatedAt,"is-editable":h.author.id===t.userId,"mentionable-users":t.users,class:"ao-comment",onEdit:m=>u(h.id,m),onRemove:()=>d(h.id)},null,8,["user","content","created-at","edited-at","is-editable","mentionable-users","onEdit","onRemove"]))),128))])):i.createCommentVNode("",!0)],512))}});const vde=["aria-label"],yde={class:"ao-file-preview__container"},_de={class:"ao-file-preview__header"},Cde=["title"],bde={class:"ao-file-preview__actions"},kde=["aria-label"],wde={key:0,class:"ao-file-preview__loading"},Ede=["src","alt"],xde=["src","title"],Sde={key:3,class:"ao-file-preview__fallback"},Tde={class:"ao-file-preview__fallback-title"},Ade={class:"ao-file-preview__fallback-filename"},Nde=["aria-label"],Dde={key:0,class:"ao-file-preview__counter"},Mde=i.defineComponent({__name:"AoFilePreview",props:{attachments:{},currentIndex:{},loadPreview:{type:Function}},emits:["update:currentIndex","close"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(null),s=i.ref(!1),a=i.ref(!1);let l=0;const c=i.computed(()=>n.attachments[n.currentIndex]),u=i.computed(()=>n.currentIndex===0),d=i.computed(()=>n.currentIndex===n.attachments.length-1),f=i.computed(()=>{var x,O;return((O=(x=c.value)==null?void 0:x.mimeType)==null?void 0:O.toLowerCase())??""}),p=i.computed(()=>{var x;return((x=c.value)==null?void 0:x.name)??""}),h=i.computed(()=>{var x;return((x=p.value.split(".").pop())==null?void 0:x.toLowerCase())??""}),m=i.computed(()=>f.value.startsWith("image/")?!0:["jpg","jpeg","png","gif","webp"].includes(h.value)),g=i.computed(()=>f.value==="application/pdf"||h.value==="pdf"),C=i.computed(()=>m.value||g.value),_=i.computed(()=>m.value?"ImageRounded":g.value?"PictureAsPdfRounded":"InsertDriveFileRounded");function y(){r.value&&(URL.revokeObjectURL(r.value),r.value=null)}async function v(){const x=c.value,O=++l;if(y(),a.value=!1,s.value=!1,!x||!C.value){a.value=!0;return}s.value=!0;try{if(!n.loadPreview)throw new Error("Attachment preview loader is missing");const M=await n.loadPreview(x);if(O!==l)return;if(!M.size)throw new Error("Empty file received");r.value=URL.createObjectURL(M)}catch(M){if(O!==l)return;console.error("Failed to load attachment preview:",M),a.value=!0}finally{O===l&&(s.value=!1)}}function w(){u.value||o("update:currentIndex",n.currentIndex-1)}function k(){d.value||o("update:currentIndex",n.currentIndex+1)}function b(){const x=c.value;if(!(x!=null&&x.url))return;const O=document.createElement("a");O.href=x.url,O.download=x.name,O.target="_blank",O.rel="noopener noreferrer",document.body.appendChild(O),O.click(),O.remove()}function S(){y(),a.value=!0}function T(){++l,y(),o("close")}function A(x){switch(x.key){case"Escape":T();break;case"ArrowLeft":w();break;case"ArrowRight":k();break}}return i.watch(()=>n.currentIndex,()=>{if(n.currentIndex<0||n.currentIndex>=n.attachments.length){T();return}v()},{immediate:!0}),i.onMounted(()=>{document.addEventListener("keydown",A)}),i.onUnmounted(()=>{++l,document.removeEventListener("keydown",A),y()}),(x,O)=>{var M,$,B,P,F,K;return i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createElementVNode("div",{class:"ao-file-preview",role:"dialog","aria-modal":"true","aria-label":(M=c.value)==null?void 0:M.name},[i.createElementVNode("div",{class:"ao-file-preview__backdrop",onClick:T}),i.createElementVNode("div",yde,[i.createElementVNode("header",_de,[i.createElementVNode("span",{class:"ao-file-preview__filename",title:($=c.value)==null?void 0:$.name},i.toDisplayString((B=c.value)==null?void 0:B.name),9,Cde),i.createElementVNode("div",bde,[i.createVNode(pe,{"icon-name":"DownloadRounded",variant:"ghost",color:"primary",size:"sm","aria-label":x.$t("activity.attachment.preview.download"),title:x.$t("activity.attachment.preview.download"),onClick:b},null,8,["aria-label","title"]),i.createVNode(pe,{"icon-name":"CloseRounded",variant:"ghost",color:"primary",size:"sm","aria-label":x.$t("activity.attachment.preview.close"),title:x.$t("activity.attachment.preview.close"),onClick:T},null,8,["aria-label","title"])])]),i.createElementVNode("main",{class:i.normalizeClass(["ao-file-preview__content",{"ao-file-preview__content--image":m.value&&r.value&&!a.value}])},[u.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",class:"ao-file-preview__nav ao-file-preview__nav--prev","aria-label":x.$t("activity.attachment.preview.previous"),onClick:i.withModifiers(w,["stop"])},[i.createVNode(ke,{name:"ArrowBackRounded",size:"lg"})],8,kde)),i.createElementVNode("div",{class:"ao-file-preview__viewer",onClick:O[0]||(O[0]=i.withModifiers(()=>{},["stop"]))},[s.value?(i.openBlock(),i.createElementBlock("div",wde,[...O[1]||(O[1]=[i.createElementVNode("div",{class:"ao-file-preview__spinner","aria-hidden":"true"},null,-1),i.createElementVNode("span",null,"Loading...",-1)])])):m.value&&r.value&&!a.value?(i.openBlock(),i.createElementBlock("img",{key:1,src:r.value,alt:(P=c.value)==null?void 0:P.name,class:"ao-file-preview__image",onError:S},null,40,Ede)):g.value&&r.value&&!a.value?(i.openBlock(),i.createElementBlock("iframe",{key:2,src:r.value,title:(F=c.value)==null?void 0:F.name,class:"ao-file-preview__pdf"},null,8,xde)):(i.openBlock(),i.createElementBlock("div",Sde,[i.createVNode(ke,{name:_.value,size:"xl"},null,8,["name"]),i.createElementVNode("p",Tde,i.toDisplayString(x.$t("activity.attachment.preview.notAvailable")),1),i.createElementVNode("p",Ade,i.toDisplayString((K=c.value)==null?void 0:K.name),1),i.createVNode(pe,{variant:"solid",color:"primary",size:"sm",label:x.$t("activity.attachment.preview.download"),onClick:b},null,8,["label"])]))]),d.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:1,type:"button",class:"ao-file-preview__nav ao-file-preview__nav--next","aria-label":x.$t("activity.attachment.preview.next"),onClick:i.withModifiers(k,["stop"])},[i.createVNode(ke,{name:"ArrowForwardRounded",size:"lg"})],8,Nde))],2),t.attachments.length>1?(i.openBlock(),i.createElementBlock("footer",Dde,i.toDisplayString(t.currentIndex+1)+" / "+i.toDisplayString(t.attachments.length),1)):i.createCommentVNode("",!0)])],8,vde)])}}});const Og=i.defineComponent({__name:"AoButtonCheck",props:{modelValue:{type:Boolean},color:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=()=>{o("update:modelValue",!n.modelValue)};return(s,a)=>(i.openBlock(),i.createBlock(pe,{color:t.modelValue?t.color:i.unref(Wc).NEUTRAL,"icon-position":"start",onClick:a[0]||(a[0]=()=>r())},null,8,["color"]))}}),$de=i.defineComponent({props:{modelValue:{type:[String,Number],required:!0},tabs:{type:Array,required:!0},variant:{type:String,default:void 0,validator:t=>["underline"].includes(t)}},emits:["update:modelValue"],methods:{selectTab(t){this.$emit("update:modelValue",t)}}});const Bde=["onClick"],Ode={class:"tab-button__label"},Lde={key:0,class:"tab-button__badge"};function Ide(t,e,n,o,r,s){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["tabbar-wrapper",{"tabbar-wrapper--underline":t.variant==="underline"}])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.tabs,a=>(i.openBlock(),i.createElementBlock("button",{key:a.value,class:i.normalizeClass(["tab-button",{"tab-button--active":a.value===t.modelValue,"tab-button--underline":t.variant==="underline"}]),type:"button",onClick:l=>t.selectTab(a.value)},[i.createElementVNode("span",Ode,i.toDisplayString(a.label),1),a.count!==void 0&&a.count>0?(i.openBlock(),i.createElementBlock("span",Lde,i.toDisplayString(a.count),1)):i.createCommentVNode("",!0)],10,Bde))),128))],2)}const fs=oe($de,[["render",Ide],["__scopeId","data-v-3d268d7b"]]),Pde={class:"ao-rich-text-editor"},Fde={class:"ao-rich-text-editor__toolbar"},Vde=["value"],Rde={class:"ao-rich-text-editor__actions"},zde=i.defineComponent({__name:"AoRichTextEditor",props:{initialMarkdown:{default:""},placeholder:{default:"Enter description..."}},emits:["save","cancel"],setup(t,{emit:e}){const n=e,o=i.ref(null);function r(l){var u;const c=l.target;(u=o.value)==null||u.setBlockStyle(c.value)}function s(){const l=o.value;l&&n("save",l.getMarkdown())}function a(){n("cancel")}return(l,c)=>(i.openBlock(),i.createElementBlock("div",Pde,[i.createVNode($g,{ref_key:"lexicalEditorRef",ref:o,"initial-markdown":t.initialMarkdown,placeholder:t.placeholder},{toolbar:i.withCtx(()=>{var u;return[i.createElementVNode("div",Fde,[i.createElementVNode("select",{class:"ao-rich-text-editor__select",title:"Text style",value:(u=o.value)==null?void 0:u.blockStyle,onChange:r},[...c[12]||(c[12]=[i.createElementVNode("option",{value:"paragraph"},"Paragraph",-1),i.createElementVNode("option",{value:"h1"},"Heading 1",-1),i.createElementVNode("option",{value:"h2"},"Heading 2",-1),i.createElementVNode("option",{value:"h3"},"Heading 3",-1),i.createElementVNode("option",{value:"code"},"Code block",-1)])],40,Vde),c[17]||(c[17]=i.createElementVNode("span",{class:"ao-rich-text-editor__toolbar-divider"},null,-1)),i.createElementVNode("button",{type:"button",class:"ao-rich-text-editor__toolbar-button",title:"Bold",onMousedown:c[0]||(c[0]=i.withModifiers(()=>{},["prevent"])),onClick:c[1]||(c[1]=d=>{var f;return(f=o.value)==null?void 0:f.toggleBold()})},[...c[13]||(c[13]=[i.createElementVNode("strong",null,"B",-1)])],32),i.createElementVNode("button",{type:"button",class:"ao-rich-text-editor__toolbar-button",title:"Italic",onMousedown:c[2]||(c[2]=i.withModifiers(()=>{},["prevent"])),onClick:c[3]||(c[3]=d=>{var f;return(f=o.value)==null?void 0:f.toggleItalic()})},[...c[14]||(c[14]=[i.createElementVNode("em",null,"I",-1)])],32),i.createElementVNode("button",{type:"button",class:"ao-rich-text-editor__toolbar-button",title:"Strikethrough",onMousedown:c[4]||(c[4]=i.withModifiers(()=>{},["prevent"])),onClick:c[5]||(c[5]=d=>{var f;return(f=o.value)==null?void 0:f.toggleStrikethrough()})},[...c[15]||(c[15]=[i.createElementVNode("s",null,"S",-1)])],32),i.createElementVNode("button",{type:"button",class:"ao-rich-text-editor__toolbar-button",title:"Inline code",onMousedown:c[6]||(c[6]=i.withModifiers(()=>{},["prevent"])),onClick:c[7]||(c[7]=d=>{var f;return(f=o.value)==null?void 0:f.toggleInlineCode()})},[...c[16]||(c[16]=[i.createElementVNode("span",null,"</>",-1)])],32),c[18]||(c[18]=i.createElementVNode("span",{class:"ao-rich-text-editor__toolbar-divider"},null,-1)),i.createElementVNode("button",{type:"button",class:"ao-rich-text-editor__toolbar-button",title:"Bullet list",onMousedown:c[8]||(c[8]=i.withModifiers(()=>{},["prevent"])),onClick:c[9]||(c[9]=d=>{var f;return(f=o.value)==null?void 0:f.insertBulletList()})}," • ",32),i.createElementVNode("button",{type:"button",class:"ao-rich-text-editor__toolbar-button",title:"Numbered list",onMousedown:c[10]||(c[10]=i.withModifiers(()=>{},["prevent"])),onClick:c[11]||(c[11]=d=>{var f;return(f=o.value)==null?void 0:f.insertNumberedList()})}," 1. ",32)])]}),_:1},8,["initial-markdown","placeholder"]),i.createElementVNode("div",Rde,[i.createVNode(pe,{variant:"ghost",color:"neutral",label:"Cancel",onClick:a}),i.createVNode(pe,{variant:"solid",color:"primary",label:"Save",onClick:s})])]))}});const Ude={class:"ao-activity-details"},qde={class:"ao-activity-details__main"},Hde={class:"ao-activity-details__header"},jde={key:1,class:"ao-activity__category"},Wde={class:"ao-feed__activity-details__header"},Zde={key:0,class:"ao-field ao-feed__activity-details__project"},Kde={class:"ao-field__label"},Gde={key:1,class:"ao-field ao-feed__activity-details__project"},Yde={class:"ao-field__label"},Jde={class:"ao-activity-details__content"},Xde={class:"ao-activity-details__tab-content"},Qde={class:"ao-fieldset"},e1e={class:"ao-field__row"},t1e={class:"ao-activity-details__tab-content"},n1e={class:"ao-fieldset"},o1e={class:"ao-fieldset__body"},r1e={class:"ao-activity-details__tab-content"},i1e={key:0,class:"ao-fieldset"},s1e={class:"ao-activity-details__aside"},a1e={class:"ao-activity-details__close-button"},l1e={key:0,class:"ao-activity-details__aside-section"},c1e={class:"ao-field"},u1e={class:"ao-field__label"},d1e={class:"ao-activity-details__aside-section"},f1e={class:"ao-field ao-field--multiselect"},p1e={class:"assignee-inline"},h1e={class:"ao-field__label"},m1e={class:"ao-activity-details__aside-section"},g1e={key:0,class:"ao-field__row"},v1e={class:"ao-field"},y1e={class:"ao-field__label"},_1e=["readonly"],C1e={class:"ao-activity-details__aside-section"},b1e={class:"ao-field__row"},k1e={class:"ao-field ao-field--inline"},w1e={class:"ao-field__label"},E1e=["readonly"],x1e={class:"ao-field__row"},S1e={class:"ao-field ao-field--inline"},T1e={class:"ao-field__label"},A1e={class:"ao-field__input ao-field__input--estim ao-field__input--readonly"},N1e={class:"ao-activity-details__aside-section"},D1e={class:"ao-fieldset ao-activity-details__aside-section"},M1e={class:"ao-fieldset__title"},$1e={class:"ao-fieldset__body"},B1e={class:"ao-field__row"},O1e={class:"ao-field ao-field--multiselect"},L1e={class:"ao-field__label"},I1e={class:"ao-field__row"},P1e={class:"ao-field ao-field--multiselect"},F1e={class:"ao-field__label"},Ju=i.defineComponent({__name:"AoActivityDetails",props:{activity:{},activityTypes:{},breadcrumbs:{},milestoneId:{},templateActivities:{},templateMilestones:{},isTemplate:{type:Boolean},users:{},userId:{},isTaskCheckable:{},statuses:{},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean},projects:{default:()=>[]},timeTrackingData:{},loadAttachmentPreview:{}},emits:["update:activity","close","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","toast"],setup(t,{emit:e}){const n=t,o=e,{t:r}=Hn(),s=i.ref("description"),a=i.computed(()=>{var I,ee;return[{label:r("activity.description.label")||"Description",value:"description"},{label:r("activity.tasks.title")||"Checklist",value:"checklist",count:((I=n.activity.tasks)==null?void 0:I.length)??0},{label:r("activity.comments.title")||"Commentaires",value:"comments",count:((ee=n.activity.comments)==null?void 0:ee.length)??0}]}),l=i.computed(()=>{var I;return n.isEditable===!0?!0:n.userId&&n.isEditable==="only-own"?n.userId===((I=n.activity.assignee)==null?void 0:I.id):!1}),c=i.ref(!1),u=i.ref(null),d=I=>{o("update:activity",{id:n.activity.id,name:I})},f=i.computed(()=>n.activity.description??""),p=()=>{l.value&&(c.value=!0)},h=I=>{o("update:activity",{id:n.activity.id,description:I}),c.value=!1},m=()=>{c.value=!1};i.watch(()=>n.activity.id,()=>{c.value=!1});const g=i.computed({get(){return n.activity.estimation??0},set(I){o("update:activity",{id:n.activity.id,estimation:I})}}),C=i.computed({get(){var ee;const I=(ee=n.timeTrackingData)==null?void 0:ee[n.activity.id];return(I==null?void 0:I.timeSpent)??0},set(){}}),_=i.computed(()=>{var ee;return((ee=n.activity.project)==null?void 0:ee.estimationUnit)==="days"?"d":"h"}),y=i.computed(()=>{var ee;const I=(ee=n.activity.project)==null?void 0:ee.estimationUnit;return Aa(C.value,I)}),v=i.computed({get(){return n.activity.important??!1},set(I){o("update:activity",{id:n.activity.id,important:I})}});i.computed({get(){return n.activity.private??!1},set(I){o("update:activity",{id:n.activity.id,private:I})}});const w=i.computed({get(){return n.activity.deadline},set(I){o("update:activity",{id:n.activity.id,deadline:I})}});i.computed(()=>{var I;return(I=n.activityTypes)==null?void 0:I.map(ee=>({label:ee.name,value:ee.id}))}),i.computed({get(){var I;return(I=n.activity.type)==null?void 0:I.id},set(I){o("update:activity",{id:n.activity.id,typeId:I})}});const k=i.computed(()=>n.templateActivities.filter(I=>I.id!==n.activity.id).map(I=>({label:I.name,value:I.id}))),b=i.computed({get(){var I;return(I=n.activity.dependingOn)==null?void 0:I.map(ee=>ee.id)},set(I){I&&o("update:activity",{id:n.activity.id,dependingOn:I})}}),S=i.computed(()=>k.value.map(I=>{var ee;return{...I,disabled:(ee=n.activity.blocking)==null?void 0:ee.some(ve=>ve.id===I.value)}})),T=i.computed({get(){var I;return(I=n.activity.blocking)==null?void 0:I.map(ee=>ee.id)},set(I){I&&o("update:activity",{id:n.activity.id,blocking:I})}}),A=i.computed(()=>k.value.map(I=>{var ee;return{...I,disabled:(ee=n.activity.dependingOn)==null?void 0:ee.some(ve=>ve.id===I.value)}})),x=I=>{o("addSubtask",I)},O=I=>{o("updateSubtask",I)},M=I=>{o("deleteSubtask",I)};function $(){n.userId?F.value=[n.userId]:console.error("Failed assigning to self: userId is missing")}function B(I){F.value=[I]}const P=i.computed(()=>{var ee;const I=new Map;return(ee=n.users)==null||ee.forEach(ve=>{I.has(ve.id)||I.set(ve.id,ve)}),Array.from(I.values()).map(ve=>({label:`${ve.firstName} ${ve.lastName}`,value:ve.id,avatar:ve.avatarUrl}))}),F=i.computed({get(){var I,ee;return(I=n.activity.assignee)!=null&&I.id?[(ee=n.activity.assignee)==null?void 0:ee.id]:[]},set(I){o("update:activity",{id:n.activity.id,assigneeId:I[0]??null})}}),K=I=>{o("addFiles",{activityId:n.activity.id,files:I})},V=I=>{o("removeFile",{activityId:n.activity.id,file:I})},N=i.computed(()=>n.projects.map(I=>({value:I.id,label:I.name}))),G=i.computed(()=>{var ee,ve,me;const I=(me=(ve=(ee=n.activity)==null?void 0:ee.project)==null?void 0:ve.phases)==null?void 0:me.reduce((Ve,le)=>[...Ve,...le.milestones],[]);return I==null?void 0:I.map(Ve=>({value:Ve.id,label:Ve.name}))}),z=I=>{n.activity&&o("update:activity",{id:n.activity.id,projectId:I})},H=I=>{n.activity&&o("update:activity",{id:n.activity.id,milestoneId:I})},ue=i.computed(()=>{var I;return(I=n.statuses)==null?void 0:I.map(ee=>({value:ee.id,label:ee.name}))}),Q=I=>{o("update:activity",{id:n.activity.id,statusId:I})},ie=I=>{o("addComment",{...I,activityId:n.activity.id})},U=I=>{o("updateComment",I)},ne=I=>{o("removeComment",I)};i.computed(()=>{var I,ee;return((I=n.activity.createdBy)==null?void 0:I.firstName)&&((ee=n.activity.createdBy)==null?void 0:ee.lastName)&&`${n.activity.createdBy.firstName} ${n.activity.createdBy.lastName}`});function ge(){const I=window.location.origin,ee=n.activity.slug,ve=`${I}/activity-feed/slug/${ee}`;navigator.clipboard.writeText(ve).then(()=>{console.log(`Link copied to clipboard: ${ve}`),o("toast","clipboard.copy.success","success")}).catch(()=>{console.log("Failed to copy link"),o("toast","clipboard.copy.error","error")})}return(I,ee)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Da,{onClose:ee[9]||(ee[9]=ve=>I.$emit("close"))},{default:i.withCtx(()=>{var ve,me,Ve;return[i.createElementVNode("div",Ude,[i.createElementVNode("div",qde,[i.createElementVNode("div",Hde,[t.activity.slug?(i.openBlock(),i.createBlock($i,{key:0,label:t.activity.slug,clickable:!0,variant:"solid_icon",color:"primary","icon-name":"ContentCopyOutline",class:"ao-activity__ao-tag",onClick:ge},null,8,["label"])):i.createCommentVNode("",!0),t.breadcrumbs?(i.openBlock(),i.createElementBlock("div",jde,i.toDisplayString(t.breadcrumbs),1)):i.createCommentVNode("",!0),i.createVNode(at,{title:t.activity.name||"",level:4,"is-editable":l.value,"onUpdate:title":d},null,8,["title","is-editable"]),i.createElementVNode("div",Wde,[N.value?(i.openBlock(),i.createElementBlock("label",Zde,[i.createElementVNode("span",Kde,i.toDisplayString(I.$t("activity.project.label")),1),i.createVNode(Dt,{options:N.value,value:(ve=t.activity.project)==null?void 0:ve.id,searchable:!0,disabled:!l.value,caret:l.value,onChange:z},null,8,["options","value","disabled","caret"])])):i.createCommentVNode("",!0),G.value?(i.openBlock(),i.createElementBlock("label",Gde,[i.createElementVNode("span",Yde,i.toDisplayString(I.$t("activity.milestone.label")),1),i.createVNode(Dt,{options:G.value,value:(me=t.activity.milestone)==null?void 0:me.id,searchable:!0,disabled:!l.value,caret:l.value,onChange:H},null,8,["options","value","disabled","caret"])])):i.createCommentVNode("",!0)]),i.renderSlot(I.$slots,"header")]),i.createElementVNode("div",Jde,[i.createVNode(fs,{modelValue:s.value,"onUpdate:modelValue":ee[0]||(ee[0]=le=>s.value=le),tabs:a.value,variant:"underline",class:"ao-activity-details__tabs"},null,8,["modelValue","tabs"]),i.withDirectives(i.createElementVNode("div",Xde,[i.createElementVNode("fieldset",Qde,[i.createElementVNode("div",e1e,[i.createVNode(z9,{attachments:t.activity.attachments,"is-editable":t.attachmentEnabled&&l.value&&t.isTemplate!==!0&&!!t.userId,onAdd:K,onRemove:V,onPreview:ee[1]||(ee[1]=le=>u.value=le)},{default:i.withCtx(()=>[c.value?(i.openBlock(),i.createBlock(zde,{key:1,"initial-markdown":f.value,onSave:h,onCancel:m},null,8,["initial-markdown"])):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["ao-activity-details__description",{"ao-activity-details__description--editable":l.value}]),onClick:p},[i.createVNode(Ch,{content:f.value},null,8,["content"])],2))]),_:1},8,["attachments","is-editable"])])])],512),[[i.vShow,s.value==="description"]]),i.withDirectives(i.createElementVNode("div",t1e,[i.createElementVNode("fieldset",n1e,[i.createElementVNode("div",o1e,[i.createVNode(N9,{class:"ao-activity-details__tasks ao-field__row",tasks:t.activity.tasks||[],"activity-id":t.activity.id,users:t.users,"is-checkable":t.isTaskCheckable,"is-editable":l.value,"is-template":t.isTemplate,onAdd:x,onUpdate:O,onDelete:M},null,8,["tasks","activity-id","users","is-checkable","is-editable","is-template"])])])],512),[[i.vShow,s.value==="checklist"]]),i.withDirectives(i.createElementVNode("div",r1e,[t.isTemplate!==!0&&t.userId?(i.openBlock(),i.createElementBlock("div",i1e,[i.createVNode(gde,{comments:t.activity.comments,users:t.users,"user-id":t.userId,onCreateComment:ie,onUpdateComment:U,onRemoveComment:ne},null,8,["comments","users","user-id"])])):i.createCommentVNode("",!0)],512),[[i.vShow,s.value==="comments"]])])]),i.createElementVNode("div",s1e,[i.createElementVNode("div",a1e,[i.createVNode(ke,{name:"CloseRounded",onClick:ee[2]||(ee[2]=le=>I.$emit("close"))})]),ue.value?(i.openBlock(),i.createElementBlock("div",l1e,[i.createElementVNode("label",c1e,[i.createElementVNode("span",u1e,i.toDisplayString(I.$t("activity.status.label")),1),i.createVNode(Dt,{class:"ao-activity-details__multiselect",options:ue.value,value:(Ve=t.activity.status)==null?void 0:Ve.id,"can-clear":!1,"can-deselect":!1,disabled:!l.value,caret:l.value,onChange:Q},null,8,["options","value","disabled","caret"])])])):i.createCommentVNode("",!0),i.createElementVNode("div",d1e,[i.createElementVNode("div",f1e,[i.createElementVNode("div",p1e,[i.createElementVNode("span",h1e,i.toDisplayString(I.$t("activity.assignee.label")),1),i.createVNode(pe,{label:I.$t("activity.assignee.toMe"),type:"button",color:"primary",variant:"solid",class:"ao-button--sm",onClick:$},null,8,["label"])]),i.createVNode(Dt,{modelValue:F.value,"onUpdate:modelValue":ee[3]||(ee[3]=le=>F.value=le),class:"ao-activity-details__assignees ao-activity-details__multiselect",options:P.value,"close-on-select":!0,searchable:!0,placeholder:I.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!l.value,caret:l.value,onSelect:B},{tag:i.withCtx(({option:le,handleTagRemove:ft})=>[i.createVNode(Un,{"user-name":le.label,"avatar-url":le.avatar,"is-closable":!0,onClose:xe=>ft(le,xe)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),i.createElementVNode("div",m1e,[t.isTemplate!==!0&&t.userId?(i.openBlock(),i.createElementBlock("div",g1e,[i.createElementVNode("label",v1e,[i.createElementVNode("span",y1e,i.toDisplayString(I.$t("activity.deadline.label")),1),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":ee[4]||(ee[4]=le=>w.value=le),readonly:!l.value,class:"ao-field__input",type:"date"},null,8,_1e),[[i.vModelText,w.value,void 0,{lazy:!0}]])])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",C1e,[i.createElementVNode("div",b1e,[i.createElementVNode("label",k1e,[i.createElementVNode("span",w1e,i.toDisplayString(I.$t("activity.estimation.label"))+" ("+i.toDisplayString(_.value)+")",1),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":ee[5]||(ee[5]=le=>g.value=le),readonly:!l.value,class:"ao-field__input ao-field__input--estim",type:"number",min:"0"},null,8,E1e),[[i.vModelText,g.value,void 0,{lazy:!0,number:!0}]])])]),i.createElementVNode("div",x1e,[i.createElementVNode("label",S1e,[i.createElementVNode("span",T1e,i.toDisplayString(I.$t("activity.timeSpent.label"))+" ("+i.toDisplayString(_.value)+")",1),i.createElementVNode("span",A1e,i.toDisplayString(y.value),1)])])]),i.createElementVNode("div",N1e,[i.createVNode(Og,{modelValue:v.value,"onUpdate:modelValue":ee[6]||(ee[6]=le=>v.value=le),modelModifiers:{lazy:!0},label:I.$t("activity.important.label"),disabled:!l.value,variant:"ghost","icon-name":"FlagRounded",class:"ao-field__input",color:"danger",type:"checkbox",size:"sm"},null,8,["modelValue","label","disabled"])]),i.createElementVNode("fieldset",D1e,[i.createElementVNode("div",M1e,[i.createVNode(ke,{name:"FlowsheetOutlineRounded"}),i.createVNode(at,{level:4,title:I.$t("activity.dependencies.title")},null,8,["title"])]),i.createElementVNode("div",$1e,[i.createElementVNode("div",B1e,[i.createElementVNode("label",O1e,[i.createElementVNode("span",L1e,i.toDisplayString(I.$t("activity.dependingOn.label")),1),i.createVNode(Dt,{modelValue:b.value,"onUpdate:modelValue":ee[7]||(ee[7]=le=>b.value=le),class:"ao-activity-details__multiselect",mode:"tags","close-on-select":!1,searchable:!0,options:S.value,disabled:!l.value,caret:l.value},null,8,["modelValue","options","disabled","caret"])])]),i.createElementVNode("div",I1e,[i.createElementVNode("label",P1e,[i.createElementVNode("span",F1e,i.toDisplayString(I.$t("activity.blocking.label")),1),i.createVNode(Dt,{modelValue:T.value,"onUpdate:modelValue":ee[8]||(ee[8]=le=>T.value=le),class:"ao-activity-details__multiselect",mode:"tags","close-on-select":!1,searchable:!0,options:A.value,disabled:!l.value,caret:l.value},null,8,["modelValue","options","disabled","caret"])])])])]),i.renderSlot(I.$slots,"default",{activity:t.activity})])])]}),_:3}),u.value!==null?(i.openBlock(),i.createBlock(Mde,{key:0,attachments:t.activity.attachments||[],"current-index":u.value,"load-preview":n.loadAttachmentPreview,"onUpdate:currentIndex":ee[10]||(ee[10]=ve=>u.value=ve),onClose:ee[11]||(ee[11]=ve=>u.value=null)},null,8,["attachments","current-index","load-preview"])):i.createCommentVNode("",!0)],64))}});const V1e=i.defineComponent({__name:"AoRuleLine",props:{rule:{},templatePhases:{},templateMilestones:{},templateActivities:{},tagName:{default:"li"}},emits:["update:rule","close"],setup(t,{emit:e}){const n=t,o=e,r=i.toRef(n.rule.itemType||Be.ACTIVITIES),s=i.computed({get(){return r.value},set(y){r.value=y,o("update:rule",{...n.rule,itemType:y,subItemId:void 0})}}),a=i.computed(()=>Object.values(Be)),l=i.computed({get(){return n.rule.subItemId},set(y){o("update:rule",{...n.rule,subItemId:y,itemType:n.rule.itemType||s.value})}}),c=i.computed(()=>{var v;return!n.templateActivities||!n.templateMilestones||!n.templatePhases?null:(v={[Be.ACTIVITIES]:n.templateActivities,[Be.MILESTONES]:n.templateMilestones,[Be.PHASES]:n.templatePhases}[r.value])==null?void 0:v.map(w=>({value:w.id,label:w.name}))}),u=i.toRef(n.rule.comparator),d=i.computed({get(){return u.value},set(y){o("update:rule",{...n.rule,comparator:y})}}),f=i.computed(()=>Object.values(fp)),p=i.toRef(n.rule.trigger),h=i.computed({get(){return p.value},set(y){o("update:rule",{...n.rule,trigger:y})}}),m=i.computed(()=>Object.values(pp)),g=i.computed({get(){return n.rule.duration},set(y){o("update:rule",{...n.rule,duration:y})}}),C=i.computed({get(){return n.rule.durationUnit},set(y){o("update:rule",{...n.rule,durationUnit:y})}}),_=i.computed(()=>Object.values(hp));return(y,v)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.tagName),{class:"ao-rule-line"},{default:i.withCtx(()=>[i.createVNode(i.unref(to),{modelValue:s.value,"onUpdate:modelValue":v[0]||(v[0]=w=>s.value=w),options:a.value},null,8,["modelValue","options"]),i.createVNode(i.unref(to),{modelValue:l.value,"onUpdate:modelValue":v[1]||(v[1]=w=>l.value=w),options:c.value},null,8,["modelValue","options"]),i.createVNode(i.unref(to),{modelValue:h.value,"onUpdate:modelValue":v[2]||(v[2]=w=>h.value=w),options:m.value},null,8,["modelValue","options"]),i.createVNode(i.unref(to),{modelValue:d.value,"onUpdate:modelValue":v[3]||(v[3]=w=>d.value=w),options:f.value},null,8,["modelValue","options"]),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":v[4]||(v[4]=w=>g.value=w),type:"number",min:"0"},null,512),[[i.vModelText,g.value,void 0,{number:!0}]]),i.createVNode(i.unref(to),{modelValue:C.value,"onUpdate:modelValue":v[5]||(v[5]=w=>C.value=w),options:_.value},null,8,["modelValue","options"]),i.createVNode(pe,{class:"ao-rule-line__remove","icon-name":"CloseRounded",variant:"ghost",onClick:v[6]||(v[6]=w=>y.$emit("close"))})]),_:1}))}});const R1e={class:"ao-template-rules__body"},z1e={class:"ao-template-rules__list"},U1e=i.defineComponent({__name:"AoTemplateRules",props:{templateId:{},rules:{},templatePhases:{},templateMilestones:{},templateActivities:{}},emits:["addRule","removeRule"],setup(t,{emit:e}){const n=e,o=()=>{n("addRule")},r=s=>{n("removeRule",s)};return(s,a)=>(i.openBlock(),i.createBlock(Da,null,{header:i.withCtx(()=>[i.createVNode(at,{title:s.$t("template.rules.title"),level:2},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("div",R1e,[i.createElementVNode("ul",z1e,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.rules,l=>(i.openBlock(),i.createBlock(V1e,{key:l.id,rule:l,"template-phases":t.templatePhases,"template-milestones":t.templateMilestones,"template-activities":t.templateActivities,class:"ao-template-rule",onClose:()=>r(l.id)},null,8,["rule","template-phases","template-milestones","template-activities","onClose"]))),128))]),i.createVNode(go,{label:s.$t("template.rules.add"),"icon-name":"Add",onClick:o},null,8,["label"])])]),_:1}))}});function Uo(t,e,n){const o=t.length,r=t.at(-1),s=r?it.LexoRank.parse(r.rank).genNext():it.LexoRank.middle();return{name:n(`template.defaultName.${e}`,{idx:o+1}),rank:s.format()}}const q1e={key:0,class:"ao-template-details"},H1e={class:"ao-template-details__body"},j1e={class:"ao-template-details__cols"},W1e={class:"ao-template-details__col"},Z1e={class:"ao-list__footer"},K1e={class:"ao-template-details__col"},G1e={class:"ao-template-details__col"},Lg=i.defineComponent({__name:"AoTemplateDetails",props:{templateId:{},templates:{},users:{},phaseId:{},milestoneId:{},activityId:{},activityTypes:{}},emits:["addItem","removeItem","updateItem","addRule","removeRule","addFiles","removeFile"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e,s=i.computed(()=>{var V;return(V=o.templates)==null?void 0:V.find(N=>N.id===o.templateId)}),a=i.ref(!1);i.watch(()=>[o.templateId,o.phaseId,o.milestoneId],()=>a.value=!1),i.watch(()=>{var V;return(V=s.value)==null?void 0:V.phases},(V,N)=>{a.value&&In(V,N)});const l=i.computed(()=>{var V,N;return(N=(V=s==null?void 0:s.value)==null?void 0:V.phases)==null?void 0:N.find(G=>G.id===o.phaseId)});i.watch(()=>{var V;return(V=l.value)==null?void 0:V.milestones},(V,N)=>{a.value&&In(V,N)});const c=i.computed(()=>{var V,N;return(N=(V=l.value)==null?void 0:V.milestones)==null?void 0:N.find(G=>G.id===o.milestoneId)});i.watch(()=>{var V;return(V=c.value)==null?void 0:V.activities},(V,N)=>{a.value&&In(V,N)});const u=i.computed(()=>{var V,N;return((N=(V=s.value)==null?void 0:V.phases)==null?void 0:N.reduce((G,z)=>{const H=z.milestones||[];return[...G,...H]},[]))||[]}),d=i.computed(()=>{var V,N;return((N=(V=s.value)==null?void 0:V.phases)==null?void 0:N.reduce((G,z)=>{const ue=(z.milestones||[]).reduce((Q,ie)=>ie.activities?[...Q,...ie.activities]:Q,[]);return[...G,...ue]},[]))||[]}),f=i.computed(()=>{var V,N;return(N=(V=c.value)==null?void 0:V.activities)==null?void 0:N.find(G=>G.id===o.activityId)}),p=i.computed(()=>{var V;return((V=s.value)==null?void 0:V.name)||o.templateId}),h=()=>{if(!s.value)return;const{name:V,rank:N}=Uo(s.value.phases,"phase",n);a.value=!0,r("addItem",{type:Be.PHASES,templateId:o.templateId,item:{name:V,rank:N}})},m=V=>{r("updateItem",{templateId:o.templateId,id:o.templateId,itemType:Be.TEMPLATES,data:{name:V}})},g=V=>{r("removeItem",{itemType:Be.PHASES,templateId:o.templateId,data:{id:V}})},C=(V,N)=>{r("updateItem",{templateId:o.templateId,id:V,itemType:Be.PHASES,data:{name:N}})},_=V=>{r("updateItem",V)},y=V=>{if(!l.value)return;const{name:N,rank:G}=Uo(l.value.milestones,"milestone",n);a.value=!0,r("addItem",{type:Be.MILESTONES,templateId:o.templateId,phaseId:V.phaseId,item:{name:N,rank:G,phaseId:V.phaseId}})},v=V=>{r("removeItem",{itemType:Be.MILESTONES,templateId:o.templateId,phaseId:V.phaseId,data:{id:V.id}})},w=V=>{const{id:N,...G}=V;r("updateItem",{itemType:Be.MILESTONES,id:N,templateId:o.templateId,data:G})},k=V=>{const{milestoneId:N}=V;if(!c.value)return;const{name:G,rank:z}=Uo(c.value.activities,"activity",n);a.value=!0,r("addItem",{type:Be.ACTIVITIES,milestoneId:N,templateId:o.templateId,item:{name:G,rank:z,milestoneId:N}})},b=V=>{var N,G;r("removeItem",{itemType:Be.ACTIVITIES,templateId:o.templateId,phaseId:(N=l.value)==null?void 0:N.id,milestoneId:(G=c.value)==null?void 0:G.id,data:{id:V.id}})},S=V=>{const{id:N,...G}=V;r("updateItem",{itemType:Be.ACTIVITIES,id:N,templateId:o.templateId,data:G})},T=i.ref(!1),A=()=>{T.value=!T.value},x=()=>{r("addRule",{templateId:o.templateId})},O=V=>{r("removeRule",{id:V,templateId:o.templateId})},M=V=>{var N;if(V.moved){const G=Xi(V,((N=s.value)==null?void 0:N.phases)??[]);r("updateItem",{itemType:Be.PHASES,id:V.moved.element.id,templateId:o.templateId,data:{rank:G}})}},$=V=>{!l.value||!c.value||!f.value||r("addItem",{type:Be.TASKS,activityId:V.activityId,milestoneId:c.value.id,phaseId:l.value.id,templateId:o.templateId,item:V})},B=V=>{!l.value||!c.value||!f.value||r("updateItem",{itemType:Be.TASKS,id:V.id,templateId:o.templateId,data:V})},P=V=>{!l.value||!c.value||!f.value||r("removeItem",{itemType:Be.TASKS,activityId:f.value.id,milestoneId:c.value.id,phaseId:l.value.id,templateId:o.templateId,data:V})},F=V=>{r("addFiles",V)},K=V=>{r("removeFile",V)};return(V,N)=>{var G,z,H,ue,Q,ie;return s.value?(i.openBlock(),i.createElementBlock("div",q1e,[i.createVNode(Qi,{"can-go-back":!0,onGoBack:N[1]||(N[1]=U=>V.$router.push({name:i.unref(Po).TEMPLATES_LIST}))},{primary:i.withCtx(()=>[i.createVNode(at,{title:p.value,level:2,"is-editable":!0,"onUpdate:title":N[0]||(N[0]=U=>{m(U)})},null,8,["title"])]),_:1}),i.createElementVNode("div",H1e,[i.createElementVNode("ol",j1e,[i.createElementVNode("li",W1e,[i.createVNode(i.unref(mo),{"model-value":s.value.phases,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:M},{header:i.withCtx(()=>[i.createVNode(at,{title:V.$t("template.phases.title"),level:3,class:"ao-list__title"},null,8,["title"])]),item:i.withCtx(({element:U})=>{var ne;return[i.createVNode(Z_,{id:U.id,name:U.name,milestones:U.milestones,"is-active":((ne=l.value)==null?void 0:ne.id)===U.id,"is-draggable":!0,onClick:ge=>V.$router.push({params:{templateId:t.templateId,phaseId:U.id}}),"onUpdate:title":ge=>{C(U.id,ge)},onRemove:()=>g(U.id)},null,8,["id","name","milestones","is-active","onClick","onUpdate:title","onRemove"])]}),footer:i.withCtx(()=>[i.createElementVNode("div",Z1e,[i.createVNode(go,{"icon-name":"AddBoxOutlineRounded",label:V.$t("template.phases.add"),onClick:h},null,8,["label"])])]),_:1},8,["model-value"])]),i.createElementVNode("li",K1e,[l.value?(i.openBlock(),i.createBlock(Y_,{key:0,"template-id":t.templateId,phase:l.value,"milestone-id":(G=c.value)==null?void 0:G.id,onAddMilestone:y,onUpdateMilestone:w,onUpdatePhase:_,onRemoveMilestone:v},null,8,["template-id","phase","milestone-id"])):i.createCommentVNode("",!0)]),i.createElementVNode("li",G1e,[l.value&&c.value?(i.openBlock(),i.createBlock(Q_,{key:0,"template-id":t.templateId,"phase-id":(z=l.value)==null?void 0:z.id,milestone:c.value,"activity-id":(H=f.value)==null?void 0:H.id,onAddActivity:k,onUpdateActivity:S,onRemoveActivity:b},null,8,["template-id","phase-id","milestone","activity-id"])):i.createCommentVNode("",!0)])])]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[f.value?(i.openBlock(),i.createBlock(Ju,{key:0,activity:f.value,"activity-types":t.activityTypes,breadcrumbs:`${s.value.name} / ${(ue=l.value)==null?void 0:ue.name} / ${(Q=c.value)==null?void 0:Q.name}`,"milestone-id":(ie=c.value)==null?void 0:ie.id,"template-activities":d.value,"template-milestones":u.value,"is-template":!0,"is-editable":!0,users:t.users,"attachment-enabled":!1,"onUpdate:activity":N[2]||(N[2]=U=>{f.value&&S(U)}),onClose:V.$router.back,onAddSubtask:$,onUpdateSubtask:B,onDeleteSubtask:P,onAddFiles:F,onRemoveFile:K},{default:i.withCtx(U=>[i.renderSlot(V.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(U)))]),_:3},8,["activity","activity-types","breadcrumbs","milestone-id","template-activities","template-milestones","users","onClose"])):i.createCommentVNode("",!0)])),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[T.value?(i.openBlock(),i.createBlock(U1e,{key:0,"template-id":s.value.id,rules:s.value.rules||[],"template-phases":s.value.phases,"template-milestones":u.value,"template-activities":d.value,onClose:A,onAddRule:x,onRemoveRule:O},null,8,["template-id","rules","template-phases","template-milestones","template-activities"])):i.createCommentVNode("",!0)]))])):i.createCommentVNode("",!0)}}});const Y1e={class:"ao-card__content"},J1e={key:0,class:"ao-card__header"},X1e={class:"ao-card__body"},Q1e={key:1,class:"ao-card__footer"},cl=i.defineComponent({__name:"AoCard",props:{isClickable:{type:Boolean},tagName:{default:"div"},isSelected:{type:Boolean},color:{},withLeftBorder:{type:Boolean,default:!1}},setup(t){return(e,n)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.tagName),{class:i.normalizeClass(["ao-card",{"ao-card--clickable":t.isClickable}]),style:i.normalizeStyle(t.isSelected?{border:"solid",borderColor:t.color||"var(--ao-color-blue-base)",borderWidth:"thick"}:{})},{default:i.withCtx(()=>[t.withLeftBorder?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ao-card__left-border",style:i.normalizeStyle({backgroundColor:t.color})},null,4)):i.createCommentVNode("",!0),i.createElementVNode("div",Y1e,[e.$slots.header?(i.openBlock(),i.createElementBlock("header",J1e,[i.renderSlot(e.$slots,"header")])):i.createCommentVNode("",!0),i.createElementVNode("div",X1e,[i.renderSlot(e.$slots,"default")]),e.$slots.footer?(i.openBlock(),i.createElementBlock("footer",Q1e,[i.renderSlot(e.$slots,"footer")])):i.createCommentVNode("",!0)])]),_:3},8,["class","style"]))}});const ul=i.defineComponent({__name:"AoProgress",props:{percentages:{},status:{},color:{}},setup(t){const e=t,n=i.computed(()=>typeof e.percentages=="number"?[e.percentages]:e.percentages??[]);return(o,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ao-progress",t.status?`ao-progress--${t.status}`:""]),role:"meter"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value,s=>(i.openBlock(),i.createElementBlock("div",{key:s,class:i.normalizeClass(["ao-progress__progress"]),style:i.normalizeStyle({width:`${s*100}%`,"--ao-progress-color":t.color||"var(--ao-color-primary-base)"})},null,4))),128))],2))}});/*!
|
|
55
55
|
* vue-color-kit v1.0.6
|
|
56
56
|
* (c) 2023
|
|
57
57
|
* @license MIT
|
|
58
|
-
*/function Ao(t){let e={r:0,g:0,b:0,a:1};/#/.test(t)?e=tfe(t):/rgb/.test(t)?e=lp(t):typeof t=="string"?e=lp(`rgba(${t})`):Object.prototype.toString.call(t)==="[object Object]"&&(e=t);const{r:n,g:o,b:r,a:s}=e,{h:a,s:l,v:c}=nfe(e);return{r:n,g:o,b:r,a:s===void 0?1:s,h:a,s:l,v:c}}function Xu(t){const e=document.createElement("canvas"),n=e.getContext("2d"),o=t*2;return e.width=o,e.height=o,n.fillStyle="#ffffff",n.fillRect(0,0,o,o),n.fillStyle="#ccd5db",n.fillRect(0,0,t,t),n.fillRect(t,t,t,t),e}function jc(t,e,n,o,r,s){const a=t==="l",l=e.createLinearGradient(0,0,a?n:0,a?0:o);l.addColorStop(.01,r),l.addColorStop(.99,s),e.fillStyle=l,e.fillRect(0,0,n,o)}function efe({r:t,g:e,b:n},o){const r=a=>("0"+Number(a).toString(16)).slice(-2),s=`#${r(t)}${r(e)}${r(n)}`;return o?s.toUpperCase():s}function tfe(t){t=t.slice(1);const e=n=>parseInt(n,16)||0;return{r:e(t.slice(0,2)),g:e(t.slice(2,4)),b:e(t.slice(4,6))}}function lp(t){return typeof t=="string"?(t=(/rgba?\((.*?)\)/.exec(t)||["","0,0,0,1"])[1].split(","),{r:Number(t[0])||0,g:Number(t[1])||0,b:Number(t[2])||0,a:Number(t[3]?t[3]:1)}):t}function nfe({r:t,g:e,b:n}){t=t/255,e=e/255,n=n/255;const o=Math.max(t,e,n),r=Math.min(t,e,n),s=o-r;let a=0;o===r?a=0:o===t?e>=n?a=60*(e-n)/s:a=60*(e-n)/s+360:o===e?a=60*(n-t)/s+120:o===n&&(a=60*(t-e)/s+240),a=Math.floor(a);let l=parseFloat((o===0?0:1-r/o).toFixed(2)),c=parseFloat(o.toFixed(2));return{h:a,s:l,v:c}}var Qu=i.defineComponent({props:{color:{type:String,default:"#000000"},hsv:{type:Object,default:null},size:{type:Number,default:152}},emits:["selectSaturation"],data(){return{slideSaturationStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasSaturation,e=this.size,n=t.getContext("2d");t.width=e,t.height=e,n.fillStyle=this.color,n.fillRect(0,0,e,e),jc("l",n,e,e,"#FFFFFF","rgba(255,255,255,0)"),jc("p",n,e,e,"rgba(0,0,0,0)","#000000")},renderSlide(){this.slideSaturationStyle={left:this.hsv.s*this.size-5+"px",top:(1-this.hsv.v)*this.size-5+"px"}},selectSaturation(t){const{top:e,left:n}=this.$el.getBoundingClientRect(),o=t.target.getContext("2d"),r=a=>{let l=a.clientX-n,c=a.clientY-e;l<0&&(l=0),c<0&&(c=0),l>this.size&&(l=this.size),c>this.size&&(c=this.size),this.slideSaturationStyle={left:l-5+"px",top:c-5+"px"};const u=o.getImageData(Math.min(l,this.size-1),Math.min(c,this.size-1),1,1),[d,f,p]=u.data;this.$emit("selectSaturation",{r:d,g:f,b:p})};r(t);const s=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",s)}}});const ofe={ref:"canvasSaturation"};function rfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"saturation",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectSaturation&&t.selectSaturation(...a),["prevent","stop"]))},[i.createVNode("canvas",ofe,null,512),i.createVNode("div",{style:t.slideSaturationStyle,class:"slide"},null,4)],32)}Qu.render=rfe;Qu.__file="src/color/Saturation.vue";var ed=i.defineComponent({props:{hsv:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectHue"],data(){return{slideHueStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasHue,e=this.width,n=this.height,o=t.getContext("2d");t.width=e,t.height=n;const r=o.createLinearGradient(0,0,0,n);r.addColorStop(0,"#FF0000"),r.addColorStop(.17*1,"#FF00FF"),r.addColorStop(.17*2,"#0000FF"),r.addColorStop(.17*3,"#00FFFF"),r.addColorStop(.17*4,"#00FF00"),r.addColorStop(.17*5,"#FFFF00"),r.addColorStop(1,"#FF0000"),o.fillStyle=r,o.fillRect(0,0,e,n)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(t){const{top:e}=this.$el.getBoundingClientRect(),n=t.target.getContext("2d"),o=s=>{let a=s.clientY-e;a<0&&(a=0),a>this.height&&(a=this.height),this.slideHueStyle={top:a-2+"px"};const l=n.getImageData(0,Math.min(a,this.height-1),1,1),[c,u,d]=l.data;this.$emit("selectHue",{r:c,g:u,b:d})};o(t);const r=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}}});const ife={ref:"canvasHue"};function sfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"hue",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectHue&&t.selectHue(...a),["prevent","stop"]))},[i.createVNode("canvas",ife,null,512),i.createVNode("div",{style:t.slideHueStyle,class:"slide"},null,4)],32)}ed.render=sfe;ed.__file="src/color/Hue.vue";var td=i.defineComponent({props:{color:{type:String,default:"#000000"},rgba:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectAlpha"],data(){return{slideAlphaStyle:{},alphaSize:5}},watch:{color(){this.renderColor()},"rgba.a"(){this.renderSlide()}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasAlpha,e=this.width,n=this.height,o=this.alphaSize,r=Xu(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),jc("p",s,e,n,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(t){const{top:e}=this.$el.getBoundingClientRect(),n=r=>{let s=r.clientY-e;s<0&&(s=0),s>this.height&&(s=this.height);let a=parseFloat((s/this.height).toFixed(2));this.$emit("selectAlpha",a)};n(t);const o=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}}});const afe={ref:"canvasAlpha"};function lfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"color-alpha",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectAlpha&&t.selectAlpha(...a),["prevent","stop"]))},[i.createVNode("canvas",afe,null,512),i.createVNode("div",{style:t.slideAlphaStyle,class:"slide"},null,4)],32)}td.render=lfe;td.__file="src/color/Alpha.vue";var nd=i.defineComponent({props:{color:{type:String,default:"#000000"},width:{type:Number,default:100},height:{type:Number,default:30}},data(){return{alphaSize:5}},watch:{color(){this.renderColor()}},mounted(){this.renderColor()},methods:{renderColor(){const t=this.$el,e=this.width,n=this.height,o=this.alphaSize,r=Xu(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),s.fillStyle=this.color,s.fillRect(0,0,e,n)}}});function cfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("canvas")}nd.render=cfe;nd.__file="src/color/Preview.vue";var od=i.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(t){this.isSucking=!1,this.suckColor(t)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(t){t.keyCode===27&&(this.isOpenSucker=!1,this.isSucking=!1,this.$emit("openSucker",!1),document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("mousemove",this.mousemoveHandler),document.removeEventListener("mouseup",this.mousemoveHandler),this.suckerPreview&&(document.body.removeChild(this.suckerPreview),this.suckerPreview=null))},mousemoveHandler(t){const{clientX:e,clientY:n}=t,{top:o,left:r,width:s,height:a}=this.suckerCanvas.getBoundingClientRect(),l=e-r,c=n-o,d=this.suckerCanvas.getContext("2d").getImageData(Math.min(l,s-1),Math.min(c,a-1),1,1);let[f,p,h,m]=d.data;m=parseFloat((m/255).toFixed(2));const g=this.suckerPreview.style;Object.assign(g,{position:"absolute",left:e+20+"px",top:n-36+"px",width:"24px",height:"24px",borderRadius:"50%",border:"2px solid #fff",boxShadow:"0 0 8px 0 rgba(0, 0, 0, 0.16)",background:`rgba(${f}, ${p}, ${h}, ${m})`,zIndex:95}),this.suckerArea.length&&e>=this.suckerArea[0]&&n>=this.suckerArea[1]&&e<=this.suckerArea[2]&&n<=this.suckerArea[3]?g.display="":g.display="none"},suckColor(t){t&&t.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),t.addEventListener("click",e=>{const{clientX:n,clientY:o}=e,{top:r,left:s,width:a,height:l}=t.getBoundingClientRect(),c=n-s,u=o-r,f=t.getContext("2d").getImageData(Math.min(c,a-1),Math.min(u,l-1),1,1);let[p,h,m,g]=f.data;g=parseFloat((g/255).toFixed(2)),this.$emit("selectSucker",{r:p,g:h,b:m,a:g})}))}}});const ufe=i.createVNode("path",{d:"M13.1,8.2l5.6,5.6c0.4,0.4,0.5,1.1,0.1,1.5s-1.1,0.5-1.5,0.1c0,0-0.1,0-0.1-0.1l-1.4-1.4l-7.7,7.7C7.9,21.9,7.6,22,7.3,22H3.1C2.5,22,2,21.5,2,20.9l0,0v-4.2c0-0.3,0.1-0.6,0.3-0.8l5.8-5.8C8.5,9.7,9.2,9.6,9.7,10s0.5,1.1,0.1,1.5c0,0,0,0.1-0.1,0.1l-5.5,5.5v2.7h2.7l7.4-7.4L8.7,6.8c-0.5-0.4-0.5-1-0.1-1.5s1.1-0.5,1.5-0.1c0,0,0.1,0,0.1,0.1l1.4,1.4l3.5-3.5c1.6-1.6,4.1-1.6,5.8-0.1c1.6,1.6,1.6,4.1,0.1,5.8L20.9,9l-3.6,3.6c-0.4,0.4-1.1,0.5-1.5,0.1"},null,-1),dfe={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},ffe=i.createVNode("g",{fill:"none","fill-rule":"evenodd"},[i.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[i.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),i.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[i.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function pfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",null,[t.isSucking?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createBlock("svg",{key:0,class:[{active:t.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:e[1]||(e[1]=(...a)=>t.openSucker&&t.openSucker(...a))},[ufe],2)),t.isSucking?(i.openBlock(),i.createBlock("svg",dfe,[ffe])):i.createCommentVNode("v-if",!0)])}od.render=pfe;od.__file="src/color/Sucker.vue";var rd=i.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(t,{emit:e}){return{modelColor:i.computed({get(){return t.color||""},set(s){e("inputColor",s)}}),handleFocus:s=>{e("inputFocus",s)},handleBlur:s=>{e("inputBlur",s)}}}});const hfe={class:"color-type"},mfe={class:"name"};function gfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",hfe,[i.createVNode("span",mfe,i.toDisplayString(t.name),1),i.withDirectives(i.createVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=a=>t.modelColor=a),class:"value",onFocus:e[2]||(e[2]=(...a)=>t.handleFocus&&t.handleFocus(...a)),onBlur:e[3]||(e[3]=(...a)=>t.handleBlur&&t.handleBlur(...a))},null,544),[[i.vModelText,t.modelColor]])])}rd.render=gfe;rd.__file="src/color/Box.vue";var id=i.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(t,{emit:e}){const n=i.ref(),o=i.ref([]),r=i.ref();t.colorsHistoryKey&&localStorage&&(o.value=JSON.parse(localStorage.getItem(t.colorsHistoryKey))||[]),r.value=Xu(4).toDataURL(),i.onUnmounted(()=>{s(n.value)});function s(l){if(!l)return;const c=o.value||[],u=c.indexOf(l);u>=0&&c.splice(u,1),c.length>=8&&(c.length=7),c.unshift(l),o.value=c||[],localStorage&&t.colorsHistoryKey&&localStorage.setItem(t.colorsHistoryKey,JSON.stringify(c))}function a(l){e("selectColor",l)}return{setColorsHistory:s,colorsHistory:o,color:n,imgAlphaBase64:r,selectColor:a}}});const vfe={class:"colors"},yfe={key:0,class:"colors history"};function _fe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",null,[i.createVNode("ul",vfe,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(t.colorsDefault,a=>(i.openBlock(),i.createBlock("li",{key:a,class:"item",onClick:l=>t.selectColor(a)},[i.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),i.createVNode("div",{style:{background:a},class:"color"},null,4)],8,["onClick"]))),128))]),t.colorsHistory.length?(i.openBlock(),i.createBlock("ul",yfe,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(t.colorsHistory,a=>(i.openBlock(),i.createBlock("li",{key:a,class:"item",onClick:l=>t.selectColor(a)},[i.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),i.createVNode("div",{style:{background:a},class:"color"},null,4)],8,["onClick"]))),128))])):i.createCommentVNode("v-if",!0)])}id.render=_fe;id.__file="src/color/Colors.vue";var Tr=i.defineComponent({components:{Saturation:Qu,Hue:ed,Alpha:td,Preview:nd,Sucker:od,Box:rd,Colors:id},emits:["changeColor","openSucker","inputFocus","inputBlur"],props:{color:{type:String,default:"#000000"},theme:{type:String,default:"dark"},suckerHide:{type:Boolean,default:!0},suckerCanvas:{type:null,default:null},suckerArea:{type:Array,default:()=>[]},colorsDefault:{type:Array,default:()=>["#000000","#FFFFFF","#FF1900","#F47365","#FFB243","#FFE623","#6EFF2A","#1BC7B1","#00BEFF","#2E81FF","#5D61FF","#FF89CF","#FC3CAD","#BF3DCE","#8E00A7","rgba(0,0,0,0)"]},colorsHistoryKey:{type:String,default:"vue-colorpicker-history"}},data(){return{hueWidth:15,hueHeight:152,previewHeight:30,modelRgba:"",modelHex:"",r:0,g:0,b:0,a:1,h:0,s:0,v:0}},computed:{isLightTheme(){return this.theme==="light"},totalWidth(){return this.hueHeight+(this.hueWidth+8)*2},previewWidth(){return this.totalWidth-(this.suckerHide?0:this.previewHeight)},rgba(){return{r:this.r,g:this.g,b:this.b,a:this.a}},hsv(){return{h:this.h,s:this.s,v:this.v}},rgbString(){return`rgb(${this.r}, ${this.g}, ${this.b})`},rgbaStringShort(){return`${this.r}, ${this.g}, ${this.b}, ${this.a}`},rgbaString(){return`rgba(${this.rgbaStringShort})`},hexString(){return efe(this.rgba,!0)}},created(){Object.assign(this,Ao(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(t){const{r:e,g:n,b:o,h:r,s,v:a}=Ao(t);Object.assign(this,{r:e,g:n,b:o,h:r,s,v:a}),this.setText()},handleFocus(t){this.$emit("inputFocus",t)},handleBlur(t){this.$emit("inputBlur",t)},selectHue(t){const{r:e,g:n,b:o,h:r,s,v:a}=Ao(t);Object.assign(this,{r:e,g:n,b:o,h:r,s,v:a}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(t){this.a=t,this.setText()},inputHex(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.modelHex=t,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.modelHex=this.hexString,this.modelRgba=t,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(t){this.$emit("openSucker",t)},selectSucker(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const Cfe={class:"color-set"};function bfe(t,e,n,o,r,s){const a=i.resolveComponent("Saturation"),l=i.resolveComponent("Hue"),c=i.resolveComponent("Alpha"),u=i.resolveComponent("Preview"),d=i.resolveComponent("Sucker"),f=i.resolveComponent("Box"),p=i.resolveComponent("Colors");return i.openBlock(),i.createBlock("div",{class:["hu-color-picker",{light:t.isLightTheme}],style:{width:t.totalWidth+"px"}},[i.createVNode("div",Cfe,[i.createVNode(a,{ref:"saturation",color:t.rgbString,hsv:t.hsv,size:t.hueHeight,onSelectSaturation:t.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),i.createVNode(l,{ref:"hue",hsv:t.hsv,width:t.hueWidth,height:t.hueHeight,onSelectHue:t.selectHue},null,8,["hsv","width","height","onSelectHue"]),i.createVNode(c,{ref:"alpha",color:t.rgbString,rgba:t.rgba,width:t.hueWidth,height:t.hueHeight,onSelectAlpha:t.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),i.createVNode("div",{style:{height:t.previewHeight+"px"},class:"color-show"},[i.createVNode(u,{color:t.rgbaString,width:t.previewWidth,height:t.previewHeight},null,8,["color","width","height"]),t.suckerHide?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createBlock(d,{key:0,"sucker-canvas":t.suckerCanvas,"sucker-area":t.suckerArea,onOpenSucker:t.openSucker,onSelectSucker:t.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),i.createVNode(f,{name:"HEX",color:t.modelHex,onInputColor:t.inputHex,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),i.createVNode(f,{name:"RGBA",color:t.modelRgba,onInputColor:t.inputRgba,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),i.createVNode(p,{color:t.rgbaString,"colors-default":t.colorsDefault,"colors-history-key":t.colorsHistoryKey,onSelectColor:t.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),i.createCommentVNode(" custom options "),i.renderSlot(t.$slots,"default")],6)}Tr.render=bfe;Tr.__file="src/color/ColorPicker.vue";Tr.install=t=>{t.component(Tr.name,Tr)};const kfe={class:"color-picker-wrapper"},dl=i.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(!1),s=i.ref(null),a=i.ref(null),l=i.ref(0),c=i.ref(0),u=async m=>{a.value=m,r.value=!0,await i.nextTick();const g=m.getBoundingClientRect(),C=s.value,_=(C==null?void 0:C.offsetHeight)||300,y=window.innerHeight-g.bottom,v=g.top,w=y<_&&v>_;console.log("pickerHeight = "+_),l.value=w?g.top-_-8:g.bottom+8,c.value=g.left,setTimeout(()=>{window.addEventListener("click",f)},0)},d=i.computed(()=>({position:"fixed",top:`${l.value}px`,left:`${c.value}px`,zIndex:1e3})),f=m=>{const g=m.target;s.value&&!s.value.contains(g)&&(r.value=!1,o("update:color",p.value),window.removeEventListener("click",f))};i.onBeforeUnmount(()=>{window.removeEventListener("click",f)}),i.watch(()=>n.color,m=>{r.value||(p.value=m)});const p=i.ref(n.color),h=m=>{const{r:g,g:C,b:_,a:y}=m.rgba;p.value=`rgba(${g}, ${C}, ${_}, ${y})`};return(m,g)=>(i.openBlock(),i.createElementBlock("div",kfe,[i.renderSlot(m.$slots,"clickable",{openPicker:u,bgColor:t.color}),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:s,class:"color-picker",style:i.normalizeStyle(d.value)},[i.createVNode(i.unref(Tr),{class:"color-picker-box",theme:"light",color:t.color,onChangeColor:h},null,8,["color"])],4)):i.createCommentVNode("",!0)]))}});const wfe={class:"ao-card-project-phase__header"},Efe={class:"ao-card-project-item__title-line"},xfe={key:0,class:"ao-card-project-item-phase__estimation"},Sfe={class:"ao-card-project-phase__footer"},Tfe={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},Afe={class:"ao-card-project-phase__subitem"},Nfe={class:"ao-card-project-phase__subitem"},Dfe={key:0,class:"ao-card-project-phase__secondary"},Mfe={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},$fe=i.defineComponent({__name:"AoCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","unarchivePhase","updatePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},s=i.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((C,_)=>{var y;return C+((y=_.activities)==null?void 0:y.reduce((v,w)=>v+(w.estimation||0),0))},0))||0}),a=i.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,C)=>{var _;return g+(((_=C.activities)==null?void 0:_.reduce((y,v)=>{var k;const w=(k=n.timeTrackingData)==null?void 0:k[v.id];return y+((w==null?void 0:w.timeSpent)||0)},0))||0)},0)),l=i.computed(()=>n.estimationUnit==="days"?"d":"h"),c=i.computed(()=>Aa(a.value,n.estimationUnit)),u=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),d=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(C=>C.status===Bi.done).length}),f=i.computed(()=>(d.value||0)/(u.value||1)),p=i.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),h=i.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),m=(g,C)=>{const _=g.target;_.closest("button")||_.closest("input")||_.closest(".ao-title")||C(_)};return(g,C)=>(i.openBlock(),i.createBlock(dl,{color:h.value,"onUpdate:color":C[2]||(C[2]=_=>h.value=_)},{clickable:i.withCtx(({openPicker:_,bgColor:y})=>[i.createVNode(cl,{class:"ao-card-project-phase","is-clickable":t.isEditable,color:y,"with-left-border":!0,onClick:v=>m(v,_)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",Efe,[i.createVNode(at,{id:t.id,class:"ao-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),s.value||a.value?(i.openBlock(),i.createElementBlock("span",xfe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",Sfe,[u.value?(i.openBlock(),i.createElementBlock("div",Tfe,[i.createElementVNode("div",Afe,[i.createVNode(ke,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",Nfe,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(ul,{percentages:f.value,class:"ao-card-project-phase__progress",color:t.color},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",Dfe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ao-card-project-phase__footer-row",p.value?"":"ao-card-project-phase__no_deadline"])},[t.isEditable?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,"onUpdate:modelValue":C[1]||(C[1]=v=>p.value=v),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[i.vModelText,p.value,void 0,{lazy:!0}]]):i.createCommentVNode("",!0),i.createElementVNode("span",Mfe,i.toDisplayString(i.unref(Na)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",wfe,[i.createVNode(pe,{class:"ao-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:C[0]||(C[0]=i.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const Bfe=i.defineComponent({__name:"AoBadge",props:{color:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",{class:"aoBadge",style:i.normalizeStyle({backgroundColor:t.color})},null,4))}});const Ofe={class:"ao-card-project-milestone__default"},Lfe={class:"ao-title-with-badge-wrapper"},Ife={class:"ao-card-project-item__title-line"},Pfe={key:0,class:"ao-card-project-item-milestone__estimation"},Ffe={key:0,class:"ao-card-project-milestone__archive"},Vfe={class:"ao-card-project-milestone__activities"},Rfe={class:"ao-card-project-milestone__activities-row"},zfe={class:"ao-card-project-milestone__subitem"},Ufe={class:"ao-card-project-milestone__subitem"},qfe={key:1,class:"ao-card-project-milestone__secondary"},Hfe={class:"ao-card-project-milestone__footer"},jfe={key:1,class:"ao-field ao-card-project-milestone__deadline"},Wfe={class:"ao-field__label"},Zfe={key:2,class:"ao-card-project-milestone__assignee"},Kfe=i.defineComponent({__name:"AoCardProjectItemMilestone",props:{id:{},name:{},color:{},phaseColor:{},activities:{},closedStatus:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},isSelected:{type:Boolean},assignee:{},important:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["updateMilestone","archiveMilestone","unarchiveMilestone"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{var p;return((p=n.activities)==null?void 0:p.reduce((h,m)=>h+(m.estimation||0),0))||0}),s=i.computed(()=>!n.activities||!n.timeTrackingData?0:n.activities.reduce((p,h)=>{var g;const m=(g=n.timeTrackingData)==null?void 0:g[h.id];return p+((m==null?void 0:m.timeSpent)||0)},0)),a=i.computed(()=>n.estimationUnit==="days"?"d":"h"),l=i.computed(()=>Aa(s.value,n.estimationUnit));i.computed(()=>{const p=s.value/60;return p%1===0?p.toString():p.toFixed(2)});const c=i.computed(()=>{var p;return(p=n.activities)==null?void 0:p.length}),u=i.computed(()=>{var p;return(p=n.activities)==null?void 0:p.filter(h=>Kc(h,n.closedStatus)).length}),d=i.computed(()=>(u.value||0)/(c.value||1)),f=p=>{o("updateMilestone",{id:n.id,name:p})};return(p,h)=>(i.openBlock(),i.createBlock(cl,{class:i.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!t.readonly,"tag-name":"li","is-selected":t.isSelected,color:t.phaseColor},{default:i.withCtx(()=>[i.createElementVNode("div",Ofe,[i.createElementVNode("div",Lfe,[i.createVNode(Bfe,{color:t.color||""},null,8,["color"]),i.createElementVNode("div",Ife,[i.createVNode(at,{id:t.id,title:t.name||"",level:5,"is-editable":!t.readonly&&t.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":f},null,8,["id","title","is-editable"]),r.value||s.value?(i.openBlock(),i.createElementBlock("span",Pfe," ("+i.toDisplayString(l.value)+"/"+i.toDisplayString(r.value)+i.toDisplayString(a.value)+")",1)):i.createCommentVNode("",!0)])]),!t.readonly&&t.isEditable?(i.openBlock(),i.createElementBlock("div",Ffe,[i.createVNode(pe,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?p.$t("archive"):p.$t("unarchive"),onClick:h[0]||(h[0]=i.withModifiers(()=>t.active?p.$emit("archiveMilestone",{id:t.id}):p.$emit("unarchiveMilestone",{id:t.id}),["stop"]))},null,8,["label"])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Vfe,[i.createElementVNode("div",Rfe,[c.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",zfe,[i.createVNode(ke,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",Ufe,i.toDisplayString(u.value)+" / "+i.toDisplayString(c.value),1)]),i.createVNode(ul,{percentages:d.value,color:t.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):i.createCommentVNode("",!0),p.$slots.secondary?(i.openBlock(),i.createElementBlock("div",qfe,[i.renderSlot(p.$slots,"secondary")])):i.createCommentVNode("",!0)])])]),footer:i.withCtx(()=>[i.createElementVNode("div",Hfe,[t.important?(i.openBlock(),i.createBlock(ke,{key:0,name:"FlagRounded",class:i.normalizeClass(t.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):i.createCommentVNode("",!0),t.deadline?(i.openBlock(),i.createElementBlock("label",jfe,[i.createElementVNode("span",Wfe,i.toDisplayString(i.unref(Na)(t.deadline)),1)])):i.createCommentVNode("",!0),t.assignee?(i.openBlock(),i.createElementBlock("div",Zfe,[i.createVNode(Un,{"user-name":i.unref(Mp)(t.assignee),"avatar-url":t.assignee.avatarUrl,color:t.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):i.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}});const Gfe={class:"ao-mapping-card-project-phase__header"},Yfe={class:"ao-card-project-item__title-line"},Jfe={key:0,class:"ao-card-project-item-phase__estimation"},Xfe={class:"ao-mapping-card-project-phase__footer"},Qfe={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},epe={class:"ao-mapping-card-project-phase__subitem"},tpe={class:"ao-mapping-card-project-phase__subitem"},npe={key:0,class:"ao-mapping-card-project-phase__secondary"},ope={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},rpe=i.defineComponent({__name:"AoCondensedCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","updatePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},s=i.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((C,_)=>{var y;return C+((y=_.activities)==null?void 0:y.reduce((v,w)=>v+(w.estimation||0),0))},0))||0}),a=i.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,C)=>{var _;return g+(((_=C.activities)==null?void 0:_.reduce((y,v)=>{var k;const w=(k=n.timeTrackingData)==null?void 0:k[v.id];return y+((w==null?void 0:w.timeSpent)||0)},0))||0)},0)),l=i.computed(()=>n.estimationUnit==="days"?"d":"h"),c=i.computed(()=>Aa(a.value,n.estimationUnit)),u=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),d=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(C=>C.status===Bi.done).length}),f=i.computed(()=>(d.value||0)/(u.value||1)),p=i.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),h=i.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),m=(g,C)=>{const _=g.target;_.closest("button")||_.closest("input")||_.closest(".ao-title")||C()};return(g,C)=>(i.openBlock(),i.createBlock(dl,{color:h.value,"onUpdate:color":C[2]||(C[2]=_=>h.value=_)},{clickable:i.withCtx(({openPicker:_,bgColor:y})=>[i.createVNode(cl,{class:"ao-mapping-card-project-phase","is-clickable":t.isEditable,color:y,"with-left-border":!0,onClick:v=>m(v,_)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",Yfe,[i.createVNode(at,{id:t.id,class:"ao-mapping-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),s.value||a.value?(i.openBlock(),i.createElementBlock("span",Jfe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",Xfe,[u.value?(i.openBlock(),i.createElementBlock("div",Qfe,[i.createElementVNode("div",epe,[i.createVNode(ke,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",tpe,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(ul,{percentages:f.value,class:"ao-mapping-card-project-phase__progress",color:h.value},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",npe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ao-mapping-card-project-phase__footer-row",p.value?"":"ao-mapping-card-project-phase__no_deadline"])},[t.isEditable?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,"onUpdate:modelValue":C[1]||(C[1]=v=>p.value=v),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[i.vModelText,p.value,void 0,{lazy:!0}]]):i.createCommentVNode("",!0),i.createElementVNode("span",ope,i.toDisplayString(i.unref(Na)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",Gfe,[i.createVNode(pe,{class:"ao-mapping-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:C[0]||(C[0]=i.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const ipe={class:"ao-project-phase"},spe={key:0,class:"ao-project-phase__drag ao-card__drag"},ape={key:1,class:"ao-project-phase__col-phase"},lpe={key:2,class:"ao-mapping-project-phase__col-phase"},cpe={key:0,class:"ao-project-phase__col-milestones"},upe={class:"ao-project-phase__milestones-list-footer"},dpe=i.defineComponent({__name:"AoProjectPhase",props:{phase:{},closedStatus:{},users:{},isEditable:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e;i.watch(()=>o.phase.milestones,(v,w)=>{In(v,w)});const s=v=>{r("updatePhase",{id:o.phase.id,name:v})},a=v=>{r("updatePhase",{id:o.phase.id,deadline:v})},l=v=>{r("updatePhase",v)},c=i.computed(()=>o.phase.milestones.map(v=>d_(v,o.closedStatus))),u=v=>{const{name:w,rank:k}=Uo(c.value??[],"milestone",n);r("addMilestone",{name:w,rank:k,phaseId:v})},d=v=>{r("updateMilestone",v)},f=v=>{r("archiveMilestone",v)},p=v=>{r("unarchiveMilestone",v)},h=v=>{r("archivePhase",v)},m=v=>{r("unarchivePhase",v)},g=v=>{"added"in v?r("updateMilestone",{id:v.added.element.id,phaseId:o.phase.id,rank:Ar(c.value,v.added.newIndex)}):"removed"in v||"moved"in v&&r("updateMilestone",{id:v.moved.element.id,rank:Ar(c.value,v.moved.newIndex)})},C=Ki.useRoute(),_=i.computed(()=>C.path.includes("/mapping")),y=i.computed(()=>{var v;return o.phase.id!==((v=C.params)==null?void 0:v.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:p_(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(v,w)=>(i.openBlock(),i.createElementBlock("li",ipe,[i.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:i.normalizeStyle(y.value)},[t.isEditable?(i.openBlock(),i.createElementBlock("div",spe,[i.createVNode(ke,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createElementBlock("div",lpe,[i.createVNode(rpe,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"estimation-unit":t.estimationUnit,"onUpdate:deadline":a,"onUpdate:title":s,onArchivePhase:h,onUnarchivePhase:m,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","estimation-unit"])])):(i.openBlock(),i.createElementBlock("div",ape,[i.createVNode($fe,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,"onUpdate:deadline":a,"onUpdate:title":s,onArchivePhase:h,onUnarchivePhase:m,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","time-tracking-data","estimation-unit"])]))],4),_.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",cpe,[i.createElementVNode("div",{class:"ao-project-phase__milestones",style:i.normalizeStyle(y.value)},[i.createVNode(i.unref(mo),i.mergeProps({class:"ao-project-phase__milestones-list",list:c.value,disabled:t.readonly||!t.isEditable,"item-key":"id",group:"kanban"},v.$attrs,{onChange:g}),{item:i.withCtx(({element:k})=>{var b;return[i.createVNode(Kfe,{id:k.id,name:k.name,color:k.color,"phase-color":t.phase.color,activities:k.activities,deadline:k.deadline,active:k.active,"is-editable":!t.readonly&&t.isEditable,"is-draggable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,"is-selected":k.id===((b=v.$route.params)==null?void 0:b.milestoneId),assignee:k.assignee,important:k.important,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,class:i.normalizeClass(["ao-project-phase__milestone"]),onClick:S=>!t.readonly&&v.$router.push({name:i.unref(je).milestone,params:{phaseId:t.phase.id,milestoneId:k.id}}),onUpdateMilestone:d,onArchiveMilestone:f,onUnarchiveMilestone:p},null,8,["id","name","color","phase-color","activities","deadline","active","is-editable","is-draggable","closed-status","is-selected","assignee","important","readonly","time-tracking-data","estimation-unit","onClick"])]}),_:1},16,["list","disabled"]),i.createElementVNode("div",upe,[t.isEditable?(i.openBlock(),i.createBlock(go,{key:0,label:v.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:w[0]||(w[0]=()=>u(t.phase.id))},null,8,["label"])):i.createCommentVNode("",!0)])],4)]))]))}});const fpe={class:"ao-project__phases"},ppe={key:0,class:"ao-project-phase__phases-list-footer"},hpe={class:"ao-project-phase__col-phase"},sd=i.defineComponent({__name:"AoProjectPhases",props:{phases:{},closedStatus:{},isEditable:{type:Boolean},users:{},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addPhase","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e;i.watch(()=>n.phases,(h,m)=>{In(h,m)});const r=h=>{o("addMilestone",h)},s=h=>{o("updateMilestone",h)},a=h=>{o("archiveMilestone",h)},l=h=>{o("unarchiveMilestone",h)},c=h=>{o("archivePhase",h)},u=h=>{o("unarchivePhase",h)},d=h=>{if(h.moved){const m=Xi(h,n.phases??[]);o("updatePhase",{id:h.moved.element.id,rank:m})}},f=h=>{o("updatePhase",h)},p=h=>{o("addPhase",h)};return(h,m)=>(i.openBlock(),i.createElementBlock("div",fpe,[i.createVNode(i.unref(mo),{class:"ao-project-phase__phases-list","model-value":t.phases,"item-key":"id",handle:".ao-card__drag",onChange:d},{item:i.withCtx(({element:g})=>[i.createVNode(dpe,{phase:g,"is-editable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,users:t.users,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,onAddMilestone:r,onUpdateMilestone:s,onArchiveMilestone:a,onUnarchiveMilestone:l,onUpdatePhase:f,onArchivePhase:c,onUnarchivePhase:u},null,8,["phase","is-editable","closed-status","users","readonly","time-tracking-data","estimation-unit"])]),_:1},8,["model-value"]),t.isEditable?(i.openBlock(),i.createElementBlock("div",ppe,[m[0]||(m[0]=i.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1)),i.createElementVNode("div",hpe,[i.createVNode(go,{label:h.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:p},null,8,["label"])]),m[1]||(m[1]=i.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1))])):i.createCommentVNode("",!0)]))}});const mpe={class:"ao-add-template-modal__form-body"},gpe={class:"field__row"},vpe={class:"ao-add-template-modal__form-footer"},Ig=i.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.templates.map(c=>({value:c.id,label:c.name}))),s=i.ref(null),a=c=>{s.value=c},l=()=>{s.value&&o("apply",s.value,n.projectId)};return(c,u)=>(i.openBlock(),i.createBlock(Da,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(at,{title:c.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:i.withModifiers(l,["prevent"])},[i.createElementVNode("p",null,i.toDisplayString(c.$t("project.template.apply.notice")),1),i.createElementVNode("div",mpe,[i.createElementVNode("div",gpe,[i.createVNode(Dt,{value:s.value,options:r.value,detached:!0,onChange:a},null,8,["value","options"])])]),i.createElementVNode("footer",vpe,[i.createVNode(pe,{label:c.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],32)]),_:1}))}});const ype={class:"ao-save-template-modal__form-body"},_pe={class:"field__row"},Cpe={class:"ao-field ao-field--inline"},bpe={class:"ao-field__label"},kpe={class:"ao-save-template-modal__phases"},wpe={class:"ao-field__label"},Epe={class:"ao-save-template-modal__phases-list"},xpe=["value"],Spe={class:"ao-save-template-modal__form-footer"},Pg=i.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(""),s=i.ref([]);i.onMounted(()=>{s.value=n.phases.map(l=>l.id)});const a=()=>{r.value&&o("save",r.value,s.value)};return(l,c)=>(i.openBlock(),i.createBlock(Da,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(at,{title:l.$t("project.template.save.title"),level:3},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:i.withModifiers(a,["prevent"])},[i.createElementVNode("div",ype,[i.createElementVNode("div",_pe,[i.createElementVNode("label",Cpe,[i.createElementVNode("span",bpe,i.toDisplayString(l.$t("project.template.name.label"))+": ",1),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u),type:"text"},null,512),[[i.vModelText,r.value]])])]),i.createElementVNode("div",kpe,[i.createElementVNode("div",wpe,i.toDisplayString(l.$t("project.template.phases.label")),1),i.createElementVNode("div",Epe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.phases,u=>(i.openBlock(),i.createElementBlock("label",{key:u.id,class:"ao-field ao-field--checkbox"},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[1]||(c[1]=d=>s.value=d),type:"checkbox",value:u.id},null,8,xpe),[[i.vModelCheckbox,s.value]]),i.createElementVNode("span",null,i.toDisplayString(u.name),1)]))),128))])])]),i.createElementVNode("footer",Spe,[i.createVNode(pe,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:a},null,8,["label"])])],32)]),_:1}))}});const Tpe={class:"ao-project"},Ape={class:"ao-project__body"},Npe=i.defineComponent({__name:"AoProjectOverviewProject",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addActivity","update:activity","archiveActivity","copyPhaseToTemplate","unarchiveActivity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e,s=i.computed(()=>o.phases.flatMap(N=>N.milestones)),a=()=>{const{name:N,rank:G}=Uo(o.phases,"phase",n);r("addPhase",{name:N,rank:G,projectId:o.project.id})},l=N=>{r("updatePhase",N)},c=N=>{r("archivePhase",N)},u=N=>{r("unarchivePhase",N)},d=N=>{r("copyPhaseToTemplate",N)},f=N=>{r("addMilestone",N)},p=N=>{r("updateMilestone",N)},h=N=>{r("archiveMilestone",N)},m=N=>{r("unarchiveMilestone",N)},g=N=>{r("addActivity",N)},C=N=>{r("update:activity",N)},_=N=>{r("archiveActivity",N)},y=N=>{r("unarchiveActivity",N)},v=N=>{r("addSubtask",N)},w=N=>{r("updateSubtask",N)},k=N=>{r("deleteSubtask",N)},b=i.computed(()=>s.value.flatMap(N=>N.activities)),S=N=>{r("addFiles",N)},T=N=>{r("removeFile",N)},A=N=>{r("addComment",N)},x=N=>{r("updateComment",N)},O=N=>{r("removeComment",N)},M=i.ref(!1),$=i.ref(!1),B=(N,G)=>{r("applyTemplate",{templateId:N,projectId:G}),M.value=!1},P=(N,G)=>{var ue;const z=(ue=o.templates)==null?void 0:ue.at(-1),H=z?it.LexoRank.parse(z.rank).genNext():it.LexoRank.middle();r("saveTemplate",{templateName:N,rank:H.format(),phaseIds:G}),$.value=!1},F=Ki.useRouter(),K=i.ref("overview"),V=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return i.watch(K,N=>{N==="feed"?(F.push({name:je.feed}),console.log("Navigating to feed...")):N==="overview"?(F.push({name:je.project}),console.log("Navigating to feed...")):N==="mapping"&&(F.push({name:je.mapping}),console.log("Navigating to feed..."))}),(N,G)=>{var H;const z=i.resolveComponent("RouterView");return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-overview"},N.$attrs),[i.createElementVNode("div",Tpe,[i.createVNode(Qi,null,{primary:i.withCtx(()=>[i.createVNode(fs,{modelValue:K.value,"onUpdate:modelValue":G[0]||(G[0]=ue=>K.value=ue),tabs:V},null,8,["modelValue"]),i.createVNode(pe,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:N.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:G[1]||(G[1]=ue=>N.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:i.withCtx(()=>[t.isEditable===!0?(i.openBlock(),i.createBlock(pe,{key:0,class:"ao-project-overview__save-as-template",color:"primary",label:N.$t("project.template.save.label"),onClick:G[2]||(G[2]=ue=>$.value=!0)},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(pe,{key:1,class:"ao-project-overview__add-template",color:"primary",label:N.$t("project.template.apply.label"),onClick:G[3]||(G[3]=ue=>M.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",Ape,[i.createVNode(sd,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"time-tracking-data":t.timeTrackingData,"estimation-unit":(H=t.project)==null?void 0:H.estimationUnit,onAddMilestone:f,onUpdateMilestone:p,onArchiveMilestone:h,onUnarchiveMilestone:m,onAddPhase:a,onUpdatePhase:l,onArchivePhase:c,onUnarchivePhase:u,onCopyPhaseToTemplate:d},null,8,["phases","closed-status","is-editable","users","time-tracking-data","estimation-unit"])])]),i.createVNode(z,{class:"ao-project__sidebar",phases:t.phases,"project-id":t.project.id,"project-name":t.project.name,users:t.users,"is-editable":t.isEditable===!0,"closed-status":t.closedStatus,"time-tracking-data":t.timeTrackingData,onClose:G[4]||(G[4]=ue=>N.$router.push({name:i.unref(je).project})),onUpdateMilestone:p,onAddActivity:g,onUpdateActivity:C,onArchiveActivity:_,onUnarchiveActivity:y},null,8,["phases","project-id","project-name","users","is-editable","closed-status","time-tracking-data"]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(z,{name:"modal",activities:b.value,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,"activity-types":t.activityTypes,phases:t.phases,project:t.project,users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,"time-tracking-data":t.timeTrackingData,"onUpdate:activity":C,onAddSubtask:v,onUpdateSubtask:w,onDeleteSubtask:k,onAddFiles:S,onRemoveFile:T,onAddComment:A,onUpdateComment:x,onRemoveComment:O},{default:i.withCtx(({Component:ue})=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(ue),null,{default:i.withCtx(Q=>[i.renderSlot(N.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(Q)))]),_:3}))]),_:3},8,["activities","is-task-checkable","statuses","activity-types","phases","project","users","user-id","is-editable","attachment-enabled","time-tracking-data"])]))],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[$.value?(i.openBlock(),i.createBlock(Pg,{key:0,phases:t.phases,onClose:G[5]||(G[5]=ue=>$.value=!1),onSave:P},null,8,["phases"])):i.createCommentVNode("",!0),M.value?(i.openBlock(),i.createBlock(Ig,{key:1,"project-id":t.project.id,templates:t.templates,onClose:G[6]||(G[6]=ue=>M.value=!1),onApply:B},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const Dpe={class:"ao-card-feed__header"},Mpe={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},$pe={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},Bpe={class:"ao-card-feed__body"},Ope={key:0,class:"ao-card-feed__breadcrumbs"},Lpe={class:i.normalizeClass(["ao-card-feed__title-group"])},Ipe={class:"ao-card-feed__title-line"},Ppe={key:0,class:"ao-card-feed__slug"},Fpe={key:1,class:"ao-card-feed__deadline"},Vpe={class:"ao-card-feed__footer"},Rpe={class:"ao-card-feed__footer-row"},zpe={class:"ao-assignees"},Upe={key:0,class:"ao-assignee"},qpe={key:0,class:"ao-card-feed__subitems"},Hpe={key:0,class:"ao-card-feed__subitem"},jpe={class:"ao-card-feed__subitem"},Wpe={key:1,class:"ao-card-feed__subitem"},Zpe={class:"ao-card-feed__subitem"},Kpe={class:"ao-card-feed__timer-wrapper"},Gpe={class:"ao-card-feed__footer-row"},Ype={key:0,class:"ao-card-feed__progress-wrapper"},Jpe={class:"ao-card-feed__subitem"},Xpe={class:"ao-card-feed__subitem"},ad=i.defineComponent({__name:"AoCardFeed",props:{id:{},name:{},projectName:{},projectId:{},projectColor:{},phaseName:{},milestoneName:{},milestoneColor:{},deadline:{},important:{type:Boolean},assignee:{},slug:{},comments:{},attachments:{},tasks:{},isEditable:{type:Boolean},isPrivate:{type:Boolean},isClosed:{type:Boolean},tagType:{}},emits:["removeAssignee","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.tagType==="milestone"?n.milestoneName:n.projectName),s=i.computed(()=>n.tagType==="milestone"?n.milestoneColor:n.projectColor),a=g=>{o("updateActivity",{id:n.id,name:g})},l=i.computed(()=>n.tagType==="milestone"&&n.phaseName?`${n.phaseName}`:n.phaseName&&n.milestoneName?`${n.phaseName} / ${n.milestoneName}`:""),c=i.computed(()=>n.assignee?[n.assignee]:[]),u=i.computed(()=>Na(n.deadline)),d=g=>{o("removeAssignee",g)},f=()=>{o("startTimer",{activityId:n.id,name:n.name,project:n.projectName,projectId:n.projectId,slug:n.slug})},p=i.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.length}),h=i.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.filter(C=>C.isDone).length}),m=i.computed(()=>(h.value||0)/(p.value||1));return(g,C)=>(i.openBlock(),i.createBlock(cl,{class:i.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":t.isClosed}]),"is-clickable":!0},{header:i.withCtx(()=>[i.createElementVNode("div",Dpe,[r.value?(i.openBlock(),i.createBlock($i,{key:0,label:r.value,class:"ao-card-feed__project",variant:"solid",color:t.projectColor?void 0:"primary","raw-color":s.value},null,8,["label","color","raw-color"])):i.createCommentVNode("",!0),t.isPrivate||t.important||t.isClosed?(i.openBlock(),i.createElementBlock("div",Mpe,[t.isPrivate?(i.openBlock(),i.createBlock(ke,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):i.createCommentVNode("",!0),t.important?(i.openBlock(),i.createBlock(ke,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):i.createCommentVNode("",!0),t.isClosed?(i.openBlock(),i.createBlock(ke,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",$pe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[i.createElementVNode("div",Bpe,[l.value?(i.openBlock(),i.createElementBlock("span",Ope,i.toDisplayString(l.value),1)):i.createCommentVNode("",!0),i.createElementVNode("div",Lpe,[i.createElementVNode("div",Ipe,[t.slug?(i.openBlock(),i.createElementBlock("span",Ppe,i.toDisplayString(t.slug)+": ",1)):i.createCommentVNode("",!0),i.createVNode(at,{id:t.id,title:t.name,level:5,"is-editable":t.isEditable,class:"ao-card-feed__title-inline","onUpdate:title":a},null,8,["id","title","is-editable"])])]),t.deadline?(i.openBlock(),i.createElementBlock("span",Fpe,i.toDisplayString(u.value),1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",Vpe,[i.createElementVNode("div",Rpe,[i.createElementVNode("ul",zpe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.value,_=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:_.id},[_?(i.openBlock(),i.createElementBlock("li",Upe,[i.createVNode(Un,{"user-name":i.unref(Mp)(_),"avatar-url":_.avatarUrl,"is-closable":!0,onClose:()=>d(_.id)},null,8,["user-name","avatar-url","onClose"])])):i.createCommentVNode("",!0)],64))),128))]),t.comments||t.attachments?(i.openBlock(),i.createElementBlock("ul",qpe,[t.comments?(i.openBlock(),i.createElementBlock("li",Hpe,[i.createVNode(ke,{name:"ChatOutline",size:"sm"}),i.createElementVNode("span",jpe,i.toDisplayString(t.comments),1)])):i.createCommentVNode("",!0),t.attachments?(i.openBlock(),i.createElementBlock("li",Wpe,[i.createVNode(ke,{name:"AttachFileRounded",size:"sm"}),i.createElementVNode("span",Zpe,i.toDisplayString(t.attachments),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",Kpe,[i.createVNode(ke,{name:"TimerOutline",class:"ao-card-feed__timer",size:"md",onClick:i.withModifiers(f,["stop"])})])]),i.createElementVNode("div",Gpe,[t.tasks&&t.tasks.length?(i.openBlock(),i.createElementBlock("div",Ype,[i.createElementVNode("div",Jpe,[i.createVNode(ke,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",Xpe,i.toDisplayString(h.value)+" / "+i.toDisplayString(p.value),1)]),i.createVNode(ul,{percentages:m.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):i.createCommentVNode("",!0)])])]),_:3},8,["class"]))}});const Qpe={class:"ao-project-milestone"},ehe={class:"ao-project-milestone__header"},the={class:"ao-project-milestone__header_line"},nhe={class:"ao-project-milestone__header_line"},ohe={class:"ao-project-milestone__title"},rhe={key:0,class:"ao-fieldset ao-milestone__fieldset"},ihe={class:"ao-field__row ao-milestone__field-row"},she={class:"ao-field ao-field--inline"},ahe={class:"ao-field__row ao-milestone__field-row"},lhe={class:"ao-field ao-milestone__field-multiselect"},che=["onClick"],uhe={class:"ao-project-milestone__body"},dhe={key:0,class:"ao-project-milestone__footer"},cp=i.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{},timeTrackingData:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity","startTimer"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e,s=k=>{var b;r("startTimer",k),(b=window.parent)==null||b.postMessage({type:"startTimer",data:k},"*")},a=i.computed(()=>{var k;return(k=o.phases)==null?void 0:k.find(b=>b.id===o.phaseId)}),l=i.computed(()=>{var k;return(k=o.phases)==null?void 0:k.flatMap(b=>b.milestones)}),c=i.computed(()=>{var k;return(k=l.value)==null?void 0:k.find(b=>b.id===o.milestoneId)}),u=i.computed(()=>{var k;return(k=c.value)==null?void 0:k.activities});i.watch(u,(k,b)=>{In(k,b)});const d=k=>{r("close",k)},f=()=>{const{name:k,rank:b}=Uo(u.value??[],"activity",n);r("addActivity",{milestoneId:o.milestoneId,name:k,rank:b,projectId:o.projectId})},p=k=>{r("updateActivity",k)},h=k=>{u.value&&"moved"in k&&r("updateActivity",{id:k.moved.element.id,rank:Ar(u.value,k.moved.newIndex)})},m=i.computed({get:()=>{var k;return(k=c.value)==null?void 0:k.color},set:k=>{c.value&&r("updateMilestone",{id:c.value.id,color:k})}}),g=i.computed({get:()=>{var k;return((k=c==null?void 0:c.value)==null?void 0:k.deadline)??""},set:k=>{c.value&&r("updateMilestone",{id:c.value.id,deadline:k!=null&&k.length?k:null})}}),C=k=>o.closedStatus?Kc(k,o.closedStatus):!1,_=i.computed(()=>{var k;return((k=o.users)==null?void 0:k.map(b=>({label:`${b.firstName} ${b.lastName}`,value:b.id,avatar:b.avatarUrl})))||[]}),y=i.computed({get(){var k,b;return(b=(k=c.value)==null?void 0:k.assignee)!=null&&b.id?[c.value.assignee.id]:[]},set(k){r("updateMilestone",{id:o.milestoneId,assigneeId:k[0]??null})}}),v=i.computed({get(){var k;return((k=c.value)==null?void 0:k.important)??!1},set(k){r("updateMilestone",{id:o.milestoneId,important:k})}}),w=(k,b)=>{const S=k.currentTarget;S instanceof HTMLElement&&b(S)};return(k,b)=>{var S;return i.openBlock(),i.createElementBlock("div",Qpe,[i.createElementVNode("header",ehe,[i.createElementVNode("div",the,[i.createVNode(pe,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:d})]),i.createElementVNode("div",nhe,[i.createElementVNode("div",ohe,[i.createVNode(at,{title:((S=c.value)==null?void 0:S.name)||t.milestoneId,level:5},null,8,["title"]),i.createVNode(Og,{modelValue:v.value,"onUpdate:modelValue":b[0]||(b[0]=T=>v.value=T),modelModifiers:{lazy:!0},disabled:!t.isEditable,class:"ao-milestone__important",color:"danger",label:k.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),c.value?(i.openBlock(),i.createElementBlock("div",rhe,[i.createElementVNode("div",ihe,[i.createElementVNode("label",she,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":b[1]||(b[1]=T=>g.value=T),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[i.vModelText,g.value,void 0,{lazy:!0}]])])]),i.createElementVNode("div",ahe,[i.createElementVNode("label",lhe,[i.createVNode(Dt,{modelValue:y.value,"onUpdate:modelValue":b[2]||(b[2]=T=>y.value=T),options:_.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:k.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!t.isEditable,caret:t.isEditable},{tag:i.withCtx(({option:T,handleTagRemove:A})=>[i.createVNode(Un,{"user-name":T.label,"avatar-url":T.avatar,"is-closable":!0,onClose:x=>A(T,x)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),i.createVNode(dl,{color:m.value,"onUpdate:color":b[3]||(b[3]=T=>m.value=T)},{clickable:i.withCtx(({openPicker:T,bgColor:A})=>[i.createElementVNode("button",{style:i.normalizeStyle({background:A}),class:"color-button",onClick:x=>w(x,T)},null,12,che)]),_:1},8,["color"])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",uhe,[i.createVNode(i.unref(mo),i.mergeProps({class:"ao-project-milestone__activities",list:u.value,disabled:!t.isEditable,"item-key":"id",group:"kanban"},k.$attrs,{onChange:h}),{item:i.withCtx(({element:T})=>{var A,x,O,M,$;return[i.createVNode(ad,{id:T.id,name:T.name||T.id,"project-id":t.projectId,"phase-name":(A=a.value)==null?void 0:A.name,"milestone-name":(x=c.value)==null?void 0:x.name,"milestone-color":(O=c.value)==null?void 0:O.color,deadline:T.deadline,important:T.important,users:t.users,assignee:T.assignee,slug:T.slug,comments:(M=T.comments)==null?void 0:M.length,attachments:($=T.attachments)==null?void 0:$.length,tasks:T.tasks,"is-editable":t.isEditable,"is-private":T.private,"is-closed":C(T),onClick:B=>k.$router.push({name:i.unref(je).activity,params:{milestoneId:t.milestoneId,activityId:T.id}}),onUpdateActivity:p,onRemoveAssignee:()=>p({id:T.id,assigneeId:null}),onStartTimer:s},i.createSlots({_:2},[t.isEditable?{name:"secondary",fn:i.withCtx(()=>[t.isEditable&&T.active?(i.openBlock(),i.createBlock(pe,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:k.$t("archive"),onClick:i.withModifiers(()=>k.$emit("archiveActivity",{id:T.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),t.isEditable&&!T.active?(i.openBlock(),i.createBlock(pe,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:k.$t("feed.activity.unarchive"),onClick:i.withModifiers(()=>k.$emit("unarchiveActivity",{id:T.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["id","name","project-id","phase-name","milestone-name","milestone-color","deadline","important","users","assignee","slug","comments","attachments","tasks","is-editable","is-private","is-closed","onClick","onRemoveAssignee"])]}),_:1},16,["list","disabled"]),t.isEditable?(i.openBlock(),i.createElementBlock("div",dhe,[i.createVNode(go,{"icon-name":"Add",label:k.$t("project.activity.add"),onClick:f},null,8,["label"])])):i.createCommentVNode("",!0)])])}}});const fhe=i.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{var _;return(_=n.phases)==null?void 0:_.find(y=>y.id===n.phaseId)}),s=i.computed(()=>{var _;return(_=n.phases)==null?void 0:_.flatMap(y=>y.milestones)}),a=i.computed(()=>{var _;return(_=s.value)==null?void 0:_.find(y=>y.id===n.milestoneId)}),l=i.computed(()=>{var _;return(_=n.activities)==null?void 0:_.find(y=>y.id===n.activityId)}),c=_=>{o("update:activity",_)},u=_=>{o("addSubtask",_)},d=_=>{o("updateSubtask",_)},f=_=>{o("deleteSubtask",_)},p=_=>{o("addFiles",_)},h=_=>{o("removeFile",_)},m=_=>{o("addComment",_)},g=_=>{o("updateComment",_)},C=_=>{o("removeComment",_)};return(_,y)=>{var v,w;return l.value?(i.openBlock(),i.createBlock(Ju,{key:0,activity:l.value,"activity-types":t.activityTypes,"milestone-id":t.milestoneId,"template-activities":t.activities,"is-template":!1,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:`${(v=r.value)==null?void 0:v.name} / ${(w=a.value)==null?void 0:w.name}`,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:[t.project],"time-tracking-data":t.timeTrackingData,onClose:_.$router.back,"onUpdate:activity":c,onAddSubtask:u,onUpdateSubtask:d,onDeleteSubtask:f,onAddFiles:p,onRemoveFile:h,onAddComment:m,onUpdateComment:g,onRemoveComment:C},{default:i.withCtx(k=>[i.renderSlot(_.$slots,"default",i.normalizeProps(i.guardReactiveProps(k)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","onClose"])):i.createCommentVNode("",!0)}}}),phe={class:"ao-col-header"},hhe=i.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("header",phe,[i.createVNode(at,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(i.openBlock(),i.createBlock($i,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):i.createCommentVNode("",!0)]))}});function mhe(t){return i.getCurrentScope()?(i.onScopeDispose(t),!0):!1}function ka(t){return typeof t=="function"?t():i.unref(t)}const ghe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const vhe=t=>t!=null,Mi=()=>{};function yhe(t,e){function n(...o){return new Promise((r,s)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(s)})}return n}function _he(t,e={}){let n,o,r=Mi;const s=l=>{clearTimeout(l),r(),r=Mi};return l=>{const c=ka(t),u=ka(e.maxWait);return n&&s(n),c<=0||u!==void 0&&u<=0?(o&&(s(o),o=null),Promise.resolve(l())):new Promise((d,f)=>{r=e.rejectOnCancel?f:d,u&&!o&&(o=setTimeout(()=>{n&&s(n),o=null,d(l())},u)),n=setTimeout(()=>{o&&s(o),o=null,d(l())},c)})}}function Che(t,e=200,n={}){return yhe(_he(e,n),t)}function ic(t){var e;const n=ka(t);return(e=n==null?void 0:n.$el)!=null?e:n}const bhe=ghe?window:void 0;function khe(){const t=i.ref(!1),e=i.getCurrentInstance();return e&&i.onMounted(()=>{t.value=!0},e),t}function whe(t){const e=khe();return i.computed(()=>(e.value,!!t()))}function Ehe(t,e,n={}){const{root:o,rootMargin:r="0px",threshold:s=.1,window:a=bhe,immediate:l=!0}=n,c=whe(()=>a&&"IntersectionObserver"in a),u=i.computed(()=>{const m=ka(t);return(Array.isArray(m)?m:[m]).map(ic).filter(vhe)});let d=Mi;const f=i.ref(l),p=c.value?i.watch(()=>[u.value,ic(o),f.value],([m,g])=>{if(d(),!f.value||!m.length)return;const C=new IntersectionObserver(e,{root:ic(g),rootMargin:r,threshold:s});m.forEach(_=>_&&C.observe(_)),d=()=>{C.disconnect(),d=Mi}},{immediate:l,flush:"post"}):Mi,h=()=>{d(),p(),f.value=!1};return mhe(h),{isSupported:c,isActive:f,pause(){d(),f.value=!1},resume(){f.value=!0},stop:h}}const xhe={class:i.normalizeClass(["ao-list-kanban"])},She={class:"ao-list-kanban__header"},The={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},Ahe={key:1,class:"ao-list-kanban__end"},Nhe={key:0,class:"ao-list-kanban__no-more"},Dhe={key:1,class:"ao-list-kanban__divider"},Mhe={key:1,class:"ao-list-kanban__footer"},$he=i.defineComponent({__name:"AoListKanban",props:{list:{},status:{},users:{},userId:{},title:{},footerLabel:{},isLoading:{type:Boolean},hasMore:{type:Boolean},noMoreLabel:{},isEditable:{type:[Boolean,String]},tagType:{}},emits:["add","update:list","change:list","loadMore","selectActivity","archiveActivity","unarchiveActivity","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(!1),s=i.ref(null);Ehe(s,([{isIntersecting:f}])=>{r.value=f}),i.watch(r,f=>{f&&n.hasMore&&!n.isLoading&&o("loadMore")});const a=f=>{var p;return n.isEditable===!0?!0:n.userId&&n.isEditable==="only-own"?n.userId===((p=f.assignee)==null?void 0:p.id):!1},l=f=>{o("selectActivity",f)},c=f=>{o("updateActivity",f)},u=f=>{"added"in f?o("updateActivity",{id:f.added.element.id,statusId:n.status.id,rank:Ar(n.list,f.added.newIndex)}):"removed"in f||"moved"in f&&o("updateActivity",{id:f.moved.element.id,rank:Ar(n.list,f.moved.newIndex)})},d=i.ref(!1);return(f,p)=>(i.openBlock(),i.createElementBlock("div",xhe,[t.title||f.$slots.header?i.renderSlot(f.$slots,"header",{},()=>{var h;return[i.createElementVNode("div",She,[t.title?(i.openBlock(),i.createBlock(hhe,{key:0,title:t.title,level:3,items:(h=t.list)==null?void 0:h.length},null,8,["title","items"])):i.createCommentVNode("",!0)])]},void 0,0):i.createCommentVNode("",!0),i.createVNode(i.unref(mo),i.mergeProps({class:["ao-list-kanban__list",d.value?"ao-list-kanban__transition":void 0],list:t.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},f.$attrs,{draggable:".ao-list-draggable",disabled:!t.isEditable,"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"},onChange:u,onStart:p[1]||(p[1]=h=>d.value=!0),onEnd:p[2]||(p[2]=h=>d.value=!1)}),{item:i.withCtx(({element:h})=>{var m,g,C,_,y,v,w,k,b,S;return[i.createVNode(ad,{id:h.id,class:i.normalizeClass(a(h)?"ao-list-draggable":""),name:h.name,"project-name":(m=h.project)==null?void 0:m.name,"project-id":(g=h.project)==null?void 0:g.id,"project-color":(C=h.project)==null?void 0:C.color,"phase-name":(y=(_=h.milestone)==null?void 0:_.phase)==null?void 0:y.name,"milestone-name":(v=h.milestone)==null?void 0:v.name,"milestone-color":(w=h.milestone)==null?void 0:w.color,deadline:h.deadline,rules:((k=h.rules)==null?void 0:k.length)||0,tasks:h.tasks,description:h.description,important:h.important,type:h.type,comments:(b=h.comments)==null?void 0:b.length,attachments:(S=h.attachments)==null?void 0:S.length,users:t.users,assignee:h.assignee,slug:h.slug,"is-editable":a(h),"is-private":h.private,"tag-type":t.tagType,onUpdateActivity:[T=>a(h)&&c(T),()=>a(h)&&c],onClick:()=>l(h.id),onRemoveAssignee:()=>a(h)&&c({id:h.id,assigneeId:null}),onStartTimer:p[0]||(p[0]=T=>f.$emit("startTimer",T))},{secondary:i.withCtx(()=>[a(h)&&h.active?(i.openBlock(),i.createBlock(pe,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:f.$t("feed.activity.archive"),onClick:i.withModifiers(()=>f.$emit("archiveActivity",{id:h.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),a(h)&&!h.active?(i.openBlock(),i.createBlock(pe,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:f.$t("feed.activity.unarchive"),onClick:i.withModifiers(()=>f.$emit("unarchiveActivity",{id:h.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0)]),_:2},1032,["id","class","name","project-name","project-id","project-color","phase-name","milestone-name","milestone-color","deadline","rules","tasks","description","important","type","comments","attachments","users","assignee","slug","is-editable","is-private","tag-type","onUpdateActivity","onClick","onRemoveAssignee"])]}),footer:i.withCtx(()=>[t.isLoading?(i.openBlock(),i.createElementBlock("div",The,[i.createVNode(ke,{name:"Loading"})])):t.hasMore?(i.openBlock(),i.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:s,class:"ao-list-kanban__end"},null,512)):(i.openBlock(),i.createElementBlock("div",Ahe,[t.noMoreLabel?(i.openBlock(),i.createElementBlock("span",Nhe,i.toDisplayString(t.noMoreLabel),1)):t.isEditable?(i.openBlock(),i.createElementBlock("span",Dhe)):i.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),f.$slots.footer||t.footerLabel?(i.openBlock(),i.createElementBlock("div",Mhe,[i.renderSlot(f.$slots,"footer",{},()=>[t.isEditable?(i.openBlock(),i.createBlock(go,{key:0,"icon-name":"AddBoxOutlineRounded",label:t.footerLabel,onClick:p[3]||(p[3]=h=>f.$emit("add"))},null,8,["label"])):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]))}});const Bhe={class:"ao-field ao-search-field"},Ohe=["value","placeholder"],Lhe=i.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(t,{emit:e}){const n=t,o=e,r=async l=>{const u=l.target.value;o("update:modelValue",u,l)},s=Che(r,n.delay),a=l=>{o("clear",l)};return(l,c)=>(i.openBlock(),i.createElementBlock("div",Bhe,[i.createElementVNode("input",{value:t.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:t.placeholder,onInput:c[0]||(c[0]=(...u)=>i.unref(s)&&i.unref(s)(...u)),onKeypress:i.withKeys(r,["enter"])},null,40,Ohe),i.createVNode(ke,{name:"SearchRounded",class:i.normalizeClass(`ao-search-field__icon ao-search-field__action ${t.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),i.createVNode(pe,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:i.normalizeClass(`ao-search-field__button ao-search-field__action ${t.modelValue?"ao-search-field__action--visible":""}`),onClick:a},null,8,["class"])]))}});const Ihe={class:"ao-feed"},Phe={class:"ao-feed__filters"},Fhe={class:"ao-feed__body"},Fg=i.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},project:{},projects:{},filters:{},activityTypes:{},users:{},userId:{},initialActivityId:{},initialActivitySlug:{},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{}},emits:["change:activities","addActivity","update:filters","selectActivity","update:activity","archiveActivity","unarchiveActivity","update:searchText","clear:searchText","update:showsArchivedActivities","update:showsOnlyImportant","update:showsOnlyNonAssigned","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","toast","startTimer"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e;function s(z,H){r("toast",z,H)}const a=i.toRef(o,"activities"),l=async(z,H)=>{await r("selectActivity",z,H)},c=i.ref({}),u=i.ref(!1),d=i.ref(!1),f=i.computed(()=>o.project?"milestone":"project");i.watch([()=>o.statuses,()=>o.activities,()=>o.initialActivityId,()=>o.initialActivitySlug],async([z,H,ue,Q],[ie,U])=>{c.value=Object.fromEntries(z.map(ne=>[ne.id,H.filter(ge=>{var I;return((I=ge.status)==null?void 0:I.id)===ne.id})])),ue&&!u.value?(l(ue,null),u.value=!0):Q&&!u.value&&(l(null,Q),u.value=!0),d.value&&In(H,U)},{immediate:!0});const p=i.computed(()=>{var z;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((z=o.selectedActivity.milestone.phase)==null?void 0:z.name)??""} / ${o.selectedActivity.milestone.name??""}`}),h=z=>{var U,ne;const H=(U=o.activities)==null?void 0:U.at(-1),ue=H?it.LexoRank.parse(H.rank).genNext():it.LexoRank.middle(),Q=((ne=o.activities)==null?void 0:ne.length)??0,ie={name:n("activity.defaultName",{idx:Q+1}),rank:ue.format(),statusId:z.id};o.filters.assigneeId.length>0&&(ie.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(ie.projectId=o.filters.projectId[0]),o.filters.typeId.length>0&&(ie.typeId=o.filters.typeId[0]),d.value=!0,r("addActivity",ie)},m=(z,H)=>{d.value=!1,r("update:filters",{...o.filters,[z]:H})},g=i.computed(()=>o.project?[o.project]:o.projects??[]),C=i.computed(()=>g.value.map(z=>({value:z.id,label:z.name}))),_=i.computed(()=>{var z;return(z=o.activityTypes)==null?void 0:z.map(H=>({value:H.id,label:H.name}))}),y=i.computed(()=>o.users.map(z=>({value:z.id,label:`${z.firstName} ${z.lastName}`,avatar:z.avatarUrl}))),v=z=>{o.selectedActivity&&r("update:activity",z)},w=z=>{r("update:activity",z)},k=z=>{r("archiveActivity",z)},b=z=>{r("unarchiveActivity",z)},S=z=>{var H;r("startTimer",z),(H=window.parent)==null||H.postMessage({type:"startTimer",data:z},"*")},T=z=>{d.value=!1,r("update:searchText",z)},A=z=>{d.value=!1,r("clear:searchText",z)},x=z=>{o.selectedActivity&&r("addSubtask",z)},O=z=>{o.selectedActivity&&r("updateSubtask",z)},M=z=>{o.selectedActivity&&r("deleteSubtask",z)},$=z=>{r("addFiles",z)},B=z=>{r("removeFile",z)},P=z=>{o.selectedActivity&&r("addComment",{...z,activityId:o.selectedActivity.id})},F=z=>{const{id:H}=o.selectedActivity||{};H&&r("updateComment",z)},K=z=>{const{id:H}=o.selectedActivity||{};H&&r("removeComment",z)},V=Ki.useRouter(),N=i.ref("feed"),G=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return i.watch(N,z=>{z==="feed"?(V.push({name:je.feed}),console.log("Navigating to feed...")):z==="overview"?(V.push({name:je.project}),console.log("Navigating to feed...")):z==="mapping"&&(V.push({name:je.mapping}),console.log("Navigating to feed..."))}),(z,H)=>{var ue;return i.openBlock(),i.createElementBlock("div",Ihe,[i.createVNode(Qi,null,{primary:i.withCtx(()=>[i.createElementVNode("div",Phe,[i.createVNode(fs,{modelValue:N.value,"onUpdate:modelValue":H[0]||(H[0]=Q=>N.value=Q),tabs:G},null,8,["modelValue"]),i.createVNode(Lhe,{"model-value":t.searchText,placeholder:z.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":T,onClear:A},null,8,["model-value","placeholder"]),o.project?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Dt,{key:0,"model-value":t.filters[i.unref(No).project],mode:"tags",options:C.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:z.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":H[1]||(H[1]=Q=>m(i.unref(No).project,Q))},null,8,["model-value","options","placeholder"])),_.value?(i.openBlock(),i.createBlock(Dt,{key:1,"model-value":t.filters[i.unref(No).type],mode:"tags",options:_.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:z.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":H[2]||(H[2]=Q=>m(i.unref(No).type,Q))},null,8,["model-value","options","placeholder"])):i.createCommentVNode("",!0),y.value.length?(i.openBlock(),i.createBlock(Dt,{key:2,"model-value":t.filters[i.unref(No).assignee],mode:"tags",options:y.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:z.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":H[3]||(H[3]=Q=>m(i.unref(No).assignee,Q))},{tag:i.withCtx(({option:Q,handleTagRemove:ie})=>[i.createVNode(Un,{"user-name":Q.label,"avatar-url":Q.avatar,"is-closable":!0,onClose:U=>ie(Q,U)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):i.createCommentVNode("",!0)]),i.createVNode(pe,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":t.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:z.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":t.showsOnlyNonAssigned,onClick:H[4]||(H[4]=Q=>z.$emit("update:showsOnlyNonAssigned",!t.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),i.createVNode(pe,{class:"ao-feed__only-important",size:"sm","icon-name":t.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:z.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":t.showsOnlyImportant,onClick:H[5]||(H[5]=Q=>z.$emit("update:showsOnlyImportant",!t.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),i.createVNode(pe,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:z.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":t.showsArchivedActivities,onClick:H[6]||(H[6]=Q=>z.$emit("update:showsArchivedActivities",!t.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),i.createElementVNode("div",Fhe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.statuses,Q=>(i.openBlock(),i.createBlock($he,{key:Q.id,status:Q,list:c.value[Q.id],title:Q.name,"footer-label":z.$t("feed.activity.add"),users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"tag-type":f.value,onAdd:()=>h(Q),onSelectActivity:l,onArchiveActivity:k,onUnarchiveActivity:b,onUpdateActivity:w,onStartTimer:S},null,8,["status","list","title","footer-label","users","user-id","is-editable","tag-type","onAdd"]))),128))]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[t.selectedActivity?(i.openBlock(),i.createBlock(Ju,{key:0,activity:t.selectedActivity,"activity-types":t.activityTypes,"milestone-id":(ue=t.selectedActivity.milestone)==null?void 0:ue.id,"template-activities":a.value,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:p.value,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:g.value,"time-tracking-data":t.timeTrackingData,onClose:H[7]||(H[7]=()=>l(null,null)),"onUpdate:activity":v,onAddSubtask:x,onUpdateSubtask:O,onDeleteSubtask:M,onAddFiles:$,onRemoveFile:B,onAddComment:P,onUpdateComment:F,onRemoveComment:K,onToast:s},{default:i.withCtx(Q=>[i.renderSlot(z.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(Q)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data"])):i.createCommentVNode("",!0)]))])}}});const Vhe={class:"ao-project-mapping"},Rhe={class:"ao-project-mapping-mapping__body"},zhe={class:"ao-project-mapping-mapping__phases"},Uhe={key:0,class:"ao-project-mapping-mapping__image-wrapper"},qhe=["src","alt"],Hhe=i.defineComponent({__name:"AoMapping",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","copyPhaseToTemplate","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e,s=()=>{const{name:_,rank:y}=Uo(o.phases,"phase",n);r("addPhase",{name:_,rank:y,projectId:o.project.id})},a=_=>{r("updatePhase",_)},l=_=>{r("archivePhase",_)},c=_=>{r("unarchivePhase",_)},u=_=>{r("copyPhaseToTemplate",_)},d=i.ref(!1),f=i.ref(!1),p=(_,y)=>{r("applyTemplate",{templateId:_,projectId:y}),d.value=!1},h=(_,y)=>{var k;const v=(k=o.templates)==null?void 0:k.at(-1),w=v?it.LexoRank.parse(v.rank).genNext():it.LexoRank.middle();r("saveTemplate",{templateName:_,rank:w.format(),phaseIds:y}),f.value=!1},m=Ki.useRouter(),g=i.ref("mapping"),C=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return i.watch(g,_=>{_==="feed"?(m.push({name:je.feed}),console.log("Navigating to feed...")):_==="overview"?(m.push({name:je.project}),console.log("Navigating to feed...")):_==="mapping"&&(m.push({name:je.mapping}),console.log("Navigating to feed..."))}),(_,y)=>{var v;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-mapping-overview"},_.$attrs),[i.createElementVNode("div",Vhe,[i.createVNode(Qi,null,{primary:i.withCtx(()=>[i.createVNode(fs,{modelValue:g.value,"onUpdate:modelValue":y[0]||(y[0]=w=>g.value=w),tabs:C},null,8,["modelValue"]),i.createVNode(pe,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:_.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:y[1]||(y[1]=w=>_.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:i.withCtx(()=>[t.isEditable===!0?(i.openBlock(),i.createBlock(pe,{key:0,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:_.$t("project.template.save.label"),onClick:y[2]||(y[2]=w=>f.value=!0)},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(pe,{key:1,class:"ao-project-mapping-overview__add-template",color:"primary",label:_.$t("project.template.apply.label"),onClick:y[3]||(y[3]=w=>d.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",Rhe,[i.createElementVNode("div",zhe,[i.createVNode(sd,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"estimation-unit":(v=t.project)==null?void 0:v.estimationUnit,onAddPhase:s,onUpdatePhase:a,onArchivePhase:l,onUnarchivePhase:c,onCopyPhaseToTemplate:u},null,8,["phases","closed-status","is-editable","users","estimation-unit"])]),t.project.architectureImage?(i.openBlock(),i.createElementBlock("div",Uhe,[i.createElementVNode("img",{class:"architecture-image",src:t.project.architectureImage.url,alt:i.unref(n)("architectureImage.alt")},null,8,qhe)])):i.createCommentVNode("",!0)])])],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[f.value?(i.openBlock(),i.createBlock(Pg,{key:0,phases:t.phases,onClose:y[4]||(y[4]=w=>f.value=!1),onSave:h},null,8,["phases"])):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createBlock(Ig,{key:1,"project-id":t.project.id,templates:t.templates,onClose:y[5]||(y[5]=w=>d.value=!1),onApply:p},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const Po={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},jhe=(t,e={})=>[{path:t,name:Po.TEMPLATES,redirect:{name:Po.TEMPLATES_LIST},...e,children:[{path:"",name:Po.TEMPLATES_LIST,component:Vg},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:Po.TEMPLATE_DETAILS,component:Lg,props:!0}]}],je={project:"AoProject",feed:"AoProjectFeed",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},Whe=(t,e={})=>[{path:t,...e,redirect:{name:je.project},children:[{path:"",name:je.project,component:Npe,props:!0,children:[{path:":phaseId/:milestoneId",name:je.milestone,component:cp,props:!0},{path:":phaseId/:milestoneId/:activityId",name:je.activity,props:{default:!0,modal:!0},components:{default:cp,modal:fhe}}]},{path:"feed",name:je.feed,component:Fg,props:!0},{path:"mapping",name:je.mapping,component:Hhe,props:!0}]}],Zhe={class:"ao-templates"},Vg=i.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e;i.watch(()=>o.templates,(u,d)=>{In(u,d)});const s=()=>{var h,m;const u=(h=o.templates)==null?void 0:h.at(-1),d=u?it.LexoRank.parse(u.rank).genNext():it.LexoRank.middle(),f=((m=o.templates)==null?void 0:m.length)??0,p={name:n("template.defaultName.template",{idx:f+1}),rank:d.format()};r("addTemplate",p)},a=(u,d)=>{r("updateItem",{itemType:Be.TEMPLATES,id:u,templateId:u,data:{name:d}})},l=(u,d)=>{r("removeItem",{itemType:Be.TEMPLATES,templateId:u,data:{id:u,...d?{name:d}:{}}})},c=u=>{if(u.moved){const d=Xi(u,o.templates??[]);r("updateItem",{itemType:Be.TEMPLATES,id:u.moved.element.id,templateId:u.moved.element.id,data:{rank:d}})}};return(u,d)=>(i.openBlock(),i.createElementBlock("div",Zhe,[i.createVNode(Qi,null,{secondary:i.withCtx(()=>[i.createVNode(pe,{label:u.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:s},null,8,["label"])]),_:1}),i.createVNode(i.unref(mo),{"model-value":t.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:c},{item:i.withCtx(({element:f})=>{var p;return[i.createVNode(P_,{id:f.id,title:f.name,phases:f.phases,milestones:(p=f.phases)!=null&&p.length?i.unref(a_)(f.phases):0,activities:f.phases?i.unref(l_)(f.phases):0,"updated-at":f.updatedAt,"updated-by":f.updatedBy,onUpdateTitle:h=>a(f.id,h),onClick:h=>u.$router.push({name:i.unref(Po).TEMPLATE_DETAILS,params:{templateId:f.id}}),onDeleteItem:d[0]||(d[0]=(h,m)=>l(h,m))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}});const Khe={class:"ao-field__label"},Rg=i.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[i.createElementVNode("span",Khe,i.toDisplayString(t.label),1),i.renderSlot(e.$slots,"default")],2))}}),Ghe=["type","value","disabled","readonly"],Yhe=i.defineComponent({__name:"AoInputField",props:{label:{default:""},type:{default:"text"},modelValue:{default:""},modelModifiers:{default:()=>({})},isDisabled:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.modelModifiers.lazy?"change":"input"),s=a=>{n.modelModifiers.number&&(a=Number(a)),o("update:modelValue",a)};return(a,l)=>(i.openBlock(),i.createBlock(Rg,{label:t.label},{default:i.withCtx(()=>[i.createElementVNode("input",i.mergeProps({class:"ao-field__input",type:t.type,value:t.modelValue,disabled:t.isDisabled,readonly:t.isReadonly},{[i.toHandlerKey(r.value)]:l[0]||(l[0]=c=>s(c.target.value))}),null,16,Ghe)]),_:1},8,["label"]))}}),Jhe={class:"ao-field"},Xhe={class:"ao-field__label"},Qhe=["checked","disabled"],eme=i.defineComponent({__name:"AoCheckboxField",props:{label:{default:""},modelValue:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("label",Jhe,[i.createElementVNode("span",Xhe,i.toDisplayString(t.label),1),i.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:n[0]||(n[0]=o=>{var r;return e.$emit("update:modelValue",((r=o.target)==null?void 0:r.checked)??!1)})},null,40,Qhe)]))}});exports.AoAvatar=Un;exports.AoCardFeed=ad;exports.AoCheckboxField=eme;exports.AoColorPicker=dl;exports.AoFeed=Fg;exports.AoField=Rg;exports.AoInputField=Yhe;exports.AoMultiselect=Dt;exports.AoProjectPhases=sd;exports.AoTabBar=fs;exports.AoTemplateDetails=Lg;exports.AoTemplates=Gg;exports.AoTemplatesList=Vg;exports.EstimationUnit=gp;exports.TemplateItemTypeEnum=mp;exports.activityFeedStatus=_y;exports.durationTypes=yy;exports.feedFilterTypes=No;exports.getProjectOverviewRoutes=Whe;exports.getTemplateRoutes=jhe;exports.listUpdateTypes=Cy;exports.milestoneStatus=Bi;exports.projectOverviewRoutes=je;exports.ruleComparators=fp;exports.ruleDurationUnits=hp;exports.ruleTriggerTypes=pp;exports.templateItemType=Be;exports.templateRouteNames=Po;
|
|
58
|
+
*/function Ao(t){let e={r:0,g:0,b:0,a:1};/#/.test(t)?e=tfe(t):/rgb/.test(t)?e=lp(t):typeof t=="string"?e=lp(`rgba(${t})`):Object.prototype.toString.call(t)==="[object Object]"&&(e=t);const{r:n,g:o,b:r,a:s}=e,{h:a,s:l,v:c}=nfe(e);return{r:n,g:o,b:r,a:s===void 0?1:s,h:a,s:l,v:c}}function Xu(t){const e=document.createElement("canvas"),n=e.getContext("2d"),o=t*2;return e.width=o,e.height=o,n.fillStyle="#ffffff",n.fillRect(0,0,o,o),n.fillStyle="#ccd5db",n.fillRect(0,0,t,t),n.fillRect(t,t,t,t),e}function jc(t,e,n,o,r,s){const a=t==="l",l=e.createLinearGradient(0,0,a?n:0,a?0:o);l.addColorStop(.01,r),l.addColorStop(.99,s),e.fillStyle=l,e.fillRect(0,0,n,o)}function efe({r:t,g:e,b:n},o){const r=a=>("0"+Number(a).toString(16)).slice(-2),s=`#${r(t)}${r(e)}${r(n)}`;return o?s.toUpperCase():s}function tfe(t){t=t.slice(1);const e=n=>parseInt(n,16)||0;return{r:e(t.slice(0,2)),g:e(t.slice(2,4)),b:e(t.slice(4,6))}}function lp(t){return typeof t=="string"?(t=(/rgba?\((.*?)\)/.exec(t)||["","0,0,0,1"])[1].split(","),{r:Number(t[0])||0,g:Number(t[1])||0,b:Number(t[2])||0,a:Number(t[3]?t[3]:1)}):t}function nfe({r:t,g:e,b:n}){t=t/255,e=e/255,n=n/255;const o=Math.max(t,e,n),r=Math.min(t,e,n),s=o-r;let a=0;o===r?a=0:o===t?e>=n?a=60*(e-n)/s:a=60*(e-n)/s+360:o===e?a=60*(n-t)/s+120:o===n&&(a=60*(t-e)/s+240),a=Math.floor(a);let l=parseFloat((o===0?0:1-r/o).toFixed(2)),c=parseFloat(o.toFixed(2));return{h:a,s:l,v:c}}var Qu=i.defineComponent({props:{color:{type:String,default:"#000000"},hsv:{type:Object,default:null},size:{type:Number,default:152}},emits:["selectSaturation"],data(){return{slideSaturationStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasSaturation,e=this.size,n=t.getContext("2d");t.width=e,t.height=e,n.fillStyle=this.color,n.fillRect(0,0,e,e),jc("l",n,e,e,"#FFFFFF","rgba(255,255,255,0)"),jc("p",n,e,e,"rgba(0,0,0,0)","#000000")},renderSlide(){this.slideSaturationStyle={left:this.hsv.s*this.size-5+"px",top:(1-this.hsv.v)*this.size-5+"px"}},selectSaturation(t){const{top:e,left:n}=this.$el.getBoundingClientRect(),o=t.target.getContext("2d"),r=a=>{let l=a.clientX-n,c=a.clientY-e;l<0&&(l=0),c<0&&(c=0),l>this.size&&(l=this.size),c>this.size&&(c=this.size),this.slideSaturationStyle={left:l-5+"px",top:c-5+"px"};const u=o.getImageData(Math.min(l,this.size-1),Math.min(c,this.size-1),1,1),[d,f,p]=u.data;this.$emit("selectSaturation",{r:d,g:f,b:p})};r(t);const s=()=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",s)}}});const ofe={ref:"canvasSaturation"};function rfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"saturation",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectSaturation&&t.selectSaturation(...a),["prevent","stop"]))},[i.createVNode("canvas",ofe,null,512),i.createVNode("div",{style:t.slideSaturationStyle,class:"slide"},null,4)],32)}Qu.render=rfe;Qu.__file="src/color/Saturation.vue";var ed=i.defineComponent({props:{hsv:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectHue"],data(){return{slideHueStyle:{}}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasHue,e=this.width,n=this.height,o=t.getContext("2d");t.width=e,t.height=n;const r=o.createLinearGradient(0,0,0,n);r.addColorStop(0,"#FF0000"),r.addColorStop(.17*1,"#FF00FF"),r.addColorStop(.17*2,"#0000FF"),r.addColorStop(.17*3,"#00FFFF"),r.addColorStop(.17*4,"#00FF00"),r.addColorStop(.17*5,"#FFFF00"),r.addColorStop(1,"#FF0000"),o.fillStyle=r,o.fillRect(0,0,e,n)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(t){const{top:e}=this.$el.getBoundingClientRect(),n=t.target.getContext("2d"),o=s=>{let a=s.clientY-e;a<0&&(a=0),a>this.height&&(a=this.height),this.slideHueStyle={top:a-2+"px"};const l=n.getImageData(0,Math.min(a,this.height-1),1,1),[c,u,d]=l.data;this.$emit("selectHue",{r:c,g:u,b:d})};o(t);const r=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}}});const ife={ref:"canvasHue"};function sfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"hue",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectHue&&t.selectHue(...a),["prevent","stop"]))},[i.createVNode("canvas",ife,null,512),i.createVNode("div",{style:t.slideHueStyle,class:"slide"},null,4)],32)}ed.render=sfe;ed.__file="src/color/Hue.vue";var td=i.defineComponent({props:{color:{type:String,default:"#000000"},rgba:{type:Object,default:null},width:{type:Number,default:15},height:{type:Number,default:152}},emits:["selectAlpha"],data(){return{slideAlphaStyle:{},alphaSize:5}},watch:{color(){this.renderColor()},"rgba.a"(){this.renderSlide()}},mounted(){this.renderColor(),this.renderSlide()},methods:{renderColor(){const t=this.$refs.canvasAlpha,e=this.width,n=this.height,o=this.alphaSize,r=Xu(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),jc("p",s,e,n,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(t){const{top:e}=this.$el.getBoundingClientRect(),n=r=>{let s=r.clientY-e;s<0&&(s=0),s>this.height&&(s=this.height);let a=parseFloat((s/this.height).toFixed(2));this.$emit("selectAlpha",a)};n(t);const o=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",o)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",o)}}});const afe={ref:"canvasAlpha"};function lfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",{class:"color-alpha",onMousedown:e[1]||(e[1]=i.withModifiers((...a)=>t.selectAlpha&&t.selectAlpha(...a),["prevent","stop"]))},[i.createVNode("canvas",afe,null,512),i.createVNode("div",{style:t.slideAlphaStyle,class:"slide"},null,4)],32)}td.render=lfe;td.__file="src/color/Alpha.vue";var nd=i.defineComponent({props:{color:{type:String,default:"#000000"},width:{type:Number,default:100},height:{type:Number,default:30}},data(){return{alphaSize:5}},watch:{color(){this.renderColor()}},mounted(){this.renderColor()},methods:{renderColor(){const t=this.$el,e=this.width,n=this.height,o=this.alphaSize,r=Xu(o),s=t.getContext("2d");t.width=e,t.height=n,s.fillStyle=s.createPattern(r,"repeat"),s.fillRect(0,0,e,n),s.fillStyle=this.color,s.fillRect(0,0,e,n)}}});function cfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("canvas")}nd.render=cfe;nd.__file="src/color/Preview.vue";var od=i.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(t){this.isSucking=!1,this.suckColor(t)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(t){t.keyCode===27&&(this.isOpenSucker=!1,this.isSucking=!1,this.$emit("openSucker",!1),document.removeEventListener("keydown",this.keydownHandler),document.removeEventListener("mousemove",this.mousemoveHandler),document.removeEventListener("mouseup",this.mousemoveHandler),this.suckerPreview&&(document.body.removeChild(this.suckerPreview),this.suckerPreview=null))},mousemoveHandler(t){const{clientX:e,clientY:n}=t,{top:o,left:r,width:s,height:a}=this.suckerCanvas.getBoundingClientRect(),l=e-r,c=n-o,d=this.suckerCanvas.getContext("2d").getImageData(Math.min(l,s-1),Math.min(c,a-1),1,1);let[f,p,h,m]=d.data;m=parseFloat((m/255).toFixed(2));const g=this.suckerPreview.style;Object.assign(g,{position:"absolute",left:e+20+"px",top:n-36+"px",width:"24px",height:"24px",borderRadius:"50%",border:"2px solid #fff",boxShadow:"0 0 8px 0 rgba(0, 0, 0, 0.16)",background:`rgba(${f}, ${p}, ${h}, ${m})`,zIndex:95}),this.suckerArea.length&&e>=this.suckerArea[0]&&n>=this.suckerArea[1]&&e<=this.suckerArea[2]&&n<=this.suckerArea[3]?g.display="":g.display="none"},suckColor(t){t&&t.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),t.addEventListener("click",e=>{const{clientX:n,clientY:o}=e,{top:r,left:s,width:a,height:l}=t.getBoundingClientRect(),c=n-s,u=o-r,f=t.getContext("2d").getImageData(Math.min(c,a-1),Math.min(u,l-1),1,1);let[p,h,m,g]=f.data;g=parseFloat((g/255).toFixed(2)),this.$emit("selectSucker",{r:p,g:h,b:m,a:g})}))}}});const ufe=i.createVNode("path",{d:"M13.1,8.2l5.6,5.6c0.4,0.4,0.5,1.1,0.1,1.5s-1.1,0.5-1.5,0.1c0,0-0.1,0-0.1-0.1l-1.4-1.4l-7.7,7.7C7.9,21.9,7.6,22,7.3,22H3.1C2.5,22,2,21.5,2,20.9l0,0v-4.2c0-0.3,0.1-0.6,0.3-0.8l5.8-5.8C8.5,9.7,9.2,9.6,9.7,10s0.5,1.1,0.1,1.5c0,0,0,0.1-0.1,0.1l-5.5,5.5v2.7h2.7l7.4-7.4L8.7,6.8c-0.5-0.4-0.5-1-0.1-1.5s1.1-0.5,1.5-0.1c0,0,0.1,0,0.1,0.1l1.4,1.4l3.5-3.5c1.6-1.6,4.1-1.6,5.8-0.1c1.6,1.6,1.6,4.1,0.1,5.8L20.9,9l-3.6,3.6c-0.4,0.4-1.1,0.5-1.5,0.1"},null,-1),dfe={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},ffe=i.createVNode("g",{fill:"none","fill-rule":"evenodd"},[i.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[i.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),i.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[i.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function pfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",null,[t.isSucking?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createBlock("svg",{key:0,class:[{active:t.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:e[1]||(e[1]=(...a)=>t.openSucker&&t.openSucker(...a))},[ufe],2)),t.isSucking?(i.openBlock(),i.createBlock("svg",dfe,[ffe])):i.createCommentVNode("v-if",!0)])}od.render=pfe;od.__file="src/color/Sucker.vue";var rd=i.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(t,{emit:e}){return{modelColor:i.computed({get(){return t.color||""},set(s){e("inputColor",s)}}),handleFocus:s=>{e("inputFocus",s)},handleBlur:s=>{e("inputBlur",s)}}}});const hfe={class:"color-type"},mfe={class:"name"};function gfe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",hfe,[i.createVNode("span",mfe,i.toDisplayString(t.name),1),i.withDirectives(i.createVNode("input",{"onUpdate:modelValue":e[1]||(e[1]=a=>t.modelColor=a),class:"value",onFocus:e[2]||(e[2]=(...a)=>t.handleFocus&&t.handleFocus(...a)),onBlur:e[3]||(e[3]=(...a)=>t.handleBlur&&t.handleBlur(...a))},null,544),[[i.vModelText,t.modelColor]])])}rd.render=gfe;rd.__file="src/color/Box.vue";var id=i.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(t,{emit:e}){const n=i.ref(),o=i.ref([]),r=i.ref();t.colorsHistoryKey&&localStorage&&(o.value=JSON.parse(localStorage.getItem(t.colorsHistoryKey))||[]),r.value=Xu(4).toDataURL(),i.onUnmounted(()=>{s(n.value)});function s(l){if(!l)return;const c=o.value||[],u=c.indexOf(l);u>=0&&c.splice(u,1),c.length>=8&&(c.length=7),c.unshift(l),o.value=c||[],localStorage&&t.colorsHistoryKey&&localStorage.setItem(t.colorsHistoryKey,JSON.stringify(c))}function a(l){e("selectColor",l)}return{setColorsHistory:s,colorsHistory:o,color:n,imgAlphaBase64:r,selectColor:a}}});const vfe={class:"colors"},yfe={key:0,class:"colors history"};function _fe(t,e,n,o,r,s){return i.openBlock(),i.createBlock("div",null,[i.createVNode("ul",vfe,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(t.colorsDefault,a=>(i.openBlock(),i.createBlock("li",{key:a,class:"item",onClick:l=>t.selectColor(a)},[i.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),i.createVNode("div",{style:{background:a},class:"color"},null,4)],8,["onClick"]))),128))]),t.colorsHistory.length?(i.openBlock(),i.createBlock("ul",yfe,[(i.openBlock(!0),i.createBlock(i.Fragment,null,i.renderList(t.colorsHistory,a=>(i.openBlock(),i.createBlock("li",{key:a,class:"item",onClick:l=>t.selectColor(a)},[i.createVNode("div",{style:{background:`url(${t.imgAlphaBase64})`},class:"alpha"},null,4),i.createVNode("div",{style:{background:a},class:"color"},null,4)],8,["onClick"]))),128))])):i.createCommentVNode("v-if",!0)])}id.render=_fe;id.__file="src/color/Colors.vue";var Tr=i.defineComponent({components:{Saturation:Qu,Hue:ed,Alpha:td,Preview:nd,Sucker:od,Box:rd,Colors:id},emits:["changeColor","openSucker","inputFocus","inputBlur"],props:{color:{type:String,default:"#000000"},theme:{type:String,default:"dark"},suckerHide:{type:Boolean,default:!0},suckerCanvas:{type:null,default:null},suckerArea:{type:Array,default:()=>[]},colorsDefault:{type:Array,default:()=>["#000000","#FFFFFF","#FF1900","#F47365","#FFB243","#FFE623","#6EFF2A","#1BC7B1","#00BEFF","#2E81FF","#5D61FF","#FF89CF","#FC3CAD","#BF3DCE","#8E00A7","rgba(0,0,0,0)"]},colorsHistoryKey:{type:String,default:"vue-colorpicker-history"}},data(){return{hueWidth:15,hueHeight:152,previewHeight:30,modelRgba:"",modelHex:"",r:0,g:0,b:0,a:1,h:0,s:0,v:0}},computed:{isLightTheme(){return this.theme==="light"},totalWidth(){return this.hueHeight+(this.hueWidth+8)*2},previewWidth(){return this.totalWidth-(this.suckerHide?0:this.previewHeight)},rgba(){return{r:this.r,g:this.g,b:this.b,a:this.a}},hsv(){return{h:this.h,s:this.s,v:this.v}},rgbString(){return`rgb(${this.r}, ${this.g}, ${this.b})`},rgbaStringShort(){return`${this.r}, ${this.g}, ${this.b}, ${this.a}`},rgbaString(){return`rgba(${this.rgbaStringShort})`},hexString(){return efe(this.rgba,!0)}},created(){Object.assign(this,Ao(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(t){const{r:e,g:n,b:o,h:r,s,v:a}=Ao(t);Object.assign(this,{r:e,g:n,b:o,h:r,s,v:a}),this.setText()},handleFocus(t){this.$emit("inputFocus",t)},handleBlur(t){this.$emit("inputBlur",t)},selectHue(t){const{r:e,g:n,b:o,h:r,s,v:a}=Ao(t);Object.assign(this,{r:e,g:n,b:o,h:r,s,v:a}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(t){this.a=t,this.setText()},inputHex(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.modelHex=t,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.modelHex=this.hexString,this.modelRgba=t,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(t){this.$emit("openSucker",t)},selectSucker(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(t){const{r:e,g:n,b:o,a:r,h:s,s:a,v:l}=Ao(t);Object.assign(this,{r:e,g:n,b:o,a:r,h:s,s:a,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const Cfe={class:"color-set"};function bfe(t,e,n,o,r,s){const a=i.resolveComponent("Saturation"),l=i.resolveComponent("Hue"),c=i.resolveComponent("Alpha"),u=i.resolveComponent("Preview"),d=i.resolveComponent("Sucker"),f=i.resolveComponent("Box"),p=i.resolveComponent("Colors");return i.openBlock(),i.createBlock("div",{class:["hu-color-picker",{light:t.isLightTheme}],style:{width:t.totalWidth+"px"}},[i.createVNode("div",Cfe,[i.createVNode(a,{ref:"saturation",color:t.rgbString,hsv:t.hsv,size:t.hueHeight,onSelectSaturation:t.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),i.createVNode(l,{ref:"hue",hsv:t.hsv,width:t.hueWidth,height:t.hueHeight,onSelectHue:t.selectHue},null,8,["hsv","width","height","onSelectHue"]),i.createVNode(c,{ref:"alpha",color:t.rgbString,rgba:t.rgba,width:t.hueWidth,height:t.hueHeight,onSelectAlpha:t.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),i.createVNode("div",{style:{height:t.previewHeight+"px"},class:"color-show"},[i.createVNode(u,{color:t.rgbaString,width:t.previewWidth,height:t.previewHeight},null,8,["color","width","height"]),t.suckerHide?i.createCommentVNode("v-if",!0):(i.openBlock(),i.createBlock(d,{key:0,"sucker-canvas":t.suckerCanvas,"sucker-area":t.suckerArea,onOpenSucker:t.openSucker,onSelectSucker:t.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),i.createVNode(f,{name:"HEX",color:t.modelHex,onInputColor:t.inputHex,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),i.createVNode(f,{name:"RGBA",color:t.modelRgba,onInputColor:t.inputRgba,onInputFocus:t.handleFocus,onInputBlur:t.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),i.createVNode(p,{color:t.rgbaString,"colors-default":t.colorsDefault,"colors-history-key":t.colorsHistoryKey,onSelectColor:t.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),i.createCommentVNode(" custom options "),i.renderSlot(t.$slots,"default")],6)}Tr.render=bfe;Tr.__file="src/color/ColorPicker.vue";Tr.install=t=>{t.component(Tr.name,Tr)};const kfe={class:"color-picker-wrapper"},dl=i.defineComponent({__name:"AoColorPicker",props:{color:{}},emits:["update:color"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(!1),s=i.ref(null),a=i.ref(null),l=i.ref(0),c=i.ref(0),u=async m=>{a.value=m,r.value=!0,await i.nextTick();const g=m.getBoundingClientRect(),C=s.value,_=(C==null?void 0:C.offsetHeight)||300,y=window.innerHeight-g.bottom,v=g.top,w=y<_&&v>_;console.log("pickerHeight = "+_),l.value=w?g.top-_-8:g.bottom+8,c.value=g.left,setTimeout(()=>{window.addEventListener("click",f)},0)},d=i.computed(()=>({position:"fixed",top:`${l.value}px`,left:`${c.value}px`,zIndex:1e3})),f=m=>{const g=m.target;s.value&&!s.value.contains(g)&&(r.value=!1,o("update:color",p.value),window.removeEventListener("click",f))};i.onBeforeUnmount(()=>{window.removeEventListener("click",f)}),i.watch(()=>n.color,m=>{r.value||(p.value=m)});const p=i.ref(n.color),h=m=>{const{r:g,g:C,b:_,a:y}=m.rgba;p.value=`rgba(${g}, ${C}, ${_}, ${y})`};return(m,g)=>(i.openBlock(),i.createElementBlock("div",kfe,[i.renderSlot(m.$slots,"clickable",{openPicker:u,bgColor:t.color}),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"pickerRef",ref:s,class:"color-picker",style:i.normalizeStyle(d.value)},[i.createVNode(i.unref(Tr),{class:"color-picker-box",theme:"light",color:t.color,onChangeColor:h},null,8,["color"])],4)):i.createCommentVNode("",!0)]))}});const wfe={class:"ao-card-project-phase__header"},Efe={class:"ao-card-project-item__title-line"},xfe={key:0,class:"ao-card-project-item-phase__estimation"},Sfe={class:"ao-card-project-phase__footer"},Tfe={key:0,class:"ao-card-project-phase__footer-row ao-card-project-phase__footer-row--progress"},Afe={class:"ao-card-project-phase__subitem"},Nfe={class:"ao-card-project-phase__subitem"},Dfe={key:0,class:"ao-card-project-phase__secondary"},Mfe={class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--readonly"},$fe=i.defineComponent({__name:"AoCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","unarchivePhase","updatePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},s=i.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((C,_)=>{var y;return C+((y=_.activities)==null?void 0:y.reduce((v,w)=>v+(w.estimation||0),0))},0))||0}),a=i.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,C)=>{var _;return g+(((_=C.activities)==null?void 0:_.reduce((y,v)=>{var k;const w=(k=n.timeTrackingData)==null?void 0:k[v.id];return y+((w==null?void 0:w.timeSpent)||0)},0))||0)},0)),l=i.computed(()=>n.estimationUnit==="days"?"d":"h"),c=i.computed(()=>Aa(a.value,n.estimationUnit)),u=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),d=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(C=>C.status===Bi.done).length}),f=i.computed(()=>(d.value||0)/(u.value||1)),p=i.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),h=i.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),m=(g,C)=>{const _=g.target;_.closest("button")||_.closest("input")||_.closest(".ao-title")||C(_)};return(g,C)=>(i.openBlock(),i.createBlock(dl,{color:h.value,"onUpdate:color":C[2]||(C[2]=_=>h.value=_)},{clickable:i.withCtx(({openPicker:_,bgColor:y})=>[i.createVNode(cl,{class:"ao-card-project-phase","is-clickable":t.isEditable,color:y,"with-left-border":!0,onClick:v=>m(v,_)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",Efe,[i.createVNode(at,{id:t.id,class:"ao-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),s.value||a.value?(i.openBlock(),i.createElementBlock("span",xfe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",Sfe,[u.value?(i.openBlock(),i.createElementBlock("div",Tfe,[i.createElementVNode("div",Afe,[i.createVNode(ke,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",Nfe,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(ul,{percentages:f.value,class:"ao-card-project-phase__progress",color:t.color},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",Dfe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ao-card-project-phase__footer-row",p.value?"":"ao-card-project-phase__no_deadline"])},[t.isEditable?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,"onUpdate:modelValue":C[1]||(C[1]=v=>p.value=v),class:"ao-card-project-phase__deadline ao-card-project-phase__deadline--input",type:"date"},null,512)),[[i.vModelText,p.value,void 0,{lazy:!0}]]):i.createCommentVNode("",!0),i.createElementVNode("span",Mfe,i.toDisplayString(i.unref(Na)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",wfe,[i.createVNode(pe,{class:"ao-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:C[0]||(C[0]=i.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const Bfe=i.defineComponent({__name:"AoBadge",props:{color:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",{class:"aoBadge",style:i.normalizeStyle({backgroundColor:t.color})},null,4))}});const Ofe={class:"ao-card-project-milestone__default"},Lfe={class:"ao-title-with-badge-wrapper"},Ife={class:"ao-card-project-item__title-line"},Pfe={key:0,class:"ao-card-project-item-milestone__estimation"},Ffe={key:0,class:"ao-card-project-milestone__archive"},Vfe={class:"ao-card-project-milestone__activities"},Rfe={class:"ao-card-project-milestone__activities-row"},zfe={class:"ao-card-project-milestone__subitem"},Ufe={class:"ao-card-project-milestone__subitem"},qfe={key:1,class:"ao-card-project-milestone__secondary"},Hfe={class:"ao-card-project-milestone__footer"},jfe={key:1,class:"ao-field ao-card-project-milestone__deadline"},Wfe={class:"ao-field__label"},Zfe={key:2,class:"ao-card-project-milestone__assignee"},Kfe=i.defineComponent({__name:"AoCardProjectItemMilestone",props:{id:{},name:{},color:{},phaseColor:{},activities:{},closedStatus:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},isSelected:{type:Boolean},assignee:{},important:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["updateMilestone","archiveMilestone","unarchiveMilestone"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{var p;return((p=n.activities)==null?void 0:p.reduce((h,m)=>h+(m.estimation||0),0))||0}),s=i.computed(()=>!n.activities||!n.timeTrackingData?0:n.activities.reduce((p,h)=>{var g;const m=(g=n.timeTrackingData)==null?void 0:g[h.id];return p+((m==null?void 0:m.timeSpent)||0)},0)),a=i.computed(()=>n.estimationUnit==="days"?"d":"h"),l=i.computed(()=>Aa(s.value,n.estimationUnit));i.computed(()=>{const p=s.value/60;return p%1===0?p.toString():p.toFixed(2)});const c=i.computed(()=>{var p;return(p=n.activities)==null?void 0:p.length}),u=i.computed(()=>{var p;return(p=n.activities)==null?void 0:p.filter(h=>Kc(h,n.closedStatus)).length}),d=i.computed(()=>(u.value||0)/(c.value||1)),f=p=>{o("updateMilestone",{id:n.id,name:p})};return(p,h)=>(i.openBlock(),i.createBlock(cl,{class:i.normalizeClass(["ao-card-project-milestone"]),"is-clickable":!t.readonly,"tag-name":"li","is-selected":t.isSelected,color:t.phaseColor},{default:i.withCtx(()=>[i.createElementVNode("div",Ofe,[i.createElementVNode("div",Lfe,[i.createVNode(Bfe,{color:t.color||""},null,8,["color"]),i.createElementVNode("div",Ife,[i.createVNode(at,{id:t.id,title:t.name||"",level:5,"is-editable":!t.readonly&&t.isEditable,class:"ao-card-project-milestone__title","onUpdate:title":f},null,8,["id","title","is-editable"]),r.value||s.value?(i.openBlock(),i.createElementBlock("span",Pfe," ("+i.toDisplayString(l.value)+"/"+i.toDisplayString(r.value)+i.toDisplayString(a.value)+")",1)):i.createCommentVNode("",!0)])]),!t.readonly&&t.isEditable?(i.openBlock(),i.createElementBlock("div",Ffe,[i.createVNode(pe,{color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?p.$t("archive"):p.$t("unarchive"),onClick:h[0]||(h[0]=i.withModifiers(()=>t.active?p.$emit("archiveMilestone",{id:t.id}):p.$emit("unarchiveMilestone",{id:t.id}),["stop"]))},null,8,["label"])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",Vfe,[i.createElementVNode("div",Rfe,[c.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",zfe,[i.createVNode(ke,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",Ufe,i.toDisplayString(u.value)+" / "+i.toDisplayString(c.value),1)]),i.createVNode(ul,{percentages:d.value,color:t.phaseColor,class:"ao-card-project-milestone__progress"},null,8,["percentages","color"])],64)):i.createCommentVNode("",!0),p.$slots.secondary?(i.openBlock(),i.createElementBlock("div",qfe,[i.renderSlot(p.$slots,"secondary")])):i.createCommentVNode("",!0)])])]),footer:i.withCtx(()=>[i.createElementVNode("div",Hfe,[t.important?(i.openBlock(),i.createBlock(ke,{key:0,name:"FlagRounded",class:i.normalizeClass(t.isSelected?"ao-card-project-milestone__important--selected":"ao-card-project-milestone__important"),size:"sm"},null,8,["class"])):i.createCommentVNode("",!0),t.deadline?(i.openBlock(),i.createElementBlock("label",jfe,[i.createElementVNode("span",Wfe,i.toDisplayString(i.unref(Na)(t.deadline)),1)])):i.createCommentVNode("",!0),t.assignee?(i.openBlock(),i.createElementBlock("div",Zfe,[i.createVNode(Un,{"user-name":i.unref(Mp)(t.assignee),"avatar-url":t.assignee.avatarUrl,color:t.isSelected?"black":"primary",size:"sm"},null,8,["user-name","avatar-url","color"])])):i.createCommentVNode("",!0)])]),_:3},8,["is-clickable","is-selected","color"]))}});const Gfe={class:"ao-mapping-card-project-phase__header"},Yfe={class:"ao-card-project-item__title-line"},Jfe={key:0,class:"ao-card-project-item-phase__estimation"},Xfe={class:"ao-mapping-card-project-phase__footer"},Qfe={key:0,class:"ao-mapping-card-project-phase__footer-row ao-mapping-card-project-phase__footer-row--progress"},epe={class:"ao-mapping-card-project-phase__subitem"},tpe={class:"ao-mapping-card-project-phase__subitem"},npe={key:0,class:"ao-mapping-card-project-phase__secondary"},ope={class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--readonly"},rpe=i.defineComponent({__name:"AoCondensedCardProjectItemPhase",props:{id:{},projectName:{},name:{},milestones:{},isEditable:{type:Boolean},deadline:{},active:{type:Boolean},color:{},timeTrackingData:{},estimationUnit:{}},emits:["update:title","update:deadline","archivePhase","updatePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e,r=g=>{o("update:title",g)},s=i.computed(()=>{var g;return((g=n.milestones)==null?void 0:g.reduce((C,_)=>{var y;return C+((y=_.activities)==null?void 0:y.reduce((v,w)=>v+(w.estimation||0),0))},0))||0}),a=i.computed(()=>!n.milestones||!n.timeTrackingData?0:n.milestones.reduce((g,C)=>{var _;return g+(((_=C.activities)==null?void 0:_.reduce((y,v)=>{var k;const w=(k=n.timeTrackingData)==null?void 0:k[v.id];return y+((w==null?void 0:w.timeSpent)||0)},0))||0)},0)),l=i.computed(()=>n.estimationUnit==="days"?"d":"h"),c=i.computed(()=>Aa(a.value,n.estimationUnit)),u=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.length}),d=i.computed(()=>{var g;return(g=n.milestones)==null?void 0:g.filter(C=>C.status===Bi.done).length}),f=i.computed(()=>(d.value||0)/(u.value||1)),p=i.computed({get:()=>n.deadline??"",set:g=>o("update:deadline",g!=null&&g.length?g:null)}),h=i.computed({get:()=>n.color,set:g=>{o("updatePhase",{id:n.id,color:g})}}),m=(g,C)=>{const _=g.target;_.closest("button")||_.closest("input")||_.closest(".ao-title")||C()};return(g,C)=>(i.openBlock(),i.createBlock(dl,{color:h.value,"onUpdate:color":C[2]||(C[2]=_=>h.value=_)},{clickable:i.withCtx(({openPicker:_,bgColor:y})=>[i.createVNode(cl,{class:"ao-mapping-card-project-phase","is-clickable":t.isEditable,color:y,"with-left-border":!0,onClick:v=>m(v,_)},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",Yfe,[i.createVNode(at,{id:t.id,class:"ao-mapping-card-project-phase__title",title:t.name||"",level:4,"is-editable":t.isEditable,"onUpdate:title":r},null,8,["id","title","is-editable"]),s.value||a.value?(i.openBlock(),i.createElementBlock("span",Jfe," ("+i.toDisplayString(c.value)+"/"+i.toDisplayString(s.value)+i.toDisplayString(l.value)+")",1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",Xfe,[u.value?(i.openBlock(),i.createElementBlock("div",Qfe,[i.createElementVNode("div",epe,[i.createVNode(ke,{name:"MountainFlagOutlineRounded",size:"sm"}),i.createElementVNode("span",tpe,i.toDisplayString(d.value)+" / "+i.toDisplayString(u.value),1)]),i.createVNode(ul,{percentages:f.value,class:"ao-mapping-card-project-phase__progress",color:h.value},null,8,["percentages","color"]),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",npe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ao-mapping-card-project-phase__footer-row",p.value?"":"ao-mapping-card-project-phase__no_deadline"])},[t.isEditable?i.withDirectives((i.openBlock(),i.createElementBlock("input",{key:0,"onUpdate:modelValue":C[1]||(C[1]=v=>p.value=v),class:"ao-mapping-card-project-phase__deadline ao-mapping-card-project-phase__deadline--input",type:"date"},null,512)),[[i.vModelText,p.value,void 0,{lazy:!0}]]):i.createCommentVNode("",!0),i.createElementVNode("span",ope,i.toDisplayString(i.unref(Na)(t.deadline)),1)],2)])]),_:2},[t.isEditable?{name:"header",fn:i.withCtx(()=>[i.createElementVNode("div",Gfe,[i.createVNode(pe,{class:"ao-mapping-card-project-phase__archive",color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:t.active?g.$t("archive"):g.$t("unarchive"),onClick:C[0]||(C[0]=i.withModifiers(()=>t.active?g.$emit("archivePhase",{id:t.id}):g.$emit("unarchivePhase",{id:t.id}),["stop"]))},null,8,["label"])])]),key:"0"}:void 0]),1032,["is-clickable","color","onClick"])]),_:3},8,["color"]))}});const ipe={class:"ao-project-phase"},spe={key:0,class:"ao-project-phase__drag ao-card__drag"},ape={key:1,class:"ao-project-phase__col-phase"},lpe={key:2,class:"ao-mapping-project-phase__col-phase"},cpe={key:0,class:"ao-project-phase__col-milestones"},upe={class:"ao-project-phase__milestones-list-footer"},dpe=i.defineComponent({__name:"AoProjectPhase",props:{phase:{},closedStatus:{},users:{},isEditable:{type:Boolean},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e;i.watch(()=>o.phase.milestones,(v,w)=>{In(v,w)});const s=v=>{r("updatePhase",{id:o.phase.id,name:v})},a=v=>{r("updatePhase",{id:o.phase.id,deadline:v})},l=v=>{r("updatePhase",v)},c=i.computed(()=>o.phase.milestones.map(v=>d_(v,o.closedStatus))),u=v=>{const{name:w,rank:k}=Uo(c.value??[],"milestone",n);r("addMilestone",{name:w,rank:k,phaseId:v})},d=v=>{r("updateMilestone",v)},f=v=>{r("archiveMilestone",v)},p=v=>{r("unarchiveMilestone",v)},h=v=>{r("archivePhase",v)},m=v=>{r("unarchivePhase",v)},g=v=>{"added"in v?r("updateMilestone",{id:v.added.element.id,phaseId:o.phase.id,rank:Ar(c.value,v.added.newIndex)}):"removed"in v||"moved"in v&&r("updateMilestone",{id:v.moved.element.id,rank:Ar(c.value,v.moved.newIndex)})},C=Ki.useRoute(),_=i.computed(()=>C.path.includes("/mapping")),y=i.computed(()=>{var v;return o.phase.id!==((v=C.params)==null?void 0:v.phaseId)?{backgroundColor:"var(--ao-color-sheet)"}:o.phase.color?{backgroundColor:p_(o.phase.color)}:{backgroundColor:"var(--ao-color-primary-lightest)"}});return(v,w)=>(i.openBlock(),i.createElementBlock("li",ipe,[i.createElementVNode("div",{class:"ao-project-phases__draggable-card",style:i.normalizeStyle(y.value)},[t.isEditable?(i.openBlock(),i.createElementBlock("div",spe,[i.createVNode(ke,{name:"DragIndicator",class:"ao-project-phase__drag-handle"})])):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createElementBlock("div",lpe,[i.createVNode(rpe,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"estimation-unit":t.estimationUnit,"onUpdate:deadline":a,"onUpdate:title":s,onArchivePhase:h,onUnarchivePhase:m,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","estimation-unit"])])):(i.openBlock(),i.createElementBlock("div",ape,[i.createVNode($fe,{id:t.phase.id,milestones:c.value,name:t.phase.name,deadline:t.phase.deadline,active:t.phase.active,"is-editable":t.isEditable,color:t.phase.color,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,"onUpdate:deadline":a,"onUpdate:title":s,onArchivePhase:h,onUnarchivePhase:m,onUpdatePhase:l},null,8,["id","milestones","name","deadline","active","is-editable","color","time-tracking-data","estimation-unit"])]))],4),_.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",cpe,[i.createElementVNode("div",{class:"ao-project-phase__milestones",style:i.normalizeStyle(y.value)},[i.createVNode(i.unref(mo),i.mergeProps({class:"ao-project-phase__milestones-list",list:c.value,disabled:t.readonly||!t.isEditable,"item-key":"id",group:"kanban"},v.$attrs,{onChange:g}),{item:i.withCtx(({element:k})=>{var b;return[i.createVNode(Kfe,{id:k.id,name:k.name,color:k.color,"phase-color":t.phase.color,activities:k.activities,deadline:k.deadline,active:k.active,"is-editable":!t.readonly&&t.isEditable,"is-draggable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,"is-selected":k.id===((b=v.$route.params)==null?void 0:b.milestoneId),assignee:k.assignee,important:k.important,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,class:i.normalizeClass(["ao-project-phase__milestone"]),onClick:S=>!t.readonly&&v.$router.push({name:i.unref(je).milestone,params:{phaseId:t.phase.id,milestoneId:k.id}}),onUpdateMilestone:d,onArchiveMilestone:f,onUnarchiveMilestone:p},null,8,["id","name","color","phase-color","activities","deadline","active","is-editable","is-draggable","closed-status","is-selected","assignee","important","readonly","time-tracking-data","estimation-unit","onClick"])]}),_:1},16,["list","disabled"]),i.createElementVNode("div",upe,[t.isEditable?(i.openBlock(),i.createBlock(go,{key:0,label:v.$t("project.milestone.add"),class:"ao-project-phase__milestone-add","icon-name":"Add",onClick:w[0]||(w[0]=()=>u(t.phase.id))},null,8,["label"])):i.createCommentVNode("",!0)])],4)]))]))}});const fpe={class:"ao-project__phases"},ppe={key:0,class:"ao-project-phase__phases-list-footer"},hpe={class:"ao-project-phase__col-phase"},sd=i.defineComponent({__name:"AoProjectPhases",props:{phases:{},closedStatus:{},isEditable:{type:Boolean},users:{},readonly:{type:Boolean},timeTrackingData:{},estimationUnit:{}},emits:["addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addPhase","updatePhase","archivePhase","unarchivePhase"],setup(t,{emit:e}){const n=t,o=e;i.watch(()=>n.phases,(h,m)=>{In(h,m)});const r=h=>{o("addMilestone",h)},s=h=>{o("updateMilestone",h)},a=h=>{o("archiveMilestone",h)},l=h=>{o("unarchiveMilestone",h)},c=h=>{o("archivePhase",h)},u=h=>{o("unarchivePhase",h)},d=h=>{if(h.moved){const m=Xi(h,n.phases??[]);o("updatePhase",{id:h.moved.element.id,rank:m})}},f=h=>{o("updatePhase",h)},p=h=>{o("addPhase",h)};return(h,m)=>(i.openBlock(),i.createElementBlock("div",fpe,[i.createVNode(i.unref(mo),{class:"ao-project-phase__phases-list","model-value":t.phases,"item-key":"id",handle:".ao-card__drag",onChange:d},{item:i.withCtx(({element:g})=>[i.createVNode(dpe,{phase:g,"is-editable":!t.readonly&&t.isEditable,"closed-status":t.closedStatus,users:t.users,readonly:t.readonly,"time-tracking-data":t.timeTrackingData,"estimation-unit":t.estimationUnit,onAddMilestone:r,onUpdateMilestone:s,onArchiveMilestone:a,onUnarchiveMilestone:l,onUpdatePhase:f,onArchivePhase:c,onUnarchivePhase:u},null,8,["phase","is-editable","closed-status","users","readonly","time-tracking-data","estimation-unit"])]),_:1},8,["model-value"]),t.isEditable?(i.openBlock(),i.createElementBlock("div",ppe,[m[0]||(m[0]=i.createElementVNode("div",{class:"ao-project-phase__empty_drag"},null,-1)),i.createElementVNode("div",hpe,[i.createVNode(go,{label:h.$t("project.phases.add"),"icon-name":"Add",class:"ao-project-phase__add-phase",onClick:p},null,8,["label"])]),m[1]||(m[1]=i.createElementVNode("div",{class:"ao-project-phase__col-milestones"},null,-1))])):i.createCommentVNode("",!0)]))}});const mpe={class:"ao-add-template-modal__form-body"},gpe={class:"field__row"},vpe={class:"ao-add-template-modal__form-footer"},Ig=i.defineComponent({__name:"AoAddTemplateModal",props:{projectId:{},templates:{}},emits:["apply"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.templates.map(c=>({value:c.id,label:c.name}))),s=i.ref(null),a=c=>{s.value=c},l=()=>{s.value&&o("apply",s.value,n.projectId)};return(c,u)=>(i.openBlock(),i.createBlock(Da,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(at,{title:c.$t("project.template.apply.title"),level:3},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("form",{class:"ao-add-template-modal__form",onSubmit:i.withModifiers(l,["prevent"])},[i.createElementVNode("p",null,i.toDisplayString(c.$t("project.template.apply.notice")),1),i.createElementVNode("div",mpe,[i.createElementVNode("div",gpe,[i.createVNode(Dt,{value:s.value,options:r.value,detached:!0,onChange:a},null,8,["value","options"])])]),i.createElementVNode("footer",vpe,[i.createVNode(pe,{label:c.$t("project.template.apply.label"),type:"submit",color:"primary",variant:"solid",onClick:l},null,8,["label"])])],32)]),_:1}))}});const ype={class:"ao-save-template-modal__form-body"},_pe={class:"field__row"},Cpe={class:"ao-field ao-field--inline"},bpe={class:"ao-field__label"},kpe={class:"ao-save-template-modal__phases"},wpe={class:"ao-field__label"},Epe={class:"ao-save-template-modal__phases-list"},xpe=["value"],Spe={class:"ao-save-template-modal__form-footer"},Pg=i.defineComponent({__name:"AoSaveTemplateModal",props:{phases:{}},emits:["save"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(""),s=i.ref([]);i.onMounted(()=>{s.value=n.phases.map(l=>l.id)});const a=()=>{r.value&&o("save",r.value,s.value)};return(l,c)=>(i.openBlock(),i.createBlock(Da,{size:"sm"},{header:i.withCtx(()=>[i.createVNode(at,{title:l.$t("project.template.save.title"),level:3},null,8,["title"])]),default:i.withCtx(()=>[i.createElementVNode("form",{class:"ao-save-template-modal__form",onSubmit:i.withModifiers(a,["prevent"])},[i.createElementVNode("div",ype,[i.createElementVNode("div",_pe,[i.createElementVNode("label",Cpe,[i.createElementVNode("span",bpe,i.toDisplayString(l.$t("project.template.name.label"))+": ",1),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>r.value=u),type:"text"},null,512),[[i.vModelText,r.value]])])]),i.createElementVNode("div",kpe,[i.createElementVNode("div",wpe,i.toDisplayString(l.$t("project.template.phases.label")),1),i.createElementVNode("div",Epe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.phases,u=>(i.openBlock(),i.createElementBlock("label",{key:u.id,class:"ao-field ao-field--checkbox"},[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":c[1]||(c[1]=d=>s.value=d),type:"checkbox",value:u.id},null,8,xpe),[[i.vModelCheckbox,s.value]]),i.createElementVNode("span",null,i.toDisplayString(u.name),1)]))),128))])])]),i.createElementVNode("footer",Spe,[i.createVNode(pe,{label:l.$t("project.template.save.label"),type:"submit",color:"primary",variant:"solid",onClick:a},null,8,["label"])])],32)]),_:1}))}});const Tpe={class:"ao-project"},Ape={class:"ao-project__body"},Npe=i.defineComponent({__name:"AoProjectOverviewProject",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","addMilestone","updateMilestone","archiveMilestone","unarchiveMilestone","addActivity","update:activity","archiveActivity","copyPhaseToTemplate","unarchiveActivity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e,s=i.computed(()=>o.phases.flatMap(N=>N.milestones)),a=()=>{const{name:N,rank:G}=Uo(o.phases,"phase",n);r("addPhase",{name:N,rank:G,projectId:o.project.id})},l=N=>{r("updatePhase",N)},c=N=>{r("archivePhase",N)},u=N=>{r("unarchivePhase",N)},d=N=>{r("copyPhaseToTemplate",N)},f=N=>{r("addMilestone",N)},p=N=>{r("updateMilestone",N)},h=N=>{r("archiveMilestone",N)},m=N=>{r("unarchiveMilestone",N)},g=N=>{r("addActivity",N)},C=N=>{r("update:activity",N)},_=N=>{r("archiveActivity",N)},y=N=>{r("unarchiveActivity",N)},v=N=>{r("addSubtask",N)},w=N=>{r("updateSubtask",N)},k=N=>{r("deleteSubtask",N)},b=i.computed(()=>s.value.flatMap(N=>N.activities)),S=N=>{r("addFiles",N)},T=N=>{r("removeFile",N)},A=N=>{r("addComment",N)},x=N=>{r("updateComment",N)},O=N=>{r("removeComment",N)},M=i.ref(!1),$=i.ref(!1),B=(N,G)=>{r("applyTemplate",{templateId:N,projectId:G}),M.value=!1},P=(N,G)=>{var ue;const z=(ue=o.templates)==null?void 0:ue.at(-1),H=z?it.LexoRank.parse(z.rank).genNext():it.LexoRank.middle();r("saveTemplate",{templateName:N,rank:H.format(),phaseIds:G}),$.value=!1},F=Ki.useRouter(),K=i.ref("overview"),V=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return i.watch(K,N=>{N==="feed"?(F.push({name:je.feed}),console.log("Navigating to feed...")):N==="overview"?(F.push({name:je.project}),console.log("Navigating to feed...")):N==="mapping"&&(F.push({name:je.mapping}),console.log("Navigating to feed..."))}),(N,G)=>{var H;const z=i.resolveComponent("RouterView");return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-overview"},N.$attrs),[i.createElementVNode("div",Tpe,[i.createVNode(Qi,null,{primary:i.withCtx(()=>[i.createVNode(fs,{modelValue:K.value,"onUpdate:modelValue":G[0]||(G[0]=ue=>K.value=ue),tabs:V},null,8,["modelValue"]),i.createVNode(pe,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:N.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:G[1]||(G[1]=ue=>N.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:i.withCtx(()=>[t.isEditable===!0?(i.openBlock(),i.createBlock(pe,{key:0,class:"ao-project-overview__save-as-template",color:"primary",label:N.$t("project.template.save.label"),onClick:G[2]||(G[2]=ue=>$.value=!0)},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(pe,{key:1,class:"ao-project-overview__add-template",color:"primary",label:N.$t("project.template.apply.label"),onClick:G[3]||(G[3]=ue=>M.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",Ape,[i.createVNode(sd,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"time-tracking-data":t.timeTrackingData,"estimation-unit":(H=t.project)==null?void 0:H.estimationUnit,onAddMilestone:f,onUpdateMilestone:p,onArchiveMilestone:h,onUnarchiveMilestone:m,onAddPhase:a,onUpdatePhase:l,onArchivePhase:c,onUnarchivePhase:u,onCopyPhaseToTemplate:d},null,8,["phases","closed-status","is-editable","users","time-tracking-data","estimation-unit"])])]),i.createVNode(z,{class:"ao-project__sidebar",phases:t.phases,"project-id":t.project.id,"project-name":t.project.name,users:t.users,"is-editable":t.isEditable===!0,"closed-status":t.closedStatus,"time-tracking-data":t.timeTrackingData,onClose:G[4]||(G[4]=ue=>N.$router.push({name:i.unref(je).project})),onUpdateMilestone:p,onAddActivity:g,onUpdateActivity:C,onArchiveActivity:_,onUnarchiveActivity:y},null,8,["phases","project-id","project-name","users","is-editable","closed-status","time-tracking-data"]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(z,{name:"modal",activities:b.value,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,"activity-types":t.activityTypes,phases:t.phases,project:t.project,users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,"time-tracking-data":t.timeTrackingData,"onUpdate:activity":C,onAddSubtask:v,onUpdateSubtask:w,onDeleteSubtask:k,onAddFiles:S,onRemoveFile:T,onAddComment:A,onUpdateComment:x,onRemoveComment:O},{default:i.withCtx(({Component:ue})=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(ue),null,{default:i.withCtx(Q=>[i.renderSlot(N.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(Q)))]),_:3}))]),_:3},8,["activities","is-task-checkable","statuses","activity-types","phases","project","users","user-id","is-editable","attachment-enabled","time-tracking-data"])]))],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[$.value?(i.openBlock(),i.createBlock(Pg,{key:0,phases:t.phases,onClose:G[5]||(G[5]=ue=>$.value=!1),onSave:P},null,8,["phases"])):i.createCommentVNode("",!0),M.value?(i.openBlock(),i.createBlock(Ig,{key:1,"project-id":t.project.id,templates:t.templates,onClose:G[6]||(G[6]=ue=>M.value=!1),onApply:B},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const Dpe={class:"ao-card-feed__header"},Mpe={key:1,class:"ao-card-feed__header-secondary ao-card-feed__header-icons"},$pe={key:2,class:"ao-card-feed__header-secondary ao-card-feed__secondary"},Bpe={class:"ao-card-feed__body"},Ope={key:0,class:"ao-card-feed__breadcrumbs"},Lpe={class:i.normalizeClass(["ao-card-feed__title-group"])},Ipe={class:"ao-card-feed__title-line"},Ppe={key:0,class:"ao-card-feed__slug"},Fpe={key:1,class:"ao-card-feed__deadline"},Vpe={class:"ao-card-feed__footer"},Rpe={class:"ao-card-feed__footer-row"},zpe={class:"ao-assignees"},Upe={key:0,class:"ao-assignee"},qpe={key:0,class:"ao-card-feed__subitems"},Hpe={key:0,class:"ao-card-feed__subitem"},jpe={class:"ao-card-feed__subitem"},Wpe={key:1,class:"ao-card-feed__subitem"},Zpe={class:"ao-card-feed__subitem"},Kpe={class:"ao-card-feed__timer-wrapper"},Gpe={class:"ao-card-feed__footer-row"},Ype={key:0,class:"ao-card-feed__progress-wrapper"},Jpe={class:"ao-card-feed__subitem"},Xpe={class:"ao-card-feed__subitem"},ad=i.defineComponent({__name:"AoCardFeed",props:{id:{},name:{},projectName:{},projectId:{},projectColor:{},phaseName:{},milestoneName:{},milestoneColor:{},deadline:{},important:{type:Boolean},assignee:{},slug:{},comments:{},attachments:{},tasks:{},isEditable:{type:Boolean},isPrivate:{type:Boolean},isClosed:{type:Boolean},tagType:{}},emits:["removeAssignee","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.tagType==="milestone"?n.milestoneName:n.projectName),s=i.computed(()=>n.tagType==="milestone"?n.milestoneColor:n.projectColor),a=g=>{o("updateActivity",{id:n.id,name:g})},l=i.computed(()=>n.tagType==="milestone"&&n.phaseName?`${n.phaseName}`:n.phaseName&&n.milestoneName?`${n.phaseName} / ${n.milestoneName}`:""),c=i.computed(()=>n.assignee?[n.assignee]:[]),u=i.computed(()=>Na(n.deadline)),d=g=>{o("removeAssignee",g)},f=()=>{o("startTimer",{activityId:n.id,name:n.name,project:n.projectName,projectId:n.projectId,slug:n.slug})},p=i.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.length}),h=i.computed(()=>{var g;return(g=n.tasks)==null?void 0:g.filter(C=>C.isDone).length}),m=i.computed(()=>(h.value||0)/(p.value||1));return(g,C)=>(i.openBlock(),i.createBlock(cl,{class:i.normalizeClass(["ao-card-feed",{"ao-card-feed--closed":t.isClosed}]),"is-clickable":!0},{header:i.withCtx(()=>[i.createElementVNode("div",Dpe,[r.value?(i.openBlock(),i.createBlock($i,{key:0,label:r.value,class:"ao-card-feed__project",variant:"solid",color:t.projectColor?void 0:"primary","raw-color":s.value},null,8,["label","color","raw-color"])):i.createCommentVNode("",!0),t.isPrivate||t.important||t.isClosed?(i.openBlock(),i.createElementBlock("div",Mpe,[t.isPrivate?(i.openBlock(),i.createBlock(ke,{key:0,name:"Lock",class:"ao-card-feed__warning",size:"sm"})):i.createCommentVNode("",!0),t.important?(i.openBlock(),i.createBlock(ke,{key:1,name:"FlagRounded",class:"ao-card-feed__important",size:"sm"})):i.createCommentVNode("",!0),t.isClosed?(i.openBlock(),i.createBlock(ke,{key:2,name:"CheckSmallRounded",class:"ao-card-feed__closed"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),g.$slots.secondary?(i.openBlock(),i.createElementBlock("div",$pe,[i.renderSlot(g.$slots,"secondary")])):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[i.createElementVNode("div",Bpe,[l.value?(i.openBlock(),i.createElementBlock("span",Ope,i.toDisplayString(l.value),1)):i.createCommentVNode("",!0),i.createElementVNode("div",Lpe,[i.createElementVNode("div",Ipe,[t.slug?(i.openBlock(),i.createElementBlock("span",Ppe,i.toDisplayString(t.slug)+": ",1)):i.createCommentVNode("",!0),i.createVNode(at,{id:t.id,title:t.name,level:5,"is-editable":t.isEditable,class:"ao-card-feed__title-inline","onUpdate:title":a},null,8,["id","title","is-editable"])])]),t.deadline?(i.openBlock(),i.createElementBlock("span",Fpe,i.toDisplayString(u.value),1)):i.createCommentVNode("",!0)])]),footer:i.withCtx(()=>[i.createElementVNode("div",Vpe,[i.createElementVNode("div",Rpe,[i.createElementVNode("ul",zpe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.value,_=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:_.id},[_?(i.openBlock(),i.createElementBlock("li",Upe,[i.createVNode(Un,{"user-name":i.unref(Mp)(_),"avatar-url":_.avatarUrl,"is-closable":!0,onClose:()=>d(_.id)},null,8,["user-name","avatar-url","onClose"])])):i.createCommentVNode("",!0)],64))),128))]),t.comments||t.attachments?(i.openBlock(),i.createElementBlock("ul",qpe,[t.comments?(i.openBlock(),i.createElementBlock("li",Hpe,[i.createVNode(ke,{name:"ChatOutline",size:"sm"}),i.createElementVNode("span",jpe,i.toDisplayString(t.comments),1)])):i.createCommentVNode("",!0),t.attachments?(i.openBlock(),i.createElementBlock("li",Wpe,[i.createVNode(ke,{name:"AttachFileRounded",size:"sm"}),i.createElementVNode("span",Zpe,i.toDisplayString(t.attachments),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",Kpe,[i.createVNode(ke,{name:"TimerOutline",class:"ao-card-feed__timer",size:"md",onClick:i.withModifiers(f,["stop"])})])]),i.createElementVNode("div",Gpe,[t.tasks&&t.tasks.length?(i.openBlock(),i.createElementBlock("div",Ype,[i.createElementVNode("div",Jpe,[i.createVNode(ke,{name:"SelectCheckBox",size:"sm"}),i.createElementVNode("span",Xpe,i.toDisplayString(h.value)+" / "+i.toDisplayString(p.value),1)]),i.createVNode(ul,{percentages:m.value,class:"ao-card-feed__progress"},null,8,["percentages"])])):i.createCommentVNode("",!0)])])]),_:3},8,["class"]))}});const Qpe={class:"ao-project-milestone"},ehe={class:"ao-project-milestone__header"},the={class:"ao-project-milestone__header_line"},nhe={class:"ao-project-milestone__header_line"},ohe={class:"ao-project-milestone__title"},rhe={key:0,class:"ao-fieldset ao-milestone__fieldset"},ihe={class:"ao-field__row ao-milestone__field-row"},she={class:"ao-field ao-field--inline"},ahe={class:"ao-field__row ao-milestone__field-row"},lhe={class:"ao-field ao-milestone__field-multiselect"},che=["onClick"],uhe={class:"ao-project-milestone__body"},dhe={key:0,class:"ao-project-milestone__footer"},cp=i.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{},timeTrackingData:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity","startTimer"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e,s=k=>{var b;r("startTimer",k),(b=window.parent)==null||b.postMessage({type:"startTimer",data:k},"*")},a=i.computed(()=>{var k;return(k=o.phases)==null?void 0:k.find(b=>b.id===o.phaseId)}),l=i.computed(()=>{var k;return(k=o.phases)==null?void 0:k.flatMap(b=>b.milestones)}),c=i.computed(()=>{var k;return(k=l.value)==null?void 0:k.find(b=>b.id===o.milestoneId)}),u=i.computed(()=>{var k;return(k=c.value)==null?void 0:k.activities});i.watch(u,(k,b)=>{In(k,b)});const d=k=>{r("close",k)},f=()=>{const{name:k,rank:b}=Uo(u.value??[],"activity",n);r("addActivity",{milestoneId:o.milestoneId,name:k,rank:b,projectId:o.projectId})},p=k=>{r("updateActivity",k)},h=k=>{u.value&&"moved"in k&&r("updateActivity",{id:k.moved.element.id,rank:Ar(u.value,k.moved.newIndex)})},m=i.computed({get:()=>{var k;return(k=c.value)==null?void 0:k.color},set:k=>{c.value&&r("updateMilestone",{id:c.value.id,color:k})}}),g=i.computed({get:()=>{var k;return((k=c==null?void 0:c.value)==null?void 0:k.deadline)??""},set:k=>{c.value&&r("updateMilestone",{id:c.value.id,deadline:k!=null&&k.length?k:null})}}),C=k=>o.closedStatus?Kc(k,o.closedStatus):!1,_=i.computed(()=>{var k;return((k=o.users)==null?void 0:k.map(b=>({label:`${b.firstName} ${b.lastName}`,value:b.id,avatar:b.avatarUrl})))||[]}),y=i.computed({get(){var k,b;return(b=(k=c.value)==null?void 0:k.assignee)!=null&&b.id?[c.value.assignee.id]:[]},set(k){r("updateMilestone",{id:o.milestoneId,assigneeId:k[0]??null})}}),v=i.computed({get(){var k;return((k=c.value)==null?void 0:k.important)??!1},set(k){r("updateMilestone",{id:o.milestoneId,important:k})}}),w=(k,b)=>{const S=k.currentTarget;S instanceof HTMLElement&&b(S)};return(k,b)=>{var S;return i.openBlock(),i.createElementBlock("div",Qpe,[i.createElementVNode("header",ehe,[i.createElementVNode("div",the,[i.createVNode(pe,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:d})]),i.createElementVNode("div",nhe,[i.createElementVNode("div",ohe,[i.createVNode(at,{title:((S=c.value)==null?void 0:S.name)||t.milestoneId,level:5},null,8,["title"]),i.createVNode(Og,{modelValue:v.value,"onUpdate:modelValue":b[0]||(b[0]=T=>v.value=T),modelModifiers:{lazy:!0},disabled:!t.isEditable,class:"ao-milestone__important",color:"danger",label:k.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),c.value?(i.openBlock(),i.createElementBlock("div",rhe,[i.createElementVNode("div",ihe,[i.createElementVNode("label",she,[i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":b[1]||(b[1]=T=>g.value=T),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[i.vModelText,g.value,void 0,{lazy:!0}]])])]),i.createElementVNode("div",ahe,[i.createElementVNode("label",lhe,[i.createVNode(Dt,{modelValue:y.value,"onUpdate:modelValue":b[2]||(b[2]=T=>y.value=T),options:_.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:k.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!t.isEditable,caret:t.isEditable},{tag:i.withCtx(({option:T,handleTagRemove:A})=>[i.createVNode(Un,{"user-name":T.label,"avatar-url":T.avatar,"is-closable":!0,onClose:x=>A(T,x)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),i.createVNode(dl,{color:m.value,"onUpdate:color":b[3]||(b[3]=T=>m.value=T)},{clickable:i.withCtx(({openPicker:T,bgColor:A})=>[i.createElementVNode("button",{style:i.normalizeStyle({background:A}),class:"color-button",onClick:x=>w(x,T)},null,12,che)]),_:1},8,["color"])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",uhe,[i.createVNode(i.unref(mo),i.mergeProps({class:"ao-project-milestone__activities",list:u.value,disabled:!t.isEditable,"item-key":"id",group:"kanban"},k.$attrs,{onChange:h}),{item:i.withCtx(({element:T})=>{var A,x,O,M,$;return[i.createVNode(ad,{id:T.id,name:T.name||T.id,"project-id":t.projectId,"phase-name":(A=a.value)==null?void 0:A.name,"milestone-name":(x=c.value)==null?void 0:x.name,"milestone-color":(O=c.value)==null?void 0:O.color,deadline:T.deadline,important:T.important,users:t.users,assignee:T.assignee,slug:T.slug,comments:(M=T.comments)==null?void 0:M.length,attachments:($=T.attachments)==null?void 0:$.length,tasks:T.tasks,"is-editable":t.isEditable,"is-private":T.private,"is-closed":C(T),onClick:B=>k.$router.push({name:i.unref(je).activity,params:{milestoneId:t.milestoneId,activityId:T.id}}),onUpdateActivity:p,onRemoveAssignee:()=>p({id:T.id,assigneeId:null}),onStartTimer:s},i.createSlots({_:2},[t.isEditable?{name:"secondary",fn:i.withCtx(()=>[t.isEditable&&T.active?(i.openBlock(),i.createBlock(pe,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:k.$t("archive"),onClick:i.withModifiers(()=>k.$emit("archiveActivity",{id:T.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),t.isEditable&&!T.active?(i.openBlock(),i.createBlock(pe,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:k.$t("feed.activity.unarchive"),onClick:i.withModifiers(()=>k.$emit("unarchiveActivity",{id:T.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["id","name","project-id","phase-name","milestone-name","milestone-color","deadline","important","users","assignee","slug","comments","attachments","tasks","is-editable","is-private","is-closed","onClick","onRemoveAssignee"])]}),_:1},16,["list","disabled"]),t.isEditable?(i.openBlock(),i.createElementBlock("div",dhe,[i.createVNode(go,{"icon-name":"Add",label:k.$t("project.activity.add"),onClick:f},null,8,["label"])])):i.createCommentVNode("",!0)])])}}});const fhe=i.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean},timeTrackingData:{}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>{var _;return(_=n.phases)==null?void 0:_.find(y=>y.id===n.phaseId)}),s=i.computed(()=>{var _;return(_=n.phases)==null?void 0:_.flatMap(y=>y.milestones)}),a=i.computed(()=>{var _;return(_=s.value)==null?void 0:_.find(y=>y.id===n.milestoneId)}),l=i.computed(()=>{var _;return(_=n.activities)==null?void 0:_.find(y=>y.id===n.activityId)}),c=_=>{o("update:activity",_)},u=_=>{o("addSubtask",_)},d=_=>{o("updateSubtask",_)},f=_=>{o("deleteSubtask",_)},p=_=>{o("addFiles",_)},h=_=>{o("removeFile",_)},m=_=>{o("addComment",_)},g=_=>{o("updateComment",_)},C=_=>{o("removeComment",_)};return(_,y)=>{var v,w;return l.value?(i.openBlock(),i.createBlock(Ju,{key:0,activity:l.value,"activity-types":t.activityTypes,"milestone-id":t.milestoneId,"template-activities":t.activities,"is-template":!1,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:`${(v=r.value)==null?void 0:v.name} / ${(w=a.value)==null?void 0:w.name}`,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:[t.project],"time-tracking-data":t.timeTrackingData,onClose:_.$router.back,"onUpdate:activity":c,onAddSubtask:u,onUpdateSubtask:d,onDeleteSubtask:f,onAddFiles:p,onRemoveFile:h,onAddComment:m,onUpdateComment:g,onRemoveComment:C},{default:i.withCtx(k=>[i.renderSlot(_.$slots,"default",i.normalizeProps(i.guardReactiveProps(k)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","onClose"])):i.createCommentVNode("",!0)}}}),phe={class:"ao-col-header"},hhe=i.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("header",phe,[i.createVNode(at,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(i.openBlock(),i.createBlock($i,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):i.createCommentVNode("",!0)]))}});function mhe(t){return i.getCurrentScope()?(i.onScopeDispose(t),!0):!1}function ka(t){return typeof t=="function"?t():i.unref(t)}const ghe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const vhe=t=>t!=null,Mi=()=>{};function yhe(t,e){function n(...o){return new Promise((r,s)=>{Promise.resolve(t(()=>e.apply(this,o),{fn:e,thisArg:this,args:o})).then(r).catch(s)})}return n}function _he(t,e={}){let n,o,r=Mi;const s=l=>{clearTimeout(l),r(),r=Mi};return l=>{const c=ka(t),u=ka(e.maxWait);return n&&s(n),c<=0||u!==void 0&&u<=0?(o&&(s(o),o=null),Promise.resolve(l())):new Promise((d,f)=>{r=e.rejectOnCancel?f:d,u&&!o&&(o=setTimeout(()=>{n&&s(n),o=null,d(l())},u)),n=setTimeout(()=>{o&&s(o),o=null,d(l())},c)})}}function Che(t,e=200,n={}){return yhe(_he(e,n),t)}function ic(t){var e;const n=ka(t);return(e=n==null?void 0:n.$el)!=null?e:n}const bhe=ghe?window:void 0;function khe(){const t=i.ref(!1),e=i.getCurrentInstance();return e&&i.onMounted(()=>{t.value=!0},e),t}function whe(t){const e=khe();return i.computed(()=>(e.value,!!t()))}function Ehe(t,e,n={}){const{root:o,rootMargin:r="0px",threshold:s=.1,window:a=bhe,immediate:l=!0}=n,c=whe(()=>a&&"IntersectionObserver"in a),u=i.computed(()=>{const m=ka(t);return(Array.isArray(m)?m:[m]).map(ic).filter(vhe)});let d=Mi;const f=i.ref(l),p=c.value?i.watch(()=>[u.value,ic(o),f.value],([m,g])=>{if(d(),!f.value||!m.length)return;const C=new IntersectionObserver(e,{root:ic(g),rootMargin:r,threshold:s});m.forEach(_=>_&&C.observe(_)),d=()=>{C.disconnect(),d=Mi}},{immediate:l,flush:"post"}):Mi,h=()=>{d(),p(),f.value=!1};return mhe(h),{isSupported:c,isActive:f,pause(){d(),f.value=!1},resume(){f.value=!0},stop:h}}const xhe={class:i.normalizeClass(["ao-list-kanban"])},She={class:"ao-list-kanban__header"},The={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},Ahe={key:1,class:"ao-list-kanban__end"},Nhe={key:0,class:"ao-list-kanban__no-more"},Dhe={key:1,class:"ao-list-kanban__divider"},Mhe={key:1,class:"ao-list-kanban__footer"},$he=i.defineComponent({__name:"AoListKanban",props:{list:{},status:{},users:{},userId:{},title:{},footerLabel:{},isLoading:{type:Boolean},hasMore:{type:Boolean},noMoreLabel:{},isEditable:{type:[Boolean,String]},tagType:{}},emits:["add","update:list","change:list","loadMore","selectActivity","archiveActivity","unarchiveActivity","updateActivity","startTimer"],setup(t,{emit:e}){const n=t,o=e,r=i.ref(!1),s=i.ref(null);Ehe(s,([{isIntersecting:f}])=>{r.value=f}),i.watch(r,f=>{f&&n.hasMore&&!n.isLoading&&o("loadMore")});const a=f=>{var p;return n.isEditable===!0?!0:n.userId&&n.isEditable==="only-own"?n.userId===((p=f.assignee)==null?void 0:p.id):!1},l=f=>{o("selectActivity",f)},c=f=>{o("updateActivity",f)},u=f=>{"added"in f?o("updateActivity",{id:f.added.element.id,statusId:n.status.id,rank:Ar(n.list,f.added.newIndex)}):"removed"in f||"moved"in f&&o("updateActivity",{id:f.moved.element.id,rank:Ar(n.list,f.moved.newIndex)})},d=i.ref(!1);return(f,p)=>(i.openBlock(),i.createElementBlock("div",xhe,[t.title||f.$slots.header?i.renderSlot(f.$slots,"header",{},()=>{var h;return[i.createElementVNode("div",She,[t.title?(i.openBlock(),i.createBlock(hhe,{key:0,title:t.title,level:3,items:(h=t.list)==null?void 0:h.length},null,8,["title","items"])):i.createCommentVNode("",!0)])]},void 0,0):i.createCommentVNode("",!0),i.createVNode(i.unref(mo),i.mergeProps({class:["ao-list-kanban__list",d.value?"ao-list-kanban__transition":void 0],list:t.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},f.$attrs,{draggable:".ao-list-draggable",disabled:!t.isEditable,"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"},onChange:u,onStart:p[1]||(p[1]=h=>d.value=!0),onEnd:p[2]||(p[2]=h=>d.value=!1)}),{item:i.withCtx(({element:h})=>{var m,g,C,_,y,v,w,k,b,S;return[i.createVNode(ad,{id:h.id,class:i.normalizeClass(a(h)?"ao-list-draggable":""),name:h.name,"project-name":(m=h.project)==null?void 0:m.name,"project-id":(g=h.project)==null?void 0:g.id,"project-color":(C=h.project)==null?void 0:C.color,"phase-name":(y=(_=h.milestone)==null?void 0:_.phase)==null?void 0:y.name,"milestone-name":(v=h.milestone)==null?void 0:v.name,"milestone-color":(w=h.milestone)==null?void 0:w.color,deadline:h.deadline,rules:((k=h.rules)==null?void 0:k.length)||0,tasks:h.tasks,description:h.description,important:h.important,type:h.type,comments:(b=h.comments)==null?void 0:b.length,attachments:(S=h.attachments)==null?void 0:S.length,users:t.users,assignee:h.assignee,slug:h.slug,"is-editable":a(h),"is-private":h.private,"tag-type":t.tagType,onUpdateActivity:[T=>a(h)&&c(T),()=>a(h)&&c],onClick:()=>l(h.id),onRemoveAssignee:()=>a(h)&&c({id:h.id,assigneeId:null}),onStartTimer:p[0]||(p[0]=T=>f.$emit("startTimer",T))},{secondary:i.withCtx(()=>[a(h)&&h.active?(i.openBlock(),i.createBlock(pe,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:f.$t("feed.activity.archive"),onClick:i.withModifiers(()=>f.$emit("archiveActivity",{id:h.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0),a(h)&&!h.active?(i.openBlock(),i.createBlock(pe,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:f.$t("feed.activity.unarchive"),onClick:i.withModifiers(()=>f.$emit("unarchiveActivity",{id:h.id}),["stop"])},null,8,["label","onClick"])):i.createCommentVNode("",!0)]),_:2},1032,["id","class","name","project-name","project-id","project-color","phase-name","milestone-name","milestone-color","deadline","rules","tasks","description","important","type","comments","attachments","users","assignee","slug","is-editable","is-private","tag-type","onUpdateActivity","onClick","onRemoveAssignee"])]}),footer:i.withCtx(()=>[t.isLoading?(i.openBlock(),i.createElementBlock("div",The,[i.createVNode(ke,{name:"Loading"})])):t.hasMore?(i.openBlock(),i.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:s,class:"ao-list-kanban__end"},null,512)):(i.openBlock(),i.createElementBlock("div",Ahe,[t.noMoreLabel?(i.openBlock(),i.createElementBlock("span",Nhe,i.toDisplayString(t.noMoreLabel),1)):t.isEditable?(i.openBlock(),i.createElementBlock("span",Dhe)):i.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),f.$slots.footer||t.footerLabel?(i.openBlock(),i.createElementBlock("div",Mhe,[i.renderSlot(f.$slots,"footer",{},()=>[t.isEditable?(i.openBlock(),i.createBlock(go,{key:0,"icon-name":"AddBoxOutlineRounded",label:t.footerLabel,onClick:p[3]||(p[3]=h=>f.$emit("add"))},null,8,["label"])):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]))}});const Bhe={class:"ao-field ao-search-field"},Ohe=["value","placeholder"],Lhe=i.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(t,{emit:e}){const n=t,o=e,r=async l=>{const u=l.target.value;o("update:modelValue",u,l)},s=Che(r,n.delay),a=l=>{o("clear",l)};return(l,c)=>(i.openBlock(),i.createElementBlock("div",Bhe,[i.createElementVNode("input",{value:t.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:t.placeholder,onInput:c[0]||(c[0]=(...u)=>i.unref(s)&&i.unref(s)(...u)),onKeypress:i.withKeys(r,["enter"])},null,40,Ohe),i.createVNode(ke,{name:"SearchRounded",class:i.normalizeClass(`ao-search-field__icon ao-search-field__action ${t.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),i.createVNode(pe,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:i.normalizeClass(`ao-search-field__button ao-search-field__action ${t.modelValue?"ao-search-field__action--visible":""}`),onClick:a},null,8,["class"])]))}});const Ihe={class:"ao-feed"},Phe={class:"ao-feed__filters"},Fhe={class:"ao-feed__body"},Fg=i.defineComponent({__name:"AoFeed",props:{activities:{},statuses:{},project:{},projects:{},filters:{},activityTypes:{},users:{},userId:{},initialActivityId:{},initialActivitySlug:{},searchText:{default:""},showsArchivedActivities:{type:Boolean},showsOnlyImportant:{type:Boolean},showsOnlyNonAssigned:{type:Boolean},selectedActivity:{},isTaskCheckable:{type:Function,default:void 0},isEditable:{type:[Boolean,String]},attachmentEnabled:{type:Boolean,default:!0},timeTrackingData:{},loadAttachmentPreview:{}},emits:["change:activities","addActivity","update:filters","selectActivity","update:activity","archiveActivity","unarchiveActivity","update:searchText","clear:searchText","update:showsArchivedActivities","update:showsOnlyImportant","update:showsOnlyNonAssigned","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","toast","startTimer"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e;function s(z,H){r("toast",z,H)}const a=i.toRef(o,"activities"),l=async(z,H)=>{await r("selectActivity",z,H)},c=i.ref({}),u=i.ref(!1),d=i.ref(!1),f=i.computed(()=>o.project?"milestone":"project");i.watch([()=>o.statuses,()=>o.activities,()=>o.initialActivityId,()=>o.initialActivitySlug],async([z,H,ue,Q],[ie,U])=>{c.value=Object.fromEntries(z.map(ne=>[ne.id,H.filter(ge=>{var I;return((I=ge.status)==null?void 0:I.id)===ne.id})])),ue&&!u.value?(l(ue,null),u.value=!0):Q&&!u.value&&(l(null,Q),u.value=!0),d.value&&In(H,U)},{immediate:!0});const p=i.computed(()=>{var z;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${((z=o.selectedActivity.milestone.phase)==null?void 0:z.name)??""} / ${o.selectedActivity.milestone.name??""}`}),h=z=>{var U,ne;const H=(U=o.activities)==null?void 0:U.at(-1),ue=H?it.LexoRank.parse(H.rank).genNext():it.LexoRank.middle(),Q=((ne=o.activities)==null?void 0:ne.length)??0,ie={name:n("activity.defaultName",{idx:Q+1}),rank:ue.format(),statusId:z.id};o.filters.assigneeId.length>0&&(ie.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(ie.projectId=o.filters.projectId[0]),o.filters.typeId.length>0&&(ie.typeId=o.filters.typeId[0]),d.value=!0,r("addActivity",ie)},m=(z,H)=>{d.value=!1,r("update:filters",{...o.filters,[z]:H})},g=i.computed(()=>o.project?[o.project]:o.projects??[]),C=i.computed(()=>g.value.map(z=>({value:z.id,label:z.name}))),_=i.computed(()=>{var z;return(z=o.activityTypes)==null?void 0:z.map(H=>({value:H.id,label:H.name}))}),y=i.computed(()=>o.users.map(z=>({value:z.id,label:`${z.firstName} ${z.lastName}`,avatar:z.avatarUrl}))),v=z=>{o.selectedActivity&&r("update:activity",z)},w=z=>{r("update:activity",z)},k=z=>{r("archiveActivity",z)},b=z=>{r("unarchiveActivity",z)},S=z=>{var H;r("startTimer",z),(H=window.parent)==null||H.postMessage({type:"startTimer",data:z},"*")},T=z=>{d.value=!1,r("update:searchText",z)},A=z=>{d.value=!1,r("clear:searchText",z)},x=z=>{o.selectedActivity&&r("addSubtask",z)},O=z=>{o.selectedActivity&&r("updateSubtask",z)},M=z=>{o.selectedActivity&&r("deleteSubtask",z)},$=z=>{r("addFiles",z)},B=z=>{r("removeFile",z)},P=z=>{o.selectedActivity&&r("addComment",{...z,activityId:o.selectedActivity.id})},F=z=>{const{id:H}=o.selectedActivity||{};H&&r("updateComment",z)},K=z=>{const{id:H}=o.selectedActivity||{};H&&r("removeComment",z)},V=Ki.useRouter(),N=i.ref("feed"),G=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return i.watch(N,z=>{z==="feed"?(V.push({name:je.feed}),console.log("Navigating to feed...")):z==="overview"?(V.push({name:je.project}),console.log("Navigating to feed...")):z==="mapping"&&(V.push({name:je.mapping}),console.log("Navigating to feed..."))}),(z,H)=>{var ue;return i.openBlock(),i.createElementBlock("div",Ihe,[i.createVNode(Qi,null,{primary:i.withCtx(()=>[i.createElementVNode("div",Phe,[i.createVNode(fs,{modelValue:N.value,"onUpdate:modelValue":H[0]||(H[0]=Q=>N.value=Q),tabs:G},null,8,["modelValue"]),i.createVNode(Lhe,{"model-value":t.searchText,placeholder:z.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":T,onClear:A},null,8,["model-value","placeholder"]),o.project?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Dt,{key:0,"model-value":t.filters[i.unref(No).project],mode:"tags",options:C.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:z.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":H[1]||(H[1]=Q=>m(i.unref(No).project,Q))},null,8,["model-value","options","placeholder"])),_.value?(i.openBlock(),i.createBlock(Dt,{key:1,"model-value":t.filters[i.unref(No).type],mode:"tags",options:_.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:z.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":H[2]||(H[2]=Q=>m(i.unref(No).type,Q))},null,8,["model-value","options","placeholder"])):i.createCommentVNode("",!0),y.value.length?(i.openBlock(),i.createBlock(Dt,{key:2,"model-value":t.filters[i.unref(No).assignee],mode:"tags",options:y.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:z.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":H[3]||(H[3]=Q=>m(i.unref(No).assignee,Q))},{tag:i.withCtx(({option:Q,handleTagRemove:ie})=>[i.createVNode(Un,{"user-name":Q.label,"avatar-url":Q.avatar,"is-closable":!0,onClose:U=>ie(Q,U)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):i.createCommentVNode("",!0)]),i.createVNode(pe,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":t.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:z.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":t.showsOnlyNonAssigned,onClick:H[4]||(H[4]=Q=>z.$emit("update:showsOnlyNonAssigned",!t.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),i.createVNode(pe,{class:"ao-feed__only-important",size:"sm","icon-name":t.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:z.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":t.showsOnlyImportant,onClick:H[5]||(H[5]=Q=>z.$emit("update:showsOnlyImportant",!t.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),i.createVNode(pe,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:z.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":t.showsArchivedActivities,onClick:H[6]||(H[6]=Q=>z.$emit("update:showsArchivedActivities",!t.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),i.createElementVNode("div",Fhe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.statuses,Q=>(i.openBlock(),i.createBlock($he,{key:Q.id,status:Q,list:c.value[Q.id],title:Q.name,"footer-label":z.$t("feed.activity.add"),users:t.users,"user-id":t.userId,"is-editable":t.isEditable,"tag-type":f.value,onAdd:()=>h(Q),onSelectActivity:l,onArchiveActivity:k,onUnarchiveActivity:b,onUpdateActivity:w,onStartTimer:S},null,8,["status","list","title","footer-label","users","user-id","is-editable","tag-type","onAdd"]))),128))]),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[t.selectedActivity?(i.openBlock(),i.createBlock(Ju,{key:0,activity:t.selectedActivity,"activity-types":t.activityTypes,"milestone-id":(ue=t.selectedActivity.milestone)==null?void 0:ue.id,"template-activities":a.value,users:t.users,"user-id":t.userId,"is-task-checkable":t.isTaskCheckable,statuses:t.statuses,breadcrumbs:p.value,"is-editable":t.isEditable,"attachment-enabled":t.attachmentEnabled,projects:g.value,"time-tracking-data":t.timeTrackingData,"load-attachment-preview":o.loadAttachmentPreview,onClose:H[7]||(H[7]=()=>l(null,null)),"onUpdate:activity":v,onAddSubtask:x,onUpdateSubtask:O,onDeleteSubtask:M,onAddFiles:$,onRemoveFile:B,onAddComment:P,onUpdateComment:F,onRemoveComment:K,onToast:s},{default:i.withCtx(Q=>[i.renderSlot(z.$slots,"activityDetailsBody",i.normalizeProps(i.guardReactiveProps(Q)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","time-tracking-data","load-attachment-preview"])):i.createCommentVNode("",!0)]))])}}});const Vhe={class:"ao-project-mapping"},Rhe={class:"ao-project-mapping-mapping__body"},zhe={class:"ao-project-mapping-mapping__phases"},Uhe={key:0,class:"ao-project-mapping-mapping__image-wrapper"},qhe=["src","alt"],Hhe=i.defineComponent({__name:"AoMapping",props:{project:{},phases:{},closedStatus:{},users:{},userId:{},templates:{},isTaskCheckable:{type:Function},statuses:{},activityTypes:{},isEditable:{type:[Boolean,String]},showsArchived:{type:Boolean},attachmentEnabled:{type:Boolean}},emits:["addPhase","updatePhase","archivePhase","unarchivePhase","copyPhaseToTemplate","applyTemplate","saveTemplate","update:showsArchived"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e,s=()=>{const{name:_,rank:y}=Uo(o.phases,"phase",n);r("addPhase",{name:_,rank:y,projectId:o.project.id})},a=_=>{r("updatePhase",_)},l=_=>{r("archivePhase",_)},c=_=>{r("unarchivePhase",_)},u=_=>{r("copyPhaseToTemplate",_)},d=i.ref(!1),f=i.ref(!1),p=(_,y)=>{r("applyTemplate",{templateId:_,projectId:y}),d.value=!1},h=(_,y)=>{var k;const v=(k=o.templates)==null?void 0:k.at(-1),w=v?it.LexoRank.parse(v.rank).genNext():it.LexoRank.middle();r("saveTemplate",{templateName:_,rank:w.format(),phaseIds:y}),f.value=!1},m=Ki.useRouter(),g=i.ref("mapping"),C=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return i.watch(g,_=>{_==="feed"?(m.push({name:je.feed}),console.log("Navigating to feed...")):_==="overview"?(m.push({name:je.project}),console.log("Navigating to feed...")):_==="mapping"&&(m.push({name:je.mapping}),console.log("Navigating to feed..."))}),(_,y)=>{var v;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",i.mergeProps({class:"ao-project-mapping-overview"},_.$attrs),[i.createElementVNode("div",Vhe,[i.createVNode(Qi,null,{primary:i.withCtx(()=>[i.createVNode(fs,{modelValue:g.value,"onUpdate:modelValue":y[0]||(y[0]=w=>g.value=w),tabs:C},null,8,["modelValue"]),i.createVNode(pe,{class:"ao-feed__show-archived",size:"sm","icon-name":t.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:_.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":t.showsArchived,onClick:y[1]||(y[1]=w=>_.$emit("update:showsArchived",!t.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:i.withCtx(()=>[t.isEditable===!0?(i.openBlock(),i.createBlock(pe,{key:0,class:"ao-project-mapping-overview__save-as-template",color:"primary",label:_.$t("project.template.save.label"),onClick:y[2]||(y[2]=w=>f.value=!0)},null,8,["label"])):i.createCommentVNode("",!0),t.isEditable===!0?(i.openBlock(),i.createBlock(pe,{key:1,class:"ao-project-mapping-overview__add-template",color:"primary",label:_.$t("project.template.apply.label"),onClick:y[3]||(y[3]=w=>d.value=!0)},null,8,["label"])):i.createCommentVNode("",!0)]),_:1}),i.createElementVNode("div",Rhe,[i.createElementVNode("div",zhe,[i.createVNode(sd,{phases:t.phases,"closed-status":t.closedStatus,"is-editable":t.isEditable===!0,users:t.users,"estimation-unit":(v=t.project)==null?void 0:v.estimationUnit,onAddPhase:s,onUpdatePhase:a,onArchivePhase:l,onUnarchivePhase:c,onCopyPhaseToTemplate:u},null,8,["phases","closed-status","is-editable","users","estimation-unit"])]),t.project.architectureImage?(i.openBlock(),i.createElementBlock("div",Uhe,[i.createElementVNode("img",{class:"architecture-image",src:t.project.architectureImage.url,alt:i.unref(n)("architectureImage.alt")},null,8,qhe)])):i.createCommentVNode("",!0)])])],16),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[f.value?(i.openBlock(),i.createBlock(Pg,{key:0,phases:t.phases,onClose:y[4]||(y[4]=w=>f.value=!1),onSave:h},null,8,["phases"])):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createBlock(Ig,{key:1,"project-id":t.project.id,templates:t.templates,onClose:y[5]||(y[5]=w=>d.value=!1),onApply:p},null,8,["project-id","templates"])):i.createCommentVNode("",!0)]))],64)}}});const Po={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},jhe=(t,e={})=>[{path:t,name:Po.TEMPLATES,redirect:{name:Po.TEMPLATES_LIST},...e,children:[{path:"",name:Po.TEMPLATES_LIST,component:Vg},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:Po.TEMPLATE_DETAILS,component:Lg,props:!0}]}],je={project:"AoProject",feed:"AoProjectFeed",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},Whe=(t,e={})=>[{path:t,...e,redirect:{name:je.project},children:[{path:"",name:je.project,component:Npe,props:!0,children:[{path:":phaseId/:milestoneId",name:je.milestone,component:cp,props:!0},{path:":phaseId/:milestoneId/:activityId",name:je.activity,props:{default:!0,modal:!0},components:{default:cp,modal:fhe}}]},{path:"feed",name:je.feed,component:Fg,props:!0},{path:"mapping",name:je.mapping,component:Hhe,props:!0}]}],Zhe={class:"ao-templates"},Vg=i.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(t,{emit:e}){const{t:n}=Hn(),o=t,r=e;i.watch(()=>o.templates,(u,d)=>{In(u,d)});const s=()=>{var h,m;const u=(h=o.templates)==null?void 0:h.at(-1),d=u?it.LexoRank.parse(u.rank).genNext():it.LexoRank.middle(),f=((m=o.templates)==null?void 0:m.length)??0,p={name:n("template.defaultName.template",{idx:f+1}),rank:d.format()};r("addTemplate",p)},a=(u,d)=>{r("updateItem",{itemType:Be.TEMPLATES,id:u,templateId:u,data:{name:d}})},l=(u,d)=>{r("removeItem",{itemType:Be.TEMPLATES,templateId:u,data:{id:u,...d?{name:d}:{}}})},c=u=>{if(u.moved){const d=Xi(u,o.templates??[]);r("updateItem",{itemType:Be.TEMPLATES,id:u.moved.element.id,templateId:u.moved.element.id,data:{rank:d}})}};return(u,d)=>(i.openBlock(),i.createElementBlock("div",Zhe,[i.createVNode(Qi,null,{secondary:i.withCtx(()=>[i.createVNode(pe,{label:u.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:s},null,8,["label"])]),_:1}),i.createVNode(i.unref(mo),{"model-value":t.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:c},{item:i.withCtx(({element:f})=>{var p;return[i.createVNode(P_,{id:f.id,title:f.name,phases:f.phases,milestones:(p=f.phases)!=null&&p.length?i.unref(a_)(f.phases):0,activities:f.phases?i.unref(l_)(f.phases):0,"updated-at":f.updatedAt,"updated-by":f.updatedBy,onUpdateTitle:h=>a(f.id,h),onClick:h=>u.$router.push({name:i.unref(Po).TEMPLATE_DETAILS,params:{templateId:f.id}}),onDeleteItem:d[0]||(d[0]=(h,m)=>l(h,m))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}});const Khe={class:"ao-field__label"},Rg=i.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[i.createElementVNode("span",Khe,i.toDisplayString(t.label),1),i.renderSlot(e.$slots,"default")],2))}}),Ghe=["type","value","disabled","readonly"],Yhe=i.defineComponent({__name:"AoInputField",props:{label:{default:""},type:{default:"text"},modelValue:{default:""},modelModifiers:{default:()=>({})},isDisabled:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,o=e,r=i.computed(()=>n.modelModifiers.lazy?"change":"input"),s=a=>{n.modelModifiers.number&&(a=Number(a)),o("update:modelValue",a)};return(a,l)=>(i.openBlock(),i.createBlock(Rg,{label:t.label},{default:i.withCtx(()=>[i.createElementVNode("input",i.mergeProps({class:"ao-field__input",type:t.type,value:t.modelValue,disabled:t.isDisabled,readonly:t.isReadonly},{[i.toHandlerKey(r.value)]:l[0]||(l[0]=c=>s(c.target.value))}),null,16,Ghe)]),_:1},8,["label"]))}}),Jhe={class:"ao-field"},Xhe={class:"ao-field__label"},Qhe=["checked","disabled"],eme=i.defineComponent({__name:"AoCheckboxField",props:{label:{default:""},modelValue:{type:Boolean,default:!1},isReadonly:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("label",Jhe,[i.createElementVNode("span",Xhe,i.toDisplayString(t.label),1),i.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:n[0]||(n[0]=o=>{var r;return e.$emit("update:modelValue",((r=o.target)==null?void 0:r.checked)??!1)})},null,40,Qhe)]))}});exports.AoAvatar=Un;exports.AoCardFeed=ad;exports.AoCheckboxField=eme;exports.AoColorPicker=dl;exports.AoFeed=Fg;exports.AoField=Rg;exports.AoInputField=Yhe;exports.AoMultiselect=Dt;exports.AoProjectPhases=sd;exports.AoTabBar=fs;exports.AoTemplateDetails=Lg;exports.AoTemplates=Gg;exports.AoTemplatesList=Vg;exports.EstimationUnit=gp;exports.TemplateItemTypeEnum=mp;exports.activityFeedStatus=_y;exports.durationTypes=yy;exports.feedFilterTypes=No;exports.getProjectOverviewRoutes=Whe;exports.getTemplateRoutes=jhe;exports.listUpdateTypes=Cy;exports.milestoneStatus=Bi;exports.projectOverviewRoutes=je;exports.ruleComparators=fp;exports.ruleDurationUnits=hp;exports.ruleTriggerTypes=pp;exports.templateItemType=Be;exports.templateRouteNames=Po;
|