(function(X,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(X=typeof globalThis<"u"?globalThis:X||self,e(X.Vue3ColorPicker={},X.Vue))})(this,function(X,e){"use strict";const xe={key:1,width:"16",height:"16",viewBox:"-12 -4 32 32",xmlns:"http://www.w3.org/2000/svg"},$e=[e.createElementVNode("path",{d:"M11.9995 16.8001C11.2995 16.8001 10.5995 16.5301 10.0695 16.0001L3.54953 9.48014C3.25953 9.19014 3.25953 8.71014 3.54953 8.42014C3.83953 8.13014 4.31953 8.13014 4.60953 8.42014L11.1295 14.9401C11.6095 15.4201 12.3895 15.4201 12.8695 14.9401L19.3895 8.42014C19.6795 8.13014 20.1595 8.13014 20.4495 8.42014C20.7395 8.71014 20.7395 9.19014 20.4495 9.48014L13.9295 16.0001C13.3995 16.5301 12.6995 16.8001 11.9995 16.8001Z"},null,-1)],Me=e.defineComponent({__name:"ColorInputMenu",props:{iconClass:{default:"",type:String},inputType:{default:"RGB",type:String}},emits:["onChangeInputName"],setup(a,{emit:p}){const c=a,r=e.ref(c.inputType),s=["CMYK","HSL","HSV","RGB"],i=p,f=()=>{const y=s.findIndex(o=>o==r.value),C=s[y+1]?s[y+1]:s[0];r.value=C,i("onChangeInputName",C)};return(y,C)=>(e.openBlock(),e.createElementBlock("button",{type:"button",class:"cp-btn",onClick:f},[e.createTextVNode(e.toDisplayString(r.value)+" ",1),a.iconClass?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.iconClass)},null,2)):(e.openBlock(),e.createElementBlock("svg",xe,$e))]))}}),Ee={class:"ck-cp-menu"},Ie={class:"ck-cp-controller-bar",style:{display:"flex","justify-content":"end",position:"relative","flex-grow":"1"}},Se={key:1,width:"16",height:"16",viewBox:"-12 -4 32 32",xmlns:"http://www.w3.org/2000/svg"},ve=[e.createElementVNode("path",{d:"M11.9995 16.8001C11.2995 16.8001 10.5995 16.5301 10.0695 16.0001L3.54953 9.48014C3.25953 9.19014 3.25953 8.71014 3.54953 8.42014C3.83953 8.13014 4.31953 8.13014 4.60953 8.42014L11.1295 14.9401C11.6095 15.4201 12.3895 15.4201 12.8695 14.9401L19.3895 8.42014C19.6795 8.13014 20.1595 8.13014 20.4495 8.42014C20.7395 8.71014 20.7395 9.19014 20.4495 9.48014L13.9295 16.0001C13.3995 16.5301 12.6995 16.8001 11.9995 16.8001Z"},null,-1)],Le={key:1,width:"16",height:"16",viewBox:"-12 -4 32 32",xmlns:"http://www.w3.org/2000/svg"},De=[e.createElementVNode("path",{d:"M11.9995 16.8001C11.2995 16.8001 10.5995 16.5301 10.0695 16.0001L3.54953 9.48014C3.25953 9.19014 3.25953 8.71014 3.54953 8.42014C3.83953 8.13014 4.31953 8.13014 4.60953 8.42014L11.1295 14.9401C11.6095 15.4201 12.3895 15.4201 12.8695 14.9401L19.3895 8.42014C19.6795 8.13014 20.1595 8.13014 20.4495 8.42014C20.7395 8.71014 20.7395 9.19014 20.4495 9.48014L13.9295 16.0001C13.3995 16.5301 12.6995 16.8001 11.9995 16.8001Z"},null,-1)],He={key:1,width:"15",height:"28",viewBox:"0 -3 36 36",xmlns:"http://www.w3.org/2000/svg"},Te=[e.createStaticVNode('',6)],Re={key:0,class:"ck-cp-linear-angle-container"},Pe={class:"ck-gradient-set-label",style:{"margin-top":"0"}},Oe=["value"],Ye={key:1,class:"ck-cp-linear-angle-container"},Xe={class:"ck-gradient-set-label",style:{"margin-top":"0"}},Ue=["value"],Ge={class:"ck-gradient-set-label"},ze=["value"],Ae=e.defineComponent({__name:"PickerMenu",props:{mode:{default:"gradient",type:String},inputType:{default:"RGB",type:String},gradientType:{default:"linear",type:String},showInputMenu:{default:!0,type:Boolean},showPickerMode:{default:!0,type:Boolean},angle:{default:90,type:Number},percentageX:{default:50,type:Number},percentageY:{default:50,type:Number},local:{default:{},type:Object},iconClasses:{default:{ruler:"",eyeDroper:"",arrowDown:"",save:"",delete:""},type:Object}},emits:["onPickerChangeMode","onChangeMode","onChangeInputType","onDeleteColor","onClickEyeDropper","update:angle","update:percentageX","update:percentageY","onInput"],setup(a,{emit:p}){const c=a,r=e.ref(!1),s=p,i=(o,m)=>{switch(m){case"angle":s("update:angle",parseInt(o.target.value)),s("onInput");break;case"percentageX":s("update:percentageX",parseInt(o.target.value)),s("onInput");break;case"percentageY":s("update:percentageY",parseInt(o.target.value)),s("onInput");break}},f=o=>{s("onChangeInputType",o)},y=()=>{s("onChangeMode",c.gradientType=="linear"?"radial":"linear")},C=()=>{s("onPickerChangeMode",c.mode=="gradient"?"solid":"gradient")};return(o,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",Ee,[e.createElementVNode("div",Ie,[a.showPickerMode?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"cp-btn",onClick:C,style:{"margin-bottom":"var(--margin-top)"}},[e.withDirectives(e.createElementVNode("span",null,e.toDisplayString(a.local.gradient?a.local.gradient:"Gradient"),513),[[e.vShow,a.mode=="gradient"]]),e.withDirectives(e.createElementVNode("span",null,e.toDisplayString(a.local.solid?a.local.solid:"Solid"),513),[[e.vShow,a.mode=="solid"]]),a.iconClasses.arrowDown?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.iconClasses.arrowDown)},null,2)):(e.openBlock(),e.createElementBlock("svg",Se,ve))])):e.createCommentVNode("",!0),a.mode=="gradient"?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"cp-btn",style:{"margin-bottom":"var(--margin-top)"},onClick:y},[e.withDirectives(e.createElementVNode("span",null,e.toDisplayString(a.local.linear?a.local.linear:"Linear"),513),[[e.vShow,a.gradientType=="linear"]]),e.withDirectives(e.createElementVNode("span",null,e.toDisplayString(a.local.radial?a.local.radial:"Radial"),513),[[e.vShow,a.gradientType=="radial"]]),a.iconClasses.arrowDown?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.iconClasses.arrowDown)},null,2)):(e.openBlock(),e.createElementBlock("svg",Le,De))])):e.createCommentVNode("",!0),a.showInputMenu?(e.openBlock(),e.createBlock(Me,{key:2,style:{"margin-bottom":"var(--margin-top)"},iconClass:a.iconClasses.arrowDown,inputType:a.inputType,onOnChangeInputName:f},null,8,["iconClass","inputType"])):e.createCommentVNode("",!0),a.mode=="gradient"?(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"cp-btn",style:{"margin-bottom":"var(--margin-top)"},onClick:m[0]||(m[0]=k=>r.value=!r.value)},[a.iconClasses.ruler?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.iconClasses.ruler)},null,2)):(e.openBlock(),e.createElementBlock("svg",He,Te))])):e.createCommentVNode("",!0)])]),a.mode=="gradient"?e.withDirectives((e.openBlock(),e.createElementBlock("div",Re,[e.createElementVNode("div",null,[e.createElementVNode("p",Pe,[e.createTextVNode(e.toDisplayString(a.local.angle?a.local.angle:"Angle")+" ",1),e.createElementVNode("span",null,e.toDisplayString(a.angle)+"°",1)]),e.createElementVNode("input",{type:"range",min:"0",max:"360",value:a.angle,onInput:m[1]||(m[1]=k=>i(k,"angle"))},null,40,Oe)])],512)),[[e.vShow,a.gradientType=="linear"&&r.value]]):e.createCommentVNode("",!0),a.mode=="gradient"&&r.value?e.withDirectives((e.openBlock(),e.createElementBlock("div",Ye,[e.createElementVNode("div",null,[e.createElementVNode("p",Xe,[e.createTextVNode(e.toDisplayString(a.local.positionX?a.local.positionX:"Position X")+" ",1),e.createElementVNode("span",null,e.toDisplayString(a.percentageX)+"%",1)]),e.createElementVNode("input",{type:"range",min:"0",max:"100",value:a.percentageX,onInput:m[2]||(m[2]=k=>i(k,"percentageX"))},null,40,Ue)]),e.createElementVNode("div",null,[e.createElementVNode("p",Ge,[e.createTextVNode(e.toDisplayString(a.local.positionY?a.local.positionY:"Position Y")+" ",1),e.createElementVNode("span",null,e.toDisplayString(a.percentageY)+"%",1)]),e.createElementVNode("input",{type:"range",min:"0",max:"100",value:a.percentageY,onInput:m[3]||(m[3]=k=>i(k,"percentageY"))},null,40,ze)])],512)),[[e.vShow,a.gradientType=="radial"]]):e.createCommentVNode("",!0)],64))}}),Fe=e.defineComponent({__name:"GradientBar",emits:["onAddColor","onMouseDown"],setup(a,{emit:p}){const c=e.inject("gradientBar"),r=s=>{s.preventDefault()};return(s,i)=>(e.openBlock(),e.createElementBlock("div",{class:"gradient-bar",onMousedown:i[1]||(i[1]=f=>s.$emit("onMouseDown",f)),onDragstart:r},[e.createElementVNode("div",{ref_key:"gradientBar",ref:c,class:"gradient-container",onDblclick:i[0]||(i[0]=f=>s.$emit("onAddColor",f))},null,544)],32))}}),We=e.createElementVNode("div",{class:"colour-area-mask"},null,-1),je=e.defineComponent({__name:"PickerWrap",emits:["onMouseDown"],setup(a){const p=e.inject("canvas"),c=e.inject("pickerWrap"),r=e.inject("pickerPointer"),s=i=>{i.preventDefault()};return(i,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"pickerWrap",ref:c,class:"cp-picker-wrap",onMousedown:f[0]||(f[0]=y=>i.$emit("onMouseDown",y)),onDragstart:s},[e.createElementVNode("canvas",{ref_key:"canvas",ref:p,class:"colour-area"},null,512),We,e.createElementVNode("div",{ref_key:"pickerPointer",ref:r,class:"colour-area-point-circle"},null,512)],544))}}),qe={class:"picker-hue"},Ze=["value"],Ke=e.defineComponent({__name:"PickerHue",props:{modelValue:{default:0,type:Number}},emits:["update:modelValue","onInput","onChange"],setup(a,{emit:p}){const c=p,r=s=>{c("update:modelValue",parseFloat(s.target.value)),c("onInput",s)};return(s,i)=>(e.openBlock(),e.createElementBlock("div",qe,[e.createElementVNode("input",{value:a.modelValue,class:"picker-hue-range-slider",type:"range",min:"0",max:"360",step:"0.1",onInput:r,onChange:i[0]||(i[0]=f=>s.$emit("onChange",f))},null,40,Ze)]))}}),Je={class:"opacity-bar"},Qe=["value"],_e=e.defineComponent({__name:"OpacityBar",props:{modelValue:{default:0,type:Number}},emits:["update:modelValue","onInput"],setup(a,{emit:p}){const c=e.inject("opacitySlider"),r=p,s=i=>{r("update:modelValue",parseInt(i.target.value)),r("onInput",i)};return(i,f)=>(e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("input",{ref_key:"opacitySlider",ref:c,value:a.modelValue,class:"opacity_slider",type:"range",min:"0",max:"100",onInput:s},null,40,Qe)]))}}),et={class:"ck-cp-input-content"},tt={class:"ck-cp-input-label"},lt=["min","max","value"],v=e.defineComponent({__name:"InputNumber",props:{label:{default:"",type:String},modelValue:{default:0,type:Number},min:{default:0,type:Number},max:{default:100,type:Number}},emits:["update:modelValue"],setup(a,{emit:p}){const c=a,r=p,s=e.ref(c.modelValue);e.watch(()=>c.modelValue,(o,m)=>{o!==m&&(s.value=o)},{immediate:!0});const i=o=>{const m=E=>{s.value=E,r("update:modelValue",E)},k=o.target.value;if(!k)return m(c.modelValue);if(parseInt(k)>c.max)return m(c.max);r("update:modelValue",parseInt(k))},f=o=>{s.value=o.target.value},y=o=>{if(["KeyE","Equal","Equal","Backslash","Slash","NumpadDecimal","NumpadAdd"].includes(o.code))return o.preventDefault();o.code==="Enter"&&i(o)},C=i;return(o,m)=>(e.openBlock(),e.createElementBlock("div",et,[e.createElementVNode("span",tt,e.toDisplayString(a.label),1),e.createElementVNode("input",{type:"number",min:a.min,max:a.max,value:s.value,onInput:f,onKeydown:y,onFocusout:m[0]||(m[0]=(...k)=>e.unref(C)&&e.unref(C)(...k))},null,40,lt)]))}}),nt={class:"ck-cp-input-content color-hex"},at=e.createElementVNode("span",{class:"ck-cp-input-label"},"HEX",-1),ot=["value"],rt=e.defineComponent({__name:"InputHex",props:{modelValue:{}},emits:["update:modelValue"],setup(a,{emit:p}){const c=a,r=p,s=e.ref(""),i=o=>{const m=o.target.value;s.value=m,s.value=`#${m.replace(/#/g,"")}`},f=o=>{const m=o.target.value;if(m===c.modelValue)return;if(!/^#[0-9a-fA-F]+$/.test(m)){s.value=c.modelValue;return}let k=m.replace(/#/g,"");switch(k.length){case 0:k=c.modelValue.replace("#","");break;case 1:case 2:k=k.repeat(3);break;case 4:case 5:k=k.slice(0,3);break;case 3:case 6:break;default:k=k.slice(0,6)}s.value=`#${k.toUpperCase()}`,r("update:modelValue",s.value)},y=o=>{o.code==="Enter"&&f(o)},C=f;return e.watch(()=>c.modelValue,(o,m)=>{o!==m&&(s.value=o)},{immediate:!0}),(o,m)=>(e.openBlock(),e.createElementBlock("div",nt,[at,e.createElementVNode("input",{type:"text",value:s.value,onInput:i,onKeydown:y,onFocusout:m[0]||(m[0]=(...k)=>e.unref(C)&&e.unref(C)(...k))},null,40,ot)]))}}),st=a=>{const p=/^rgb\((\s*\d+\s*),(\s*\d+\s*),(\s*\d+\s*)\)$/i;if(!p.test(a))return null;const c=p.exec(a);if(!c)return null;const r=parseInt(c[1].trim(),10),s=parseInt(c[2].trim(),10),i=parseInt(c[3].trim(),10);return{r,g:s,b:i}},ct=a=>{const p=/^rgba?\((\s*\d+\s*),(\s*\d+\s*),(\s*\d+\s*),(\s*[\d.]+\s*)\)$/i;if(!p.test(a))return null;const c=p.exec(a);if(!c)return null;const r=parseInt(c[1].trim(),10),s=parseInt(c[2].trim(),10),i=parseInt(c[3].trim(),10),f=parseFloat(c[4].trim());return{r,g:s,b:i,a:f}},it=a=>{const p=/^#?([a-f\d]{8})$/i;if(!p.test(a))return null;const c=p.exec(a);if(!c)return null;const r=c[1],s=r.substring(6,8),i=parseInt(r.substring(0,2),16),f=parseInt(r.substring(2,4),16),y=parseInt(r.substring(4,6),16),C=parseInt(s,16)/255;return{r:i,g:f,b:y,a:C}},dt=(a,p,c,r)=>{function s(o){const m=o.toString(16);return m.length===1?"0"+m:m}const i=s(Math.round(a)),f=s(Math.round(p)),y=s(Math.round(c)),C=s(Math.round(r*255));return`#${i}${f}${y}${C}`},Q=a=>{var p;try{let c=(p=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(f,y,C,o)=>"#"+y+y+C+C+o+o).substring(1).match(/.{2}/g))==null?void 0:p.map(f=>parseInt(f,16)),r=c==null?void 0:c[0],s=c==null?void 0:c[1],i=c==null?void 0:c[2];return Number.isNaN(r)||Number.isNaN(s)||Number.isNaN(i)||r===void 0||s===void 0||i===void 0?null:{r,g:s,b:i}}catch{return null}},G=(a,p,c)=>{a=a/255,p=p/255,c=c/255;const r=Math.max(a,p,c),s=Math.min(a,p,c);let i;return r===a?i=(p-c)/(r-s):r===p?i=2+(c-a)/(r-s):i=4+(a-p)/(r-s),i*=60,i<0&&(i+=360),Number.isNaN(i)&&(i=0),i},ut=(a,p,c)=>{p=p/100,c=c/100;let r,s,i,f=[];return r=(1-Math.abs(2*c-1))*p,s=r*(1-Math.abs(a/60%2-1)),i=c-r/2,a>=0&&a<60&&(f=[r,s,0]),a>=60&&a<120&&(f=[s,r,0]),a>=120&&a<180&&(f=[0,r,s]),a>=180&&a<240&&(f=[0,s,r]),a>=240&&a<300&&(f=[s,0,r]),a>=300&&a<=360&&(f=[r,0,s]),f.map(y=>Math.round(255*(y+i)))},ne=(a,p,c)=>"#"+(16777216+(c|p<<8|a<<16)).toString(16).slice(1),ie=(a,p,c)=>{let r=ut(a,p,c);return{rgb:r,hexA:ne(r[0],r[1],r[2])}},de=(a,p,c)=>{let r,s,i,f,y,C,o=0,m=[];for(m[0]=a/255,m[1]=p/255,m[2]=c/255,r=m[0],s=m[0],C=0,i=0;i=s&&(s=m[i+1],C=i+1);return C===0&&(o=(m[1]-m[2])/(s-r)),C===1&&(o=2+(m[2]-m[0])/(s-r)),C===2&&(o=4+(m[0]-m[1])/(s-r)),isNaN(o)&&(o=0),o=o*60,o<0&&(o=o+360),f=(r+s)/2,r===s?y=0:f<.5?y=(s-r)/(s+r):y=(s-r)/(2-s-r),y=y,{h:o,s:y,l:f}},ue=(a,p,c)=>{a=a%360/360,p=Math.min(1,Math.max(0,p)),c=Math.min(1,Math.max(0,c));let r,s,i;if(p===0)r=s=i=c;else{const f=(o,m,k)=>(k<0&&(k+=1),k>1&&(k-=1),k<.16666666666666666?o+(m-o)*6*k:k<.5?m:k<.6666666666666666?o+(m-o)*(.6666666666666666-k)*6:o),y=c<.5?c*(1+p):c+p-c*p,C=2*c-y;r=f(C,y,a+1/3),s=f(C,y,a),i=f(C,y,a-1/3)}return r=Math.round(r*255),s=Math.round(s*255),i=Math.round(i*255),{r,g:s,b:i}},pt=(a,p,c)=>{let r=0,s=0,i=0;const f=a/60,y=c*p,C=y*(1-Math.abs(f%2-1)),o=c-y;switch(Math.floor(f)%6){case 0:r=y,s=C,i=0;break;case 1:r=C,s=y,i=0;break;case 2:r=0,s=y,i=C;break;case 3:r=0,s=C,i=y;break;case 4:r=C,s=0,i=y;break;case 5:r=y,s=0,i=C;break}return{r:Math.round((r+o)*255),g:Math.round((s+o)*255),b:Math.round((i+o)*255)}},mt=(a,p,c)=>{a/=255,p/=255,c/=255;const r=Math.max(a,p,c),s=Math.min(a,p,c);let i,f,y=r;const C=r-s;if(r!==0)f=C/r;else return{h:0,s:0,v:0};return C===0?i=0:r===a?i=60*((p-c)/C%6):r===p?i=60*((c-a)/C+2):i=60*((a-p)/C+4),i<0&&(i+=360),{h:Math.round(i),s:Math.round(f*100)/100,v:Math.round(y*100)/100}},gt=(a,p,c)=>{const r=(2-p)*c/2,s=r&&r<1?p*c/(r<.5?r*2:2-r*2):p;return{h:a,s,l:r}},ft=(a,p,c,r)=>{const s=Math.round(255*(1-a)*(1-r)),i=Math.round(255*(1-p)*(1-r)),f=Math.round(255*(1-c)*(1-r));return{r:Math.min(255,Math.max(0,s)),g:Math.min(255,Math.max(0,i)),b:Math.min(255,Math.max(0,f))}},ht=(a,p,c)=>{a=a/255,p=p/255,c=c/255;const r=1-Math.max(a,p,c),s=(1-a-r)/(1-r),i=(1-p-r)/(1-r),f=(1-c-r)/(1-r);return{c:isNaN(s)?0:s,m:isNaN(i)?0:i,y:isNaN(f)?0:f,k:isNaN(r)?0:r}},kt={class:"ck-cp-local-color-conatiner"},yt={class:"ck-cp-color-list-label"},Ct={style:{display:"flex","align-items":"center"}},bt={key:1,width:"32",height:"14",viewBox:"5 -5 32 32",xmlns:"http://www.w3.org/2000/svg"},Vt=[e.createElementVNode("path",{d:"M11.9995 16.8001C11.2995 16.8001 10.5995 16.5301 10.0695 16.0001L3.54953 9.48014C3.25953 9.19014 3.25953 8.71014 3.54953 8.42014C3.83953 8.13014 4.31953 8.13014 4.60953 8.42014L11.1295 14.9401C11.6095 15.4201 12.3895 15.4201 12.8695 14.9401L19.3895 8.42014C19.6795 8.13014 20.1595 8.13014 20.4495 8.42014C20.7395 8.71014 20.7395 9.19014 20.4495 9.48014L13.9295 16.0001C13.3995 16.5301 12.6995 16.8001 11.9995 16.8001Z"},null,-1)],wt={key:1,width:"18",height:"18",viewBox:"-2 -2 30 30",xmlns:"http://www.w3.org/2000/svg"},Bt=[e.createStaticVNode('',5)],Nt={class:"ck-cp-color-list"},xt=["onClick"],$t={key:1,width:"25",height:"25",viewBox:"2 2 20 20",xmlns:"http://www.w3.org/2000/svg"},Mt=[e.createElementVNode("path",{d:"M18 12.75H6C5.59 12.75 5.25 12.41 5.25 12C5.25 11.59 5.59 11.25 6 11.25H18C18.41 11.25 18.75 11.59 18.75 12C18.75 12.41 18.41 12.75 18 12.75Z"},null,-1),e.createElementVNode("path",{d:"M12 18.75C11.59 18.75 11.25 18.41 11.25 18V6C11.25 5.59 11.59 5.25 12 5.25C12.41 5.25 12.75 5.59 12.75 6V18C12.75 18.41 12.41 18.75 12 18.75Z"},null,-1)],Et=e.defineComponent({__name:"HistoryColorList",props:{colorListCount:{default:10,type:Number},hexVal:{default:"",type:String},title:{default:"",type:String},iconClasses:{default:{ruler:"",eyeDroper:"",arrowDown:"",save:"",delete:""},type:Object}},emits:["color-item-click"],setup(a,{emit:p}){const c=a,r=p,s=e.ref([]),i=e.computed(()=>s.value.some(o=>o.selected==!0)),f=()=>{if(!s.value.find(m=>m.color===c.hexVal)){const m=s.value.find(k=>k.selected==!0);if(m)m.color=c.hexVal;else{s.value.length===c.colorListCount&&s.value.pop();let k=c.hexVal;s.value.unshift({color:k,selected:!1})}localStorage.setItem("ck-cp-local-color-list",JSON.stringify(s.value.map(k=>k.color)))}},y=()=>{s.value=s.value.filter(o=>o.selected==!1),localStorage.setItem("ck-cp-local-color-list",JSON.stringify(s.value.map(o=>o.color)))},C=o=>{s.value.forEach(m=>{m.color===o?m.selected=!m.selected:m.selected=!1}),r("color-item-click",o)};return e.onBeforeMount(()=>{let o=localStorage.getItem("ck-cp-local-color-list");if(o){let m=JSON.parse(o);s.value=m.map(k=>({color:k,selected:!1}))}}),(o,m)=>(e.openBlock(),e.createElementBlock("div",kt,[e.createElementVNode("div",yt,[e.createElementVNode("div",Ct,[e.createTextVNode(e.toDisplayString(a.title?a.title:"Color Palette")+" ",1),a.iconClasses.arrowDown?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.iconClasses.arrowDown)},null,2)):(e.openBlock(),e.createElementBlock("svg",bt,Vt))]),i.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"cp-main-btn",onClick:y,style:{width:"17.33px",height:"17.33px"}},[a.iconClasses.delete?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.iconClasses.delete)},null,2)):(e.openBlock(),e.createElementBlock("svg",wt,Bt))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,k=>(e.openBlock(),e.createElementBlock("div",{key:`color-${k.color}`,class:e.normalizeClass(["ck-cp-color-item",k.selected?"ck-select":""]),style:e.normalizeStyle({backgroundColor:k.color}),onClick:E=>C(k.color)},null,14,xt))),128)),e.createElementVNode("button",{type:"button",class:"cp-btn-save-color",onClick:f},[a.iconClasses.save?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.iconClasses.save)},null,2)):(e.openBlock(),e.createElementBlock("svg",$t,Mt))])])]))}}),It=["cp-theme"],St={key:0,style:{display:"flex","align-items":"center",gap:"8px","margin-top":"calc(var(--margin-top) * 1.35)",padding:"var(--padding)"}},vt={key:1,width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Lt=[e.createStaticVNode('',5)],Dt={style:{display:"flex","align-items":"center",gap:"8px","margin-top":"calc(var(--margin-top) * 1.35)",padding:"var(--padding)"}},Ht=e.createElementVNode("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"3 2 28 28"},[e.createElementVNode("path",{d:"M27.014 2.891l-0.058-0.058c-1.106-1.11-2.911-1.11-4.022 0l-2.515 2.515-0.072-0.072c-0.603-0.603-1.584-0.603-2.216 0.024-0.599 0.603-0.599 1.584 0 2.187l0.072 0.072-8.034 8.039c-1.135 1.13-1.878 2.617-2.1 4.2l-1.217 1.453c-0.483 0.483-0.483 1.265 0 1.743 0.241 0.246 0.565 0.367 0.883 0.367 0.304 0 0.608-0.111 0.826-0.338l1.487-1.241c1.584-0.227 3.071-0.97 4.205-2.1l8.034-8.039 0.072 0.072c0.299 0.299 0.69 0.449 1.086 0.449 0.401 0 0.811-0.159 1.13-0.478 0.29-0.29 0.449-0.676 0.449-1.091s-0.159-0.801-0.449-1.096l-0.072-0.068 2.515-2.515c1.106-1.11 1.106-2.916-0.005-4.027zM13.568 18.997c-1.014 1.014-2.356 1.671-3.78 1.844-0.092 0.014-0.179 0.048-0.251 0.111l-1.622 1.361c-0.106 0.106-0.275 0.106-0.381 0-0.101-0.106-0.101-0.275 0.029-0.41l1.337-1.593c0.058-0.072 0.097-0.159 0.106-0.251 0.174-1.424 0.83-2.766 1.844-3.78l8.039-8.034 2.718 2.718-8.039 8.034z"}),e.createElementVNode("path",{d:"M5.804 24.979c-0.275 0.328-1.651 2.023-1.651 2.998 0 1.115 0.908 2.023 2.018 2.023 1.115 0 2.023-0.908 2.023-2.023 0-0.975-1.376-2.67-1.651-2.998-0.183-0.222-0.555-0.222-0.739 0z"})],-1),Tt={style:{"flex-grow":"1",display:"flex","flex-direction":"column",gap:"calc(var(--margin-top) * 1.85)"}},Rt={id:"ck-cp-target-background"},Pt={key:1,class:"ck-cp-input-container"},Ot={key:3,class:"ck-cp-buttons"},Yt=e.defineComponent({__name:"Vue3ColorPicker",props:{modelValue:{default:"",type:String},mode:{default:"gradient",type:String},type:{default:"HEX8",type:String},inputType:{default:"RGB",type:String},theme:{default:"light",type:String},colorListCount:{default:15,type:Number},showColorList:{default:!0,type:Boolean},showEyeDrop:{default:!0,type:Boolean},showPickerMode:{default:!0,type:Boolean},showAlpha:{default:!0,type:Boolean},showInputMenu:{default:!0,type:Boolean},showInputSet:{default:!0,type:Boolean},disabled:{default:!1,type:Boolean},gradientMode:{default:"linear",type:String},local:{default:{angle:"",positionX:"",positionY:"",solid:"",gradient:"",linear:"",radial:"",colorPalette:"",btnSaveLabel:"Save",btnCancelLabel:"Cancel"},type:Object},iconClasses:{default:{linear:"",radial:"",ruler:"",eyeDroper:"",inputMenu:"",save:"",delete:""},type:Object},showButtons:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(a,{emit:p}){const c=a,r=e.ref(null),s=p,i=e.ref(c.mode),f=e.ref(c.modelValue),y=e.ref(c.modelValue),C=n=>{f.value=n,c.showButtons||(y.value=n,s("update:modelValue",n))},o=e.ref([{id:1,r:68,g:71,b:119,a:100,percent:0,hue:0,select:!0},{id:2,r:0,g:0,b:255,a:100,percent:100,hue:0,select:!1}]),m=e.ref(!1),k=e.ref(c.gradientMode),E=e.reactive({angle:90,percentageX:50,percentageY:50}),P=e.ref(""),x=e.ref(c.inputType),F=e.ref(!1),pe=e.ref(),_=e.ref(),U=e.ref(),T=e.ref(),N=e.ref(),I=e.reactive({h:0,s:0,l:0}),M=e.reactive({h:0,s:0,v:0}),$=e.reactive({c:0,m:0,y:0,k:0});e.provide("gradientBar",_),e.provide("canvas",U),e.provide("pickerWrap",T),e.provide("pickerPointer",N),e.provide("opacitySlider",pe);let W=0,j=0,me=0,ge=0,q=0,Z=0;const Xt=n=>{!T.value||!N.value||(q=T.value.offsetHeight-N.value.offsetHeight,Z=T.value.offsetWidth-N.value.offsetWidth,me=n.clientX-n.target.getBoundingClientRect().left,ge=n.clientY-n.target.getBoundingClientRect().top,W=me-N.value.offsetWidth/2,j=ge-N.value.offsetHeight/2,N.value.style.left=`${W}px`,N.value.style.top=`${j}px`,ae(!1),A(),window.addEventListener("mousemove",fe),window.addEventListener("mouseup",he))},fe=n=>{n.preventDefault();const t=T.value.getBoundingClientRect(),l=n.clientX-t.left-N.value.offsetWidth/2,d=n.clientY-t.top-N.value.offsetHeight/2;l>=0&&l<=Z?(W=l,N.value.style.left=`${l}px`):0>l?(W=0,N.value.style.left="0px"):l>Z&&(W=Z,N.value.style.left=`${Z}px`),d>=0&&d<=q?(j=d,N.value.style.top=`${d}px`):0>d?(j=0,N.value.style.top="0px"):d>q&&(j=q,N.value.style.top=`${q}px`),ae(!1),A()},he=()=>{window.removeEventListener("mousemove",fe),window.removeEventListener("mouseup",he)},ae=n=>{if(!n){let t=Ut();const l=ue(O.value,t.s,t.l);if(l){if(F.value){let d=o.value.find(u=>u.select==!0);d&&(d.r=l.r,d.g=l.g,d.b=l.b)}H(),S()}}},O=e.ref(0),oe=async n=>{const{rgb:t}=ie(O.value,100,50);we(t),setTimeout(()=>{ae(n),A()},0)},Ut=()=>{let n={s:0,l:0},t=T.value.offsetWidth-N.value.offsetWidth,l=T.value.offsetHeight-N.value.offsetHeight,d=parseInt(N.value.style.left),g=1-parseInt(N.value.style.top)/l,b=d/t;return n.l=g/2*(2-b),n.s=g*b/(1-Math.abs(2*n.l-1)),Number.isNaN(n.s)&&(n.s=n.l),n.l=n.l>1?1:n.l,n.s=n.s>1?1:n.s,n},K=()=>{const n=o.value.find(t=>t.select==!0);if(n){const{l:t,s:l}=de(n.r,n.g,n.b);let d=t,u=l;Number.isNaN(u)&&(u=d);let g={x:0,y:0},b=T.value.offsetWidth-N.value.offsetWidth,B=T.value.offsetHeight-N.value.offsetHeight;const[V,h]=2*d-1<0?[b*2*u/(1+u),B*(1-d*(1+u))]:[-b*2*(d-1)*u/(d+u-d*u),B*(d-1)*(u-1)];return g.x=V,g.y=h,g}else return null},Gt=()=>{const n=o.value.find(t=>t.select==!0);n&&(n.hue=O.value)},z=e.ref(100),zt=n=>{if(c.showAlpha){const t=n.target,l=o.value.find(d=>d.select==!0);l&&(l.a=parseInt(t.value),S())}},At=n=>{var l,d,u,g;const t=(d=(l=r.value)==null?void 0:l.querySelector(".gradient-handle-content"))==null?void 0:d.getBoundingClientRect();return n===0?"0px":n===100&&t?`${(((u=_.value)==null?void 0:u.offsetWidth)||0)-(t.width||0)}px`:`${(((g=_.value)==null?void 0:g.offsetWidth)||0)*(n/100)-((t==null?void 0:t.width)||0)/2}px`};let L=null,D=null;const ke=n=>{var d,u;const l=n.target.offsetParent;if((d=l==null?void 0:l.id)!=null&&d.includes("clr-gb-")){const g=l.id.replace("clr-gb-","");D=l;const b=o.value.find(B=>B.select==!0);if(b&&b.id!=g){const B=(u=r.value)==null?void 0:u.querySelector(".gradient-handle.select");B==null||B.classList.remove("select"),l.classList.add("select");const V=o.value.findIndex(h=>h.select==!0);for(let h=0;h{window.removeEventListener("mousemove",ye),window.removeEventListener("mouseup",ke)},ye=n=>{var g,b;n.preventDefault();const t=(b=(g=r.value)==null?void 0:g.querySelector(".gradient-handle-content"))==null?void 0:b.getBoundingClientRect(),l=L==null?void 0:L.getBoundingClientRect(),d=(l==null?void 0:l.width)-(t==null?void 0:t.width);let u=n.clientX-((l==null?void 0:l.left)||0)-((t==null?void 0:t.width)||0)/2;if(u<0?u=0:u>d&&(u=d),D){D.style.left=`${u}px`;const B=parseFloat((u/((l==null?void 0:l.width)-(t==null?void 0:t.width))*100).toFixed(0)),V=o.value.find(h=>h.id==(D==null?void 0:D.id.replace("clr-gb-","")));V&&(V.percent=B),S()}},Wt=n=>{var B,V;const t=L==null?void 0:L.getBoundingClientRect(),l=Math.round((n.clientX-((t==null?void 0:t.left)||0))/((t==null?void 0:t.width)||1)*100),d=o.value.findIndex(h=>h.select==!0),u=o.value[d],g={id:Date.now(),r:u.r,g:u.g,b:u.b,a:u.a,percent:l,hue:u.hue,select:!0};o.value[d].select=!1;const b=(B=r.value)==null?void 0:B.querySelector(".gradient-handle.select");b==null||b.classList.remove("select"),o.value=[...o.value,g],Ve(g),D=(V=r.value)==null?void 0:V.querySelector(`#clr-gb-${g.id}`),S()},Ce=n=>{if(n.r==0&&n.g==0&&n.b==0)return!0;if(n.r==255&&n.g==255&&n.b==255)return!0;{const t=U.value.getContext("2d",{willReadFrequently:!0}),l=U.value.width,d=U.value.height,u=t.getImageData(0,0,l,d).data,g=n.r,b=n.g,B=n.b;for(let V=0;V{setTimeout(()=>{if(Ce({r:n,g:t,b:l})){let g=K();g&&(N.value.style.left=`${g.x}px`,N.value.style.top=`${g.y}px`)}else{let g=K();g&&(N.value.style.left=`${g.x}px`,N.value.style.top=`${g.y}px`),O.value=d,oe(u)}},0)},be=()=>{o.value.forEach(l=>Ve(l)),jt();const n=o.value[0];O.value=n.hue,oe(!0);let t=K();t&&(N.value.style.left=`${t.x}px`,N.value.style.top=`${t.y}px`),H(),S()},Ve=n=>{if(i.value=="gradient"){let t=document.createElement("div");t.id=`clr-gb-${n.id}`,t.classList.add("gradient-handle"),t.style.left=At(n.percent);let l=document.createElement("div");l.classList.add("gradient-handle-content"),n.select==!0&&t.classList.add("select"),t.appendChild(l),L&&L.appendChild(t)}},we=n=>{const t=U.value.getContext("2d",{willReadFrequently:!0}),l=U.value.width,d=U.value.height;t.fillStyle=`rgb(${n[0]},${n[1]},${n[2]})`,t.fillRect(0,0,l,d);let u=t.createLinearGradient(0,0,l-12,0);u.addColorStop(0,"rgb(255,255,255)"),u.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=u,t.fillRect(0,0,l,d);let g=t.createLinearGradient(0,0,0,d);g.addColorStop(0,"rgba(0,0,0,0)"),g.addColorStop(1,"rgb(0,0,0)"),t.fillStyle=g,t.fillRect(0,0,l,d)},H=()=>{if(c.showAlpha){let n=o.value.find(t=>t.select==!0);n&&(pe.value.style.background=` linear-gradient(90deg,rgba(255, 255, 255, 0) 0%, rgba(${n.r}, ${n.g}, ${n.b}, 100) 97%)`)}},S=()=>{var n;if(i.value=="gradient"){o.value.sort((u,g)=>u.percent-g.percent);let t="linear-gradient(90deg, ",l;if(k.value=="linear"){l=`linear-gradient(${E.angle}deg, `;for(let u=0;u{o.value.forEach(n=>{n.hue=G(n.r,n.g,n.b)})},qt=n=>{k.value=n,S()},Be=()=>{var n,t;if(o.value.length>2){const l=o.value.findIndex(d=>d.select==!0);if(l!==-1){const d=o.value[l].id;o.value.splice(l,1);const u=(n=r.value)==null?void 0:n.querySelector(`#clr-gb-${d}`);u==null||u.remove();const g=o.value[0];g&&(g.select=!0,D=(t=r.value)==null?void 0:t.querySelector(`#clr-gb-${g.id}`),D==null||D.classList.add("select"),Y(g.r,g.g,g.b,g.hue,!1),A(),S())}}},re=()=>{var l;const n=(l=r.value)==null?void 0:l.querySelector("#cp-btn-eyedropper");n==null||n.classList.add("active"),new EyeDropper().open().then(d=>{const{sRGBHex:u}=d,g=o.value.find(B=>B.select==!0),b=Q(u);if(b){const B=G(b.r,b.g,b.b);if(g&&(g.hue=B,g.r=b.r,g.g=b.g,g.b=b.b),Ce(b)){const V=K();V&&(N.value.style.left=`${V.x}px`,N.value.style.top=`${V.y}px`)}else{O.value=B;const{rgb:V}=ie(B,100,50);we(V);const h=K();h&&(N.value.style.left=`${h.x}px`,N.value.style.top=`${h.y}px`)}A(),H(),S(),n==null||n.classList.remove("active")}}).catch(()=>{n==null||n.classList.remove("active")})},ee=(n,t)=>{if(t!="a"){const l=o.value.find(d=>d.select==!0);if(l){const d=G(l.r,l.g,l.b);l.hue=d,Y(l.r,l.g,l.b,l.hue,!0),S(),H()}}else z.value=n,S(),H()},se=()=>{const n=o.value.find(t=>t.select==!0);if(n&&!Number.isNaN(I.h)&&!Number.isNaN(I.s)&&!Number.isNaN(I.l)){const{r:t,g:l,b:d}=ue(I.h,I.s/100,I.l/100);n.hue=I.h,n.r=t,n.g=l,n.b=d,Y(n.r,n.g,n.b,n.hue,!0),S(),H()}},ce=()=>{const n=o.value.find(t=>t.select==!0);if(n&&!Number.isNaN(M.h)&&!Number.isNaN(M.s)&&!Number.isNaN(M.v)){const{r:t,g:l,b:d}=pt(M.h,M.s/100,M.v/100),{h:u}=gt(M.h,M.s/100,M.v/100);n.hue=u,n.r=t,n.g=l,n.b=d,Y(n.r,n.g,n.b,n.hue,!0),S(),H()}},te=()=>{const n=o.value.find(t=>t.select==!0);if(n&&!Number.isNaN($.c)&&!Number.isNaN($.m)&&!Number.isNaN($.y)&&!Number.isNaN($.k)){const{r:t,g:l,b:d}=ft($.c/100,$.m/100,$.y/100,$.k/100),u=G(t,l,d);n.hue=u,n.r=t,n.g=l,n.b=d,Y(n.r,n.g,n.b,n.hue,!0),S(),H()}},Zt=()=>{if(P.value){const n=Q(P.value);if(n){const t=G(n.r,n.g,n.b),l=o.value.find(d=>d.select==!0);l&&(l.r=n.r,l.g=n.g,l.b=n.b,l.hue=t,Y(n.r,n.g,n.b,l.hue,!0),S(),H(),J(x.value))}}},A=()=>{const n=o.value.find(t=>t.select==!0);n&&(P.value=ne(n.r,n.g,n.b).toUpperCase()),J(x.value)},Kt=n=>{P.value=n;let t=Q(P.value);if(t){const l=G(t.r,t.g,t.b),d=o.value.find(u=>u.select==!0);d&&(d.r=t.r,d.g=t.g,d.b=t.b,d.hue=l,Y(t.r,t.g,t.b,d.hue,!0),S(),H())}};window.EyeDropper&&(m.value=!0);const Jt=(n="")=>{if(i.value=="gradient"){let t=n?n.includes("linear-gradient")?"linear":"radial":c.gradientMode,l=[];if(k.value=t,t=="linear"){let d=/^linear-gradient\((.*)\)$/,u=n.replace(";","").trim().match(d),g=/,\s*(?![^()]*\))/;if(u){let b=u[1].split(g);for(let B=0;BR.trim()!==""),h.r=parseInt(w[0]),h.g=parseInt(w[1]),h.b=parseInt(w[2]),h.a=parseFloat(w[3])*100,h.percent=parseInt(w[4]),l.push(h)}else if(V.includes("rgb")){let w=V.trim().replace(/rgb|\(|\)|%/g,"").replace(/,/g," ").split(" ");w=w.filter(R=>R.trim()!==""),h.r=parseInt(w[0]),h.g=parseInt(w[1]),h.b=parseInt(w[2]),h.percent=parseInt(w[3]),l.push(h)}}}}else{let d=/^radial-gradient\((.*)\)$/,u=n.replace(";","").trim().match(d),g=/,\s*(?![^()]*\))/;if(u){let b=u[1].split(g);for(let B=0;BR.trim()!==""),h.r=parseInt(w[0]),h.g=parseInt(w[1]),h.b=parseInt(w[2]),h.a=parseFloat(w[3])*100,h.percent=parseInt(w[4]),l.push(h)}else if(V.includes("rgb")){let w=V.replace(/rgb|\(|\)|%/g,"").replace(/,/g," ").split(" ");w=w.filter(R=>R.trim()!==""),h.r=parseInt(w[0]),h.g=parseInt(w[1]),h.b=parseInt(w[2]),h.percent=parseInt(w[3]),l.push(h)}}}}l.length>1&&(o.value=l,o.value[0].select=!0,z.value=o.value[0].a)}else if(n){let t={r:0,g:0,b:0,a:0};if(n.includes("#"))if(n.length>=8)t=it(n);else{let l=Q(n);l?(t.a=1,t.r=l.r,t.g=l.g,t.b=l.b):t=null}else if(n.includes("rgb"))if(n.includes("rgba"))t=ct(n);else{let l=st(n);l?(t.a=1,t.r=l.r,t.g=l.g,t.b=l.b):t=null}t&&(o.value[0].r=t.r,o.value[0].b=t.b,o.value[0].g=t.g,o.value[0].a=parseInt((t.a*100).toFixed(0)),z.value=o.value[0].a,o.value[0].hue=0)}},J=n=>{const t=o.value.find(l=>l.select==!0);if(t){switch(n){case"RGB":break;case"HSL":{const{h:l,s:d,l:u}=de(t.r,t.g,t.b);I.h=Math.round(l),I.s=Math.round(d*100),I.l=Math.round(u*100);break}case"HSV":{const{h:l,s:d,v:u}=mt(t.r,t.g,t.b);M.h=Math.round(l),M.s=Math.round(d*100),M.v=Math.round(u*100);break}case"CMYK":{const{c:l,m:d,y:u,k:g}=ht(t.r,t.g,t.b);$.c=Math.round(l*100),$.m=Math.round(d*100),$.y=Math.round(u*100),$.k=Math.round(g*100)}break}x.value=n}},Qt=n=>{i.value=n,setTimeout(()=>{var t;i.value=="gradient"&&(L=(t=r.value)==null?void 0:t.querySelector(".gradient-bar")),le(c.modelValue),J(x.value)},0)},le=n=>{n&&Jt(n),be()},_t=()=>{y.value=f.value,s("update:modelValue",y.value)},Ne=()=>{o.value.forEach(n=>{const t=L==null?void 0:L.querySelector(`#clr-gb-${n.id}`);t==null||t.remove()})},el=()=>{f.value=y.value,Ne(),le(f.value)};return e.watch(()=>c.modelValue,(n,t)=>{n!==t&&n!==y.value&&(Ne(),le(n))}),e.onMounted(()=>{var n;i.value=="gradient"&&(L=(n=r.value)==null?void 0:n.querySelector(".gradient-bar")),le(c.modelValue),J(x.value),F.value=!0}),(n,t)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["ck-cp-container",a.disabled?"ck-cp-disabled ":""]),ref_key:"pickerTemplateRef",ref:r,"cp-theme":a.theme},[e.createVNode(Ae,{angle:E.angle,"onUpdate:angle":t[0]||(t[0]=l=>E.angle=l),percentageX:E.percentageX,"onUpdate:percentageX":t[1]||(t[1]=l=>E.percentageX=l),percentageY:E.percentageY,"onUpdate:percentageY":t[2]||(t[2]=l=>E.percentageY=l),local:a.local,iconClasses:a.iconClasses,inputType:x.value,mode:i.value,showInputMenu:a.showInputMenu,gradientType:k.value,showPickerMode:a.showPickerMode,onOnChangeMode:qt,onOnInput:S,onOnClickEyeDropper:re,onOnDeleteColor:Be,onOnChangeInputType:J,onOnPickerChangeMode:Qt},null,8,["angle","percentageX","percentageY","local","iconClasses","inputType","mode","showInputMenu","gradientType","showPickerMode"]),e.createVNode(je,{onOnMouseDown:Xt}),i.value=="gradient"?(e.openBlock(),e.createElementBlock("div",St,[e.createElementVNode("button",{type:"button",class:"cp-main-btn",onClick:Be},[a.iconClasses.delete?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.iconClasses.delete)},null,2)):(e.openBlock(),e.createElementBlock("svg",vt,Lt))]),e.createVNode(Fe,{onOnAddColor:Wt,onOnMouseDown:ke})])):e.createCommentVNode("",!0),e.createElementVNode("div",Dt,[m.value&&a.showEyeDrop?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",id:"cp-btn-eyedropper",class:"cp-main-btn",onClick:re},[a.iconClasses.eyeDroper?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass(a.iconClasses.eyeDroper)},null,2)):e.createCommentVNode("",!0),Ht])):e.createCommentVNode("",!0),e.createElementVNode("div",Tt,[e.createVNode(Ke,{modelValue:O.value,"onUpdate:modelValue":t[3]||(t[3]=l=>O.value=l),showEyeDrop:a.showEyeDrop,isEyeDropperUsing:m.value,onOnInput:t[4]||(t[4]=l=>oe(!1)),onOnChange:Gt,onOnClickEyeDropper:re},null,8,["modelValue","showEyeDrop","isEyeDropperUsing"]),a.showAlpha?(e.openBlock(),e.createBlock(_e,{key:0,modelValue:z.value,"onUpdate:modelValue":t[5]||(t[5]=l=>z.value=l),onOnInput:zt},null,8,["modelValue"])):e.createCommentVNode("",!0)])]),e.withDirectives(e.createElementVNode("div",Rt,null,512),[[e.vShow,!1]]),F.value&&a.showInputSet?(e.openBlock(),e.createElementBlock("div",Pt,[x.value!=="CMYK"?(e.openBlock(),e.createBlock(rt,{key:0,modelValue:P.value,"onUpdate:modelValue":[t[6]||(t[6]=l=>P.value=l),Zt]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="RGB"?(e.openBlock(),e.createBlock(v,{key:1,label:"R",min:0,max:255,modelValue:o.value.find(l=>l.select==!0).r,"onUpdate:modelValue":[t[7]||(t[7]=l=>o.value.find(d=>d.select==!0).r=l),t[8]||(t[8]=l=>ee(l,"r"))]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="RGB"?(e.openBlock(),e.createBlock(v,{key:2,label:"G",min:0,max:255,modelValue:o.value.find(l=>l.select==!0).g,"onUpdate:modelValue":[t[9]||(t[9]=l=>o.value.find(d=>d.select==!0).g=l),t[10]||(t[10]=l=>ee(l,"g"))]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="RGB"?(e.openBlock(),e.createBlock(v,{key:3,label:"B",min:0,max:255,modelValue:o.value.find(l=>l.select==!0).b,"onUpdate:modelValue":[t[11]||(t[11]=l=>o.value.find(d=>d.select==!0).b=l),t[12]||(t[12]=l=>ee(l,"b"))]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="HSL"?(e.openBlock(),e.createBlock(v,{key:4,label:"H",min:0,max:360,modelValue:I.h,"onUpdate:modelValue":[t[13]||(t[13]=l=>I.h=l),se]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="HSL"?(e.openBlock(),e.createBlock(v,{key:5,label:"S",min:0,max:100,modelValue:I.s,"onUpdate:modelValue":[t[14]||(t[14]=l=>I.s=l),se]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="HSL"?(e.openBlock(),e.createBlock(v,{key:6,label:"L",min:0,max:100,modelValue:I.l,"onUpdate:modelValue":[t[15]||(t[15]=l=>I.l=l),se]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="HSV"?(e.openBlock(),e.createBlock(v,{key:7,label:"H",min:0,max:360,modelValue:M.h,"onUpdate:modelValue":[t[16]||(t[16]=l=>M.h=l),ce]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="HSV"?(e.openBlock(),e.createBlock(v,{key:8,label:"S",min:0,max:100,modelValue:M.s,"onUpdate:modelValue":[t[17]||(t[17]=l=>M.s=l),ce]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="HSV"?(e.openBlock(),e.createBlock(v,{key:9,label:"V",min:0,max:100,modelValue:M.v,"onUpdate:modelValue":[t[18]||(t[18]=l=>M.v=l),ce]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="CMYK"?(e.openBlock(),e.createBlock(v,{key:10,label:"C",min:0,max:100,modelValue:$.c,"onUpdate:modelValue":[t[19]||(t[19]=l=>$.c=l),te]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="CMYK"?(e.openBlock(),e.createBlock(v,{key:11,label:"M",min:0,max:100,modelValue:$.m,"onUpdate:modelValue":[t[20]||(t[20]=l=>$.m=l),te]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="CMYK"?(e.openBlock(),e.createBlock(v,{key:12,label:"Y",min:0,max:100,modelValue:$.y,"onUpdate:modelValue":[t[21]||(t[21]=l=>$.y=l),te]},null,8,["modelValue"])):e.createCommentVNode("",!0),x.value=="CMYK"?(e.openBlock(),e.createBlock(v,{key:13,label:"K",min:0,max:100,modelValue:$.k,"onUpdate:modelValue":[t[22]||(t[22]=l=>$.k=l),te]},null,8,["modelValue"])):e.createCommentVNode("",!0),a.showAlpha?(e.openBlock(),e.createBlock(v,{key:14,label:"A",min:0,max:100,style:{"margin-right":"2px"},modelValue:o.value.find(l=>l.select==!0).a,"onUpdate:modelValue":[t[23]||(t[23]=l=>o.value.find(d=>d.select==!0).a=l),t[24]||(t[24]=l=>ee(l,"a"))]},null,8,["modelValue"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),a.showColorList?(e.openBlock(),e.createBlock(Et,{key:2,"color-list-count":a.colorListCount,"hex-val":P.value,onColorItemClick:Kt,iconClasses:a.iconClasses,title:a.local.colorPalette},null,8,["color-list-count","hex-val","iconClasses","title"])):e.createCommentVNode("",!0),a.showButtons?(e.openBlock(),e.createElementBlock("div",Ot,[e.createElementVNode("button",{class:"ck-cp-buttons__button ck-cp-buttons__button--save",type:"button",onClick:_t},e.toDisplayString(a.local.btnSaveLabel),1),e.createElementVNode("button",{class:"ck-cp-buttons__button ck-cp-buttons__button--cancel",type:"button",onClick:el},e.toDisplayString(a.local.btnCancelLabel),1)])):e.createCommentVNode("",!0)],10,It))}});X.Vue3ColorPicker=Yt,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})});