@26lights/orcha 0.41.18 → 0.41.20
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 +1 -1
- package/dist/orcha.css +1 -1
- package/dist/orcha.es.js +1 -1
- package/dist/orcha.umd.js +3 -3
- package/package.json +2 -2
package/dist/orcha.cjs.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* vue-color-kit v1.0.6
|
|
3
3
|
* (c) 2023
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/function Qe(a){let t={r:0,g:0,b:0,a:1};/#/.test(a)?t=Bv(a):/rgb/.test(a)?t=Go(a):typeof a=="string"?t=Go(`rgba(${a})`):Object.prototype.toString.call(a)==="[object Object]"&&(t=a);const{r:o,g:n,b:s,a:i}=t,{h:l,s:r,v:c}=Vv(t);return{r:o,g:n,b:s,a:i===void 0?1:i,h:l,s:r,v:c}}function ho(a){const t=document.createElement("canvas"),o=t.getContext("2d"),n=a*2;return t.width=n,t.height=n,o.fillStyle="#ffffff",o.fillRect(0,0,n,n),o.fillStyle="#ccd5db",o.fillRect(0,0,a,a),o.fillRect(a,a,a,a),t}function xa(a,t,o,n,s,i){const l=a==="l",r=t.createLinearGradient(0,0,l?o:0,l?0:n);r.addColorStop(.01,s),r.addColorStop(.99,i),t.fillStyle=r,t.fillRect(0,0,o,n)}function Ev({r:a,g:t,b:o},n){const s=l=>("0"+Number(l).toString(16)).slice(-2),i=`#${s(a)}${s(t)}${s(o)}`;return n?i.toUpperCase():i}function Bv(a){a=a.slice(1);const t=o=>parseInt(o,16)||0;return{r:t(a.slice(0,2)),g:t(a.slice(2,4)),b:t(a.slice(4,6))}}function Go(a){return typeof a=="string"?(a=(/rgba?\((.*?)\)/.exec(a)||["","0,0,0,1"])[1].split(","),{r:Number(a[0])||0,g:Number(a[1])||0,b:Number(a[2])||0,a:Number(a[3]?a[3]:1)}):a}function Vv({r:a,g:t,b:o}){a=a/255,t=t/255,o=o/255;const n=Math.max(a,t,o),s=Math.min(a,t,o),i=n-s;let l=0;n===s?l=0:n===a?t>=o?l=60*(t-o)/i:l=60*(t-o)/i+360:n===t?l=60*(o-a)/i+120:n===o&&(l=60*(a-t)/i+240),l=Math.floor(l);let r=parseFloat((n===0?0:1-s/n).toFixed(2)),c=parseFloat(n.toFixed(2));return{h:l,s:r,v:c}}var Co=e.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 a=this.$refs.canvasSaturation,t=this.size,o=a.getContext("2d");a.width=t,a.height=t,o.fillStyle=this.color,o.fillRect(0,0,t,t),xa("l",o,t,t,"#FFFFFF","rgba(255,255,255,0)"),xa("p",o,t,t,"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(a){const{top:t,left:o}=this.$el.getBoundingClientRect(),n=a.target.getContext("2d"),s=l=>{let r=l.clientX-o,c=l.clientY-t;r<0&&(r=0),c<0&&(c=0),r>this.size&&(r=this.size),c>this.size&&(c=this.size),this.slideSaturationStyle={left:r-5+"px",top:c-5+"px"};const u=n.getImageData(Math.min(r,this.size-1),Math.min(c,this.size-1),1,1),[d,p,m]=u.data;this.$emit("selectSaturation",{r:d,g:p,b:m})};s(a);const i=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",i)}}});const Sv={ref:"canvasSaturation"};function Nv(a,t,o,n,s,i){return e.openBlock(),e.createBlock("div",{class:"saturation",onMousedown:t[1]||(t[1]=e.withModifiers((...l)=>a.selectSaturation&&a.selectSaturation(...l),["prevent","stop"]))},[e.createVNode("canvas",Sv,null,512),e.createVNode("div",{style:a.slideSaturationStyle,class:"slide"},null,4)],32)}Co.render=Nv;Co.__file="src/color/Saturation.vue";var go=e.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 a=this.$refs.canvasHue,t=this.width,o=this.height,n=a.getContext("2d");a.width=t,a.height=o;const s=n.createLinearGradient(0,0,0,o);s.addColorStop(0,"#FF0000"),s.addColorStop(.17*1,"#FF00FF"),s.addColorStop(.17*2,"#0000FF"),s.addColorStop(.17*3,"#00FFFF"),s.addColorStop(.17*4,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),n.fillStyle=s,n.fillRect(0,0,t,o)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(a){const{top:t}=this.$el.getBoundingClientRect(),o=a.target.getContext("2d"),n=i=>{let l=i.clientY-t;l<0&&(l=0),l>this.height&&(l=this.height),this.slideHueStyle={top:l-2+"px"};const r=o.getImageData(0,Math.min(l,this.height-1),1,1),[c,u,d]=r.data;this.$emit("selectHue",{r:c,g:u,b:d})};n(a);const s=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",s)}}});const Mv={ref:"canvasHue"};function Av(a,t,o,n,s,i){return e.openBlock(),e.createBlock("div",{class:"hue",onMousedown:t[1]||(t[1]=e.withModifiers((...l)=>a.selectHue&&a.selectHue(...l),["prevent","stop"]))},[e.createVNode("canvas",Mv,null,512),e.createVNode("div",{style:a.slideHueStyle,class:"slide"},null,4)],32)}go.render=Av;go.__file="src/color/Hue.vue";var _o=e.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 a=this.$refs.canvasAlpha,t=this.width,o=this.height,n=this.alphaSize,s=ho(n),i=a.getContext("2d");a.width=t,a.height=o,i.fillStyle=i.createPattern(s,"repeat"),i.fillRect(0,0,t,o),xa("p",i,t,o,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(a){const{top:t}=this.$el.getBoundingClientRect(),o=s=>{let i=s.clientY-t;i<0&&(i=0),i>this.height&&(i=this.height);let l=parseFloat((i/this.height).toFixed(2));this.$emit("selectAlpha",l)};o(a);const n=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",n)}}});const Tv={ref:"canvasAlpha"};function Ov(a,t,o,n,s,i){return e.openBlock(),e.createBlock("div",{class:"color-alpha",onMousedown:t[1]||(t[1]=e.withModifiers((...l)=>a.selectAlpha&&a.selectAlpha(...l),["prevent","stop"]))},[e.createVNode("canvas",Tv,null,512),e.createVNode("div",{style:a.slideAlphaStyle,class:"slide"},null,4)],32)}_o.render=Ov;_o.__file="src/color/Alpha.vue";var yo=e.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 a=this.$el,t=this.width,o=this.height,n=this.alphaSize,s=ho(n),i=a.getContext("2d");a.width=t,a.height=o,i.fillStyle=i.createPattern(s,"repeat"),i.fillRect(0,0,t,o),i.fillStyle=this.color,i.fillRect(0,0,t,o)}}});function Iv(a,t,o,n,s,i){return e.openBlock(),e.createBlock("canvas")}yo.render=Iv;yo.__file="src/color/Preview.vue";var bo=e.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(a){this.isSucking=!1,this.suckColor(a)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(a){a.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(a){const{clientX:t,clientY:o}=a,{top:n,left:s,width:i,height:l}=this.suckerCanvas.getBoundingClientRect(),r=t-s,c=o-n,d=this.suckerCanvas.getContext("2d").getImageData(Math.min(r,i-1),Math.min(c,l-1),1,1);let[p,m,f,b]=d.data;b=parseFloat((b/255).toFixed(2));const v=this.suckerPreview.style;Object.assign(v,{position:"absolute",left:t+20+"px",top:o-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(${p}, ${m}, ${f}, ${b})`,zIndex:95}),this.suckerArea.length&&t>=this.suckerArea[0]&&o>=this.suckerArea[1]&&t<=this.suckerArea[2]&&o<=this.suckerArea[3]?v.display="":v.display="none"},suckColor(a){a&&a.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),a.addEventListener("click",t=>{const{clientX:o,clientY:n}=t,{top:s,left:i,width:l,height:r}=a.getBoundingClientRect(),c=o-i,u=n-s,p=a.getContext("2d").getImageData(Math.min(c,l-1),Math.min(u,r-1),1,1);let[m,f,b,v]=p.data;v=parseFloat((v/255).toFixed(2)),this.$emit("selectSucker",{r:m,g:f,b,a:v})}))}}});const Lv=e.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),Dv={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},Pv=e.createVNode("g",{fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[e.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),e.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[e.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function Hv(a,t,o,n,s,i){return e.openBlock(),e.createBlock("div",null,[a.isSucking?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock("svg",{key:0,class:[{active:a.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:t[1]||(t[1]=(...l)=>a.openSucker&&a.openSucker(...l))},[Lv],2)),a.isSucking?(e.openBlock(),e.createBlock("svg",Dv,[Pv])):e.createCommentVNode("v-if",!0)])}bo.render=Hv;bo.__file="src/color/Sucker.vue";var wo=e.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(a,{emit:t}){return{modelColor:e.computed({get(){return a.color||""},set(i){t("inputColor",i)}}),handleFocus:i=>{t("inputFocus",i)},handleBlur:i=>{t("inputBlur",i)}}}});const Rv={class:"color-type"},jv={class:"name"};function Fv(a,t,o,n,s,i){return e.openBlock(),e.createBlock("div",Rv,[e.createVNode("span",jv,e.toDisplayString(a.name),1),e.withDirectives(e.createVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=l=>a.modelColor=l),class:"value",onFocus:t[2]||(t[2]=(...l)=>a.handleFocus&&a.handleFocus(...l)),onBlur:t[3]||(t[3]=(...l)=>a.handleBlur&&a.handleBlur(...l))},null,544),[[e.vModelText,a.modelColor]])])}wo.render=Fv;wo.__file="src/color/Box.vue";var ko=e.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(a,{emit:t}){const o=e.ref(),n=e.ref([]),s=e.ref();a.colorsHistoryKey&&localStorage&&(n.value=JSON.parse(localStorage.getItem(a.colorsHistoryKey))||[]),s.value=ho(4).toDataURL(),e.onUnmounted(()=>{i(o.value)});function i(r){if(!r)return;const c=n.value||[],u=c.indexOf(r);u>=0&&c.splice(u,1),c.length>=8&&(c.length=7),c.unshift(r),n.value=c||[],localStorage&&a.colorsHistoryKey&&localStorage.setItem(a.colorsHistoryKey,JSON.stringify(c))}function l(r){t("selectColor",r)}return{setColorsHistory:i,colorsHistory:n,color:o,imgAlphaBase64:s,selectColor:l}}});const Uv={class:"colors"},Zv={key:0,class:"colors history"};function zv(a,t,o,n,s,i){return e.openBlock(),e.createBlock("div",null,[e.createVNode("ul",Uv,[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(a.colorsDefault,l=>(e.openBlock(),e.createBlock("li",{key:l,class:"item",onClick:r=>a.selectColor(l)},[e.createVNode("div",{style:{background:`url(${a.imgAlphaBase64})`},class:"alpha"},null,4),e.createVNode("div",{style:{background:l},class:"color"},null,4)],8,["onClick"]))),128))]),a.colorsHistory.length?(e.openBlock(),e.createBlock("ul",Zv,[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(a.colorsHistory,l=>(e.openBlock(),e.createBlock("li",{key:l,class:"item",onClick:r=>a.selectColor(l)},[e.createVNode("div",{style:{background:`url(${a.imgAlphaBase64})`},class:"alpha"},null,4),e.createVNode("div",{style:{background:l},class:"color"},null,4)],8,["onClick"]))),128))])):e.createCommentVNode("v-if",!0)])}ko.render=zv;ko.__file="src/color/Colors.vue";var ut=e.defineComponent({components:{Saturation:Co,Hue:go,Alpha:_o,Preview:yo,Sucker:bo,Box:wo,Colors:ko},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 Ev(this.rgba,!0)}},created(){Object.assign(this,Qe(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(a){const{r:t,g:o,b:n,h:s,s:i,v:l}=Qe(a);Object.assign(this,{r:t,g:o,b:n,h:s,s:i,v:l}),this.setText()},handleFocus(a){this.$emit("inputFocus",a)},handleBlur(a){this.$emit("inputBlur",a)},selectHue(a){const{r:t,g:o,b:n,h:s,s:i,v:l}=Qe(a);Object.assign(this,{r:t,g:o,b:n,h:s,s:i,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(a){this.a=a,this.setText()},inputHex(a){const{r:t,g:o,b:n,a:s,h:i,s:l,v:r}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:i,s:l,v:r}),this.modelHex=a,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(a){const{r:t,g:o,b:n,a:s,h:i,s:l,v:r}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:i,s:l,v:r}),this.modelHex=this.hexString,this.modelRgba=a,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(a){this.$emit("openSucker",a)},selectSucker(a){const{r:t,g:o,b:n,a:s,h:i,s:l,v:r}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:i,s:l,v:r}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(a){const{r:t,g:o,b:n,a:s,h:i,s:l,v:r}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:i,s:l,v:r}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const xv={class:"color-set"};function Wv(a,t,o,n,s,i){const l=e.resolveComponent("Saturation"),r=e.resolveComponent("Hue"),c=e.resolveComponent("Alpha"),u=e.resolveComponent("Preview"),d=e.resolveComponent("Sucker"),p=e.resolveComponent("Box"),m=e.resolveComponent("Colors");return e.openBlock(),e.createBlock("div",{class:["hu-color-picker",{light:a.isLightTheme}],style:{width:a.totalWidth+"px"}},[e.createVNode("div",xv,[e.createVNode(l,{ref:"saturation",color:a.rgbString,hsv:a.hsv,size:a.hueHeight,onSelectSaturation:a.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),e.createVNode(r,{ref:"hue",hsv:a.hsv,width:a.hueWidth,height:a.hueHeight,onSelectHue:a.selectHue},null,8,["hsv","width","height","onSelectHue"]),e.createVNode(c,{ref:"alpha",color:a.rgbString,rgba:a.rgba,width:a.hueWidth,height:a.hueHeight,onSelectAlpha:a.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),e.createVNode("div",{style:{height:a.previewHeight+"px"},class:"color-show"},[e.createVNode(u,{color:a.rgbaString,width:a.previewWidth,height:a.previewHeight},null,8,["color","width","height"]),a.suckerHide?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(d,{key:0,"sucker-canvas":a.suckerCanvas,"sucker-area":a.suckerArea,onOpenSucker:a.openSucker,onSelectSucker:a.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),e.createVNode(p,{name:"HEX",color:a.modelHex,onInputColor:a.inputHex,onInputFocus:a.handleFocus,onInputBlur:a.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),e.createVNode(p,{name:"RGBA",color:a.modelRgba,onInputColor:a.inputRgba,onInputFocus:a.handleFocus,onInputBlur:a.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),e.createVNode(m,{color:a.rgbaString,"colors-default":a.colorsDefault,"colors-history-key":a.colorsHistoryKey,onSelectColor:a.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),e.createCommentVNode(" custom options "),e.renderSlot(a.$slots,"default")],6)}ut.render=Wv;ut.__file="src/color/ColorPicker.vue";ut.install=a=>{a.component(ut.name,ut)};const qv={props:{color:{type:String,required:!0}},components:{ColorPicker:ut},data(){return{showPicker:!1}},methods:{togglePicker(){this.showPicker=!this.showPicker},changeColor(a){const{r:t,g:o,b:n,a:s}=a.rgba,i=`rgba(${t}, ${o}, ${n}, ${s})`;this.$emit("update:color",i)}}},Yv={class:"color-picker-wrapper"};function Kv(a,t,o,n,s,i){const l=e.resolveComponent("ColorPicker");return e.openBlock(),e.createElementBlock("div",Yv,[e.createElementVNode("button",{style:e.normalizeStyle({backgroundColor:o.color}),class:"color-button",onClick:t[0]||(t[0]=(...r)=>i.togglePicker&&i.togglePicker(...r))},null,4),s.showPicker?(e.openBlock(),e.createBlock(l,{key:0,class:"color-picker",theme:"light",color:o.color,onChangeColor:i.changeColor},null,8,["color","onChangeColor"])):e.createCommentVNode("",!0)])}const Gv=L(qv,[["render",Kv]]),Xv={class:"ao-project-milestone"},Qv={class:"ao-project-milestone__header"},Jv={class:"ao-project-milestone__header_line"},eh={class:"ao-project-milestone__header_line"},th={class:"ao-project-milestone__title"},ah={key:0,class:"ao-fieldset ao-milestone__fieldset"},oh={class:"ao-field__row ao-milestone__field-row"},nh={class:"ao-field ao-field--inline"},sh={class:"ao-field__row ao-milestone__field-row"},lh={class:"ao-field ao-milestone__field-multiselect"},ih={class:"ao-project-milestone__body"},rh={key:0,class:"ao-project-milestone__footer"},Xo=e.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity"],setup(a,{emit:t}){const o=a,{t:n}=Ye(),s=e.computed(()=>{var C;return(C=o.phases)==null?void 0:C.find(g=>g.id===o.phaseId)}),i=e.computed(()=>{var C;return(C=o.phases)==null?void 0:C.flatMap(g=>g.milestones)}),l=e.computed(()=>{var C;return(C=i.value)==null?void 0:C.find(g=>g.id===o.milestoneId)}),r=e.computed(()=>{var C;return(C=l.value)==null?void 0:C.activities});e.watch(r,(C,g)=>{Me(C,g)});const c=C=>{t("close",C)},u=()=>{const{name:C,rank:g}=ot(r.value??[],"activity",n);t("addActivity",{milestoneId:o.milestoneId,name:C,rank:g,projectId:o.projectId})},d=C=>{t("updateActivity",C)},p=C=>{r.value&&"moved"in C&&t("updateActivity",{id:C.moved.element.id,rank:pt(r.value,C.moved.newIndex)})},m=e.computed({get:()=>{var C;return(C=l.value)==null?void 0:C.color},set:C=>{l.value&&t("updateMilestone",{id:l.value.id,color:C})}}),f=e.computed({get:()=>{var C;return((C=l==null?void 0:l.value)==null?void 0:C.deadline)??""},set:C=>{l.value&&t("updateMilestone",{id:l.value.id,deadline:C!=null&&C.length?C:null})}}),b=C=>o.closedStatus?Ga(C,o.closedStatus):!1,v=e.computed(()=>{var C;return((C=o.users)==null?void 0:C.map(g=>({label:`${g.firstName} ${g.lastName}`,value:g.id,avatar:g.avatarUrl})))||[]}),y=e.computed({get(){var C,g;return(g=(C=l.value)==null?void 0:C.assignee)!=null&&g.id?[l.value.assignee.id]:[]},set(C){t("updateMilestone",{id:o.milestoneId,assigneeId:C[0]??null})}}),k=e.computed({get(){var C;return((C=l.value)==null?void 0:C.important)??!1},set(C){t("updateMilestone",{id:o.milestoneId,important:C})}});return(C,g)=>{var E;return e.openBlock(),e.createElementBlock("div",Xv,[e.createElementVNode("header",Qv,[e.createElementVNode("div",Jv,[e.createVNode(K,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:c})]),e.createElementVNode("div",eh,[e.createElementVNode("div",th,[e.createVNode(ne,{title:((E=l.value)==null?void 0:E.name)||C.milestoneId,level:5},null,8,["title"]),e.createVNode(za,{modelValue:k.value,"onUpdate:modelValue":g[0]||(g[0]=B=>k.value=B),modelModifiers:{lazy:!0},disabled:!C.isEditable,class:"ao-milestone__important",color:"danger",label:C.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),l.value?(e.openBlock(),e.createElementBlock("div",ah,[e.createElementVNode("div",oh,[e.createElementVNode("label",nh,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[1]||(g[1]=B=>f.value=B),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[e.vModelText,f.value,void 0,{lazy:!0}]])])]),e.createElementVNode("div",sh,[e.createElementVNode("label",lh,[e.createVNode(ie,{modelValue:y.value,"onUpdate:modelValue":g[2]||(g[2]=B=>y.value=B),options:v.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:C.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!C.isEditable,caret:C.isEditable},{tag:e.withCtx(({option:B,handleTagRemove:V})=>[e.createVNode(we,{"user-name":B.label,"avatar-url":B.avatar,"is-closable":!0,onClose:I=>V(B,I)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),e.createVNode(Gv,{color:m.value,"onUpdate:color":g[3]||(g[3]=B=>m.value=B)},null,8,["color"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ih,[e.createVNode(e.unref(xe),e.mergeProps({class:"ao-project-milestone__activities",list:r.value,disabled:!C.isEditable,"item-key":"id",group:"kanban"},C.$attrs,{onChange:p}),{item:e.withCtx(({element:B})=>{var V,I,P,R,j;return[e.createVNode(vo,{id:B.id,name:B.name||B.id,"phase-name":(V=s.value)==null?void 0:V.name,"milestone-name":(I=l.value)==null?void 0:I.name,"milestone-color":(P=l.value)==null?void 0:P.color,deadline:B.deadline,important:B.important,users:C.users,assignee:B.assignee,slug:B.slug,comments:(R=B.comments)==null?void 0:R.length,attachments:(j=B.attachments)==null?void 0:j.length,tasks:B.tasks,"is-editable":C.isEditable,"is-private":B.private,"is-closed":b(B),onClick:Z=>C.$router.push({name:e.unref(oe).activity,params:{milestoneId:C.milestoneId,activityId:B.id}}),onUpdateActivity:d,onRemoveAssignee:()=>d({id:B.id,assigneeId:null})},e.createSlots({_:2},[C.isEditable?{name:"secondary",fn:e.withCtx(()=>[C.isEditable&&B.active?(e.openBlock(),e.createBlock(K,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("archive"),onClick:e.withModifiers(()=>C.$emit("archiveActivity",{id:B.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0),C.isEditable&&!B.active?(e.openBlock(),e.createBlock(K,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("feed.activity.unarchive"),onClick:e.withModifiers(()=>C.$emit("unarchiveActivity",{id:B.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["id","name","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"]),C.isEditable?(e.openBlock(),e.createElementBlock("div",rh,[e.createVNode(We,{"icon-name":"Add",label:C.$t("project.activity.add"),onClick:u},null,8,["label"])])):e.createCommentVNode("",!0)])])}}});const ch=e.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(a,{emit:t}){const o=a,n=e.computed(()=>{var y;return(y=o.phases)==null?void 0:y.find(k=>k.id===o.phaseId)}),s=e.computed(()=>{var y;return(y=o.phases)==null?void 0:y.flatMap(k=>k.milestones)}),i=e.computed(()=>{var y;return(y=s.value)==null?void 0:y.find(k=>k.id===o.milestoneId)}),l=e.computed(()=>{var y;return(y=o.activities)==null?void 0:y.find(k=>k.id===o.activityId)}),r=y=>{t("update:activity",y)},c=y=>{t("addSubtask",y)},u=y=>{t("updateSubtask",y)},d=y=>{t("deleteSubtask",y)},p=y=>{t("addFiles",y)},m=y=>{t("removeFile",y)},f=y=>{t("addComment",y)},b=y=>{t("updateComment",y)},v=y=>{t("removeComment",y)};return(y,k)=>{var C,g;return l.value?(e.openBlock(),e.createBlock(co,{key:0,activity:l.value,"activity-types":y.activityTypes,"milestone-id":y.milestoneId,"template-activities":y.activities,"is-template":!1,users:y.users,"user-id":y.userId,"is-task-checkable":y.isTaskCheckable,statuses:y.statuses,breadcrumbs:`${(C=n.value)==null?void 0:C.name} / ${(g=i.value)==null?void 0:g.name}`,"is-editable":y.isEditable,"attachment-enabled":y.attachmentEnabled,projects:[y.project],onClose:y.$router.back,"onUpdate:activity":r,onAddSubtask:c,onUpdateSubtask:u,onDeleteSubtask:d,onAddFiles:p,onRemoveFile:m,onAddComment:f,onUpdateComment:b,onRemoveComment:v},{default:e.withCtx(E=>[e.renderSlot(y.$slots,"default",e.normalizeProps(e.guardReactiveProps(E)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","onClose"])):e.createCommentVNode("",!0)}}}),dh={class:"ao-col-header"},uh=e.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("header",dh,[e.createVNode(ne,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(e.openBlock(),e.createBlock(Tt,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):e.createCommentVNode("",!0)]))}});function ph(a){return e.getCurrentScope()?(e.onScopeDispose(a),!0):!1}function ma(a){return typeof a=="function"?a():e.unref(a)}const mh=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const fh=a=>a!=null,At=()=>{};function vh(a,t){function o(...n){return new Promise((s,i)=>{Promise.resolve(a(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(s).catch(i)})}return o}function hh(a,t={}){let o,n,s=At;const i=r=>{clearTimeout(r),s(),s=At};return r=>{const c=ma(a),u=ma(t.maxWait);return o&&i(o),c<=0||u!==void 0&&u<=0?(n&&(i(n),n=null),Promise.resolve(r())):new Promise((d,p)=>{s=t.rejectOnCancel?p:d,u&&!n&&(n=setTimeout(()=>{o&&i(o),n=null,d(r())},u)),o=setTimeout(()=>{n&&i(n),n=null,d(r())},c)})}}function Ch(a,t=200,o={}){return vh(hh(t,o),a)}function Ra(a){var t;const o=ma(a);return(t=o==null?void 0:o.$el)!=null?t:o}const gh=mh?window:void 0;function _h(){const a=e.ref(!1),t=e.getCurrentInstance();return t&&e.onMounted(()=>{a.value=!0},t),a}function yh(a){const t=_h();return e.computed(()=>(t.value,!!a()))}function bh(a,t,o={}){const{root:n,rootMargin:s="0px",threshold:i=.1,window:l=gh,immediate:r=!0}=o,c=yh(()=>l&&"IntersectionObserver"in l),u=e.computed(()=>{const b=ma(a);return(Array.isArray(b)?b:[b]).map(Ra).filter(fh)});let d=At;const p=e.ref(r),m=c.value?e.watch(()=>[u.value,Ra(n),p.value],([b,v])=>{if(d(),!p.value||!b.length)return;const y=new IntersectionObserver(t,{root:Ra(v),rootMargin:s,threshold:i});b.forEach(k=>k&&y.observe(k)),d=()=>{y.disconnect(),d=At}},{immediate:r,flush:"post"}):At,f=()=>{d(),m(),p.value=!1};return ph(f),{isSupported:c,isActive:p,pause(){d(),p.value=!1},resume(){p.value=!0},stop:f}}const wh={class:e.normalizeClass(["ao-list-kanban"])},kh={class:"ao-list-kanban__header"},$h={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},Eh={key:1,class:"ao-list-kanban__end"},Bh={key:0,class:"ao-list-kanban__no-more"},Vh={key:1,class:"ao-list-kanban__divider"},Sh={key:1,class:"ao-list-kanban__footer"},Nh=e.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"],setup(a,{emit:t}){const o=a,n=e.ref(!1),s=e.ref(null);bh(s,([{isIntersecting:d}])=>{n.value=d}),e.watch(n,d=>{d&&o.hasMore&&!o.isLoading&&t("loadMore")});const i=d=>{var p;return o.isEditable===!0?!0:o.userId&&o.isEditable==="only-own"?o.userId===((p=d.assignee)==null?void 0:p.id):!1},l=d=>{t("selectActivity",d)},r=d=>{t("updateActivity",d)},c=d=>{"added"in d?t("updateActivity",{id:d.added.element.id,statusId:o.status.id,rank:pt(o.list,d.added.newIndex)}):"removed"in d||"moved"in d&&t("updateActivity",{id:d.moved.element.id,rank:pt(o.list,d.moved.newIndex)})},u=e.ref(!1);return(d,p)=>(e.openBlock(),e.createElementBlock("div",wh,[d.title||d.$slots.header?e.renderSlot(d.$slots,"header",{key:0},()=>{var m;return[e.createElementVNode("div",kh,[d.title?(e.openBlock(),e.createBlock(uh,{key:0,title:d.title,level:3,items:(m=d.list)==null?void 0:m.length},null,8,["title","items"])):e.createCommentVNode("",!0)])]}):e.createCommentVNode("",!0),e.createVNode(e.unref(xe),e.mergeProps({class:["ao-list-kanban__list",u.value?"ao-list-kanban__transition":void 0],list:d.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},d.$attrs,{draggable:".ao-list-draggable",disabled:!d.isEditable,onChange:c,onStart:p[0]||(p[0]=m=>u.value=!0),onEnd:p[1]||(p[1]=m=>u.value=!1),"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"}}),{item:e.withCtx(({element:m})=>{var f,b,v,y,k,C,g,E,B;return[e.createVNode(vo,{class:e.normalizeClass(i(m)?"ao-list-draggable":""),id:m.id,name:m.name,"project-name":(f=m.project)==null?void 0:f.name,"project-color":(b=m.project)==null?void 0:b.color,"phase-name":(y=(v=m.milestone)==null?void 0:v.phase)==null?void 0:y.name,"milestone-name":(k=m.milestone)==null?void 0:k.name,"milestone-color":(C=m.milestone)==null?void 0:C.color,deadline:m.deadline,rules:((g=m.rules)==null?void 0:g.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(E=m.comments)==null?void 0:E.length,attachments:(B=m.attachments)==null?void 0:B.length,users:d.users,assignee:m.assignee,slug:m.slug,"is-editable":i(m),"is-private":m.private,"tag-type":d.tagType,onUpdateActivity:[V=>i(m)&&r(V),()=>i(m)&&r],onClick:()=>l(m.id),onRemoveAssignee:()=>i(m)&&r({id:m.id,assigneeId:null})},{secondary:e.withCtx(()=>[i(m)&&m.active?(e.openBlock(),e.createBlock(K,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:d.$t("feed.activity.archive"),onClick:e.withModifiers(()=>d.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0),i(m)&&!m.active?(e.openBlock(),e.createBlock(K,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:d.$t("feed.activity.unarchive"),onClick:e.withModifiers(()=>d.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0)]),_:2},1032,["class","id","name","project-name","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:e.withCtx(()=>[d.isLoading?(e.openBlock(),e.createElementBlock("div",$h,[e.createVNode(Q,{name:"Loading"})])):d.hasMore?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:s,class:"ao-list-kanban__end"},null,512)):(e.openBlock(),e.createElementBlock("div",Eh,[d.noMoreLabel?(e.openBlock(),e.createElementBlock("span",Bh,e.toDisplayString(d.noMoreLabel),1)):d.isEditable?(e.openBlock(),e.createElementBlock("span",Vh)):e.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),d.$slots.footer||d.footerLabel?(e.openBlock(),e.createElementBlock("div",Sh,[e.renderSlot(d.$slots,"footer",{},()=>[d.isEditable?(e.openBlock(),e.createBlock(We,{key:0,"icon-name":"AddBoxOutlineRounded",label:d.footerLabel,onClick:p[2]||(p[2]=m=>d.$emit("add"))},null,8,["label"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]))}});const Mh={class:"ao-field ao-search-field"},Ah=["value","placeholder","onKeypress"],Th=e.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(a,{emit:t}){const o=a,n=async l=>{const c=l.target.value;t("update:modelValue",c,l)},s=Ch(n,o.delay),i=l=>{t("clear",l)};return(l,r)=>(e.openBlock(),e.createElementBlock("div",Mh,[e.createElementVNode("input",{value:l.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:l.placeholder,onInput:r[0]||(r[0]=(...c)=>e.unref(s)&&e.unref(s)(...c)),onKeypress:e.withKeys(n,["enter"])},null,40,Ah),e.createVNode(Q,{name:"SearchRounded",class:e.normalizeClass(`ao-search-field__icon ao-search-field__action ${l.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),e.createVNode(K,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:e.normalizeClass(`ao-search-field__button ao-search-field__action ${l.modelValue?"ao-search-field__action--visible":""}`),onClick:i},null,8,["class"])]))}});const Oh={class:"ao-feed"},Ih={class:"ao-feed__filters"},Lh={class:"ao-feed__body"},Fn=e.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}},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"],setup(a,{emit:t}){const o=a,{t:n}=Ye();function s($,T){t("toast",$,T)}const i=e.toRef(o,"activities"),l=async($,T)=>{await t("selectActivity",$,T)},r=e.ref({}),c=e.ref(!1),u=e.ref(!1),d=e.computed(()=>o.project?"milestone":"project");e.watch([()=>o.statuses,()=>o.activities,()=>o.initialActivityId,()=>o.initialActivitySlug],async([$,T,_,N],[Y,x])=>{r.value=Object.fromEntries($.map(D=>[D.id,T.filter(S=>{var H;return((H=S.status)==null?void 0:H.id)===D.id})])),_&&!c.value?(l(_,null),c.value=!0):N&&!c.value&&(l(null,N),c.value=!0),u.value&&Me(T,x)},{immediate:!0});const p=e.computed(()=>{var $;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${(($=o.selectedActivity.milestone.phase)==null?void 0:$.name)??""} / ${o.selectedActivity.milestone.name??""}`}),m=$=>{var x,D;const T=(x=o.activities)==null?void 0:x.at(-1),_=T?se.LexoRank.parse(T.rank).genNext():se.LexoRank.middle(),N=((D=o.activities)==null?void 0:D.length)??0,Y={name:n("activity.defaultName",{idx:N+1}),rank:_.format(),statusId:$.id};o.filters.assigneeId.length>0&&(Y.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(Y.projectId=o.filters.projectId[0]),o.filters.typeId.length>0&&(Y.typeId=o.filters.typeId[0]),u.value=!0,t("addActivity",Y)},f=($,T)=>{u.value=!1,t("update:filters",{...o.filters,[$]:T})},b=e.computed(()=>o.project?[o.project]:o.projects??[]),v=e.computed(()=>b.value.map($=>({value:$.id,label:$.name}))),y=e.computed(()=>{var $;return($=o.activityTypes)==null?void 0:$.map(T=>({value:T.id,label:T.name}))}),k=e.computed(()=>o.users.map($=>({value:$.id,label:`${$.firstName} ${$.lastName}`,avatar:$.avatarUrl}))),C=$=>{o.selectedActivity&&t("update:activity",$)},g=$=>{t("update:activity",$)},E=$=>{t("archiveActivity",$)},B=$=>{t("unarchiveActivity",$)},V=$=>{u.value=!1,t("update:searchText",$)},I=$=>{u.value=!1,t("clear:searchText",$)},P=$=>{o.selectedActivity&&t("addSubtask",$)},R=$=>{o.selectedActivity&&t("updateSubtask",$)},j=$=>{o.selectedActivity&&t("deleteSubtask",$)},Z=$=>{t("addFiles",$)},O=$=>{t("removeFile",$)},F=$=>{o.selectedActivity&&t("addComment",{...$,activityId:o.selectedActivity.id})},q=$=>{const{id:T}=o.selectedActivity||{};T&&t("updateComment",$)},z=$=>{const{id:T}=o.selectedActivity||{};T&&t("removeComment",$)},U=Ht.useRouter(),h=e.ref("feed"),M=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(h,$=>{$==="feed"?(U.push({name:oe.feed}),console.log("Navigating to feed...")):$==="overview"?(U.push({name:oe.project}),console.log("Navigating to feed...")):$==="mapping"&&(U.push({name:oe.mapping}),console.log("Navigating to feed..."))}),($,T)=>{var _;return e.openBlock(),e.createElementBlock("div",Oh,[e.createVNode(Zt,null,{primary:e.withCtx(()=>[e.createElementVNode("div",Ih,[e.createVNode(fo,{tabs:M,modelValue:h.value,"onUpdate:modelValue":T[0]||(T[0]=N=>h.value=N)},null,8,["modelValue"]),e.createVNode(Th,{"model-value":$.searchText,placeholder:$.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":V,onClear:I},null,8,["model-value","placeholder"]),o.project?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie,{key:0,"model-value":$.filters[e.unref(Je).project],mode:"tags",options:v.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:$.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":T[1]||(T[1]=N=>f(e.unref(Je).project,N))},null,8,["model-value","options","placeholder"])),y.value?(e.openBlock(),e.createBlock(ie,{key:1,"model-value":$.filters[e.unref(Je).type],mode:"tags",options:y.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:$.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":T[2]||(T[2]=N=>f(e.unref(Je).type,N))},null,8,["model-value","options","placeholder"])):e.createCommentVNode("",!0),k.value.length?(e.openBlock(),e.createBlock(ie,{key:2,"model-value":$.filters[e.unref(Je).assignee],mode:"tags",options:k.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:$.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":T[3]||(T[3]=N=>f(e.unref(Je).assignee,N))},{tag:e.withCtx(({option:N,handleTagRemove:Y})=>[e.createVNode(we,{"user-name":N.label,"avatar-url":N.avatar,"is-closable":!0,onClose:x=>Y(N,x)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):e.createCommentVNode("",!0)]),e.createVNode(K,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":$.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:$.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":$.showsOnlyNonAssigned,onClick:T[4]||(T[4]=N=>$.$emit("update:showsOnlyNonAssigned",!$.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),e.createVNode(K,{class:"ao-feed__only-important",size:"sm","icon-name":$.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:$.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":$.showsOnlyImportant,onClick:T[5]||(T[5]=N=>$.$emit("update:showsOnlyImportant",!$.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),e.createVNode(K,{class:"ao-feed__show-archived",size:"sm","icon-name":$.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:$.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":$.showsArchivedActivities,onClick:T[6]||(T[6]=N=>$.$emit("update:showsArchivedActivities",!$.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),e.createElementVNode("div",Lh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.statuses,N=>(e.openBlock(),e.createBlock(Nh,{key:N.id,status:N,list:r.value[N.id],title:N.name,"footer-label":$.$t("feed.activity.add"),users:$.users,"user-id":$.userId,"is-editable":$.isEditable,tagType:d.value,onAdd:()=>m(N),onSelectActivity:l,onArchiveActivity:E,onUnarchiveActivity:B,onUpdateActivity:g},null,8,["status","list","title","footer-label","users","user-id","is-editable","tagType","onAdd"]))),128))]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[$.selectedActivity?(e.openBlock(),e.createBlock(co,{key:0,activity:$.selectedActivity,"activity-types":$.activityTypes,"milestone-id":(_=$.selectedActivity.milestone)==null?void 0:_.id,"template-activities":i.value,users:$.users,"user-id":$.userId,"is-task-checkable":$.isTaskCheckable,statuses:$.statuses,breadcrumbs:p.value,"is-editable":$.isEditable,"attachment-enabled":$.attachmentEnabled,projects:b.value,onClose:T[7]||(T[7]=()=>l(null,null)),"onUpdate:activity":C,onAddSubtask:P,onUpdateSubtask:R,onDeleteSubtask:j,onAddFiles:Z,onRemoveFile:O,onAddComment:F,onUpdateComment:q,onRemoveComment:z,onToast:s},{default:e.withCtx(N=>[e.renderSlot($.$slots,"activityDetailsBody",e.normalizeProps(e.guardReactiveProps(N)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects"])):e.createCommentVNode("",!0)]))])}}});const Dh={class:"ao-project"},Ph={class:"ao-project__body"},Hh=["src","alt"],Rh=e.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","addMilestone","updateMilestone","archiveMilestone","addActivity","update:activity","archiveActivity","copyPhaseToTemplate","unarchiveActivity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","applyTemplate","saveTemplate","update:showsArchived"],setup(a,{emit:t}){const o=a,{t:n}=Ye(),s=e.computed(()=>o.phases.flatMap(E=>E.milestones)),i=()=>{const{name:E,rank:B}=ot(o.phases,"phase",n);t("addPhase",{name:E,rank:B,projectId:o.project.id})},l=E=>{t("updatePhase",E)},r=E=>{t("archivePhase",E)},c=E=>{t("unarchivePhase",E)},u=E=>{t("copyPhaseToTemplate",E)},d=E=>{t("addMilestone",E)},p=E=>{t("updateMilestone",E)},m=E=>{t("archiveMilestone",E)};e.computed(()=>s.value.flatMap(E=>E.activities));const f=e.ref(!1),b=e.ref(!1),v=(E,B)=>{t("applyTemplate",{templateId:E,projectId:B}),f.value=!1},y=(E,B)=>{var P;const V=(P=o.templates)==null?void 0:P.at(-1),I=V?se.LexoRank.parse(V.rank).genNext():se.LexoRank.middle();t("saveTemplate",{templateName:E,rank:I.format(),phaseIds:B}),b.value=!1},k=Ht.useRouter(),C=e.ref("mapping"),g=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(C,E=>{E==="feed"?(k.push({name:oe.feed}),console.log("Navigating to feed...")):E==="overview"?(k.push({name:oe.project}),console.log("Navigating to feed...")):E==="mapping"&&(k.push({name:oe.mapping}),console.log("Navigating to feed..."))}),(E,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps({class:"ao-project-overview"},E.$attrs),[e.createElementVNode("div",Dh,[e.createVNode(Zt,null,{primary:e.withCtx(()=>[e.createVNode(fo,{tabs:g,modelValue:C.value,"onUpdate:modelValue":B[0]||(B[0]=V=>C.value=V)},null,8,["modelValue"]),e.createVNode(K,{class:"ao-feed__show-archived",size:"sm","icon-name":E.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:E.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":E.showsArchived,onClick:B[1]||(B[1]=V=>E.$emit("update:showsArchived",!E.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:e.withCtx(()=>[E.isEditable===!0?(e.openBlock(),e.createBlock(K,{key:0,class:"ao-project-overview__save-as-template",color:"primary",label:E.$t("project.template.save.label"),onClick:B[2]||(B[2]=V=>b.value=!0)},null,8,["label"])):e.createCommentVNode("",!0),E.isEditable===!0?(e.openBlock(),e.createBlock(K,{key:1,class:"ao-project-overview__add-template",color:"primary",label:E.$t("project.template.apply.label"),onClick:B[3]||(B[3]=V=>f.value=!0)},null,8,["label"])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Ph,[e.createVNode(mo,{phases:E.phases,"closed-status":E.closedStatus,"is-editable":E.isEditable===!0,users:E.users,onAddMilestone:d,onUpdateMilestone:p,onArchiveMilestone:m,onAddPhase:i,onUpdatePhase:l,onArchivePhase:r,onUnarchivePhase:c,onCopyPhaseToTemplate:u},null,8,["phases","closed-status","is-editable","users"]),E.project.architectureImage?(e.openBlock(),e.createElementBlock("img",{key:0,class:"main-image",src:E.project.architectureImage.url,alt:e.unref(n)("architectureImage.alt")},null,8,Hh)):e.createCommentVNode("",!0)])])],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[b.value?(e.openBlock(),e.createBlock(jn,{key:0,phases:E.phases,onClose:B[4]||(B[4]=V=>b.value=!1),onSave:y},null,8,["phases"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createBlock(Rn,{key:1,"project-id":E.project.id,templates:E.templates,onClose:B[5]||(B[5]=V=>f.value=!1),onApply:v},null,8,["project-id","templates"])):e.createCommentVNode("",!0)]))],64))}});const tt={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},jh=(a,t={})=>[{path:a,name:tt.TEMPLATES,redirect:{name:tt.TEMPLATES_LIST},...t,children:[{path:"",name:tt.TEMPLATES_LIST,component:Un},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:tt.TEMPLATE_DETAILS,component:Hn,props:!0}]}],oe={project:"AoProject",feed:"AoProjectFeed",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},Fh=(a,t={})=>[{path:a,...t,redirect:{name:oe.project},children:[{path:"",name:oe.project,component:av,props:!0,children:[{path:":phaseId/:milestoneId",name:oe.milestone,component:Xo,props:!0},{path:":phaseId/:milestoneId/:activityId",name:oe.activity,props:{default:!0,modal:!0},components:{default:Xo,modal:ch}}]},{path:"feed",name:oe.feed,component:Fn,props:!0},{path:"mapping",name:oe.mapping,component:Rh,props:!0}]}],Uh={class:"ao-templates"},Un=e.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(a,{emit:t}){const o=a,{t:n}=Ye();e.watch(()=>o.templates,(c,u)=>{Me(c,u)});const s=()=>{var m,f;const c=(m=o.templates)==null?void 0:m.at(-1),u=c?se.LexoRank.parse(c.rank).genNext():se.LexoRank.middle(),d=((f=o.templates)==null?void 0:f.length)??0,p={name:n("template.defaultName.template",{idx:d+1}),rank:u.format()};t("addTemplate",p)},i=(c,u)=>{t("updateItem",{itemType:ee.TEMPLATES,id:c,templateId:c,data:{name:u}})},l=(c,u)=>{t("removeItem",{itemType:ee.TEMPLATES,templateId:c,data:{id:c,...u?{name:u}:{}}})},r=c=>{if(c.moved){const u=Ut(c,o.templates??[]);t("updateItem",{itemType:ee.TEMPLATES,id:c.moved.element.id,templateId:c.moved.element.id,data:{rank:u}})}};return(c,u)=>(e.openBlock(),e.createElementBlock("div",Uh,[e.createVNode(Zt,null,{secondary:e.withCtx(()=>[e.createVNode(K,{label:c.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:s},null,8,["label"])]),_:1}),e.createVNode(e.unref(xe),{"model-value":c.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:r},{item:e.withCtx(({element:d})=>{var p;return[e.createVNode(b3,{id:d.id,title:d.name,phases:d.phases,milestones:(p=d.phases)!=null&&p.length?e.unref(q0)(d.phases):0,activities:d.phases?e.unref(Y0)(d.phases):0,"updated-at":d.updatedAt,"updated-by":d.updatedBy,onUpdateTitle:m=>i(d.id,m),onClick:m=>c.$router.push({name:e.unref(tt).TEMPLATE_DETAILS,params:{templateId:d.id}}),onDeleteItem:u[0]||(u[0]=(m,f)=>l(m,f))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}});const Zh={class:"ao-field__label"},Zn=e.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[e.createElementVNode("span",Zh,e.toDisplayString(t.label),1),e.renderSlot(t.$slots,"default")],2))}}),zh=["type","value","disabled","readonly"],xh=e.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(a,{emit:t}){const o=a,n=e.computed(()=>o.modelModifiers.lazy?"change":"input"),s=i=>{o.modelModifiers.number&&(i=Number(i)),t("update:modelValue",i)};return(i,l)=>(e.openBlock(),e.createBlock(Zn,{label:i.label},{default:e.withCtx(()=>[e.createElementVNode("input",e.mergeProps({class:"ao-field__input",type:i.type,value:i.modelValue,disabled:i.isDisabled,readonly:i.isReadonly},{[e.toHandlerKey(n.value)]:l[0]||(l[0]=r=>s(r.target.value))}),null,16,zh)]),_:1},8,["label"]))}}),Wh={class:"ao-field"},qh={class:"ao-field__label"},Yh=["checked","disabled"],Kh=e.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(a){return(t,o)=>(e.openBlock(),e.createElementBlock("label",Wh,[e.createElementVNode("span",qh,e.toDisplayString(t.label),1),e.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:o[0]||(o[0]=n=>{var s;return t.$emit("update:modelValue",((s=n.target)==null?void 0:s.checked)??!1)})},null,40,Yh)]))}});exports.AoAvatar=we;exports.AoCardFeed=vo;exports.AoCheckboxField=Kh;exports.AoFeed=Fn;exports.AoField=Zn;exports.AoInputField=xh;exports.AoMultiselect=ie;exports.AoProjectPhases=mo;exports.AoTemplateDetails=Hn;exports.AoTemplates=is;exports.AoTemplatesList=Un;exports.TemplateItemTypeEnum=nn;exports.activityFeedStatus=r2;exports.durationTypes=i2;exports.feedFilterTypes=Je;exports.getProjectOverviewRoutes=Fh;exports.getTemplateRoutes=jh;exports.listUpdateTypes=c2;exports.milestoneStatus=sa;exports.projectOverviewRoutes=oe;exports.ruleComparators=tn;exports.ruleDurationUnits=on;exports.ruleTriggerTypes=an;exports.templateItemType=ee;exports.templateRouteNames=tt;
|
|
5
|
+
*/function Qe(a){let t={r:0,g:0,b:0,a:1};/#/.test(a)?t=Bv(a):/rgb/.test(a)?t=Go(a):typeof a=="string"?t=Go(`rgba(${a})`):Object.prototype.toString.call(a)==="[object Object]"&&(t=a);const{r:o,g:n,b:s,a:i}=t,{h:l,s:r,v:c}=Vv(t);return{r:o,g:n,b:s,a:i===void 0?1:i,h:l,s:r,v:c}}function ho(a){const t=document.createElement("canvas"),o=t.getContext("2d"),n=a*2;return t.width=n,t.height=n,o.fillStyle="#ffffff",o.fillRect(0,0,n,n),o.fillStyle="#ccd5db",o.fillRect(0,0,a,a),o.fillRect(a,a,a,a),t}function xa(a,t,o,n,s,i){const l=a==="l",r=t.createLinearGradient(0,0,l?o:0,l?0:n);r.addColorStop(.01,s),r.addColorStop(.99,i),t.fillStyle=r,t.fillRect(0,0,o,n)}function Ev({r:a,g:t,b:o},n){const s=l=>("0"+Number(l).toString(16)).slice(-2),i=`#${s(a)}${s(t)}${s(o)}`;return n?i.toUpperCase():i}function Bv(a){a=a.slice(1);const t=o=>parseInt(o,16)||0;return{r:t(a.slice(0,2)),g:t(a.slice(2,4)),b:t(a.slice(4,6))}}function Go(a){return typeof a=="string"?(a=(/rgba?\((.*?)\)/.exec(a)||["","0,0,0,1"])[1].split(","),{r:Number(a[0])||0,g:Number(a[1])||0,b:Number(a[2])||0,a:Number(a[3]?a[3]:1)}):a}function Vv({r:a,g:t,b:o}){a=a/255,t=t/255,o=o/255;const n=Math.max(a,t,o),s=Math.min(a,t,o),i=n-s;let l=0;n===s?l=0:n===a?t>=o?l=60*(t-o)/i:l=60*(t-o)/i+360:n===t?l=60*(o-a)/i+120:n===o&&(l=60*(a-t)/i+240),l=Math.floor(l);let r=parseFloat((n===0?0:1-s/n).toFixed(2)),c=parseFloat(n.toFixed(2));return{h:l,s:r,v:c}}var Co=e.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 a=this.$refs.canvasSaturation,t=this.size,o=a.getContext("2d");a.width=t,a.height=t,o.fillStyle=this.color,o.fillRect(0,0,t,t),xa("l",o,t,t,"#FFFFFF","rgba(255,255,255,0)"),xa("p",o,t,t,"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(a){const{top:t,left:o}=this.$el.getBoundingClientRect(),n=a.target.getContext("2d"),s=l=>{let r=l.clientX-o,c=l.clientY-t;r<0&&(r=0),c<0&&(c=0),r>this.size&&(r=this.size),c>this.size&&(c=this.size),this.slideSaturationStyle={left:r-5+"px",top:c-5+"px"};const u=n.getImageData(Math.min(r,this.size-1),Math.min(c,this.size-1),1,1),[d,p,m]=u.data;this.$emit("selectSaturation",{r:d,g:p,b:m})};s(a);const i=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",i)}}});const Sv={ref:"canvasSaturation"};function Nv(a,t,o,n,s,i){return e.openBlock(),e.createBlock("div",{class:"saturation",onMousedown:t[1]||(t[1]=e.withModifiers((...l)=>a.selectSaturation&&a.selectSaturation(...l),["prevent","stop"]))},[e.createVNode("canvas",Sv,null,512),e.createVNode("div",{style:a.slideSaturationStyle,class:"slide"},null,4)],32)}Co.render=Nv;Co.__file="src/color/Saturation.vue";var go=e.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 a=this.$refs.canvasHue,t=this.width,o=this.height,n=a.getContext("2d");a.width=t,a.height=o;const s=n.createLinearGradient(0,0,0,o);s.addColorStop(0,"#FF0000"),s.addColorStop(.17*1,"#FF00FF"),s.addColorStop(.17*2,"#0000FF"),s.addColorStop(.17*3,"#00FFFF"),s.addColorStop(.17*4,"#00FF00"),s.addColorStop(.17*5,"#FFFF00"),s.addColorStop(1,"#FF0000"),n.fillStyle=s,n.fillRect(0,0,t,o)},renderSlide(){this.slideHueStyle={top:(1-this.hsv.h/360)*this.height-2+"px"}},selectHue(a){const{top:t}=this.$el.getBoundingClientRect(),o=a.target.getContext("2d"),n=i=>{let l=i.clientY-t;l<0&&(l=0),l>this.height&&(l=this.height),this.slideHueStyle={top:l-2+"px"};const r=o.getImageData(0,Math.min(l,this.height-1),1,1),[c,u,d]=r.data;this.$emit("selectHue",{r:c,g:u,b:d})};n(a);const s=()=>{document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",s)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",s)}}});const Mv={ref:"canvasHue"};function Av(a,t,o,n,s,i){return e.openBlock(),e.createBlock("div",{class:"hue",onMousedown:t[1]||(t[1]=e.withModifiers((...l)=>a.selectHue&&a.selectHue(...l),["prevent","stop"]))},[e.createVNode("canvas",Mv,null,512),e.createVNode("div",{style:a.slideHueStyle,class:"slide"},null,4)],32)}go.render=Av;go.__file="src/color/Hue.vue";var _o=e.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 a=this.$refs.canvasAlpha,t=this.width,o=this.height,n=this.alphaSize,s=ho(n),i=a.getContext("2d");a.width=t,a.height=o,i.fillStyle=i.createPattern(s,"repeat"),i.fillRect(0,0,t,o),xa("p",i,t,o,"rgba(255,255,255,0)",this.color)},renderSlide(){this.slideAlphaStyle={top:this.rgba.a*this.height-2+"px"}},selectAlpha(a){const{top:t}=this.$el.getBoundingClientRect(),o=s=>{let i=s.clientY-t;i<0&&(i=0),i>this.height&&(i=this.height);let l=parseFloat((i/this.height).toFixed(2));this.$emit("selectAlpha",l)};o(a);const n=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",n)}}});const Tv={ref:"canvasAlpha"};function Ov(a,t,o,n,s,i){return e.openBlock(),e.createBlock("div",{class:"color-alpha",onMousedown:t[1]||(t[1]=e.withModifiers((...l)=>a.selectAlpha&&a.selectAlpha(...l),["prevent","stop"]))},[e.createVNode("canvas",Tv,null,512),e.createVNode("div",{style:a.slideAlphaStyle,class:"slide"},null,4)],32)}_o.render=Ov;_o.__file="src/color/Alpha.vue";var yo=e.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 a=this.$el,t=this.width,o=this.height,n=this.alphaSize,s=ho(n),i=a.getContext("2d");a.width=t,a.height=o,i.fillStyle=i.createPattern(s,"repeat"),i.fillRect(0,0,t,o),i.fillStyle=this.color,i.fillRect(0,0,t,o)}}});function Iv(a,t,o,n,s,i){return e.openBlock(),e.createBlock("canvas")}yo.render=Iv;yo.__file="src/color/Preview.vue";var bo=e.defineComponent({props:{suckerCanvas:{type:Object,default:null},suckerArea:{type:Array,default:()=>[]}},data(){return{isOpenSucker:!1,suckerPreview:null,isSucking:!1}},watch:{suckerCanvas(a){this.isSucking=!1,this.suckColor(a)}},methods:{openSucker(){this.isOpenSucker?this.keydownHandler({keyCode:27}):(this.isOpenSucker=!0,this.isSucking=!0,this.$emit("openSucker",!0),document.addEventListener("keydown",this.keydownHandler))},keydownHandler(a){a.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(a){const{clientX:t,clientY:o}=a,{top:n,left:s,width:i,height:l}=this.suckerCanvas.getBoundingClientRect(),r=t-s,c=o-n,d=this.suckerCanvas.getContext("2d").getImageData(Math.min(r,i-1),Math.min(c,l-1),1,1);let[p,m,f,b]=d.data;b=parseFloat((b/255).toFixed(2));const v=this.suckerPreview.style;Object.assign(v,{position:"absolute",left:t+20+"px",top:o-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(${p}, ${m}, ${f}, ${b})`,zIndex:95}),this.suckerArea.length&&t>=this.suckerArea[0]&&o>=this.suckerArea[1]&&t<=this.suckerArea[2]&&o<=this.suckerArea[3]?v.display="":v.display="none"},suckColor(a){a&&a.tagName!=="CANVAS"||(this.suckerPreview=document.createElement("div"),this.suckerPreview&&document.body.appendChild(this.suckerPreview),document.addEventListener("mousemove",this.mousemoveHandler),document.addEventListener("mouseup",this.mousemoveHandler),a.addEventListener("click",t=>{const{clientX:o,clientY:n}=t,{top:s,left:i,width:l,height:r}=a.getBoundingClientRect(),c=o-i,u=n-s,p=a.getContext("2d").getImageData(Math.min(c,l-1),Math.min(u,r-1),1,1);let[m,f,b,v]=p.data;v=parseFloat((v/255).toFixed(2)),this.$emit("selectSucker",{r:m,g:f,b,a:v})}))}}});const Lv=e.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),Dv={key:1,class:"sucker",viewBox:"-16 -16 68 68",xmlns:"http://www.w3.org/2000/svg",stroke:"#9099a4"},Pv=e.createVNode("g",{fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{transform:"translate(1 1)","stroke-width":"4"},[e.createVNode("circle",{"stroke-opacity":".5",cx:"18",cy:"18",r:"18"}),e.createVNode("path",{d:"M36 18c0-9.94-8.06-18-18-18"},[e.createVNode("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})])])],-1);function Hv(a,t,o,n,s,i){return e.openBlock(),e.createBlock("div",null,[a.isSucking?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock("svg",{key:0,class:[{active:a.isOpenSucker},"sucker"],xmlns:"http://www.w3.org/2000/svg",viewBox:"-12 -12 48 48",onClick:t[1]||(t[1]=(...l)=>a.openSucker&&a.openSucker(...l))},[Lv],2)),a.isSucking?(e.openBlock(),e.createBlock("svg",Dv,[Pv])):e.createCommentVNode("v-if",!0)])}bo.render=Hv;bo.__file="src/color/Sucker.vue";var wo=e.defineComponent({props:{name:{type:String,default:""},color:{type:String,default:""}},emits:["inputColor","inputFocus","inputBlur"],setup(a,{emit:t}){return{modelColor:e.computed({get(){return a.color||""},set(i){t("inputColor",i)}}),handleFocus:i=>{t("inputFocus",i)},handleBlur:i=>{t("inputBlur",i)}}}});const Rv={class:"color-type"},jv={class:"name"};function Fv(a,t,o,n,s,i){return e.openBlock(),e.createBlock("div",Rv,[e.createVNode("span",jv,e.toDisplayString(a.name),1),e.withDirectives(e.createVNode("input",{"onUpdate:modelValue":t[1]||(t[1]=l=>a.modelColor=l),class:"value",onFocus:t[2]||(t[2]=(...l)=>a.handleFocus&&a.handleFocus(...l)),onBlur:t[3]||(t[3]=(...l)=>a.handleBlur&&a.handleBlur(...l))},null,544),[[e.vModelText,a.modelColor]])])}wo.render=Fv;wo.__file="src/color/Box.vue";var ko=e.defineComponent({name:"ColorPicker",props:{color:{type:String,default:"#000000"},colorsDefault:{type:Array,default:()=>[]},colorsHistoryKey:{type:String,default:""}},emits:["selectColor"],setup(a,{emit:t}){const o=e.ref(),n=e.ref([]),s=e.ref();a.colorsHistoryKey&&localStorage&&(n.value=JSON.parse(localStorage.getItem(a.colorsHistoryKey))||[]),s.value=ho(4).toDataURL(),e.onUnmounted(()=>{i(o.value)});function i(r){if(!r)return;const c=n.value||[],u=c.indexOf(r);u>=0&&c.splice(u,1),c.length>=8&&(c.length=7),c.unshift(r),n.value=c||[],localStorage&&a.colorsHistoryKey&&localStorage.setItem(a.colorsHistoryKey,JSON.stringify(c))}function l(r){t("selectColor",r)}return{setColorsHistory:i,colorsHistory:n,color:o,imgAlphaBase64:s,selectColor:l}}});const Uv={class:"colors"},Zv={key:0,class:"colors history"};function zv(a,t,o,n,s,i){return e.openBlock(),e.createBlock("div",null,[e.createVNode("ul",Uv,[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(a.colorsDefault,l=>(e.openBlock(),e.createBlock("li",{key:l,class:"item",onClick:r=>a.selectColor(l)},[e.createVNode("div",{style:{background:`url(${a.imgAlphaBase64})`},class:"alpha"},null,4),e.createVNode("div",{style:{background:l},class:"color"},null,4)],8,["onClick"]))),128))]),a.colorsHistory.length?(e.openBlock(),e.createBlock("ul",Zv,[(e.openBlock(!0),e.createBlock(e.Fragment,null,e.renderList(a.colorsHistory,l=>(e.openBlock(),e.createBlock("li",{key:l,class:"item",onClick:r=>a.selectColor(l)},[e.createVNode("div",{style:{background:`url(${a.imgAlphaBase64})`},class:"alpha"},null,4),e.createVNode("div",{style:{background:l},class:"color"},null,4)],8,["onClick"]))),128))])):e.createCommentVNode("v-if",!0)])}ko.render=zv;ko.__file="src/color/Colors.vue";var ut=e.defineComponent({components:{Saturation:Co,Hue:go,Alpha:_o,Preview:yo,Sucker:bo,Box:wo,Colors:ko},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 Ev(this.rgba,!0)}},created(){Object.assign(this,Qe(this.color)),this.setText(),this.$watch("rgba",()=>{this.$emit("changeColor",{rgba:this.rgba,hsv:this.hsv,hex:this.modelHex})})},methods:{selectSaturation(a){const{r:t,g:o,b:n,h:s,s:i,v:l}=Qe(a);Object.assign(this,{r:t,g:o,b:n,h:s,s:i,v:l}),this.setText()},handleFocus(a){this.$emit("inputFocus",a)},handleBlur(a){this.$emit("inputBlur",a)},selectHue(a){const{r:t,g:o,b:n,h:s,s:i,v:l}=Qe(a);Object.assign(this,{r:t,g:o,b:n,h:s,s:i,v:l}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide()})},selectAlpha(a){this.a=a,this.setText()},inputHex(a){const{r:t,g:o,b:n,a:s,h:i,s:l,v:r}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:i,s:l,v:r}),this.modelHex=a,this.modelRgba=this.rgbaStringShort,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},inputRgba(a){const{r:t,g:o,b:n,a:s,h:i,s:l,v:r}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:i,s:l,v:r}),this.modelHex=this.hexString,this.modelRgba=a,this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},setText(){this.modelHex=this.hexString,this.modelRgba=this.rgbaStringShort},openSucker(a){this.$emit("openSucker",a)},selectSucker(a){const{r:t,g:o,b:n,a:s,h:i,s:l,v:r}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:i,s:l,v:r}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})},selectColor(a){const{r:t,g:o,b:n,a:s,h:i,s:l,v:r}=Qe(a);Object.assign(this,{r:t,g:o,b:n,a:s,h:i,s:l,v:r}),this.setText(),this.$nextTick(()=>{this.$refs.saturation.renderColor(),this.$refs.saturation.renderSlide(),this.$refs.hue.renderSlide()})}}});const xv={class:"color-set"};function Wv(a,t,o,n,s,i){const l=e.resolveComponent("Saturation"),r=e.resolveComponent("Hue"),c=e.resolveComponent("Alpha"),u=e.resolveComponent("Preview"),d=e.resolveComponent("Sucker"),p=e.resolveComponent("Box"),m=e.resolveComponent("Colors");return e.openBlock(),e.createBlock("div",{class:["hu-color-picker",{light:a.isLightTheme}],style:{width:a.totalWidth+"px"}},[e.createVNode("div",xv,[e.createVNode(l,{ref:"saturation",color:a.rgbString,hsv:a.hsv,size:a.hueHeight,onSelectSaturation:a.selectSaturation},null,8,["color","hsv","size","onSelectSaturation"]),e.createVNode(r,{ref:"hue",hsv:a.hsv,width:a.hueWidth,height:a.hueHeight,onSelectHue:a.selectHue},null,8,["hsv","width","height","onSelectHue"]),e.createVNode(c,{ref:"alpha",color:a.rgbString,rgba:a.rgba,width:a.hueWidth,height:a.hueHeight,onSelectAlpha:a.selectAlpha},null,8,["color","rgba","width","height","onSelectAlpha"])]),e.createVNode("div",{style:{height:a.previewHeight+"px"},class:"color-show"},[e.createVNode(u,{color:a.rgbaString,width:a.previewWidth,height:a.previewHeight},null,8,["color","width","height"]),a.suckerHide?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createBlock(d,{key:0,"sucker-canvas":a.suckerCanvas,"sucker-area":a.suckerArea,onOpenSucker:a.openSucker,onSelectSucker:a.selectSucker},null,8,["sucker-canvas","sucker-area","onOpenSucker","onSelectSucker"]))],4),e.createVNode(p,{name:"HEX",color:a.modelHex,onInputColor:a.inputHex,onInputFocus:a.handleFocus,onInputBlur:a.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),e.createVNode(p,{name:"RGBA",color:a.modelRgba,onInputColor:a.inputRgba,onInputFocus:a.handleFocus,onInputBlur:a.handleBlur},null,8,["color","onInputColor","onInputFocus","onInputBlur"]),e.createVNode(m,{color:a.rgbaString,"colors-default":a.colorsDefault,"colors-history-key":a.colorsHistoryKey,onSelectColor:a.selectColor},null,8,["color","colors-default","colors-history-key","onSelectColor"]),e.createCommentVNode(" custom options "),e.renderSlot(a.$slots,"default")],6)}ut.render=Wv;ut.__file="src/color/ColorPicker.vue";ut.install=a=>{a.component(ut.name,ut)};const qv={props:{color:{type:String,required:!0}},components:{ColorPicker:ut},data(){return{showPicker:!1}},methods:{togglePicker(){this.showPicker=!this.showPicker},changeColor(a){const{r:t,g:o,b:n,a:s}=a.rgba,i=`rgba(${t}, ${o}, ${n}, ${s})`;this.$emit("update:color",i)}}},Yv={class:"color-picker-wrapper"};function Kv(a,t,o,n,s,i){const l=e.resolveComponent("ColorPicker");return e.openBlock(),e.createElementBlock("div",Yv,[e.createElementVNode("button",{style:e.normalizeStyle({backgroundColor:o.color}),class:"color-button",onClick:t[0]||(t[0]=(...r)=>i.togglePicker&&i.togglePicker(...r))},null,4),s.showPicker?(e.openBlock(),e.createBlock(l,{key:0,class:"color-picker",theme:"light",color:o.color,onChangeColor:i.changeColor},null,8,["color","onChangeColor"])):e.createCommentVNode("",!0)])}const Gv=L(qv,[["render",Kv]]),Xv={class:"ao-project-milestone"},Qv={class:"ao-project-milestone__header"},Jv={class:"ao-project-milestone__header_line"},eh={class:"ao-project-milestone__header_line"},th={class:"ao-project-milestone__title"},ah={key:0,class:"ao-fieldset ao-milestone__fieldset"},oh={class:"ao-field__row ao-milestone__field-row"},nh={class:"ao-field ao-field--inline"},sh={class:"ao-field__row ao-milestone__field-row"},lh={class:"ao-field ao-milestone__field-multiselect"},ih={class:"ao-project-milestone__body"},rh={key:0,class:"ao-project-milestone__footer"},Xo=e.defineComponent({__name:"AoProjectOverviewMilestoneDetails",props:{milestoneId:{},users:{},projectId:{},phases:{},phaseId:{},isEditable:{type:Boolean},closedStatus:{}},emits:["close","addActivity","updateMilestone","updateActivity","archiveActivity","unarchiveActivity"],setup(a,{emit:t}){const o=a,{t:n}=Ye(),s=e.computed(()=>{var C;return(C=o.phases)==null?void 0:C.find(g=>g.id===o.phaseId)}),i=e.computed(()=>{var C;return(C=o.phases)==null?void 0:C.flatMap(g=>g.milestones)}),l=e.computed(()=>{var C;return(C=i.value)==null?void 0:C.find(g=>g.id===o.milestoneId)}),r=e.computed(()=>{var C;return(C=l.value)==null?void 0:C.activities});e.watch(r,(C,g)=>{Me(C,g)});const c=C=>{t("close",C)},u=()=>{const{name:C,rank:g}=ot(r.value??[],"activity",n);t("addActivity",{milestoneId:o.milestoneId,name:C,rank:g,projectId:o.projectId})},d=C=>{t("updateActivity",C)},p=C=>{r.value&&"moved"in C&&t("updateActivity",{id:C.moved.element.id,rank:pt(r.value,C.moved.newIndex)})},m=e.computed({get:()=>{var C;return(C=l.value)==null?void 0:C.color},set:C=>{l.value&&t("updateMilestone",{id:l.value.id,color:C})}}),f=e.computed({get:()=>{var C;return((C=l==null?void 0:l.value)==null?void 0:C.deadline)??""},set:C=>{l.value&&t("updateMilestone",{id:l.value.id,deadline:C!=null&&C.length?C:null})}}),b=C=>o.closedStatus?Ga(C,o.closedStatus):!1,v=e.computed(()=>{var C;return((C=o.users)==null?void 0:C.map(g=>({label:`${g.firstName} ${g.lastName}`,value:g.id,avatar:g.avatarUrl})))||[]}),y=e.computed({get(){var C,g;return(g=(C=l.value)==null?void 0:C.assignee)!=null&&g.id?[l.value.assignee.id]:[]},set(C){t("updateMilestone",{id:o.milestoneId,assigneeId:C[0]??null})}}),k=e.computed({get(){var C;return((C=l.value)==null?void 0:C.important)??!1},set(C){t("updateMilestone",{id:o.milestoneId,important:C})}});return(C,g)=>{var E;return e.openBlock(),e.createElementBlock("div",Xv,[e.createElementVNode("header",Qv,[e.createElementVNode("div",Jv,[e.createVNode(K,{"icon-name":"CloseRounded",variant:"ghost",size:"sm",class:"ao-milestone__close",onClick:c})]),e.createElementVNode("div",eh,[e.createElementVNode("div",th,[e.createVNode(ne,{title:((E=l.value)==null?void 0:E.name)||C.milestoneId,level:5},null,8,["title"]),e.createVNode(za,{modelValue:k.value,"onUpdate:modelValue":g[0]||(g[0]=B=>k.value=B),modelModifiers:{lazy:!0},disabled:!C.isEditable,class:"ao-milestone__important",color:"danger",label:C.$t("activity.important.label"),"icon-name":"FlagRounded",variant:"ghost",size:"sm"},null,8,["modelValue","disabled","label"])])]),l.value?(e.openBlock(),e.createElementBlock("div",ah,[e.createElementVNode("div",oh,[e.createElementVNode("label",nh,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[1]||(g[1]=B=>f.value=B),class:"ao-milestone__field ao-milestone__date-field",type:"date"},null,512),[[e.vModelText,f.value,void 0,{lazy:!0}]])])]),e.createElementVNode("div",sh,[e.createElementVNode("label",lh,[e.createVNode(ie,{modelValue:y.value,"onUpdate:modelValue":g[2]||(g[2]=B=>y.value=B),options:v.value,"close-on-select":!0,searchable:!0,max:1,class:"ao-milestone__field ao-milestone__multiselect",placeholder:C.$t("activity.filters.assignee.placeholder"),mode:"tags",disabled:!C.isEditable,caret:C.isEditable},{tag:e.withCtx(({option:B,handleTagRemove:V})=>[e.createVNode(we,{"user-name":B.label,"avatar-url":B.avatar,"is-closable":!0,onClose:I=>V(B,I)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["modelValue","options","placeholder","disabled","caret"])])]),e.createVNode(Gv,{color:m.value,"onUpdate:color":g[3]||(g[3]=B=>m.value=B)},null,8,["color"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ih,[e.createVNode(e.unref(xe),e.mergeProps({class:"ao-project-milestone__activities",list:r.value,disabled:!C.isEditable,"item-key":"id",group:"kanban"},C.$attrs,{onChange:p}),{item:e.withCtx(({element:B})=>{var V,I,P,R,j;return[e.createVNode(vo,{id:B.id,name:B.name||B.id,"phase-name":(V=s.value)==null?void 0:V.name,"milestone-name":(I=l.value)==null?void 0:I.name,"milestone-color":(P=l.value)==null?void 0:P.color,deadline:B.deadline,important:B.important,users:C.users,assignee:B.assignee,slug:B.slug,comments:(R=B.comments)==null?void 0:R.length,attachments:(j=B.attachments)==null?void 0:j.length,tasks:B.tasks,"is-editable":C.isEditable,"is-private":B.private,"is-closed":b(B),onClick:Z=>C.$router.push({name:e.unref(oe).activity,params:{milestoneId:C.milestoneId,activityId:B.id}}),onUpdateActivity:d,onRemoveAssignee:()=>d({id:B.id,assigneeId:null})},e.createSlots({_:2},[C.isEditable?{name:"secondary",fn:e.withCtx(()=>[C.isEditable&&B.active?(e.openBlock(),e.createBlock(K,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("archive"),onClick:e.withModifiers(()=>C.$emit("archiveActivity",{id:B.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0),C.isEditable&&!B.active?(e.openBlock(),e.createBlock(K,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:C.$t("feed.activity.unarchive"),onClick:e.withModifiers(()=>C.$emit("unarchiveActivity",{id:B.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1032,["id","name","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"]),C.isEditable?(e.openBlock(),e.createElementBlock("div",rh,[e.createVNode(We,{"icon-name":"Add",label:C.$t("project.activity.add"),onClick:u},null,8,["label"])])):e.createCommentVNode("",!0)])])}}});const ch=e.defineComponent({__name:"AoProjectOverviewActivityDetails",props:{phaseId:{},milestoneId:{},activityId:{},activityTypes:{},activities:{},isTaskCheckable:{type:Function},statuses:{},phases:{},users:{},project:{},userId:{},isEditable:{type:Boolean},attachmentEnabled:{type:Boolean}},emits:["update:activity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment"],setup(a,{emit:t}){const o=a,n=e.computed(()=>{var y;return(y=o.phases)==null?void 0:y.find(k=>k.id===o.phaseId)}),s=e.computed(()=>{var y;return(y=o.phases)==null?void 0:y.flatMap(k=>k.milestones)}),i=e.computed(()=>{var y;return(y=s.value)==null?void 0:y.find(k=>k.id===o.milestoneId)}),l=e.computed(()=>{var y;return(y=o.activities)==null?void 0:y.find(k=>k.id===o.activityId)}),r=y=>{t("update:activity",y)},c=y=>{t("addSubtask",y)},u=y=>{t("updateSubtask",y)},d=y=>{t("deleteSubtask",y)},p=y=>{t("addFiles",y)},m=y=>{t("removeFile",y)},f=y=>{t("addComment",y)},b=y=>{t("updateComment",y)},v=y=>{t("removeComment",y)};return(y,k)=>{var C,g;return l.value?(e.openBlock(),e.createBlock(co,{key:0,activity:l.value,"activity-types":y.activityTypes,"milestone-id":y.milestoneId,"template-activities":y.activities,"is-template":!1,users:y.users,"user-id":y.userId,"is-task-checkable":y.isTaskCheckable,statuses:y.statuses,breadcrumbs:`${(C=n.value)==null?void 0:C.name} / ${(g=i.value)==null?void 0:g.name}`,"is-editable":y.isEditable,"attachment-enabled":y.attachmentEnabled,projects:[y.project],onClose:y.$router.back,"onUpdate:activity":r,onAddSubtask:c,onUpdateSubtask:u,onDeleteSubtask:d,onAddFiles:p,onRemoveFile:m,onAddComment:f,onUpdateComment:b,onRemoveComment:v},{default:e.withCtx(E=>[e.renderSlot(y.$slots,"default",e.normalizeProps(e.guardReactiveProps(E)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects","onClose"])):e.createCommentVNode("",!0)}}}),dh={class:"ao-col-header"},uh=e.defineComponent({__name:"AoColHeader",props:{title:{},items:{}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("header",dh,[e.createVNode(ne,{title:t.title,class:"ao-col-header__title",level:4},null,8,["title"]),t.items?(e.openBlock(),e.createBlock(Tt,{key:0,label:t.items,class:"ao-col-header__items",variant:"solid",color:"primary"},null,8,["label"])):e.createCommentVNode("",!0)]))}});function ph(a){return e.getCurrentScope()?(e.onScopeDispose(a),!0):!1}function ma(a){return typeof a=="function"?a():e.unref(a)}const mh=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const fh=a=>a!=null,At=()=>{};function vh(a,t){function o(...n){return new Promise((s,i)=>{Promise.resolve(a(()=>t.apply(this,n),{fn:t,thisArg:this,args:n})).then(s).catch(i)})}return o}function hh(a,t={}){let o,n,s=At;const i=r=>{clearTimeout(r),s(),s=At};return r=>{const c=ma(a),u=ma(t.maxWait);return o&&i(o),c<=0||u!==void 0&&u<=0?(n&&(i(n),n=null),Promise.resolve(r())):new Promise((d,p)=>{s=t.rejectOnCancel?p:d,u&&!n&&(n=setTimeout(()=>{o&&i(o),n=null,d(r())},u)),o=setTimeout(()=>{n&&i(n),n=null,d(r())},c)})}}function Ch(a,t=200,o={}){return vh(hh(t,o),a)}function Ra(a){var t;const o=ma(a);return(t=o==null?void 0:o.$el)!=null?t:o}const gh=mh?window:void 0;function _h(){const a=e.ref(!1),t=e.getCurrentInstance();return t&&e.onMounted(()=>{a.value=!0},t),a}function yh(a){const t=_h();return e.computed(()=>(t.value,!!a()))}function bh(a,t,o={}){const{root:n,rootMargin:s="0px",threshold:i=.1,window:l=gh,immediate:r=!0}=o,c=yh(()=>l&&"IntersectionObserver"in l),u=e.computed(()=>{const b=ma(a);return(Array.isArray(b)?b:[b]).map(Ra).filter(fh)});let d=At;const p=e.ref(r),m=c.value?e.watch(()=>[u.value,Ra(n),p.value],([b,v])=>{if(d(),!p.value||!b.length)return;const y=new IntersectionObserver(t,{root:Ra(v),rootMargin:s,threshold:i});b.forEach(k=>k&&y.observe(k)),d=()=>{y.disconnect(),d=At}},{immediate:r,flush:"post"}):At,f=()=>{d(),m(),p.value=!1};return ph(f),{isSupported:c,isActive:p,pause(){d(),p.value=!1},resume(){p.value=!0},stop:f}}const wh={class:e.normalizeClass(["ao-list-kanban"])},kh={class:"ao-list-kanban__header"},$h={key:0,class:"ao-list-kanban__end ao-list-kanban__end--loading"},Eh={key:1,class:"ao-list-kanban__end"},Bh={key:0,class:"ao-list-kanban__no-more"},Vh={key:1,class:"ao-list-kanban__divider"},Sh={key:1,class:"ao-list-kanban__footer"},Nh=e.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"],setup(a,{emit:t}){const o=a,n=e.ref(!1),s=e.ref(null);bh(s,([{isIntersecting:d}])=>{n.value=d}),e.watch(n,d=>{d&&o.hasMore&&!o.isLoading&&t("loadMore")});const i=d=>{var p;return o.isEditable===!0?!0:o.userId&&o.isEditable==="only-own"?o.userId===((p=d.assignee)==null?void 0:p.id):!1},l=d=>{t("selectActivity",d)},r=d=>{t("updateActivity",d)},c=d=>{"added"in d?t("updateActivity",{id:d.added.element.id,statusId:o.status.id,rank:pt(o.list,d.added.newIndex)}):"removed"in d||"moved"in d&&t("updateActivity",{id:d.moved.element.id,rank:pt(o.list,d.moved.newIndex)})},u=e.ref(!1);return(d,p)=>(e.openBlock(),e.createElementBlock("div",wh,[d.title||d.$slots.header?e.renderSlot(d.$slots,"header",{key:0},()=>{var m;return[e.createElementVNode("div",kh,[d.title?(e.openBlock(),e.createBlock(uh,{key:0,title:d.title,level:3,items:(m=d.list)==null?void 0:m.length},null,8,["title","items"])):e.createCommentVNode("",!0)])]}):e.createCommentVNode("",!0),e.createVNode(e.unref(xe),e.mergeProps({class:["ao-list-kanban__list",u.value?"ao-list-kanban__transition":void 0],list:d.list,"item-key":"id",group:"kanban","ghost-class":"ao-list-kanban__ghost",animation:"200"},d.$attrs,{draggable:".ao-list-draggable",disabled:!d.isEditable,onChange:c,onStart:p[0]||(p[0]=m=>u.value=!0),onEnd:p[1]||(p[1]=m=>u.value=!1),"component-data":{tag:"transition-group",name:"ao-list-kanban__transition"}}),{item:e.withCtx(({element:m})=>{var f,b,v,y,k,C,g,E,B;return[e.createVNode(vo,{class:e.normalizeClass(i(m)?"ao-list-draggable":""),id:m.id,name:m.name,"project-name":(f=m.project)==null?void 0:f.name,"project-color":(b=m.project)==null?void 0:b.color,"phase-name":(y=(v=m.milestone)==null?void 0:v.phase)==null?void 0:y.name,"milestone-name":(k=m.milestone)==null?void 0:k.name,"milestone-color":(C=m.milestone)==null?void 0:C.color,deadline:m.deadline,rules:((g=m.rules)==null?void 0:g.length)||0,tasks:m.tasks,description:m.description,important:m.important,type:m.type,comments:(E=m.comments)==null?void 0:E.length,attachments:(B=m.attachments)==null?void 0:B.length,users:d.users,assignee:m.assignee,slug:m.slug,"is-editable":i(m),"is-private":m.private,"tag-type":d.tagType,onUpdateActivity:[V=>i(m)&&r(V),()=>i(m)&&r],onClick:()=>l(m.id),onRemoveAssignee:()=>i(m)&&r({id:m.id,assigneeId:null})},{secondary:e.withCtx(()=>[i(m)&&m.active?(e.openBlock(),e.createBlock(K,{key:0,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:d.$t("feed.activity.archive"),onClick:e.withModifiers(()=>d.$emit("archiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0),i(m)&&!m.active?(e.openBlock(),e.createBlock(K,{key:1,color:"primary",variant:"ghost","icon-name":"ArchiveOutlineRounded",size:"sm","icon-position":"start",corners:"round",label:d.$t("feed.activity.unarchive"),onClick:e.withModifiers(()=>d.$emit("unarchiveActivity",{id:m.id}),["stop"])},null,8,["label","onClick"])):e.createCommentVNode("",!0)]),_:2},1032,["class","id","name","project-name","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:e.withCtx(()=>[d.isLoading?(e.openBlock(),e.createElementBlock("div",$h,[e.createVNode(Q,{name:"Loading"})])):d.hasMore?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"scrollEnd",ref:s,class:"ao-list-kanban__end"},null,512)):(e.openBlock(),e.createElementBlock("div",Eh,[d.noMoreLabel?(e.openBlock(),e.createElementBlock("span",Bh,e.toDisplayString(d.noMoreLabel),1)):d.isEditable?(e.openBlock(),e.createElementBlock("span",Vh)):e.createCommentVNode("",!0)]))]),_:1},16,["class","list","disabled"]),d.$slots.footer||d.footerLabel?(e.openBlock(),e.createElementBlock("div",Sh,[e.renderSlot(d.$slots,"footer",{},()=>[d.isEditable?(e.openBlock(),e.createBlock(We,{key:0,"icon-name":"AddBoxOutlineRounded",label:d.footerLabel,onClick:p[2]||(p[2]=m=>d.$emit("add"))},null,8,["label"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]))}});const Mh={class:"ao-field ao-search-field"},Ah=["value","placeholder","onKeypress"],Th=e.defineComponent({__name:"AoSearchField",props:{modelValue:{},delay:{default:250},placeholder:{default:"Search"}},emits:["update:modelValue","clear"],setup(a,{emit:t}){const o=a,n=async l=>{const c=l.target.value;t("update:modelValue",c,l)},s=Ch(n,o.delay),i=l=>{t("clear",l)};return(l,r)=>(e.openBlock(),e.createElementBlock("div",Mh,[e.createElementVNode("input",{value:l.modelValue,type:"text",class:"ao-field__input ao-search-field__input",placeholder:l.placeholder,onInput:r[0]||(r[0]=(...c)=>e.unref(s)&&e.unref(s)(...c)),onKeypress:e.withKeys(n,["enter"])},null,40,Ah),e.createVNode(Q,{name:"SearchRounded",class:e.normalizeClass(`ao-search-field__icon ao-search-field__action ${l.modelValue?"":"ao-search-field__action--visible"}`)},null,8,["class"]),e.createVNode(K,{"icon-name":"CloseRounded",size:"sm",color:"primary",corners:"round",class:e.normalizeClass(`ao-search-field__button ao-search-field__action ${l.modelValue?"ao-search-field__action--visible":""}`),onClick:i},null,8,["class"])]))}});const Oh={class:"ao-feed"},Ih={class:"ao-feed__filters"},Lh={class:"ao-feed__body"},Fn=e.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}},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"],setup(a,{emit:t}){const o=a,{t:n}=Ye();function s($,T){t("toast",$,T)}const i=e.toRef(o,"activities"),l=async($,T)=>{await t("selectActivity",$,T)},r=e.ref({}),c=e.ref(!1),u=e.ref(!1),d=e.computed(()=>o.project?"milestone":"project");e.watch([()=>o.statuses,()=>o.activities,()=>o.initialActivityId,()=>o.initialActivitySlug],async([$,T,_,N],[Y,x])=>{r.value=Object.fromEntries($.map(D=>[D.id,T.filter(S=>{var H;return((H=S.status)==null?void 0:H.id)===D.id})])),_&&!c.value?(l(_,null),c.value=!0):N&&!c.value&&(l(null,N),c.value=!0),u.value&&Me(T,x)},{immediate:!0});const p=e.computed(()=>{var $;return!o.selectedActivity||!o.selectedActivity.milestone?"":`${(($=o.selectedActivity.milestone.phase)==null?void 0:$.name)??""} / ${o.selectedActivity.milestone.name??""}`}),m=$=>{var x,D;const T=(x=o.activities)==null?void 0:x.at(-1),_=T?se.LexoRank.parse(T.rank).genNext():se.LexoRank.middle(),N=((D=o.activities)==null?void 0:D.length)??0,Y={name:n("activity.defaultName",{idx:N+1}),rank:_.format(),statusId:$.id};o.filters.assigneeId.length>0&&(Y.assigneeId=o.filters.assigneeId[0]),o.filters.projectId.length>0&&(Y.projectId=o.filters.projectId[0]),o.filters.typeId.length>0&&(Y.typeId=o.filters.typeId[0]),u.value=!0,t("addActivity",Y)},f=($,T)=>{u.value=!1,t("update:filters",{...o.filters,[$]:T})},b=e.computed(()=>o.project?[o.project]:o.projects??[]),v=e.computed(()=>b.value.map($=>({value:$.id,label:$.name}))),y=e.computed(()=>{var $;return($=o.activityTypes)==null?void 0:$.map(T=>({value:T.id,label:T.name}))}),k=e.computed(()=>o.users.map($=>({value:$.id,label:`${$.firstName} ${$.lastName}`,avatar:$.avatarUrl}))),C=$=>{o.selectedActivity&&t("update:activity",$)},g=$=>{t("update:activity",$)},E=$=>{t("archiveActivity",$)},B=$=>{t("unarchiveActivity",$)},V=$=>{u.value=!1,t("update:searchText",$)},I=$=>{u.value=!1,t("clear:searchText",$)},P=$=>{o.selectedActivity&&t("addSubtask",$)},R=$=>{o.selectedActivity&&t("updateSubtask",$)},j=$=>{o.selectedActivity&&t("deleteSubtask",$)},Z=$=>{t("addFiles",$)},O=$=>{t("removeFile",$)},F=$=>{o.selectedActivity&&t("addComment",{...$,activityId:o.selectedActivity.id})},q=$=>{const{id:T}=o.selectedActivity||{};T&&t("updateComment",$)},z=$=>{const{id:T}=o.selectedActivity||{};T&&t("removeComment",$)},U=Ht.useRouter(),h=e.ref("feed"),M=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(h,$=>{$==="feed"?(U.push({name:oe.feed}),console.log("Navigating to feed...")):$==="overview"?(U.push({name:oe.project}),console.log("Navigating to feed...")):$==="mapping"&&(U.push({name:oe.mapping}),console.log("Navigating to feed..."))}),($,T)=>{var _;return e.openBlock(),e.createElementBlock("div",Oh,[e.createVNode(Zt,null,{primary:e.withCtx(()=>[e.createElementVNode("div",Ih,[e.createVNode(fo,{tabs:M,modelValue:h.value,"onUpdate:modelValue":T[0]||(T[0]=N=>h.value=N)},null,8,["modelValue"]),e.createVNode(Th,{"model-value":$.searchText,placeholder:$.$t("feed.search.placeholder"),class:"ao-feed__search","onUpdate:modelValue":V,onClear:I},null,8,["model-value","placeholder"]),o.project?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ie,{key:0,"model-value":$.filters[e.unref(Je).project],mode:"tags",options:v.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__projects",placeholder:$.$t("feed.filters.project.placeholder"),"onUpdate:modelValue":T[1]||(T[1]=N=>f(e.unref(Je).project,N))},null,8,["model-value","options","placeholder"])),y.value?(e.openBlock(),e.createBlock(ie,{key:1,"model-value":$.filters[e.unref(Je).type],mode:"tags",options:y.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__types",placeholder:$.$t("feed.filters.activityType.placeholder"),"onUpdate:modelValue":T[2]||(T[2]=N=>f(e.unref(Je).type,N))},null,8,["model-value","options","placeholder"])):e.createCommentVNode("",!0),k.value.length?(e.openBlock(),e.createBlock(ie,{key:2,"model-value":$.filters[e.unref(Je).assignee],mode:"tags",options:k.value,"close-on-select":!1,searchable:!0,class:"ao-feed__filter ao-feed__filter__assignees",placeholder:$.$t("feed.filters.assignee.placeholder"),"onUpdate:modelValue":T[3]||(T[3]=N=>f(e.unref(Je).assignee,N))},{tag:e.withCtx(({option:N,handleTagRemove:Y})=>[e.createVNode(we,{"user-name":N.label,"avatar-url":N.avatar,"is-closable":!0,onClose:x=>Y(N,x)},null,8,["user-name","avatar-url","onClose"])]),_:1},8,["model-value","options","placeholder"])):e.createCommentVNode("",!0)]),e.createVNode(K,{class:"ao-feed__only-non-assigned",size:"sm","icon-name":$.showsOnlyNonAssigned?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:$.$t("feed.filters.showsOnlyNonAssigned.label"),role:"checkbox","aria-checked":$.showsOnlyNonAssigned,onClick:T[4]||(T[4]=N=>$.$emit("update:showsOnlyNonAssigned",!$.showsOnlyNonAssigned))},null,8,["icon-name","label","aria-checked"]),e.createVNode(K,{class:"ao-feed__only-important",size:"sm","icon-name":$.showsOnlyImportant?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:$.$t("feed.filters.showsOnlyImportant.label"),role:"checkbox","aria-checked":$.showsOnlyImportant,onClick:T[5]||(T[5]=N=>$.$emit("update:showsOnlyImportant",!$.showsOnlyImportant))},null,8,["icon-name","label","aria-checked"]),e.createVNode(K,{class:"ao-feed__show-archived",size:"sm","icon-name":$.showsArchivedActivities?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:$.$t("feed.filters.showsArchivedActivities.label"),role:"checkbox","aria-checked":$.showsArchivedActivities,onClick:T[6]||(T[6]=N=>$.$emit("update:showsArchivedActivities",!$.showsArchivedActivities))},null,8,["icon-name","label","aria-checked"])]),_:1}),e.createElementVNode("div",Lh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.statuses,N=>(e.openBlock(),e.createBlock(Nh,{key:N.id,status:N,list:r.value[N.id],title:N.name,"footer-label":$.$t("feed.activity.add"),users:$.users,"user-id":$.userId,"is-editable":$.isEditable,tagType:d.value,onAdd:()=>m(N),onSelectActivity:l,onArchiveActivity:E,onUnarchiveActivity:B,onUpdateActivity:g},null,8,["status","list","title","footer-label","users","user-id","is-editable","tagType","onAdd"]))),128))]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[$.selectedActivity?(e.openBlock(),e.createBlock(co,{key:0,activity:$.selectedActivity,"activity-types":$.activityTypes,"milestone-id":(_=$.selectedActivity.milestone)==null?void 0:_.id,"template-activities":i.value,users:$.users,"user-id":$.userId,"is-task-checkable":$.isTaskCheckable,statuses:$.statuses,breadcrumbs:p.value,"is-editable":$.isEditable,"attachment-enabled":$.attachmentEnabled,projects:b.value,onClose:T[7]||(T[7]=()=>l(null,null)),"onUpdate:activity":C,onAddSubtask:P,onUpdateSubtask:R,onDeleteSubtask:j,onAddFiles:Z,onRemoveFile:O,onAddComment:F,onUpdateComment:q,onRemoveComment:z,onToast:s},{default:e.withCtx(N=>[e.renderSlot($.$slots,"activityDetailsBody",e.normalizeProps(e.guardReactiveProps(N)))]),_:3},8,["activity","activity-types","milestone-id","template-activities","users","user-id","is-task-checkable","statuses","breadcrumbs","is-editable","attachment-enabled","projects"])):e.createCommentVNode("",!0)]))])}}});const Dh={class:"ao-project"},Ph={class:"ao-project__body"},Hh=["src","alt"],Rh=e.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","addMilestone","updateMilestone","archiveMilestone","addActivity","update:activity","archiveActivity","copyPhaseToTemplate","unarchiveActivity","addSubtask","updateSubtask","deleteSubtask","addFiles","removeFile","addComment","updateComment","removeComment","applyTemplate","saveTemplate","update:showsArchived"],setup(a,{emit:t}){const o=a,{t:n}=Ye(),s=e.computed(()=>o.phases.flatMap(E=>E.milestones)),i=()=>{const{name:E,rank:B}=ot(o.phases,"phase",n);t("addPhase",{name:E,rank:B,projectId:o.project.id})},l=E=>{t("updatePhase",E)},r=E=>{t("archivePhase",E)},c=E=>{t("unarchivePhase",E)},u=E=>{t("copyPhaseToTemplate",E)},d=E=>{t("addMilestone",E)},p=E=>{t("updateMilestone",E)},m=E=>{t("archiveMilestone",E)};e.computed(()=>s.value.flatMap(E=>E.activities));const f=e.ref(!1),b=e.ref(!1),v=(E,B)=>{t("applyTemplate",{templateId:E,projectId:B}),f.value=!1},y=(E,B)=>{var P;const V=(P=o.templates)==null?void 0:P.at(-1),I=V?se.LexoRank.parse(V.rank).genNext():se.LexoRank.middle();t("saveTemplate",{templateName:E,rank:I.format(),phaseIds:B}),b.value=!1},k=Ht.useRouter(),C=e.ref("mapping"),g=[{label:"Overview",value:"overview"},{label:"Feed",value:"feed"},{label:"Mapping",value:"mapping"}];return e.watch(C,E=>{E==="feed"?(k.push({name:oe.feed}),console.log("Navigating to feed...")):E==="overview"?(k.push({name:oe.project}),console.log("Navigating to feed...")):E==="mapping"&&(k.push({name:oe.mapping}),console.log("Navigating to feed..."))}),(E,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",e.mergeProps({class:"ao-project-overview"},E.$attrs),[e.createElementVNode("div",Dh,[e.createVNode(Zt,null,{primary:e.withCtx(()=>[e.createVNode(fo,{tabs:g,modelValue:C.value,"onUpdate:modelValue":B[0]||(B[0]=V=>C.value=V)},null,8,["modelValue"]),e.createVNode(K,{class:"ao-feed__show-archived",size:"sm","icon-name":E.showsArchived?"CheckBoxOutlineRounded":"CheckBoxOutlineBlank","icon-position":"start",color:"primary",variant:"ghost",label:E.$t("feed.filters.showsArchived.label"),role:"checkbox","aria-checked":E.showsArchived,onClick:B[1]||(B[1]=V=>E.$emit("update:showsArchived",!E.showsArchived))},null,8,["icon-name","label","aria-checked"])]),secondary:e.withCtx(()=>[E.isEditable===!0?(e.openBlock(),e.createBlock(K,{key:0,class:"ao-project-overview__save-as-template",color:"primary",label:E.$t("project.template.save.label"),onClick:B[2]||(B[2]=V=>b.value=!0)},null,8,["label"])):e.createCommentVNode("",!0),E.isEditable===!0?(e.openBlock(),e.createBlock(K,{key:1,class:"ao-project-overview__add-template",color:"primary",label:E.$t("project.template.apply.label"),onClick:B[3]||(B[3]=V=>f.value=!0)},null,8,["label"])):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Ph,[e.createVNode(mo,{phases:E.phases,"closed-status":E.closedStatus,"is-editable":E.isEditable===!0,users:E.users,onAddMilestone:d,onUpdateMilestone:p,onArchiveMilestone:m,onAddPhase:i,onUpdatePhase:l,onArchivePhase:r,onUnarchivePhase:c,onCopyPhaseToTemplate:u},null,8,["phases","closed-status","is-editable","users"]),E.project.architectureImage?(e.openBlock(),e.createElementBlock("img",{key:0,class:"architecture-image",src:E.project.architectureImage.url,alt:e.unref(n)("architectureImage.alt")},null,8,Hh)):e.createCommentVNode("",!0)])])],16),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[b.value?(e.openBlock(),e.createBlock(jn,{key:0,phases:E.phases,onClose:B[4]||(B[4]=V=>b.value=!1),onSave:y},null,8,["phases"])):e.createCommentVNode("",!0),f.value?(e.openBlock(),e.createBlock(Rn,{key:1,"project-id":E.project.id,templates:E.templates,onClose:B[5]||(B[5]=V=>f.value=!1),onApply:v},null,8,["project-id","templates"])):e.createCommentVNode("",!0)]))],64))}});const tt={TEMPLATES:"templates",TEMPLATE_DETAILS:"template_details",TEMPLATES_LIST:"templates_list"},jh=(a,t={})=>[{path:a,name:tt.TEMPLATES,redirect:{name:tt.TEMPLATES_LIST},...t,children:[{path:"",name:tt.TEMPLATES_LIST,component:Un},{path:":templateId/:phaseId?/:milestoneId?/:activityId?",name:tt.TEMPLATE_DETAILS,component:Hn,props:!0}]}],oe={project:"AoProject",feed:"AoProjectFeed",mapping:"AoProjectMapping",milestone:"AoMilestone",activity:"AoActivity"},Fh=(a,t={})=>[{path:a,...t,redirect:{name:oe.project},children:[{path:"",name:oe.project,component:av,props:!0,children:[{path:":phaseId/:milestoneId",name:oe.milestone,component:Xo,props:!0},{path:":phaseId/:milestoneId/:activityId",name:oe.activity,props:{default:!0,modal:!0},components:{default:Xo,modal:ch}}]},{path:"feed",name:oe.feed,component:Fn,props:!0},{path:"mapping",name:oe.mapping,component:Rh,props:!0}]}],Uh={class:"ao-templates"},Un=e.defineComponent({__name:"AoTemplatesList",props:{templates:{}},emits:["addTemplate","updateTemplates","updateItem","removeItem"],setup(a,{emit:t}){const o=a,{t:n}=Ye();e.watch(()=>o.templates,(c,u)=>{Me(c,u)});const s=()=>{var m,f;const c=(m=o.templates)==null?void 0:m.at(-1),u=c?se.LexoRank.parse(c.rank).genNext():se.LexoRank.middle(),d=((f=o.templates)==null?void 0:f.length)??0,p={name:n("template.defaultName.template",{idx:d+1}),rank:u.format()};t("addTemplate",p)},i=(c,u)=>{t("updateItem",{itemType:ee.TEMPLATES,id:c,templateId:c,data:{name:u}})},l=(c,u)=>{t("removeItem",{itemType:ee.TEMPLATES,templateId:c,data:{id:c,...u?{name:u}:{}}})},r=c=>{if(c.moved){const u=Ut(c,o.templates??[]);t("updateItem",{itemType:ee.TEMPLATES,id:c.moved.element.id,templateId:c.moved.element.id,data:{rank:u}})}};return(c,u)=>(e.openBlock(),e.createElementBlock("div",Uh,[e.createVNode(Zt,null,{secondary:e.withCtx(()=>[e.createVNode(K,{label:c.$t("templates.new"),color:"primary","icon-name":"Add","icon-position":"start",onClick:s},null,8,["label"])]),_:1}),e.createVNode(e.unref(xe),{"model-value":c.templates,class:"ao-templates__list","item-key":"id",handle:".ao-card__drag",onChange:r},{item:e.withCtx(({element:d})=>{var p;return[e.createVNode(b3,{id:d.id,title:d.name,phases:d.phases,milestones:(p=d.phases)!=null&&p.length?e.unref(q0)(d.phases):0,activities:d.phases?e.unref(Y0)(d.phases):0,"updated-at":d.updatedAt,"updated-by":d.updatedBy,onUpdateTitle:m=>i(d.id,m),onClick:m=>c.$router.push({name:e.unref(tt).TEMPLATE_DETAILS,params:{templateId:d.id}}),onDeleteItem:u[0]||(u[0]=(m,f)=>l(m,f))},null,8,["id","title","phases","milestones","activities","updated-at","updated-by","onUpdateTitle","onClick"])]}),_:1},8,["model-value"])]))}});const Zh={class:"ao-field__label"},Zn=e.defineComponent({__name:"AoField",props:{label:{},isMultiselect:{type:Boolean,default:!1}},setup(a){return(t,o)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(["ao-field",{"ao-field--multiselect":t.isMultiselect}])},[e.createElementVNode("span",Zh,e.toDisplayString(t.label),1),e.renderSlot(t.$slots,"default")],2))}}),zh=["type","value","disabled","readonly"],xh=e.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(a,{emit:t}){const o=a,n=e.computed(()=>o.modelModifiers.lazy?"change":"input"),s=i=>{o.modelModifiers.number&&(i=Number(i)),t("update:modelValue",i)};return(i,l)=>(e.openBlock(),e.createBlock(Zn,{label:i.label},{default:e.withCtx(()=>[e.createElementVNode("input",e.mergeProps({class:"ao-field__input",type:i.type,value:i.modelValue,disabled:i.isDisabled,readonly:i.isReadonly},{[e.toHandlerKey(n.value)]:l[0]||(l[0]=r=>s(r.target.value))}),null,16,zh)]),_:1},8,["label"]))}}),Wh={class:"ao-field"},qh={class:"ao-field__label"},Yh=["checked","disabled"],Kh=e.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(a){return(t,o)=>(e.openBlock(),e.createElementBlock("label",Wh,[e.createElementVNode("span",qh,e.toDisplayString(t.label),1),e.createElementVNode("input",{class:"ao-field__input",type:"checkbox",checked:t.modelValue,disabled:t.isDisabled,onChange:o[0]||(o[0]=n=>{var s;return t.$emit("update:modelValue",((s=n.target)==null?void 0:s.checked)??!1)})},null,40,Yh)]))}});exports.AoAvatar=we;exports.AoCardFeed=vo;exports.AoCheckboxField=Kh;exports.AoFeed=Fn;exports.AoField=Zn;exports.AoInputField=xh;exports.AoMultiselect=ie;exports.AoProjectPhases=mo;exports.AoTemplateDetails=Hn;exports.AoTemplates=is;exports.AoTemplatesList=Un;exports.TemplateItemTypeEnum=nn;exports.activityFeedStatus=r2;exports.durationTypes=i2;exports.feedFilterTypes=Je;exports.getProjectOverviewRoutes=Fh;exports.getTemplateRoutes=jh;exports.listUpdateTypes=c2;exports.milestoneStatus=sa;exports.projectOverviewRoutes=oe;exports.ruleComparators=tn;exports.ruleDurationUnits=on;exports.ruleTriggerTypes=an;exports.templateItemType=ee;exports.templateRouteNames=tt;
|